@arcgis/core 4.32.0-next.20250102 → 4.32.0-next.20250103

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/Color.js +1 -1
  2. package/PopupTemplate.js +1 -1
  3. package/arcade/functions/date.js +1 -1
  4. package/arcade/functions/featuresetbase.js +1 -1
  5. package/arcade/functions/featuresetstats.js +1 -1
  6. package/arcade/functions/featuresetstring.js +1 -1
  7. package/arcade/functions/geomasync.js +1 -1
  8. package/arcade/functions/geometry.js +1 -1
  9. package/arcade/functions/geomsync.js +1 -1
  10. package/arcade/functions/knowledgegraph.js +1 -1
  11. package/arcade/functions/string.js +1 -1
  12. package/arcade/geometry/extendedUnitData.js +5 -0
  13. package/arcade/geometry/functions.js +5 -0
  14. package/arcade/geometry/operators.js +5 -0
  15. package/arcade/geometry/unitConversion.js +5 -0
  16. package/arcade/geometry/wkt.js +5 -0
  17. package/arcade/languageUtils.js +1 -1
  18. package/assets/esri/core/workers/RemoteClient.js +1 -1
  19. package/assets/esri/core/workers/chunks/{e371f4f0eb3c22f222df.js → 005727711cca0614c2ab.js} +2 -2
  20. package/assets/esri/core/workers/chunks/{e371f4f0eb3c22f222df.js.LICENSE.txt → 005727711cca0614c2ab.js.LICENSE.txt} +1 -1
  21. package/assets/esri/core/workers/chunks/{2d908c115ea18e813b95.js → 00c0fbe19c12691cf2c3.js} +1 -1
  22. package/assets/esri/core/workers/chunks/08e28328385066c519c2.js +1 -0
  23. package/assets/esri/core/workers/chunks/{0e735d01296d340b393e.js → 0b95ec12218f3c04df18.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{59bf879b4802a5ba431e.js → 0ee669947c23f469e357.js} +1 -1
  25. package/assets/esri/core/workers/chunks/116103ecec27cce47a2f.js +1 -0
  26. package/assets/esri/core/workers/chunks/11f00218905f0db447ff.js +1 -0
  27. package/assets/esri/core/workers/chunks/14b87f3dd9942e6b19d0.js +1 -0
  28. package/assets/esri/core/workers/chunks/16d7c07e1c11b88dae84.js +1 -0
  29. package/assets/esri/core/workers/chunks/1d04fe800cb98e4d6bc4.js +1 -0
  30. package/assets/esri/core/workers/chunks/{71f6e5742cf0c482066b.js → 1dc6b5b177022b80c473.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{59455e2dd44b4c01cc76.js → 2586741c359057b3f626.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{250a810dd4e1ff293564.js → 318a39b56851e707edad.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{b1e4813f0c73fc2a483c.js → 370b230fd2d7703d0698.js} +2 -2
  34. package/assets/esri/core/workers/chunks/{b1e4813f0c73fc2a483c.js.LICENSE.txt → 370b230fd2d7703d0698.js.LICENSE.txt} +1 -1
  35. package/assets/esri/core/workers/chunks/38d03fe352057fb375b5.js +1 -0
  36. package/assets/esri/core/workers/chunks/{ebf9caf2dc8af89afec2.js → 42aa697b4718b75b8cb2.js} +2 -2
  37. package/assets/esri/core/workers/chunks/{ebf9caf2dc8af89afec2.js.LICENSE.txt → 42aa697b4718b75b8cb2.js.LICENSE.txt} +1 -1
  38. package/assets/esri/core/workers/chunks/{801dbea20966806db1c9.js → 53cd990b2c988518de6d.js} +1 -1
  39. package/assets/esri/core/workers/chunks/5a1eb0d1e25ff5574c43.js +1 -0
  40. package/assets/esri/core/workers/chunks/6157c49e7431f5868c77.js +1 -0
  41. package/assets/esri/core/workers/chunks/{eef2d94a73064f9bc085.js → 61d64f163840563017d5.js} +1 -1
  42. package/assets/esri/core/workers/chunks/6d218fb5e0f0a04d72c5.js +2 -0
  43. package/assets/esri/core/workers/chunks/{d82b3e2905cab511ff3a.js.LICENSE.txt → 6d218fb5e0f0a04d72c5.js.LICENSE.txt} +1 -1
  44. package/assets/esri/core/workers/chunks/6ed57d01be6bc054c7cd.js +1 -0
  45. package/assets/esri/core/workers/chunks/7254956381e823219db0.js +1 -0
  46. package/assets/esri/core/workers/chunks/740e6bdb3b76f2ea6d61.js +1 -0
  47. package/assets/esri/core/workers/chunks/756c2f7c8659deab6c96.js.LICENSE.txt +1 -1
  48. package/assets/esri/core/workers/chunks/{56fc353421252f2d0a99.js → 75e8ba7e02647b7216ae.js} +1 -1
  49. package/assets/esri/core/workers/chunks/89d7eec47e5b29935d92.js +1 -0
  50. package/assets/esri/core/workers/chunks/8cd2c9ec1e541836b81c.js +1 -0
  51. package/assets/esri/core/workers/chunks/{0b3e1e903120da297641.js → 932375de79e3d33bc4d7.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{263adfd1c2641ef5c0f5.js → 95f23bd17ce9e07fc8ef.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{7de9c01849c4aa1940e7.js → 986889cea53c4a470347.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{cc6160e8ab3cea4040c2.js → 9e9b2fd958e816b1b5f6.js} +1 -1
  55. package/assets/esri/core/workers/chunks/a57cead317eb2fc9afd8.js +1 -0
  56. package/assets/esri/core/workers/chunks/acec58a7f23b2cc938ee.js +1 -0
  57. package/assets/esri/core/workers/chunks/b0f4254d8a32dd713009.js +1 -0
  58. package/assets/esri/core/workers/chunks/b277b8c2f556918e4f9a.js +1 -0
  59. package/assets/esri/core/workers/chunks/{deffd56e39ce725ce377.js → b30046a40bcfbec8abe4.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{5c11e2e65b97565e5003.js → b7db64b07edb0b37ece1.js} +1 -1
  61. package/assets/esri/core/workers/chunks/bd1fb82e8bac439d05ea.js +1 -0
  62. package/assets/esri/core/workers/chunks/bf0a0ca7fdac98f06a89.js.LICENSE.txt +1 -1
  63. package/assets/esri/core/workers/chunks/c44ce0302dc82fb66ada.js +1 -0
  64. package/assets/esri/core/workers/chunks/c52872a50a5989121388.js +1 -0
  65. package/assets/esri/core/workers/chunks/c8cd6ba5600d8ff8db0b.js +2 -0
  66. package/assets/esri/core/workers/chunks/{a100fb789d72410f8d4f.js.LICENSE.txt → c8cd6ba5600d8ff8db0b.js.LICENSE.txt} +1 -1
  67. package/assets/esri/core/workers/chunks/{57c1370b310768c0790a.js → ca1e186f136abb23ae4b.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{d14e4fc82ad772899336.js → ca4a37bdc0f7fb705146.js} +1 -1
  69. package/assets/esri/core/workers/chunks/cb94fc9b0f613ad50b3f.js +1 -0
  70. package/assets/esri/core/workers/chunks/d20764cc99fcabcb7cbf.js +1 -0
  71. package/assets/esri/core/workers/chunks/df18a72e3625cbe31935.js +1 -0
  72. package/assets/esri/core/workers/chunks/eff8fcb6393cd1193cbc.js +1 -0
  73. package/assets/esri/core/workers/chunks/f19d3c855f6e93544918.js +1 -0
  74. package/assets/esri/core/workers/chunks/{60b40b2319d1651dd150.js → f7e50a8284d12da21355.js} +1 -1
  75. package/assets/esri/core/workers/chunks/f9c0d571f62e611ffe2b.js +1 -0
  76. package/assets/esri/core/workers/chunks/fdfe8e0d942b78f08191.js +1 -0
  77. package/assets/esri/core/workers/chunks/ff21207f46a354786eed.js +1 -0
  78. package/chunks/Bufferer-BiY2mtjI.js +1 -1
  79. package/chunks/Centroid-DZi-eb9F.js +1 -1
  80. package/chunks/Clipper-a9xfvRaw.js +1 -1
  81. package/chunks/CrackAndCluster-CfzXpEle.js +1 -1
  82. package/chunks/Distance2DCalculator-eS0piaux.js +1 -1
  83. package/chunks/GeodeticDistanceCalculator-bNilDneE.js +1 -1
  84. package/chunks/Geometry.js +1 -1
  85. package/chunks/GeometryCleaner-DVgW95-D.js +1 -1
  86. package/chunks/Intersector-K1VmdfQW.js +1 -1
  87. package/chunks/LineSeries.js +1 -1
  88. package/chunks/OperatorClip.js +1 -1
  89. package/chunks/OperatorCrosses.js +1 -1
  90. package/chunks/OperatorCut.js +1 -1
  91. package/chunks/OperatorDensify.js +1 -1
  92. package/chunks/OperatorDifference.js +1 -1
  93. package/chunks/OperatorGeneralize.js +1 -1
  94. package/chunks/OperatorGeodesicBuffer.js +1 -1
  95. package/chunks/OperatorGeodeticArea.js +1 -1
  96. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  97. package/chunks/OperatorGeodeticDistance.js +1 -1
  98. package/chunks/OperatorGeodeticLength.js +1 -1
  99. package/chunks/OperatorIntersection.js +1 -1
  100. package/chunks/OperatorIntersects.js +1 -1
  101. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  102. package/chunks/OperatorOverlaps.js +1 -1
  103. package/chunks/OperatorProject.js +1 -1
  104. package/chunks/OperatorProximity.js +1 -1
  105. package/chunks/OperatorProximityGeodesic.js +1 -1
  106. package/chunks/OperatorShapePreservingDensify.js +1 -1
  107. package/chunks/OperatorShapePreservingLength.js +1 -1
  108. package/chunks/OperatorSimplify.js +1 -1
  109. package/chunks/OperatorTouches.js +1 -1
  110. package/chunks/OperatorUnion.js +1 -1
  111. package/chunks/OperatorWithin.js +1 -1
  112. package/chunks/QuadraticBezier.js +1 -1
  113. package/chunks/SideCalculator2D-Bf4QCxCR.js +1 -1
  114. package/chunks/Theme.js +1 -1
  115. package/chunks/Tick.js +1 -1
  116. package/chunks/Transformation2D.js +1 -1
  117. package/chunks/arcade.js +1 -1
  118. package/chunks/areaOperator.js +5 -0
  119. package/chunks/array.js +1 -1
  120. package/chunks/bufferOperator.js +5 -0
  121. package/chunks/centroidOperator.js +5 -0
  122. package/chunks/chartUtilsAm5.js +1 -1
  123. package/chunks/clipOperator.js +5 -0
  124. package/chunks/containsOperator.js +5 -0
  125. package/chunks/convexHullOperator.js +5 -0
  126. package/chunks/crossesOperator.js +5 -0
  127. package/chunks/cutOperator.js +5 -0
  128. package/chunks/densifyOperator.js +5 -0
  129. package/chunks/differenceOperator.js +5 -0
  130. package/chunks/disjointOperator.js +5 -0
  131. package/chunks/distanceOperator.js +5 -0
  132. package/chunks/equalsOperator.js +5 -0
  133. package/chunks/generalizeOperator.js +5 -0
  134. package/chunks/geodesicBufferOperator.js +5 -0
  135. package/chunks/geodeticAreaOperator.js +5 -0
  136. package/chunks/geodeticDensifyOperator.js +5 -0
  137. package/chunks/geodeticLengthOperator.js +5 -0
  138. package/chunks/i3s.js +1 -1
  139. package/chunks/intersectionOperator.js +5 -0
  140. package/chunks/intersectsOperator.js +5 -0
  141. package/chunks/languageUtils.js +1 -1
  142. package/chunks/lclayout.js +1 -1
  143. package/chunks/lengthOperator.js +5 -0
  144. package/chunks/lyr3DMain.js +1 -1
  145. package/chunks/lyr3DWorker.js +1 -1
  146. package/chunks/offsetOperator.js +5 -0
  147. package/chunks/overlapsOperator.js +5 -0
  148. package/chunks/pe-wasm.js +1 -1
  149. package/chunks/proximityOperator.js +5 -0
  150. package/chunks/relateOperator.js +5 -0
  151. package/chunks/simplifyOperator.js +5 -0
  152. package/chunks/symmetricDifferenceOperator.js +5 -0
  153. package/chunks/touchesOperator.js +5 -0
  154. package/chunks/unionOperator.js +5 -0
  155. package/chunks/vxlLayer.js +1 -1
  156. package/chunks/withinOperator.js +5 -0
  157. package/copyright.txt +2 -2
  158. package/core/Evented.js +1 -1
  159. package/geometry/operators/areaOperator.js +1 -1
  160. package/geometry/operators/bufferOperator.js +1 -1
  161. package/geometry/operators/centroidOperator.js +1 -1
  162. package/geometry/operators/clipOperator.js +1 -1
  163. package/geometry/operators/containsOperator.js +1 -1
  164. package/geometry/operators/convexHullOperator.js +1 -1
  165. package/geometry/operators/crossesOperator.js +1 -1
  166. package/geometry/operators/cutOperator.js +1 -1
  167. package/geometry/operators/densifyOperator.js +1 -1
  168. package/geometry/operators/differenceOperator.js +1 -1
  169. package/geometry/operators/disjointOperator.js +1 -1
  170. package/geometry/operators/distanceOperator.js +1 -1
  171. package/geometry/operators/equalsOperator.js +1 -1
  172. package/geometry/operators/extendOperator.js +1 -1
  173. package/geometry/operators/generalizeOperator.js +1 -1
  174. package/geometry/operators/geodesicBufferOperator.js +1 -1
  175. package/geometry/operators/geodeticAreaOperator.js +1 -1
  176. package/geometry/operators/geodeticDensifyOperator.js +1 -1
  177. package/geometry/operators/geodeticLengthOperator.js +1 -1
  178. package/geometry/operators/gx/operatorAffineTransform.js +1 -1
  179. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  180. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  181. package/geometry/operators/gx/operatorBoundary.js +1 -1
  182. package/geometry/operators/gx/operatorBuffer.js +1 -1
  183. package/geometry/operators/gx/operatorConvexHull.js +1 -1
  184. package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
  185. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  186. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  187. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  188. package/geometry/operators/gx/operatorLocateBetween.js +1 -1
  189. package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
  190. package/geometry/operators/gx/operatorOffset.js +1 -1
  191. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  192. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  193. package/geometry/operators/gx/operatorSinglePartToMultiPart.js +1 -1
  194. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  195. package/geometry/operators/intersectionOperator.js +1 -1
  196. package/geometry/operators/intersectsOperator.js +1 -1
  197. package/geometry/operators/isNearOperator.js +1 -1
  198. package/geometry/operators/json/disjointOperator.js +1 -1
  199. package/geometry/operators/lengthOperator.js +1 -1
  200. package/geometry/operators/offsetOperator.js +1 -1
  201. package/geometry/operators/overlapsOperator.js +1 -1
  202. package/geometry/operators/proximityOperator.js +1 -1
  203. package/geometry/operators/relateOperator.js +1 -1
  204. package/geometry/operators/reshapeOperator.js +1 -1
  205. package/geometry/operators/simplifyOperator.js +1 -1
  206. package/geometry/operators/support/apiConverter.js +1 -1
  207. package/geometry/operators/support/jsonConverter.js +1 -1
  208. package/geometry/operators/symmetricDifferenceOperator.js +1 -1
  209. package/geometry/operators/touchesOperator.js +1 -1
  210. package/geometry/operators/unionOperator.js +1 -1
  211. package/geometry/operators/withinOperator.js +1 -1
  212. package/geometry/support/contains.js +1 -1
  213. package/kernel.js +1 -1
  214. package/layers/KMLLayer.js +1 -1
  215. package/layers/WCSLayer.js +1 -1
  216. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  217. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  218. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  219. package/layers/support/wmtsUtils.js +1 -1
  220. package/package.json +3 -3
  221. package/smartMapping/renderers/support/utils.js +1 -1
  222. package/smartMapping/symbology/support/Theme.js +1 -1
  223. package/support/revision.js +1 -1
  224. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  225. package/views/3d/support/DisplayQualityProfile.js +1 -1
  226. package/views/3d/webgl-engine/core/shaderModules/interfaces.js +1 -1
  227. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  228. package/views/SelectionManager.js +1 -1
  229. package/widgets/BatchAttributeForm.js +1 -1
  230. package/widgets/Feature/support/featureUtils.js +1 -1
  231. package/widgets/Legend/support/heatmapRampUtils.js +1 -1
  232. package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
  233. package/widgets/OrientedImageryViewer.js +1 -1
  234. package/assets/esri/core/workers/chunks/015285436ca965f94e17.js +0 -1
  235. package/assets/esri/core/workers/chunks/048d296efa26ccd79056.js +0 -1
  236. package/assets/esri/core/workers/chunks/0e0b978459d70b15acb5.js +0 -1
  237. package/assets/esri/core/workers/chunks/10fa211987b16fd71a1a.js +0 -1
  238. package/assets/esri/core/workers/chunks/200a5f1864c2c2f7536c.js +0 -1
  239. package/assets/esri/core/workers/chunks/23a697d48f6e45cc033e.js +0 -1
  240. package/assets/esri/core/workers/chunks/29b610ff44708e044cbd.js +0 -1
  241. package/assets/esri/core/workers/chunks/3600125c58d5d04c515a.js +0 -1
  242. package/assets/esri/core/workers/chunks/457d4abc938d14f28e31.js +0 -1
  243. package/assets/esri/core/workers/chunks/4b5dbdcad438cb2dd4bf.js +0 -1
  244. package/assets/esri/core/workers/chunks/69efc716991a407c3d23.js +0 -1
  245. package/assets/esri/core/workers/chunks/6e254e846e284223ef63.js +0 -1
  246. package/assets/esri/core/workers/chunks/785610aa615198fd3815.js +0 -1
  247. package/assets/esri/core/workers/chunks/7bf7aace72f81f5de4e4.js +0 -1
  248. package/assets/esri/core/workers/chunks/7ea3d652536e1d79dfc6.js +0 -1
  249. package/assets/esri/core/workers/chunks/816c9c81352cd0ca8ce8.js +0 -1
  250. package/assets/esri/core/workers/chunks/9291508232b23f030178.js +0 -1
  251. package/assets/esri/core/workers/chunks/9fc49968dea8e2b64f3e.js +0 -1
  252. package/assets/esri/core/workers/chunks/a0b3d70a1b0360084593.js +0 -1
  253. package/assets/esri/core/workers/chunks/a100fb789d72410f8d4f.js +0 -2
  254. package/assets/esri/core/workers/chunks/b4d76d46661aba356ea3.js +0 -1
  255. package/assets/esri/core/workers/chunks/cb3af81e1fe6405c4885.js +0 -1
  256. package/assets/esri/core/workers/chunks/cbf57abb537e86c1dd7f.js +0 -1
  257. package/assets/esri/core/workers/chunks/cebdf2f88c4d2ad8baab.js +0 -1
  258. package/assets/esri/core/workers/chunks/d56d77125798beb7e493.js +0 -1
  259. package/assets/esri/core/workers/chunks/d82b3e2905cab511ff3a.js +0 -2
  260. package/assets/esri/core/workers/chunks/e2f91098793b8742fae6.js +0 -1
  261. package/assets/esri/core/workers/chunks/f25c04cf1a4bc1d2636a.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{G as e}from"./SimpleGeometryCursor.js";import{t as r,b as t}from"./Geometry.js";import{c as s}from"./QuadraticBezier.js";import{c as o,a as m}from"./Clipper-a9xfvRaw.js";class n{getOperatorType(){return 10004}supportsCurves(){return!0}accelerateGeometry(e,r,t){return!1}canAccelerateGeometry(e){return!1}executeMany(e,r,t,s){return new a(e,r,t,s)}execute(e,r,t,s){return i(e,r,t,s)}}class a extends e{constructor(e,t,o,m){super(),this.m_progressTracker=m,this.m_index=-1,e||r(""),this.m_envelope=t,this.m_inputGeometryCursor=e,this.m_spatialRefImpl=o,this.m_tolerance=s(o,t,!1).total()}next(){let e;return(e=this.m_inputGeometryCursor.next())?(t(e),this.m_index=this.m_inputGeometryCursor.getGeometryID(),o(e,this.m_envelope,this.m_tolerance,0,this.m_progressTracker)):null}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}}function i(e,r,t,s){return m(e,r,t,Number.NaN,0,s)}export{n as O};
5
+ import{G as e}from"./SimpleGeometryCursor.js";import{t as r,c as t}from"./Geometry.js";import{b as s}from"./QuadraticBezier.js";import{c as o,a as m}from"./Clipper-a9xfvRaw.js";class n{getOperatorType(){return 10004}supportsCurves(){return!0}accelerateGeometry(e,r,t){return!1}canAccelerateGeometry(e){return!1}executeMany(e,r,t,s){return new a(e,r,t,s)}execute(e,r,t,s){return i(e,r,t,s)}}class a extends e{constructor(e,t,o,m){super(),this.m_progressTracker=m,this.m_index=-1,e||r(""),this.m_envelope=t,this.m_inputGeometryCursor=e,this.m_spatialRefImpl=o,this.m_tolerance=s(o,t,!1).total()}next(){let e;return(e=this.m_inputGeometryCursor.next())?(t(e),this.m_index=this.m_inputGeometryCursor.getGeometryID(),o(e,this.m_envelope,this.m_tolerance,0,this.m_progressTracker)):null}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}}function i(e,r,t,s){return m(e,r,t,Number.NaN,0,s)}export{n as O};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{b as e,r}from"./OperatorProject.js";class t extends e{getOperatorType(){return 6}execute(e,t,s,a){return r(e,t,s,16,a)}}export{t as O};
5
+ import{d as e,r}from"./OperatorProject.js";class t extends e{getOperatorType(){return 6}execute(e,t,s,a){return r(e,t,s,16,a)}}export{t as O};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{G as t}from"./SimpleGeometryCursor.js";import{G as e,a as s,g as r}from"./Geometry.js";import{h as n,G as o,c as m,g as i,b as u,n as c}from"./QuadraticBezier.js";import{T as l,s as a}from"./OperatorSimplify.js";import{s as h,d,b as p,C as y}from"./CrackAndCluster-CfzXpEle.js";var _=y;function g(t,e){return{m_geometry:t,m_side:e}}function C(t,e,s,r,n,o){if(e.isEmpty()){const t=g(e,0);return void n.push(t)}if(s.isEmpty()){const t=g(e,0);return void n.push(t)}const m=[],i=new u;{const u=i.createGeometryUserIndex(),c=i.addGeometry(e),y=i.addGeometry(s),C=new l(o);let f=0,E=null;if(i.hasCurves()){E=new _;const t=i.getEnvelope2D(o);f=h(r.total());const e=d(r.total(),t);p(i,e,r.total(),12e3,E,null,o)}i.dbgVerifyCurves(),C.setEditShapeCrackAndCluster(i,r),C.cut(t,u,c,y,m);for(const t of m){null!==E&&E.stitchCurves(i,t,f,!1);const e=g(i.getGeometry(t),a(i.getGeometryUserIndex(t,u)));n.push(e)}null!==E&&E.clearStitcher(i)}}function f(t,e,s,r,n,o){if(e.isEmpty()){const t=g(e,0);return void n.push(t)}if(s.isEmpty()){const t=g(e,0);return void n.push(t)}const m=[],a=new u;{const t=a.createGeometryUserIndex(),y=a.addGeometry(e),C=a.addGeometry(s),f=new l(o);let E=0,G=null;if(a.hasCurves()){G=new _;const t=a.getEnvelope2D(o);E=h(r.total());const e=d(r.total(),t);p(a,e,r.total(),12e3,G,null,o)}a.dbgVerifyCurves(),f.setEditShapeCrackAndCluster(a,r),f.cut(!1,t,y,C,m),null!==G&&G.stitchCurves(a,c,E,!0);let v=a.getGeometry(y);const w=new i,x=new i,k=[];for(let e=0;e<m.length;e++){let s=null;{const n=new u,i=n.addGeometry(v),l=n.addGeometry(a.getGeometry(m[e]));if(n.hasCurves()){const t=n.getEnvelope2D(o);E=h(r.total());const e=d(r.total(),t);p(n,e,r.total(),12e3,G,null,o)}f.setEditShapeCrackAndCluster(n,r);const y=f.intersection(i,l);if(null!==G&&G.stitchCurves(n,c,E,!0),s=n.getGeometry(y),s.isEmpty())continue;const _=a.getGeometryUserIndex(m[e],t);2===_?w.add(s,!1):1===_?x.add(s,!1):k.push(s)}{const t=new u,s=t.addGeometry(v),n=t.addGeometry(a.getGeometry(m[e]));if(t.hasCurves()){const e=t.getEnvelope2D(o);E=h(r.total());const s=d(r.total(),e);p(t,s,r.total(),12e3,G,null,o)}f.setEditShapeCrackAndCluster(t,r);const i=f.difference(s,n);null!==G&&G.stitchCurves(t,c,E,!0);v=t.getGeometry(i)}}if(!v.isEmpty()&&m.length>0&&k.push(v),w.isEmpty()&&x.isEmpty())return;if(!w.isEmpty()){const t=g(w,1);n.push(t)}if(!x.isEmpty()){const t=g(x,2);n.push(t)}for(let e=0,s=k.length;e<s;++e){const t=g(k[e],3);n.push(t)}}}class E{getOperatorType(){return 10005}accelerateGeometry(t,e,s){return!1}canAccelerateGeometry(t){return!1}supportsCurves(){return!0}execute(t,e,s,r,n){return new G(t,e,s,r,n)}}class G extends t{constructor(t,e,s,r,i){super(),this.m_cutIndex=-1,this.m_cuts=[],this.m_progressTracker=i,this.m_cuttee=e.clone(),this.m_cutter=new n({copy:s}),this.m_bConsiderTouch=t;const u=o(e,s);this.m_tolerance=m(r,u,!0)}next(){return-1===this.m_cutIndex&&this.generateCuts(),++this.m_cutIndex<this.m_cuts.length?this.m_cuts[this.m_cutIndex]:null}getGeometryID(){return 0}tock(){return!0}getRank(){return 1}generateCuts(){switch(this.m_cuttee.getGeometryType()){case e.enumPolyline:this.generatePolylineCuts();break;case e.enumPolygon:this.generatePolygonCuts()}}generatePolylineCuts(){const t=new n,e=new n,r=new n;this.m_cuts.length=0,this.m_cuts.push(t),this.m_cuts.push(e);const o=[];C(this.m_bConsiderTouch,this.m_cuttee,this.m_cutter,this.m_tolerance,o,this.m_progressTracker);for(let n=0;n<o.length;n++){const m=o[n];1===m.m_side?t.add(m.m_geometry,!1):2===m.m_side||4===m.m_side?e.add(m.m_geometry,!1):3===m.m_side?this.m_cuts.push(m.m_geometry):0===m.m_side?r.add(m.m_geometry,!1):s("")}r.isEmpty()||t.isEmpty()&&e.isEmpty()&&!(this.m_cuts.length>=3)||this.m_cuts.push(r),t.isEmpty()&&e.isEmpty()&&this.m_cuts.length<3&&(this.m_cuts.length=0)}generatePolygonCuts(){const t=new i,e=new i,n=new i;this.m_cuts.length=0,this.m_cuts.push(t),this.m_cuts.push(e);const o=[];f(this.m_bConsiderTouch,this.m_cuttee,this.m_cutter,this.m_tolerance,o,this.m_progressTracker);for(let r=0;r<o.length;r++){const m=o[r];1===m.m_side?t.add(m.m_geometry,!1):2===m.m_side?e.add(m.m_geometry,!1):3===m.m_side?this.m_cuts.push(m.m_geometry):0===m.m_side?n.add(m.m_geometry,!1):s("")}r(n.isEmpty()||1===o.length),t.isEmpty()&&e.isEmpty()&&this.m_cuts.length<3&&(this.m_cuts.length=0)}}export{E as O};
5
+ import{G as t}from"./SimpleGeometryCursor.js";import{G as e,b as s,g as r}from"./Geometry.js";import{i as n,H as o,b as m,h as i,d as u,n as c}from"./QuadraticBezier.js";import{T as l,s as h}from"./OperatorSimplify.js";import{s as a,d,b as p,C as y}from"./CrackAndCluster-CfzXpEle.js";var _=y;function g(t,e){return{m_geometry:t,m_side:e}}function C(t,e,s,r,n,o){if(e.isEmpty()){const t=g(e,0);return void n.push(t)}if(s.isEmpty()){const t=g(e,0);return void n.push(t)}const m=[],i=new u;{const u=i.createGeometryUserIndex(),c=i.addGeometry(e),y=i.addGeometry(s),C=new l(o);let f=0,E=null;if(i.hasCurves()){E=new _;const t=i.getEnvelope2D(o);f=a(r.total());const e=d(r.total(),t);p(i,e,r.total(),12e3,E,null,o)}i.dbgVerifyCurves(),C.setEditShapeCrackAndCluster(i,r),C.cut(t,u,c,y,m);for(const t of m){null!==E&&E.stitchCurves(i,t,f,!1);const e=g(i.getGeometry(t),h(i.getGeometryUserIndex(t,u)));n.push(e)}null!==E&&E.clearStitcher(i)}}function f(t,e,s,r,n,o){if(e.isEmpty()){const t=g(e,0);return void n.push(t)}if(s.isEmpty()){const t=g(e,0);return void n.push(t)}const m=[],h=new u;{const t=h.createGeometryUserIndex(),y=h.addGeometry(e),C=h.addGeometry(s),f=new l(o);let E=0,G=null;if(h.hasCurves()){G=new _;const t=h.getEnvelope2D(o);E=a(r.total());const e=d(r.total(),t);p(h,e,r.total(),12e3,G,null,o)}h.dbgVerifyCurves(),f.setEditShapeCrackAndCluster(h,r),f.cut(!1,t,y,C,m),null!==G&&G.stitchCurves(h,c,E,!0);let v=h.getGeometry(y);const w=new i,x=new i,k=[];for(let e=0;e<m.length;e++){let s=null;{const n=new u,i=n.addGeometry(v),l=n.addGeometry(h.getGeometry(m[e]));if(n.hasCurves()){const t=n.getEnvelope2D(o);E=a(r.total());const e=d(r.total(),t);p(n,e,r.total(),12e3,G,null,o)}f.setEditShapeCrackAndCluster(n,r);const y=f.intersection(i,l);if(null!==G&&G.stitchCurves(n,c,E,!0),s=n.getGeometry(y),s.isEmpty())continue;const _=h.getGeometryUserIndex(m[e],t);2===_?w.add(s,!1):1===_?x.add(s,!1):k.push(s)}{const t=new u,s=t.addGeometry(v),n=t.addGeometry(h.getGeometry(m[e]));if(t.hasCurves()){const e=t.getEnvelope2D(o);E=a(r.total());const s=d(r.total(),e);p(t,s,r.total(),12e3,G,null,o)}f.setEditShapeCrackAndCluster(t,r);const i=f.difference(s,n);null!==G&&G.stitchCurves(t,c,E,!0);v=t.getGeometry(i)}}if(!v.isEmpty()&&m.length>0&&k.push(v),w.isEmpty()&&x.isEmpty())return;if(!w.isEmpty()){const t=g(w,1);n.push(t)}if(!x.isEmpty()){const t=g(x,2);n.push(t)}for(let e=0,s=k.length;e<s;++e){const t=g(k[e],3);n.push(t)}}}class E{getOperatorType(){return 10005}accelerateGeometry(t,e,s){return!1}canAccelerateGeometry(t){return!1}supportsCurves(){return!0}execute(t,e,s,r,n){return new G(t,e,s,r,n)}}class G extends t{constructor(t,e,s,r,i){super(),this.m_cutIndex=-1,this.m_cuts=[],this.m_progressTracker=i,this.m_cuttee=e.clone(),this.m_cutter=new n({copy:s}),this.m_bConsiderTouch=t;const u=o(e,s);this.m_tolerance=m(r,u,!0)}next(){return-1===this.m_cutIndex&&this.generateCuts(),++this.m_cutIndex<this.m_cuts.length?this.m_cuts[this.m_cutIndex]:null}getGeometryID(){return 0}tock(){return!0}getRank(){return 1}generateCuts(){switch(this.m_cuttee.getGeometryType()){case e.enumPolyline:this.generatePolylineCuts();break;case e.enumPolygon:this.generatePolygonCuts()}}generatePolylineCuts(){const t=new n,e=new n,r=new n;this.m_cuts.length=0,this.m_cuts.push(t),this.m_cuts.push(e);const o=[];C(this.m_bConsiderTouch,this.m_cuttee,this.m_cutter,this.m_tolerance,o,this.m_progressTracker);for(let n=0;n<o.length;n++){const m=o[n];1===m.m_side?t.add(m.m_geometry,!1):2===m.m_side||4===m.m_side?e.add(m.m_geometry,!1):3===m.m_side?this.m_cuts.push(m.m_geometry):0===m.m_side?r.add(m.m_geometry,!1):s("")}r.isEmpty()||t.isEmpty()&&e.isEmpty()&&!(this.m_cuts.length>=3)||this.m_cuts.push(r),t.isEmpty()&&e.isEmpty()&&this.m_cuts.length<3&&(this.m_cuts.length=0)}generatePolygonCuts(){const t=new i,e=new i,n=new i;this.m_cuts.length=0,this.m_cuts.push(t),this.m_cuts.push(e);const o=[];f(this.m_bConsiderTouch,this.m_cuttee,this.m_cutter,this.m_tolerance,o,this.m_progressTracker);for(let r=0;r<o.length;r++){const m=o[r];1===m.m_side?t.add(m.m_geometry,!1):2===m.m_side?e.add(m.m_geometry,!1):3===m.m_side?this.m_cuts.push(m.m_geometry):0===m.m_side?n.add(m.m_geometry,!1):s("")}r(n.isEmpty()||1===o.length),t.isEmpty()&&e.isEmpty()&&this.m_cuts.length<3&&(this.m_cuts.length=0)}}export{E as O};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{G as e}from"./SimpleGeometryCursor.js";import{b as r}from"./Geometry.js";import{d as t,D as s}from"./QuadraticBezier.js";var n=s;class i extends e{constructor(e,r,t,s,i,o){super(),this.m_densificator=new n(r,t,s,o,!1,i),this.m_index=-1,this.m_inputGeoms=e}tock(){return!0}getRank(){return 1}next(){let e=null;for(;e=this.m_inputGeoms.next();)return r(e),this.m_index=this.m_inputGeoms.getGeometryID(),this.densify(e);return null}getGeometryID(){return this.m_index}densify(e){return this.m_densificator.densify(e)}}class o{getOperatorType(){return 10202}accelerateGeometry(e,r,t){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}executeMany(e,r,t,s,n,o=12e3){return new i(e,r,t,s,o,n)}execute(e,r,s,n,i,o=12e3){return t(e,r,s,n,i,o)}}export{o as O};
5
+ import{G as e}from"./SimpleGeometryCursor.js";import{c as r}from"./Geometry.js";import{e as t,D as s}from"./QuadraticBezier.js";var n=s;class i extends e{constructor(e,r,t,s,i,o){super(),this.m_densificator=new n(r,t,s,o,!1,i),this.m_index=-1,this.m_inputGeoms=e}tock(){return!0}getRank(){return 1}next(){let e=null;for(;e=this.m_inputGeoms.next();)return r(e),this.m_index=this.m_inputGeoms.getGeometryID(),this.densify(e);return null}getGeometryID(){return this.m_index}densify(e){return this.m_densificator.densify(e)}}class o{getOperatorType(){return 10202}accelerateGeometry(e,r,t){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}executeMany(e,r,t,s,n,o=12e3){return new i(e,r,t,s,o,n)}execute(e,r,s,n,i,o=12e3){return t(e,r,s,n,i,o)}}export{o as O};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{S as e,G as t}from"./SimpleGeometryCursor.js";import{b as n,m as r,G as o,d as s,t as i}from"./Geometry.js";import{I as a}from"./Intersector-K1VmdfQW.js";import{P as c,a as u}from"./Transformation2D.js";import{g as m,a as l,c as f,k as p,h as g,E as y}from"./QuadraticBezier.js";import{c as d}from"./Clipper-a9xfvRaw.js";import{b as w}from"./OperatorSimplify.js";import{l as h,m as I}from"./CrackAndCluster-CfzXpEle.js";function P(e,t,n,r){if(e.isEmpty()||t.isEmpty())return e;const a=e.getDimension(),c=t.getDimension();if(a>c)return e;const u=e.getGeometryType(),m=t.getGeometryType(),y=new l,h=new l,I=new l;e.queryEnvelope(y),t.queryEnvelope(h),I.setCoords({env2D:y}),I.mergeEnvelope2D(h);const P=f(n,I,!0),v=p(P),q=new l;if(q.setCoords({env2D:y}),q.inflateCoords(v,v),!q.isIntersecting(h))return e;if(1===a&&2===c){const o=Y(e,t,m,n,r);if(o)return o}if(u===o.enumPoint){let n;switch(s(m)?(n=new g({vd:t.getDescription()}),n.addSegment(t,!0)):n=t,m){case o.enumPolygon:return E(e,n,P);case o.enumPolyline:return x(e,n,P);case o.enumMultiPoint:return D(e,n,P);case o.enumEnvelope:return C(e,n,P);case o.enumPoint:return G(e,n,P);default:i("invalid shape type")}}else if(u===o.enumMultiPoint)switch(m){case o.enumPolygon:return S(e,t,P);case o.enumEnvelope:return _(e,t,P);case o.enumPoint:return X(e,t,P)}const j=new l(y);j.inflate(100*P.total());const b=d(t,j,0,0,r);return w(e,b,n,r)}class v{getOperatorType(){return 10002}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,n,r){return new q(e,t,n,r)}execute(t,n,r,o){return this.executeMany(new e([t]),new e([n]),r,o).next()}}class q extends t{constructor(e,t,n,r){super(),this.m_progressTracker=r,this.m_index=-1,this.m_inputGeoms=e,this.m_spatialReference=n;const o=t.next();this.m_geomSubtractor=o||new m}next(){const e=this.m_inputGeoms.next();return e?(n(e),r(e),this.m_index=this.m_inputGeoms.getGeometryID(),P(e,this.m_geomSubtractor,this.m_spatialReference,this.m_progressTracker)):null}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}}function E(e,t,n,r){return 0===h(t,e,n.total())?e:e.createInstance()}function x(e,t,n,r){const o=e.getXY(),s=t.querySegmentIterator(),i=p(n),a=i*i;for(;s.nextPath();)for(;s.hasNextSegment();){const t=s.nextSegment(),r=new l;if(t.queryEnvelope(r),r.inflateCoords(i,i),!r.contains(o))continue;if(t.isIntersectingPoint(o,n.total()))return e.createInstance();let u=t.getStartXY();if(c.sqrDistance(o,u)<=a)return e.createInstance();if(u=t.getEndXY(),c.sqrDistance(o,u)<=a)return e.createInstance()}return e}function D(e,t,n,r){const o=t.getImpl().getAttributeStreamRef(0),s=t.getPointCount(),i=e.getXY(),a=p(n),u=a*a,m=new c;for(let l=0;l<s;l++){o.queryPoint2D(2*l,m);if(c.sqrDistance(m,i)<=u)return e.createInstance()}return e}function C(e,t,n,r){const o=new l;t.queryEnvelope(o),o.inflate(n.total());const s=e.getXY();return o.contains(s)?e.createInstance():e}function G(e,t,n,r){const o=p(n),s=o*o,i=e.getXY(),a=t.getXY();return c.sqrDistance(i,a)<=s?e.createInstance():e}function S(e,t,n,r){const o=new l;t.queryEnvelope(o),o.inflate(n.total());const s=e.getPointCount();let i=!1;const a=u(s,!1),m=new c;for(let c=0;c<s;c++){if(e.queryXY(c,m),!o.contains(m))continue;0!==I(t,m,n.total())&&(i=!0,a[c]=!0)}if(!i)return e;const f=e.createInstance();for(let c=0;c<s;c++)a[c]||f.addPoints(e,c,c+1);return f}function _(e,t,n,r){const o=new l;t.queryEnvelope(o),o.inflate(n.total());const s=e.getPointCount();let i=!1;const a=u(s,!1),m=new c;for(let c=0;c<s;c++)e.queryXY(c,m),o.contains(m)&&(i=!0,a[c]=!0);if(!i)return e;const f=e.createInstance();for(let c=0;c<s;c++)a[c]||f.addPoints(e,c,c+1);return f}function X(e,t,n,r){const o=e.getImpl().getAttributeStreamRef(0),s=e.getPointCount(),i=t.getXY();let a=!1;const m=u(s,!1),l=p(n),f=l*l,g=new c;for(let u=0;u<s;u++){o.queryPoint2D(2*u,g);c.sqrDistance(g,i)<=f&&(a=!0,m[u]=!0)}if(!a)return e;const y=e.createInstance();for(let c=0;c<s;c++)m[c]||y.addPoints(e,c,c+1);return y}function Y(e,t,n,r,s){const i=new y;e.queryEnvelope(i);const c=new l;t.queryEnvelope(c),i.merge(c);const u=.1*i.width(),f=.1*i.height();i.inflateCoords(u,f);const p=new m;p.addEnvelope(i,!1);const g=p.getImpl();if(n===o.enumPolygon){const e=t.getImpl();g.add(e,!0)}else g.addEnvelope(t,!0);return new a(p,r,-1,s).tryFastImplementation(e)}export{v as O};
5
+ import{S as e,G as t}from"./SimpleGeometryCursor.js";import{c as n,m as r,G as o,e as s,t as i}from"./Geometry.js";import{I as a}from"./Intersector-K1VmdfQW.js";import{P as c,a as u}from"./Transformation2D.js";import{h as m,a as l,b as f,l as p,i as g,E as y}from"./QuadraticBezier.js";import{c as d}from"./Clipper-a9xfvRaw.js";import{b as w}from"./OperatorSimplify.js";import{m as h,i as I}from"./CrackAndCluster-CfzXpEle.js";function P(e,t,n,r){if(e.isEmpty()||t.isEmpty())return e;const a=e.getDimension(),c=t.getDimension();if(a>c)return e;const u=e.getGeometryType(),m=t.getGeometryType(),y=new l,h=new l,I=new l;e.queryEnvelope(y),t.queryEnvelope(h),I.setCoords({env2D:y}),I.mergeEnvelope2D(h);const P=f(n,I,!0),v=p(P),q=new l;if(q.setCoords({env2D:y}),q.inflateCoords(v,v),!q.isIntersecting(h))return e;if(1===a&&2===c){const o=Y(e,t,m,n,r);if(o)return o}if(u===o.enumPoint){let n;switch(s(m)?(n=new g({vd:t.getDescription()}),n.addSegment(t,!0)):n=t,m){case o.enumPolygon:return E(e,n,P);case o.enumPolyline:return x(e,n,P);case o.enumMultiPoint:return D(e,n,P);case o.enumEnvelope:return C(e,n,P);case o.enumPoint:return G(e,n,P);default:i("invalid shape type")}}else if(u===o.enumMultiPoint)switch(m){case o.enumPolygon:return S(e,t,P);case o.enumEnvelope:return _(e,t,P);case o.enumPoint:return X(e,t,P)}const j=new l(y);j.inflate(100*P.total());const b=d(t,j,0,0,r);return w(e,b,n,r)}class v{getOperatorType(){return 10002}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,n,r){return new q(e,t,n,r)}execute(t,n,r,o){return this.executeMany(new e([t]),new e([n]),r,o).next()}}class q extends t{constructor(e,t,n,r){super(),this.m_progressTracker=r,this.m_index=-1,this.m_inputGeoms=e,this.m_spatialReference=n;const o=t.next();this.m_geomSubtractor=o||new m}next(){const e=this.m_inputGeoms.next();return e?(n(e),r(e),this.m_index=this.m_inputGeoms.getGeometryID(),P(e,this.m_geomSubtractor,this.m_spatialReference,this.m_progressTracker)):null}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}}function E(e,t,n,r){return 0===h(t,e,n.total())?e:e.createInstance()}function x(e,t,n,r){const o=e.getXY(),s=t.querySegmentIterator(),i=p(n),a=i*i;for(;s.nextPath();)for(;s.hasNextSegment();){const t=s.nextSegment(),r=new l;if(t.queryEnvelope(r),r.inflateCoords(i,i),!r.contains(o))continue;if(t.isIntersectingPoint(o,n.total()))return e.createInstance();let u=t.getStartXY();if(c.sqrDistance(o,u)<=a)return e.createInstance();if(u=t.getEndXY(),c.sqrDistance(o,u)<=a)return e.createInstance()}return e}function D(e,t,n,r){const o=t.getImpl().getAttributeStreamRef(0),s=t.getPointCount(),i=e.getXY(),a=p(n),u=a*a,m=new c;for(let l=0;l<s;l++){o.queryPoint2D(2*l,m);if(c.sqrDistance(m,i)<=u)return e.createInstance()}return e}function C(e,t,n,r){const o=new l;t.queryEnvelope(o),o.inflate(n.total());const s=e.getXY();return o.contains(s)?e.createInstance():e}function G(e,t,n,r){const o=p(n),s=o*o,i=e.getXY(),a=t.getXY();return c.sqrDistance(i,a)<=s?e.createInstance():e}function S(e,t,n,r){const o=new l;t.queryEnvelope(o),o.inflate(n.total());const s=e.getPointCount();let i=!1;const a=u(s,!1),m=new c;for(let c=0;c<s;c++){if(e.queryXY(c,m),!o.contains(m))continue;0!==I(t,m,n.total())&&(i=!0,a[c]=!0)}if(!i)return e;const f=e.createInstance();for(let c=0;c<s;c++)a[c]||f.addPoints(e,c,c+1);return f}function _(e,t,n,r){const o=new l;t.queryEnvelope(o),o.inflate(n.total());const s=e.getPointCount();let i=!1;const a=u(s,!1),m=new c;for(let c=0;c<s;c++)e.queryXY(c,m),o.contains(m)&&(i=!0,a[c]=!0);if(!i)return e;const f=e.createInstance();for(let c=0;c<s;c++)a[c]||f.addPoints(e,c,c+1);return f}function X(e,t,n,r){const o=e.getImpl().getAttributeStreamRef(0),s=e.getPointCount(),i=t.getXY();let a=!1;const m=u(s,!1),l=p(n),f=l*l,g=new c;for(let u=0;u<s;u++){o.queryPoint2D(2*u,g);c.sqrDistance(g,i)<=f&&(a=!0,m[u]=!0)}if(!a)return e;const y=e.createInstance();for(let c=0;c<s;c++)m[c]||y.addPoints(e,c,c+1);return y}function Y(e,t,n,r,s){const i=new y;e.queryEnvelope(i);const c=new l;t.queryEnvelope(c),i.merge(c);const u=.1*i.width(),f=.1*i.height();i.inflateCoords(u,f);const p=new m;p.addEnvelope(i,!1);const g=p.getImpl();if(n===o.enumPolygon){const e=t.getImpl();g.add(e,!0)}else g.addEnvelope(t,!0);return new a(p,r,-1,s).tryFastImplementation(e)}export{v as O};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{b as t,c as e}from"./tslib.es6.js";import{G as s}from"./SimpleGeometryCursor.js";import{t as i,b as r,f as a,G as n,d as h,e as m,k as l}from"./Geometry.js";import{P as o,g as c,h as u,L as _}from"./QuadraticBezier.js";import{f as g,P as p,b as k}from"./Transformation2D.js";import{O as f}from"./OperatorDensify.js";class P{getOperatorType(){return 10204}supportsCurves(){return!0}accelerateGeometry(t,e,s){return!1}canAccelerateGeometry(t){return!1}executeMany(t,e,s,i){return new y(t,e,s,i)}execute(t,e,s,r){t||i("null param is not allowed.");return new y(null,e,s,r).generalize(t)}}class y extends s{constructor(t,e,s,i){super(),this.m_pline=null,this.m_point=new o,this.m_stack=[],this.m_resultstack=[],this.m_callCount=0,this.m_progressTracker=i,this.m_geoms=t,this.m_maxDeviation=e,this.m_bRemoveDegenerateParts=s}tock(){return!0}getRank(){return 1}next(){const t=this.m_geoms.next();return null===t?null:(r(t),this.generalize(t))}getGeometryID(){return this.m_geoms.getGeometryID()}generalize(s){const i=s.getGeometryType();if(a(i))return s;if(i===n.enumEnvelope){const t=new c({vd:s.getDescription()});return t.addEnvelope(s,!1),this.generalize(t)}if(h(i)){const t=new u({vd:s.getDescription()});return t.addSegment(s,!0),this.generalize(t)}if(m(i)||l(""),s.isEmpty()||this.m_maxDeviation<=0)return s;const r=(new f).execute(s,0,.05*this.m_maxDeviation,0,this.m_progressTracker);s.hasNonLinearSegments()&&(this.m_maxDeviation*=.95);const o=r,p=s.createInstance();if(p.getGeometryType()===n.enumPolygon){p.setFillRule(s.getFillRule())}this.m_xy=o.getAttributeStreamRef(0);{const s={stack:[],error:void 0,hasError:!1};try{const e=new _;this.m_pline=e,t(s,g((()=>{this.m_pline=null}),!1),!1);for(let t=0,s=o.getPathCount();t<s;t++)this.generalizePath(o.getImpl(),t,p.getImpl())}catch(k){s.error=k,s.hasError=!0}finally{e(s)}}return this.m_resultstack.length=0,this.m_stack.length=0,p}generalizePath(t,e,s){if(t.getPathSize(e)<2)return;this.m_resultstack.length=0,this.m_stack.length=0;const i=t.getPathStart(e),r=t.getPathEnd(e)-1,a=t.isClosedPath(e),n=t.isClosedPathInXYPlane(e);let h=0,m=-1;this.m_stack.push(a?i:r),this.m_stack.push(i);let l=!1,o=!1;for(!this.m_bRemoveDegenerateParts&&n&&(l=!0,o=!0);this.m_stack.length>1;){const e=this.m_stack.at(-1);this.m_stack.pop();const s=this.m_stack.at(-1);let i=t.getXY(e);this.m_pline.setStartXY(i),i=t.getXY(s),this.m_pline.setEndXY(i);const a=[0];let n=this.findGreatestDistance(e,s,r,a);n>=0&&(l?l=!1:(o&&a[0]>h&&(h=a[0],m=n),a[0]<=this.m_maxDeviation&&(n=-1))),n>=0?(this.m_stack.push(n),this.m_stack.push(e)):this.m_resultstack.push(e)}a||this.m_resultstack.push(this.m_stack[0]);const c=this.m_resultstack.length;if(c===t.getPathSize(e)&&c===this.m_stack.length)s.addPath(t,e,!0);else if(this.m_resultstack.length>0){if(this.m_bRemoveDegenerateParts&&this.m_resultstack.length<=2){if(a||1===this.m_resultstack.length)return;if(p.distance(t.getXY(this.m_resultstack[0]),t.getXY(this.m_resultstack[1]))<=this.m_maxDeviation)return}if(o&&m>=0&&h<=this.m_maxDeviation){const t=this.m_resultstack.at(-1)>m;this.m_resultstack.push(m),t&&(this.m_resultstack[this.m_resultstack.length-2]=k(this.m_resultstack[this.m_resultstack.length-1],this.m_resultstack[this.m_resultstack.length-1]=this.m_resultstack[this.m_resultstack.length-2]))}for(let e=0,i=this.m_resultstack.length;e<i;e++)t.getPointByVal(this.m_resultstack[e],this.m_point),0===e?s.startPathPoint(this.m_point):s.lineToPoint(this.m_point);if(a){for(let t=this.m_resultstack.length;t<3;t++)s.lineToPoint(this.m_point);s.closePathWithLine()}}}findGreatestDistance(t,e,s,i){let r=e-1;e<=t&&(r=s);let a=-1,n=0;const h=new p;for(let m=t+1;m<=r;m++){this.m_xy.queryPoint2D(2*m,h);const t=h.x,e=h.y,s=this.m_pline.getClosestCoordinate(h,!1);h.assign(this.m_pline.getCoord2D(s)),h.x-=t,h.y-=e;const i=h.length();i>n&&(a=m,n=i),this.m_callCount++}return i[0]=n,a}}export{P as O};
5
+ import{b as t,c as e}from"./tslib.es6.js";import{G as s}from"./SimpleGeometryCursor.js";import{t as i,c as r,h as a,G as n,e as h,f as m,a as l}from"./Geometry.js";import{P as o,h as c,i as u,L as _}from"./QuadraticBezier.js";import{f as g,P as p,b as k}from"./Transformation2D.js";import{O as f}from"./OperatorDensify.js";class P{getOperatorType(){return 10204}supportsCurves(){return!0}accelerateGeometry(t,e,s){return!1}canAccelerateGeometry(t){return!1}executeMany(t,e,s,i){return new y(t,e,s,i)}execute(t,e,s,r){t||i("null param is not allowed.");return new y(null,e,s,r).generalize(t)}}class y extends s{constructor(t,e,s,i){super(),this.m_pline=null,this.m_point=new o,this.m_stack=[],this.m_resultstack=[],this.m_callCount=0,this.m_progressTracker=i,this.m_geoms=t,this.m_maxDeviation=e,this.m_bRemoveDegenerateParts=s}tock(){return!0}getRank(){return 1}next(){const t=this.m_geoms.next();return null===t?null:(r(t),this.generalize(t))}getGeometryID(){return this.m_geoms.getGeometryID()}generalize(s){const i=s.getGeometryType();if(a(i))return s;if(i===n.enumEnvelope){const t=new c({vd:s.getDescription()});return t.addEnvelope(s,!1),this.generalize(t)}if(h(i)){const t=new u({vd:s.getDescription()});return t.addSegment(s,!0),this.generalize(t)}if(m(i)||l(""),s.isEmpty()||this.m_maxDeviation<=0)return s;const r=(new f).execute(s,0,.05*this.m_maxDeviation,0,this.m_progressTracker);s.hasNonLinearSegments()&&(this.m_maxDeviation*=.95);const o=r,p=s.createInstance();if(p.getGeometryType()===n.enumPolygon){p.setFillRule(s.getFillRule())}this.m_xy=o.getAttributeStreamRef(0);{const s={stack:[],error:void 0,hasError:!1};try{const e=new _;this.m_pline=e,t(s,g((()=>{this.m_pline=null}),!1),!1);for(let t=0,s=o.getPathCount();t<s;t++)this.generalizePath(o.getImpl(),t,p.getImpl())}catch(k){s.error=k,s.hasError=!0}finally{e(s)}}return this.m_resultstack.length=0,this.m_stack.length=0,p}generalizePath(t,e,s){if(t.getPathSize(e)<2)return;this.m_resultstack.length=0,this.m_stack.length=0;const i=t.getPathStart(e),r=t.getPathEnd(e)-1,a=t.isClosedPath(e),n=t.isClosedPathInXYPlane(e);let h=0,m=-1;this.m_stack.push(a?i:r),this.m_stack.push(i);let l=!1,o=!1;for(!this.m_bRemoveDegenerateParts&&n&&(l=!0,o=!0);this.m_stack.length>1;){const e=this.m_stack.at(-1);this.m_stack.pop();const s=this.m_stack.at(-1);let i=t.getXY(e);this.m_pline.setStartXY(i),i=t.getXY(s),this.m_pline.setEndXY(i);const a=[0];let n=this.findGreatestDistance(e,s,r,a);n>=0&&(l?l=!1:(o&&a[0]>h&&(h=a[0],m=n),a[0]<=this.m_maxDeviation&&(n=-1))),n>=0?(this.m_stack.push(n),this.m_stack.push(e)):this.m_resultstack.push(e)}a||this.m_resultstack.push(this.m_stack[0]);const c=this.m_resultstack.length;if(c===t.getPathSize(e)&&c===this.m_stack.length)s.addPath(t,e,!0);else if(this.m_resultstack.length>0){if(this.m_bRemoveDegenerateParts&&this.m_resultstack.length<=2){if(a||1===this.m_resultstack.length)return;if(p.distance(t.getXY(this.m_resultstack[0]),t.getXY(this.m_resultstack[1]))<=this.m_maxDeviation)return}if(o&&m>=0&&h<=this.m_maxDeviation){const t=this.m_resultstack.at(-1)>m;this.m_resultstack.push(m),t&&(this.m_resultstack[this.m_resultstack.length-2]=k(this.m_resultstack[this.m_resultstack.length-1],this.m_resultstack[this.m_resultstack.length-1]=this.m_resultstack[this.m_resultstack.length-2]))}for(let e=0,i=this.m_resultstack.length;e<i;e++)t.getPointByVal(this.m_resultstack[e],this.m_point),0===e?s.startPathPoint(this.m_point):s.lineToPoint(this.m_point);if(a){for(let t=this.m_resultstack.length;t<3;t++)s.lineToPoint(this.m_point);s.closePathWithLine()}}}findGreatestDistance(t,e,s,i){let r=e-1;e<=t&&(r=s);let a=-1,n=0;const h=new p;for(let m=t+1;m<=r;m++){this.m_xy.queryPoint2D(2*m,h);const t=h.x,e=h.y,s=this.m_pline.getClosestCoordinate(h,!1);h.assign(this.m_pline.getCoord2D(s)),h.x-=t,h.y-=e;const i=h.length();i>n&&(a=m,n=i),this.m_callCount++}return i[0]=n,a}}export{P as O};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{S as e,G as t}from"./SimpleGeometryCursor.js";import{a as s,k as n,t as i,b as r,i as o,G as m,n as a,d as h,f as c,e as u,o as l}from"./Geometry.js";import{a as _,g as f,h as d,k as g,c as p,P,t as x,K as b,b as y,i as w,N as C}from"./QuadraticBezier.js";import{O as S}from"./OperatorUnion.js";import{b as v,c as D}from"./tslib.es6.js";import{e as I,p as G,f as M,g as T,h as N,n as k,j as A,k as q,L as E,l as R,m as z,P as O,o as X,q as B,s as Y,G as j,t as F,u as W,v as J,w as U,x as H,S as L}from"./OperatorProject.js";import{a as V,m as K,T as Q,P as Z,S as $,p as ee,q as te}from"./Transformation2D.js";import{p as se,O as ne}from"./OperatorSimplify.js";import{c as ie}from"./Clipper-a9xfvRaw.js";import{O as re}from"./OperatorDifference.js";import{c as oe}from"./GeometryCleaner-DVgW95-D.js";import{O as me}from"./OperatorDensify.js";function ae(e,t,s,n,a,h){n<Number.MAX_VALUE&&n>-Number.MAX_VALUE||i("Geodesic_bufferer.buffer - bad distance"),r(e);const c=oe(e),u=c.getGeometryType();if(o(u)){const e=c.getPointCount(),i=8e6;if(Math.abs(n)>i&&(e>50||u!==m.enumMultiPoint&&4===s&&e>2)){let e=c;const r=n>0?1:-1,o=7e6;let m=n,u=1;do{u++,m=(Math.abs(m)-o)*r}while(Math.abs(m)>i);m=n;for(let n=0;n<u-1;n++)e=ce(e,t,s,o*r,a,u,h),m=(Math.abs(m)-o)*r;return e=ce(e,t,s,m,a,u,h),e}}return ce(c,t,s,n,a,1,h)}class he{constructor(e){this.m_sr=null,this.m_gcs=null,this.m_transform=null,this.m_a=0,this.m_eSquared=0,this.m_rpu=0,this.m_radTolerance=0,this.m_q90=0,this.m_gcs90=0,this.m_gcs180=0,this.m_gcs360=0,this.m_gcs60=0,this.m_ellipticToGeodesicMaxRatio=0,this.m_curveType=0,this.m_bShapePreserving=!1,this.m_distance=0,this.m_absDistance=0,this.m_convergenceOffset=0,this.m_cornerStep=0,this.m_segmentStep=0,this.m_progressTracker=e}bufferPolygon(e){const t=new f,s=new Ce(this,e,t);return this.processGnomonicBufferPiecesCursor(!0,s)}bufferPolyline(e){const t=new Ce(this,e,null);return this.processGnomonicBufferPiecesCursor(!0,t)}bufferMultiPoint(e){const t=new Se(this,e);return this.processGnomonicBufferPiecesCursor(!1,t)}bufferPoint(e){const t=e.getXY();t.scale(this.m_rpu);let s=new f;if(this.bufferPoint2D(t,!1,s)){const e=x(null,s,!0);s=se(s,e,!0,!0,-1,this.m_progressTracker,0,!1)}return s=(new T).foldInto360RangeGeodetic(s,this.m_gcs,2),s}processGnomonicBufferPiecesCursor(e,t){const s=t;let n=s.getGnomonic();const i=A(q()),r=new L;i.queryPrecisionDescriptor(r),r.setTolerance(0,.001),A(q(),void 0,r);let o=new E,m=(new S).executeMany(o,i,this.m_progressTracker,2);const a=V(6,!1),h=K(_,6);this.initializeGrid(a,h);const c=[null,null,null,null,null,null],u=[null,null,null,null,null,null],l=[null,null,null,null,null,null];let f,d,p;for(;null!==(f=s.next());){if(d=s.getGnomonic(),d!==n){if(null!==n){let t=m.next();if(o=null,m=null,null!=t){const s=x(i,t,!0),r=g(s);t=n.unproject(t,r,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,a,h,c,u,l)}}null!==d&&(o=new E,m=(new S).executeMany(o,i,this.m_progressTracker,2)),n=d}if(s.isRunningInGnomonic()){if(d.project(f),s.needsSimplify()){const e=x(null,f,!0);f=se(f,e,!0,!0,-1,this.m_progressTracker,0,!1)}o.tick(ye(f)),m.tock()}else this.putInGridCursors(e,f,i,!0,a,h,c,u,l)}let P=!1;for(let _=0;_<6;_++)if(null!=l[_]){P=!0;break}if(P){let t=!1;const r=[null,null,null,null,null,null];if(e){const n=s.m_densified;if(s.m_densified=null,null!==n){const s=new Q;s.scale(1/this.m_rpu,1/this.m_rpu),n.applyTransformation(s),this.m_distance>0?this.putInGridCursors(e,n,i,!1,a,h,c,u,l):(this.processInGrid(e,n,!1,a,h,c,r),t=!0)}}const _=new E,f=(new S).executeMany(_,this.m_gcs,this.m_progressTracker,2);if(null!==m){let t=m.next();o=null,m=null;const s=x(i,t,!0),r=g(s);t=n.unproject(t,r,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,a,h,c,u,l)}for(let e=0;e<6;e++)if(null!=l[e]){let s=l[e].next();l[e]=null,u[e]=null,t&&null!==r[e]&&(s=(new re).execute(r[e],s,i,this.m_progressTracker));const n=x(i,s,!0),o=g(n);s=c[e].unproject(s,o,this.m_progressTracker),s=(new ne).execute(s,this.m_gcs,!0,this.m_progressTracker),_.tick(ye(s)),f.tock()}p=f.next()}else{let t,r=!1;if(e){let e=s.m_densified;if(s.m_densified=null,null!==e){const s=new Q;s.scale(1/this.m_rpu,1/this.m_rpu),e.applyTransformation(s),d.project(e);const n=x(null,e,!0);e=se(e,n,!1,!0,-1,this.m_progressTracker,0,!1),this.m_distance>0?(o.tick(ye(e)),m.tock()):(t=e,r=!0)}}let a=m.next();o=null,m=null,r&&(a=(new re).execute(t,a,i,this.m_progressTracker));const h=x(i,a,!0),c=g(h);p=n.unproject(a,c,this.m_progressTracker),p=(new ne).execute(p,this.m_gcs,!0,this.m_progressTracker)}return p=(new T).foldInto360RangeGeodetic(p,this.m_gcs,2),p}putInGridCursors(e,t,s,n,i,r,o,m,a){const h=[null,null,null,null,null,null];this.processInGrid(e,t,n,i,r,o,h);for(let c=0;c<6;c++)null!==h[c]&&(null===m[c]&&(m[c]=new E,a[c]=(new S).executeMany(m[c],s,this.m_progressTracker,2)),m[c].tick(ye(h[c])),a[c].tock())}processInGrid(e,t,s,n,i,r,o){const m=.01,a=this.insertGeodeticPointsAlongGrid(t,i,m);for(let h=0;h<6;h++){if(n[h])continue;const e=i[h].clone();e.inflateCoords(m,m);const c=b(t,e),u=p(null,c,!1).total();let l=ie(a,e,u,Number.NaN,this.m_progressTracker);if(null!==l&&!l.isEmpty()){if(l===a&&(l=l.clone()),null===r[h]){const e=new Z;h<3?e.setCoords(0,1):e.setCoords(0,-1);const t=new Z;t.setAdd(i[h].getCenter(),e),r[h]=be(this.m_gcs,t)}r[h].project(l);const e=x(null,l,!0);l=se(l,e,s,!0,-1,this.m_progressTracker,0,!1),o[h]=l}}}insertGeodeticPointsAlongGrid(e,t,s){const n=_.construct(t[3].xmin,t[3].ymin,t[2].xmax,t[2].ymax),i=R(this.m_gcs,n,e,!0,this.m_progressTracker),r=new y,o=r.addGeometry(i);return z(r,o,this.m_gcs,0,2,!0,t[0].xmax+s),z(r,o,this.m_gcs,0,2,!0,t[1].xmax+s),z(r,o,this.m_gcs,0,2,!1,t[1].ymin+s),0!==s&&(z(r,o,this.m_gcs,0,2,!0,t[0].xmax-s),z(r,o,this.m_gcs,0,2,!0,t[1].xmax-s),z(r,o,this.m_gcs,0,2,!1,t[1].ymin-s)),r.getGeometry(o)}initializeGrid(e,t){for(let s=0;s<6;s++)e[s]=!1;t[0].setCoords({xmin:-this.m_gcs180,ymin:0,xmax:-this.m_gcs60,ymax:this.m_gcs90}),t[1].setCoords({xmin:-this.m_gcs60,ymin:0,xmax:this.m_gcs60,ymax:this.m_gcs90}),t[2].setCoords({xmin:this.m_gcs60,ymin:0,xmax:this.m_gcs180,ymax:this.m_gcs90}),t[3].setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:-this.m_gcs60,ymax:0}),t[4].setCoords({xmin:-this.m_gcs60,ymin:-this.m_gcs90,xmax:this.m_gcs60,ymax:0}),t[5].setCoords({xmin:this.m_gcs60,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:0})}checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(e,t,s,n,i,r){const o=e[0],m=e.at(-1),a=o.y<m.y?o.y:m.y,h=o.y>m.y?o.y:m.y,c=G.q(this.m_a,this.m_eSquared,a),u=G.q(this.m_a,this.m_eSquared,h);if(this.m_q90-(c+t+this.m_absDistance)>.001&&this.m_q90+(u-t-this.m_absDistance)>.001)return!1;const l=s-te,_=n+te,f=l-Math.PI,d=l+Math.PI,g=_+Math.PI,p=[Number.NaN],P=[Number.NaN],x=[Number.NaN],b=[Number.NaN];let y=!1;if(_e(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,o,l,f,m,_,p,P),_e(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,g,_,o,f,x,b),(_<p[0]&&p[0]<g||_<P[0]&&P[0]<g)&&(y=!0),y||(f<x[0]&&x[0]<l||f<b[0]&&b[0]<l)&&(y=!0),!y&&i)return!1;const w=[];for(let v=e.length-1;v>=0;v--)w.push(e[v]);r.setEmpty(),r.addPathPoint2D(null,0,!0);let C=0;C=ue(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,e,l,_,i,C,r),C=le(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,_,g,this.m_cornerStep,i,C,r,p[0],P[0]),C=ue(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,w,g,d,i,C,r),C=le(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,o,f,l,this.m_cornerStep,i,C,r,x[0],b[0]);let S=!1;return i||(S=this.checkAndPrepForPole(r)),y||S}bufferPoint2D(e,t,s){s.setEmpty(),s.addPathPoint2D(null,0,!0);const n=0;le(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,e,-this.m_cornerStep,2*Math.PI,this.m_cornerStep,t,n,s);let i=!1;return t||(i=this.checkAndPrepForPole(s)),i}checkAndPrepForPole(e){const t=this.checkAndPrepForPoleTouch(e),s=this.checkAndPrepForPoleWrap(e);return t||s}checkAndPrepForPoleTouch(e){const t=new _;return e.queryEnvelope(t),!(!O(t.ymax,this.m_gcs90)&&!O(t.ymin,-this.m_gcs90))&&(this.prepPoleTouch(e),!0)}checkAndPrepForPoleWrap(e){const t=e.getXY(0),s=e.getXY(e.getPointCount()-1);return Math.abs(t.x-s.x)>this.m_gcs180?(this.prepSinglePoleWrap(e),!0):this.checkAndPrepForDoublePoleWrap(e)}checkAndPrepForDoublePoleWrap(e){return e.calculateArea2D()<0&&(this.prepDoublePoleWrap(e),!0)}prepPoleTouch(e){const t=new f;t.insertPath2D(-1,null,0,0,!0);const s=e.getPathStart(0),n=e.getPathEnd(0),i=n-s;let r=-1;for(r=s;r<n;r++){const t=e.getXY(r),s=O(t.y,this.m_gcs90),n=O(t.y,-this.m_gcs90);if(!s&&!n)break}let o=r,m=!1,a=Number.NaN;do{const n=e.getXY(o),r=O(n.y,this.m_gcs90),h=O(n.y,-this.m_gcs90),c=s+(o+1-s)%i;if(r||h){let s=Z.construct(a,n.y);t.insertPoint2D(0,-1,s);const i=e.getXY(c),r=O(i.y,this.m_gcs90),o=O(i.y,-this.m_gcs90);r||o||(s=Z.construct(i.x,n.y),m?t.setXY(t.getPointCount()-1,s):t.insertPoint2D(0,-1,s)),m=!0}else t.insertPoint2D(0,-1,n),a=n.x,m=!1;o=c}while(o!==r);e.setEmpty(),e.add(t,!1)}prepSinglePoleWrap(e){const t=new f,s=new f,n=new Q,i=e.getXY(e.getPathStart(0)),r=e.getXY(e.getPathEnd(0)-1),o=this.m_gcs360,m=this.m_gcs180,a=new _;a.setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:this.m_gcs90});const h=new _;e.queryEnvelope(h);const c=Math.ceil(h.width()/o);let u,l;i.x>r.x?(u=-o,l=this.m_gcs90):(u=o,l=-this.m_gcs90),n.setShiftCoords(u,0),t.addPath(e,0,!0),s.add(t,!1);const d=new P;for(let _=0;_<c;_++)s.applyTransformation(n),s.getPointByVal(0,d),t.lineToPoint(d),t.addSegmentsFromPath(s,0,0,s.getSegmentCount()-1,!1);const g=t.getXY(0),x=t.getXY(t.getPointCount()-1);g.y=l,x.y=l,t.lineTo(x);const w=new Z;for(w.setCoordsPoint2D(x),w.x-=.5*u;Math.abs(w.x-g.x)>m;)t.lineTo(w),w.x-=.5*u;t.lineTo(g);const C=a.getCenterX(),S=new _;t.queryEnvelope(S);let v=0;const D=S.getCenter().x;D-C>m?v=-Math.ceil((D-C-m)/o):C-D>m&&(v=Math.ceil((C-D-m)/o)),0!==v&&(n.setShiftCoords(v*o,0),t.applyTransformation(n));const I=new y,G=I.addGeometry(t);z(I,G,this.m_gcs,0,2,!0,a.xmin),z(I,G,this.m_gcs,0,2,!0,a.xmax);const M=I.getGeometry(G),T=b(M,a);T.inflateCoords(0,1);const N=p(null,T,!0).total(),k=ie(M,a,N,Number.NaN,this.m_progressTracker);e.setEmpty(),e.add(k,!1)}prepDoublePoleWrap(e){const t=this.m_gcs360,s=this.m_gcs180,n=new _;n.setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:this.m_gcs90});const i=n.getCenter().x,r=new _;e.queryPathEnvelope(0,r);let o,m=0,a=r.getCenter().x;if(a-i>s?m=-Math.ceil((a-i-s)/t):i-a>s&&(m=Math.ceil((i-a-s)/t)),0!==m){const s=new Q;s.setShiftCoords(m*t,0),e.getImpl().applyTransformationToPath(s,0),e.queryPathEnvelope(0,r),a=r.getCenter().x}const h=new _;n.containsExclusiveEnvelope(r)?(o=!1,h.setCoords({env2D:n})):(o=!0,h.setCoords({env2D:n}),h.xmin-=t,h.xmax+=t);let c=e.createInstance();c.addPathPoint2D(null,0,!0);const u=new Z;if(u.setCoords(h.xmin,h.ymin),c.insertPoint2D(0,-1,u),u.setCoords(h.xmin,h.ymax),c.insertPoint2D(0,-1,u),u.setCoords(.5*(h.xmin+h.xmax),h.ymax),c.insertPoint2D(0,-1,u),u.setCoords(h.xmax,h.ymax),c.insertPoint2D(0,-1,u),u.setCoords(h.xmax,h.ymin),c.insertPoint2D(0,-1,u),u.setCoords(.5*(h.xmin+h.xmax),h.ymin),c.insertPoint2D(0,-1,u),o){c.addPath(e,0,!0);const s=new Q;a<i?s.setShiftCoords(t,0):s.setShiftCoords(-t,0),e.getImpl().applyTransformationToPath(s,0),c.addPath(e,0,!0);const r=new y,o=r.addGeometry(c);z(r,o,this.m_gcs,0,2,!0,n.xmin),z(r,o,this.m_gcs,0,2,!0,n.xmax),c=r.getGeometry(o);const m=b(c,n);m.inflateCoords(0,1);const h=p(null,m,!0).total();c=ie(c,n,h,Number.NaN,this.m_progressTracker)}else c.addPath(e,0,!0);e.setEmpty(),e.add(c,!1)}setMinCornerStep(){const e={stack:[],error:void 0,hasError:!1};try{let s=Math.min(Math.PI*this.m_a-this.m_absDistance,this.m_absDistance);s=Math.min(s,.125*this.m_a*Math.PI);const n=new Z;n.setCoords(0,10*this.m_rpu);const i=0;let r=45*this.m_rpu;const o=v(e,new $(new X,new X),!1),m=v(e,new $(new X,new X),!1),a=v(e,new $(new X,new X),!1),h=v(e,new $(new X,new X),!1),c=new Z,u=new Z,l=new Z,_=new Z;for(B.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,s,i,o.at(0),o.at(1)),c.setCoords(o.at(0).val,o.at(1).val),B.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,s,r,m.at(0),m.at(1)),u.setCoords(m.at(0).val,m.at(1).val);;){const e={stack:[],error:void 0,hasError:!1};try{const t=.5*(i+r);B.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,s,t,a.at(0),a.at(1)),l.setCoords(a.at(0).val,a.at(1).val);const o=v(e,new X,!1),f=v(e,new X,!1);B.geodeticDistance(this.m_a,this.m_eSquared,c.x,c.y,u.x,u.y,o,f,null,2),B.geodeticCoordinate(this.m_a,this.m_eSquared,c.x,c.y,.5*o.val,f.val,h.at(0),h.at(1),2),_.setCoords(h.at(0).val,h.at(1).val);const d=v(e,new X,!1);B.geodeticDistance(this.m_a,this.m_eSquared,l.x,l.y,_.x,_.y,d,null,null,2);if(d.val<=this.m_convergenceOffset)break;r*=.9,B.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,s,r,m.at(0),m.at(1)),u.setCoords(m.at(0).val,m.at(1).val)}catch(t){e.error=t,e.hasError=!0}finally{D(e)}}const f=r-i,d=2*Math.PI/Math.ceil(2*Math.PI/f);this.m_cornerStep=d}catch(s){e.error=s,e.hasError=!0}finally{D(e)}}setMinSegmentStep(){const e={stack:[],error:void 0,hasError:!1};try{let n=Math.min(Math.PI*this.m_a-this.m_absDistance,this.m_absDistance);n=Math.min(n,.125*this.m_a*Math.PI);const i=new Z,r=new Z;i.setCoords(0,10*this.m_rpu),r.setCoords(10*this.m_rpu,10*this.m_rpu);const o=v(e,new X,!1),m=v(e,new X,!1),a=v(e,new X,!1);B.geodeticDistance(this.m_a,this.m_eSquared,i.x,i.y,r.x,r.y,a,o,m,this.m_curveType);const h=v(e,new $(new X,new X),!1),c=v(e,new $(new X,new X),!1),u=new Z,l=v(e,new X,!1),_=v(e,new $(new X,new X),!1),f=v(e,new $(new X,new X),!1),d=v(e,new $(new X,new X),!1),g=v(e,new $(new X,new X),!1),p=new Z,P=new Z,x=new Z,b=new Z,y=0;let w=1;const C=o.val,S=m.val,I=C-.5*Math.PI,G=S+.5*Math.PI,M=a.val;for(B.geodesicCoordinate(this.m_a,this.m_eSquared,i.x,i.y,n,I,_.at(0),_.at(1)),p.setCoords(_.at(0).val,_.at(1).val),B.geodesicCoordinate(this.m_a,this.m_eSquared,r.x,r.y,n,G,f.at(0),f.at(1)),P.setCoords(f.at(0).val,f.at(1).val);;){const e={stack:[],error:void 0,hasError:!1};try{const s=.5*(y+w);B.geodeticCoordinate(this.m_a,this.m_eSquared,i.x,i.y,s*M,C,h.at(0),h.at(1),this.m_curveType),u.setCoords(h.at(0).val,h.at(1).val),B.geodeticDistance(this.m_a,this.m_eSquared,i.x,i.y,u.x,u.y,null,null,l,this.m_curveType);const o=l.val+.5*Math.PI;B.geodesicCoordinate(this.m_a,this.m_eSquared,u.x,u.y,n,o,d.at(0),d.at(1)),x.setCoords(d.at(0).val,d.at(1).val);const m=v(e,new X,!1),a=v(e,new X,!1);B.geodeticDistance(this.m_a,this.m_eSquared,p.x,p.y,P.x,P.y,m,a,null,2),B.geodeticCoordinate(this.m_a,this.m_eSquared,p.x,p.y,.5*m.val,a.val,g.at(0),g.at(1),2),b.setCoords(g.at(0).val,g.at(1).val);const _=v(e,new X,!1);B.geodeticDistance(this.m_a,this.m_eSquared,x.x,x.y,b.x,b.y,_,null,null,2);if(_.val<=this.m_convergenceOffset)break;{const e={stack:[],error:void 0,hasError:!1};try{w*=.9,B.geodeticCoordinate(this.m_a,this.m_eSquared,i.x,i.y,w*M,C,c.at(0),c.at(1),this.m_curveType),r.setCoords(c.at(0).val,c.at(1).val);const t=v(e,new X,!1);B.geodeticDistance(this.m_a,this.m_eSquared,i.x,i.y,r.x,r.y,null,null,t,this.m_curveType);const s=t.val+.5*Math.PI;B.geodesicCoordinate(this.m_a,this.m_eSquared,r.x,r.y,n,s,f.at(0),f.at(1)),P.setCoords(f.at(0).val,f.at(1).val)}catch(t){e.error=t,e.hasError=!0}finally{D(e)}}}catch(s){e.error=s,e.hasError=!0}finally{D(e)}}let T=w*M;T>1e5&&(T=1e5),this.m_segmentStep=T}catch(n){e.error=n,e.hasError=!0}finally{D(e)}}setConvergenceOffset(){let e;e=this.m_absDistance>5e4?100:this.m_absDistance>1e4?10:1,this.m_absDistance/e<500&&(e=this.m_absDistance/500),e<.01&&(e=.01),this.m_convergenceOffset=e}}function ce(e,t,s,n,i,r,o){if(e.isEmpty())return new f({vd:e.getDescription()});let x=e;if(a(x)){const e=10*t.getTolerance(0);x=(new me).execute(x,0,e,0,o,12e3)}const b=new he(o);b.m_sr=t,b.m_gcs=t.getGCS(),b.m_transform=I(t,b.m_gcs,null);const y=Y();b.m_gcs.querySpheroidData(y);const w=new _;x.queryEnvelope(w),b.m_a=y.majorSemiAxis,b.m_eSquared=y.e2,b.m_rpu=b.m_gcs.getUnit().getUnitToBaseFactor(),b.m_gcs90=.5*Math.PI/b.m_rpu,b.m_gcs180=Math.PI/b.m_rpu,b.m_gcs360=2*Math.PI/b.m_rpu,b.m_gcs60=b.m_gcs360/6,b.m_q90=G.q90(b.m_a,b.m_eSquared),b.m_ellipticToGeodesicMaxRatio=.5*b.m_a*Math.PI/b.m_q90;const C=b.m_gcs.getTolerance(0);b.m_radTolerance=C*b.m_rpu,4===s?(b.m_curveType=2,b.m_bShapePreserving=!0):(b.m_curveType=s,b.m_bShapePreserving=!1),b.m_distance=n,b.m_absDistance=Math.abs(n),Number.isNaN(i)||i<=0?b.setConvergenceOffset():b.m_convergenceOffset=Math.max(i,.001),b.m_convergenceOffset/=r;let S,v=x.getGeometryType();if(h(v)){const e=new d({vd:x.getDescription()});e.addSegment(x,!0),S=e,v=m.enumPolyline}else if(v===m.enumEnvelope){const e=x,t=new _;e.queryEnvelope(t);const s=g(p(b.m_sr,w,!0));if(t.minDimension()<=s)if(0===t.maxDimension()){const t=new P({vd:x.getDescription()});e.getCenter(t),S=t,v=m.enumPoint}else{const t=new d({vd:x.getDescription()});t.addEnvelope(e,!1),S=t,v=m.enumPolyline}else{const t=new f({vd:x.getDescription()});t.addEnvelope(e,!1),S=t,v=m.enumPolygon}}else S=x;if(b.setMinCornerStep(),c(v)||b.setMinSegmentStep(),b.m_absDistance<=.5*b.m_convergenceOffset)return v!==m.enumPolygon?new f({vd:S.getDescription()}):b.m_bShapePreserving?S:M(S,b.m_sr,b.m_curveType,b.m_segmentStep,-1,o);if(b.m_distance<0&&v!==m.enumPolygon)return new f({vd:S.getDescription()});if(b.m_bShapePreserving&&u(v)){const e=M(S,t,4,Number.NaN,b.m_convergenceOffset,o);S=(new T).execute(e,b.m_transform,o)}else S=(new T).execute(S,b.m_transform,o);if(S=N(S,b.m_gcs),S.isEmpty())return new f({vd:S.getDescription()});!b.m_bShapePreserving&&u(v)&&(S=k(b.m_rpu,S)),S=de(S,b.m_gcs);let D=new f;switch(v){case m.enumPolygon:D=b.bufferPolygon(S);break;case m.enumPolyline:D=b.bufferPolyline(S);break;case m.enumMultiPoint:D=b.bufferMultiPoint(S);break;case m.enumPoint:D=b.bufferPoint(S);break;default:l("")}const A=(new T).execute(D,b.m_transform.getInverse(),o);return A.mergeVertexDescription(S.getDescription()),A}function ue(e,t,s,n,i,r,o,m,a,h,c){const u={stack:[],error:void 0,hasError:!1};try{const l=new Z;l.setNAN(),a||c.getPointCount()>0&&(l.setCoordsPoint2D(c.getXY(c.getPointCount()-1)),l.scale(s));const _=v(u,new X,!1),f=v(u,new $(new X,new X),!1),d=new Z,g=new Z,p=r.at(-1),P=1/s;for(let s=0;s<r.length;s++){const u=r[s];let x;0===s?x=o:s===r.length-1?x=m:(B.geodeticDistance(e,t,p.x,p.y,u.x,u.y,null,null,_,i),x=_.val-.5*Math.PI),B.geodesicCoordinate(e,t,u.x,u.y,n,x,f.at(0),f.at(1)),a?g.setCoords(f.at(0).val,f.at(1).val):(d.setCoords(f.at(0).val,f.at(1).val),h=fe(u.x,d.x,l.x,h),g.setCoords(h+d.x,d.y),l.setCoordsPoint2D(g)),g.scale(P),c.insertPoint2D(0,-1,g)}return h}catch(l){u.error=l,u.hasError=!0}finally{D(u)}}function le(e,t,s,n,i,r,o,m,a,h,c,u=Number.NaN,l=Number.NaN){const _={stack:[],error:void 0,hasError:!1};try{if(o-r<m)return h;const f=v(_,new $(new X,new X),!1),d=new Z,g=new Z,p=new Z;g.setNAN(),a||c.getPointCount()>0&&(g.setCoordsPoint2D(c.getXY(c.getPointCount()-1)),g.scale(s));let P=Math.ceil(r/m),x=P++*m;x===r&&(x=P++*m);let b=r;const y=1/s;for(;x<o+m&&(b<u&&u<x?(x=u,P--):b<l&&l<x&&(x=l,P--),!(x>=o));)B.geodesicCoordinate(e,t,i.x,i.y,n,x,f.at(0),f.at(1)),a?p.setCoords(f.at(0).val,f.at(1).val):(d.setCoords(f.at(0).val,f.at(1).val),h=fe(i.x,d.x,g.x,h),p.setCoords(h+d.x,d.y),g.setCoordsPoint2D(p)),p.scale(y),c.insertPoint2D(0,-1,p),b=x,x=P++*m;return h}catch(f){_.error=f,_.hasError=!0}finally{D(_)}}function _e(e,t,s,n,i,r,o,m,a,h,c){const u={stack:[],error:void 0,hasError:!1};try{const s=new Z,l=new Z,_=v(u,new $(new X,new X),!1);B.geodesicCoordinate(e,t,i.x,i.y,n,r,_.at(0),_.at(1)),s.setCoords(_.at(0).val,_.at(1).val),B.geodesicCoordinate(e,t,i.x,i.y,n,o,_.at(0),_.at(1)),l.setCoords(_.at(0).val,_.at(1).val);const f=v(u,new X,!1);for(B.geodeticDistance(e,t,m.x,m.y,s.x,s.y,null,f,null,0),h[0]=f.val,B.geodeticDistance(e,t,m.x,m.y,l.x,l.y,null,f,null,0),c[0]=f.val;h[0]<=c[0];)h[0]+=ee;for(;h[0]>c[0];)h[0]-=ee;for(;h[0]>=a;)h[0]-=ee,c[0]-=ee;for(;h[0]<a;)h[0]+=ee,c[0]+=ee}catch(l){u.error=l,u.hasError=!0}finally{D(u)}}function fe(e,t,s,n){if(Number.isNaN(s)){for(;n+t-e>Math.PI;)n-=ee;for(;e-(n+t)>Math.PI;)n+=ee;return n}return n+t-s>Math.PI?n-=ee:s-(n+t)>Math.PI&&(n+=ee),n}function de(e,t){const s=e.getGeometryType();let n;if(n=u(s)?e.getPathCount():s===m.enumMultiPoint?e.getPointCount():1,1===n)return e;const i=[],r=[];for(let m=0;m<n;m++){i.push(m);const n=new Z;if(u(s)){const t=new _;e.queryPathEnvelope(m,t),n.assign(t.getCenter())}else n.assign(e.getXY(m));const o=t.toGeohash(n);r.push(o)}i.sort(((e,t)=>r[e]<r[t]?-1:r[e]>r[t]?1:0));const o=e.createInstance();for(let m=0;m<n;m++){const t=i[m];u(s)?o.addPath(e,t,!0):o.addPoints(e,t,t+1)}return o}function ge(e,t,s,n,i,r){const o={stack:[],error:void 0,hasError:!1};try{if(n>=r)return!1;const m=s[0],a=s.at(-1),h=v(o,new X,!1),c=v(o,new X,!1),u=v(o,new X,!1);B.greatEllipticDistance(e,t,i.x,i.y,m.x,m.y,h,null,null),B.greatEllipticDistance(e,t,i.x,i.y,a.x,a.y,c,null,null),B.greatEllipticDistance(e,t,m.x,m.y,a.x,a.y,u,null,null);let l=Math.min(h.val,c.val)+u.val,_=l+n;if(_<r)return!0;const f=v(o,new X,!1);l=Math.max(h.val,c.val);for(let n=1;n<s.length-1;n++){const r=s[n];B.greatEllipticDistance(e,t,i.x,i.y,r.x,r.y,f,null,null),f.val>l&&(l=f.val)}return _=l+n,_<r}catch(m){o.error=m,o.hasError=!0}finally{D(o)}}function pe(e,t,s,n,i,r,o,m){let a;if(n.length%2==0){const e=n.length>>1,t=n[e],s=n[e-1];a=Z.lerp(t,s,.5)}else{a=n[n.length-1>>1].clone()}const h=a.clone(),c=F(e,t,h,75/180*Math.PI);return!!ge(e,t,n,i,h,c)&&(null!==r&&(r.setCoordsPoint2D(a),r.scale(1/s)),null!==o&&o.setCoordsPoint2D(h),null!==m&&(m[0]=c),!0)}function Pe(e,t,s,n,i,r){const o={stack:[],error:void 0,hasError:!1};try{if(n>=r)return!1;const m=v(o,new X,!1);B.greatEllipticDistance(e,t,i.x,i.y,s.x,s.y,m,null,null);return m.val+n<r}catch(m){o.error=m,o.hasError=!0}finally{D(o)}}function xe(e,t,s,n,i,r,o,m){const a=F(e,t,n,75/180*Math.PI);return!!Pe(e,t,n,i,n,a)&&(null!==r&&(r.setCoordsPoint2D(n),r.scale(1/s)),null!==o&&o.setCoordsPoint2D(n),null!==m&&(m[0]=a),!0)}function be(e,t){return new j(e,t)}function ye(e){return w(e,0)||C(e,0),e}class we{constructor(e){this.m_bRunningInGnomonic=!1,this.m_bNeedsSimplify=!1,this.m_gnomonic=null,this.m_gnomonicCenterRad=new Z,this.m_minGnomonicRadius=Number.NaN,this.m_progressTracker=e}isRunningInGnomonic(){return this.m_bRunningInGnomonic}needsSimplify(){return this.m_bNeedsSimplify}getGnomonic(){return this.m_gnomonic}}class Ce extends we{constructor(e,t,s){super(e.m_progressTracker),this.m_segIter=null,this.m_bNextSegmentCannotJoin=!1,this.m_currentDensifiedDelta=[0],this.m_currentBufferedDelta=0,this.m_lastAzimuth=0,this.m_startAzimuth=[0],this.m_endAzimuth=[0],this.m_numWinds=0,this.m_debugCounter=0,this.m_bufferHelper=new f,this.m_densifiedPoints=[],this.m_bufferer=e,this.m_multiPath=t,this.m_densified=s,this.m_bNeedsSimplify=!0;const n=new _;this.m_multiPath.queryEnvelope(n);const i=n.getCenter(),r=i.clone();r.scale(this.m_bufferer.m_rpu),this.m_gnomonic=be(this.m_bufferer.m_gcs,i),this.m_gnomonicCenterRad=r.clone(),this.m_minGnomonicRadius=F(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,r,75/180*Math.PI)}next(){let e;if(this.m_bNextSegmentCannotJoin)return this.m_bNextSegmentCannotJoin=!1,this.m_segIter.nextSegment(),e=this.m_bufferHelper.clone(),e;if(null===this.m_segIter){if(this.m_segIter=this.m_multiPath.getImpl().querySegmentIterator(),!this.m_segIter.nextPath())return null;null!==this.m_densified&&this.m_densified.addPathPoint2D(null,0,!0)}if(!this.m_segIter.hasNextSegment()){if(!this.m_segIter.nextPath())return null;null!=this.m_densified&&this.m_densified.addPathPoint2D(null,0,!0)}let t=null;this.m_currentBufferedDelta=0,this.m_currentDensifiedDelta=[0],this.m_numWinds=0,this.m_lastAzimuth=Number.NaN,this.m_bNextSegmentCannotJoin=!1,this.m_densifiedPoints.length=0;const s=16;let n=0;const i=new Z,r=new Z;for(;this.m_segIter.hasNextSegment()&&this.m_numWinds<s;){const e=this.m_segIter.nextSegment();if(i.setCoordsPoint2D(e.getStartXY()),r.setCoordsPoint2D(e.getEndXY()),i.scale(this.m_bufferer.m_rpu),r.scale(this.m_bufferer.m_rpu),W(i,r))i.x=r.x;else if(J(i,r))r.x=i.x;else{let e=-1,t=-1;const s=this.m_segIter.getPathIndex(),n=this.m_multiPath.getPathStart(s),o=this.m_multiPath.getPathEnd(s);if(e=this.m_segIter.getStartPointIndex()-1,t=this.m_segIter.getEndPointIndex()+1,e<n&&(e=this.m_multiPath.isClosedPath(s)?o-1:-1),t>o-1&&(t=this.m_multiPath.isClosedPath(s)?n:-1),-1!==e){const t=this.m_multiPath.getXY(e);t.scale(this.m_bufferer.m_rpu),J(t,i)&&(i.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),W(r,e)&&(r.x=e.x)}}this.m_densifiedPoints.length=0;const s=U(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_curveType,i,r,this.m_bufferer.m_segmentStep,Number.NaN,this.m_bufferer.m_radTolerance,this.m_startAzimuth,this.m_endAzimuth,this.m_densifiedPoints,this.m_currentDensifiedDelta);if(0===n)this.m_bRunningInGnomonic=this.isSegmentBufferInCurrentGnomonic(this.m_densifiedPoints),this.m_bRunningInGnomonic||(this.m_bRunningInGnomonic=this.tryUpdateGnomonic(this.m_densifiedPoints));else if(this.m_bRunningInGnomonic){if(!this.isSegmentBufferInCurrentGnomonic(this.m_densifiedPoints)){this.m_segIter.previousSegment(),this.m_segIter.previousSegment(),this.m_segIter.nextSegment();break}}else{if(pe(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_densifiedPoints,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,null,null,null)){this.m_segIter.previousSegment(),this.m_segIter.previousSegment(),this.m_segIter.nextSegment();break}}if(0===s||H(i,r)?(this.m_bufferHelper.setEmpty(),this.m_bufferer.bufferPoint2D(i,this.m_bRunningInGnomonic,this.m_bufferHelper),this.m_bNextSegmentCannotJoin=!0):(this.m_bufferHelper.setEmpty(),this.m_bNextSegmentCannotJoin=this.checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(s,this.m_bufferHelper)),this.m_bNextSegmentCannotJoin){this.m_segIter.previousSegment(),this.m_segIter.hasPreviousSegment()?(this.m_segIter.previousSegment(),this.m_segIter.nextSegment()):this.m_segIter.resetToFirstSegment(),null!=this.m_densified&&this.m_densified.insertPointsFromPoints(this.m_densified.getPathCount()-1,-1,this.m_densifiedPoints,0,this.m_densifiedPoints.length-1,!0);break}null!=this.m_densified&&this.m_densified.insertPointsFromPoints(this.m_densified.getPathCount()-1,-1,this.m_densifiedPoints,0,this.m_densifiedPoints.length-1,!0),null===t&&(t=new f,t.addPathPoint2D(null,0,!0)),this.addJoinAndBufferLeftSide(t),n++}if(this.m_currentDensifiedDelta=[0],n>0){const e=this.m_segIter.getStartPointIndex(),s=this.m_segIter.getPathIndex();for(;n>0;){if(this.m_segIter.previousSegment(),i.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getStartPointIndex())),r.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getEndPointIndex())),i.scale(this.m_bufferer.m_rpu),r.scale(this.m_bufferer.m_rpu),this.m_bRunningInGnomonic)if(W(i,r))i.x=r.x;else if(J(i,r))r.x=i.x;else{let e=-1,t=-1;const s=this.m_segIter.getPathIndex(),n=this.m_multiPath.getPathStart(s),o=this.m_multiPath.getPathEnd(s);if(e=this.m_segIter.getStartPointIndex()-1,t=this.m_segIter.getEndPointIndex()+1,e<n&&(e=this.m_multiPath.isClosedPath(s)?o-1:-1),t>o-1&&(t=this.m_multiPath.isClosedPath(s)?n:-1),-1!==e){const t=this.m_multiPath.getXY(e);t.scale(this.m_bufferer.m_rpu),J(t,i)&&(i.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),W(r,e)&&(r.x=e.x)}}this.m_densifiedPoints.length=0,U(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_curveType,r,i,this.m_bufferer.m_segmentStep,Number.NaN,this.m_bufferer.m_radTolerance,this.m_startAzimuth,this.m_endAzimuth,this.m_densifiedPoints,this.m_currentDensifiedDelta),this.addJoinAndBufferLeftSide(t),n--}return i.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getStartPointIndex())),i.scale(this.m_bufferer.m_rpu),this.m_currentBufferedDelta=le(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,i,this.m_lastAzimuth+.5*Math.PI,this.m_lastAzimuth+1.5*Math.PI,this.m_bufferer.m_cornerStep,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,t),this.m_segIter.resetToVertex(e,s),this.m_segIter.nextSegment(),t}return this.m_bNextSegmentCannotJoin=!1,this.m_segIter.nextSegment(),e=this.m_bufferHelper.clone(),e}isSegmentBufferInCurrentGnomonic(e){return null!==this.m_gnomonic&&ge(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,this.m_gnomonicCenterRad,this.m_minGnomonicRadius)}tryUpdateGnomonic(e){const t=new Z,s=new Z,n=[0];return pe(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,t,s,n)?(this.m_gnomonicCenterRad.setCoordsPoint2D(s),this.m_minGnomonicRadius=n[0],this.m_gnomonic=be(this.m_bufferer.m_gcs,t),!0):(this.m_gnomonic=null,!1)}checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(e,t){return this.m_bufferer.checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(this.m_densifiedPoints,e,this.m_startAzimuth[0],this.m_endAzimuth[0],this.m_bRunningInGnomonic,t)}addJoinAndBufferLeftSide(e){const t=this.m_densifiedPoints[0];let s=Number.NaN,n=this.m_startAzimuth[0]-te;const i=this.m_endAzimuth[0]+te;let r=!1;if(!Number.isNaN(this.m_lastAzimuth)){this.m_lastAzimuth>=this.m_startAzimuth[0]?(s=this.m_lastAzimuth+te,n=s+Math.PI-(this.m_lastAzimuth-this.m_startAzimuth[0])):(s=this.m_lastAzimuth+te,n=s+Math.PI-(ee-(this.m_startAzimuth[0]-this.m_lastAzimuth))),r=!(this.m_lastAzimuth>=this.m_startAzimuth[0]&&this.m_lastAzimuth-this.m_startAzimuth[0]<=Math.PI)&&!(this.m_lastAzimuth<this.m_startAzimuth[0]&&this.m_startAzimuth[0]-this.m_lastAzimuth>=Math.PI);let i=!1;if(Math.abs(n-s)<=.5*this.m_bufferer.m_cornerStep&&(r||(i=!0)),i){if(e.removePointFromPath(0,e.getPointCount()-1),!this.m_bRunningInGnomonic){const t=new Z;t.setCoordsPoint2D(e.getXY(e.getPointCount()-1)),t.scale(this.m_bufferer.m_rpu),t.x-this.m_currentBufferedDelta<-Math.PI?this.m_currentBufferedDelta-=ee:t.x-this.m_currentBufferedDelta>Math.PI&&(this.m_currentBufferedDelta+=ee)}n=.5*(n+s)}else if(r){const s=new Z;s.setCoordsPoint2D(t),s.scale(1/this.m_bufferer.m_rpu),e.insertPoint2D(0,-1,s)}else le(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,this.m_densifiedPoints[0],s,n,this.m_bufferer.m_cornerStep,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,e)}this.m_startAzimuth[0]!==this.m_lastAzimuth&&this.m_numWinds++,ue(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,this.m_bufferer.m_curveType,this.m_densifiedPoints,n,i,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,e),this.m_lastAzimuth=this.m_endAzimuth[0]}}class Se extends we{constructor(e,t){super(e.m_progressTracker),this.m_pointIndex=-1,this.m_bufferer=e,this.m_multiPoint=t,this.m_bNeedsSimplify=!1;const s=new _;this.m_multiPoint.queryEnvelope(s);const n=s.getCenter(),i=n.clone();i.scale(this.m_bufferer.m_rpu),this.m_gnomonic=be(this.m_bufferer.m_gcs,n),this.m_gnomonicCenterRad=i.clone(),this.m_minGnomonicRadius=F(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,i,75/180*Math.PI)}next(){if(this.m_bNeedsSimplify=!1,++this.m_pointIndex===this.m_multiPoint.getPointCount())return null;const e=this.m_multiPoint.getXY(this.m_pointIndex);e.scale(this.m_bufferer.m_rpu),this.m_bRunningInGnomonic=this.isPointBufferInCurrentGnomonic(e),this.m_bRunningInGnomonic||(this.m_bRunningInGnomonic=this.tryUpdateGnomonic(e));const t=new f,s=this.m_bufferer.bufferPoint2D(e,this.m_bRunningInGnomonic,t);return this.m_bNeedsSimplify=s,t}isPointBufferInCurrentGnomonic(e){return null!==this.m_gnomonic&&Pe(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,this.m_gnomonicCenterRad,this.m_minGnomonicRadius)}tryUpdateGnomonic(e){const t=new Z,s=new Z,n=[0];return xe(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,t,s,n)?(this.m_gnomonicCenterRad.setCoordsPoint2D(s),this.m_minGnomonicRadius=n[0],this.m_gnomonic=be(this.m_bufferer.m_gcs,t),!0):(this.m_gnomonic=null,!1)}}class ve{getOperatorType(){return 10110}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,s,n,i,r,o,m){if(o){const o=new De(e,t,s,n,i,!1,r,m);return(new S).executeMany(o,t,m)}return new De(e,t,s,n,i,!1,r,m)}execute(t,n,i,r,o,m,a){const h=new e([t]),c=[r],u=this.executeMany(h,n,i,c,o,!1,m,a).next();return u||s("geodesic buffer null output"),u}}class De extends t{constructor(e,t,s,r,o,m,a,h){super(),this.m_currentUnionEnvelope2D=new _,this.m_index=-1,this.m_dindex=-1,this.m_progressTracker=h,m&&n(""),t||i("");0===t.getCoordinateSystemType()&&i(""),this.m_inputGeoms=e,this.m_spatialReference=t,this.m_curveType=s,this.m_distances=r,this.m_convergenceOffset=o,this.m_bOutlineOnly=m,this.m_bUnion=a}next(){let e;for(;e=this.m_inputGeoms.next();)return r(e),this.m_index=this.m_inputGeoms.getGeometryID(),this.m_dindex+1<this.m_distances.length&&this.m_dindex++,this.geodesicBuffer(e,this.m_distances[this.m_dindex]);return null}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}geodesicBuffer(e,t){return ae(e,this.m_spatialReference,this.m_curveType,t,this.m_convergenceOffset,this.m_progressTracker)}}export{ve as OperatorGeodesicBuffer};
5
+ import{S as e,G as t}from"./SimpleGeometryCursor.js";import{b as s,a as n,t as i,c as r,i as o,G as m,n as a,e as h,h as c,f as u,o as l}from"./Geometry.js";import{a as _,h as f,i as d,l as g,b as p,P,u as x,K as b,d as y,j as w,N as C}from"./QuadraticBezier.js";import{O as S}from"./OperatorUnion.js";import{b as v,c as D}from"./tslib.es6.js";import{e as I,p as G,f as M,g as T,h as N,n as k,j as A,k as q,L as E,l as R,m as z,P as O,o as X,q as B,s as Y,G as j,t as F,u as W,v as J,w as U,x as H,S as L}from"./OperatorProject.js";import{a as V,m as K,T as Q,P as Z,S as $,p as ee,q as te}from"./Transformation2D.js";import{p as se,O as ne}from"./OperatorSimplify.js";import{c as ie}from"./Clipper-a9xfvRaw.js";import{O as re}from"./OperatorDifference.js";import{c as oe}from"./GeometryCleaner-DVgW95-D.js";import{O as me}from"./OperatorDensify.js";function ae(e,t,s,n,a,h){n<Number.MAX_VALUE&&n>-Number.MAX_VALUE||i("Geodesic_bufferer.buffer - bad distance"),r(e);const c=oe(e),u=c.getGeometryType();if(o(u)){const e=c.getPointCount(),i=8e6;if(Math.abs(n)>i&&(e>50||u!==m.enumMultiPoint&&4===s&&e>2)){let e=c;const r=n>0?1:-1,o=7e6;let m=n,u=1;do{u++,m=(Math.abs(m)-o)*r}while(Math.abs(m)>i);m=n;for(let n=0;n<u-1;n++)e=ce(e,t,s,o*r,a,u,h),m=(Math.abs(m)-o)*r;return e=ce(e,t,s,m,a,u,h),e}}return ce(c,t,s,n,a,1,h)}class he{constructor(e){this.m_sr=null,this.m_gcs=null,this.m_transform=null,this.m_a=0,this.m_eSquared=0,this.m_rpu=0,this.m_radTolerance=0,this.m_q90=0,this.m_gcs90=0,this.m_gcs180=0,this.m_gcs360=0,this.m_gcs60=0,this.m_ellipticToGeodesicMaxRatio=0,this.m_curveType=0,this.m_bShapePreserving=!1,this.m_distance=0,this.m_absDistance=0,this.m_convergenceOffset=0,this.m_cornerStep=0,this.m_segmentStep=0,this.m_progressTracker=e}bufferPolygon(e){const t=new f,s=new Ce(this,e,t);return this.processGnomonicBufferPiecesCursor(!0,s)}bufferPolyline(e){const t=new Ce(this,e,null);return this.processGnomonicBufferPiecesCursor(!0,t)}bufferMultiPoint(e){const t=new Se(this,e);return this.processGnomonicBufferPiecesCursor(!1,t)}bufferPoint(e){const t=e.getXY();t.scale(this.m_rpu);let s=new f;if(this.bufferPoint2D(t,!1,s)){const e=x(null,s,!0);s=se(s,e,!0,!0,-1,this.m_progressTracker,0,!1)}return s=(new T).foldInto360RangeGeodetic(s,this.m_gcs,2),s}processGnomonicBufferPiecesCursor(e,t){const s=t;let n=s.getGnomonic();const i=A(q()),r=new L;i.queryPrecisionDescriptor(r),r.setTolerance(0,.001),A(q(),void 0,r);let o=new E,m=(new S).executeMany(o,i,this.m_progressTracker,2);const a=V(6,!1),h=K(_,6);this.initializeGrid(a,h);const c=[null,null,null,null,null,null],u=[null,null,null,null,null,null],l=[null,null,null,null,null,null];let f,d,p;for(;null!==(f=s.next());){if(d=s.getGnomonic(),d!==n){if(null!==n){let t=m.next();if(o=null,m=null,null!=t){const s=x(i,t,!0),r=g(s);t=n.unproject(t,r,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,a,h,c,u,l)}}null!==d&&(o=new E,m=(new S).executeMany(o,i,this.m_progressTracker,2)),n=d}if(s.isRunningInGnomonic()){if(d.project(f),s.needsSimplify()){const e=x(null,f,!0);f=se(f,e,!0,!0,-1,this.m_progressTracker,0,!1)}o.tick(ye(f)),m.tock()}else this.putInGridCursors(e,f,i,!0,a,h,c,u,l)}let P=!1;for(let _=0;_<6;_++)if(null!=l[_]){P=!0;break}if(P){let t=!1;const r=[null,null,null,null,null,null];if(e){const n=s.m_densified;if(s.m_densified=null,null!==n){const s=new Q;s.scale(1/this.m_rpu,1/this.m_rpu),n.applyTransformation(s),this.m_distance>0?this.putInGridCursors(e,n,i,!1,a,h,c,u,l):(this.processInGrid(e,n,!1,a,h,c,r),t=!0)}}const _=new E,f=(new S).executeMany(_,this.m_gcs,this.m_progressTracker,2);if(null!==m){let t=m.next();o=null,m=null;const s=x(i,t,!0),r=g(s);t=n.unproject(t,r,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,a,h,c,u,l)}for(let e=0;e<6;e++)if(null!=l[e]){let s=l[e].next();l[e]=null,u[e]=null,t&&null!==r[e]&&(s=(new re).execute(r[e],s,i,this.m_progressTracker));const n=x(i,s,!0),o=g(n);s=c[e].unproject(s,o,this.m_progressTracker),s=(new ne).execute(s,this.m_gcs,!0,this.m_progressTracker),_.tick(ye(s)),f.tock()}p=f.next()}else{let t,r=!1;if(e){let e=s.m_densified;if(s.m_densified=null,null!==e){const s=new Q;s.scale(1/this.m_rpu,1/this.m_rpu),e.applyTransformation(s),d.project(e);const n=x(null,e,!0);e=se(e,n,!1,!0,-1,this.m_progressTracker,0,!1),this.m_distance>0?(o.tick(ye(e)),m.tock()):(t=e,r=!0)}}let a=m.next();o=null,m=null,r&&(a=(new re).execute(t,a,i,this.m_progressTracker));const h=x(i,a,!0),c=g(h);p=n.unproject(a,c,this.m_progressTracker),p=(new ne).execute(p,this.m_gcs,!0,this.m_progressTracker)}return p=(new T).foldInto360RangeGeodetic(p,this.m_gcs,2),p}putInGridCursors(e,t,s,n,i,r,o,m,a){const h=[null,null,null,null,null,null];this.processInGrid(e,t,n,i,r,o,h);for(let c=0;c<6;c++)null!==h[c]&&(null===m[c]&&(m[c]=new E,a[c]=(new S).executeMany(m[c],s,this.m_progressTracker,2)),m[c].tick(ye(h[c])),a[c].tock())}processInGrid(e,t,s,n,i,r,o){const m=.01,a=this.insertGeodeticPointsAlongGrid(t,i,m);for(let h=0;h<6;h++){if(n[h])continue;const e=i[h].clone();e.inflateCoords(m,m);const c=b(t,e),u=p(null,c,!1).total();let l=ie(a,e,u,Number.NaN,this.m_progressTracker);if(null!==l&&!l.isEmpty()){if(l===a&&(l=l.clone()),null===r[h]){const e=new Z;h<3?e.setCoords(0,1):e.setCoords(0,-1);const t=new Z;t.setAdd(i[h].getCenter(),e),r[h]=be(this.m_gcs,t)}r[h].project(l);const e=x(null,l,!0);l=se(l,e,s,!0,-1,this.m_progressTracker,0,!1),o[h]=l}}}insertGeodeticPointsAlongGrid(e,t,s){const n=_.construct(t[3].xmin,t[3].ymin,t[2].xmax,t[2].ymax),i=R(this.m_gcs,n,e,!0,this.m_progressTracker),r=new y,o=r.addGeometry(i);return z(r,o,this.m_gcs,0,2,!0,t[0].xmax+s),z(r,o,this.m_gcs,0,2,!0,t[1].xmax+s),z(r,o,this.m_gcs,0,2,!1,t[1].ymin+s),0!==s&&(z(r,o,this.m_gcs,0,2,!0,t[0].xmax-s),z(r,o,this.m_gcs,0,2,!0,t[1].xmax-s),z(r,o,this.m_gcs,0,2,!1,t[1].ymin-s)),r.getGeometry(o)}initializeGrid(e,t){for(let s=0;s<6;s++)e[s]=!1;t[0].setCoords({xmin:-this.m_gcs180,ymin:0,xmax:-this.m_gcs60,ymax:this.m_gcs90}),t[1].setCoords({xmin:-this.m_gcs60,ymin:0,xmax:this.m_gcs60,ymax:this.m_gcs90}),t[2].setCoords({xmin:this.m_gcs60,ymin:0,xmax:this.m_gcs180,ymax:this.m_gcs90}),t[3].setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:-this.m_gcs60,ymax:0}),t[4].setCoords({xmin:-this.m_gcs60,ymin:-this.m_gcs90,xmax:this.m_gcs60,ymax:0}),t[5].setCoords({xmin:this.m_gcs60,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:0})}checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(e,t,s,n,i,r){const o=e[0],m=e.at(-1),a=o.y<m.y?o.y:m.y,h=o.y>m.y?o.y:m.y,c=G.q(this.m_a,this.m_eSquared,a),u=G.q(this.m_a,this.m_eSquared,h);if(this.m_q90-(c+t+this.m_absDistance)>.001&&this.m_q90+(u-t-this.m_absDistance)>.001)return!1;const l=s-te,_=n+te,f=l-Math.PI,d=l+Math.PI,g=_+Math.PI,p=[Number.NaN],P=[Number.NaN],x=[Number.NaN],b=[Number.NaN];let y=!1;if(_e(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,o,l,f,m,_,p,P),_e(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,g,_,o,f,x,b),(_<p[0]&&p[0]<g||_<P[0]&&P[0]<g)&&(y=!0),y||(f<x[0]&&x[0]<l||f<b[0]&&b[0]<l)&&(y=!0),!y&&i)return!1;const w=[];for(let v=e.length-1;v>=0;v--)w.push(e[v]);r.setEmpty(),r.addPathPoint2D(null,0,!0);let C=0;C=ue(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,e,l,_,i,C,r),C=le(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,_,g,this.m_cornerStep,i,C,r,p[0],P[0]),C=ue(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,w,g,d,i,C,r),C=le(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,o,f,l,this.m_cornerStep,i,C,r,x[0],b[0]);let S=!1;return i||(S=this.checkAndPrepForPole(r)),y||S}bufferPoint2D(e,t,s){s.setEmpty(),s.addPathPoint2D(null,0,!0);const n=0;le(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,e,-this.m_cornerStep,2*Math.PI,this.m_cornerStep,t,n,s);let i=!1;return t||(i=this.checkAndPrepForPole(s)),i}checkAndPrepForPole(e){const t=this.checkAndPrepForPoleTouch(e),s=this.checkAndPrepForPoleWrap(e);return t||s}checkAndPrepForPoleTouch(e){const t=new _;return e.queryEnvelope(t),!(!O(t.ymax,this.m_gcs90)&&!O(t.ymin,-this.m_gcs90))&&(this.prepPoleTouch(e),!0)}checkAndPrepForPoleWrap(e){const t=e.getXY(0),s=e.getXY(e.getPointCount()-1);return Math.abs(t.x-s.x)>this.m_gcs180?(this.prepSinglePoleWrap(e),!0):this.checkAndPrepForDoublePoleWrap(e)}checkAndPrepForDoublePoleWrap(e){return e.calculateArea2D()<0&&(this.prepDoublePoleWrap(e),!0)}prepPoleTouch(e){const t=new f;t.insertPath2D(-1,null,0,0,!0);const s=e.getPathStart(0),n=e.getPathEnd(0),i=n-s;let r=-1;for(r=s;r<n;r++){const t=e.getXY(r),s=O(t.y,this.m_gcs90),n=O(t.y,-this.m_gcs90);if(!s&&!n)break}let o=r,m=!1,a=Number.NaN;do{const n=e.getXY(o),r=O(n.y,this.m_gcs90),h=O(n.y,-this.m_gcs90),c=s+(o+1-s)%i;if(r||h){let s=Z.construct(a,n.y);t.insertPoint2D(0,-1,s);const i=e.getXY(c),r=O(i.y,this.m_gcs90),o=O(i.y,-this.m_gcs90);r||o||(s=Z.construct(i.x,n.y),m?t.setXY(t.getPointCount()-1,s):t.insertPoint2D(0,-1,s)),m=!0}else t.insertPoint2D(0,-1,n),a=n.x,m=!1;o=c}while(o!==r);e.setEmpty(),e.add(t,!1)}prepSinglePoleWrap(e){const t=new f,s=new f,n=new Q,i=e.getXY(e.getPathStart(0)),r=e.getXY(e.getPathEnd(0)-1),o=this.m_gcs360,m=this.m_gcs180,a=new _;a.setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:this.m_gcs90});const h=new _;e.queryEnvelope(h);const c=Math.ceil(h.width()/o);let u,l;i.x>r.x?(u=-o,l=this.m_gcs90):(u=o,l=-this.m_gcs90),n.setShiftCoords(u,0),t.addPath(e,0,!0),s.add(t,!1);const d=new P;for(let _=0;_<c;_++)s.applyTransformation(n),s.getPointByVal(0,d),t.lineToPoint(d),t.addSegmentsFromPath(s,0,0,s.getSegmentCount()-1,!1);const g=t.getXY(0),x=t.getXY(t.getPointCount()-1);g.y=l,x.y=l,t.lineTo(x);const w=new Z;for(w.setCoordsPoint2D(x),w.x-=.5*u;Math.abs(w.x-g.x)>m;)t.lineTo(w),w.x-=.5*u;t.lineTo(g);const C=a.getCenterX(),S=new _;t.queryEnvelope(S);let v=0;const D=S.getCenter().x;D-C>m?v=-Math.ceil((D-C-m)/o):C-D>m&&(v=Math.ceil((C-D-m)/o)),0!==v&&(n.setShiftCoords(v*o,0),t.applyTransformation(n));const I=new y,G=I.addGeometry(t);z(I,G,this.m_gcs,0,2,!0,a.xmin),z(I,G,this.m_gcs,0,2,!0,a.xmax);const M=I.getGeometry(G),T=b(M,a);T.inflateCoords(0,1);const N=p(null,T,!0).total(),k=ie(M,a,N,Number.NaN,this.m_progressTracker);e.setEmpty(),e.add(k,!1)}prepDoublePoleWrap(e){const t=this.m_gcs360,s=this.m_gcs180,n=new _;n.setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:this.m_gcs90});const i=n.getCenter().x,r=new _;e.queryPathEnvelope(0,r);let o,m=0,a=r.getCenter().x;if(a-i>s?m=-Math.ceil((a-i-s)/t):i-a>s&&(m=Math.ceil((i-a-s)/t)),0!==m){const s=new Q;s.setShiftCoords(m*t,0),e.getImpl().applyTransformationToPath(s,0),e.queryPathEnvelope(0,r),a=r.getCenter().x}const h=new _;n.containsExclusiveEnvelope(r)?(o=!1,h.setCoords({env2D:n})):(o=!0,h.setCoords({env2D:n}),h.xmin-=t,h.xmax+=t);let c=e.createInstance();c.addPathPoint2D(null,0,!0);const u=new Z;if(u.setCoords(h.xmin,h.ymin),c.insertPoint2D(0,-1,u),u.setCoords(h.xmin,h.ymax),c.insertPoint2D(0,-1,u),u.setCoords(.5*(h.xmin+h.xmax),h.ymax),c.insertPoint2D(0,-1,u),u.setCoords(h.xmax,h.ymax),c.insertPoint2D(0,-1,u),u.setCoords(h.xmax,h.ymin),c.insertPoint2D(0,-1,u),u.setCoords(.5*(h.xmin+h.xmax),h.ymin),c.insertPoint2D(0,-1,u),o){c.addPath(e,0,!0);const s=new Q;a<i?s.setShiftCoords(t,0):s.setShiftCoords(-t,0),e.getImpl().applyTransformationToPath(s,0),c.addPath(e,0,!0);const r=new y,o=r.addGeometry(c);z(r,o,this.m_gcs,0,2,!0,n.xmin),z(r,o,this.m_gcs,0,2,!0,n.xmax),c=r.getGeometry(o);const m=b(c,n);m.inflateCoords(0,1);const h=p(null,m,!0).total();c=ie(c,n,h,Number.NaN,this.m_progressTracker)}else c.addPath(e,0,!0);e.setEmpty(),e.add(c,!1)}setMinCornerStep(){const e={stack:[],error:void 0,hasError:!1};try{let s=Math.min(Math.PI*this.m_a-this.m_absDistance,this.m_absDistance);s=Math.min(s,.125*this.m_a*Math.PI);const n=new Z;n.setCoords(0,10*this.m_rpu);const i=0;let r=45*this.m_rpu;const o=v(e,new $(new X,new X),!1),m=v(e,new $(new X,new X),!1),a=v(e,new $(new X,new X),!1),h=v(e,new $(new X,new X),!1),c=new Z,u=new Z,l=new Z,_=new Z;for(B.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,s,i,o.at(0),o.at(1)),c.setCoords(o.at(0).val,o.at(1).val),B.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,s,r,m.at(0),m.at(1)),u.setCoords(m.at(0).val,m.at(1).val);;){const e={stack:[],error:void 0,hasError:!1};try{const t=.5*(i+r);B.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,s,t,a.at(0),a.at(1)),l.setCoords(a.at(0).val,a.at(1).val);const o=v(e,new X,!1),f=v(e,new X,!1);B.geodeticDistance(this.m_a,this.m_eSquared,c.x,c.y,u.x,u.y,o,f,null,2),B.geodeticCoordinate(this.m_a,this.m_eSquared,c.x,c.y,.5*o.val,f.val,h.at(0),h.at(1),2),_.setCoords(h.at(0).val,h.at(1).val);const d=v(e,new X,!1);B.geodeticDistance(this.m_a,this.m_eSquared,l.x,l.y,_.x,_.y,d,null,null,2);if(d.val<=this.m_convergenceOffset)break;r*=.9,B.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,s,r,m.at(0),m.at(1)),u.setCoords(m.at(0).val,m.at(1).val)}catch(t){e.error=t,e.hasError=!0}finally{D(e)}}const f=r-i,d=2*Math.PI/Math.ceil(2*Math.PI/f);this.m_cornerStep=d}catch(s){e.error=s,e.hasError=!0}finally{D(e)}}setMinSegmentStep(){const e={stack:[],error:void 0,hasError:!1};try{let n=Math.min(Math.PI*this.m_a-this.m_absDistance,this.m_absDistance);n=Math.min(n,.125*this.m_a*Math.PI);const i=new Z,r=new Z;i.setCoords(0,10*this.m_rpu),r.setCoords(10*this.m_rpu,10*this.m_rpu);const o=v(e,new X,!1),m=v(e,new X,!1),a=v(e,new X,!1);B.geodeticDistance(this.m_a,this.m_eSquared,i.x,i.y,r.x,r.y,a,o,m,this.m_curveType);const h=v(e,new $(new X,new X),!1),c=v(e,new $(new X,new X),!1),u=new Z,l=v(e,new X,!1),_=v(e,new $(new X,new X),!1),f=v(e,new $(new X,new X),!1),d=v(e,new $(new X,new X),!1),g=v(e,new $(new X,new X),!1),p=new Z,P=new Z,x=new Z,b=new Z,y=0;let w=1;const C=o.val,S=m.val,I=C-.5*Math.PI,G=S+.5*Math.PI,M=a.val;for(B.geodesicCoordinate(this.m_a,this.m_eSquared,i.x,i.y,n,I,_.at(0),_.at(1)),p.setCoords(_.at(0).val,_.at(1).val),B.geodesicCoordinate(this.m_a,this.m_eSquared,r.x,r.y,n,G,f.at(0),f.at(1)),P.setCoords(f.at(0).val,f.at(1).val);;){const e={stack:[],error:void 0,hasError:!1};try{const s=.5*(y+w);B.geodeticCoordinate(this.m_a,this.m_eSquared,i.x,i.y,s*M,C,h.at(0),h.at(1),this.m_curveType),u.setCoords(h.at(0).val,h.at(1).val),B.geodeticDistance(this.m_a,this.m_eSquared,i.x,i.y,u.x,u.y,null,null,l,this.m_curveType);const o=l.val+.5*Math.PI;B.geodesicCoordinate(this.m_a,this.m_eSquared,u.x,u.y,n,o,d.at(0),d.at(1)),x.setCoords(d.at(0).val,d.at(1).val);const m=v(e,new X,!1),a=v(e,new X,!1);B.geodeticDistance(this.m_a,this.m_eSquared,p.x,p.y,P.x,P.y,m,a,null,2),B.geodeticCoordinate(this.m_a,this.m_eSquared,p.x,p.y,.5*m.val,a.val,g.at(0),g.at(1),2),b.setCoords(g.at(0).val,g.at(1).val);const _=v(e,new X,!1);B.geodeticDistance(this.m_a,this.m_eSquared,x.x,x.y,b.x,b.y,_,null,null,2);if(_.val<=this.m_convergenceOffset)break;{const e={stack:[],error:void 0,hasError:!1};try{w*=.9,B.geodeticCoordinate(this.m_a,this.m_eSquared,i.x,i.y,w*M,C,c.at(0),c.at(1),this.m_curveType),r.setCoords(c.at(0).val,c.at(1).val);const t=v(e,new X,!1);B.geodeticDistance(this.m_a,this.m_eSquared,i.x,i.y,r.x,r.y,null,null,t,this.m_curveType);const s=t.val+.5*Math.PI;B.geodesicCoordinate(this.m_a,this.m_eSquared,r.x,r.y,n,s,f.at(0),f.at(1)),P.setCoords(f.at(0).val,f.at(1).val)}catch(t){e.error=t,e.hasError=!0}finally{D(e)}}}catch(s){e.error=s,e.hasError=!0}finally{D(e)}}let T=w*M;T>1e5&&(T=1e5),this.m_segmentStep=T}catch(n){e.error=n,e.hasError=!0}finally{D(e)}}setConvergenceOffset(){let e;e=this.m_absDistance>5e4?100:this.m_absDistance>1e4?10:1,this.m_absDistance/e<500&&(e=this.m_absDistance/500),e<.01&&(e=.01),this.m_convergenceOffset=e}}function ce(e,t,s,n,i,r,o){if(e.isEmpty())return new f({vd:e.getDescription()});let x=e;if(a(x)){const e=10*t.getTolerance(0);x=(new me).execute(x,0,e,0,o,12e3)}const b=new he(o);b.m_sr=t,b.m_gcs=t.getGCS(),b.m_transform=I(t,b.m_gcs,null);const y=Y();b.m_gcs.querySpheroidData(y);const w=new _;x.queryEnvelope(w),b.m_a=y.majorSemiAxis,b.m_eSquared=y.e2,b.m_rpu=b.m_gcs.getUnit().getUnitToBaseFactor(),b.m_gcs90=.5*Math.PI/b.m_rpu,b.m_gcs180=Math.PI/b.m_rpu,b.m_gcs360=2*Math.PI/b.m_rpu,b.m_gcs60=b.m_gcs360/6,b.m_q90=G.q90(b.m_a,b.m_eSquared),b.m_ellipticToGeodesicMaxRatio=.5*b.m_a*Math.PI/b.m_q90;const C=b.m_gcs.getTolerance(0);b.m_radTolerance=C*b.m_rpu,4===s?(b.m_curveType=2,b.m_bShapePreserving=!0):(b.m_curveType=s,b.m_bShapePreserving=!1),b.m_distance=n,b.m_absDistance=Math.abs(n),Number.isNaN(i)||i<=0?b.setConvergenceOffset():b.m_convergenceOffset=Math.max(i,.001),b.m_convergenceOffset/=r;let S,v=x.getGeometryType();if(h(v)){const e=new d({vd:x.getDescription()});e.addSegment(x,!0),S=e,v=m.enumPolyline}else if(v===m.enumEnvelope){const e=x,t=new _;e.queryEnvelope(t);const s=g(p(b.m_sr,w,!0));if(t.minDimension()<=s)if(0===t.maxDimension()){const t=new P({vd:x.getDescription()});e.getCenter(t),S=t,v=m.enumPoint}else{const t=new d({vd:x.getDescription()});t.addEnvelope(e,!1),S=t,v=m.enumPolyline}else{const t=new f({vd:x.getDescription()});t.addEnvelope(e,!1),S=t,v=m.enumPolygon}}else S=x;if(b.setMinCornerStep(),c(v)||b.setMinSegmentStep(),b.m_absDistance<=.5*b.m_convergenceOffset)return v!==m.enumPolygon?new f({vd:S.getDescription()}):b.m_bShapePreserving?S:M(S,b.m_sr,b.m_curveType,b.m_segmentStep,-1,o);if(b.m_distance<0&&v!==m.enumPolygon)return new f({vd:S.getDescription()});if(b.m_bShapePreserving&&u(v)){const e=M(S,t,4,Number.NaN,b.m_convergenceOffset,o);S=(new T).execute(e,b.m_transform,o)}else S=(new T).execute(S,b.m_transform,o);if(S=N(S,b.m_gcs),S.isEmpty())return new f({vd:S.getDescription()});!b.m_bShapePreserving&&u(v)&&(S=k(b.m_rpu,S)),S=de(S,b.m_gcs);let D=new f;switch(v){case m.enumPolygon:D=b.bufferPolygon(S);break;case m.enumPolyline:D=b.bufferPolyline(S);break;case m.enumMultiPoint:D=b.bufferMultiPoint(S);break;case m.enumPoint:D=b.bufferPoint(S);break;default:l("")}const A=(new T).execute(D,b.m_transform.getInverse(),o);return A.mergeVertexDescription(S.getDescription()),A}function ue(e,t,s,n,i,r,o,m,a,h,c){const u={stack:[],error:void 0,hasError:!1};try{const l=new Z;l.setNAN(),a||c.getPointCount()>0&&(l.setCoordsPoint2D(c.getXY(c.getPointCount()-1)),l.scale(s));const _=v(u,new X,!1),f=v(u,new $(new X,new X),!1),d=new Z,g=new Z,p=r.at(-1),P=1/s;for(let s=0;s<r.length;s++){const u=r[s];let x;0===s?x=o:s===r.length-1?x=m:(B.geodeticDistance(e,t,p.x,p.y,u.x,u.y,null,null,_,i),x=_.val-.5*Math.PI),B.geodesicCoordinate(e,t,u.x,u.y,n,x,f.at(0),f.at(1)),a?g.setCoords(f.at(0).val,f.at(1).val):(d.setCoords(f.at(0).val,f.at(1).val),h=fe(u.x,d.x,l.x,h),g.setCoords(h+d.x,d.y),l.setCoordsPoint2D(g)),g.scale(P),c.insertPoint2D(0,-1,g)}return h}catch(l){u.error=l,u.hasError=!0}finally{D(u)}}function le(e,t,s,n,i,r,o,m,a,h,c,u=Number.NaN,l=Number.NaN){const _={stack:[],error:void 0,hasError:!1};try{if(o-r<m)return h;const f=v(_,new $(new X,new X),!1),d=new Z,g=new Z,p=new Z;g.setNAN(),a||c.getPointCount()>0&&(g.setCoordsPoint2D(c.getXY(c.getPointCount()-1)),g.scale(s));let P=Math.ceil(r/m),x=P++*m;x===r&&(x=P++*m);let b=r;const y=1/s;for(;x<o+m&&(b<u&&u<x?(x=u,P--):b<l&&l<x&&(x=l,P--),!(x>=o));)B.geodesicCoordinate(e,t,i.x,i.y,n,x,f.at(0),f.at(1)),a?p.setCoords(f.at(0).val,f.at(1).val):(d.setCoords(f.at(0).val,f.at(1).val),h=fe(i.x,d.x,g.x,h),p.setCoords(h+d.x,d.y),g.setCoordsPoint2D(p)),p.scale(y),c.insertPoint2D(0,-1,p),b=x,x=P++*m;return h}catch(f){_.error=f,_.hasError=!0}finally{D(_)}}function _e(e,t,s,n,i,r,o,m,a,h,c){const u={stack:[],error:void 0,hasError:!1};try{const s=new Z,l=new Z,_=v(u,new $(new X,new X),!1);B.geodesicCoordinate(e,t,i.x,i.y,n,r,_.at(0),_.at(1)),s.setCoords(_.at(0).val,_.at(1).val),B.geodesicCoordinate(e,t,i.x,i.y,n,o,_.at(0),_.at(1)),l.setCoords(_.at(0).val,_.at(1).val);const f=v(u,new X,!1);for(B.geodeticDistance(e,t,m.x,m.y,s.x,s.y,null,f,null,0),h[0]=f.val,B.geodeticDistance(e,t,m.x,m.y,l.x,l.y,null,f,null,0),c[0]=f.val;h[0]<=c[0];)h[0]+=ee;for(;h[0]>c[0];)h[0]-=ee;for(;h[0]>=a;)h[0]-=ee,c[0]-=ee;for(;h[0]<a;)h[0]+=ee,c[0]+=ee}catch(l){u.error=l,u.hasError=!0}finally{D(u)}}function fe(e,t,s,n){if(Number.isNaN(s)){for(;n+t-e>Math.PI;)n-=ee;for(;e-(n+t)>Math.PI;)n+=ee;return n}return n+t-s>Math.PI?n-=ee:s-(n+t)>Math.PI&&(n+=ee),n}function de(e,t){const s=e.getGeometryType();let n;if(n=u(s)?e.getPathCount():s===m.enumMultiPoint?e.getPointCount():1,1===n)return e;const i=[],r=[];for(let m=0;m<n;m++){i.push(m);const n=new Z;if(u(s)){const t=new _;e.queryPathEnvelope(m,t),n.assign(t.getCenter())}else n.assign(e.getXY(m));const o=t.toGeohash(n);r.push(o)}i.sort(((e,t)=>r[e]<r[t]?-1:r[e]>r[t]?1:0));const o=e.createInstance();for(let m=0;m<n;m++){const t=i[m];u(s)?o.addPath(e,t,!0):o.addPoints(e,t,t+1)}return o}function ge(e,t,s,n,i,r){const o={stack:[],error:void 0,hasError:!1};try{if(n>=r)return!1;const m=s[0],a=s.at(-1),h=v(o,new X,!1),c=v(o,new X,!1),u=v(o,new X,!1);B.greatEllipticDistance(e,t,i.x,i.y,m.x,m.y,h,null,null),B.greatEllipticDistance(e,t,i.x,i.y,a.x,a.y,c,null,null),B.greatEllipticDistance(e,t,m.x,m.y,a.x,a.y,u,null,null);let l=Math.min(h.val,c.val)+u.val,_=l+n;if(_<r)return!0;const f=v(o,new X,!1);l=Math.max(h.val,c.val);for(let n=1;n<s.length-1;n++){const r=s[n];B.greatEllipticDistance(e,t,i.x,i.y,r.x,r.y,f,null,null),f.val>l&&(l=f.val)}return _=l+n,_<r}catch(m){o.error=m,o.hasError=!0}finally{D(o)}}function pe(e,t,s,n,i,r,o,m){let a;if(n.length%2==0){const e=n.length>>1,t=n[e],s=n[e-1];a=Z.lerp(t,s,.5)}else{a=n[n.length-1>>1].clone()}const h=a.clone(),c=F(e,t,h,75/180*Math.PI);return!!ge(e,t,n,i,h,c)&&(null!==r&&(r.setCoordsPoint2D(a),r.scale(1/s)),null!==o&&o.setCoordsPoint2D(h),null!==m&&(m[0]=c),!0)}function Pe(e,t,s,n,i,r){const o={stack:[],error:void 0,hasError:!1};try{if(n>=r)return!1;const m=v(o,new X,!1);B.greatEllipticDistance(e,t,i.x,i.y,s.x,s.y,m,null,null);return m.val+n<r}catch(m){o.error=m,o.hasError=!0}finally{D(o)}}function xe(e,t,s,n,i,r,o,m){const a=F(e,t,n,75/180*Math.PI);return!!Pe(e,t,n,i,n,a)&&(null!==r&&(r.setCoordsPoint2D(n),r.scale(1/s)),null!==o&&o.setCoordsPoint2D(n),null!==m&&(m[0]=a),!0)}function be(e,t){return new j(e,t)}function ye(e){return w(e,0)||C(e,0),e}class we{constructor(e){this.m_bRunningInGnomonic=!1,this.m_bNeedsSimplify=!1,this.m_gnomonic=null,this.m_gnomonicCenterRad=new Z,this.m_minGnomonicRadius=Number.NaN,this.m_progressTracker=e}isRunningInGnomonic(){return this.m_bRunningInGnomonic}needsSimplify(){return this.m_bNeedsSimplify}getGnomonic(){return this.m_gnomonic}}class Ce extends we{constructor(e,t,s){super(e.m_progressTracker),this.m_segIter=null,this.m_bNextSegmentCannotJoin=!1,this.m_currentDensifiedDelta=[0],this.m_currentBufferedDelta=0,this.m_lastAzimuth=0,this.m_startAzimuth=[0],this.m_endAzimuth=[0],this.m_numWinds=0,this.m_debugCounter=0,this.m_bufferHelper=new f,this.m_densifiedPoints=[],this.m_bufferer=e,this.m_multiPath=t,this.m_densified=s,this.m_bNeedsSimplify=!0;const n=new _;this.m_multiPath.queryEnvelope(n);const i=n.getCenter(),r=i.clone();r.scale(this.m_bufferer.m_rpu),this.m_gnomonic=be(this.m_bufferer.m_gcs,i),this.m_gnomonicCenterRad=r.clone(),this.m_minGnomonicRadius=F(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,r,75/180*Math.PI)}next(){let e;if(this.m_bNextSegmentCannotJoin)return this.m_bNextSegmentCannotJoin=!1,this.m_segIter.nextSegment(),e=this.m_bufferHelper.clone(),e;if(null===this.m_segIter){if(this.m_segIter=this.m_multiPath.getImpl().querySegmentIterator(),!this.m_segIter.nextPath())return null;null!==this.m_densified&&this.m_densified.addPathPoint2D(null,0,!0)}if(!this.m_segIter.hasNextSegment()){if(!this.m_segIter.nextPath())return null;null!=this.m_densified&&this.m_densified.addPathPoint2D(null,0,!0)}let t=null;this.m_currentBufferedDelta=0,this.m_currentDensifiedDelta=[0],this.m_numWinds=0,this.m_lastAzimuth=Number.NaN,this.m_bNextSegmentCannotJoin=!1,this.m_densifiedPoints.length=0;const s=16;let n=0;const i=new Z,r=new Z;for(;this.m_segIter.hasNextSegment()&&this.m_numWinds<s;){const e=this.m_segIter.nextSegment();if(i.setCoordsPoint2D(e.getStartXY()),r.setCoordsPoint2D(e.getEndXY()),i.scale(this.m_bufferer.m_rpu),r.scale(this.m_bufferer.m_rpu),W(i,r))i.x=r.x;else if(J(i,r))r.x=i.x;else{let e=-1,t=-1;const s=this.m_segIter.getPathIndex(),n=this.m_multiPath.getPathStart(s),o=this.m_multiPath.getPathEnd(s);if(e=this.m_segIter.getStartPointIndex()-1,t=this.m_segIter.getEndPointIndex()+1,e<n&&(e=this.m_multiPath.isClosedPath(s)?o-1:-1),t>o-1&&(t=this.m_multiPath.isClosedPath(s)?n:-1),-1!==e){const t=this.m_multiPath.getXY(e);t.scale(this.m_bufferer.m_rpu),J(t,i)&&(i.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),W(r,e)&&(r.x=e.x)}}this.m_densifiedPoints.length=0;const s=U(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_curveType,i,r,this.m_bufferer.m_segmentStep,Number.NaN,this.m_bufferer.m_radTolerance,this.m_startAzimuth,this.m_endAzimuth,this.m_densifiedPoints,this.m_currentDensifiedDelta);if(0===n)this.m_bRunningInGnomonic=this.isSegmentBufferInCurrentGnomonic(this.m_densifiedPoints),this.m_bRunningInGnomonic||(this.m_bRunningInGnomonic=this.tryUpdateGnomonic(this.m_densifiedPoints));else if(this.m_bRunningInGnomonic){if(!this.isSegmentBufferInCurrentGnomonic(this.m_densifiedPoints)){this.m_segIter.previousSegment(),this.m_segIter.previousSegment(),this.m_segIter.nextSegment();break}}else{if(pe(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_densifiedPoints,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,null,null,null)){this.m_segIter.previousSegment(),this.m_segIter.previousSegment(),this.m_segIter.nextSegment();break}}if(0===s||H(i,r)?(this.m_bufferHelper.setEmpty(),this.m_bufferer.bufferPoint2D(i,this.m_bRunningInGnomonic,this.m_bufferHelper),this.m_bNextSegmentCannotJoin=!0):(this.m_bufferHelper.setEmpty(),this.m_bNextSegmentCannotJoin=this.checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(s,this.m_bufferHelper)),this.m_bNextSegmentCannotJoin){this.m_segIter.previousSegment(),this.m_segIter.hasPreviousSegment()?(this.m_segIter.previousSegment(),this.m_segIter.nextSegment()):this.m_segIter.resetToFirstSegment(),null!=this.m_densified&&this.m_densified.insertPointsFromPoints(this.m_densified.getPathCount()-1,-1,this.m_densifiedPoints,0,this.m_densifiedPoints.length-1,!0);break}null!=this.m_densified&&this.m_densified.insertPointsFromPoints(this.m_densified.getPathCount()-1,-1,this.m_densifiedPoints,0,this.m_densifiedPoints.length-1,!0),null===t&&(t=new f,t.addPathPoint2D(null,0,!0)),this.addJoinAndBufferLeftSide(t),n++}if(this.m_currentDensifiedDelta=[0],n>0){const e=this.m_segIter.getStartPointIndex(),s=this.m_segIter.getPathIndex();for(;n>0;){if(this.m_segIter.previousSegment(),i.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getStartPointIndex())),r.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getEndPointIndex())),i.scale(this.m_bufferer.m_rpu),r.scale(this.m_bufferer.m_rpu),this.m_bRunningInGnomonic)if(W(i,r))i.x=r.x;else if(J(i,r))r.x=i.x;else{let e=-1,t=-1;const s=this.m_segIter.getPathIndex(),n=this.m_multiPath.getPathStart(s),o=this.m_multiPath.getPathEnd(s);if(e=this.m_segIter.getStartPointIndex()-1,t=this.m_segIter.getEndPointIndex()+1,e<n&&(e=this.m_multiPath.isClosedPath(s)?o-1:-1),t>o-1&&(t=this.m_multiPath.isClosedPath(s)?n:-1),-1!==e){const t=this.m_multiPath.getXY(e);t.scale(this.m_bufferer.m_rpu),J(t,i)&&(i.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),W(r,e)&&(r.x=e.x)}}this.m_densifiedPoints.length=0,U(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_curveType,r,i,this.m_bufferer.m_segmentStep,Number.NaN,this.m_bufferer.m_radTolerance,this.m_startAzimuth,this.m_endAzimuth,this.m_densifiedPoints,this.m_currentDensifiedDelta),this.addJoinAndBufferLeftSide(t),n--}return i.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getStartPointIndex())),i.scale(this.m_bufferer.m_rpu),this.m_currentBufferedDelta=le(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,i,this.m_lastAzimuth+.5*Math.PI,this.m_lastAzimuth+1.5*Math.PI,this.m_bufferer.m_cornerStep,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,t),this.m_segIter.resetToVertex(e,s),this.m_segIter.nextSegment(),t}return this.m_bNextSegmentCannotJoin=!1,this.m_segIter.nextSegment(),e=this.m_bufferHelper.clone(),e}isSegmentBufferInCurrentGnomonic(e){return null!==this.m_gnomonic&&ge(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,this.m_gnomonicCenterRad,this.m_minGnomonicRadius)}tryUpdateGnomonic(e){const t=new Z,s=new Z,n=[0];return pe(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,t,s,n)?(this.m_gnomonicCenterRad.setCoordsPoint2D(s),this.m_minGnomonicRadius=n[0],this.m_gnomonic=be(this.m_bufferer.m_gcs,t),!0):(this.m_gnomonic=null,!1)}checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(e,t){return this.m_bufferer.checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(this.m_densifiedPoints,e,this.m_startAzimuth[0],this.m_endAzimuth[0],this.m_bRunningInGnomonic,t)}addJoinAndBufferLeftSide(e){const t=this.m_densifiedPoints[0];let s=Number.NaN,n=this.m_startAzimuth[0]-te;const i=this.m_endAzimuth[0]+te;let r=!1;if(!Number.isNaN(this.m_lastAzimuth)){this.m_lastAzimuth>=this.m_startAzimuth[0]?(s=this.m_lastAzimuth+te,n=s+Math.PI-(this.m_lastAzimuth-this.m_startAzimuth[0])):(s=this.m_lastAzimuth+te,n=s+Math.PI-(ee-(this.m_startAzimuth[0]-this.m_lastAzimuth))),r=!(this.m_lastAzimuth>=this.m_startAzimuth[0]&&this.m_lastAzimuth-this.m_startAzimuth[0]<=Math.PI)&&!(this.m_lastAzimuth<this.m_startAzimuth[0]&&this.m_startAzimuth[0]-this.m_lastAzimuth>=Math.PI);let i=!1;if(Math.abs(n-s)<=.5*this.m_bufferer.m_cornerStep&&(r||(i=!0)),i){if(e.removePointFromPath(0,e.getPointCount()-1),!this.m_bRunningInGnomonic){const t=new Z;t.setCoordsPoint2D(e.getXY(e.getPointCount()-1)),t.scale(this.m_bufferer.m_rpu),t.x-this.m_currentBufferedDelta<-Math.PI?this.m_currentBufferedDelta-=ee:t.x-this.m_currentBufferedDelta>Math.PI&&(this.m_currentBufferedDelta+=ee)}n=.5*(n+s)}else if(r){const s=new Z;s.setCoordsPoint2D(t),s.scale(1/this.m_bufferer.m_rpu),e.insertPoint2D(0,-1,s)}else le(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,this.m_densifiedPoints[0],s,n,this.m_bufferer.m_cornerStep,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,e)}this.m_startAzimuth[0]!==this.m_lastAzimuth&&this.m_numWinds++,ue(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,this.m_bufferer.m_curveType,this.m_densifiedPoints,n,i,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,e),this.m_lastAzimuth=this.m_endAzimuth[0]}}class Se extends we{constructor(e,t){super(e.m_progressTracker),this.m_pointIndex=-1,this.m_bufferer=e,this.m_multiPoint=t,this.m_bNeedsSimplify=!1;const s=new _;this.m_multiPoint.queryEnvelope(s);const n=s.getCenter(),i=n.clone();i.scale(this.m_bufferer.m_rpu),this.m_gnomonic=be(this.m_bufferer.m_gcs,n),this.m_gnomonicCenterRad=i.clone(),this.m_minGnomonicRadius=F(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,i,75/180*Math.PI)}next(){if(this.m_bNeedsSimplify=!1,++this.m_pointIndex===this.m_multiPoint.getPointCount())return null;const e=this.m_multiPoint.getXY(this.m_pointIndex);e.scale(this.m_bufferer.m_rpu),this.m_bRunningInGnomonic=this.isPointBufferInCurrentGnomonic(e),this.m_bRunningInGnomonic||(this.m_bRunningInGnomonic=this.tryUpdateGnomonic(e));const t=new f,s=this.m_bufferer.bufferPoint2D(e,this.m_bRunningInGnomonic,t);return this.m_bNeedsSimplify=s,t}isPointBufferInCurrentGnomonic(e){return null!==this.m_gnomonic&&Pe(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,this.m_gnomonicCenterRad,this.m_minGnomonicRadius)}tryUpdateGnomonic(e){const t=new Z,s=new Z,n=[0];return xe(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,t,s,n)?(this.m_gnomonicCenterRad.setCoordsPoint2D(s),this.m_minGnomonicRadius=n[0],this.m_gnomonic=be(this.m_bufferer.m_gcs,t),!0):(this.m_gnomonic=null,!1)}}class ve{getOperatorType(){return 10110}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,s,n,i,r,o,m){if(o){const o=new De(e,t,s,n,i,!1,r,m);return(new S).executeMany(o,t,m)}return new De(e,t,s,n,i,!1,r,m)}execute(t,n,i,r,o,m,a){const h=new e([t]),c=[r],u=this.executeMany(h,n,i,c,o,!1,m,a).next();return u||s("geodesic buffer null output"),u}}class De extends t{constructor(e,t,s,r,o,m,a,h){super(),this.m_currentUnionEnvelope2D=new _,this.m_index=-1,this.m_dindex=-1,this.m_progressTracker=h,m&&n(""),t||i("");0===t.getCoordinateSystemType()&&i(""),this.m_inputGeoms=e,this.m_spatialReference=t,this.m_curveType=s,this.m_distances=r,this.m_convergenceOffset=o,this.m_bOutlineOnly=m,this.m_bUnion=a}next(){let e;for(;e=this.m_inputGeoms.next();)return r(e),this.m_index=this.m_inputGeoms.getGeometryID(),this.m_dindex+1<this.m_distances.length&&this.m_dindex++,this.geodesicBuffer(e,this.m_distances[this.m_dindex]);return null}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}geodesicBuffer(e,t){return ae(e,this.m_spatialReference,this.m_curveType,t,this.m_convergenceOffset,this.m_progressTracker)}}export{ve as OperatorGeodesicBuffer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{t as e,b as t,G as i,a as s,g as n}from"./Geometry.js";import{g as a,a as _,c as r,ab as h,Q as o,L as m}from"./QuadraticBezier.js";import{O as l}from"./OperatorDensify.js";import{e as p,g as u,F as c,$ as g,a as d,R as E,s as f,h as P,U as S,a0 as A,a1 as x,o as y,q as R,z as M,a2 as C,D as T,N as w}from"./OperatorProject.js";import{O as q}from"./OperatorSimplify.js";import{d as N,P as b,K as I,q as v,e as $,T as z,E as O,t as D,a as G,c as L,b as k,x as F,y as J,z as U}from"./Transformation2D.js";import{O as Y}from"./OperatorClip.js";import{O as X}from"./OperatorShapePreservingLength.js";import{b as j,c as B}from"./tslib.es6.js";import{a as H}from"./GeodeticDistanceCalculator-bNilDneE.js";class Q{constructor(e,t,i,s,n=100){this.m_startPt=e.clone(),this.m_endPt=t.clone(),this.m_cE2=s,this.m_cE=Math.sqrt(this.m_cE2),this.m_c1By2e=1/(2*this.m_cE),this.m_cRpu=i.getGCS().getUnit().getUnitToBaseFactor(),this.isPcs=2===i.getCoordinateSystemType(),this.PEProjcs=i.getPECoordSys(),this.m_points=new Array(2*n)}setSegmentEndPoints(e,t){this.m_startPt.assign(e),this.m_endPt.assign(t)}makeFunctor(){return e=>{const t=[0,0];t[0]=this.m_startPt.x*(1-e)+this.m_endPt.x*e,t[1]=this.m_startPt.y*(1-e)+this.m_endPt.y*e,this.isPcs&&E.projToGeogCenter(this.PEProjcs,1,t,0);const i=Math.sin(t[1]*this.m_cRpu);if(0===this.m_cE2)return i;return-Math.log((1-this.m_cE*i)/(1+this.m_cE*i))*this.m_c1By2e+i/(1-this.m_cE2*i*i)}}}function V(e,t,i){const s=new _;e.queryEnvelope(s);const n=r(t,s,!0).total(),a=t.getPannableExtent();a.xmin=s.xmin-10*n,a.xmax=s.xmax+10*n;const o=(new Y).execute(e,a,t,i).getImpl().querySegmentIterator();o.stripAttributes();const m=f();t.querySpheroidData(m);const l=m.e2,p=0===l?2:1,u=new b(0,0),c=new b(0,0),g=new I(0),d=new Q(u,c,t,l,100);for(;o.nextPath();)for(;o.hasNextSegment();){const e=o.nextSegment();u.assign(e.getStartXY()),c.assign(e.getEndXY()),d.setSegmentEndPoints(u,c);const t=h(6,0,1,1e-12,1e-15,d.makeFunctor());g.pe((c.x-u.x)*t)}const E=m.majorSemiAxis;return p*E*E*(1-l)*Math.PI*g.getResult()/t.getPannableExtent().width()}function Z(e,t,i,s,n){const a=se(e,t,n);let _=W(e,a.first,i,s,n),r=1,h=0,o=0;do{if(r++,a.first*=.5,a.first<50*t.getTolerance(0))return _;a.second*=2,o=W(e,a.first,i,s,n),h=Math.abs(o-_),_=o}while(Math.abs(_)>1&&h>1e-8*Math.abs(_)&&(a.second<65e3&&r<8||r<4));return o}function W(e,t,i,s,n){const a=(new l).execute(e,t,0,0,n);let r;r=s?(new u).execute(a,s,n):a;const h=1===i.getUnit().getUnitToBaseFactor()?Math.PI/180:1,o=new _;r.queryEnvelope(o);const m=new _,p=new _,c=new _;m.setCoords({xmin:o.xmin,ymin:75*h,xmax:o.xmax,ymax:90*h}),p.setCoords({xmin:o.xmin,ymin:-60*h,xmax:o.xmax,ymax:75*h}),c.setCoords({xmin:o.xmin,ymin:-90*h,xmax:o.xmax,ymax:-60*h}),m.inflateCoords(.01*m.width(),0),p.inflateCoords(.01*p.width(),0),c.inflateCoords(.01*c.width(),0);let g=0;return g+=K(r,m,i,n),g+=K(r,p,i,n),g+=K(r,c,i,n),g}function K(e,t,i,s){const n=(new Y).execute(e,t,i,s);if(null!==n&&!n.isEmpty()){const e=new _;n.queryEnvelope(e);const{first:t,second:a}=ie(i,e,!1),r=p(i,t,null),h=(new u).execute(n,r,s).calculateArea2D();return a&&t.destroy(),h}return 0}const ee=[null,null,null,null,null,null,null];function te(e,t,i){const a=e.getUnit().getUnitToBaseFactor(),_=t.getCenter();_.scale(180*a/Math.PI);const r=new b;r.x=0,r.y=0;let h=0;if(0===h){_.y>45?(r.y=v,h=0):_.y<-45?(r.y=-v,h=1):_.x>=45&&_.x<135?(r.x=v,h=2):_.x>=135||_.x<-135?(r.x=v,h=3):_.x<-45&&_.x>=-135?(r.x=-v,h=4):(r.x=0,h=5);const e=a*Math.sqrt($(t.xmin-t.xmax)+$(t.ymin-t.ymax)),i=r.clone(),s=t.getCenter();s.scale(a),h<2&&(i.x=s.x);if(b.distance(i,s)+.5*e>v)return null}const o=ee[h];if(null!==o&&o.getGCS().equalHorizontal(e))return o;const m=e.getText(),l=r.x,p=r.y,u=0,E=0;let f=0,P=-1;6!==h?P=c.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA:(n(i),f=0,P=c.PE_PRJ_CYLINDRICAL_EQAREA);const S=g("EqualAreaPCS");let A;P===c.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA?A=`PROJCS["${S}",${m},PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["False_Easting",${u}],PARAMETER["False_Northing",${E}],PARAMETER["Central_Meridian",${l}],PARAMETER["Latitude_of_Origin",${p}],UNIT["Meter",1.0]]`:P===c.PE_PRJ_CYLINDRICAL_EQAREA?A=`PROJCS["${S}",${m},PROJECTION["Cylindrical_Equal_Area"],PARAMETER["False_Easting",${u}],PARAMETER["False_Northing",${E}],PARAMETER["Central_Meridian",${l}],PARAMETER["Standard_Parallel_1",${f}],PARAMETER["Latitude_of_Origin",${p}],UNIT["Meter",1.0]]`:s("getEqualAreaPcsFixed");const x=d(A);return ee[h]&&ee[h].destroy(),ee[h]=x,x}function ie(e,t,i){const n=te(e,t,i);if(null!==n)return N(n,!1);const a=e.getText(),_=e.getUnit().getUnitToBaseFactor(),r=(t.xmin+t.width()/2)*_,h=(t.ymin+t.height()/2)*_,o=0,m=0;let l=0,p=0,u=-1;t.ymin*_>=75*Math.PI/180||t.ymax*_<=-60*Math.PI/180?u=c.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA:t.ymin>0||t.ymax<0?(l=(t.ymin+1/3*t.height())*_,p=(t.ymin+2/3*t.height())*_,u=c.PE_PRJ_ALBERS):(l=(t.ymin+2/3*t.height())*_,u=c.PE_PRJ_CYLINDRICAL_EQAREA);const E=g("EqualAreaPCS");let f;return u===c.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA?f=`PROJCS["${E}",${a},PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["False_Easting",${o}],PARAMETER["False_Northing",${m}],PARAMETER["Central_Meridian",${r}],PARAMETER["Latitude_of_Origin",${h}],UNIT["Meter",1.0]]`:u===c.PE_PRJ_ALBERS?f=`PROJCS["${E}",${a},PROJECTION["Albers"],PARAMETER["False_Easting",${o}],PARAMETER["False_Northing",${m}],PARAMETER["Central_Meridian",${r}],PARAMETER["Standard_Parallel_1",${l}],PARAMETER["Standard_Parallel_2",${p}],PARAMETER["Latitude_of_Origin",${h}],UNIT["Meter",1.0]]`:u===c.PE_PRJ_CYLINDRICAL_EQAREA?f=`PROJCS["${E}",${a},PROJECTION["Cylindrical_Equal_Area"],PARAMETER["False_Easting",${o}],PARAMETER["False_Northing",${m}],PARAMETER["Central_Meridian",${r}],PARAMETER["Standard_Parallel_1",${l}],PARAMETER["Latitude_of_Origin",${h}],UNIT["Meter",1.0]]`:s("getEqualAreaPCSInstance"),N(d(f),!0)}function se(e,t,i){const s=e.calculateLength2D(),n=(new X).execute(e,t,i)/25e3,a=s/e.getSegmentCount()*2;let _=Math.min(a,s/n);0===_&&(_=1);return N(_,s/_)}class ne{getOperatorType(){return 10314}supportsCurves(){return!0}accelerateGeometry(e,t,i){return!1}canAccelerateGeometry(e){return!1}execute(s,n,_){if(0===n.getCoordinateSystemType()&&e(""),s.isEmpty()||s.getDimension()<2)return 0;if(t(s),s.getGeometryType()===i.enumEnvelope){const e=new a;return e.addEnvelope(s,!1),this.execute(e,n,_)}let r=s;s.getDescription().getAttributeCount()>1&&(r=s.clone(),r.dropAllAttributes());const h=(new l).execute(r,0,n.getTolerance(0),0,_);let o=null;const m=n.getGCS();m!==n&&(o=p(n,m));let u=(new q).execute(h,n,!1,_);return u.isEmpty()?0:(u===s&&(u=s.clone()),n.isPannable()?V(u,n,_):Z(u,n,m,o,_))}}function ae(){return{m_p_PCS:new b,m_factor:Number.NaN,setValues:_e,assign:re}}function _e(e,t){this.m_factor=e,this.m_p_PCS.assign(t)}function re(e){this.m_factor=e.m_factor,this.m_p_PCS.assign(e.m_p_PCS)}class he{constructor(e,t,i,s){this.m_ptStart=new o,this.m_ptEnd=new o,this.m_ptStart.assign(t),this.m_ptEnd.assign(i),this.m_deltaX=this.m_ptEnd.x-this.m_ptStart.x,this.m_deltaY=this.m_ptEnd.y-this.m_ptStart.y,this.m_e=Math.sqrt(e),this.m_e2=e,this.m_c1MinusE2=1-e;const n=Math.sin(s);let a;a=0===this.m_e2?2*n:n*(J(this.m_e*n)+1/(1-this.m_e2*n*n)),this.m_baseA=a}setSegmentEndPoints(e,t){this.m_ptStart.assign(e),this.m_ptEnd.assign(t),this.m_deltaX=this.m_ptEnd.x-this.m_ptStart.x,this.m_deltaY=this.m_ptEnd.y-this.m_ptStart.y}makeFunctor(){return e=>{const t=1-e,i=t*this.m_ptStart.x+e*this.m_ptEnd.x,s=t*this.m_ptStart.y+e*this.m_ptEnd.y,n=t*this.m_ptStart.z+e*this.m_ptEnd.z,a=i*i+s*s,_=n/Math.sqrt(n*n+this.m_c1MinusE2*this.m_c1MinusE2*a);let r;if(0===this.m_e2)r=2*_;else{r=_*(J(this.m_e*_)+1/(1-this.m_e2*_*_))}return(this.m_deltaY*i-this.m_deltaX*s)/a*(r-this.m_baseA)}}}function oe(){return{e:Number.NaN,one_p_e:Number.NaN,one_m_e:Number.NaN,one_m_e_2:Number.NaN,atanh_e_over_e:Number.NaN,half_qp:Number.NaN,f:Number.NaN,z:Number.NaN}}function me(){return{sin_phi:Number.NaN,one_p_sin_phi:Number.NaN,one_m_sin_phi:Number.NaN,one_m_e_2_sin_2_phi:Number.NaN,sin_half_phi_pf:Number.NaN,sin_half_phi_pz:Number.NaN,sin_half_asin_e_sin_phi_pf:Number.NaN,sin_half_asin_e_sin_phi_pz:Number.NaN,atanh_sin_phi:Number.NaN,atanh_esin_phi:Number.NaN,make_negative:!1,initialize:le,changeSign:pe,assign:ue,clone:ce}}function le(e,t,i,s){const n=.5*e;this.sin_phi=Math.sin(e);const a=t*this.sin_phi,_=.5*Math.asin(a);this.one_p_sin_phi=1+this.sin_phi,this.one_m_sin_phi=1-this.sin_phi,this.one_m_e_2_sin_2_phi=(1+a)*(1-a),this.sin_half_phi_pf=Math.sin(n+i),this.sin_half_phi_pz=Math.sin(n+s),this.sin_half_asin_e_sin_phi_pf=Math.sin(_+i),this.sin_half_asin_e_sin_phi_pz=Math.sin(_+s),this.atanh_sin_phi=Math.log(this.sin_half_phi_pf/this.sin_half_phi_pz),this.atanh_esin_phi=Math.log(this.sin_half_asin_e_sin_phi_pf/this.sin_half_asin_e_sin_phi_pz)}function pe(){this.sin_phi=-this.sin_phi;let e=this.one_p_sin_phi;this.one_p_sin_phi=this.one_m_sin_phi,this.one_m_sin_phi=e,e=this.sin_half_phi_pf,this.sin_half_phi_pf=this.sin_half_phi_pz,this.sin_half_phi_pz=e,e=this.sin_half_asin_e_sin_phi_pf,this.sin_half_asin_e_sin_phi_pf=this.sin_half_asin_e_sin_phi_pz,this.sin_half_asin_e_sin_phi_pz=e,this.atanh_sin_phi=-this.atanh_sin_phi,this.atanh_esin_phi=-this.atanh_esin_phi}function ue(e){this.sin_phi=e.sin_phi,this.one_p_sin_phi=e.one_p_sin_phi,this.one_m_sin_phi=e.one_m_sin_phi,this.one_m_e_2_sin_2_phi=e.one_m_e_2_sin_2_phi,this.sin_half_phi_pf=e.sin_half_phi_pf,this.sin_half_phi_pz=e.sin_half_phi_pz,this.sin_half_asin_e_sin_phi_pf=e.sin_half_asin_e_sin_phi_pf,this.sin_half_asin_e_sin_phi_pz=e.sin_half_asin_e_sin_phi_pz,this.atanh_sin_phi=e.atanh_sin_phi,this.atanh_esin_phi=e.atanh_esin_phi,this.make_negative=e.make_negative}function ce(){return{...this}}class ge{constructor(t,i,s){this.m_transformPCS2GCS=null,this.m_scaleToRadians=new z,this.m_scaleToDegrees=new z,this.m_progressTracker=s,n(4!==i),this.m_curveType=i,this.m_inputSR=t,t&&0!==t.getCoordinateSystemType()||e(""),this.m_inputGCS=t.getGCS(),this.m_a=0,this.m_eSquared=0,this.m_b=0,this.m_rpu=0}executePolygonGeodeticArea(e){let t,i=e.clone();if(i.dropAllAttributes(),e.hasNonLinearSegments()){i=(new l).execute(i,0,this.m_inputSR.getTolerance(0),0,this.m_progressTracker)}if(this.m_inputSR.isPannable()){const e=new _;i.queryEnvelope(e);const t=this.m_inputSR.getPannableExtent();if(!t.containsEnvelope(e)){const s=t.getCenterX()-e.getCenterX(),n=new z;n.setShiftCoords(s,0),i.applyTransformation(n),e.move(s,0);const a=new O;t.queryIntervalX(a);const _=new O;e.queryIntervalX(_),i=a.contains(_)?P(i,this.m_inputSR):(new u).foldInto360RangeGeodetic(i,this.m_inputSR,this.m_curveType)}}if(this.m_transformPCS2GCS?(i=(new q).execute(i,this.m_inputSR,!1,this.m_progressTracker),t=i.createInstance(),S(this.m_transformPCS2GCS,i,t,this.m_progressTracker)||(t=(new u).execute(i,this.m_transformPCS2GCS,this.m_progressTracker))):t=(new q).execute(i,this.m_inputGCS,!1,this.m_progressTracker),t.isEmpty())return 0;if(1===this.m_curveType){const e=f();return this.m_inputGCS.querySpheroidData(e),this.m_a=e.majorSemiAxis,this.m_eSquared=e.e2,this.loxodromeArea(t)}const s=t.getImpl();this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_scaleToRadians.setScale(this.m_rpu),s.applyTransformation(this.m_scaleToRadians),this.m_scaleToDegrees=this.m_scaleToRadians,this.m_scaleToDegrees.invertThis();const n=f();if(this.m_inputGCS.querySpheroidData(n),this.m_a=n.majorSemiAxis,this.m_b=n.minorSemiAxis,this.m_eSquared=n.e2,2===this.m_curveType)return this.executeClippedPolygonGreatEllipticArea(t);{const e={stack:[],error:void 0,hasError:!1};try{const i=A.unit(9101),s=this.m_inputGCS.getPECoordSys(),n=j(e,s.cloneAlterUnits(i),!1);let a,_,r=this.executeClippedPolygonGeodeticArea(t,n,0),h=0;do{h++,a=this.executeClippedPolygonGeodeticArea(t,n,h),_=Math.abs(a-r),r=a}while(Math.abs(a)>1&&_>1e-8*Math.abs(a)&&h<7);return a}catch(a){e.error=a,e.hasError=!0}finally{B(e)}}}executeClippedPolygonGeodeticArea(e,t,i){const s={stack:[],error:void 0,hasError:!1};try{const n=new _;e.queryEnvelope(n);const a=j(s,this.getEqualAreaPCSInstance(t,n),!1),r=e.clone();x(a,r);const h=50,o=r.getImpl().getAttributeStreamRef(0),m=e.getImpl().getAttributeStreamRef(0),l=j(s,new y,!1),p=j(s,new y,!1),u=40,c=[0,0],g=D(ae,u),d=G(u,-1),f=ae(),P=ae();let S,A;const M=a;let C=r.calculateArea2D();const T=new I(0),w=.5*Math.PI,q=1e-10*Math.abs(C)+1e-6,N=e.getPathCount();let v,$,z,O;const k=new b,F=new b,J=new b,U=new b,Y=new b,X=new b;let B,H;for($=e.getPathStart(0),v=0;v<N;v++,$=z)for(z=e.getPathEnd(v),o.queryPoint2D(z-1<<1,J),m.queryPoint2D(z-1<<1,k),Math.abs(k.y)>w&&(k.y=L(w,k.y)),O=$;O<z;O++,J.assign(U),k.assign(F)){if(o.queryPoint2D(O<<1,U),m.queryPoint2D(O<<1,F),Math.abs(F.y)>w&&(F.y=L(w,F.y)),B=b.distance(J,U),B<h||0===k.y&&0===F.y)continue;R.geodeticDistance(this.m_a,this.m_eSquared,k.x,k.y,F.x,F.y,l,p,null,this.m_curveType);const e=l.val,t=p.val;for(f.setValues(0,J),P.setValues(1,U),A=i,g[0].assign(P),d[0]=i,S=0;S>=0;){H=.5*(f.m_factor+P.m_factor),R.geodeticCoordinate(this.m_a,this.m_eSquared,k.x,k.y,e*H,t,l,p,this.m_curveType),Y.x=l.val,Y.y=p.val,c[0]=Y.x,c[1]=Y.y,E.geogToProj(M,1,c),X.x=c[0],X.y=c[1];const i=-X.offset(f.m_p_PCS,P.m_p_PCS),s=.5*i*b.distance(f.m_p_PCS,P.m_p_PCS);if(T.pe(s),Math.abs(s)>q||Math.abs(s)>0&&A>0)P.setValues(H,X),S++,g[S].assign(P),Math.abs(s)<=q?(A--,d[S-1]=A,d[S]=A):(A=d[S-1],d[S]=A);else{if(S<=0)break;f.assign(P),S--,P.assign(g[S]),A=d[S]}}}return C+=T.getResult(),Math.abs(C)}catch(n){s.error=n,s.hasError=!0}finally{B(s)}}executeClippedPolygonGreatEllipticArea(e){const t=[],i=[],s=new b,n=new b,a=M(1,this.m_eSquared,new b(0,.5*Math.PI)),r=new I(0),h=new I(0),m=new I(0),l=new o,p=new o,u=new _;e.queryLooseEnvelope(u);let c=0;u.containsCoords(u.xmin,0)||(c=Math.abs(u.ymin)<Math.abs(u.ymax)?u.ymin:u.ymax);const g=new he(this.m_eSquared,l,p,c),d=this.m_a*this.m_a,E=e.getImpl().querySegmentIterator();for(E.stripAttributes();E.nextPath();)for(;E.hasNextSegment();){const e=E.nextSegment();s.assign(e.getStartXY()),n.assign(e.getEndXY()),n.x-s.x>Math.PI?s.x+=2*Math.PI:n.x-s.x<-Math.PI&&(n.x+=2*Math.PI),this.splitSegmentCrossingItegralThreshold(e,t,i);for(let i of t)l.assign(M(this.m_a,this.m_eSquared,i.getStartXY())),p.assign(M(this.m_a,this.m_eSquared,i.getEndXY())),g.setSegmentEndPoints(l,p),this.adaptiveIntegrationWithRomberg(g,r);for(let t of i){let e=t.getStartXY(),i=t.getEndXY(),s=c;e.y<0&&(i=k(e,e=i),e.y=-e.y,i.y=-i.y,s=-s);const n=M(1,this.m_eSquared,e),_=M(1,this.m_eSquared,i),r=Math.min(e.y,i.y),l=C(this.m_eSquared,e.x,i.x,s,r);h.pe(l);const p=Math.abs(C(this.m_eSquared,e.x,i.x,r,v)),u=new o;u.setSub(n,a);const g=new o;g.setSub(_,a);const E=new o;E.setCrossProductVector(u,g);let f=d*(p-.5*E.length());f=L(f,i.x-e.x),m.pe(f)}t.length=0,i.length=0}return m.getResult()+d*(.5*(1-this.m_eSquared)*r.getResult()+h.getResult())}getEqualAreaPCSInstance(e,t){const i=t.getCenterX(),s=0,n=0;let a,_;const r=t.height();let h,o;(h=t.ymin>45*Math.PI/180||t.ymax<45*-Math.PI/180)?a=L(.5*Math.PI,t.getCenterY()):(a=t.getCenterY(),_=t.ymin+r*(2/3));const m=g("EqualAreaPCS"),l=e.toString();return o=h?A.fromString(c.PE_TYPE_PROJCS,`PROJCS["${m}", ${l}, PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["False_Easting",${s}],PARAMETER["False_Northing", ${n}],PARAMETER["Central_Meridian", ${i}], PARAMETER["Latitude_of_Origin", ${a}], UNIT["Meter",1.0]]`):A.fromString(c.PE_TYPE_PROJCS,`PROJCS["${m}", ${l}, PROJECTION["Cylindrical_Equal_Area"],PARAMETER["False_Easting", ${s}],PARAMETER["False_Northing", ${n}],PARAMETER["Central_Meridian", ${i}],PARAMETER["Standard_Parallel_1", ${_}],PARAMETER["Latitude_of_Origin", ${a}],UNIT["Meter",1.0]]`),o}splitSegmentCrossingItegralThreshold(e,t,i){const s=100,n=20,a=n*n,_=M(this.m_a,this.m_eSquared,new b(0,v)),r=M(this.m_a,this.m_eSquared,new b(0,-v)),h=this.splitSegmentPassingThroughPole(e);for(let l of h){const e=l.getStartXY(),h=l.getEndXY(),p=M(this.m_a,this.m_eSquared,e),u=M(this.m_a,this.m_eSquared,h),c=new b,g=new o;let d=o.sqrDistance(_,p),E=o.sqrDistance(p,u);if(d<=s){if(!(E>a)){i.push(new m({start:e,end:h}));continue}g.assign(u.sub(p)),g.normalizeThis(),g.assign(p.add(g.mul(n))),c.assign(T(this.m_a,this.m_eSquared,g)),i.push(new m({start:e,end:c})),e.assign(c)}if(p.assign(M(this.m_a,this.m_eSquared,e)),d=o.sqrDistance(_,u),E=o.sqrDistance(p,u),d<=s){if(!(E>a)){i.push(new m({start:e,end:h}));continue}g.assign(u.sub(p)),g.normalizeThis(),g.assign(u.sub(g.mul(n))),c.assign(T(this.m_a,this.m_eSquared,g)),i.push(new m({start:c,end:h})),h.assign(c)}if(p.assign(M(this.m_a,this.m_eSquared,e)),u.assign(M(this.m_a,this.m_eSquared,h)),d=o.sqrDistance(r,p),E=o.sqrDistance(p,u),d<=s){if(!(E>a)){i.push(new m({start:e,end:h}));continue}g.assign(u.sub(p)),g.normalizeThis(),g.assign(p.add(g.mul(n))),c.assign(T(this.m_a,this.m_eSquared,g)),i.push(new m({start:e,end:c})),e.assign(c)}if(p.assign(M(this.m_a,this.m_eSquared,e)),u.assign(M(this.m_a,this.m_eSquared,h)),d=o.sqrDistance(r,u),E=o.sqrDistance(p,u),d<=s){if(!(E>a)){i.push(new m({start:e,end:h}));continue}g.assign(u.sub(p)),g.normalizeThis(),g.assign(u.sub(g.mul(n))),c.assign(T(this.m_a,this.m_eSquared,g)),i.push(new m({start:c,end:h})),h.assign(c)}t.push(new m({start:e,end:h}))}}splitSegmentPassingThroughPole(e){const t={stack:[],error:void 0,hasError:!1};try{const i=[],s=new o,n=new o,a=new o,_=new b,r=20,h=3.124139361,l=10,p=e.getStartXY(),u=e.getEndXY(),c=j(t,new y,!1);if(R.geodeticDistance(this.m_a,this.m_eSquared,p.x,p.y,u.x,u.y,c,null,null,2),Math.abs(u.x-p.x)>h&&c.val>r){const e=new H(new b(0,90),p.divide(this.m_rpu),u.divide(this.m_rpu),this.m_inputGCS,2,2);let t=w(e.makeFunctor(),0,1,1e-10);if(t.second<=l&&t.first>0&&t.first<1)return s.assign(M(this.m_a,this.m_eSquared,p)),n.assign(M(this.m_a,this.m_eSquared,u)),F(s,n,t.first,a),_.assign(T(this.m_a,this.m_eSquared,a)),i.push(new m({start:p,end:_})),i.push(new m({start:_,end:u})),i;if(e.setPointDistFrom(new b(0,-90)),t=w(e.makeFunctor(),0,1,1e-10),t.second<=l&&t.first>0&&t.first<1)return s.assign(M(this.m_a,this.m_eSquared,p)),n.assign(M(this.m_a,this.m_eSquared,u)),F(s,n,t.first,a),_.assign(T(this.m_a,this.m_eSquared,a)),i.push(new m({start:p,end:_})),i.push(new m({start:_,end:u})),i}return i.push(new m({start:p,end:u})),i}catch(i){t.error=i,t.hasError=!0}finally{B(t)}}adaptiveIntegrationWithRomberg(e,t){const i=e.makeFunctor();let s=0,n=1,a=i(s),_=i(n);const r=1e-17,o=1e-14;let m=(s+n)/2,l=i(m),p=Math.abs(l-a),u=Math.abs(_-l),c=0;for(;c++<32&&(p/u<.1||u/p<.1);)p<u?(t.pe(h(5,s,m,o,r,i)),s=m,a=l):(t.pe(h(5,m,n,o,r,i)),n=m,_=l),m=(s+n)/2,l=Math.abs(i(m)),p=Math.abs(l-a),u=Math.abs(_-l);t.pe(h(5,s,n,o,r,i))}loxodromeAreaHemi(e,t,i,s,n){const a=i.clone(),_=n.clone();let r,h,o,m,l,p,u,c,g,d,E,f,P,S,A,x;return a.make_negative&&a.changeSign(),_.make_negative&&_.changeSign(),E=s-t,1===Math.abs(a.sin_phi)||1===Math.abs(_.sin_phi)?e.half_qp*E:a.sin_phi===_.sin_phi?(d=.5*e.one_m_e_2*a.sin_phi*(1/a.one_m_e_2_sin_2_phi+J(e.e*a.sin_phi))*E,d):(A=Math.log(_.sin_half_phi_pf*a.sin_half_phi_pz/(_.sin_half_phi_pz*a.sin_half_phi_pf)),x=Math.log(_.sin_half_asin_e_sin_phi_pf*a.sin_half_asin_e_sin_phi_pz/(_.sin_half_asin_e_sin_phi_pz*a.sin_half_asin_e_sin_phi_pf)),1===this.m_eSquared?(l=0,r=.5*(A+_.sin_phi/_.one_m_e_2_sin_2_phi-a.sin_phi/a.one_m_e_2_sin_2_phi),h=0):(l=-2*e.atanh_e_over_e*(Math.log(_.one_p_sin_phi/a.one_p_sin_phi)-e.e*x),r=(A-e.e*x)/e.one_m_e_2,h=(Math.log(_.one_m_e_2_sin_2_phi/a.one_m_e_2_sin_2_phi)+l/e.atanh_e_over_e)/e.one_m_e_2),o=-x*(a.atanh_esin_phi+_.atanh_esin_phi),m=1/a.one_m_e_2_sin_2_phi-1/_.one_m_e_2_sin_2_phi,p=U(_.one_m_sin_phi/e.one_p_e,e.e)-U(a.one_m_sin_phi/e.one_p_e,e.e),u=U(_.one_p_sin_phi/e.one_p_e,e.e)-U(a.one_p_sin_phi/e.one_p_e,e.e),c=U(a.one_m_sin_phi/-e.one_m_e,e.e)-U(_.one_m_sin_phi/-e.one_m_e,e.e),g=U(a.one_p_sin_phi/-e.one_m_e,e.e)-U(_.one_p_sin_phi/-e.one_m_e,e.e),d=.25/r*(h+o+m+l+.5*(p+u+c+g)),d+=e.half_qp,f=.5*e.one_m_e_2*a.sin_phi*(1/a.one_m_e_2_sin_2_phi+J(e.e*a.sin_phi)),P=.5*e.one_m_e_2*_.sin_phi*(1/_.one_m_e_2_sin_2_phi+J(e.e*_.sin_phi)),P<f&&(S=f,f=P,P=S),d<f&&(d=f),d>P&&(d=P),d*=E,d)}loxodromeArea(e){const t=Math.PI/180;let i=0;const s=oe(),n=me(),a=me();s.e=Math.sqrt(this.m_eSquared),s.one_p_e=1+s.e,s.one_m_e=1-s.e,s.one_m_e_2=1-this.m_eSquared,s.atanh_e_over_e=J(s.e),this.m_eSquared>=1?s.half_qp=1:s.half_qp=.5*(1+s.atanh_e_over_e*s.one_m_e_2),s.f=.25*Math.PI,s.z=.75*Math.PI,a.initialize(0,s.e,s.f,s.z);const _=e.getPathCount(),r=new b,h=new b,o=e.getImpl().getAttributeStreamRef(0);for(let m=0;m<_;m++){const _=e.getPathStart(m),l=e.getPathEnd(m);if(!(l-_<=1)){o.queryPoint2D(2*(l-1),r);for(let e=_;e<l;e++){o.queryPoint2D(2*e,h);const m=r.y*t,l=h.y*t;if(e===_?(n.initialize(m,s.e,s.f,s.z),n.make_negative=!1):n.assign(a),a.initialize(l,s.e,s.f,s.z),a.make_negative=!1,r.y*h.y<0){if(r.y>=90&&h.y<=-90||h.y>=90&&r.y<=-90)return Number.NaN;const e=me();e.initialize(0,s.e,s.f,s.z),e.make_negative=!1;const _=n.atanh_sin_phi-s.e*n.atanh_esin_phi,o=a.atanh_sin_phi-s.e*a.atanh_esin_phi,l=(o*r.x-_*h.x)/(o-_);m<0?(n.make_negative=!0,i-=this.loxodromeAreaHemi(s,r.x*t,n,l*t,e),n.make_negative=!1,i+=this.loxodromeAreaHemi(s,l*t,e,h.x*t,a)):(i+=this.loxodromeAreaHemi(s,r.x*t,n,l*t,e),a.make_negative=!0,i-=this.loxodromeAreaHemi(s,l*t,e,h.x*t,a),a.make_negative=!1)}else r.y>=0?i+=this.loxodromeAreaHemi(s,r.x*t,n,h.x*t,a):(n.make_negative=!0,a.make_negative=!0,i-=this.loxodromeAreaHemi(s,r.x*t,n,h.x*t,a),n.make_negative=!1,a.make_negative=!1);r.assign(h)}}}return this.m_a*i*this.m_a}calculate(e){if(e.isEmpty()||e.getDimension()<2)return 0;if(e.getGeometryType()===i.enumEnvelope){const t=new a;return t.addEnvelope(e,!1),this.calculate(t)}return this.m_inputSR!==this.m_inputGCS&&null===this.m_transformPCS2GCS&&(this.m_transformPCS2GCS=p(this.m_inputSR,this.m_inputGCS,null)),this.executePolygonGeodeticArea(e)}}class de{getOperatorType(){return 10311}supportsCurves(){return!0}accelerateGeometry(e,t,i){return!1}canAccelerateGeometry(e){return!1}execute(e,i,s,n){if(t(e),4===s)return(new ne).execute(e,i,n);return new ge(i,s,n).calculate(e)}}export{de as OperatorGeodeticArea};
5
+ import{t as e,c as t,G as i,b as s,g as n}from"./Geometry.js";import{h as a,a as _,b as r,ab as h,O as o,L as m}from"./QuadraticBezier.js";import{O as l}from"./OperatorDensify.js";import{e as p,g as u,Q as c,$ as g,b as d,F as E,s as f,h as P,I as S,a0 as A,a1 as y,o as x,q as R,y as M,a2 as C,E as T,B as w}from"./OperatorProject.js";import{O as q}from"./OperatorSimplify.js";import{d as N,P as b,K as I,q as v,e as $,T as O,E as z,t as D,a as G,c as L,b as k,x as F,y as J,z as Y}from"./Transformation2D.js";import{O as U}from"./OperatorClip.js";import{O as X}from"./OperatorShapePreservingLength.js";import{b as j,c as B}from"./tslib.es6.js";import{a as H}from"./GeodeticDistanceCalculator-bNilDneE.js";class Q{constructor(e,t,i,s,n=100){this.m_startPt=e.clone(),this.m_endPt=t.clone(),this.m_cE2=s,this.m_cE=Math.sqrt(this.m_cE2),this.m_c1By2e=1/(2*this.m_cE),this.m_cRpu=i.getGCS().getUnit().getUnitToBaseFactor(),this.isPcs=2===i.getCoordinateSystemType(),this.PEProjcs=i.getPECoordSys(),this.m_points=new Array(2*n)}setSegmentEndPoints(e,t){this.m_startPt.assign(e),this.m_endPt.assign(t)}makeFunctor(){return e=>{const t=[0,0];t[0]=this.m_startPt.x*(1-e)+this.m_endPt.x*e,t[1]=this.m_startPt.y*(1-e)+this.m_endPt.y*e,this.isPcs&&E.projToGeogCenter(this.PEProjcs,1,t,0);const i=Math.sin(t[1]*this.m_cRpu);if(0===this.m_cE2)return i;return-Math.log((1-this.m_cE*i)/(1+this.m_cE*i))*this.m_c1By2e+i/(1-this.m_cE2*i*i)}}}function V(e,t,i){const s=new _;e.queryEnvelope(s);const n=r(t,s,!0).total(),a=t.getPannableExtent();a.xmin=s.xmin-10*n,a.xmax=s.xmax+10*n;const o=(new U).execute(e,a,t,i).getImpl().querySegmentIterator();o.stripAttributes();const m=f();t.querySpheroidData(m);const l=m.e2,p=0===l?2:1,u=new b(0,0),c=new b(0,0),g=new I(0),d=new Q(u,c,t,l,100);for(;o.nextPath();)for(;o.hasNextSegment();){const e=o.nextSegment();u.assign(e.getStartXY()),c.assign(e.getEndXY()),d.setSegmentEndPoints(u,c);const t=h(6,0,1,1e-12,1e-15,d.makeFunctor());g.pe((c.x-u.x)*t)}const E=m.majorSemiAxis;return p*E*E*(1-l)*Math.PI*g.getResult()/t.getPannableExtent().width()}function Z(e,t,i,s,n){const a=se(e,t,n);let _=W(e,a.first,i,s,n),r=1,h=0,o=0;do{if(r++,a.first*=.5,a.first<50*t.getTolerance(0))return _;a.second*=2,o=W(e,a.first,i,s,n),h=Math.abs(o-_),_=o}while(Math.abs(_)>1&&h>1e-8*Math.abs(_)&&(a.second<65e3&&r<8||r<4));return o}function W(e,t,i,s,n){const a=(new l).execute(e,t,0,0,n);let r;r=s?(new u).execute(a,s,n):a;const h=1===i.getUnit().getUnitToBaseFactor()?Math.PI/180:1,o=new _;r.queryEnvelope(o);const m=new _,p=new _,c=new _;m.setCoords({xmin:o.xmin,ymin:75*h,xmax:o.xmax,ymax:90*h}),p.setCoords({xmin:o.xmin,ymin:-60*h,xmax:o.xmax,ymax:75*h}),c.setCoords({xmin:o.xmin,ymin:-90*h,xmax:o.xmax,ymax:-60*h}),m.inflateCoords(.01*m.width(),0),p.inflateCoords(.01*p.width(),0),c.inflateCoords(.01*c.width(),0);let g=0;return g+=K(r,m,i,n),g+=K(r,p,i,n),g+=K(r,c,i,n),g}function K(e,t,i,s){const n=(new U).execute(e,t,i,s);if(null!==n&&!n.isEmpty()){const e=new _;n.queryEnvelope(e);const{first:t,second:a}=ie(i,e,!1),r=p(i,t,null),h=(new u).execute(n,r,s).calculateArea2D();return a&&t.destroy(),h}return 0}const ee=[null,null,null,null,null,null,null];function te(e,t,i){const a=e.getUnit().getUnitToBaseFactor(),_=t.getCenter();_.scale(180*a/Math.PI);const r=new b;r.x=0,r.y=0;let h=0;if(0===h){_.y>45?(r.y=v,h=0):_.y<-45?(r.y=-v,h=1):_.x>=45&&_.x<135?(r.x=v,h=2):_.x>=135||_.x<-135?(r.x=v,h=3):_.x<-45&&_.x>=-135?(r.x=-v,h=4):(r.x=0,h=5);const e=a*Math.sqrt($(t.xmin-t.xmax)+$(t.ymin-t.ymax)),i=r.clone(),s=t.getCenter();s.scale(a),h<2&&(i.x=s.x);if(b.distance(i,s)+.5*e>v)return null}const o=ee[h];if(null!==o&&o.getGCS().equalHorizontal(e))return o;const m=e.getText(),l=r.x,p=r.y,u=0,E=0;let f=0,P=-1;6!==h?P=c.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA:(n(i),f=0,P=c.PE_PRJ_CYLINDRICAL_EQAREA);const S=g("EqualAreaPCS");let A;P===c.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA?A=`PROJCS["${S}",${m},PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["False_Easting",${u}],PARAMETER["False_Northing",${E}],PARAMETER["Central_Meridian",${l}],PARAMETER["Latitude_of_Origin",${p}],UNIT["Meter",1.0]]`:P===c.PE_PRJ_CYLINDRICAL_EQAREA?A=`PROJCS["${S}",${m},PROJECTION["Cylindrical_Equal_Area"],PARAMETER["False_Easting",${u}],PARAMETER["False_Northing",${E}],PARAMETER["Central_Meridian",${l}],PARAMETER["Standard_Parallel_1",${f}],PARAMETER["Latitude_of_Origin",${p}],UNIT["Meter",1.0]]`:s("getEqualAreaPcsFixed");const y=d(A);return ee[h]&&ee[h].destroy(),ee[h]=y,y}function ie(e,t,i){const n=te(e,t,i);if(null!==n)return N(n,!1);const a=e.getText(),_=e.getUnit().getUnitToBaseFactor(),r=(t.xmin+t.width()/2)*_,h=(t.ymin+t.height()/2)*_,o=0,m=0;let l=0,p=0,u=-1;t.ymin*_>=75*Math.PI/180||t.ymax*_<=-60*Math.PI/180?u=c.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA:t.ymin>0||t.ymax<0?(l=(t.ymin+1/3*t.height())*_,p=(t.ymin+2/3*t.height())*_,u=c.PE_PRJ_ALBERS):(l=(t.ymin+2/3*t.height())*_,u=c.PE_PRJ_CYLINDRICAL_EQAREA);const E=g("EqualAreaPCS");let f;return u===c.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA?f=`PROJCS["${E}",${a},PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["False_Easting",${o}],PARAMETER["False_Northing",${m}],PARAMETER["Central_Meridian",${r}],PARAMETER["Latitude_of_Origin",${h}],UNIT["Meter",1.0]]`:u===c.PE_PRJ_ALBERS?f=`PROJCS["${E}",${a},PROJECTION["Albers"],PARAMETER["False_Easting",${o}],PARAMETER["False_Northing",${m}],PARAMETER["Central_Meridian",${r}],PARAMETER["Standard_Parallel_1",${l}],PARAMETER["Standard_Parallel_2",${p}],PARAMETER["Latitude_of_Origin",${h}],UNIT["Meter",1.0]]`:u===c.PE_PRJ_CYLINDRICAL_EQAREA?f=`PROJCS["${E}",${a},PROJECTION["Cylindrical_Equal_Area"],PARAMETER["False_Easting",${o}],PARAMETER["False_Northing",${m}],PARAMETER["Central_Meridian",${r}],PARAMETER["Standard_Parallel_1",${l}],PARAMETER["Latitude_of_Origin",${h}],UNIT["Meter",1.0]]`:s("getEqualAreaPCSInstance"),N(d(f),!0)}function se(e,t,i){const s=e.calculateLength2D(),n=(new X).execute(e,t,i)/25e3,a=s/e.getSegmentCount()*2;let _=Math.min(a,s/n);0===_&&(_=1);return N(_,s/_)}class ne{getOperatorType(){return 10314}supportsCurves(){return!0}accelerateGeometry(e,t,i){return!1}canAccelerateGeometry(e){return!1}execute(s,n,_){if(0===n.getCoordinateSystemType()&&e(""),s.isEmpty()||s.getDimension()<2)return 0;if(t(s),s.getGeometryType()===i.enumEnvelope){const e=new a;return e.addEnvelope(s,!1),this.execute(e,n,_)}let r=s;s.getDescription().getAttributeCount()>1&&(r=s.clone(),r.dropAllAttributes());const h=(new l).execute(r,0,n.getTolerance(0),0,_);let o=null;const m=n.getGCS();m!==n&&(o=p(n,m));let u=(new q).execute(h,n,!1,_);return u.isEmpty()?0:(u===s&&(u=s.clone()),n.isPannable()?V(u,n,_):Z(u,n,m,o,_))}}function ae(){return{m_p_PCS:new b,m_factor:Number.NaN,setValues:_e,assign:re}}function _e(e,t){this.m_factor=e,this.m_p_PCS.assign(t)}function re(e){this.m_factor=e.m_factor,this.m_p_PCS.assign(e.m_p_PCS)}class he{constructor(e,t,i,s){this.m_ptStart=new o,this.m_ptEnd=new o,this.m_ptStart.assign(t),this.m_ptEnd.assign(i),this.m_deltaX=this.m_ptEnd.x-this.m_ptStart.x,this.m_deltaY=this.m_ptEnd.y-this.m_ptStart.y,this.m_e=Math.sqrt(e),this.m_e2=e,this.m_c1MinusE2=1-e;const n=Math.sin(s);let a;a=0===this.m_e2?2*n:n*(J(this.m_e*n)+1/(1-this.m_e2*n*n)),this.m_baseA=a}setSegmentEndPoints(e,t){this.m_ptStart.assign(e),this.m_ptEnd.assign(t),this.m_deltaX=this.m_ptEnd.x-this.m_ptStart.x,this.m_deltaY=this.m_ptEnd.y-this.m_ptStart.y}makeFunctor(){return e=>{const t=1-e,i=t*this.m_ptStart.x+e*this.m_ptEnd.x,s=t*this.m_ptStart.y+e*this.m_ptEnd.y,n=t*this.m_ptStart.z+e*this.m_ptEnd.z,a=i*i+s*s,_=n/Math.sqrt(n*n+this.m_c1MinusE2*this.m_c1MinusE2*a);let r;if(0===this.m_e2)r=2*_;else{r=_*(J(this.m_e*_)+1/(1-this.m_e2*_*_))}return(this.m_deltaY*i-this.m_deltaX*s)/a*(r-this.m_baseA)}}}function oe(){return{e:Number.NaN,one_p_e:Number.NaN,one_m_e:Number.NaN,one_m_e_2:Number.NaN,atanh_e_over_e:Number.NaN,half_qp:Number.NaN,f:Number.NaN,z:Number.NaN}}function me(){return{sin_phi:Number.NaN,one_p_sin_phi:Number.NaN,one_m_sin_phi:Number.NaN,one_m_e_2_sin_2_phi:Number.NaN,sin_half_phi_pf:Number.NaN,sin_half_phi_pz:Number.NaN,sin_half_asin_e_sin_phi_pf:Number.NaN,sin_half_asin_e_sin_phi_pz:Number.NaN,atanh_sin_phi:Number.NaN,atanh_esin_phi:Number.NaN,make_negative:!1,initialize:le,changeSign:pe,assign:ue,clone:ce}}function le(e,t,i,s){const n=.5*e;this.sin_phi=Math.sin(e);const a=t*this.sin_phi,_=.5*Math.asin(a);this.one_p_sin_phi=1+this.sin_phi,this.one_m_sin_phi=1-this.sin_phi,this.one_m_e_2_sin_2_phi=(1+a)*(1-a),this.sin_half_phi_pf=Math.sin(n+i),this.sin_half_phi_pz=Math.sin(n+s),this.sin_half_asin_e_sin_phi_pf=Math.sin(_+i),this.sin_half_asin_e_sin_phi_pz=Math.sin(_+s),this.atanh_sin_phi=Math.log(this.sin_half_phi_pf/this.sin_half_phi_pz),this.atanh_esin_phi=Math.log(this.sin_half_asin_e_sin_phi_pf/this.sin_half_asin_e_sin_phi_pz)}function pe(){this.sin_phi=-this.sin_phi;let e=this.one_p_sin_phi;this.one_p_sin_phi=this.one_m_sin_phi,this.one_m_sin_phi=e,e=this.sin_half_phi_pf,this.sin_half_phi_pf=this.sin_half_phi_pz,this.sin_half_phi_pz=e,e=this.sin_half_asin_e_sin_phi_pf,this.sin_half_asin_e_sin_phi_pf=this.sin_half_asin_e_sin_phi_pz,this.sin_half_asin_e_sin_phi_pz=e,this.atanh_sin_phi=-this.atanh_sin_phi,this.atanh_esin_phi=-this.atanh_esin_phi}function ue(e){this.sin_phi=e.sin_phi,this.one_p_sin_phi=e.one_p_sin_phi,this.one_m_sin_phi=e.one_m_sin_phi,this.one_m_e_2_sin_2_phi=e.one_m_e_2_sin_2_phi,this.sin_half_phi_pf=e.sin_half_phi_pf,this.sin_half_phi_pz=e.sin_half_phi_pz,this.sin_half_asin_e_sin_phi_pf=e.sin_half_asin_e_sin_phi_pf,this.sin_half_asin_e_sin_phi_pz=e.sin_half_asin_e_sin_phi_pz,this.atanh_sin_phi=e.atanh_sin_phi,this.atanh_esin_phi=e.atanh_esin_phi,this.make_negative=e.make_negative}function ce(){return{...this}}class ge{constructor(t,i,s){this.m_transformPCS2GCS=null,this.m_scaleToRadians=new O,this.m_scaleToDegrees=new O,this.m_progressTracker=s,n(4!==i),this.m_curveType=i,this.m_inputSR=t,t&&0!==t.getCoordinateSystemType()||e(""),this.m_inputGCS=t.getGCS(),this.m_a=0,this.m_eSquared=0,this.m_b=0,this.m_rpu=0}executePolygonGeodeticArea(e){let t,i=e.clone();if(i.dropAllAttributes(),e.hasNonLinearSegments()){i=(new l).execute(i,0,this.m_inputSR.getTolerance(0),0,this.m_progressTracker)}if(this.m_inputSR.isPannable()){const e=new _;i.queryEnvelope(e);const t=this.m_inputSR.getPannableExtent();if(!t.containsEnvelope(e)){const s=t.getCenterX()-e.getCenterX(),n=new O;n.setShiftCoords(s,0),i.applyTransformation(n),e.move(s,0);const a=new z;t.queryIntervalX(a);const _=new z;e.queryIntervalX(_),i=a.contains(_)?P(i,this.m_inputSR):(new u).foldInto360RangeGeodetic(i,this.m_inputSR,this.m_curveType)}}if(this.m_transformPCS2GCS?(i=(new q).execute(i,this.m_inputSR,!1,this.m_progressTracker),t=i.createInstance(),S(this.m_transformPCS2GCS,i,t,this.m_progressTracker)||(t=(new u).execute(i,this.m_transformPCS2GCS,this.m_progressTracker))):t=(new q).execute(i,this.m_inputGCS,!1,this.m_progressTracker),t.isEmpty())return 0;if(1===this.m_curveType){const e=f();return this.m_inputGCS.querySpheroidData(e),this.m_a=e.majorSemiAxis,this.m_eSquared=e.e2,this.loxodromeArea(t)}const s=t.getImpl();this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_scaleToRadians.setScale(this.m_rpu),s.applyTransformation(this.m_scaleToRadians),this.m_scaleToDegrees=this.m_scaleToRadians,this.m_scaleToDegrees.invertThis();const n=f();if(this.m_inputGCS.querySpheroidData(n),this.m_a=n.majorSemiAxis,this.m_b=n.minorSemiAxis,this.m_eSquared=n.e2,2===this.m_curveType)return this.executeClippedPolygonGreatEllipticArea(t);{const e={stack:[],error:void 0,hasError:!1};try{const i=A.unit(9101),s=this.m_inputGCS.getPECoordSys(),n=j(e,s.cloneAlterUnits(i),!1);let a,_,r=this.executeClippedPolygonGeodeticArea(t,n,0),h=0;do{h++,a=this.executeClippedPolygonGeodeticArea(t,n,h),_=Math.abs(a-r),r=a}while(Math.abs(a)>1&&_>1e-8*Math.abs(a)&&h<7);return a}catch(a){e.error=a,e.hasError=!0}finally{B(e)}}}executeClippedPolygonGeodeticArea(e,t,i){const s={stack:[],error:void 0,hasError:!1};try{const n=new _;e.queryEnvelope(n);const a=j(s,this.getEqualAreaPCSInstance(t,n),!1),r=e.clone();y(a,r);const h=50,o=r.getImpl().getAttributeStreamRef(0),m=e.getImpl().getAttributeStreamRef(0),l=j(s,new x,!1),p=j(s,new x,!1),u=40,c=[0,0],g=D(ae,u),d=G(u,-1),f=ae(),P=ae();let S,A;const M=a;let C=r.calculateArea2D();const T=new I(0),w=.5*Math.PI,q=1e-10*Math.abs(C)+1e-6,N=e.getPathCount();let v,$,O,z;const k=new b,F=new b,J=new b,Y=new b,U=new b,X=new b;let B,H;for($=e.getPathStart(0),v=0;v<N;v++,$=O)for(O=e.getPathEnd(v),o.queryPoint2D(O-1<<1,J),m.queryPoint2D(O-1<<1,k),Math.abs(k.y)>w&&(k.y=L(w,k.y)),z=$;z<O;z++,J.assign(Y),k.assign(F)){if(o.queryPoint2D(z<<1,Y),m.queryPoint2D(z<<1,F),Math.abs(F.y)>w&&(F.y=L(w,F.y)),B=b.distance(J,Y),B<h||0===k.y&&0===F.y)continue;R.geodeticDistance(this.m_a,this.m_eSquared,k.x,k.y,F.x,F.y,l,p,null,this.m_curveType);const e=l.val,t=p.val;for(f.setValues(0,J),P.setValues(1,Y),A=i,g[0].assign(P),d[0]=i,S=0;S>=0;){H=.5*(f.m_factor+P.m_factor),R.geodeticCoordinate(this.m_a,this.m_eSquared,k.x,k.y,e*H,t,l,p,this.m_curveType),U.x=l.val,U.y=p.val,c[0]=U.x,c[1]=U.y,E.geogToProj(M,1,c),X.x=c[0],X.y=c[1];const i=-X.offset(f.m_p_PCS,P.m_p_PCS),s=.5*i*b.distance(f.m_p_PCS,P.m_p_PCS);if(T.pe(s),Math.abs(s)>q||Math.abs(s)>0&&A>0)P.setValues(H,X),S++,g[S].assign(P),Math.abs(s)<=q?(A--,d[S-1]=A,d[S]=A):(A=d[S-1],d[S]=A);else{if(S<=0)break;f.assign(P),S--,P.assign(g[S]),A=d[S]}}}return C+=T.getResult(),Math.abs(C)}catch(n){s.error=n,s.hasError=!0}finally{B(s)}}executeClippedPolygonGreatEllipticArea(e){const t=[],i=[],s=new b,n=new b,a=M(1,this.m_eSquared,new b(0,.5*Math.PI)),r=new I(0),h=new I(0),m=new I(0),l=new o,p=new o,u=new _;e.queryLooseEnvelope(u);let c=0;u.containsCoords(u.xmin,0)||(c=Math.abs(u.ymin)<Math.abs(u.ymax)?u.ymin:u.ymax);const g=new he(this.m_eSquared,l,p,c),d=this.m_a*this.m_a,E=e.getImpl().querySegmentIterator();for(E.stripAttributes();E.nextPath();)for(;E.hasNextSegment();){const e=E.nextSegment();s.assign(e.getStartXY()),n.assign(e.getEndXY()),n.x-s.x>Math.PI?s.x+=2*Math.PI:n.x-s.x<-Math.PI&&(n.x+=2*Math.PI),this.splitSegmentCrossingItegralThreshold(e,t,i);for(let i of t)l.assign(M(this.m_a,this.m_eSquared,i.getStartXY())),p.assign(M(this.m_a,this.m_eSquared,i.getEndXY())),g.setSegmentEndPoints(l,p),this.adaptiveIntegrationWithRomberg(g,r);for(let t of i){let e=t.getStartXY(),i=t.getEndXY(),s=c;e.y<0&&(i=k(e,e=i),e.y=-e.y,i.y=-i.y,s=-s);const n=M(1,this.m_eSquared,e),_=M(1,this.m_eSquared,i),r=Math.min(e.y,i.y),l=C(this.m_eSquared,e.x,i.x,s,r);h.pe(l);const p=Math.abs(C(this.m_eSquared,e.x,i.x,r,v)),u=new o;u.setSub(n,a);const g=new o;g.setSub(_,a);const E=new o;E.setCrossProductVector(u,g);let f=d*(p-.5*E.length());f=L(f,i.x-e.x),m.pe(f)}t.length=0,i.length=0}return m.getResult()+d*(.5*(1-this.m_eSquared)*r.getResult()+h.getResult())}getEqualAreaPCSInstance(e,t){const i=t.getCenterX(),s=0,n=0;let a,_;const r=t.height();let h,o;(h=t.ymin>45*Math.PI/180||t.ymax<45*-Math.PI/180)?a=L(.5*Math.PI,t.getCenterY()):(a=t.getCenterY(),_=t.ymin+r*(2/3));const m=g("EqualAreaPCS"),l=e.toString();return o=h?A.fromString(c.PE_TYPE_PROJCS,`PROJCS["${m}", ${l}, PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["False_Easting",${s}],PARAMETER["False_Northing", ${n}],PARAMETER["Central_Meridian", ${i}], PARAMETER["Latitude_of_Origin", ${a}], UNIT["Meter",1.0]]`):A.fromString(c.PE_TYPE_PROJCS,`PROJCS["${m}", ${l}, PROJECTION["Cylindrical_Equal_Area"],PARAMETER["False_Easting", ${s}],PARAMETER["False_Northing", ${n}],PARAMETER["Central_Meridian", ${i}],PARAMETER["Standard_Parallel_1", ${_}],PARAMETER["Latitude_of_Origin", ${a}],UNIT["Meter",1.0]]`),o}splitSegmentCrossingItegralThreshold(e,t,i){const s=100,n=20,a=n*n,_=M(this.m_a,this.m_eSquared,new b(0,v)),r=M(this.m_a,this.m_eSquared,new b(0,-v)),h=this.splitSegmentPassingThroughPole(e);for(let l of h){const e=l.getStartXY(),h=l.getEndXY(),p=M(this.m_a,this.m_eSquared,e),u=M(this.m_a,this.m_eSquared,h),c=new b,g=new o;let d=o.sqrDistance(_,p),E=o.sqrDistance(p,u);if(d<=s){if(!(E>a)){i.push(new m({start:e,end:h}));continue}g.assign(u.sub(p)),g.normalizeThis(),g.assign(p.add(g.mul(n))),c.assign(T(this.m_a,this.m_eSquared,g)),i.push(new m({start:e,end:c})),e.assign(c)}if(p.assign(M(this.m_a,this.m_eSquared,e)),d=o.sqrDistance(_,u),E=o.sqrDistance(p,u),d<=s){if(!(E>a)){i.push(new m({start:e,end:h}));continue}g.assign(u.sub(p)),g.normalizeThis(),g.assign(u.sub(g.mul(n))),c.assign(T(this.m_a,this.m_eSquared,g)),i.push(new m({start:c,end:h})),h.assign(c)}if(p.assign(M(this.m_a,this.m_eSquared,e)),u.assign(M(this.m_a,this.m_eSquared,h)),d=o.sqrDistance(r,p),E=o.sqrDistance(p,u),d<=s){if(!(E>a)){i.push(new m({start:e,end:h}));continue}g.assign(u.sub(p)),g.normalizeThis(),g.assign(p.add(g.mul(n))),c.assign(T(this.m_a,this.m_eSquared,g)),i.push(new m({start:e,end:c})),e.assign(c)}if(p.assign(M(this.m_a,this.m_eSquared,e)),u.assign(M(this.m_a,this.m_eSquared,h)),d=o.sqrDistance(r,u),E=o.sqrDistance(p,u),d<=s){if(!(E>a)){i.push(new m({start:e,end:h}));continue}g.assign(u.sub(p)),g.normalizeThis(),g.assign(u.sub(g.mul(n))),c.assign(T(this.m_a,this.m_eSquared,g)),i.push(new m({start:c,end:h})),h.assign(c)}t.push(new m({start:e,end:h}))}}splitSegmentPassingThroughPole(e){const t={stack:[],error:void 0,hasError:!1};try{const i=[],s=new o,n=new o,a=new o,_=new b,r=20,h=3.124139361,l=10,p=e.getStartXY(),u=e.getEndXY(),c=j(t,new x,!1);if(R.geodeticDistance(this.m_a,this.m_eSquared,p.x,p.y,u.x,u.y,c,null,null,2),Math.abs(u.x-p.x)>h&&c.val>r){const e=new H(new b(0,90),p.divide(this.m_rpu),u.divide(this.m_rpu),this.m_inputGCS,2,2);let t=w(e.makeFunctor(),0,1,1e-10);if(t.second<=l&&t.first>0&&t.first<1)return s.assign(M(this.m_a,this.m_eSquared,p)),n.assign(M(this.m_a,this.m_eSquared,u)),F(s,n,t.first,a),_.assign(T(this.m_a,this.m_eSquared,a)),i.push(new m({start:p,end:_})),i.push(new m({start:_,end:u})),i;if(e.setPointDistFrom(new b(0,-90)),t=w(e.makeFunctor(),0,1,1e-10),t.second<=l&&t.first>0&&t.first<1)return s.assign(M(this.m_a,this.m_eSquared,p)),n.assign(M(this.m_a,this.m_eSquared,u)),F(s,n,t.first,a),_.assign(T(this.m_a,this.m_eSquared,a)),i.push(new m({start:p,end:_})),i.push(new m({start:_,end:u})),i}return i.push(new m({start:p,end:u})),i}catch(i){t.error=i,t.hasError=!0}finally{B(t)}}adaptiveIntegrationWithRomberg(e,t){const i=e.makeFunctor();let s=0,n=1,a=i(s),_=i(n);const r=1e-17,o=1e-14;let m=(s+n)/2,l=i(m),p=Math.abs(l-a),u=Math.abs(_-l),c=0;for(;c++<32&&(p/u<.1||u/p<.1);)p<u?(t.pe(h(5,s,m,o,r,i)),s=m,a=l):(t.pe(h(5,m,n,o,r,i)),n=m,_=l),m=(s+n)/2,l=Math.abs(i(m)),p=Math.abs(l-a),u=Math.abs(_-l);t.pe(h(5,s,n,o,r,i))}loxodromeAreaHemi(e,t,i,s,n){const a=i.clone(),_=n.clone();let r,h,o,m,l,p,u,c,g,d,E,f,P,S,A,y;return a.make_negative&&a.changeSign(),_.make_negative&&_.changeSign(),E=s-t,1===Math.abs(a.sin_phi)||1===Math.abs(_.sin_phi)?e.half_qp*E:a.sin_phi===_.sin_phi?(d=.5*e.one_m_e_2*a.sin_phi*(1/a.one_m_e_2_sin_2_phi+J(e.e*a.sin_phi))*E,d):(A=Math.log(_.sin_half_phi_pf*a.sin_half_phi_pz/(_.sin_half_phi_pz*a.sin_half_phi_pf)),y=Math.log(_.sin_half_asin_e_sin_phi_pf*a.sin_half_asin_e_sin_phi_pz/(_.sin_half_asin_e_sin_phi_pz*a.sin_half_asin_e_sin_phi_pf)),1===this.m_eSquared?(l=0,r=.5*(A+_.sin_phi/_.one_m_e_2_sin_2_phi-a.sin_phi/a.one_m_e_2_sin_2_phi),h=0):(l=-2*e.atanh_e_over_e*(Math.log(_.one_p_sin_phi/a.one_p_sin_phi)-e.e*y),r=(A-e.e*y)/e.one_m_e_2,h=(Math.log(_.one_m_e_2_sin_2_phi/a.one_m_e_2_sin_2_phi)+l/e.atanh_e_over_e)/e.one_m_e_2),o=-y*(a.atanh_esin_phi+_.atanh_esin_phi),m=1/a.one_m_e_2_sin_2_phi-1/_.one_m_e_2_sin_2_phi,p=Y(_.one_m_sin_phi/e.one_p_e,e.e)-Y(a.one_m_sin_phi/e.one_p_e,e.e),u=Y(_.one_p_sin_phi/e.one_p_e,e.e)-Y(a.one_p_sin_phi/e.one_p_e,e.e),c=Y(a.one_m_sin_phi/-e.one_m_e,e.e)-Y(_.one_m_sin_phi/-e.one_m_e,e.e),g=Y(a.one_p_sin_phi/-e.one_m_e,e.e)-Y(_.one_p_sin_phi/-e.one_m_e,e.e),d=.25/r*(h+o+m+l+.5*(p+u+c+g)),d+=e.half_qp,f=.5*e.one_m_e_2*a.sin_phi*(1/a.one_m_e_2_sin_2_phi+J(e.e*a.sin_phi)),P=.5*e.one_m_e_2*_.sin_phi*(1/_.one_m_e_2_sin_2_phi+J(e.e*_.sin_phi)),P<f&&(S=f,f=P,P=S),d<f&&(d=f),d>P&&(d=P),d*=E,d)}loxodromeArea(e){const t=Math.PI/180;let i=0;const s=oe(),n=me(),a=me();s.e=Math.sqrt(this.m_eSquared),s.one_p_e=1+s.e,s.one_m_e=1-s.e,s.one_m_e_2=1-this.m_eSquared,s.atanh_e_over_e=J(s.e),this.m_eSquared>=1?s.half_qp=1:s.half_qp=.5*(1+s.atanh_e_over_e*s.one_m_e_2),s.f=.25*Math.PI,s.z=.75*Math.PI,a.initialize(0,s.e,s.f,s.z);const _=e.getPathCount(),r=new b,h=new b,o=e.getImpl().getAttributeStreamRef(0);for(let m=0;m<_;m++){const _=e.getPathStart(m),l=e.getPathEnd(m);if(!(l-_<=1)){o.queryPoint2D(2*(l-1),r);for(let e=_;e<l;e++){o.queryPoint2D(2*e,h);const m=r.y*t,l=h.y*t;if(e===_?(n.initialize(m,s.e,s.f,s.z),n.make_negative=!1):n.assign(a),a.initialize(l,s.e,s.f,s.z),a.make_negative=!1,r.y*h.y<0){if(r.y>=90&&h.y<=-90||h.y>=90&&r.y<=-90)return Number.NaN;const e=me();e.initialize(0,s.e,s.f,s.z),e.make_negative=!1;const _=n.atanh_sin_phi-s.e*n.atanh_esin_phi,o=a.atanh_sin_phi-s.e*a.atanh_esin_phi,l=(o*r.x-_*h.x)/(o-_);m<0?(n.make_negative=!0,i-=this.loxodromeAreaHemi(s,r.x*t,n,l*t,e),n.make_negative=!1,i+=this.loxodromeAreaHemi(s,l*t,e,h.x*t,a)):(i+=this.loxodromeAreaHemi(s,r.x*t,n,l*t,e),a.make_negative=!0,i-=this.loxodromeAreaHemi(s,l*t,e,h.x*t,a),a.make_negative=!1)}else r.y>=0?i+=this.loxodromeAreaHemi(s,r.x*t,n,h.x*t,a):(n.make_negative=!0,a.make_negative=!0,i-=this.loxodromeAreaHemi(s,r.x*t,n,h.x*t,a),n.make_negative=!1,a.make_negative=!1);r.assign(h)}}}return this.m_a*i*this.m_a}calculate(e){if(e.isEmpty()||e.getDimension()<2)return 0;if(e.getGeometryType()===i.enumEnvelope){const t=new a;return t.addEnvelope(e,!1),this.calculate(t)}return this.m_inputSR!==this.m_inputGCS&&null===this.m_transformPCS2GCS&&(this.m_transformPCS2GCS=p(this.m_inputSR,this.m_inputGCS,null)),this.executePolygonGeodeticArea(e)}}class de{getOperatorType(){return 10311}supportsCurves(){return!0}accelerateGeometry(e,t,i){return!1}canAccelerateGeometry(e){return!1}execute(e,i,s,n){if(t(e),4===s)return(new ne).execute(e,i,n);return new ge(i,s,n).calculate(e)}}export{de as OperatorGeodeticArea};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{S as e,G as t}from"./SimpleGeometryCursor.js";import{a as r,k as s,t as n,b as i}from"./Geometry.js";import{f as m}from"./OperatorProject.js";class o{getOperatorType(){return 10310}supportsCurves(){return!0}accelerateGeometry(e,t,r){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,r,s,n){return new a(e,r,s,t,-1,-1,n)}execute(t,s,n,i,m){const o=new e([t]),a=this.executeMany(o,s,n,i,m).next();return a||r("null output"),a}}class a extends t{constructor(e,t,r,i,m,o,a){super(),this.m_progressTracker=a,o>0&&s(""),4!==r&&m>0&&s(""),t||n("");0===t.getCoordinateSystemType()&&n(""),i>0||m>0||n(""),this.m_index=-1,this.m_inputGeoms=e,this.m_spatialReference=t,this.m_curveType=r,this.m_maxLengthMeters=i,this.m_maxDeviationMeters=m,this.m_maxAngle=o}next(){{let e;for(;e=this.m_inputGeoms.next();)return i(e),this.m_index=this.m_inputGeoms.getGeometryID(),this.geodeticDensify(e);return null}}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}geodeticDensify(e){return m(e,this.m_spatialReference,this.m_curveType,this.m_maxLengthMeters,this.m_maxDeviationMeters,this.m_progressTracker)}}export{o as OperatorGeodeticDensifyByLength,a as OperatorGeodeticDensifyCursor};
5
+ import{S as e,G as t}from"./SimpleGeometryCursor.js";import{b as r,a as s,t as n,c as i}from"./Geometry.js";import{f as m}from"./OperatorProject.js";class o{getOperatorType(){return 10310}supportsCurves(){return!0}accelerateGeometry(e,t,r){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,r,s,n){return new a(e,r,s,t,-1,-1,n)}execute(t,s,n,i,m){const o=new e([t]),a=this.executeMany(o,s,n,i,m).next();return a||r("null output"),a}}class a extends t{constructor(e,t,r,i,m,o,a){super(),this.m_progressTracker=a,o>0&&s(""),4!==r&&m>0&&s(""),t||n("");0===t.getCoordinateSystemType()&&n(""),i>0||m>0||n(""),this.m_index=-1,this.m_inputGeoms=e,this.m_spatialReference=t,this.m_curveType=r,this.m_maxLengthMeters=i,this.m_maxDeviationMeters=m,this.m_maxAngle=o}next(){{let e;for(;e=this.m_inputGeoms.next();)return i(e),this.m_index=this.m_inputGeoms.getGeometryID(),this.geodeticDensify(e);return null}}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}geodeticDensify(e){return m(e,this.m_spatialReference,this.m_curveType,this.m_maxLengthMeters,this.m_maxDeviationMeters,this.m_progressTracker)}}export{o as OperatorGeodeticDensifyByLength,a as OperatorGeodeticDensifyCursor};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{b as e,c as r}from"./tslib.es6.js";import{t,b as o}from"./Geometry.js";import{G as s,m as a}from"./GeodeticDistanceCalculator-bNilDneE.js";class u{getOperatorType(){return 10316}supportsCurves(){return!0}accelerateGeometry(e,r,t){return!1}canAccelerateGeometry(e){return!1}execute(e,r,t,o,s){return this.executeEx(e,r,t,o,s,null,null,Number.NaN)}executeEx(u,n,i,c,m,l,p,N){const y={stack:[],error:void 0,hasError:!1};try{if(0===i.getCoordinateSystemType()&&t(""),o(u),o(n),u.isEmpty()||n.isEmpty())return Number.NaN;Number.isNaN(N)&&(N=Number.MAX_VALUE);const r=e(y,new s(i,c,m,N,1),!1),b=a(),E=a(),x=r.calculate(u,n,b,E);return l&&l.outPoint.assign(b.outPoint),p&&p.outPoint.assign(E.outPoint),x}catch(b){y.error=b,y.hasError=!0}finally{r(y)}}}export{u as OperatorGeodeticDistance,a as makeOutput};
5
+ import{b as e,c as r}from"./tslib.es6.js";import{t,c as o}from"./Geometry.js";import{G as s,m as a}from"./GeodeticDistanceCalculator-bNilDneE.js";class u{getOperatorType(){return 10316}supportsCurves(){return!0}accelerateGeometry(e,r,t){return!1}canAccelerateGeometry(e){return!1}execute(e,r,t,o,s){return this.executeEx(e,r,t,o,s,null,null,Number.NaN)}executeEx(u,n,c,i,m,l,p,N){const y={stack:[],error:void 0,hasError:!1};try{if(0===c.getCoordinateSystemType()&&t(""),o(u),o(n),u.isEmpty()||n.isEmpty())return Number.NaN;Number.isNaN(N)&&(N=Number.MAX_VALUE);const r=e(y,new s(c,i,m,N,1),!1),E=a(),b=a(),x=r.calculate(u,n,E,b);return l&&l.outPoint.assign(E.outPoint),p&&p.outPoint.assign(b.outPoint),x}catch(E){y.error=E,y.hasError=!0}finally{r(y)}}}export{u as OperatorGeodeticDistance,a as makeOutput};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{b as e,c as t}from"./tslib.es6.js";import{t as r,b as n,G as o,d as s}from"./Geometry.js";import{O as a}from"./OperatorShapePreservingLength.js";import{R as i,h as c}from"./QuadraticBezier.js";import{E as m}from"./Transformation2D.js";import{h as u,T as g,U as l,g as p,o as y,q as f,s as h}from"./OperatorProject.js";import{O as x}from"./OperatorDensify.js";class d{getOperatorType(){return 10311}supportsCurves(){return!0}accelerateGeometry(e,t,r){return!1}canAccelerateGeometry(e){return!1}execute(e,t,y,f){if(4===y)return(new a).execute(e,t,f);if(0===t.getCoordinateSystemType()&&r(""),n(e),e.isEmpty()||e.getDimension()<1)return 0;const d=t.getGCS(),S=h();d.querySpheroidData(S);const P=S.majorSemiAxis,j=S.e2,E=d.getUnit().getUnitToBaseFactor();let G;const T=e.getGeometryType();if(T===o.enumPolygon?G=e.getBoundary():T===o.enumEnvelope?G=i(e):s(T)?(G=new c({vd:e.getDescription()}),G.addSegment(e,!0)):G=e,G.hasNonLinearSegments()){G=(new x).execute(G,0,t.getTolerance(0),0,f)}if(d!==t){const r=t.getSRToGCSTransform();if(t.isPannable()){G=u(G,t),T===o.enumPolyline&&G===e&&(G=e.clone());const r=new m;t.getPannableExtent().queryIntervalX(r);for(let e=0,t=G.getPointCount();e<t;e++){const t=G.getXY(e);t.x=g(t.x,r),G.setXY(e,t)}}const n=G.createInstance();G=l(r,G,n,f)?n:(new p).execute(G,r,f)}return this._ExecuteMultiPathGeodeticLength(G,y,P,j,E)}_ExecuteMultiPathGeodeticLength(r,n,o,s,a){const i={stack:[],error:void 0,hasError:!1};try{const t=e(i,new y,!1);let c=0;const m=r.querySegmentIterator();for(;m.nextPath();)for(;m.hasNextSegment();){const e=m.nextSegment(),r=e.getStartXY(),i=e.getEndXY();r.scale(a),i.scale(a),f.geodeticDistance(o,s,r.x,r.y,i.x,i.y,t,null,null,n),c+=t.val}return c}catch(c){i.error=c,i.hasError=!0}finally{t(i)}}}export{d as OperatorGeodeticLength};
5
+ import{b as e,c as t}from"./tslib.es6.js";import{t as r,c as n,G as o,e as s}from"./Geometry.js";import{O as a}from"./OperatorShapePreservingLength.js";import{Q as i,i as c}from"./QuadraticBezier.js";import{E as m}from"./Transformation2D.js";import{h as u,H as g,I as l,g as p,o as y,q as f,s as x}from"./OperatorProject.js";import{O as h}from"./OperatorDensify.js";class S{getOperatorType(){return 10311}supportsCurves(){return!0}accelerateGeometry(e,t,r){return!1}canAccelerateGeometry(e){return!1}execute(e,t,y,f){if(4===y)return(new a).execute(e,t,f);if(0===t.getCoordinateSystemType()&&r(""),n(e),e.isEmpty()||e.getDimension()<1)return 0;const S=t.getGCS(),d=x();S.querySpheroidData(d);const P=d.majorSemiAxis,j=d.e2,E=S.getUnit().getUnitToBaseFactor();let G;const T=e.getGeometryType();if(T===o.enumPolygon?G=e.getBoundary():T===o.enumEnvelope?G=i(e):s(T)?(G=new c({vd:e.getDescription()}),G.addSegment(e,!0)):G=e,G.hasNonLinearSegments()){G=(new h).execute(G,0,t.getTolerance(0),0,f)}if(S!==t){const r=t.getSRToGCSTransform();if(t.isPannable()){G=u(G,t),T===o.enumPolyline&&G===e&&(G=e.clone());const r=new m;t.getPannableExtent().queryIntervalX(r);for(let e=0,t=G.getPointCount();e<t;e++){const t=G.getXY(e);t.x=g(t.x,r),G.setXY(e,t)}}const n=G.createInstance();G=l(r,G,n,f)?n:(new p).execute(G,r,f)}return this._ExecuteMultiPathGeodeticLength(G,y,P,j,E)}_ExecuteMultiPathGeodeticLength(r,n,o,s,a){const i={stack:[],error:void 0,hasError:!1};try{const t=e(i,new y,!1);let c=0;const m=r.querySegmentIterator();for(;m.nextPath();)for(;m.hasNextSegment();){const e=m.nextSegment(),r=e.getStartXY(),i=e.getEndXY();r.scale(a),i.scale(a),f.geodeticDistance(o,s,r.x,r.y,i.x,i.y,t,null,null,n),c+=t.val}return c}catch(c){i.error=c,i.hasError=!0}finally{t(i)}}}export{S as OperatorGeodeticLength};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{S as e,G as t}from"./SimpleGeometryCursor.js";import{G as r,a as s,t as n,b as m}from"./Geometry.js";import{I as i}from"./Intersector-K1VmdfQW.js";import{t as o,F as u}from"./QuadraticBezier.js";class a extends t{constructor(e,t,r,s,m){super(),this.m_smallCursor=null,this.m_progressTracker=s,this.m_geomIntersector=t.next(),this.m_intersector=new i(this.m_geomIntersector,r,m,s),this.m_index=-1,this.m_inputGeoms=e,this.m_dimensionMask=m,-1!==this.m_dimensionMask&&(this.m_dimensionMask<=0||this.m_dimensionMask>7)&&n("bad dimension mask")}next(){if(!this.m_geomIntersector)return null;let e;if(null!==this.m_smallCursor){if(e=this.m_smallCursor.next(),e)return e;this.m_smallCursor=null}for(;e=this.m_inputGeoms.next();){if(m(e),this.m_index=this.m_inputGeoms.getGeometryID(),-1===this.m_dimensionMask){return this.m_intersector.intersect(e)}this.m_smallCursor=this.m_intersector.intersectEx(e);return this.m_smallCursor.next()}return null}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}}class l{getOperatorType(){return 1e4}accelerateGeometry(e,t,s){if(!this.canAccelerateGeometry(e))return!1;o(t,e,!0);let n=0;return e.getGeometryType()!==r.enumPolygon&&e.getGeometryType()!==r.enumPolyline||!u(e)||0===s||(n|=e.getImpl().buildQuadTreeAccelerator(s)?1:0),!!n}canAccelerateGeometry(e){return u(e)}supportsCurves(){return!0}executeMany(e,t,r,s,n=-1){return new a(e,t,r,s,n)}execute(t,n,m,o){if(t.getGeometryType()===r.enumPoint&&n.getGeometryType()===r.enumPoint)return i.intersectPoints(t,n,m);const u=new e([t]),a=new e([n]),l=this.executeMany(u,a,m,o,-1).next();return l||s("null output"),l}}export{l as O};
5
+ import{S as e,G as t}from"./SimpleGeometryCursor.js";import{G as r,b as s,t as n,c as m}from"./Geometry.js";import{I as i}from"./Intersector-K1VmdfQW.js";import{u as o,G as u}from"./QuadraticBezier.js";class a extends t{constructor(e,t,r,s,m){super(),this.m_smallCursor=null,this.m_progressTracker=s,this.m_geomIntersector=t.next(),this.m_intersector=new i(this.m_geomIntersector,r,m,s),this.m_index=-1,this.m_inputGeoms=e,this.m_dimensionMask=m,-1!==this.m_dimensionMask&&(this.m_dimensionMask<=0||this.m_dimensionMask>7)&&n("bad dimension mask")}next(){if(!this.m_geomIntersector)return null;let e;if(null!==this.m_smallCursor){if(e=this.m_smallCursor.next(),e)return e;this.m_smallCursor=null}for(;e=this.m_inputGeoms.next();){if(m(e),this.m_index=this.m_inputGeoms.getGeometryID(),-1===this.m_dimensionMask){return this.m_intersector.intersect(e)}this.m_smallCursor=this.m_intersector.intersectEx(e);return this.m_smallCursor.next()}return null}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}}class l{getOperatorType(){return 1e4}accelerateGeometry(e,t,s){if(!this.canAccelerateGeometry(e))return!1;o(t,e,!0);let n=0;return e.getGeometryType()!==r.enumPolygon&&e.getGeometryType()!==r.enumPolyline||!u(e)||0===s||(n|=e.getImpl().buildQuadTreeAccelerator(s)?1:0),!!n}canAccelerateGeometry(e){return u(e)}supportsCurves(){return!0}executeMany(e,t,r,s,n=-1){return new a(e,t,r,s,n)}execute(t,n,m,o){if(t.getGeometryType()===r.enumPoint&&n.getGeometryType()===r.enumPoint)return i.intersectPoints(t,n,m);const u=new e([t]),a=new e([n]),l=this.executeMany(u,a,m,o,-1).next();return l||s("null output"),l}}export{l as O};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{b as e,r}from"./OperatorProject.js";class t extends e{getOperatorType(){return 4}execute(e,t,s,a){return!r(e,t,s,4,a)}}export{t as O};
5
+ import{d as e,r}from"./OperatorProject.js";class t extends e{getOperatorType(){return 4}execute(e,t,s,a){return!r(e,t,s,4,a)}}export{t as O};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{G as e}from"./SimpleGeometryCursor.js";import{j as t,b as s,a as r,t as n,n as a,g as o,P as i}from"./QuadraticBezier.js";import{b as m,G as l,g,t as h}from"./Geometry.js";import{O as u,h as c}from"./OperatorSimplify.js";import{d as p,g as y,q as P,C as _}from"./CrackAndCluster-CfzXpEle.js";class d{getOperatorType(){return 10700}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}executeMany(e,t,s,r=1){return new I(e,t,s,r)}}class I extends e{constructor(e,t,s,r){super(),this.m_progressTracker=s,this.m_inputGeoms=e,this.m_spatialReference=t,this.m_currentGeometry=null,this.m_singlePartIndex=-1,this.m_singlePartCount=-1,this.m_polygonStart=-1,this.m_index=-1,this.m_options=r}tock(){return!0}getRank(){return 1}next(){if(this.m_singlePartIndex===this.m_singlePartCount){const e=this.m_inputGeoms.next();if(null===e)return null;if(m(e),e.getGeometryType()===l.enumPolygon)if(1===this.m_options)this.m_currentGeometry=(new u).execute(e,this.m_spatialReference,!1,this.m_progressTracker);else if(2===this.m_options)if(e.getPathCount()<2)this.m_currentGeometry=e;else{const i=[0],m=e.getImpl().getIsSimple(0,i);if(t(m))this.m_currentGeometry=e;else{const t=new s,i=t.addGeometry(e);let m=null;if(t.hasCurves()){m=new _;const s=new r;e.queryEnvelope(s);const a=n(null,e,!0),o=p(a.total(),s);y(t,o,a.total(),12e3,null,m,null,this.m_progressTracker)}const l=t.createPathUserIndex();{let e=0;for(let s=t.getFirstPath(i);s!==a;s=t.getNextPath(s))t.setPathUserIndex(s,l,e++)}const h=c(t,i,this.m_progressTracker);g(h>=0);const u=[];for(let e=t.getFirstPath(i);e!==a;e=t.getNextPath(e))u.push(e);u.sort(((e,s)=>Math.abs(t.getPathUserIndex(e,h))-Math.abs(t.getPathUserIndex(s,h))));const P=e,d=new o({vd:e.getDescription()});d.reserveParts(P.getPointCount(),P.getPathCount());for(let e=0,s=u.length;e<s;e++){const s=u[e],r=t.getPathUserIndex(s,l),n=P.calculateRingArea2D(r)>0,a=t.getPathUserIndex(s,h)>=0;d.addPath(P,r,n===a)}this.m_currentGeometry=d}}else h("");else this.m_currentGeometry=e;this.m_singlePartCount=f(this.m_currentGeometry),this.m_singlePartIndex=0,this.m_polygonStart=0,this.m_index=this.m_inputGeoms.getGeometryID()}const e=this.getSingleGeometry(this.m_singlePartIndex,this.m_singlePartCount,this.m_polygonStart,this.m_currentGeometry);return e.getGeometryType()===l.enumPolygon&&(this.m_polygonStart+=e.getPathCount()),this.m_singlePartIndex++,e}getGeometryID(){return this.m_index}getSingleGeometry(e,t,s,r){let n=null;switch(r.getGeometryType()){case l.enumMultiPoint:n=new i({vd:r.getDescription()}),r.isEmpty()||r.getPointByVal(e,n);break;case l.enumPolyline:if(1===t)n=r;else{n=r.createInstance(),n.getImpl().addPath(r.getImpl(),e,!0);const t=[0],s=r.getImpl().getIsSimple(0,t);n.getImpl().setIsSimple(s,t[0],!0)}break;case l.enumPolygon:if(1===t)n=r;else{n=r.createInstance();const e=n.getImpl(),t=r.getImpl(),a=t.getPathFlagsStreamRef();let o=s;const i=t.getPathCount();do{e.addPath(t,o,!0),o++}while(o<i&&!(8&a.read(o)));e.getPathFlagsStreamRef().setBits(0,8);const m=[0],l=t.getIsSimple(0,m);e.setIsSimple(l,m[0],!0)}break;default:n=r}return n}}function f(e){return e.isEmpty()?1:P(e)}export{d as O};
5
+ import{G as e}from"./SimpleGeometryCursor.js";import{k as t,d as s,a as r,u as n,n as a,h as o,P as i}from"./QuadraticBezier.js";import{c as m,G as l,g as h,t as g}from"./Geometry.js";import{O as u,h as c}from"./OperatorSimplify.js";import{d as p,h as y,q as P,C as _}from"./CrackAndCluster-CfzXpEle.js";class d{getOperatorType(){return 10700}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}executeMany(e,t,s,r=1){return new I(e,t,s,r)}}class I extends e{constructor(e,t,s,r){super(),this.m_progressTracker=s,this.m_inputGeoms=e,this.m_spatialReference=t,this.m_currentGeometry=null,this.m_singlePartIndex=-1,this.m_singlePartCount=-1,this.m_polygonStart=-1,this.m_index=-1,this.m_options=r}tock(){return!0}getRank(){return 1}next(){if(this.m_singlePartIndex===this.m_singlePartCount){const e=this.m_inputGeoms.next();if(null===e)return null;if(m(e),e.getGeometryType()===l.enumPolygon)if(1===this.m_options)this.m_currentGeometry=(new u).execute(e,this.m_spatialReference,!1,this.m_progressTracker);else if(2===this.m_options)if(e.getPathCount()<2)this.m_currentGeometry=e;else{const i=[0],m=e.getImpl().getIsSimple(0,i);if(t(m))this.m_currentGeometry=e;else{const t=new s,i=t.addGeometry(e);let m=null;if(t.hasCurves()){m=new _;const s=new r;e.queryEnvelope(s);const a=n(null,e,!0),o=p(a.total(),s);y(t,o,a.total(),12e3,null,m,null,this.m_progressTracker)}const l=t.createPathUserIndex();{let e=0;for(let s=t.getFirstPath(i);s!==a;s=t.getNextPath(s))t.setPathUserIndex(s,l,e++)}const g=c(t,i,this.m_progressTracker);h(g>=0);const u=[];for(let e=t.getFirstPath(i);e!==a;e=t.getNextPath(e))u.push(e);u.sort(((e,s)=>Math.abs(t.getPathUserIndex(e,g))-Math.abs(t.getPathUserIndex(s,g))));const P=e,d=new o({vd:e.getDescription()});d.reserveParts(P.getPointCount(),P.getPathCount());for(let e=0,s=u.length;e<s;e++){const s=u[e],r=t.getPathUserIndex(s,l),n=P.calculateRingArea2D(r)>0,a=t.getPathUserIndex(s,g)>=0;d.addPath(P,r,n===a)}this.m_currentGeometry=d}}else g("");else this.m_currentGeometry=e;this.m_singlePartCount=f(this.m_currentGeometry),this.m_singlePartIndex=0,this.m_polygonStart=0,this.m_index=this.m_inputGeoms.getGeometryID()}const e=this.getSingleGeometry(this.m_singlePartIndex,this.m_singlePartCount,this.m_polygonStart,this.m_currentGeometry);return e.getGeometryType()===l.enumPolygon&&(this.m_polygonStart+=e.getPathCount()),this.m_singlePartIndex++,e}getGeometryID(){return this.m_index}getSingleGeometry(e,t,s,r){let n=null;switch(r.getGeometryType()){case l.enumMultiPoint:n=new i({vd:r.getDescription()}),r.isEmpty()||r.getPointByVal(e,n);break;case l.enumPolyline:if(1===t)n=r;else{n=r.createInstance(),n.getImpl().addPath(r.getImpl(),e,!0);const t=[0],s=r.getImpl().getIsSimple(0,t);n.getImpl().setIsSimple(s,t[0],!0)}break;case l.enumPolygon:if(1===t)n=r;else{n=r.createInstance();const e=n.getImpl(),t=r.getImpl(),a=t.getPathFlagsStreamRef();let o=s;const i=t.getPathCount();do{e.addPath(t,o,!0),o++}while(o<i&&!(8&a.read(o)));e.getPathFlagsStreamRef().setBits(0,8);const m=[0],l=t.getIsSimple(0,m);e.setIsSimple(l,m[0],!0)}break;default:n=r}return n}}function f(e){return e.isEmpty()?1:P(e)}export{d as O};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{b as e,r}from"./OperatorProject.js";class t extends e{getOperatorType(){return 9}execute(e,t,s,a){return r(e,t,s,32,a)}}export{t as O};
5
+ import{d as e,r}from"./OperatorProject.js";class t extends e{getOperatorType(){return 9}execute(e,t,s,a){return r(e,t,s,32,a)}}export{t as O};