!function(e){"object"==typeof module&&"object"==typeof module.exports?e(require,exports):"function"==typeof define&&define.amd&&define(["require","exports","tslib","./esriDelegate!esri/tasks/support/ServiceAreaParameters","../../Validation","./tools","./MapProvider","../../Hooks","esri/tasks/ServiceAreaTask"],e)}(function(e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var t=e("tslib"),a=e("./esriDelegate!esri/tasks/support/ServiceAreaParameters"),n=e("../../Validation"),s=e("./tools"),r=e("./MapProvider"),o=e("../../Hooks"),l=t.__importDefault(e("esri/tasks/ServiceAreaTask")),r=(u.prototype.execute=function(e,i,t){var r=n.validation.string("url",e.url,n.validation.never),o=new a.ServiceAreaParameters;o.facilities=n.validation.exists("facilities",e.facilities),o.accumulateAttributes=n.validation.array("accumulateAttributes",e.accumulateAttributes),o.attributeParameterValues=n.validation.exists("attributeParameterValues",e.attributeParameterValues,void 0),o.defaultBreaks=n.validation.exists("defaultBreaks",e.defaultBreaks,void 0),o.doNotLocateOnRestrictedElements=n.validation.boolean("doNotLocateOnRestrictedElements",e.doNotLocateOnRestrictedElements,void 0),o.excludeSourcesFromPolygons=n.validation.exists("excludeSourcesFromPolygons",e.excludeSourcesFromPolygons,void 0),o.impedanceAttribute=n.validation.string("impedanceAttribute",e.impedanceAttribute,void 0),o.impedanceAttribute||(o.impedanceAttribute=n.validation.string("impedenceAttribute",e.impedenceAttribute,void 0)),o.mergeSimilarPolygonRanges=n.validation.boolean("mergeSimilarPolygonRanges",e.mergeSimilarPolygonRanges,void 0),o.outputGeometryPrecision=n.validation.number("outputGeometryPrecision",e.outputGeometryPrecision,void 0),o.outputGeometryPrecisionUnits=n.validation.string("outputGeometryPrecisionUnits",e.outputGeometryPrecisionUnits,void 0),o.outputLines=n.validation.string("outputLines",e.outputLines,void 0),o.outputPolygons=n.validation.string("outputPolygons",e.outputPolygons,void 0),o.overlapLines=n.validation.boolean("overlapLines",e.overlapLines,void 0),o.overlapPolygons=n.validation.boolean("overlapPolygons",e.overlapPolygons,void 0),o.pointBarriers=n.validation.exists("pointBarriers",e.pointBarriers,void 0),o.polygonBarriers=n.validation.exists("polygonBarriers",e.polygonBarriers,void 0),o.polylineBarriers=n.validation.exists("polylineBarriers",e.polylineBarriers,void 0),o.restrictionAttributes=n.validation.exists("restrictionAttributes",e.restrictionAttributes,void 0),o.restrictUTurns=n.validation.string("restrictUTurns",e.restrictUTurns,void 0),o.returnFacilities=n.validation.boolean("returnFacilities",e.returnFacilities,void 0),o.returnPointBarriers=n.validation.boolean("returnPointBarriers",e.returnPointBarriers,void 0),o.returnPolygonBarriers=n.validation.boolean("returnPolygonBarriers",e.returnPolygonBarriers,void 0),o.returnPolylineBarriers=n.validation.boolean("returnPolylineBarriers",e.returnPolylineBarriers,void 0),o.splitLinesAtBreaks=n.validation.boolean("splitLinesAtBreaks",e.splitLinesAtBreaks,void 0),o.splitPolygonsAtBreaks=n.validation.boolean("splitPolygonsAtBreaks",e.splitPolygonsAtBreaks,void 0),o.timeOfDay=n.validation.exists("timeOfDay",e.timeOfDay,void 0),o.travelDirection=n.validation.string("travelDirection",e.travelDirection,void 0),o.trimOuterPolygon=n.validation.boolean("trimOuterPolygon",e.trimOuterPolygon,void 0),o.trimPolygonDistance=n.validation.number("trimPolygonDistance",e.trimPolygonDistance,void 0),o.trimPolygonDistanceUnits=n.validation.string("trimPolygonDistanceUnits",e.trimPolygonDistanceUnits,void 0),o.useHierarchy=n.validation.boolean("useHierarchy",e.useHierarchy,void 0);e=n.validation.exists("outSpatialReference",e.outSpatialReference,void 0);o.outSpatialReference=t.getOutSR(e);e=new l.default(r),r=s.isAbortable(i.cancellationToken)?{signal:i.cancellationToken.signal}:void 0,r=e.solve(o,r);return s.schedulePromiseCancellation(i,r),s.inline(r,function(e){return{facilities:e.facilities,messages:e.messages,pointBarriers:e.pointBarriers,polygonBarriers:e.polygonBarriers,polylineBarriers:e.polylineBarriers,serviceAreaPolygons:e.serviceAreaPolygons,serviceAreaPolylines:e.serviceAreaPolylines}})},u.action="gcx:wf:arcgis::ServiceAreaTask",u.suite="gcx:wf:builtin",t.__decorate([o.activate(r.MapProvider)],u));function u(){}i.ServiceAreaTask=r});