@arcgis/core 4.34.0-next.50 → 4.34.0-next.51

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 (256) hide show
  1. package/analysis/ElevationProfile/GroundLine.d.ts +4 -0
  2. package/analysis/ElevationProfile/GroundLine.js +5 -0
  3. package/analysis/ElevationProfile/InputLine.d.ts +4 -0
  4. package/analysis/ElevationProfile/InputLine.js +5 -0
  5. package/analysis/ElevationProfile/Line.d.ts +4 -0
  6. package/analysis/ElevationProfile/Line.js +5 -0
  7. package/analysis/ElevationProfile/LineChartOptions.d.ts +4 -0
  8. package/analysis/ElevationProfile/LineChartOptions.js +5 -0
  9. package/analysis/ElevationProfile/LineViewOptions.d.ts +4 -0
  10. package/analysis/ElevationProfile/LineViewOptions.js +5 -0
  11. package/analysis/ElevationProfile/QueryLine.d.ts +4 -0
  12. package/analysis/ElevationProfile/QueryLine.js +5 -0
  13. package/analysis/ElevationProfile/SceneLine.d.ts +4 -0
  14. package/analysis/ElevationProfile/SceneLine.js +5 -0
  15. package/analysis/ElevationProfile/Units.d.ts +4 -0
  16. package/analysis/ElevationProfile/Units.js +5 -0
  17. package/analysis/ElevationProfile/ViewOptions.d.ts +4 -0
  18. package/analysis/ElevationProfile/ViewOptions.js +5 -0
  19. package/analysis/ElevationProfile/elevationProfileLineTypes.js +5 -0
  20. package/analysis/ElevationProfileAnalysis.js +1 -1
  21. package/assets/esri/core/workers/RemoteClient.js +1 -1
  22. package/assets/esri/core/workers/chunks/{7bd672e534cde0d5787d.js → 0021118bafefd1e47ff7.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{0b52c0ca432761076076.js → 081b22fa73ef7b696409.js} +2 -2
  24. package/assets/esri/core/workers/chunks/0a6d33d013628f671aea.js +1 -0
  25. package/assets/esri/core/workers/chunks/0ce671588de2858516d2.js +1 -0
  26. package/assets/esri/core/workers/chunks/14c6ae4feb4859cfa7c5.js +1 -0
  27. package/assets/esri/core/workers/chunks/20a2b3d1f826e9059884.js +1 -0
  28. package/assets/esri/core/workers/chunks/{c4651243525026e6ddde.js → 2da12a64d3baef4aaaa1.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{3610357c8fa9bec9e0dc.js → 30169cf969d36ea8654e.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{5b0c42bb95d81085061d.js → 35fc8a64674005b1d1d7.js} +1 -1
  31. package/assets/esri/core/workers/chunks/37a97e690786814bf0b3.js +1 -0
  32. package/assets/esri/core/workers/chunks/38f84294fb2fb4663ba5.js +1 -0
  33. package/assets/esri/core/workers/chunks/3eb3af0b6cf3c2f28131.js +1 -0
  34. package/assets/esri/core/workers/chunks/48e64f99720907017778.js +1 -0
  35. package/assets/esri/core/workers/chunks/4bd92232928b832dea76.js +1 -0
  36. package/assets/esri/core/workers/chunks/50e9eafb118d2a221f10.js +1 -0
  37. package/assets/esri/core/workers/chunks/55588e668b6acb6aa390.js +1 -0
  38. package/assets/esri/core/workers/chunks/5b112471dca94b2e8462.js +1 -0
  39. package/assets/esri/core/workers/chunks/5dfe1aed10095385c066.js +1 -0
  40. package/assets/esri/core/workers/chunks/7389841fabe0f319f1e5.js +1 -0
  41. package/assets/esri/core/workers/chunks/77493aa2118d462612a0.js +1 -0
  42. package/assets/esri/core/workers/chunks/7a8d740d1226719a578a.js +1 -0
  43. package/assets/esri/core/workers/chunks/8e0559cc6295008fcdf7.js +1 -0
  44. package/assets/esri/core/workers/chunks/{69e37365c17e7cc4168f.js → 93af38d29d066f27ed28.js} +1 -1
  45. package/assets/esri/core/workers/chunks/944fa8261aad94ae0542.js +1 -0
  46. package/assets/esri/core/workers/chunks/{6775d2ab5faf1fa161db.js → 97a38d700f2cb8807d51.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{45121b7258333c8ebbdb.js → 98ea12c7a000a30f3dc0.js} +1 -1
  48. package/assets/esri/core/workers/chunks/9e479e7e2e51476c3d27.js +1 -0
  49. package/assets/esri/core/workers/chunks/a1e179dd6de9c8769b02.js +1 -0
  50. package/assets/esri/core/workers/chunks/a829969ed44cdb814f27.js +1 -0
  51. package/assets/esri/core/workers/chunks/ac41b882f9cbf8d56f0c.js +1 -0
  52. package/assets/esri/core/workers/chunks/b0ee061747bef6729bb9.js +1 -0
  53. package/assets/esri/core/workers/chunks/b2a035befeeff1a55ad8.js +1 -0
  54. package/assets/esri/core/workers/chunks/ba45dccb4dab5a74d224.js +1 -0
  55. package/assets/esri/core/workers/chunks/c5b2a261d8c216ca4a10.js +1 -0
  56. package/assets/esri/core/workers/chunks/{edc4f230a5bdf928f9fd.js → d1aeb9fe9eb573beefcc.js} +2 -2
  57. package/assets/esri/core/workers/chunks/e3f68f7b408a08d7cd5d.js +1 -0
  58. package/assets/esri/core/workers/chunks/e9716995ce0c3683eafc.js +1 -0
  59. package/assets/esri/core/workers/chunks/{4cc982c99d84e896d535.js → ed25bf087f52e5d3e71b.js} +1 -1
  60. package/assets/esri/core/workers/chunks/f92e608931b1c168cb45.js +1 -0
  61. package/assets/esri/core/workers/chunks/f9f94b5efa9a64cdb407.js +1 -0
  62. package/assets/esri/core/workers/chunks/fb4950995f6780f6c22a.js +1 -0
  63. package/assets/esri/themes/base/widgets/_VideoPlayer.scss +16 -2
  64. package/assets/esri/themes/dark/main.css +1 -1
  65. package/assets/esri/themes/light/main.css +1 -1
  66. package/assets/esri/themes/light/view.css +1 -1
  67. package/chunks/Laserlines.glsl.js +12 -12
  68. package/chunks/sphere.js +1 -1
  69. package/chunks/vec42.js +1 -1
  70. package/config.js +1 -1
  71. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  72. package/core/libs/gl-matrix-2/math/vec4.js +1 -1
  73. package/geometry/projection/projectBoundingSphere.js +1 -1
  74. package/geometry/support/DoubleArray.js +1 -1
  75. package/geometry/support/aaBoundingRect.js +1 -1
  76. package/geometry/support/curves/bezierCurveUtils.js +1 -1
  77. package/geometry/support/curves/circleUtils.js +1 -1
  78. package/geometry/support/curves/ellipticArc4Utils.js +1 -1
  79. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  80. package/geometry/support/curves/mathUtils.js +1 -1
  81. package/geometry/support/sphere.js +1 -1
  82. package/interfaces.d.ts +271 -279
  83. package/kernel.js +1 -1
  84. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  85. package/layers/mixins/ArcGISImageService.js +1 -1
  86. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  87. package/package.json +1 -1
  88. package/support/revision.js +1 -1
  89. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  90. package/views/2d/engine/imagery/RasterTileContainer.js +1 -1
  91. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  92. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +5 -0
  93. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/AspectTechnique.js +1 -1
  94. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BandArithmeticTechnique.js +1 -1
  95. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BaseRasterProcessorTechnique.js +1 -1
  96. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ColormapToRGBTechnique.js +1 -1
  97. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CompositeBandTechnique.js +1 -1
  98. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ComputeChangeTechnique.js +1 -1
  99. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ContrastBrightnessTechnique.js +1 -1
  100. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ConvolutionTechnique.js +1 -1
  101. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CurvatureTechnique.js +1 -1
  102. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ExtractBandTechnique.js +1 -1
  103. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/FocalStatisticsTechnique.js +1 -1
  104. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/GrayscaleTechnique.js +1 -1
  105. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/HillshadeTechnique.js +1 -1
  106. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/LocalTechnique.js +1 -1
  107. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/MaskTechnique.js +1 -1
  108. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/NDVITechnique.js +1 -1
  109. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/RemapTechnique.js +1 -1
  110. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ReprojectTechnique.js +1 -1
  111. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ShadedReliefTechnique.js +1 -1
  112. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/SlopeTechnique.js +1 -1
  113. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/StretchTechnique.js +1 -1
  114. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
  115. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterColorizerShader.js +1 -1
  116. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterRangeHighlightShader.js +5 -0
  117. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  118. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  119. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  120. package/views/2d/layers/imagery/ImageryView2D.js +1 -1
  121. package/views/3d/analysis/ElevationProfile/ProfileLinesVisualization.js +1 -1
  122. package/views/3d/analysis/ElevationProfile/SceneLineComputation.js +5 -0
  123. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  124. package/views/3d/analysis/VolumeMeasurement/CutFillVolumeMeasurementController.js +1 -1
  125. package/views/3d/analysis/support/measurementUtils.js +1 -1
  126. package/views/3d/camera/constraintUtils/distance.js +1 -1
  127. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  128. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  129. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  130. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  131. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  132. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  133. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  134. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  135. package/views/3d/interactive/visualElements/SlicePlaneVisualElement.js +1 -1
  136. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  137. package/views/3d/layers/I3SMeshView3D.js +1 -1
  138. package/views/3d/layers/SceneLayerWorker.js +1 -1
  139. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  140. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  141. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  142. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  143. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  144. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  145. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  146. package/views/3d/layers/i3s/I3SProjectionUtil.js +1 -1
  147. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  148. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  149. package/views/3d/state/NearFarHeuristic.js +1 -1
  150. package/views/3d/state/ViewStateManager.js +1 -1
  151. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  152. package/views/3d/state/utils/navigationUtils.js +1 -1
  153. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  154. package/views/3d/support/orientedBoundingBox.js +1 -1
  155. package/views/3d/terrain/OverlayManager.js +1 -1
  156. package/views/3d/terrain/ScaleRangeQueries.js +1 -1
  157. package/views/3d/terrain/SphericalPatch.js +1 -1
  158. package/views/3d/terrain/TerrainSurface.js +1 -1
  159. package/views/3d/terrain/Tile.js +1 -1
  160. package/views/3d/webgl/RenderCamera.js +1 -1
  161. package/views/3d/webgl-engine/Stage.js +1 -1
  162. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  163. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  164. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  165. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  166. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  167. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  168. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  169. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  170. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  171. package/views/3d/webgl-engine/lib/screenSizePerspectiveUtils.js +1 -1
  172. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  173. package/views/analysis/ElevationProfile/Controller.js +5 -0
  174. package/views/analysis/ElevationProfile/GroundLineComputation.js +5 -0
  175. package/views/analysis/ElevationProfile/InputLineComputation.js +5 -0
  176. package/views/analysis/ElevationProfile/LineComputation.js +5 -0
  177. package/views/analysis/ElevationProfile/QueryLineComputation.js +5 -0
  178. package/views/analysis/ElevationProfile/Result.d.ts +4 -0
  179. package/views/analysis/{ElevationProfileResult.js → ElevationProfile/Result.js} +1 -1
  180. package/views/interactive/coordinateHelper.js +1 -1
  181. package/views/interactive/editGeometry/operations/curveOperationUtils.js +1 -1
  182. package/views/interactive/sketch/constraints.js +1 -1
  183. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  184. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  185. package/views/support/LayerLayerViewInfo.js +1 -1
  186. package/views/support/LayerViewManager.js +1 -1
  187. package/widgets/ElevationProfile/ElevationProfileLine.d.ts +2 -2
  188. package/widgets/ElevationProfile/ElevationProfileLineGround.d.ts +2 -2
  189. package/widgets/ElevationProfile/ElevationProfileLineInput.d.ts +2 -2
  190. package/widgets/ElevationProfile/ElevationProfileLineQuery.d.ts +2 -2
  191. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  192. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  193. package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +5 -0
  194. package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
  195. package/widgets/VideoPlayer/css.js +1 -1
  196. package/widgets/VideoPlayer.js +1 -1
  197. package/analysis/ElevationProfileLine.d.ts +0 -4
  198. package/analysis/ElevationProfileLine.js +0 -5
  199. package/analysis/ElevationProfileLineChartOptions.d.ts +0 -4
  200. package/analysis/ElevationProfileLineChartOptions.js +0 -5
  201. package/analysis/ElevationProfileLineGround.d.ts +0 -4
  202. package/analysis/ElevationProfileLineGround.js +0 -5
  203. package/analysis/ElevationProfileLineInput.d.ts +0 -4
  204. package/analysis/ElevationProfileLineInput.js +0 -5
  205. package/analysis/ElevationProfileLineQuery.d.ts +0 -4
  206. package/analysis/ElevationProfileLineQuery.js +0 -5
  207. package/analysis/ElevationProfileLineScene.d.ts +0 -4
  208. package/analysis/ElevationProfileLineScene.js +0 -5
  209. package/analysis/ElevationProfileLineViewOptions.d.ts +0 -4
  210. package/analysis/ElevationProfileLineViewOptions.js +0 -5
  211. package/analysis/ElevationProfileUnits.d.ts +0 -4
  212. package/analysis/ElevationProfileUnits.js +0 -5
  213. package/analysis/ElevationProfileViewOptions.d.ts +0 -4
  214. package/analysis/ElevationProfileViewOptions.js +0 -5
  215. package/analysis/support/elevationProfileLineTypes.js +0 -5
  216. package/assets/esri/core/workers/chunks/21a90083f29e44ccd735.js +0 -1
  217. package/assets/esri/core/workers/chunks/224872bfd923cf4c9d78.js +0 -1
  218. package/assets/esri/core/workers/chunks/237c96d946efa5ed0386.js +0 -1
  219. package/assets/esri/core/workers/chunks/2942ab268f24cea2e722.js +0 -1
  220. package/assets/esri/core/workers/chunks/32789077e37d5c8191e7.js +0 -1
  221. package/assets/esri/core/workers/chunks/3e3886a51c0f8c86df75.js +0 -1
  222. package/assets/esri/core/workers/chunks/6d786fac4bb5efcb7acc.js +0 -1
  223. package/assets/esri/core/workers/chunks/7b95da70d39ba316b051.js +0 -1
  224. package/assets/esri/core/workers/chunks/7df8c78e36b04ad657d2.js +0 -1
  225. package/assets/esri/core/workers/chunks/838c7fd37b2e78b1d582.js +0 -1
  226. package/assets/esri/core/workers/chunks/8c6119dde0eead8d90d9.js +0 -1
  227. package/assets/esri/core/workers/chunks/8c8c8f1058a4b58a3181.js +0 -1
  228. package/assets/esri/core/workers/chunks/8f70650aba8e55eb7a96.js +0 -1
  229. package/assets/esri/core/workers/chunks/96a34b240d17147902f4.js +0 -1
  230. package/assets/esri/core/workers/chunks/9af47a4da3a0b84f1add.js +0 -1
  231. package/assets/esri/core/workers/chunks/9affcf990ea810fa426b.js +0 -1
  232. package/assets/esri/core/workers/chunks/a3dce23ca98c9b0f945f.js +0 -1
  233. package/assets/esri/core/workers/chunks/a50026e567b1edff87c6.js +0 -1
  234. package/assets/esri/core/workers/chunks/a7ff44157b8cf19de37e.js +0 -1
  235. package/assets/esri/core/workers/chunks/b884bd2f50aaccfa24c5.js +0 -1
  236. package/assets/esri/core/workers/chunks/c483d2149d9d0099bfdb.js +0 -1
  237. package/assets/esri/core/workers/chunks/cfc3f202e7313ca56823.js +0 -1
  238. package/assets/esri/core/workers/chunks/d1c97fdcba6eb443cb1c.js +0 -1
  239. package/assets/esri/core/workers/chunks/d7c679374aa2d256becf.js +0 -1
  240. package/assets/esri/core/workers/chunks/d8d17e3ecccec7e99f0b.js +0 -1
  241. package/assets/esri/core/workers/chunks/e4069352d5d1104749ae.js +0 -1
  242. package/assets/esri/core/workers/chunks/e408ccee12bfe089c913.js +0 -1
  243. package/assets/esri/core/workers/chunks/e5522c85ca4f0efab8ea.js +0 -1
  244. package/assets/esri/core/workers/chunks/e59e09766b130a05c617.js +0 -1
  245. package/assets/esri/core/workers/chunks/ef02e33ea53b46b566cb.js +0 -1
  246. package/assets/esri/core/workers/chunks/ff79a8df1b1941ae350d.js +0 -1
  247. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +0 -5
  248. package/views/analysis/ElevationProfile/ElevationProfileController.js +0 -5
  249. package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +0 -5
  250. package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +0 -5
  251. package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +0 -5
  252. package/views/analysis/ElevationProfile/ElevationProfileLineQueryComputation.js +0 -5
  253. package/views/analysis/ElevationProfileResult.d.ts +0 -4
  254. package/views/support/PixelHighlightOptions.js +0 -5
  255. /package/assets/esri/core/workers/chunks/{edc4f230a5bdf928f9fd.js.LICENSE.txt → d1aeb9fe9eb573beefcc.js.LICENSE.txt} +0 -0
  256. /package/views/analysis/ElevationProfile/{profileUtils.js → profileGenerationUtils.js} +0 -0
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{min as o}from"../../../core/arrayUtils.js";import{createTask as i}from"../../../core/asyncUtils.js";import{makeHandle as s}from"../../../core/handleUtils.js";import{LRUCache as r}from"../../../core/LRUCache.js";import{mapCollection as a}from"../../../core/mapCollectionUtils.js";import{destroyMaybe as n,abortMaybe as l}from"../../../core/maybe.js";import{memoize as p}from"../../../core/memoize.js";import{throwIfAborted as u,throwIfAbortError as m}from"../../../core/promiseUtils.js";import{watch as c,syncAndInitial as h,on as _}from"../../../core/reactiveUtils.js";import{throttle as d}from"../../../core/throttle.js";import{adaptiveLengthUnit as f,adaptiveVerticalLengthUnit as y}from"../../../core/unitUtils.js";import{property as v}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as g}from"../../../core/accessorSupport/decorators/subclass.js";import{ElevationQueryTileCache as C}from"../../../layers/support/ElevationQueryTileCache.js";import{hasGraphicFeatureExpressionInfo as P,getGraphicEffectiveElevationInfo as T}from"../../../support/elevationInfoUtils.js";import{getDefaultUnitForView as U}from"../../../support/getDefaultUnitForView.js";import{getConfig as j}from"./constants.js";import{isValidInputPath as R,getInputGeometry as w,getInputGraphic as M}from"./geometryUtils.js";import{createProfileQueue as z,generateProfiles as D}from"./profileGenerationUtils.js";import{getBoundsInMeters as b,mergeStatistics as I}from"./statisticsUtils.js";let x=class extends e{constructor(t){super(t),this.error=null,this._getEffectiveUnitsMemoized=p((t,e)=>({distance:t,elevation:e})),this._updateTask=null,this._queue=null,this._currentTileCache=null,this._parametersPerComputation=new Map,this._getUpdateParametersMemoized=p((t,e,o)=>({stationary:t,activeComputations:e,generationParameters:o})),this._getGenerationParametersMemoized=p((t,e,o,i,s,r,a)=>R(e)&&null!=i?{view:t,geometry:e,elevationInfo:o,options:r,queue:i,cache:s,slicePlane:a}:null),this._getElevationInfoMemoized=p((t,e)=>({mode:t,offset:e})),this._getOptionsMemoized=p((t,e)=>{const{densificationMaxSamples:o,maxTotalSamples:i}=j();return{samplingDistance:t,densificationMaxSamples:Math.round(o/e),maxTotalSamples:i}}),this._updateThrottled=d(t=>this._update(t),j().updateThrottleMillis)}initialize(){this._computationsCollection=a(()=>this.analysis.profiles,t=>this.computationFactory.create({controller:this,profileLine:t,onInvalidate:t=>this._invalidateComputation(t)}),{recycleItems:!0}),this.addHandles([this._computationsCollection.on("change",()=>{this._parametersPerComputation.clear(),this._updateThrottled(this._updateParameters)}),c(()=>this._updateParameters,t=>this._updateThrottled(t),h),this._updateThrottled]);const t="3d"===this.view.type?this.view.resourceController:void 0;this._queue=z(t?.scheduler),t?.addUpdatingObject(this)}destroy(){this._abortUpdate(),this._parametersPerComputation.clear(),this._computationsCollection?.destroy(),this._queue=n(this._queue),this._currentTileCache=n(this._currentTileCache)}get effectiveUnits(){const t=b(this._activeComputations.map(t=>t.result.rawResult)),e=this.analysis.units,o=U(this.view),i=f(t.maxDistance,"meters",e.distance??o),s=y(t.maxElevation,"meters",e.elevation??o);return this._getEffectiveUnitsMemoized(i,s)}get progress(){let t=0,e=0;for(const o of this._activeComputations)t++,e+=o.progress;return t>0?e/t:0}get updating(){const{progress:t}=this;return t>0&&t<1||!!this._queue?.updating||this._updateThrottled.hasPendingUpdates()||null!=this._updateTask&&!this._updateTask.finished}get results(){return this._computations.map(t=>t.result)}get statistics(){return I(this._activeComputations.map(t=>t.result.statistics))}get hoveredPoints(){return this._computations.map(t=>t.hoveredPoint)}onElevationChange(t){const{view:e}=this;return"3d"===e?.type?_(()=>e.elevationProvider,"elevation-change",t,{onListenerAdd:t,onListenerRemove:t}):s()}get _tileCache(){this._currentTileCache=n(this._currentTileCache);const t=this.view;if("3d"===t?.type){const e=t.basemapTerrain?.elevationQueryCache;if(null!=e)return e}return null==this._currentTileCache&&(this._currentTileCache=new C(new r(20971520))),this._currentTileCache}get _computations(){return this._computationsCollection?.toArray()??[]}get _activeComputations(){return this._computations.filter(t=>t.profileLine.enabled&&t.available)}get _minDemResolution(){const t=this._minDemResolutions;return t.length>0?o(t):null}get _minDemResolutions(){const t=[];for(const{minDemResolution:e}of this._activeComputations)null!=e&&t.push(e);return t}get _updateParameters(){const{view:t}=this;return this._getUpdateParametersMemoized(t?.stationary??!0,this._activeComputations,this._generationParameters)}get _generationParameters(){const{view:t}=this;return null!=t&&t.ready?this._getGenerationParametersMemoized(t,this._inputGeometry,this._elevationInfo,this._queue,this._tileCache,this._options,"3d"===t.type?t.slice.plane:null):null}get _inputGeometry(){return w(this.analysis.input)}get _elevationInfo(){const t=M(this.analysis.input);if(!t)return null;const e=t?P(t)?null:T(t):null;return null!=e?this._getElevationInfoMemoized(e.mode,e.offset):null}get _options(){const t=this._activeComputations.length;let e=this._minDemResolution??j().defaultDemResolution;return e=parseFloat(e.toFixed(2)),this._getOptionsMemoized(e,t)}_update({stationary:t,activeComputations:e,generationParameters:o}){this._abortUpdate(),t&&(null!=o?this._updateTask=i(async t=>{this.error=null;const i=e.filter(t=>!this._isComputationValid(t,o)),s=D({...o,providers:i},{signal:t});try{for await(const e of s){u(t),this._clearInvalidResults(o);for(let t=0;t<i.length;t++)i[t].setResult(e[t])}for(const t of i)this._parametersPerComputation.set(t,o)}catch(r){m(r),this._abortUpdate(),this.error=r,i.forEach(t=>{t.clearResult()})}}):this._clearResults())}_abortUpdate(){this._updateTask=l(this._updateTask)}_isComputationValid(t,e){return this._parametersPerComputation.has(t)&&this._parametersPerComputation.get(t)===e}_invalidateComputation(t){this._parametersPerComputation.delete(t),this._updateThrottled(this._updateParameters)}_clearInvalidResults(t){for(const e of this._computations)this._isComputationValid(e,t)||(e.clearResult(),this._parametersPerComputation.delete(e))}_clearResults(){for(const t of this._computations)t.clearResult(),this._parametersPerComputation.delete(t)}};t([v({constructOnly:!0})],x.prototype,"analysis",void 0),t([v({constructOnly:!0})],x.prototype,"analysisViewData",void 0),t([v({constructOnly:!0})],x.prototype,"computationFactory",void 0),t([v({constructOnly:!0})],x.prototype,"view",void 0),t([v()],x.prototype,"error",void 0),t([v({readOnly:!0})],x.prototype,"effectiveUnits",null),t([v()],x.prototype,"progress",null),t([v()],x.prototype,"updating",null),t([v()],x.prototype,"results",null),t([v()],x.prototype,"statistics",null),t([v()],x.prototype,"hoveredPoints",null),t([v()],x.prototype,"_queue",void 0),t([v()],x.prototype,"_tileCache",null),t([v()],x.prototype,"_computationsCollection",void 0),t([v()],x.prototype,"_computations",null),t([v()],x.prototype,"_activeComputations",null),t([v({readOnly:!0})],x.prototype,"_minDemResolution",null),t([v()],x.prototype,"_minDemResolutions",null),t([v()],x.prototype,"_updateParameters",null),t([v()],x.prototype,"_generationParameters",null),t([v()],x.prototype,"_inputGeometry",null),t([v()],x.prototype,"_elevationInfo",null),t([v()],x.prototype,"_options",null),x=t([g("esri.views.analysis.ElevationProfile.Controller")],x);export{x as Controller};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as e}from"tslib";import{memoize as r}from"../../../core/memoize.js";import{watch as o}from"../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as t}from"../../../core/unitUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{getGroundMinDemResolution as s}from"./elevationQuerySourceUtils.js";import{LineComputation as a}from"./LineComputation.js";let l=class extends a{constructor(){super(...arguments),this.type="ground",this.numSamplesForPreview=50,this.numSamplesPerChunk=1e3,this._getQueryElevationDependencies=r((e,r)=>({ground:e,groundLayers:r}))}get minDemResolution(){return s(this._ground)}get available(){return!0===this._ground?.layers.some(e=>e.visible)}initialize(){this.addHandles([o(()=>this._queryElevationDependencies,()=>this.onInvalidate(this))])}async queryElevation(e,r){const o=this._queryElevationDependencies;if(null==o)throw new Error(`${this.declaredClass}: no dependencies`);const{ground:i}=o;if(null==i)throw new Error("No ground configured in the view");const n=await i.queryElevation(e,r),s=t(e.spatialReference),a=t(i.layers.at(0).spatialReference);if(s!==a){const e=n.geometry;e.points=e.points.map(([e,o,t])=>[e,o,t===r.noDataValue?t:t*a/s])}return n}get _queryElevationDependencies(){return this._getQueryElevationDependencies(this._ground,this._ground?.layers?.toArray())}get _ground(){return this.controller.view?.map?.ground}};e([i()],l.prototype,"minDemResolution",null),e([i()],l.prototype,"available",null),e([i()],l.prototype,"_queryElevationDependencies",null),e([i()],l.prototype,"_ground",null),l=e([n("esri.views.analysis.ElevationProfile.GroundLineComputation")],l);export{l as GroundLineComputation};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as e}from"tslib";import{memoize as t}from"../../../core/memoize.js";import{watch as o}from"../../../core/reactiveUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{GeometryDescriptor as n}from"../../../layers/support/ElevationQuery.js";import{getGraphicEffectiveElevationInfo as s}from"../../../support/elevationInfoUtils.js";import{getInputGraphic as a}from"./geometryUtils.js";import{LineComputation as l}from"./LineComputation.js";let p=class extends l{constructor(){super(...arguments),this.type="input",this.numSamplesForPreview=50,this.numSamplesPerChunk=500,this._getQueryElevationDependenciesMemoized=t((e,t,o,r,i)=>e&&o?{elevationInfo:e,visibleLayers:t,view:o,stationary:r,spatialReference:i}:null)}get available(){return!this.controller.analysisViewData.inputIsSketched}initialize(){const e=()=>this.onInvalidate(this);this.addHandles([o(()=>this._queryElevationDependencies,e),this.controller.onElevationChange(e)])}async queryElevation(e,{noDataValue:t,signal:o}){const r=this._queryElevationDependencies;if(null==r)throw new Error(`${this.declaredClass}: no dependencies`);const{view:i,elevationInfo:s,spatialReference:a}=r;if("on-the-ground"===s.mode&&"3d"===i.type&&a){const r=await n.fromGeometry(e).project(a,o);if(!r)return{geometry:e,noDataValue:t};const s=i.elevationProvider;return r.coordinates.forEach(e=>{e.z=s.getElevation(e.x,e.y,0,a,"ground")??0}),{geometry:r.export(),noDataValue:t}}return{geometry:e,noDataValue:t}}get _queryElevationDependencies(){const{view:e}=this.controller;return this._getQueryElevationDependenciesMemoized(this._elevationInfo,this._visibleLayers,e,e.stationary,e.spatialReference)}get _elevationInfo(){const e=a(this.controller.analysis.input);return e?s(e):null}get _visibleLayers(){return this.controller.view?.map?.allLayers?.filter(e=>e.visible).toArray()??[]}};e([r()],p.prototype,"available",null),e([r()],p.prototype,"_queryElevationDependencies",null),e([r()],p.prototype,"_elevationInfo",null),e([r()],p.prototype,"_visibleLayers",null),p=e([i("esri.views.analysis.ElevationProfile.InputLineComputation")],p);export{p as InputLineComputation};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t}from"tslib";import o from"../../../core/Accessor.js";import{watch as e,sync as r}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{getConfig as l}from"./constants.js";import n from"./Result.js";let p=class extends o{constructor(t){super(t),this.result=new n({computation:this}),this.numSamplesForPreview=30,this.numSamplesPerChunk=200}initialize(){this.addHandles([e(()=>[this.controller.analysis.input],()=>this.onInvalidate(this),r)])}setResult(t){this.result.rawResult=t}clearResult(){this.setResult(null)}get progress(){return this.result.progress}get hoveredPoint(){return this.result.hoveredPoint}get available(){return!0}get minDemResolution(){return l().defaultDemResolution}};t([s({constructOnly:!0})],p.prototype,"controller",void 0),t([s({constructOnly:!0})],p.prototype,"profileLine",void 0),t([s({constructOnly:!0})],p.prototype,"onInvalidate",void 0),t([s()],p.prototype,"result",void 0),t([s({readOnly:!0})],p.prototype,"progress",null),t([s()],p.prototype,"hoveredPoint",null),t([s()],p.prototype,"available",null),t([s()],p.prototype,"numSamplesForPreview",void 0),t([s()],p.prototype,"numSamplesPerChunk",void 0),t([s({readOnly:!0})],p.prototype,"minDemResolution",null),p=t([i("esri.views.analysis.ElevationProfile.LineComputation")],p);export{p as LineComputation};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as e}from"tslib";import{watch as r,sync as o}from"../../../core/reactiveUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import{getQuerySourceMinDemResolution as s}from"./elevationQuerySourceUtils.js";import{LineComputation as l}from"./LineComputation.js";let n=class extends l{constructor(){super(...arguments),this.type="query",this.numSamplesForPreview=50,this.numSamplesPerChunk=500}get minDemResolution(){return s(this.profileLine.source)}get available(){const{source:e}=this.profileLine;return!!e&&(null==e.visible||e.visible)&&(null==e.layers||e.layers.some(e=>e.visible))}initialize(){this.addHandles(r(()=>this.profileLine.source,()=>this.onInvalidate(this),o))}queryElevation(e,r){if(!this.profileLine.source)throw new Error("No source configured for the elevation profile line");return this.profileLine.source.queryElevation(e,r)}};e([i({readOnly:!0})],n.prototype,"minDemResolution",null),e([i()],n.prototype,"available",null),n=e([t("esri.views.analysis.ElevationProfile.QueryLineComputation")],n);export{n as QueryLineComputation};
@@ -0,0 +1,4 @@
1
+ import "../../../interfaces";
2
+
3
+ import Result = __esri.Result;
4
+ export default Result;
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{Clonable as e}from"../../core/Clonable.js";import{memoize as o}from"../../core/memoize.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import i from"../../geometry/Point.js";import{binaryFindClosest as l}from"./ElevationProfile/profileUtils.js";import{convertSamples as n,convertStatistics as a}from"./ElevationProfile/unitUtils.js";let p=class extends e{constructor(t){super(t),this._getSamplesMemoized=o((t,e)=>n(t,e)),this._getStatisticsMemoized=o((t,e)=>a(t,e)),this.rawResult=null}get available(){const{computation:t}=this;return t.profileLine.enabled&&t.available}get progress(){return null!=this.rawResult&&this.computation.profileLine.enabled?this.rawResult.progress:0}get samples(){return this._getSamplesMemoized(this.rawResult,this.computation.controller.effectiveUnits)}get statistics(){return this._getStatisticsMemoized(this.rawResult,this.computation.controller.effectiveUnits)}get hoveredPoint(){const t=this.computation.controller.analysisViewData.hoveredPosition;if(null==t)return null;const{rawResult:e,samples:o}=this;if(null==o||null==e)return null;const r=o.length;if(0===r)return null;const s=o[r-1].distance,n=l(o,t*s,t=>t.distance);if(null==n)return null;const{x:a,y:p,z:u}=n;return null==u?null:new i({x:a,y:p,z:u,spatialReference:e.spatialReference})}};t([r()],p.prototype,"available",null),t([r()],p.prototype,"progress",null),t([r()],p.prototype,"samples",null),t([r()],p.prototype,"statistics",null),t([r({constructOnly:!0})],p.prototype,"computation",void 0),t([r()],p.prototype,"rawResult",void 0),t([r()],p.prototype,"hoveredPoint",null),p=t([s("esri.views.analysis.ElevationProfileResult")],p);export{p as default};
5
+ import{__decorate as t}from"tslib";import{Clonable as e}from"../../../core/Clonable.js";import{memoize as o}from"../../../core/memoize.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../geometry/Point.js";import{binaryFindClosest as l}from"./profileGenerationUtils.js";import{convertSamples as n,convertStatistics as a}from"./unitUtils.js";let p=class extends e{constructor(t){super(t),this._getSamplesMemoized=o((t,e)=>n(t,e)),this._getStatisticsMemoized=o((t,e)=>a(t,e)),this.rawResult=null}get available(){const{computation:t}=this;return t.profileLine.enabled&&t.available}get progress(){return null!=this.rawResult&&this.computation.profileLine.enabled?this.rawResult.progress:0}get samples(){return this._getSamplesMemoized(this.rawResult,this.computation.controller.effectiveUnits)}get statistics(){return this._getStatisticsMemoized(this.rawResult,this.computation.controller.effectiveUnits)}get hoveredPoint(){const t=this.computation.controller.analysisViewData.hoveredPosition;if(null==t)return null;const{rawResult:e,samples:o}=this;if(null==o||null==e)return null;const r=o.length;if(0===r)return null;const s=o[r-1].distance,n=l(o,t*s,t=>t.distance);if(null==n)return null;const{x:a,y:p,z:u}=n;return null==u?null:new i({x:a,y:p,z:u,spatialReference:e.spatialReference})}};t([r()],p.prototype,"available",null),t([r()],p.prototype,"progress",null),t([r()],p.prototype,"samples",null),t([r()],p.prototype,"statistics",null),t([r({constructOnly:!0})],p.prototype,"computation",void 0),t([r()],p.prototype,"rawResult",void 0),t([r()],p.prototype,"hoveredPoint",null),p=t([s("esri.views.analysis.ElevationProfile.Result")],p);export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{distance as e,lerp as r,copy as t,equals as a}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as i,fromValues as o,fromArray as n}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{j as s,i as u,m as c,c as p,G as l}from"../../chunks/vec32.js";import{create as h,fromValues as v,fromArray as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{l as d,c as f,e as m}from"../../chunks/vec42.js";import{create as T,fromValues as _,fromArray as g}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import x from"../../geometry/Point.js";class R{constructor(e){this.spatialReference=e}createVector(){return this._tag(i())}pointToVector(e){return this._tag(o(e.x,e.y))}arrayToVector(e){return this._tag(o(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,r=new x){if(e)return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.hasZ=!1,r.hasM=!1,r.spatialReference=this.spatialReference,r}lerp(e,t,a,i){return r(i,e,t,a)}addDelta(e,r,t){e[0]+=r,e[1]+=t}distance(r,t){return e(r,t)}getZ(e,r=void 0){return r}hasZ(){return!1}getM(e,r=void 0){return r}hasM(){return!1}clone(e){return this._tag(n(e))}copy(e,r){return t(r,e)}fromXYZ(e){return this._tag(o(e[0],e[1]))}toXYZ(e,r=h()){return u(r,e[0],e[1],0)}pointToXYZ(e,r=h()){return u(r,e.x,e.y,0)}equals(e,r){return a(e,r)}_tag(e){return e}}class Z{constructor(e,r){this._valueType=e,this.spatialReference=r}createVector(){return this._tag(h())}pointToVector(e){return this._tag(v(e.x,e.y,0===this._valueType?e.z:e.m))}arrayToVector(e){return this._tag(v(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return 0===this._valueType?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,r=new x){if(e)return r.x=e[0],r.y=e[1],r.z=0===this._valueType?e[2]:void 0,r.m=1===this._valueType?e[2]:void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=0===this._valueType?e[2]:void 0,r.m=1===this._valueType?e[2]:void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(!e)return;r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"};const t=0===this._valueType,a=1===this._valueType;return r.x=e[0],r.y=e[1],r.z=t?e[2]:void 0,r.m=a?e[2]:void 0,r.hasZ=t,r.hasM=a,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return c(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,0===this._valueType&&(e[2]+=a)}distance(r,t){return 0===this._valueType?s(r,t):e(V(r),V(t))}getZ(e,r=void 0){return 0===this._valueType?e[2]:r}hasZ(){return 0===this._valueType}getM(e,r=void 0){return 1===this._valueType?e[2]:r}hasM(){return 1===this._valueType}clone(e){return this._tag(y(e))}copy(e,r){return p(r,e)}fromXYZ(e,r=0,t=0){return this._tag(v(e[0],e[1],0===this._valueType?e.length>2?e[2]:r:t))}toXYZ(e,r=h()){return u(r,e[0],e[1],0===this._valueType?e[2]:0)}pointToXYZ(e,r=h()){return u(r,e.x,e.y,0===this._valueType?e.z??0:0)}equals(e,r){return l(e,r)}_tag(e){return e}}class z{constructor(e){this.spatialReference=e}createVector(){return this._tag(T())}pointToVector(e){return this._tag(_(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(_(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.hasZ=!0,r.hasM=!0,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return d(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,e[2]+=a}distance(e,r){return s(M(e),M(r))}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(g(e))}copy(e,r){return f(r,e)}fromXYZ(e,r=0,t=0){return this._tag(_(e[0],e[1],e.length>2?e[2]:r,t))}toXYZ(e,r=h()){return u(r,e[0],e[1],e[2])}pointToXYZ(e,r=h()){return u(r,e.x,e.y,e.z??0)}equals(e,r){return m(e,r)}_tag(e){return e}}function M(e){return e}function V(e){return e}function w(e,r,t){return e&&r?new z(t):r?new Z(1,t):e?new Z(0,t):new R(t)}export{R as CoordinateHelper2D,Z as CoordinateHelper3D,z as CoordinateHelper4D,w as createCoordinateHelper};
5
+ import{distance as e,lerp as r,copy as t,equals as a}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as i,fromValues as o,fromArray as n}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{j as s,i as u,m as c,c as p,G as l}from"../../chunks/vec32.js";import{create as h,fromValues as v,fromArray as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{l as d,d as f,e as m}from"../../chunks/vec42.js";import{create as T,fromValues as _,fromArray as g}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import x from"../../geometry/Point.js";class R{constructor(e){this.spatialReference=e}createVector(){return this._tag(i())}pointToVector(e){return this._tag(o(e.x,e.y))}arrayToVector(e){return this._tag(o(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,r=new x){if(e)return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.hasZ=!1,r.hasM=!1,r.spatialReference=this.spatialReference,r}lerp(e,t,a,i){return r(i,e,t,a)}addDelta(e,r,t){e[0]+=r,e[1]+=t}distance(r,t){return e(r,t)}getZ(e,r=void 0){return r}hasZ(){return!1}getM(e,r=void 0){return r}hasM(){return!1}clone(e){return this._tag(n(e))}copy(e,r){return t(r,e)}fromXYZ(e){return this._tag(o(e[0],e[1]))}toXYZ(e,r=h()){return u(r,e[0],e[1],0)}pointToXYZ(e,r=h()){return u(r,e.x,e.y,0)}equals(e,r){return a(e,r)}_tag(e){return e}}class Z{constructor(e,r){this._valueType=e,this.spatialReference=r}createVector(){return this._tag(h())}pointToVector(e){return this._tag(v(e.x,e.y,0===this._valueType?e.z:e.m))}arrayToVector(e){return this._tag(v(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return 0===this._valueType?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,r=new x){if(e)return r.x=e[0],r.y=e[1],r.z=0===this._valueType?e[2]:void 0,r.m=1===this._valueType?e[2]:void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=0===this._valueType?e[2]:void 0,r.m=1===this._valueType?e[2]:void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(!e)return;r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"};const t=0===this._valueType,a=1===this._valueType;return r.x=e[0],r.y=e[1],r.z=t?e[2]:void 0,r.m=a?e[2]:void 0,r.hasZ=t,r.hasM=a,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return c(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,0===this._valueType&&(e[2]+=a)}distance(r,t){return 0===this._valueType?s(r,t):e(V(r),V(t))}getZ(e,r=void 0){return 0===this._valueType?e[2]:r}hasZ(){return 0===this._valueType}getM(e,r=void 0){return 1===this._valueType?e[2]:r}hasM(){return 1===this._valueType}clone(e){return this._tag(y(e))}copy(e,r){return p(r,e)}fromXYZ(e,r=0,t=0){return this._tag(v(e[0],e[1],0===this._valueType?e.length>2?e[2]:r:t))}toXYZ(e,r=h()){return u(r,e[0],e[1],0===this._valueType?e[2]:0)}pointToXYZ(e,r=h()){return u(r,e.x,e.y,0===this._valueType?e.z??0:0)}equals(e,r){return l(e,r)}_tag(e){return e}}class z{constructor(e){this.spatialReference=e}createVector(){return this._tag(T())}pointToVector(e){return this._tag(_(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(_(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.hasZ=!0,r.hasM=!0,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return d(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,e[2]+=a}distance(e,r){return s(M(e),M(r))}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(g(e))}copy(e,r){return f(r,e)}fromXYZ(e,r=0,t=0){return this._tag(_(e[0],e[1],e.length>2?e[2]:r,t))}toXYZ(e,r=h()){return u(r,e[0],e[1],e[2])}pointToXYZ(e,r=h()){return u(r,e.x,e.y,e.z??0)}equals(e,r){return m(e,r)}_tag(e){return e}}function M(e){return e}function V(e){return e}function w(e,r,t){return e&&r?new z(t):r?new Z(1,t):e?new Z(0,t):new R(t)}export{R as CoordinateHelper2D,Z as CoordinateHelper3D,z as CoordinateHelper4D,w as createCoordinateHelper};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{fromValues as t,create as r}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{mul as o}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{deriveCircleFromCircularArc as s}from"../../../../geometry/support/curves/circularArcUtils.js";import{isCircularArc as c}from"../../../../geometry/support/curves/curveUtils.js";import{transformEllipticArc as e}from"../../../../geometry/support/curves/ellipticArc7Utils.js";function a(t,r){const[o]=r.c,c=s(t,r);return{a:[o,[c.cx,c.cy],Math.abs(c.thetaEnd-c.thetaStart)>Math.PI?0:1,1,0,c.radius,1]}}function i(r,o,s,i){const m=c(o)?a(r,o):o,[n,u,p,f,h,l,y]=m.a,M=h??0,g=l??Math.hypot(n[0]-u[0],n[1]-u[1]),j=y??1,x=Math.cos(i),v=Math.sin(i),[b,U]=s,d=t(x,v,0,-v,x,0,b-x*b+v*U,U-v*b-x*U,1);return e(r,{a:[n,u,p,f,M,g,j]},d)}function m(t,r,o,s,i,m,u,p){const f=r??o.leftVertex.pos,h=c(t)?a(f,t):t,[l,y,M,g,j,x,v]=h.a,b=j??0,U=x??Math.hypot(l[0]-y[0],l[1]-y[1]),d=v??1,A=n(s[0],s[1],i[0],i[1],m[0],m[1],u,p);return e(f,{a:[l,y,M,g,b,U,d]},A)}function n(s,c,e,a,i,m,n,u){const p=t(1,0,0,0,1,0,-s,-c,1),f=n-1,h=t(e*e*f+1,a*e*f,0,e*a*f,a*a*f+1,0,0,0,1),l=u-1,y=t(i*i*l+1,m*i*l,0,i*m*l,m*m*l+1,0,0,0,1),M=t(1,0,0,0,1,0,s,c,1),g=r();return o(g,h,p),o(g,y,g),o(g,M,g),g}export{n as getScaleTransform,i as rotateArc,m as scaleArc,a as toEllipticArc7};
5
+ import{fromValues as t,create as r}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{mul as o}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{deriveCircleFromCircularArc as a}from"../../../../geometry/support/curves/circularArcUtils.js";import{isCircularArc as e}from"../../../../geometry/support/curves/curveUtils.js";import{transformEllipticArc as s}from"../../../../geometry/support/curves/ellipticArc7Utils.js";function c(t,r){const[o]=r.c,e=a(t,r);return{a:[o,[e.cx,e.cy],Math.abs(e.thetaEnd-e.thetaStart)<Math.PI?1:0,e.thetaStart>e.thetaEnd?1:0,0,e.radius,1]}}function i(r,o,a,i){const n=e(o)?c(r,o):o,[m,u,p,h,f,l,y]=n.a,M=f??0,g=l??Math.hypot(m[0]-u[0],m[1]-u[1]),j=y??1,x=Math.cos(i),v=Math.sin(i),[b,d]=a,U=t(x,v,0,-v,x,0,b-x*b+v*d,d-v*b-x*d,1);return s(r,{a:[m,u,p,h,M,g,j]},U)}function n(t,r,o,a,i,n,u,p){const h=r??o.leftVertex.pos,f=e(t)?c(h,t):t,[l,y,M,g,j,x,v]=f.a,b=j??0,d=x??Math.hypot(l[0]-y[0],l[1]-y[1]),U=v??1,A=m(a[0],a[1],i[0],i[1],n[0],n[1],u,p);return s(h,{a:[l,y,M,g,b,d,U]},A)}function m(a,e,s,c,i,n,m,u){const p=t(1,0,0,0,1,0,-a,-e,1),h=m-1,f=t(s*s*h+1,c*s*h,0,s*c*h,c*c*h+1,0,0,0,1),l=u-1,y=t(i*i*l+1,n*i*l,0,i*n*l,n*n*l+1,0,0,0,1),M=t(1,0,0,0,1,0,a,e,1),g=r();return o(g,f,p),o(g,y,g),o(g,M,g),g}export{m as getScaleTransform,i as rotateArc,n as scaleArc,c as toEllipticArc7};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{asinClamped as s}from"../../../core/mathUtils.js";import{dot as n,subtract as r,squaredDistance as i,exactEquals as o,set as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{q as a,c as h,i as f,d as l,G as d,b as p,s as m,a as g,k as _,e as k,h as L,n as x}from"../../../chunks/vec32.js";import{create as y,fromValues as z,clone as M,UNIT_Z as P}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as T,h as q}from"../../../chunks/vec42.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{toRadians as v}from"../../../geometry/support/geodesicConstants.js";import{directGeodeticSolver as j,inverseGeodeticSolver as D,InverseGeodeticSolverResult as b}from"../../../geometry/support/geodesicUtils.js";import{create as R,fromPoints as A,fromPositionAndNormal as Z,intersectLine as U,signedDistance as G,projectPoint as I,getNormal as S,distance as C}from"../../../geometry/support/plane.js";import{m as O,l as E,n as V,p as B,a as F}from"../../../chunks/sphere.js";import{tangentFrame as H}from"../../3d/support/mathUtils.js";import{clone as J,asVec2 as K,createWritable as N,fromVec3 as Q,fromValues as W,create as X}from"./normalizedPoint.js";import{projectPointToVerticalPlane as Y,isClose as $,projectPointToVerticalCylinder as tt,projectPointToLineLike as et,intersectLineLikes as st,intersectVerticalPlaneAndLineLike as nt,intersectLineLikeAndVerticalCylinder as rt,intersectLineLikeAndCircle as it,intersectVerticalPlanes as ot,intersectVerticalPlaneAndVerticalCylinder as ct,intersectVerticalCylinders as ut,intersectVerticalPlaneAndPoint as at,vectorsHaveCloseZ as ht,isPointInsidePlane as ft,pointsInsidePlane as lt}from"../../support/geometry3dUtils.js";class dt{intersect(t){return Vt(this,t)}closestPoints(t){return[this.closestTo(t)]}}class pt extends dt{constructor(t){super(),this.point=t}equals(t){return this===t||ge(t)&&a(this.point,t.point)}closestTo(){return J(this.point)}}class mt extends dt{constructor(t,e,s){super(),this.start=t,this.end=e,this.lineLike={start:t,end:e,type:s}}equals(t){return this===t||_e(t)&&this.lineLike.type===t.lineLike.type&&a(this.start,t.start)&&a(this.end,t.end)}closestTo(t){const e=N();return et(t,this.lineLike,e),e}}class gt extends mt{constructor(t,e){super(t,e,1)}}class _t extends mt{constructor(t,e){super(t,e,0)}}class kt extends dt{constructor(t){super(),this.constraints=t}equals(t){return this===t||me(t)&&e(this.constraints,t.constraints,(t,e)=>t.equals(e))}closestTo(t){let e,s=1/0;for(const n of this.constraints){const r=n.closestTo(t),i=m(t,r);i<s&&(s=i,e=r)}return J(e??t)}closestPoints(t){return this.constraints.flatMap(e=>e===this?[]:e.closestPoints(t))}}class Lt extends dt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||xe(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const e=N();return tt(t,this.center,this.radius,e),e}}class xt extends dt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||ye(t)&&a(this.center,t.center)&&this.radius===t.radius}closestTo(t){const e=N();return tt(t,this.center,this.radius,e),e[2]=this.center[2],e}asCircle(){return new yt(J(this.center),this.radius,W(0,0,1))}}class yt extends dt{constructor(t,e,s,n=void 0){super(),this.center=t,this.radius=e,this.normal=s,this.slicePlane=n}equals(t){return this===t||ze(t)&&a(this.center,t.center)&&a(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:e,radius:s}=this;I(this.getPlane(Mt),t,zt);const n=g(zt,zt,e),r=_(n);if($(r,0))return J(t);const i=s/Math.sqrt(r),o=N();p(o,e,n,i);const{slicePlane:c}=this;if(c&&!ft(c,o)){const e=Jt(c,this);return e?.closestTo(t)??J(t)}return o}getPlane(t=R()){return Z(this.center,this.normal,t)}}const zt=y(),Mt=R();class Pt extends dt{constructor(t){super(),this.z=t}equals(t){return this===t||ke(t)&&this.z===t.z}closestTo(t){return W(t[0],t[1],this.z)}getPlane(t=R()){return f(Tt,0,0,this.z),Z(Tt,P,t)}}const Tt=y();class qt extends dt{constructor(t,e,s){super(),this.start=t,this.end=e,this.planeLike={start:K(t),end:K(e),type:s}}equals(t){return this===t||Le(t)&&this.planeLike.type===t.planeLike.type&&a(this.start,t.start)&&a(this.end,t.end)}closestTo(t){const e=N();return Y(t,this.planeLike,e),e}closestEndTo(t){const{start:e,end:s}=this.planeLike;return Math.sign(n(r(wt,s,e),r(vt,K(t),e)))>0?this.end:this.start}getPlane(t=R()){const e=h(jt,this.end);return e[2]+=1,A(this.start,this.end,e,t)}getSlicePlane(t=R()){const{start:e,end:s,type:n}=this.planeLike;if(0===n)return;const r=f(jt,e[0],e[1],0),i=f(Dt,s[0],s[1],0),o=l(Dt,i,r);return Z(r,o,t),t}}const wt=u(),vt=u(),jt=y(),Dt=y();class bt extends qt{constructor(t,e){super(t,e,1)}}class Rt extends qt{constructor(t,e){super(t,e,0)}}class At extends dt{constructor(t,e){super(),this.sphere=E(t,e)}equals(t){return this===t||Me(t)&&V(this.sphere,t.sphere)}closestTo(t){const e=N();return B(this.sphere,t,e),e}get center(){return F(this.sphere)}get radius(){return this.sphere[3]}}class Zt extends dt{constructor(t,e,s){super(),this.start=t,this.end=e,this.getZ=s,this.planeLike={start:K(t),end:K(e),type:0}}equals(t){return this===t||Pe(t)&&a(this.start,t.start)&&a(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return Et(this,t)}addIfOnTheGround(t,e){for(const s of e){const e=this.getZ(s[0],s[1])??0;$(s[2],e)&&(s[2]=e,t.push(s))}}}class Ut extends dt{constructor(t,e,s){super(),this._x=t,this._y=e,this._z=s}equals(t){return this===t||qe(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,e,s]){return X(this._x??t,this._y??e,this._z??s)}}class Gt extends dt{constructor(t,e,s,n,r){super(),this._origin=t,this._spatialReference=e,this._distanceMeters=s,this._z=n,this._directionDegrees=r}equals(t){return this===t||Te(t)&&o(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._z===t._z&&this._directionDegrees===t._directionDegrees}closestTo([t,e,s]){return c(It,t,e),o(It,this._origin)||this._applyDirectionAndDistance(It),X(It[0],It[1],this._z??s)}_applyDirectionAndDistance(t){if(null!=this._directionDegrees&&null!=this._distanceMeters)j(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(null!=this._directionDegrees)Ct(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(null!=this._distanceMeters){const{azimuth:e}=D(St,this._origin,t,this._spatialReference);j(t,this._origin,e??0,this._distanceMeters,this._spatialReference)}}}const It=[0,0],St=new b;function Ct(t,e,s,n,r){let{azimuth:i,distance:o}=D(Ot,e,n,r);i??=0;let c=o*Math.cos((i-s)*v);c=Math.max(0,c),j(t,e,s,c,r)}const Ot=new b;function Et(t,e){const s=N();return Y(e,t.planeLike,s),s[2]=t.getZ(s[0],s[1])??we,s}function Vt(t,e){if(me(t)){const s=[];for(const n of t.constraints){const t=n.intersect(e);t&&s.push(t)}return pe(s)}if(me(e))return Vt(e,t);if(Pe(t))return he(t,e);if(Pe(e))return he(e,t);if(ge(t)){const{point:s}=t;if(ge(e))return a(s,e.point)?t:void 0;const n=e.closestTo(s);return d(n,s)?t:void 0}if(_e(t)){if(ge(e))return Vt(e,t);if(_e(e))return le(st(t.lineLike,e.lineLike));if(ke(e))return Bt(t,e);if(Le(e))return le(nt(e.planeLike,t.lineLike));if(xe(e))return le(rt(t.lineLike,e.center,e.radius));if(ze(e))return le(it(t.lineLike,e));if(ye(e))return Ft(t,e);if(Me(e))return Ht(t,e)}else if(ke(t)){if(ge(e)||_e(e))return Vt(e,t);if(ke(e))return Kt(t,e);if(Le(e))return Nt(t,e);if(xe(e))return Qt(t,e);if(ze(e))return Xt(t,e);if(ye(e))return Wt(t,e);if(Me(e))return Yt(t,e)}else if(Le(t)){if(ge(e)||_e(e)||ke(e))return Vt(e,t);if(Le(e))return fe(ot(t.planeLike,e.planeLike));if(xe(e))return fe(ct(t.planeLike,e.center,e.radius));if(ze(e))return te(t,e);if(ye(e))return $t(t,e);if(Me(e))return ee(t,e)}else if(xe(t)){if(ge(e)||_e(e)||ke(e)||Le(e))return Vt(e,t);if(xe(e))return fe(ut(K(t.center),t.radius,K(e.center),e.radius));if(ze(e))return se();if(ye(e))return ne(t,e);if(Me(e))return re()}else if(ze(t)){if(ge(e)||_e(e)||ke(e)||Le(e)||xe(e))return Vt(e,t);if(ze(e))return ie();if(ye(e))return ie(e.asCircle());if(Me(e))return oe()}else if(ye(t)){if(ge(e)||_e(e)||ke(e)||Le(e)||xe(e)||ze(e))return Vt(e,t);if(ye(e))return ce(e,t);if(Me(e))return ue()}else if(Me(t)){if(ge(e)||_e(e)||ke(e)||Le(e)||xe(e)||ye(e))return Vt(e,t);if(Me(e))return ae()}}const Bt=(()=>{const t=R();return(e,s)=>{const{start:n,end:r}=e;if(ht(n,r)&&$(n[2],s.z))return e;const i=N();return U(s.getPlane(t),n,r,i)?new pt(i):void 0}})();function Ft({lineLike:t},{center:e,radius:s}){const n=e[2];return le(rt(t,e,s).filter(t=>$(t[2],n)))}function Ht({lineLike:t},{sphere:e}){return le(O(e,t.start,t.end))}const Jt=(()=>{const t=w(),e=y(),n=y();return(r,i,o)=>{const{normal:c,center:u,radius:a}=i;H(c,e,n);const h=S(r),f=a*k(h,e),l=a*k(h,n);T(t,u[0],u[1],u[2],1);const d=q(r,t),m=Math.hypot(f,l),g=$(m,0);if($(C(r,u),0)){if(g)return i;if($(a,0))return!o||ft(o,u)?new pt(J(u)):void 0;L(e,h,c),x(e,e);const t=new Array,s=M(u);p(s,s,e,a),o&&!ft(o,s)||t.push(s);const n=M(u);return p(n,n,e,-a),o&&!ft(o,n)||t.push(n),le(t)}if(g)return;const _=-d/m;if(Math.abs(_)>1||$(_,1))return;const z=Math.atan(f/l),P=s(_)-z,w=Math.PI-P,v=new Array,j=y();p(j,u,e,a*Math.cos(P)),p(j,j,n,a*Math.sin(P)),v.push(j);const D=y();return p(D,u,e,a*Math.cos(w)),p(D,D,n,a*Math.sin(w)),v.push(D),le(o?lt(o,v):v)}})();function Kt(t,e){return $(t.z,e.z)?t:void 0}function Nt({z:t},{planeLike:e}){const[s,n]=e.start,[r,i]=e.end,o=W(s,n,t),c=W(r,i,t);return 0===e.type?new gt(o,c):new _t(o,c)}function Qt(t,e){const[s,n]=e.center;return new xt(W(s,n,t.z),e.radius)}function Wt(t,e){return $(e.center[2],t.z)?e:void 0}const Xt=(()=>{const t=R();return(e,s)=>Jt(e.getPlane(t),s,s.slicePlane)})();function Yt(t,{center:e,radius:s}){const n=Math.abs(e[2]-t.z);if(n>s&&!$(n,s))return;const r=W(e[0],e[1],t.z),i=Math.sqrt(s**2-n**2);return $(i,0)?void 0:new xt(r,i)}const $t=(()=>{const t=R();return(e,{center:s,radius:n})=>{const r=ct(e.planeLike,s,n),i=s[2];e.getSlicePlane(t);const o=new Array;for(const[c,u]of r){const e=[c,u,i];ft(t,e)&&o.push(e)}return le(o)}})(),te=(()=>{const t=R(),e=R();return(s,n)=>Jt(s.getPlane(t),n,s.getSlicePlane(e))})(),ee=(()=>{const t=R();return(e,{center:s,radius:n})=>{const r=e.getPlane(t),i=G(r,s),o=Math.abs(i);if(o>n&&!$(o,n))return;const c=Math.sqrt(n**2-i**2);if($(c,0)){const t=N();return I(r,s,t),new pt(t)}const u=N(),a=M(S(r));return p(u,s,a,i),new yt(u,c,a,e.getSlicePlane())}})();function se(t,e){}function ne(t,e){const s=i(K(t.center),K(e.center));if($(s,0)&&$(t.radius,e.radius))return e;return de(ut(K(t.center),t.radius,K(e.center),e.radius),e.center[2])}function re(t,e){}function ie(t,e){}function oe(t,e){}function ce(t,e){if(!ht(t.center,e.center))return;const s=i(K(t.center),K(e.center));if($(s,0)&&$(t.radius,e.radius))return t;return de(ut(K(t.center),t.radius,K(e.center),e.radius),t.center[2])}function ue(t,e){}function ae(t,e){}function he(t,e){const{planeLike:s,getZ:n}=t,r=new Array;if(ge(e))t.addIfOnTheGround(r,at(s,e.point));else if(_e(e))t.addIfOnTheGround(r,nt(s,e.lineLike));else if(xe(e))for(const[i,o]of ct(s,e.center,e.radius)){const t=n(i,o);null!=t&&r.push(z(i,o,t))}else if(Le(e)||Pe(e))for(const[i,o]of ot(s,e.planeLike)){const t=n(i,o)??we;r.push(z(i,o,t))}return le(r)}function fe(t){return pe(t.map(([t,e])=>{const s=W(t,e,0),n=W(t,e,1);return new gt(s,n)}))}function le(t){return pe(t.map(t=>t?new pt(Q(t)):void 0))}function de(t,e){return le(t.map(([t,s])=>[t,s,e]))}function pe(e){if(0!==e.length)return 1===e.length?e[0]??void 0:new kt(e.filter(t))}function me(t){return t instanceof kt}function ge(t){return t instanceof pt}function _e(t){return t instanceof mt}function ke(t){return t instanceof Pt}function Le(t){return t instanceof qt}function xe(t){return t instanceof Lt}function ye(t){return t instanceof xt}function ze(t){return t instanceof yt}function Me(t){return t instanceof At}function Pe(t){return t instanceof Zt}function Te(t){return t instanceof Gt}function qe(t){return t instanceof Ut}const we=0;export{yt as CircleConstraint,dt as Constraint,Ut as CoordinateConstraint,Zt as DrapedLineConstraint,Gt as GeodesicConstraint,xt as HorizontalCircleConstraint,Pt as HorizontalPlaneConstraint,gt as LineConstraint,mt as LineLikeConstraint,pt as PointConstraint,_t as RayConstraint,kt as SetConstraint,At as SphereConstraint,Lt as VerticalCylinderConstraint,bt as VerticalHalfPlaneConstraint,Rt as VerticalPlaneConstraint,qt as VerticalPlaneLikeConstraint,pe as constraintOrSet,ge as isPoint};
5
+ import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{asinClamped as s}from"../../../core/mathUtils.js";import{dot as r,subtract as n,squaredDistance as i,exactEquals as o,set as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{q as a,c as h,i as f,d as l,G as d,b as p,s as m,a as g,k as _,e as k,h as L,n as x}from"../../../chunks/vec32.js";import{create as y,fromValues as z,clone as M,UNIT_Z as P}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as T,h as q}from"../../../chunks/vec42.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{toRadians as v}from"../../../geometry/support/geodesicConstants.js";import{directGeodeticSolver as j,inverseGeodeticSolver as D,InverseGeodeticSolverResult as b}from"../../../geometry/support/geodesicUtils.js";import{create as R,fromPoints as A,fromPositionAndNormal as Z,intersectLine as U,signedDistance as G,projectPoint as I,getNormal as S,distance as C}from"../../../geometry/support/plane.js";import{u as O,r as E,v as V,w as B,a as F}from"../../../chunks/sphere.js";import{tangentFrame as H}from"../../3d/support/mathUtils.js";import{clone as J,asVec2 as K,createWritable as N,fromVec3 as Q,fromValues as W,create as X}from"./normalizedPoint.js";import{projectPointToVerticalPlane as Y,isClose as $,projectPointToVerticalCylinder as tt,projectPointToLineLike as et,intersectLineLikes as st,intersectVerticalPlaneAndLineLike as rt,intersectLineLikeAndVerticalCylinder as nt,intersectLineLikeAndCircle as it,intersectVerticalPlanes as ot,intersectVerticalPlaneAndVerticalCylinder as ct,intersectVerticalCylinders as ut,intersectVerticalPlaneAndPoint as at,vectorsHaveCloseZ as ht,isPointInsidePlane as ft,pointsInsidePlane as lt}from"../../support/geometry3dUtils.js";class dt{intersect(t){return Vt(this,t)}closestPoints(t){return[this.closestTo(t)]}}class pt extends dt{constructor(t){super(),this.point=t}equals(t){return this===t||ge(t)&&a(this.point,t.point)}closestTo(){return J(this.point)}}class mt extends dt{constructor(t,e,s){super(),this.start=t,this.end=e,this.lineLike={start:t,end:e,type:s}}equals(t){return this===t||_e(t)&&this.lineLike.type===t.lineLike.type&&a(this.start,t.start)&&a(this.end,t.end)}closestTo(t){const e=N();return et(t,this.lineLike,e),e}}class gt extends mt{constructor(t,e){super(t,e,1)}}class _t extends mt{constructor(t,e){super(t,e,0)}}class kt extends dt{constructor(t){super(),this.constraints=t}equals(t){return this===t||me(t)&&e(this.constraints,t.constraints,(t,e)=>t.equals(e))}closestTo(t){let e,s=1/0;for(const r of this.constraints){const n=r.closestTo(t),i=m(t,n);i<s&&(s=i,e=n)}return J(e??t)}closestPoints(t){return this.constraints.flatMap(e=>e===this?[]:e.closestPoints(t))}}class Lt extends dt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||xe(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const e=N();return tt(t,this.center,this.radius,e),e}}class xt extends dt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||ye(t)&&a(this.center,t.center)&&this.radius===t.radius}closestTo(t){const e=N();return tt(t,this.center,this.radius,e),e[2]=this.center[2],e}asCircle(){return new yt(J(this.center),this.radius,W(0,0,1))}}class yt extends dt{constructor(t,e,s,r=void 0){super(),this.center=t,this.radius=e,this.normal=s,this.slicePlane=r}equals(t){return this===t||ze(t)&&a(this.center,t.center)&&a(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:e,radius:s}=this;I(this.getPlane(Mt),t,zt);const r=g(zt,zt,e),n=_(r);if($(n,0))return J(t);const i=s/Math.sqrt(n),o=N();p(o,e,r,i);const{slicePlane:c}=this;if(c&&!ft(c,o)){const e=Jt(c,this);return e?.closestTo(t)??J(t)}return o}getPlane(t=R()){return Z(this.center,this.normal,t)}}const zt=y(),Mt=R();class Pt extends dt{constructor(t){super(),this.z=t}equals(t){return this===t||ke(t)&&this.z===t.z}closestTo(t){return W(t[0],t[1],this.z)}getPlane(t=R()){return f(Tt,0,0,this.z),Z(Tt,P,t)}}const Tt=y();class qt extends dt{constructor(t,e,s){super(),this.start=t,this.end=e,this.planeLike={start:K(t),end:K(e),type:s}}equals(t){return this===t||Le(t)&&this.planeLike.type===t.planeLike.type&&a(this.start,t.start)&&a(this.end,t.end)}closestTo(t){const e=N();return Y(t,this.planeLike,e),e}closestEndTo(t){const{start:e,end:s}=this.planeLike;return Math.sign(r(n(wt,s,e),n(vt,K(t),e)))>0?this.end:this.start}getPlane(t=R()){const e=h(jt,this.end);return e[2]+=1,A(this.start,this.end,e,t)}getSlicePlane(t=R()){const{start:e,end:s,type:r}=this.planeLike;if(0===r)return;const n=f(jt,e[0],e[1],0),i=f(Dt,s[0],s[1],0),o=l(Dt,i,n);return Z(n,o,t),t}}const wt=u(),vt=u(),jt=y(),Dt=y();class bt extends qt{constructor(t,e){super(t,e,1)}}class Rt extends qt{constructor(t,e){super(t,e,0)}}class At extends dt{constructor(t,e){super(),this.sphere=E(t,e)}equals(t){return this===t||Me(t)&&V(this.sphere,t.sphere)}closestTo(t){const e=N();return B(this.sphere,t,e),e}get center(){return F(this.sphere)}get radius(){return this.sphere[3]}}class Zt extends dt{constructor(t,e,s){super(),this.start=t,this.end=e,this.getZ=s,this.planeLike={start:K(t),end:K(e),type:0}}equals(t){return this===t||Pe(t)&&a(this.start,t.start)&&a(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return Et(this,t)}addIfOnTheGround(t,e){for(const s of e){const e=this.getZ(s[0],s[1])??0;$(s[2],e)&&(s[2]=e,t.push(s))}}}class Ut extends dt{constructor(t,e,s){super(),this._x=t,this._y=e,this._z=s}equals(t){return this===t||qe(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,e,s]){return X(this._x??t,this._y??e,this._z??s)}}class Gt extends dt{constructor(t,e,s,r,n){super(),this._origin=t,this._spatialReference=e,this._distanceMeters=s,this._z=r,this._directionDegrees=n}equals(t){return this===t||Te(t)&&o(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._z===t._z&&this._directionDegrees===t._directionDegrees}closestTo([t,e,s]){return c(It,t,e),o(It,this._origin)||this._applyDirectionAndDistance(It),X(It[0],It[1],this._z??s)}_applyDirectionAndDistance(t){if(null!=this._directionDegrees&&null!=this._distanceMeters)j(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(null!=this._directionDegrees)Ct(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(null!=this._distanceMeters){const{azimuth:e}=D(St,this._origin,t,this._spatialReference);j(t,this._origin,e??0,this._distanceMeters,this._spatialReference)}}}const It=[0,0],St=new b;function Ct(t,e,s,r,n){let{azimuth:i,distance:o}=D(Ot,e,r,n);i??=0;let c=o*Math.cos((i-s)*v);c=Math.max(0,c),j(t,e,s,c,n)}const Ot=new b;function Et(t,e){const s=N();return Y(e,t.planeLike,s),s[2]=t.getZ(s[0],s[1])??we,s}function Vt(t,e){if(me(t)){const s=[];for(const r of t.constraints){const t=r.intersect(e);t&&s.push(t)}return pe(s)}if(me(e))return Vt(e,t);if(Pe(t))return he(t,e);if(Pe(e))return he(e,t);if(ge(t)){const{point:s}=t;if(ge(e))return a(s,e.point)?t:void 0;const r=e.closestTo(s);return d(r,s)?t:void 0}if(_e(t)){if(ge(e))return Vt(e,t);if(_e(e))return le(st(t.lineLike,e.lineLike));if(ke(e))return Bt(t,e);if(Le(e))return le(rt(e.planeLike,t.lineLike));if(xe(e))return le(nt(t.lineLike,e.center,e.radius));if(ze(e))return le(it(t.lineLike,e));if(ye(e))return Ft(t,e);if(Me(e))return Ht(t,e)}else if(ke(t)){if(ge(e)||_e(e))return Vt(e,t);if(ke(e))return Kt(t,e);if(Le(e))return Nt(t,e);if(xe(e))return Qt(t,e);if(ze(e))return Xt(t,e);if(ye(e))return Wt(t,e);if(Me(e))return Yt(t,e)}else if(Le(t)){if(ge(e)||_e(e)||ke(e))return Vt(e,t);if(Le(e))return fe(ot(t.planeLike,e.planeLike));if(xe(e))return fe(ct(t.planeLike,e.center,e.radius));if(ze(e))return te(t,e);if(ye(e))return $t(t,e);if(Me(e))return ee(t,e)}else if(xe(t)){if(ge(e)||_e(e)||ke(e)||Le(e))return Vt(e,t);if(xe(e))return fe(ut(K(t.center),t.radius,K(e.center),e.radius));if(ze(e))return se();if(ye(e))return re(t,e);if(Me(e))return ne()}else if(ze(t)){if(ge(e)||_e(e)||ke(e)||Le(e)||xe(e))return Vt(e,t);if(ze(e))return ie();if(ye(e))return ie(e.asCircle());if(Me(e))return oe()}else if(ye(t)){if(ge(e)||_e(e)||ke(e)||Le(e)||xe(e)||ze(e))return Vt(e,t);if(ye(e))return ce(e,t);if(Me(e))return ue()}else if(Me(t)){if(ge(e)||_e(e)||ke(e)||Le(e)||xe(e)||ye(e))return Vt(e,t);if(Me(e))return ae()}}const Bt=(()=>{const t=R();return(e,s)=>{const{start:r,end:n}=e;if(ht(r,n)&&$(r[2],s.z))return e;const i=N();return U(s.getPlane(t),r,n,i)?new pt(i):void 0}})();function Ft({lineLike:t},{center:e,radius:s}){const r=e[2];return le(nt(t,e,s).filter(t=>$(t[2],r)))}function Ht({lineLike:t},{sphere:e}){return le(O(e,t.start,t.end))}const Jt=(()=>{const t=w(),e=y(),r=y();return(n,i,o)=>{const{normal:c,center:u,radius:a}=i;H(c,e,r);const h=S(n),f=a*k(h,e),l=a*k(h,r);T(t,u[0],u[1],u[2],1);const d=q(n,t),m=Math.hypot(f,l),g=$(m,0);if($(C(n,u),0)){if(g)return i;if($(a,0))return!o||ft(o,u)?new pt(J(u)):void 0;L(e,h,c),x(e,e);const t=new Array,s=M(u);p(s,s,e,a),o&&!ft(o,s)||t.push(s);const r=M(u);return p(r,r,e,-a),o&&!ft(o,r)||t.push(r),le(t)}if(g)return;const _=-d/m;if(Math.abs(_)>1||$(_,1))return;const z=Math.atan(f/l),P=s(_)-z,w=Math.PI-P,v=new Array,j=y();p(j,u,e,a*Math.cos(P)),p(j,j,r,a*Math.sin(P)),v.push(j);const D=y();return p(D,u,e,a*Math.cos(w)),p(D,D,r,a*Math.sin(w)),v.push(D),le(o?lt(o,v):v)}})();function Kt(t,e){return $(t.z,e.z)?t:void 0}function Nt({z:t},{planeLike:e}){const[s,r]=e.start,[n,i]=e.end,o=W(s,r,t),c=W(n,i,t);return 0===e.type?new gt(o,c):new _t(o,c)}function Qt(t,e){const[s,r]=e.center;return new xt(W(s,r,t.z),e.radius)}function Wt(t,e){return $(e.center[2],t.z)?e:void 0}const Xt=(()=>{const t=R();return(e,s)=>Jt(e.getPlane(t),s,s.slicePlane)})();function Yt(t,{center:e,radius:s}){const r=Math.abs(e[2]-t.z);if(r>s&&!$(r,s))return;const n=W(e[0],e[1],t.z),i=Math.sqrt(s**2-r**2);return $(i,0)?void 0:new xt(n,i)}const $t=(()=>{const t=R();return(e,{center:s,radius:r})=>{const n=ct(e.planeLike,s,r),i=s[2];e.getSlicePlane(t);const o=new Array;for(const[c,u]of n){const e=[c,u,i];ft(t,e)&&o.push(e)}return le(o)}})(),te=(()=>{const t=R(),e=R();return(s,r)=>Jt(s.getPlane(t),r,s.getSlicePlane(e))})(),ee=(()=>{const t=R();return(e,{center:s,radius:r})=>{const n=e.getPlane(t),i=G(n,s),o=Math.abs(i);if(o>r&&!$(o,r))return;const c=Math.sqrt(r**2-i**2);if($(c,0)){const t=N();return I(n,s,t),new pt(t)}const u=N(),a=M(S(n));return p(u,s,a,i),new yt(u,c,a,e.getSlicePlane())}})();function se(t,e){}function re(t,e){const s=i(K(t.center),K(e.center));if($(s,0)&&$(t.radius,e.radius))return e;return de(ut(K(t.center),t.radius,K(e.center),e.radius),e.center[2])}function ne(t,e){}function ie(t,e){}function oe(t,e){}function ce(t,e){if(!ht(t.center,e.center))return;const s=i(K(t.center),K(e.center));if($(s,0)&&$(t.radius,e.radius))return t;return de(ut(K(t.center),t.radius,K(e.center),e.radius),t.center[2])}function ue(t,e){}function ae(t,e){}function he(t,e){const{planeLike:s,getZ:r}=t,n=new Array;if(ge(e))t.addIfOnTheGround(n,at(s,e.point));else if(_e(e))t.addIfOnTheGround(n,rt(s,e.lineLike));else if(xe(e))for(const[i,o]of ct(s,e.center,e.radius)){const t=r(i,o);null!=t&&n.push(z(i,o,t))}else if(Le(e)||Pe(e))for(const[i,o]of ot(s,e.planeLike)){const t=r(i,o)??we;n.push(z(i,o,t))}return le(n)}function fe(t){return pe(t.map(([t,e])=>{const s=W(t,e,0),r=W(t,e,1);return new gt(s,r)}))}function le(t){return pe(t.map(t=>t?new pt(Q(t)):void 0))}function de(t,e){return le(t.map(([t,s])=>[t,s,e]))}function pe(e){if(0!==e.length)return 1===e.length?e[0]??void 0:new kt(e.filter(t))}function me(t){return t instanceof kt}function ge(t){return t instanceof pt}function _e(t){return t instanceof mt}function ke(t){return t instanceof Pt}function Le(t){return t instanceof qt}function xe(t){return t instanceof Lt}function ye(t){return t instanceof xt}function ze(t){return t instanceof yt}function Me(t){return t instanceof At}function Pe(t){return t instanceof Zt}function Te(t){return t instanceof Gt}function qe(t){return t instanceof Ut}const we=0;export{yt as CircleConstraint,dt as Constraint,Ut as CoordinateConstraint,Zt as DrapedLineConstraint,Gt as GeodesicConstraint,xt as HorizontalCircleConstraint,Pt as HorizontalPlaneConstraint,gt as LineConstraint,mt as LineLikeConstraint,pt as PointConstraint,_t as RayConstraint,kt as SetConstraint,At as SphereConstraint,Lt as VerticalCylinderConstraint,bt as VerticalHalfPlaneConstraint,Rt as VerticalPlaneConstraint,qt as VerticalPlaneLikeConstraint,pe as constraintOrSet,ge as isPoint};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{f as s,j as n}from"../../../../../chunks/vec32.js";import{create as i,clone as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as c,fromPoints as d,projectPoint as a}from"../../../../../geometry/support/lineSegment.js";import{a as p,o as m}from"../../../../../chunks/sphere.js";import{Octree as u}from"../../../../3d/webgl-engine/lib/Octree.js";import{extractComponentsEdgeLocationsLayout as h}from"../../../../3d/webgl-engine/lib/edgeRendering/edgeProcessing.js";import{maxCandidateCount as g,boundsFromEdge as l}from"./sceneLayerSnappingUtils.js";let f=class{constructor(){this._idToComponent=new Map,this._components=new u(e=>e.bounds),this._edges=new u(e=>e.bounds),this._tmpLineSegment=c(),this._tmpP1=i(),this._tmpP2=i(),this._tmpP3=i(),this.remoteClient=null}async fetchCandidates(e,o){await Promise.resolve(),t(o),await this._ensureEdgeLocations(e,o);const s=[];return this._edges.forEachNeighbor(t=>(this._addCandidates(e,t,s),s.length<g),e.bounds),{result:{candidates:s}}}async _ensureEdgeLocations(e,t){const o=[];if(this._components.forEachNeighbor(e=>{if(null==e.info){const{id:t,uid:s}=e;o.push({id:t,uid:s})}return!0},e.bounds),!o.length)return;const s={components:o},n=await this.remoteClient.invoke("fetchAllEdgeLocations",s,t??{});for(const i of n.components)this._setFetchEdgeLocations(i)}async add(e){const t=new j(e.id,e.bounds);return this._idToComponent.set(t.id,t),this._components.add([t]),{result:{}}}async remove(e){const t=this._idToComponent.get(e.id);if(t){const e=[];this._edges.forEachNeighbor(o=>(o.component===t&&e.push(o),!0),t.bounds),this._edges.remove(e),this._components.remove([t]),this._idToComponent.delete(t.id)}return{result:{}}}_setFetchEdgeLocations(e){const t=this._idToComponent.get(e.id);if(null==t||e.uid!==t.uid)return;const o=h.createView(e.locations),s=new Array(o.count),n=i(),r=i();for(let i=0;i<o.count;i++){o.position0.getVec(i,n),o.position1.getVec(i,r);const c=l(n,r,e.origin),d=new w(t,i,c);s[i]=d}this._edges.add(s);const{objectIds:c,origin:d}=e;t.info={locations:o,objectIds:c,origin:d}}_addCandidates(e,t,o){const{info:n}=t.component,{origin:i,objectIds:r}=n,c=n.locations,d=c.position0.getVec(t.index,this._tmpP1),a=c.position1.getVec(t.index,this._tmpP2);s(d,d,i),s(a,a,i);const p=r[c.componentIndex.get(t.index)];this._addEdgeCandidate(e,p,d,a,o),b(e,p,d,o),b(e,p,a,o)}_addEdgeCandidate(e,t,o,s,i){if(!e.returnEdge)return;const c=p(e.bounds),u=d(o,s,this._tmpLineSegment),h=a(u,c,this._tmpP3);m(e.bounds,h)&&i.push({type:"edge",objectId:t,target:r(h),distance:n(c,h),start:r(o),end:r(s)})}};f=e([o("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],f);const _=f;function b(e,t,o,s){if(!e.returnVertex||!m(e.bounds,o))return;const i=p(e.bounds);s.push({type:"vertex",objectId:t,target:r(o),distance:n(i,o)})}class j{constructor(e,t){this.id=e,this.bounds=t,this.info=null,this.uid=++j.uid}static{this.uid=0}}class w{constructor(e,t,o){this.component=e,this.index=t,this.bounds=o}}export{_ as default};
5
+ import{__decorate as e}from"tslib";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{f as s,j as n}from"../../../../../chunks/vec32.js";import{create as i,clone as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as c,fromPoints as d,projectPoint as a}from"../../../../../geometry/support/lineSegment.js";import{a as p,A as m}from"../../../../../chunks/sphere.js";import{Octree as u}from"../../../../3d/webgl-engine/lib/Octree.js";import{extractComponentsEdgeLocationsLayout as h}from"../../../../3d/webgl-engine/lib/edgeRendering/edgeProcessing.js";import{maxCandidateCount as g,boundsFromEdge as l}from"./sceneLayerSnappingUtils.js";let f=class{constructor(){this._idToComponent=new Map,this._components=new u(e=>e.bounds),this._edges=new u(e=>e.bounds),this._tmpLineSegment=c(),this._tmpP1=i(),this._tmpP2=i(),this._tmpP3=i(),this.remoteClient=null}async fetchCandidates(e,o){await Promise.resolve(),t(o),await this._ensureEdgeLocations(e,o);const s=[];return this._edges.forEachNeighbor(t=>(this._addCandidates(e,t,s),s.length<g),e.bounds),{result:{candidates:s}}}async _ensureEdgeLocations(e,t){const o=[];if(this._components.forEachNeighbor(e=>{if(null==e.info){const{id:t,uid:s}=e;o.push({id:t,uid:s})}return!0},e.bounds),!o.length)return;const s={components:o},n=await this.remoteClient.invoke("fetchAllEdgeLocations",s,t??{});for(const i of n.components)this._setFetchEdgeLocations(i)}async add(e){const t=new j(e.id,e.bounds);return this._idToComponent.set(t.id,t),this._components.add([t]),{result:{}}}async remove(e){const t=this._idToComponent.get(e.id);if(t){const e=[];this._edges.forEachNeighbor(o=>(o.component===t&&e.push(o),!0),t.bounds),this._edges.remove(e),this._components.remove([t]),this._idToComponent.delete(t.id)}return{result:{}}}_setFetchEdgeLocations(e){const t=this._idToComponent.get(e.id);if(null==t||e.uid!==t.uid)return;const o=h.createView(e.locations),s=new Array(o.count),n=i(),r=i();for(let i=0;i<o.count;i++){o.position0.getVec(i,n),o.position1.getVec(i,r);const c=l(n,r,e.origin),d=new w(t,i,c);s[i]=d}this._edges.add(s);const{objectIds:c,origin:d}=e;t.info={locations:o,objectIds:c,origin:d}}_addCandidates(e,t,o){const{info:n}=t.component,{origin:i,objectIds:r}=n,c=n.locations,d=c.position0.getVec(t.index,this._tmpP1),a=c.position1.getVec(t.index,this._tmpP2);s(d,d,i),s(a,a,i);const p=r[c.componentIndex.get(t.index)];this._addEdgeCandidate(e,p,d,a,o),b(e,p,d,o),b(e,p,a,o)}_addEdgeCandidate(e,t,o,s,i){if(!e.returnEdge)return;const c=p(e.bounds),u=d(o,s,this._tmpLineSegment),h=a(u,c,this._tmpP3);m(e.bounds,h)&&i.push({type:"edge",objectId:t,target:r(h),distance:n(c,h),start:r(o),end:r(s)})}};f=e([o("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],f);const _=f;function b(e,t,o,s){if(!e.returnVertex||!m(e.bounds,o))return;const i=p(e.bounds);s.push({type:"vertex",objectId:t,target:r(o),distance:n(i,o)})}class j{constructor(e,t){this.id=e,this.bounds=t,this.info=null,this.uid=++j.uid}static{this.uid=0}}class w{constructor(e,t,o){this.component=e,this.index=t,this.bounds=o}}export{_ as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{b as s,j as o,f as r}from"../../../../../chunks/vec32.js";import{c,a as n}from"../../../../../chunks/sphere.js";const t=1e3;function a(t,a,e){const f=c(),m=n(f);return s(m,m,t,.5),s(m,m,a,.5),f[3]=o(m,t),r(m,m,e),f}export{a as boundsFromEdge,t as maxCandidateCount};
5
+ import{g as s,b as o,j as r,f as t}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{r as e}from"../../../../../chunks/sphere.js";const n=1e3;function a(c,n,a){const i=f;s(i,c,.5),o(i,i,n,.5);const m=r(i,c);return t(i,i,a),e(i,m)}const f=c();export{a as boundsFromEdge,n as maxCandidateCount};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import{removeMaybe as r}from"../../core/maybe.js";import{createResolver as t,onAbort as i,throwIfAborted as l}from"../../core/promiseUtils.js";import a from"../../layers/Layer.js";function s(e){return"tryRecycleWith"in e}class o{constructor(r,l,a){this.layer=r,this.view=l,this.layerViewImporter=a,this._controller=new AbortController,this._deferred=t(),this._started=!1,this.done=!1,this.promise=this._deferred.promise,i(this._controller.signal,()=>{this._recycleController?.abort();const t=new e("cancelled:layerview-create","layerview creation cancelled",{layer:r});this._deferred.reject(t)})}tryRecycle(e){if(!this.done||!this.layerView||!s(this.layerView))return null;this._recycleController?.abort(),this._recycleController=new AbortController;const r=this.layer.type,t=this._recycleController.signal;for(let i=0;i<e.length;i++){const a=e[i];if(a.type!==r)continue;const s=this.layerView.tryRecycleWith(a,{signal:t});if(s){e.splice(i,1),this.layer=a;const r=this.layerView,o=r.view;return this.promise=s.then(()=>(l(t),a.emit("layerview-destroy",{view:o,layerView:r}),o.emit("layerview-destroy",{view:o,layerView:r}),a.emit("layerview-create",{view:o,layerView:r}),o.emit("layerview-create",{view:o,layerView:r}),r)),this.promise}}return null}destroy(){this._controller.abort();const{layerView:e}=this;if(e){const{layer:r,view:t}=this;r.emit("layerview-destroy",{view:t,layerView:e}),t.emit("layerview-destroy",{layer:r,layerView:e})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null,this.promise=null,this._deferred=null}async start(){const{view:t}=this;if(this._started||!t.map)return;this._started=!0;const{_controller:{signal:a},layer:s}=this;this._map=t.map;try{let n,w;if(await s.load({signal:a}),s.prefetchResources&&await s.prefetchResources({signal:a}),y(s))n=await s.createLayerView(t,{signal:a});else{if(!this.layerViewImporter.hasLayerViewModule(s))throw new e("layer:view-not-supported","No layerview implementation was found");const r=await this.layerViewImporter.importLayerView(s);l(a),n="default"in r?new r.default({layer:s,view:t}):new r({layer:s,view:t})}const c=()=>{w=r(w),n.destroyed||n.destroy(),this.done=!0};w=i(a,c),l(a);try{await n.when()}catch(o){throw c(),o}const h=this._map?.allLayers?.includes(s);if(!h)return c(),void this._deferred.reject(new e("view:no-layerview-for-layer","The layer has been removed from the map",{layer:s}));this.layerView=n,s.emit("layerview-create",{view:t,layerView:n}),t.emit("layerview-create",{layer:s,layerView:n}),this.done=!0,this._deferred.resolve(n)}catch(o){s.emit("layerview-create-error",{view:t,error:o}),t.emit("layerview-create-error",{layer:s,error:o}),this.done=!0,this._deferred.reject(new e("layerview:create-error","layerview creation failed",{layer:s,error:o}))}}}function y(e){return e.createLayerView!==a.prototype.createLayerView}export{o as LayerLayerViewInfo};
5
+ import e from"../../core/Error.js";import{removeMaybe as r}from"../../core/maybe.js";import{createResolver as t,onAbort as i,throwIfAborted as l}from"../../core/promiseUtils.js";import a from"../../layers/Layer.js";function s(e){return"tryRecycleWith"in e}class o{constructor(r,l,a){this.layer=r,this.view=l,this.layerViewImporter=a,this._controller=new AbortController,this._started=!1,this.done=!1,this._deferred=t(),this.promise=this._deferred.promise,i(this._controller.signal,()=>{this._recycleController?.abort();const t=new e("cancelled:layerview-create","layerview creation cancelled",{layer:r});this._deferred?.reject(t)})}tryRecycle(e){if(!this.done||!this.layerView||!s(this.layerView))return null;this._recycleController?.abort(),this._recycleController=new AbortController;const r=this.layer.type,t=this._recycleController.signal;for(let i=0;i<e.length;i++){const a=e[i];if(a.type!==r)continue;const s=this.layerView.tryRecycleWith(a,{signal:t});if(s){e.splice(i,1),this.layer=a;const r=this.layerView,o=r.view;return this.promise=s.then(()=>(l(t),a.emit("layerview-destroy",{view:o,layerView:r}),o.emit("layerview-destroy",{view:o,layerView:r}),a.emit("layerview-create",{view:o,layerView:r}),o.emit("layerview-create",{view:o,layerView:r}),r)),this.promise}}return null}destroy(){this._controller.abort();const{layerView:e}=this;if(e){const{layer:r,view:t}=this;r.emit("layerview-destroy",{view:t,layerView:e}),t.emit("layerview-destroy",{layer:r,layerView:e})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null,this.promise=null,this._deferred=null}async start(){const{view:t}=this;if(this._started||!t.map)return;this._started=!0;const{_controller:{signal:a},layer:s}=this;this._map=t.map;try{let n,w;if(await s.load({signal:a}),s.prefetchResources&&await s.prefetchResources({signal:a}),y(s))n=await s.createLayerView(t,{signal:a});else{if(!this.layerViewImporter.hasLayerViewModule(s))throw new e("layer:view-not-supported","No layerview implementation was found");const r=await this.layerViewImporter.importLayerView(s);l(a),n="default"in r?new r.default({layer:s,view:t}):new r({layer:s,view:t})}const c=()=>{w=r(w),n.destroyed||n.destroy(),this.done=!0};w=i(a,c),l(a);try{await n.when()}catch(o){throw c(),o}const h=this._map?.allLayers?.includes(s);if(!h)return c(),void this._deferred?.reject(new e("view:no-layerview-for-layer","The layer has been removed from the map",{layer:s}));this.layerView=n,s.emit("layerview-create",{view:t,layerView:n}),t.emit("layerview-create",{layer:s,layerView:n}),this.done=!0,this._deferred?.resolve(n)}catch(o){s.emit("layerview-create-error",{view:t,error:o}),t.emit("layerview-create-error",{layer:s,error:o}),this.done=!0,this._deferred?.reject(new e("layerview:create-error","layerview creation failed",{layer:s,error:o}))}}}function y(e){return e.createLayerView!==a.prototype.createLayerView}export{o as LayerLayerViewInfo};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../../core/Accessor.js";import i from"../../core/Error.js";import t from"../../core/Logger.js";import{someMap as s}from"../../core/MapUtils.js";import{createResolver as a,createAbortError as o,isAbortError as n}from"../../core/promiseUtils.js";import{on as l,watch as y,syncAndInitial as h}from"../../core/reactiveUtils.js";import{schedule as p}from"../../core/scheduling.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{get as w}from"../../core/accessorSupport/get.js";import{UpdatingHandles as m}from"../../core/support/UpdatingHandles.js";import{destroyMap as f}from"../../support/collectionUtils.js";import{LayerLayerViewInfo as u}from"./LayerLayerViewInfo.js";function g(e){return null!=e&&"object"==typeof e&&"layerViews"in e}let _=class extends r{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new m,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const e=this.view.map?.allLayers;if(e)for(const r of e)!1!==this.layerViewFilter?.(r)&&this.layerViewImporter.hasLayerViewModule(r)&&this.layerViewImporter.importLayerView(r)},this._reschedule=()=>this.destroyed?Promise.reject():(null==this._workPromise&&(this._workPromise=a(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(p(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{if(this.destroyed)return;const{map:e}=this.view;if(!e)return void this.clear();if(this._map!==e&&(this.clear(),this._map=e),null==this._workPromise)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const r=new Set,i=[],t=this.view.ready,s=e=>{if(null!=e)for(const a of e)if(a){if(!1===this.layerViewFilter?.(a))continue;r.add(a);const e=this._layerLayerViewInfoMap.get(a);e&&t?e.start():e||this._recyclingInfoMap.has(a)||i.push(a),"layers"in a&&a.layers&&s(a.layers)}};for(const n of this._rootCollectionNames)s(w(this,n));const a=new Array,o=e=>{const r=e.tryRecycle(i);r?(this._recyclingInfoMap.set(e.layer,e),this.notifyChange("updating"),r.then(()=>{this._recyclingInfoMap.delete(e.layer),this._layerLayerViewInfoMap.set(e.layer,e),this._reschedule(),this.notifyChange("updating")}).catch(r=>{n(r)||(this._recyclingInfoMap.delete(e.layer),e.destroy(),this._reschedule(),this.notifyChange("updating"))})):a.push(e)};for(const n of this._layerLayerViewInfoMap.values())r.has(n.layer)||(this._layerLayerViewInfoMap.delete(n.layer),o(n));for(const n of this._recyclingInfoMap.values())r.has(n.layer)||(this._recyclingInfoMap.delete(n.layer),o(n));for(const n of i)this._createLayerView(n);this._refreshCollections(),a.forEach(e=>e.destroy());const l=[e?.ground?.layers,e?.basemap?.baseLayers,e?.basemap?.groundLayers,e?.basemap?.referenceLayers,e?.layers].filter(e=>!!e);r.forEach(e=>"layers"in e&&l.push(e.layers)),this.addHandles(l.map(e=>this._watchUpdatingTracking.addOnCollectionChange(()=>e,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.addHandles([l(()=>this.view?.map?.allLayers,"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),y(()=>{const e=this.view,r=e?.map;return[r?.basemap,r?.ground,r?.layers,e?.ready]},()=>this._reschedule(),h)]),this._preloadLayerViewModules(),this._reschedule()}clearHandles(){this._watchUpdatingTracking.removeAll()}destroy(){this.clear(),f(this._recyclingInfoMap),f(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,null!=this._workPromise&&(this._workPromise.reject(o()),this._workPromise=null)}get _layersToLayerViews(){const e=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.basemap.groundLayers","view.basemapView.groundLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&e.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(e)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return null!=this._workPromise||this._watchUpdatingTracking.updating||s(this._layerLayerViewInfoMap,e=>!e.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let e=0;for(const r of this._layerLayerViewInfoMap.values())r.done||++e;return e}clear(){this.destroyed||(this._clearCollections(),f(this._layerLayerViewInfoMap))}async whenLayerView(e){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(e)){if(this._recyclingInfoMap.has(e))return this._recyclingInfoMap.get(e).promise;throw new i("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e})}return this._layerLayerViewInfoMap.get(e).promise}isCreatingLayerViewsForLayer(e,r){this.commitProperty("updatingRemaining");const i=this._layerLayerViewInfoMap.get(e);if(!i?.done)return!0;const t=i.layerView;return!(!t||!r||t.parent===r)||!!(i.done&&t&&"layers"in e&&e.layers?.length)&&e.layers.some(e=>this.isCreatingLayerViewsForLayer(e,t))}_refreshCollections(){for(const[e,r]of this._layersToLayerViews)this._populateLayerViewsOwners(w(this,e),w(this,r),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_clearCollections(){for(const e of this._layersToLayerViews.values())w(this,e)?.removeAll()}_populateLayerViewsOwners(e,r,i){if(!e||!r)return void r?.removeAll();let t=0;for(const s of e){const e=this._layerLayerViewInfoMap.get(s);if(!e?.layerView)continue;const a=e.layerView;a.layer=s,a.parent=i,r.at(t)!==a&&r.splice(t,0,a),"layers"in s&&g(a)&&this._populateLayerViewsOwners(s.layers,a.layerViews,a),t+=1}t<r.length&&r.splice(t)}_createLayerView(e){e.load().catch(r=>{t.getLogger("LayerViewManager").error(`Error loading layer "${e.title}"`,r)}),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const r=new u(e,this.view,this.layerViewImporter);r.promise.then(()=>this._refreshCollections(),r=>{r&&(n(r)||"cancelled:layerview-create"===r.name)||t.getLogger(this).error(`Failed to create layerview for layer title:'${e.title??"no title"}', id:'${e.id??"no id"}' of type '${e.type}'.`,{layer:e,error:r}),this._refreshCollections()}),this._layerLayerViewInfoMap.set(e,r),this.view.ready&&r.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};e([c()],_.prototype,"_workPromise",void 0),e([c({readOnly:!0})],_.prototype,"_watchUpdatingTracking",void 0),e([c({readOnly:!0})],_.prototype,"_layersToLayerViews",null),e([c({readOnly:!0})],_.prototype,"_rootCollectionNames",null),e([c({constructOnly:!0})],_.prototype,"layerViewFilter",void 0),e([c()],_.prototype,"layerViewImporter",void 0),e([c()],_.prototype,"supportsGround",void 0),e([c({readOnly:!0})],_.prototype,"updating",null),e([c({readOnly:!0})],_.prototype,"updatingRemaining",null),e([c({constructOnly:!0})],_.prototype,"view",void 0),_=e([d("esri.views.support.LayerViewManager")],_);const V=_;export{V as default};
5
+ import{__decorate as e}from"tslib";import r from"../../core/Accessor.js";import i from"../../core/Error.js";import t from"../../core/Logger.js";import{someMap as s}from"../../core/MapUtils.js";import{createResolver as o,createAbortError as a,isAbortError as n}from"../../core/promiseUtils.js";import{on as l,watch as y,syncAndInitial as h}from"../../core/reactiveUtils.js";import{schedule as p}from"../../core/scheduling.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{get as w}from"../../core/accessorSupport/get.js";import{UpdatingHandles as m}from"../../core/support/UpdatingHandles.js";import{destroyMap as u}from"../../support/collectionUtils.js";import{LayerLayerViewInfo as f}from"./LayerLayerViewInfo.js";function g(e){return null!=e&&"object"==typeof e&&"layerViews"in e}let _=class extends r{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new m,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const e=this.view.map?.allLayers;if(e)for(const r of e)!1!==this.layerViewFilter?.(r)&&this.layerViewImporter.hasLayerViewModule(r)&&this.layerViewImporter.importLayerView(r)},this._reschedule=()=>this.destroyed?Promise.reject():(null==this._workPromise&&(this._workPromise=o(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(p(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{if(this.destroyed)return;const{map:e}=this.view;if(!e)return void this.clear();if(this._map!==e&&(this.clear(),this._map=e),null==this._workPromise)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const r=new Set,i=[],t=this.view.ready,s=e=>{if(null!=e)for(const o of e)if(o){if(!1===this.layerViewFilter?.(o))continue;r.add(o);const e=this._layerLayerViewInfoMap.get(o);e&&t?e.start():e||this._recyclingInfoMap.has(o)||i.push(o),"layers"in o&&o.layers&&s(o.layers)}};for(const n of this._rootCollectionNames)s(w(this,n));const o=new Array,a=e=>{const r=e.tryRecycle(i);r?(this._recyclingInfoMap.set(e.layer,e),this.notifyChange("updating"),r.then(()=>{this._recyclingInfoMap.delete(e.layer),this._layerLayerViewInfoMap.set(e.layer,e),this._reschedule(),this.notifyChange("updating")}).catch(r=>{n(r)||(this._recyclingInfoMap.delete(e.layer),e.destroy(),this._reschedule(),this.notifyChange("updating"))})):o.push(e)};for(const n of this._layerLayerViewInfoMap.values())r.has(n.layer)||(this._layerLayerViewInfoMap.delete(n.layer),a(n));for(const n of this._recyclingInfoMap.values())r.has(n.layer)||(this._recyclingInfoMap.delete(n.layer),a(n));for(const n of i)this._createLayerView(n);this._refreshCollections(),o.forEach(e=>e.destroy());const l=[e?.ground?.layers,e?.basemap?.baseLayers,e?.basemap?.groundLayers,e?.basemap?.referenceLayers,e?.layers].filter(e=>!!e);r.forEach(e=>"layers"in e&&l.push(e.layers)),this.addHandles(l.map(e=>this._watchUpdatingTracking.addOnCollectionChange(()=>e,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.addHandles([l(()=>this.view?.map?.allLayers,"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),y(()=>{const e=this.view,r=e?.map;return[r?.basemap,r?.ground,r?.layers,e?.ready]},()=>this._reschedule(),h)]),this._preloadLayerViewModules(),this._reschedule()}clearHandles(){this._watchUpdatingTracking.removeAll()}destroy(){this.clear(),u(this._recyclingInfoMap),u(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,null!=this._workPromise&&(this._workPromise.reject(a()),this._workPromise=null)}get _layersToLayerViews(){const e=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.basemap.groundLayers","view.basemapView.groundLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&e.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(e)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return null!=this._workPromise||this._watchUpdatingTracking.updating||s(this._layerLayerViewInfoMap,e=>!e.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let e=0;for(const r of this._layerLayerViewInfoMap.values())r.done||++e;return e}clear(){this.destroyed||(this._clearCollections(),u(this._layerLayerViewInfoMap))}async whenLayerView(e){await this._reschedule();const r=this._layerLayerViewInfoMap.get(e)?.promise;if(!r){const r=this._recyclingInfoMap.get(e)?.promise;if(!r)throw new i("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e});return r}return r}isCreatingLayerViewsForLayer(e,r){this.commitProperty("updatingRemaining");const i=this._layerLayerViewInfoMap.get(e);if(!i?.done)return!0;const t=i.layerView;return!(!t||!r||t.parent===r)||!!(i.done&&t&&"layers"in e&&e.layers?.length)&&e.layers.some(e=>this.isCreatingLayerViewsForLayer(e,t))}_refreshCollections(){for(const[e,r]of this._layersToLayerViews)this._populateLayerViewsOwners(w(this,e),w(this,r),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_clearCollections(){for(const e of this._layersToLayerViews.values())w(this,e)?.removeAll()}_populateLayerViewsOwners(e,r,i){if(!e||!r)return void r?.removeAll();let t=0;for(const s of e){const e=this._layerLayerViewInfoMap.get(s);if(!e?.layerView)continue;const o=e.layerView;o.layer=s,o.parent=i,r.at(t)!==o&&r.splice(t,0,o),"layers"in s&&g(o)&&this._populateLayerViewsOwners(s.layers,o.layerViews,o),t+=1}t<r.length&&r.splice(t)}_createLayerView(e){e.load().catch(r=>{t.getLogger("LayerViewManager").error(`Error loading layer "${e.title}"`,r)}),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const r=new f(e,this.view,this.layerViewImporter);r.promise?.then(()=>this._refreshCollections(),r=>{r&&(n(r)||"cancelled:layerview-create"===r.name)||t.getLogger(this).error(`Failed to create layerview for layer title:'${e.title??"no title"}', id:'${e.id??"no id"}' of type '${e.type}'.`,{layer:e,error:r}),this._refreshCollections()}),this._layerLayerViewInfoMap.set(e,r),this.view.ready&&r.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};e([c()],_.prototype,"_workPromise",void 0),e([c({readOnly:!0})],_.prototype,"_watchUpdatingTracking",void 0),e([c({readOnly:!0})],_.prototype,"_layersToLayerViews",null),e([c({readOnly:!0})],_.prototype,"_rootCollectionNames",null),e([c({constructOnly:!0})],_.prototype,"layerViewFilter",void 0),e([c()],_.prototype,"layerViewImporter",void 0),e([c()],_.prototype,"supportsGround",void 0),e([c({readOnly:!0})],_.prototype,"updating",null),e([c({readOnly:!0})],_.prototype,"updatingRemaining",null),e([c({constructOnly:!0})],_.prototype,"view",void 0),_=e([d("esri.views.support.LayerViewManager")],_);const V=_;export{V as default};
@@ -1,4 +1,4 @@
1
1
  import "../../interfaces";
2
2
 
3
- import ElevationProfileElevationProfileLine = __esri.ElevationProfileElevationProfileLine;
4
- export default ElevationProfileElevationProfileLine;
3
+ import ElevationProfileLine = __esri.ElevationProfileLine;
4
+ export default ElevationProfileLine;
@@ -1,4 +1,4 @@
1
1
  import "../../interfaces";
2
2
 
3
- import ElevationProfileElevationProfileLineGround = __esri.ElevationProfileElevationProfileLineGround;
4
- export default ElevationProfileElevationProfileLineGround;
3
+ import ElevationProfileLineGround = __esri.ElevationProfileLineGround;
4
+ export default ElevationProfileLineGround;
@@ -1,4 +1,4 @@
1
1
  import "../../interfaces";
2
2
 
3
- import ElevationProfileElevationProfileLineInput = __esri.ElevationProfileElevationProfileLineInput;
4
- export default ElevationProfileElevationProfileLineInput;
3
+ import ElevationProfileLineInput = __esri.ElevationProfileLineInput;
4
+ export default ElevationProfileLineInput;
@@ -1,4 +1,4 @@
1
1
  import "../../interfaces";
2
2
 
3
- import ElevationProfileElevationProfileLineQuery = __esri.ElevationProfileElevationProfileLineQuery;
4
- export default ElevationProfileElevationProfileLineQuery;
3
+ import ElevationProfileLineQuery = __esri.ElevationProfileLineQuery;
4
+ export default ElevationProfileLineQuery;