/*
 COPYRIGHT 2009 ESRI

 TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
 Unpublished material - all rights reserved under the
 Copyright Laws of the United States and applicable international
 laws, treaties, and conventions.

 For additional information, contact:
 Environmental Systems Research Institute, Inc.
 Attn: Contracts and Legal Services Department
 380 New York Street
 Redlands, California, 92373
 USA

 email: contracts@esri.com
 */
//>>built
define("esri/tasks/ServiceAreaParameters",["dojo/_base/declare","dojo/_base/lang","dojo/_base/json","dojo/has","esri/kernel","esri/lang","esri/graphicsUtils"],function(_1,_2,_3,_4,_5,_6,_7){var _8=_1(null,{declaredClass:"esri.tasks.ServiceAreaParameters",accumulateAttributes:null,attributeParameterValues:null,defaultBreaks:null,doNotLocateOnRestrictedElements:true,excludeSourcesFromPolygons:null,facilities:null,impedanceAttribute:null,mergeSimilarPolygonRanges:false,outputGeometryPrecision:null,outputGeometryPrecisionUnits:null,outputLines:null,outputPolygons:null,outSpatialReference:null,overlapLines:false,overlapPolygons:false,pointBarriers:null,polygonBarriers:null,polylineBarriers:null,restrictionAttributes:null,restrictUTurns:null,returnFacilities:false,returnPointBarriers:false,returnPolylgonBarriers:false,returnPolylineBarriers:false,splitLinesAtBreaks:false,splitPolygonsAtBreaks:false,travelDirection:null,trimOuterPolygon:false,trimPolygonDistance:null,trimPolygonDistanceUnits:null,useHierarchy:null,timeOfDay:null,toJson:function(_9){var _a={returnFacilities:this.returnFacilities,returnBarriers:this.returnPointBarriers,returnPolygonBarriers:this.returnPolygonBarriers,returnPolylineBarriers:this.returnPolylineBarriers,mergeSimilarPolygonRanges:this.mergeSimilarPolygonRanges,overlapLines:this.overlapLines,overlapPolygons:this.overlapPolygons,splitLinesAtBreaks:this.splitLinesAtBreaks,splitPolygonsAtBreaks:this.splitPolygonsAtBreaks,trimOuterPolygon:this.trimOuterPolygon,accumulateAttributeNames:this.accumulateAttributes?this.accumulateAttributes.join(","):null,attributeParameterValues:this.attributeParameterValues&&_3.toJson(this.attributeParameterValues),defaultBreaks:this.defaultBreaks?this.defaultBreaks.join(","):null,excludeSourcesFromPolygons:this.excludeSourcesFromPolygons?this.excludeSourcesFromPolygons.join(","):null,impedanceAttributeName:this.impedanceAttribute,outputGeometryPrecision:this.outputGeometryPrecision,outputGeometryPrecisionUnits:this.outputGeometryPrecisionUnits,outputLines:this.outputLines,outputPolygons:this.outputPolygons,outSR:this.outSpatialReference?(this.outSpatialReference.wkid||_3.toJson(this.outSpatialReference.toJson())):null,restrictionAttributeNames:this.restrictionAttributes?this.restrictionAttributes.join(","):null,restrictUTurns:this.restrictUTurns,travelDirection:this.travelDirection,trimPolygonDistance:this.trimPolygonDistance,trimPolygonDistanceUnits:this.trimPolygonDistanceUnits,useHierarchy:this.useHierarchy,timeOfDay:this.timeOfDay&&this.timeOfDay.getTime()};var _b=this.facilities;if(_b.declaredClass==="esri.tasks.FeatureSet"&&_b.features.length>0){_a.facilities=_3.toJson({type:"features",features:_7._encodeGraphics(_b.features,_9&&_9["facilities.features"]),doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements});}else{if(_b.declaredClass==="esri.tasks.DataLayer"){_a.facilities=_b;}else{if(_b.declaredClass==="esri.tasks.DataFile"){_a.facilities=_3.toJson({type:"features",url:_b.url,doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements});}}}var _c=function(_d,_e){if(!_d){return null;}if(_d.declaredClass==="esri.tasks.FeatureSet"){if(_d.features.length>0){return _3.toJson({type:"features",features:_7._encodeGraphics(_d.features,_9&&_9[_e])});}else{return null;}}else{if(_d.declaredClass==="esri.tasks.DataLayer"){return _d;}else{if(_d.declaredClass==="esri.tasks.DataFile"){return _3.toJson({type:"features",url:_d.url});}}}return _3.toJson(_d);};if(this.pointBarriers){_a.barriers=_c(this.pointBarriers,"pointBarriers.features");}if(this.polygonBarriers){_a.polygonBarriers=_c(this.polygonBarriers,"polygonBarriers.features");}if(this.polylineBarriers){_a.polylineBarriers=_c(this.polylineBarriers,"polylineBarriers.features");}return _6.filter(_a,function(_f){if(_f!==null){return true;}});}});if(_4("extend-esri")){_2.setObject("tasks.ServiceAreaParameters",_8,_5);}return _8;});