@arcgis/core 4.34.0-next.92 → 4.34.0-next.94

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 (348) hide show
  1. package/Color.js +1 -1
  2. package/Ground.js +1 -1
  3. package/WebScene.js +1 -1
  4. package/analysis/ElevationProfile/ElevationProfileDisplayUnits.d.ts +4 -0
  5. package/analysis/ElevationProfile/{ElevationProfileUnits.js → ElevationProfileDisplayUnits.js} +1 -1
  6. package/analysis/ElevationProfile/ElevationProfileUnits.d.ts +1 -1
  7. package/analysis/ElevationProfile/ElevationProfileViewOptions.js +1 -1
  8. package/analysis/ElevationProfileAnalysis.js +1 -1
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/004b13c1db79c9e668b1.js +1 -0
  11. package/assets/esri/core/workers/chunks/{700b5a536f97233bc4af.js → 03b455e9405a8b6fec68.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{a244afea77127e54dd3a.js → 08b0fc6bfe9640ee2525.js} +1 -1
  13. package/assets/esri/core/workers/chunks/0a981061df08da19372c.js +1 -0
  14. package/assets/esri/core/workers/chunks/{db5a985ccc6b7d0ad855.js → 176f56de787bf486be9f.js} +1 -1
  15. package/assets/esri/core/workers/chunks/1fc7df018c8f802565a6.js +1 -0
  16. package/assets/esri/core/workers/chunks/20003728a679479b14dc.js +1 -0
  17. package/assets/esri/core/workers/chunks/20f4c6d8b310ecab97be.js +1 -0
  18. package/assets/esri/core/workers/chunks/25639559336109ff3df1.js +1 -0
  19. package/assets/esri/core/workers/chunks/26081b6486c623735657.js +1 -0
  20. package/assets/esri/core/workers/chunks/2698f656405876f4bd20.js +1 -0
  21. package/assets/esri/core/workers/chunks/{4660798b3b45dcb5cecb.js → 2b9c9a35a6e1f56920b5.js} +2 -2
  22. package/assets/esri/core/workers/chunks/352511dbc67166face40.js +1 -0
  23. package/assets/esri/core/workers/chunks/3acd79a6a0572926a799.js +1 -0
  24. package/assets/esri/core/workers/chunks/3d7923d25734d03a4d27.js +1 -0
  25. package/assets/esri/core/workers/chunks/48133effac2eacc2196e.js +1 -0
  26. package/assets/esri/core/workers/chunks/4dfcd03082be83600f3a.js +1 -0
  27. package/assets/esri/core/workers/chunks/503c81dda242e6077317.js +1 -0
  28. package/assets/esri/core/workers/chunks/{06aed0a5464965be8d52.js → 56b3bb68b61b77138186.js} +1 -1
  29. package/assets/esri/core/workers/chunks/5746c4861af83c1d57a8.js +1 -0
  30. package/assets/esri/core/workers/chunks/5aacd1c6b171c99b41f5.js +1 -0
  31. package/assets/esri/core/workers/chunks/6810ecdeccf4b7eae5e2.js +1 -0
  32. package/assets/esri/core/workers/chunks/6b208f5d423da64c8559.js +1 -0
  33. package/assets/esri/core/workers/chunks/{7a240ab31d9ff2d2c5af.js → 73db6c070b049fe05147.js} +1 -1
  34. package/assets/esri/core/workers/chunks/801451fb572bc5f1f270.js +1 -0
  35. package/assets/esri/core/workers/chunks/82e0d22619dc26920ca9.js +1 -0
  36. package/assets/esri/core/workers/chunks/8f426cb210a4250517d5.js +1 -0
  37. package/assets/esri/core/workers/chunks/94ddf029698991d853b9.js +1 -0
  38. package/assets/esri/core/workers/chunks/97eb2cfc1f036feea9a9.js +1 -0
  39. package/assets/esri/core/workers/chunks/98381404f2d99a1f9341.js +1 -0
  40. package/assets/esri/core/workers/chunks/9adecee0ed2f1df3b0d2.js +1 -0
  41. package/assets/esri/core/workers/chunks/a0fab8cd791c33d3895d.js +1 -0
  42. package/assets/esri/core/workers/chunks/{a85acb948cc7d22be592.js → a410dcf80d17a2383337.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{d9d86cf0500fa29d1d43.js → a98b284b147258629947.js} +1 -1
  44. package/assets/esri/core/workers/chunks/b1ccbc2fef7f7e5e04f7.js +1 -0
  45. package/assets/esri/core/workers/chunks/b5c829e904bc9cb5347d.js +1 -0
  46. package/assets/esri/core/workers/chunks/bec9ddd38c9ab9f2561b.js +1 -0
  47. package/assets/esri/core/workers/chunks/bf9031749d10e7d457b6.js +1 -0
  48. package/assets/esri/core/workers/chunks/bf9d09493fd849ea69fd.js +1 -0
  49. package/assets/esri/core/workers/chunks/c4641c2c130c7b8bcdee.js +1 -0
  50. package/assets/esri/core/workers/chunks/{58e2652810143f509fe1.js → c473b15d4d52f0a63d20.js} +1 -1
  51. package/assets/esri/core/workers/chunks/c8e4fe0e3b109eb80e8e.js +1 -0
  52. package/assets/esri/core/workers/chunks/c9159ebf930af3f336f3.js +1 -0
  53. package/assets/esri/core/workers/chunks/cd0c222a36caa7f80860.js +1 -0
  54. package/assets/esri/core/workers/chunks/ce2fcaa21d6efcdf4da5.js +1 -0
  55. package/assets/esri/core/workers/chunks/d2df6e685d6cffc5f486.js +1 -0
  56. package/assets/esri/core/workers/chunks/{c27783ce7ea51a5e49c5.js → e153b61560a7a869db63.js} +1 -1
  57. package/assets/esri/core/workers/chunks/e2c293331515f3bd0355.js +1 -0
  58. package/assets/esri/core/workers/chunks/{100a0041ee42b0b2fa32.js → e5d974593043d5e2b502.js} +1 -1
  59. package/assets/esri/core/workers/chunks/ec7b156425f25d231078.js +1 -0
  60. package/assets/esri/core/workers/chunks/{1194c2432c31def87db1.js → f71b76c9506178124fa3.js} +1 -1
  61. package/assets/esri/core/workers/chunks/fb456e7425e09df17d8c.js +1 -0
  62. package/assets/esri/core/workers/chunks/{f6806780ca2aa591475a.js → fe1dcf9f81da4adbb1fe.js} +1 -1
  63. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  64. package/assets/esri/themes/base/_core.scss +0 -2
  65. package/assets/esri/themes/base/widgets/_OrientedImageryViewerNavigationUI.scss +10 -7
  66. package/assets/esri/themes/dark/main.css +1 -1
  67. package/assets/esri/themes/light/main.css +1 -1
  68. package/assets/esri/themes/light/view.css +1 -1
  69. package/chunks/CutFillComposition.glsl.js +15 -3
  70. package/chunks/CutFillMask.glsl.js +1 -1
  71. package/chunks/WaterSurface.glsl.js +0 -1
  72. package/chunks/bundle.js +1 -1
  73. package/chunks/languageUtils.js +1 -1
  74. package/colorUtils.js +1 -1
  75. package/config.js +1 -1
  76. package/core/CollectionFlattener.js +1 -1
  77. package/editing/sharedTemplates/executor/support/createPresetServiceEdit.js +1 -1
  78. package/geometry/operators/json/graphicBufferOperator.js +1 -1
  79. package/geometry/support/aaBoundingRect.js +1 -1
  80. package/geometry/support/geometryUtils.js +1 -1
  81. package/geometry/support/meshUtils/elevationSampler.js +1 -1
  82. package/geometry/support/meshUtils.js +1 -1
  83. package/geometry/support/triangle.js +1 -1
  84. package/interfaces.d.ts +262 -339
  85. package/kernel.js +1 -1
  86. package/layers/BaseElevationLayer.js +1 -1
  87. package/layers/BaseTileLayer.js +1 -1
  88. package/layers/ElevationLayer.js +1 -1
  89. package/layers/FeatureLayer.js +1 -1
  90. package/layers/GaussianSplatLayer.js +1 -1
  91. package/layers/ImageryTileLayer.js +1 -1
  92. package/layers/ParquetLayer.js +1 -1
  93. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  94. package/layers/graphics/dehydratedFeatureComparison.js +1 -1
  95. package/layers/graphics/sources/ParquetSource.js +1 -1
  96. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  97. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  98. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  99. package/layers/support/ElevationQuery.js +1 -1
  100. package/layers/support/ElevationQueryContext.js +5 -0
  101. package/layers/support/ElevationSampler.js +1 -1
  102. package/layers/support/ElevationTile.js +1 -1
  103. package/layers/support/GeometryDescriptor.js +1 -1
  104. package/layers/support/ParquetEncodingLocation.js +1 -1
  105. package/layers/support/ParquetEncodingWkb.js +1 -1
  106. package/layers/support/RasterBandInfo.js +1 -1
  107. package/layers/support/TileElevationSampler.js +5 -0
  108. package/layers/support/TileInfo.js +1 -1
  109. package/layers/support/TileKey.js +1 -1
  110. package/layers/support/TilemapCache.js +1 -1
  111. package/layers/support/layerUtils.js +1 -1
  112. package/layers/support/parquetEncodingUtils.js +5 -0
  113. package/layers/support/parquetUtils.js +1 -1
  114. package/layers/support/rasterDatasets/InMemoryRaster.js +1 -1
  115. package/networks/UtilityNetwork.js +1 -1
  116. package/networks/support/NetworkSystemLayers.js +1 -1
  117. package/networks/support/typeUtils.js +1 -1
  118. package/package.json +3 -2
  119. package/popup/FieldInfo.js +1 -1
  120. package/popup/content/AttachmentsContent.js +1 -1
  121. package/portal/schemas/definitions.js +1 -1
  122. package/rest/knowledgeGraphService.js +1 -1
  123. package/rest/networks/support/Association.js +1 -1
  124. package/rest/print.js +1 -1
  125. package/support/revision.js +1 -1
  126. package/symbols/cim/CIMSymbolHelper.js +1 -1
  127. package/symbols/cim/cimAnalyzer.js +1 -1
  128. package/symbols/cim/effects/EffectOffset.js +1 -1
  129. package/views/2d/analysis/ElevationProfile/ElevationProfileInputVisualization2D.js +1 -1
  130. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  131. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  132. package/views/2d/engine/Stage.js +1 -1
  133. package/views/2d/engine/flow/BrushFlow.js +1 -1
  134. package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
  135. package/views/2d/engine/webgl/Overlay.js +1 -1
  136. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  137. package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
  138. package/views/2d/engine/webgl/TextureManager.js +1 -1
  139. package/views/2d/engine/webgl/animatedFormats/AnimatableTextureResource.js +1 -1
  140. package/views/2d/engine/webgl/animatedFormats/utils.js +1 -1
  141. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  142. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  143. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
  144. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
  145. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
  146. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
  147. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
  148. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  149. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  150. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
  151. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
  152. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
  153. package/views/2d/engine/webgl/shaderGraph/utils.js +1 -1
  154. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  155. package/views/2d/layers/VideoLayerView2D.js +1 -1
  156. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  157. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  158. package/views/2d/navigation/actions/Pan.js +1 -1
  159. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization3D.js +1 -1
  160. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  161. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
  162. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
  163. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  164. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  165. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  166. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  167. package/views/3d/layers/FlowSubView3D.js +1 -1
  168. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  169. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  170. package/views/3d/support/GaussianSplatSortWorker.js +1 -1
  171. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  172. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  173. package/views/3d/support/hitTest.js +1 -1
  174. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  175. package/views/3d/support/popupHitTest.js +1 -1
  176. package/views/3d/terrain/ExtentHelper.js +1 -1
  177. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  178. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  179. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  180. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  181. package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
  182. package/views/3d/webgl-engine/shaders/CutFillComposition.glsl.js +1 -1
  183. package/views/3d/webgl-engine/shaders/GaussianSplatDepthCompositionTechnique.js +1 -1
  184. package/views/PopupView.js +1 -1
  185. package/views/SceneView.js +1 -1
  186. package/views/View.js +1 -1
  187. package/views/View2D.js +1 -1
  188. package/views/Viewport2DMixin.js +1 -1
  189. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  190. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  191. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +1 -1
  192. package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +1 -1
  193. package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +1 -1
  194. package/views/analysis/ElevationProfile/ElevationProfileLineQueryComputation.js +1 -1
  195. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  196. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  197. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  198. package/views/analysis/ElevationProfile/elevationProfileInputVisualizationUtils.js +1 -1
  199. package/views/analysis/ExclusiveOperationManager.js +5 -0
  200. package/views/interactive/snapping/LineSnapper.js +1 -1
  201. package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
  202. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  203. package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
  204. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  205. package/views/interactive/snapping/featureSources/WorkerTileTreeDebugger.js +1 -1
  206. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  207. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  208. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  209. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  210. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
  211. package/views/interactive/snapping/featureSources/featureServiceSource/PendingFeatureTile.js +1 -1
  212. package/views/interactive/snapping/featureSources/queryEngineUtils.js +1 -1
  213. package/views/interactive/snapping/snappingUtils.js +1 -1
  214. package/views/navigation/Navigation.js +1 -1
  215. package/views/popupAdapter.js +5 -0
  216. package/views/support/GroundViewElevationSampler.js +1 -1
  217. package/views/video/VideoOperationalDataView.js +1 -1
  218. package/views/webgl/ContextState.js +1 -1
  219. package/views/webgl/RenderingContext.js +1 -1
  220. package/views/webgl/enums.js +1 -1
  221. package/widgets/Attachments/AttachmentsViewModel.js +1 -1
  222. package/widgets/Attachments.js +1 -1
  223. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  224. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  225. package/widgets/Feature/FeatureExpression.js +1 -1
  226. package/widgets/Feature/FeatureMedia/chartCommon.js +1 -1
  227. package/widgets/Feature/FeatureMedia/pieChart.js +1 -1
  228. package/widgets/Feature/FeatureMedia/xyChart.js +1 -1
  229. package/widgets/Feature/FeatureMedia.js +1 -1
  230. package/widgets/Feature/FeatureViewModel.js +1 -1
  231. package/widgets/Feature.js +1 -1
  232. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  233. package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
  234. package/widgets/FeatureTable/support/TableTemplate.js +1 -1
  235. package/widgets/FeatureTable.js +1 -1
  236. package/widgets/Features/FeaturesViewModel.js +1 -1
  237. package/widgets/Legend/LegendViewModel.js +1 -1
  238. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  239. package/widgets/Legend.js +1 -1
  240. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  241. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  242. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  243. package/widgets/OrientedImageryViewer/components/NavigationUIPanoramicViewModel.js +1 -1
  244. package/widgets/OrientedImageryViewer/services/DepthImageService.js +5 -0
  245. package/widgets/PanoramicViewer.js +1 -1
  246. package/widgets/Search/SearchResultRenderer.js +1 -1
  247. package/widgets/Search/SearchViewModel.js +1 -1
  248. package/widgets/Search.js +1 -1
  249. package/widgets/Sketch/SketchViewModel.js +1 -1
  250. package/widgets/support/chartUtilsAm5.js +1 -1
  251. package/assets/esri/core/workers/chunks/08374e5805fcedc1cb57.js +0 -1
  252. package/assets/esri/core/workers/chunks/0b24a6c06d1becbb6815.js +0 -1
  253. package/assets/esri/core/workers/chunks/14114be3afd6d292f89c.js +0 -1
  254. package/assets/esri/core/workers/chunks/19f1bfe815896d4983af.js +0 -1
  255. package/assets/esri/core/workers/chunks/22c3a21bc9f32c429c48.js +0 -1
  256. package/assets/esri/core/workers/chunks/2605062e44f2d4e73f14.js +0 -1
  257. package/assets/esri/core/workers/chunks/282c4f3484c605ce7d5e.js +0 -1
  258. package/assets/esri/core/workers/chunks/2e1cc11462846febb3b2.js +0 -1
  259. package/assets/esri/core/workers/chunks/37b5007660535f1c91c6.js +0 -1
  260. package/assets/esri/core/workers/chunks/393274af1804e5b6046a.js +0 -1
  261. package/assets/esri/core/workers/chunks/3b2ef975831eb75b40fb.js +0 -1
  262. package/assets/esri/core/workers/chunks/3ff3e1507220d3869c76.js +0 -1
  263. package/assets/esri/core/workers/chunks/4133ab8720e7e4afa9a6.js +0 -1
  264. package/assets/esri/core/workers/chunks/4d807bfe75108438db83.js +0 -1
  265. package/assets/esri/core/workers/chunks/5ad1985a9e66fb2232ae.js +0 -1
  266. package/assets/esri/core/workers/chunks/5b7a2ee44883b1fb2a5f.js +0 -1
  267. package/assets/esri/core/workers/chunks/614a00a3179f8fe23f45.js +0 -1
  268. package/assets/esri/core/workers/chunks/6aa349e1adf844df4b5b.js +0 -1
  269. package/assets/esri/core/workers/chunks/83065bef261314f9b2c5.js +0 -1
  270. package/assets/esri/core/workers/chunks/8bdbd94a59269e216fba.js +0 -1
  271. package/assets/esri/core/workers/chunks/8cae725e631d922853c8.js +0 -1
  272. package/assets/esri/core/workers/chunks/8f4cfef97716c3502b0f.js +0 -1
  273. package/assets/esri/core/workers/chunks/8ff2daef892881ff2019.js +0 -1
  274. package/assets/esri/core/workers/chunks/9bb6984f24cd5461a754.js +0 -1
  275. package/assets/esri/core/workers/chunks/9f2a3f37fe9b19ef1209.js +0 -1
  276. package/assets/esri/core/workers/chunks/a1196637268b89281780.js +0 -1
  277. package/assets/esri/core/workers/chunks/a6a2d4602dfeb62e0ecc.js +0 -1
  278. package/assets/esri/core/workers/chunks/b240298b8b643a323d34.js +0 -1
  279. package/assets/esri/core/workers/chunks/b47f26d6aa9a2848a677.js +0 -1
  280. package/assets/esri/core/workers/chunks/b661ea374fe38c8e29ca.js +0 -1
  281. package/assets/esri/core/workers/chunks/b8997ae5893afa0298d1.js +0 -1
  282. package/assets/esri/core/workers/chunks/baa48614d9567d5f240d.js +0 -1
  283. package/assets/esri/core/workers/chunks/c20862fe15295a294bbd.js +0 -1
  284. package/assets/esri/core/workers/chunks/c3020747f9001ca6a6e7.js +0 -1
  285. package/assets/esri/core/workers/chunks/c7c76a8a1c47eb62bef1.js +0 -1
  286. package/assets/esri/core/workers/chunks/c95e6bef8c97cf647869.js +0 -1
  287. package/assets/esri/core/workers/chunks/d71836cf70b9604832f1.js +0 -1
  288. package/assets/esri/core/workers/chunks/e99fc64b67bb0c71dc34.js +0 -1
  289. package/assets/esri/core/workers/chunks/eea9d49d55c2d1355497.js +0 -1
  290. package/assets/esri/core/workers/chunks/fb6ebb780bb59e252887.js +0 -1
  291. package/assets/esri/core/workers/chunks/ff6d189ba78980d40bb5.js +0 -1
  292. package/assets/esri/themes/base/widgets/_ButtonMenu.scss +0 -87
  293. package/chunks/Button.js +0 -5
  294. package/chunks/ColorSet.js +0 -5
  295. package/chunks/DefaultTheme.js +0 -5
  296. package/chunks/LineSeries.js +0 -5
  297. package/chunks/ResponsiveTheme.js +0 -5
  298. package/chunks/Theme.js +0 -5
  299. package/chunks/Tick.js +0 -5
  300. package/chunks/Tooltip.js +0 -5
  301. package/chunks/ar.js +0 -5
  302. package/chunks/bg_BG.js +0 -5
  303. package/chunks/bs_BA.js +0 -5
  304. package/chunks/ca_ES.js +0 -5
  305. package/chunks/chartUtilsAm5.js +0 -5
  306. package/chunks/cs_CZ.js +0 -5
  307. package/chunks/da_DK.js +0 -5
  308. package/chunks/de_CH.js +0 -5
  309. package/chunks/de_DE.js +0 -5
  310. package/chunks/el_GR.js +0 -5
  311. package/chunks/en_CA.js +0 -5
  312. package/chunks/en_US.js +0 -5
  313. package/chunks/es_ES.js +0 -5
  314. package/chunks/et_EE.js +0 -5
  315. package/chunks/fi_FI.js +0 -5
  316. package/chunks/fr_FR.js +0 -5
  317. package/chunks/he_IL.js +0 -5
  318. package/chunks/hr_HR.js +0 -5
  319. package/chunks/hu_HU.js +0 -5
  320. package/chunks/id_ID.js +0 -5
  321. package/chunks/it_IT.js +0 -5
  322. package/chunks/ja_JP.js +0 -5
  323. package/chunks/ko_KR.js +0 -5
  324. package/chunks/lt_LT.js +0 -5
  325. package/chunks/lv_LV.js +0 -5
  326. package/chunks/nb_NO.js +0 -5
  327. package/chunks/nl_NL.js +0 -5
  328. package/chunks/pl_PL.js +0 -5
  329. package/chunks/pt_BR.js +0 -5
  330. package/chunks/pt_PT.js +0 -5
  331. package/chunks/ro_RO.js +0 -5
  332. package/chunks/ru_RU.js +0 -5
  333. package/chunks/sk_SK.js +0 -5
  334. package/chunks/sl_SL.js +0 -5
  335. package/chunks/sr_RS.js +0 -5
  336. package/chunks/sv_SE.js +0 -5
  337. package/chunks/th_TH.js +0 -5
  338. package/chunks/tr_TR.js +0 -5
  339. package/chunks/uk_UA.js +0 -5
  340. package/chunks/vi_VN.js +0 -5
  341. package/chunks/zh_Hans.js +0 -5
  342. package/chunks/zh_Hant.js +0 -5
  343. package/widgets/FeatureTable/Grid/support/ButtonMenu.d.ts +0 -4
  344. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +0 -5
  345. package/widgets/FeatureTable/Grid/support/ButtonMenuItem.d.ts +0 -4
  346. package/widgets/FeatureTable/Grid/support/ButtonMenuItem.js +0 -5
  347. package/widgets/FeatureTable/Grid/support/ButtonMenuViewModel.d.ts +0 -4
  348. package/widgets/FeatureTable/Grid/support/ButtonMenuViewModel.js +0 -5
@@ -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 o}from"tslib";import t from"../../../core/Accessor.js";import e from"../../../core/Collection.js";import{watch as r,syncAndInitial as i}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 n}from"../../../core/accessorSupport/decorators/subclass.js";import{getInputGeometry as l}from"./elevationProfileGeometryUtils.js";import{ElevationProfileHoveredPointVisualization as a}from"./ElevationProfileHoveredPointVisualization.js";let p=class extends t{constructor(o){super(o),this._hoveredPoints=new e}initialize(){const{analysisViewData:o}=this,{analysis:t}=o;this.addHandles([r(()=>{const{hoveredPoints:e,visible:r,updating:i}=o;return r?i?null:e.map((o,e)=>{const r=t.profiles.at(e);return!0===r?.viewOptions.hoveredPointVisible&&null!=o?{hoveredPoint:o,color:r.color}:null}).filter(o=>!!o):[]},o=>this._update(o),i),r(()=>l(t.input),()=>this._update([]),i)])}destroy(){this._hoveredPoints.drain(o=>o.destroy())}get updating(){return!1}_update(o){if(!o)return;const{view:t,_hoveredPoints:e}=this,r=o.length;for(;e.length>r;)e.pop()?.destroy();for(;e.length<r;){const o=new a({view:t});e.push(o)}for(let i=0;i<r;++i){const t=o[i],s=e.at(r-1-i);s.position=t.hoveredPoint,s.color=t.color}}};o([s()],p.prototype,"view",void 0),o([s()],p.prototype,"analysisViewData",void 0),o([s()],p.prototype,"_hoveredPoints",void 0),o([s()],p.prototype,"updating",null),p=o([n("esri.views.analysis.ElevationProfile.ElevationProfileHoveredPointsVisualization")],p);export{p as ElevationProfileHoveredPointsVisualization};
5
+ import{__decorate as o}from"tslib";import t from"../../../core/Accessor.js";import e from"../../../core/Collection.js";import{watch as r,syncAndInitial as i}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 n}from"../../../core/accessorSupport/decorators/subclass.js";import{ElevationProfileHoveredPointVisualization as a}from"./ElevationProfileHoveredPointVisualization.js";let l=class extends t{constructor(o){super(o),this._hoveredPoints=new e}initialize(){const{analysisViewData:o}=this,{analysis:t}=o;this.addHandles([r(()=>{const{hoveredPoints:e,visible:r,updating:i}=o;return r?i?null:e.map((o,e)=>{const r=t.profiles.at(e);return!0===r?.viewOptions.hoveredPointVisible&&null!=o?{hoveredPoint:o,color:r.color}:null}).filter(o=>!!o):[]},o=>this._update(o),i),r(()=>t.geometry,()=>this._update([]),i)])}destroy(){this._hoveredPoints.drain(o=>o.destroy())}get updating(){return!1}_update(o){if(!o)return;const{view:t,_hoveredPoints:e}=this,r=o.length;for(;e.length>r;)e.pop()?.destroy();for(;e.length<r;){const o=new a({view:t});e.push(o)}for(let i=0;i<r;++i){const t=o[i],s=e.at(r-1-i);s.position=t.hoveredPoint,s.color=t.color}}};o([s()],l.prototype,"view",void 0),o([s()],l.prototype,"analysisViewData",void 0),o([s()],l.prototype,"_hoveredPoints",void 0),o([s()],l.prototype,"updating",null),l=o([n("esri.views.analysis.ElevationProfile.ElevationProfileHoveredPointsVisualization")],l);export{l as ElevationProfileHoveredPointsVisualization};
@@ -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 o}from"tslib";import t 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"./ElevationProfileResult.js";let p=class extends t{constructor(o){super(o),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(o){this.result.rawResult=o}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}};o([s({constructOnly:!0})],p.prototype,"controller",void 0),o([s({constructOnly:!0})],p.prototype,"profileLine",void 0),o([s({constructOnly:!0})],p.prototype,"onInvalidate",void 0),o([s()],p.prototype,"result",void 0),o([s({readOnly:!0})],p.prototype,"progress",null),o([s()],p.prototype,"hoveredPoint",null),o([s()],p.prototype,"available",null),o([s()],p.prototype,"numSamplesForPreview",void 0),o([s()],p.prototype,"numSamplesPerChunk",void 0),o([s({readOnly:!0})],p.prototype,"minDemResolution",null),p=o([i("esri.views.analysis.ElevationProfile.ElevationProfileLineComputation")],p);export{p as ElevationProfileLineComputation};
5
+ import{__decorate as o}from"tslib";import t 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"./ElevationProfileResult.js";let p=class extends t{constructor(o){super(o),this.result=new n({computation:this}),this.numSamplesForPreview=30,this.numSamplesPerChunk=200}initialize(){this.addHandles([e(()=>{const{geometry:o,elevationInfo:t}=this.controller.analysis;return[o,t]},()=>this.onInvalidate(this),r)])}setResult(o){this.result.rawResult=o}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}};o([s({constructOnly:!0})],p.prototype,"controller",void 0),o([s({constructOnly:!0})],p.prototype,"profile",void 0),o([s({constructOnly:!0})],p.prototype,"onInvalidate",void 0),o([s()],p.prototype,"result",void 0),o([s({readOnly:!0})],p.prototype,"progress",null),o([s()],p.prototype,"hoveredPoint",null),o([s()],p.prototype,"available",null),o([s()],p.prototype,"numSamplesForPreview",void 0),o([s()],p.prototype,"numSamplesPerChunk",void 0),o([s({readOnly:!0})],p.prototype,"minDemResolution",null),p=o([i("esri.views.analysis.ElevationProfile.ElevationProfileLineComputation")],p);export{p as ElevationProfileLineComputation};
@@ -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{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/GeometryDescriptor.js";import{getGraphicEffectiveElevationInfo as s}from"../../../support/elevationInfoUtils.js";import{getInputGraphic as a}from"./elevationProfileGeometryUtils.js";import{ElevationProfileLineComputation as l}from"./ElevationProfileLineComputation.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.sketchGraphic?.geometry}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"3d"!==this.controller.view.type?[]:this.controller.view?.map?.allLayers?.toArray().filter(e=>("graphics"!==e.type||!e.internal)&&e.visible)??[]}};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.ElevationProfileLineInputComputation")],p);export{p as ElevationProfileLineInputComputation};
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/GeometryDescriptor.js";import{ElevationProfileLineComputation as s}from"./ElevationProfileLineComputation.js";let a=class extends s{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)}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.controller.elevationInfo,this._visibleLayers,e,e.stationary,e.spatialReference)}get _visibleLayers(){return"3d"!==this.controller.view.type?[]:this.controller.view?.map?.allLayers?.toArray().filter(e=>("graphics"!==e.type||!e.internal)&&e.visible)??[]}};e([r()],a.prototype,"_queryElevationDependencies",null),e([r()],a.prototype,"_visibleLayers",null),a=e([i("esri.views.analysis.ElevationProfile.ElevationProfileLineInputComputation")],a);export{a as ElevationProfileLineInputComputation};
@@ -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{watch as o,sync as r}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{ElevationProfileLineComputation as s}from"./ElevationProfileLineComputation.js";import{getQuerySourceMinDemResolution as l}from"./elevationProfileQuerySourceUtils.js";let n=class extends s{constructor(){super(...arguments),this.type="query",this.numSamplesForPreview=50,this.numSamplesPerChunk=500}get minDemResolution(){return l(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(o(()=>this.profileLine.source,()=>this.onInvalidate(this),r))}queryElevation(e,o){if(!this.profileLine.source)throw new Error("No source configured for the elevation profile line");return this.profileLine.source.queryElevation(e,o)}};e([i({readOnly:!0})],n.prototype,"minDemResolution",null),e([i()],n.prototype,"available",null),n=e([t("esri.views.analysis.ElevationProfile.ElevationProfileLineQueryComputation")],n);export{n as ElevationProfileLineQueryComputation};
5
+ import{__decorate as e}from"tslib";import{watch as o,sync as r}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{ElevationProfileLineComputation as s}from"./ElevationProfileLineComputation.js";import{getQuerySourceMinDemResolution as l}from"./elevationProfileQuerySourceUtils.js";let n=class extends s{constructor(){super(...arguments),this.type="query",this.numSamplesForPreview=50,this.numSamplesPerChunk=500}get minDemResolution(){return l(this.profile.source)}get available(){const{source:e}=this.profile;return!!e&&(null==e.visible||e.visible)&&(null==e.layers||e.layers.some(e=>e.visible))}initialize(){this.addHandles(o(()=>this.profile.source,()=>this.onInvalidate(this),r))}queryElevation(e,o){if(!this.profile.source)throw new Error("No source configured for the elevation profile line");return this.profile.source.queryElevation(e,o)}};e([i({readOnly:!0})],n.prototype,"minDemResolution",null),e([i()],n.prototype,"available",null),n=e([t("esri.views.analysis.ElevationProfile.ElevationProfileLineQueryComputation")],n);export{n as ElevationProfileLineQueryComputation};
@@ -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"./elevationProfileGenerationUtils.js";import{convertSamples as n,convertStatistics as a}from"./elevationProfileUnitUtils.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(){if(!this.computation.profileLine.enabled)return null;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.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 l from"../../../geometry/Point.js";import{binaryFindClosest as i}from"./elevationProfileGenerationUtils.js";import{convertSamples as n,convertStatistics as a}from"./elevationProfileUnitUtils.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.profile.enabled&&t.available}get profile(){return this.computation.profile}get progress(){return null!=this.rawResult&&this.computation.profile.enabled?this.rawResult.progress:0}get samples(){return this._getSamplesMemoized(this.rawResult,this.computation.controller.effectiveDisplayUnits)}get statistics(){return this._getStatisticsMemoized(this.rawResult,this.computation.controller.effectiveDisplayUnits)}get hoveredPoint(){if(!this.computation.profile.enabled)return null;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=i(o,t*s,t=>t.distance);if(null==n)return null;const{x:a,y:p,z:u}=n;return null==u?null:new l({x:a,y:p,z:u,spatialReference:e.spatialReference})}};t([r()],p.prototype,"available",null),t([r({readOnly:!0})],p.prototype,"profile",null),t([r({readOnly:!0})],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.ElevationProfileResult")],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{__decorate as t}from"tslib";import e from"../../../Graphic.js";import i from"../../../core/Accessor.js";import{isSome as s}from"../../../core/arrayUtils.js";import{createTask as a}from"../../../core/asyncUtils.js";import"../../../core/has.js";import{makeHandle as r,handlesGroup as o}from"../../../core/handleUtils.js";import{ignoreAbortErrors as n,isAborted as p,createResolver as c,throwIfAborted as l,createAbortError as h,onAbort as d}from"../../../core/promiseUtils.js";import{watch as m,syncAndInitial as u}from"../../../core/reactiveUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as f}from"../../../core/support/UpdatingHandles.js";import k from"../../../layers/GraphicsLayer.js";import g from"../../../symbols/CIMSymbol.js";import w from"../../../symbols/SimpleLineSymbol.js";import{isPolylineGraphic as v,isPolyline as b,isValidInputGraphic as G}from"./elevationProfileGeometryUtils.js";import{ViewEventPriorities as S}from"../../input/InputManager.js";import{isCancelEvent as O}from"../../interactive/interactiveToolUtils.js";import I from"../../../widgets/Sketch/SketchViewModel.js";const j=Symbol("main"),V=Symbol("interactive-operation");let M=class extends i{constructor(t){super(t),this._updatingHandles=new f,this._activeOperationInfo=null}initialize(){const{view:t}=this;this._graphicsLayer=new k({listMode:"hide",internal:!0,elevationInfo:{mode:"absolute-height",offset:null}}),this._sketchViewModel=new I({layer:this._graphicsLayer,view:t,defaultCreateOptions:{mode:"click",hasZ:!0},updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{shapeOperation:"none"},enableRotation:!1,enableScaling:!1,enableMoveAllGraphics:!1,enableZ:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"reshape"},polylineSymbol:this._lineSymbol,activeLineSymbol:this._lineSymbol}),this.addHandles(m(()=>({map:t.map,internalGraphicsLayer:this._graphicsLayer,state:this.state}),({map:t,internalGraphicsLayer:e,state:i})=>{switch(D(t,e),i){case"idle":case"selected":case"reshaping-disabled":this._stopOperation(),this._ensureUpdatedSketchGraphic();break;case"reshaping":this._startReshape()}},u),j)}destroy(){this._sketchViewModel.destroy();const t=this._graphicsLayer;t&&this.view.map?.remove(t),t.destroy()}get sketchGraphic(){return this._get("sketchGraphic")}set sketchGraphic(t){t!==this._get("sketchGraphic")&&(this._set("sketchGraphic",t),U(this._graphicsLayer,t),this._updateInputFromSketchGraphic())}get state(){const{analysis:t,visible:e,interactive:i}=this.analysisViewData;if(!e)return"idle";switch(this._activeOperationInfo?.type){case"place":return this._sketchViewModel.createGraphic===this.sketchGraphic?"sketching":"awaiting-sketch";case"pick-graphic":return"picking";default:{const{input:e}=t;return e?v(e)?"selected":i?"reshaping":"reshaping-disabled":"idle"}}}get updating(){return this._sketchViewModel.updating||this._updatingHandles.updating}get _lineSymbol(){return L(this.view.type)}place(t){return this._startOperation("place",t,(e,i)=>{const s=this.analysisViewData.analysis.clone(),a=this._sketchViewModel.on("create",t=>{switch(t.state){case"complete":this._updateInputFromSketchGraphic(),this._stopOperation();break;case"cancel":this._stopOperation();break;case"active":this._updateInputFromSketchGraphic();break;case"start":this.sketchGraphic=t.graphic}});return this._ensureUpdatedSketchGraphic(),this._updatingHandles.addPromise(n(this._sketchViewModel.create("polyline"))),r(()=>(a.remove(),this._sketchViewModel.cancel(),this._updateInputFromSketchGraphic(),this.analysisViewData.analysis.valid?p(t)||s.equals(this.analysisViewData.analysis)?i():void e():(this._clearInput(),i())))})}async pickGraphic(t){return this._startOperation("pick-graphic",t,(t,e)=>{const{view:i}=this;i.closePopup();let s=null;const n=r=>{r.defer(async()=>{s?.abort(),s=a(async s=>{const{results:a}=await i.hitTest(r);l(s);const o=a.filter(t=>"graphic"===t.type).map(t=>t.graphic).find(G);o?(r.preventDefault(),r.stopPropagation(),this.sketchGraphic=null,this.analysisViewData.analysis.input=o,t(),this._stopOperation()):e()}),await s.promise})},p=t=>{O(t)&&(e(),this._stopOperation())};return i.focus(),o([i.on("immediate-click",n,S.TOOL),i.on("key-down",p,S.TOOL),i.acquireCursor("crosshair","high"),r(()=>{s?.abort(),e()})])})}_startReshape(){this._stopOperation();const t=this._sketchViewModel.on("update",t=>{this._updateInputFromSketchGraphic(),"complete"===t.state&&("reshaping"===this.state?this._startReshape():this._stopOperation())});this._replaceHandles(r(()=>{t.remove(),this._sketchViewModel.cancel()}),V);const e=this._ensureUpdatedSketchGraphic();e&&this._updatingHandles.addPromise(n(this._sketchViewModel.update(e,{tool:"reshape"})))}async _startOperation(t,e,i){const s=this._activeOperationInfo,a=c(),r={type:t,promise:a.promise};if(this._activeOperationInfo=r,s){const t=s.promise.catch(()=>{});this._stopOperation(),await t,l(e)}this.analysisViewData.interactive=!0;const o=i(()=>a.resolve({}),()=>a.reject(h()));this._replaceHandles([o,d(e,()=>this._stopOperation())],V);try{return await a.promise}finally{this._activeOperationInfo===r&&(this._activeOperationInfo=null)}}_stopOperation(){this.removeHandles(V)}_ensureUpdatedSketchGraphic(){const{input:t}=this.analysisViewData.analysis;return b(t)?(this.sketchGraphic??=new e({symbol:this._lineSymbol,geometry:t}),this.sketchGraphic.geometry=t,this.sketchGraphic):(this.sketchGraphic=null,null)}_clearInput(){this.sketchGraphic=null,this.analysisViewData.analysis.input=null}_updateInputFromSketchGraphic(){const t=this.sketchGraphic,{analysis:e}=this.analysisViewData;e.input=v(t)?t.geometry:null}_replaceHandles(t,e){this.removeHandles(e),this.addHandles((Array.isArray(t)?t:[t]).filter(s),e)}};function L(t){if("2d"===t){const t={type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",width:1.5};return new g({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{...t,effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,4],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],color:[0,0,0,255]},{...t,color:[255,255,255,255]}]}}})}return new w({color:[0,0,0,0]})}function D(t,e){e&&(e.removeFromParent(),t?.add(e))}function U({graphics:t},e){e?(t.includes(e)||t.add(e),1!==t.length&&t.removeMany(t.filter(t=>t!==e))):t.removeAll()}t([y({constructOnly:!0})],M.prototype,"analysisViewData",void 0),t([y({constructOnly:!0})],M.prototype,"view",void 0),t([y()],M.prototype,"sketchGraphic",null),t([y({nonNullable:!0})],M.prototype,"state",null),t([y()],M.prototype,"updating",null),t([y()],M.prototype,"_activeOperationInfo",void 0),t([y()],M.prototype,"_lineSymbol",null),M=t([_("esri.views.analysis.ElevationProfile.ElevationProfileTool")],M);export{M as ElevationProfileTool};
5
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import i from"../../../core/Accessor.js";import{isSome as s}from"../../../core/arrayUtils.js";import{createTask as a}from"../../../core/asyncUtils.js";import"../../../core/has.js";import{makeHandle as r,handlesGroup as o}from"../../../core/handleUtils.js";import{ignoreAbortErrors as n,isAborted as l,createResolver as c,throwIfAborted as p,createAbortError as h,onAbort as m}from"../../../core/promiseUtils.js";import{watch as d,syncAndInitial as y}from"../../../core/reactiveUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as f}from"../../../core/support/UpdatingHandles.js";import g from"../../../layers/GraphicsLayer.js";import{getGraphicEffectiveElevationInfo as k}from"../../../support/elevationInfoUtils.js";import v from"../../../symbols/CIMSymbol.js";import b from"../../../symbols/SimpleLineSymbol.js";import w from"../../../symbols/support/ElevationInfo.js";import{isPolyline as G,isValidInputGraphic as S}from"./elevationProfileGeometryUtils.js";import{ViewEventPriorities as O}from"../../input/InputManager.js";import{isCancelEvent as j}from"../../interactive/interactiveToolUtils.js";import M from"../../../widgets/Sketch/SketchViewModel.js";const V=Symbol("main"),I=Symbol("interactive-operation");let L=class extends i{constructor(e){super(e),this._updatingHandles=new f,this._activeOperationInfo=null}initialize(){const{view:e}=this;this._graphicsLayer=new g({listMode:"hide",internal:!0,elevationInfo:{mode:"absolute-height",offset:null}}),this._sketchViewModel=new M({layer:this._graphicsLayer,view:e,defaultCreateOptions:{mode:"click",hasZ:!0},updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{shapeOperation:"none"},enableRotation:!1,enableScaling:!1,enableMoveAllGraphics:!1,enableZ:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"reshape"},polylineSymbol:this._lineSymbol,activeLineSymbol:this._lineSymbol}),this.addHandles(d(()=>({map:e.map,internalGraphicsLayer:this._graphicsLayer,state:this.state,sketchGraphicVisible:this._analysis.viewOptions.geometryVisualizationVisible}),({map:e,internalGraphicsLayer:t,state:i,sketchGraphicVisible:s})=>{H(e,t);const a=this.sketchGraphic;switch(a&&(a.visible=!0),i){case"idle":case"reshaping-disabled":a&&!s&&(a.visible=!1),this._stopOperation(),this._ensureUpdatedSketchGraphic();break;case"reshaping":this._startReshape()}},y),V)}destroy(){this._sketchViewModel.destroy();const e=this._graphicsLayer;e&&this.view.map?.remove(e),e.destroy()}get sketchGraphic(){return this._get("sketchGraphic")}set sketchGraphic(e){e!==this._get("sketchGraphic")&&(this._set("sketchGraphic",e),A(this._graphicsLayer,e),this._updateAnalysisFromSketchGraphic())}get state(){const{visible:e,interactive:t}=this.analysisViewData;if(!e)return"idle";switch(this._activeOperationInfo?.type){case"place":return this._sketchViewModel.createGraphic===this.sketchGraphic?"sketching":"awaiting-sketch";case"pick-graphic":return"picking";default:return this._analysis.geometry?t?"reshaping":"reshaping-disabled":"idle"}}get updating(){return this._sketchViewModel.updating||this._updatingHandles.updating}get _analysis(){return this.analysisViewData.analysis}get _lineSymbol(){return U(this.view.type)}place(e){return this._startOperation("place",e,(t,i)=>{this.analysisViewData.interactive=!0;const s=this._analysis.clone(),a=this._sketchViewModel.on("create",e=>{switch(e.state){case"start":this.sketchGraphic=e.graphic;break;case"active":this._updateAnalysisFromSketchGraphic();break;case"complete":this._updateAnalysisFromSketchGraphic(),this._stopOperation();break;case"cancel":this._stopOperation()}});return this._ensureUpdatedSketchGraphic(),this._updatingHandles.addPromise(n(this._sketchViewModel.create("polyline"))),r(()=>(a.remove(),this._sketchViewModel.cancel(),this._updateAnalysisFromSketchGraphic(),this._analysis.valid?l(e)||s.equals(this._analysis)?i():void t({}):(this._clear(),i())))})}async pickGraphic(e){return this._startOperation("pick-graphic",e,(e,t)=>{const{view:i}=this;i.closePopup();let s=null;const n=r=>{r.defer(async()=>{s?.abort(),s=a(async s=>{const{results:a}=await i.hitTest(r);p(s);const o=a.filter(e=>"graphic"===e.type).map(e=>e.graphic).find(S);o?(r.preventDefault(),r.stopPropagation(),this.sketchGraphic=null,this._analysis.geometry=o.geometry,this._analysis.elevationInfo=new w({...k(o)}),e({graphic:o}),this._stopOperation()):t()}),await s.promise})},l=e=>{j(e)&&(t(),this._stopOperation())};return i.focus(),o([i.on("immediate-click",n,O.TOOL),i.on("key-down",l,O.TOOL),i.acquireCursor("crosshair","high"),r(()=>{s?.abort(),t()})])})}_startReshape(){this._stopOperation();const e=this._sketchViewModel.on("update",e=>{this._updateAnalysisFromSketchGraphic(),"complete"===e.state&&("reshaping"===this.state?this._startReshape():this._stopOperation())});this._replaceHandles(r(()=>{e.remove(),this._sketchViewModel.cancel()}),I);const t=this._ensureUpdatedSketchGraphic();t&&this._updatingHandles.addPromise(n(this._sketchViewModel.update(t,{tool:"reshape"})))}async _startOperation(e,t,i){const s=this._activeOperationInfo,a=c(),r={type:e,promise:a.promise};if(this._activeOperationInfo=r,s){const e=s.promise.catch(()=>{});this._stopOperation(),await e,p(t)}const o=i(e=>a.resolve(e),()=>a.reject(h()));this._replaceHandles([o,m(t,()=>this._stopOperation())],I);try{return await a.promise}finally{this._activeOperationInfo===r&&(this._activeOperationInfo=null)}}_stopOperation(){this.removeHandles(I)}_ensureUpdatedSketchGraphic(){const{geometry:e}=this._analysis;if(!e)return this.sketchGraphic=null,null;const i=this.sketchGraphic??=new t({symbol:this._lineSymbol,geometry:e});return i.geometry=e,i}_clear(){this.sketchGraphic=null,this._analysis.clear()}_updateAnalysisFromSketchGraphic(){let e=this.sketchGraphic?.geometry;G(e)||(e=null);const t=this._analysis;t.geometry!==e&&(t.geometry=e)}_replaceHandles(e,t){this.removeHandles(t),this.addHandles((Array.isArray(e)?e:[e]).filter(s),t)}};function U(e){if("2d"===e){const e={type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",width:1.5};return new v({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{...e,effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,4],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],color:[0,0,0,255]},{...e,color:[255,255,255,255]}]}}})}return new b({color:[0,0,0,0]})}function H(e,t){t&&(t.removeFromParent(),e?.add(t))}function A({graphics:e},t){t?(e.includes(t)||e.add(t),1!==e.length&&e.removeMany(e.filter(e=>e!==t))):e.removeAll()}e([u({constructOnly:!0})],L.prototype,"analysisViewData",void 0),e([u({constructOnly:!0})],L.prototype,"view",void 0),e([u()],L.prototype,"sketchGraphic",null),e([u({nonNullable:!0})],L.prototype,"state",null),e([u()],L.prototype,"updating",null),e([u()],L.prototype,"_activeOperationInfo",void 0),e([u()],L.prototype,"_analysis",null),e([u()],L.prototype,"_lineSymbol",null),L=e([_("esri.views.analysis.ElevationProfile.ElevationProfileTool")],L);export{L as ElevationProfileTool};
@@ -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{floatEqualUlp as e,lerp as t}from"../../../core/mathUtils.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as r}from"../../../core/unitUtils.js";import{distance as o,lerp as s}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{m as i}from"../../../chunks/vec32.js";import a from"../../../geometry/Polyline.js";import{initializeProjection as c,project as u}from"../../../geometry/projectionUtils.js";import l from"../../../geometry/SpatialReference.js";import{geodesicLengths as f,isSupported as p,inverseGeodeticSolver as h,directGeodeticSolver as m}from"../../../geometry/support/geodesicUtils.js";import{getElevationOffset as d}from"../../../support/elevationInfoUtils.js";import{ElevationProfileGenerationError as g}from"./ElevationProfileGenerationError.js";async function y(e,t,o,s,i,a,p){let h,m,d;const y=e.spatialReference,j=y.isGeographic||y.isWebMercator;let v=0;if(!j){const{execute:t}=await import("../../../geometry/operators/lengthOperator.js");n(p),v=t(e,{unit:"meters"}),n(p)}const P=1/r(s);if(j){await c([{source:y,dest:s},{source:y,dest:l.WGS84}],p);const n=C(e);h=f([n],"meters")[0];const r=w(h,i);if(H(e,h,r)>a)throw new g("too-complex");const j=R(n,t,o);({densifiedPath:m,distances:d}=k(j,r,P)),m=u(m,s)}else{await c([{source:y,dest:s}],p),h=v;const r=w(h,i);if(H(e,h,r)>a)throw new g("too-complex");const l=R(e,t,o);({densifiedPath:m,distances:d}=W(l,r,P)),n(p),m=u(m,s)}return{densifiedPath:m,pathLength:h*P,distances:d}}function w(e,t){const n=e/t.densificationMaxSamples;return Math.max(t.samplingDistance,n)}function R(e,t,n){if(null==t)return P(e);const r=e.spatialReference,o=t.mode,s=d(t,r);let i=null;switch(n.type){case"2d":i=j(e,o,s);break;case"3d":i=v(e,o,s,n)}return null==i?P(e):new a({hasZ:!0,hasM:!1,spatialReference:r,paths:Z(e.paths,i)})}function j({hasZ:e},t,n){return"absolute-height"===t?e?([e,t,r])=>[e,t,r+n]:([e,t])=>[e,t,n]:null}function v({spatialReference:e,hasZ:t},n,r,{elevationProvider:o}){const s=(t,n,r,s)=>o?.getElevation(t,n,r,e,s)??0;switch(n){case"on-the-ground":return([e,t])=>[e,t,s(e,t,0,"ground")];case"absolute-height":return t?([e,t,n])=>[e,t,n+r]:([e,t])=>[e,t,r];case"relative-to-ground":return t?([e,t,n])=>[e,t,n+s(e,t,n,"ground")+r]:([e,t])=>[e,t,s(e,t,0,"ground")+r];case"relative-to-scene":return t?([e,t,n])=>[e,t,n+s(e,t,n,"scene")+r]:([e,t])=>[e,t,s(e,t,0,"scene")+r];default:return null}}function P(e){return e.hasZ?new a({hasZ:!1,hasM:!1,spatialReference:e.spatialReference,paths:Z(e.paths,([e,t])=>[e,t])}):e}function Z(e,t){const n=e.length,r=new Array(n);for(let o=0;o<n;++o){const n=e[o],s=n.length,i=new Array(n.length);r[o]=i;for(let e=0;e<s;++e)i[e]=t(n[e])}return r}function x(e){return null!=e&&"polyline"===e.type&&e.paths.length>0&&e.paths.every(e=>e.length>=2)}function M(e){return S(e)&&x(e.geometry)}function S(e){return z(e)&&U(e?.geometry)}function U(e){return!z(e)&&null!=e&&"polyline"===e.type}function b(e){return z(e)?e:null}function A(e){return z(e)?e.geometry:e}function z(e){return null!=e&&"geometry"in e}function G(e){const t=e?.input;return!z(t)&&U(t)}function E(t,n,o,s,i){const{spatialReference:c,hasZ:u}=t,l={from:null,to:null,distance:0,azimuth:0,reverseAzimuth:0,spatialReference:c,metersPerSR:r(c)},f=[],p=[];let h=0;for(let r=0;r<t.paths.length;++r){const a=t.paths[r],c=new Array,u=new Array;let m=0;for(let t=1;t<a.length;++t){const r=a[t-1],f=a[t],p=s(l,r,f);let d;for(d=m;d<p.distance&&!e(d,p.distance);d+=n)c.push(i(p,d)),u.push((h+d)*o);m=d-p.distance,h+=p.distance,c.push(f),u.push(h*o)}f[r]=c,p[r]=u}return{densifiedPath:new a({spatialReference:c,hasZ:u,paths:f}),distances:p}}function W(e,t,n){const{hasZ:r}=e;return E(e,t,n,I,r?B:q)}function k(e,t,n){const{hasZ:r}=e;return E(e,t,n,D,r?O:L)}function D(e,t,n){return e.distance=0,h(e,t,n,e.spatialReference),e.from=t,e.to=n,e}function I(e,t,n){return e.from=t,e.to=n,e.distance=o(n,t)*e.metersPerSR,e}function L({from:e,azimuth:t,spatialReference:n},r){return m([0,0],e,t,r,n)}function O({from:e,to:n,azimuth:r,distance:o,spatialReference:s},i){const a=i/o,c=[0,0,t(e[2],n[2],a)];return m(c,e,r,i,s),c}function q({from:e,to:t,distance:n},r){return s([0,0],e,t,r/n)}function B({from:e,to:t,distance:n},r){return i([0,0,0],e,t,r/n)}function C(e){return p(e.spatialReference)?e:u(e,l.WGS84)}function F(e){return e.paths.reduce((e,t)=>e+t.length,0)}function H(e,t,n){return F(e)+Math.floor(t/n)+Math.max(0,e.paths.reduce(e=>1+e,0)-1)}export{F as countPoints,y as densifyPath,A as getInputGeometry,b as getInputGraphic,z as isGraphic,G as isInputSketched,U as isPolyline,S as isPolylineGraphic,M as isValidInputGraphic,x as isValidInputPath,R as toAbsoluteHeightElevation};
5
+ import{floatEqualUlp as e,lerp as t}from"../../../core/mathUtils.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as r}from"../../../core/unitUtils.js";import{distance as o,lerp as s}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{m as i}from"../../../chunks/vec32.js";import a from"../../../geometry/Polyline.js";import{initializeProjection as c,project as u}from"../../../geometry/projectionUtils.js";import l from"../../../geometry/SpatialReference.js";import{geodesicLengths as f,isSupported as p,inverseGeodeticSolver as h,directGeodeticSolver as m}from"../../../geometry/support/geodesicUtils.js";import{getElevationOffset as d}from"../../../support/elevationInfoUtils.js";import{ElevationProfileGenerationError as g}from"./ElevationProfileGenerationError.js";async function y(e,t,o,s,i,a,p){let h,m,d;const y=e.spatialReference,j=y.isGeographic||y.isWebMercator;let v=0;if(!j){const{execute:t}=await import("../../../geometry/operators/lengthOperator.js");n(p),v=t(e,{unit:"meters"}),n(p)}const P=1/r(s);if(j){await c([{source:y,dest:s},{source:y,dest:l.WGS84}],p);const n=O(e);h=f([n],"meters")[0];const r=w(h,i);if(B(e,h,r)>a)throw new g("too-complex");const j=R(n,t,o);({densifiedPath:m,distances:d}=G(j,r,P)),m=u(m,s)}else{await c([{source:y,dest:s}],p),h=v;const r=w(h,i);if(B(e,h,r)>a)throw new g("too-complex");const l=R(e,t,o);({densifiedPath:m,distances:d}=z(l,r,P)),n(p),m=u(m,s)}return{densifiedPath:m,pathLength:h*P,distances:d}}function w(e,t){const n=e/t.densificationMaxSamples;return Math.max(t.samplingDistance,n)}function R(e,t,n){if(null==t)return P(e);const r=e.spatialReference,o=t.mode,s=d(t,r);let i=null;switch(n.type){case"2d":i=j(e,o,s);break;case"3d":i=v(e,o,s,n)}return null==i?P(e):new a({hasZ:!0,hasM:!1,spatialReference:r,paths:Z(e.paths,i)})}function j({hasZ:e},t,n){return"absolute-height"===t?e?([e,t,r])=>[e,t,r+n]:([e,t])=>[e,t,n]:null}function v({spatialReference:e,hasZ:t},n,r,{elevationProvider:o}){const s=(t,n,r,s)=>o?.getElevation(t,n,r,e,s)??0;switch(n){case"on-the-ground":return([e,t])=>[e,t,s(e,t,0,"ground")];case"absolute-height":return t?([e,t,n])=>[e,t,n+r]:([e,t])=>[e,t,r];case"relative-to-ground":return t?([e,t,n])=>[e,t,n+s(e,t,n,"ground")+r]:([e,t])=>[e,t,s(e,t,0,"ground")+r];case"relative-to-scene":return t?([e,t,n])=>[e,t,n+s(e,t,n,"scene")+r]:([e,t])=>[e,t,s(e,t,0,"scene")+r];default:return null}}function P(e){return e.hasZ?new a({hasZ:!1,hasM:!1,spatialReference:e.spatialReference,paths:Z(e.paths,([e,t])=>[e,t])}):e}function Z(e,t){const n=e.length,r=new Array(n);for(let o=0;o<n;++o){const n=e[o],s=n.length,i=new Array(n.length);r[o]=i;for(let e=0;e<s;++e)i[e]=t(n[e])}return r}function x(e){return null!=e&&"polyline"===e.type&&e.paths.length>0&&e.paths.every(e=>e.length>=2)}function M(e){return S(e)&&x(e.geometry)}function S(e){return b(e)&&U(e?.geometry)}function U(e){return!b(e)&&null!=e&&"polyline"===e.type}function b(e){return null!=e&&"geometry"in e}function A(t,n,o,s,i){const{spatialReference:c,hasZ:u}=t,l={from:null,to:null,distance:0,azimuth:0,reverseAzimuth:0,spatialReference:c,metersPerSR:r(c)},f=[],p=[];let h=0;for(let r=0;r<t.paths.length;++r){const a=t.paths[r],c=new Array,u=new Array;let m=0;for(let t=1;t<a.length;++t){const r=a[t-1],f=a[t],p=s(l,r,f);let d;for(d=m;d<p.distance&&!e(d,p.distance);d+=n)c.push(i(p,d)),u.push((h+d)*o);m=d-p.distance,h+=p.distance,c.push(f),u.push(h*o)}f[r]=c,p[r]=u}return{densifiedPath:new a({spatialReference:c,hasZ:u,paths:f}),distances:p}}function z(e,t,n){const{hasZ:r}=e;return A(e,t,n,W,r?L:I)}function G(e,t,n){const{hasZ:r}=e;return A(e,t,n,E,r?D:k)}function E(e,t,n){return e.distance=0,h(e,t,n,e.spatialReference),e.from=t,e.to=n,e}function W(e,t,n){return e.from=t,e.to=n,e.distance=o(n,t)*e.metersPerSR,e}function k({from:e,azimuth:t,spatialReference:n},r){return m([0,0],e,t,r,n)}function D({from:e,to:n,azimuth:r,distance:o,spatialReference:s},i){const a=i/o,c=[0,0,t(e[2],n[2],a)];return m(c,e,r,i,s),c}function I({from:e,to:t,distance:n},r){return s([0,0],e,t,r/n)}function L({from:e,to:t,distance:n},r){return i([0,0,0],e,t,r/n)}function O(e){return p(e.spatialReference)?e:u(e,l.WGS84)}function q(e){return e.paths.reduce((e,t)=>e+t.length,0)}function B(e,t,n){return q(e)+Math.floor(t/n)+Math.max(0,e.paths.reduce(e=>1+e,0)-1)}export{q as countPoints,y as densifyPath,b as isGraphic,U as isPolyline,S as isPolylineGraphic,M as isValidInputGraphic,x as isValidInputPath,R as toAbsoluteHeightElevation};
@@ -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{handlesGroup as i}from"../../../core/handleUtils.js";import{watch as t,syncAndInitial as e}from"../../../core/reactiveUtils.js";import{isPolylineGraphic as r}from"./elevationProfileGeometryUtils.js";function n(n){return i([t(()=>{const{analysis:i,sketchGraphic:t,toolState:e,visible:a}=n.analysisViewData,{input:h,viewOptions:o}=i,{highlightEnabled:l}=o,s=r(h)?h:null,p=s?.layer;return{inputGraphic:s,inputGraphicLayer:p,sketchGraphic:t,toolState:e,visible:a,highlightEnabled:l}},({inputGraphic:i,inputGraphicLayer:t,sketchGraphic:e,toolState:r,visible:a,highlightEnabled:h})=>{if(n.onRemove(),!a)return;if(null!=e&&"reshaping"!==r&&"sketching"!==r)return n.onShowSketchedGraphic(e);return i&&!e&&h?n.onHighlight(i,t):void 0},e)])}export{n as connectVisualization};
5
+ import{handlesGroup as i}from"../../../core/handleUtils.js";import{watch as e,syncAndInitial as t}from"../../../core/reactiveUtils.js";function o(o){return i([e(()=>{const{analysis:i,sketchGraphic:e,toolState:t,visible:r}=o.analysisViewData,{geometryVisualizationVisible:s}=i.viewOptions;return{geometryVisualizationVisible:s,geometry:i.geometry,sketchGraphic:e,toolState:t,visible:r}},({geometryVisualizationVisible:i,sketchGraphic:e,toolState:t,visible:r})=>{if(o.onRemove(),r)return i&&null!=e&&"reshaping"!==t&&"sketching"!==t?o.onShowSketchedGraphic(e):void 0},t)])}export{o as connectVisualization};
@@ -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{isSome as t}from"../../core/arrayUtils.js";import{removeHandles as r}from"../../core/handleUtils.js";import{createResolver as s,onAbort as e,throwIfAborted as o,createAbortError as i}from"../../core/promiseUtils.js";class n{constructor(){this._currentOperation=null}destroy(){this.stop()}async start(n,a){const l=this._currentOperation;l?.stop();const p=new AbortController,c=a?.signal,h=AbortSignal.any([p.signal,c].filter(t)),m=s();let u=!1;const d=()=>{u||(u=!0,m.reject(i()))},y={resolve:()=>{u||(u=!0,m.resolve({}))},reject:d,promise:m.promise,stop:()=>p.abort(),handles:[]};this._currentOperation=y,y.handles.push(e(c,()=>{p.abort()}),e(h,()=>{r(y.handles),u||d()}));try{return l&&(await l.promise.catch(()=>{}),o(h)),await n(y,h),await m.promise}finally{r(y.handles),this._currentOperation===y&&(this._currentOperation=null)}}stop(){this._currentOperation?.stop()}}export{n as ExclusiveOperationManager};
@@ -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{cyclicalPI as e,cyclical2PI as t}from"../../../core/Cyclical.js";import{valueInUnit as s,createAngle as r}from"../../../core/quantityUtils.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{absoluteHeightElevationInfo as o}from"../../../support/elevationInfoUtils.js";import{fromAnyMapPoint as n,markAsTarget as a,fromVec3 as l}from"../sketch/normalizedPoint.js";import{SnappingAlgorithm as p}from"./SnappingAlgorithm.js";import{editEdgeToSnappingEdge as h,squaredScreenDistance as c}from"./snappingUtils.js";import{LineSnappingCandidate as d}from"./candidates/LineSnappingCandidate.js";import{vectorToScreenPoint as m}from"../support/viewUtils.js";import{radiansGeographicBetweenVec as g,pointFromDistanceAlongAzimuth as f}from"../../support/angularMeasurementUtils.js";import{projectPointToLineLike as u}from"../../support/geometry3dUtils.js";class x extends p{constructor(e,t,s){super(e,t),this._geodesicLengthMeasurementUtils=s}snapNewVertex(e,t){const s=t.editGeometryOperations.data.parts[0],r=s.segments.length,i=[];if(r<1)return i;const{spatialReference:n}=t,a=m(e,n,o,this.view),{view:l}=this,p=s.segments[r-1];let c=p;do{if(this.edgeExceedsShortLineThreshold(c,t)){const s=h(c,l,t);this._processCandidateProposal(s.left,s.right,e,a,t,i)}c=c.leftVertex.leftSegment}while(c&&c!==p);return i}snapExistingVertex(e,t){const s=[],r=t.vertexHandle,i=r.part;if(i.segments.length<2)return s;const{view:a}=this,{spatialReference:l}=t,p=m(e,l,o,a),c=r.leftSegment,d=r.rightSegment;c&&d&&this.edgeExceedsShortLineThreshold(c,t)&&this.edgeExceedsShortLineThreshold(d,t)&&this._processCandidateProposal(n(c.leftVertex.pos,a,t),n(d.rightVertex.pos,a,t),e,p,t,s);const g=i.segments[0];let f=g;do{if(f!==r.leftSegment&&f!==r.rightSegment&&this.edgeExceedsShortLineThreshold(f,t)){const r=h(f,a,t);this._processCandidateProposal(r.left,r.right,e,p,t,s)}f=f.rightVertex.rightSegment}while(f&&f!==g);return s}_processCandidateProposal(e,t,s,r,n,p){const{spatialReference:h,pointer:g}=n,f=i();S(f,e,t,s,n,this._geodesicLengthMeasurementUtils);const u=a(l(f));c(r,m(u,h,o,this.view))<this.squaredProximityThreshold(g)&&p.push(new d({lineStart:e,lineEnd:t,targetPoint:u,isDraped:"on-the-ground"===n.elevationInfo?.mode}))}}function S(e,t,s,r,i,o){j(e,t,s,r,i,o)||v(e,r,t,s)}function j(i,o,n,a,{spatialReference:l},p){const h=g(o,n,l,l);if(null==h)return!1;const c=g(n,a,l,l);if(null==c)return!1;const d=p.geodesicDistance(n,a,l);if(null==d)return!1;const m=Math.abs(e.shortestSignedDiff(h,c))>Math.PI/2?t.normalize(h+Math.PI):h;return f(i,n,l,s(d,"meters"),r(m,"radians","geographic"),"geodesic"),i[2]=a[2],!0}function v(e,t,s,r){u(t,{start:s,end:r,type:1},e),e[2]=t[2]}export{x as LineSnapper};
5
+ import{cyclicalPI as e,cyclical2PI as t}from"../../../core/Cyclical.js";import{valueInUnit as s,createAngle as r}from"../../../core/quantityUtils.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{absoluteHeightElevationInfo as o}from"../../../support/elevationInfoUtils.js";import{fromAnyMapPoint as n,markAsTarget as a,fromVec3 as l}from"../sketch/normalizedPoint.js";import{SnappingAlgorithm as p}from"./SnappingAlgorithm.js";import{isLine as h,editEdgeToSnappingEdge as c,squaredScreenDistance as d}from"./snappingUtils.js";import{LineSnappingCandidate as m}from"./candidates/LineSnappingCandidate.js";import{vectorToScreenPoint as g}from"../support/viewUtils.js";import{radiansGeographicBetweenVec as f,pointFromDistanceAlongAzimuth as u}from"../../support/angularMeasurementUtils.js";import{projectPointToLineLike as x}from"../../support/geometry3dUtils.js";class S extends p{constructor(e,t,s){super(e,t),this._geodesicLengthMeasurementUtils=s}snapNewVertex(e,t){const s=t.editGeometryOperations.data.parts[0],r=s.segments.length,i=[];if(r<1)return i;const{spatialReference:n}=t,a=g(e,n,o,this.view),{view:l}=this,p=s.segments[r-1];let d=p;do{if(h(d)&&this.edgeExceedsShortLineThreshold(d,t)){const s=c(d,l,t);this._processCandidateProposal(s.left,s.right,e,a,t,i)}d=d.leftVertex.leftSegment}while(d&&d!==p);return i}snapExistingVertex(e,t){const s=[],r=t.vertexHandle,i=r.part;if(i.segments.length<2)return s;const{view:a}=this,{spatialReference:l}=t,p=g(e,l,o,a),d=r.leftSegment,m=r.rightSegment;h(d)&&h(m)&&this.edgeExceedsShortLineThreshold(d,t)&&this.edgeExceedsShortLineThreshold(m,t)&&this._processCandidateProposal(n(d.leftVertex.pos,a,t),n(m.rightVertex.pos,a,t),e,p,t,s);const f=i.segments[0];let u=f;do{if(h(u)&&u!==r.leftSegment&&u!==r.rightSegment&&this.edgeExceedsShortLineThreshold(u,t)){const r=c(u,a,t);this._processCandidateProposal(r.left,r.right,e,p,t,s)}u=u.rightVertex.rightSegment}while(u&&u!==f);return s}_processCandidateProposal(e,t,s,r,n,p){const{spatialReference:h,pointer:c}=n,f=i();j(f,e,t,s,n,this._geodesicLengthMeasurementUtils);const u=a(l(f));d(r,g(u,h,o,this.view))<this.squaredProximityThreshold(c)&&p.push(new m({lineStart:e,lineEnd:t,targetPoint:u,isDraped:"on-the-ground"===n.elevationInfo?.mode}))}}function j(e,t,s,r,i,o){v(e,t,s,r,i,o)||w(e,r,t,s)}function v(i,o,n,a,{spatialReference:l},p){const h=f(o,n,l,l);if(null==h)return!1;const c=f(n,a,l,l);if(null==c)return!1;const d=p.geodesicDistance(n,a,l);if(null==d)return!1;const m=Math.abs(e.shortestSignedDiff(h,c))>Math.PI/2?t.normalize(h+Math.PI):h;return u(i,n,l,s(d,"meters"),r(m,"radians","geographic"),"geodesic"),i[2]=a[2],!0}function w(e,t,s,r){x(t,{start:s,end:r,type:1},e),e[2]=t[2]}export{S as LineSnapper};
@@ -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{squaredDistance as e}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{absoluteHeightElevationInfo as r}from"../../../support/elevationInfoUtils.js";import{fromAnyMapPoint as i,asVec2 as s,markAsTarget as n,fromValues as o}from"../sketch/normalizedPoint.js";import{defaults as l}from"./Settings.js";import{SnappingAlgorithm as a}from"./SnappingAlgorithm.js";import{editEdgeToSnappingEdge as c,squaredScreenDistance as h}from"./snappingUtils.js";import{ParallelLineSnappingCandidate as p}from"./candidates/ParallelLineSnappingCandidate.js";import{vectorToScreenPoint as g}from"../support/viewUtils.js";import{projectPointToLine as f}from"../../support/geometry2dUtils.js";class m extends a{snapNewVertex(e,t){const s=t.editGeometryOperations.data.parts[0],n=s.segments.length,o=s.vertices.length,l=[];if(n<2)return l;const{view:a}=this,h=g(e,t.spatialReference,r,a),p=i(s.vertices[o-1].pos,a,t),f=i(s.vertices[0].pos,a,t),m=s.segments[n-1];let d=m;do{if(this.edgeExceedsShortLineThreshold(d,t)){const r=c(d,a,t);this._checkEdgeForParallelLines(r,p,e,h,t,l),this._checkEdgeForParallelLines(r,f,e,h,t,l)}d=d.leftVertex.leftSegment}while(d&&d!==m);return l}snapExistingVertex(e,t){const s=[],n=t.vertexHandle,o=n.part;if(o.segments.length<3)return s;const{view:l}=this,a=g(e,t.spatialReference,r,l),h=n.leftSegment,p=n.rightSegment,f=o.vertices[0],m=i(f.pos,l,t),d=o.vertices.length,u=o.vertices[d-1],v=i(u.pos,l,t),x=o.segments[0];let L=x;do{if(L!==h&&L!==p&&this.edgeExceedsShortLineThreshold(L,t)){const r=c(L,l,t);h&&this._checkEdgeForParallelLines(r,i(h.leftVertex.pos,l,t),e,a,t,s),p&&this._checkEdgeForParallelLines(r,i(p.rightVertex.pos,l,t),e,a,t,s),n===f?this._checkEdgeForParallelLines(r,v,e,a,t,s):n===u&&this._checkEdgeForParallelLines(r,m,e,a,t,s)}L=L.rightVertex.rightSegment}while(L&&L!==x);return s}_checkEdgeForParallelLines(t,i,a,c,m,v){const x=t.left,L=t.right;if(f(u,s(i),s(x),s(L)),e(u,s(i))<l.parallelLineThreshold)return;f(u,s(a),s(x),s(L),s(i));const{spatialReference:P,pointer:j}=m,E=n(o(u[0],u[1],a[2]));if(h(c,g(E,P,r,this.view))<this.squaredProximityThreshold(j)){if(this.isVertical(E,i,m)||this.isVertical(x,L,m))return;if(d(t,v))return;v.push(new p({referenceLine:t,lineStart:i,targetPoint:E,isDraped:"on-the-ground"===m.elevationInfo?.mode}))}}}function d(t,r){const i=t.left,n=t.right;for(const o of r)if(f(u,s(n),s(o.constraint.start),s(o.constraint.end),s(i)),e(u,s(n))<l.parallelLineThreshold)return o.addReferenceLine(t),!0;return!1}const u=t();export{m as ParallelLineSnapper};
5
+ import{squaredDistance as e}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{absoluteHeightElevationInfo as r}from"../../../support/elevationInfoUtils.js";import{fromAnyMapPoint as i,asVec2 as s,markAsTarget as n,fromValues as o}from"../sketch/normalizedPoint.js";import{defaults as l}from"./Settings.js";import{SnappingAlgorithm as a}from"./SnappingAlgorithm.js";import{isLine as c,editEdgeToSnappingEdge as h,squaredScreenDistance as p}from"./snappingUtils.js";import{ParallelLineSnappingCandidate as g}from"./candidates/ParallelLineSnappingCandidate.js";import{vectorToScreenPoint as m}from"../support/viewUtils.js";import{projectPointToLine as f}from"../../support/geometry2dUtils.js";class d extends a{snapNewVertex(e,t){const s=t.editGeometryOperations.data.parts[0],n=s.segments.length,o=s.vertices.length,l=[];if(n<2)return l;const{view:a}=this,p=m(e,t.spatialReference,r,a),g=s.vertices[0],f=s.vertices[o-1],d=c(f.leftSegment)?i(f.pos,a,t):null,u=c(g.rightSegment)?i(g.pos,a,t):null,v=s.segments[n-1];let x=v;do{if(c(x)&&this.edgeExceedsShortLineThreshold(x,t)){const r=h(x,a,t);d&&this._checkEdgeForParallelLines(r,d,e,p,t,l),u&&this._checkEdgeForParallelLines(r,u,e,p,t,l)}x=x.leftVertex.leftSegment}while(x&&x!==v);return l}snapExistingVertex(e,t){const s=[],n=t.vertexHandle,o=n.part;if(o.segments.length<3)return s;const{view:l}=this,a=m(e,t.spatialReference,r,l),p=n.leftSegment,g=n.rightSegment,f=o.vertices[0],d=i(f.pos,l,t),u=o.vertices.length,v=o.vertices[u-1],x=i(v.pos,l,t),L=o.segments[0];let S=L;do{if(c(S)&&S!==p&&S!==g&&this.edgeExceedsShortLineThreshold(S,t)){const r=h(S,l,t);c(p)&&this._checkEdgeForParallelLines(r,i(p.leftVertex.pos,l,t),e,a,t,s),c(g)&&this._checkEdgeForParallelLines(r,i(g.rightVertex.pos,l,t),e,a,t,s),n===f?this._checkEdgeForParallelLines(r,x,e,a,t,s):n===v&&this._checkEdgeForParallelLines(r,d,e,a,t,s)}S=S.rightVertex.rightSegment}while(S&&S!==L);return s}_checkEdgeForParallelLines(t,i,a,c,h,d){const x=t.left,L=t.right;if(f(v,s(i),s(x),s(L)),e(v,s(i))<l.parallelLineThreshold)return;f(v,s(a),s(x),s(L),s(i));const{spatialReference:S,pointer:P}=h,j=n(o(v[0],v[1],a[2]));if(p(c,m(j,S,r,this.view))<this.squaredProximityThreshold(P)){if(this.isVertical(j,i,h)||this.isVertical(x,L,h))return;if(u(t,d))return;d.push(new g({referenceLine:t,lineStart:i,targetPoint:j,isDraped:"on-the-ground"===h.elevationInfo?.mode}))}}}function u(t,r){const i=t.left,n=t.right;for(const o of r)if(f(v,s(n),s(o.constraint.start),s(o.constraint.end),s(i)),e(v,s(n))<l.parallelLineThreshold)return o.addReferenceLine(t),!0;return!1}const v=t();export{d as ParallelLineSnapper};
@@ -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{cyclical2PI as e}from"../../../core/Cyclical.js";import{createAngle as t,valueInUnit as r}from"../../../core/quantityUtils.js";import{subtract as i,dot as n,squaredLength as s,scaleAndAdd as o}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{b as c,d as p,i as g}from"../../../chunks/vec32.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{absoluteHeightElevationInfo as l}from"../../../support/elevationInfoUtils.js";import{VerticalHalfPlaneConstraint as m}from"../sketch/constraints.js";import{fromAnyMapPoint as f,asVec2 as d,markAsTarget as u,fromValues as x,fromVec3 as S}from"../sketch/normalizedPoint.js";import{SnappingAlgorithm as v}from"./SnappingAlgorithm.js";import{squaredScreenDistance as V}from"./snappingUtils.js";import{RightAngleSnappingCandidate as j}from"./candidates/RightAngleSnappingCandidate.js";import{vectorToScreenPoint as k}from"../support/viewUtils.js";import{radiansGeographicBetweenVec as C,pointFromDistanceAlongAzimuth as _}from"../../support/angularMeasurementUtils.js";class w extends v{constructor(e,t,r){super(e,t),this._geodesicLengthMeasurementUtils=r}snapNewVertex(e,t){const r=t.editGeometryOperations.data.parts[0],i=[];if(r.vertices.length<2)return i;const{view:n}=this,s=k(e,t.spatialReference,l,n),o=r.vertices.at(-1);this._checkForSnappingCandidate(1,i,o.leftSegment,o,o.leftSegment.leftVertex,e,s,t);const a=r.vertices[0];return this._checkForSnappingCandidate(2,i,a.rightSegment,a,a.rightSegment.rightVertex,e,s,t),i}snapExistingVertex(e,t){const r=[],i=t.vertexHandle;if(i.part.vertices.length<3)return r;const{view:n}=this,s=k(e,t.spatialReference,l,n),o=i.leftSegment,a=i.rightSegment;if(o?.leftVertex.leftSegment){const i=o.leftVertex.leftSegment;this._checkForSnappingCandidate(3,r,i,i.rightVertex,i.leftVertex,e,s,t)}if(a?.rightVertex.rightSegment){const i=a.rightVertex.rightSegment;this._checkForSnappingCandidate(3,r,i,i.leftVertex,i.rightVertex,e,s,t)}return r}_checkForSnappingCandidate(e,t,r,i,n,s,o,a){if(!this.edgeExceedsShortLineThreshold(r,a))return;const c=this.view,p=f(i.pos,c,a),g=f(n.pos,c,a);y(M,g,p,s,a,this._geodesicLengthMeasurementUtils),this._checkForSnappingCandidateAlongProjectedRay(e,t,g,p,M,s,o,a)}_checkForSnappingCandidateAlongProjectedRay(e,t,r,a,p,g,f,v){const{spatialReference:C,pointer:_}=v,w=i(U,d(g),d(a)),y=n(p,w)/s(p),F=o(U,d(a),p,y),R=u(x(F[0],F[1],g[2]));if(V(f,k(R,C,l,this.view))>this.squaredProximityThreshold(_)||this.isVertical(R,a,v)||this.isVertical(a,r,v))return;const M=c(h(),a,p,Math.sign(y));t.push(new j({targetPoint:R,constraint:new m(a,S(M)),previousVertex:r,otherVertex:a,otherVertexType:1,selfSnappingType:e,isDraped:"on-the-ground"===v.elevationInfo?.mode}))}}function y(e,t,r,i,n,s){F(e,t,r,i,n,s)||R(e,t,r)}function F(i,n,s,o,{spatialReference:a},c){const g=C(n,s,a,a);if(null==g)return!1;const l=C(s,o,a,a);if(null==l)return!1;const m=Math.sign(e.shortestSignedDiff(g,l))*Math.PI*.5,f=t(g+m,"radians","geographic"),d=h(),u=c.geodesicDistance(s,o,a);return null!=u&&(_(d,s,a,r(u,"meters"),f,"geodesic"),p(i,d,s),!0)}function R(e,t,r){const n=i(U,d(r),d(t));g(e,n[1],-n[0],0)}const U=a(),M=h();export{w as RightAngleSnapper};
5
+ import{cyclical2PI as e}from"../../../core/Cyclical.js";import{createAngle as t,valueInUnit as r}from"../../../core/quantityUtils.js";import{subtract as i,dot as n,squaredLength as s,scaleAndAdd as o}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{b as c,d as p,i as g}from"../../../chunks/vec32.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{absoluteHeightElevationInfo as l}from"../../../support/elevationInfoUtils.js";import{VerticalHalfPlaneConstraint as m}from"../sketch/constraints.js";import{fromAnyMapPoint as f,asVec2 as d,markAsTarget as u,fromValues as x,fromVec3 as S}from"../sketch/normalizedPoint.js";import{SnappingAlgorithm as v}from"./SnappingAlgorithm.js";import{isLine as V,squaredScreenDistance as j}from"./snappingUtils.js";import{RightAngleSnappingCandidate as k}from"./candidates/RightAngleSnappingCandidate.js";import{vectorToScreenPoint as C}from"../support/viewUtils.js";import{radiansGeographicBetweenVec as _,pointFromDistanceAlongAzimuth as w}from"../../support/angularMeasurementUtils.js";class y extends v{constructor(e,t,r){super(e,t),this._geodesicLengthMeasurementUtils=r}snapNewVertex(e,t){const r=t.editGeometryOperations.data.parts[0],i=[];if(r.vertices.length<2)return i;const{view:n}=this,s=C(e,t.spatialReference,l,n),o=r.vertices.at(-1);V(o.leftSegment)&&this._checkForSnappingCandidate(1,i,o.leftSegment,o,o.leftSegment.leftVertex,e,s,t);const a=r.vertices[0];return V(a.rightSegment)&&this._checkForSnappingCandidate(2,i,a.rightSegment,a,a.rightSegment.rightVertex,e,s,t),i}snapExistingVertex(e,t){const r=[],i=t.vertexHandle;if(i.part.vertices.length<3)return r;const{view:n}=this,s=C(e,t.spatialReference,l,n),o=i.leftSegment,a=i.rightSegment;if(V(o?.leftVertex.leftSegment)){const i=o.leftVertex.leftSegment;this._checkForSnappingCandidate(3,r,i,i.rightVertex,i.leftVertex,e,s,t)}if(V(a)&&V(a.rightVertex.rightSegment)){const i=a.rightVertex.rightSegment;this._checkForSnappingCandidate(3,r,i,i.leftVertex,i.rightVertex,e,s,t)}return r}_checkForSnappingCandidate(e,t,r,i,n,s,o,a){if(!V(r)||!this.edgeExceedsShortLineThreshold(r,a))return;const c=this.view,p=f(i.pos,c,a),g=f(n.pos,c,a);F(P,g,p,s,a,this._geodesicLengthMeasurementUtils),this._checkForSnappingCandidateAlongProjectedRay(e,t,g,p,P,s,o,a)}_checkForSnappingCandidateAlongProjectedRay(e,t,r,a,p,g,f,v){const{spatialReference:V,pointer:_}=v,w=i(M,d(g),d(a)),y=n(p,w)/s(p),F=o(M,d(a),p,y),R=u(x(F[0],F[1],g[2]));if(j(f,C(R,V,l,this.view))>this.squaredProximityThreshold(_)||this.isVertical(R,a,v)||this.isVertical(a,r,v))return;const U=c(h(),a,p,Math.sign(y));t.push(new k({targetPoint:R,constraint:new m(a,S(U)),previousVertex:r,otherVertex:a,otherVertexType:1,selfSnappingType:e,isDraped:"on-the-ground"===v.elevationInfo?.mode}))}}function F(e,t,r,i,n,s){R(e,t,r,i,n,s)||U(e,t,r)}function R(i,n,s,o,{spatialReference:a},c){const g=_(n,s,a,a);if(null==g)return!1;const l=_(s,o,a,a);if(null==l)return!1;const m=Math.sign(e.shortestSignedDiff(g,l))*Math.PI*.5,f=t(g+m,"radians","geographic"),d=h(),u=c.geodesicDistance(s,o,a);return null!=u&&(w(d,s,a,r(u,"meters"),f,"geodesic"),p(i,d,s),!0)}function U(e,t,r){const n=i(M,d(r),d(t));g(e,n[1],-n[0],0)}const M=a(),P=h();export{y as RightAngleSnapper};
@@ -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{lerp as e,distance as t}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{absoluteHeightElevationInfo as r}from"../../../support/elevationInfoUtils.js";import{fromAnyMapPoint as s,asVec2 as o,markAsTarget as n,fromValues as p}from"../sketch/normalizedPoint.js";import{SnappingAlgorithm as a}from"./SnappingAlgorithm.js";import{squaredScreenDistance as l}from"./snappingUtils.js";import{RightAngleTriangleSnappingCandidate as m}from"./candidates/RightAngleTriangleSnappingCandidate.js";import{vectorToScreenPoint as d}from"../support/viewUtils.js";import{projectPointToCircle as h}from"../../support/geometry2dUtils.js";class c extends a{snapNewVertex(e,t){const i=t.editGeometryOperations.data.parts[0],r=[],o=i.vertices.length;if("polygon"!==t.editGeometryOperations.data.type||o<2)return r;const{view:n}=this,p=i.vertices[0],a=i.vertices[o-1],l=s(p.pos,n,t),m=s(a.pos,n,t);return this._processCandidateProposal(l,m,e,t,r),r}snapExistingVertex(e,t){const i=[],r=t.vertexHandle,o=r.part;if(o.segments.length<2)return i;if("polyline"===t.editGeometryOperations.data.type&&(0===r.index||r.index===o.vertices.length-1))return i;const{view:n}=this,p=s(r.leftSegment.leftVertex.pos,n,t),a=s(r.rightSegment.rightVertex.pos,n,t);return this._processCandidateProposal(p,a,e,t,i),i}_processCandidateProposal(i,s,a,c,g){if(!this.exceedsShortLineThreshold(i,s,c))return;const v=e(f,o(i),o(s),.5),x=.5*t(o(i),o(s)),u=h(f,o(a),v,x),j=n(p(u[0],u[1],a[2])),{spatialReference:y,pointer:w}=c,P=d(a,y,r,this.view);if(l(P,d(j,y,r,this.view))<this.squaredProximityThreshold(w)){if(this.isVertical(i,j,c)||this.isVertical(j,s,c))return;g.push(new m({targetPoint:j,point1:i,point2:s,isDraped:"on-the-ground"===c.elevationInfo?.mode}))}}}const f=i();export{c as RightAngleTriangleSnapper};
5
+ import{lerp as e,distance as t}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{absoluteHeightElevationInfo as r}from"../../../support/elevationInfoUtils.js";import{fromAnyMapPoint as s,asVec2 as o,markAsTarget as n,fromValues as p}from"../sketch/normalizedPoint.js";import{SnappingAlgorithm as a}from"./SnappingAlgorithm.js";import{squaredScreenDistance as l}from"./snappingUtils.js";import{RightAngleTriangleSnappingCandidate as m}from"./candidates/RightAngleTriangleSnappingCandidate.js";import{vectorToScreenPoint as g}from"../support/viewUtils.js";import{projectPointToCircle as d}from"../../support/geometry2dUtils.js";class h extends a{snapNewVertex(e,t){const i=t.editGeometryOperations.data.parts[0],r=[],o=i.vertices.length;if("polygon"!==t.editGeometryOperations.data.type||o<2)return r;const{view:n}=this,p=i.vertices[0],a=i.vertices[o-1];if(a.leftSegment&&"line"!==a.leftSegment.type||a.rightSegment&&"line"!==a.rightSegment.type)return r;const l=s(p.pos,n,t),m=s(a.pos,n,t);return this._processCandidateProposal(l,m,e,t,r),r}snapExistingVertex(e,t){const i=[],r=t.vertexHandle,o=r.part;if(o.segments.length<2)return i;if("polyline"===t.editGeometryOperations.data.type&&(0===r.index||r.index===o.vertices.length-1))return i;if("line"!==r.leftSegment?.type||"line"!==r.rightSegment?.type)return i;const{view:n}=this,p=s(r.leftSegment.leftVertex.pos,n,t),a=s(r.rightSegment.rightVertex.pos,n,t);return this._processCandidateProposal(p,a,e,t,i),i}_processCandidateProposal(i,s,a,h,c){if(!this.exceedsShortLineThreshold(i,s,h))return;const u=e(f,o(i),o(s),.5),v=.5*t(o(i),o(s)),x=d(f,o(a),u,v),y=n(p(x[0],x[1],a[2])),{spatialReference:S,pointer:j}=h,w=g(a,S,r,this.view);if(l(w,g(y,S,r,this.view))<this.squaredProximityThreshold(j)){if(this.isVertical(i,y,h)||this.isVertical(y,s,h))return;c.push(new m({targetPoint:y,point1:i,point2:s,isDraped:"on-the-ground"===h.elevationInfo?.mode}))}}}const f=i();export{h as RightAngleTriangleSnapper};
@@ -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 t from"../../../../core/Accessor.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{destroyHandle as i}from"../../../../core/handleUtils.js";import{memoize as s}from"../../../../core/memoize.js";import{throwIfAborted as o,ignoreAbortErrors as a}from"../../../../core/promiseUtils.js";import{watch as n,on as l,initial as d,sync as u,syncAndInitial as p}from"../../../../core/reactiveUtils.js";import{sqlAnd as h}from"../../../../core/sql.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as y}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as m}from"../../../../layers/support/layerUtils.js";import{elevationContextAffectsAlignment as _}from"../../../../support/elevationInfoUtils.js";import{FeatureServiceTiles2D as g}from"../../../2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js";import{FeatureServiceTiles3D as w}from"../../../3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js";import{isUtilityNetworkWebMap as S}from"../snappingUtils.js";import{makeGetGroundElevation as v,convertSnappingCandidate as b}from"./queryEngineUtils.js";import{WorkerTileTreeDebugger as I}from"./WorkerTileTreeDebugger.js";import{FeatureServiceSnappingSourceWorkerHandle as H}from"./featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js";import{FeatureServiceTilesSimple as F}from"./featureServiceSource/FeatureServiceTilesSimple.js";import j from"../../../support/debugFlags.js";let O=class extends t{get _updateTilesParameters(){return{tiles:this._tilesOfInterest.tiles,tileInfo:this._tilesOfInterest.tileInfo,tileSize:this._tilesOfInterest.tileSize}}get _layerView(){return this.view?.allLayerViews.find(e=>e.layer===this._layer)}get _isSuspended(){if(m(this._layer)){if(!this.layerSource.sublayerSources.some(e=>e.enabled&&e.layer.visible))return!0}return!!this.view&&(!1!==this._layerView?.suspended||!this.layerSource.enabled)}get updating(){return this._workerHandle?.updating||this._updatingHandles.updating}get _outFields(){const{view:e,_layerView:t,layerSource:r}=this,{layer:i}=r,{fieldsIndex:s,timeInfo:o,floorInfo:a,subtypeField:n}=i,l=t&&"filter"in t?t.filter:null,d=l?.where&&"1=1"!==l.where?this._getOrLoadWhereFields(l.where,s):[];if(l?.timeExtent&&o){const{startField:e,endField:t}=o,r=s.get(e)?.name??e,i=s.get(t)?.name??t;r&&d.push(r),i&&d.push(i)}if(e?.map&&S(e.map)&&e.map.utilityNetworks?.find(e=>e.isUtilityLayer(i))){const e=i.fieldsIndex.get("assetGroup")?.name,t=i.fieldsIndex.get("assetType")?.name;e&&t&&(d.push(e),d.push(t))}if(i&&a?.floorField&&e?.floors?.length){const e=s.get(a.floorField)?.name??a.floorField;e&&d.push(e)}if(n){const e=s.get(n)?.name??n;e&&d.push(e)}return new Set(d)}get configuration(){const{view:e}=this,{apiKey:t,customParameters:r}=this._layer,i=null!=e?e.type:"2d",s=this._layer.createQuery();return this._layerView&&"effectiveDisplayFilter"in this._layerView&&(s.where=h(s.where,this._layerView.effectiveDisplayFilter?.where)),{filter:s,customParameters:t?{...r,token:t}:r,viewType:i}}get availability(){return this._workerHandle?.availability??0}get _layer(){return this.layerSource.layer}constructor(e){super(e),this._updatingHandles=new f,this._workerHandle=null,this._debug=null,this._memoizedMakeGetGroundElevation=s(v)}initialize(){let e;const t=this.view;if(null==t||t.destroyed)this._tilesOfInterest=new F({layer:this._layer}),e=this._workerHandle=new H;else switch(t.type){case"2d":this._tilesOfInterest=new g({view:t,layer:this._layer}),e=this._workerHandle=new H;break;case"3d":{const{resourceController:r}=t,i=this._layer;this._tilesOfInterest=new w({view:t}),e=this._workerHandle=new H({schedule:e=>r.immediate.schedule(e),hasZ:this._layer.hasZ&&(this._layer.returnZ??!0),elevationAlignPointsInFeatures:async(e,r)=>{const s=await t.whenLayerView(i);return o(r),s.elevationAlignPointsInFeatures(e,r)},queryForSymbologySnapping:async(e,r)=>{const s=await t.whenLayerView(i);return o(r),s.queryForSymbologySnapping(e,r)}}),this.addHandles([t.elevationProvider.on("elevation-change",({context:t})=>{const{elevationInfo:r}=i;_(t,r)&&a(e.notifyElevationSourceChange())}),n(()=>i.elevationInfo,()=>a(e.notifyElevationSourceChange()),d),n(()=>this._layerView?.layer?.renderer,()=>a(e.notifySymbologyChange()),d),n(()=>this._layerView?.symbologySnappingSupported??!1,t=>a(e.setSymbologySnappingSupported(t)),d),l(()=>this._layerView?.layer,["edits","apply-edits","graphic-update"],()=>e.notifySymbologyChange())]);break}}this.addHandles([i(e)]),a(e.setup({layer:this._layer,spatialReference:this.spatialReference,configuration:this.configuration},null)),this._updatingHandles.add(()=>this._updateTilesParameters,()=>a(e.updateTiles(this._updateTilesParameters,null)),d),this.addHandles([n(()=>this.configuration,t=>a(e.configure(t,null)),u),n(()=>this._layer.historicMoment,t=>a(e.setHistoricMoment(t)),p),n(()=>this._outFields,t=>a(e.updateOutFields(t)),d),n(()=>this._isSuspended,t=>a(e.setSuspended(t)),p)]),null!=t&&this.addHandles(n(()=>j.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES,r=>{r&&!this._debug?(this._debug=new I({view:t,handle:e}),this.addHandles(i(this._debug),"debug")):!r&&this._debug&&this.removeHandles("debug")},d)),this.addHandles([this.layerSource.layer.on("edits",t=>a(e.handleEdits(t,null))),this.layerSource.layer.on("apply-edits",e=>this._updatingHandles.addPromise(e.result))])}destroy(){this._updatingHandles.destroy(),this._tilesOfInterest.destroy()}refresh(){this._workerHandle?.refresh(null)}async fetchCandidates(e,t){const{coordinateHelper:r,point:i}=e;this._tilesOfInterest.pointOfInterest=r.arrayToPoint(i);const s=this._memoizedMakeGetGroundElevation(this.view,r.spatialReference);return(await this._workerHandle.fetchCandidates({...e},t)).candidates.map(e=>b(e,s))}getDebugInfo(e){return this._workerHandle.getDebugInfo(e)}_getOrLoadWhereFields(e,t){const{_whereModule:i}=this;if(!this._loadWhereModuleTask&&!i){const e=r(async()=>{const e=await import("../../../../core/sql/WhereClause.js");return this._whereModule=e.default,this._whereModule});return this._loadWhereModuleTask=e,this._updatingHandles.addPromise(e.promise),[]}if(!i)return[];try{return i.create(e,{fieldsIndex:t}).fieldNames}catch(s){return[]}}};e([c({constructOnly:!0})],O.prototype,"spatialReference",void 0),e([c({constructOnly:!0})],O.prototype,"layerSource",void 0),e([c({constructOnly:!0})],O.prototype,"view",void 0),e([c()],O.prototype,"_tilesOfInterest",void 0),e([c({readOnly:!0})],O.prototype,"_updateTilesParameters",null),e([c()],O.prototype,"_layerView",null),e([c()],O.prototype,"_isSuspended",null),e([c({readOnly:!0})],O.prototype,"updating",null),e([c()],O.prototype,"_outFields",null),e([c({readOnly:!0})],O.prototype,"configuration",null),e([c({readOnly:!0})],O.prototype,"availability",null),e([c()],O.prototype,"_loadWhereModuleTask",void 0),e([c()],O.prototype,"_whereModule",void 0),O=e([y("esri.views.interactive.snapping.featureSources.FeatureServiceSnappingSource")],O);export{O as FeatureServiceSnappingSource};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{destroyHandle as i}from"../../../../core/handleUtils.js";import{memoize as s}from"../../../../core/memoize.js";import{throwIfAborted as o,ignoreAbortErrors as a}from"../../../../core/promiseUtils.js";import{watch as n,on as l,initial as d,sync as u,syncAndInitial as p}from"../../../../core/reactiveUtils.js";import{sqlAnd as h}from"../../../../core/sql.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as y}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as m}from"../../../../layers/support/layerUtils.js";import{elevationContextAffectsAlignment as _}from"../../../../support/elevationInfoUtils.js";import{FeatureServiceTiles2D as g}from"../../../2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js";import{FeatureServiceTiles3D as w}from"../../../3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js";import{isUtilityNetworkWebMap as S}from"../snappingUtils.js";import{makeGetGroundElevation as v,convertSnappingCandidate as b}from"./queryEngineUtils.js";import{WorkerTileTreeDebugger as I}from"./WorkerTileTreeDebugger.js";import{FeatureServiceSnappingSourceWorkerHandle as H}from"./featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js";import{FeatureServiceTilesSimple as F}from"./featureServiceSource/FeatureServiceTilesSimple.js";import j from"../../../support/debugFlags.js";let O=class extends t{get _updateTilesParameters(){return{tiles:this._tilesOfInterest.tiles,tileInfo:this._tilesOfInterest.tileInfo,tileSize:this._tilesOfInterest.tileSize}}get _layerView(){return this.view?.allLayerViews.find(e=>e.layer===this._layer)}get _isSuspended(){if(m(this._layer)){if(!this.layerSource.sublayerSources.some(e=>e.enabled&&e.layer.visible))return!0}return!!this.view&&(!1!==this._layerView?.suspended||!this.layerSource.enabled)}get updating(){return this._workerHandle?.updating||this._updatingHandles.updating}get _outFields(){const{view:e,_layerView:t,layerSource:r}=this,{layer:i}=r,{fieldsIndex:s,timeInfo:o,floorInfo:a,subtypeField:n}=i,l=t&&"filter"in t?t.filter:null,d=l?.where&&"1=1"!==l.where?this._getOrLoadWhereFields(l.where,s):[];if(l?.timeExtent&&o){const{startField:e,endField:t}=o,r=s.get(e)?.name??e,i=s.get(t)?.name??t;r&&d.push(r),i&&d.push(i)}if(e?.map&&S(e.map)&&e.map.utilityNetworks?.find(e=>e.isUtilityLayer(i))){const e=i.fieldsIndex.get("assetGroup")?.name,t=i.fieldsIndex.get("assetType")?.name;e&&t&&(d.push(e),d.push(t))}if(i&&a?.floorField&&e?.floors?.length){const e=s.get(a.floorField)?.name??a.floorField;e&&d.push(e)}if(n){const e=s.get(n)?.name??n;e&&d.push(e)}return new Set(d)}get configuration(){const{view:e}=this,{apiKey:t,customParameters:r}=this._layer,i=null!=e?e.type:"2d",s=this._layer.createQuery();return this._layerView&&"effectiveDisplayFilter"in this._layerView&&(s.where=h(s.where,this._layerView.effectiveDisplayFilter?.where)),{filter:s,customParameters:t?{...r,token:t}:r,viewType:i}}get availability(){return this._workerHandle?.availability??0}get _layer(){return this.layerSource.layer}constructor(e){super(e),this._updatingHandles=new f,this._workerHandle=null,this._debug=null,this._memoizedMakeGetGroundElevation=s(v)}initialize(){let e;const t=this.view;if(null==t||t.destroyed)this._tilesOfInterest=new F({layer:this._layer}),e=this._workerHandle=new H;else switch(t.type){case"2d":this._tilesOfInterest=new g({view:t,layer:this._layer}),e=this._workerHandle=new H;break;case"3d":{const{resourceController:r}=t,i=this._layer;this._tilesOfInterest=new w({view:t}),e=this._workerHandle=new H({schedule:e=>r.immediate.schedule(e),hasZ:i.hasZ&&(i.returnZ??!0),elevationAlignPointsInFeatures:async(e,r)=>{const s=await t.whenLayerView(i);return o(r),s.elevationAlignPointsInFeatures(e,r)},queryForSymbologySnapping:async(e,r)=>{const s=await t.whenLayerView(i);return o(r),s.queryForSymbologySnapping(e,r)}}),this.addHandles([t.elevationProvider.on("elevation-change",({context:t})=>{const{elevationInfo:r}=i;_(t,r)&&a(e.notifyElevationSourceChange())}),n(()=>i.elevationInfo,()=>a(e.notifyElevationSourceChange()),d),n(()=>this._layerView?.layer?.renderer,()=>a(e.notifySymbologyChange()),d),n(()=>this._layerView?.symbologySnappingSupported??!1,t=>a(e.setSymbologySnappingSupported(t)),d),l(()=>this._layerView?.layer,["edits","apply-edits","graphic-update"],()=>e.notifySymbologyChange())]);break}}this.addHandles([i(e)]),a(e.setup({layer:this._layer,spatialReference:this.spatialReference,configuration:this.configuration},null)),this._updatingHandles.add(()=>this._updateTilesParameters,()=>a(e.updateTiles(this._updateTilesParameters,null)),d),this.addHandles([n(()=>this.configuration,t=>a(e.configure(t,null)),u),n(()=>this._layer.historicMoment,t=>a(e.setHistoricMoment(t)),p),n(()=>this._outFields,t=>a(e.updateOutFields(t)),d),n(()=>this._isSuspended,t=>a(e.setSuspended(t)),p)]),null!=t&&this.addHandles(n(()=>j.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES,r=>{r&&!this._debug?(this._debug=new I({view:t,handle:e}),this.addHandles(i(this._debug),"debug")):!r&&this._debug&&this.removeHandles("debug")},d)),this.addHandles([this.layerSource.layer.on("edits",t=>a(e.handleEdits(t,null))),this.layerSource.layer.on("apply-edits",e=>this._updatingHandles.addPromise(e.result))])}destroy(){this._updatingHandles.destroy(),this._tilesOfInterest.destroy()}refresh(){this._workerHandle?.refresh(null)}async fetchCandidates(e,t){const{coordinateHelper:r,point:i}=e;this._tilesOfInterest.pointOfInterest=r.arrayToPoint(i);const s=this._memoizedMakeGetGroundElevation(this.view,r.spatialReference);return(await this._workerHandle.fetchCandidates({...e},t)).candidates.map(e=>b(e,s))}getDebugInfo(e){return this._workerHandle.getDebugInfo(e)}_getOrLoadWhereFields(e,t){const{_whereModule:i}=this;if(!this._loadWhereModuleTask&&!i){const e=r(async()=>{const e=await import("../../../../core/sql/WhereClause.js");return this._whereModule=e.default,this._whereModule});return this._loadWhereModuleTask=e,this._updatingHandles.addPromise(e.promise),[]}if(!i)return[];try{return i.create(e,{fieldsIndex:t}).fieldNames}catch(s){return[]}}};e([c({constructOnly:!0})],O.prototype,"spatialReference",void 0),e([c({constructOnly:!0})],O.prototype,"layerSource",void 0),e([c({constructOnly:!0})],O.prototype,"view",void 0),e([c()],O.prototype,"_tilesOfInterest",void 0),e([c({readOnly:!0})],O.prototype,"_updateTilesParameters",null),e([c()],O.prototype,"_layerView",null),e([c()],O.prototype,"_isSuspended",null),e([c({readOnly:!0})],O.prototype,"updating",null),e([c()],O.prototype,"_outFields",null),e([c({readOnly:!0})],O.prototype,"configuration",null),e([c({readOnly:!0})],O.prototype,"availability",null),e([c()],O.prototype,"_loadWhereModuleTask",void 0),e([c()],O.prototype,"_whereModule",void 0),O=e([y("esri.views.interactive.snapping.featureSources.FeatureServiceSnappingSource")],O);export{O as FeatureServiceSnappingSource};
@@ -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{makeHandle as t}from"../../../../core/handleUtils.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 o}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../../geometry/Polygon.js";import{toExtent as a}from"../../../../geometry/support/aaBoundingRect.js";import{TileTreeDebugger as i}from"../../../support/TileTreeDebugger.js";let n=class extends i{constructor(e){super(e)}initialize(){const e=setInterval(()=>this._fetchDebugInfo(),2e3);this.addHandles(t(()=>clearInterval(e)))}getTiles(){if(!this._debugInfo)return[];const e=new Map,t=new Map;this._debugInfo.storedTiles.forEach(t=>{e.set(t.data.id,t.featureCount)}),this._debugInfo.pendingTiles.forEach(r=>{e.set(r.data.id,r.featureCount),t.set(r.data.id,r.state)});const r=r=>{const o=t.get(r),s=e.get(r)??"?";return o?`${o}:${s}\n${r}`:`store:${s}\n${r}`},o=new Map;return this._debugInfo.storedTiles.forEach(e=>{o.set(e.data.id,e.data)}),this._debugInfo.pendingTiles.forEach(e=>{o.set(e.data.id,e.data)}),Array.from(o.values()).map(e=>({lij:[e.level,e.row,e.col],level:e.level,geometry:s.fromExtent(a(e.extent,this.view.spatialReference)),label:r(e.id)}))}_fetchDebugInfo(){this.handle.getDebugInfo(null).then(e=>{this._debugInfo=e,this.update()})}};e([r({constructOnly:!0})],n.prototype,"handle",void 0),n=e([o("esri.views.interactive.snapping.featureSources.WorkerTileTreeDebugger")],n);export{n as WorkerTileTreeDebugger};
5
+ import{__decorate as e}from"tslib";import{makeHandle as t}from"../../../../core/handleUtils.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 o}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../../geometry/Polygon.js";import{toExtent as i}from"../../../../geometry/support/aaBoundingRect.js";import{TileKey as n}from"../../../../layers/support/TileKey.js";import{TileTreeDebugger as a}from"../../../support/TileTreeDebugger.js";let l=class extends a{constructor(e){super(e)}initialize(){const e=setInterval(()=>this._fetchDebugInfo(),2e3);this.addHandles(t(()=>clearInterval(e)))}getTiles(){if(!this._debugInfo)return[];const e=new Map,t=new Map;this._debugInfo.storedTiles.forEach(t=>e.set(n.fromJSON(t.key).id,t.featureCount)),this._debugInfo.pendingTiles.forEach(r=>{e.set(r.key.id,r.featureCount),t.set(r.key.id,r.state)});const r=r=>{const o=t.get(r),s=e.get(r)??"?";return o?`${o}:${s}\n${r}`:`store:${s}\n${r}`},o=new Map;return this._debugInfo.storedTiles.forEach(e=>{const t=n.fromJSON(e.key);o.set(t.id,t)}),this._debugInfo.pendingTiles.forEach(e=>{o.set(e.key.id,e.key)}),Array.from(o.values()).map(e=>({lij:[e.level,e.row,e.col],level:e.level,geometry:s.fromExtent(i(e.extent,this.view.spatialReference)),label:r(e.id)}))}_fetchDebugInfo(){this.handle.getDebugInfo(null).then(e=>{this._debugInfo=e,this.update()})}};e([r({constructOnly:!0})],l.prototype,"handle",void 0),l=e([o("esri.views.interactive.snapping.featureSources.WorkerTileTreeDebugger")],l);export{l as WorkerTileTreeDebugger};
@@ -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{EventedAccessor as t}from"../../../../../core/Evented.js";import{createResolver as i,throwIfAborted as r}from"../../../../../core/promiseUtils.js";import{watch as s,sync as a,whenOnce as n}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as u}from"../../../../../core/support/UpdatingHandles.js";import d from"../../../../../geometry/SpatialReference.js";import{fromJSON as h}from"../../../../../geometry/support/jsonUtils.js";import c from"../../../../../layers/graphics/data/FeatureStore.js";import{QueryEngine as p}from"../../../../../layers/graphics/data/QueryEngine.js";import f from"../../../../../layers/support/TileInfo.js";import m from"../../../../../rest/support/Query.js";import g from"../../../../../symbols/support/ElevationInfo.js";import{getSnappingCandidateElevationAligner as y}from"../snappingCandidateElevationAlignment.js";import{getSnappingCandidateElevationFilter as _}from"../snappingCandidateElevationFilter.js";import{getSymbologySnappingCandidatesFetcher as S}from"../symbologySnappingCandidates.js";import{FeatureServiceTiledFetcher as F}from"./FeatureServiceTiledFetcher.js";import{FeatureServiceTileStore as v}from"./FeatureServiceTileStore.js";let I=class extends t{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=i(),this._elevationAligner=y(),this._elevationFilter=_(),this._symbologyCandidatesFetcher=S(),this._updatingHandles=new u,this._alignPointsInFeatures=async(e,t)=>{const i={query:e},s=await this.remoteClient.invoke("alignElevation",i,{signal:t});return r(t),s},this._getSymbologyCandidates=async(e,t)=>{const i={candidates:e,spatialReference:this._spatialReference.toJSON()},s=await this.remoteClient.invoke("getSymbologyCandidates",i,{signal:t});return r(t),s}}get updating(){return this._isInitializing||this._updatingHandles.updating||this._featureFetcher.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:i,timeInfo:r,fieldsIndex:n}=e.serviceInfo,{hasZ:o}=e,l=d.fromJSON(e.spatialReference);this._spatialReference=l,this._featureStore=new c({...e.serviceInfo,hasZ:o,hasM:!1}),this._featureStore.estimateFeatureUsedMemory=e=>e.usedMemory,this._queryEngine=new p({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:n,hasZ:o,hasM:!1,featureIdInfo:{type:"object-id",fieldName:i},timeInfo:r}),this._featureFetcher=new F({store:new v({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:l,sourceSpatialReference:d.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const u="3d"===e.configuration.viewType;return this._elevationAligner=y(u,{elevationInfo:null!=e.elevationInfo?g.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=_(u),this.addHandles([s(()=>this._featureFetcher.availability,e=>this.emit("notify-availability",{availability:e}),a),s(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),j}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.suspended=e,j}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.outFields=new Set(e??[]),j}async fetchCandidates(e,t){await this._whenSetup.promise,r(t);const i=b(e,this._featureStore.hasZ),s=t?.signal,a=await this._queryEngine.executeQueryForSnapping(i,s);r(s);const n=await this._elevationAligner.alignCandidates(a.candidates,d.fromJSON(e.point.spatialReference)??d.WGS84,s);r(s);const o=await this._symbologyCandidatesFetcher.fetch(n,s);r(s);const l=0===o.length?n:n.concat(o);return{result:{candidates:this._elevationFilter.filter(i,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=null!=e.tileInfo?f.fromJSON(e.tileInfo):null,j}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.refresh(),j}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),await n(()=>!this.updating,t),r(t),j}async getDebugInfo(e,t){return r(t),{result:this._featureFetcher.debugInfo}}async handleEdits(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),await this._updatingHandles.addPromise(this._featureFetcher.handleEdits(e)),r(t),j}async setHistoricMoment(e,t){return this._featureFetcher.setHistoricMoment(e.moment),j}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),j}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),j}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=S(e,this._getSymbologyCandidates),j}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null!=e.filter?m.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};e([o({readOnly:!0})],I.prototype,"updating",null),e([o()],I.prototype,"_isInitializing",void 0),I=e([l("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],I);const w=I;function b(e,t){const i=!!t||void 0;if(!e.filter)return{...e,query:{where:"1=1",returnZ:i}};const{distance:r,units:s,spatialRel:a,where:n,timeExtent:o,objectIds:l}=e.filter,u={geometry:e.filter.geometry?h(e.filter.geometry):void 0,distance:r,units:s,spatialRel:a,timeExtent:o,objectIds:l,returnZ:i,where:n??"1=1"};return{...e,query:u}}const j={result:{}};export{w as default};
5
+ import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../../core/Evented.js";import{createResolver as i,throwIfAborted as r}from"../../../../../core/promiseUtils.js";import{watch as s,sync as a,whenOnce as n}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as u}from"../../../../../core/support/UpdatingHandles.js";import d from"../../../../../geometry/SpatialReference.js";import{fromJSON as p}from"../../../../../geometry/support/jsonUtils.js";import h from"../../../../../layers/graphics/data/FeatureStore.js";import{QueryEngine as c}from"../../../../../layers/graphics/data/QueryEngine.js";import f from"../../../../../layers/support/TileInfo.js";import{TileKey as m}from"../../../../../layers/support/TileKey.js";import g from"../../../../../rest/support/Query.js";import y from"../../../../../symbols/support/ElevationInfo.js";import{getSnappingCandidateElevationAligner as _}from"../snappingCandidateElevationAlignment.js";import{getSnappingCandidateElevationFilter as S}from"../snappingCandidateElevationFilter.js";import{getSymbologySnappingCandidatesFetcher as F}from"../symbologySnappingCandidates.js";import{FeatureServiceTiledFetcher as v}from"./FeatureServiceTiledFetcher.js";import{FeatureServiceTileStore as I}from"./FeatureServiceTileStore.js";let w=class extends t{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=i(),this._elevationAligner=_(),this._elevationFilter=S(),this._symbologyCandidatesFetcher=F(),this._updatingHandles=new u,this._alignPointsInFeatures=async(e,t)=>{const i={query:e},s=await this.remoteClient.invoke("alignElevation",i,{signal:t});return r(t),s},this._getSymbologyCandidates=async(e,t)=>{const i={candidates:e,spatialReference:this._spatialReference.toJSON()},s=await this.remoteClient.invoke("getSymbologyCandidates",i,{signal:t});return r(t),s}}get updating(){return this._isInitializing||this._updatingHandles.updating||this._featureFetcher.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:i,timeInfo:r,fieldsIndex:n}=e.serviceInfo,{hasZ:o}=e,l=d.fromJSON(e.spatialReference);this._spatialReference=l,this._featureStore=new h({...e.serviceInfo,hasZ:o,hasM:!1}),this._featureStore.estimateFeatureUsedMemory=e=>e.usedMemory,this._queryEngine=new c({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:n,hasZ:o,hasM:!1,featureIdInfo:{type:"object-id",fieldName:i},timeInfo:r}),this._featureFetcher=new v({store:new I({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:l,sourceSpatialReference:d.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const u="3d"===e.configuration.viewType;return this._elevationAligner=_(u,{elevationInfo:null!=e.elevationInfo?y.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=S(u),this.addHandles([s(()=>this._featureFetcher.availability,e=>this.emit("notify-availability",{availability:e}),a),s(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),C}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.suspended=e,C}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.outFields=new Set(e??[]),C}async fetchCandidates(e,t){await this._whenSetup.promise,r(t);const i=j(e,this._featureStore.hasZ),s=t?.signal,a=await this._queryEngine.executeQueryForSnapping(i,s);r(s);const n=await this._elevationAligner.alignCandidates(a.candidates,d.fromJSON(e.point.spatialReference)??d.WGS84,s);r(s);const o=await this._symbologyCandidatesFetcher.fetch(n,s);r(s);const l=0===o.length?n:n.concat(o);return{result:{candidates:this._elevationFilter.filter(i,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles.map(e=>m.fromJSON(e)),this._featureFetcher.tileInfo=null!=e.tileInfo?f.fromJSON(e.tileInfo):null,C}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.refresh(),C}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),await n(()=>!this.updating,t),r(t),C}async getDebugInfo(e,t){return r(t),{result:this._featureFetcher.debugInfo}}async handleEdits(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),await this._updatingHandles.addPromise(this._featureFetcher.handleEdits(e)),r(t),C}async setHistoricMoment(e,t){return this._featureFetcher.setHistoricMoment(e.moment),C}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),C}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),C}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=F(e,this._getSymbologyCandidates),C}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null!=e.filter?g.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};e([o({readOnly:!0})],w.prototype,"updating",null),e([o()],w.prototype,"_isInitializing",void 0),w=e([l("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],w);const b=w;function j(e,t){const i=!!t||void 0;if(!e.filter)return{...e,query:{where:"1=1",returnZ:i}};const{distance:r,units:s,spatialRel:a,where:n,timeExtent:o,objectIds:l}=e.filter,u={geometry:e.filter.geometry?p(e.filter.geometry):void 0,distance:r,units:s,spatialRel:a,timeExtent:o,objectIds:l,returnZ:i,where:n??"1=1"};return{...e,query:u}}const C={result:{}};export{b 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{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{isSome as o}from"../../../../../core/arrayUtils.js";import{abortMaybe as i}from"../../../../../core/maybe.js";import{debounce as n}from"../../../../../core/promiseUtils.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as s}from"../../../../../core/support/UpdatingHandles.js";import{WorkerHandle as d}from"../../../../../core/workers/WorkerHandle.js";import{featureGeometryTypeKebabDictionary as l}from"../../../../../geometry/support/typeUtils.js";import{makeDehydratedPoint as p}from"../../../../../layers/graphics/dehydratedPoint.js";let u=class extends t{get updating(){return this._updatingHandles.updating||this._workerHandleUpdating}constructor(e){super(e),this._updatingHandles=new s,this._suspendController=null,this.schedule=null,this.hasZ=!1,this.elevationAlignPointsInFeatures=async e=>{const t=[];for(const{points:o}of e.pointsInFeatures)for(const{z:e}of o)t.push(e);return{elevations:t,drapedObjectIds:new Set,failedObjectIds:new Set}},this.queryForSymbologySnapping=async()=>({candidates:[],sourceCandidateIndices:[]}),this.availability=0,this._workerHandleUpdating=!0,this.updateOutFields=n(async(e,t)=>{await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("updateOutFields",[...e],t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))})}destroy(){this._suspendController=i(this._suspendController),this._workerHandle.destroy(),this._updatingHandles.destroy()}initialize(){this._workerHandle=new y(this.schedule,{alignElevation:async(e,{signal:t})=>({result:await this.elevationAlignPointsInFeatures(e.query,t)}),getSymbologyCandidates:async(e,{signal:t})=>({result:await this.queryForSymbologySnapping(e,t)})}),this.addHandles([this._workerHandle.on("notify-updating",({updating:e})=>this._workerHandleUpdating=e),this._workerHandle.on("notify-availability",({availability:e})=>this._set("availability",e))])}async setup(e,t){const o=c(e.layer);if(null==o)return;const i={configuration:h(e.configuration),serviceInfo:o,spatialReference:e.spatialReference.toJSON(),hasZ:this.hasZ,elevationInfo:e.layer.elevationInfo?.toJSON()};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("setup",i,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async configure(e,t){const o=h(e);await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("configure",o,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async refresh(e){await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("refresh",{},e)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},e))}async fetchCandidates(e,t){const{point:o,filter:i,coordinateHelper:n}=e,a={...e,point:p(o[0],o[1],o[2],n.spatialReference.toJSON()),filter:i?.toJSON()};return this._workerHandle.invoke(a,t)}async updateTiles(e,t){const o={tiles:e.tiles,tileInfo:null!=e.tileInfo?e.tileInfo.toJSON():null,tileSize:e.tileSize};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("updateTiles",o,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async handleEdits({historicMoment:e,addedFeatures:t,deletedFeatures:i,updatedFeatures:n},a){const r={historicMoment:e,addedFeatures:t?.map(({objectId:e})=>e).filter(o)??[],deletedFeatures:i?.map(({objectId:e,globalId:t})=>({objectId:e,globalId:t}))??[],updatedFeatures:n?.map(({objectId:e})=>e).filter(o)??[]};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("handleEdits",r,a)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},a))}async setHistoricMoment(e,t){await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("setHistoricMoment",{moment:e},t))}getDebugInfo(e){return this._workerHandle.invokeMethod("getDebugInfo",{},e)}async notifyElevationSourceChange(){await this._workerHandle.invokeMethod("notifyElevationSourceChange",{})}async notifySymbologyChange(){await this._workerHandle.invokeMethod("notifySymbologyChange",{})}async setSymbologySnappingSupported(e){await this._workerHandle.invokeMethod("setSymbologySnappingSupported",e)}async setSuspended(e){this._suspendController?.abort(),this._suspendController=new AbortController,await this._workerHandle.invokeMethod("setSuspended",e,this._suspendController.signal)}};function h(e){return{filter:null!=e.filter?e.filter.toJSON():null,customParameters:e.customParameters,viewType:e.viewType}}function c(e){return"multipatch"===e.geometryType||"mesh"===e.geometryType?null:{url:e.parsedUrl?.path??"",fieldsIndex:e.fieldsIndex.toJSON(),geometryType:l.toJSON(e.geometryType),capabilities:e.capabilities,objectIdField:e.objectIdField,globalIdField:e.globalIdField,spatialReference:e.spatialReference.toJSON(),timeInfo:e.timeInfo?.toJSON()}}e([a({constructOnly:!0})],u.prototype,"schedule",void 0),e([a({constructOnly:!0})],u.prototype,"hasZ",void 0),e([a({constructOnly:!0})],u.prototype,"elevationAlignPointsInFeatures",void 0),e([a({constructOnly:!0})],u.prototype,"queryForSymbologySnapping",void 0),e([a({readOnly:!0})],u.prototype,"updating",null),e([a({readOnly:!0})],u.prototype,"availability",void 0),e([a()],u.prototype,"_workerHandleUpdating",void 0),u=e([r("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorkerHandle")],u);class y extends d{constructor(e,t){super("FeatureServiceSnappingSourceWorker","fetchCandidates",{},e,{strategy:"dedicated",client:t})}}export{u as FeatureServiceSnappingSourceWorkerHandle};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{isSome as o}from"../../../../../core/arrayUtils.js";import{abortMaybe as i}from"../../../../../core/maybe.js";import{debounce as n}from"../../../../../core/promiseUtils.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as s}from"../../../../../core/support/UpdatingHandles.js";import{WorkerHandle as d}from"../../../../../core/workers/WorkerHandle.js";import{featureGeometryTypeKebabDictionary as l}from"../../../../../geometry/support/typeUtils.js";import{makeDehydratedPoint as p}from"../../../../../layers/graphics/dehydratedPoint.js";let u=class extends t{get updating(){return this._updatingHandles.updating||this._workerHandleUpdating}constructor(e){super(e),this._updatingHandles=new s,this._suspendController=null,this.schedule=null,this.hasZ=!1,this.elevationAlignPointsInFeatures=async e=>{const t=[];for(const{points:o}of e.pointsInFeatures)for(const{z:e}of o)t.push(e);return{elevations:t,drapedObjectIds:new Set,failedObjectIds:new Set}},this.queryForSymbologySnapping=async()=>({candidates:[],sourceCandidateIndices:[]}),this.availability=0,this._workerHandleUpdating=!0,this.updateOutFields=n(async(e,t)=>{await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("updateOutFields",[...e],t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))})}destroy(){this._suspendController=i(this._suspendController),this._workerHandle.destroy(),this._updatingHandles.destroy()}initialize(){this._workerHandle=new y(this.schedule,{alignElevation:async(e,{signal:t})=>({result:await this.elevationAlignPointsInFeatures(e.query,t)}),getSymbologyCandidates:async(e,{signal:t})=>({result:await this.queryForSymbologySnapping(e,t)})}),this.addHandles([this._workerHandle.on("notify-updating",({updating:e})=>this._workerHandleUpdating=e),this._workerHandle.on("notify-availability",({availability:e})=>this._set("availability",e))])}async setup(e,t){const o=c(e.layer);if(null==o)return;const i={configuration:h(e.configuration),serviceInfo:o,spatialReference:e.spatialReference.toJSON(),hasZ:this.hasZ,elevationInfo:e.layer.elevationInfo?.toJSON()};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("setup",i,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async configure(e,t){const o=h(e);await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("configure",o,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async refresh(e){await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("refresh",{},e)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},e))}async fetchCandidates(e,t){const{point:o,filter:i,coordinateHelper:n}=e,a={...e,point:p(o[0],o[1],o[2],n.spatialReference.toJSON()),filter:i?.toJSON()};return this._workerHandle.invoke(a,t)}async updateTiles(e,t){const o={tiles:e.tiles.map(e=>e.toJSON()),tileInfo:null!=e.tileInfo?e.tileInfo.toJSON():null,tileSize:e.tileSize};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("updateTiles",o,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async handleEdits({historicMoment:e,addedFeatures:t,deletedFeatures:i,updatedFeatures:n},a){const r={historicMoment:e,addedFeatures:t?.map(({objectId:e})=>e).filter(o)??[],deletedFeatures:i?.map(({objectId:e,globalId:t})=>({objectId:e,globalId:t}))??[],updatedFeatures:n?.map(({objectId:e})=>e).filter(o)??[]};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("handleEdits",r,a)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},a))}async setHistoricMoment(e,t){await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("setHistoricMoment",{moment:e},t))}getDebugInfo(e){return this._workerHandle.invokeMethod("getDebugInfo",{},e)}async notifyElevationSourceChange(){await this._workerHandle.invokeMethod("notifyElevationSourceChange",{})}async notifySymbologyChange(){await this._workerHandle.invokeMethod("notifySymbologyChange",{})}async setSymbologySnappingSupported(e){await this._workerHandle.invokeMethod("setSymbologySnappingSupported",e)}async setSuspended(e){this._suspendController?.abort(),this._suspendController=new AbortController,await this._workerHandle.invokeMethod("setSuspended",e,this._suspendController.signal)}};function h(e){return{filter:null!=e.filter?e.filter.toJSON():null,customParameters:e.customParameters,viewType:e.viewType}}function c(e){return"multipatch"===e.geometryType||"mesh"===e.geometryType?null:{url:e.parsedUrl?.path??"",fieldsIndex:e.fieldsIndex.toJSON(),geometryType:l.toJSON(e.geometryType),capabilities:e.capabilities,objectIdField:e.objectIdField,globalIdField:e.globalIdField,spatialReference:e.spatialReference.toJSON(),timeInfo:e.timeInfo?.toJSON()}}e([a({constructOnly:!0})],u.prototype,"schedule",void 0),e([a({constructOnly:!0})],u.prototype,"hasZ",void 0),e([a({constructOnly:!0})],u.prototype,"elevationAlignPointsInFeatures",void 0),e([a({constructOnly:!0})],u.prototype,"queryForSymbologySnapping",void 0),e([a({readOnly:!0})],u.prototype,"updating",null),e([a({readOnly:!0})],u.prototype,"availability",void 0),e([a()],u.prototype,"_workerHandleUpdating",void 0),u=e([r("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorkerHandle")],u);class y extends d{constructor(e,t){super("FeatureServiceSnappingSourceWorker","fetchCandidates",{},e,{strategy:"dedicated",client:t})}}export{u as FeatureServiceSnappingSourceWorkerHandle};
@@ -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 t from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import{intersection as s,isSubsetOf as i}from"../../../../../core/SetUtils.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{create as n,intersects as l,fromExtent as u,area as c}from"../../../../../geometry/support/aaBoundingRect.js";import{getBoundsOptimizedGeometry as a}from"../../../../../layers/graphics/featureConversionUtils.js";import{BoundsStore as h}from"../../../../../layers/graphics/data/BoundsStore.js";import{TileKey as d}from"../../../../../layers/support/TileKey.js";import{executeQueryForCount as f}from"../../../../../rest/query/operations/query.js";import{FeatureServiceTileCache as _}from"./FeatureServiceTileCache.js";let m=class extends t{setPriorityOrderByKey(e){this._tiles.setPriorityOrderByKey(e)}get _memoryLimitExceeded(){return this.featureStore.usedMemory>=this.maximumByteSize}constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10485760,this._tileBounds=new h,this._tiles=new _,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=n()}add(e,t){for(const s of t)this._referenceFeature(s.objectId);const i=this.featureStore.upsertMany(t),r=i.map(e=>new Set(Object.keys(e.attributes))).reduce((e,t)=>s(e,t),new Set(Object.keys(i[0]?.attributes??[]))),o=this._memoryLimitExceeded;this._addTileStorage(e,new Set(i.map(e=>e.objectId)),r),o&&this._applyCacheMemoryLimits()}_applyCacheMemoryLimits(){if(!this._memoryLimitExceeded)return;const{_tiles:e,featureStore:t,maximumByteSize:s}=this;e.someFromLowestToHighestPriority(e=>!this._memoryLimitExceeded||t.usedMemory-this._estimateRemoveTileMemoryReduction(e)<s||(this._removeTileStorage(e),!1))}_estimateRemoveTileMemoryReduction(e){let t=0;for(const s of e.objectIds){if(1===this._refCounts.get(s)){const e=this.featureStore.getFeature(s);e&&(t+=this.featureStore.estimateFeatureUsedMemory?.(e)??0)}}return t}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s){const i=e.id;this._tiles.set(i,new g(e,t,s)),this._tileBounds.set(i,e.extent),this._tileFeatureCounts.set(i,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const i of e.objectIds)1===this._unreferenceFeature(i)&&t.push(i);this.featureStore.removeManyById(t);const s=e.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const t of this._tiles.values()){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){if(!e.length)return;const i=(await t(e,s)).features,{hasZ:r,hasM:o}=this.featureStore;for(const n of i){const e=a(this._tmpBoundingRect,n.geometry,r,o);null!=e&&this._tileBounds.forEachInBounds(e,e=>{const t=this._tiles.get(e);this.featureStore.add(n);const s=n.objectId;t.objectIds.has(s)||(t.objectIds.add(s),this._referenceFeature(s),this._tileFeatureCounts.set(t.data.id,t.objectIds.size))})}}process(e,t=()=>!0,s){if(null==this.tileInfo||!e.extent||null!=this.extent&&!l(u(this.extent,this._tmpBoundingRect),e.extent))return new v(e);if(this._memoryLimitExceeded&&!this._tiles.hasLowerPriority(e.id??""))return new v(e);const r=this.getAttributesForTile(e.id);if(i(s,r))return new v(e);const o=this._createTileTree(e,this.tileInfo);return this._simplify(o,t,null,0,1),this._collectMissingTiles(e,o,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map(({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const r=this._tileFeatureCounts.get(e.id);if(null!=r)return r;const o=await f(t,s,i);return this._tileFeatureCounts.set(e.id,o.data.count),o.data.count}_createTileTree(e,t){const s=new y(e.level,e.row,e.col);return t.updateTileInfo(s,1),this._tileBounds.forEachInBounds(e.extent,i=>{const r=this._tiles.get(i)?.data;r&&p(e,r)&&this._populateChildren(s,r,t,this._tileFeatureCounts.get(r.id)||0)}),s}_populateChildren(e,t,s,i){const r=t.level-e.level-1;if(r<0)return void(e.isLeaf=!0);const o=t.row>>r,n=t.col>>r,l=e.row<<1,u=n-(e.col<<1)+(o-l<<1),c=e.children[u];if(null!=c)this._populateChildren(c,t,s,i);else{const r=new y(e.level+1,o,n);s.updateTileInfo(r,1),e.children[u]=r,this._populateChildren(r,t,s,i)}}_simplify(e,t,s,i,r){const o=r*r;if(e.isLeaf)return t(this.getFeatureCount(e),r)?0:(this._remove(e),null!=s&&(s.children[i]=null),o);const n=r/2,l=n*n;let u=0;for(let c=0;c<e.children.length;c++){const s=e.children[c];u+=null!=s?this._simplify(s,t,e,c,n):l}return 0===u?this._mergeChildren(e):1-u/o<S&&(this._purge(e),null!=s&&(s.children[i]=null),u=o),u}_mergeChildren(e){const t=new Set;let i;this._forEachLeaf(e,e=>{const r=this._tiles.get(e.id);if(r){i=i?s(i,r.attributeKeys):new Set(r.attributeKeys);for(const e of r.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}}),this._addTileStorage(e,t,i??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)null!=s&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const s=e.children[t];this._purge(s),e.children[t]=null}}_collectMissingTiles(e,t,s,i){const r=new C(s,e,this.extent);return this._collectMissingTilesRecurse(t,r,1,i),r.info}_collectMissingTilesRecurse(e,t,s,r){const o=this.getAttributesForTile(e.id),n=o&&!i(r,o);if(n&&t.addMissing(e.level,e.row,e.col,s),e.isLeaf)return;if(!e.hasChildren)return void(n||t.addMissing(e.level,e.row,e.col,s));const l=s/2;for(let i=0;i<e.children.length;i++){const s=e.children[i];null==s?t.addMissing(e.level+1,(e.row<<1)+((2&i)>>1),(e.col<<1)+(1&i),l):this._collectMissingTilesRecurse(s,t,l,r)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?0:2}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),1):(t>0&&this._refCounts.set(e,t),2)}get test(){}};function p(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level<t.level,i=s?e:t,r=s?t:e,o=1<<r.level-i.level;return Math.floor(r.row/o)===i.row&&Math.floor(r.col/o)===i.col}e([r({constructOnly:!0})],m.prototype,"featureStore",void 0),e([r()],m.prototype,"tileInfo",void 0),e([r()],m.prototype,"extent",void 0),e([r()],m.prototype,"maximumByteSize",void 0),m=e([o("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],m);class g{constructor(e,t,s){this.data=e,this.objectIds=t,this.attributeKeys=s}}class y{constructor(e,t,s){this.level=e,this.row=t,this.col=s,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class v{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=c(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class C{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new v(t),null!=s&&(this._extent=u(s))}addMissing(e,t,s,i){const r=new d(null,e,t,s);this._tileInfo.updateTileInfo(r,1),null==r.extent||null!=this._extent&&!l(this._extent,r.extent)||(this.info.missingTiles.push({data:r,resolution:i}),this.info.coveredArea-=c(r.extent))}}const S=.18751;export{m as FeatureServiceTileStore,v as ProcessResult};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import{intersection as s,isSubsetOf as i}from"../../../../../core/SetUtils.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{create as n,intersects as l,fromExtent as u,area as c}from"../../../../../geometry/support/aaBoundingRect.js";import{getBoundsOptimizedGeometry as h}from"../../../../../layers/graphics/featureConversionUtils.js";import{BoundsStore as a}from"../../../../../layers/graphics/data/BoundsStore.js";import{TileKey as d}from"../../../../../layers/support/TileKey.js";import{executeQueryForCount as f}from"../../../../../rest/query/operations/query.js";import{FeatureServiceTileCache as _}from"./FeatureServiceTileCache.js";let m=class extends t{setPriorityOrderByKey(e){this._tiles.setPriorityOrderByKey(e)}get _memoryLimitExceeded(){return this.featureStore.usedMemory>=this.maximumByteSize}constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10485760,this._tileBounds=new a,this._tiles=new _,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=n()}add(e,t){for(const s of t)this._referenceFeature(s.objectId);const i=this.featureStore.upsertMany(t),r=i.map(e=>new Set(Object.keys(e.attributes))).reduce((e,t)=>s(e,t),new Set(Object.keys(i[0]?.attributes??[]))),o=this._memoryLimitExceeded;this._addTileStorage(e,new Set(i.map(e=>e.objectId)),r),o&&this._applyCacheMemoryLimits()}_applyCacheMemoryLimits(){if(!this._memoryLimitExceeded)return;const{_tiles:e,featureStore:t,maximumByteSize:s}=this;e.someFromLowestToHighestPriority(e=>!this._memoryLimitExceeded||t.usedMemory-this._estimateRemoveTileMemoryReduction(e)<s||(this._removeTileStorage(e),!1))}_estimateRemoveTileMemoryReduction(e){let t=0;for(const s of e.objectIds){if(1===this._refCounts.get(s)){const e=this.featureStore.getFeature(s);e&&(t+=this.featureStore.estimateFeatureUsedMemory?.(e)??0)}}return t}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s){const i=e.id;this._tiles.set(i,new y(e,t,s)),this._tileBounds.set(i,e.extent),this._tileFeatureCounts.set(i,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const i of e.objectIds)1===this._unreferenceFeature(i)&&t.push(i);this.featureStore.removeManyById(t);const s=e.key.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const t of this._tiles.values()){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.key.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){if(!e.length)return;const i=(await t(e,s)).features,{hasZ:r,hasM:o}=this.featureStore;for(const n of i){const e=h(this._tmpBoundingRect,n.geometry,r,o);null!=e&&this._tileBounds.forEachInBounds(e,e=>{const t=this._tiles.get(e);this.featureStore.add(n);const s=n.objectId;t.objectIds.has(s)||(t.objectIds.add(s),this._referenceFeature(s),this._tileFeatureCounts.set(t.key.id,t.objectIds.size))})}}process(e,t=()=>!0,s){if(null==this.tileInfo||!e.extent||null!=this.extent&&!l(u(this.extent,this._tmpBoundingRect),e.extent))return new v(e);if(this._memoryLimitExceeded&&!this._tiles.hasLowerPriority(e.id??""))return new v(e);const r=this.getAttributesForTile(e.id);if(i(s,r))return new v(e);const o=this._createTileTree(e,this.tileInfo);return this._simplify(o,t,null,0,1),this._collectMissingTiles(e,o,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map(({key:e})=>({key:e.toJSON(),featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const r=this._tileFeatureCounts.get(e.id);if(null!=r)return r;const o=await f(t,s,i);return this._tileFeatureCounts.set(e.id,o.data.count),o.data.count}_createTileTree(e,t){const s=new g(e.level,e.row,e.col);return t.updateTileInfo(s,1),this._tileBounds.forEachInBounds(e.extent,i=>{const r=this._tiles.get(i)?.key;r&&p(e,r)&&this._populateChildren(s,r,t,this._tileFeatureCounts.get(r.id)||0)}),s}_populateChildren(e,t,s,i){const r=t.level-e.level-1;if(r<0)return void(e.isLeaf=!0);const o=t.row>>r,n=t.col>>r,l=e.row<<1,u=n-(e.col<<1)+(o-l<<1),c=e.children[u];if(null!=c)this._populateChildren(c,t,s,i);else{const r=new g(e.level+1,o,n);s.updateTileInfo(r,1),e.children[u]=r,this._populateChildren(r,t,s,i)}}_simplify(e,t,s,i,r){const o=r*r;if(e.isLeaf)return t(this.getFeatureCount(e),r)?0:(this._remove(e),null!=s&&(s.children[i]=null),o);const n=r/2,l=n*n;let u=0;for(let c=0;c<e.children.length;c++){const s=e.children[c];u+=null!=s?this._simplify(s,t,e,c,n):l}return 0===u?this._mergeChildren(e):1-u/o<S&&(this._purge(e),null!=s&&(s.children[i]=null),u=o),u}_mergeChildren(e){const t=new Set;let i;this._forEachLeaf(e,e=>{const r=this._tiles.get(e.id);if(r){i=i?s(i,r.attributeKeys):new Set(r.attributeKeys);for(const e of r.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}}),this._addTileStorage(e,t,i??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)null!=s&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const s=e.children[t];this._purge(s),e.children[t]=null}}_collectMissingTiles(e,t,s,i){const r=new C(s,e,this.extent);return this._collectMissingTilesRecurse(t,r,1,i),r.info}_collectMissingTilesRecurse(e,t,s,r){const o=this.getAttributesForTile(e.id),n=o&&!i(r,o);if(n&&t.addMissing(e.level,e.row,e.col,s),e.isLeaf)return;if(!e.hasChildren)return void(n||t.addMissing(e.level,e.row,e.col,s));const l=s/2;for(let i=0;i<e.children.length;i++){const s=e.children[i];null==s?t.addMissing(e.level+1,(e.row<<1)+((2&i)>>1),(e.col<<1)+(1&i),l):this._collectMissingTilesRecurse(s,t,l,r)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?0:2}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),1):(t>0&&this._refCounts.set(e,t),2)}get test(){}};function p(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level<t.level,i=s?e:t,r=s?t:e,o=1<<r.level-i.level;return Math.floor(r.row/o)===i.row&&Math.floor(r.col/o)===i.col}e([r({constructOnly:!0})],m.prototype,"featureStore",void 0),e([r()],m.prototype,"tileInfo",void 0),e([r()],m.prototype,"extent",void 0),e([r()],m.prototype,"maximumByteSize",void 0),m=e([o("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],m);class y{constructor(e,t,s){this.key=e,this.objectIds=t,this.attributeKeys=s}}class g extends d{constructor(){super(...arguments),this.isLeaf=!1,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class v{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=c(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class C{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new v(t),null!=s&&(this._extent=u(s))}addMissing(e,t,s,i){const r=new d(e,t,s);this._tileInfo.updateTileInfo(r,1)&&(null==this._extent||l(this._extent,r.extent))&&(this.info.missingTiles.push({data:r,resolution:i}),this.info.coveredArea-=c(r.extent))}}const S=.18751;export{m as FeatureServiceTileStore,v as ProcessResult};
@@ -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 t from"../../../../../core/Accessor.js";import{equals as i}from"../../../../../core/arrayUtils.js";import{createTask as s}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Logger.js";import{throwIfAbortError as o}from"../../../../../core/promiseUtils.js";import{when as n}from"../../../../../core/reactiveUtils.js";import{union as a,equals as l,isSubsetOf as u,difference as d}from"../../../../../core/SetUtils.js";import{normalizeGlobalID as c}from"../../../../../core/uuid.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as f}from"../../../../../core/support/UpdatingHandles.js";import y from"../../../../../geometry/Extent.js";import{toExtent as m}from"../../../../../geometry/support/aaBoundingRect.js";import{unquantizeOptimizedFeatureSet as _,convertFromFeatureSet as g}from"../../../../../layers/graphics/featureConversionUtils.js";import{isHostedAgolService as F}from"../../../../../layers/support/arcgisLayerUrl.js";import{OptimizedFeatureSetParserContext as b}from"../../../../../rest/query/operations/pbfOptimizedFeatureSet.js";import{executeQueryForExtent as T,executeQueryPBF as P,executeQuery as v}from"../../../../../rest/query/operations/query.js";import I from"../../../../../rest/support/Query.js";import{PendingFeatureTile as O}from"./PendingFeatureTile.js";let S=class extends t{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),i=a(e,this._mandatoryOutFields);l(i,t)||(this._set("outFields",i),u(i,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),i=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(i)&&this._set("filter",i)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new f}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,()=>{this._updatePriorities(),this._process()},{sync:!0,initial:!0,equals:(e,t)=>i(e,t,({id:e},{id:t})=>e===t)}),this.addHandles(n(()=>!this.suspended,()=>this._process()))}_updatePriorities(){this.store.setPriorityOrderByKey(this.tilesOfInterest.map(e=>e.id??"")??[])}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(const s of this._pendingTiles.values())s.reset();const t={...e,deletedFeatures:e.deletedFeatures.map(({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t))},i=s(async e=>{try{await this.store.processEdits(t,(e,t)=>this._queryFeaturesById(e,t),e),this._processPendingTiles()}catch(i){o(i),r.getLogger(this).warn("Failed to apply edits",i)}});this.addHandles(i),await this._updatingHandles.addPromise(i.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!F(this.url))return;const e=s(async e=>{try{const t=await T(this.url,new I({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=y.fromJSON(t.data?.extent)}catch(t){o(t),r.getLogger(this).warn("Failed to fetch data extent",t)}});this._updatingHandles.addPromise(e.promise.then(()=>this._process())),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:i}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=i,e.alive=!0):this._createPendingTile(t,i)}}_collectMissingTilesInfo(){let e=null;for(const t of this.tilesOfInterest){const i=this.store.process(t,(e,t)=>this._verifyTileComplexity(e,t),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,i)=>this._fetchFeatures(e,t,i),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<w}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const i=this.tileSize*t;return e*(C/(i*i))<q}_ensureFetchAllCounts(e){let t=!0;for(const i of this._pendingTiles.values())i.state.type<2&&this._updatingHandles.addPromise(i.process(e)),i.state.type<=1&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const i=new O(e,t);return this._pendingTiles.set(e.id,i),i}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:x,signal:t})}async _fetchFeatures(e,t,i){let s=0;const r=[];let o=0,n=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,s,n),{features:u,exceededTransferLimit:d}=await this._queryFeatures(a,i);l&&(s+=a.num),o+=u.length;for(const e of u)r.push(e);if(n=t-o,!l||!d||n<=0)return r}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,i=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let s=null;const r=e?c(e):e;if(this.store.featureStore.forEach(e=>{r===c(e.attributes[t])&&(s=e.objectId??e.attributes[i])}),null==s)throw new Error(`Expected to find a feature with globalId ${e}`);return s}_queryFeaturesById(e,t){const i=this._createFeaturesQuery();return i.objectIds=e,this._queryFeatures(i,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:i}=this,{data:s}=await P(this.url,e,new b({sourceSpatialReference:i}),{query:this._configuration.customParameters,timeout:x,signal:t});return _(s)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:i}=this,{data:s}=await v(this.url,e,i,{query:this._configuration.customParameters,timeout:x,signal:t});return g(s,{type:"object-id",fieldName:this.objectIdField})}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),i=null!=e?.data?this.store.getAttributesForTile(e?.data?.id):null,s=a(d(this.outFields,i??new Set),this._mandatoryOutFields);return t.outFields=Array.from(s),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new I({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:null!=this.tileInfo&&null!=e?m(e.data.extent,this.tileInfo.spatialReference):void 0}),i=this._configuration.filter;return null!=i&&(t.where=i.where,t.gdbVersion=i.gdbVersion,t.timeExtent=i.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,i){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:s,supportsCacheHint:r,tileMaxRecordCount:o,maxRecordCount:n,supportsResultType:a}=this.capabilities.query,l=s?I.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||r)&&o?o:n||j);return e.start=t,s?(e.maxRecordCountFactor=Math.min(l,Math.ceil(i/u)),e.num=Math.min(i,e.maxRecordCountFactor*u)):e.num=Math.min(i,u),!0}};e([h({constructOnly:!0})],S.prototype,"url",void 0),e([h({constructOnly:!0})],S.prototype,"objectIdField",void 0),e([h({constructOnly:!0})],S.prototype,"globalIdField",void 0),e([h({constructOnly:!0})],S.prototype,"capabilities",void 0),e([h({constructOnly:!0})],S.prototype,"sourceSpatialReference",void 0),e([h({constructOnly:!0})],S.prototype,"spatialReference",void 0),e([h({constructOnly:!0})],S.prototype,"store",void 0),e([h({readOnly:!0})],S.prototype,"_minimumVerticesPerFeature",null),e([h()],S.prototype,"_mandatoryOutFields",null),e([h()],S.prototype,"outFields",null),e([h()],S.prototype,"suspended",void 0),e([h()],S.prototype,"_historicMoment",void 0),e([h()],S.prototype,"filter",null),e([h()],S.prototype,"customParameters",null),e([h({readOnly:!0})],S.prototype,"_configuration",null),e([h()],S.prototype,"tileInfo",null),e([h()],S.prototype,"tileSize",null),e([h()],S.prototype,"tilesOfInterest",void 0),e([h({readOnly:!0})],S.prototype,"updating",null),e([h({readOnly:!0})],S.prototype,"availability",void 0),e([h()],S.prototype,"hasZ",null),S=e([p("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],S);const j=2e3,x=6e5,w=1e6,C=25,q=1;export{S as FeatureServiceTiledFetcher};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{equals as i}from"../../../../../core/arrayUtils.js";import{createTask as s}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Logger.js";import{throwIfAbortError as o}from"../../../../../core/promiseUtils.js";import{when as n}from"../../../../../core/reactiveUtils.js";import{union as a,equals as l,isSubsetOf as u,difference as d}from"../../../../../core/SetUtils.js";import{normalizeGlobalID as c}from"../../../../../core/uuid.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../../../../core/support/UpdatingHandles.js";import f from"../../../../../geometry/Extent.js";import{toExtent as m}from"../../../../../geometry/support/aaBoundingRect.js";import{unquantizeOptimizedFeatureSet as _,convertFromFeatureSet as g}from"../../../../../layers/graphics/featureConversionUtils.js";import{isHostedAgolService as F}from"../../../../../layers/support/arcgisLayerUrl.js";import{OptimizedFeatureSetParserContext as b}from"../../../../../rest/query/operations/pbfOptimizedFeatureSet.js";import{executeQueryForExtent as T,executeQueryPBF as P,executeQuery as v}from"../../../../../rest/query/operations/query.js";import I from"../../../../../rest/support/Query.js";import{PendingFeatureTile as O}from"./PendingFeatureTile.js";let S=class extends t{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),i=a(e,this._mandatoryOutFields);l(i,t)||(this._set("outFields",i),u(i,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),i=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(i)&&this._set("filter",i)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=new Array,this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new y}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,()=>{this._updatePriorities(),this._process()},{sync:!0,initial:!0,equals:(e,t)=>i(e,t,({id:e},{id:t})=>e===t)}),this.addHandles(n(()=>!this.suspended,()=>this._process()))}_updatePriorities(){this.store.setPriorityOrderByKey(this.tilesOfInterest.map(({id:e})=>e)??[])}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(const s of this._pendingTiles.values())s.reset();const t={...e,deletedFeatures:e.deletedFeatures.map(({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t))},i=s(async e=>{try{await this.store.processEdits(t,(e,t)=>this._queryFeaturesById(e,t),e),this._processPendingTiles()}catch(i){o(i),r.getLogger(this).warn("Failed to apply edits",i)}});this.addHandles(i),await this._updatingHandles.addPromise(i.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!F(this.url))return;const e=s(async e=>{try{const t=await T(this.url,new I({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=f.fromJSON(t.data?.extent)}catch(t){o(t),r.getLogger(this).warn("Failed to fetch data extent",t)}});this._updatingHandles.addPromise(e.promise.then(()=>this._process())),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:i}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=i,e.alive=!0):this._createPendingTile(t,i)}}_collectMissingTilesInfo(){let e=null;for(const t of this.tilesOfInterest){const i=this.store.process(t,(e,t)=>this._verifyTileComplexity(e,t),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,i)=>this._fetchFeatures(e,t,i),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.key),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<x}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const i=this.tileSize*t;return e*(C/(i*i))<q}_ensureFetchAllCounts(e){let t=!0;for(const i of this._pendingTiles.values())i.state.type<2&&this._updatingHandles.addPromise(i.process(e)),i.state.type<=1&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.key,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const i=new O(e,t);return this._pendingTiles.set(e.id,i),i}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.key.id)}async _fetchCount(e,t){return this.store.fetchCount(e.key,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:w,signal:t})}async _fetchFeatures(e,t,i){let s=0;const r=[];let o=0,n=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,s,n),{features:u,exceededTransferLimit:d}=await this._queryFeatures(a,i);l&&(s+=a.num),o+=u.length;for(const e of u)r.push(e);if(n=t-o,!l||!d||n<=0)return r}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,i=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let s=null;const r=e?c(e):e;if(this.store.featureStore.forEach(e=>{r===c(e.attributes[t])&&(s=e.objectId??e.attributes[i])}),null==s)throw new Error(`Expected to find a feature with globalId ${e}`);return s}_queryFeaturesById(e,t){const i=this._createFeaturesQuery();return i.objectIds=e,this._queryFeatures(i,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:i}=this,{data:s}=await P(this.url,e,new b({sourceSpatialReference:i}),{query:this._configuration.customParameters,timeout:w,signal:t});return _(s)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:i}=this,{data:s}=await v(this.url,e,i,{query:this._configuration.customParameters,timeout:w,signal:t});return g(s,{type:"object-id",fieldName:this.objectIdField})}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),i=null!=e?.key?this.store.getAttributesForTile(e?.key?.id):null,s=a(d(this.outFields,i??new Set),this._mandatoryOutFields);return t.outFields=Array.from(s),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new I({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:null!=this.tileInfo&&null!=e?m(e.key.extent,this.tileInfo.spatialReference):void 0}),i=this._configuration.filter;return null!=i&&(t.where=i.where,t.gdbVersion=i.gdbVersion,t.timeExtent=i.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,i){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:s,supportsCacheHint:r,tileMaxRecordCount:o,maxRecordCount:n,supportsResultType:a}=this.capabilities.query,l=s?I.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||r)&&o?o:n||j);return e.start=t,s?(e.maxRecordCountFactor=Math.min(l,Math.ceil(i/u)),e.num=Math.min(i,e.maxRecordCountFactor*u)):e.num=Math.min(i,u),!0}};e([h({constructOnly:!0})],S.prototype,"url",void 0),e([h({constructOnly:!0})],S.prototype,"objectIdField",void 0),e([h({constructOnly:!0})],S.prototype,"globalIdField",void 0),e([h({constructOnly:!0})],S.prototype,"capabilities",void 0),e([h({constructOnly:!0})],S.prototype,"sourceSpatialReference",void 0),e([h({constructOnly:!0})],S.prototype,"spatialReference",void 0),e([h({constructOnly:!0})],S.prototype,"store",void 0),e([h({readOnly:!0})],S.prototype,"_minimumVerticesPerFeature",null),e([h()],S.prototype,"_mandatoryOutFields",null),e([h()],S.prototype,"outFields",null),e([h()],S.prototype,"suspended",void 0),e([h()],S.prototype,"_historicMoment",void 0),e([h()],S.prototype,"filter",null),e([h()],S.prototype,"customParameters",null),e([h({readOnly:!0})],S.prototype,"_configuration",null),e([h()],S.prototype,"tileInfo",null),e([h()],S.prototype,"tileSize",null),e([h()],S.prototype,"tilesOfInterest",void 0),e([h({readOnly:!0})],S.prototype,"updating",null),e([h({readOnly:!0})],S.prototype,"availability",void 0),e([h()],S.prototype,"hasZ",null),S=e([p("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],S);const j=2e3,w=6e5,x=1e6,C=25,q=1;export{S as FeatureServiceTiledFetcher};
@@ -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{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../../../geometry/Point.js";import{fromValues as i}from"../../../../../geometry/support/aaBoundingRect.js";import p from"../../../../../layers/support/LOD.js";import l from"../../../../../layers/support/TileInfo.js";import{TileKey as n}from"../../../../../layers/support/TileKey.js";let a=class extends r{get tiles(){return[new n("0/0/0",0,0,0,i(-1e8,-1e8,1e8,1e8))]}get tileInfo(){return new l({origin:new s({x:-1e8,y:1e8,spatialReference:this.layer.spatialReference}),size:[512,512],lods:[new p({level:0,scale:1,resolution:390625})],spatialReference:this.layer.spatialReference})}get tileSize(){return this.tileInfo.size[0]}constructor(e){super(e),this.pointOfInterest=null}};e([t({readOnly:!0})],a.prototype,"tiles",null),e([t({readOnly:!0})],a.prototype,"tileInfo",null),e([t({readOnly:!0})],a.prototype,"tileSize",null),e([t({constructOnly:!0})],a.prototype,"layer",void 0),e([t()],a.prototype,"pointOfInterest",void 0),a=e([o("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTilesSimple")],a);export{a as FeatureServiceTilesSimple};
5
+ import{__decorate as e}from"tslib";import r from"../../../../../core/Accessor.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../../../geometry/Point.js";import{fromValues as i}from"../../../../../geometry/support/aaBoundingRect.js";import p from"../../../../../layers/support/LOD.js";import l from"../../../../../layers/support/TileInfo.js";import{TileKey as n}from"../../../../../layers/support/TileKey.js";let a=class extends r{get tiles(){return[new n(0,0,0,i(-1e8,-1e8,1e8,1e8))]}get tileInfo(){return new l({origin:new s({x:-1e8,y:1e8,spatialReference:this.layer.spatialReference}),size:[512,512],lods:[new p({level:0,scale:1,resolution:390625})],spatialReference:this.layer.spatialReference})}get tileSize(){return this.tileInfo.size[0]}constructor(e){super(e),this.pointOfInterest=null}};e([t({readOnly:!0})],a.prototype,"tiles",null),e([t({readOnly:!0})],a.prototype,"tileInfo",null),e([t({readOnly:!0})],a.prototype,"tileSize",null),e([t({constructOnly:!0})],a.prototype,"layer",void 0),e([t()],a.prototype,"pointOfInterest",void 0),a=e([o("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTilesSimple")],a);export{a as FeatureServiceTilesSimple};
@@ -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{createTask as t,resultOrAbort as e}from"../../../../../core/asyncUtils.js";import{fromExtent as s,create as a,intersects as r}from"../../../../../geometry/support/aaBoundingRect.js";class u{constructor(t,e){this.data=t,this.resolution=e,this.state={type:0},this.alive=!0}process(t){switch(this.state.type){case 0:return this.state=this._gotoFetchCount(this.state,t),this.state.task.promise.then(t.resume,t.resume);case 1:case 3:break;case 2:return this.state=this._gotoFetchFeatures(this.state,t),this.state.task.promise.then(t.resume,t.resume);case 4:this.state=this._goToDone(this.state,t)}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case 0:case 1:return 0;case 2:return this.state.featureCount;case 3:return this.state.previous.featureCount;case 4:return this.state.features.length;case 5:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case 0:return"created";case 1:return"fetch-count";case 2:return"fetched-count";case 3:return"fetch-features";case 4:return"fetched-features";case 5:return"done"}}_gotoFetchCount(s,a){return{type:1,previous:s,task:t(async t=>{const s=await e(a.fetchCount(this,t));1===this.state.type&&(this.state=i(this.state,s.ok?s.value:1/0))})}}_gotoFetchFeatures(s,a){return{type:3,previous:s,task:t(async t=>{const r=await e(a.fetchFeatures(this,s.featureCount,t));3===this.state.type&&(this.state=n(this.state,r.ok?r.value:[]))})}}_goToDone(t,e){return e.finish(this,t.features),{type:5,previous:t}}reset(){const t=this.state;switch(this.state={type:0},t.type){case 0:case 2:case 4:case 5:break;case 1:case 3:t.task.abort()}}intersects(t){return null==t||!this.data.extent||(s(t,o),r(this.data.extent,o))}}function i(t,e){return{type:2,featureCount:e,previous:t}}function n(t,e){return{type:4,previous:t,features:e}}const o=a();export{u as PendingFeatureTile};
5
+ import{createTask as t,resultOrAbort as e}from"../../../../../core/asyncUtils.js";class s{constructor(t,e){this.key=t,this.resolution=e,this.state={type:0},this.alive=!0}process(t){switch(this.state.type){case 0:return this.state=this._gotoFetchCount(this.state,t),this.state.task.promise.then(t.resume,t.resume);case 1:case 3:break;case 2:return this.state=this._gotoFetchFeatures(this.state,t),this.state.task.promise.then(t.resume,t.resume);case 4:this.state=this._goToDone(this.state,t)}return null}get debugInfo(){return{key:this.key,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case 0:case 1:return 0;case 2:return this.state.featureCount;case 3:return this.state.previous.featureCount;case 4:return this.state.features.length;case 5:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case 0:return"created";case 1:return"fetch-count";case 2:return"fetched-count";case 3:return"fetch-features";case 4:return"fetched-features";case 5:return"done"}}_gotoFetchCount(s,r){return{type:1,previous:s,task:t(async t=>{const s=await e(r.fetchCount(this,t));1===this.state.type&&(this.state=a(this.state,s.ok?s.value:1/0))})}}_gotoFetchFeatures(s,a){return{type:3,previous:s,task:t(async t=>{const u=await e(a.fetchFeatures(this,s.featureCount,t));3===this.state.type&&(this.state=r(this.state,u.ok?u.value:[]))})}}_goToDone(t,e){return e.finish(this,t.features),{type:5,previous:t}}reset(){const t=this.state;switch(this.state={type:0},t.type){case 0:case 2:case 4:case 5:break;case 1:case 3:t.task.abort()}}}function a(t,e){return{type:2,featureCount:e,previous:t}}function r(t,e){return{type:4,previous:t,features:e}}export{s as PendingFeatureTile};