/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.24/esri/copyright.txt for details. */ import{version as n}from"../../kernel.js";import{cloneGeometry as t,convertSquareUnitsToCode as r,convertLinearUnitsToCode as e}from"../kernel.js";import{H as i,p as o,j as l,h as u,l as a,n as s,A as c,y as f,C as g,K as m,J as w,L as h,f as d,g as p}from"../../chunks/languageUtils.js";import{centroidPolyline as A,centroidMultiPoint as y,getMetersPerVerticalUnitForSR as E,segmentLength3d as I}from"./centroid.js";import F from"../../geometry/Extent.js";import R from"../../geometry/Geometry.js";import{disjoint as x,intersects as b,touches as N,crosses as j,within as S,contains as k,overlaps as M,equals as O,relate as P,intersect as Z,union as z,difference as L,symmetricDifference as v,clip as C,cut as J,planarArea as U,geodesicArea as T,planarLength as W,geodesicLength as q,distance as G,densify as H,geodesicDensify as K,generalize as V,buffer as B,geodesicBuffer as D,offset as Q,rotate as X,simplify as Y,isSimple as $}from"../../geometry/geometryEngineAsync.js";import _ from"../../geometry/Multipoint.js";import nn from"../../geometry/Point.js";import tn from"../../geometry/Polygon.js";import rn from"../../geometry/Polyline.js";import{fromJSON as en}from"../../geometry/support/jsonUtils.js";import{getMetersPerUnitForSR as on}from"../../core/unitUtils.js";function ln(t){return 0===n.indexOf("4.")?tn.fromExtent(t):new tn({spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]})}function un(n){if(o(n,2,2),n[0]instanceof R&&n[1]instanceof R);else if(n[0]instanceof R&&null===n[1]);else if(n[1]instanceof R&&null===n[0]);else if(null!==n[0]||null!==n[1])throw new Error("Illegal Argument")}async function an(n,t){if("polygon"!==n.type&&"polyline"!==n.type&&"extent"!==n.type)return 0;let r=1;if(n.spatialReference.vcsWkid||n.spatialReference.latestVcsWkid){r=E(n.spatialReference)/on(n.spatialReference)}let e=0;if("polyline"===n.type)for(const o of n.paths)for(let n=1;n