@arcgis/core 4.34.0-next.65 → 4.34.0-next.67

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 (367) hide show
  1. package/Graphic.js +1 -1
  2. package/WebDocument2D.js +1 -1
  3. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/0814676e4bac81f96140.js +1 -0
  6. package/assets/esri/core/workers/chunks/{6ab435423acb0ed0b1c7.js → 09dbb3e200ef8d514eb3.js} +2 -2
  7. package/assets/esri/core/workers/chunks/0b71100fa1e7ca706dbb.js +1 -0
  8. package/assets/esri/core/workers/chunks/0c4f07eb3f3dd5cd2c6c.js +1 -0
  9. package/assets/esri/core/workers/chunks/{3167230555c63f943485.js → 0cbd5335cc92f5891bcf.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{79933271a76a1756584f.js → 12d30c2367652e2c688b.js} +1 -1
  11. package/assets/esri/core/workers/chunks/144bfd64daf103a06734.js +1 -0
  12. package/assets/esri/core/workers/chunks/{0b53bc76d38e85902748.js → 170ec7fb070c63230c81.js} +1 -1
  13. package/assets/esri/core/workers/chunks/18c7b1e1fbf7eb6c3c33.js +1 -0
  14. package/assets/esri/core/workers/chunks/1ada9e6cdd6792e3847a.js +1 -0
  15. package/assets/esri/core/workers/chunks/1e86df439c564fe752e3.js +1 -0
  16. package/assets/esri/core/workers/chunks/{4459c8e495a37d4c4eb8.js → 25118304c9a914194e90.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{426232091caf8608e5f1.js → 26b791291689434dde09.js} +1 -1
  18. package/assets/esri/core/workers/chunks/3212a476184be25d17f8.js +1 -0
  19. package/assets/esri/core/workers/chunks/{d823277612f971a9c2f0.js → 3245663da75e168bf85c.js} +1 -1
  20. package/assets/esri/core/workers/chunks/37d7c249114994a7dfac.js +1 -0
  21. package/assets/esri/core/workers/chunks/{e72aee3f857aa473822c.js → 39d69afc9da9db0c75ab.js} +1 -1
  22. package/assets/esri/core/workers/chunks/4102ed32b8dbdc32cb3b.js +1 -0
  23. package/assets/esri/core/workers/chunks/{7c3a1958990de095d3a1.js → 48316d91c06928f69f61.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{dbcef57073075e9cfdfe.js → 489fa17e60f25d5f33ae.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{19e5e011f929b6b940fe.js → 4bc091770bab38874848.js} +1 -1
  26. package/assets/esri/core/workers/chunks/4f0f6653b8e92c633d14.js +1 -0
  27. package/assets/esri/core/workers/chunks/{09f0c9f0b6aa58ae3c52.js → 4f22e5a7f81883e8e5b6.js} +1 -1
  28. package/assets/esri/core/workers/chunks/5185c63fecc5f493e142.js +1 -0
  29. package/assets/esri/core/workers/chunks/{6fff219dfaa86167c326.js → 5303d77a3ab1b7ddeef3.js} +1 -1
  30. package/assets/esri/core/workers/chunks/548818df658b607a364e.js +1 -0
  31. package/assets/esri/core/workers/chunks/{22ec2b0a853911692dc8.js → 5993427325d1add18ed9.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{657b01a6df8dc46c5209.js → 5b84eba4a28e25b6d5c0.js} +1 -1
  33. package/assets/esri/core/workers/chunks/5c053d197935c65792ce.js +1 -0
  34. package/assets/esri/core/workers/chunks/{497214e9e82b936fc94e.js → 5ed381a268855bcad072.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{33718ea851645d9078d1.js → 605acf18cbeb89e4f29f.js} +1 -1
  36. package/assets/esri/core/workers/chunks/66cb5b294d7f251c2cc8.js +1 -0
  37. package/assets/esri/core/workers/chunks/6a5b5b80917a5375b9f6.js +1 -0
  38. package/assets/esri/core/workers/chunks/{4d7fcec769369c576847.js → 6e59ba2afd444eb4be18.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{a700f57af6856cb5313c.js → 70dc7ec6474f0801bc04.js} +1 -1
  40. package/assets/esri/core/workers/chunks/7e95896ac41c7e2ca26a.js +1 -0
  41. package/assets/esri/core/workers/chunks/80b0c88a76bd523a406a.js +1 -0
  42. package/assets/esri/core/workers/chunks/{5d12862042b6bf9f9d54.js → 82cb5defb0593e3017ff.js} +1 -1
  43. package/assets/esri/core/workers/chunks/837830e1cf712d4243a5.js +1 -0
  44. package/assets/esri/core/workers/chunks/87fb5d755860057da164.js +1 -0
  45. package/assets/esri/core/workers/chunks/{a29fb90226bd08157bd1.js → 8a104b35708a492bd614.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{5cb238318a24b70d5ac3.js → 8bc8caa384b24af12411.js} +1 -1
  47. package/assets/esri/core/workers/chunks/8e2558b14be70b273ce4.js +1 -0
  48. package/assets/esri/core/workers/chunks/{8e40c409a9b0a2a768a9.js → 8f02349602b072186a1f.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{fa0f94318173db2034de.js → 90491262b6d6a126c32f.js} +1 -1
  50. package/assets/esri/core/workers/chunks/99f133a152afb4f1b067.js +1 -0
  51. package/assets/esri/core/workers/chunks/9eb1bfcb9b05f2a36748.js +1 -0
  52. package/assets/esri/core/workers/chunks/{0a36df6fdab95785d1ce.js → a2963ffc9a8c90822d2d.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{8e3c09c3524654830b14.js → a634764dec5404f4a1d7.js} +1 -1
  54. package/assets/esri/core/workers/chunks/a895da7fd64ebad3d5a4.js +1 -0
  55. package/assets/esri/core/workers/chunks/aa970a547c60c43d6c7f.js +1 -0
  56. package/assets/esri/core/workers/chunks/ab727ed4417b7dd94ce9.js +1 -0
  57. package/assets/esri/core/workers/chunks/{d1e8220dcae1d01d3c35.js → ad3ebd4f05cc673140f3.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{9f93513037a6e87433c4.js → adfb018f510e19a520fb.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{a1bd4eecca1e3272bffb.js → aff553c3d6544e20f188.js} +1 -1
  60. package/assets/esri/core/workers/chunks/b052d3ef5493eedb44a5.js +1 -0
  61. package/assets/esri/core/workers/chunks/b335e96f6bcac6d2f0ee.js +1 -0
  62. package/assets/esri/core/workers/chunks/b482132638f3b351724c.js +1 -0
  63. package/assets/esri/core/workers/chunks/{e1b25b1ce3bd4f0f2cda.js → bc5fa33afec5354601a1.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{dd1d9913b33d4e48baff.js → c35dad3d5ceaac6ad5a4.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{e1b573840ec1f7c3afd3.js → c4b2678dd46fa1e22f7e.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{bc931865a77fc48871d3.js → c94c797864a85342b105.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{e97250ae8da4bd0d6bc9.js → cad03967e132a28512c2.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{904c116c6b093e0e970c.js → d1b361b8adf1c719a10a.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{c7a386ac90e58eb71935.js → da1a5537e2f2ca6cc247.js} +1 -1
  70. package/assets/esri/core/workers/chunks/dd447dfc50ee7f511b84.js +1 -0
  71. package/assets/esri/core/workers/chunks/e0fe6bb51ecc9b2faf69.js +1 -0
  72. package/assets/esri/core/workers/chunks/{0f9813e7d4e2b47b2c39.js → e47acdb1fbf797342716.js} +1 -1
  73. package/assets/esri/core/workers/chunks/e4e224983c3ee24fc51d.js +1 -0
  74. package/assets/esri/core/workers/chunks/{a16b471c3706ee37f9b6.js → e6f2ac738df16fb5e13a.js} +1 -1
  75. package/assets/esri/core/workers/chunks/ed1272e7681e561d843f.js +1 -0
  76. package/assets/esri/core/workers/chunks/ee391a41144855fc625d.js +1 -0
  77. package/assets/esri/core/workers/chunks/efea3e82cec476d486e0.js +1 -0
  78. package/assets/esri/core/workers/chunks/f054557e23978e174686.js +1 -0
  79. package/assets/esri/core/workers/chunks/{ff2614d96ca5228e9685.js → f4d4c1f13522f20b00d1.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{897f9775f06ddbf6486f.js → f9385d7fb5ff20f7b252.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{b30de4936caa654d7817.js → fac020b6886ff2d75015.js} +1 -1
  82. package/assets/esri/core/workers/chunks/fe353a53968827bcd9cc.js +1 -0
  83. package/chunks/GlowComposition.glsl.js +3 -3
  84. package/chunks/RibbonLine.glsl.js +2 -2
  85. package/config.js +1 -1
  86. package/core/AsyncUpdate.js +1 -1
  87. package/core/mapCollectionUtils.js +1 -1
  88. package/editing/sharedTemplates/executor/builders/pointAtPolygonCentroid.js +1 -1
  89. package/geometry/Polygon.js +1 -1
  90. package/geometry/support/centroid.js +1 -1
  91. package/geometry/support/geometryUtils.js +1 -1
  92. package/graphic/AggregateGraphicOrigin.js +1 -1
  93. package/graphic/BuildingGraphicOrigin.js +1 -1
  94. package/graphic/CSVGraphicOrigin.js +1 -1
  95. package/graphic/CatalogGraphicOrigin.js +1 -1
  96. package/graphic/FeatureGraphicOrigin.js +1 -1
  97. package/graphic/GeoJSONGraphicOrigin.js +1 -1
  98. package/graphic/GeoRSSGraphicOrigin.js +1 -1
  99. package/graphic/ImageryGraphicOrigin.js +1 -1
  100. package/graphic/ImageryTileGraphicOrigin.js +1 -1
  101. package/graphic/KMLGraphicOrigin.js +1 -1
  102. package/graphic/KnowledgeGraphGraphicOrigin.js +1 -1
  103. package/graphic/LinkChartGraphicOrigin.js +1 -1
  104. package/graphic/MapImageGraphicOrigin.js +1 -1
  105. package/graphic/MapNotesGraphicOrigin.js +1 -1
  106. package/graphic/OGCFeatureGraphicOrigin.js +1 -1
  107. package/graphic/OrientedImageryGraphicOrigin.js +1 -1
  108. package/graphic/ParquetGraphicOrigin.js +1 -1
  109. package/graphic/PointCloudGraphicOrigin.js +1 -1
  110. package/graphic/SceneGraphicOrigin.js +1 -1
  111. package/graphic/StreamGraphicOrigin.js +1 -1
  112. package/graphic/SubtypeGroupGraphicOrigin.js +1 -1
  113. package/graphic/TileGraphicOrigin.js +1 -1
  114. package/graphic/TrackGraphicOrigin.js +1 -1
  115. package/graphic/VectorTileGraphicOrigin.js +1 -1
  116. package/graphic/VoxelGraphicOrigin.js +1 -1
  117. package/graphic/WCSGraphicOrigin.js +1 -1
  118. package/graphic/WFSGraphicOrigin.js +1 -1
  119. package/graphic/getIdFieldsProvider.js +5 -0
  120. package/graphic/getSliceableContainer.js +5 -0
  121. package/graphic/graphicOrigins.d.ts +0 -2
  122. package/graphic/graphicOrigins.js +1 -1
  123. package/interfaces.d.ts +172 -244
  124. package/kernel.js +1 -1
  125. package/layers/GaussianSplatLayer.js +1 -1
  126. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  127. package/layers/IntegratedMeshLayer.js +1 -1
  128. package/layers/Layer.js +1 -1
  129. package/layers/LinkChartLayer.js +1 -1
  130. package/layers/MapImageLayer.js +1 -1
  131. package/layers/OrientedImageryLayer.js +1 -1
  132. package/layers/VoxelLayer.js +1 -1
  133. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  134. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  135. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  136. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  137. package/layers/mixins/ArcGISImageService.js +1 -1
  138. package/layers/mixins/ImageryTileMixin.js +1 -1
  139. package/layers/mixins/OperationalLayer.js +1 -1
  140. package/layers/mixins/TemporalLayer.js +1 -1
  141. package/layers/mixins/TemporalSceneLayer.js +1 -1
  142. package/layers/mixins/operationalLayers.js +1 -1
  143. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  144. package/layers/support/FeatureFilter.js +1 -1
  145. package/layers/support/TimeInfo.js +1 -1
  146. package/layers/support/TrackInfo.js +1 -1
  147. package/layers/support/layersCreator.js +1 -1
  148. package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
  149. package/package.json +2 -2
  150. package/portal/schemas/definitions.js +1 -1
  151. package/portal/support/portalLayers.js +1 -1
  152. package/rest/support/AttributeBinsQuery.js +1 -1
  153. package/rest/support/IdentifyParameters.js +1 -1
  154. package/rest/support/ImageGPSInfoParameters.js +1 -1
  155. package/rest/support/ImageHistogramParameters.js +1 -1
  156. package/rest/support/ImageIdentifyParameters.js +1 -1
  157. package/rest/support/ImageParameters.js +1 -1
  158. package/rest/support/ImageSampleParameters.js +1 -1
  159. package/rest/support/Query.js +1 -1
  160. package/rest/support/TopFeaturesQuery.js +1 -1
  161. package/smartMapping/support/adapters/FeatureLayerBinningAdapter.js +1 -1
  162. package/support/revision.js +1 -1
  163. package/support/timeUtils.js +1 -1
  164. package/symbols/support/previewCIMSymbol.js +1 -1
  165. package/symbols/support/previewSymbol2D.js +1 -1
  166. package/symbols/support/renderUtils.js +1 -1
  167. package/symbols/support/svgUtils.js +1 -1
  168. package/symbols/support/symbolUtils.js +1 -1
  169. package/symbols/support/utils.js +1 -1
  170. package/time/TimeExtent.js +1 -1
  171. package/time/TimeInterval.js +1 -1
  172. package/views/2d/analysis/ElevationProfile/ElevationProfileInputVisualization2D.js +5 -0
  173. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +5 -0
  174. package/views/2d/analysis/ElevationProfile/ElevationProfileVisualization2D.js +5 -0
  175. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  176. package/views/2d/engine/webgl/Painter.js +1 -1
  177. package/views/2d/engine/webgl/effects/FeatureEffect.js +1 -1
  178. package/views/2d/engine/webgl/effects/post-processing/EffectManager.js +1 -1
  179. package/views/2d/engine/webgl/shaderGraph/techniques/TestTechnique.js +1 -1
  180. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  181. package/views/2d/engine/webgl/shaderGraph/techniques/bloom/BloomTechnique.js +5 -0
  182. package/views/2d/engine/webgl/shaderGraph/techniques/blur/BlurTechnique.js +5 -0
  183. package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +5 -0
  184. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  185. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +5 -0
  186. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
  187. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
  188. package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillTechnique.js +1 -1
  189. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
  190. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
  191. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
  192. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
  193. package/views/2d/engine/webgl/shaderGraph/techniques/grid/GridTechnique.js +1 -1
  194. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  195. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  196. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  197. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique.js +1 -1
  198. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
  199. package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
  200. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
  201. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
  202. package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +5 -0
  203. package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
  204. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
  205. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlitShader.js +5 -0
  206. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js +5 -0
  207. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlurShader.js +5 -0
  208. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js +5 -0
  209. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js +5 -0
  210. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PostProcessingShader.js +5 -0
  211. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
  212. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
  213. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  214. package/views/2d/layers/MediaLayerView2D.js +1 -1
  215. package/views/2d/layers/TileLayerView2D.js +1 -1
  216. package/views/2d/layers/features/FeatureContainer.js +1 -1
  217. package/views/2d/layers/features/RenderState.js +1 -1
  218. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  219. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization3D.js +5 -0
  220. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +5 -0
  221. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +5 -0
  222. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  223. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  224. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  225. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  226. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  227. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +5 -0
  228. package/views/3d/analysis/VolumeMeasurement/volumeMeasurementGeometryUtils.js +5 -0
  229. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  230. package/views/3d/environment/Fog.js +1 -1
  231. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  232. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  233. package/views/3d/layers/I3SMeshView3D.js +1 -1
  234. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  235. package/views/3d/layers/SceneLayerView3D.js +1 -1
  236. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  237. package/views/3d/layers/graphics/QueryEngine.js +1 -1
  238. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  239. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  240. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  241. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
  242. package/views/3d/layers/i3s/Intersector.js +1 -1
  243. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  244. package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
  245. package/views/3d/layers/support/SublayerPopupHighlightHelper3D.js +1 -1
  246. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  247. package/views/3d/support/hitTest.js +1 -1
  248. package/views/3d/support/viewpointUtils.js +1 -1
  249. package/views/3d/terrain/Intersector.js +1 -1
  250. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  251. package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
  252. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +4 -4
  253. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColor.glsl.js +5 -0
  254. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  255. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
  256. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.glsl.js +5 -0
  257. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  258. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +1 -1
  259. package/views/3d/webgl-engine/effects/focusArea/FocusAreaOutlineItem.js +1 -1
  260. package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
  261. package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +1 -1
  262. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  263. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  264. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  265. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  266. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  267. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  268. package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
  269. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  270. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +5 -0
  271. package/views/VideoView.js +1 -1
  272. package/views/View.js +1 -1
  273. package/views/View2D.js +1 -1
  274. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  275. package/views/analysis/ElevationProfile/ElevationProfileGenerationError.js +1 -1
  276. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +5 -0
  277. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +5 -0
  278. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  279. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  280. package/views/analysis/ElevationProfile/constants.js +1 -1
  281. package/views/analysis/ElevationProfile/elevationProfileInputVisualizationUtils.js +5 -0
  282. package/views/draw/support/createUtils.js +1 -1
  283. package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
  284. package/webdoc/support/timeProperties.js +1 -1
  285. package/webdoc/widgets/TimeSlider.js +1 -1
  286. package/webmap/InitialViewProperties.js +1 -1
  287. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  288. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  289. package/widgets/Legend/styles/card/CardView.js +1 -1
  290. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  291. package/widgets/Legend/styles/card/LegendElement.js +1 -1
  292. package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
  293. package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
  294. package/widgets/Legend/styles/classic/ClassicView.js +1 -1
  295. package/widgets/Legend/styles/classic/LegendElement.js +1 -1
  296. package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
  297. package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
  298. package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
  299. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  300. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  301. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  302. package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
  303. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  304. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  305. package/widgets/TimeSlider.js +1 -1
  306. package/widgets/UtilityNetworkTrace/support/GraphicHandler.js +1 -1
  307. package/TimeExtent.d.ts +0 -4
  308. package/TimeExtent.js +0 -5
  309. package/TimeInterval.d.ts +0 -4
  310. package/TimeInterval.js +0 -5
  311. package/assets/esri/core/workers/chunks/0264905da9fa56166538.js +0 -1
  312. package/assets/esri/core/workers/chunks/070b29cba896f46537f9.js +0 -1
  313. package/assets/esri/core/workers/chunks/0b01c87db77246632ad9.js +0 -1
  314. package/assets/esri/core/workers/chunks/0cb2f7172190babb4139.js +0 -1
  315. package/assets/esri/core/workers/chunks/0cdf6b51f2a63f348530.js +0 -1
  316. package/assets/esri/core/workers/chunks/0d82cc6905b105b3568a.js +0 -1
  317. package/assets/esri/core/workers/chunks/0e28cb5d8d89ae29cdd0.js +0 -1
  318. package/assets/esri/core/workers/chunks/1143313f2f6f34deaad7.js +0 -1
  319. package/assets/esri/core/workers/chunks/14c6461ffd36319e1d74.js +0 -1
  320. package/assets/esri/core/workers/chunks/2394ac65d64e50399d76.js +0 -1
  321. package/assets/esri/core/workers/chunks/47febd4de836a33b51b1.js +0 -1
  322. package/assets/esri/core/workers/chunks/487afbf352d12c745430.js +0 -1
  323. package/assets/esri/core/workers/chunks/56b4dcd04c844eaacd60.js +0 -1
  324. package/assets/esri/core/workers/chunks/5d65987f2c1b5c56a799.js +0 -1
  325. package/assets/esri/core/workers/chunks/77e27f318b5863dd0f5c.js +0 -1
  326. package/assets/esri/core/workers/chunks/7b7f5028a488bb9c10f4.js +0 -1
  327. package/assets/esri/core/workers/chunks/808cfed7022e3846d5b2.js +0 -1
  328. package/assets/esri/core/workers/chunks/8bd5a0ff7dcf1067bf53.js +0 -1
  329. package/assets/esri/core/workers/chunks/99b20eef2893047fac10.js +0 -1
  330. package/assets/esri/core/workers/chunks/9f4e23bae621ff3ecea3.js +0 -1
  331. package/assets/esri/core/workers/chunks/a596d6ccb6103e594031.js +0 -1
  332. package/assets/esri/core/workers/chunks/a5e6359fadbd699b1c8e.js +0 -1
  333. package/assets/esri/core/workers/chunks/a7f3cdd9a249ef4572ce.js +0 -1
  334. package/assets/esri/core/workers/chunks/a80d769b0ed025f0df64.js +0 -1
  335. package/assets/esri/core/workers/chunks/af83dddddbfe25194527.js +0 -1
  336. package/assets/esri/core/workers/chunks/b057e6d593c1607cae61.js +0 -1
  337. package/assets/esri/core/workers/chunks/b1f1a26e7a2ef5b783ee.js +0 -1
  338. package/assets/esri/core/workers/chunks/b605dfdfed8ff8eda4f3.js +0 -1
  339. package/assets/esri/core/workers/chunks/c337c1a2dbc452780dd7.js +0 -1
  340. package/assets/esri/core/workers/chunks/c601bbdafdee5074b04f.js +0 -1
  341. package/assets/esri/core/workers/chunks/c696615cae5daefa2d98.js +0 -1
  342. package/assets/esri/core/workers/chunks/c8694a27e2cf28b010e8.js +0 -1
  343. package/assets/esri/core/workers/chunks/e6457ac25c0829ee039c.js +0 -1
  344. package/assets/esri/core/workers/chunks/eadac757f74470b89a36.js +0 -1
  345. package/assets/esri/core/workers/chunks/f4167fc895d4009df1c7.js +0 -1
  346. package/assets/esri/core/workers/chunks/f76774781865cb1411b0.js +0 -1
  347. package/assets/esri/core/workers/chunks/fd04df45cdcc6ff52554.js +0 -1
  348. package/chunks/TimeExtent.js +0 -5
  349. package/chunks/TimeInterval.js +0 -5
  350. package/graphic/IntegratedMesh3DTilesGraphicOrigin.d.ts +0 -4
  351. package/graphic/IntegratedMesh3DTilesGraphicOrigin.js +0 -5
  352. package/graphic/IntegratedMeshGraphicOrigin.d.ts +0 -4
  353. package/graphic/IntegratedMeshGraphicOrigin.js +0 -5
  354. package/graphic/isIntegratedMesh3DTilesGraphicOrigin.js +0 -5
  355. package/graphic/isIntegratedMeshGraphicOrigin.js +0 -5
  356. package/views/2d/engine/webgl/effects/post-processing/Bloom.js +0 -5
  357. package/views/2d/engine/webgl/effects/post-processing/Blur.js +0 -5
  358. package/views/2d/engine/webgl/effects/post-processing/Colorize.js +0 -5
  359. package/views/2d/engine/webgl/effects/post-processing/DropShadow.js +0 -5
  360. package/views/2d/engine/webgl/effects/post-processing/Opacity.js +0 -5
  361. package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +0 -5
  362. package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +0 -5
  363. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization.js +0 -5
  364. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization.js +0 -5
  365. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization.js +0 -5
  366. package/views/3d/webgl-engine/shaders/FocusAreaColor.glsl.js +0 -5
  367. package/views/3d/webgl-engine/shaders/FocusAreaMask.glsl.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{getMetersPerUnitForSR as t}from"../../../../core/unitUtils.js";import{rotateZ as e,rotateX as r,rotateY as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ONES as o,fromArray as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as l,s as u}from"../../../../chunks/vec42.js";import{clone as a,ONES as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectPoint as m}from"../../../../geometry/projectionUtils.js";import{width as p,depth as f,height as h}from"../../../../geometry/support/aaBoundingBox.js";import{create as y}from"../../../../geometry/support/aaBoundingRect.js";import{ringsCentroid as x}from"../../../../geometry/support/centroid.js";import{getPointOnPath as g,getPathLength as d}from"../../../../geometry/support/coordsUtils.js";import{vertexSpaceOriginToPoint as j}from"../../../../geometry/support/meshVertexSpaceUtils.js";import{makeDehydratedPoint as v}from"../../../../layers/graphics/dehydratedPoint.js";import{isHydratedGeometry as z,clonePoint as b}from"../../../../layers/graphics/hydratedFeatures.js";function w(t,e){if("point"===t.type)return F(t,e,!1);if(z(t))switch(t.type){case"extent":return F(t.center,e,!1);case"polygon":return F(t.centroid,e,!1);case"polyline":return F(M(t),e,!0);case"mesh":return F(j(t.vertexSpace,t.spatialReference)??t.extent.center,e,!1);case"multipoint":return}else switch(t.type){case"extent":return F(R(t),e,!0);case"polygon":return F(P(t),e,!0);case"polyline":return F(M(t),e,!0);case"multipoint":return}}function M(t){const e=t.paths[0];if(!e||0===e.length)return null;const r=g(e,d(e)/2);return v(r[0],r[1],r[2],t.spatialReference)}function R(t){return v(.5*(t.xmax+t.xmin),.5*(t.ymax+t.ymin),null!=t.zmin&&null!=t.zmax&&isFinite(t.zmin)&&isFinite(t.zmax)?.5*(t.zmax+t.zmin):void 0,t.spatialReference)}function P(t){const e=t.rings[0];if(!e||0===e.length)return null;const r=x(t.rings,!!t.hasZ);return v(r[0],r[1],r[2],t.spatialReference)}function F(t,e,r){const n=r?t:b(t);return e&&t?m(t,n,e)?n:null:n}function S(t){if(!t)return 0;switch(t.type){case"point":return t.z;case"extent":return t.zmax;case"polygon":return t.hasZ?t.rings.reduce((t,e)=>e.reduce((t,e)=>Math.max(t,e[2]),t),-1/0):void 0;case"polyline":return t.hasZ?t.paths.reduce((t,e)=>e.reduce((t,e)=>Math.max(t,e[2]),t),-1/0):void 0;case"mesh":return t.extent.zmax;case"multipoint":return}}function U(t,e,r,n=0){if(t){e||(e=y());const i=t;let o=.5*i.width*(r-1),s=.5*i.height*(r-1);return i.width<1e-7*i.height?o+=s/20:i.height<1e-7*i.width&&(s+=o/20),u(e,i.xmin-o-n,i.ymin-s-n,i.xmax+o+n,i.ymax+s+n),e}return null}function A(t,e,r=null){const n=a(c);return null!=t&&(n[0]=t[0],n[1]=t[1],n[2]=t[2],t.length>3&&(n[3]=t[3])),null!=e&&(n[3]=e),r&&l(n,n,r),n}function B(t,e,r,n,i,o){for(let s=0;s<3;++s)o[s]=null!=t?.[s]?t[s]:null!=r?.[s]?r[s]:i[s];return o[3]=null!=e?e:null!=n?n:i[3],o}function D(t=o,e,r,n=1){const i=new Array(3);if(null==e||null==r)i[0]=1,i[1]=1,i[2]=1;else{let n,o=0;for(let s=2;s>=0;s--){const l=t[s],u=null!=l,a=0===s&&!n&&!u,c=r[s];let m;"symbol-value"===l||a?m=0!==c?e[s]/c:1:u&&"proportional"!==l&&isFinite(l)&&(m=0!==c?l/c:1),null!=m&&(i[s]=m,n=m,o=Math.max(o,Math.abs(m)))}for(let t=2;t>=0;t--)null==i[t]?i[t]=n:0===i[t]&&(i[t]=.001*o)}for(let o=2;o>=0;o--)i[o]/=n;return s(i)}function I(t){return null!=t.isPrimitive}function Z(t){return k(I(t)?[t.width,t.depth,t.height]:t)?null:"Symbol sizes may not be negative values"}function k(t){const e=t=>null==t||t>=0;return Array.isArray(t)?t.every(e):e(t)}function E(t,o,s,l=i()){return t&&e(l,l,-t/180*Math.PI),o&&r(l,l,o/180*Math.PI),s&&n(l,l,s/180*Math.PI),l}function G(e,r,n){if(null!=n.minDemResolution)return n.minDemResolution;const i=t(r),o=p(e)*i,s=f(e)*i,l=h(e)*(r.isGeographic?1:i);return 0===o&&0===s&&0===l?n.minDemResolutionForPoints:.01*Math.max(o,s,l)}export{w as computeCentroid,S as computeMaxZ,E as computeObjectRotation,D as computeObjectScale,G as demResolutionForBoundingBox,U as enlargeExtent,k as isValidSize,A as mixinColorAndOpacity,B as overrideColor,Z as validateSymbolLayerSize};
5
+ import{getMetersPerUnitForSR as t}from"../../../../core/unitUtils.js";import{rotateZ as e,rotateX as r,rotateY as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ONES as o,fromArray as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as l,s as u}from"../../../../chunks/vec42.js";import{clone as a,ONES as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectPoint as m}from"../../../../geometry/projectionUtils.js";import{width as p,depth as f,height as h}from"../../../../geometry/support/aaBoundingBox.js";import{create as y}from"../../../../geometry/support/aaBoundingRect.js";import{ringsCentroid as x}from"../../../../geometry/support/centroid.js";import{getPointOnPath as g,getPathLength as d}from"../../../../geometry/support/coordsUtils.js";import{vertexSpaceOriginToPoint as j}from"../../../../geometry/support/meshVertexSpaceUtils.js";import{makeDehydratedPoint as v}from"../../../../layers/graphics/dehydratedPoint.js";import{isHydratedGeometry as z,clonePoint as b}from"../../../../layers/graphics/hydratedFeatures.js";function w(t,e){if("point"===t.type)return F(t,e,!1);if(z(t))switch(t.type){case"extent":return F(t.center,e,!1);case"polygon":return F(P(t),e,!1);case"polyline":return F(M(t),e,!0);case"mesh":return F(j(t.vertexSpace,t.spatialReference)??t.extent.center,e,!1);case"multipoint":return}else switch(t.type){case"extent":return F(R(t),e,!0);case"polygon":return F(P(t),e,!0);case"polyline":return F(M(t),e,!0);case"multipoint":return}}function M(t){const e=t.paths[0];if(!e||0===e.length)return null;const r=g(e,d(e)/2);return v(r[0],r[1],r[2],t.spatialReference)}function R(t){return v(.5*(t.xmax+t.xmin),.5*(t.ymax+t.ymin),null!=t.zmin&&null!=t.zmax&&isFinite(t.zmin)&&isFinite(t.zmax)?.5*(t.zmax+t.zmin):void 0,t.spatialReference)}function P(t){const e=t.rings[0];if(!e||0===e.length)return null;const r=x(t.rings,!!t.hasZ);return v(r[0],r[1],r[2],t.spatialReference)}function F(t,e,r){const n=r?t:b(t);return e&&t?m(t,n,e)?n:null:n}function S(t){if(!t)return 0;switch(t.type){case"point":return t.z;case"extent":return t.zmax;case"polygon":return t.hasZ?t.rings.reduce((t,e)=>e.reduce((t,e)=>Math.max(t,e[2]),t),-1/0):void 0;case"polyline":return t.hasZ?t.paths.reduce((t,e)=>e.reduce((t,e)=>Math.max(t,e[2]),t),-1/0):void 0;case"mesh":return t.extent.zmax;case"multipoint":return}}function U(t,e,r,n=0){if(t){e||(e=y());const i=t;let o=.5*i.width*(r-1),s=.5*i.height*(r-1);return i.width<1e-7*i.height?o+=s/20:i.height<1e-7*i.width&&(s+=o/20),u(e,i.xmin-o-n,i.ymin-s-n,i.xmax+o+n,i.ymax+s+n),e}return null}function A(t,e,r=null){const n=a(c);return null!=t&&(n[0]=t[0],n[1]=t[1],n[2]=t[2],t.length>3&&(n[3]=t[3])),null!=e&&(n[3]=e),r&&l(n,n,r),n}function B(t,e,r,n,i,o){for(let s=0;s<3;++s)o[s]=null!=t?.[s]?t[s]:null!=r?.[s]?r[s]:i[s];return o[3]=null!=e?e:null!=n?n:i[3],o}function D(t=o,e,r,n=1){const i=new Array(3);if(null==e||null==r)i[0]=1,i[1]=1,i[2]=1;else{let n,o=0;for(let s=2;s>=0;s--){const l=t[s],u=null!=l,a=0===s&&!n&&!u,c=r[s];let m;"symbol-value"===l||a?m=0!==c?e[s]/c:1:u&&"proportional"!==l&&isFinite(l)&&(m=0!==c?l/c:1),null!=m&&(i[s]=m,n=m,o=Math.max(o,Math.abs(m)))}for(let t=2;t>=0;t--)null==i[t]?i[t]=n:0===i[t]&&(i[t]=.001*o)}for(let o=2;o>=0;o--)i[o]/=n;return s(i)}function I(t){return null!=t.isPrimitive}function Z(t){return k(I(t)?[t.width,t.depth,t.height]:t)?null:"Symbol sizes may not be negative values"}function k(t){const e=t=>null==t||t>=0;return Array.isArray(t)?t.every(e):e(t)}function E(t,o,s,l=i()){return t&&e(l,l,-t/180*Math.PI),o&&r(l,l,o/180*Math.PI),s&&n(l,l,s/180*Math.PI),l}function G(e,r,n){if(null!=n.minDemResolution)return n.minDemResolution;const i=t(r),o=p(e)*i,s=f(e)*i,l=h(e)*(r.isGeographic?1:i);return 0===o&&0===s&&0===l?n.minDemResolutionForPoints:.01*Math.max(o,s,l)}export{w as computeCentroid,S as computeMaxZ,E as computeObjectRotation,D as computeObjectScale,G as demResolutionForBoundingBox,U as enlargeExtent,k as isValidSize,A as mixinColorAndOpacity,B as overrideColor,Z as validateSymbolLayerSize};
@@ -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/Error.js";import{makeHandle as t}from"../../../../../core/handleUtils.js";import{destroyMaybe as n}from"../../../../../core/maybe.js";import{EsriPromise as o}from"../../../../../core/Promise.js";import{on as i,watch as a}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 u}from"../../../../../core/accessorSupport/decorators/subclass.js";import{FeatureLayerViewPerformanceInfo as l}from"../../FeatureLayerViewPerformanceInfo.js";import{Feature3DPipelineWorkerHandle as d}from"./Feature3DPipelineWorkerHandle.js";import{FeaturePipelineRenderManager as p}from"./rendering/FeaturePipelineRenderManager.js";import{emptyHighlightHandle as y}from"../../support/highlightUtils.js";import{LayerViewPerformanceInfo as m}from"../../support/LayerViewPerformanceInfo.js";let c=class extends o{constructor(e){super(e),this._renderer=null,this.graphicsQuery={queryForSymbologySnapping:(e,t)=>{throw new r("featurelayer:unsupported-symbology-snapping","Symbology snapping not supported")},executeQuery:async(e,r)=>await this._workerHandle.executeQuery(e,r),executeQueryForIds:async(e,r)=>await this._workerHandle.executeQueryForIds(e,r),executeQueryForCount:async(e,r)=>await this._workerHandle.executeQueryForCount(e,r),executeQueryForExtent:async(e,r)=>await this._workerHandle.executeQueryForExtent(e,r),executeQueryForLatestObservations:async(e,r)=>await this._workerHandle.executeQueryForLatestObservations(e,r)},this.maximumNumberOfFeatures=1e3}initialize(){if("point"!==this.layerView.layer.geometryType)throw new r("featurelayer:unsupported-geometry-type",`${this.layerView.layer.geometryType} is not supported`);this.addResolvingPromise(this.setup())}destroy(){this.removeAllHandles(),this._workerHandle.destroy(),n(this._renderer)}async setup(){const e=this.layerView,{layer:t,view:n,uid:o}=e,{spatialReference:s,renderSpatialReference:u,resourceController:l,renderCoordsHelper:y,elevationProvider:m}=n,c=n.state.viewingMode;if(this._renderer=new p({view:n,layerViewUid:o}),"feature"!==t.type)throw new r("featurelayer:unsupported-layertype","Only FeatureLayer is supported");const h=new d({schedule:e=>l.immediate.schedule(e),layer:t,layerView:e,viewSpatialReference:s,renderSpatialReference:u,viewingMode:c,renderer:this._renderer,elevationProvider:m,renderCoordsHelper:y});this._workerHandle=await h.when(),this.addHandles([this.layerView.view.enableFeatureTiles(),i(()=>this.layerView.view.featureTiles?.tiles,"change",e=>{this._workerHandle.onTileTreeChange(e.target)},{onListenerAdd:e=>this._workerHandle.onTileTreeChange(e),onListenerRemove:e=>this._workerHandle.onTileTreeChange(e)}),n.elevationProvider.on("elevation-change",e=>this._workerHandle.onElevationChange(e)),a(()=>this.layerView.fullOpacity,e=>this._workerHandle.onLayerViewOpacityChange(e),{sync:!1}),a(()=>t.renderer,e=>this._workerHandle.onRendererChange(e),{sync:!1})])}get legendEnabled(){return!1}get hasAllFeatures(){return!1}get hasAllFeaturesInView(){return!1}get hasFullGeometries(){return!1}get symbologySnappingSupported(){return!1}get scaleVisibilitySuspended(){return!1}get suspendInfo(){return{}}get updating(){return this._workerHandle.updating}get dataUpdating(){return!1}get updatePolicy(){return 0}get maximumNumberOfFeaturesExceeded(){return!1}get updatingProgressValue(){return 1}get usedMemory(){return this._renderer?.usedMemory??0}get unloadedMemory(){return 0}get ignoresMemoryFactor(){return!0}get totalFeatures(){return this._renderer?.totalFeatures??0}get performanceInfo(){const e=this.totalFeatures;return new l(new m(this.usedMemory,e,e,this.maximumNumberOfFeatures,0,null),e,e,this.maximumNumberOfFeaturesExceeded,"tiles","n/a")}get suspendResumeExtentMode(){return"computed"}forEachGraphic(e){}findGraphic(e){return null}highlightByObjectIds(e,r){return y}highlightByGraphics(e,r){return y}maskOccludee(e){return t()}async whenGraphicBounds(e,r){return null}computeAttachmentOrigin(e,r){return null}elevationAlignPointsInFeatures(e,t){throw new r("featurelayer:unsupported-elevation-alignment","Elevation alignment not supported")}async doRefresh(e){}setVisibility(e,r){}getMissingAttributesForFeature(e){return null}getHydratedGeometry(e){return null}};e([s()],c.prototype,"layerView",void 0),e([s()],c.prototype,"updating",null),e([s()],c.prototype,"totalFeatures",null),c=e([u("esri.views.3d.layers.graphics.pipeline.Feature3DPipeline")],c);export{c as Feature3DPipeline};
5
+ import{__decorate as e}from"tslib";import r from"../../../../../core/Error.js";import{makeHandle as t}from"../../../../../core/handleUtils.js";import{destroyMaybe as n}from"../../../../../core/maybe.js";import{EsriPromise as i}from"../../../../../core/Promise.js";import{on as o,watch as a}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 u}from"../../../../../core/accessorSupport/decorators/subclass.js";import{FeatureLayerViewPerformanceInfo as l}from"../../FeatureLayerViewPerformanceInfo.js";import{Feature3DPipelineWorkerHandle as d}from"./Feature3DPipelineWorkerHandle.js";import{FeaturePipelineRenderManager as p}from"./rendering/FeaturePipelineRenderManager.js";import{emptyHighlightHandle as y}from"../../support/highlightUtils.js";import{LayerViewPerformanceInfo as c}from"../../support/LayerViewPerformanceInfo.js";let m=class extends i{constructor(e){super(e),this._renderer=null,this.graphicsQuery={queryForSymbologySnapping:(e,t)=>{throw new r("featurelayer:unsupported-symbology-snapping","Symbology snapping not supported")},executeQuery:async(e,r)=>await this._workerHandle.executeQuery(e,r),executeQueryForIds:async(e,r)=>await this._workerHandle.executeQueryForIds(e,r),executeQueryForCount:async(e,r)=>await this._workerHandle.executeQueryForCount(e,r),executeQueryForExtent:async(e,r)=>await this._workerHandle.executeQueryForExtent(e,r),executeQueryForLatestObservations:async(e,r)=>await this._workerHandle.executeQueryForLatestObservations(e,r),executeAttributeBinsQuery:async(e,r)=>this._workerHandle.executeAttributeBinsQuery(e,r)},this.maximumNumberOfFeatures=1e3}initialize(){if("point"!==this.layerView.layer.geometryType)throw new r("featurelayer:unsupported-geometry-type",`${this.layerView.layer.geometryType} is not supported`);this.addResolvingPromise(this.setup())}destroy(){this.removeAllHandles(),this._workerHandle.destroy(),n(this._renderer)}async setup(){const e=this.layerView,{layer:t,view:n,uid:i}=e,{spatialReference:s,renderSpatialReference:u,resourceController:l,renderCoordsHelper:y,elevationProvider:c}=n,m=n.state.viewingMode;if(this._renderer=new p({view:n,layerViewUid:i}),"feature"!==t.type)throw new r("featurelayer:unsupported-layertype","Only FeatureLayer is supported");const h=new d({schedule:e=>l.immediate.schedule(e),layer:t,layerView:e,viewSpatialReference:s,renderSpatialReference:u,viewingMode:m,renderer:this._renderer,elevationProvider:c,renderCoordsHelper:y});this._workerHandle=await h.when(),this.addHandles([this.layerView.view.enableFeatureTiles(),o(()=>this.layerView.view.featureTiles?.tiles,"change",e=>{this._workerHandle.onTileTreeChange(e.target)},{onListenerAdd:e=>this._workerHandle.onTileTreeChange(e),onListenerRemove:e=>this._workerHandle.onTileTreeChange(e)}),n.elevationProvider.on("elevation-change",e=>this._workerHandle.onElevationChange(e)),a(()=>this.layerView.fullOpacity,e=>this._workerHandle.onLayerViewOpacityChange(e),{sync:!1}),a(()=>t.renderer,e=>this._workerHandle.onRendererChange(e),{sync:!1})])}get legendEnabled(){return!1}get hasAllFeatures(){return!1}get hasAllFeaturesInView(){return!1}get hasFullGeometries(){return!1}get symbologySnappingSupported(){return!1}get scaleVisibilitySuspended(){return!1}get suspendInfo(){return{}}get updating(){return this._workerHandle.updating}get dataUpdating(){return!1}get updatePolicy(){return 0}get maximumNumberOfFeaturesExceeded(){return!1}get updatingProgressValue(){return 1}get usedMemory(){return this._renderer?.usedMemory??0}get unloadedMemory(){return 0}get ignoresMemoryFactor(){return!0}get totalFeatures(){return this._renderer?.totalFeatures??0}get performanceInfo(){const e=this.totalFeatures;return new l(new c(this.usedMemory,e,e,this.maximumNumberOfFeatures,0,null),e,e,this.maximumNumberOfFeaturesExceeded,"tiles","n/a")}get suspendResumeExtentMode(){return"computed"}forEachGraphic(e){}findGraphic(e){return null}highlightByObjectIds(e,r){return y}highlightByGraphics(e,r){return y}maskOccludee(e){return t()}async whenGraphicBounds(e,r){return null}computeAttachmentOrigin(e,r){return null}elevationAlignPointsInFeatures(e,t){throw new r("featurelayer:unsupported-elevation-alignment","Elevation alignment not supported")}async doRefresh(e){}setVisibility(e,r){}getMissingAttributesForFeature(e){return null}getHydratedGeometry(e){return null}};e([s()],m.prototype,"layerView",void 0),e([s()],m.prototype,"updating",null),e([s()],m.prototype,"totalFeatures",null),m=e([u("esri.views.3d.layers.graphics.pipeline.Feature3DPipeline")],m);export{m as Feature3DPipeline};
@@ -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{__addDisposableResource as e,__disposeResources as t,__decorate as r}from"tslib";import{EventedAccessor as a}from"../../../../../core/Evented.js";import{throwIfAborted as n}from"../../../../../core/promiseUtils.js";import{watch as i,initial as o}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 l}from"../../../../../core/accessorSupport/decorators/subclass.js";import c from"../../../../../geometry/Extent.js";import{initializeProjection as d,project as m}from"../../../../../geometry/projectionUtils.js";import u from"../../../../../geometry/SpatialReference.js";import{QueryEngine as h}from"../../../../../layers/graphics/data/QueryEngine.js";import y from"../../../../../rest/support/Query.js";import{FeatureProcessingContext as p}from"./FeatureProcessingContext.js";import{PipelineCommand as f}from"./PipelineCommand.js";import{Tile3DManager as _}from"./Tile3DManager.js";import{TileLocks as C}from"./TileLocks.js";import{TiledFeatureStore as w}from"./featureSet/TiledFeatureStore.js";import{Tile3DFetcher as g}from"./fetching/Tile3DFetcher.js";import{RenderCommandContext as x}from"./rendering/RenderCommandContext.js";import{RenderCoordsHelper as v}from"../../../support/RenderCoordsHelper.js";let R=class extends a{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new w,this._tileLocks=new C,this._tileManager=null,this._renderer=null,this._fetcher=null,this._queryEngine=null,this._defaultQueryJSON=null,this._mainThreadDelegate=null,this._viewSpatialReference=null,this._renderCommandContext=null,this._context=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager?.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,layerInfo:a,layerViewInfo:n}){const s=u.fromJSON(e);this._viewSpatialReference=s;const l=u.fromJSON(t);this._fetcher=new g(this._viewSpatialReference,y.fromJSON(a.baseQuery),a.url,a.objectIdField,a.capabilities),this._queryEngine=new h({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",featureIdInfo:{type:"object-id",fieldName:a.objectIdField},fieldsIndex:a.fieldIndex,availableFields:[a.objectIdField],spatialReference:e,featureStore:this._featureStore,timeInfo:a.timeInfo}),this._mainThreadDelegate={createTexture:async(e,t)=>{const r={data:e,parameters:t};return await this.remoteClient.invoke("createTexture",r,{transferList:[e.buffer]})},releaseTexture:async e=>{const t={uid:e};await this.remoteClient.invoke("releaseTexture",t)},createMaterial:async e=>{const t={materialJSON:e};await this.remoteClient.invoke("createMaterial",t)},destroyMaterial:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyMaterial",t)},createDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("createDirectRenderer",t)},destroyDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyDirectRenderer",t)},createLodRenderer:async(e,t,r)=>{const a={rendererId:e,lodRenderGeometry:t};await this.remoteClient.invoke("createLoDRenderer",a,{transferList:r})},destroyLodRenderer:async e=>{const t={rendererId:e};await this.remoteClient.invoke("destroyLoDRenderer",t)},executeRenderCommands:async e=>{const t={commands:e.commands};await this.remoteClient.invoke("dispatchRenderCommands",t,{transferList:e.transferList})},applyElevationAlignmentTo:async e=>{const t={mapPoints:e};return await this.remoteClient.invoke("applyElevationAlignment",t,{transferList:[e.buffer]})}};const f=v.create(r,l),C=new x(r,this._mainThreadDelegate);this._renderCommandContext=C;const w=new p(s,l,this._mainThreadDelegate,f,C,a,n);this._context=w,this._renderer=w.symbolRendererFactory.createSymbolRendererFromJSON(a.renderer),this._defaultQueryJSON=new y({outSpatialReference:s}).toJSON();let R=null;if(null!=a.fullExtent){const e=c.fromJSON(a.fullExtent);await d(e.spatialReference,s),R=m(e,s)}return this._tileManager=new _({loadTile:(e,t)=>this._fetcher.fetch(e,t),createAddCommand:(e,t)=>this._createAddFeatureDataCommand(e,t),createRemoveCommand:e=>this._createRemoveFeatureDataCommand(e),createUpdateCommand:(e,t)=>this._createUpdateFeatureDataVisibilityCommand(e,t),tileLocks:this._tileLocks,extent:R}),this.addHandles(i(()=>this.updating,e=>{this.emit("notify-updating",{updating:e})}),o),null!=this._renderer&&await this._renderer.load(),j}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}onTileTreeChange(e){return this._tileManager.onTileTreeChange(e),Promise.resolve(j)}async onElevationChange(e){return j}async onLayerViewOpacityChange(e){const{_context:t,_renderer:r}=this;if(t.layerViewInfo.fullOpacity=e,null==r)return j;const a=await r.createUpdateLayerViewOpacityCommand(e);return await a.execute(),j}async onRendererChange(r){const{_context:a}=this,n=a.symbolRendererFactory.createSymbolRendererFromJSON(r);await n.load();const i=this._renderer;this._renderer=n;const o=[...this._tileManager.loadedTiles()],s=o.map(e=>e.tileId);{const r={stack:[],error:void 0,hasError:!1};try{e(r,await this._tileLocks.lock(s),!1);const t=o.flatMap(e=>[i.createRemoveCommand(e.id),n.createAddCommand(e)]),l=await Promise.all(t),c=a.joinPipelineCommands(l);await c.execute()}catch(c){r.error=c,r.hasError=!0}finally{t(r)}}const l=await i.createDestroyCommand();return await l.execute(),j}async _createAddFeatureDataCommand(e,t){const r=this._featureStore,a=this._renderer;let i;return i=null!=a?await a.createAddCommand(e):f.create(this._renderCommandContext),n(t),i.appendPipelineStateCommand(()=>{r.addTile(e)}),i}async _createRemoveFeatureDataCommand(e){const t=this._featureStore,r=this._renderer;let a;return a=null!=r?await r.createRemoveCommand(e):f.create(this._renderCommandContext),a.appendPipelineStateCommand(()=>{t.removeTile(e)}),a}async _createUpdateFeatureDataVisibilityCommand(e,t){const r=this._renderer;let a;return a=null!=r?await r.createUpdateVisibilityCommand(e):f.create(this._renderCommandContext),n(t),a}_ensureQuery(e){return e??this._defaultQueryJSON}};r([s()],R.prototype,"updating",null),R=r([l("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],R);const S=R,j={result:void 0};export{S as default};
5
+ import{__addDisposableResource as e,__disposeResources as t,__decorate as r}from"tslib";import{EventedAccessor as a}from"../../../../../core/Evented.js";import{throwIfAborted as n}from"../../../../../core/promiseUtils.js";import{watch as i,initial as o}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 l}from"../../../../../core/accessorSupport/decorators/subclass.js";import c from"../../../../../geometry/Extent.js";import{initializeProjection as d,project as m}from"../../../../../geometry/projectionUtils.js";import u from"../../../../../geometry/SpatialReference.js";import{QueryEngine as h}from"../../../../../layers/graphics/data/QueryEngine.js";import y from"../../../../../rest/support/Query.js";import{FeatureProcessingContext as p}from"./FeatureProcessingContext.js";import{PipelineCommand as f}from"./PipelineCommand.js";import{Tile3DManager as _}from"./Tile3DManager.js";import{TileLocks as C}from"./TileLocks.js";import{TiledFeatureStore as w}from"./featureSet/TiledFeatureStore.js";import{Tile3DFetcher as g}from"./fetching/Tile3DFetcher.js";import{RenderCommandContext as x}from"./rendering/RenderCommandContext.js";import{RenderCoordsHelper as v}from"../../../support/RenderCoordsHelper.js";let R=class extends a{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new w,this._tileLocks=new C,this._tileManager=null,this._renderer=null,this._fetcher=null,this._queryEngine=null,this._defaultQueryJSON=null,this._mainThreadDelegate=null,this._viewSpatialReference=null,this._renderCommandContext=null,this._context=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager?.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,layerInfo:a,layerViewInfo:n}){const s=u.fromJSON(e);this._viewSpatialReference=s;const l=u.fromJSON(t);this._fetcher=new g(this._viewSpatialReference,y.fromJSON(a.baseQuery),a.url,a.objectIdField,a.capabilities),this._queryEngine=new h({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",featureIdInfo:{type:"object-id",fieldName:a.objectIdField},fieldsIndex:a.fieldIndex,availableFields:[a.objectIdField],spatialReference:e,featureStore:this._featureStore,timeInfo:a.timeInfo}),this._mainThreadDelegate={createTexture:async(e,t)=>{const r={data:e,parameters:t};return await this.remoteClient.invoke("createTexture",r,{transferList:[e.buffer]})},releaseTexture:async e=>{const t={uid:e};await this.remoteClient.invoke("releaseTexture",t)},createMaterial:async e=>{const t={materialJSON:e};await this.remoteClient.invoke("createMaterial",t)},destroyMaterial:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyMaterial",t)},createDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("createDirectRenderer",t)},destroyDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyDirectRenderer",t)},createLodRenderer:async(e,t,r)=>{const a={rendererId:e,lodRenderGeometry:t};await this.remoteClient.invoke("createLoDRenderer",a,{transferList:r})},destroyLodRenderer:async e=>{const t={rendererId:e};await this.remoteClient.invoke("destroyLoDRenderer",t)},executeRenderCommands:async e=>{const t={commands:e.commands};await this.remoteClient.invoke("dispatchRenderCommands",t,{transferList:e.transferList})},applyElevationAlignmentTo:async e=>{const t={mapPoints:e};return await this.remoteClient.invoke("applyElevationAlignment",t,{transferList:[e.buffer]})}};const f=v.create(r,l),C=new x(r,this._mainThreadDelegate);this._renderCommandContext=C;const w=new p(s,l,this._mainThreadDelegate,f,C,a,n);this._context=w,this._renderer=w.symbolRendererFactory.createSymbolRendererFromJSON(a.renderer),this._defaultQueryJSON=new y({outSpatialReference:s}).toJSON();let R=null;if(null!=a.fullExtent){const e=c.fromJSON(a.fullExtent);await d(e.spatialReference,s),R=m(e,s)}return this._tileManager=new _({loadTile:(e,t)=>this._fetcher.fetch(e,t),createAddCommand:(e,t)=>this._createAddFeatureDataCommand(e,t),createRemoveCommand:e=>this._createRemoveFeatureDataCommand(e),createUpdateCommand:(e,t)=>this._createUpdateFeatureDataVisibilityCommand(e,t),tileLocks:this._tileLocks,extent:R}),this.addHandles(i(()=>this.updating,e=>{this.emit("notify-updating",{updating:e})}),o),null!=this._renderer&&await this._renderer.load(),j}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}async executeAttributeBinsQuery(e,t){return{result:await this._queryEngine.executeAttributeBinsQuery(e,t)}}onTileTreeChange(e){return this._tileManager.onTileTreeChange(e),Promise.resolve(j)}async onElevationChange(e){return j}async onLayerViewOpacityChange(e){const{_context:t,_renderer:r}=this;if(t.layerViewInfo.fullOpacity=e,null==r)return j;const a=await r.createUpdateLayerViewOpacityCommand(e);return await a.execute(),j}async onRendererChange(r){const{_context:a}=this,n=a.symbolRendererFactory.createSymbolRendererFromJSON(r);await n.load();const i=this._renderer;this._renderer=n;const o=[...this._tileManager.loadedTiles()],s=o.map(e=>e.tileId);{const r={stack:[],error:void 0,hasError:!1};try{e(r,await this._tileLocks.lock(s),!1);const t=o.flatMap(e=>[i.createRemoveCommand(e.id),n.createAddCommand(e)]),l=await Promise.all(t),c=a.joinPipelineCommands(l);await c.execute()}catch(c){r.error=c,r.hasError=!0}finally{t(r)}}const l=await i.createDestroyCommand();return await l.execute(),j}async _createAddFeatureDataCommand(e,t){const r=this._featureStore,a=this._renderer;let i;return i=null!=a?await a.createAddCommand(e):f.create(this._renderCommandContext),n(t),i.appendPipelineStateCommand(()=>{r.addTile(e)}),i}async _createRemoveFeatureDataCommand(e){const t=this._featureStore,r=this._renderer;let a;return a=null!=r?await r.createRemoveCommand(e):f.create(this._renderCommandContext),a.appendPipelineStateCommand(()=>{t.removeTile(e)}),a}async _createUpdateFeatureDataVisibilityCommand(e,t){const r=this._renderer;let a;return a=null!=r?await r.createUpdateVisibilityCommand(e):f.create(this._renderCommandContext),n(t),a}_ensureQuery(e){return e??this._defaultQueryJSON}};r([s()],R.prototype,"updating",null),R=r([l("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],R);const S=R,j={result:void 0};export{S 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 r from"../../../../../core/Error.js";import{EsriPromise as t}from"../../../../../core/Promise.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 i}from"../../../../../core/accessorSupport/decorators/subclass.js";import{WorkerHandle as n}from"../../../../../core/workers/WorkerHandle.js";import a from"../../../../../geometry/Extent.js";import{clone as s}from"../../../../../geometry/support/aaBoundingRect.js";import{isFeatureGraphicOrigin as d}from"../../../../../graphic/isFeatureGraphicOrigin.js";import c from"../../../../../rest/support/FeatureSet.js";import{ElevationContext as l}from"../ElevationContext.js";import{applyElevationAlignment as p}from"./utils.js";let u=class extends t{constructor(e){super(e),this.schedule=null,this._workerUpdating=!0}get updating(){return this._workerUpdating}get _graphicOrigin(){const e=this.layer.graphicOrigin;if(!d(e))throw new r("featurelayerview3d:invalid-graphic-origin","Layer's graphic origin is not a FeatureGraphicOrigin");return e}initialize(){const{layer:e,layerView:r,viewSpatialReference:t,renderSpatialReference:o}=this,i=e.elevationInfo;this._elevationContext=l.fromElevationInfo(i),this._workerHandle=new y(this.schedule,{createTexture:async({data:e,parameters:r})=>({result:await this.renderer.createTexture(e,r),transferList:[]}),releaseTexture:async({uid:e})=>(await this.renderer.releaseTexture(e),m),createMaterial:async({materialJSON:e})=>(await this.renderer.createMaterial(e),m),destroyMaterial:async({materialId:e})=>(await this.renderer.destroyMaterial(e),m),createDirectRenderer:async({materialId:e})=>(await this.renderer.createDirectRenderer(e),m),destroyDirectRenderer:async({materialId:e})=>(await this.renderer.destroyDirectRenderer(e),m),createLoDRenderer:async({rendererId:e,lodRenderGeometry:r},t)=>(await this.renderer.createLoDRenderer(e,r,t?.signal??void 0),m),destroyLoDRenderer:async({rendererId:e},r)=>(await this.renderer.destroyLoDRenderer(e,r?.signal??void 0),m),dispatchRenderCommands:async({commands:e})=>(await this.renderer.executeRenderCommands(e),m),applyElevationAlignment:async({mapPoints:e})=>{const{viewSpatialReference:r,elevationProvider:t,renderCoordsHelper:o}=this,i=p(e,r,this._elevationContext,t,o);return{result:i,transferList:[i.buffer]}}}),this.addResolvingPromise((async()=>{await e.load();const n={url:e.parsedUrl?.path??"",baseQuery:e.createQuery().toJSON(),objectIdField:e.objectIdField,capabilities:e.capabilities,fieldIndex:e.fieldsIndex.toJSON(),timeInfo:e.timeInfo?.toJSON(),elevationInfo:i?.toJSON(),fullExtent:e.fullExtent?.toJSON(),renderer:e.renderer?.toJSON()},a={fullOpacity:r.fullOpacity};await this._workerHandle.invokeMethod("setup",{viewSpatialReference:t.toJSON(),renderSpatialReference:o.toJSON(),viewingMode:this.viewingMode,layerInfo:n,layerViewInfo:a})})()),this.addHandles(this._workerHandle.on("notify-updating",({updating:e})=>{this._workerUpdating=e}))}onTileTreeChange(e){this._workerHandle.invokeMethod("onTileTreeChange",{tiles:e.items.map(h)})}onElevationChange(e){this._workerHandle.invokeMethod("onElevationChange",{context:e.context,spatialReference:e.spatialReference?.toJSON(),extent:s(e.extent)})}onLayerViewOpacityChange(e){this._workerHandle.invokeMethod("onLayerViewOpacityChange",e)}onRendererChange(e){const r=e?.toJSON();this._workerHandle.invokeMethod("onRendererChange",r)}async executeQuery(e,r){const t=await this._workerHandle.invokeMethod("executeQuery",e?.toJSON(),r),o=c.fromJSON(t);return this._ensureLayerOnFeatures(o),o}async executeQueryForIds(e,r){return await this._workerHandle.invokeMethod("executeQueryForIds",e?.toJSON(),r)}async executeQueryForCount(e,r){return await this._workerHandle.invokeMethod("executeQueryForCount",e?.toJSON(),r)}async executeQueryForExtent(e,r){const{count:t,extent:o}=await this._workerHandle.invokeMethod("executeQueryForExtent",e?.toJSON(),r);return{count:t,extent:a.fromJSON(o)}}async executeQueryForLatestObservations(e,r){const t=await this._workerHandle.invokeMethod("executeQueryForLatestObservations",e?.toJSON(),r),o=c.fromJSON(t);return this._ensureLayerOnFeatures(o),o}_ensureLayerOnFeatures(e){const{layer:r,_graphicOrigin:t}=this;for(const o of e.features)o.layer=r,o.sourceLayer=r,o.origin=t}};e([o()],u.prototype,"updating",null),e([o({constructOnly:!0})],u.prototype,"schedule",void 0),e([o({constructOnly:!0})],u.prototype,"layer",void 0),e([o({constructOnly:!0})],u.prototype,"layerView",void 0),e([o({constructOnly:!0})],u.prototype,"viewSpatialReference",void 0),e([o({constructOnly:!0})],u.prototype,"renderSpatialReference",void 0),e([o({constructOnly:!0})],u.prototype,"viewingMode",void 0),e([o({constructOnly:!0})],u.prototype,"renderer",void 0),e([o({constructOnly:!0})],u.prototype,"elevationProvider",void 0),e([o({constructOnly:!0})],u.prototype,"renderCoordsHelper",void 0),e([o()],u.prototype,"_workerUpdating",void 0),e([o()],u.prototype,"_graphicOrigin",null),u=e([i("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorkerHandle")],u);class y extends n{constructor(e,r){super("Feature3DPipelineWorker","setup",{},e,{strategy:"dedicated",client:r})}}function h({id:e,lij:r,extent:t}){return{id:e,lij:r,extent:t}}const m={result:void 0};export{u as Feature3DPipelineWorkerHandle};
5
+ import{__decorate as e}from"tslib";import r from"../../../../../core/Error.js";import{EsriPromise as t}from"../../../../../core/Promise.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 i}from"../../../../../core/accessorSupport/decorators/subclass.js";import{WorkerHandle as n}from"../../../../../core/workers/WorkerHandle.js";import a from"../../../../../geometry/Extent.js";import{clone as s}from"../../../../../geometry/support/aaBoundingRect.js";import{isFeatureGraphicOrigin as d}from"../../../../../graphic/isFeatureGraphicOrigin.js";import c from"../../../../../rest/support/AttributeBinsFeatureSet.js";import l from"../../../../../rest/support/FeatureSet.js";import{ElevationContext as u}from"../ElevationContext.js";import{applyElevationAlignment as p}from"./utils.js";let y=class extends t{constructor(e){super(e),this.schedule=null,this._workerUpdating=!0}get updating(){return this._workerUpdating}get _graphicOrigin(){const e=this.layer.graphicOrigin;if(!d(e))throw new r("featurelayerview3d:invalid-graphic-origin","Layer's graphic origin is not a FeatureGraphicOrigin");return e}initialize(){const{layer:e,layerView:r,viewSpatialReference:t,renderSpatialReference:o}=this,i=e.elevationInfo;this._elevationContext=u.fromElevationInfo(i),this._workerHandle=new h(this.schedule,{createTexture:async({data:e,parameters:r})=>({result:await this.renderer.createTexture(e,r),transferList:[]}),releaseTexture:async({uid:e})=>(await this.renderer.releaseTexture(e),w),createMaterial:async({materialJSON:e})=>(await this.renderer.createMaterial(e),w),destroyMaterial:async({materialId:e})=>(await this.renderer.destroyMaterial(e),w),createDirectRenderer:async({materialId:e})=>(await this.renderer.createDirectRenderer(e),w),destroyDirectRenderer:async({materialId:e})=>(await this.renderer.destroyDirectRenderer(e),w),createLoDRenderer:async({rendererId:e,lodRenderGeometry:r},t)=>(await this.renderer.createLoDRenderer(e,r,t?.signal??void 0),w),destroyLoDRenderer:async({rendererId:e},r)=>(await this.renderer.destroyLoDRenderer(e,r?.signal??void 0),w),dispatchRenderCommands:async({commands:e})=>(await this.renderer.executeRenderCommands(e),w),applyElevationAlignment:async({mapPoints:e})=>{const{viewSpatialReference:r,elevationProvider:t,renderCoordsHelper:o}=this,i=p(e,r,this._elevationContext,t,o);return{result:i,transferList:[i.buffer]}}}),this.addResolvingPromise((async()=>{await e.load();const n={url:e.parsedUrl?.path??"",baseQuery:e.createQuery().toJSON(),objectIdField:e.objectIdField,capabilities:e.capabilities,fieldIndex:e.fieldsIndex.toJSON(),timeInfo:e.timeInfo?.toJSON(),elevationInfo:i?.toJSON(),fullExtent:e.fullExtent?.toJSON(),renderer:e.renderer?.toJSON()},a={fullOpacity:r.fullOpacity};await this._workerHandle.invokeMethod("setup",{viewSpatialReference:t.toJSON(),renderSpatialReference:o.toJSON(),viewingMode:this.viewingMode,layerInfo:n,layerViewInfo:a})})()),this.addHandles(this._workerHandle.on("notify-updating",({updating:e})=>{this._workerUpdating=e}))}onTileTreeChange(e){this._workerHandle.invokeMethod("onTileTreeChange",{tiles:e.items.map(m)})}onElevationChange(e){this._workerHandle.invokeMethod("onElevationChange",{context:e.context,spatialReference:e.spatialReference?.toJSON(),extent:s(e.extent)})}onLayerViewOpacityChange(e){this._workerHandle.invokeMethod("onLayerViewOpacityChange",e)}onRendererChange(e){const r=e?.toJSON();this._workerHandle.invokeMethod("onRendererChange",r)}async executeQuery(e,r){const t=await this._workerHandle.invokeMethod("executeQuery",e?.toJSON(),r),o=l.fromJSON(t);return this._ensureLayerOnFeatures(o),o}async executeQueryForIds(e,r){return await this._workerHandle.invokeMethod("executeQueryForIds",e?.toJSON(),r)}async executeQueryForCount(e,r){return await this._workerHandle.invokeMethod("executeQueryForCount",e?.toJSON(),r)}async executeQueryForExtent(e,r){const{count:t,extent:o}=await this._workerHandle.invokeMethod("executeQueryForExtent",e?.toJSON(),r);return{count:t,extent:a.fromJSON(o)}}async executeQueryForLatestObservations(e,r){const t=await this._workerHandle.invokeMethod("executeQueryForLatestObservations",e?.toJSON(),r),o=l.fromJSON(t);return this._ensureLayerOnFeatures(o),o}async executeAttributeBinsQuery(e,r){const t=await this._workerHandle.invokeMethod("executeAttributeBinsQuery",e.toJSON(),r);return c.fromJSON(t)}_ensureLayerOnFeatures(e){const{layer:r,_graphicOrigin:t}=this;for(const o of e.features)o.layer=r,o.sourceLayer=r,o.origin=t}};e([o()],y.prototype,"updating",null),e([o({constructOnly:!0})],y.prototype,"schedule",void 0),e([o({constructOnly:!0})],y.prototype,"layer",void 0),e([o({constructOnly:!0})],y.prototype,"layerView",void 0),e([o({constructOnly:!0})],y.prototype,"viewSpatialReference",void 0),e([o({constructOnly:!0})],y.prototype,"renderSpatialReference",void 0),e([o({constructOnly:!0})],y.prototype,"viewingMode",void 0),e([o({constructOnly:!0})],y.prototype,"renderer",void 0),e([o({constructOnly:!0})],y.prototype,"elevationProvider",void 0),e([o({constructOnly:!0})],y.prototype,"renderCoordsHelper",void 0),e([o()],y.prototype,"_workerUpdating",void 0),e([o()],y.prototype,"_graphicOrigin",null),y=e([i("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorkerHandle")],y);class h extends n{constructor(e,r){super("Feature3DPipelineWorker","setup",{},e,{strategy:"dedicated",client:r})}}function m({id:e,lij:r,extent:t}){return{id:e,lij:r,extent:t}}const w={result:void 0};export{y as Feature3DPipelineWorkerHandle};
@@ -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{isValidIntersectorResult as t}from"../../webgl-engine/lib/IntersectorResult.js";import{Graphic3DTarget as e,LayerTarget as r}from"../../webgl-engine/lib/IntersectorTarget.js";class s extends e{constructor(t,e,r,s){super(e,r),this.point=t,this.createGraphic=s}}function n(e){return t(e)&&5===e.intersector&&!!e.target}class i extends r{constructor(t,e,r,s,n){super(t),this.layerViewUid=t,this.sublayerId=e,this.nodeIndex=r,this.componentIndex=s,this.triangleNr=n}}class c extends e{constructor(t,e,r){super(e,null),this.point=t,this.createVoxelGraphic=r}}class o extends e{constructor(t,e){super(t,null),this.createTiles3DGraphic=e}}function u(e){return t(e)&&4===e.intersector&&!!e.target}function a(e){return t(e)&&7===e.intersector&&!!e.target}function l(e){return t(e)&&8===e.intersector&&!!e.target}export{i as I3sTarget,s as PclTarget,o as Tiles3DTarget,c as VoxelTarget,u as isI3sIntersectorResult,n as isPclIntersectorResult,l as isTiles3DIntersectorResult,a as isVoxelIntersectorResult};
5
+ import{isValidIntersectorResult as t}from"../../webgl-engine/lib/IntersectorResult.js";import{Graphic3DTarget as e,LayerTarget as r}from"../../webgl-engine/lib/IntersectorTarget.js";class s extends e{constructor(t,e,r,s){super(e,r),this.point=t,this.createGraphic=s}}function n(e){return t(e)&&5===e.intersector&&!!e.target}class i extends r{constructor(t,e,r,s,n){super(t),this.layerViewUid=t,this.sublayerId=e,this.nodeIndex=r,this.componentIndex=s,this.triangleNr=n}}class o extends e{constructor(t,e,r){super(e,null),this.point=t,this.createVoxelGraphic=r}}class c extends r{}function a(e){return t(e)&&4===e.intersector&&!!e.target}function l(e){return t(e)&&7===e.intersector&&!!e.target}export{i as I3sTarget,s as PclTarget,c as Tiles3DTarget,o as VoxelTarget,a as isI3sIntersectorResult,n as isPclIntersectorResult,l as isVoxelIntersectorResult};
@@ -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{filterInPlace as s}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../../core/MapUtils.js";import{isAbortError as a,throwIfAborted as n}from"../../../../core/promiseUtils.js";import o from"../../../../core/ReactiveMap.js";import{on as l,watch as u}from"../../../../core/reactiveUtils.js";import{schedule as h}from"../../../../core/scheduling.js";import{signal as d}from"../../../../core/signal.js";import{sqlAnd as c}from"../../../../core/sql.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{getEpsilon as _}from"../../../../core/libs/gl-matrix-2/math/common.js";import{create as m,equals as g,clone as F,expand as y,toExtent as T,width as x,height as v}from"../../../../geometry/support/aaBoundingRect.js";import{getObjectId as R,hasVertices as b,computeAABR as E}from"../../../../layers/graphics/dehydratedFeatures.js";import C from"../../../../rest/support/QuantizationParameters.js";import D from"../../../../rest/support/Query.js";import{MultiFeatureReference as w,SingleFeatureReference as M}from"./featureReference.js";import{failedFeatureCount as U,FeatureTile as j}from"./FeatureTile.js";import{virtualDisplayFilterHighlightTileId as A,virtualSnapshotTileId as I}from"./FeatureTileDescriptor.js";import{tilesAreRelated as O}from"../../terrain/tileUtils.js";import{ImmediateTask as P,TaskPriority as z}from"../../../support/Scheduler.js";let q=class extends t{set maximumNumberOfFeatures(e){e=e||1/0;const t=this._get("maximumNumberOfFeatures");e===t||e<1||(this._set("maximumNumberOfFeatures",e),this._maximumFeaturesUpdated(t,e))}set memoryFactor(e){this.memoryFactor!==e&&(this._set("memoryFactor",e),this._setDirty())}set lodFactor(e){this.lodFactor!==e&&(this._set("lodFactor",e),this._supportsResolution&&this.refetch())}get useTileCount(){return this._useTileCount&&null!=this.context.query.queryFeatureCount}set useTileCount(e){this._useTileCount=e,this.notifyChange("useTileCount")}get updating(){return this._dirty||!!this._pendingEdits||this._isFetching||(this.tileDescriptors?.updating??!1)}get readyToRun(){return this._dirty}get memoryForUnusedFeatures(){let e=0;return this._featureTiles.forEach(t=>e+=t.estimatedUnusedSize),e}get totalVertices(){let e=0;return this._featureTiles.forEach(t=>e+=t.numVertices),e}get totalFeatures(){let e=0;return this._featureTiles.forEach(t=>e+=t.numFeatures),e}get showsAllFeatures(){if(this._paused||this.dataUpdating)return!1;for(const e of this._featureTiles.values())if(!this.hasFullGeometries&&0!==e.emptyFeatureRatio||!e.showsAllFeatures)return!1;return!0}get hasFullGeometries(){if(!this._supportsResolution)return!0;const e=this.tileDescriptors?.some(Q);return e||!this.context.capabilities.supportsQuantization&&"polyline"!==this.context.geometryType}set filterExtent(e){if(null!=e&&this.context.tilingScheme&&!e.spatialReference.equals(this.context.tilingScheme.spatialReference))return void i.getLogger(this).error("#filterExtent=","extent needs to be in the same spatial reference as the tiling scheme");const t=this._get("filterExtent");if(t===e||null!=t&&e&&t.equals(e))return;const s=null!=e?e.clone():null;this._set("filterExtent",s),this._reclip(s,t)}_updateTileZQuantization(e){if(1===this.context.viewingMode){const t=e.computeZQuantizationFactor();this._zQuantizationFactor.value<t&&(this._zQuantizationFactor.value=t)}}get _tileZQuantization(){return this.context.isDraped?1:this._zQuantizationFactor.value}constructor(e){super(e),this._useTileCount=!1,this.dataUpdating=!1,this.updatingTotal=0,this.updatingRemaining=0,this.expectedFeatureDiff=0,this.maximumNumberOfFeaturesExceeded=!1,this._fullRatio=1,this._farRatio=1,this._zQuantizationFactor=d(1),this._changes={updates:{adds:new Array,removes:new Array},adds:new Array,removes:new Array},this._featureTiles=new o,this._displayingFeatureReferences=new Map,this._numDisplayingFeatureReferences=0,this._dirty=!1,this._suspended=!0,this._pendingEdits=null,this._applyEditsTilesUpdated=!1,this._isFetching=!1;const t=e.context;this._frameTask=t.scheduler?.registerTask(z.FEATURE_TILE_FETCHER,this)??P,this.FeatureReferenceClass=t.capabilities.supportsMultipleResolutions?w:M,this._objectIdField=t.objectIdField}initialize(){this.addHandles([l(()=>this.tileDescriptors,"change",()=>this._setDirty(),{onListenerAdd:()=>this._setDirty(),onListenerRemove:()=>this._setDirty()}),u(()=>this._tileZQuantization,()=>this.refetch())]),this._setDirty()}destroy(){this._frameTask.remove(),this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._removeTile(e)}),this._featureTiles.clear(),this._displayingFeatureReferences.clear(),this._pendingEdits?.controller.abort(),this._pendingEdits=null}get _paused(){return this._suspended||!!this._pendingEdits}restart(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._clearTile(e),this._resetFetchTile(e)}),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._setDirty()}refetch(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._resetFetchTile(e)}),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._setDirty()}refetchDisplayFilterHighlightTile(){const e=this._featureTiles.get(A);e&&(this._cancelFetchTile(e),this._resetFetchTile(e),this._setDirty())}suspend(){this._suspended||(this._suspended=!0,this._pause(),this._setDirty())}resume(){this._suspended&&(this._suspended=!1,this._unpause())}getMissingAttributesForFeature(e){for(const t of this._featureTiles.values()){const s=t.missingAttributes?.get(e);if(null!=s)return s}}_pause(){this._paused&&(this._featureTiles.forEach(e=>this._cancelFetchTile(e)),this._updated())}_unpause(){this._paused||this._setDirty()}get availableFields(){let e=null;return this._featureTiles.forEach(t=>{null!=t.displayingFeatures&&0!==t.displayingFeatures.length&&(null==e?e=new Set(t.availableFields):e.forEach(s=>{t.availableFields?.has(s)||e.delete(s)}))}),null!=e?e:new Set}applyEdits(e){this._pendingEdits||(this._pendingEdits={edits:Promise.resolve(),count:0,controller:new AbortController},this._pause());const t=this._pendingEdits;t.count++;const s=t.edits.then(()=>e.result.catch(e=>{if(a(e))throw e;return null}).then(e=>e?(this._applyEditsDeleteFeatures(e.deletedFeatures),this._applyEditsAddUpdateFeatures(e.addedFeatures,e.updatedFeatures,t.controller.signal).then(()=>e)):e).then(e=>(0===--t.count&&(this._pendingEdits===t&&(this._pendingEdits=null),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._applyEditsTilesUpdated=!1,this._unpause()),e)));return t.edits=s,this._updated(),s}_applyEditsDeleteFeatures(e){if(0===e.length)return;const t=this.context.globalIdField,s=t&&this.availableFields.has(t),r=new Set,a=this._objectIdField;e.forEach(({objectId:e,globalId:n})=>{(!e||e<0)&&t&&n&&(s||i.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected in the view`),e=this._objectIdFromGlobalId(n,a,t)),null!=e&&e>=0&&r.add(e)}),this._featureTiles.forEach(e=>{if(!e.features)return;const t=e.features.filter(e=>!r.has(R(e,this._objectIdField)));t.length!==e.features.length&&(this._applyEditsTileUpdated(),e.setFeatures(t,0,e.availableFields,e.missingAttributes),this._updateTileZQuantization(e),this._invalidateCounts())})}_objectIdFromGlobalId(e,t,s){if(null==e)return null;const i=this.features.find(t=>t.attributes?.[s]===e);return i?R(i,t):null}async _applyEditsAddUpdateFeatures(e,t,s){const{objectIdField:r,globalIdField:a}=this.context,n=a&&this.availableFields.has(a),o=new Set,l=new Set;for(const i of e){const e=i.objectId;null!=e&&o.add(e)}for(const{objectId:h,globalId:d}of t){let e=h;(null==e||e<0)&&a&&(n||i.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${a} to be included the layer's outFields for updates to be reflected in the view`),e=this._objectIdFromGlobalId(d,r,a)),null!=e&&e>=0&&(o.add(e),l.add(e))}if(0===o.size)return;const u=[];this._featureTiles.forEach(e=>{const t=this._applyEditsAddUpdateTile(e,o,l,s);u.push(t)}),this._updated(),await Promise.allSettled(u)}async _applyEditsAddUpdateTile(e,t,s,i){if(!e.features)return;e.fetchingResolution=e.descriptor.resolution;const r=this._createQuery(e);r.resultType=void 0,r.cacheHint=!1,r.objectIds=Array.from(t);const a=await this._queryFeatures(r,i);let n=null;if(s.size>0){const t=e.features.filter(e=>!s.has(R(e,this._objectIdField)));t.length!==e.features.length&&(n=t)}if(a.features.length>0){n||(n=e.features.slice());for(const e of a.features)n.push(e)}n&&(e.hasPreciseFeatureCount&&(e.numFeatures=Math.max(e.numFeatures,n.length)),this._applyEditsTileUpdated(),e.setFeatures(n,0,Z(e.availableFields,a.fields),V(e.missingAttributes,a.missingAttributes)),this._updateTileZQuantization(e),this._invalidateCounts())}_applyEditsTileUpdated(){this._applyEditsTilesUpdated||(this._applyEditsTilesUpdated=!0,this._updated())}_queryFeatures(e,t){return this.context.query.queryFeaturesDehydrated(e,{signal:t,timeout:J})}_setDirty(){this._dirty=!0,this._updated()}runTask(e){const t=this._frameTask.processQueue(e);if(!this._dirty||!this.initialized)return t;this._dirty=!1;const s=this._featureTilesArray;if(this._markTilesNotAlive(s),!e.run(()=>this._addTiles(s,e))||!e.run(()=>this._filterExtentTiles(s,e))||!e.run(()=>this._removeTiles(s,e))||e.done)return void this._setDirty();const i=this._sortTiles(s);e.run(()=>this._showTiles(i,e))&&e.run(()=>this._fetchTiles(i,e))&&e.run(()=>this._updateMemoryEstimates(i,e))||this._setDirty(),this._updated(),this.updating||this._updateMaximumNumberOfFeaturesExceeded()}_markTilesNotAlive(e){for(const t of e)t.alive=!1}_addTiles(e,t){return!(this._suspended||!this.tileDescriptors)&&(this.tileDescriptors.forEach(s=>{const i=this._featureTiles.get(s.id);i?i.alive=!0:t.done||(e.push(this._addTile(s)),t.madeProgress())}),t.hasProgressed)}_filterExtentTiles(e,t){for(const s of e){if(t.done)break;s.alive&&(s.filtered=!s.intersects(this.filterExtent),s.filtered&&(this._clearTile(s),t.madeProgress()))}return t.hasProgressed}_removeTiles(e,t){for(let s=e.length-1;s>=0&&!t.done;s--){const i=e[s];i.alive||(this._removeTile(i),s!==e.length-1&&(e[s]=e[e.length-1]),e.pop(),t.madeProgress())}return t.hasProgressed}_sortTiles(e){return e.sort((e,t)=>e.descriptor.loadPriority-t.descriptor.loadPriority),e}_showTiles(e,t){const s=this._updateRatio(e),i=e=>{const t=this._fullRatio<1?s(e)*this._farRatio:1;e.reduceFeatures(t,this.memoryFactor,this._objectIdField,this._reduceMode)&&this._setDirty();const{numFeatures:i,fetchingResolution:r,descriptor:a,isFetched:n}=e;return this._supportsResolution&&i>0&&r!==a.resolution&&n&&(e.requestRefetch(),this._setDirty()),this._showTile(e)};for(const r of e)if(!t.run(()=>i(r))){this._setDirty();break}return t.hasProgressed}_fetchTiles(e,t){if(this._paused)return!1;let s=!1;for(const i of e){if(!i.needsFetch)continue;const e=null!=this.context.memoryCache?this.context.memoryCache.pop(i.id):null;if(e?.resolution!==i.displayingResolution){if(this._needsNumFeatures(i)){const e=new AbortController,r=this._fetchTileCount(i,e.signal);this._handleRequest(i,r,e,()=>i.resetFetching(),()=>i.numFeatures=U),s=!0,t.madeProgress()}if(t.done)return!0}else i.cache=e,i.numFeatures&&this._notifyDataUpdating(),this._setDirty(),this._scheduleUpdated(),t.madeProgress()}if(s)return t.hasProgressed;for(const r of e){if(!r.needsFetch)continue;const e=new AbortController,s=this._fetchTile(r,e.signal);if(this._handleRequest(r,s,e,e=>r.fetchDone(e),e=>{r.fetchFailed=!0,this.context.logFetchError(i.getLogger(this),e)}),t.madeProgress(),t.done)return!0}return t.hasProgressed}_updateMemoryEstimates(e,t){return e.some(e=>!t.run(()=>e.updateMemoryEstimates())&&(this._setDirty(),!0)),t.hasProgressed}_reclip(e,t){if(!this.initialized)return;const s=new Array;this._featureTiles.forEach(i=>{null!=i.displayingFeatures&&0!==i.displayingFeatures.length&&(i.intersectionIncludingBorrowed(t,B),i.intersectionIncludingBorrowed(e,G),g(B,G)||s.push(i))}),this._refreshDisplayingFeatures(s),this._updated()}_refreshDisplayingFeatures(e){const t=new Set,s=this._changes.updates;for(const i of e)if(null!=i.displayingFeatures)for(const e of i.displayingFeatures){const i=R(e,this._objectIdField);if(t.has(i))continue;t.add(i);const r=this._displayingFeatureReferences.get(i).feature;s.removes.push(r),s.adds.push(r)}this._applyChanges()}_updated(){let e=0;if(this._paused||this._featureTiles.forEach(t=>t.isFetching?++e:0),this._isFetching=e>0,e>0||this._applyEditsTilesUpdated?this._notifyDataUpdating():this._dirty||this._set("dataUpdating",!1),this.updating){let t=0,s=0,i=0,r=0,a=0;const n=this._displayingFeatureReferences.size/this._numDisplayingFeatureReferences;this._featureTiles.forEach(e=>{if(++s,e.isFetching&&e.hasPreciseFeatureCount){const t=this._maximumFeaturesForTile(e)*(1-e.emptyFeatureRatio),s=null!=e.displayingFeatures?e.displayingFeatures.length*n:0;a+=t-s}e.needsFetch?++r:e.numFeatures>0&&(++i,t+=e.numFeatures)}),r+=e;let o=0,l=0;t?(l=t,o=Math.min(r*t/i,t)):(l=s,o=r),a=Math.min(this.maximumNumberOfFeatures-this.features.length,a),this._set("updatingTotal",l),this._set("updatingRemaining",o),this._set("expectedFeatureDiff",a)}else this._set("updatingTotal",0),this._set("updatingRemaining",0),this._set("expectedFeatureDiff",0);this.debugger?.update()}_updateMaximumNumberOfFeaturesExceeded(){for(const{perTileMaximumNumberOfFeaturesExceeded:e}of this._featureTiles.values())if(e)return void this._set("maximumNumberOfFeaturesExceeded",!0);this._set("maximumNumberOfFeaturesExceeded",!1)}_updateRatio(e){const t=L(e),s=e=>1/(1<<Math.max(0,t-e.descriptor.lij[0]));let i=0,r=0;for(const a of e){const e=a.numFeatures;i+=e,r+=e*s(a)}return this._fullRatio=Math.min(1,this.maximumNumberOfFeatures/i),this._farRatio=this.maximumNumberOfFeatures/r,this._scheduleUpdated(),s}_maximumFeaturesUpdated(e,t){e!==t&&(t>e&&this._featureTiles.forEach(e=>{if(!e.featuresMissing)return;const t=this._maximumFeaturesForTile(e);e.isFullyFetched(t)||(this._cancelFetchTile(e),this._resetFetchTile(e))}),this._setDirty())}_addTile(e){const t=new j(e);return this._featureTiles.set(t.id,t),this._resetFetchTile(t),this._referenceDisplayingFeaturesFromRelatedTiles(t),t}_referenceDisplayingFeaturesFromRelatedTiles(e){const t=e.displayingResolution;this._featureTiles.forEach(s=>{if(null!=s.displayingFeatures&&e!==s&&O(e.descriptor.lij,s.descriptor.lij)){null==e.displayingFeatures&&(e.displayingFeatures=[]),e.descriptor.extent&&s.descriptor.extent&&(e.extentIncludingBorrowedFeatures??=F(e.descriptor.extent),y(e.extentIncludingBorrowedFeatures,s.descriptor.extent,e.extentIncludingBorrowedFeatures));for(const i of s.displayingFeatures){e.displayingFeatures.push(i);const s=this._displayingFeatureReferences.get(R(i,this._objectIdField));s.ref(s.feature,t),this._numDisplayingFeatureReferences++}}})}_removeTile(e){this._clearTile(e),this._featureTiles.delete(e.id)}_resetFetchTile(e){e.filtered=!e.intersects(this.filterExtent),e.filtered?e.needsFetch&&e.fetchDone(4):e.requestFetch()}_cancelFetchTile(e){const t=e.requestController;null!=t&&(e.requestController=null,e.resetFetching(),t.abort())}async _fetchTileCount(e,t){e.numFeatures=await this._fetchCount(e,t),this._updateRatio(this._featureTilesArray)}async _fetchTile(e,t){e.fetchFailed=!1;const s=this._maximumFeaturesForTile(e);if(s<=0)return e.hasPreciseFeatureCount&&0===e.numFeatures||(e.fetchFailed=!0),k(e),e.fetchInformation.value="Empty tile",4;const i=this._getMaxRecordCount(e),r=Math.ceil(s/i);if(e.fetchingResolution=e.descriptor.resolution,N(e)||!this.context.capabilities.supportsMaxRecordCountFactor||e.numFeatures<=s&&r>D.MAX_MAX_RECORD_COUNT_FACTOR)return this._fetchPagedTile(e,t);const a=this._createQuery(e);if(a.maxRecordCountFactor=r,e.isRefetching&&e.features&&e.features.length>0){const t=Math.ceil(e.features.length/(1-e.emptyFeatureRatio)/i);a.maxRecordCountFactor=Math.max(t+1,a.maxRecordCountFactor)}e.fetchInformation.value=`Single fetch\n${s} features`;const{features:o,exceededTransferLimit:l,fields:u,missingAttributes:h}=await this._queryFeatures(a,t),d=l||a.maxRecordCountFactor>=D.MAX_MAX_RECORD_COUNT_FACTOR||s===this._totalFeaturesForTile(e)?5:4,c=await this._frameTask.schedule(()=>{e.exceededTransferLimit.value=!!l;const t=this._removeEmptyFeatures(o,this._getEffectiveTileResolution(e));return e.fetchInformation.value=`Single fetch\n${o.length}/${s} features`,e.setFeatures(o,t,H(u),V(void 0,h)),this._updateTileZQuantization(e),this._maximumFeaturesForTile(e)>s?1:d},t);return n(t),this._invalidateCounts(),c}async _fetchCount(e,t){return this.context.query.queryFeatureCount(this._createFeatureCountQuery(e),{signal:t})}async _fetchPagedTile(e,t){let s,i=0,r=0,a=0,o=this._maximumFeaturesForTile(e)-a;const l=this._getMaxRecordCount(e);let u,h=null;for(;;){const d=this._createQuery(e),c=this._setPagingParameters(d,i,o,l);e.fetchInformation.value=`Paged fetch\n${e.features?.length}/${o} features`;const{features:p,exceededTransferLimit:f,fields:_,missingAttributes:m}=await this._queryFeatures(d,t);if(await this._frameTask.schedule(()=>{c&&(i+=d.num),a+=p.length,r+=this._removeEmptyFeatures(p,this._getEffectiveTileResolution(e)),e.exceededTransferLimit.value=!!f,s=s?.concat(p)??p,h=Z(h,_),u=V(u,m),e.setFeatures(s,r,h,u),this._updateTileZQuantization(e),this._invalidateCounts(),this._setDirty()},t),n(t),o=this._maximumFeaturesForTile(e)-(s?.length??0),!c||!f||o<=0)return f?4:5}}_createFeatureCountQuery(e){const t=this._createQuery(e);return this.context.capabilities.supportsCacheHint&&(t.resultType=void 0,t.cacheHint=!0),t}_createQuery(e){const t=this.context.createQuery();return t.resultType=this._resultType(e),!N(e)&&e.descriptor.extent&&this.context.tilingScheme&&(t.geometry=T(e.descriptor.extent,this.context.tilingScheme.spatialReference)),this._setResolutionParams(t,e),"tile"!==t.resultType&&this.context.capabilities.supportsCacheHint&&(t.cacheHint=!0),S(e)&&this.context.highlightIds?.length?t.objectIds=this.context.highlightIds:!Q(e)&&this.context.effectiveDisplayFilter&&(t.where=c(t.where,this.context.effectiveDisplayFilter.where)),t}_setPagingParameters(e,t,s,i){return!!this.context.capabilities.supportsPagination&&(e.start=t,s>0&&this.context.capabilities.supportsMaxRecordCountFactor?(e.maxRecordCountFactor=Math.ceil(s/i),e.num=Math.min(e.maxRecordCountFactor*i,s)):e.num=Math.min(i),!0)}_getEffectiveTileResolution(e){if(N(e)||!this._supportsResolution)return null;const t=1===this.context.viewingMode&&this.context.tilingScheme?this.context.tilingScheme.resolutionAtLevel(3):1/0;return Math.min(e.fetchingResolution,t)/this.lodFactor/this._tileZQuantization}get _supportsResolution(){return this.context.capabilities.supportsMultipleResolutions&&"point"!==this.context.geometryType}_setResolutionParams(e,t){const s=this._getEffectiveTileResolution(t);null!=s&&(this.context.capabilities.supportsQuantization?e.quantizationParameters=new C({mode:"view",originPosition:"upper-left",tolerance:s,extent:this.context.fullExtent}):"polyline"===this.context.geometryType&&(e.maxAllowableOffset=s))}_removeEmptyFeatures(e,t){const i=e.length;if(t&&this._supportsResolution){const i=t*(1+_());s(e,({geometry:e})=>!(!e||!b(e))&&(E(e,X),x(X)>i||v(X)>i))}else s(e,({geometry:e})=>b(e));return i-e.length}_needsNumFeatures(e){return this.useTileCount&&e.needsFeatureCount&&!Q(e)}_getMaxRecordCount(e){switch(this._resultType(e)){case"tile":if(this.context.tileMaxRecordCount)return this.context.tileMaxRecordCount;break;case"standard":if(this.context.standardMaxRecordCount)return this.context.standardMaxRecordCount}return this.context.maxRecordCount||$}_resultType(e){if(this.context.capabilities.supportsResultType)return Q(e)?"standard":"tile"}get _reduceMode(){const e=this.context.geometryType;return"polygon"===e||"polyline"===e?0:1}_handleRequest(e,t,s,i,r){e.startFetch(),e.requestController=s;let n=!1;t.then(t=>{e.requestController=null,i(t)}).catch(t=>{e.requestController===s&&(e.requestController=null,e.fetchDone(4)),a(t)?n=!0:r(t)}).then(()=>{n||this._setDirty(),this._scheduleUpdated()})}_scheduleUpdated(){this.hasHandles("scheduleUpdated")||this.addHandles(h(()=>{this.removeHandles("scheduleUpdated"),this._updated()}),"scheduleUpdated")}_showTile(e){if(e.displayingFeatures&&!e.needsDisplayUpdate)return!1;const t=e.features;if(0===e.featureLimit||!t){const t=null!=e.displayingFeatures&&e.displayingFeatures.length>0;return this._hideTileFeatures(e),e.displayingFeatures=[],t}const s=e.fetchingResolution,{adds:i,updates:r}=this._changes,a=Math.min(e.featureLimit,t.length);for(let n=0;n<a;++n){const e=t[n],a=R(e,this._objectIdField),o=this._displayingFeatureReferences.get(a);if(o){const{oldVersion:t,newVersion:i}=o.ref(e,s);t!==i&&(t&&r.removes.push(t),i&&r.adds.push(i))}else this._displayingFeatureReferences.set(a,new this.FeatureReferenceClass(e,s)),i.push(e);this._numDisplayingFeatureReferences++}return this._hideTileFeatures(e),e.displayingResolution=e.fetchingResolution,this._applyChanges(),e.displayingFeatures=t.slice(0,a),!0}_hideTile(e){this._cancelFetchTile(e),this._hideTileFeatures(e)}_hideTileFeatures(e){if(null==e.displayingFeatures)return;const{updates:t,removes:s}=this._changes;for(const i of e.displayingFeatures){const r=R(i,this._objectIdField),a=this._displayingFeatureReferences.get(r);if(!a)continue;const{oldVersion:n,newVersion:o}=a.unref(e.displayingResolution);this._numDisplayingFeatureReferences--,n!==o&&(null==o?(this._displayingFeatureReferences.delete(r),n&&s.push(n)):(t.adds.push(o),n&&t.removes.push(n)))}this._applyChanges(),e.displayingFeatures=null}_notifyDataUpdating(){this._get("dataUpdating")||this._set("dataUpdating",!0)}_applyChanges(){const e=this._changes.updates;e.removes.length>0&&(this._notifyDataUpdating(),this.features.removeMany(e.removes),e.removes.length=0),e.adds.length>0&&(this._notifyDataUpdating(),this.features.addMany(e.adds),e.adds.length=0);const t=this._changes.adds,s=this._changes.removes,i=Math.min(t.length,s.length);let r=0;for(;r<i;){const e=Math.min(r+K,i);this._notifyDataUpdating(),this.features.addMany(t.slice(r,e)),this.features.removeMany(s.slice(r,e)),r=e}t.length>i&&(this._notifyDataUpdating(),this.features.addMany(0===r?t:t.slice(r))),s.length>i&&(this._notifyDataUpdating(),this.features.removeMany(0===r?s:s.slice(r))),t.length=0,s.length=0}_clearTile(e){this._hideTile(e),e.features&&null!=this.context.memoryCache&&this.context.memoryCache.put(e.id,e.cache),e.setFeatures(null,0,null,void 0),this._invalidateCounts()}_invalidateCounts(){this.notifyChange("totalVertices"),this.notifyChange("totalFeatures"),this.notifyChange("memoryForUnusedFeatures")}get _featureTilesArray(){return Array.from(this._featureTiles.values())}get featureTiles(){return this._featureTiles}get storedFeatures(){return this._featureTilesArray.reduce((e,t)=>e+(t.features?t.features.length:0),0)}get missingTiles(){return Array.from(this._featureTiles.values()).reduce((e,t)=>e+(t.needsFetch||t.isFetching?1:0),0)}_totalFeaturesForTile(e){return e.hasPreciseFeatureCount?e.numFeatures:this.maximumNumberOfFeatures}_maximumFeaturesForTile(e){const t=this._totalFeaturesForTile(e),s=this._fullRatio<1?this._farRatio:1;return Math.min(Math.ceil(t*s/(1-e.emptyFeatureRatio)),t)}get test(){}};function Q(e){return e.id===I}function S(e){return e.id===A}function N(e){return Q(e)||S(e)}function L(e){let t=0;for(const s of e)s.features&&s.features.length>0&&s.alive&&(t=Math.max(t,s.descriptor.lij[0]));return t}function k(e){e.setFeatures([],0,null,void 0)}function H(e){return null==e?new Set:new Set(e.map(e=>e.name))}function Z(e,t){if(null==e||null==t)return H(t);const s=new Set;for(const{name:i}of t)e.has(i)&&s.add(i);return s}function V(e,t){if(!t?.length)return e;e??=new Map;const s=()=>new Set;for(const{objectId:i,attribute:a}of t)r(e,i,s).add(a);return e}e([p({constructOnly:!0})],q.prototype,"features",void 0),e([p()],q.prototype,"tileDescriptors",void 0),e([p({value:1/0})],q.prototype,"maximumNumberOfFeatures",null),e([p({value:1})],q.prototype,"memoryFactor",null),e([p({value:1})],q.prototype,"lodFactor",null),e([p()],q.prototype,"useTileCount",null),e([p({readOnly:!0})],q.prototype,"updating",null),e([p({readOnly:!0})],q.prototype,"dataUpdating",void 0),e([p({readOnly:!0})],q.prototype,"updatingTotal",void 0),e([p({readOnly:!0})],q.prototype,"updatingRemaining",void 0),e([p({readOnly:!0})],q.prototype,"expectedFeatureDiff",void 0),e([p({readOnly:!0})],q.prototype,"memoryForUnusedFeatures",null),e([p({readOnly:!0})],q.prototype,"maximumNumberOfFeaturesExceeded",void 0),e([p({readOnly:!0})],q.prototype,"totalVertices",null),e([p({readOnly:!0})],q.prototype,"totalFeatures",null),e([p({readOnly:!0})],q.prototype,"showsAllFeatures",null),e([p({readOnly:!0})],q.prototype,"hasFullGeometries",null),e([p()],q.prototype,"filterExtent",null),e([p({constructOnly:!0})],q.prototype,"context",void 0),e([p()],q.prototype,"_dirty",void 0),e([p()],q.prototype,"_suspended",void 0),e([p()],q.prototype,"_pendingEdits",void 0),e([p()],q.prototype,"_applyEditsTilesUpdated",void 0),e([p()],q.prototype,"_paused",null),e([p()],q.prototype,"_isFetching",void 0),q=e([f("esri.views.3d.layers.support.FeatureTileFetcher3D")],q);const $=2e3,B=m(),G=m(),X=m(),J=6e5,K=200;export{q as FeatureTileFetcher3D};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{filterInPlace as s}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../../core/MapUtils.js";import{isAbortError as a,throwIfAborted as n}from"../../../../core/promiseUtils.js";import o from"../../../../core/ReactiveMap.js";import{on as l,watch as u}from"../../../../core/reactiveUtils.js";import{schedule as h}from"../../../../core/scheduling.js";import{signal as d}from"../../../../core/signal.js";import{sqlAnd as c}from"../../../../core/sql.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{getEpsilon as _}from"../../../../core/libs/gl-matrix-2/math/common.js";import{create as m,equals as g,clone as y,expand as F,toExtent as T,width as x,height as v}from"../../../../geometry/support/aaBoundingRect.js";import{getObjectId as R,hasVertices as b,computeAABR as E}from"../../../../layers/graphics/dehydratedFeatures.js";import C from"../../../../rest/support/QuantizationParameters.js";import D from"../../../../rest/support/Query.js";import{MultiFeatureReference as w,SingleFeatureReference as M}from"./featureReference.js";import{failedFeatureCount as U,FeatureTile as j}from"./FeatureTile.js";import{virtualDisplayFilterHighlightTileId as A,virtualSnapshotTileId as I}from"./FeatureTileDescriptor.js";import{tilesAreRelated as O}from"../../terrain/tileUtils.js";import{ImmediateTask as P,TaskPriority as z}from"../../../support/Scheduler.js";let q=class extends t{set maximumNumberOfFeatures(e){e=e||1/0;const t=this._get("maximumNumberOfFeatures");e===t||e<1||(this._set("maximumNumberOfFeatures",e),this._maximumFeaturesUpdated(t,e))}set memoryFactor(e){this.memoryFactor!==e&&(this._set("memoryFactor",e),this._setDirty())}set lodFactor(e){this.lodFactor!==e&&(this._set("lodFactor",e),this._supportsResolution&&this.refetch())}get useTileCount(){return this._useTileCount&&null!=this.context.query.queryFeatureCount}set useTileCount(e){this._useTileCount=e,this.notifyChange("useTileCount")}get updating(){return this._dirty||!!this._pendingEdits||this._isFetching||(this.tileDescriptors?.updating??!1)}get readyToRun(){return this._dirty}get memoryForUnusedFeatures(){let e=0;return this._featureTiles.forEach(t=>e+=t.estimatedUnusedSize),e}get totalVertices(){let e=0;return this._featureTiles.forEach(t=>e+=t.numVertices),e}get totalFeatures(){let e=0;return this._featureTiles.forEach(t=>e+=t.numFeatures),e}get showsAllFeatures(){if(this._paused||this.dataUpdating)return!1;for(const e of this._featureTiles.values())if(!this.hasFullGeometries&&0!==e.emptyFeatureRatio||!e.showsAllFeatures)return!1;return!0}get hasFullGeometries(){if(!this._supportsResolution)return!0;const e=this.tileDescriptors?.some(Q);return e||!this.context.capabilities.supportsQuantization&&"polyline"!==this.context.geometryType}set filterExtent(e){if(null!=e&&this.context.tilingScheme&&!e.spatialReference.equals(this.context.tilingScheme.spatialReference))return void i.getLogger(this).error("#filterExtent=","extent needs to be in the same spatial reference as the tiling scheme");const t=this._get("filterExtent");if(t===e||null!=t&&e&&t.equals(e))return;const s=null!=e?e.clone():null;this._set("filterExtent",s),this._reclip(s,t)}_updateTileZQuantization(e){if(1===this.context.viewingMode){const t=e.computeZQuantizationFactor();this._zQuantizationFactor.value<t&&(this._zQuantizationFactor.value=t)}}get _tileZQuantization(){return this.context.isDraped?1:this._zQuantizationFactor.value}constructor(e){super(e),this._useTileCount=!1,this.dataUpdating=!1,this.updatingTotal=0,this.updatingRemaining=0,this.expectedFeatureDiff=0,this.maximumNumberOfFeaturesExceeded=!1,this._fullRatio=1,this._farRatio=1,this._zQuantizationFactor=d(1),this._changes={updates:{adds:new Array,removes:new Array},adds:new Array,removes:new Array},this._featureTiles=new o,this._displayingFeatureReferences=new Map,this._numDisplayingFeatureReferences=0,this._dirty=!1,this._suspended=!0,this._pendingEdits=null,this._applyEditsTilesUpdated=!1,this._isFetching=!1;const t=e.context;this._frameTask=t.scheduler?.registerTask(z.FEATURE_TILE_FETCHER,this)??P,this.FeatureReferenceClass=t.capabilities.supportsMultipleResolutions?w:M,this._objectIdField=t.objectIdField}initialize(){this.addHandles([l(()=>this.tileDescriptors,"change",()=>this._setDirty(),{onListenerAdd:()=>this._setDirty(),onListenerRemove:()=>this._setDirty()}),u(()=>this._tileZQuantization,()=>this.refetch())]),this._setDirty()}destroy(){this._frameTask.remove(),this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._removeTile(e)}),this._featureTiles.clear(),this._displayingFeatureReferences.clear(),this._pendingEdits?.controller.abort(),this._pendingEdits=null}get _paused(){return this._suspended||!!this._pendingEdits}restart(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._clearTile(e),this._resetFetchTile(e)}),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._setDirty()}refetch(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._resetFetchTile(e)}),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._setDirty()}refetchDisplayFilterHighlightTile(){const e=this._featureTiles.get(A);e&&(this._cancelFetchTile(e),this._resetFetchTile(e),this._setDirty())}suspend(){this._suspended||(this._suspended=!0,this._pause(),this._setDirty())}resume(){this._suspended&&(this._suspended=!1,this._unpause())}getMissingAttributesForFeature(e){for(const t of this._featureTiles.values()){const s=t.missingAttributes?.get(e);if(null!=s)return s}}_pause(){this._paused&&(this._featureTiles.forEach(e=>this._cancelFetchTile(e)),this._updated())}_unpause(){this._paused||this._setDirty()}get availableFields(){let e=null;return this._featureTiles.forEach(t=>{null!=t.displayingFeatures&&0!==t.displayingFeatures.length&&(null==e?e=new Set(t.availableFields):e.forEach(s=>{t.availableFields?.has(s)||e.delete(s)}))}),null!=e?e:new Set}applyEdits(e){this._pendingEdits||(this._pendingEdits={edits:Promise.resolve(),count:0,controller:new AbortController},this._pause());const t=this._pendingEdits;t.count++;const s=t.edits.then(()=>e.result.catch(e=>{if(a(e))throw e;return null}).then(e=>e?(this._applyEditsDeleteFeatures(e.deletedFeatures),this._applyEditsAddUpdateFeatures(e.addedFeatures,e.updatedFeatures,t.controller.signal).then(()=>e)):e).then(e=>(0===--t.count&&(this._pendingEdits===t&&(this._pendingEdits=null),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._applyEditsTilesUpdated=!1,this._unpause()),e)));return t.edits=s,this._updated(),s}_applyEditsDeleteFeatures(e){if(0===e.length)return;const t=this.context.globalIdField,s=t&&this.availableFields.has(t),r=new Set,a=this._objectIdField;e.forEach(({objectId:e,globalId:n})=>{(!e||e<0)&&t&&n&&(s||i.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected in the view`),e=this._objectIdFromGlobalId(n,a,t)),null!=e&&e>=0&&r.add(e)}),this._featureTiles.forEach(e=>{if(!e.features)return;const t=e.features.filter(e=>!r.has(R(e,this._objectIdField)));t.length!==e.features.length&&(this._applyEditsTileUpdated(),e.setFeatures(t,0,e.availableFields,e.missingAttributes),this._updateTileZQuantization(e),this._invalidateCounts())})}_objectIdFromGlobalId(e,t,s){if(null==e)return null;const i=this.features.find(t=>t.attributes?.[s]===e);return i?R(i,t):null}async _applyEditsAddUpdateFeatures(e,t,s){const{objectIdField:r,globalIdField:a}=this.context,n=a&&this.availableFields.has(a),o=new Set,l=new Set;for(const i of e){const e=i.objectId;null!=e&&o.add(e)}for(const{objectId:h,globalId:d}of t){let e=h;(null==e||e<0)&&a&&(n||i.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${a} to be included the layer's outFields for updates to be reflected in the view`),e=this._objectIdFromGlobalId(d,r,a)),null!=e&&e>=0&&(o.add(e),l.add(e))}if(0===o.size)return;const u=[];this._featureTiles.forEach(e=>{const t=this._applyEditsAddUpdateTile(e,o,l,s);u.push(t)}),this._updated(),await Promise.allSettled(u)}async _applyEditsAddUpdateTile(e,t,s,i){if(!e.features)return;e.fetchingResolution=e.descriptor.resolution;const r=this._createQuery(e);r.resultType=void 0,r.cacheHint=!1,r.objectIds=Array.from(t);const a=await this._queryFeatures(r,i);let n=null;if(s.size>0){const t=e.features.filter(e=>!s.has(R(e,this._objectIdField)));t.length!==e.features.length&&(n=t)}if(a.features.length>0){n||(n=e.features.slice());for(const e of a.features)n.push(e)}n&&(e.hasPreciseFeatureCount&&(e.numFeatures=Math.max(e.numFeatures,n.length)),this._applyEditsTileUpdated(),e.setFeatures(n,0,Z(e.availableFields,a.fields),V(e.missingAttributes,a.missingAttributes)),this._updateTileZQuantization(e),this._invalidateCounts())}_applyEditsTileUpdated(){this._applyEditsTilesUpdated||(this._applyEditsTilesUpdated=!0,this._updated())}_queryFeatures(e,t){return this.context.query.queryFeaturesDehydrated(e,{signal:t,timeout:J})}_setDirty(){this._dirty=!0,this._updated()}runTask(e){const t=this._frameTask.processQueue(e);if(!this._dirty||!this.initialized)return t;this._dirty=!1;const s=this._featureTilesArray;if(this._markTilesNotAlive(s),!e.run(()=>this._addTiles(s,e))||!e.run(()=>this._filterExtentTiles(s,e))||!e.run(()=>this._removeTiles(s,e))||e.done)return void this._setDirty();const i=this._sortTiles(s);e.run(()=>this._showTiles(i,e))&&e.run(()=>this._fetchTiles(i,e))&&e.run(()=>this._updateMemoryEstimates(i,e))||this._setDirty(),this._updated(),this.updating||this._updateMaximumNumberOfFeaturesExceeded()}_markTilesNotAlive(e){for(const t of e)t.alive=!1}_addTiles(e,t){return!(this._suspended||!this.tileDescriptors)&&(this.tileDescriptors.forEach(s=>{const i=this._featureTiles.get(s.id);i?i.alive=!0:t.done||(e.push(this._addTile(s)),t.madeProgress())}),t.hasProgressed)}_filterExtentTiles(e,t){for(const s of e){if(t.done)break;s.alive&&(s.filtered=!s.intersects(this.filterExtent),s.filtered&&(this._clearTile(s),t.madeProgress()))}return t.hasProgressed}_removeTiles(e,t){for(let s=e.length-1;s>=0&&!t.done;s--){const i=e[s];i.alive||(this._removeTile(i),s!==e.length-1&&(e[s]=e[e.length-1]),e.pop(),t.madeProgress())}return t.hasProgressed}_sortTiles(e){return e.sort((e,t)=>e.descriptor.loadPriority-t.descriptor.loadPriority),e}_showTiles(e,t){const s=this._updateRatio(e),i=e=>{const t=this._fullRatio<1?s(e)*this._farRatio:1;e.reduceFeatures(t,this.memoryFactor,this._objectIdField,this._reduceMode)&&this._setDirty();const{numFeatures:i,fetchingResolution:r,descriptor:a,isFetched:n}=e;return this._supportsResolution&&i>0&&r!==a.resolution&&n&&(e.requestRefetch(),this._setDirty()),this._showTile(e)};for(const r of e)if(!t.run(()=>i(r))){this._setDirty();break}return t.hasProgressed}_fetchTiles(e,t){if(this._paused)return!1;let s=!1;for(const i of e){if(!i.needsFetch)continue;const e=null!=this.context.memoryCache?this.context.memoryCache.pop(i.id):null;if(e?.resolution!==i.displayingResolution){if(this._needsNumFeatures(i)){const e=new AbortController,r=this._fetchTileCount(i,e.signal);this._handleRequest(i,r,e,()=>i.resetFetching(),()=>i.numFeatures=U),s=!0,t.madeProgress()}if(t.done)return!0}else i.cache=e,i.numFeatures&&this._notifyDataUpdating(),this._setDirty(),this._scheduleUpdated(),t.madeProgress()}if(s)return t.hasProgressed;for(const r of e){if(!r.needsFetch)continue;const e=new AbortController,s=this._fetchTile(r,e.signal);if(this._handleRequest(r,s,e,e=>r.fetchDone(e),e=>{r.fetchFailed=!0,this.context.logFetchError(i.getLogger(this),e)}),t.madeProgress(),t.done)return!0}return t.hasProgressed}_updateMemoryEstimates(e,t){return e.some(e=>!t.run(()=>e.updateMemoryEstimates())&&(this._setDirty(),!0)),t.hasProgressed}_reclip(e,t){if(!this.initialized)return;const s=new Array;this._featureTiles.forEach(i=>{null!=i.displayingFeatures&&0!==i.displayingFeatures.length&&(i.intersectionIncludingBorrowed(t,B),i.intersectionIncludingBorrowed(e,G),g(B,G)||s.push(i))}),this._refreshDisplayingFeatures(s),this._updated()}_refreshDisplayingFeatures(e){const t=new Set,s=this._changes.updates;for(const i of e)if(null!=i.displayingFeatures)for(const e of i.displayingFeatures){const i=R(e,this._objectIdField);if(t.has(i))continue;t.add(i);const r=this._displayingFeatureReferences.get(i).feature;s.removes.push(r),s.adds.push(r)}this._applyChanges()}_updated(){let e=0;if(this._paused||this._featureTiles.forEach(t=>t.isFetching?++e:0),this._isFetching=e>0,e>0||this._applyEditsTilesUpdated?this._notifyDataUpdating():this._dirty||this._set("dataUpdating",!1),this.updating){let t=0,s=0,i=0,r=0,a=0;const n=this._displayingFeatureReferences.size/this._numDisplayingFeatureReferences;this._featureTiles.forEach(e=>{if(++s,e.isFetching&&e.hasPreciseFeatureCount){const t=this._maximumFeaturesForTile(e)*(1-e.emptyFeatureRatio),s=null!=e.displayingFeatures?e.displayingFeatures.length*n:0;a+=t-s}e.needsFetch?++r:e.numFeatures>0&&(++i,t+=e.numFeatures)}),r+=e;let o=0,l=0;t?(l=t,o=Math.min(r*t/i,t)):(l=s,o=r),a=Math.min(this.maximumNumberOfFeatures-this.features.length,a),this._set("updatingTotal",l),this._set("updatingRemaining",o),this._set("expectedFeatureDiff",a)}else this._set("updatingTotal",0),this._set("updatingRemaining",0),this._set("expectedFeatureDiff",0);this.debugger?.update()}_updateMaximumNumberOfFeaturesExceeded(){for(const{perTileMaximumNumberOfFeaturesExceeded:e}of this._featureTiles.values())if(e)return void this._set("maximumNumberOfFeaturesExceeded",!0);this._set("maximumNumberOfFeaturesExceeded",!1)}_updateRatio(e){const t=L(e),s=e=>1/(1<<Math.max(0,t-e.descriptor.lij[0]));let i=0,r=0;for(const a of e){const e=a.numFeatures;i+=e,r+=e*s(a)}return this._fullRatio=Math.min(1,this.maximumNumberOfFeatures/i),this._farRatio=this.maximumNumberOfFeatures/r,this._scheduleUpdated(),s}_maximumFeaturesUpdated(e,t){e!==t&&(t>e&&this._featureTiles.forEach(e=>{if(!e.featuresMissing)return;const t=this._maximumFeaturesForTile(e);e.isFullyFetched(t)||(this._cancelFetchTile(e),this._resetFetchTile(e))}),this._setDirty())}_addTile(e){const t=new j(e);return this._featureTiles.set(t.id,t),this._resetFetchTile(t),this._referenceDisplayingFeaturesFromRelatedTiles(t),t}_referenceDisplayingFeaturesFromRelatedTiles(e){const t=e.displayingResolution;this._featureTiles.forEach(s=>{if(null!=s.displayingFeatures&&e!==s&&O(e.descriptor.lij,s.descriptor.lij)){null==e.displayingFeatures&&(e.displayingFeatures=[]),e.descriptor.extent&&s.descriptor.extent&&(e.extentIncludingBorrowedFeatures??=y(e.descriptor.extent),F(e.extentIncludingBorrowedFeatures,s.descriptor.extent,e.extentIncludingBorrowedFeatures));for(const i of s.displayingFeatures){e.displayingFeatures.push(i);const s=this._displayingFeatureReferences.get(R(i,this._objectIdField));s.ref(s.feature,t),this._numDisplayingFeatureReferences++}}})}_removeTile(e){this._clearTile(e),this._featureTiles.delete(e.id)}_resetFetchTile(e){e.filtered=!e.intersects(this.filterExtent),e.filtered?e.needsFetch&&e.fetchDone(4):e.requestFetch()}_cancelFetchTile(e){const t=e.requestController;null!=t&&(e.requestController=null,e.resetFetching(),t.abort())}async _fetchTileCount(e,t){e.numFeatures=await this._fetchCount(e,t),this._updateRatio(this._featureTilesArray)}async _fetchTile(e,t){e.fetchFailed=!1;const s=this._maximumFeaturesForTile(e);if(s<=0)return e.hasPreciseFeatureCount&&0===e.numFeatures||(e.fetchFailed=!0),k(e),e.fetchInformation.value="Empty tile",4;const i=this._getMaxRecordCount(e),r=Math.ceil(s/i);if(e.fetchingResolution=e.descriptor.resolution,N(e)||!this.context.capabilities.supportsMaxRecordCountFactor||e.numFeatures<=s&&r>D.MAX_MAX_RECORD_COUNT_FACTOR)return this._fetchPagedTile(e,t);const a=this._createQuery(e);if(a.maxRecordCountFactor=r,e.isRefetching&&e.features&&e.features.length>0){const t=Math.ceil(e.features.length/(1-e.emptyFeatureRatio)/i);a.maxRecordCountFactor=Math.max(t+1,a.maxRecordCountFactor)}e.fetchInformation.value=`Single fetch\n${s} features`;const{features:o,exceededTransferLimit:l,fields:u,missingAttributes:h}=await this._queryFeatures(a,t),d=l||a.maxRecordCountFactor>=D.MAX_MAX_RECORD_COUNT_FACTOR||s===this._totalFeaturesForTile(e)?5:4,c=await this._frameTask.schedule(()=>{e.exceededTransferLimit.value=!!l;const t=this._removeEmptyFeatures(o,this._getEffectiveTileResolution(e));return e.fetchInformation.value=`Single fetch\n${o.length}/${s} features`,e.setFeatures(o,t,H(u),V(void 0,h)),this._updateTileZQuantization(e),this._maximumFeaturesForTile(e)>s?1:d},t);return n(t),this._invalidateCounts(),c}async _fetchCount(e,t){return this.context.query.queryFeatureCount(this._createFeatureCountQuery(e),{signal:t})}async _fetchPagedTile(e,t){let s,i=0,r=0,a=0,o=this._maximumFeaturesForTile(e)-a;const l=this._getMaxRecordCount(e);let u,h=null;for(;;){const d=this._createQuery(e),c=this._setPagingParameters(d,i,o,l);e.fetchInformation.value=`Paged fetch\n${e.features?.length}/${o} features`;const{features:p,exceededTransferLimit:f,fields:_,missingAttributes:m}=await this._queryFeatures(d,t);if(await this._frameTask.schedule(()=>{c&&(i+=d.num),a+=p.length,r+=this._removeEmptyFeatures(p,this._getEffectiveTileResolution(e)),e.exceededTransferLimit.value=!!f,s=s?.concat(p)??p,h=Z(h,_),u=V(u,m),e.setFeatures(s,r,h,u),this._updateTileZQuantization(e),this._invalidateCounts(),this._setDirty()},t),n(t),o=this._maximumFeaturesForTile(e)-(s?.length??0),!c||!f||o<=0)return f?4:5}}_createFeatureCountQuery(e){const t=this._createQuery(e);return this.context.capabilities.supportsCacheHint&&(t.resultType=void 0,t.cacheHint=!0),t}_createQuery(e){const t=this.context.createQuery();if(t.resultType=this._resultType(e),!N(e)&&e.descriptor.extent&&this.context.tilingScheme&&(t.geometry=T(e.descriptor.extent,this.context.tilingScheme.spatialReference)),this._setResolutionParams(t,e),"tile"!==t.resultType&&this.context.capabilities.supportsCacheHint&&(t.cacheHint=!0),S(e)){const{highlightIds:e}=this.context;e&&e.length>$&&i.getLogger(this).warn("highlight-too-many-features",`highlight is limited to ${$} features on large layers configured with a display filter to avoid performance issues`),t.objectIds=e?.slice(0,$)}else!Q(e)&&this.context.effectiveDisplayFilter&&(t.where=c(t.where,this.context.effectiveDisplayFilter.where));return t}_setPagingParameters(e,t,s,i){return!!this.context.capabilities.supportsPagination&&(e.start=t,s>0&&this.context.capabilities.supportsMaxRecordCountFactor?(e.maxRecordCountFactor=Math.ceil(s/i),e.num=Math.min(e.maxRecordCountFactor*i,s)):e.num=Math.min(i),!0)}_getEffectiveTileResolution(e){if(N(e)||!this._supportsResolution)return null;const t=1===this.context.viewingMode&&this.context.tilingScheme?this.context.tilingScheme.resolutionAtLevel(3):1/0;return Math.min(e.fetchingResolution,t)/this.lodFactor/this._tileZQuantization}get _supportsResolution(){return this.context.capabilities.supportsMultipleResolutions&&"point"!==this.context.geometryType}_setResolutionParams(e,t){const s=this._getEffectiveTileResolution(t);null!=s&&(this.context.capabilities.supportsQuantization?e.quantizationParameters=new C({mode:"view",originPosition:"upper-left",tolerance:s,extent:this.context.fullExtent}):"polyline"===this.context.geometryType&&(e.maxAllowableOffset=s))}_removeEmptyFeatures(e,t){const i=e.length;if(t&&this._supportsResolution){const i=t*(1+_());s(e,({geometry:e})=>!(!e||!b(e))&&(E(e,X),x(X)>i||v(X)>i))}else s(e,({geometry:e})=>b(e));return i-e.length}_needsNumFeatures(e){return this.useTileCount&&e.needsFeatureCount&&!Q(e)}_getMaxRecordCount(e){switch(this._resultType(e)){case"tile":if(this.context.tileMaxRecordCount)return this.context.tileMaxRecordCount;break;case"standard":if(this.context.standardMaxRecordCount)return this.context.standardMaxRecordCount}return this.context.maxRecordCount||$}_resultType(e){if(this.context.capabilities.supportsResultType)return Q(e)?"standard":"tile"}get _reduceMode(){const e=this.context.geometryType;return"polygon"===e||"polyline"===e?0:1}_handleRequest(e,t,s,i,r){e.startFetch(),e.requestController=s;let n=!1;t.then(t=>{e.requestController=null,i(t)}).catch(t=>{e.requestController===s&&(e.requestController=null,e.fetchDone(4)),a(t)?n=!0:r(t)}).then(()=>{n||this._setDirty(),this._scheduleUpdated()})}_scheduleUpdated(){this.hasHandles("scheduleUpdated")||this.addHandles(h(()=>{this.removeHandles("scheduleUpdated"),this._updated()}),"scheduleUpdated")}_showTile(e){if(e.displayingFeatures&&!e.needsDisplayUpdate)return!1;const t=e.features;if(0===e.featureLimit||!t){const t=null!=e.displayingFeatures&&e.displayingFeatures.length>0;return this._hideTileFeatures(e),e.displayingFeatures=[],t}const s=e.fetchingResolution,{adds:i,updates:r}=this._changes,a=Math.min(e.featureLimit,t.length);for(let n=0;n<a;++n){const e=t[n],a=R(e,this._objectIdField),o=this._displayingFeatureReferences.get(a);if(o){const{oldVersion:t,newVersion:i}=o.ref(e,s);t!==i&&(t&&r.removes.push(t),i&&r.adds.push(i))}else this._displayingFeatureReferences.set(a,new this.FeatureReferenceClass(e,s)),i.push(e);this._numDisplayingFeatureReferences++}return this._hideTileFeatures(e),e.displayingResolution=e.fetchingResolution,this._applyChanges(),e.displayingFeatures=t.slice(0,a),!0}_hideTile(e){this._cancelFetchTile(e),this._hideTileFeatures(e)}_hideTileFeatures(e){if(null==e.displayingFeatures)return;const{updates:t,removes:s}=this._changes;for(const i of e.displayingFeatures){const r=R(i,this._objectIdField),a=this._displayingFeatureReferences.get(r);if(!a)continue;const{oldVersion:n,newVersion:o}=a.unref(e.displayingResolution);this._numDisplayingFeatureReferences--,n!==o&&(null==o?(this._displayingFeatureReferences.delete(r),n&&s.push(n)):(t.adds.push(o),n&&t.removes.push(n)))}this._applyChanges(),e.displayingFeatures=null}_notifyDataUpdating(){this._get("dataUpdating")||this._set("dataUpdating",!0)}_applyChanges(){const e=this._changes.updates;e.removes.length>0&&(this._notifyDataUpdating(),this.features.removeMany(e.removes),e.removes.length=0),e.adds.length>0&&(this._notifyDataUpdating(),this.features.addMany(e.adds),e.adds.length=0);const t=this._changes.adds,s=this._changes.removes,i=Math.min(t.length,s.length);let r=0;for(;r<i;){const e=Math.min(r+K,i);this._notifyDataUpdating(),this.features.addMany(t.slice(r,e)),this.features.removeMany(s.slice(r,e)),r=e}t.length>i&&(this._notifyDataUpdating(),this.features.addMany(0===r?t:t.slice(r))),s.length>i&&(this._notifyDataUpdating(),this.features.removeMany(0===r?s:s.slice(r))),t.length=0,s.length=0}_clearTile(e){this._hideTile(e),e.features&&null!=this.context.memoryCache&&this.context.memoryCache.put(e.id,e.cache),e.setFeatures(null,0,null,void 0),this._invalidateCounts()}_invalidateCounts(){this.notifyChange("totalVertices"),this.notifyChange("totalFeatures"),this.notifyChange("memoryForUnusedFeatures")}get _featureTilesArray(){return Array.from(this._featureTiles.values())}get featureTiles(){return this._featureTiles}get storedFeatures(){return this._featureTilesArray.reduce((e,t)=>e+(t.features?t.features.length:0),0)}get missingTiles(){return Array.from(this._featureTiles.values()).reduce((e,t)=>e+(t.needsFetch||t.isFetching?1:0),0)}_totalFeaturesForTile(e){return e.hasPreciseFeatureCount?e.numFeatures:this.maximumNumberOfFeatures}_maximumFeaturesForTile(e){const t=this._totalFeaturesForTile(e),s=this._fullRatio<1?this._farRatio:1;return Math.min(Math.ceil(t*s/(1-e.emptyFeatureRatio)),t)}get test(){}};function Q(e){return e.id===I}function S(e){return e.id===A}function N(e){return Q(e)||S(e)}function L(e){let t=0;for(const s of e)s.features&&s.features.length>0&&s.alive&&(t=Math.max(t,s.descriptor.lij[0]));return t}function k(e){e.setFeatures([],0,null,void 0)}function H(e){return null==e?new Set:new Set(e.map(e=>e.name))}function Z(e,t){if(null==e||null==t)return H(t);const s=new Set;for(const{name:i}of t)e.has(i)&&s.add(i);return s}function V(e,t){if(!t?.length)return e;e??=new Map;const s=()=>new Set;for(const{objectId:i,attribute:a}of t)r(e,i,s).add(a);return e}e([p({constructOnly:!0})],q.prototype,"features",void 0),e([p()],q.prototype,"tileDescriptors",void 0),e([p({value:1/0})],q.prototype,"maximumNumberOfFeatures",null),e([p({value:1})],q.prototype,"memoryFactor",null),e([p({value:1})],q.prototype,"lodFactor",null),e([p()],q.prototype,"useTileCount",null),e([p({readOnly:!0})],q.prototype,"updating",null),e([p({readOnly:!0})],q.prototype,"dataUpdating",void 0),e([p({readOnly:!0})],q.prototype,"updatingTotal",void 0),e([p({readOnly:!0})],q.prototype,"updatingRemaining",void 0),e([p({readOnly:!0})],q.prototype,"expectedFeatureDiff",void 0),e([p({readOnly:!0})],q.prototype,"memoryForUnusedFeatures",null),e([p({readOnly:!0})],q.prototype,"maximumNumberOfFeaturesExceeded",void 0),e([p({readOnly:!0})],q.prototype,"totalVertices",null),e([p({readOnly:!0})],q.prototype,"totalFeatures",null),e([p({readOnly:!0})],q.prototype,"showsAllFeatures",null),e([p({readOnly:!0})],q.prototype,"hasFullGeometries",null),e([p()],q.prototype,"filterExtent",null),e([p({constructOnly:!0})],q.prototype,"context",void 0),e([p()],q.prototype,"_dirty",void 0),e([p()],q.prototype,"_suspended",void 0),e([p()],q.prototype,"_pendingEdits",void 0),e([p()],q.prototype,"_applyEditsTilesUpdated",void 0),e([p()],q.prototype,"_paused",null),e([p()],q.prototype,"_isFetching",void 0),q=e([f("esri.views.3d.layers.support.FeatureTileFetcher3D")],q);const $=2e3,B=m(),G=m(),X=m(),J=6e5,K=200;export{q as FeatureTileFetcher3D};
@@ -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 r from"../../../../core/Logger.js";import{removeMaybe as i,destroyMaybe as o}from"../../../../core/maybe.js";import{throwIfNotAbortError as s,throwIfAborted as n,throwIfAbortError as l}from"../../../../core/promiseUtils.js";import{initial as a}from"../../../../core/reactiveUtils.js";import{sqlAnd as u}from"../../../../core/sql.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import _ from"../../../../layers/support/FeatureFilter.js";import{getFloorFilterClause as f}from"../../../../layers/support/floorFilterUtils.js";import{QueryEngine as d}from"../graphics/QueryEngine.js";import{QueryEngineContext as g}from"../graphics/QueryEngineContext.js";import{TaskPriority as m}from"../../../support/Scheduler.js";let y=class extends t{constructor(e){super(e),this._frameTask=null,this._queryEngine=null,this._updateRequested=!0,this._updatingHandles=new h,this._abortController=new AbortController}initialize(){const e=m.FILTER_VISIBILITY,{layer:t,view:r}=this._configuration,{featureStore:i}=this.context,{spatialReference:o,resourceController:n}=r,l=this._configuration.hasZ??!1,u=this._configuration.hasM??!1,p=new g(o,t,n,()=>i,l,u);this._queryEngine=new d({context:p,priority:e}),this._frameTask=r.resourceController.scheduler.registerTask(e),this._updatingHandles.add(()=>[this._compositedFeatureFilter,this._sceneFilter],()=>this.reapply(),a),this._updatingHandles.addWhen(()=>!this._frameTask.updating&&this._updateRequested,()=>{this._frameTask.scheduleGenerator(()=>this._updateVisibility(),this._abortController.signal).catch(s)},a)}destroy(){this._abortController.abort(),this._updatingHandles.destroy(),this.clear(),this._frameTask=i(this._frameTask),this._queryEngine=o(this._queryEngine),this._set("context",null)}get updating(){return this._updateRequested||this._updatingHandles.updating||this._frameTask.updating}get defaultVisibility(){return null==this._compositedFeatureFilter&&null==this._sceneFilter}get _featureFilter(){return"filter"in this._configuration?this._configuration.filter:null}get _effectiveDisplayFilterClause(){return"effectiveDisplayFilterClause"in this._configuration?this._configuration.effectiveDisplayFilterClause:null}get _sceneFilter(){return"layerFilter"in this._configuration?this._configuration.layerFilter:null}get _floorFilter(){return f(this._configuration)}get _timeExtent(){return"timeExtent"in this._configuration?this._configuration.timeExtent:null}get _compositedFeatureFilter(){const{_featureFilter:e,_effectiveDisplayFilterClause:t,_timeExtent:r,_floorFilter:i}=this;let o=e?.clone();if(null!=t&&(o??=new _,o.where=u(o.where,t)),null!=r&&(o??=new _,o.timeExtent=o.timeExtent?.intersection(r)??r),null!=i){o??=new _;const e=null==o.where||""===o.where;o.where=e?i:u(o.where,i)}return o}get _configuration(){return this.context.configuration}reapply(){this._updateRequested=!0}clear(){this._queryEngine.clear(),this.context.clearFeaturesVisibility()}async*_updateVisibility(){this._updateRequested=!1;const{context:e,_sceneFilter:t,_compositedFeatureFilter:i,_abortController:{signal:o}}=this;if(n(o),null==i&&null==t||0===e.getFeatureCount())return this.clear();try{const r=await this._queryEngine.executeQueryForIdSet(i,t,o);n(o),yield,n(o),e.updateFeatureVisibilities(e=>r.has(e))}catch(s){l(s),r.getLogger(this).warn(`FeatureFilter query failed: ${s}`,{error:s}),e.setAllFeaturesVisibility(!0)}}};e([p({constructOnly:!0})],y.prototype,"context",void 0),e([p()],y.prototype,"updating",null),e([p()],y.prototype,"defaultVisibility",null),e([p()],y.prototype,"_featureFilter",null),e([p()],y.prototype,"_effectiveDisplayFilterClause",null),e([p()],y.prototype,"_sceneFilter",null),e([p()],y.prototype,"_floorFilter",null),e([p()],y.prototype,"_timeExtent",null),e([p()],y.prototype,"_compositedFeatureFilter",null),e([p()],y.prototype,"_configuration",null),e([p()],y.prototype,"_updateRequested",void 0),y=e([c("esri.views.3d.layers.support.FeatureVisibilityFilter")],y);export{y as FeatureVisibilityFilter};
5
+ import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{removeMaybe as r,destroyMaybe as s}from"../../../../core/maybe.js";import{throwIfNotAbortError as o,throwIfAborted as l,throwIfAbortError as n}from"../../../../core/promiseUtils.js";import{initial as a}from"../../../../core/reactiveUtils.js";import{sqlAnd as u}from"../../../../core/sql.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as c}from"../../../../core/support/UpdatingHandles.js";import g from"../../../../layers/support/FeatureFilter.js";import{getFloorFilterClause as _}from"../../../../layers/support/floorFilterUtils.js";import{QueryEngine as d}from"../graphics/QueryEngine.js";import{QueryEngineContext as f}from"../graphics/QueryEngineContext.js";import{TaskPriority as y}from"../../../support/Scheduler.js";let m=class extends e{constructor(t){super(t),this._frameTask=null,this._queryEngine=null,this._updateRequested=!0,this._updatingHandles=new c,this._abortController=new AbortController}initialize(){const t=y.FILTER_VISIBILITY,{layer:e,view:i}=this._configuration,{featureStore:r}=this.context,{spatialReference:s,resourceController:l}=i,n=this._configuration.hasZ??!1,u=this._configuration.hasM??!1,h=new f(s,e,l,()=>r,n,u);this._queryEngine=new d({context:h,priority:t}),this._frameTask=i.resourceController.scheduler.registerTask(t),this._updatingHandles.add(()=>[this._compositedFeatureFilter,this._sceneFilter,this._displayFilterHighlightIds],()=>this.reapply(),a),this._updatingHandles.addWhen(()=>!this._frameTask.updating&&this._updateRequested,()=>{this._frameTask.scheduleGenerator(()=>this._updateVisibility(),this._abortController.signal).catch(o)},a)}destroy(){this._abortController.abort(),this._updatingHandles.destroy(),this.clear(),this._frameTask=r(this._frameTask),this._queryEngine=s(this._queryEngine),this._set("context",null)}get updating(){return this._updateRequested||this._updatingHandles.updating||this._frameTask.updating}get defaultVisibility(){return null==this._compositedFeatureFilter&&null==this._sceneFilter}get _featureFilter(){return"filter"in this._configuration?this._configuration.filter:null}get _effectiveDisplayFilter(){return"effectiveDisplayFilter"in this._configuration?this._configuration.effectiveDisplayFilter:null}get _highlightIds(){return"highlightIds"in this._configuration?this._configuration.highlightIds:null}get _displayFilterHighlightIds(){return this._effectiveDisplayFilter&&this._highlightIds?.length?new Set(this._highlightIds):null}get _sceneFilter(){return"layerFilter"in this._configuration?this._configuration.layerFilter:null}get _floorFilter(){return _(this._configuration)}get _timeExtent(){return"timeExtent"in this._configuration?this._configuration.timeExtent:null}get _compositedFeatureFilter(){const{_featureFilter:t,_effectiveDisplayFilter:e,_timeExtent:i,_floorFilter:r}=this;let s=t?.clone();if(null!=e&&(s??=new g,s.where=u(s.where,e.where)),null!=i&&(s??=new g,s.timeExtent=s.timeExtent?.intersection(i)??i),null!=r){s??=new g;const t=null==s.where||""===s.where;s.where=t?r:u(s.where,r)}return s}get _configuration(){return this.context.configuration}reapply(){this._updateRequested=!0}clear(){this._queryEngine.clear(),this.context.clearFeaturesVisibility()}async*_updateVisibility(){this._updateRequested=!1;const{context:t,_sceneFilter:e,_compositedFeatureFilter:r,_displayFilterHighlightIds:s,_abortController:{signal:o}}=this;if(l(o),null==r&&null==e||0===t.getFeatureCount())return this.clear();try{let i=await this._queryEngine.executeQueryForIdSet(r,e,o);yield,s&&(i=new Set([...i,...s])),yield,t.updateFeatureVisibilities(t=>i.has(t))}catch(a){n(a),i.getLogger(this).warn(`FeatureFilter query failed: ${a}`,{error:a}),t.setAllFeaturesVisibility(!0)}}};t([h({constructOnly:!0})],m.prototype,"context",void 0),t([h()],m.prototype,"updating",null),t([h()],m.prototype,"defaultVisibility",null),t([h()],m.prototype,"_featureFilter",null),t([h()],m.prototype,"_effectiveDisplayFilter",null),t([h()],m.prototype,"_highlightIds",null),t([h()],m.prototype,"_displayFilterHighlightIds",null),t([h()],m.prototype,"_sceneFilter",null),t([h()],m.prototype,"_floorFilter",null),t([h()],m.prototype,"_timeExtent",null),t([h()],m.prototype,"_compositedFeatureFilter",null),t([h()],m.prototype,"_configuration",null),t([h()],m.prototype,"_updateRequested",void 0),m=t([p("esri.views.3d.layers.support.FeatureVisibilityFilter")],m);export{m as FeatureVisibilityFilter};
@@ -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 i from"../../../../core/Accessor.js";import{destroyHandle as r}from"../../../../core/handleUtils.js";import{when as t,watch as s,initial as p,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{ImageHighlightHelper3D as l}from"./ImageHighlightHelper3D.js";import{MapServiceLayerViewHelper as g}from"../../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as c}from"../../../support/drapedUtils.js";let d=class extends i{constructor(e){super(e)}initialize(){this._highlightHelper=new l({layer:this.layerView.layer,view:this.view,updatingHandles:this.updatingHandles}),this._mapServiceLayerViewHelper=new g({createFetchPopupFeaturesQueryGeometry:(e,i)=>c(e,i,this.view),layerView:this.layerView,updatingHandles:this.updatingHandles,highlightGraphics:this._highlightHelper.graphics,highlightGraphicUpdated:e=>this._highlightHelper.graphicsView?.graphicChanged(e)}),this.addHandles([r(this._mapServiceLayerViewHelper),t(()=>this.view?.stationary,()=>this._mapServiceLayerViewHelper.updateHighlightedFeatures(this.view.resolution),p),s(()=>this.layerView.suspended,e=>this._highlightHelper.suspended=e,o)])}fetchPopupFeaturesAtLocation(e,i){return this._highlightHelper.preload(),this._mapServiceLayerViewHelper.fetchPopupFeaturesAtLocation(e,i)}highlight(e,i){return this._highlightHelper.highlight(e,i)}};e([h()],d.prototype,"view",void 0),e([h()],d.prototype,"layerView",void 0),e([h()],d.prototype,"updatingHandles",void 0),d=e([a("esri.views.3d.layers.support.SublayerPopupHighlightHelper3D")],d);export{d as SublayerPopupHighlightHelper3D};
5
+ import{__decorate as e}from"tslib";import i from"../../../../core/Accessor.js";import{destroyHandle as r}from"../../../../core/handleUtils.js";import{ignoreAbortErrors as t}from"../../../../core/promiseUtils.js";import{when as s,watch as p,initial as o,syncAndInitial as h}from"../../../../core/reactiveUtils.js";import{property as a}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{ImageHighlightHelper3D as c}from"./ImageHighlightHelper3D.js";import{MapServiceLayerViewHelper as g}from"../../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as d}from"../../../support/drapedUtils.js";let m=class extends i{constructor(e){super(e)}initialize(){this._highlightHelper=new c({layer:this.layerView.layer,view:this.view,updatingHandles:this.updatingHandles}),this._mapServiceLayerViewHelper=new g({createFetchPopupFeaturesQueryGeometry:(e,i)=>d(e,i,this.view),layerView:this.layerView,updatingHandles:this.updatingHandles,highlightGraphics:this._highlightHelper.graphics,highlightGraphicUpdated:e=>this._highlightHelper.graphicsView?.graphicChanged(e)}),this.addHandles([r(this._mapServiceLayerViewHelper),s(()=>this._mapServiceLayerViewHelper.highlightFeaturesActive&&this.view?.stationary,()=>t(this._mapServiceLayerViewHelper.updateHighlightedFeatures(this.view.resolution)),o),p(()=>this.layerView.suspended,e=>this._highlightHelper.suspended=e,h)])}fetchPopupFeaturesAtLocation(e,i){return this._highlightHelper.preload(),this._mapServiceLayerViewHelper.fetchPopupFeaturesAtLocation(e,i)}highlight(e,i){return this._highlightHelper.highlight(e,i)}};e([a()],m.prototype,"view",void 0),e([a()],m.prototype,"layerView",void 0),e([a()],m.prototype,"updatingHandles",void 0),m=e([l("esri.views.3d.layers.support.SublayerPopupHighlightHelper3D")],m);export{m as SublayerPopupHighlightHelper3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Graphic.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Tiles3DTarget as r}from"../i3s/Intersector.js";import{IntersectorResult as t}from"../../webgl-engine/lib/IntersectorResult.js";import{MeshIntersectionOptions as s,computeInvDir as n,intersectAabbInvDir as o}from"../../webgl-engine/lib/RayIntersections.js";class l{constructor(e){this.type=8,this.slicePlaneEnabled=!1,this.isGround=!0,this.layerView=e,this.layerViewUid=e.uid,this._graphicOrigin=e.layer.graphicOrigin}intersect(e,l,a,c,u,d){if(e.options.filteredLayerViewUids.includes(this.layerView.uid))return;const h=e.results,m=2===e.options.store,p=this.layerView.view.stage.renderView.componentObjectCollection,y=new s(d,e.options.normalRequired),g=i();n(a,c,g),this.layerView.forEachVisibleComponentObject(i=>{i.intersectionGeometry&&o(i.aabbInWorldCoordinates,a,g,0)&&p.intersect(i,a,c,e.tolerance,null,y,(i,s,n,o)=>{if(s>=0){if(null!=l&&!l(a,c,s))return;const i=e=>{const i=new r(this.layerView.layer.uid,()=>this._createTiles3DGraphic(this.layerView.layer,{}));e.set(this.type,i,s,n)};if(this.isGround&&(null==h.ground.distance||s<h.ground.distance)&&i(h.ground),e.options.isFiltered)return;if((null==h.min.distance||s<h.min.distance)&&i(h.min),(null==h.max.distance||s>h.max.distance)&&i(h.max),m){const r=new t(e.ray);i(r),e.results.all.push(r)}}})})}_createTiles3DGraphic(i,r){return new e({layer:i,sourceLayer:i,origin:this._graphicOrigin,attributes:r})}}export{l as Tiles3DIntersectionHandler};
5
+ import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Tiles3DTarget as i}from"../i3s/Intersector.js";import{IntersectorResult as t}from"../../webgl-engine/lib/IntersectorResult.js";import{MeshIntersectionOptions as n,computeInvDir as s,intersectAabbInvDir as r}from"../../webgl-engine/lib/RayIntersections.js";class o{constructor(e){this.type=8,this.slicePlaneEnabled=!1,this.isGround=!0,this.layerView=e,this.layerViewUid=e.uid}intersect(o,l,a,c,d,u){if(o.options.filteredLayerViewUids.includes(this.layerView.uid))return;const m=o.results,p=2===o.options.store,w=this.layerView.view.stage.renderView.componentObjectCollection,f=new n(u,o.options.normalRequired),h=e();s(a,c,h),this.layerView.forEachVisibleComponentObject(e=>{e.intersectionGeometry&&r(e.aabbInWorldCoordinates,a,h,0)&&w.intersect(e,a,c,o.tolerance,null,f,(e,n,s,r)=>{if(n>=0){if(null!=l&&!l(a,c,n))return;const e=e=>{const t=new i(this.layerView.layer.uid);e.set(this.type,t,n,s)};if(this.isGround&&(null==m.ground.distance||n<m.ground.distance)&&e(m.ground),o.options.isFiltered)return;if((null==m.min.distance||n<m.min.distance)&&e(m.min),(null==m.max.distance||n>m.max.distance)&&e(m.max),p){const i=new t(o.ray);e(i),o.results.all.push(i)}}})})}}export{o as Tiles3DIntersectionHandler};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../Graphic.js";import{isIterable as n}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as i,createScreenPointArray as t}from"../../../core/screenUtils.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../geometry/Point.js";import l from"../../../geometry/SpatialReference.js";import{projectVectorToVector as o}from"../../../geometry/projection/projectVectorToVector.js";import{fallbackObjectIDAttribute as c}from"../../../layers/LayerConstants.js";import{isIntegratedMeshLayer as a}from"../../../layers/support/layerUtils.js";import{debugFlags as u}from"./debugFlags.js";import{getElevationAtPoint as d}from"./ElevationProvider.js";import{Intersector as p}from"../webgl-engine/lib/Intersector.js";import{isValidIntersectorResult as f}from"../webgl-engine/lib/IntersectorResult.js";import{toHit as m,toOwner as g}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as y}from"../webgl-engine/lib/verticalOffsetUtils.js";async function h(e,n,i,r){const s=i?x(e,i):r,l=t(n.x,n.y);s.requiresGroundFeedback=!0,s.enableDraped=!0;const o=new p(e.state.viewingMode);o.options.selectionMode=!0,o.options.store=2,e.sceneIntersectionHelper.intersectIntersectorScreen(l,o,s);const c=await b(e,o.results.all,s.graphics),d=o.results.ground,m=g(d,e),y=null!=m&&"type"in m&&a(m.type)?m:null,h={screenPoint:n,results:c,ground:{mapPoint:j(e,d),distance:f(d)?d.distanceInRenderSpace:0,layer:y}};return u.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=o),h}function w(e,n,t,r){const s=t?x(e,t):r,l=!(!s.graphics?.include&&!s.graphics?.exclude),o=!(!s.mediaElements?.include&&!s.mediaElements?.exclude),c=i(n);s.enableDraped=s.include&&!s.include.has(y)||s.exclude?.has(y);const a=e.sceneIntersectionHelper,u=new p(e.state.viewingMode);if(u.options.selectionMode=!0,u.options.store=l||o?2:0,u.options.excludeLabels=t?.excludeLabels??!1,a.intersectIntersectorScreen(c,u,s),l||o){for(const n of u.results.all){const i=m(n,e);if(null==i)return j(e,n);if(l&&("graphic"!==i.type||E(s.graphics,i.graphic)))return j(e,n);if(o&&("media"!==i.type||S(s.mediaElements,i.element)))return j(e,n)}return null}return j(e,u.results.min)}async function b(e,n,i){const t=new Array;let r,s=null;const l={defer(e){r=e()}};for(let o=0;o<n.length;o++){const c=n[o],u=g(c,e);if(null!=u&&(u===e.map.ground||"type"in u&&a(u.type)))break;const d=m(c,e,l)??await r;if(r=null,null==d)continue;if("graphic"===d.type){if(null==s&&o!==n.length-1&&(s=new Set),null!=s){const e=U(d.graphic);if(s.has(e))continue;s.add(e)}if(!E(i,d.graphic))continue}const p=j(e,c),f=c.distanceInRenderSpace;if("media"===d.type){const e=d.element.toSource(p);t.push({...d,mapPoint:p,distance:f,sourcePoint:e})}else t.push({...d,mapPoint:p,distance:f})}return t}function j(e,n,i){return n.getIntersectionPoint(F)?(i=V(e,F,i),2===n.intersector&&e.basemapTerrain&&(i.z=d(e.basemapTerrain,i)??0),i):null}function U(e){const n=e.sourceLayer,i=e.layer,t=n&&"objectIdField"in n?n:i&&"objectIdField"in i?i:n;if(t){const n=t.objectIdField??c,i=e.attributes?.[n];if(i)return`o-${t.id}-${i}`}return`u-${e.uid}`}function E(e,n){return S(e,U(n))}function S(e,n){return null==e||(null==e.include||e.include.has(n))&&(null==e.exclude||!e.exclude.has(n))}function V(e,n,i){let t=e.spatialReference||l.WGS84;return o(n,e.renderSpatialReference,F,t)?n=F:(t=l.WGS84,o(n,e.renderSpatialReference,F,t)&&(n=F)),i?(i.x=n[0],i.y=n[1],i.z=n[2],i.spatialReference=t):i=new s(n,t),i}function x(e,n){const i=I(e,n.include,0),t=I(e,n.exclude,1);return{include:i.layerViewUids,exclude:t.layerViewUids,graphics:{include:i.graphicUids,exclude:t.graphicUids},mediaElements:{include:i.mediaElements,exclude:t.mediaElements}}}function I(i,t,r,s=new R){if(!t)return s;if(t instanceof e)L(s,U(t)),0===r&&(null!=i.graphicsView&&t.layer===i?P(s,i.graphicsView.uid):t.layer&&T(s,i,t.layer.uid));else if("layer"in t&&"element"in t)M(s,t.element),0===r&&T(s,i,t.layer.uid);else if(n(t))for(const e of t)e===i.graphics&&null!=i.graphicsView?P(s,i.graphicsView.uid):e===i.map.ground?P(s,y):I(i,e,r,s);else"layer"in t&&v(s,i,t),"uid"in t&&T(s,i,t.uid);return s}class R{constructor(){this.layerViewUids=null,this.graphicUids=null,this.mediaElements=null}}function T(e,n,i){const t=n.allLayerViews.find(e=>e.layer.uid===i);t&&P(e,t.uid)}function P(e,n){e.layerViewUids??=new Map,e.layerViewUids.set(n,!0)}function v(e,n,i){const t=n.allLayerViews.find(e=>e.layer.uid===i.layer.uid);if(!t)return;e.layerViewUids??=new Map;const r=e.layerViewUids.get(t.uid);!0!==r&&(r?r.add(i.id):e.layerViewUids.set(t.uid,new Set([i.id])))}function L(e,n){e.graphicUids??=new Set,e.graphicUids.add(n)}function M(e,n){e.mediaElements??=new Set,e.mediaElements.add(n)}const F=r();export{V as computeMapPointFromVec3d,x as externalToInternalIntersectOptions,U as getGraphicFilterUid,h as hitTest,j as intersectResultToMapPoint,w as toMap};
5
+ import e from"../../../Graphic.js";import{isIterable as n}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as i,createScreenPointArray as t}from"../../../core/screenUtils.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../geometry/Point.js";import l from"../../../geometry/SpatialReference.js";import{projectVectorToVector as o}from"../../../geometry/projection/projectVectorToVector.js";import{fallbackObjectIDAttribute as c}from"../../../layers/LayerConstants.js";import{isIntegratedMeshLayer as a}from"../../../layers/support/layerUtils.js";import{debugFlags as u}from"./debugFlags.js";import{getElevationAtPoint as d}from"./ElevationProvider.js";import{Intersector as p}from"../webgl-engine/lib/Intersector.js";import{isValidIntersectorResult as m}from"../webgl-engine/lib/IntersectorResult.js";import{toHit as f,toOwner as g}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as y}from"../webgl-engine/lib/verticalOffsetUtils.js";async function h(e,n,i,r){const s=i?x(e,i):r,l=t(n.x,n.y);s.requiresGroundFeedback=!0,s.enableDraped=!0;const o=new p(e.state.viewingMode);o.options.selectionMode=!0,o.options.store=2,e.sceneIntersectionHelper.intersectIntersectorScreen(l,o,s);const c=await b(e,o.results.all,s.graphics),d=o.results.ground,f=g(d,e),y=null!=f&&"type"in f&&a(f.type)?f:null,h={screenPoint:n,results:c,ground:{mapPoint:U(e,d),distance:m(d)?d.distanceInRenderSpace:0,layer:y}};return u.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=o),h}function w(e,n,t,r){const s=t?x(e,t):r,l=!(!s.graphics?.include&&!s.graphics?.exclude),o=!(!s.mediaElements?.include&&!s.mediaElements?.exclude),c=i(n);s.enableDraped=s.include&&!s.include.has(y)||s.exclude?.has(y);const a=e.sceneIntersectionHelper,u=new p(e.state.viewingMode);if(u.options.selectionMode=!0,u.options.store=l||o?2:0,u.options.excludeLabels=t?.excludeLabels??!1,a.intersectIntersectorScreen(c,u,s),l||o){for(const n of u.results.all){const i=f(n,e);if(null==i)return U(e,n);if(l&&("graphic"!==i.type||E(s.graphics,i.graphic)))return U(e,n);if(o&&("media"!==i.type||S(s.mediaElements,i.element)))return U(e,n)}return null}return U(e,u.results.min)}async function b(e,n,i){const t=new Array;let r,s=null;const l={defer(e){r=e()}};for(let o=0;o<n.length;o++){const c=n[o],u=g(c,e);if(null!=u&&(u===e.map.ground||"type"in u&&a(u.type)))break;const d=f(c,e,l)??await r;if(r=null,null==d)continue;if("graphic"===d.type){if(null==s&&o!==n.length-1&&(s=new Set),null!=s){const e=j(d.graphic);if(s.has(e))continue;s.add(e)}if(!E(i,d.graphic))continue}const p=U(e,c),m=c.distanceInRenderSpace;if("media"===d.type){const e=d.element.toSource(p);t.push({...d,mapPoint:p,distance:m,sourcePoint:e})}else t.push({...d,mapPoint:p,distance:m})}return t}function U(e,n,i){return n.getIntersectionPoint(C)?(i=V(e,C,i),2===n.intersector&&e.basemapTerrain&&(i.z=d(e.basemapTerrain,i)??0),i):null}function j(e){const n=e.getObjectId()??e.attributes?.[c];return e.origin&&null!=n?`o-${e.origin.id}-${n}`:`u-${e.uid}`}function E(e,n){return S(e,j(n))}function S(e,n){return null==e||(null==e.include||e.include.has(n))&&(null==e.exclude||!e.exclude.has(n))}function V(e,n,i){let t=e.spatialReference||l.WGS84;return o(n,e.renderSpatialReference,C,t)?n=C:(t=l.WGS84,o(n,e.renderSpatialReference,C,t)&&(n=C)),i?(i.x=n[0],i.y=n[1],i.z=n[2],i.spatialReference=t):i=new s(n,t),i}function x(e,n){const i=I(e,n.include,0),t=I(e,n.exclude,1);return{include:i.layerViewUids,exclude:t.layerViewUids,graphics:{include:i.graphicUids,exclude:t.graphicUids},mediaElements:{include:i.mediaElements,exclude:t.mediaElements}}}function I(i,t,r,s=new R){if(!t)return s;if(t instanceof e)M(s,j(t)),0===r&&(null!=i.graphicsView&&t.layer===i?P(s,i.graphicsView.uid):t.layer&&T(s,i,t.layer.uid));else if("layer"in t&&"element"in t)L(s,t.element),0===r&&T(s,i,t.layer.uid);else if(n(t))for(const e of t)e===i.graphics&&null!=i.graphicsView?P(s,i.graphicsView.uid):e===i.map.ground?P(s,y):I(i,e,r,s);else"layer"in t&&v(s,i,t),"uid"in t&&T(s,i,t.uid);return s}class R{constructor(){this.layerViewUids=null,this.graphicUids=null,this.mediaElements=null}}function T(e,n,i){const t=n.allLayerViews.find(e=>e.layer.uid===i);t&&P(e,t.uid)}function P(e,n){e.layerViewUids??=new Map,e.layerViewUids.set(n,!0)}function v(e,n,i){const t=n.allLayerViews.find(e=>e.layer.uid===i.layer.uid);if(!t)return;e.layerViewUids??=new Map;const r=e.layerViewUids.get(t.uid);!0!==r&&(r?r.add(i.id):e.layerViewUids.set(t.uid,new Set([i.id])))}function M(e,n){e.graphicUids??=new Set,e.graphicUids.add(n)}function L(e,n){e.mediaElements??=new Set,e.mediaElements.add(n)}const C=r();export{V as computeMapPointFromVec3d,x as externalToInternalIntersectOptions,h as hitTest,U as intersectResultToMapPoint,w as toMap};
@@ -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 t from"../../../Camera.js";import e from"../../../Graphic.js";import n from"../../../Viewpoint.js";import{result as a}from"../../../core/asyncUtils.js";import"../../../core/has.js";import{cyclicalDegrees as r}from"../../../core/Cyclical.js";import o from"../../../core/Error.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{fromMat4 as s,transpose as c}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as u,f,j as p,c as g,d as y,i as h,o as d}from"../../../chunks/vec32.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import x from"../../../geometry/Extent.js";import j from"../../../geometry/Geometry.js";import v from"../../../geometry/Multipoint.js";import b from"../../../geometry/Point.js";import{projectWithZConversion as R,tryProjectWithZConversion as z}from"../../../geometry/projectionUtils.js";import G from"../../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as B}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectPointToVectorAsync as M}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPoint as S}from"../../../geometry/projection/projectVectorToPoint.js";import{projectVectorToVector as Z}from"../../../geometry/projection/projectVectorToVector.js";import{create as F,center as T,toRect as P,isPoint as A,empty as E,expandWithVec3 as V,expandWithAABB as U,width as k,height as O,depth as I}from"../../../geometry/support/aaBoundingBox.js";import{create as N,isPoint as C}from"../../../geometry/support/aaBoundingRect.js";import{intersectsPoint as W}from"../../../geometry/support/frustum.js";import{getResolutionInMetersForScale as Y}from"../../../geometry/support/scaleUtils.js";import{fromRenderCamera as q,toRenderCamera as D}from"../webgl.js";import{cameraOnContentAlongViewDirection as X}from"../camera/intersectionUtils.js";import{getViewSR as _,fromExtentAsync as H,scaleToDistance as J,fromCenterDistanceAsync as K,fromExtentSync as L,distanceToScale as Q,fromCenterDistanceSync as $,fromCenterScale as tt,zoomToScale as et}from"./cameraUtils.js";import{getElevationAtPoint as nt}from"./ElevationProvider.js";import{directionToHeadingTilt as at}from"./viewingModeUtils.js";const rt=.66;function ot(t){return 360-r.normalize(t)}function it(t){return r.normalize(360-t)}function st(t,e,n){const a=e.camera;if(null!=a)return lt(a,_(t));const{targetGeometry:r}=e;if(null==r)return null;const{camera:o,mode:i}=ut(t,e.rotation,n);if("point"===r.type)return ft(t,e,r,o,i);const s=r.extent;return null==s?null:L(t,s,o.heading,o.tilt,i)}async function ct(t,e,n,a){const r=e.camera;if(null!=r)return mt(r,_(t),a);const{targetGeometry:o}=e;if(null==o)throw new Error("Viewpoint has no targetGeometry!");const{camera:i,mode:s}=ut(t,e.rotation,n);if("point"===o.type)return pt(t,e,o,i,s,a);const c=o.extent;if(null==c)throw new Error("Target geometry has no extent!");return H(t,c,i.heading,i.tilt,s,a)}function lt(t,e){const n=t.position;let a;try{a=z(n,e)}catch(o){return null}if(!a)return null;const r=t.clone();return r.position=a.clone(),r}async function mt(t,e,n){const a=t.position,r=await R(a,e,{signal:n});i(n);const o=t.clone();return o.position=r.clone(),o}function ut(t,e,n){const a=q(t,t.state.camera);let r=1;return null!=e&&(a.heading=ot(e),r=0),null!=n&&(a.tilt=n),{camera:a,mode:r}}function ft(t,e,n,a,r){const o=t.spatialReference;let i;try{i=z(n.clone(),o)}catch(c){return null}if(!i)return null;const s=null!=e.scale?J(t,e.scale):t.state.camera.distance;return $(t,i,s,a,r)}async function pt(t,e,n,a,r,o){const s=t.spatialReference,c=await R(n.clone(),s,{signal:o});i(o);const l=null!=e.scale?J(t,e.scale):t.state.camera.distance;return K(t,c,l,a,r,o)}function gt(t,e,a=null){return null==a&&(a=new n),xt(t,null,e.clone(),a)}async function yt(e,a,r){const i=Pt(e,a);if(!i)throw new o("viewpointutils-create:no-target","Missing target for creating viewpoint");const s=new t({fov:e.camera.fov}),c=new n({camera:s});if(i.target instanceof n){return At(await Rt(e,i.target,i,r,c))}if(i.target instanceof t)return At(await zt(e,i.target,r,c));const l=null!=i.scale||null!=i.zoom;if(i.target instanceof x){const t=i.target.xmin===i.target.xmax||i.target.ymin===i.target.ymax;return At(l||t?await Bt(e,i,i.target.center,s,r,c):await Zt(e,i,i.target,s,r,c))}const m=new Vt,u=l?dt(e,i):void 0;if(await bt(e,i.target,u,m,r),isFinite(m.boundingBox[0])){let t;if(T(m.boundingBox,Ut),Dt.x=Ut[0],Dt.y=Ut[1],Dt.z=Ut[2],Dt.spatialReference=e.spatialReference,isFinite(Dt.z)&&m.hasZ?t=A(m.boundingBox):(Dt.z=void 0,t=C(P(m.boundingBox,Nt))),l||t)return At(await Bt(e,i,Dt,s,r,c));const n=Et(e,m.screenSpaceObjects);return At(await Tt(e,i,Dt,m.boundingBox,n,s,r,c))}return i.position?At(await Mt(e,i,s,c,r)):At(await St(e,i,s,r,c))}function ht(t,e){return null==e.scale&&null!=e.zoom?et(t,e.zoom):e.scale}function dt(t,e){const n=ht(t,e);return n?Y(n):void 0}function wt(t,e){let n=!1;return null!=e.heading?(t.heading=e.heading,n=!0):null!=e.rotation&&(t.heading=ot(e.rotation),n=!0),null!=e.tilt&&(t.tilt=e.tilt,n=!0),null!=e.fov&&(t.fov=e.fov),n}function xt(t,e,n,a){const r=t.spatialReference||G.WGS84;if(e??=D(t,n),null==e)return a;const o=new b({spatialReference:r});return S(e.center,t.renderSpatialReference,o)?(a.targetGeometry=o,a.scale=Q(t,e.distance),a.rotation=it(n.heading),a.camera=n,a):a}async function jt(t,e,n,a){const r=()=>new o("viewpointutils:invalid-geometry","The target is missing a valid geometry");if(!e)throw r();"mesh"===e.type&&(e=e.extent);const i=t.basemapTerrain.spatialReference;if(!e.hasZ&&t.basemapTerrain){let n;switch(e.type){case"point":n=e;break;case"multipoint":case"polyline":n=e.extent?.center;break;case"extent":n=e.center;break;case"polygon":n=e.centroid}null!=n&&i&&t.elevationProvider?(n=await R(n,i,{signal:a}),Ut[2]=nt(t.elevationProvider,n)??0):Ut[2]=0}const s=Xt[e.type],c=new Array;if(s(e,e.hasZ?t=>{c.push([t[0],t[1],t[2]])}:t=>{c.push([t[0],t[1]])},Ut),0===c.length)throw r();const l=e.spatialReference,m=t.spatialReference,u=await R(new v({spatialReference:l,hasZ:e.hasZ,hasM:!1,points:c}),m,{signal:a});if(e.hasZ&&(n.hasZ=!0),e.hasZ)for(const[o,f,p]of u.points)Ut[0]=o,Ut[1]=f,Ut[2]=p,V(n.boundingBox,Ut);else for(const[o,f]of u.points)Ut[0]=o,Ut[1]=f,V(n.boundingBox,Ut)}async function vt(t,e,n,r,o){const i=await a(t.whenViewForGraphic(e));if(!1===i.ok||null==i.value||!("whenGraphicBounds"in i.value))return void await jt(t,e.geometry,r,o);const s=i.value,c=await a(s.whenGraphicBounds(e,{minDemResolution:n}));if(!1===c.ok||!c.value)return void await jt(t,e.geometry,r,o);const{screenSpaceObjects:l,boundingBox:m}=c.value;U(r.boundingBox,m),l&&l.forEach(t=>{r.screenSpaceObjects.push(t)}),isFinite(m[2])&&(r.hasZ=!0)}async function bt(t,n,a,r,o){if(Array.isArray(n)&&2===n.length){const e=n[0],a=n[1];if("number"==typeof e&&"number"==typeof a)return Dt.x=e,Dt.y=a,Dt.z=void 0,Dt.spatialReference=t.spatialReference?.isGeographic?t.spatialReference:G.WGS84,void await jt(t,Dt,r,o)}n&&"map"in n&&"function"==typeof n.map?await Promise.allSettled(n.map(e=>bt(t,e,a,r,o))):n instanceof j?await jt(t,n,r,o):n instanceof e&&await vt(t,n,a,r,o)}async function Rt(t,e,n,a,r){if(e.camera)return zt(t,e.camera,a,r);r.scale=e.scale,r.rotation=e.rotation,r.targetGeometry=null!=e.targetGeometry?e.targetGeometry.clone():null,r.camera=null,null!=n.heading?r.rotation=it(n.heading):null!=n.rotation&&(r.rotation=n.rotation);const o=ht(t,n);return null!=o&&(r.scale=o),r.camera=await ct(t,r,n.tilt,a),r}async function zt(t,e,n,a){const r=t.spatialReference,o=await R(e.position,r,{signal:n}),i=e.clone();return i.position=o,xt(t,null,i,a)}async function Gt(t,e,n,a,r,o,i){const s=t.renderSpatialReference;return await M(e,Yt,s,0,{signal:i}),await M(n,Wt,s,0,{signal:i}),o.targetGeometry=new b(e),r.position=new b(n),y(Ct,Yt,Wt),at(t,Wt,Ct,a.up,r),o.scale=Q(t,p(Wt,Yt)),o.rotation=it(r.heading),o.camera=r,o}async function Bt(t,e,n,a,r,o){o.targetGeometry=n.clone();const i=X(t);if(e.position)return Gt(t,o.targetGeometry,e.position,i,a,o,r);if(e.zoomFactor){const n=i.distance/e.zoomFactor,a=u(Ut,i.viewForward,-n);i.eye=f(Ut,i.center,a),o.scale=Q(t,n)}q(t,i,a);const s=wt(a,e)?0:1;if(!e.zoomFactor){const n=ht(t,e);if(null==n){await M(o.targetGeometry,Ut,t.renderSpatialReference,0,{signal:r});const e=W(i.frustum,Ut)?p(i.eye,Ut):i.distance;o.camera=await K(t,o.targetGeometry,e,a,s),o.scale=Q(t,e)}else o.scale=n,o.camera=await tt(t,o.targetGeometry,o.scale,a,s,r)}return o}async function Mt(t,e,n,a,r){const o=X(t);g(Ct,o.viewForward),at(t,o.eye,Ct,o.up,qt);const i=t.spatialReference,{position:s}=e;if(s){const t=await R(s,i,{signal:r});n.position=t}else n.position=new b;return n.heading=null!=e.heading?e.heading:qt.heading,n.tilt=null!=e.tilt?e.tilt:qt.tilt,xt(t,null,n,a)}async function St(t,e,n,a,r){if(null!=e.heading||null!=e.rotation||null!=e.scale||null!=e.tilt||null!=e.zoom||null!=e.zoomFactor){const o=X(t),{spatialReference:i,renderSpatialReference:s}=t,c=new b({spatialReference:i});return S(o.center,s,c)?Bt(t,e,c,n,a,r):r}return r.scale=t.scale,r.camera=t.camera.clone(),wt(r.camera,e),r}async function Zt(t,e,n,a,r,o){o.targetGeometry=n.clone();const i=X(t);q(t,i,a);const s=wt(a,e)?0:1;return o.camera=await H(t,n,a.heading,a.tilt,s,r),o}function Ft(t,e,n,a,r){let o=0;null!=n.z?o=n.z:t.basemapTerrain&&t.elevationProvider&&(o=nt(t.elevationProvider,n)),h(Ut,n.x,n.y,o),B(t.spatialReference,Ut,kt,t.renderSpatialReference),s(Ot,kt),c(Ot,Ot),E(It);const i=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];for(let s=0;s<i.length;s++){const e=i[s];let n=a[e[2]];isFinite(n)||(n=o),h(Ut,a[e[0]],a[e[1]],n),Z(Ut,t.spatialReference,Ut,t.renderSpatialReference),V(It,d(Ut,Ut,Ot))}const l=k(It),m=O(It),u=I(It),f=1/Math.tan(e.fovX/2),p=1/Math.tan(e.fovY/2),g=.5*Math.sqrt(l*l+u*u)*Math.max(p,f)+.5*m,y=.5*m*p+.5*Math.max(l,u);return Math.max(g,y)/r}async function Tt(t,e,n,a,r,o,i,s){s.targetGeometry=n.clone();const c=X(t),l=Ft(t,c,n,a,r);q(t,c,o);const m=wt(o,e)?0:1;return s.camera=await K(t,s.targetGeometry,l,o,m,i),s.scale=Q(t,l),s}function Pt(t,e){if(!e||!t.spatialReference)return null;const n={target:void 0};return"declaredClass"in e||Array.isArray(e)?n.target=e:(Object.assign(n,e),!n.target&&"center"in e&&e.center&&(n.target=e.center)),n}function At(t){return null!=t?.camera&&(t.rotation=it(t.camera.heading)),t}function Et(t,e){const n=rt;if(!e.length)return n;let a=Number.NEGATIVE_INFINITY;for(let r=0;r<e.length;r++){const t=e[r].screenSpaceBoundingRect;a=Math.max(a,Math.abs(t[0]),Math.abs(t[1]),Math.abs(t[2]),Math.abs(t[3]))}return n-a/Math.min(t.width,t.height)*2}class Vt{constructor(){this.hasZ=!1,this.boundingBox=E(),this.screenSpaceObjects=new Array}}const Ut=w(),kt=m(),Ot=l(),It=F(),Nt=N(),Ct=w(),Wt=w(),Yt=w(),qt={heading:0,tilt:0},Dt=new b,Xt={point(t,e,n){n[0]=t.x,n[1]=t.y,null!=t.z&&(n[2]=t.z),e(n)},polygon(t,e,n){const a=t.hasZ;for(let r=0;r<t.rings.length;r++){const o=t.rings[r];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],a&&(n[2]=o[t][2]),e(n)}},polyline(t,e,n){const a=t.hasZ;for(let r=0;r<t.paths.length;r++){const o=t.paths[r];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],a&&(n[2]=o[t][2]),e(n)}},multipoint(t,e,n){const a=t.points,r=t.hasZ;for(let o=0;o<a.length;o++)n[0]=a[o][0],n[1]=a[o][1],r&&(n[2]=a[o][2]),e(n)},extent(t,e,n){null!=t.zmin&&null!=t.zmax?(e(h(n,t.xmin,t.ymin,t.zmin)),e(h(n,t.xmax,t.ymin,t.zmin)),e(h(n,t.xmin,t.ymax,t.zmin)),e(h(n,t.xmax,t.ymax,t.zmin)),e(h(n,t.xmin,t.ymin,t.zmax)),e(h(n,t.xmax,t.ymin,t.zmax)),e(h(n,t.xmin,t.ymax,t.zmax)),e(h(n,t.xmax,t.ymax,t.zmax))):(e(h(n,t.xmin,t.ymin,n[2])),e(h(n,t.xmax,t.ymin,n[2])),e(h(n,t.xmin,t.ymax,n[2])),e(h(n,t.xmax,t.ymax,n[2])))}};export{yt as create,gt as fromCamera,ct as toCameraAsync,st as toCameraSync};
5
+ import t from"../../../Camera.js";import e from"../../../Graphic.js";import n from"../../../Viewpoint.js";import{result as r}from"../../../core/asyncUtils.js";import"../../../core/has.js";import{cyclicalDegrees as a}from"../../../core/Cyclical.js";import o from"../../../core/Error.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{fromMat4 as s,transpose as c}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as u,f,j as p,c as g,d as y,i as h,o as d}from"../../../chunks/vec32.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import x from"../../../geometry/Extent.js";import j from"../../../geometry/Geometry.js";import v from"../../../geometry/Multipoint.js";import b from"../../../geometry/Point.js";import{projectWithZConversion as R,tryProjectWithZConversion as z}from"../../../geometry/projectionUtils.js";import G from"../../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as B}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectPointToVectorAsync as M}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPoint as S}from"../../../geometry/projection/projectVectorToPoint.js";import{projectVectorToVector as Z}from"../../../geometry/projection/projectVectorToVector.js";import{create as F,center as T,toRect as P,isPoint as A,empty as E,expandWithVec3 as V,expandWithAABB as k,width as O,height as U,depth as N}from"../../../geometry/support/aaBoundingBox.js";import{create as I,isPoint as C}from"../../../geometry/support/aaBoundingRect.js";import{polygonCentroidPoint as W}from"../../../geometry/support/centroid.js";import{intersectsPoint as Y}from"../../../geometry/support/frustum.js";import{getResolutionInMetersForScale as q}from"../../../geometry/support/scaleUtils.js";import{fromRenderCamera as D,toRenderCamera as J}from"../webgl.js";import{cameraOnContentAlongViewDirection as X}from"../camera/intersectionUtils.js";import{getViewSR as _,fromExtentAsync as H,scaleToDistance as K,fromCenterDistanceAsync as L,fromExtentSync as Q,distanceToScale as $,fromCenterDistanceSync as tt,fromCenterScale as et,zoomToScale as nt}from"./cameraUtils.js";import{getElevationAtPoint as rt}from"./ElevationProvider.js";import{directionToHeadingTilt as at}from"./viewingModeUtils.js";const ot=.66;function it(t){return 360-a.normalize(t)}function st(t){return a.normalize(360-t)}function ct(t,e,n){const r=e.camera;if(null!=r)return mt(r,_(t));const{targetGeometry:a}=e;if(null==a)return null;const{camera:o,mode:i}=ft(t,e.rotation,n);if("point"===a.type)return pt(t,e,a,o,i);const s=a.extent;return null==s?null:Q(t,s,o.heading,o.tilt,i)}async function lt(t,e,n,r){const a=e.camera;if(null!=a)return ut(a,_(t),r);const{targetGeometry:o}=e;if(null==o)throw new Error("Viewpoint has no targetGeometry!");const{camera:i,mode:s}=ft(t,e.rotation,n);if("point"===o.type)return gt(t,e,o,i,s,r);const c=o.extent;if(null==c)throw new Error("Target geometry has no extent!");return H(t,c,i.heading,i.tilt,s,r)}function mt(t,e){const n=t.position;let r;try{r=z(n,e)}catch(o){return null}if(!r)return null;const a=t.clone();return a.position=r.clone(),a}async function ut(t,e,n){const r=t.position,a=await R(r,e,{signal:n});i(n);const o=t.clone();return o.position=a.clone(),o}function ft(t,e,n){const r=D(t,t.state.camera);let a=1;return null!=e&&(r.heading=it(e),a=0),null!=n&&(r.tilt=n),{camera:r,mode:a}}function pt(t,e,n,r,a){const o=t.spatialReference;let i;try{i=z(n.clone(),o)}catch(c){return null}if(!i)return null;const s=null!=e.scale?K(t,e.scale):t.state.camera.distance;return tt(t,i,s,r,a)}async function gt(t,e,n,r,a,o){const s=t.spatialReference,c=await R(n.clone(),s,{signal:o});i(o);const l=null!=e.scale?K(t,e.scale):t.state.camera.distance;return L(t,c,l,r,a,o)}function yt(t,e,r=null){return null==r&&(r=new n),jt(t,null,e.clone(),r)}async function ht(e,r,a){const i=At(e,r);if(!i)throw new o("viewpointutils-create:no-target","Missing target for creating viewpoint");const s=new t({fov:e.camera.fov}),c=new n({camera:s});if(i.target instanceof n){return Et(await zt(e,i.target,i,a,c))}if(i.target instanceof t)return Et(await Gt(e,i.target,a,c));const l=null!=i.scale||null!=i.zoom;if(i.target instanceof x){const t=i.target.xmin===i.target.xmax||i.target.ymin===i.target.ymax;return Et(l||t?await Mt(e,i,i.target.center,s,a,c):await Ft(e,i,i.target,s,a,c))}const m=new kt,u=l?wt(e,i):void 0;if(await Rt(e,i.target,u,m,a),isFinite(m.boundingBox[0])){let t;if(T(m.boundingBox,Ot),Jt.x=Ot[0],Jt.y=Ot[1],Jt.z=Ot[2],Jt.spatialReference=e.spatialReference,isFinite(Jt.z)&&m.hasZ?t=A(m.boundingBox):(Jt.z=void 0,t=C(P(m.boundingBox,Ct))),l||t)return Et(await Mt(e,i,Jt,s,a,c));const n=Vt(e,m.screenSpaceObjects);return Et(await Pt(e,i,Jt,m.boundingBox,n,s,a,c))}return i.position?Et(await St(e,i,s,c,a)):Et(await Zt(e,i,s,a,c))}function dt(t,e){return null==e.scale&&null!=e.zoom?nt(t,e.zoom):e.scale}function wt(t,e){const n=dt(t,e);return n?q(n):void 0}function xt(t,e){let n=!1;return null!=e.heading?(t.heading=e.heading,n=!0):null!=e.rotation&&(t.heading=it(e.rotation),n=!0),null!=e.tilt&&(t.tilt=e.tilt,n=!0),null!=e.fov&&(t.fov=e.fov),n}function jt(t,e,n,r){const a=t.spatialReference||G.WGS84;if(e??=J(t,n),null==e)return r;const o=new b({spatialReference:a});return S(e.center,t.renderSpatialReference,o)?(r.targetGeometry=o,r.scale=$(t,e.distance),r.rotation=st(n.heading),r.camera=n,r):r}async function vt(t,e,n,r){const a=()=>new o("viewpointutils:invalid-geometry","The target is missing a valid geometry");if(!e)throw a();"mesh"===e.type&&(e=e.extent);const i=t.basemapTerrain.spatialReference;if(!e.hasZ&&t.basemapTerrain){let n;switch(e.type){case"point":n=e;break;case"multipoint":case"polyline":n=e.extent?.center;break;case"extent":n=e.center;break;case"polygon":{const t=W(e);n=t?b.fromJSON(t):null;break}}null!=n&&i&&t.elevationProvider?(n=await R(n,i,{signal:r}),Ot[2]=rt(t.elevationProvider,n)??0):Ot[2]=0}const s=Xt[e.type],c=new Array;if(s(e,e.hasZ?t=>{c.push([t[0],t[1],t[2]])}:t=>{c.push([t[0],t[1]])},Ot),0===c.length)throw a();const l=e.spatialReference,m=t.spatialReference,u=await R(new v({spatialReference:l,hasZ:e.hasZ,hasM:!1,points:c}),m,{signal:r});if(e.hasZ&&(n.hasZ=!0),e.hasZ)for(const[o,f,p]of u.points)Ot[0]=o,Ot[1]=f,Ot[2]=p,V(n.boundingBox,Ot);else for(const[o,f]of u.points)Ot[0]=o,Ot[1]=f,V(n.boundingBox,Ot)}async function bt(t,e,n,a,o){const i=await r(t.whenViewForGraphic(e));if(!1===i.ok||null==i.value||!("whenGraphicBounds"in i.value))return void await vt(t,e.geometry,a,o);const s=i.value,c=await r(s.whenGraphicBounds(e,{minDemResolution:n}));if(!1===c.ok||!c.value)return void await vt(t,e.geometry,a,o);const{screenSpaceObjects:l,boundingBox:m}=c.value;k(a.boundingBox,m),l&&l.forEach(t=>{a.screenSpaceObjects.push(t)}),isFinite(m[2])&&(a.hasZ=!0)}async function Rt(t,n,r,a,o){if(Array.isArray(n)&&2===n.length){const e=n[0],r=n[1];if("number"==typeof e&&"number"==typeof r)return Jt.x=e,Jt.y=r,Jt.z=void 0,Jt.spatialReference=t.spatialReference?.isGeographic?t.spatialReference:G.WGS84,void await vt(t,Jt,a,o)}n&&"map"in n&&"function"==typeof n.map?await Promise.allSettled(n.map(e=>Rt(t,e,r,a,o))):n instanceof j?await vt(t,n,a,o):n instanceof e&&await bt(t,n,r,a,o)}async function zt(t,e,n,r,a){if(e.camera)return Gt(t,e.camera,r,a);a.scale=e.scale,a.rotation=e.rotation,a.targetGeometry=null!=e.targetGeometry?e.targetGeometry.clone():null,a.camera=null,null!=n.heading?a.rotation=st(n.heading):null!=n.rotation&&(a.rotation=n.rotation);const o=dt(t,n);return null!=o&&(a.scale=o),a.camera=await lt(t,a,n.tilt,r),a}async function Gt(t,e,n,r){const a=t.spatialReference,o=await R(e.position,a,{signal:n}),i=e.clone();return i.position=o,jt(t,null,i,r)}async function Bt(t,e,n,r,a,o,i){const s=t.renderSpatialReference;return await M(e,qt,s,0,{signal:i}),await M(n,Yt,s,0,{signal:i}),o.targetGeometry=new b(e),a.position=new b(n),y(Wt,qt,Yt),at(t,Yt,Wt,r.up,a),o.scale=$(t,p(Yt,qt)),o.rotation=st(a.heading),o.camera=a,o}async function Mt(t,e,n,r,a,o){o.targetGeometry=n.clone();const i=X(t);if(e.position)return Bt(t,o.targetGeometry,e.position,i,r,o,a);if(e.zoomFactor){const n=i.distance/e.zoomFactor,r=u(Ot,i.viewForward,-n);i.eye=f(Ot,i.center,r),o.scale=$(t,n)}D(t,i,r);const s=xt(r,e)?0:1;if(!e.zoomFactor){const n=dt(t,e);if(null==n){await M(o.targetGeometry,Ot,t.renderSpatialReference,0,{signal:a});const e=Y(i.frustum,Ot)?p(i.eye,Ot):i.distance;o.camera=await L(t,o.targetGeometry,e,r,s),o.scale=$(t,e)}else o.scale=n,o.camera=await et(t,o.targetGeometry,o.scale,r,s,a)}return o}async function St(t,e,n,r,a){const o=X(t);g(Wt,o.viewForward),at(t,o.eye,Wt,o.up,Dt);const i=t.spatialReference,{position:s}=e;if(s){const t=await R(s,i,{signal:a});n.position=t}else n.position=new b;return n.heading=null!=e.heading?e.heading:Dt.heading,n.tilt=null!=e.tilt?e.tilt:Dt.tilt,jt(t,null,n,r)}async function Zt(t,e,n,r,a){if(null!=e.heading||null!=e.rotation||null!=e.scale||null!=e.tilt||null!=e.zoom||null!=e.zoomFactor){const o=X(t),{spatialReference:i,renderSpatialReference:s}=t,c=new b({spatialReference:i});return S(o.center,s,c)?Mt(t,e,c,n,r,a):a}return a.scale=t.scale,a.camera=t.camera.clone(),xt(a.camera,e),a}async function Ft(t,e,n,r,a,o){o.targetGeometry=n.clone();const i=X(t);D(t,i,r);const s=xt(r,e)?0:1;return o.camera=await H(t,n,r.heading,r.tilt,s,a),o}function Tt(t,e,n,r,a){let o=0;null!=n.z?o=n.z:t.basemapTerrain&&t.elevationProvider&&(o=rt(t.elevationProvider,n)),h(Ot,n.x,n.y,o),B(t.spatialReference,Ot,Ut,t.renderSpatialReference),s(Nt,Ut),c(Nt,Nt),E(It);const i=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];for(let s=0;s<i.length;s++){const e=i[s];let n=r[e[2]];isFinite(n)||(n=o),h(Ot,r[e[0]],r[e[1]],n),Z(Ot,t.spatialReference,Ot,t.renderSpatialReference),V(It,d(Ot,Ot,Nt))}const l=O(It),m=U(It),u=N(It),f=1/Math.tan(e.fovX/2),p=1/Math.tan(e.fovY/2),g=.5*Math.sqrt(l*l+u*u)*Math.max(p,f)+.5*m,y=.5*m*p+.5*Math.max(l,u);return Math.max(g,y)/a}async function Pt(t,e,n,r,a,o,i,s){s.targetGeometry=n.clone();const c=X(t),l=Tt(t,c,n,r,a);D(t,c,o);const m=xt(o,e)?0:1;return s.camera=await L(t,s.targetGeometry,l,o,m,i),s.scale=$(t,l),s}function At(t,e){if(!e||!t.spatialReference)return null;const n={target:void 0};return"declaredClass"in e||Array.isArray(e)?n.target=e:(Object.assign(n,e),!n.target&&"center"in e&&e.center&&(n.target=e.center)),n}function Et(t){return null!=t?.camera&&(t.rotation=st(t.camera.heading)),t}function Vt(t,e){const n=ot;if(!e.length)return n;let r=Number.NEGATIVE_INFINITY;for(let a=0;a<e.length;a++){const t=e[a].screenSpaceBoundingRect;r=Math.max(r,Math.abs(t[0]),Math.abs(t[1]),Math.abs(t[2]),Math.abs(t[3]))}return n-r/Math.min(t.width,t.height)*2}class kt{constructor(){this.hasZ=!1,this.boundingBox=E(),this.screenSpaceObjects=new Array}}const Ot=w(),Ut=m(),Nt=l(),It=F(),Ct=I(),Wt=w(),Yt=w(),qt=w(),Dt={heading:0,tilt:0},Jt=new b,Xt={point(t,e,n){n[0]=t.x,n[1]=t.y,null!=t.z&&(n[2]=t.z),e(n)},polygon(t,e,n){const r=t.hasZ;for(let a=0;a<t.rings.length;a++){const o=t.rings[a];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],r&&(n[2]=o[t][2]),e(n)}},polyline(t,e,n){const r=t.hasZ;for(let a=0;a<t.paths.length;a++){const o=t.paths[a];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],r&&(n[2]=o[t][2]),e(n)}},multipoint(t,e,n){const r=t.points,a=t.hasZ;for(let o=0;o<r.length;o++)n[0]=r[o][0],n[1]=r[o][1],a&&(n[2]=r[o][2]),e(n)},extent(t,e,n){null!=t.zmin&&null!=t.zmax?(e(h(n,t.xmin,t.ymin,t.zmin)),e(h(n,t.xmax,t.ymin,t.zmin)),e(h(n,t.xmin,t.ymax,t.zmin)),e(h(n,t.xmax,t.ymax,t.zmin)),e(h(n,t.xmin,t.ymin,t.zmax)),e(h(n,t.xmax,t.ymin,t.zmax)),e(h(n,t.xmin,t.ymax,t.zmax)),e(h(n,t.xmax,t.ymax,t.zmax))):(e(h(n,t.xmin,t.ymin,n[2])),e(h(n,t.xmax,t.ymin,n[2])),e(h(n,t.xmin,t.ymax,n[2])),e(h(n,t.xmax,t.ymax,n[2])))}};export{ht as create,yt as fromCamera,lt as toCameraAsync,ct as toCameraSync};
@@ -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{isValidIntersectorResult as t}from"../webgl-engine/lib/IntersectorResult.js";import{Graphic3DTarget as e}from"../webgl-engine/lib/IntersectorTarget.js";function r(e){return t(e)&&2===e.intersector&&!!e.target}class n extends e{constructor(t,e,r){super(t,e),this.triangleNr=r}}function o(e){return t(e)&&3===e.intersector&&!!e.target}export{n as OverlayTarget,o as isOverlayIntersectorResult,r as isTerrainIntersectorResult};
5
+ import{isValidIntersectorResult as e}from"../webgl-engine/lib/IntersectorResult.js";import{Graphic3DTarget as t}from"../webgl-engine/lib/IntersectorTarget.js";function r(t){return e(t)&&2===t.intersector&&!!t.target}function n(t,r){if(!e(r)||!r.target||!("layerViewUid"in r.target))return!1;const n=r.target.layerViewUid,i=t.allLayerViews.find(e=>e.uid===n);switch(i?.layer.type){case"integrated-mesh":case"integrated-mesh-3dtiles":return!0}return!1}class i extends t{constructor(e,t,r){super(e,t),this.triangleNr=r}}function s(t){return e(t)&&3===t.intersector&&!!t.target}export{i as OverlayTarget,n as isIntegratedMeshIntersectorResult,s as isOverlayIntersectorResult,r as isTerrainIntersectorResult};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{ManagedColorAttachment as t}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthTexture as r}from"../../webgl/ManagedDepthTexture.js";import a from"../../webgl/ManagedFBO.js";import{isDepthFormat as c,DepthTextureFormats as h,ColorFormats as i}from"./FBOCacheFormats.js";import{FBOPool as n}from"./FBOPool.js";import{DepthStencilAttachment as o,ColorAttachment0 as s}from"../../../webgl/enums.js";import{FramebufferObject as l}from"../../../webgl/FramebufferObject.js";import{Texture as u}from"../../../webgl/Texture.js";class m{constructor(e){this.rctx=e,this._interactive=!1,this._acquired=new Set,this._cache=new n(e.newCache,"FBOCache"),this._depthCache=new n(e.newCache,"DepthAttachmentCache"),this._colorCache=new n(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.()}frameEnd(){const{debugCallback:e}=this;e&&this._acquired.forEach(t=>e(t.name,t.fbo))}get usedMemory(){return Array.from(this._acquired.values()).reduce((e,t)=>e+t.cachedMemory,this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e,this._interactive=e}get interactive(){return this._interactive}acquire(t,r,h,i=5){const n=_(i,t,r);let u=this._cache.pop(n);const{rctx:m}=this;if(u){u.retain(),u.setName(h);const t=u.getAttachment(o);t&&(t.name=f(h));const r=u.getAttachment(s);r&&(r.name=d(h,0));const{fbo:a}=u;if(!a)throw new e("renderer","attempt to use a none existing framebuffer");m.temporaryBindFramebufferObject(a,()=>{m.setDrawBuffers([s]),m.unbindTexture(a.colorTexture)})}else{const e=new l(m),p=(e,a,c)=>{a??=5;const h=this._acquireColor(a,t,r,c??d(u.name,e-s));return this.rctx.unbindTexture(h.attachment),u.attachColor(h,e),h.release(),u},_=e=>{e??=12;const a=this.acquireDepth(e,t,r,f(u.name));return u.attachDepth(a),a.release(),u},C=()=>{if(!u)return;this.debugCallback?.(u.name,u.fbo),this._acquired.delete(u);const e=c(i);e&&null!=u.getAttachment(o)||!e&&null!=u.getAttachment(s)?(e?(u.fbo?.invalidateAttachments([o]),u.detachAllColors()):(u.fbo?.invalidateAttachments([s]),u.detachAllButColor0()),this._cache.put(u)):u.dispose()};u=new a(n,h,e,p,_,C),c(i)?u.acquireDepth(i):u.acquireColor(s,i,h)}return this._trackHandle(u)}acquireDepth(e,t,a,c){const i=_(e,t,a);let n=this._depthCache.pop(i);if(n)n.retain(),n.attachment.setShadowFiltering(!1);else{const c=new u(this.rctx,{...h[e],width:t,height:a});n=new r(i,c,()=>this._depthCache.put(n))}return n.name=c,n}_acquireColor(e,r,a,c){const h=_(e,r,a);let n=this._colorCache.pop(h);if(n)n.retain();else{const c=new u(this.rctx,{...i[e],width:r,height:a});n=new t(h,c,()=>this._colorCache.put(n))}return n.name=c,n}_trackHandle(e){return this._acquired.add(e),e}}function d(e,t=0){return`${e}.color${t}`}function f(e){return`${e}.depth`}const p=new a("default","default",null,()=>p,()=>p,()=>{});function _(e,t,r){return`${t}x${r}:${e}`}p.release=()=>!1;export{m as FBOCache,p as defaultWebGLFBO};
5
+ import e from"../../../../core/Error.js";import{ManagedColorAttachment as t}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthTexture as a}from"../../webgl/ManagedDepthTexture.js";import r from"../../webgl/ManagedFBO.js";import{isDepthFormat as c,formatString as h,DepthTextureFormats as s,ColorFormats as i}from"./FBOCacheFormats.js";import{FBOPool as n}from"./FBOPool.js";import{DepthStencilAttachment as o,ColorAttachment0 as l}from"../../../webgl/enums.js";import{FramebufferObject as u}from"../../../webgl/FramebufferObject.js";import{Texture as m}from"../../../webgl/Texture.js";class d{constructor(e){this.rctx=e,this._interactive=!1,this._usage=new Map,this._acquired=new Set,this._cache=new n(e.newCache,"FBOCache"),this._depthCache=new n(e.newCache,"DepthAttachmentCache"),this._colorCache=new n(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.(),this._usage.clear()}frameEnd(){const{debugCallback:e}=this;e&&this._acquired.forEach(t=>e(t.name,t.fbo,this._usage))}get usedMemory(){return Array.from(this._acquired.values()).reduce((e,t)=>e+t.cachedMemory,this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e,this._interactive=e}get interactive(){return this._interactive}acquire(t,a,s,i=5){const n=C(i,t,a);let m=this._cache.pop(n);const{rctx:d}=this;if(m){m.retain(),m.setName(s);const t=m.getAttachment(o);t&&(t.name=f(s));const a=m.getAttachment(l);a&&(a.name=_(s,0));const{fbo:r}=m;if(!r)throw new e("renderer","attempt to use a none existing framebuffer");d.temporaryBindFramebufferObject(r,()=>{d.setDrawBuffers([l]),d.unbindTexture(r.colorTexture)})}else{const e=new u(d),h=(e,r,c)=>{r??=5;const h=this._acquireColor(r,t,a,c??_(m.name,e-l));return this.rctx.unbindTexture(h.attachment),m.attachColor(h,e),h.release(),m},p=e=>{e??=12;const r=this.acquireDepth(e,t,a,f(m.name));return m.attachDepth(r),r.release(),m},C=()=>{if(!m)return;this.debugCallback?.(m.name,m.fbo),this._acquired.delete(m);const e=c(i);e&&null!=m.getAttachment(o)||!e&&null!=m.getAttachment(l)?(e?(m.fbo?.invalidateAttachments([o]),m.detachAllColors()):(m.fbo?.invalidateAttachments([l]),m.detachAllButColor0()),this._cache.put(m)):m.dispose()};m=new r(n,s,e,h,p,C),c(i)?m.acquireDepth(i):m.acquireColor(l,i,s)}return this._trackUsage(m,"fbo "+h(i),t,a),this._trackHandle(m)}acquireDepth(e,t,r,c){const i=C(e,t,r);let n=this._depthCache.pop(i);if(n)n.retain(),n.attachment.setShadowFiltering(!1);else{const c=new m(this.rctx,{...s[e],width:t,height:r});n=new a(i,c,()=>this._depthCache.put(n))}return n.name=c,this._trackUsage(n,"depth "+h(e),t,r),n}_acquireColor(e,a,r,c){const s=C(e,a,r);let n=this._colorCache.pop(s);if(n)n.retain();else{const c=new m(this.rctx,{...i[e],width:a,height:r});n=new t(s,c,()=>this._colorCache.put(n))}return n.name=c,this._trackUsage(n,"color "+h(e),a,r),n}_trackHandle(e){return this._acquired.add(e),e}_trackUsage(e,t,a,r){this.debugCallback&&(this._usage.has(e)?this._usage.get(e)[2].push(e.name):this._usage.set(e,[t,`${a}x${r}`,[e.name]]))}}function _(e,t=0){return`${e}.color${t}`}function f(e){return`${e}.depth`}const p=new r("default","default",null,()=>p,()=>p,()=>{});function C(e,t,a){return`${t}x${a}:${e}`}p.release=()=>!1;export{d as FBOCache,p as defaultWebGLFBO};
@@ -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{SizedPixelFormat as e,PixelType as a,SizedDepthStencilFormat as t,SizedDepthFormat as n}from"../../../webgl/enums.js";import{TextureDescriptor as o}from"../../../webgl/TextureDescriptor.js";import{isSizedDepthFormat as r}from"../../../webgl/textureUtils.js";function p(e){return e>=11}const m=new o;m.pixelFormat=6403,m.internalFormat=e.R8,m.wrapMode=33071;const i=new o;i.pixelFormat=36244,i.internalFormat=e.R8UI,i.wrapMode=33071,i.samplingMode=9728;const l=new o;l.pixelFormat=33319,l.internalFormat=e.RG8,l.wrapMode=33071;const F=new o;F.pixelFormat=33320,F.internalFormat=e.RG8UI,F.wrapMode=33071,F.samplingMode=9728;const T=new o;T.internalFormat=e.RGBA4,T.dataType=a.UNSIGNED_SHORT_4_4_4_4,T.wrapMode=33071;const s=new o;s.wrapMode=33071;const _=new o;_.wrapMode=33071,_.samplingMode=9987,_.hasMipmap=!0,_.maxAnisotropy=8;const w=new o;w.pixelFormat=6403,w.dataType=a.HALF_FLOAT,w.internalFormat=e.R16F,w.samplingMode=9728;const N=new o;N.dataType=a.HALF_FLOAT,N.internalFormat=e.RGBA16F,N.wrapMode=33071;const d=new o;d.pixelFormat=6403,d.dataType=a.FLOAT,d.internalFormat=e.R32F,d.samplingMode=9728;const M=new o;M.pixelFormat=33319,M.dataType=a.FLOAT,M.internalFormat=e.RG32F,M.samplingMode=9728;const E={0:m,1:i,2:l,3:F,4:T,5:s,6:_,7:w,8:N,9:d,10:M,11:null},c={[n.DEPTH_COMPONENT16]:a.UNSIGNED_SHORT,[n.DEPTH_COMPONENT24]:a.UNSIGNED_INT,[n.DEPTH_COMPONENT32F]:a.FLOAT,[t.DEPTH24_STENCIL8]:a.UNSIGNED_INT_24_8,[t.DEPTH32F_STENCIL8]:a.FLOAT_32_UNSIGNED_INT_24_8_REV},O={12:I(t.DEPTH24_STENCIL8),11:I(n.DEPTH_COMPONENT16)};function I(e){const a=new o;return a.pixelFormat=r(e)?6402:34041,a.dataType=c[e],a.samplingMode=9728,a.wrapMode=33071,a.internalFormat=e,a.hasMipmap=!1,a.isImmutable=!0,a}export{E as ColorFormats,O as DepthTextureFormats,p as isDepthFormat};
5
+ import{SizedPixelFormat as e,PixelType as r,SizedDepthStencilFormat as n,SizedDepthFormat as t}from"../../../webgl/enums.js";import{TextureDescriptor as a}from"../../../webgl/TextureDescriptor.js";import{isSizedDepthFormat as o}from"../../../webgl/textureUtils.js";function s(e){switch(e){case 0:return"R8UNORM";case 1:return"R8UINT";case 2:return"RG8UNORM";case 3:return"RG8UINT";case 4:return"RGBA4UNORM";case 5:return"RGBA8UNORM";case 6:return"RGBA8UNORM_MIPMAP";case 7:return"R16FLOAT";case 8:return"RGBA16FLOAT";case 9:return"R32FLOAT";case 10:return"RG32FLOAT";case 11:return"COUNT"}}function T(e){switch(e){case 11:return"DEPTH16";case 12:return"DEPTH24_STENCIL8"}}function i(e){return p(e)?T(e):s(e)}function p(e){return e>=11}const m=new a;m.pixelFormat=6403,m.internalFormat=e.R8,m.wrapMode=33071;const F=new a;F.pixelFormat=36244,F.internalFormat=e.R8UI,F.wrapMode=33071,F.samplingMode=9728;const c=new a;c.pixelFormat=33319,c.internalFormat=e.RG8,c.wrapMode=33071;const N=new a;N.pixelFormat=33320,N.internalFormat=e.RG8UI,N.wrapMode=33071,N.samplingMode=9728;const l=new a;l.internalFormat=e.RGBA4,l.dataType=r.UNSIGNED_SHORT_4_4_4_4,l.wrapMode=33071;const M=new a;M.wrapMode=33071;const R=new a;R.wrapMode=33071,R.samplingMode=9987,R.hasMipmap=!0,R.maxAnisotropy=8;const u=new a;u.pixelFormat=6403,u.dataType=r.HALF_FLOAT,u.internalFormat=e.R16F,u.samplingMode=9728;const _=new a;_.dataType=r.HALF_FLOAT,_.internalFormat=e.RGBA16F,_.wrapMode=33071;const w=new a;w.pixelFormat=6403,w.dataType=r.FLOAT,w.internalFormat=e.R32F,w.samplingMode=9728;const O=new a;O.pixelFormat=33319,O.dataType=r.FLOAT,O.internalFormat=e.RG32F,O.samplingMode=9728;const E={0:m,1:F,2:c,3:N,4:l,5:M,6:R,7:u,8:_,9:w,10:O,11:null},d={[t.DEPTH_COMPONENT16]:r.UNSIGNED_SHORT,[t.DEPTH_COMPONENT24]:r.UNSIGNED_INT,[t.DEPTH_COMPONENT32F]:r.FLOAT,[n.DEPTH24_STENCIL8]:r.UNSIGNED_INT_24_8,[n.DEPTH32F_STENCIL8]:r.FLOAT_32_UNSIGNED_INT_24_8_REV},A={12:I(n.DEPTH24_STENCIL8),11:I(t.DEPTH_COMPONENT16)};function I(e){const r=new a;return r.pixelFormat=o(e)?6402:34041,r.dataType=d[e],r.samplingMode=9728,r.wrapMode=33071,r.internalFormat=e,r.hasMipmap=!1,r.isImmutable=!0,r}export{E as ColorFormats,A as DepthTextureFormats,i as formatString,p as isDepthFormat};
@@ -2,7 +2,7 @@
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{property as r}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{ZEROS as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderCategory as n}from"../../../webgl.js";import i from"../../../webgl/RenderNode.js";import{glsl as c,If as s}from"../../core/shaderModules/glsl.js";import{Pos2Locations as a}from"../../lib/DefaultVertexBufferLayouts.js";import{checkWebGLError as l}from"../../../../webgl/checkWebGLError.js";import{ColorAttachment0 as u,DataType as p,SizedPixelFormat as h}from"../../../../webgl/enums.js";import{alphaCutoff as f}from"../../../../../webscene/support/AlphaCutoff.js";let d=class extends i{constructor(e){super(e),this.destroyedCB=null,this.produces=n.FINAL,this.consumes={required:[n.FINAL]},this.clearColor=o,this._focusedFBOType=0,this._program=new Map}destroy(){this._program.forEach(e=>e.dispose()),this._program.clear(),this.destroyedCB()}render(e){const r=e.find(({name:e})=>e===n.FINAL);if(!this._focusedFBO)return r;const t=this.renderingContext;t.bindFramebuffer(r.fbo),t.setClearColor(0,0,0,0),t.clear(16384);const o=this._focusedFBO.getTexture(),i=[v(o)],c=this._ensureProgram(t,!1,i);return t.useProgram(c),t.bindTexture(o,0),c.setUniform1i("colorTex0",0),c.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&c.setUniform2fv("nearFar",this.camera.nearFar),t.screen.draw(),r}getDownscaledFBO(e,r,t,o,n){0===r&&(o=e.width,n=e.height);const i=e.colorAttachments.length,s=[],a=new Array(i);for(let c=0;c<i;++c){const r=e.getColorTexture(u+c);if(r){const e=v(r);s.push(e);const{descriptor:t}=r;"float"!==e||t.hasMipmap||t.isImmutable||(r.generateMipmap(),a[c]=!0)}}const p=this.renderingContext,{depthStencilTexture:f}=e,d=this._ensureProgram(p,null!=f,s),m=this.fboCache.acquire(o,n,"fbo visualizer");p.useProgram(d),p.bindFramebuffer(m.fbo);const g=[];for(let l=0;l<i;++l){const r=u+l,t=`colorTex${c.int(l)}`;p.bindTexture(e.getColorTexture(r),l),d.setUniform1i(t,l),l>0&&m.acquireColor(r,5),g.push(r)}const x=f?.descriptor.linearFilterDepth??!1;if(f){const e=i;f.setShadowFiltering(!1),p.bindTexture(f,e),d.setUniform1i("depthTex",e);const r=u+e;r>u&&m.acquireColor(r,5,"depth to color"),g.push(r)}p.gl.drawBuffers(g),l(p.gl);const T=p.getViewport();p.setViewport(0,0,o,n),p.setClearColor(0,0,0,0),p.clear(16384),p.setBlendingEnabled(!0),p.setBlendFunction(1,771);const F="linear-depth"===t||t.includes("shadow"),b="overlay highlight"===t||"highlights"===t||"highlight mix"===t,R="highlight coverage"===t,B=e.colorTexture?.descriptor,C=B?.internalFormat,y=F?3:b?5:R?6:C===h.R16F||C===h.R32F||C===h.R8?1:C===h.RG8?2:C===h.RGBA16F?4:C===h.RG8UI?7:0;d.setUniform1i("inputType",y),d.setUniform2fv("nearFar",this.camera.nearFar),p.screen.draw(),l(p.gl),p.bindFramebuffer(null),p.setViewport(T.x,T.y,T.width,T.height),0===r&&(this._focusedFBO=m,this._focusedFBOType=y);for(let c=0;c<i;++c)if(a[c]){const r=e.getColorTexture(u+c);r?.clearMipmap()}return f&&f.setShadowFiltering(x),m}clearFocusedFBO(){this._focusedFBO=null}getPreviewContent(e,r,t,o){if(!t)return null;const n=this.renderingContext,i=this.fboCache.acquire(e,r,"fbo visualizer");n.bindFramebuffer(i?.fbo),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(16384),n.setBlendingEnabled(!0),n.setBlendFunction(1,771);const c=t.getColorTexture(o);n.setViewport(0,0,e,r);const s=this._ensureProgram(n,!1,[v(c)]);n.useProgram(s),n.bindTexture(c,0),s.setUniform1i("colorTex0",0),s.setUniform1i("inputType",0),n.screen.draw();const a=new ImageData(new Uint8ClampedArray(e*r*4),e,r);return n.gl.readPixels(0,0,e,r,6408,p.UNSIGNED_BYTE,new Uint8Array(a.data.buffer)),l(n.gl),n.bindFramebuffer(null),i?.release(),a}_ensureProgram(e,r,t){const o=g({hasDepthAttachment:r,colorAttachmentTypes:t}),n=this._program.get(o);if(n)return n;const i="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",l=e=>{let r="";for(let t=0;t<e.length;++t){const o=e[t];r+=`layout(location = ${c.int(t)}) out vec4 fragColor${c.int(t)};\n uniform ${m(o)} colorTex${c.int(t)};`}return r},u=e=>{let r="";for(let t=1;t<e.length;++t){const o=e[t],n=`texture(colorTex${c.int(t)}, uv)`,i="float"===o?n:`vec4( vec2(${n}), 0.0, 1.0)`;r+=`fragColor${c.int(t)} = ${i};`}return r},p=t.length,h=`#version 300 es\n precision highp float;\n precision highp usampler2D;\n\n in vec2 uv;\n ${l(t)}\n ${s(r,`layout(location = ${c.int(p)}) out vec4 fragDepth;\n uniform sampler2D depthTex;`)}\n\n uniform int inputType;\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgbaTofloat(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgbaTofloat(depth));\n }\n\n ${"float"===t[0]?"float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }":"float linearDepthFromTexture(usampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(vec4(texelFetch(depthTex, iuv, 0)) * 255.0);\n }"}\n\n void main() {\n ${s(t.length>0,c`
5
+ import{__decorate as e}from"tslib";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 t}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderCategory as n}from"../../../webgl.js";import i from"../../../webgl/RenderNode.js";import{glsl as s,If as c}from"../../core/shaderModules/glsl.js";import{Pos2Locations as a}from"../../lib/DefaultVertexBufferLayouts.js";import{checkWebGLError as l}from"../../../../webgl/checkWebGLError.js";import{ColorAttachment0 as u,DataType as p,SizedPixelFormat as h}from"../../../../webgl/enums.js";import{alphaCutoff as f}from"../../../../../webscene/support/AlphaCutoff.js";let d=class extends i{constructor(e){super(e),this.destroyedCB=null,this.produces=n.FINAL,this.consumes={required:[n.FINAL]},this.clearColor=o,this._focusedFBOType=0,this._program=new Map}destroy(){this._program.forEach(e=>e.dispose()),this._program.clear(),this.destroyedCB()}render(e){const r=e.find(({name:e})=>e===n.FINAL);if(!this._focusedFBO)return r;const t=this.renderingContext;t.bindFramebuffer(r.fbo),t.setClearColor(0,0,0,0),t.clear(16384);const o=this._focusedFBO.getTexture(),i=[v(o)],s=this._ensureProgram(t,!1,i);return t.useProgram(s),t.bindTexture(o,0),s.setUniform1i("colorTex0",0),s.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&s.setUniform2fv("nearFar",this.camera.nearFar),t.screen.draw(),r}getDownscaledFBO(e,r,t,o,n){0===r&&(o=e.width,n=e.height);const i=e.colorAttachments.length,c=[],a=new Array(i);for(let s=0;s<i;++s){const r=e.getColorTexture(u+s);if(r){const e=v(r);c.push(e);const{descriptor:t}=r;"float"!==e||t.hasMipmap||t.isImmutable||(r.generateMipmap(),a[s]=!0)}}const p=this.renderingContext,{depthStencilTexture:f}=e,d=this._ensureProgram(p,null!=f,c),m=this.fboCache.acquire(o,n,"fbo visualizer");p.useProgram(d),p.bindFramebuffer(m.fbo);const g=[];for(let l=0;l<i;++l){const r=u+l,t=`colorTex${s.int(l)}`;p.bindTexture(e.getColorTexture(r),l),d.setUniform1i(t,l),l>0&&m.acquireColor(r,5),g.push(r)}const x=f?.descriptor.linearFilterDepth??!1;if(f){const e=i;f.setShadowFiltering(!1),p.bindTexture(f,e),d.setUniform1i("depthTex",e);const r=u+e;r>u&&m.acquireColor(r,5,"fbo visualizer"),g.push(r)}p.gl.drawBuffers(g),l(p.gl);const T=p.getViewport();p.setViewport(0,0,o,n),p.setClearColor(0,0,0,0),p.clear(16384),p.setBlendingEnabled(!0),p.setBlendFunction(1,771);const F="linear depth"===t||t.includes("shadow"),b="overlay highlight"===t||"highlights"===t||"highlight mix"===t,R="highlight coverage"===t,B=e.colorTexture?.descriptor,C=B?.internalFormat,y=F?3:b?5:R?6:C===h.R16F||C===h.R32F||C===h.R8?1:C===h.RG8?2:C===h.RGBA16F?4:C===h.RG8UI?7:0;d.setUniform1i("inputType",y),d.setUniform2fv("nearFar",this.camera.nearFar),p.screen.draw(),l(p.gl),p.bindFramebuffer(null),p.setViewport(T.x,T.y,T.width,T.height),0===r&&(this._focusedFBO=m,this._focusedFBOType=y);for(let s=0;s<i;++s)if(a[s]){const r=e.getColorTexture(u+s);r?.clearMipmap()}return f&&f.setShadowFiltering(x),m}clearFocusedFBO(){this._focusedFBO=null}getPreviewContent(e,r,t,o){if(!t)return null;const n=this.renderingContext,i=this.fboCache.acquire(e,r,"fbo visualizer");n.bindFramebuffer(i?.fbo),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(16384),n.setBlendingEnabled(!0),n.setBlendFunction(1,771);const s=t.getColorTexture(o);n.setViewport(0,0,e,r);const c=this._ensureProgram(n,!1,[v(s)]);n.useProgram(c),n.bindTexture(s,0),c.setUniform1i("colorTex0",0),c.setUniform1i("inputType",0),n.screen.draw();const a=new ImageData(new Uint8ClampedArray(e*r*4),e,r);return n.gl.readPixels(0,0,e,r,6408,p.UNSIGNED_BYTE,new Uint8Array(a.data.buffer)),l(n.gl),n.bindFramebuffer(null),i?.release(),a}_ensureProgram(e,r,t){const o=g({hasDepthAttachment:r,colorAttachmentTypes:t}),n=this._program.get(o);if(n)return n;const i="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",l=e=>{let r="";for(let t=0;t<e.length;++t){const o=e[t];r+=`layout(location = ${s.int(t)}) out vec4 fragColor${s.int(t)};\n uniform ${m(o)} colorTex${s.int(t)};`}return r},u=e=>{let r="";for(let t=1;t<e.length;++t){const o=e[t],n=`texture(colorTex${s.int(t)}, uv)`,i="float"===o?n:`vec4( vec2(${n}), 0.0, 1.0)`;r+=`fragColor${s.int(t)} = ${i};`}return r},p=t.length,h=`#version 300 es\n precision highp float;\n precision highp usampler2D;\n\n in vec2 uv;\n ${l(t)}\n ${c(r,`layout(location = ${s.int(p)}) out vec4 fragDepth;\n uniform sampler2D depthTex;`)}\n\n uniform int inputType;\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgbaTofloat(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgbaTofloat(depth));\n }\n\n ${"float"===t[0]?"float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }":"float linearDepthFromTexture(usampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(vec4(texelFetch(depthTex, iuv, 0)) * 255.0);\n }"}\n\n void main() {\n ${c(t.length>0,s`
6
6
  vec4 color;
7
7
  if (inputType == 1) {
8
8
  color = vec4(vec3(texture(colorTex0, uv).r), 1.0);
@@ -31,8 +31,8 @@ import{__decorate as e}from"tslib";import{property as r}from"../../../../../core
31
31
  }
32
32
 
33
33
 
34
- if(color.a < ${c.float(f)})
34
+ if(color.a < ${s.float(f)})
35
35
  discard;
36
36
  fragColor0 = color;
37
- ${s(t.length>1,u(t))}
38
- `)}\n\n ${s(r,"float depth = 1.0 - pow(texture(depthTex, uv).r, 10.0);\n fragDepth = vec4(vec3(depth), depth < 0.000001 ? 0.0 : 1.0);")}\n }`,d=e.programCache.acquire(i,h,a);return this._program.set(o,d),d}};function m(e){switch(e){case"float":return"sampler2D";case"uint":return"usampler2D";case"int":return"isampler2D"}}function v(e){if(!e)return"float";const{internalFormat:r}=e.descriptor;switch(r){case h.R8I:case h.R16I:case h.R32I:case h.RG8I:case h.RG16I:case h.RG32I:case h.RGB8I:case h.RGB16I:case h.RGB32I:case h.RGBA8I:case h.RGBA16I:case h.RGBA32I:return"int";case h.R8UI:case h.R16UI:case h.R32UI:case h.RG8UI:case h.RG16UI:case h.RG32UI:case h.RGB8UI:case h.RGB16UI:case h.RGB32UI:case h.RGBA8UI:case h.RGBA16UI:case h.RGBA32UI:return"uint";default:return"float"}}function g(e){const{hasDepthAttachment:r,colorAttachmentTypes:t}=e;return`${r?"Depth":""}${t.reduceRight((e,r)=>e+`|C${r}`,"")}`}e([r()],d.prototype,"destroyedCB",void 0),e([r()],d.prototype,"produces",void 0),e([r()],d.prototype,"consumes",void 0),e([r()],d.prototype,"clearColor",void 0),d=e([t("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizerNode")],d);export{d as RenderNodeVisualizerNode};
37
+ ${c(t.length>1,u(t))}
38
+ `)}\n\n ${c(r,"float depth = 1.0 - pow(texture(depthTex, uv).r, 10.0);\n fragDepth = vec4(vec3(depth), depth < 0.000001 ? 0.0 : 1.0);")}\n }`,d=e.programCache.acquire(i,h,a);return this._program.set(o,d),d}};function m(e){switch(e){case"float":return"sampler2D";case"uint":return"usampler2D";case"int":return"isampler2D"}}function v(e){if(!e)return"float";const{internalFormat:r}=e.descriptor;switch(r){case h.R8I:case h.R16I:case h.R32I:case h.RG8I:case h.RG16I:case h.RG32I:case h.RGB8I:case h.RGB16I:case h.RGB32I:case h.RGBA8I:case h.RGBA16I:case h.RGBA32I:return"int";case h.R8UI:case h.R16UI:case h.R32UI:case h.RG8UI:case h.RG16UI:case h.RG32UI:case h.RGB8UI:case h.RGB16UI:case h.RGB32UI:case h.RGBA8UI:case h.RGBA16UI:case h.RGBA32UI:return"uint";default:return"float"}}function g(e){const{hasDepthAttachment:r,colorAttachmentTypes:t}=e;return`${r?"Depth":""}${t.reduceRight((e,r)=>e+`|C${r}`,"")}`}e([r()],d.prototype,"destroyedCB",void 0),e([r()],d.prototype,"produces",void 0),e([r()],d.prototype,"consumes",void 0),e([r()],d.prototype,"clearColor",void 0),d=e([t("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizerNode")],d);export{d as RenderNodeVisualizerNode};