/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{S as e}from"../../../chunks/SimpleGeometryCursor.js";import{G as r}from"../../../chunks/GeometryCursor.js";import{a as t,d as n,c as s}from"../../../chunks/Geometry.js";import{t as i}from"../../../chunks/SpatialReference.js";import{Envelope2D as u}from"../../../chunks/Envelope2D.js";import{B as m}from"../../../chunks/Bufferer-CclWhXVb.js";class o{getOperatorType(){return 10004}supportsCurves(){return!0}accelerateGeometry(e,r,t){return!1}canAccelerateGeometry(e){return!1}executeMany(e,r,t,n,s){return this.executeManyEx(e,r,t,Number.NaN,96,n,s)}execute(r,s,i,u){Number.isFinite(i)||t("Invalid distance for buffer operation");const m=new e([r]),o=[i],a=this.executeMany(m,s,o,!1,u).next();return a||n("null buffer output"),a}executeManyEx(e,r,n,s,u,m,o){if(void 0!==n.find(e=>!Number.isFinite(e))&&t("Invalid distance for buffer operation"),m){const t=new a(e,r,n,s,u,!1,o);return(new i).executeMany(t,r,o,2)}return new a(e,r,n,s,u,!1,o)}}class a extends r{m_inputGeoms;m_spatialReference;m_progressTracker;m_bufferer;m_distances;m_maxDeviation;m_maxVerticesInFullCircle;m_currentUnionEnvelope2D=new u;m_index=-1;m_dindex=-1;constructor(e,r,t,n,s,i,u){super(),this.m_progressTracker=u,this.m_bufferer=new m(u),this.m_inputGeoms=e,this.m_spatialReference=r,this.m_distances=t,this.m_maxDeviation=n,this.m_maxVerticesInFullCircle=s}tock(){return!0}getRank(){return 1}next(){{let e;for(;e=this.m_inputGeoms.next();)return s(e),this.m_index=this.m_inputGeoms.getGeometryID(),this.m_dindex+1<this.m_distances.length&&this.m_dindex++,this.buffer(e,this.m_distances[this.m_dindex]);return null}}getGeometryID(){return this.m_index}buffer(e,r){return this.m_bufferer.buffer(e,r,this.m_spatialReference,0,0,4,this.m_maxDeviation,this.m_maxVerticesInFullCircle)}}const c=new o;function f(e,r,t){return c.execute(e,r,t,null)}function l(r,t,n,s){const i=c.executeMany(new e(r),t,n,s,null);return Array.from(i)}function h(r,t,n,s,i,u){const m=c.executeManyEx(new e(r),t,n,s,i,u,null);return Array.from(m)}function p(){return c.supportsCurves()}export{f as execute,l as executeMany,h as executeManyEx,p as supportsCurves};
