/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../chunks/_rollupPluginBabelHelpers","../request","../core/queryUtils","../geometry/support/normalizeUtils","./networkService","./utils","./support/ServiceAreaSolveResult"],(function(e,r,t,i,a,s,o,l){"use strict";const n=i.createQueryParamsHelper({accumulateAttributes:{name:"accumulateAttributeNames"},attributeParameterValues:!0,defaultBreaks:!0,facilities:!0,outSpatialReference:{name:"outSR",getter:e=>e.outSpatialReference.wkid},pointBarriers:{name:"barriers"},polylineBarriers:!0,polygonBarriers:!0,restrictionAttributes:{name:"restrictionAttributeNames"},returnPointBarriers:{name:"returnBarriers"},travelMode:!0});function u(e,r,t){return c.apply(this,arguments)}function c(){return(c=r._asyncToGenerator((function*(e,r,i){const u=[],c=[],p={},f={},y=o.parseUrl(e),{path:m}=y;r.facilities&&r.facilities.features&&s.collectGeometries(r.facilities.features,c,"facilities.features",p),r.pointBarriers&&r.pointBarriers.features&&s.collectGeometries(r.pointBarriers.features,c,"pointBarriers.features",p),r.polylineBarriers&&r.polylineBarriers.features&&s.collectGeometries(r.polylineBarriers.features,c,"polylineBarriers.features",p),r.polygonBarriers&&r.polygonBarriers.features&&s.collectGeometries(r.polygonBarriers.features,c,"polygonBarriers.features",p);const B=yield a.normalizeCentralMeridian(c);for(const t in p){const e=p[t];u.push(t),f[t]=B.slice(e[0],e[1])}if(s.isInputGeometryZAware(f,u)){let e=null;try{e=yield s.fetchServiceDescription(m,r.apiKey,i)}catch{}e&&!e.hasZ&&s.dropZValuesOffInputGeometry(f,u)}for(const t in f)f[t].forEach(((e,i)=>{r.get(t)[i].geometry=e}));const d={...i,query:{...y.query,...n.toQueryParams(r),f:"json"}},{data:g}=yield t(`${m}/solveServiceArea`,d);return l.fromJSON(g)}))).apply(this,arguments)}e.solve=u,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
