@arcgis/core 4.33.0-next.20250227 → 4.33.0-next.20250301

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 (330) hide show
  1. package/WebLinkChart.js +1 -1
  2. package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +2 -0
  3. package/applications/KnowledgeStudio/generalSharedKgUtils.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{3170552a6310725d7730.js → 05b7c739115be0490583.js} +1 -1
  6. package/assets/esri/core/workers/chunks/066844a51cd22cbef0e6.js +1 -0
  7. package/assets/esri/core/workers/chunks/0ce1bfcdcccb679569f8.js +1 -0
  8. package/assets/esri/core/workers/chunks/0e164b19e4ea3aa73843.js +1 -0
  9. package/assets/esri/core/workers/chunks/12d798775a96a45aada2.js +1 -0
  10. package/assets/esri/core/workers/chunks/{f298cda10a9ffe35ea49.js → 1377ddd582518e5fa051.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{95a5ed95f0060b43f38f.js → 15fe629cd4da1bb2169f.js} +1 -1
  12. package/assets/esri/core/workers/chunks/1a5f96b1b892ecceb36a.js +1 -0
  13. package/assets/esri/core/workers/chunks/{b4002b4fd99748fdf5da.js → 1e631e34ee495eb0e76e.js} +1 -1
  14. package/assets/esri/core/workers/chunks/22618753349eb9d8b3df.js +1 -0
  15. package/assets/esri/core/workers/chunks/25a686f00479ac12a1ca.js +1 -0
  16. package/assets/esri/core/workers/chunks/25ef080163f3f795911a.js +1 -0
  17. package/assets/esri/core/workers/chunks/{afdbdc1569b56489c14d.js → 29fe3e9a0ecab74bb729.js} +1 -1
  18. package/assets/esri/core/workers/chunks/2c091edee3601f345f5f.js +1 -0
  19. package/assets/esri/core/workers/chunks/2c227d97d00b3849f441.js +1 -0
  20. package/assets/esri/core/workers/chunks/2ce80c764cca9e6a20cd.js +1 -0
  21. package/assets/esri/core/workers/chunks/2f23fc27d005ffa18f47.js +1 -0
  22. package/assets/esri/core/workers/chunks/2f818b9a6b1f2b61410d.js +978 -0
  23. package/assets/esri/core/workers/chunks/3010a22d00f45fce5939.js +1 -0
  24. package/assets/esri/core/workers/chunks/{05869484d7de75f86916.js → 33005043f7084048296d.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{835fa4484c58d9b31c78.js → 3315de71eb8791189c05.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{f7a055be225f3498baaf.js → 354117429b3a0a0794c9.js} +1 -1
  27. package/assets/esri/core/workers/chunks/361a3253877acd3b4f07.js +1 -0
  28. package/assets/esri/core/workers/chunks/{53bc621e2cbc519b2535.js → 36b406131cd864567033.js} +1 -1
  29. package/assets/esri/core/workers/chunks/385dd6466fd967ce3ae9.js +1 -0
  30. package/assets/esri/core/workers/chunks/394b9723d108cff7136e.js +1 -0
  31. package/assets/esri/core/workers/chunks/4395b7263a299a8020d4.js +1 -0
  32. package/assets/esri/core/workers/chunks/47c04980098dc0c228d7.js +1 -0
  33. package/assets/esri/core/workers/chunks/{d6ee6ebdaf582f39c14b.js → 4c8164955f8d844c09ee.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{e4d7f1e685f69b3bf54d.js → 4c9160e3d596fe75392d.js} +1 -1
  35. package/assets/esri/core/workers/chunks/534f3d7e4300b662191a.js +1 -0
  36. package/assets/esri/core/workers/chunks/55c7c51e56d72f507c22.js +1 -0
  37. package/assets/esri/core/workers/chunks/5802406d0a239a27a9a3.js +1 -0
  38. package/assets/esri/core/workers/chunks/6ce738960ee47904968f.js +314 -0
  39. package/assets/esri/core/workers/chunks/{b12f2eaa15f6753fa1a8.js → 6ff981ec0c725efe5525.js} +1 -1
  40. package/assets/esri/core/workers/chunks/7ca33e03a2fd217b9443.js +1 -0
  41. package/assets/esri/core/workers/chunks/7d93ff4f18fd21c7b9f2.js +1 -0
  42. package/assets/esri/core/workers/chunks/{983d787730bf8b74fe13.js → 7ec2f531217718e76469.js} +1 -1
  43. package/assets/esri/core/workers/chunks/8196ff250c0de00104f7.js +1 -0
  44. package/assets/esri/core/workers/chunks/{ae25c6108918d37e61bf.js → 8278d9263e9b7e3bf2d1.js} +1 -1
  45. package/assets/esri/core/workers/chunks/852c32b5e717c54e3ae0.js +1 -0
  46. package/assets/esri/core/workers/chunks/856b03020b2dd047291d.js +1 -0
  47. package/assets/esri/core/workers/chunks/85a9025c2990a8bbd61b.js +1 -0
  48. package/assets/esri/core/workers/chunks/8b057b5a606ac3669a78.js +1 -0
  49. package/assets/esri/core/workers/chunks/8bf623f560b1ed440004.js +1 -0
  50. package/assets/esri/core/workers/chunks/8d421e0a01e2c3f6980c.js +1 -0
  51. package/assets/esri/core/workers/chunks/{f27828ba83846d686072.js → 97078a7871e243c19b6b.js} +1 -1
  52. package/assets/esri/core/workers/chunks/a68b48fd1a529f69705e.js +1 -0
  53. package/assets/esri/core/workers/chunks/{272662e4e28341419b4f.js → a73a262ddc959a59819f.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{e118245566be994a53da.js → a901c445d36f1a9e7df8.js} +1 -1
  55. package/assets/esri/core/workers/chunks/a91f2d1deb950f46ad09.js +1 -0
  56. package/assets/esri/core/workers/chunks/{4253438dd3045566892d.js → aba4353892c47de98eb3.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{14cb593dfb50c724b9eb.js → ac6b582ca180210e596c.js} +1 -1
  58. package/assets/esri/core/workers/chunks/af27a3f646a4404d3b8d.js +1 -0
  59. package/assets/esri/core/workers/chunks/{fc07d47d44c04f123650.js → b1e275607d9754079f60.js} +1 -1
  60. package/assets/esri/core/workers/chunks/b3c126e8a0a722c03efc.js +1 -0
  61. package/assets/esri/core/workers/chunks/b464b7800a2ddd92b9a7.js +1 -0
  62. package/assets/esri/core/workers/chunks/b52a3a48d2d3ff22542d.js +1 -0
  63. package/assets/esri/core/workers/chunks/b8416f2560710258c239.js +1 -0
  64. package/assets/esri/core/workers/chunks/be883ebdbaf11647b718.js +1 -0
  65. package/assets/esri/core/workers/chunks/bf9b45604249520b596a.js +1 -0
  66. package/assets/esri/core/workers/chunks/c0400c25c53fd90fc90e.js +1 -0
  67. package/assets/esri/core/workers/chunks/c2939e0c45a6d074cac0.js +1 -0
  68. package/assets/esri/core/workers/chunks/{fccf505dbd98e59e721a.js → c3dc8d1958ddc71e1129.js} +1 -1
  69. package/assets/esri/core/workers/chunks/c68c68e918c72932b247.js +1 -0
  70. package/assets/esri/core/workers/chunks/c8cd9a3175f516624842.js +1 -0
  71. package/assets/esri/core/workers/chunks/cc1aedb2b3aa3854b0de.js +1 -0
  72. package/assets/esri/core/workers/chunks/d374d2a1487faee3672d.js +1 -0
  73. package/assets/esri/core/workers/chunks/d630e64463687090db92.js +1 -0
  74. package/assets/esri/core/workers/chunks/dbdca19978fbee8dc106.js +1 -0
  75. package/assets/esri/core/workers/chunks/ddfb5a2055a36576ba0d.js +1 -0
  76. package/assets/esri/core/workers/chunks/e1a90f63d2e6c761953b.js +1 -0
  77. package/assets/esri/core/workers/chunks/{5b5d89b94e020b4bfcc1.js → e3b0bb6850d5252d5f24.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{4235bb1334c95f3c828d.js → e45404a982e173459990.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{b7a3d9c5d18e59da378f.js → eab1e3c101158675abba.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{8a3290ee6e6587fa39a6.js → ed4afafbcb31491c2049.js} +1 -1
  81. package/assets/esri/core/workers/chunks/ef46613c3aa363dc1cfc.js +1 -0
  82. package/assets/esri/core/workers/chunks/{6c5877e4ad108a6d074e.js → f0351930cbb3d8643119.js} +1 -1
  83. package/assets/esri/core/workers/chunks/f31986ea5cadfade8344.js +1 -0
  84. package/assets/esri/core/workers/chunks/f350aefc5e348ebad1da.js +1 -0
  85. package/assets/esri/core/workers/chunks/{a2e52b40eeeda4282c07.js → f70dd16f14279bb7e60d.js} +1 -1
  86. package/assets/esri/core/workers/chunks/f995a74bd9b58c069c07.js +1 -0
  87. package/assets/esri/core/workers/chunks/{7437b7423c8b7fb4f0dd.js → fe3ed029b07bb1e4aef3.js} +1 -1
  88. package/assets/esri/core/workers/chunks/{e6e6247ea5ce0c2b125f.js → fe8ee1938d196a70d809.js} +1 -1
  89. package/assets/esri/themes/base/widgets/_LabeledSwitch.scss +0 -2
  90. package/assets/esri/themes/base/widgets/_Sketch.scss +4 -4
  91. package/assets/esri/themes/dark/main.css +1 -1
  92. package/assets/esri/themes/light/main.css +1 -1
  93. package/assets/esri/themes/light/view.css +1 -1
  94. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
  95. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
  96. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
  97. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
  98. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
  99. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
  100. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
  101. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
  102. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
  103. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
  104. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
  105. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
  106. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
  107. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
  108. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
  109. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
  110. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
  111. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
  112. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
  113. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
  114. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
  115. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
  116. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
  117. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
  118. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
  119. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
  120. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
  121. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
  122. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
  123. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
  124. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
  125. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
  126. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
  127. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
  128. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
  129. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
  130. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
  131. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
  132. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
  133. package/chunks/Envelope.js +1 -1
  134. package/chunks/{GeodeticDistanceCalculator-D4iQ-_NX.js → GeodeticDistanceCalculator-CcF1gMZX.js} +1 -1
  135. package/chunks/LineSeries.js +1 -1
  136. package/chunks/OperatorGeodeticArea.js +1 -1
  137. package/chunks/OperatorGeodeticDistance.js +1 -1
  138. package/chunks/OperatorProximityGeodesic.js +1 -1
  139. package/chunks/Point2D.js +1 -1
  140. package/chunks/ProjectionTransformation.js +1 -1
  141. package/chunks/QuadraticBezier.js +1 -1
  142. package/chunks/Theme.js +1 -1
  143. package/chunks/chartUtilsAm5.js +1 -1
  144. package/chunks/distanceOperator.js +1 -1
  145. package/core/timeUtils.js +1 -1
  146. package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
  147. package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
  148. package/editing/sharedTemplates/support/sharedTemplateErrors.js +1 -1
  149. package/editing/sharedTemplates/templateDefinitions/GroupTemplateDefinition.js +1 -1
  150. package/editing/templateUtils.js +1 -1
  151. package/geometry/operators/extendOperator.js +1 -1
  152. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  153. package/geometry/operators/gx/operatorBuffer.js +1 -1
  154. package/geometry/operators/gx/operatorConvexHull.js +1 -1
  155. package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
  156. package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
  157. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  158. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  159. package/geometry/operators/isNearOperator.js +1 -1
  160. package/geometry/operators/support/jsonConverter.js +1 -1
  161. package/geometry/support/PolylineBuilder.js +5 -0
  162. package/geometry/support/TileClipper.js +1 -1
  163. package/interfaces.d.ts +26 -24
  164. package/intl/date.js +1 -1
  165. package/intl/duration.js +1 -1
  166. package/intl/locale.js +1 -1
  167. package/intl/messages.js +1 -1
  168. package/layers/BingMapsLayer.js +1 -1
  169. package/layers/LinkChartLayer.js +1 -1
  170. package/layers/graphics/sources/WFSSource.js +1 -1
  171. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  172. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  173. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  174. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  175. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  176. package/layers/mixins/ImageryTileMixin.js +1 -1
  177. package/layers/mixins/SublayersOwner.js +1 -1
  178. package/layers/ogc/ogcFeatureUtils.js +1 -1
  179. package/layers/support/FieldsIndex.js +1 -1
  180. package/layers/support/rasterDatasets/covJSONParser.js +1 -1
  181. package/layers/support/rasterFunctions/RemapFunction.js +1 -1
  182. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  183. package/networks/support/UtilityNetworkLookupHelper.js +5 -0
  184. package/package.json +2 -2
  185. package/smartMapping/support/utils.js +1 -1
  186. package/support/guards.js +1 -1
  187. package/support/revision.js +1 -1
  188. package/symbols/cim/CIMOperators.js +1 -1
  189. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  190. package/symbols/cim/defaultCIMValues.js +1 -1
  191. package/symbols/cim/effects/EffectEnclosingPolygon.js +5 -0
  192. package/symbols/cim/effects/EffectRadial.js +5 -0
  193. package/symbols/cim/effects/EffectTaperedPolygon.js +5 -0
  194. package/symbols/cim/utils.js +1 -1
  195. package/symbols/support/previewSymbol2D.js +1 -1
  196. package/time/TimeExtent.js +1 -1
  197. package/time/constants.js +5 -0
  198. package/time/timeZoneUtils.js +1 -1
  199. package/views/2d/engine/webgl/TextureManager.js +1 -1
  200. package/views/2d/engine/webgl/Utils.js +1 -1
  201. package/views/2d/engine/webgl/mesh/factories/ResourceProxy.js +1 -1
  202. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
  203. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  204. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader.js +1 -1
  205. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
  206. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
  207. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
  208. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  209. package/views/2d/engine/webgl/textureUtils.js +5 -0
  210. package/views/2d/engine/webgl/urlUtils.js +5 -0
  211. package/views/2d/layers/MediaLayerView2D.js +1 -1
  212. package/views/2d/layers/TileLayerView2D.js +1 -1
  213. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  214. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  215. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  216. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  217. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  218. package/views/3d/environment/CloudsRenderer.js +1 -1
  219. package/views/3d/terrain/TileRenderer.js +1 -1
  220. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +11 -11
  221. package/views/3d/webgl-engine/core/shaderLibrary/util/LookupCubemapFromTextureArray.glsl.js +39 -0
  222. package/views/3d/webgl-engine/core/shaderModules/Texture2DArrayBindUniform.js +5 -0
  223. package/views/3d/webgl-engine/lib/TextureCompressionWorkerHandle.js +1 -1
  224. package/views/VideoView.js +1 -1
  225. package/views/View.js +1 -1
  226. package/views/support/TextureCompressionHelper.js +1 -1
  227. package/views/webgl/FramebufferObject.js +1 -1
  228. package/views/webgl/ShaderBuilder.js +1 -1
  229. package/views/webgl/Texture.js +1 -1
  230. package/webdoc/support/webdocSaveUtils.js +1 -1
  231. package/webdoc/support/writeUtils.js +1 -1
  232. package/webmap/InitialViewProperties.js +1 -1
  233. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  234. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  235. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  236. package/widgets/Bookmarks.js +1 -1
  237. package/widgets/Directions/DirectionsViewModel.js +1 -1
  238. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  239. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  240. package/widgets/Feature/FeatureViewModel.js +1 -1
  241. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/AssociationDetails.js +1 -1
  242. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  243. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  244. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  245. package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
  246. package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
  247. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  248. package/widgets/FeatureTable/FieldColumn.js +1 -1
  249. package/widgets/Features/FeaturesViewModel.js +1 -1
  250. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  251. package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
  252. package/widgets/OrientedImageryViewer/dataCaptureUtils.js +1 -1
  253. package/widgets/OrientedImageryViewer/symbols.js +1 -1
  254. package/widgets/OrientedImageryViewer.js +1 -1
  255. package/widgets/Print/PrintViewModel.js +1 -1
  256. package/widgets/ScaleRangeSlider/scalePreviewUtils.js +1 -1
  257. package/widgets/TimeSlider.js +1 -1
  258. package/widgets/TimeZoneLabel.js +1 -1
  259. package/widgets/support/LabeledSwitch.js +1 -1
  260. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  261. package/widgets/support/SelectionToolbar.js +1 -1
  262. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  263. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  264. package/widgets/support/UtilityNetworkAssociations/utils/createAssociation.js +5 -0
  265. package/widgets/support/UtilityNetworkAssociations/utils/formatPercentAlong.js +5 -0
  266. package/widgets/support/UtilityNetworkAssociations/utils/getAssociationTitle.js +5 -0
  267. package/widgets/support/UtilityNetworkAssociations/utils/getFeatureTitle.js +5 -0
  268. package/widgets/support/UtilityNetworkAssociations/utils/isConnectivity.js +5 -0
  269. package/widgets/support/UtilityNetworkAssociations/utils/isConnectivityMidspan.js +5 -0
  270. package/widgets/support/UtilityNetworkAssociations/utils/isFromElement.js +5 -0
  271. package/widgets/support/chartUtilsAm5.js +1 -1
  272. package/widgets/support/dateUtils.js +1 -1
  273. package/assets/esri/core/workers/chunks/0509af0f6c732a847531.js +0 -1
  274. package/assets/esri/core/workers/chunks/1461ca910c3dba1d808b.js +0 -1
  275. package/assets/esri/core/workers/chunks/19f45bb389daf866dbc5.js +0 -1
  276. package/assets/esri/core/workers/chunks/1c4cafb879f21a42f7db.js +0 -978
  277. package/assets/esri/core/workers/chunks/22e7db720724f2426d74.js +0 -1
  278. package/assets/esri/core/workers/chunks/2515ace848cf078c6263.js +0 -1
  279. package/assets/esri/core/workers/chunks/2626f4201deb7bdd4866.js +0 -1
  280. package/assets/esri/core/workers/chunks/2c348d0e8131f08391cb.js +0 -1
  281. package/assets/esri/core/workers/chunks/2d4bfd747580ed3b6f4d.js +0 -1
  282. package/assets/esri/core/workers/chunks/2e1126a35976b2d48197.js +0 -1
  283. package/assets/esri/core/workers/chunks/2eadc555038a38afdc9c.js +0 -1
  284. package/assets/esri/core/workers/chunks/36f0446d9d47685b7ce0.js +0 -1
  285. package/assets/esri/core/workers/chunks/380128e2cb74798478c1.js +0 -1
  286. package/assets/esri/core/workers/chunks/3cf3aa74541f0cfff94f.js +0 -1
  287. package/assets/esri/core/workers/chunks/3d46327469ed5170e83e.js +0 -1
  288. package/assets/esri/core/workers/chunks/440afa7d26e721af578a.js +0 -1
  289. package/assets/esri/core/workers/chunks/460e5f78574cc0d157af.js +0 -1
  290. package/assets/esri/core/workers/chunks/4de09a997691305415b1.js +0 -1
  291. package/assets/esri/core/workers/chunks/5066fc5257296d95fe60.js +0 -1
  292. package/assets/esri/core/workers/chunks/53315ca098d76d34cf00.js +0 -1
  293. package/assets/esri/core/workers/chunks/539190038ac552e5374c.js +0 -1
  294. package/assets/esri/core/workers/chunks/55162949a2b2c8e1c95c.js +0 -1
  295. package/assets/esri/core/workers/chunks/58853056c16f2b525a9e.js +0 -1
  296. package/assets/esri/core/workers/chunks/5af9737d0530ca17b771.js +0 -1
  297. package/assets/esri/core/workers/chunks/5c0dfc75a9b654e6fa25.js +0 -1
  298. package/assets/esri/core/workers/chunks/6245c51d1525767ce2fe.js +0 -1
  299. package/assets/esri/core/workers/chunks/6728185fdf53b4921bf8.js +0 -1
  300. package/assets/esri/core/workers/chunks/68ac336f7384bbca85ab.js +0 -1
  301. package/assets/esri/core/workers/chunks/68cb0c3462c90f2d1538.js +0 -1
  302. package/assets/esri/core/workers/chunks/6affa0f3d5bb74c7a1db.js +0 -1
  303. package/assets/esri/core/workers/chunks/6e108fb9884139dd3b52.js +0 -314
  304. package/assets/esri/core/workers/chunks/70943dc884d9ba8045a2.js +0 -1
  305. package/assets/esri/core/workers/chunks/7fe799c1e60e23a976e9.js +0 -1
  306. package/assets/esri/core/workers/chunks/80395a1d8ae91ff3961b.js +0 -1
  307. package/assets/esri/core/workers/chunks/823bf95f42cc42f20e22.js +0 -1
  308. package/assets/esri/core/workers/chunks/84e50d3ff298b7b66070.js +0 -1
  309. package/assets/esri/core/workers/chunks/87b78e491c800c96b503.js +0 -1
  310. package/assets/esri/core/workers/chunks/8bf29e5e4c93d85a6abf.js +0 -1
  311. package/assets/esri/core/workers/chunks/99838ad20c10aa5aa471.js +0 -1
  312. package/assets/esri/core/workers/chunks/9fb568d25ed4f4660963.js +0 -1
  313. package/assets/esri/core/workers/chunks/9ff9cf156d024ade068b.js +0 -1
  314. package/assets/esri/core/workers/chunks/a2d0f7d82630dd8efb9b.js +0 -1
  315. package/assets/esri/core/workers/chunks/a66c3866888bd7e415e8.js +0 -1
  316. package/assets/esri/core/workers/chunks/aa98a6c38e82d384403c.js +0 -1
  317. package/assets/esri/core/workers/chunks/b3bbe6f569ab6a3777b5.js +0 -1
  318. package/assets/esri/core/workers/chunks/ba33405a524c6bb88656.js +0 -1
  319. package/assets/esri/core/workers/chunks/bb1fb9990f8bf5f7a05f.js +0 -1
  320. package/assets/esri/core/workers/chunks/c22664f9f2b4ba7fe3d4.js +0 -1
  321. package/assets/esri/core/workers/chunks/c83245257deb230f79c0.js +0 -1
  322. package/assets/esri/core/workers/chunks/d2f8eed0b5b7cbdcd182.js +0 -1
  323. package/assets/esri/core/workers/chunks/d56426def776aae6fac6.js +0 -1
  324. package/assets/esri/core/workers/chunks/e12882be1b6820b8e9e8.js +0 -1
  325. package/assets/esri/core/workers/chunks/e648f1c96edf44c781eb.js +0 -1
  326. package/assets/esri/core/workers/chunks/ef6e9dbfc9a5bd38a7b6.js +0 -1
  327. package/assets/esri/core/workers/chunks/f2723d0c9c8d8ff4ec70.js +0 -1
  328. package/widgets/support/UtilityNetworkAssociations/utilityNetworkUtils.js +0 -5
  329. /package/chunks/{Bufferer-B-V7yYm-.js → Bufferer-CicaNej1.js} +0 -0
  330. /package/chunks/{Distance2DCalculator-Coa0qAFt.js → Distance2DCalculator-C1KHhZwD.js} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{b as t,c as e}from"./tslib.es6.js";import{t as i,G as s,g as n,c as o,v as a,h as m}from"./Geometry.js";import{S as r,a as u}from"./QuadraticBezier.js";import{v as c,p as h,E as l,F as _,Q as p,R as d,S as g,U as x,V as y,W as P,w as S,X as f,t as G,Y as D,G as v}from"./ProjectionTransformation.js";import{h as T,a as b}from"./Envelope.js";import{Envelope2D as w}from"./Envelope2D.js";import{P as M,b as E,n as R,E as C,o as I}from"./Point2D.js";import{T as B}from"./Transformation2D.js";import{s as A,w as q,m as N}from"./Distance2DCalculator-Coa0qAFt.js";import{O as F}from"./OperatorShapePreservingDensify.js";import{O as Y}from"./OperatorClip.js";function X(){return new w}class k{[Symbol.dispose](){this.m_peR1.destroy(),this.m_peR2.destroy(),this.m_peR3.destroy(),this.m_peR1=null,this.m_peR2=null,this.m_peR3=null}constructor(t,e,i){this.m_peR1=new l,this.m_peR2=new l,this.m_peR3=new l,void 0!==t?this.reset(t,e,i):this.reset(1,0,1)}reset(t,e,i){this.m_a=t,this.m_e2=e,this.m_b=this.m_a*Math.sqrt(1-this.m_e2),this.m_unitToDegree=i,this.m_unitToRad=.017453292519943295*i,this.m_u180=180/this.m_unitToDegree,this.m_u360=360/this.m_unitToDegree}calculateBbox(t,e,i,s){const n=this.m_peR1,o=this.m_peR2,a=this.m_peR3;_.geodeticDistance(this.m_a,this.m_e2,t*this.m_unitToRad,e*this.m_unitToRad,i*this.m_unitToRad,s*this.m_unitToRad,a,n,o,0);const m=Math.cos(n.val),r=Math.cos(o.val+3.141592653589793),u=e*this.m_unitToRad,c=G.phiToEta(this.m_e2,u),h=Math.sin(n.val)*Math.cos(c);let l=e;if(m*r<0){const t=m<0?-1:1,e=Math.acos(Math.abs(h))*t;l=G.etaToPhi(this.m_e2,e)/this.m_unitToRad}let p=I((i-t)*this.m_unitToRad,2*Math.PI);Math.abs(p)>Math.PI&&(p=p>0?p-2*Math.PI:p+2*Math.PI),p/=this.m_unitToRad,i=t+p;const d=X();return d.xmin=Math.min(t,i),d.xmax=Math.max(t,i),d.ymin=Math.min(e,s),d.ymin=Math.min(d.ymin,l),d.ymax=Math.max(e,s),d.ymax=Math.max(d.ymax,l),d}minDistanceGeodesic(t,e){const i=O(t),s=O(e);if(i&&s)return this.lowerDistanceGeodetic_(t.xmin,t.ymin,e.xmin,e.ymin);const n=this.normalizeGeodesic_(e,t);return U(t,n)?t.ymin>=n.ymax?this.minDistanceGeodesicUpDown_(t,n):n.ymin>=t.ymax?this.minDistanceGeodesicUpDown_(n,t):t.xmin>n.xmax?this.minDistanceGeodesicLeftRight_(n,t):this.minDistanceGeodesicLeftRight_(t,n):0}normalizeGeodesic_(t,e){const i=t.clone(),s=t.clone();let n=V(i,e);if(0===n)return i;for(;s.xmax>e.xmin;){s.xmin-=this.m_u360,s.xmax-=this.m_u360;const t=V(s,e);if(t<n&&(i.assign(s),n=t,0===n))return i}for(s.assign(t);s.xmin<e.xmax;){s.xmin+=this.m_u360,s.xmax+=this.m_u360;const t=V(s,e);if(t<n&&(i.assign(s),n=t,0===n))return i}return i}lowerDistanceGeodetic_(t,e,i,s){const n=this.m_peR1;{const o=this.m_b*this.m_b/this.m_a,a=G.phiToPhig(this.m_e2,this.m_unitToRad*e),m=G.phiToPhig(this.m_e2,this.m_unitToRad*s);_.geodeticDistance(o,0,this.m_unitToRad*t,a,this.m_unitToRad*i,m,n,null,null,0)}return n.val}minDistanceGeodesicUpDown_(t,e){if(e.xmin<=t.xmin?e.xmax>=t.xmin:t.xmax>=e.xmin)return this.lowerDistanceGeodetic_(0,t.ymin,0,e.ymax);if(e.xmin>t.xmax){const i=this.lowerDistanceGeodeticSegMeridional_(t.xmax,t.ymin,t.ymax,e.xmin,e.ymin,e.ymax);if(e.xmax-t.xmin<this.m_u180)return i;const s=this.lowerDistanceGeodeticSegMeridional_(t.xmin,t.ymin,t.ymax,e.xmax,e.ymin,e.ymax);return Math.min(i,s)}{const i=this.lowerDistanceGeodeticSegMeridional_(t.xmin,t.ymin,t.ymax,e.xmax,e.ymin,e.ymax);if(t.xmax-e.xmin<this.m_u180)return i;const s=this.lowerDistanceGeodeticSegMeridional_(t.xmax,t.ymin,t.ymax,e.xmin,e.ymin,e.ymax);return Math.min(i,s)}}minDistanceGeodesicLeftRight_(t,e){let i=Math.abs(t.xmax-e.xmin);for(;i>this.m_u180;)i-=this.m_u360;let s=Math.abs(t.xmin-e.xmax);for(;s>this.m_u180;)s-=this.m_u360;return Math.abs(i)<=Math.abs(s)?this.minDistanceGeodesicLeftRightNormalized_(t,e):this.minDistanceGeodesicLeftRightNormalized_(e,t)}minDistanceGeodesicLeftRightNormalized_(t,e){let i,s;return i=this.lowerDistanceGeodetic_(t.xmax,t.ymin,e.xmin,e.ymin),t.ymin>=e.ymin&&t.ymin<=e.ymax&&(s=this.lowerDistanceGeodeticPtMeridional_(t.xmax,t.ymin,e.xmin,e.ymin,e.ymax),i=Math.min(i,s)),e.ymin>=t.ymin&&e.ymin<=t.ymax&&(s=this.lowerDistanceGeodeticPtMeridional_(e.xmin,e.ymin,t.xmax,t.ymin,t.ymax),i=Math.min(i,s)),s=this.lowerDistanceGeodetic_(t.xmax,t.ymax,e.xmin,e.ymax),i=Math.min(i,s),t.ymax>=e.ymin&&t.ymax<=e.ymax&&(s=this.lowerDistanceGeodeticPtMeridional_(t.xmax,t.ymax,e.xmin,e.ymin,e.ymax),i=Math.min(i,s)),e.ymax>=t.ymin&&e.ymax<=t.ymax&&(s=this.lowerDistanceGeodeticPtMeridional_(e.xmin,e.ymax,t.xmax,t.ymin,t.ymax),i=Math.min(i,s)),i}lowerDistanceGeodeticSegMeridional_(t,e,i,s,n,o){let a=this.lowerDistanceGeodeticPtMeridional_(t,e,s,n,o);const m=this.lowerDistanceGeodeticPtMeridional_(t,i,s,n,o);let r=this.lowerDistanceGeodeticPtMeridional_(s,n,t,e,i);const u=this.lowerDistanceGeodeticPtMeridional_(s,o,t,e,i);return a=Math.min(a,m),r=Math.min(r,u),Math.min(a,r)}lowerDistanceGeodeticPtMeridional_(t,e,i,s,n){const o=this.m_b*this.m_b/this.m_a,a=G.phiToPhig(this.m_e2,this.m_unitToRad*e),m=G.phiToPhig(this.m_e2,this.m_unitToRad*s),r=G.phiToPhig(this.m_e2,this.m_unitToRad*n),u=this.m_peR1,c=this.m_peR2;_.geodeticDistance(o,0,this.m_unitToRad*i,m,this.m_unitToRad*t,a,u,null,null,0),_.geodeticDistance(o,0,this.m_unitToRad*i,r,this.m_unitToRad*t,a,c,null,null,0);const h=p(1,0,new M(this.m_unitToRad*t,a)),l=p(1,0,new M(this.m_unitToRad*i,m)),d=p(1,0,new M(this.m_unitToRad*i,r));let g=new T;g.setCrossProductVector(l,d);const x=l.dotProduct(d);if(g.length()<1.568e-10)return x>=0?Math.min(u.val,c.val):0;g=g.getUnitVector();let y=new T;if(y.setCrossProductVector(g,h),y.length()<1.568e-10){return Math.min(u.val,c.val)-1e-5*o}y=y.getUnitVector();let P=h.sub(g.mul(h.dotProduct(g)));{const e=new T;e.setCrossProductVector(l,P);const i=new T;i.setCrossProductVector(P,d);let s=g.dotProduct(e)>0&&g.dotProduct(i)>0;if(s||(P.negateThis(),e.setCrossProductVector(l,P),i.setCrossProductVector(P,d),s=g.dotProduct(e)>0&&g.dotProduct(i)>0),s){P=P.getUnitVector();const e=D(1,0,P),i=this.m_peR3;_.geodeticDistance(o,0,this.m_unitToRad*t,a,e.x,e.y,i,null,null,0);const s=Math.min(u.val,c.val);return Math.min(s,i.val)}}return Math.min(u.val,c.val)}}function O(t){return t.xmin===t.xmax&&t.ymin===t.ymax}function U(t,e){return e.xmax<t.xmin||e.xmin>t.xmax||e.ymax<t.ymin||e.ymin>t.ymax}function V(t,e){let i,s=0;return i=t.xmin-e.xmax,i>s&&(s=i),i=e.xmin-t.xmax,i>s&&(s=i),s}class j{}function L(t){return{outPoint:void 0===t?new M:t.clone()}}function z(t,e){t.outPoint.assign(e.outPoint)}function H(){return new w}class Q{constructor(t,e,i,s,n=0,o=4){this.m_ptDistFrom=new M,this.m_segStartPt=new M,this.m_segEndPt=new M,this.m_geodeticLength=new l,this.m_az12=new l,this.m_minGeodeticDist=new l,this.m_segStartPt3d=new T,this.m_segEndPt3d=new T,this.m_sr=s,this.m_distCurveType=n,this.m_segCurveType=o,this.m_inputGCS=this.m_sr.getGCS(),this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_bIsPannablePcs=2===this.m_sr.getCoordinateSystemType()&&this.m_sr.isPannable();const a=v();this.m_inputGCS.querySpheroidData(a),this.m_a=a.majorSemiAxis,this.m_eSquared=a.e2,this.setPointDistFrom(t),this.setSegmentEndPoints(e,i)}setSegmentEndPoints(t,e){this.m_segStartPt.assign(t),this.m_segEndPt.assign(e),this.m_bIsPannablePcs||(this.m_segStartPt.mulThis(this.m_rpu),this.m_segEndPt.mulThis(this.m_rpu)),2===this.m_segCurveType&&(this.m_segStartPt3d.assign(p(this.m_a,this.m_eSquared,this.m_segStartPt)),this.m_segEndPt3d.assign(p(this.m_a,this.m_eSquared,this.m_segEndPt))),this.calculateAndUpdateSegmentLength()}setPointDistFrom(t){this.m_ptDistFrom.assign(t),this.m_ptDistFrom.scale(this.m_rpu)}setSegmentCurveType(t){this.m_segCurveType=t}setDistanceCurveType(t){this.m_distCurveType=t}makeFunctor(){return i=>{let s;switch(this.m_segCurveType){case 0:case 1:case 3:{const o={stack:[],error:void 0,hasError:!1};try{const e=t(o,new l,!1),n=t(o,new l,!1);_.geodeticCoordinate(this.m_a,this.m_eSquared,this.m_segStartPt.x,this.m_segStartPt.y,this.m_geodeticLength.val*i,this.m_az12.val,e,n,this.m_segCurveType),s=new M(e.val,n.val);break}catch(n){o.error=n,o.hasError=!0}finally{e(o)}}case 2:{const t=T.lerp(this.m_segStartPt3d,this.m_segEndPt3d,i);s=D(this.m_a,this.m_eSquared,t);break}case 4:s=M.lerp(this.m_segStartPt,this.m_segEndPt,i),this.m_bIsPannablePcs&&(g(this.m_sr,0,[s],1),s.mulThis(this.m_rpu));break;default:o("Invalid curve type")}return _.geodeticDistance(this.m_a,this.m_eSquared,this.m_ptDistFrom.x,this.m_ptDistFrom.y,s.x,s.y,this.m_minGeodeticDist,null,null,this.m_distCurveType),this.m_minGeodeticDist.val}}calculateAndUpdateSegmentLength(){switch(this.m_segCurveType){case 0:case 2:case 1:case 3:_.geodeticDistance(this.m_a,this.m_eSquared,this.m_segStartPt.x,this.m_segStartPt.y,this.m_segEndPt.x,this.m_segEndPt.y,this.m_geodeticLength,this.m_az12,null,this.m_segCurveType);break;case 4:this.m_geodeticLength.val=M.distance(this.m_segStartPt,this.m_segEndPt);break;default:o("Invalid curve type")}}[Symbol.dispose](){this.m_geodeticLength[Symbol.dispose](),this.m_az12[Symbol.dispose](),this.m_minGeodeticDist[Symbol.dispose]()}}function W(){return new j}class J{[Symbol.dispose](){this.m_envHelper[Symbol.dispose]()}constructor(t,e,i,s,n){this.m_boxGeomA=H(),this.m_boxGeomB=H(),this.m_envGeomA=new w,this.m_envGeomB=new w,this.m_progressCounter=0,this.m_transformPCS2GCS=null,this.m_segmentBoxesA=new Map,this.m_segmentBoxesB=new Map,this.m_boundaryPtsA=[],this.m_boundaryPtsB=[],this.m_scaleToRadians=new B,this.m_scaleToDegrees=new B,this.m_inputSR=t,this.m_distCurveType=e,this.m_progressTracker=i,this.m_maxDistance=s,this.m_maxDeviation=n,this.m_inputGCS=t.getGCS(),this.m_peGeogcs=this.m_inputGCS.getPECoordSys(),this.m_tolerance=0;const o=v();this.m_inputGCS.querySpheroidData(o),this.m_a=o.majorSemiAxis,this.m_eSquared=o.e2,this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_envHelper=new k(this.m_a,this.m_eSquared,1),4===this.m_distCurveType&&(this.m_distCurveType=0),this.m_boxGeomA.setEmpty(),this.m_boxGeomB.setEmpty(),this.m_envGeomA.setEmpty(),this.m_envGeomB.setEmpty(),this.m_bIsPannablePcs=2===this.m_inputSR.getCoordinateSystemType()&&this.m_inputSR.isPannable()}progress(t=!1){}calculate(t,e,i,s){const n=L(),o=L();if(t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB),this.checkGeometriesIntersect(t,e,n,o))return i&&z(i,n),s&&z(s,o),0;const a=this.prepareGeometry(t);if(a.isEmpty())return Number.NaN;const m=this.prepareGeometry(e);if(m.isEmpty())return Number.NaN;this.m_tolerance=this.computeTolerance(a,m);const r=this._ExecuteBruteForce(a,m,n,o);return r>=this.m_maxDistance?Number.NaN:(i&&(this.prepareOutput(n),z(i,n)),s&&(this.prepareOutput(o),z(s,o)),r)}createDistanceFunctor(t,e,i){const s=new Q(t,e,i,this.m_inputSR,this.m_distCurveType);return this.m_bIsPannablePcs||1===this.m_inputSR.getCoordinateSystemType()||s.setSegmentCurveType(2),s}_NormalizeAndProject(t){if(this.m_inputSR.isPannable()&&(t=(new c).foldInto360Range(t,this.m_inputSR)),2===this.m_inputSR.getCoordinateSystemType()){const e=h(this.m_inputSR,this.m_inputGCS,null);t=(new c).execute(t,e,this.m_progressTracker)}return t}_ExecuteBruteForce(t,e,n,o){switch(t.getGeometryType()){case s.enumPoint:return this.calculateDistanceGeodeticPointGeometry(t,e,n,o);case s.enumMultiPoint:return this.calculateDistanceGeodeticMultipointGeometry(t,e,n,o);case s.enumPolyline:case s.enumPolygon:case s.enumEnvelope:return this.calculateDistanceGeodeticMultipathGeometry(t,e,n,o);default:i("")}}calculateDistanceGeodeticPointGeometry(t,e,n,o){switch(e.getGeometryType()){case s.enumPoint:return this.calculateDistanceGeodeticPointPoint(t,e,n,o);case s.enumMultiPoint:return this.calculateDistanceGeodeticPointMultipoint(t,e,n,o);case s.enumPolyline:case s.enumPolygon:return this.calculateDistanceGeodeticPointMultipath(t,e,n,o);default:i("")}}calculateDistanceGeodeticPointPoint(i,s,n,o){const a={stack:[],error:void 0,hasError:!1};try{const e=i.getXY();e.scale(this.m_rpu);const m=s.getXY();m.scale(this.m_rpu),n.outPoint.assign(e),o.outPoint.assign(m);const r=t(a,new l,!1);return _.geodeticDistance(this.m_a,this.m_eSquared,e.x,e.y,m.x,m.y,r,null,null,this.m_distCurveType),r.val}catch(m){a.error=m,a.hasError=!0}finally{e(a)}}calculateDistanceGeodeticPointMultipoint(i,s,n,o){const a={stack:[],error:void 0,hasError:!1};try{this.computeEnvelopesAndBoxes(i,s);const e=this.estimateMinimumDistance(n,o);let m=e<this.m_maxDistance?e:this.m_maxDistance;const r=i.getXY();r.scale(this.m_rpu),n.outPoint.assign(r);const u=p(this.m_a,this.m_eSquared,r),c=new M,h=s.getImpl(),d=t(a,new l,!1),g=h.getPointCount();for(let t=0;t<g;++t){h.queryXY(t,c),c.scale(this.m_rpu);const e=p(this.m_a,this.m_eSquared,c);if(!(T.distance(u,e)>m)&&(!(this.m_envHelper.minDistanceGeodesic(this.m_boxGeomA,this.m_boxGeomB)>m)&&(_.geodeticDistance(this.m_a,this.m_eSquared,r.x,r.y,c.x,c.y,d,null,null,this.m_distCurveType),d.val<m&&(m=d.val,o.outPoint=c,0===m))))return m}return m===this.m_maxDistance?Number.POSITIVE_INFINITY:m}catch(m){a.error=m,a.hasError=!0}finally{e(a)}}calculateDistanceGeodeticPointMultipath(i,s,o,a){const m={stack:[],error:void 0,hasError:!1};try{const e=new M,r=new M;e.assign(i.getXY()),r.assign(i.getXY()),o.outPoint.assign(r.mul(this.m_rpu)),this.m_bIsPannablePcs&&d(this.m_inputSR,[e],1,!1),this.computeEnvelopesAndBoxes(i,s);const u=this.estimateMinimumDistance(o,a);let c=u<this.m_maxDistance?u:this.m_maxDistance;const h=s.getImpl(),l=new M(0,0),_=new M(0,0),p=[1],g=this.canUseSpatialTree(i,s),x=W();g&&this.buildSpatialTree(x,s);const y=H();y.setCoords({xmin:r.x,ymin:r.y,xmax:r.x,ymax:r.y});const P=t(m,this.createDistanceFunctor(r,l,_),!1),S=h.querySegmentIterator();if(S.stripAttributes(),g)n(0);else for(;S.nextPath();)for(;S.hasNextSegment();){const t=S.nextSegment(),i=this.findOrComputeBoxSegment(S.getStartPointIndex(),t,this.m_segmentBoxesB);if(this.m_envHelper.minDistanceGeodesic(y,i)>c)continue;const s=this.calculateDistanceGeodeticPointSegment(e,r,t,p,P);if(s.second<c&&(this.updateOutputSegment(a,t,s.first),c=s.second,0===c))return 0}return c===this.m_maxDistance?Number.POSITIVE_INFINITY:c}catch(r){m.error=r,m.hasError=!0}finally{e(m)}}calculateDistanceGeodeticMultipointGeometry(t,e,n,o){switch(e.getGeometryType()){case s.enumPoint:return this.calculateDistanceGeodeticPointMultipoint(e,t,o,n);case s.enumMultiPoint:return this.calculateDistanceGeodeticMultipointMultipoint(t,e,n,o);case s.enumPolyline:case s.enumPolygon:case s.enumEnvelope:return this.calculateDistanceGeodeticMultipointMultipath(t,e,n,o);default:i("")}}calculateDistanceGeodeticMultipointMultipoint(i,s,n,o){const a={stack:[],error:void 0,hasError:!1};try{const e=t(a,new l,!1);this.computeEnvelopesAndBoxes(i,s);const m=this.estimateMinimumDistance(n,o);let r=m<this.m_maxDistance?m:this.m_maxDistance;const u=new M,c=new M,h=i.getImpl(),d=s.getImpl(),g=H(),x=h.getPointCount(),y=d.getPointCount();for(let t=0;t<x;++t){if(u.assign(h.getXY(t)),g.setCoords({xmin:u.x,ymin:u.y,xmax:u.x,ymax:u.y}),this.m_envHelper.minDistanceGeodesic(g,this.m_boxGeomB)>r)continue;u.scale(this.m_rpu);const i=p(this.m_a,this.m_eSquared,u);for(let t=0;t<y;++t){c.assign(d.getXY(t)),c.scale(this.m_rpu);const s=p(this.m_a,this.m_eSquared,c);if(!(T.distance(i,s)>=r)&&(_.geodeticDistance(this.m_a,this.m_eSquared,u.x,u.y,c.x,c.y,e,null,null,this.m_distCurveType),e.val<r&&(n.outPoint.assign(u),o.outPoint.assign(c),r=e.val,0===r)))return r}}return r===this.m_maxDistance?Number.POSITIVE_INFINITY:r}catch(m){a.error=m,a.hasError=!0}finally{e(a)}}calculateDistanceGeodeticMultipointMultipath(i,s,o,a){const m={stack:[],error:void 0,hasError:!1};try{const e=s.getImpl().querySegmentIterator();e.stripAttributes(),this.computeEnvelopesAndBoxes(i,s);const r=this.estimateMinimumDistance(o,a);let u=r<this.m_maxDistance?r:this.m_maxDistance;const c=new M,h=new M(0,0),l=new M(0,0),_=new M(0,0),p=[0],g=H(),x=t(m,this.createDistanceFunctor(h,l,_),!1),y=W(),P=this.canUseSpatialTree(i,s);P&&this.buildSpatialTree(y,s);const S=i.getPointCount();for(let t=0;t<S;++t)if(c.assign(i.getXY(t)),h.assign(i.getXY(t)),this.m_bIsPannablePcs&&d(this.m_inputSR,[c],1,!1),g.setCoords({xmin:h.x,ymin:h.y,xmax:h.x,ymax:h.y}),!(this.m_envHelper.minDistanceGeodesic(g,this.m_boxGeomB)>u))if(x.setPointDistFrom(h),P)n(0);else{for(;e.nextPath();)for(;e.hasNextSegment();){const t=e.nextSegment();if(this.m_envHelper.minDistanceGeodesic(g,this.findOrComputeBoxSegment(e.getStartPointIndex(),t,this.m_segmentBoxesB))>u)continue;const i=this.calculateDistanceGeodeticPointSegment(c,h,t,p,x);if(i.second<u&&(o.outPoint.assign(h.mul(this.m_rpu)),this.updateOutputSegment(a,t,i.first),u=i.second,0===u))return 0}e.resetToFirstPath()}return u===this.m_maxDistance?Number.POSITIVE_INFINITY:u}catch(r){m.error=r,m.hasError=!0}finally{e(m)}}calculateDistanceGeodeticMultipathGeometry(t,e,n,o){switch(e.getGeometryType()){case s.enumPoint:return this.calculateDistanceGeodeticPointMultipath(e,t,o,n);case s.enumMultiPoint:return this.calculateDistanceGeodeticMultipointMultipath(e,t,o,n);case s.enumPolyline:case s.enumPolygon:case s.enumEnvelope:return this.calculateDistanceGeodeticMultipathMultipath(t,e,n,o);default:i("")}}calculateDistanceGeodeticMultipathMultipath(t,e,i,s){const n=[t],o=[e],a=this.swapGeometries(n,o),m=n[0],r=o[0];this.computeEnvelopesAndBoxes(n[0],o[0]);const u=this.estimateMinimumDistance(i,s),c=this.calculateDistanceGeodeticMultipathMultipath_(m,r,i,s,u);return a&&(s.outPoint=E(i.outPoint,i.outPoint=s.outPoint)),c}calculateDistanceGeodeticMultipathMultipath_(i,s,o,a,m=Number.MAX_VALUE){const u={stack:[],error:void 0,hasError:!1};try{let e=m;const c=new M(0,0),h=new M,l=new M(0,0),_=new M,p=new M(0,0),d=new M,y=new M,P=new M,S=[new M],f=[0],G=[0],D=H(),v=H(),T=t(u,this.createDistanceFunctor(p,c,l),!1),b=W(),w=this.canUseSpatialTree(i,s);w&&this.buildSpatialTree(b,s);const E=s.querySegmentIterator();E.stripAttributes();const R=new r,C=A(i);for(let t=0;t<C.length;++t){const s=C[t];i.getSegmentBuffer(s,R,!0);const m=R.get();if(D.assign(this.findOrComputeBoxSegment(s,m,this.m_segmentBoxesA)),w)n(0);else{if(p.assign(m.getStartXY()),d.assign(m.getStartXY()),y.assign(m.getEndXY()),P.assign(m.getEndXY()),this.m_bIsPannablePcs&&(g(this.m_inputSR,0,[d],1),g(this.m_inputSR,0,[P],1)),this.m_envHelper.minDistanceGeodesic(D,this.m_boxGeomB)>e)continue;for(;E.nextPath();){for(;E.hasNextSegment();){const t=E.nextSegment();if(c.assign(t.getStartXY()),h.assign(t.getStartXY()),l.assign(t.getEndXY()),_.assign(t.getEndXY()),m.intersect(t,S,f,G,this.m_tolerance))return this.updateOutputSegment(o,m,f[0]),this.updateOutputSegment(a,t,G[0]),0;if(this.m_bIsPannablePcs&&(g(this.m_inputSR,0,[h],1),g(this.m_inputSR,0,[_],1)),v.assign(this.findOrComputeBoxPoint(E.getStartPointIndex(),h,_,this.m_segmentBoxesB)),this.m_envHelper.minDistanceGeodesic(D,v)>e)continue;T.setSegmentEndPoints(c,l),T.setPointDistFrom(d);let i=x(T.makeFunctor(),0,1,1e-10);if(i.second<e&&(o.outPoint.assign(d.mul(this.m_rpu)),this.updateOutputSegment(a,t,i.first),e=i.second,0===e))break;if(T.setPointDistFrom(P),i=x(T.makeFunctor(),0,1,1e-10),i.second<e&&(o.outPoint.assign(P.mul(this.m_rpu)),this.updateOutputSegment(a,t,i.first),e=i.second,0===e))break;if(T.setSegmentEndPoints(p,y),T.setPointDistFrom(h),i=x(T.makeFunctor(),0,1,1e-10),i.second<e&&(this.updateOutputSegment(o,m,i.first),a.outPoint.assign(h.mul(this.m_rpu)),e=i.second,0===e))break;if(T.setPointDistFrom(_),i=x(T.makeFunctor(),0,1,1e-10),i.second<e&&(this.updateOutputSegment(o,m,i.first),a.outPoint.assign(_.mul(this.m_rpu)),e=i.second,0===e))break}if(0===e)return 0}E.resetToFirstPath()}}return e===this.m_maxDistance?Number.POSITIVE_INFINITY:e}catch(c){u.error=c,u.hasError=!0}finally{e(u)}}calculateDistanceGeodeticPointSegment(t,e,i,s,n){const o=i.getStartXY(),a=i.getEndXY();return i.intersectPoint(t,s,this.m_tolerance)?R(s[0],0):(n.setPointDistFrom(e),n.setSegmentEndPoints(o,a),x(n.makeFunctor(),0,1,1e-10))}prepareGeometry(t){let e=t.clone();const i=t.getGeometryType();if(i===s.enumPoint||i===s.enumMultiPoint)return this._NormalizeAndProject(e);if(i===s.enumEnvelope&&(e=this.envelopeToPolygon(e)),this.m_inputSR.isPannable())return this.prepareGeometryPannable(e,4);if(2===this.m_inputSR.getCoordinateSystemType()){if(e=y(e,this.m_inputSR,0,null),e.isEmpty())return e;e=(new F).execute(e,this.m_inputSR,5e4,this.m_maxDeviation/2,0,null);const t=this.m_inputSR.getSRToGCSTransform();return(new c).execute(e,t,this.m_progressTracker)}const n=new w;e.queryLooseEnvelope(n);const o=this.m_inputSR.getPannableExtent();if(n.ymin<o.ymin||n.ymax>o.ymax){const t=new w(n.xmin-1,o.ymin,n.xmax+1,o.ymax);if(e=(new Y).execute(e,t,this.m_inputSR,this.m_progressTracker),e.isEmpty())return e}return n.width()>2*o.width()?(e=P(e,-2*o.width(),2*o.width(),this.m_inputSR,!0,0,!0,this.m_progressTracker),e):e}prepareGeometryPannable(t,e){const i=new w;t.queryEnvelope(i);const s=this.m_inputSR.getPannableExtent();if(s.containsEnvelope(i))return t;const n=new C;s.queryIntervalX(n);const o=new C;return i.queryIntervalX(o),t=n.contains(o)?S(t,this.m_inputSR):(new c).foldInto360RangeGeodetic(t,this.m_inputSR,e)}prepareOutput(t){t.outPoint.scale(1/this.m_rpu),2===this.m_inputSR.getCoordinateSystemType()&&d(this.m_inputSR,[t.outPoint],1,!1)}updateOutputSegment(t,e,i){e.queryCoord2D(i,t.outPoint),this.m_bIsPannablePcs&&g(this.m_inputSR,0,[t.outPoint],1),t.outPoint.mulThis(this.m_rpu)}computeTolerance(t,e){t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB);const i=new w(this.m_envGeomA);return i.mergeEnvelope2D(this.m_envGeomB),b(null,i)}envelopeToPolygon(t){const e=new u;return e.addEnvelope(t,!1),e}computeEnvelopesAndBoxes(t,e){t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB),this.m_boxGeomA=this.computeBoxGeometry(t,this.m_boundaryPtsA,this.m_segmentBoxesA),this.m_boxGeomB=this.computeBoxGeometry(e,this.m_boundaryPtsB,this.m_segmentBoxesB)}computeBoxGeometry(t,e,i){switch(t.getGeometryType()){case s.enumPoint:return this.computeBoxPoint(t,e);case s.enumMultiPoint:return this.computeBoxMultiPoint(t,e);case s.enumPolyline:case s.enumPolygon:return this.computeBoxMultiPath(t,e,i);default:o("Invalid geometry type")}}computeBoxPoint(t,e){const i=t.getXY();e.length=0,e.push(i.mul(this.m_rpu));const s=H();return s.setCoords({xmin:i.x,ymin:i.y,xmax:i.x,ymax:i.y}),s}computeBoxMultiPoint(t,e){let i=!0;for(let n=0;n<t.getPointCount();++n){const s=t.getXY(n);if(i){e.length=0;for(let t=0;t<4;++t)e.push(s.clone());i=!1}s.x<e[0].x&&e[0].assign(s),s.y>e[1].y&&e[1].assign(s),s.x>e[2].x&&e[2].assign(s),s.y<e[3].y&&e[3].assign(s)}for(let n=0;n<e.length;++n)e[n].mulThis(this.m_rpu);const s=H();return t.queryEnvelope(s),s}computeBoxMultiPath(t,e,i){let s=!0;const n=H();n.setEmpty();const o=t.querySegmentIterator();for(o.stripAttributes();o.nextPath();)for(;o.hasNextSegment();){const t=o.nextSegment(),a=t.getStartXY(),m=t.getEndXY();if(this.m_bIsPannablePcs&&(g(this.m_inputSR,0,[a],1),g(this.m_inputSR,0,[m],1)),s){for(let t=0;t<4;++t)e.push(a.clone());s=!1}a.x<e[0].x&&e[0].assign(a),a.y>e[1].y&&e[1].assign(a),a.x>e[2].x&&e[2].assign(a),a.y<e[3].y&&e[3].assign(a),m.x<e[0].x&&e[0].assign(m),m.y>e[1].y&&e[1].assign(m),m.x>e[2].x&&e[2].assign(m),m.y<e[3].y&&e[3].assign(m);const r=this.findOrComputeBoxPoint(o.getStartPointIndex(),a,m,i);n.mergeEnvelope2D(r)}for(let a=0;a<e.length;++a)e[a].mulThis(this.m_rpu);return n}findOrComputeBoxSegment(t,e,i){if(!i.has(t)){let s=H();if(e.queryEnvelope(s),this.m_bIsPannablePcs){const t=M.construct(s.xmin,s.ymin),e=M.construct(s.xmax,s.ymax);g(this.m_inputSR,0,[t],1),g(this.m_inputSR,0,[e],1),s=this.m_envHelper.calculateBbox(t.x,t.y,e.x,e.y)}return i.set(t,s),s}return i.get(t)}findOrComputeBoxPoint(t,e,i,s){if(!s.has(t)){let n=H();return n.setCoords({xmin:e.x,ymin:e.y,xmax:i.x,ymax:i.y}),this.m_bIsPannablePcs&&(n=this.m_envHelper.calculateBbox(n.xmin,n.ymin,n.xmax,n.ymax)),s.set(t,n),n}return s.get(t)}estimateMinimumDistance(i,s){const n={stack:[],error:void 0,hasError:!1};try{const e=t=>p(this.m_a,this.m_eSquared,t),o=this.m_boundaryPtsA.map(e),a=this.m_boundaryPtsB.map(e);let m=Number.MAX_VALUE,r=0,u=0;for(let t=0;t<o.length;++t)for(let e=0;e<a.length;++e){const i=T.distance(o[t],a[e]);i<m&&(m=i,r=t,u=e)}i.outPoint.assign(this.m_boundaryPtsA[r]),s.outPoint.assign(this.m_boundaryPtsB[u]);const c=t(n,new l,!1);return _.geodeticDistance(this.m_a,this.m_eSquared,this.m_boundaryPtsA[r].x,this.m_boundaryPtsA[r].y,this.m_boundaryPtsB[u].x,this.m_boundaryPtsB[u].y,c,null,null,this.m_distCurveType),c.val}catch(o){n.error=o,n.hasError=!0}finally{e(n)}}swapGeometries(t,e){return a(t[0])>a(e[0])&&(e[0]=E(t[0],t[0]=e[0]),this.m_envGeomB=E(this.m_envGeomA,this.m_envGeomA=this.m_envGeomB),!0)}canUseSpatialTree(t,e){return!1}checkGeometriesIntersect(t,e,i,n){let o=t.getGeometryType(),a=e.getGeometryType();if(this.m_envGeomA.isIntersecting(this.m_envGeomB)){if(o===s.enumPoint&&2===e.getDimension()){const s=[0],o=[t.getXY()];if(f(e,o,1,this.m_tolerance,s),0!==s[0])return i.outPoint.assign(o[0]),n.outPoint.assign(o[0]),!0}else if(a===s.enumPoint&&2===t.getDimension()){const s=[2],o=[e.getXY()];if(f(t,o,1,this.m_tolerance,s),0!==s[0])return i.outPoint.assign(o[0]),n.outPoint.assign(o[0]),!0}if(o===s.enumMultiPoint&&2===e.getDimension())return this.multipointIntersectsArea(t,e,i,n);if(a===s.enumMultiPoint&&2===t.getDimension())return this.multipointIntersectsArea(e,t,n,i);let r,u,c=t,h=e;if(o===s.enumEnvelope&&(r=this.envelopeToPolygon(t),c=r,o=s.enumPolygon),a===s.enumEnvelope&&(u=this.envelopeToPolygon(e),h=u,a=s.enumPolygon),m(o)&&m(a)){const t=c.querySegmentIterator(),e=h.querySegmentIterator(),s=N(),o=N();if(q(c,h,t,e,s,o))return i.outPoint.assign(s.outPoint),n.outPoint.assign(s.outPoint),!0}}return!1}multipointIntersectsArea(t,e,i,s){const n=t.getPointCount();for(let o=0;o<n;++o){const n=[2],a=t.getXY(o);if(f(e,[a],1,this.m_tolerance,n),0!==n[0])return i.outPoint.assign(a),s.outPoint.assign(a),!0}return!1}getNearestNeighbourVisitor(t,e,i,s,o,a,m){return n(0),{}}buildSpatialTree(t,e){n(0)}}export{J as G,Q as a,L as m};
5
+ import{b as t,c as e}from"./tslib.es6.js";import{t as i,G as s,g as n,c as o,v as a,h as m}from"./Geometry.js";import{S as r,a as u}from"./QuadraticBezier.js";import{v as c,p as h,E as l,F as _,Q as p,R as d,S as g,U as x,V as y,W as P,w as S,X as f,t as D,Y as G,G as v}from"./ProjectionTransformation.js";import{h as T,a as b}from"./Envelope.js";import{Envelope2D as w}from"./Envelope2D.js";import{P as M,b as E,n as R,E as C,o as I}from"./Point2D.js";import{T as B}from"./Transformation2D.js";import{s as A,w as q,m as N}from"./Distance2DCalculator-C1KHhZwD.js";import{O as F}from"./OperatorShapePreservingDensify.js";import{O as Y}from"./OperatorClip.js";function X(){return new w}class k{[Symbol.dispose](){this.m_peR1.destroy(),this.m_peR2.destroy(),this.m_peR3.destroy(),this.m_peR1=null,this.m_peR2=null,this.m_peR3=null}constructor(t,e,i){this.m_peR1=new l,this.m_peR2=new l,this.m_peR3=new l,void 0!==t?this.reset(t,e,i):this.reset(1,0,1)}reset(t,e,i){this.m_a=t,this.m_e2=e,this.m_b=this.m_a*Math.sqrt(1-this.m_e2),this.m_unitToDegree=i,this.m_unitToRad=.017453292519943295*i,this.m_u180=180/this.m_unitToDegree,this.m_u360=360/this.m_unitToDegree}calculateBbox(t,e,i,s){const n=this.m_peR1,o=this.m_peR2,a=this.m_peR3;_.geodeticDistance(this.m_a,this.m_e2,t*this.m_unitToRad,e*this.m_unitToRad,i*this.m_unitToRad,s*this.m_unitToRad,a,n,o,0);const m=Math.cos(n.val),r=Math.cos(o.val+3.141592653589793),u=e*this.m_unitToRad,c=D.phiToEta(this.m_e2,u),h=Math.sin(n.val)*Math.cos(c);let l=e;if(m*r<0){const t=m<0?-1:1,e=Math.acos(Math.abs(h))*t;l=D.etaToPhi(this.m_e2,e)/this.m_unitToRad}let p=I((i-t)*this.m_unitToRad,2*Math.PI);Math.abs(p)>Math.PI&&(p=p>0?p-2*Math.PI:p+2*Math.PI),p/=this.m_unitToRad,i=t+p;const d=X();return d.xmin=Math.min(t,i),d.xmax=Math.max(t,i),d.ymin=Math.min(e,s),d.ymin=Math.min(d.ymin,l),d.ymax=Math.max(e,s),d.ymax=Math.max(d.ymax,l),d}minDistanceGeodesic(t,e){const i=O(t),s=O(e);if(i&&s)return this.lowerDistanceGeodetic_(t.xmin,t.ymin,e.xmin,e.ymin);const n=this.normalizeGeodesic_(e,t);return U(t,n)?t.ymin>=n.ymax?this.minDistanceGeodesicUpDown_(t,n):n.ymin>=t.ymax?this.minDistanceGeodesicUpDown_(n,t):t.xmin>n.xmax?this.minDistanceGeodesicLeftRight_(n,t):this.minDistanceGeodesicLeftRight_(t,n):0}normalizeGeodesic_(t,e){const i=t.clone(),s=t.clone();let n=V(i,e);if(0===n)return i;for(;s.xmax>e.xmin;){s.xmin-=this.m_u360,s.xmax-=this.m_u360;const t=V(s,e);if(t<n&&(i.assign(s),n=t,0===n))return i}for(s.assign(t);s.xmin<e.xmax;){s.xmin+=this.m_u360,s.xmax+=this.m_u360;const t=V(s,e);if(t<n&&(i.assign(s),n=t,0===n))return i}return i}lowerDistanceGeodetic_(t,e,i,s){const n=this.m_peR1;{const o=this.m_b*this.m_b/this.m_a,a=D.phiToPhig(this.m_e2,this.m_unitToRad*e),m=D.phiToPhig(this.m_e2,this.m_unitToRad*s);_.geodeticDistance(o,0,this.m_unitToRad*t,a,this.m_unitToRad*i,m,n,null,null,0)}return n.val}minDistanceGeodesicUpDown_(t,e){if(e.xmin<=t.xmin?e.xmax>=t.xmin:t.xmax>=e.xmin)return this.lowerDistanceGeodetic_(0,t.ymin,0,e.ymax);if(e.xmin>t.xmax){const i=this.lowerDistanceGeodeticSegMeridional_(t.xmax,t.ymin,t.ymax,e.xmin,e.ymin,e.ymax);if(e.xmax-t.xmin<this.m_u180)return i;const s=this.lowerDistanceGeodeticSegMeridional_(t.xmin,t.ymin,t.ymax,e.xmax,e.ymin,e.ymax);return Math.min(i,s)}{const i=this.lowerDistanceGeodeticSegMeridional_(t.xmin,t.ymin,t.ymax,e.xmax,e.ymin,e.ymax);if(t.xmax-e.xmin<this.m_u180)return i;const s=this.lowerDistanceGeodeticSegMeridional_(t.xmax,t.ymin,t.ymax,e.xmin,e.ymin,e.ymax);return Math.min(i,s)}}minDistanceGeodesicLeftRight_(t,e){let i=Math.abs(t.xmax-e.xmin);for(;i>this.m_u180;)i-=this.m_u360;let s=Math.abs(t.xmin-e.xmax);for(;s>this.m_u180;)s-=this.m_u360;return Math.abs(i)<=Math.abs(s)?this.minDistanceGeodesicLeftRightNormalized_(t,e):this.minDistanceGeodesicLeftRightNormalized_(e,t)}minDistanceGeodesicLeftRightNormalized_(t,e){let i,s;return i=this.lowerDistanceGeodetic_(t.xmax,t.ymin,e.xmin,e.ymin),t.ymin>=e.ymin&&t.ymin<=e.ymax&&(s=this.lowerDistanceGeodeticPtMeridional_(t.xmax,t.ymin,e.xmin,e.ymin,e.ymax),i=Math.min(i,s)),e.ymin>=t.ymin&&e.ymin<=t.ymax&&(s=this.lowerDistanceGeodeticPtMeridional_(e.xmin,e.ymin,t.xmax,t.ymin,t.ymax),i=Math.min(i,s)),s=this.lowerDistanceGeodetic_(t.xmax,t.ymax,e.xmin,e.ymax),i=Math.min(i,s),t.ymax>=e.ymin&&t.ymax<=e.ymax&&(s=this.lowerDistanceGeodeticPtMeridional_(t.xmax,t.ymax,e.xmin,e.ymin,e.ymax),i=Math.min(i,s)),e.ymax>=t.ymin&&e.ymax<=t.ymax&&(s=this.lowerDistanceGeodeticPtMeridional_(e.xmin,e.ymax,t.xmax,t.ymin,t.ymax),i=Math.min(i,s)),i}lowerDistanceGeodeticSegMeridional_(t,e,i,s,n,o){let a=this.lowerDistanceGeodeticPtMeridional_(t,e,s,n,o);const m=this.lowerDistanceGeodeticPtMeridional_(t,i,s,n,o);let r=this.lowerDistanceGeodeticPtMeridional_(s,n,t,e,i);const u=this.lowerDistanceGeodeticPtMeridional_(s,o,t,e,i);return a=Math.min(a,m),r=Math.min(r,u),Math.min(a,r)}lowerDistanceGeodeticPtMeridional_(t,e,i,s,n){const o=this.m_b*this.m_b/this.m_a,a=D.phiToPhig(this.m_e2,this.m_unitToRad*e),m=D.phiToPhig(this.m_e2,this.m_unitToRad*s),r=D.phiToPhig(this.m_e2,this.m_unitToRad*n),u=this.m_peR1,c=this.m_peR2;_.geodeticDistance(o,0,this.m_unitToRad*i,m,this.m_unitToRad*t,a,u,null,null,0),_.geodeticDistance(o,0,this.m_unitToRad*i,r,this.m_unitToRad*t,a,c,null,null,0);const h=p(1,0,new M(this.m_unitToRad*t,a)),l=p(1,0,new M(this.m_unitToRad*i,m)),d=p(1,0,new M(this.m_unitToRad*i,r));let g=new T;g.setCrossProductVector(l,d);const x=l.dotProduct(d);if(g.length()<1.568e-10)return x>=0?Math.min(u.val,c.val):0;g=g.getUnitVector();let y=new T;if(y.setCrossProductVector(g,h),y.length()<1.568e-10){return Math.min(u.val,c.val)-1e-5*o}y=y.getUnitVector();let P=h.sub(g.mul(h.dotProduct(g)));{const e=new T;e.setCrossProductVector(l,P);const i=new T;i.setCrossProductVector(P,d);let s=g.dotProduct(e)>0&&g.dotProduct(i)>0;if(s||(P.negateThis(),e.setCrossProductVector(l,P),i.setCrossProductVector(P,d),s=g.dotProduct(e)>0&&g.dotProduct(i)>0),s){P=P.getUnitVector();const e=G(1,0,P),i=this.m_peR3;_.geodeticDistance(o,0,this.m_unitToRad*t,a,e.x,e.y,i,null,null,0);const s=Math.min(u.val,c.val);return Math.min(s,i.val)}}return Math.min(u.val,c.val)}}function O(t){return t.xmin===t.xmax&&t.ymin===t.ymax}function U(t,e){return e.xmax<t.xmin||e.xmin>t.xmax||e.ymax<t.ymin||e.ymin>t.ymax}function V(t,e){let i,s=0;return i=t.xmin-e.xmax,i>s&&(s=i),i=e.xmin-t.xmax,i>s&&(s=i),s}class j{}function L(t){return{outPoint:void 0===t?new M:t.clone()}}function z(t,e){t.outPoint.assign(e.outPoint)}function H(){return new w}class Q{constructor(t,e,i,s,n=0,o=4){this.m_ptDistFrom=new M,this.m_segStartPt=new M,this.m_segEndPt=new M,this.m_geodeticLength=new l,this.m_az12=new l,this.m_minGeodeticDist=new l,this.m_segStartPt3d=new T,this.m_segEndPt3d=new T,this.m_sr=s,this.m_distCurveType=n,this.m_segCurveType=o,this.m_inputGCS=this.m_sr.getGCS(),this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_bIsPannablePcs=2===this.m_sr.getCoordinateSystemType()&&this.m_sr.isPannable();const a=v();this.m_inputGCS.querySpheroidData(a),this.m_a=a.majorSemiAxis,this.m_eSquared=a.e2,this.setPointDistFrom(t),this.setSegmentEndPoints(e,i)}setSegmentEndPoints(t,e){this.m_segStartPt.assign(t),this.m_segEndPt.assign(e),this.m_bIsPannablePcs||(this.m_segStartPt.mulThis(this.m_rpu),this.m_segEndPt.mulThis(this.m_rpu)),2===this.m_segCurveType&&(this.m_segStartPt3d.assign(p(this.m_a,this.m_eSquared,this.m_segStartPt)),this.m_segEndPt3d.assign(p(this.m_a,this.m_eSquared,this.m_segEndPt))),this.calculateAndUpdateSegmentLength()}setPointDistFrom(t){this.m_ptDistFrom.assign(t),this.m_ptDistFrom.scale(this.m_rpu)}setSegmentCurveType(t){this.m_segCurveType=t}setDistanceCurveType(t){this.m_distCurveType=t}makeFunctor(){return i=>{let s;switch(this.m_segCurveType){case 0:case 1:case 3:{const o={stack:[],error:void 0,hasError:!1};try{const e=t(o,new l,!1),n=t(o,new l,!1);_.geodeticCoordinate(this.m_a,this.m_eSquared,this.m_segStartPt.x,this.m_segStartPt.y,this.m_geodeticLength.val*i,this.m_az12.val,e,n,this.m_segCurveType),s=new M(e.val,n.val);break}catch(n){o.error=n,o.hasError=!0}finally{e(o)}}case 2:{const t=T.lerp(this.m_segStartPt3d,this.m_segEndPt3d,i);s=G(this.m_a,this.m_eSquared,t);break}case 4:s=M.lerp(this.m_segStartPt,this.m_segEndPt,i),this.m_bIsPannablePcs&&(g(this.m_sr,0,[s],1),s.mulThis(this.m_rpu));break;default:o("Invalid curve type")}return _.geodeticDistance(this.m_a,this.m_eSquared,this.m_ptDistFrom.x,this.m_ptDistFrom.y,s.x,s.y,this.m_minGeodeticDist,null,null,this.m_distCurveType),this.m_minGeodeticDist.val}}calculateAndUpdateSegmentLength(){switch(this.m_segCurveType){case 0:case 2:case 1:case 3:_.geodeticDistance(this.m_a,this.m_eSquared,this.m_segStartPt.x,this.m_segStartPt.y,this.m_segEndPt.x,this.m_segEndPt.y,this.m_geodeticLength,this.m_az12,null,this.m_segCurveType);break;case 4:this.m_geodeticLength.val=M.distance(this.m_segStartPt,this.m_segEndPt);break;default:o("Invalid curve type")}}[Symbol.dispose](){this.m_geodeticLength[Symbol.dispose](),this.m_az12[Symbol.dispose](),this.m_minGeodeticDist[Symbol.dispose]()}}function K(){return new j}class W{[Symbol.dispose](){this.m_envHelper[Symbol.dispose]()}constructor(t,e,i,s,n){this.m_boxGeomA=H(),this.m_boxGeomB=H(),this.m_envGeomA=new w,this.m_envGeomB=new w,this.m_progressCounter=0,this.m_transformPCS2GCS=null,this.m_segmentBoxesA=new Map,this.m_segmentBoxesB=new Map,this.m_boundaryPtsA=[],this.m_boundaryPtsB=[],this.m_scaleToRadians=new B,this.m_scaleToDegrees=new B,this.m_inputSR=t,this.m_distCurveType=e,this.m_progressTracker=i,this.m_maxDistance=s,this.m_maxDeviation=n,this.m_inputGCS=t.getGCS(),this.m_peGeogcs=this.m_inputGCS.getPECoordSys(),this.m_tolerance=0;const o=v();this.m_inputGCS.querySpheroidData(o),this.m_a=o.majorSemiAxis,this.m_eSquared=o.e2,this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_envHelper=new k(this.m_a,this.m_eSquared,1),4===this.m_distCurveType&&(this.m_distCurveType=0),this.m_boxGeomA.setEmpty(),this.m_boxGeomB.setEmpty(),this.m_envGeomA.setEmpty(),this.m_envGeomB.setEmpty(),this.m_bIsPannablePcs=2===this.m_inputSR.getCoordinateSystemType()&&this.m_inputSR.isPannable()}progress(t=!1){}calculate(t,e,i,s){const n=L(),o=L();if(t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB),this.checkGeometriesIntersect(t,e,n,o))return i&&z(i,n),s&&z(s,o),0;const a=this.prepareGeometry(t);if(a.isEmpty())return Number.NaN;const m=this.prepareGeometry(e);if(m.isEmpty())return Number.NaN;this.m_tolerance=this.computeTolerance(a,m);const r=this._ExecuteBruteForce(a,m,n,o);return r>=this.m_maxDistance?Number.NaN:(i&&(this.prepareOutput(n),z(i,n)),s&&(this.prepareOutput(o),z(s,o)),r)}createDistanceFunctor(t,e,i){const s=new Q(t,e,i,this.m_inputSR,this.m_distCurveType);return this.m_bIsPannablePcs||1===this.m_inputSR.getCoordinateSystemType()||s.setSegmentCurveType(2),s}_NormalizeAndProject(t){if(this.m_inputSR.isPannable()&&(t=(new c).foldInto360Range(t,this.m_inputSR)),2===this.m_inputSR.getCoordinateSystemType()){const e=h(this.m_inputSR,this.m_inputGCS,null);t=(new c).execute(t,e,this.m_progressTracker)}return t}_ExecuteBruteForce(t,e,n,o){switch(t.getGeometryType()){case s.enumPoint:return this.calculateDistanceGeodeticPointGeometry(t,e,n,o);case s.enumMultiPoint:return this.calculateDistanceGeodeticMultipointGeometry(t,e,n,o);case s.enumPolyline:case s.enumPolygon:case s.enumEnvelope:return this.calculateDistanceGeodeticMultipathGeometry(t,e,n,o);default:i("")}}calculateDistanceGeodeticPointGeometry(t,e,n,o){switch(e.getGeometryType()){case s.enumPoint:return this.calculateDistanceGeodeticPointPoint(t,e,n,o);case s.enumMultiPoint:return this.calculateDistanceGeodeticPointMultipoint(t,e,n,o);case s.enumPolyline:case s.enumPolygon:return this.calculateDistanceGeodeticPointMultipath(t,e,n,o);default:i("")}}calculateDistanceGeodeticPointPoint(i,s,n,o){const a={stack:[],error:void 0,hasError:!1};try{const e=i.getXY();e.scale(this.m_rpu);const m=s.getXY();m.scale(this.m_rpu),n.outPoint.assign(e),o.outPoint.assign(m);const r=t(a,new l,!1);return _.geodeticDistance(this.m_a,this.m_eSquared,e.x,e.y,m.x,m.y,r,null,null,this.m_distCurveType),r.val}catch(m){a.error=m,a.hasError=!0}finally{e(a)}}calculateDistanceGeodeticPointMultipoint(i,s,n,o){const a={stack:[],error:void 0,hasError:!1};try{this.computeEnvelopesAndBoxes(i,s);const e=this.estimateMinimumDistance(n,o);let m=e<this.m_maxDistance?e:this.m_maxDistance;const r=i.getXY();r.scale(this.m_rpu),n.outPoint.assign(r);const u=p(this.m_a,this.m_eSquared,r),c=new M,h=s.getImpl(),d=t(a,new l,!1),g=h.getPointCount();for(let t=0;t<g;++t){h.queryXY(t,c),c.scale(this.m_rpu);const e=p(this.m_a,this.m_eSquared,c);if(!(T.distance(u,e)>m)&&(!(this.m_envHelper.minDistanceGeodesic(this.m_boxGeomA,this.m_boxGeomB)>m)&&(_.geodeticDistance(this.m_a,this.m_eSquared,r.x,r.y,c.x,c.y,d,null,null,this.m_distCurveType),d.val<m&&(m=d.val,o.outPoint=c,0===m))))return m}return m===this.m_maxDistance?Number.POSITIVE_INFINITY:m}catch(m){a.error=m,a.hasError=!0}finally{e(a)}}calculateDistanceGeodeticPointMultipath(i,s,o,a){const m={stack:[],error:void 0,hasError:!1};try{const e=new M,r=new M;e.assign(i.getXY()),r.assign(i.getXY()),o.outPoint.assign(r.mul(this.m_rpu)),this.m_bIsPannablePcs&&d(this.m_inputSR,[e],1,!1),this.computeEnvelopesAndBoxes(i,s);const u=this.estimateMinimumDistance(o,a);let c=u<this.m_maxDistance?u:this.m_maxDistance;const h=s.getImpl(),l=new M(0,0),_=new M(0,0),p=[1],g=this.canUseSpatialTree(i,s),x=K();g&&this.buildSpatialTree(x,s);const y=H();y.setCoords({xmin:r.x,ymin:r.y,xmax:r.x,ymax:r.y});const P=t(m,this.createDistanceFunctor(r,l,_),!1),S=h.querySegmentIterator();if(S.stripAttributes(),g)n(0);else for(;S.nextPath();)for(;S.hasNextSegment();){const t=S.nextSegment(),i=this.findOrComputeBoxSegment(S.getStartPointIndex(),t,this.m_segmentBoxesB);if(this.m_envHelper.minDistanceGeodesic(y,i)>c)continue;const s=this.calculateDistanceGeodeticPointSegment(e,r,t,p,P);if(s.second<c&&(this.updateOutputSegment(a,t,s.first),c=s.second,0===c))return 0}return c===this.m_maxDistance?Number.POSITIVE_INFINITY:c}catch(r){m.error=r,m.hasError=!0}finally{e(m)}}calculateDistanceGeodeticMultipointGeometry(t,e,n,o){switch(e.getGeometryType()){case s.enumPoint:return this.calculateDistanceGeodeticPointMultipoint(e,t,o,n);case s.enumMultiPoint:return this.calculateDistanceGeodeticMultipointMultipoint(t,e,n,o);case s.enumPolyline:case s.enumPolygon:case s.enumEnvelope:return this.calculateDistanceGeodeticMultipointMultipath(t,e,n,o);default:i("")}}calculateDistanceGeodeticMultipointMultipoint(i,s,n,o){const a={stack:[],error:void 0,hasError:!1};try{const e=t(a,new l,!1);this.computeEnvelopesAndBoxes(i,s);const m=this.estimateMinimumDistance(n,o);let r=m<this.m_maxDistance?m:this.m_maxDistance;const u=new M,c=new M,h=i.getImpl(),d=s.getImpl(),g=H(),x=h.getPointCount(),y=d.getPointCount();for(let t=0;t<x;++t){if(u.assign(h.getXY(t)),g.setCoords({xmin:u.x,ymin:u.y,xmax:u.x,ymax:u.y}),this.m_envHelper.minDistanceGeodesic(g,this.m_boxGeomB)>r)continue;u.scale(this.m_rpu);const i=p(this.m_a,this.m_eSquared,u);for(let t=0;t<y;++t){c.assign(d.getXY(t)),c.scale(this.m_rpu);const s=p(this.m_a,this.m_eSquared,c);if(!(T.distance(i,s)>=r)&&(_.geodeticDistance(this.m_a,this.m_eSquared,u.x,u.y,c.x,c.y,e,null,null,this.m_distCurveType),e.val<r&&(n.outPoint.assign(u),o.outPoint.assign(c),r=e.val,0===r)))return r}}return r===this.m_maxDistance?Number.POSITIVE_INFINITY:r}catch(m){a.error=m,a.hasError=!0}finally{e(a)}}calculateDistanceGeodeticMultipointMultipath(i,s,o,a){const m={stack:[],error:void 0,hasError:!1};try{const e=s.getImpl().querySegmentIterator();e.stripAttributes(),this.computeEnvelopesAndBoxes(i,s);const r=this.estimateMinimumDistance(o,a);let u=r<this.m_maxDistance?r:this.m_maxDistance;const c=new M,h=new M(0,0),l=new M(0,0),_=new M(0,0),p=[0],g=H(),x=t(m,this.createDistanceFunctor(h,l,_),!1),y=K(),P=this.canUseSpatialTree(i,s);P&&this.buildSpatialTree(y,s);const S=i.getPointCount();for(let t=0;t<S;++t)if(c.assign(i.getXY(t)),h.assign(i.getXY(t)),this.m_bIsPannablePcs&&d(this.m_inputSR,[c],1,!1),g.setCoords({xmin:h.x,ymin:h.y,xmax:h.x,ymax:h.y}),!(this.m_envHelper.minDistanceGeodesic(g,this.m_boxGeomB)>u))if(x.setPointDistFrom(h),P)n(0);else{for(;e.nextPath();)for(;e.hasNextSegment();){const t=e.nextSegment();if(this.m_envHelper.minDistanceGeodesic(g,this.findOrComputeBoxSegment(e.getStartPointIndex(),t,this.m_segmentBoxesB))>u)continue;const i=this.calculateDistanceGeodeticPointSegment(c,h,t,p,x);if(i.second<u&&(o.outPoint.assign(h.mul(this.m_rpu)),this.updateOutputSegment(a,t,i.first),u=i.second,0===u))return 0}e.resetToFirstPath()}return u===this.m_maxDistance?Number.POSITIVE_INFINITY:u}catch(r){m.error=r,m.hasError=!0}finally{e(m)}}calculateDistanceGeodeticMultipathGeometry(t,e,n,o){switch(e.getGeometryType()){case s.enumPoint:return this.calculateDistanceGeodeticPointMultipath(e,t,o,n);case s.enumMultiPoint:return this.calculateDistanceGeodeticMultipointMultipath(e,t,o,n);case s.enumPolyline:case s.enumPolygon:case s.enumEnvelope:return this.calculateDistanceGeodeticMultipathMultipath(t,e,n,o);default:i("")}}calculateDistanceGeodeticMultipathMultipath(t,e,i,s){const n=[t],o=[e],a=this.swapGeometries(n,o),m=n[0],r=o[0];this.computeEnvelopesAndBoxes(n[0],o[0]);const u=this.estimateMinimumDistance(i,s),c=this.calculateDistanceGeodeticMultipathMultipath_(m,r,i,s,u);return a&&(s.outPoint=E(i.outPoint,i.outPoint=s.outPoint)),c}calculateDistanceGeodeticMultipathMultipath_(i,s,o,a,m=Number.MAX_VALUE){const u={stack:[],error:void 0,hasError:!1};try{let e=m;const c=new M(0,0),h=new M,l=new M(0,0),_=new M,p=new M(0,0),d=new M,y=new M,P=new M,S=[new M],f=[0],D=[0],G=H(),v=H(),T=t(u,this.createDistanceFunctor(p,c,l),!1),b=K(),w=this.canUseSpatialTree(i,s);w&&this.buildSpatialTree(b,s);const E=s.querySegmentIterator();E.stripAttributes();const R=new r,C=A(i);for(let t=0;t<C.length;++t){const s=C[t];i.getSegmentBuffer(s,R,!0);const m=R.get();if(G.assign(this.findOrComputeBoxSegment(s,m,this.m_segmentBoxesA)),w)n(0);else{if(p.assign(m.getStartXY()),d.assign(m.getStartXY()),y.assign(m.getEndXY()),P.assign(m.getEndXY()),this.m_bIsPannablePcs&&(g(this.m_inputSR,0,[d],1),g(this.m_inputSR,0,[P],1)),this.m_envHelper.minDistanceGeodesic(G,this.m_boxGeomB)>e)continue;for(;E.nextPath();){for(;E.hasNextSegment();){const t=E.nextSegment();if(c.assign(t.getStartXY()),h.assign(t.getStartXY()),l.assign(t.getEndXY()),_.assign(t.getEndXY()),m.intersect(t,S,f,D,this.m_tolerance))return this.updateOutputSegment(o,m,f[0]),this.updateOutputSegment(a,t,D[0]),0;if(this.m_bIsPannablePcs&&(g(this.m_inputSR,0,[h],1),g(this.m_inputSR,0,[_],1)),v.assign(this.findOrComputeBoxPoint(E.getStartPointIndex(),h,_,this.m_segmentBoxesB)),this.m_envHelper.minDistanceGeodesic(G,v)>e)continue;T.setSegmentEndPoints(c,l),T.setPointDistFrom(d);let i=x(T.makeFunctor(),0,1,1e-10);if(i.second<e&&(o.outPoint.assign(d.mul(this.m_rpu)),this.updateOutputSegment(a,t,i.first),e=i.second,0===e))break;if(T.setPointDistFrom(P),i=x(T.makeFunctor(),0,1,1e-10),i.second<e&&(o.outPoint.assign(P.mul(this.m_rpu)),this.updateOutputSegment(a,t,i.first),e=i.second,0===e))break;if(T.setSegmentEndPoints(p,y),T.setPointDistFrom(h),i=x(T.makeFunctor(),0,1,1e-10),i.second<e&&(this.updateOutputSegment(o,m,i.first),a.outPoint.assign(h.mul(this.m_rpu)),e=i.second,0===e))break;if(T.setPointDistFrom(_),i=x(T.makeFunctor(),0,1,1e-10),i.second<e&&(this.updateOutputSegment(o,m,i.first),a.outPoint.assign(_.mul(this.m_rpu)),e=i.second,0===e))break}if(0===e)return 0}E.resetToFirstPath()}}return e===this.m_maxDistance?Number.POSITIVE_INFINITY:e}catch(c){u.error=c,u.hasError=!0}finally{e(u)}}calculateDistanceGeodeticPointSegment(t,e,i,s,n){const o=i.getStartXY(),a=i.getEndXY();return i.intersectPoint(t,s,this.m_tolerance)?R(s[0],0):(n.setPointDistFrom(e),n.setSegmentEndPoints(o,a),x(n.makeFunctor(),0,1,1e-10))}prepareGeometry(t){let e=t.clone();const i=t.getGeometryType();if(i===s.enumPoint||i===s.enumMultiPoint)return this._NormalizeAndProject(e);if(i===s.enumEnvelope&&(e=this.envelopeToPolygon(e)),this.m_inputSR.isPannable())return this.prepareGeometryPannable(e,4);if(2===this.m_inputSR.getCoordinateSystemType()){if(e=y(e,this.m_inputSR,0,null),e.isEmpty())return e;e=(new F).execute(e,this.m_inputSR,5e4,this.m_maxDeviation/2,0,null);const t=this.m_inputSR.getSRToGCSTransform();return(new c).execute(e,t,this.m_progressTracker)}const n=new w;e.queryLooseEnvelope(n);const o=this.m_inputSR.getPannableExtent();if(n.ymin<o.ymin||n.ymax>o.ymax){const t=new w(n.xmin-1,o.ymin,n.xmax+1,o.ymax);if(e=(new Y).execute(e,t,this.m_inputSR,this.m_progressTracker),e.isEmpty())return e}return n.width()>2*o.width()?(e=P(e,-2*o.width(),2*o.width(),this.m_inputSR,!0,0,!0,this.m_progressTracker),e):e}prepareGeometryPannable(t,e){const i=new w;t.queryEnvelope(i);const s=this.m_inputSR.getPannableExtent();if(s.containsEnvelope(i))return t;const n=new C;s.queryIntervalX(n);const o=new C;return i.queryIntervalX(o),t=n.contains(o)?S(t,this.m_inputSR):(new c).foldInto360RangeGeodetic(t,this.m_inputSR,e)}prepareOutput(t){t.outPoint.scale(1/this.m_rpu),2===this.m_inputSR.getCoordinateSystemType()&&d(this.m_inputSR,[t.outPoint],1,!1)}updateOutputSegment(t,e,i){e.queryCoord2D(i,t.outPoint),this.m_bIsPannablePcs&&g(this.m_inputSR,0,[t.outPoint],1),t.outPoint.mulThis(this.m_rpu)}computeTolerance(t,e){t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB);const i=new w(this.m_envGeomA);return i.mergeEnvelope2D(this.m_envGeomB),b(null,i)}envelopeToPolygon(t){const e=new u;return e.addEnvelope(t,!1),e}computeEnvelopesAndBoxes(t,e){t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB),this.m_boxGeomA=this.computeBoxGeometry(t,this.m_boundaryPtsA,this.m_segmentBoxesA),this.m_boxGeomB=this.computeBoxGeometry(e,this.m_boundaryPtsB,this.m_segmentBoxesB)}computeBoxGeometry(t,e,i){switch(t.getGeometryType()){case s.enumPoint:return this.computeBoxPoint(t,e);case s.enumMultiPoint:return this.computeBoxMultiPoint(t,e);case s.enumPolyline:case s.enumPolygon:return this.computeBoxMultiPath(t,e,i);default:o("Invalid geometry type")}}computeBoxPoint(t,e){const i=t.getXY();e.length=0,e.push(i.mul(this.m_rpu));const s=H();return s.setCoords({xmin:i.x,ymin:i.y,xmax:i.x,ymax:i.y}),s}computeBoxMultiPoint(t,e){let i=!0;for(let n=0;n<t.getPointCount();++n){const s=t.getXY(n);if(i){e.length=0;for(let t=0;t<4;++t)e.push(s.clone());i=!1}s.x<e[0].x&&e[0].assign(s),s.y>e[1].y&&e[1].assign(s),s.x>e[2].x&&e[2].assign(s),s.y<e[3].y&&e[3].assign(s)}for(let n=0;n<e.length;++n)e[n].mulThis(this.m_rpu);const s=H();return t.queryEnvelope(s),s}computeBoxMultiPath(t,e,i){let s=!0;const n=H();n.setEmpty();const o=t.querySegmentIterator();for(o.stripAttributes();o.nextPath();)for(;o.hasNextSegment();){const t=o.nextSegment(),a=t.getStartXY(),m=t.getEndXY();if(this.m_bIsPannablePcs&&(g(this.m_inputSR,0,[a],1),g(this.m_inputSR,0,[m],1)),s){for(let t=0;t<4;++t)e.push(a.clone());s=!1}a.x<e[0].x&&e[0].assign(a),a.y>e[1].y&&e[1].assign(a),a.x>e[2].x&&e[2].assign(a),a.y<e[3].y&&e[3].assign(a),m.x<e[0].x&&e[0].assign(m),m.y>e[1].y&&e[1].assign(m),m.x>e[2].x&&e[2].assign(m),m.y<e[3].y&&e[3].assign(m);const r=this.findOrComputeBoxPoint(o.getStartPointIndex(),a,m,i);n.mergeEnvelope2D(r)}for(let a=0;a<e.length;++a)e[a].mulThis(this.m_rpu);return n}findOrComputeBoxSegment(t,e,i){if(!i.has(t)){let s=H();if(e.queryEnvelope(s),this.m_bIsPannablePcs){const t=M.construct(s.xmin,s.ymin),e=M.construct(s.xmax,s.ymax);g(this.m_inputSR,0,[t],1),g(this.m_inputSR,0,[e],1),s=this.m_envHelper.calculateBbox(t.x,t.y,e.x,e.y)}return i.set(t,s),s}return i.get(t)}findOrComputeBoxPoint(t,e,i,s){if(!s.has(t)){let n=H();return n.setCoords({xmin:e.x,ymin:e.y,xmax:i.x,ymax:i.y}),this.m_bIsPannablePcs&&(n=this.m_envHelper.calculateBbox(n.xmin,n.ymin,n.xmax,n.ymax)),s.set(t,n),n}return s.get(t)}estimateMinimumDistance(i,s){const n={stack:[],error:void 0,hasError:!1};try{const e=t=>p(this.m_a,this.m_eSquared,t),o=this.m_boundaryPtsA.map(e),a=this.m_boundaryPtsB.map(e);let m=Number.MAX_VALUE,r=0,u=0;for(let t=0;t<o.length;++t)for(let e=0;e<a.length;++e){const i=T.distance(o[t],a[e]);i<m&&(m=i,r=t,u=e)}i.outPoint.assign(this.m_boundaryPtsA[r]),s.outPoint.assign(this.m_boundaryPtsB[u]);const c=t(n,new l,!1);return _.geodeticDistance(this.m_a,this.m_eSquared,this.m_boundaryPtsA[r].x,this.m_boundaryPtsA[r].y,this.m_boundaryPtsB[u].x,this.m_boundaryPtsB[u].y,c,null,null,this.m_distCurveType),c.val}catch(o){n.error=o,n.hasError=!0}finally{e(n)}}swapGeometries(t,e){return a(t[0])>a(e[0])&&(e[0]=E(t[0],t[0]=e[0]),this.m_envGeomB=E(this.m_envGeomA,this.m_envGeomA=this.m_envGeomB),!0)}canUseSpatialTree(t,e){return!1}checkGeometriesIntersect(t,e,i,n){let o=t.getGeometryType(),a=e.getGeometryType();if(this.m_envGeomA.isIntersecting(this.m_envGeomB)){if(o===s.enumPoint&&2===e.getDimension()){const s=[0],o=[t.getXY()];if(f(e,o,1,this.m_tolerance,s),0!==s[0])return i.outPoint.assign(o[0]),n.outPoint.assign(o[0]),!0}else if(a===s.enumPoint&&2===t.getDimension()){const s=[2],o=[e.getXY()];if(f(t,o,1,this.m_tolerance,s),0!==s[0])return i.outPoint.assign(o[0]),n.outPoint.assign(o[0]),!0}if(o===s.enumMultiPoint&&2===e.getDimension())return this.multipointIntersectsArea(t,e,i,n);if(a===s.enumMultiPoint&&2===t.getDimension())return this.multipointIntersectsArea(e,t,n,i);let r,u,c=t,h=e;if(o===s.enumEnvelope&&(r=this.envelopeToPolygon(t),c=r,o=s.enumPolygon),a===s.enumEnvelope&&(u=this.envelopeToPolygon(e),h=u,a=s.enumPolygon),m(o)&&m(a)){const t=c.querySegmentIterator(),e=h.querySegmentIterator(),s=N(),o=N();if(q(c,h,t,e,s,o))return i.outPoint.assign(s.outPoint),n.outPoint.assign(s.outPoint),!0}}return!1}multipointIntersectsArea(t,e,i,s){const n=t.getPointCount();for(let o=0;o<n;++o){const n=[2],a=t.getXY(o);if(f(e,[a],1,this.m_tolerance,n),0!==n[0])return i.outPoint.assign(a),s.outPoint.assign(a),!0}return!1}getNearestNeighbourVisitor(t,e,i,s,o,a,m){return n(0),{}}buildSpatialTree(t,e){n(0)}}export{W as G,Q as a,L as m};