/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{G as e,S as t}from"../../../chunks/SimpleGeometryCursor.js";import{E as r,n as s}from"../../../chunks/MultiPathImpl.js";import{G as n,k as o}from"../../../chunks/Geometry.js";import{Envelope2D as m}from"../../../chunks/Envelope2D.js";import{c as u}from"../../../chunks/Envelope.js";import{p as i,at as l}from"../../../chunks/SpatialReference.js";class p{getOperatorType(){return 10008}accelerateGeometry(e,t,r){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,r,s){const n=(new i).executeMany(e,r,s);return new c(n,t,r,s)}}class c extends e{constructor(e,t,r,s){super(),this.m_resultPolygons=null,this.m_polygons=e,this.m_polylines=t,this.m_sr=r,this.m_progressTracker=s,this.m_bFirst=!0}tock(){return!0}getRank(){return 1}next(){return this.m_bFirst&&(this.performOperation(),this.m_bFirst=!1),this.m_resultPolygons?this.m_resultPolygons.next():null}getGeometryID(){return null!=this.m_resultPolygons?this.m_resultPolygons.getGeometryID():-1}performOperation(){const e=new m,t=new r;let i,p=s;for(;i=this.m_polylines.next();){if(i.getGeometryType()!==n.enumPolyline||i.isEmpty())continue;p===s?p=t.addGeometry(i):t.appendGeometry(p,i);const r=new m;i.queryEnvelope(r),e.mergeEnvelope2D(r)}if(0===t.getTotalPointCount())return;for(;i=this.m_polygons.next();){if(!o(i.getGeometryType())||i.isEmpty())continue;const r=new m;i.queryEnvelope(r),e.mergeEnvelope2D(r),t.addGeometry(i)}const c=u(this.m_sr,e,!0);this.m_resultPolygons=l(t,p,c,this.m_progressTracker)}}const a=new p;function y(e,r,s){const n=a.execute(new t(e),new t(r),s,null);return Array.from(n)}function h(){return a.supportsCurves()}export{y as execute,h as supportsCurves};
