@arcgis/core 5.2.0-next.81 → 5.2.0-next.83

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 (269) hide show
  1. package/assets/components/assets/icon/deleteAndReplaceFeatures16.json +1 -0
  2. package/assets/components/assets/icon/deleteAndReplaceFeatures24.json +1 -0
  3. package/assets/components/assets/icon/deleteAndReplaceFeatures32.json +1 -0
  4. package/assets/components/assets/icon/moveAndRotate16.json +1 -0
  5. package/assets/components/assets/icon/moveAndRotate24.json +1 -0
  6. package/assets/components/assets/icon/moveAndRotate32.json +1 -0
  7. package/assets/esri/core/workers/RemoteClient.js +1 -1
  8. package/assets/esri/core/workers/chunks/{88d6a7ebded4d359deb0.js → 027af54888befb209aaa.js} +1 -1
  9. package/assets/esri/core/workers/chunks/028bee58f7bc19e5e39e.js +1 -0
  10. package/assets/esri/core/workers/chunks/{9bd4cda90daf90189bfc.js → 03895d49fbd34ccb3ead.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{694216224d5fd3a8956d.js → 04f5ff688785a4bd3b03.js} +1 -1
  12. package/assets/esri/core/workers/chunks/0775d1e3034d5e7ef7bc.js +1 -0
  13. package/assets/esri/core/workers/chunks/{3adba34224cba869a39c.js → 10ac92dcd3738ec23dfb.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{4a537054c99cbc492715.js → 11d911f70bf0ca252c19.js} +1 -1
  15. package/assets/esri/core/workers/chunks/1354b8442c2c501238f1.js +1 -0
  16. package/assets/esri/core/workers/chunks/{95ff342e5c29bf91a765.js → 13a43c87d7952facbed4.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{8cfe817299eb16cb2664.js → 1438f571f738e83b4d1c.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{bfd532e33800755b1f48.js → 14511c92cbbc26d80c86.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{e59101f1d060d0a30a65.js → 14def8f47ae7265dd71b.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{fbb0b2f4ec0ba458ddeb.js → 19dac19122eeeb5e36b2.js} +1 -1
  21. package/assets/esri/core/workers/chunks/1b00789511c9b27da4a7.js +1 -0
  22. package/assets/esri/core/workers/chunks/1b277311a4beb4243bf8.js +2 -0
  23. package/assets/esri/core/workers/chunks/1d03db4df18524cf391c.js +1 -0
  24. package/assets/esri/core/workers/chunks/{f71a3fe5f30aa782193a.js → 20db27d9828397d0b37a.js} +1 -1
  25. package/assets/esri/core/workers/chunks/24bfe759c8848143361e.js +1 -0
  26. package/assets/esri/core/workers/chunks/{b3081c0b037abc49d09b.js → 26c12804a0d801df29bf.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{8006ffa263fb8016afdb.js → 26c8ed0aef59ed6d5267.js} +1 -1
  28. package/assets/esri/core/workers/chunks/2d1c0d80a9843567df8d.js +1 -0
  29. package/assets/esri/core/workers/chunks/{2b79b376b0d60d2f0d5c.js → 2d6e1bf7c1981bed4357.js} +1 -1
  30. package/assets/esri/core/workers/chunks/30dade7bf6032be32599.js +2 -0
  31. package/assets/esri/core/workers/chunks/{7028671ffdaafe2725bc.js → 33aaa5a49e396a0aca47.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{dcec7fc66385c12ecdf0.js → 33dc93d82407052fafe1.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{578904043e873424904c.js → 3a6990058f1003bd2812.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{0fd7590e545864f5fff4.js → 3ca0d503ce733088a6c2.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{bfac0f47e81055585002.js → 3f0625c31dd46b563160.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{9a5894e8ebdf0e97b98f.js → 43122c435497228a7583.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{8fff4a41a54d39db470a.js → 44d13f65465646e5f6e9.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{9c17bfbfc347ac289b6e.js → 463b7952a4825541eb13.js} +1 -1
  39. package/assets/esri/core/workers/chunks/46b3d6814ba4c0a71111.js +1 -0
  40. package/assets/esri/core/workers/chunks/49784f8e8e5fac0cc5a9.js +1 -0
  41. package/assets/esri/core/workers/chunks/{1ed6a8bb415999c4e8a6.js → 4cf2c33494cb75942511.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{d8b38c196b06e801c4e6.js → 5156d94f01b4fbbf8cde.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{6c372d85b5783dd2a793.js → 52042fd36f4a572938f0.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{e8a9a686a3c23afc9d1f.js → 5568448e7f51508ffdf5.js} +1 -1
  45. package/assets/esri/core/workers/chunks/58e4aecabca047f1d229.js +1 -0
  46. package/assets/esri/core/workers/chunks/598221c7054415b84904.js +1 -0
  47. package/assets/esri/core/workers/chunks/{89df303abcbc0167e4d2.js → 5a006ff759fad9fc25cb.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{218ddad849745d652a28.js → 5a3c1fe24814a345ab39.js} +1 -1
  49. package/assets/esri/core/workers/chunks/5b292831127bf981c1c5.js +1 -0
  50. package/assets/esri/core/workers/chunks/{40ebe69b08ea54e0e780.js → 5b60fc95757b2a53558a.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{c336f300fe6100e36592.js → 5c634b3e6dc76299b1df.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{5a67bd724aa7fcdebe16.js → 5d30accf1dcda0c70f95.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{dbca32f0e0c2c2e2ccf3.js → 5f13ade03500b39c1720.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{8d16d53643dd8d489c25.js → 605da92d28e067f4a4c6.js} +1 -1
  55. package/assets/esri/core/workers/chunks/6154f4d39f9e53fe56cc.js +1 -0
  56. package/assets/esri/core/workers/chunks/62b116307483d5f0e37d.js +2 -0
  57. package/assets/esri/core/workers/chunks/6433a623af765b7e53ab.js +1 -0
  58. package/assets/esri/core/workers/chunks/{5c9a398e659ecd427fb5.js → 657528eb6a3d3b3cb631.js} +1 -1
  59. package/assets/esri/core/workers/chunks/65eff0ae773505495f21.js +1 -0
  60. package/assets/esri/core/workers/chunks/{d845f2115848b56c0369.js → 66292e98b4111ea3658d.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{f57e5e7d0748d9a370f7.js → 680496660b2aaa710099.js} +1 -1
  62. package/assets/esri/core/workers/chunks/6d11b922898a8039dbe7.js +1 -0
  63. package/assets/esri/core/workers/chunks/{fbcc346fa603d6edac98.js → 6db4a4f9a9ce7cc738d0.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{a9e944f28bd573c8230d.js → 6eb28086dc28f6d144ec.js} +1 -1
  65. package/assets/esri/core/workers/chunks/7188559a685e0ba30c4f.js +1 -0
  66. package/assets/esri/core/workers/chunks/{a3cbd3e983e21f40b253.js → 724b2631c9ced80a1661.js} +1 -1
  67. package/assets/esri/core/workers/chunks/7493ce5d02224c07a6d5.js +1 -0
  68. package/assets/esri/core/workers/chunks/7ad70c8a56f2481adc82.js +1 -0
  69. package/assets/esri/core/workers/chunks/7bd8ebb321ecf1f06496.js +1 -0
  70. package/assets/esri/core/workers/chunks/7ca188f824956a5cac35.js +2 -0
  71. package/assets/esri/core/workers/chunks/{d0aaa4ad7f76f577f117.js → 7d5877eede2f552dea9f.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{bf5831a7c12b1e42c669.js → 83a77d3f45c8c21cec45.js} +1 -1
  73. package/assets/esri/core/workers/chunks/852649460d664b0a1a1d.js +1 -0
  74. package/assets/esri/core/workers/chunks/{d62a5a33a24418a3e283.js → 88771a75adcbd54c4fac.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{37fb38db03cb39e3c342.js → 8c6a60d96c73982febd2.js} +1 -1
  76. package/assets/esri/core/workers/chunks/{e63f94c8097555b266ad.js → 8e1b913067b8e88ff365.js} +2 -2
  77. package/assets/esri/core/workers/chunks/{6065caa7981cef255277.js → 911f3a1b8dd4bc5c9782.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{70c371c9f133ab9f7925.js → 918577ea025f67ebe372.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{e3eab61815ef1c521a6c.js → 9568932bafe689c38f63.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{e72fa08b0bd324514a0e.js → 996ac351e2322298a17d.js} +1 -1
  81. package/assets/esri/core/workers/chunks/99966339b061eb9945b8.js +1 -0
  82. package/assets/esri/core/workers/chunks/{d1baf17f3219f70106f7.js → 9be05d32528b395a7d34.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{552d6aecc7d88d16227b.js → 9d41c02601d0bb75b525.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{64a1ffc221e5b63b43fb.js → a4bb0951e1389e7b803c.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{74cd17aca5f7e0caac90.js → a9a1061cdf82b372835f.js} +1 -1
  86. package/assets/esri/core/workers/chunks/{d2448e26e19005ef9ab2.js → aabffe53508730e504ec.js} +1 -1
  87. package/assets/esri/core/workers/chunks/{82da6d98bd4980a3d454.js → af88f8dd1a53e4740aa6.js} +1 -1
  88. package/assets/esri/core/workers/chunks/b61c30cdf698b4d1573a.js +1 -0
  89. package/assets/esri/core/workers/chunks/{61190c833791f0833a39.js → b7bcc2d0b0fa8e703c83.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{37a121316d114999ac70.js → ba67aaa08e4f11e1140a.js} +1 -1
  91. package/assets/esri/core/workers/chunks/bbb97c38d8670329d07e.js +2 -0
  92. package/assets/esri/core/workers/chunks/{5d50a030bf9f4e94f69d.js → bbeb61d9302323bae9fb.js} +1 -1
  93. package/assets/esri/core/workers/chunks/bd8b483e70acf0fc601e.js +1 -0
  94. package/assets/esri/core/workers/chunks/bef32acf368b4d5aba37.js +1 -0
  95. package/assets/esri/core/workers/chunks/c1f125594e684c1b4ffc.js +1 -0
  96. package/assets/esri/core/workers/chunks/c90dfdf2302b7db1f6f7.js +1 -0
  97. package/assets/esri/core/workers/chunks/{09f0805b32e6cab980e6.js → cc1a00694cc9f7c606d6.js} +1 -1
  98. package/assets/esri/core/workers/chunks/{8a36b999cbd65dd2f16c.js → d8c3bdc3c6be8ba7c5e6.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{bc30c0de6dcb106b24a1.js → da233362b06b6db375f1.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{ce81f29134ab3971bd54.js → dd91824692bec809909c.js} +1 -1
  101. package/assets/esri/core/workers/chunks/{f9e9e79f78be32e5d475.js → e706c37b44e98fbcb5f7.js} +1 -1
  102. package/assets/esri/core/workers/chunks/ef269dd559c1c79957e5.js +1 -0
  103. package/assets/esri/core/workers/chunks/{4a6158994a8cc8b8664f.js → f0692e10af5983f6ad93.js} +1 -1
  104. package/assets/esri/core/workers/chunks/{40b842d055b87e442156.js → f20b88f5a6d3b988a055.js} +1 -1
  105. package/assets/esri/core/workers/chunks/{fae32c9ce811934b6a64.js → f6ae0c483579e227a2f2.js} +1 -1
  106. package/assets/esri/core/workers/chunks/{4c15551e33a3c6cda61d.js → f762f0f6c83748d8e328.js} +1 -1
  107. package/assets/esri/core/workers/chunks/{4eaa93859ceec1b38530.js → fa29b5064d6626cfc019.js} +1 -1
  108. package/assets/esri/core/workers/chunks/fcf7299e2ee904ab9882.js +1 -0
  109. package/assets/esri/core/workers/chunks/{388b71211a0ad5cbd6b9.js → fe06cc2f90b2d551e4c1.js} +1 -1
  110. package/assets/esri/core/workers/chunks/{86035e46777ed896c658.js → ffad5fd9c5e98f4fe2c3.js} +1 -1
  111. package/assets/esri/geometry/support/pe-wasm.wasm +0 -0
  112. package/chunks/Bufferer-CclWhXVb.js +1 -1
  113. package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
  114. package/chunks/EmissionComposite.glsl.js +7 -1
  115. package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
  116. package/chunks/GeodeticUtils.js +1 -1
  117. package/chunks/GeographicTransformation.js +2 -0
  118. package/chunks/Geometry.js +1 -1
  119. package/chunks/MultiPathImpl.js +1 -1
  120. package/chunks/OperatorCrosses.js +1 -1
  121. package/chunks/OperatorCut.js +1 -1
  122. package/chunks/OperatorGeodesicBuffer.js +1 -1
  123. package/chunks/OperatorGeodeticArea.js +1 -1
  124. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  125. package/chunks/OperatorGeodeticLength.js +1 -1
  126. package/chunks/OperatorGraphicBuffer.js +1 -1
  127. package/chunks/OperatorIntegrate.js +1 -1
  128. package/chunks/OperatorIntersects.js +1 -1
  129. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  130. package/chunks/OperatorOverlaps.js +1 -1
  131. package/chunks/OperatorProximity.js +1 -1
  132. package/chunks/OperatorProximityGeodesic.js +1 -1
  133. package/chunks/OperatorShapePreservingLength.js +1 -1
  134. package/chunks/OperatorShapePreservingProject.js +1 -1
  135. package/chunks/OperatorSimplifyOGC.js +1 -1
  136. package/chunks/OperatorTouches.js +1 -1
  137. package/chunks/OperatorWithin.js +1 -1
  138. package/chunks/Point2D.js +1 -1
  139. package/chunks/ProjectionTransformation.js +1 -1
  140. package/chunks/SideCalculator2D-DX0718xq.js +1 -1
  141. package/chunks/UnitFactory.js +1 -1
  142. package/chunks/containsOperator.js +1 -1
  143. package/chunks/disjointOperator.js +1 -1
  144. package/chunks/equalsOperator.js +1 -1
  145. package/chunks/pe-wasm.js +1 -1
  146. package/chunks/relateOperator.js +1 -1
  147. package/config.js +1 -1
  148. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  149. package/geometry/operators/gx/operatorBuffer.js +1 -1
  150. package/geometry/operators/gx/operatorDifference.js +1 -1
  151. package/geometry/operators/gx/operatorIntersection.js +1 -1
  152. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  153. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  154. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  155. package/geometry/operators/gx/operatorSimplify.js +1 -1
  156. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  157. package/geometry/operators/gx/operatorUnion.js +1 -1
  158. package/geometry/operators/json/containsOperator.js +1 -1
  159. package/geometry/operators/json/disjointOperator.js +1 -1
  160. package/geometry/operators/reshapeOperator.js +1 -1
  161. package/geometry/operators/support/GeographicTransformation.d.ts +7 -0
  162. package/geometry/operators/support/GeographicTransformation.js +1 -1
  163. package/geometry/operators/support/GeographicTransformationStep.d.ts +7 -1
  164. package/geometry/operators/support/GeographicTransformationStep.js +1 -1
  165. package/geometry/operators/support/geographicTransformationUtils.d.ts +13 -2
  166. package/geometry/operators/support/geographicTransformationUtils.js +1 -1
  167. package/geometry/operators/support/jsonConverter.js +1 -1
  168. package/geometry/operators/support/projectionTransformation.js +1 -1
  169. package/geometry/support/spatialReferenceUtils.js +1 -1
  170. package/kernel.js +1 -1
  171. package/layers/raster/types.d.ts +1 -1
  172. package/layers/support/AggregateField.d.ts +9 -3
  173. package/layers/support/FeatureReductionCluster.d.ts +16 -6
  174. package/layers/support/I3SExtractChanges.js +2 -0
  175. package/package.json +4 -4
  176. package/renderers/UniqueValueRenderer.js +1 -1
  177. package/renderers/support/AuthoringInfo.d.ts +8 -3
  178. package/support/revision.js +1 -1
  179. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
  180. package/views/2d/engine/vectorTiles/style/GeoJSONLabelUtils.js +2 -0
  181. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  182. package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
  183. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
  184. package/views/2d/layers/MediaLayerView2D.js +1 -1
  185. package/views/3d/GroundView3D.js +1 -1
  186. package/views/3d/analysis/LineOfSight/LineOfSightAuthoringUtils.js +1 -1
  187. package/views/3d/analysis/LineOfSight/LineOfSightDrawToolRenderer.js +1 -1
  188. package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
  189. package/views/3d/analysis/LineOfSight/LineOfSightInteractionVisuals.js +1 -1
  190. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
  191. package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
  192. package/views/3d/analysis/LineOfSight/LineOfSightPlacementLeafPlugin.js +1 -1
  193. package/views/3d/analysis/LineOfSight/LineOfSightRootPlugin.js +1 -1
  194. package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
  195. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  196. package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
  197. package/views/3d/input/SceneInputManager.js +1 -1
  198. package/views/3d/input/handlers/PinchAndPanNavigation.js +1 -1
  199. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  200. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  201. package/views/3d/layers/I3SMeshView3D.js +1 -1
  202. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  203. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  204. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  205. package/views/3d/layers/SceneLayerView3D.js +1 -1
  206. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  207. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  208. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  209. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  210. package/views/3d/state/utils/navigationUtils.js +1 -1
  211. package/views/3d/support/GroundAndIMSurface.js +2 -0
  212. package/views/3d/support/PBFDecoder.js +1 -1
  213. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  214. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  215. package/views/3d/support/pointsOfInterest/PointOfInterest.js +1 -1
  216. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  217. package/views/3d/terrain/OverlayManager.js +1 -1
  218. package/views/3d/webgl-engine/Stage.js +1 -1
  219. package/views/3d/webgl-engine/lib/EmissionComposite.glsl.js +1 -1
  220. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  221. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  222. package/views/MapView.d.ts +0 -60
  223. package/views/SceneView.js +1 -1
  224. package/views/View2D.d.ts +59 -1
  225. package/views/draw/support/PluginContext.js +1 -1
  226. package/views/draw/support/managers/InteractiveHandleManager.js +1 -1
  227. package/views/draw/support/types.d.ts +6 -0
  228. package/views/interactive/interactiveToolUtils.js +1 -1
  229. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  230. package/widgets/Legend/support/utils.js +1 -1
  231. package/widgets/Widget.js +1 -1
  232. package/widgets/support/jsxWidgetSupport.js +1 -1
  233. package/assets/esri/core/workers/chunks/0dcfd82a2669df6eb5a0.js +0 -1
  234. package/assets/esri/core/workers/chunks/177c3b23c1cbd4737049.js +0 -1
  235. package/assets/esri/core/workers/chunks/21f763694a41968ac21a.js +0 -1
  236. package/assets/esri/core/workers/chunks/230925079cee040a8d77.js +0 -1
  237. package/assets/esri/core/workers/chunks/25696c194457e42b3bdc.js +0 -1
  238. package/assets/esri/core/workers/chunks/2f3525df00fb265661fc.js +0 -1
  239. package/assets/esri/core/workers/chunks/453c69879f4b82ba13a1.js +0 -1
  240. package/assets/esri/core/workers/chunks/4f36596280142be1c666.js +0 -1
  241. package/assets/esri/core/workers/chunks/53d80202b5f43542d45b.js +0 -1
  242. package/assets/esri/core/workers/chunks/540a3685e614bb006744.js +0 -1
  243. package/assets/esri/core/workers/chunks/61312d3b5477ed9d87d9.js +0 -2
  244. package/assets/esri/core/workers/chunks/6f08c8a1e8e3ffd0a96a.js +0 -1
  245. package/assets/esri/core/workers/chunks/71ee7c51d2c60a180f1e.js +0 -1
  246. package/assets/esri/core/workers/chunks/856dba96332509fb1d7a.js +0 -2
  247. package/assets/esri/core/workers/chunks/9234a293d61e134f121f.js +0 -1
  248. package/assets/esri/core/workers/chunks/927582ec15bff2acbb49.js +0 -1
  249. package/assets/esri/core/workers/chunks/95b9eaf7a49eeb17e62f.js +0 -1
  250. package/assets/esri/core/workers/chunks/973440553c9e058b0132.js +0 -1
  251. package/assets/esri/core/workers/chunks/98739b6e7904045edbab.js +0 -1
  252. package/assets/esri/core/workers/chunks/a69c10bfd632a5546b34.js +0 -1
  253. package/assets/esri/core/workers/chunks/c5853fbb975e169c44c5.js +0 -1
  254. package/assets/esri/core/workers/chunks/c899457f19b749516275.js +0 -1
  255. package/assets/esri/core/workers/chunks/d4b78d11a5ce4320a29a.js +0 -1
  256. package/assets/esri/core/workers/chunks/da0ef984509057ec8507.js +0 -1
  257. package/assets/esri/core/workers/chunks/e2473de49189d93714d3.js +0 -1
  258. package/assets/esri/core/workers/chunks/eca0736953a20cfc64ad.js +0 -2
  259. package/assets/esri/core/workers/chunks/efd176c5ac35f313e7a2.js +0 -1
  260. package/assets/esri/core/workers/chunks/f2d99f693a590f384315.js +0 -1
  261. package/assets/esri/core/workers/chunks/fc2234e0d202631f3abf.js +0 -2
  262. package/assets/esri/core/workers/chunks/fcb943c3b31b1bf62e65.js +0 -2
  263. package/assets/esri/core/workers/chunks/ffe2cbfea38b92a231d6.js +0 -1
  264. /package/assets/esri/core/workers/chunks/{eca0736953a20cfc64ad.js.LICENSE.txt → 1b277311a4beb4243bf8.js.LICENSE.txt} +0 -0
  265. /package/assets/esri/core/workers/chunks/{856dba96332509fb1d7a.js.LICENSE.txt → 30dade7bf6032be32599.js.LICENSE.txt} +0 -0
  266. /package/assets/esri/core/workers/chunks/{fc2234e0d202631f3abf.js.LICENSE.txt → 62b116307483d5f0e37d.js.LICENSE.txt} +0 -0
  267. /package/assets/esri/core/workers/chunks/{61312d3b5477ed9d87d9.js.LICENSE.txt → 7ca188f824956a5cac35.js.LICENSE.txt} +0 -0
  268. /package/assets/esri/core/workers/chunks/{e63f94c8097555b266ad.js.LICENSE.txt → 8e1b913067b8e88ff365.js.LICENSE.txt} +0 -0
  269. /package/assets/esri/core/workers/chunks/{fcb943c3b31b1bf62e65.js.LICENSE.txt → bbb97c38d8670329d07e.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{R as e,T as r}from"./UnitFactory.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
+ import{W as e,X as r}from"./UnitFactory.js";class t extends e{getOperatorType(){return 6}execute(e,t,s,a){return r(e,t,s,16,a)}}export{t as O};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{G as t}from"./GeometryCursor.js";import{G as e,d as s,g as r}from"./Geometry.js";import{a as n,P as o,E as m,n as i}from"./MultiPathImpl.js";import{g as c,c as u}from"./Envelope.js";import{H as l,G as a,I as h,Z as d,_ as y,L as _}from"./UnitFactory.js";var p=_;function g(t,e){return{m_geometry:t,m_side:e}}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 i=[],c=new m;{const m=c.createGeometryUserIndex(),u=c.addGeometry(e),_=c.addGeometry(s),f=new d(o);let C=0,E=null;if(c.hasCurves()){E=new p;const t=c.getEnvelope2D(o);C=l(r.total());const e=a(r.total(),t);h(c,e,r.total(),12e3,E,null,o)}c.dbgVerifyCurves(),f.setEditShapeCrackAndCluster(c,r),f.cut(t,m,u,_,i);for(const t of i){null!==E&&E.stitchCurves(c,t,C,!1);const e=g(c.getGeometry(t),y(c.getGeometryUserIndex(t,m)));n.push(e)}null!==E&&E.clearStitcher(c)}}function C(t,e,s,r,n,c){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 u=[],y=new m;{const t=y.createGeometryUserIndex(),_=y.addGeometry(e),f=y.addGeometry(s),C=new d(c);let E=0,G=null;if(y.hasCurves()){G=new p;const t=y.getEnvelope2D(c);E=l(r.total());const e=a(r.total(),t);h(y,e,r.total(),12e3,G,null,c)}y.dbgVerifyCurves(),C.setEditShapeCrackAndCluster(y,r),C.cut(!1,t,_,f,u),null!==G&&G.stitchCurves(y,i,E,!0);let v=y.getGeometry(_);const w=new o,x=new o,I=[];for(let e=0;e<u.length;e++){let s=null;{const n=new m,o=n.addGeometry(v),d=n.addGeometry(y.getGeometry(u[e]));if(n.hasCurves()){const t=n.getEnvelope2D(c);E=l(r.total());const e=a(r.total(),t);h(n,e,r.total(),12e3,G,null,c)}C.setEditShapeCrackAndCluster(n,r);const _=C.intersection(o,d);if(null!==G&&G.stitchCurves(n,i,E,!0),s=n.getGeometry(_),s.isEmpty())continue;const p=y.getGeometryUserIndex(u[e],t);2===p?w.add(s,!1):1===p?x.add(s,!1):I.push(s)}{const t=new m,s=t.addGeometry(v),n=t.addGeometry(y.getGeometry(u[e]));if(t.hasCurves()){const e=t.getEnvelope2D(c);E=l(r.total());const s=a(r.total(),e);h(t,s,r.total(),12e3,G,null,c)}C.setEditShapeCrackAndCluster(t,r);const o=C.difference(s,n);null!==G&&G.stitchCurves(t,i,E,!0);v=t.getGeometry(o)}}if(!v.isEmpty()&&u.length>0&&I.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=I.length;e<s;++e){const t=g(I[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{m_bConsiderTouch;m_cuttee;m_cutter;m_tolerance;m_cutIndex=-1;m_cuts=[];m_progressTracker;constructor(t,e,s,r,o){super(),this.m_progressTracker=o,this.m_cuttee=e.clone(),this.m_cutter=new n({copy:s}),this.m_bConsiderTouch=t;const m=c(e,s);this.m_tolerance=u(r,m,!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 this.m_cutIndex}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=[];f(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 o,e=new o,n=new o;this.m_cuts.length=0,this.m_cuts.push(t),this.m_cuts.push(e);const m=[];C(this.m_bConsiderTouch,this.m_cuttee,this.m_cutter,this.m_tolerance,m,this.m_progressTracker);for(let r=0;r<m.length;r++){const o=m[r];1===o.m_side?t.add(o.m_geometry,!1):2===o.m_side?e.add(o.m_geometry,!1):3===o.m_side?this.m_cuts.push(o.m_geometry):0===o.m_side?n.add(o.m_geometry,!1):s("")}r(n.isEmpty()||1===m.length),t.isEmpty()&&e.isEmpty()&&this.m_cuts.length<3&&(this.m_cuts.length=0)}}export{E as O};
2
+ import{G as t}from"./GeometryCursor.js";import{G as e,d as s,g as r}from"./Geometry.js";import{a as n,P as o,E as m,n as i}from"./MultiPathImpl.js";import{g as c,c as u}from"./Envelope.js";import{L as a,K as l,M as h,a1 as d,a2 as y,R as p}from"./UnitFactory.js";var _=p;function g(t,e){return{m_geometry:t,m_side:e}}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 i=[],c=new m;{const m=c.createGeometryUserIndex(),u=c.addGeometry(e),p=c.addGeometry(s),f=new d(o);let C=0,E=null;if(c.hasCurves()){E=new _;const t=c.getEnvelope2D(o);C=a(r.total());const e=l(r.total(),t);h(c,e,r.total(),12e3,E,null,o)}c.dbgVerifyCurves(),f.setEditShapeCrackAndCluster(c,r),f.cut(t,m,u,p,i);for(const t of i){null!==E&&E.stitchCurves(c,t,C,!1);const e=g(c.getGeometry(t),y(c.getGeometryUserIndex(t,m)));n.push(e)}null!==E&&E.clearStitcher(c)}}function C(t,e,s,r,n,c){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 u=[],y=new m;{const t=y.createGeometryUserIndex(),p=y.addGeometry(e),f=y.addGeometry(s),C=new d(c);let E=0,G=null;if(y.hasCurves()){G=new _;const t=y.getEnvelope2D(c);E=a(r.total());const e=l(r.total(),t);h(y,e,r.total(),12e3,G,null,c)}y.dbgVerifyCurves(),C.setEditShapeCrackAndCluster(y,r),C.cut(!1,t,p,f,u),null!==G&&G.stitchCurves(y,i,E,!0);let v=y.getGeometry(p);const w=new o,x=new o,k=[];for(let e=0;e<u.length;e++){let s=null;{const n=new m,o=n.addGeometry(v),d=n.addGeometry(y.getGeometry(u[e]));if(n.hasCurves()){const t=n.getEnvelope2D(c);E=a(r.total());const e=l(r.total(),t);h(n,e,r.total(),12e3,G,null,c)}C.setEditShapeCrackAndCluster(n,r);const p=C.intersection(o,d);if(null!==G&&G.stitchCurves(n,i,E,!0),s=n.getGeometry(p),s.isEmpty())continue;const _=y.getGeometryUserIndex(u[e],t);2===_?w.add(s,!1):1===_?x.add(s,!1):k.push(s)}{const t=new m,s=t.addGeometry(v),n=t.addGeometry(y.getGeometry(u[e]));if(t.hasCurves()){const e=t.getEnvelope2D(c);E=a(r.total());const s=l(r.total(),e);h(t,s,r.total(),12e3,G,null,c)}C.setEditShapeCrackAndCluster(t,r);const o=C.difference(s,n);null!==G&&G.stitchCurves(t,i,E,!0);v=t.getGeometry(o)}}if(!v.isEmpty()&&u.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{m_bConsiderTouch;m_cuttee;m_cutter;m_tolerance;m_cutIndex=-1;m_cuts=[];m_progressTracker;constructor(t,e,s,r,o){super(),this.m_progressTracker=o,this.m_cuttee=e.clone(),this.m_cutter=new n({copy:s}),this.m_bConsiderTouch=t;const m=c(e,s);this.m_tolerance=u(r,m,!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 this.m_cutIndex}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=[];f(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 o,e=new o,n=new o;this.m_cuts.length=0,this.m_cuts.push(t),this.m_cuts.push(e);const m=[];C(this.m_bConsiderTouch,this.m_cuttee,this.m_cutter,this.m_tolerance,m,this.m_progressTracker);for(let r=0;r<m.length;r++){const o=m[r];1===o.m_side?t.add(o.m_geometry,!1):2===o.m_side?e.add(o.m_geometry,!1):3===o.m_side?this.m_cuts.push(o.m_geometry):0===o.m_side?n.add(o.m_geometry,!1):s("")}r(n.isEmpty()||1===m.length),t.isEmpty()&&e.isEmpty()&&this.m_cuts.length<3&&(this.m_cuts.length=0)}}export{E as O};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{G as e}from"./GeometryCursor.js";import{d as t,t as s,a as n,c as i,i as r,G as o,n as m,h as a,f as h,j as c,o as u}from"./Geometry.js";import{Envelope2D as l}from"./Envelope2D.js";import{W as _,y as f,a7 as d,a8 as g,O as p,a9 as P,aa as x,a2 as b,e as y,ab as w,ac as C,U as v,D as S,ad as D,ae as I,af as G,ag as T,ah as M,r as N,ai as k,aj as A,ak as E,al as q,am as R,an as z}from"./UnitFactory.js";import{__addDisposableResource as X,__disposeResources as B}from"tslib";import{P as O,a as Y,E as j}from"./MultiPathImpl.js";import{f as F,c as W,P as U,e as J,h as H,j as L,s as V}from"./Envelope.js";import{T as K}from"./Transformation2D.js";import{d as Q,m as Z,P as $,S as ee,l as te,n as se}from"./Point2D.js";import{c as ne}from"./OperatorClip.js";import{c as ie}from"./GeometryCleaner-CIE8Wfmb.js";import{O as re}from"./OperatorDensify.js";import{S as oe}from"./SimpleGeometryCursor.js";function me(e,t,s,m,a,h){m<Number.MAX_VALUE&&m>-Number.MAX_VALUE||n("Geodesic_bufferer.buffer - bad distance"),i(e);const c=ie(e),u=c.getGeometryType();if(r(u)){const e=c.getPointCount(),n=8e6;if(Math.abs(m)>n&&(e>50||u!==o.enumMultiPoint&&4===s&&e>2)){let e=c;const i=m>0?1:-1,r=7e6;let o=m,u=1;do{u++,o=(Math.abs(o)-r)*i}while(Math.abs(o)>n);o=m;for(let n=0;n<u-1;n++)e=he(e,t,s,r*i,a,u,h),o=(Math.abs(o)-r)*i;return e=he(e,t,s,o,a,u,h),e}}return he(c,t,s,m,a,1,h)}class ae{m_sr=null;m_gcs=null;m_transform=null;m_progressTracker;m_a=0;m_eSquared=0;m_rpu=0;m_radTolerance=0;m_q90=0;m_gcs90=0;m_gcs180=0;m_gcs360=0;m_gcs60=0;m_ellipticToGeodesicMaxRatio=0;m_curveType=0;m_bShapePreserving=!1;m_distance=0;m_absDistance=0;m_convergenceOffset=0;m_cornerStep=0;m_segmentStep=0;constructor(e){this.m_progressTracker=e}bufferPolygon(e){const t=new O,s=new we(this,e,t);return this.processGnomonicBufferPiecesCursor(!0,s)}bufferPolyline(e){const t=new we(this,e,null);return this.processGnomonicBufferPiecesCursor(!0,t)}bufferMultiPoint(e){const t=new Ce(this,e);return this.processGnomonicBufferPiecesCursor(!1,t)}bufferPoint(e){const t=e.getXY();t.scale(this.m_rpu);let s=new O;if(this.bufferPoint2D(t,!1,s)){const e=J(null,s,!0);s=b(s,e,!0,!0,-1,this.m_progressTracker,0,!1)}return s=(new p).foldInto360RangeGeodetic(s,this.m_gcs,2),s}processGnomonicBufferPiecesCursor(e,t){const s=t;let n=s.getGnomonic();const i=y(w());let r=new C,o=(new _).executeMany(r,i,this.m_progressTracker,2);const m=Q(6,!1),a=Z(l,6);this.initializeGrid(m,a);const h=[null,null,null,null,null,null],c=[null,null,null,null,null,null],u=[null,null,null,null,null,null];let f,d,g;for(;null!==(f=s.next());){if(d=s.getGnomonic(),d!==n){if(null!==n){let t=o.next();if(r=null,o=null,null!=t){const s=J(i,t,!0),r=F(s);t=n.unproject(t,r,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,m,a,h,c,u)}}null!==d&&(r=new C,o=(new _).executeMany(r,i,this.m_progressTracker,2)),n=d}if(s.isRunningInGnomonic()){if(d.project(f),s.needsSimplify()){const e=J(null,f,!0);f=b(f,e,!0,!0,-1,this.m_progressTracker,0,!1)}r.tick(be(f)),o.tock()}else this.putInGridCursors(e,f,i,!0,m,a,h,c,u)}let P=!1;for(let l=0;l<6;l++)if(null!=u[l]){P=!0;break}if(P){let t=!1;const l=[null,null,null,null,null,null];if(e){const n=s.m_densified;if(s.m_densified=null,null!==n){const s=new K;s.scale(1/this.m_rpu,1/this.m_rpu),n.applyTransformation(s),this.m_distance>0?this.putInGridCursors(e,n,i,!1,m,a,h,c,u):(this.processInGrid(e,n,!1,m,a,h,l),t=!0)}}const f=new C,d=(new _).executeMany(f,this.m_gcs,this.m_progressTracker,2);if(null!==o){let t=o.next();r=null,o=null;const s=J(i,t,!0),l=F(s);t=n.unproject(t,l,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,m,a,h,c,u)}for(let e=0;e<6;e++)if(null!=u[e]){let s=u[e].next();u[e]=null,c[e]=null,t&&null!==l[e]&&(s=(new v).execute(l[e],s,i,this.m_progressTracker));const n=J(i,s,!0),r=F(n);s=h[e].unproject(s,r,this.m_progressTracker),s=(new S).execute(s,this.m_gcs,!0,this.m_progressTracker),f.tick(be(s)),d.tock()}g=d.next()}else{let t,m=!1;if(e){let e=s.m_densified;if(s.m_densified=null,null!==e){const s=new K;s.scale(1/this.m_rpu,1/this.m_rpu),e.applyTransformation(s),d.project(e);const n=J(null,e,!0);e=b(e,n,!1,!0,-1,this.m_progressTracker,0,!1),this.m_distance>0?(r.tick(be(e)),o.tock()):(t=e,m=!0)}}let a=o.next();r=null,o=null,m&&(a=(new v).execute(t,a,i,this.m_progressTracker));const h=J(i,a,!0),c=F(h);g=n.unproject(a,c,this.m_progressTracker),g=(new S).execute(g,this.m_gcs,!0,this.m_progressTracker)}return g=(new p).foldInto360RangeGeodetic(g,this.m_gcs,2),g}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 C,a[c]=(new _).executeMany(m[c],s,this.m_progressTracker,2)),m[c].tick(be(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=H(t,e),u=W(null,c,!1).total();let l=ne(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 $;h<3?e.setCoords(0,1):e.setCoords(0,-1);const t=new $;t.setAdd(i[h].getCenter(),e),r[h]=xe(this.m_gcs,t)}r[h].project(l);const e=J(null,l,!0);l=b(l,e,s,!0,-1,this.m_progressTracker,0,!1),o[h]=l}}}insertGeodeticPointsAlongGrid(e,t,s){const n=l.construct(t[3].xmin,t[3].ymin,t[2].xmax,t[2].ymax),i=D(this.m_gcs,n,e,!0,this.m_progressTracker),r=new j,o=r.addGeometry(i);return I(r,o,this.m_gcs,0,2,!0,t[0].xmax+s),I(r,o,this.m_gcs,0,2,!0,t[1].xmax+s),I(r,o,this.m_gcs,0,2,!1,t[1].ymin+s),0!==s&&(I(r,o,this.m_gcs,0,2,!0,t[0].xmax-s),I(r,o,this.m_gcs,0,2,!0,t[1].xmax-s),I(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=d.q(this.m_a,this.m_eSquared,a),u=d.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,g=l+Math.PI,p=_+Math.PI,P=[Number.NaN],x=[Number.NaN],b=[Number.NaN],y=[Number.NaN];let w=!1;if(le(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,o,l,f,m,_,P,x),le(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,p,_,o,f,b,y),(_<P[0]&&P[0]<p||_<x[0]&&x[0]<p)&&(w=!0),w||(f<b[0]&&b[0]<l||f<y[0]&&y[0]<l)&&(w=!0),!w&&i)return!1;const C=[];for(let d=e.length-1;d>=0;d--)C.push(e[d]);r.setEmpty(),r.addPathPoint2D(null,0,!0);let v=0;v=ce(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,e,l,_,i,v,r),v=ue(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,_,p,this.m_cornerStep,i,v,r,P[0],x[0]),v=ce(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,C,p,g,i,v,r),v=ue(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,o,f,l,this.m_cornerStep,i,v,r,b[0],y[0]);let S=!1;return i||(S=this.checkAndPrepForPole(r)),w||S}bufferPoint2D(e,t,s){s.setEmpty(),s.addPathPoint2D(null,0,!0);const n=0;ue(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 l;return e.queryEnvelope(t),!(!G(t.ymax,this.m_gcs90)&&!G(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 O;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=G(t.y,this.m_gcs90),n=G(t.y,-this.m_gcs90);if(!s&&!n)break}let o=r,m=!1,a=Number.NaN;do{const n=e.getXY(o),r=G(n.y,this.m_gcs90),h=G(n.y,-this.m_gcs90),c=s+(o+1-s)%i;if(r||h){let s=$.construct(a,n.y);t.insertPoint2D(0,-1,s);const i=e.getXY(c),r=G(i.y,this.m_gcs90),o=G(i.y,-this.m_gcs90);r||o||(s=$.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 O,s=new O,n=new K,i=e.getXY(e.getPathStart(0)),r=e.getXY(e.getPathEnd(0)-1),o=this.m_gcs360,m=this.m_gcs180,a=new l;a.setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:this.m_gcs90});const h=new l;e.queryEnvelope(h);const c=Math.ceil(h.width()/o);let u,_;i.x>r.x?(u=-o,_=this.m_gcs90):(u=o,_=-this.m_gcs90),n.setShiftCoords(u,0),t.addPath(e,0,!0),s.add(t,!1);const f=new U;for(let l=0;l<c;l++)s.applyTransformation(n),s.getPointByVal(0,f),t.lineToPoint(f),t.addSegmentsFromPath(s,0,0,s.getSegmentCount()-1,!1);const d=t.getXY(0),g=t.getXY(t.getPointCount()-1);d.y=_,g.y=_,t.lineTo(g);const p=new $;for(p.setCoordsPoint2D(g),p.x-=.5*u;Math.abs(p.x-d.x)>m;)t.lineTo(p),p.x-=.5*u;t.lineTo(d);const P=a.getCenterX(),x=new l;t.queryEnvelope(x);let b=0;const y=x.getCenter().x;y-P>m?b=-Math.ceil((y-P-m)/o):P-y>m&&(b=Math.ceil((P-y-m)/o)),0!==b&&(n.setShiftCoords(b*o,0),t.applyTransformation(n));const w=new j,C=w.addGeometry(t);I(w,C,this.m_gcs,0,2,!0,a.xmin),I(w,C,this.m_gcs,0,2,!0,a.xmax);const v=w.getGeometry(C),S=H(v,a);S.inflateCoords(0,1);const D=W(null,S,!0).total(),G=ne(v,a,D,Number.NaN,this.m_progressTracker);e.setEmpty(),e.add(G,!1)}prepDoublePoleWrap(e){const t=this.m_gcs360,s=this.m_gcs180,n=new l;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 l;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 K;s.setShiftCoords(m*t,0),e.getImpl().applyTransformationToPath(s,0),e.queryPathEnvelope(0,r),a=r.getCenter().x}const h=new l;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 $;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 K;a<i?s.setShiftCoords(t,0):s.setShiftCoords(-t,0),e.getImpl().applyTransformationToPath(s,0),c.addPath(e,0,!0);const r=new j,o=r.addGeometry(c);I(r,o,this.m_gcs,0,2,!0,n.xmin),I(r,o,this.m_gcs,0,2,!0,n.xmax),c=r.getGeometry(o);const m=H(c,n);m.inflateCoords(0,1);const h=W(null,m,!0).total();c=ne(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 $;n.setCoords(0,10*this.m_rpu);const i=0;let r=45*this.m_rpu;const o=X(e,new ee(new T,new T),!1),m=X(e,new ee(new T,new T),!1),a=X(e,new ee(new T,new T),!1),h=X(e,new ee(new T,new T),!1),c=new $,u=new $,l=new $,_=new $;for(M.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),M.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);M.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=X(e,new T,!1),f=X(e,new T,!1);M.geodeticDistance(this.m_a,this.m_eSquared,c.x,c.y,u.x,u.y,o,f,null,2),M.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=X(e,new T,!1);M.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,M.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{B(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{B(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 $,r=new $;i.setCoords(0,10*this.m_rpu),r.setCoords(10*this.m_rpu,10*this.m_rpu);const o=X(e,new T,!1),m=X(e,new T,!1),a=X(e,new T,!1);M.geodeticDistance(this.m_a,this.m_eSquared,i.x,i.y,r.x,r.y,a,o,m,this.m_curveType);const h=X(e,new ee(new T,new T),!1),c=X(e,new ee(new T,new T),!1),u=new $,l=X(e,new T,!1),_=X(e,new ee(new T,new T),!1),f=X(e,new ee(new T,new T),!1),d=X(e,new ee(new T,new T),!1),g=X(e,new ee(new T,new T),!1),p=new $,P=new $,x=new $,b=new $,y=0;let w=1;const C=o.val,v=m.val,S=C-.5*Math.PI,D=v+.5*Math.PI,I=a.val;for(M.geodesicCoordinate(this.m_a,this.m_eSquared,i.x,i.y,n,S,_.at(0),_.at(1)),p.setCoords(_.at(0).val,_.at(1).val),M.geodesicCoordinate(this.m_a,this.m_eSquared,r.x,r.y,n,D,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);M.geodeticCoordinate(this.m_a,this.m_eSquared,i.x,i.y,s*I,C,h.at(0),h.at(1),this.m_curveType),u.setCoords(h.at(0).val,h.at(1).val),M.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;M.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=X(e,new T,!1),a=X(e,new T,!1);M.geodeticDistance(this.m_a,this.m_eSquared,p.x,p.y,P.x,P.y,m,a,null,2),M.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 _=X(e,new T,!1);M.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,M.geodeticCoordinate(this.m_a,this.m_eSquared,i.x,i.y,w*I,C,c.at(0),c.at(1),this.m_curveType),r.setCoords(c.at(0).val,c.at(1).val);const t=X(e,new T,!1);M.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;M.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{B(e)}}}catch(s){e.error=s,e.hasError=!0}finally{B(e)}}let G=w*I;G>1e5&&(G=1e5),this.m_segmentStep=G}catch(n){e.error=n,e.hasError=!0}finally{B(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 he(e,t,s,n,i,r,_){if(e.isEmpty())return new O({vd:e.getDescription()});let b=e;if(m(b)){const e=10*t.getTolerance(0);b=(new re).execute(b,0,e,0,_,12e3)}const y=new ae(_);y.m_sr=t,y.m_gcs=t.getGCS(),y.m_transform=f(t,y.m_gcs,null);const w=N();y.m_gcs.querySpheroidData(w);const C=new l;b.queryEnvelope(C),y.m_a=w.majorSemiAxis,y.m_eSquared=w.e2,y.m_rpu=y.m_gcs.getUnit().getUnitToBaseFactor(),y.m_gcs90=.5*Math.PI/y.m_rpu,y.m_gcs180=Math.PI/y.m_rpu,y.m_gcs360=2*Math.PI/y.m_rpu,y.m_gcs60=y.m_gcs360/6,y.m_q90=d.q90(y.m_a,y.m_eSquared),y.m_ellipticToGeodesicMaxRatio=.5*y.m_a*Math.PI/y.m_q90;const v=y.m_gcs.getTolerance(0);y.m_radTolerance=v*y.m_rpu,4===s?(y.m_curveType=2,y.m_bShapePreserving=!0):(y.m_curveType=s,y.m_bShapePreserving=!1),y.m_distance=n,y.m_absDistance=Math.abs(n),Number.isNaN(i)||i<=0?y.setConvergenceOffset():y.m_convergenceOffset=Math.max(i,.001),y.m_convergenceOffset/=r;let S,D=b.getGeometryType();if(a(D)){const e=new Y({vd:b.getDescription()});e.addSegment(b,!0),S=e,D=o.enumPolyline}else if(D===o.enumEnvelope){const e=b,t=new l;e.queryEnvelope(t);const s=F(W(y.m_sr,C,!0));if(t.minDimension()<=s)if(0===t.maxDimension()){const t=new U({vd:b.getDescription()});e.getCenter(t),S=t,D=o.enumPoint}else{const t=new Y({vd:b.getDescription()});t.addEnvelope(e,!1),S=t,D=o.enumPolyline}else{const t=new O({vd:b.getDescription()});t.addEnvelope(e,!1),S=t,D=o.enumPolygon}}else S=b;if(y.setMinCornerStep(),h(D)||y.setMinSegmentStep(),y.m_absDistance<=.5*y.m_convergenceOffset)return D!==o.enumPolygon?new O({vd:S.getDescription()}):y.m_bShapePreserving?S:g(S,y.m_sr,y.m_curveType,y.m_segmentStep,-1,_);if(y.m_distance<0&&D!==o.enumPolygon)return new O({vd:S.getDescription()});if(y.m_bShapePreserving&&c(D)){const e=g(S,t,4,Number.NaN,y.m_convergenceOffset,_);S=(new p).execute(e,y.m_transform,_)}else S=(new p).execute(S,y.m_transform,_);if(S=P(S,y.m_gcs),S.isEmpty())return new O({vd:S.getDescription()});!y.m_bShapePreserving&&c(D)&&(S=x(y.m_rpu,S)),S=fe(S,y.m_gcs);let I=new O;switch(D){case o.enumPolygon:I=y.bufferPolygon(S);break;case o.enumPolyline:I=y.bufferPolyline(S);break;case o.enumMultiPoint:I=y.bufferMultiPoint(S);break;case o.enumPoint:I=y.bufferPoint(S);break;default:u("")}const G=(new p).execute(I,y.m_transform.getInverse(),_);return G.mergeVertexDescription(S.getDescription()),G}function ce(e,t,s,n,i,r,o,m,a,h,c){const u={stack:[],error:void 0,hasError:!1};try{const l=new $;l.setNAN(),a||c.getPointCount()>0&&(l.setCoordsPoint2D(c.getXY(c.getPointCount()-1)),l.scale(s));const _=X(u,new T,!1),f=X(u,new ee(new T,new T),!1),d=new $,g=new $,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:(M.geodeticDistance(e,t,p.x,p.y,u.x,u.y,null,null,_,i),x=_.val-.5*Math.PI),M.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=_e(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{B(u)}}function ue(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=X(_,new ee(new T,new T),!1),d=new $,g=new $,p=new $;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));)M.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=_e(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{B(_)}}function le(e,t,s,n,i,r,o,m,a,h,c){const u={stack:[],error:void 0,hasError:!1};try{const s=new $,l=new $,_=X(u,new ee(new T,new T),!1);M.geodesicCoordinate(e,t,i.x,i.y,n,r,_.at(0),_.at(1)),s.setCoords(_.at(0).val,_.at(1).val),M.geodesicCoordinate(e,t,i.x,i.y,n,o,_.at(0),_.at(1)),l.setCoords(_.at(0).val,_.at(1).val);const f=X(u,new T,!1);for(M.geodeticDistance(e,t,m.x,m.y,s.x,s.y,null,f,null,0),h[0]=f.val,M.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]+=se;for(;h[0]>c[0];)h[0]-=se;for(;h[0]>=a;)h[0]-=se,c[0]-=se;for(;h[0]<a;)h[0]+=se,c[0]+=se}catch(l){u.error=l,u.hasError=!0}finally{B(u)}}function _e(e,t,s,n){if(Number.isNaN(s)){for(;n+t-e>Math.PI;)n-=se;for(;e-(n+t)>Math.PI;)n+=se;return n}return n+t-s>Math.PI?n-=se:s-(n+t)>Math.PI&&(n+=se),n}function fe(e,t){const s=e.getGeometryType();let n;if(n=c(s)?e.getPathCount():s===o.enumMultiPoint?e.getPointCount():1,1===n)return e;const i=[],r=[];for(let o=0;o<n;o++){i.push(o);const n=new $;if(c(s)){const t=new l;e.queryPathEnvelope(o,t),n.assign(t.getCenter())}else n.assign(e.getXY(o));const m=t.toGeohash(n);r.push(m)}i.sort((e,t)=>r[e]<r[t]?-1:r[e]>r[t]?1:0);const m=e.createInstance();for(let o=0;o<n;o++){const t=i[o];c(s)?m.addPath(e,t,!0):m.addPoints(e,t,t+1)}return m}function de(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=X(o,new T,!1),c=X(o,new T,!1),u=X(o,new T,!1);M.greatEllipticDistance(e,t,i.x,i.y,m.x,m.y,h,null,null),M.greatEllipticDistance(e,t,i.x,i.y,a.x,a.y,c,null,null),M.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=X(o,new T,!1);l=Math.max(h.val,c.val);for(let n=1;n<s.length-1;n++){const r=s[n];M.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{B(o)}}function ge(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=$.lerp(t,s,.5)}else{a=n[n.length-1>>1].clone()}const h=a.clone(),c=k(e,t,h,75/180*Math.PI);return!!de(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=X(o,new T,!1);M.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{B(o)}}function Pe(e,t,s,n,i,r,o,m){const a=k(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 xe(e,t){return new z(e,t)}function be(e){return L(e,0)||V(e,0),e}class ye{m_bRunningInGnomonic=!1;m_bNeedsSimplify=!1;m_gnomonic=null;m_gnomonicCenterRad=new $;m_minGnomonicRadius=Number.NaN;m_progressTracker;constructor(e){this.m_progressTracker=e}isRunningInGnomonic(){return this.m_bRunningInGnomonic}needsSimplify(){return this.m_bNeedsSimplify}getGnomonic(){return this.m_gnomonic}}class we extends ye{m_bufferer;m_multiPath;m_segIter=null;m_bNextSegmentCannotJoin=!1;m_currentDensifiedDelta=[0];m_currentBufferedDelta=0;m_lastAzimuth=0;m_startAzimuth=[0];m_endAzimuth=[0];m_numWinds=0;m_debugCounter=0;m_bufferHelper=new O;m_densifiedPoints=[];m_densified;constructor(e,t,s){super(e.m_progressTracker),this.m_bufferer=e,this.m_multiPath=t,this.m_densified=s,this.m_bNeedsSimplify=!0;const n=new l;this.m_multiPath.queryEnvelope(n);const i=n.getCenter(),r=i.clone();r.scale(this.m_bufferer.m_rpu),this.m_gnomonic=xe(this.m_bufferer.m_gcs,i),this.m_gnomonicCenterRad=r.clone(),this.m_minGnomonicRadius=k(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 $,r=new $;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),A(i,r))i.x=r.x;else if(E(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),E(t,i)&&(i.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),A(r,e)&&(r.x=e.x)}}this.m_densifiedPoints.length=0;const s=q(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(ge(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||R(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 O,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(A(i,r))i.x=r.x;else if(E(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),E(t,i)&&(i.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),A(r,e)&&(r.x=e.x)}}this.m_densifiedPoints.length=0,q(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=ue(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&&de(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 $,s=new $,n=[0];return ge(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=xe(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-(se-(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 $;t.setCoordsPoint2D(e.getXY(e.getPointCount()-1)),t.scale(this.m_bufferer.m_rpu),t.x-this.m_currentBufferedDelta<-Math.PI?this.m_currentBufferedDelta-=se:t.x-this.m_currentBufferedDelta>Math.PI&&(this.m_currentBufferedDelta+=se)}n=.5*(n+s)}else if(r){const s=new $;s.setCoordsPoint2D(t),s.scale(1/this.m_bufferer.m_rpu),e.insertPoint2D(0,-1,s)}else ue(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++,ce(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 Ce extends ye{m_bufferer;m_multiPoint;m_pointIndex=-1;constructor(e,t){super(e.m_progressTracker),this.m_bufferer=e,this.m_multiPoint=t,this.m_bNeedsSimplify=!1;const s=new l;this.m_multiPoint.queryEnvelope(s);const n=s.getCenter(),i=n.clone();i.scale(this.m_bufferer.m_rpu),this.m_gnomonic=xe(this.m_bufferer.m_gcs,n),this.m_gnomonicCenterRad=i.clone(),this.m_minGnomonicRadius=k(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 O,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 $,s=new $,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=xe(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 Se(e,t,s,n,i,!1,r,m);return(new _).executeMany(o,t,m)}return new Se(e,t,s,n,i,!1,r,m)}execute(e,s,n,i,r,o,m){const a=new oe([e]),h=[i],c=this.executeMany(a,s,n,h,r,!1,o,m).next();return c||t("geodesic buffer null output"),c}}class Se extends e{m_inputGeoms;m_spatialReference;m_curveType;m_progressTracker;m_distances;m_convergenceOffset;m_currentUnionEnvelope2D=new l;m_bOutlineOnly;m_bUnion;m_index=-1;m_dindex=-1;constructor(e,t,i,r,o,m,a,h){super(),this.m_progressTracker=h,m&&s(""),t||n("");0===t.getCoordinateSystemType()&&n(""),this.m_inputGeoms=e,this.m_spatialReference=t,this.m_curveType=i,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 i(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 me(e,this.m_spatialReference,this.m_curveType,t,this.m_convergenceOffset,this.m_progressTracker)}}export{ve as OperatorGeodesicBuffer};
2
+ import{G as e}from"./GeometryCursor.js";import{d as t,t as s,a as n,c as i,i as r,G as o,n as m,h as a,f as h,j as c,o as u}from"./Geometry.js";import{Envelope2D as l}from"./Envelope2D.js";import{_,B as f,a9 as d,aa as g,O as p,ab as P,ac as x,a6 as b,e as y,ad as w,ae as C,Y as v,H as S,af as D,ag as I,ah as G,ai as T,aj as M,r as N,ak as k,al as A,am as E,an as q,ao as R,ap as z}from"./UnitFactory.js";import{__addDisposableResource as X,__disposeResources as B}from"tslib";import{P as O,a as Y,E as j}from"./MultiPathImpl.js";import{f as F,c as W,P as U,e as J,h as H,j as L,s as V}from"./Envelope.js";import{T as K}from"./Transformation2D.js";import{d as Q,m as Z,P as $,S as ee,l as te,n as se}from"./Point2D.js";import{c as ne}from"./OperatorClip.js";import{c as ie}from"./GeometryCleaner-CIE8Wfmb.js";import{O as re}from"./OperatorDensify.js";import{S as oe}from"./SimpleGeometryCursor.js";function me(e,t,s,m,a,h){m<Number.MAX_VALUE&&m>-Number.MAX_VALUE||n("Geodesic_bufferer.buffer - bad distance"),i(e);const c=ie(e),u=c.getGeometryType();if(r(u)){const e=c.getPointCount(),n=8e6;if(Math.abs(m)>n&&(e>50||u!==o.enumMultiPoint&&4===s&&e>2)){let e=c;const i=m>0?1:-1,r=7e6;let o=m,u=1;do{u++,o=(Math.abs(o)-r)*i}while(Math.abs(o)>n);o=m;for(let n=0;n<u-1;n++)e=he(e,t,s,r*i,a,u,h),o=(Math.abs(o)-r)*i;return e=he(e,t,s,o,a,u,h),e}}return he(c,t,s,m,a,1,h)}class ae{m_sr=null;m_gcs=null;m_transform=null;m_progressTracker;m_a=0;m_eSquared=0;m_rpu=0;m_radTolerance=0;m_q90=0;m_gcs90=0;m_gcs180=0;m_gcs360=0;m_gcs60=0;m_ellipticToGeodesicMaxRatio=0;m_curveType=0;m_bShapePreserving=!1;m_distance=0;m_absDistance=0;m_convergenceOffset=0;m_cornerStep=0;m_segmentStep=0;constructor(e){this.m_progressTracker=e}bufferPolygon(e){const t=new O,s=new we(this,e,t);return this.processGnomonicBufferPiecesCursor(!0,s)}bufferPolyline(e){const t=new we(this,e,null);return this.processGnomonicBufferPiecesCursor(!0,t)}bufferMultiPoint(e){const t=new Ce(this,e);return this.processGnomonicBufferPiecesCursor(!1,t)}bufferPoint(e){const t=e.getXY();t.scale(this.m_rpu);let s=new O;if(this.bufferPoint2D(t,!1,s)){const e=J(null,s,!0);s=b(s,e,!0,!0,-1,this.m_progressTracker,0,!1)}return s=(new p).foldInto360RangeGeodetic(s,this.m_gcs,2),s}processGnomonicBufferPiecesCursor(e,t){const s=t;let n=s.getGnomonic();const i=y(w());let r=new C,o=(new _).executeMany(r,i,this.m_progressTracker,2);const m=Q(6,!1),a=Z(l,6);this.initializeGrid(m,a);const h=[null,null,null,null,null,null],c=[null,null,null,null,null,null],u=[null,null,null,null,null,null];let f,d,g;for(;null!==(f=s.next());){if(d=s.getGnomonic(),d!==n){if(null!==n){let t=o.next();if(r=null,o=null,null!=t){const s=J(i,t,!0),r=F(s);t=n.unproject(t,r,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,m,a,h,c,u)}}null!==d&&(r=new C,o=(new _).executeMany(r,i,this.m_progressTracker,2)),n=d}if(s.isRunningInGnomonic()){if(d.project(f),s.needsSimplify()){const e=J(null,f,!0);f=b(f,e,!0,!0,-1,this.m_progressTracker,0,!1)}r.tick(be(f)),o.tock()}else this.putInGridCursors(e,f,i,!0,m,a,h,c,u)}let P=!1;for(let l=0;l<6;l++)if(null!=u[l]){P=!0;break}if(P){let t=!1;const l=[null,null,null,null,null,null];if(e){const n=s.m_densified;if(s.m_densified=null,null!==n){const s=new K;s.scale(1/this.m_rpu,1/this.m_rpu),n.applyTransformation(s),this.m_distance>0?this.putInGridCursors(e,n,i,!1,m,a,h,c,u):(this.processInGrid(e,n,!1,m,a,h,l),t=!0)}}const f=new C,d=(new _).executeMany(f,this.m_gcs,this.m_progressTracker,2);if(null!==o){let t=o.next();r=null,o=null;const s=J(i,t,!0),l=F(s);t=n.unproject(t,l,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,m,a,h,c,u)}for(let e=0;e<6;e++)if(null!=u[e]){let s=u[e].next();u[e]=null,c[e]=null,t&&null!==l[e]&&(s=(new v).execute(l[e],s,i,this.m_progressTracker));const n=J(i,s,!0),r=F(n);s=h[e].unproject(s,r,this.m_progressTracker),s=(new S).execute(s,this.m_gcs,!0,this.m_progressTracker),f.tick(be(s)),d.tock()}g=d.next()}else{let t,m=!1;if(e){let e=s.m_densified;if(s.m_densified=null,null!==e){const s=new K;s.scale(1/this.m_rpu,1/this.m_rpu),e.applyTransformation(s),d.project(e);const n=J(null,e,!0);e=b(e,n,!1,!0,-1,this.m_progressTracker,0,!1),this.m_distance>0?(r.tick(be(e)),o.tock()):(t=e,m=!0)}}let a=o.next();r=null,o=null,m&&(a=(new v).execute(t,a,i,this.m_progressTracker));const h=J(i,a,!0),c=F(h);g=n.unproject(a,c,this.m_progressTracker),g=(new S).execute(g,this.m_gcs,!0,this.m_progressTracker)}return g=(new p).foldInto360RangeGeodetic(g,this.m_gcs,2),g}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 C,a[c]=(new _).executeMany(m[c],s,this.m_progressTracker,2)),m[c].tick(be(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=H(t,e),u=W(null,c,!1).total();let l=ne(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 $;h<3?e.setCoords(0,1):e.setCoords(0,-1);const t=new $;t.setAdd(i[h].getCenter(),e),r[h]=xe(this.m_gcs,t)}r[h].project(l);const e=J(null,l,!0);l=b(l,e,s,!0,-1,this.m_progressTracker,0,!1),o[h]=l}}}insertGeodeticPointsAlongGrid(e,t,s){const n=l.construct(t[3].xmin,t[3].ymin,t[2].xmax,t[2].ymax),i=D(this.m_gcs,n,e,!0,this.m_progressTracker),r=new j,o=r.addGeometry(i);return I(r,o,this.m_gcs,0,2,!0,t[0].xmax+s),I(r,o,this.m_gcs,0,2,!0,t[1].xmax+s),I(r,o,this.m_gcs,0,2,!1,t[1].ymin+s),0!==s&&(I(r,o,this.m_gcs,0,2,!0,t[0].xmax-s),I(r,o,this.m_gcs,0,2,!0,t[1].xmax-s),I(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=d.q(this.m_a,this.m_eSquared,a),u=d.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,g=l+Math.PI,p=_+Math.PI,P=[Number.NaN],x=[Number.NaN],b=[Number.NaN],y=[Number.NaN];let w=!1;if(le(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,o,l,f,m,_,P,x),le(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,p,_,o,f,b,y),(_<P[0]&&P[0]<p||_<x[0]&&x[0]<p)&&(w=!0),w||(f<b[0]&&b[0]<l||f<y[0]&&y[0]<l)&&(w=!0),!w&&i)return!1;const C=[];for(let d=e.length-1;d>=0;d--)C.push(e[d]);r.setEmpty(),r.addPathPoint2D(null,0,!0);let v=0;v=ce(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,e,l,_,i,v,r),v=ue(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,_,p,this.m_cornerStep,i,v,r,P[0],x[0]),v=ce(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,C,p,g,i,v,r),v=ue(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,o,f,l,this.m_cornerStep,i,v,r,b[0],y[0]);let S=!1;return i||(S=this.checkAndPrepForPole(r)),w||S}bufferPoint2D(e,t,s){s.setEmpty(),s.addPathPoint2D(null,0,!0);const n=0;ue(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 l;return e.queryEnvelope(t),!(!G(t.ymax,this.m_gcs90)&&!G(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 O;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=G(t.y,this.m_gcs90),n=G(t.y,-this.m_gcs90);if(!s&&!n)break}let o=r,m=!1,a=Number.NaN;do{const n=e.getXY(o),r=G(n.y,this.m_gcs90),h=G(n.y,-this.m_gcs90),c=s+(o+1-s)%i;if(r||h){let s=$.construct(a,n.y);t.insertPoint2D(0,-1,s);const i=e.getXY(c),r=G(i.y,this.m_gcs90),o=G(i.y,-this.m_gcs90);r||o||(s=$.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 O,s=new O,n=new K,i=e.getXY(e.getPathStart(0)),r=e.getXY(e.getPathEnd(0)-1),o=this.m_gcs360,m=this.m_gcs180,a=new l;a.setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:this.m_gcs90});const h=new l;e.queryEnvelope(h);const c=Math.ceil(h.width()/o);let u,_;i.x>r.x?(u=-o,_=this.m_gcs90):(u=o,_=-this.m_gcs90),n.setShiftCoords(u,0),t.addPath(e,0,!0),s.add(t,!1);const f=new U;for(let l=0;l<c;l++)s.applyTransformation(n),s.getPointByVal(0,f),t.lineToPoint(f),t.addSegmentsFromPath(s,0,0,s.getSegmentCount()-1,!1);const d=t.getXY(0),g=t.getXY(t.getPointCount()-1);d.y=_,g.y=_,t.lineTo(g);const p=new $;for(p.setCoordsPoint2D(g),p.x-=.5*u;Math.abs(p.x-d.x)>m;)t.lineTo(p),p.x-=.5*u;t.lineTo(d);const P=a.getCenterX(),x=new l;t.queryEnvelope(x);let b=0;const y=x.getCenter().x;y-P>m?b=-Math.ceil((y-P-m)/o):P-y>m&&(b=Math.ceil((P-y-m)/o)),0!==b&&(n.setShiftCoords(b*o,0),t.applyTransformation(n));const w=new j,C=w.addGeometry(t);I(w,C,this.m_gcs,0,2,!0,a.xmin),I(w,C,this.m_gcs,0,2,!0,a.xmax);const v=w.getGeometry(C),S=H(v,a);S.inflateCoords(0,1);const D=W(null,S,!0).total(),G=ne(v,a,D,Number.NaN,this.m_progressTracker);e.setEmpty(),e.add(G,!1)}prepDoublePoleWrap(e){const t=this.m_gcs360,s=this.m_gcs180,n=new l;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 l;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 K;s.setShiftCoords(m*t,0),e.getImpl().applyTransformationToPath(s,0),e.queryPathEnvelope(0,r),a=r.getCenter().x}const h=new l;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 $;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 K;a<i?s.setShiftCoords(t,0):s.setShiftCoords(-t,0),e.getImpl().applyTransformationToPath(s,0),c.addPath(e,0,!0);const r=new j,o=r.addGeometry(c);I(r,o,this.m_gcs,0,2,!0,n.xmin),I(r,o,this.m_gcs,0,2,!0,n.xmax),c=r.getGeometry(o);const m=H(c,n);m.inflateCoords(0,1);const h=W(null,m,!0).total();c=ne(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 $;n.setCoords(0,10*this.m_rpu);const i=0;let r=45*this.m_rpu;const o=X(e,new ee(new T,new T),!1),m=X(e,new ee(new T,new T),!1),a=X(e,new ee(new T,new T),!1),h=X(e,new ee(new T,new T),!1),c=new $,u=new $,l=new $,_=new $;for(M.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),M.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);M.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=X(e,new T,!1),f=X(e,new T,!1);M.geodeticDistance(this.m_a,this.m_eSquared,c.x,c.y,u.x,u.y,o,f,null,2),M.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=X(e,new T,!1);M.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,M.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{B(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{B(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 $,r=new $;i.setCoords(0,10*this.m_rpu),r.setCoords(10*this.m_rpu,10*this.m_rpu);const o=X(e,new T,!1),m=X(e,new T,!1),a=X(e,new T,!1);M.geodeticDistance(this.m_a,this.m_eSquared,i.x,i.y,r.x,r.y,a,o,m,this.m_curveType);const h=X(e,new ee(new T,new T),!1),c=X(e,new ee(new T,new T),!1),u=new $,l=X(e,new T,!1),_=X(e,new ee(new T,new T),!1),f=X(e,new ee(new T,new T),!1),d=X(e,new ee(new T,new T),!1),g=X(e,new ee(new T,new T),!1),p=new $,P=new $,x=new $,b=new $,y=0;let w=1;const C=o.val,v=m.val,S=C-.5*Math.PI,D=v+.5*Math.PI,I=a.val;for(M.geodesicCoordinate(this.m_a,this.m_eSquared,i.x,i.y,n,S,_.at(0),_.at(1)),p.setCoords(_.at(0).val,_.at(1).val),M.geodesicCoordinate(this.m_a,this.m_eSquared,r.x,r.y,n,D,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);M.geodeticCoordinate(this.m_a,this.m_eSquared,i.x,i.y,s*I,C,h.at(0),h.at(1),this.m_curveType),u.setCoords(h.at(0).val,h.at(1).val),M.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;M.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=X(e,new T,!1),a=X(e,new T,!1);M.geodeticDistance(this.m_a,this.m_eSquared,p.x,p.y,P.x,P.y,m,a,null,2),M.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 _=X(e,new T,!1);M.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,M.geodeticCoordinate(this.m_a,this.m_eSquared,i.x,i.y,w*I,C,c.at(0),c.at(1),this.m_curveType),r.setCoords(c.at(0).val,c.at(1).val);const t=X(e,new T,!1);M.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;M.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{B(e)}}}catch(s){e.error=s,e.hasError=!0}finally{B(e)}}let G=w*I;G>1e5&&(G=1e5),this.m_segmentStep=G}catch(n){e.error=n,e.hasError=!0}finally{B(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 he(e,t,s,n,i,r,_){if(e.isEmpty())return new O({vd:e.getDescription()});let b=e;if(m(b)){const e=10*t.getTolerance(0);b=(new re).execute(b,0,e,0,_,12e3)}const y=new ae(_);y.m_sr=t,y.m_gcs=t.getGCS(),y.m_transform=f(t,y.m_gcs,null);const w=N();y.m_gcs.querySpheroidData(w);const C=new l;b.queryEnvelope(C),y.m_a=w.majorSemiAxis,y.m_eSquared=w.e2,y.m_rpu=y.m_gcs.getUnit().getUnitToBaseFactor(),y.m_gcs90=.5*Math.PI/y.m_rpu,y.m_gcs180=Math.PI/y.m_rpu,y.m_gcs360=2*Math.PI/y.m_rpu,y.m_gcs60=y.m_gcs360/6,y.m_q90=d.q90(y.m_a,y.m_eSquared),y.m_ellipticToGeodesicMaxRatio=.5*y.m_a*Math.PI/y.m_q90;const v=y.m_gcs.getTolerance(0);y.m_radTolerance=v*y.m_rpu,4===s?(y.m_curveType=2,y.m_bShapePreserving=!0):(y.m_curveType=s,y.m_bShapePreserving=!1),y.m_distance=n,y.m_absDistance=Math.abs(n),Number.isNaN(i)||i<=0?y.setConvergenceOffset():y.m_convergenceOffset=Math.max(i,.001),y.m_convergenceOffset/=r;let S,D=b.getGeometryType();if(a(D)){const e=new Y({vd:b.getDescription()});e.addSegment(b,!0),S=e,D=o.enumPolyline}else if(D===o.enumEnvelope){const e=b,t=new l;e.queryEnvelope(t);const s=F(W(y.m_sr,C,!0));if(t.minDimension()<=s)if(0===t.maxDimension()){const t=new U({vd:b.getDescription()});e.getCenter(t),S=t,D=o.enumPoint}else{const t=new Y({vd:b.getDescription()});t.addEnvelope(e,!1),S=t,D=o.enumPolyline}else{const t=new O({vd:b.getDescription()});t.addEnvelope(e,!1),S=t,D=o.enumPolygon}}else S=b;if(y.setMinCornerStep(),h(D)||y.setMinSegmentStep(),y.m_absDistance<=.5*y.m_convergenceOffset)return D!==o.enumPolygon?new O({vd:S.getDescription()}):y.m_bShapePreserving?S:g(S,y.m_sr,y.m_curveType,y.m_segmentStep,-1,_);if(y.m_distance<0&&D!==o.enumPolygon)return new O({vd:S.getDescription()});if(y.m_bShapePreserving&&c(D)){const e=g(S,t,4,Number.NaN,y.m_convergenceOffset,_);S=(new p).execute(e,y.m_transform,_)}else S=(new p).execute(S,y.m_transform,_);if(S=P(S,y.m_gcs),S.isEmpty())return new O({vd:S.getDescription()});!y.m_bShapePreserving&&c(D)&&(S=x(y.m_rpu,S)),S=fe(S,y.m_gcs);let I=new O;switch(D){case o.enumPolygon:I=y.bufferPolygon(S);break;case o.enumPolyline:I=y.bufferPolyline(S);break;case o.enumMultiPoint:I=y.bufferMultiPoint(S);break;case o.enumPoint:I=y.bufferPoint(S);break;default:u("")}const G=(new p).execute(I,y.m_transform.getInverse(),_);return G.mergeVertexDescription(S.getDescription()),G}function ce(e,t,s,n,i,r,o,m,a,h,c){const u={stack:[],error:void 0,hasError:!1};try{const l=new $;l.setNAN(),a||c.getPointCount()>0&&(l.setCoordsPoint2D(c.getXY(c.getPointCount()-1)),l.scale(s));const _=X(u,new T,!1),f=X(u,new ee(new T,new T),!1),d=new $,g=new $,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:(M.geodeticDistance(e,t,p.x,p.y,u.x,u.y,null,null,_,i),x=_.val-.5*Math.PI),M.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=_e(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{B(u)}}function ue(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=X(_,new ee(new T,new T),!1),d=new $,g=new $,p=new $;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));)M.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=_e(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{B(_)}}function le(e,t,s,n,i,r,o,m,a,h,c){const u={stack:[],error:void 0,hasError:!1};try{const s=new $,l=new $,_=X(u,new ee(new T,new T),!1);M.geodesicCoordinate(e,t,i.x,i.y,n,r,_.at(0),_.at(1)),s.setCoords(_.at(0).val,_.at(1).val),M.geodesicCoordinate(e,t,i.x,i.y,n,o,_.at(0),_.at(1)),l.setCoords(_.at(0).val,_.at(1).val);const f=X(u,new T,!1);for(M.geodeticDistance(e,t,m.x,m.y,s.x,s.y,null,f,null,0),h[0]=f.val,M.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]+=se;for(;h[0]>c[0];)h[0]-=se;for(;h[0]>=a;)h[0]-=se,c[0]-=se;for(;h[0]<a;)h[0]+=se,c[0]+=se}catch(l){u.error=l,u.hasError=!0}finally{B(u)}}function _e(e,t,s,n){if(Number.isNaN(s)){for(;n+t-e>Math.PI;)n-=se;for(;e-(n+t)>Math.PI;)n+=se;return n}return n+t-s>Math.PI?n-=se:s-(n+t)>Math.PI&&(n+=se),n}function fe(e,t){const s=e.getGeometryType();let n;if(n=c(s)?e.getPathCount():s===o.enumMultiPoint?e.getPointCount():1,1===n)return e;const i=[],r=[];for(let o=0;o<n;o++){i.push(o);const n=new $;if(c(s)){const t=new l;e.queryPathEnvelope(o,t),n.assign(t.getCenter())}else n.assign(e.getXY(o));const m=t.toGeohash(n);r.push(m)}i.sort((e,t)=>r[e]<r[t]?-1:r[e]>r[t]?1:0);const m=e.createInstance();for(let o=0;o<n;o++){const t=i[o];c(s)?m.addPath(e,t,!0):m.addPoints(e,t,t+1)}return m}function de(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=X(o,new T,!1),c=X(o,new T,!1),u=X(o,new T,!1);M.greatEllipticDistance(e,t,i.x,i.y,m.x,m.y,h,null,null),M.greatEllipticDistance(e,t,i.x,i.y,a.x,a.y,c,null,null),M.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=X(o,new T,!1);l=Math.max(h.val,c.val);for(let n=1;n<s.length-1;n++){const r=s[n];M.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{B(o)}}function ge(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=$.lerp(t,s,.5)}else{a=n[n.length-1>>1].clone()}const h=a.clone(),c=k(e,t,h,75/180*Math.PI);return!!de(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=X(o,new T,!1);M.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{B(o)}}function Pe(e,t,s,n,i,r,o,m){const a=k(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 xe(e,t){return new z(e,t)}function be(e){return L(e,0)||V(e,0),e}class ye{m_bRunningInGnomonic=!1;m_bNeedsSimplify=!1;m_gnomonic=null;m_gnomonicCenterRad=new $;m_minGnomonicRadius=Number.NaN;m_progressTracker;constructor(e){this.m_progressTracker=e}isRunningInGnomonic(){return this.m_bRunningInGnomonic}needsSimplify(){return this.m_bNeedsSimplify}getGnomonic(){return this.m_gnomonic}}class we extends ye{m_bufferer;m_multiPath;m_segIter=null;m_bNextSegmentCannotJoin=!1;m_currentDensifiedDelta=[0];m_currentBufferedDelta=0;m_lastAzimuth=0;m_startAzimuth=[0];m_endAzimuth=[0];m_numWinds=0;m_debugCounter=0;m_bufferHelper=new O;m_densifiedPoints=[];m_densified;constructor(e,t,s){super(e.m_progressTracker),this.m_bufferer=e,this.m_multiPath=t,this.m_densified=s,this.m_bNeedsSimplify=!0;const n=new l;this.m_multiPath.queryEnvelope(n);const i=n.getCenter(),r=i.clone();r.scale(this.m_bufferer.m_rpu),this.m_gnomonic=xe(this.m_bufferer.m_gcs,i),this.m_gnomonicCenterRad=r.clone(),this.m_minGnomonicRadius=k(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 $,r=new $;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),A(i,r))i.x=r.x;else if(E(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),E(t,i)&&(i.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),A(r,e)&&(r.x=e.x)}}this.m_densifiedPoints.length=0;const s=q(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(ge(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||R(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 O,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(A(i,r))i.x=r.x;else if(E(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),E(t,i)&&(i.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),A(r,e)&&(r.x=e.x)}}this.m_densifiedPoints.length=0,q(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=ue(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&&de(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 $,s=new $,n=[0];return ge(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=xe(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-(se-(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 $;t.setCoordsPoint2D(e.getXY(e.getPointCount()-1)),t.scale(this.m_bufferer.m_rpu),t.x-this.m_currentBufferedDelta<-Math.PI?this.m_currentBufferedDelta-=se:t.x-this.m_currentBufferedDelta>Math.PI&&(this.m_currentBufferedDelta+=se)}n=.5*(n+s)}else if(r){const s=new $;s.setCoordsPoint2D(t),s.scale(1/this.m_bufferer.m_rpu),e.insertPoint2D(0,-1,s)}else ue(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++,ce(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 Ce extends ye{m_bufferer;m_multiPoint;m_pointIndex=-1;constructor(e,t){super(e.m_progressTracker),this.m_bufferer=e,this.m_multiPoint=t,this.m_bNeedsSimplify=!1;const s=new l;this.m_multiPoint.queryEnvelope(s);const n=s.getCenter(),i=n.clone();i.scale(this.m_bufferer.m_rpu),this.m_gnomonic=xe(this.m_bufferer.m_gcs,n),this.m_gnomonicCenterRad=i.clone(),this.m_minGnomonicRadius=k(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 O,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 $,s=new $,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=xe(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 Se(e,t,s,n,i,!1,r,m);return(new _).executeMany(o,t,m)}return new Se(e,t,s,n,i,!1,r,m)}execute(e,s,n,i,r,o,m){const a=new oe([e]),h=[i],c=this.executeMany(a,s,n,h,r,!1,o,m).next();return c||t("geodesic buffer null output"),c}}class Se extends e{m_inputGeoms;m_spatialReference;m_curveType;m_progressTracker;m_distances;m_convergenceOffset;m_currentUnionEnvelope2D=new l;m_bOutlineOnly;m_bUnion;m_index=-1;m_dindex=-1;constructor(e,t,i,r,o,m,a,h){super(),this.m_progressTracker=h,m&&s(""),t||n("");0===t.getCoordinateSystemType()&&n(""),this.m_inputGeoms=e,this.m_spatialReference=t,this.m_curveType=i,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 i(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 me(e,this.m_spatialReference,this.m_curveType,t,this.m_convergenceOffset,this.m_progressTracker)}}export{ve as OperatorGeodesicBuffer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as e,c as t,G as i,d as s,g as n}from"./Geometry.js";import{P as a,x as _,L as r}from"./MultiPathImpl.js";import{O as h}from"./OperatorDensify.js";import{y as o,D as m,r as l,aw as p,O as u,aG as c,j as g,b as d,a9 as E,ay as f,aU as P,aV as S,ag as A,ah as y,ao as x,aW as R,av as M,ar as C}from"./UnitFactory.js";import{P as T,K as w,d as q,o as N,l as b,a as I,E as v,q as $,f as z,c as D,y as G,z as O,A as k}from"./Point2D.js";import{Envelope2D as L}from"./Envelope2D.js";import{c as F,k as J}from"./Envelope.js";import{O as U}from"./OperatorClip.js";import{O as Y}from"./OperatorShapePreservingLength.js";import{__addDisposableResource as X,__disposeResources as j}from"tslib";import{T as B}from"./Transformation2D.js";import{a as H}from"./GeodeticDistanceCalculator-zRp89-dW.js";class Q{m_startPt;m_endPt;m_cE2;m_cE;m_c1By2e;m_cRpu;isPcs;PEProjcs;m_points;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=q(2*n,Number.NaN)}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&&p.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 L;e.queryEnvelope(s);const n=F(t,s,!0).total(),a=t.getPannableExtent();a.xmin=s.xmin-10*n,a.xmax=s.xmax+10*n;const r=(new U).execute(e,a,t,i).getImpl().querySegmentIterator();r.stripAttributes();const h=l();t.querySpheroidData(h);const o=h.e2,m=0===o?2:1,p=new T(0,0),u=new T(0,0),c=new w(0),g=new Q(p,u,t,o,100);for(;r.nextPath();)for(;r.hasNextSegment();){const e=r.nextSegment();p.assign(e.getStartXY()),u.assign(e.getEndXY()),g.setSegmentEndPoints(p,u);const t=_(6,0,1,1e-12,1e-15,g.makeFunctor());c.pe((u.x-p.x)*t)}const d=h.majorSemiAxis;return m*d*d*(1-o)*Math.PI*c.getResult()/t.getPannableExtent().width()}function W(e,t,i,s,n){const a=se(e,t,n);let _=Z(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=Z(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 Z(e,t,i,s,n){const a=(new h).execute(e,t,0,0,n);let _;_=s?(new u).execute(a,s,n):a;const r=1===i.getUnit().getUnitToBaseFactor()?Math.PI/180:1,o=new L;_.queryEnvelope(o);const m=new L,l=new L,p=new L;m.setCoords({xmin:o.xmin,ymin:75*r,xmax:o.xmax,ymax:90*r}),l.setCoords({xmin:o.xmin,ymin:-60*r,xmax:o.xmax,ymax:75*r}),p.setCoords({xmin:o.xmin,ymin:-90*r,xmax:o.xmax,ymax:-60*r}),m.inflateCoords(.01*m.width(),0),l.inflateCoords(.01*l.width(),0),p.inflateCoords(.01*p.width(),0);let c=0;return c+=K(_,m,i,n),c+=K(_,l,i,n),c+=K(_,p,i,n),c}function K(e,t,i,s){const n=(new U).execute(e,t,i,s);if(null!==n&&!n.isEmpty()){const e=new L;n.queryEnvelope(e);const{first:t,second:a}=ie(i,e,!1),_=o(i,t,null),r=(new u).execute(n,_,s).calculateArea2D();return a&&t.destroy(),r}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 T;r.x=0,r.y=0;let h=0;if(0===h){_.y>45?(r.y=b,h=0):_.y<-45?(r.y=-b,h=1):_.x>=45&&_.x<135?(r.x=b,h=2):_.x>=135||_.x<-135?(r.x=b,h=3):_.x<-45&&_.x>=-135?(r.x=-b,h=4):(r.x=0,h=5);const e=a*Math.sqrt(I(t.xmin-t.xmax)+I(t.ymin-t.ymax)),i=r.clone(),s=t.getCenter();s.scale(a),h<2&&(i.x=s.x);if(T.distance(i,s)+.5*e>b)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 Y).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 l=(new h).execute(r,0,n.getTolerance(0),0,_);let p=null;const u=n.getGCS();u!==n&&(p=o(n,u));let c=(new m).execute(l,n,!1,_);return c.isEmpty()?0:(c===s&&(c=s.clone()),n.isPannable()?V(c,n,_):W(c,n,u,p,_))}}function ae(){return{m_p_PCS:new T,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{m_ptStart=new J;m_ptEnd=new J;m_deltaX;m_deltaY;m_e;m_e2;m_c1MinusE2;m_baseA;constructor(e,t,i,s){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*(O(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=_*(O(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{m_a;m_b;m_eSquared;m_inputSR;m_inputGCS;m_transformPCS2GCS=null;m_curveType;m_progressTracker;m_scaleToRadians=new B;m_scaleToDegrees=new B;m_rpu;constructor(t,i,s){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 h).execute(i,0,this.m_inputSR.getTolerance(0),0,this.m_progressTracker)}if(this.m_inputSR.isPannable()){const e=new L;i.queryEnvelope(e);const t=this.m_inputSR.getPannableExtent();if(!t.containsEnvelope(e)){const s=t.getCenterX()-e.getCenterX(),n=new B;n.setShiftCoords(s,0),i.applyTransformation(n),e.move(s,0);const a=new v;t.queryIntervalX(a);const _=new v;e.queryIntervalX(_),i=a.contains(_)?E(i,this.m_inputSR):(new u).foldInto360RangeGeodetic(i,this.m_inputSR,this.m_curveType)}}if(this.m_transformPCS2GCS?(i=(new m).execute(i,this.m_inputSR,!1,this.m_progressTracker),t=i.createInstance(),f(this.m_transformPCS2GCS,i,t,this.m_progressTracker)||(t=(new u).execute(i,this.m_transformPCS2GCS,this.m_progressTracker))):t=(new m).execute(i,this.m_inputGCS,!1,this.m_progressTracker),t.isEmpty())return 0;if(1===this.m_curveType){const e=l();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=l();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=P.unit(9101),s=this.m_inputGCS.getPECoordSys(),n=X(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{j(e)}}}executeClippedPolygonGeodeticArea(e,t,i){const s={stack:[],error:void 0,hasError:!1};try{const n=new L;e.queryEnvelope(n);const a=X(s,this.getEqualAreaPCSInstance(t,n),!1),_=e.clone();S(a,_);const r=50,h=_.getImpl().getAttributeStreamRef(0),o=e.getImpl().getAttributeStreamRef(0),m=X(s,new A,!1),l=X(s,new A,!1),u=40,c=[0,0],g=$(ae,u),d=q(u,-1),E=ae(),f=ae();let P,x;const R=a;let M=_.calculateArea2D();const C=new w(0),N=.5*Math.PI,b=1e-10*Math.abs(M)+1e-6,I=e.getPathCount();let v,D,G,O;const k=new T,F=new T,J=new T,U=new T,Y=new T,j=new T;let B,H;for(D=e.getPathStart(0),v=0;v<I;v++,D=G)for(G=e.getPathEnd(v),h.queryPoint2D(G-1<<1,J),o.queryPoint2D(G-1<<1,k),Math.abs(k.y)>N&&(k.y=z(N,k.y)),O=D;O<G;O++,J.assign(U),k.assign(F)){if(h.queryPoint2D(O<<1,U),o.queryPoint2D(O<<1,F),Math.abs(F.y)>N&&(F.y=z(N,F.y)),B=T.distance(J,U),B<r||0===k.y&&0===F.y)continue;y.geodeticDistance(this.m_a,this.m_eSquared,k.x,k.y,F.x,F.y,m,l,null,this.m_curveType);const e=m.val,t=l.val;for(E.setValues(0,J),f.setValues(1,U),x=i,g[0].assign(f),d[0]=i,P=0;P>=0;){H=.5*(E.m_factor+f.m_factor),y.geodeticCoordinate(this.m_a,this.m_eSquared,k.x,k.y,e*H,t,m,l,this.m_curveType),Y.x=m.val,Y.y=l.val,c[0]=Y.x,c[1]=Y.y,p.geogToProj(R,1,c),j.x=c[0],j.y=c[1];const i=-j.offset(E.m_p_PCS,f.m_p_PCS),s=.5*i*T.distance(E.m_p_PCS,f.m_p_PCS);if(C.pe(s),Math.abs(s)>b||Math.abs(s)>0&&x>0)f.setValues(H,j),P++,g[P].assign(f),Math.abs(s)<=b?(x--,d[P-1]=x,d[P]=x):(x=d[P-1],d[P]=x);else{if(P<=0)break;E.assign(f),P--,f.assign(g[P]),x=d[P]}}}return M+=C.getResult(),Math.abs(M)}catch(n){s.error=n,s.hasError=!0}finally{j(s)}}executeClippedPolygonGreatEllipticArea(e){const t=[],i=[],s=new T,n=new T,a=x(1,this.m_eSquared,new T(0,.5*Math.PI)),_=new w(0),r=new w(0),h=new w(0),o=new J,m=new J,l=new L;e.queryLooseEnvelope(l);let p=0;l.containsCoords(l.xmin,0)||(p=Math.abs(l.ymin)<Math.abs(l.ymax)?l.ymin:l.ymax);const u=new he(this.m_eSquared,o,m,p),c=this.m_a*this.m_a,g=e.getImpl().querySegmentIterator();for(g.stripAttributes();g.nextPath();)for(;g.hasNextSegment();){const e=g.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)o.assign(x(this.m_a,this.m_eSquared,i.getStartXY())),m.assign(x(this.m_a,this.m_eSquared,i.getEndXY())),u.setSegmentEndPoints(o,m),this.adaptiveIntegrationWithRomberg(u,_);for(let t of i){let e=t.getStartXY(),i=t.getEndXY(),s=p;e.y<0&&(i=D(e,e=i),e.y=-e.y,i.y=-i.y,s=-s);const n=x(1,this.m_eSquared,e),_=x(1,this.m_eSquared,i),o=Math.min(e.y,i.y),m=R(this.m_eSquared,e.x,i.x,s,o);r.pe(m);const l=Math.abs(R(this.m_eSquared,e.x,i.x,o,b)),u=new J;u.setSub(n,a);const g=new J;g.setSub(_,a);const d=new J;d.setCrossProductVector(u,g);let E=c*(l-.5*d.length());E=z(E,i.x-e.x),h.pe(E)}t.length=0,i.length=0}return h.getResult()+c*(.5*(1-this.m_eSquared)*_.getResult()+r.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=z(.5*Math.PI,t.getCenterY()):(a=t.getCenterY(),_=t.ymin+r*(2/3));const m=g("EqualAreaPCS"),l=e.toString();return o=h?P.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]]`,!0):P.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]]`,!0),o}splitSegmentCrossingItegralThreshold(e,t,i){const s=100,n=20,a=n*n,_=x(this.m_a,this.m_eSquared,new T(0,b)),h=x(this.m_a,this.m_eSquared,new T(0,-b)),o=this.splitSegmentPassingThroughPole(e);for(let m of o){const e=m.getStartXY(),o=m.getEndXY(),l=x(this.m_a,this.m_eSquared,e),p=x(this.m_a,this.m_eSquared,o),u=new T,c=new J;let g=J.sqrDistance(_,l),d=J.sqrDistance(l,p);if(g<=s){if(!(d>a)){i.push(new r({start:e,end:o}));continue}c.assign(p.sub(l)),c.normalizeThis(),c.assign(l.add(c.mul(n))),u.assign(M(this.m_a,this.m_eSquared,c)),i.push(new r({start:e,end:u})),e.assign(u)}if(l.assign(x(this.m_a,this.m_eSquared,e)),g=J.sqrDistance(_,p),d=J.sqrDistance(l,p),g<=s){if(!(d>a)){i.push(new r({start:e,end:o}));continue}c.assign(p.sub(l)),c.normalizeThis(),c.assign(p.sub(c.mul(n))),u.assign(M(this.m_a,this.m_eSquared,c)),i.push(new r({start:u,end:o})),o.assign(u)}if(l.assign(x(this.m_a,this.m_eSquared,e)),p.assign(x(this.m_a,this.m_eSquared,o)),g=J.sqrDistance(h,l),d=J.sqrDistance(l,p),g<=s){if(!(d>a)){i.push(new r({start:e,end:o}));continue}c.assign(p.sub(l)),c.normalizeThis(),c.assign(l.add(c.mul(n))),u.assign(M(this.m_a,this.m_eSquared,c)),i.push(new r({start:e,end:u})),e.assign(u)}if(l.assign(x(this.m_a,this.m_eSquared,e)),p.assign(x(this.m_a,this.m_eSquared,o)),g=J.sqrDistance(h,p),d=J.sqrDistance(l,p),g<=s){if(!(d>a)){i.push(new r({start:e,end:o}));continue}c.assign(p.sub(l)),c.normalizeThis(),c.assign(p.sub(c.mul(n))),u.assign(M(this.m_a,this.m_eSquared,c)),i.push(new r({start:u,end:o})),o.assign(u)}t.push(new r({start:e,end:o}))}}splitSegmentPassingThroughPole(e){const t={stack:[],error:void 0,hasError:!1};try{const i=[],s=new J,n=new J,a=new J,_=new T,h=20,o=3.124139361,m=10,l=e.getStartXY(),p=e.getEndXY(),u=X(t,new A,!1);if(y.geodeticDistance(this.m_a,this.m_eSquared,l.x,l.y,p.x,p.y,u,null,null,2),Math.abs(p.x-l.x)>o&&u.val>h){const e=new H(new T(0,90),l.divide(this.m_rpu),p.divide(this.m_rpu),this.m_inputGCS,2,2);let t=C(e.makeFunctor(),0,1,1e-10);if(t.second<=m&&t.first>0&&t.first<1)return s.assign(x(this.m_a,this.m_eSquared,l)),n.assign(x(this.m_a,this.m_eSquared,p)),G(s,n,t.first,a),_.assign(M(this.m_a,this.m_eSquared,a)),i.push(new r({start:l,end:_})),i.push(new r({start:_,end:p})),i;if(e.setPointDistFrom(new T(0,-90)),t=C(e.makeFunctor(),0,1,1e-10),t.second<=m&&t.first>0&&t.first<1)return s.assign(x(this.m_a,this.m_eSquared,l)),n.assign(x(this.m_a,this.m_eSquared,p)),G(s,n,t.first,a),_.assign(M(this.m_a,this.m_eSquared,a)),i.push(new r({start:l,end:_})),i.push(new r({start:_,end:p})),i}return i.push(new r({start:l,end:p})),i}catch(i){t.error=i,t.hasError=!0}finally{j(t)}}adaptiveIntegrationWithRomberg(e,t){const i=e.makeFunctor();let s=0,n=1,a=i(s),r=i(n);const h=1e-17,o=1e-14;let m=(s+n)/2,l=i(m),p=Math.abs(l-a),u=Math.abs(r-l),c=0;for(;c++<32&&(p/u<.1||u/p<.1);)p<u?(t.pe(_(5,s,m,o,h,i)),s=m,a=l):(t.pe(_(5,m,n,o,h,i)),n=m,r=l),m=(s+n)/2,l=Math.abs(i(m)),p=Math.abs(l-a),u=Math.abs(r-l);t.pe(_(5,s,n,o,h,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+O(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=k(_.one_m_sin_phi/e.one_p_e,e.e)-k(a.one_m_sin_phi/e.one_p_e,e.e),u=k(_.one_p_sin_phi/e.one_p_e,e.e)-k(a.one_p_sin_phi/e.one_p_e,e.e),c=k(a.one_m_sin_phi/-e.one_m_e,e.e)-k(_.one_m_sin_phi/-e.one_m_e,e.e),g=k(a.one_p_sin_phi/-e.one_m_e,e.e)-k(_.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+O(e.e*a.sin_phi)),P=.5*e.one_m_e_2*_.sin_phi*(1/_.one_m_e_2_sin_2_phi+O(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=O(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 T,h=new T,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=o(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
+ import{a as e,c as t,G as i,d as s,g as n}from"./Geometry.js";import{P as a,x as _,L as r}from"./MultiPathImpl.js";import{O as h}from"./OperatorDensify.js";import{B as o,H as m,r as l,ay as p,O as u,aI as c,j as g,b as d,ab as E,aA as f,aW as P,aX as S,ai as A,aj as y,aq as x,aY as R,ax as M,at as C}from"./UnitFactory.js";import{P as T,K as w,d as q,o as N,l as b,a as I,E as v,q as $,f as z,c as O,y as D,z as G,A as k}from"./Point2D.js";import{Envelope2D as L}from"./Envelope2D.js";import{c as F,k as J}from"./Envelope.js";import{O as Y}from"./OperatorClip.js";import{O as U}from"./OperatorShapePreservingLength.js";import{__addDisposableResource as X,__disposeResources as j}from"tslib";import{T as B}from"./Transformation2D.js";import{a as H}from"./GeodeticDistanceCalculator-zRp89-dW.js";class Q{m_startPt;m_endPt;m_cE2;m_cE;m_c1By2e;m_cRpu;isPcs;PEProjcs;m_points;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=q(2*n,Number.NaN)}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&&p.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 L;e.queryEnvelope(s);const n=F(t,s,!0).total(),a=t.getPannableExtent();a.xmin=s.xmin-10*n,a.xmax=s.xmax+10*n;const r=(new Y).execute(e,a,t,i).getImpl().querySegmentIterator();r.stripAttributes();const h=l();t.querySpheroidData(h);const o=h.e2,m=0===o?2:1,p=new T(0,0),u=new T(0,0),c=new w(0),g=new Q(p,u,t,o,100);for(;r.nextPath();)for(;r.hasNextSegment();){const e=r.nextSegment();p.assign(e.getStartXY()),u.assign(e.getEndXY()),g.setSegmentEndPoints(p,u);const t=_(6,0,1,1e-12,1e-15,g.makeFunctor());c.pe((u.x-p.x)*t)}const d=h.majorSemiAxis;return m*d*d*(1-o)*Math.PI*c.getResult()/t.getPannableExtent().width()}function W(e,t,i,s,n){const a=se(e,t,n);let _=Z(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=Z(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 Z(e,t,i,s,n){const a=(new h).execute(e,t,0,0,n);let _;_=s?(new u).execute(a,s,n):a;const r=1===i.getUnit().getUnitToBaseFactor()?Math.PI/180:1,o=new L;_.queryEnvelope(o);const m=new L,l=new L,p=new L;m.setCoords({xmin:o.xmin,ymin:75*r,xmax:o.xmax,ymax:90*r}),l.setCoords({xmin:o.xmin,ymin:-60*r,xmax:o.xmax,ymax:75*r}),p.setCoords({xmin:o.xmin,ymin:-90*r,xmax:o.xmax,ymax:-60*r}),m.inflateCoords(.01*m.width(),0),l.inflateCoords(.01*l.width(),0),p.inflateCoords(.01*p.width(),0);let c=0;return c+=K(_,m,i,n),c+=K(_,l,i,n),c+=K(_,p,i,n),c}function K(e,t,i,s){const n=(new Y).execute(e,t,i,s);if(null!==n&&!n.isEmpty()){const e=new L;n.queryEnvelope(e);const{first:t,second:a}=ie(i,e,!1),_=o(i,t,null),r=(new u).execute(n,_,s).calculateArea2D();return a&&t.destroy(),r}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 T;r.x=0,r.y=0;let h=0;if(0===h){_.y>45?(r.y=b,h=0):_.y<-45?(r.y=-b,h=1):_.x>=45&&_.x<135?(r.x=b,h=2):_.x>=135||_.x<-135?(r.x=b,h=3):_.x<-45&&_.x>=-135?(r.x=-b,h=4):(r.x=0,h=5);const e=a*Math.sqrt(I(t.xmin-t.xmax)+I(t.ymin-t.ymax)),i=r.clone(),s=t.getCenter();s.scale(a),h<2&&(i.x=s.x);if(T.distance(i,s)+.5*e>b)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 U).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 l=(new h).execute(r,0,n.getTolerance(0),0,_);let p=null;const u=n.getGCS();u!==n&&(p=o(n,u));let c=(new m).execute(l,n,!1,_);return c.isEmpty()?0:(c===s&&(c=s.clone()),n.isPannable()?V(c,n,_):W(c,n,u,p,_))}}function ae(){return{m_p_PCS:new T,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{m_ptStart=new J;m_ptEnd=new J;m_deltaX;m_deltaY;m_e;m_e2;m_c1MinusE2;m_baseA;constructor(e,t,i,s){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*(G(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=_*(G(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{m_a;m_b;m_eSquared;m_inputSR;m_inputGCS;m_transformPCS2GCS=null;m_curveType;m_progressTracker;m_scaleToRadians=new B;m_scaleToDegrees=new B;m_rpu;constructor(t,i,s){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 h).execute(i,0,this.m_inputSR.getTolerance(0),0,this.m_progressTracker)}if(this.m_inputSR.isPannable()){const e=new L;i.queryEnvelope(e);const t=this.m_inputSR.getPannableExtent();if(!t.containsEnvelope(e)){const s=t.getCenterX()-e.getCenterX(),n=new B;n.setShiftCoords(s,0),i.applyTransformation(n),e.move(s,0);const a=new v;t.queryIntervalX(a);const _=new v;e.queryIntervalX(_),i=a.contains(_)?E(i,this.m_inputSR):(new u).foldInto360RangeGeodetic(i,this.m_inputSR,this.m_curveType)}}if(this.m_transformPCS2GCS?(i=(new m).execute(i,this.m_inputSR,!1,this.m_progressTracker),t=i.createInstance(),f(this.m_transformPCS2GCS,i,t,this.m_progressTracker)||(t=(new u).execute(i,this.m_transformPCS2GCS,this.m_progressTracker))):t=(new m).execute(i,this.m_inputGCS,!1,this.m_progressTracker),t.isEmpty())return 0;if(1===this.m_curveType){const e=l();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=l();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=P.unit(9101),s=this.m_inputGCS.getPECoordSys(),n=X(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{j(e)}}}executeClippedPolygonGeodeticArea(e,t,i){const s={stack:[],error:void 0,hasError:!1};try{const n=new L;e.queryEnvelope(n);const a=X(s,this.getEqualAreaPCSInstance(t,n),!1),_=e.clone();S(a,_);const r=50,h=_.getImpl().getAttributeStreamRef(0),o=e.getImpl().getAttributeStreamRef(0),m=X(s,new A,!1),l=X(s,new A,!1),u=40,c=[0,0],g=$(ae,u),d=q(u,-1),E=ae(),f=ae();let P,x;const R=a;let M=_.calculateArea2D();const C=new w(0),N=.5*Math.PI,b=1e-10*Math.abs(M)+1e-6,I=e.getPathCount();let v,O,D,G;const k=new T,F=new T,J=new T,Y=new T,U=new T,j=new T;let B,H;for(O=e.getPathStart(0),v=0;v<I;v++,O=D)for(D=e.getPathEnd(v),h.queryPoint2D(D-1<<1,J),o.queryPoint2D(D-1<<1,k),Math.abs(k.y)>N&&(k.y=z(N,k.y)),G=O;G<D;G++,J.assign(Y),k.assign(F)){if(h.queryPoint2D(G<<1,Y),o.queryPoint2D(G<<1,F),Math.abs(F.y)>N&&(F.y=z(N,F.y)),B=T.distance(J,Y),B<r||0===k.y&&0===F.y)continue;y.geodeticDistance(this.m_a,this.m_eSquared,k.x,k.y,F.x,F.y,m,l,null,this.m_curveType);const e=m.val,t=l.val;for(E.setValues(0,J),f.setValues(1,Y),x=i,g[0].assign(f),d[0]=i,P=0;P>=0;){H=.5*(E.m_factor+f.m_factor),y.geodeticCoordinate(this.m_a,this.m_eSquared,k.x,k.y,e*H,t,m,l,this.m_curveType),U.x=m.val,U.y=l.val,c[0]=U.x,c[1]=U.y,p.geogToProj(R,1,c),j.x=c[0],j.y=c[1];const i=-j.offset(E.m_p_PCS,f.m_p_PCS),s=.5*i*T.distance(E.m_p_PCS,f.m_p_PCS);if(C.pe(s),Math.abs(s)>b||Math.abs(s)>0&&x>0)f.setValues(H,j),P++,g[P].assign(f),Math.abs(s)<=b?(x--,d[P-1]=x,d[P]=x):(x=d[P-1],d[P]=x);else{if(P<=0)break;E.assign(f),P--,f.assign(g[P]),x=d[P]}}}return M+=C.getResult(),Math.abs(M)}catch(n){s.error=n,s.hasError=!0}finally{j(s)}}executeClippedPolygonGreatEllipticArea(e){const t=[],i=[],s=new T,n=new T,a=x(1,this.m_eSquared,new T(0,.5*Math.PI)),_=new w(0),r=new w(0),h=new w(0),o=new J,m=new J,l=new L;e.queryLooseEnvelope(l);let p=0;l.containsCoords(l.xmin,0)||(p=Math.abs(l.ymin)<Math.abs(l.ymax)?l.ymin:l.ymax);const u=new he(this.m_eSquared,o,m,p),c=this.m_a*this.m_a,g=e.getImpl().querySegmentIterator();for(g.stripAttributes();g.nextPath();)for(;g.hasNextSegment();){const e=g.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)o.assign(x(this.m_a,this.m_eSquared,i.getStartXY())),m.assign(x(this.m_a,this.m_eSquared,i.getEndXY())),u.setSegmentEndPoints(o,m),this.adaptiveIntegrationWithRomberg(u,_);for(let t of i){let e=t.getStartXY(),i=t.getEndXY(),s=p;e.y<0&&(i=O(e,e=i),e.y=-e.y,i.y=-i.y,s=-s);const n=x(1,this.m_eSquared,e),_=x(1,this.m_eSquared,i),o=Math.min(e.y,i.y),m=R(this.m_eSquared,e.x,i.x,s,o);r.pe(m);const l=Math.abs(R(this.m_eSquared,e.x,i.x,o,b)),u=new J;u.setSub(n,a);const g=new J;g.setSub(_,a);const d=new J;d.setCrossProductVector(u,g);let E=c*(l-.5*d.length());E=z(E,i.x-e.x),h.pe(E)}t.length=0,i.length=0}return h.getResult()+c*(.5*(1-this.m_eSquared)*_.getResult()+r.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=z(.5*Math.PI,t.getCenterY()):(a=t.getCenterY(),_=t.ymin+r*(2/3));const m=g("EqualAreaPCS"),l=e.toString();return o=h?P.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]]`,!0):P.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]]`,!0),o}splitSegmentCrossingItegralThreshold(e,t,i){const s=100,n=20,a=n*n,_=x(this.m_a,this.m_eSquared,new T(0,b)),h=x(this.m_a,this.m_eSquared,new T(0,-b)),o=this.splitSegmentPassingThroughPole(e);for(let m of o){const e=m.getStartXY(),o=m.getEndXY(),l=x(this.m_a,this.m_eSquared,e),p=x(this.m_a,this.m_eSquared,o),u=new T,c=new J;let g=J.sqrDistance(_,l),d=J.sqrDistance(l,p);if(g<=s){if(!(d>a)){i.push(new r({start:e,end:o}));continue}c.assign(p.sub(l)),c.normalizeThis(),c.assign(l.add(c.mul(n))),u.assign(M(this.m_a,this.m_eSquared,c)),i.push(new r({start:e,end:u})),e.assign(u)}if(l.assign(x(this.m_a,this.m_eSquared,e)),g=J.sqrDistance(_,p),d=J.sqrDistance(l,p),g<=s){if(!(d>a)){i.push(new r({start:e,end:o}));continue}c.assign(p.sub(l)),c.normalizeThis(),c.assign(p.sub(c.mul(n))),u.assign(M(this.m_a,this.m_eSquared,c)),i.push(new r({start:u,end:o})),o.assign(u)}if(l.assign(x(this.m_a,this.m_eSquared,e)),p.assign(x(this.m_a,this.m_eSquared,o)),g=J.sqrDistance(h,l),d=J.sqrDistance(l,p),g<=s){if(!(d>a)){i.push(new r({start:e,end:o}));continue}c.assign(p.sub(l)),c.normalizeThis(),c.assign(l.add(c.mul(n))),u.assign(M(this.m_a,this.m_eSquared,c)),i.push(new r({start:e,end:u})),e.assign(u)}if(l.assign(x(this.m_a,this.m_eSquared,e)),p.assign(x(this.m_a,this.m_eSquared,o)),g=J.sqrDistance(h,p),d=J.sqrDistance(l,p),g<=s){if(!(d>a)){i.push(new r({start:e,end:o}));continue}c.assign(p.sub(l)),c.normalizeThis(),c.assign(p.sub(c.mul(n))),u.assign(M(this.m_a,this.m_eSquared,c)),i.push(new r({start:u,end:o})),o.assign(u)}t.push(new r({start:e,end:o}))}}splitSegmentPassingThroughPole(e){const t={stack:[],error:void 0,hasError:!1};try{const i=[],s=new J,n=new J,a=new J,_=new T,h=20,o=3.124139361,m=10,l=e.getStartXY(),p=e.getEndXY(),u=X(t,new A,!1);if(y.geodeticDistance(this.m_a,this.m_eSquared,l.x,l.y,p.x,p.y,u,null,null,2),Math.abs(p.x-l.x)>o&&u.val>h){const e=new H(new T(0,90),l.divide(this.m_rpu),p.divide(this.m_rpu),this.m_inputGCS,2,2);let t=C(e.makeFunctor(),0,1,1e-10);if(t.second<=m&&t.first>0&&t.first<1)return s.assign(x(this.m_a,this.m_eSquared,l)),n.assign(x(this.m_a,this.m_eSquared,p)),D(s,n,t.first,a),_.assign(M(this.m_a,this.m_eSquared,a)),i.push(new r({start:l,end:_})),i.push(new r({start:_,end:p})),i;if(e.setPointDistFrom(new T(0,-90)),t=C(e.makeFunctor(),0,1,1e-10),t.second<=m&&t.first>0&&t.first<1)return s.assign(x(this.m_a,this.m_eSquared,l)),n.assign(x(this.m_a,this.m_eSquared,p)),D(s,n,t.first,a),_.assign(M(this.m_a,this.m_eSquared,a)),i.push(new r({start:l,end:_})),i.push(new r({start:_,end:p})),i}return i.push(new r({start:l,end:p})),i}catch(i){t.error=i,t.hasError=!0}finally{j(t)}}adaptiveIntegrationWithRomberg(e,t){const i=e.makeFunctor();let s=0,n=1,a=i(s),r=i(n);const h=1e-17,o=1e-14;let m=(s+n)/2,l=i(m),p=Math.abs(l-a),u=Math.abs(r-l),c=0;for(;c++<32&&(p/u<.1||u/p<.1);)p<u?(t.pe(_(5,s,m,o,h,i)),s=m,a=l):(t.pe(_(5,m,n,o,h,i)),n=m,r=l),m=(s+n)/2,l=Math.abs(i(m)),p=Math.abs(l-a),u=Math.abs(r-l);t.pe(_(5,s,n,o,h,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+G(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=k(_.one_m_sin_phi/e.one_p_e,e.e)-k(a.one_m_sin_phi/e.one_p_e,e.e),u=k(_.one_p_sin_phi/e.one_p_e,e.e)-k(a.one_p_sin_phi/e.one_p_e,e.e),c=k(a.one_m_sin_phi/-e.one_m_e,e.e)-k(_.one_m_sin_phi/-e.one_m_e,e.e),g=k(a.one_p_sin_phi/-e.one_m_e,e.e)-k(_.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+G(e.e*a.sin_phi)),P=.5*e.one_m_e_2*_.sin_phi*(1/_.one_m_e_2_sin_2_phi+G(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=G(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 T,h=new T,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=o(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};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{G as e}from"./GeometryCursor.js";import{d as t,t as r,a as s,c as m}from"./Geometry.js";import{a8 as n}from"./UnitFactory.js";import{S as i}from"./SimpleGeometryCursor.js";class a{getOperatorType(){return 10310}supportsCurves(){return!0}accelerateGeometry(e,t,r){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,r,s,m){return new o(e,r,s,t,-1,-1,m)}execute(e,r,s,m,n){const a=new i([e]),o=this.executeMany(a,r,s,m,n).next();return o||t("null output"),o}}class o extends e{m_inputGeoms;m_spatialReference;m_curveType;m_maxLengthMeters;m_maxDeviationMeters;m_maxAngle;m_progressTracker;m_index;constructor(e,t,m,n,i,a,o){super(),this.m_progressTracker=o,a>0&&r(""),4!==m&&i>0&&r(""),t||s("");0===t.getCoordinateSystemType()&&s(""),n>0||i>0||s(""),this.m_index=-1,this.m_inputGeoms=e,this.m_spatialReference=t,this.m_curveType=m,this.m_maxLengthMeters=n,this.m_maxDeviationMeters=i,this.m_maxAngle=a}next(){{let e;for(;e=this.m_inputGeoms.next();)return m(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 n(e,this.m_spatialReference,this.m_curveType,this.m_maxLengthMeters,this.m_maxDeviationMeters,this.m_progressTracker)}}export{a as OperatorGeodeticDensifyByLength,o as OperatorGeodeticDensifyCursor};
2
+ import{G as e}from"./GeometryCursor.js";import{d as t,t as r,a as s,c as m}from"./Geometry.js";import{aa as n}from"./UnitFactory.js";import{S as i}from"./SimpleGeometryCursor.js";class a{getOperatorType(){return 10310}supportsCurves(){return!0}accelerateGeometry(e,t,r){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,r,s,m){return new o(e,r,s,t,-1,-1,m)}execute(e,r,s,m,n){const a=new i([e]),o=this.executeMany(a,r,s,m,n).next();return o||t("null output"),o}}class o extends e{m_inputGeoms;m_spatialReference;m_curveType;m_maxLengthMeters;m_maxDeviationMeters;m_maxAngle;m_progressTracker;m_index;constructor(e,t,m,n,i,a,o){super(),this.m_progressTracker=o,a>0&&r(""),4!==m&&i>0&&r(""),t||s("");0===t.getCoordinateSystemType()&&s(""),n>0||i>0||s(""),this.m_index=-1,this.m_inputGeoms=e,this.m_spatialReference=t,this.m_curveType=m,this.m_maxLengthMeters=n,this.m_maxDeviationMeters=i,this.m_maxAngle=a}next(){{let e;for(;e=this.m_inputGeoms.next();)return m(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 n(e,this.m_spatialReference,this.m_curveType,this.m_maxLengthMeters,this.m_maxDeviationMeters,this.m_progressTracker)}}export{a as OperatorGeodeticDensifyByLength,o as OperatorGeodeticDensifyCursor};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{a as r,c as n,G as a,h as o}from"./Geometry.js";import{O as s}from"./OperatorShapePreservingLength.js";import{c as i,a as c}from"./MultiPathImpl.js";import{E as m}from"./Point2D.js";import{a9 as l,ax as u,ay as g,O as p,ag as y,ah as f,r as h}from"./UnitFactory.js";import{O as x}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 s).execute(e,t,f);if(0===t.getCoordinateSystemType()&&r(""),n(e),e.isEmpty()||e.getDimension()<1)return 0;const S=t.getGCS(),d=h();S.querySpheroidData(d);const P=d.majorSemiAxis,E=d.e2,G=S.getUnit().getUnitToBaseFactor();let j;const v=e.getGeometryType();if(v===a.enumPolygon?j=e.getBoundary():v===a.enumEnvelope?j=i(e):o(v)?(j=new c({vd:e.getDescription()}),j.addSegment(e,!0)):j=e,j.hasNonLinearSegments()){j=(new x).execute(j,0,t.getTolerance(0),0,f)}if(S!==t){const r=t.getSRToGCSTransform();if(t.isPannable()){j=l(j,t),v===a.enumPolyline&&j===e&&(j=e.clone());const r=new m;t.getPannableExtent().queryIntervalX(r);for(let e=0,t=j.getPointCount();e<t;e++){const t=j.getXY(e);t.x=u(t.x,r),j.setXY(e,t)}}const n=j.createInstance();j=g(r,j,n,f)?n:(new p).execute(j,r,f)}return this._ExecuteMultiPathGeodeticLength(j,y,P,E,G)}_ExecuteMultiPathGeodeticLength(r,n,a,o,s){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(s),i.scale(s),f.geodeticDistance(a,o,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
+ import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{a as r,c as n,G as a,h as o}from"./Geometry.js";import{O as s}from"./OperatorShapePreservingLength.js";import{c as i,a as c}from"./MultiPathImpl.js";import{E as m}from"./Point2D.js";import{ab as l,az as u,aA as g,O as p,ai as y,aj as f,r as h}from"./UnitFactory.js";import{O as x}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 s).execute(e,t,f);if(0===t.getCoordinateSystemType()&&r(""),n(e),e.isEmpty()||e.getDimension()<1)return 0;const S=t.getGCS(),d=h();S.querySpheroidData(d);const P=d.majorSemiAxis,E=d.e2,G=S.getUnit().getUnitToBaseFactor();let j;const v=e.getGeometryType();if(v===a.enumPolygon?j=e.getBoundary():v===a.enumEnvelope?j=i(e):o(v)?(j=new c({vd:e.getDescription()}),j.addSegment(e,!0)):j=e,j.hasNonLinearSegments()){j=(new x).execute(j,0,t.getTolerance(0),0,f)}if(S!==t){const r=t.getSRToGCSTransform();if(t.isPannable()){j=l(j,t),v===a.enumPolyline&&j===e&&(j=e.clone());const r=new m;t.getPannableExtent().queryIntervalX(r);for(let e=0,t=j.getPointCount();e<t;e++){const t=j.getXY(e);t.x=u(t.x,r),j.setXY(e,t)}}const n=j.createInstance();j=g(r,j,n,f)?n:(new p).execute(j,r,f)}return this._ExecuteMultiPathGeodeticLength(j,y,P,E,G)}_ExecuteMultiPathGeodeticLength(r,n,a,o,s){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(s),i.scale(s),f.geodeticDistance(a,o,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};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{G as e}from"./GeometryCursor.js";import{c as t}from"./Geometry.js";import{W as r}from"./UnitFactory.js";import{Envelope2D as i}from"./Envelope2D.js";import{B as s}from"./Bufferer-CclWhXVb.js";class m{getOperatorType(){return 10111}supportsCurves(){return!0}accelerateGeometry(e,t,r){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,i,s,m,o,a,_,c,u,h){if(c){const c=new n(e,t,i,s,m,o,a,_,h);return(new r).executeMany(c,t,h,2)}return new n(e,t,i,s,m,o,a,_,h)}}class n extends e{m_inputGeoms;m_spatialReference;m_progressTracker;m_bufferer;m_distances;m_maxDeviation;m_miterLimit;m_maxVerticesInFullCircle;m_joins;m_caps;m_currentUnionEnvelope2D=new i;m_index=-1;m_dindex=-1;constructor(e,t,r,i,m,n,o,a,_){super(),this.m_progressTracker=_,this.m_bufferer=new s(_),this.m_inputGeoms=e,this.m_spatialReference=t,this.m_distances=r,this.m_maxDeviation=o,this.m_maxVerticesInFullCircle=a,this.m_joins=i,this.m_caps=m,this.m_miterLimit=n}tock(){return!0}getRank(){return 1}next(){{let e;for(;e=this.m_inputGeoms.next();)return t(e),this.m_index=this.m_inputGeoms.getGeometryID(),this.m_dindex+1<this.m_distances.length&&this.m_dindex++,this.buffer(e,this.m_distances[this.m_dindex]);return null}}getGeometryID(){return this.m_index}buffer(e,t){return this.m_bufferer.buffer(e,t,this.m_spatialReference,this.m_joins,this.m_caps,this.m_miterLimit,this.m_maxDeviation,this.m_maxVerticesInFullCircle)}}export{m as O};
2
+ import{G as e}from"./GeometryCursor.js";import{c as t}from"./Geometry.js";import{_ as r}from"./UnitFactory.js";import{Envelope2D as i}from"./Envelope2D.js";import{B as s}from"./Bufferer-CclWhXVb.js";class m{getOperatorType(){return 10111}supportsCurves(){return!0}accelerateGeometry(e,t,r){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,i,s,m,o,a,_,c,u,h){if(c){const c=new n(e,t,i,s,m,o,a,_,h);return(new r).executeMany(c,t,h,2)}return new n(e,t,i,s,m,o,a,_,h)}}class n extends e{m_inputGeoms;m_spatialReference;m_progressTracker;m_bufferer;m_distances;m_maxDeviation;m_miterLimit;m_maxVerticesInFullCircle;m_joins;m_caps;m_currentUnionEnvelope2D=new i;m_index=-1;m_dindex=-1;constructor(e,t,r,i,m,n,o,a,_){super(),this.m_progressTracker=_,this.m_bufferer=new s(_),this.m_inputGeoms=e,this.m_spatialReference=t,this.m_distances=r,this.m_maxDeviation=o,this.m_maxVerticesInFullCircle=a,this.m_joins=i,this.m_caps=m,this.m_miterLimit=n}tock(){return!0}getRank(){return 1}next(){{let e;for(;e=this.m_inputGeoms.next();)return t(e),this.m_index=this.m_inputGeoms.getGeometryID(),this.m_dindex+1<this.m_distances.length&&this.m_dindex++,this.buffer(e,this.m_distances[this.m_dindex]);return null}}getGeometryID(){return this.m_index}buffer(e,t){return this.m_bufferer.buffer(e,t,this.m_spatialReference,this.m_joins,this.m_caps,this.m_miterLimit,this.m_maxDeviation,this.m_maxVerticesInFullCircle)}}export{m as O};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{G as e}from"./GeometryCursor.js";import{e as t,G as s,c as m}from"./Geometry.js";import{E as r,n as i}from"./MultiPathImpl.js";import{Envelope2D as o}from"./Envelope2D.js";import{c as h,P as n}from"./Envelope.js";import{l as _,F as p,s as a,G as l,H as u,I as y,J as c,K as G,L as g,M as d}from"./UnitFactory.js";class f{getOperatorType(){return 10009}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,s,m=0){return new x(e,t,s,m)}}class x extends e{m_inputGeometries;m_sr;m_progressTracker;m_shape=new r;m_currentGeom=i;m_options;m_progressCounter=0;m_geomIndex=-1;m_geomTypeIndex=-1;m_index=-1;m_bBuilt=!1;m_bOutputOnlyModified=!1;m_bSimplifyPolygons=!1;m_bSnapToSr=!1;constructor(e,s,m,r){super(),this.m_progressTracker=m,this.m_inputGeometries=e,this.m_sr=s,this.m_options=r,1===r||2===r?(this.m_bOutputOnlyModified=!0,this.m_options=0,this.m_bSimplifyPolygons=!0,this.m_bSnapToSr=null!=s&&2===r,this.m_bSnapToSr&&!_()&&t("PE is required for snapping to spatial reference operation")):0===r&&(this.m_bSimplifyPolygons=!0)}progress_(e=!1){}tock(){return!0}getRank(){return 1}moveToNextGeom(){for(;;){if(this.m_bBuilt?this.m_currentGeom=this.m_shape.getNextGeometry(this.m_currentGeom):(this.m_currentGeom=this.m_shape.getFirstGeometry(),this.m_bBuilt=!0),this.m_currentGeom!==i){let e=!1;if(this.m_bSimplifyPolygons&&this.m_shape.getGeometryType(this.m_currentGeom)===s.enumPolygon&&(e=p(this.m_shape,this.m_currentGeom,-1,!1,i,this.m_progressTracker)),this.m_bOutputOnlyModified&&!e&&!this.m_shape.getGeometryModified(this.m_currentGeom))continue}break}}next(){if(this.m_bBuilt)this.moveToNextGeom();else{this.m_geomIndex=this.m_shape.createGeometryUserIndex();const e=new o;for(let i=this.m_inputGeometries.next();null!=i;i=this.m_inputGeometries.next()){this.progress_(),m(i);let t=!1;this.m_bSnapToSr&&(i=i.clone(),t=a(this.m_sr,i));const r=this.m_shape.addGeometry(i);this.m_shape.setGeometryUserIndex(r,this.m_geomIndex,this.m_inputGeometries.getGeometryID());const h=i.getGeometryType();h===s.enumPoint&&(-1===this.m_geomTypeIndex&&(this.m_geomTypeIndex=this.m_shape.createGeometryUserIndex()),this.m_shape.setGeometryUserIndex(r,this.m_geomTypeIndex,h));const n=new o;i.queryLooseEnvelope(n),e.mergeEnvelope2D(n),t&&this.m_shape.setGeometryModified(r,!0)}const t=h(this.m_sr,e,!0),r=h(this.m_sr,e,!1);e.inflate(10*t.total()),this.m_shape.forceSetEnvelope2D(e);let n=null,_=0,f=0;if(this.m_shape.hasCurves()){n=new g;const s=l(t.total(),e);_=u(t.total()),f=d(s,_),y(this.m_shape,s,t.total(),12e3,n,null,this.m_progressTracker)}if(c(this.m_shape,r,this.m_progressTracker)){if(G(this.m_shape,t.add(f),this.m_progressTracker,0===this.m_options,this.m_bOutputOnlyModified),null!==n){if(this.m_bSimplifyPolygons){for(let e=this.m_shape.getFirstGeometry();e!==i;e=this.m_shape.getNextGeometry(e))if(this.m_shape.getGeometryType(e)===s.enumPolygon){p(this.m_shape,e,-1,!1,i,this.m_progressTracker)&&this.m_shape.setGeometryModified(e,!0)}this.m_bSimplifyPolygons=!1}n.stitchCurves(this.m_shape,i,_,!0),n.clearStitcher(this.m_shape)}}else this.m_bSimplifyPolygons=!1,null!==n&&(n.stitchCurves(this.m_shape,i,_,!0),n.clearStitcher(this.m_shape));this.moveToNextGeom()}if(this.m_currentGeom!==i){if(this.m_index=this.m_shape.getGeometryUserIndex(this.m_currentGeom,this.m_geomIndex),-1!==this.m_geomTypeIndex&&this.m_shape.getGeometryUserIndex(this.m_currentGeom,this.m_geomTypeIndex)===s.enumPoint){const e=new n({vd:this.m_shape.getVertexDescription()});return this.m_shape.queryPointGeometryOnly(this.m_currentGeom,e),this.m_bSnapToSr&&a(this.m_sr,e),e}{const e=this.m_shape.getGeometry(this.m_currentGeom);return this.m_bSnapToSr&&a(this.m_sr,e),e}}return null}getGeometryID(){return this.m_index}}export{f as O};
2
+ import{G as e}from"./GeometryCursor.js";import{e as t,G as s,c as m}from"./Geometry.js";import{E as r,n as i}from"./MultiPathImpl.js";import{Envelope2D as o}from"./Envelope2D.js";import{c as h,P as n}from"./Envelope.js";import{l as _,J as p,s as a,K as l,L as u,M as y,N as c,Q as G,R as g,T as d}from"./UnitFactory.js";class f{getOperatorType(){return 10009}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,s,m=0){return new x(e,t,s,m)}}class x extends e{m_inputGeometries;m_sr;m_progressTracker;m_shape=new r;m_currentGeom=i;m_options;m_progressCounter=0;m_geomIndex=-1;m_geomTypeIndex=-1;m_index=-1;m_bBuilt=!1;m_bOutputOnlyModified=!1;m_bSimplifyPolygons=!1;m_bSnapToSr=!1;constructor(e,s,m,r){super(),this.m_progressTracker=m,this.m_inputGeometries=e,this.m_sr=s,this.m_options=r,1===r||2===r?(this.m_bOutputOnlyModified=!0,this.m_options=0,this.m_bSimplifyPolygons=!0,this.m_bSnapToSr=null!=s&&2===r,this.m_bSnapToSr&&!_()&&t("PE is required for snapping to spatial reference operation")):0===r&&(this.m_bSimplifyPolygons=!0)}progress_(e=!1){}tock(){return!0}getRank(){return 1}moveToNextGeom(){for(;;){if(this.m_bBuilt?this.m_currentGeom=this.m_shape.getNextGeometry(this.m_currentGeom):(this.m_currentGeom=this.m_shape.getFirstGeometry(),this.m_bBuilt=!0),this.m_currentGeom!==i){let e=!1;if(this.m_bSimplifyPolygons&&this.m_shape.getGeometryType(this.m_currentGeom)===s.enumPolygon&&(e=p(this.m_shape,this.m_currentGeom,-1,!1,i,this.m_progressTracker)),this.m_bOutputOnlyModified&&!e&&!this.m_shape.getGeometryModified(this.m_currentGeom))continue}break}}next(){if(this.m_bBuilt)this.moveToNextGeom();else{this.m_geomIndex=this.m_shape.createGeometryUserIndex();const e=new o;for(let i=this.m_inputGeometries.next();null!=i;i=this.m_inputGeometries.next()){this.progress_(),m(i);let t=!1;this.m_bSnapToSr&&(i=i.clone(),t=a(this.m_sr,i));const r=this.m_shape.addGeometry(i);this.m_shape.setGeometryUserIndex(r,this.m_geomIndex,this.m_inputGeometries.getGeometryID());const h=i.getGeometryType();h===s.enumPoint&&(-1===this.m_geomTypeIndex&&(this.m_geomTypeIndex=this.m_shape.createGeometryUserIndex()),this.m_shape.setGeometryUserIndex(r,this.m_geomTypeIndex,h));const n=new o;i.queryLooseEnvelope(n),e.mergeEnvelope2D(n),t&&this.m_shape.setGeometryModified(r,!0)}const t=h(this.m_sr,e,!0),r=h(this.m_sr,e,!1);e.inflate(10*t.total()),this.m_shape.forceSetEnvelope2D(e);let n=null,_=0,f=0;if(this.m_shape.hasCurves()){n=new g;const s=l(t.total(),e);_=u(t.total()),f=d(s,_),y(this.m_shape,s,t.total(),12e3,n,null,this.m_progressTracker)}if(c(this.m_shape,r,this.m_progressTracker)){if(G(this.m_shape,t.add(f),this.m_progressTracker,0===this.m_options,this.m_bOutputOnlyModified),null!==n){if(this.m_bSimplifyPolygons){for(let e=this.m_shape.getFirstGeometry();e!==i;e=this.m_shape.getNextGeometry(e))if(this.m_shape.getGeometryType(e)===s.enumPolygon){p(this.m_shape,e,-1,!1,i,this.m_progressTracker)&&this.m_shape.setGeometryModified(e,!0)}this.m_bSimplifyPolygons=!1}n.stitchCurves(this.m_shape,i,_,!0),n.clearStitcher(this.m_shape)}}else this.m_bSimplifyPolygons=!1,null!==n&&(n.stitchCurves(this.m_shape,i,_,!0),n.clearStitcher(this.m_shape));this.moveToNextGeom()}if(this.m_currentGeom!==i){if(this.m_index=this.m_shape.getGeometryUserIndex(this.m_currentGeom,this.m_geomIndex),-1!==this.m_geomTypeIndex&&this.m_shape.getGeometryUserIndex(this.m_currentGeom,this.m_geomTypeIndex)===s.enumPoint){const e=new n({vd:this.m_shape.getVertexDescription()});return this.m_shape.queryPointGeometryOnly(this.m_currentGeom,e),this.m_bSnapToSr&&a(this.m_sr,e),e}{const e=this.m_shape.getGeometry(this.m_currentGeom);return this.m_bSnapToSr&&a(this.m_sr,e),e}}return null}getGeometryID(){return this.m_index}}export{f as O};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{R as e,T as r}from"./UnitFactory.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
+ import{W as e,X as r}from"./UnitFactory.js";class t extends e{getOperatorType(){return 4}execute(e,t,s,a){return!r(e,t,s,4,a)}}export{t as O};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{G as e}from"./GeometryCursor.js";import{E as t,n as s,P as r}from"./MultiPathImpl.js";import{c as n,G as o,g as a,a as i}from"./Geometry.js";import{Envelope2D as m}from"./Envelope2D.js";import{i as l,e as g,P as h}from"./Envelope.js";import{D as u,G as c,$ as p,a0 as _,L as P,a1 as y}from"./UnitFactory.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{m_inputGeoms;m_spatialReference;m_progressTracker;m_currentGeometry;m_singlePartIndex;m_singlePartCount;m_polygonStart;m_index;m_options;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(n(e),e.getGeometryType()===o.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 n=[0],o=e.getImpl().getIsSimple(0,n);if(l(o))this.m_currentGeometry=e;else{const n=new t,o=n.addGeometry(e);let i=null;if(n.hasCurves()){i=new P;const t=new m;e.queryEnvelope(t);const s=g(null,e,!0),r=c(s.total(),t);p(n,r,s.total(),12e3,null,i,null,this.m_progressTracker)}const l=n.createPathUserIndex();{let e=0;for(let t=n.getFirstPath(o);t!==s;t=n.getNextPath(t))n.setPathUserIndex(t,l,e++)}const h=_(n,o,this.m_progressTracker);a(h>=0);const u=[];for(let e=n.getFirstPath(o);e!==s;e=n.getNextPath(e))u.push(e);u.sort((e,t)=>Math.abs(n.getPathUserIndex(e,h))-Math.abs(n.getPathUserIndex(t,h)));const y=e,d=new r({vd:e.getDescription()});d.reserveParts(y.getPointCount(),y.getPathCount());for(let e=0,t=u.length;e<t;e++){const t=u[e],s=n.getPathUserIndex(t,l),r=y.calculateRingArea2D(s)>0,o=n.getPathUserIndex(t,h)>=0;d.addPath(y,s,r===o)}this.m_currentGeometry=d}}else i("");else this.m_currentGeometry=e;this.m_singlePartCount=G(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()===o.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 o.enumMultiPoint:n=new h({vd:r.getDescription()}),r.isEmpty()||r.getPointByVal(e,n);break;case o.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 o.enumPolygon:if(1===t)n=r;else{n=r.createInstance();const e=n.getImpl(),t=r.getImpl(),o=t.getPathFlagsStreamRef();let a=s;const i=t.getPathCount();do{e.addPath(t,a,!0),a++}while(a<i&&!(8&o.read(a)));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 G(e){return e.isEmpty()?1:y(e)}export{d as O};
2
+ import{G as e}from"./GeometryCursor.js";import{E as t,n as s,P as r}from"./MultiPathImpl.js";import{c as n,G as o,g as a,a as i}from"./Geometry.js";import{Envelope2D as m}from"./Envelope2D.js";import{i as l,e as g,P as h}from"./Envelope.js";import{H as u,K as c,a3 as p,a4 as _,R as P,a5 as y}from"./UnitFactory.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{m_inputGeoms;m_spatialReference;m_progressTracker;m_currentGeometry;m_singlePartIndex;m_singlePartCount;m_polygonStart;m_index;m_options;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(n(e),e.getGeometryType()===o.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 n=[0],o=e.getImpl().getIsSimple(0,n);if(l(o))this.m_currentGeometry=e;else{const n=new t,o=n.addGeometry(e);let i=null;if(n.hasCurves()){i=new P;const t=new m;e.queryEnvelope(t);const s=g(null,e,!0),r=c(s.total(),t);p(n,r,s.total(),12e3,null,i,null,this.m_progressTracker)}const l=n.createPathUserIndex();{let e=0;for(let t=n.getFirstPath(o);t!==s;t=n.getNextPath(t))n.setPathUserIndex(t,l,e++)}const h=_(n,o,this.m_progressTracker);a(h>=0);const u=[];for(let e=n.getFirstPath(o);e!==s;e=n.getNextPath(e))u.push(e);u.sort((e,t)=>Math.abs(n.getPathUserIndex(e,h))-Math.abs(n.getPathUserIndex(t,h)));const y=e,d=new r({vd:e.getDescription()});d.reserveParts(y.getPointCount(),y.getPathCount());for(let e=0,t=u.length;e<t;e++){const t=u[e],s=n.getPathUserIndex(t,l),r=y.calculateRingArea2D(s)>0,o=n.getPathUserIndex(t,h)>=0;d.addPath(y,s,r===o)}this.m_currentGeometry=d}}else i("");else this.m_currentGeometry=e;this.m_singlePartCount=G(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()===o.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 o.enumMultiPoint:n=new h({vd:r.getDescription()}),r.isEmpty()||r.getPointByVal(e,n);break;case o.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 o.enumPolygon:if(1===t)n=r;else{n=r.createInstance();const e=n.getImpl(),t=r.getImpl(),o=t.getPathFlagsStreamRef();let a=s;const i=t.getPathCount();do{e.addPath(t,a,!0),a++}while(a<i&&!(8&o.read(a)));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 G(e){return e.isEmpty()?1:y(e)}export{d as O};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{R as e,T as r}from"./UnitFactory.js";class t extends e{getOperatorType(){return 9}execute(e,t,s,a){return r(e,t,s,32,a)}}export{t as O};
2
+ import{W as e,X as r}from"./UnitFactory.js";class t extends e{getOperatorType(){return 9}execute(e,t,s,a){return r(e,t,s,32,a)}}export{t as O};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as e,t,G as r}from"./Geometry.js";import{Envelope2D as s}from"./Envelope2D.js";import{m as n,a as o,c as i}from"./SideCalculator2D-DX0718xq.js";import{d as a}from"./Envelope.js";import{P as u}from"./Point2D.js";import{E as c}from"./UnitFactory.js";class m{getOperatorType(){return 10500}accelerateGeometry(e,t,r){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}getNearestCoordinate(s,o,i,a){if(o.isNAN()&&e("NAN xy coordinates are not allowed"),s.isEmpty())return n();switch(s.getGeometryType()){case r.enumPoint:return this.pointGetNearestVertex(s,o);case r.enumMultiPoint:return this.multiVertexGetNearestVertex(s,o);case r.enumPolyline:case r.enumPolygon:return this.multiPathGetNearestCoordinate(s,o,i,a);default:t("")}}getNearestVertex(s,o){if(o.isNAN()&&e("NAN xy coordinates are not allowed"),s.isEmpty())return n();switch(s.getGeometryType()){case r.enumPoint:return this.pointGetNearestVertex(s,o);case r.enumMultiPoint:case r.enumPolyline:case r.enumPolygon:return this.multiVertexGetNearestVertex(s,o);default:t("")}}getNearestVertices(s,n,o,i){if(0===i&&e(""),n.isNAN()&&e("NAN xy coordinates are not allowed"),s.isEmpty())return[];switch(s.getGeometryType()){case r.enumPoint:return this.pointGetNearestVertices(s,n,o,i);case r.enumMultiPoint:case r.enumPolyline:case r.enumPolygon:return this.multiVertexGetNearestVertices(s,n,o,i);default:t("")}}multiPathGetNearestCoordinate(t,n,m,l){if(t.getGeometryType()===r.enumPolygon&&m){const e=new s;t.queryEnvelope(e);const r=a(null,e,!1);let i;if(i=c(t,n,l?0:r),0!==i){const e=o(n,-1,0);return l&&(e.m_bRightSide=!0),e}}const g=t.querySegmentIterator(),y=new u;let N=-1,p=-1,d=Number.MAX_VALUE,f=0;for(;g.nextPath();)for(;g.hasNextSegment();){const e=g.nextSegment(),t=e.getClosestCoordinate(n,!1),r=e.getCoord2D(t),s=u.sqrDistance(r,n);s<d?(f=1,y.assign(r),N=g.getStartPointIndex(),p=g.getPathIndex(),d=s):s===d&&f++}-1===N&&e("");const h=o(y,N,Math.sqrt(d));if(l)if(t.getGeometryType()!==r.enumPolygon){let e=!1;if(f>1){const r=i(t,n,N,p);e=0!==r&&3!==r}else{g.resetToVertex(N,p);const t=g.nextSegment();e=0!==i(t,n)}h.m_bRightSide=e}else if(!m){0!==c(t,n,0)&&(h.m_bRightSide=!0)}return h}pointGetNearestVertex(e,t){const r=e.getXY(),s=u.distance(r,t);return o(r,0,s)}multiVertexGetNearestVertex(e,t){const r=e.getAttributeStreamRef(0),s=e.getPointCount();let n=-1;const i=new u;let a=Number.MAX_VALUE;const c=new u;for(let o=0;o<s;o++){r.queryPoint2D(2*o,c);const e=u.sqrDistance(c,t);e<a&&(i.assign(c),n=o,a=e)}return o(i,n,Math.sqrt(a))}pointGetNearestVertices(e,t,r,s){const n=[];if(0!==s){const s=r*r,i=e.getXY(),a=u.sqrDistance(i,t);a<=s&&n.push(o(i,0,Math.sqrt(a)))}return n}multiVertexGetNearestVertices(e,t,r,s){const n=[];if(0!==s){const i=e.getAttributeStreamRef(0),a=e.getPointCount();n.length=s+1;const c=r*r;for(let e=0;e<a;e++){const r=i.read(2*e),s=i.read(2*e+1),a=t.x-r,m=t.y-s,l=a*a+m*m;l<=c&&n.push(o(u.construct(r,s),e,Math.sqrt(l)))}n.sort((e,t)=>e.m_distance-t.m_distance)}return n.slice(0,s)}}export{m as O};
2
+ import{a as e,t,G as r}from"./Geometry.js";import{Envelope2D as s}from"./Envelope2D.js";import{m as n,a as o,c as i}from"./SideCalculator2D-DX0718xq.js";import{d as a}from"./Envelope.js";import{P as u}from"./Point2D.js";import{I as c}from"./UnitFactory.js";class m{getOperatorType(){return 10500}accelerateGeometry(e,t,r){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}getNearestCoordinate(s,o,i,a){if(o.isNAN()&&e("NAN xy coordinates are not allowed"),s.isEmpty())return n();switch(s.getGeometryType()){case r.enumPoint:return this.pointGetNearestVertex(s,o);case r.enumMultiPoint:return this.multiVertexGetNearestVertex(s,o);case r.enumPolyline:case r.enumPolygon:return this.multiPathGetNearestCoordinate(s,o,i,a);default:t("")}}getNearestVertex(s,o){if(o.isNAN()&&e("NAN xy coordinates are not allowed"),s.isEmpty())return n();switch(s.getGeometryType()){case r.enumPoint:return this.pointGetNearestVertex(s,o);case r.enumMultiPoint:case r.enumPolyline:case r.enumPolygon:return this.multiVertexGetNearestVertex(s,o);default:t("")}}getNearestVertices(s,n,o,i){if(0===i&&e(""),n.isNAN()&&e("NAN xy coordinates are not allowed"),s.isEmpty())return[];switch(s.getGeometryType()){case r.enumPoint:return this.pointGetNearestVertices(s,n,o,i);case r.enumMultiPoint:case r.enumPolyline:case r.enumPolygon:return this.multiVertexGetNearestVertices(s,n,o,i);default:t("")}}multiPathGetNearestCoordinate(t,n,m,l){if(t.getGeometryType()===r.enumPolygon&&m){const e=new s;t.queryEnvelope(e);const r=a(null,e,!1);let i;if(i=c(t,n,l?0:r),0!==i){const e=o(n,-1,0);return l&&(e.m_bRightSide=!0),e}}const g=t.querySegmentIterator(),y=new u;let N=-1,p=-1,d=Number.MAX_VALUE,f=0;for(;g.nextPath();)for(;g.hasNextSegment();){const e=g.nextSegment(),t=e.getClosestCoordinate(n,!1),r=e.getCoord2D(t),s=u.sqrDistance(r,n);s<d?(f=1,y.assign(r),N=g.getStartPointIndex(),p=g.getPathIndex(),d=s):s===d&&f++}-1===N&&e("");const h=o(y,N,Math.sqrt(d));if(l)if(t.getGeometryType()!==r.enumPolygon){let e=!1;if(f>1){const r=i(t,n,N,p);e=0!==r&&3!==r}else{g.resetToVertex(N,p);const t=g.nextSegment();e=0!==i(t,n)}h.m_bRightSide=e}else if(!m){0!==c(t,n,0)&&(h.m_bRightSide=!0)}return h}pointGetNearestVertex(e,t){const r=e.getXY(),s=u.distance(r,t);return o(r,0,s)}multiVertexGetNearestVertex(e,t){const r=e.getAttributeStreamRef(0),s=e.getPointCount();let n=-1;const i=new u;let a=Number.MAX_VALUE;const c=new u;for(let o=0;o<s;o++){r.queryPoint2D(2*o,c);const e=u.sqrDistance(c,t);e<a&&(i.assign(c),n=o,a=e)}return o(i,n,Math.sqrt(a))}pointGetNearestVertices(e,t,r,s){const n=[];if(0!==s){const s=r*r,i=e.getXY(),a=u.sqrDistance(i,t);a<=s&&n.push(o(i,0,Math.sqrt(a)))}return n}multiVertexGetNearestVertices(e,t,r,s){const n=[];if(0!==s){const i=e.getAttributeStreamRef(0),a=e.getPointCount();n.length=s+1;const c=r*r;for(let e=0;e<a;e++){const r=i.read(2*e),s=i.read(2*e+1),a=t.x-r,m=t.y-s,l=a*a+m*m;l<=c&&n.push(o(u.construct(r,s),e,Math.sqrt(l)))}n.sort((e,t)=>e.m_distance-t.m_distance)}return n.slice(0,s)}}export{m as O};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{a as n,G as s,j as o,t as r,d as i,g as a}from"./Geometry.js";import{m as c,a as m,c as l}from"./SideCalculator2D-DX0718xq.js";import{P as u,b as g,S as f,s as y}from"./MultiPathImpl.js";import{P as S,d,c as N,m as x}from"./Point2D.js";import{P as h,k as p}from"./Envelope.js";import{G as A}from"./GeometryCursor.js";import{O as C,N as P,as as w,ao as E,az as _,aA as T,aB as j,av as G,r as I,aC as D,aD as v,aE as b,ag as R,ah as U,aF as q,aG as F}from"./UnitFactory.js";import{O as k}from"./OperatorShapePreservingDensify.js";class B{getOperatorType(){return 10501}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}getNearestCoordinate(e,t,y,d,N,x){if(t.isNAN()&&n("NAN xy coordinates are not allowed"),e.isEmpty())return c();if(Number.isNaN(d)&&(d=0),d>=0||n("maxDeviationMeters"),0===e.getDimension())return this.getNearestVertex(e,t,y);const A=e.getGeometryType();if(A===s.enumGeometryCollection){const n=e;let s=c();for(let e=0,o=n.getGeometryCount();e<o;++e){const o=n.getGeometry(e),r=this.getNearestCoordinate(o,t,y,d,N,x);if(!r.isEmpty()){if(0===r.m_distance)return r;r.m_distance>=s.m_distance||(s=r,s.m_geometryIndex=e)}}return s}if(A===s.enumEnvelope){const n=new u;return n.addEnvelope(e,!1),this.getNearestCoordinate(n,t,y,d,N,x)}o(A)||r("Operation is not implemented for this geometry type");const D=e;if((N||x)&&A===s.enumPolygon){const n=()=>{const e=m(t,-1,0);return e.m_bRightSide=!0,e};if(y.isPannable()){const s=(new C).foldInto360Range(new h(t),y);if(s.isEmpty())return c();const o=(new C).foldInto360Range(e,y);if(o.isEmpty())return c();if((new P).execute(o,s,y,null)&&N)return n()}else{const e=(new C).clipToSpatialReference(new h(t),y,null,1);if(e.isEmpty())return c();const s=w(D,y,0,null);if(s.isEmpty())return c();if((new P).execute(s,e,y,null)&&N)return n()}}const v=y!==y.getGCS()?y.getSRToGCSTransform():null,b=new S;if(v?(new C).transform(v,[t],1,[b],!1):b.assign(t),b.isNAN())return c();const R=V(D,t,y,1);let U=R.m_distance;if(0===U)return R;Number.isNaN(U)?U=Number.POSITIVE_INFINITY:U*=1+1e-7;const q=y.getGCS(),F=q.getUnit().getUnitToBaseFactor(),B=b.clone();B.scale(F);const O=I();y.querySpheroidData(O);const Y=E(O.majorSemiAxis,O.e2,B),L=_(O.majorSemiAxis,O.e2),z=new M(D.querySegmentIterator());0===d&&(d=.01);const H=O.majorSemiAxis*g(45),J=(new k).executeMany(z,y,H,d,0,null),K=[];let Q=-1;const W=new p,Z=new f;for(let n=J.next();null!==n;n=J.next()){if(n.isEmpty())continue;const t=J.getGeometryID(),s=e.getPathIndexFromPointIndex(t);e.isClosedPath(s)&&D.getPathEnd(s);const o=n;for(let e=0,n=o.getPathCount();e<n;++e){K.length=0;for(let t=o.getPathStart(e),r=o.getPathEnd(e);t<r;++t)K.push(o.getXY(t));if(v&&(new C).transform(v,K,K.length,K,!1),K.length>3){const e=X(K,K.length,b,q,1);if(e.m_distance<U){U=e.m_distance,W.assign(E(O.majorSemiAxis,O.e2,e.m_coordinate.mul(F))),Q=t;let n=e.m_vertexIndex;n+1===K.length&&(n-=1),o.getSegmentBuffer(n,Z,!0)}}K.forEach(e=>e.mulThis(F));const n=E(O.majorSemiAxis,O.e2,K[0]),s=new p;for(let e=1,r=K.length;e<r;++e){const r=E(O.majorSemiAxis,O.e2,K[e]);if(T(L,Y,n,r,s)<U){const{second:s}=j(O.majorSemiAxis,O.e2,Y,n,r,2,null);if(s<=U){const s=new p,{second:i}=j(O.majorSemiAxis,O.e2,Y,n,r,0,s);i<U&&(U=i,W.assign(s),Q=t,o.getSegmentBuffer(e-1,Z,!0))}}n.assign(r)}}}if(!Number.isFinite(U))return c();-1===Q&&n("");const $=G(O.majorSemiAxis,O.e2,W);$.divThis(F);const ee=$.clone(),te=y!==y.getGCS()?y.getGCSToSRTransform():null;te&&(new C).transform(te,[$],1,[ee],!1),ee.isNAN()&&i("closestPoint2DSr.isNAN()"),a(!Z.empty());const ne=Z.get().getClosestCoordinate(ee,!1);ee.assign(Z.get().getCoord2D(ne)),v?(new C).transform(v,[ee],1,[$],!1):$.assign(ee),a(!$.isNAN());const se=this.getNearestVertex(new h($),b,y.getGCS()),oe=m(ee,Q,se.m_distance);if(x&&e.getDimension()>0){const n=l(e,t,-1,-1),s=0!==n&&3!==n;oe.m_bRightSide=s}return oe}getNearestVertex(e,t,o){if(t.isNAN()&&n("NAN xy coordinates are not allowed"),e.isEmpty())return c();switch(e.getGeometryType()){case s.enumPoint:return O(e,t,o);case s.enumMultiPoint:case s.enumPolyline:case s.enumPolygon:return V(e,t,o);default:r("")}}getNearestVertexPoint2D(e,t,n,s){return X(e,t,n,s)}getNearestVertices(e,t,o,i,a){if(t.isNAN()&&n("NAN xy coordinates are not allowed"),e.isEmpty())return[];switch(e.getGeometryType()){case s.enumPoint:{const n=O(e,t,o);if(!n.isEmpty()&&n.m_distance<i&&a>=1){const e=[];return e.push(n),e}return[]}case s.enumMultiPoint:case s.enumPolyline:case s.enumPolygon:return Y(e,t,o,i,a);default:r("")}}}function O(s,o,r){const i={stack:[],error:void 0,hasError:!1};try{if(0===r.getCoordinateSystemType()&&n("Cannot use local SR"),1!==r.getCoordinateSystemType()){const e=new Array(2);e[0]=s.getXY(),e[1]=o.clone();const t=x(S,2);2!==q(r,e,2,t)&&n("Point cannot be projected to GCS");const i=r.getGCS(),a=O(new h(t[0]),t[1],i);return m(a.m_coordinate,0,a.m_distance)}const t=r.getUnit().getUnitToBaseFactor(),a=s.getXY();a.scale(t);const c=o.clone();c.scale(t);const l=I();r.querySpheroidData(l);const u=e(i,new R,!1);U.geodeticDistance(l.majorSemiAxis,l.e2,a.x,a.y,c.x,c.y,u,null,null,F.PE_LINETYPE_GEODESIC);const g=s.getXY();return m(g,0,u.val)}catch(a){i.error=a,i.hasError=!0}finally{t(i)}}function V(s,o,r,i=0){0===r.getCoordinateSystemType()&&n("Cannot use local SR");let a=s.getAttributeStreamRef(0),c=s.getPointCount();const l=r.getGCS(),u=o.clone();if(1!==r.getCoordinateSystemType()){const e=r.getSRToGCSTransform();if(D(e,[o],1,[u],null),u.isNAN())return m(S.getNAN(),-1,Number.NaN);const t=(new C).execute(s,e,null);a=t.getAttributeStreamRef(0),c=t.getPointCount()}const g=l.getUnit().getUnitToBaseFactor(),f=d(c,0);for(let e=0;e<c;++e)f[e]=e;y(c,f);const x=I();l.querySpheroidData(x);const h=u.clone();h.scale(g);const A=E(x.majorSemiAxis,x.e2,h);let P=-1,w=Number.MAX_VALUE;const _=v(x.majorSemiAxis,x.e2);let T=c;const j=new S,G=new S;for(let e=0;e<T;){if(a.queryPoint2D(2*f[e],j),j.isNAN())continue;G.assign(j),G.scale(g);const t=E(x.majorSemiAxis,x.e2,G);if(p.distance(t,A)>w){f[T-1]=N(f[e],f[e]=f[T-1]),T--;continue}const n=b(_,t,A);n<w&&(P=f[e],w=n),e++}if(0!==x.e2){const n={stack:[],error:void 0,hasError:!1};try{const t=e(n,new R,!1);for(let e=0;e<T;e++){if(a.queryPoint2D(2*f[e],j),j.isNAN())continue;G.assign(j),G.scale(g);const n=E(x.majorSemiAxis,x.e2,G);p.distance(n,A)>w||(U.geodeticDistance(x.majorSemiAxis,x.e2,h.x,h.y,G.x,G.y,t,null,null,i),t.val<w&&(P=f[e],w=t.val))}}catch(F){n.error=F,n.hasError=!0}finally{t(n)}}const q=new S;return-1!==P&&q.assign(s.getXY(P)),m(q,P,w)}function X(s,o,r,i,a=0){0===i.getCoordinateSystemType()&&n("Cannot use local SR");const l=i.getGCS(),u=r.clone();if(1!==i.getCoordinateSystemType()){const e=i.getSRToGCSTransform();if(D(e,[r],1,[u],null),u.isNAN())return c();const t=x(S,o);D(e,s,o,t,null);const n=X(t,o,r,l,a);return n.isEmpty()?n:m(s[n.m_vertexIndex],n.m_vertexIndex,n.m_distance)}const g=l.getUnit().getUnitToBaseFactor(),f=d(o,0);for(let e=0;e<o;++e)f[e]=e;y(o,f);const h=I();l.querySpheroidData(h);const A=u.clone();A.scale(g);const C=E(h.majorSemiAxis,h.e2,A);let P=-1,w=Number.MAX_VALUE;const _=v(h.majorSemiAxis,h.e2);let T=o;for(let e=0;e<T;){const t=s[f[e]];if(t.isNAN())continue;const n=t.clone();n.scale(g);const o=E(h.majorSemiAxis,h.e2,n);if(p.distance(o,C)>w){f[T-1]=N(f[e],f[e]=f[T-1]),T--;continue}const r=b(_,o,C);r<w&&(P=f[e],w=r),e++}if(0!==h.e2){const n={stack:[],error:void 0,hasError:!1};try{const t=e(n,new R,!1);for(let e=0;e<T;e++){const n=s[f[e]];if(n.isNAN())continue;const o=n.clone();o.scale(g);const r=E(h.majorSemiAxis,h.e2,o);p.distance(r,C)>w||(U.geodeticDistance(h.majorSemiAxis,h.e2,A.x,A.y,o.x,o.y,t,null,null,a),t.val<w&&(P=f[e],w=t.val))}}catch(G){n.error=G,n.hasError=!0}finally{t(n)}}const j=new S;return-1!==P&&j.assign(s[P]),m(j,P,w)}function Y(s,o,r,i,a){const c={stack:[],error:void 0,hasError:!1};try{0===r.getCoordinateSystemType()&&n("Cannot use local SR");let t=s.getAttributeStreamRef(0),l=s.getPointCount();const u=r.getGCS(),g=o.clone();if(1!==r.getCoordinateSystemType()){const e=r.getSRToGCSTransform();if(D(e,[o],1,[g],null),g.isNAN())return[];const n=(new C).execute(s,e,null);t=n.getAttributeStreamRef(0),l=n.getPointCount()}const f=u.getUnit().getUnitToBaseFactor(),x=d(l,0);for(let e=0;e<l;++e)x[e]=e;y(l,x);const h=I();u.querySpheroidData(h);const A=g.clone();A.scale(f);const P=E(h.majorSemiAxis,h.e2,A),w=[];let _=l;const T=new S,j=new S;for(let e=0;e<_;){if(t.queryPoint2D(2*x[e],T),T.isNAN())continue;j.assign(T),j.scale(f);const n=E(h.majorSemiAxis,h.e2,j);p.distance(n,P)>i?(x[_-1]=N(x[e],x[e]=x[_-1]),_--):e++}const G=(e,t)=>e.m_distance-t.m_distance,v=e(c,new R,!1);for(let e=0;e<_;e++)t.queryPoint2D(2*x[e],T),T.isNAN()||(U.geodeticDistance(h.majorSemiAxis,h.e2,A.x,A.y,T.x*f,T.y*f,v,null,null,F.PE_LINETYPE_GEODESIC),v.val<i&&w.push(m(T,x[e],v.val)));return w.sort(G),w.slice(0,a)}catch(l){c.error=l,c.hasError=!0}finally{t(c)}}class M extends A{m_segIter;m_first=!0;constructor(e){super(),this.m_segIter=e,this.m_segIter.stripAttributes()}tock(){return!0}getRank(){return 1}next(){if(this.m_first){if(!this.m_segIter.nextPath())return null;this.m_first=!1}for(;;){if(this.m_segIter.hasNextSegment())return this.m_segIter.nextSegment().clone();if(!this.m_segIter.nextPath())break}return null}getGeometryID(){return this.m_segIter.getStartPointIndex()}}export{B as OperatorProximityGeodesic};
2
+ import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{a as n,G as s,j as o,t as r,d as i,g as a}from"./Geometry.js";import{m as c,a as m,c as l}from"./SideCalculator2D-DX0718xq.js";import{P as u,b as g,S as f,s as y}from"./MultiPathImpl.js";import{P as S,d,c as N,m as x}from"./Point2D.js";import{P as p,k as h}from"./Envelope.js";import{G as A}from"./GeometryCursor.js";import{O as C,U as P,au as w,aq as E,aB as _,aC as j,aD as T,ax as G,r as I,aE as D,aF as v,aG as b,ai as R,aj as U,aH as q,aI as F}from"./UnitFactory.js";import{O as k}from"./OperatorShapePreservingDensify.js";class B{getOperatorType(){return 10501}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}getNearestCoordinate(e,t,y,d,N,x){if(t.isNAN()&&n("NAN xy coordinates are not allowed"),e.isEmpty())return c();if(Number.isNaN(d)&&(d=0),d>=0||n("maxDeviationMeters"),0===e.getDimension())return this.getNearestVertex(e,t,y);const A=e.getGeometryType();if(A===s.enumGeometryCollection){const n=e;let s=c();for(let e=0,o=n.getGeometryCount();e<o;++e){const o=n.getGeometry(e),r=this.getNearestCoordinate(o,t,y,d,N,x);if(!r.isEmpty()){if(0===r.m_distance)return r;r.m_distance>=s.m_distance||(s=r,s.m_geometryIndex=e)}}return s}if(A===s.enumEnvelope){const n=new u;return n.addEnvelope(e,!1),this.getNearestCoordinate(n,t,y,d,N,x)}o(A)||r("Operation is not implemented for this geometry type");const D=e;if((N||x)&&A===s.enumPolygon){const n=()=>{const e=m(t,-1,0);return e.m_bRightSide=!0,e};if(y.isPannable()){const s=(new C).foldInto360Range(new p(t),y);if(s.isEmpty())return c();const o=(new C).foldInto360Range(e,y);if(o.isEmpty())return c();if((new P).execute(o,s,y,null)&&N)return n()}else{const e=(new C).clipToSpatialReference(new p(t),y,null,1);if(e.isEmpty())return c();const s=w(D,y,0,null);if(s.isEmpty())return c();if((new P).execute(s,e,y,null)&&N)return n()}}const v=y!==y.getGCS()?y.getSRToGCSTransform():null,b=new S;if(v?(new C).transform(v,[t],1,[b],!1):b.assign(t),b.isNAN())return c();const R=V(D,t,y,1);let U=R.m_distance;if(0===U)return R;Number.isNaN(U)?U=Number.POSITIVE_INFINITY:U*=1+1e-7;const q=y.getGCS(),F=q.getUnit().getUnitToBaseFactor(),B=b.clone();B.scale(F);const O=I();y.querySpheroidData(O);const Y=E(O.majorSemiAxis,O.e2,B),L=_(O.majorSemiAxis,O.e2),H=new M(D.querySegmentIterator());0===d&&(d=.01);const z=O.majorSemiAxis*g(45),J=(new k).executeMany(H,y,z,d,0,null),K=[];let Q=-1;const W=new h,Z=new f;for(let n=J.next();null!==n;n=J.next()){if(n.isEmpty())continue;const t=J.getGeometryID(),s=e.getPathIndexFromPointIndex(t);e.isClosedPath(s)&&D.getPathEnd(s);const o=n;for(let e=0,n=o.getPathCount();e<n;++e){K.length=0;for(let t=o.getPathStart(e),r=o.getPathEnd(e);t<r;++t)K.push(o.getXY(t));if(v&&(new C).transform(v,K,K.length,K,!1),K.length>3){const e=X(K,K.length,b,q,1);if(e.m_distance<U){U=e.m_distance,W.assign(E(O.majorSemiAxis,O.e2,e.m_coordinate.mul(F))),Q=t;let n=e.m_vertexIndex;n+1===K.length&&(n-=1),o.getSegmentBuffer(n,Z,!0)}}K.forEach(e=>e.mulThis(F));const n=E(O.majorSemiAxis,O.e2,K[0]),s=new h;for(let e=1,r=K.length;e<r;++e){const r=E(O.majorSemiAxis,O.e2,K[e]);if(j(L,Y,n,r,s)<U){const{second:s}=T(O.majorSemiAxis,O.e2,Y,n,r,2,null);if(s<=U){const s=new h,{second:i}=T(O.majorSemiAxis,O.e2,Y,n,r,0,s);i<U&&(U=i,W.assign(s),Q=t,o.getSegmentBuffer(e-1,Z,!0))}}n.assign(r)}}}if(!Number.isFinite(U))return c();-1===Q&&n("");const $=G(O.majorSemiAxis,O.e2,W);$.divThis(F);const ee=$.clone(),te=y!==y.getGCS()?y.getGCSToSRTransform():null;te&&(new C).transform(te,[$],1,[ee],!1),ee.isNAN()&&i("closestPoint2DSr.isNAN()"),a(!Z.empty());const ne=Z.get().getClosestCoordinate(ee,!1);ee.assign(Z.get().getCoord2D(ne)),v?(new C).transform(v,[ee],1,[$],!1):$.assign(ee),a(!$.isNAN());const se=this.getNearestVertex(new p($),b,y.getGCS()),oe=m(ee,Q,se.m_distance);if(x&&e.getDimension()>0){const n=l(e,t,-1,-1),s=0!==n&&3!==n;oe.m_bRightSide=s}return oe}getNearestVertex(e,t,o){if(t.isNAN()&&n("NAN xy coordinates are not allowed"),e.isEmpty())return c();switch(e.getGeometryType()){case s.enumPoint:return O(e,t,o);case s.enumMultiPoint:case s.enumPolyline:case s.enumPolygon:return V(e,t,o);default:r("")}}getNearestVertexPoint2D(e,t,n,s){return X(e,t,n,s)}getNearestVertices(e,t,o,i,a){if(t.isNAN()&&n("NAN xy coordinates are not allowed"),e.isEmpty())return[];switch(e.getGeometryType()){case s.enumPoint:{const n=O(e,t,o);if(!n.isEmpty()&&n.m_distance<i&&a>=1){const e=[];return e.push(n),e}return[]}case s.enumMultiPoint:case s.enumPolyline:case s.enumPolygon:return Y(e,t,o,i,a);default:r("")}}}function O(s,o,r){const i={stack:[],error:void 0,hasError:!1};try{if(0===r.getCoordinateSystemType()&&n("Cannot use local SR"),1!==r.getCoordinateSystemType()){const e=new Array(2);e[0]=s.getXY(),e[1]=o.clone();const t=x(S,2);2!==q(r,e,2,t)&&n("Point cannot be projected to GCS");const i=r.getGCS(),a=O(new p(t[0]),t[1],i);return m(a.m_coordinate,0,a.m_distance)}const t=r.getUnit().getUnitToBaseFactor(),a=s.getXY();a.scale(t);const c=o.clone();c.scale(t);const l=I();r.querySpheroidData(l);const u=e(i,new R,!1);U.geodeticDistance(l.majorSemiAxis,l.e2,a.x,a.y,c.x,c.y,u,null,null,F.PE_LINETYPE_GEODESIC);const g=s.getXY();return m(g,0,u.val)}catch(a){i.error=a,i.hasError=!0}finally{t(i)}}function V(s,o,r,i=0){0===r.getCoordinateSystemType()&&n("Cannot use local SR");let a=s.getAttributeStreamRef(0),c=s.getPointCount();const l=r.getGCS(),u=o.clone();if(1!==r.getCoordinateSystemType()){const e=r.getSRToGCSTransform();if(D(e,[o],1,[u],null),u.isNAN())return m(S.getNAN(),-1,Number.NaN);const t=(new C).execute(s,e,null);a=t.getAttributeStreamRef(0),c=t.getPointCount()}const g=l.getUnit().getUnitToBaseFactor(),f=d(c,0);for(let e=0;e<c;++e)f[e]=e;y(c,f);const x=I();l.querySpheroidData(x);const p=u.clone();p.scale(g);const A=E(x.majorSemiAxis,x.e2,p);let P=-1,w=Number.MAX_VALUE;const _=v(x.majorSemiAxis,x.e2);let j=c;const T=new S,G=new S;for(let e=0;e<j;){if(a.queryPoint2D(2*f[e],T),T.isNAN())continue;G.assign(T),G.scale(g);const t=E(x.majorSemiAxis,x.e2,G);if(h.distance(t,A)>w){f[j-1]=N(f[e],f[e]=f[j-1]),j--;continue}const n=b(_,t,A);n<w&&(P=f[e],w=n),e++}if(0!==x.e2){const n={stack:[],error:void 0,hasError:!1};try{const t=e(n,new R,!1);for(let e=0;e<j;e++){if(a.queryPoint2D(2*f[e],T),T.isNAN())continue;G.assign(T),G.scale(g);const n=E(x.majorSemiAxis,x.e2,G);h.distance(n,A)>w||(U.geodeticDistance(x.majorSemiAxis,x.e2,p.x,p.y,G.x,G.y,t,null,null,i),t.val<w&&(P=f[e],w=t.val))}}catch(F){n.error=F,n.hasError=!0}finally{t(n)}}const q=new S;return-1!==P&&q.assign(s.getXY(P)),m(q,P,w)}function X(s,o,r,i,a=0){0===i.getCoordinateSystemType()&&n("Cannot use local SR");const l=i.getGCS(),u=r.clone();if(1!==i.getCoordinateSystemType()){const e=i.getSRToGCSTransform();if(D(e,[r],1,[u],null),u.isNAN())return c();const t=x(S,o);D(e,s,o,t,null);const n=X(t,o,r,l,a);return n.isEmpty()?n:m(s[n.m_vertexIndex],n.m_vertexIndex,n.m_distance)}const g=l.getUnit().getUnitToBaseFactor(),f=d(o,0);for(let e=0;e<o;++e)f[e]=e;y(o,f);const p=I();l.querySpheroidData(p);const A=u.clone();A.scale(g);const C=E(p.majorSemiAxis,p.e2,A);let P=-1,w=Number.MAX_VALUE;const _=v(p.majorSemiAxis,p.e2);let j=o;for(let e=0;e<j;){const t=s[f[e]];if(t.isNAN())continue;const n=t.clone();n.scale(g);const o=E(p.majorSemiAxis,p.e2,n);if(h.distance(o,C)>w){f[j-1]=N(f[e],f[e]=f[j-1]),j--;continue}const r=b(_,o,C);r<w&&(P=f[e],w=r),e++}if(0!==p.e2){const n={stack:[],error:void 0,hasError:!1};try{const t=e(n,new R,!1);for(let e=0;e<j;e++){const n=s[f[e]];if(n.isNAN())continue;const o=n.clone();o.scale(g);const r=E(p.majorSemiAxis,p.e2,o);h.distance(r,C)>w||(U.geodeticDistance(p.majorSemiAxis,p.e2,A.x,A.y,o.x,o.y,t,null,null,a),t.val<w&&(P=f[e],w=t.val))}}catch(G){n.error=G,n.hasError=!0}finally{t(n)}}const T=new S;return-1!==P&&T.assign(s[P]),m(T,P,w)}function Y(s,o,r,i,a){const c={stack:[],error:void 0,hasError:!1};try{0===r.getCoordinateSystemType()&&n("Cannot use local SR");let t=s.getAttributeStreamRef(0),l=s.getPointCount();const u=r.getGCS(),g=o.clone();if(1!==r.getCoordinateSystemType()){const e=r.getSRToGCSTransform();if(D(e,[o],1,[g],null),g.isNAN())return[];const n=(new C).execute(s,e,null);t=n.getAttributeStreamRef(0),l=n.getPointCount()}const f=u.getUnit().getUnitToBaseFactor(),x=d(l,0);for(let e=0;e<l;++e)x[e]=e;y(l,x);const p=I();u.querySpheroidData(p);const A=g.clone();A.scale(f);const P=E(p.majorSemiAxis,p.e2,A),w=[];let _=l;const j=new S,T=new S;for(let e=0;e<_;){if(t.queryPoint2D(2*x[e],j),j.isNAN())continue;T.assign(j),T.scale(f);const n=E(p.majorSemiAxis,p.e2,T);h.distance(n,P)>i?(x[_-1]=N(x[e],x[e]=x[_-1]),_--):e++}const G=(e,t)=>e.m_distance-t.m_distance,v=e(c,new R,!1);for(let e=0;e<_;e++)t.queryPoint2D(2*x[e],j),j.isNAN()||(U.geodeticDistance(p.majorSemiAxis,p.e2,A.x,A.y,j.x*f,j.y*f,v,null,null,F.PE_LINETYPE_GEODESIC),v.val<i&&w.push(m(j,x[e],v.val)));return w.sort(G),w.slice(0,a)}catch(l){c.error=l,c.hasError=!0}finally{t(c)}}class M extends A{m_segIter;m_first=!0;constructor(e){super(),this.m_segIter=e,this.m_segIter.stripAttributes()}tock(){return!0}getRank(){return 1}next(){if(this.m_first){if(!this.m_segIter.nextPath())return null;this.m_first=!1}for(;;){if(this.m_segIter.hasNextSegment())return this.m_segIter.nextSegment().clone();if(!this.m_segIter.nextPath())break}return null}getGeometryID(){return this.m_segIter.getStartPointIndex()}}export{B as OperatorProximityGeodesic};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as e,G as t,h as s,d as n}from"./Geometry.js";import{aw as o,V as r,y as a,r as i,ao as m}from"./UnitFactory.js";import{P as c,a as g}from"./MultiPathImpl.js";import{q as u,d as p,P as h}from"./Point2D.js";import{k as y}from"./Envelope.js";import{Envelope2D as l}from"./Envelope2D.js";import{O as f}from"./OperatorDensify.js";import{O as _}from"./OperatorClip.js";function x(){return{m_pGcs:new h,m_xyz:new y,m_factor:Number.NaN,m_geoLength:Number.NaN,setValues:d,setLength:P,assign:S}}function d(e,t,s,n){this.m_factor=e,this.m_pGcs.assign(t),this.m_xyz.assign(n),this.m_geoLength=s}function P(e){this.m_geoLength=e}function S(e){this.m_pGcs.assign(e.m_pGcs),this.m_xyz.assign(e.m_xyz),this.m_factor=e.m_factor,this.m_geoLength=e.m_geoLength}class w{getOperatorType(){return 10315}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}_ExecuteShapePreservingLength(e,t,s,n,a){if(e.hasNonLinearSegments()){e=(new f).execute(e,0,t.getTolerance(0),0,a)}if(t.isPannable()){let n=90,r=-90;if(1===s.getUnit().getUnitToBaseFactor()&&(n*=Math.PI/180,r*=Math.PI/180),2===t.getCoordinateSystemType()){let e=null;const s=[0,0,0,0];e=t.getPECoordSys(),s[0]=0,s[1]=n,s[2]=0,s[3]=r,o.geogToProj(e,2,s),n=s[1],r=s[3]}const i=new l;e.queryEnvelope(i),i.ymin=r,i.ymax=n,e=(new _).execute(e,i,t,a)}else{const s=t.getPCSHorizon();if((e=(new r).execute(e,s,t,a))===s){const t=e.clone();e=t}}return e.isEmpty()?0:this._ExecuteIterativeApproach(e,t,s,n,1,a)}_ExecuteIterativeApproach(e,t,s,r,a,m){const c=i();s.querySpheroidData(c);const g=c.majorSemiAxis,l=c.e2,f=s.getUnit().getUnitToBaseFactor(),_=40,d=u(x,_),P=p(_,Number.NaN),S=x(),w=x();let E;const G=[0,0,0,0],L=t.getPECoordSys(),j=new h,v=new h,T=new h,D=new h,b=new h;let z=0;const I=e.querySegmentIterator();for(;I.nextPath();)for(;I.hasNextSegment();){const e=I.nextSegment();j.assign(e.getStartXY()),v.assign(e.getEndXY()),2===t.getCoordinateSystemType()?(G[0]=j.x,G[1]=j.y,G[2]=v.x,G[3]=v.y,o.projToGeog(L,2,G),T.x=G[0]*f,T.y=G[1]*f,D.x=G[2]*f,D.y=G[3]*f):(T.setCoordsPoint2D(j),D.setCoordsPoint2D(v),T.scale(f),D.scale(f));const s=new y,r=new y;N(g,l,T,s),N(g,l,D,r);let i=C(g,s,r);S.setValues(0,T,Number.NaN,s),w.setValues(1,D,i,r),E=a,d[0].assign(w),P[0]=a;let m=0;for(;;){m>128&&n("iterations exceeded");const s=.5*(S.m_factor+w.m_factor),r=e.getCoord2D(s);2===t.getCoordinateSystemType()?(G[0]=r.x,G[1]=r.y,o.projToGeog(L,1,G),b.x=G[0]*f,b.y=G[1]*f):(b.setCoordsPoint2D(r),b.scale(f)),T.setCoordsPoint2D(S.m_pGcs),D.setCoordsPoint2D(w.m_pGcs);const c=new y;N(g,l,b,c);const u=C(g,S.m_xyz,c),p=C(g,w.m_xyz,c);i=w.m_geoLength,Number.isNaN(i)&&(i=C(g,S.m_xyz,w.m_xyz));const h=u+p,x=E===a&&h>=20&&Math.abs(h-i)>1e-8*(i+h);if(m+2<_&&(x||Math.abs(h-i)>0&&E>0))w.setLength(p),d[m].assign(w),w.setValues(s,b,u,c),d[++m].assign(w),x?(E=a,P[m]=a):(E--,P[m-1]=E,P[m]=E);else{if(z+=h,0===m)break;S.assign(w),w.assign(d[--m]),E=P[m]}}}return z}execute(n,o,r){if(o&&0!==o.getCoordinateSystemType()||e(""),n.isEmpty()||n.getDimension()<1)return 0;let i=null;const m=o.getGCS();m!==o&&(i=a(o,m,null));const u=n.getGeometryType();if(u===t.enumEnvelope){const e=new c;return e.addEnvelope(n,!1),this._ExecuteShapePreservingLength(e,o,m,i,r)}if(s(u)){const e=new g;return e.addSegment(n,!0),this._ExecuteShapePreservingLength(e,o,m,i,r)}return this._ExecuteShapePreservingLength(n,o,m,i,r)}}function N(e,t,s,n){n.assign(m(e,t,s))}function C(e,t,s){const n=e,o=new y;o.setSub(t,s);const r=o.length();return 2*n*Math.asin(r/(2*n))}export{w as O};
2
+ import{a as e,G as t,h as s,d as n}from"./Geometry.js";import{ay as o,Z as r,B as a,r as i,aq as m}from"./UnitFactory.js";import{P as c,a as g}from"./MultiPathImpl.js";import{q as u,d as p,P as h}from"./Point2D.js";import{k as y}from"./Envelope.js";import{Envelope2D as l}from"./Envelope2D.js";import{O as f}from"./OperatorDensify.js";import{O as _}from"./OperatorClip.js";function x(){return{m_pGcs:new h,m_xyz:new y,m_factor:Number.NaN,m_geoLength:Number.NaN,setValues:d,setLength:P,assign:S}}function d(e,t,s,n){this.m_factor=e,this.m_pGcs.assign(t),this.m_xyz.assign(n),this.m_geoLength=s}function P(e){this.m_geoLength=e}function S(e){this.m_pGcs.assign(e.m_pGcs),this.m_xyz.assign(e.m_xyz),this.m_factor=e.m_factor,this.m_geoLength=e.m_geoLength}class w{getOperatorType(){return 10315}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}_ExecuteShapePreservingLength(e,t,s,n,a){if(e.hasNonLinearSegments()){e=(new f).execute(e,0,t.getTolerance(0),0,a)}if(t.isPannable()){let n=90,r=-90;if(1===s.getUnit().getUnitToBaseFactor()&&(n*=Math.PI/180,r*=Math.PI/180),2===t.getCoordinateSystemType()){let e=null;const s=[0,0,0,0];e=t.getPECoordSys(),s[0]=0,s[1]=n,s[2]=0,s[3]=r,o.geogToProj(e,2,s),n=s[1],r=s[3]}const i=new l;e.queryEnvelope(i),i.ymin=r,i.ymax=n,e=(new _).execute(e,i,t,a)}else{const s=t.getPCSHorizon();if((e=(new r).execute(e,s,t,a))===s){const t=e.clone();e=t}}return e.isEmpty()?0:this._ExecuteIterativeApproach(e,t,s,n,1,a)}_ExecuteIterativeApproach(e,t,s,r,a,m){const c=i();s.querySpheroidData(c);const g=c.majorSemiAxis,l=c.e2,f=s.getUnit().getUnitToBaseFactor(),_=40,d=u(x,_),P=p(_,Number.NaN),S=x(),w=x();let E;const G=[0,0,0,0],L=t.getPECoordSys(),j=new h,v=new h,T=new h,D=new h,b=new h;let z=0;const I=e.querySegmentIterator();for(;I.nextPath();)for(;I.hasNextSegment();){const e=I.nextSegment();j.assign(e.getStartXY()),v.assign(e.getEndXY()),2===t.getCoordinateSystemType()?(G[0]=j.x,G[1]=j.y,G[2]=v.x,G[3]=v.y,o.projToGeog(L,2,G),T.x=G[0]*f,T.y=G[1]*f,D.x=G[2]*f,D.y=G[3]*f):(T.setCoordsPoint2D(j),D.setCoordsPoint2D(v),T.scale(f),D.scale(f));const s=new y,r=new y;N(g,l,T,s),N(g,l,D,r);let i=C(g,s,r);S.setValues(0,T,Number.NaN,s),w.setValues(1,D,i,r),E=a,d[0].assign(w),P[0]=a;let m=0;for(;;){m>128&&n("iterations exceeded");const s=.5*(S.m_factor+w.m_factor),r=e.getCoord2D(s);2===t.getCoordinateSystemType()?(G[0]=r.x,G[1]=r.y,o.projToGeog(L,1,G),b.x=G[0]*f,b.y=G[1]*f):(b.setCoordsPoint2D(r),b.scale(f)),T.setCoordsPoint2D(S.m_pGcs),D.setCoordsPoint2D(w.m_pGcs);const c=new y;N(g,l,b,c);const u=C(g,S.m_xyz,c),p=C(g,w.m_xyz,c);i=w.m_geoLength,Number.isNaN(i)&&(i=C(g,S.m_xyz,w.m_xyz));const h=u+p,x=E===a&&h>=20&&Math.abs(h-i)>1e-8*(i+h);if(m+2<_&&(x||Math.abs(h-i)>0&&E>0))w.setLength(p),d[m].assign(w),w.setValues(s,b,u,c),d[++m].assign(w),x?(E=a,P[m]=a):(E--,P[m-1]=E,P[m]=E);else{if(z+=h,0===m)break;S.assign(w),w.assign(d[--m]),E=P[m]}}}return z}execute(n,o,r){if(o&&0!==o.getCoordinateSystemType()||e(""),n.isEmpty()||n.getDimension()<1)return 0;let i=null;const m=o.getGCS();m!==o&&(i=a(o,m,null));const u=n.getGeometryType();if(u===t.enumEnvelope){const e=new c;return e.addEnvelope(n,!1),this._ExecuteShapePreservingLength(e,o,m,i,r)}if(s(u)){const e=new g;return e.addSegment(n,!0),this._ExecuteShapePreservingLength(e,o,m,i,r)}return this._ExecuteShapePreservingLength(n,o,m,i,r)}}function N(e,t,s,n){n.assign(m(e,t,s))}function C(e,t,s){const n=e,o=new y;o.setSub(t,s);const r=o.length();return 2*n*Math.asin(r/(2*n))}export{w as O};