// 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/ParcelDrafter/PlanSettings.html":'\x3cdiv\x3e\r\n    \x3c!-- Direction or Angle Type Selector --\x3e\r\n    \x3cdiv class\x3d"esriCTFullWidth esriCTPlanSettingRow"\x3e\r\n        \x3cdiv class\x3d"esriCTDropdownLabel esriCTEllipsis" title\x3d"${nls.planSettings.directionOrAngleTypeLabel}"\r\n        data-a11y-label-id\x3d"directionOrAngleTypeLabel"\x3e\r\n            ${nls.planSettings.directionOrAngleTypeLabel}\x3c/div\x3e\r\n        \x3cselect data-dojo-attach-point\x3d"directionOrAngleType" style\x3d"width: 100%" data-dojo-type\x3d"jimu/dijit/formSelect"\r\n        data-a11y-label-by\x3d"directionOrAngleTypeLabel"\x3e\r\n        \x3c/select\x3e\r\n    \x3c/div\x3e\r\n    \x3c!-- Direction or Angle Units Selector --\x3e\r\n    \x3cdiv class\x3d"esriCTFullWidth esriCTPlanSettingRow"\x3e\r\n        \x3cdiv class\x3d"esriCTDropdownLabel esriCTEllipsis" title\x3d"${nls.planSettings.directionOrAngleUnitsLabel}"\r\n        data-a11y-label-id\x3d"directionOrAngleUnitsLabel"\x3e\r\n            ${nls.planSettings.directionOrAngleUnitsLabel}\x3c/div\x3e\r\n        \x3cselect data-dojo-attach-point\x3d"directionOrAngleUnits" style\x3d"width: 100%" data-dojo-type\x3d"jimu/dijit/formSelect"\r\n        data-a11y-label-by\x3d"directionOrAngleUnitsLabel"\x3e\r\n        \x3c/select\x3e\r\n    \x3c/div\x3e\r\n    \x3c!-- Distance and Length Units Selector --\x3e\r\n    \x3cdiv class\x3d"esriCTFullWidth esriCTPlanSettingRow"\x3e\r\n        \x3cdiv class\x3d"esriCTDropdownLabel esriCTEllipsis" title\x3d"${nls.planSettings.distanceAndLengthUnitsLabel}"\r\n        data-a11y-label-id\x3d"distanceAndLengthUnitsLabel"\x3e\r\n            ${nls.planSettings.distanceAndLengthUnitsLabel}\x3c/div\x3e\r\n        \x3cselect data-dojo-attach-point\x3d"distanceAndLengthUnits" style\x3d"width: 100%" data-dojo-type\x3d"jimu/dijit/formSelect"\r\n        data-a11y-label-by\x3d"distanceAndLengthUnitsLabel"\x3e\r\n        \x3c/select\x3e\r\n    \x3c/div\x3e\r\n    \x3c!-- Area Units Selector--\x3e\r\n    \x3cdiv class\x3d"esriCTFullWidth esriCTPlanSettingRow"\x3e\r\n        \x3cdiv class\x3d"esriCTDropdownLabel esriCTEllipsis" title\x3d"${nls.planSettings.areaUnitsLabel}"\r\n        data-a11y-label-id\x3d"areaUnitsLabel"\x3e\r\n            ${nls.planSettings.areaUnitsLabel}\x3c/div\x3e\r\n        \x3cselect data-dojo-attach-point\x3d"areaUnits" style\x3d"width: 100%" data-dojo-type\x3d"jimu/dijit/formSelect"\r\n        data-a11y-label-by\x3d"areaUnitsLabel"\x3e\r\n        \x3c/select\x3e\r\n    \x3c/div\x3e\r\n    \x3c!-- Circular Curve Parameters Selector --\x3e\r\n    \x3cdiv class\x3d"esriCTFullWidth esriCTPlanSettingRow"\x3e\r\n        \x3cdiv class\x3d"esriCTDropdownLabel esriCTEllipsis " title\x3d"${nls.planSettings.circularCurveParameters}"\r\n        data-a11y-label-id\x3d"circularCurveParameters"\x3e\r\n            ${nls.planSettings.circularCurveParameters}\x3c/div\x3e\r\n        \x3cselect data-dojo-attach-point\x3d"circularCurveParameters" style\x3d"width: 100%" data-dojo-type\x3d"jimu/dijit/formSelect"\r\n        data-a11y-label-by\x3d"circularCurveParameters"\x3e\r\n        \x3c/select\x3e\r\n    \x3c/div\x3e\r\n\x3c/div\x3e'}});
define("dojo/_base/declare dojo/_base/array jimu/BaseWidget dijit/_WidgetsInTemplateMixin dojo/text!./PlanSettings.html dojo/_base/lang dojo/Evented dojo/dom-class dojo/query ./utils jimu/utils libs/storejs/store jimu/dijit/formSelect".split(" "),function(p,q,r,t,u,c,v,f,h,k,l,m){return p([r,t,v],{baseClass:"jimu-widget-ParcelDrafter-PlanSettings",templateString:u,selectedPlanSettings:{},planSettingsOptions:c.clone(k.planSettingsOptions),planSettingsKey:null,constructor:function(a){c.mixin(this,a)},
startup:function(){var a=this._retriveFromLocalCache();a||(a={areaUnits:this.planSettingsOptions.areaUnits[1],circularCurveParameters:this.planSettingsOptions.circularCurveParameters[0],directionOrAngleType:this.planSettingsOptions.directionOrAngleType[0],directionOrAngleUnits:this.planSettingsOptions.directionOrAngleUnits[0],distanceAndLengthUnits:this.planSettingsOptions.distanceAndLengthUnits[1]});this._loadOptionsForDropDown(this.directionOrAngleType,this.planSettingsOptions.directionOrAngleType,
a.directionOrAngleType);this._loadOptionsForDropDown(this.directionOrAngleUnits,this.planSettingsOptions.directionOrAngleUnits,a.directionOrAngleUnits);this._loadOptionsForDropDown(this.distanceAndLengthUnits,this.planSettingsOptions.distanceAndLengthUnits,a.distanceAndLengthUnits);this._loadOptionsForDropDown(this.areaUnits,this.planSettingsOptions.areaUnits,a.areaUnits);this._loadOptionsForDropDown(this.circularCurveParameters,this.planSettingsOptions.circularCurveParameters,a.circularCurveParameters);
this.onPlansettingsChanged()},postCreate:function(){this.inherited(arguments);this.planSettingsKey=this.getKey();this.selectedPlanSettings={};this.planSettingsOptions=c.clone(k.planSettingsOptions);f.add(this.domNode,"esriCTPlanSettingsContainer esriCTFullWidth");setTimeout(c.hitch(this,this._setBackgroundColorForDartTheme),500)},postMixInProperties:function(){this.inherited(arguments);this.isRenderIdForAttrs=!0},_setBackgroundColorForDartTheme:function(){var a;if("DartTheme"===this.appConfig.theme.name){var b=
h(".dijitSelect .dijitButtonContents",this.planSettingsNode);var d=h(".dijitSelect .dijitArrowButton",this.planSettingsNode);for(a=0;a<b.length&&a<d.length;a++)f.add(b[a],"dijitButtonContentsDartTheme"),f.add(d[a],"dijitArrowButtonDartTheme")}},_loadOptionsForDropDown:function(a,b,d){var n=[],g;q.forEach(b,c.hitch(this,function(e){g={value:e,label:this.nls.planSettings[e]||window.jimuNls.units[e]};d===e&&(g.selected=!0);n.push(g)}));a.addOption(n)},_isSettingsChanged:function(){var a=!1;this.selectedPlanSettings.directionOrAngleType!==
this.directionOrAngleType.get("value")?a=!0:this.selectedPlanSettings.directionOrAngleUnits!==this.directionOrAngleUnits.get("value")?a=!0:this.selectedPlanSettings.distanceAndLengthUnits!==this.distanceAndLengthUnits.get("value")?a=!0:this.selectedPlanSettings.areaUnits!==this.areaUnits.get("value")?a=!0:this.selectedPlanSettings.circularCurveParameters!==this.circularCurveParameters.get("value")&&(a=!0);return a},onClose:function(){if(this._isSettingsChanged())this.onPlansettingsChanged()},onPlansettingsChanged:function(){this.selectedPlanSettings=
{directionOrAngleType:this.directionOrAngleType.get("value"),directionOrAngleUnits:this.directionOrAngleUnits.get("value"),distanceAndLengthUnits:this.distanceAndLengthUnits.get("value"),areaUnits:this.areaUnits.get("value"),circularCurveParameters:this.circularCurveParameters.get("value")};this._saveToLocalCache(this.selectedPlanSettings);this.emit("planSettingsChanged",this.selectedPlanSettings)},_saveToLocalCache:function(a){try{m.set(this.planSettingsKey,a)}catch(b){console.log("ParcelDrafter: Error in storeing settings to local cache.")}},
_retriveFromLocalCache:function(){var a=null;try{a=m.get(this.planSettingsKey)}catch(b){console.log("ParcelDrafter: Error in retriving settings from local cache.")}return a},getKey:function(){return"ParcelDrafterPlanSettings."+encodeURIComponent(l.getAppIdFromUrl())+"."+this.widgetId},updateLastNodeInPlanSetting:function(){l.initLastFocusNode(this.widgetDomNode,this.circularCurveParameters.domNode)}})});