@arcgis/core 5.0.0-next.16 → 5.0.0-next.18

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 (262) hide show
  1. package/analysis/ElevationProfile/ElevationProfileLineInput.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{adf7ccf4ef629211c7ee.js → 08aacbfb651cc2e1c054.js} +1 -1
  4. package/assets/esri/core/workers/chunks/234b52b2a391631ceff6.js +1 -0
  5. package/assets/esri/core/workers/chunks/{658cd45b5fb304fd840a.js → 3aa77696c5ea54a238da.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{8f3503b2fb6cd38757b9.js → 458e87902abc24b375da.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{57b410198d83bf0ab708.js → 4a89e120be142ab58a27.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{49571d6875de1f2e7e25.js → 4b9dfdc23ba3d6ebcc1b.js} +2 -2
  9. package/assets/esri/core/workers/chunks/{a410dcf80d17a2383337.js → 65a4099bdbe31834d0cc.js} +1 -1
  10. package/assets/esri/core/workers/chunks/722da7a39a0ad9300752.js +1 -0
  11. package/assets/esri/core/workers/chunks/{cdb4664fd59860ddeb5a.js → 72f1c3d97e7b9546c113.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{bc318b6fef192cee2a72.js → 76e945da8f30d8641c3d.js} +20 -20
  13. package/assets/esri/core/workers/chunks/{319c3f46f2afb8f3e5a9.js → 89c9cf7f799858d14c76.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{e19cd07df8ce87e18832.js → 8b33732e3c2924c1f60d.js} +1 -1
  15. package/assets/esri/core/workers/chunks/98739414c107ad78e4d8.js +1 -0
  16. package/assets/esri/core/workers/chunks/{8b73db0f4d6714396eb0.js → a6fa90eab77ac0e1cdfc.js} +1 -1
  17. package/assets/esri/core/workers/chunks/ac366221e8636b60aee5.js +1 -0
  18. package/assets/esri/core/workers/chunks/{23e17b745adf71a5efc7.js → aca72ca7f43f70eb8077.js} +1 -1
  19. package/assets/esri/core/workers/chunks/ad0c7225941437d18408.js +1 -0
  20. package/assets/esri/core/workers/chunks/b30897952494a3e5b9fe.js +1 -0
  21. package/assets/esri/core/workers/chunks/bfd3d81e8e148be99686.js +1 -0
  22. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  23. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  24. package/assets/esri/themes/base/widgets/_Editor.scss +2 -1
  25. package/assets/esri/themes/base/widgets/_FeatureForm.scss +1 -1
  26. package/assets/esri/themes/dark/main.css +1 -1
  27. package/assets/esri/themes/light/main.css +1 -1
  28. package/assets/esri/themes/light/view.css +1 -1
  29. package/chunks/GaussianSplat.glsl.js +2 -2
  30. package/chunks/ImageMaterial.glsl.js +1 -1
  31. package/chunks/lyr3DMain.js +1 -1
  32. package/config.js +1 -1
  33. package/graphic/graphicOriginUtils.js +1 -1
  34. package/interfaces.d.ts +113 -54
  35. package/intl/locale.js +1 -1
  36. package/kernel.js +1 -1
  37. package/layers/BingMapsLayer.js +1 -1
  38. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  39. package/layers/support/attributionUtils.js +5 -0
  40. package/layers/support/fieldConfigUtils.js +1 -1
  41. package/layers/support/fieldFormatUtils.js +1 -1
  42. package/layers/video/VideoController.js +1 -1
  43. package/libs/parquet/parquet.js +1 -1
  44. package/package.json +1 -1
  45. package/support/revision.js +1 -1
  46. package/symbols/cim/SDFHelper.js +1 -1
  47. package/symbols/cim/cimAnalyzer.js +1 -1
  48. package/views/2d/LabelManager.js +1 -1
  49. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  50. package/views/2d/engine/flow/dataUtils.js +1 -1
  51. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  52. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  53. package/views/2d/engine/webgl/TextureManager.js +1 -1
  54. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  55. package/views/2d/engine/webgl/animations/store/AnimationStore.js +1 -1
  56. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +1 -1
  57. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
  58. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
  59. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
  60. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  61. package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +1 -1
  62. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  63. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
  64. package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +1 -1
  65. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  66. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
  67. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  68. package/views/2d/engine/webgl/textureUtils.js +1 -1
  69. package/views/2d/layers/features/FeatureContainer.js +1 -1
  70. package/views/2d/layers/features/Processor.js +1 -1
  71. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  72. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  73. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  74. package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
  75. package/views/3d/GroundView3D.js +1 -1
  76. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  77. package/views/3d/analysis/ElevationProfile/ElevationProfileGeometryVisualization3D.js +1 -1
  78. package/views/3d/analysis/Slice/RotateManipulator.js +1 -1
  79. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  80. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  81. package/views/3d/analysis/images/Factory.js +1 -1
  82. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  83. package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
  84. package/views/3d/environment/CloudsCompositionTechnique.js +1 -1
  85. package/views/3d/environment/CloudsTechnique.js +1 -1
  86. package/views/3d/environment/EnvironmentManager.js +1 -1
  87. package/views/3d/environment/FogTechnique.js +1 -1
  88. package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
  89. package/views/3d/environment/PrecipitationTechnique.js +1 -1
  90. package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
  91. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  92. package/views/3d/layers/DrapedSubView3D.js +1 -1
  93. package/views/3d/layers/FlowSubView3D.js +1 -1
  94. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  95. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  96. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  97. package/views/3d/layers/MediaLayerView3D.js +1 -1
  98. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  99. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  100. package/views/3d/layers/SceneLayerView3D.js +1 -1
  101. package/views/3d/layers/TiledLayerView3D.js +1 -1
  102. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  103. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  104. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  105. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  106. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  107. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  108. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  109. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  110. package/views/3d/support/QualityProfile.js +5 -0
  111. package/views/3d/support/QualitySettings.js +1 -1
  112. package/views/3d/support/StreamTextureCollection.js +1 -1
  113. package/views/3d/support/TextureCollection.js +1 -1
  114. package/views/3d/support/engineContent/marker.js +1 -1
  115. package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
  116. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  117. package/views/3d/support/flow/FlowWorker.js +1 -1
  118. package/views/3d/support/flow/FlowWorkerHandle.js +1 -1
  119. package/views/3d/support/flow/StreamlineResources3D.js +1 -1
  120. package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
  121. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  122. package/views/3d/support/flow/constants.js +1 -1
  123. package/views/3d/support/flow/loadUtils.js +1 -1
  124. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  125. package/views/3d/support/popupHitTest.js +1 -1
  126. package/views/3d/terrain/BlendLayersTechnique.js +1 -1
  127. package/views/3d/terrain/OverlayRenderer.js +1 -1
  128. package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
  129. package/views/3d/terrain/TerrainSurface.js +1 -1
  130. package/views/3d/terrain/TileAgent.js +1 -1
  131. package/views/3d/terrain/TileCompositor.js +1 -1
  132. package/views/3d/webgl-engine/Stage.js +1 -1
  133. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  134. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  135. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  136. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  137. package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
  138. package/views/3d/webgl-engine/core/material/RenderTexture.js +1 -1
  139. package/views/3d/webgl-engine/core/shaderTechnique/{ReloadableShaderModule.js → ReloadableShader.js} +1 -1
  140. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  141. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
  142. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +1 -1
  143. package/views/3d/webgl-engine/effects/glow/GlowBlurTechnique.js +1 -1
  144. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +1 -1
  145. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  146. package/views/3d/webgl-engine/effects/haze/HazeCompositingTechnique.js +1 -1
  147. package/views/3d/webgl-engine/effects/haze/HazeTechnique.js +1 -1
  148. package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
  149. package/views/3d/webgl-engine/effects/highlight/HighlightBlurTechnique.js +1 -1
  150. package/views/3d/webgl-engine/effects/highlight/HighlightDownsampleTechnique.js +1 -1
  151. package/views/3d/webgl-engine/effects/highlight/HighlightToSingleTechnique.js +1 -1
  152. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
  153. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechnique.js +1 -1
  154. package/views/3d/webgl-engine/effects/laserlines/LaserlineTechnique.js +1 -1
  155. package/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique.js +1 -1
  156. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  157. package/views/3d/webgl-engine/effects/smaa/SMAABlendWeightsTechnique.js +1 -1
  158. package/views/3d/webgl-engine/effects/smaa/SMAABlurTechnique.js +1 -1
  159. package/views/3d/webgl-engine/effects/smaa/SMAAEdgeDetectTechnique.js +1 -1
  160. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  161. package/views/3d/webgl-engine/effects/ssao/SSAOBlurTechnique.js +1 -1
  162. package/views/3d/webgl-engine/effects/ssao/SSAOTechnique.js +1 -1
  163. package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
  164. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  165. package/views/3d/webgl-engine/lib/AnimationTimeStep.js +1 -1
  166. package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
  167. package/views/3d/webgl-engine/lib/DDSUtil.js +1 -1
  168. package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
  169. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  170. package/views/3d/webgl-engine/lib/ManagedTexture.js +5 -0
  171. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  172. package/views/3d/webgl-engine/lib/Program.js +1 -1
  173. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  174. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  175. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  176. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  177. package/views/3d/webgl-engine/lib/TextTextureFactory.js +1 -1
  178. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  179. package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
  180. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
  181. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  182. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  183. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  184. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  185. package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
  186. package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
  187. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  188. package/views/3d/webgl-engine/shaders/AtmosphereCompositingTechnique.js +1 -1
  189. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  190. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  191. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  192. package/views/3d/webgl-engine/shaders/CutFillCompositionTechnique.js +1 -1
  193. package/views/3d/webgl-engine/shaders/CutFillDepthTechnique.js +1 -1
  194. package/views/3d/webgl-engine/shaders/CutFillMaskTechnique.js +1 -1
  195. package/views/3d/webgl-engine/shaders/CutFillReductionTechnique.js +1 -1
  196. package/views/3d/webgl-engine/shaders/CutFillTargetDepthTechnique.js +1 -1
  197. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  198. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  199. package/views/3d/webgl-engine/shaders/GaussianSplatCompositionTechnique.js +1 -1
  200. package/views/3d/webgl-engine/shaders/GaussianSplatDepthCompositionTechnique.js +1 -1
  201. package/views/3d/webgl-engine/shaders/GaussianSplatDepthTechnique.js +1 -1
  202. package/views/3d/webgl-engine/shaders/GaussianSplatTechnique.js +1 -1
  203. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  204. package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +1 -1
  205. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  206. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  207. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  208. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  209. package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
  210. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  211. package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
  212. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  213. package/views/3d/webgl-engine/shaders/OverlayCompositingTechnique.js +1 -1
  214. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  215. package/views/3d/webgl-engine/shaders/PointRendererTechnique.js +1 -1
  216. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  217. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  218. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  219. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
  220. package/views/3d/webgl-engine/shaders/ShadowCastClearTechnique.js +1 -1
  221. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
  222. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
  223. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  224. package/views/3d/webgl-engine/shaders/ViewshedTechnique.js +1 -1
  225. package/views/GroundView.js +1 -1
  226. package/views/SceneView.js +1 -1
  227. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  228. package/views/analysis/ElevationProfile/types.d.ts +5 -0
  229. package/views/analysis/ElevationProfile/types.js +5 -0
  230. package/views/support/layerViewUtils.js +1 -1
  231. package/views/webgl/Texture.js +1 -1
  232. package/views/webgl/VertexAttributeLocations.js +1 -1
  233. package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
  234. package/widgets/Attribution/AttributionViewModel.js +1 -1
  235. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  236. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  237. package/widgets/Editor/UpdateWorkflow.js +1 -1
  238. package/widgets/Editor/Workflow.js +1 -1
  239. package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
  240. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  241. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  242. package/widgets/Editor.js +1 -1
  243. package/widgets/Feature/support/featureUtils.js +1 -1
  244. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  245. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  246. package/widgets/FeatureTable/FieldColumn.js +1 -1
  247. package/widgets/FeatureTable/Grid/Column.js +1 -1
  248. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  249. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  250. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  251. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  252. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  253. package/assets/esri/core/workers/chunks/38ee69125da60464d5a1.js +0 -1
  254. package/assets/esri/core/workers/chunks/4f0016111fd84c612f41.js +0 -1
  255. package/assets/esri/core/workers/chunks/8208dfa8f7fae7e616b9.js +0 -1
  256. package/assets/esri/core/workers/chunks/847f4fc39100fac1df01.js +0 -1
  257. package/assets/esri/core/workers/chunks/ab005fe84952f0676020.js +0 -1
  258. package/assets/esri/core/workers/chunks/bc19a232076d98825eef.js +0 -1
  259. package/assets/esri/core/workers/chunks/c3dcfe26c2c3c829762d.js +0 -1
  260. package/views/3d/support/DisplayQualityProfile.js +0 -5
  261. package/views/3d/webgl-engine/lib/Texture.js +0 -5
  262. /package/views/3d/webgl-engine/lib/{ITexture.js → IManagedTexture.js} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{Pos2Locations as o}from"../lib/DefaultVertexBufferLayouts.js";import{a as s}from"../../../../chunks/OverlayCompositing.glsl.js";class t extends r{constructor(r,t){super(r,t,new e(s,()=>import("./OverlayCompositing.glsl.js")),o)}}export{t as OverlayCompositingTechnique};
5
+ import{__decorate as r}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{ReloadableShader as o}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../chunks/OverlayCompositing.glsl.js";let t=class extends s{constructor(){super(...arguments),this.shader=new o(i,()=>import("./OverlayCompositing.glsl.js"))}};t=r([e("esri.views.3d.webgl-engine.shaders.OverlayCompositingTechnique")],t);export{t as OverlayCompositingTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmission as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as r}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i,depthOnlyOutputBuffersOr as o}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as n,depthWrite as s,oitDepthTest as c,blending as u,getDrawBuffers as a}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as p,stencilBaseAllZerosParams as d,stencilWriteMaskOn as f}from"../lib/StencilUtils.js";import{P as m}from"../../../../chunks/Pattern.glsl.js";import{makePipelineState as h,defaultColorWrite as P,cullingParams as g}from"../../../webgl/renderState.js";class S extends i{constructor(e,t){super(e,t,new r(m,()=>import("./Pattern.glsl.js")),b(t).locations)}_setPipelineState(e,r){const{oitPass:i,output:l,cullFace:m,draped:S,hasOccludees:b,polygonOffset:v}=e,y=0===i;return h({blending:t(l)?u(i):null,culling:g(m),depthTest:S?null:{func:c(i)},depthWrite:s(e),drawBuffers:o(l,a(i,l)),colorWrite:P,stencilWrite:b?f:null,stencilTest:b?r?p:d:null,polygonOffset:y?v?j:null:n(e)})}initializePipeline(e){return this._occludeePipelineState=this._setPipelineState(e,!0),this._setPipelineState(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}const j={factor:1,units:1};function b(t){const r=e().vec3f("position").vec4f("uvMapSpace");return t.draped||r.mat3f("boundingRect"),t.hasVVColor?r.f32("colorFeatureAttribute"):r.vec4u8("color"),l()&&r.vec4u8("olidColor"),r.freeze()}export{S as PatternTechnique,b as getLayout};
5
+ import{__decorate as e}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{newLayout as t}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmission as o}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as i}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s,depthOnlyOutputBuffersOr as n}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as c,depthWrite as a,oitDepthTest as p,blending as u,getDrawBuffers as d}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as m,stencilBaseAllZerosParams as f,stencilWriteMaskOn as h}from"../lib/StencilUtils.js";import{P as g}from"../../../../chunks/Pattern.glsl.js";import{makePipelineState as j,defaultColorWrite as P,cullingParams as b}from"../../../webgl/renderState.js";let S=class extends s{constructor(e,r){super(e,r,T(r).locations),this.shader=new i(g,()=>import("./Pattern.glsl.js"))}_setPipelineState(e,r){const{oitPass:t,output:i,cullFace:s,draped:l,hasOccludees:g,polygonOffset:S}=e,T=0===t;return j({blending:o(i)?u(t):null,culling:b(s),depthTest:l?null:{func:p(t)},depthWrite:a(e),drawBuffers:n(i,d(t,i)),colorWrite:P,stencilWrite:g?h:null,stencilTest:g?r?m:f:null,polygonOffset:T?S?v:null:c(e)})}initializePipeline(e){return this._occludeePipelineState=this._setPipelineState(e,!0),this._setPipelineState(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};S=e([r("esri.views.3d.webgl-engine.shaders.PatternTechnique")],S);const v={factor:1,units:1};function T(e){const r=t().vec3f("position").vec4f("uvMapSpace");return e.draped||r.mat3f("boundingRect"),e.hasVVColor?r.f32("colorFeatureAttribute"):r.vec4u8("color"),l()&&r.vec4u8("olidColor"),r.freeze()}export{S as PatternTechnique,T as getLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r,depthOnlyOutputBuffersOr as t}from"../core/shaderTechnique/ShaderTechnique.js";import{stencilBaseAllZerosParams as o,stencilWriteMaskOn as s}from"../lib/StencilUtils.js";import{b as i}from"../../../../chunks/PointRenderer.glsl.js";import{DataType as n}from"../../../webgl/enums.js";import{makePipelineState as l,defaultColorWrite as c,defaultDepthWrite as m}from"../../../webgl/renderState.js";import{fromLayout as u}from"../../../webgl/VertexAttributeLocations.js";import{VertexElementDescriptor as p}from"../../../webgl/VertexElementDescriptor.js";class a extends r{constructor(r,t){super(r,t,new e(i,()=>import("./PointRenderer.glsl.js")),u(f))}initializePipeline(e){return l({depthTest:{func:513},depthWrite:m,colorWrite:c,stencilWrite:e.hasOccludees?s:null,stencilTest:e.hasOccludees?o:null,drawBuffers:t(e.output)})}}const d=[new p("position",3,n.FLOAT,0,12)],h=[new p("color",3,n.UNSIGNED_BYTE,0,3,!0)],f=d.concat(h);export{a as PointRendererTechnique,h as colorsLayout,d as positionsLayout};
5
+ import{__decorate as e}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{ReloadableShader as o}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as t,depthOnlyOutputBuffersOr as s}from"../core/shaderTechnique/ShaderTechnique.js";import{stencilBaseAllZerosParams as i,stencilWriteMaskOn as n}from"../lib/StencilUtils.js";import{b as c}from"../../../../chunks/PointRenderer.glsl.js";import{DataType as l}from"../../../webgl/enums.js";import{makePipelineState as m,defaultColorWrite as p,defaultDepthWrite as a}from"../../../webgl/renderState.js";import{fromLayout as d}from"../../../webgl/VertexAttributeLocations.js";import{VertexElementDescriptor as u}from"../../../webgl/VertexElementDescriptor.js";let h=class extends t{constructor(e,r){super(e,r,d(b)),this.shader=new o(c,()=>import("./PointRenderer.glsl.js"))}initializePipeline(e){return m({depthTest:{func:513},depthWrite:a,colorWrite:p,stencilWrite:e.hasOccludees?n:null,stencilTest:e.hasOccludees?i:null,drawBuffers:s(e.output)})}};h=e([r("esri.views.3d.webgl-engine.shaders.PointRendererTechnique")],h);const j=[new u("position",3,l.FLOAT,0,12)],f=[new u("color",3,l.UNSIGNED_BYTE,0,3,!0)],b=j.concat(f);export{h as PointRendererTechnique,f as colorsLayout,j as positionsLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{DefaultMaterialTechnique as r}from"./DefaultMaterialTechnique.js";import{R as s}from"../../../../chunks/RealisticTree.glsl.js";class o extends r{constructor(r,o){super(r,o,new e(s,()=>import("./RealisticTree.glsl.js")))}}export{o as RealisticTreeTechnique};
5
+ import{__decorate as e}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{DefaultMaterialTechnique as o}from"./DefaultMaterialTechnique.js";import{R as i}from"../../../../chunks/RealisticTree.glsl.js";let t=class extends o{constructor(){super(...arguments),this.shader=new s(i,()=>import("./RealisticTree.glsl.js"))}};t=e([r("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],t);export{t as RealisticTreeTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmission as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r,depthOnlyOutputBuffersOr as l}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as s}from"../effects/geometry/olidUtils.js";import{OITPolygonOffset as n,depthWrite as o,oitDepthTest as u,blending as c,getDrawBuffers as a}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as p,stencilBaseAllZerosParams as f,stencilWriteMaskOn as d,stencilToolTransparentOccluderParams as h,depthCompareAlways as m,stencilToolMaskOccluderParams as P,stencilWriteMaskOff as g,depthCompareLess as b}from"../lib/StencilUtils.js";import{R as T}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as W}from"../../../webgl/enums.js";import{makePipelineState as y,defaultColorWrite as O,unpremultipliedAlphaToPremultipliedAlpha as j}from"../../../webgl/renderState.js";class S extends r{constructor(e,t){super(e,t,new i(T,()=>import("./RibbonLine.glsl.js")),v(t).locations),this.primitiveType=t.wireframe?W.LINES:W.TRIANGLE_STRIP}_makePipelineState(e,i){const{oitPass:r,output:s,hasOccludees:h,hasPolygonOffset:m}=e,P=0===r,g=2===r;return y({blending:t(s)?c(r):null,depthTest:{func:u(r)},depthWrite:o(e),drawBuffers:l(s,a(r,s)),colorWrite:O,stencilWrite:h?d:null,stencilTest:h?i?p:f:null,polygonOffset:P||g?m?_:null:n})}initializePipeline(e){if(e.occluder){const t=e.hasPolygonOffset?_:null,{output:i,hasOccludees:r}=e;this._occluderPipelineTransparent=y({blending:j,polygonOffset:t,depthTest:m,depthWrite:null,colorWrite:O,stencilWrite:null,stencilTest:r?h:null,drawBuffers:l(i)}),this._occluderPipelineOpaque=y({blending:j,polygonOffset:t,depthTest:r?m:b,depthWrite:null,colorWrite:O,stencilWrite:r?g:null,stencilTest:r?P:null,drawBuffers:l(i)}),this._occluderPipelineMaskWrite=y({blending:null,polygonOffset:t,depthTest:b,depthWrite:null,colorWrite:null,stencilWrite:r?d:null,stencilTest:r?p:null,drawBuffers:l(i)})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(e)return this._occludeePipeline;switch(t){case 11:return this._occluderPipelineTransparent??super.getPipeline();case 10:return this._occluderPipelineOpaque??super.getPipeline();default:return this._occluderPipelineMaskWrite??super.getPipeline()}}}const _={factor:0,units:-4};function v(t){const i=e().vec3f("position").vec4f16("previousDelta").vec4f16("nextDelta").f32("u0").vec2f16("lineParameters");return t.hasVVColor?i.f32("colorFeatureAttribute"):i.vec4u8("color",{glNormalized:!0}),t.hasVVSize?i.f32("sizeFeatureAttribute"):i.f32("size"),t.hasVVOpacity&&i.f32("opacityFeatureAttribute"),s()&&i.vec4u8("olidColor"),t.hasAnimation&&i.vec4f16("timeStamps"),i}export{S as RibbonLineTechnique,v as getLayout};
5
+ import{__decorate as e}from"tslib";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmission as i}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l,depthOnlyOutputBuffersOr as o}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{OITPolygonOffset as c,depthWrite as u,oitDepthTest as p,blending as a,getDrawBuffers as f}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as d,stencilBaseAllZerosParams as h,stencilWriteMaskOn as m,stencilToolTransparentOccluderParams as g,depthCompareAlways as b,stencilToolMaskOccluderParams as P,stencilWriteMaskOff as T,depthCompareLess as j}from"../lib/StencilUtils.js";import{R as W}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as y}from"../../../webgl/enums.js";import{makePipelineState as O,defaultColorWrite as S,unpremultipliedAlphaToPremultipliedAlpha as _}from"../../../webgl/renderState.js";let v=class extends l{constructor(e,t){super(e,t,L(t).locations),this.shader=new s(W,()=>import("./RibbonLine.glsl.js")),this.primitiveType=t.wireframe?y.LINES:y.TRIANGLE_STRIP}_makePipelineState(e,t){const{oitPass:r,output:s,hasOccludees:l,hasPolygonOffset:n}=e,g=0===r,b=2===r;return O({blending:i(s)?a(r):null,depthTest:{func:p(r)},depthWrite:u(e),drawBuffers:o(s,f(r,s)),colorWrite:S,stencilWrite:l?m:null,stencilTest:l?t?d:h:null,polygonOffset:g||b?n?w:null:c})}initializePipeline(e){if(e.occluder){const t=e.hasPolygonOffset?w:null,{output:r,hasOccludees:i}=e;this._occluderPipelineTransparent=O({blending:_,polygonOffset:t,depthTest:b,depthWrite:null,colorWrite:S,stencilWrite:null,stencilTest:i?g:null,drawBuffers:o(r)}),this._occluderPipelineOpaque=O({blending:_,polygonOffset:t,depthTest:i?b:j,depthWrite:null,colorWrite:S,stencilWrite:i?T:null,stencilTest:i?P:null,drawBuffers:o(r)}),this._occluderPipelineMaskWrite=O({blending:null,polygonOffset:t,depthTest:j,depthWrite:null,colorWrite:null,stencilWrite:i?m:null,stencilTest:i?d:null,drawBuffers:o(r)})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(e)return this._occludeePipeline;switch(t){case 11:return this._occluderPipelineTransparent??super.getPipeline();case 10:return this._occluderPipelineOpaque??super.getPipeline();default:return this._occluderPipelineMaskWrite??super.getPipeline()}}};v=e([t("esri.views.3d.webgl-engine.shaders.RibbonLineTechnique")],v);const w={factor:0,units:-4};function L(e){const t=r().vec3f("position").vec4f16("previousDelta").vec4f16("nextDelta").f32("u0").vec2f16("lineParameters");return e.hasVVColor?t.f32("colorFeatureAttribute"):t.vec4u8("color",{glNormalized:!0}),e.hasVVSize?t.f32("sizeFeatureAttribute"):t.f32("size"),e.hasVVOpacity&&t.f32("opacityFeatureAttribute"),n()&&t.vec4u8("olidColor"),e.hasAnimation&&t.vec4f16("timeStamps"),t}export{v as RibbonLineTechnique,L as getLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as o}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPolygonOffset as n,getDrawBuffers as s,depthWrite as a,blending as i}from"../lib/OrderIndependentTransparency.js";import{S as l}from"../../../../chunks/ShadedColorMaterial.glsl.js";import{makePipelineState as d,defaultColorWrite as c,cullingParams as u}from"../../../webgl/renderState.js";class p extends t{constructor(e,r){super(e,r,new o(l,()=>import("./ShadedColorMaterial.glsl.js")),f(r).locations)}initializePipeline(e){const{oitPass:o,output:t,transparent:l,cullFace:p,shadingEnabled:f}=e,m=0===o,h=2===o;return d({blending:r(t)&&l?i(o):null,culling:u(p),depthTest:{func:h?513:f?515:513},depthWrite:a(e),drawBuffers:s(o,t),colorWrite:c,polygonOffset:m||h?null:n})}}function f(r){const o=e().vec3f("position").vec3f("normal");return r.screenSizeEnabled&&o.vec3f("offset"),o}export{p as ShadedColorMaterialTechnique,f as getLayout};
5
+ import{__decorate as e}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmission as s}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as t}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPolygonOffset as a,getDrawBuffers as n,depthWrite as l,blending as c}from"../lib/OrderIndependentTransparency.js";import{S as d}from"../../../../chunks/ShadedColorMaterial.glsl.js";import{makePipelineState as p,defaultColorWrite as m,cullingParams as u}from"../../../webgl/renderState.js";let f=class extends i{constructor(e,r){super(e,r,h(r).locations),this.shader=new t(d,()=>import("./ShadedColorMaterial.glsl.js"))}initializePipeline(e){const{oitPass:r,output:o,transparent:t,cullFace:i,shadingEnabled:d}=e,f=0===r,h=2===r;return p({blending:s(o)&&t?c(r):null,culling:u(i),depthTest:{func:h?513:d?515:513},depthWrite:l(e),drawBuffers:n(r,o),colorWrite:m,polygonOffset:f||h?null:a})}};function h(e){const r=o().vec3f("position").vec3f("normal");return e.screenSizeEnabled&&r.vec3f("offset"),r}f=e([r("esri.views.3d.webgl-engine.shaders.ShadedColorMaterialTechnique")],f);export{f as ShadedColorMaterialTechnique,h as getLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{Pos2Locations as t}from"../lib/DefaultVertexBufferLayouts.js";import{a as i}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{PrimitiveType as o}from"../../../webgl/enums.js";import{makePipelineState as s,add as l}from"../../../webgl/renderState.js";class a extends r{constructor(r,s){super(r,s,new e(i,()=>import("./ShadowCastAccumulate.glsl.js")),t),this.primitiveType=o.TRIANGLE_STRIP}initializePipeline(e){const r={r:0===e.index,g:1===e.index,b:!1,a:!1};return s({blending:l,colorWrite:r,depthTest:null,depthWrite:null})}}export{a as ShadowCastAccumulateTechnique};
5
+ import{__decorate as e}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{ReloadableShader as o}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{a as t}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{PrimitiveType as i}from"../../../webgl/enums.js";import{makePipelineState as a,add as c}from"../../../webgl/renderState.js";let m=class extends s{constructor(){super(...arguments),this.shader=new o(t,()=>import("./ShadowCastAccumulate.glsl.js")),this.primitiveType=i.TRIANGLE_STRIP}initializePipeline(e){const r={r:0===e.index,g:1===e.index,b:!1,a:!1};return a({blending:c,colorWrite:r,depthTest:null,depthWrite:null})}};m=e([r("esri.views.3d.webgl-engine.shaders.ShadowCastAccumulateTechnique")],m);export{m as ShadowCastAccumulateTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{Pos2Locations as t}from"../lib/DefaultVertexBufferLayouts.js";import{S as i}from"../../../../chunks/ShadowCastClear.glsl.js";import{PrimitiveType as o}from"../../../webgl/enums.js";import{makePipelineState as s}from"../../../webgl/renderState.js";class l extends r{constructor(r,s){super(r,s,new e(i,()=>import("./ShadowCastClear.glsl.js")),t),this.primitiveType=o.TRIANGLE_STRIP}initializePipeline(e){const r={r:0===e.index,g:1===e.index,b:!1,a:!1};return s({blending:null,colorWrite:r,depthTest:null,depthWrite:null})}}export{l as ShadowCastClearTechnique};
5
+ import{__decorate as e}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{ReloadableShader as o}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{S as i}from"../../../../chunks/ShadowCastClear.glsl.js";import{PrimitiveType as t}from"../../../webgl/enums.js";import{makePipelineState as a}from"../../../webgl/renderState.js";let l=class extends s{constructor(){super(...arguments),this.shader=new o(i,()=>import("./ShadowCastClear.glsl.js")),this.primitiveType=t.TRIANGLE_STRIP}initializePipeline(e){const r={r:0===e.index,g:1===e.index,b:!1,a:!1};return a({blending:null,colorWrite:r,depthTest:null,depthWrite:null})}};l=e([r("esri.views.3d.webgl-engine.shaders.ShadowCastClearTechnique")],l);export{l as ShadowCastClearTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{Pos2Locations as i}from"../lib/DefaultVertexBufferLayouts.js";import{a as t}from"../../../../chunks/ShadowCastVisualize.glsl.js";import{PrimitiveType as s}from"../../../webgl/enums.js";import{makePipelineState as o,defaultColorWrite as l,premultipliedAlpha as a}from"../../../webgl/renderState.js";class n extends r{constructor(r,o){super(r,o,new e(t,()=>import("./ShadowCastVisualize.glsl.js")),i),this.primitiveType=s.TRIANGLE_STRIP}initializePipeline(){return o({blending:a,colorWrite:l,depthTest:null,depthWrite:null})}}export{n as ShadowCastVisualizeTechnique};
5
+ import{__decorate as e}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../chunks/ShadowCastVisualize.glsl.js";import{PrimitiveType as t}from"../../../webgl/enums.js";import{makePipelineState as a,defaultColorWrite as l,premultipliedAlpha as m}from"../../../webgl/renderState.js";let p=class extends o{constructor(){super(...arguments),this.shader=new s(i,()=>import("./ShadowCastVisualize.glsl.js")),this.primitiveType=t.TRIANGLE_STRIP}initializePipeline(){return a({blending:m,colorWrite:l,depthTest:null,depthWrite:null})}};p=e([r("esri.views.3d.webgl-engine.shaders.ShadowCastVisualizeTechnique")],p);export{p as ShadowCastVisualizeTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ReloadableShaderModule as r}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{PositionUvLayout as t}from"../materials/DefaultLayouts.js";import{S as i}from"../../../../chunks/SlicePlaneMaterial.glsl.js";import{NoParameters as s}from"../../../webgl/NoParameters.js";import{makePipelineState as l,defaultColorWrite as a,premultipliedAlpha as c}from"../../../webgl/renderState.js";class n extends s{constructor(){super(...arguments),this.backgroundColor=e(1,0,0,.5),this.gridColor=e(0,1,0,.5),this.gridWidth=4}}class m extends o{constructor(e,o){super(e,o,new r(i,()=>import("./SlicePlaneMaterial.glsl.js")),t.locations)}initializePipeline(){return l({blending:c,depthTest:{func:513},colorWrite:a})}}export{n as SlicePlaneMaterialPassParameters,m as SlicePlaneMaterialTechnique};
5
+ import{__decorate as r}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{PositionUvLayout as t}from"../materials/DefaultLayouts.js";import{S as a}from"../../../../chunks/SlicePlaneMaterial.glsl.js";import{NoParameters as l}from"../../../webgl/NoParameters.js";import{makePipelineState as c,defaultColorWrite as m,premultipliedAlpha as n}from"../../../webgl/renderState.js";class p extends l{constructor(){super(...arguments),this.backgroundColor=o(1,0,0,.5),this.gridColor=o(0,1,0,.5),this.gridWidth=4}}let d=class extends i{constructor(r,e){super(r,e,t.locations),this.shader=new s(a,()=>import("./SlicePlaneMaterial.glsl.js"))}initializePipeline(){return c({blending:n,depthTest:{func:513},colorWrite:m})}};d=r([e("esri.views.3d.webgl-engine.shaders.SlicePlaneMaterialTechnique")],d);export{p as SlicePlaneMaterialPassParameters,d as SlicePlaneMaterialTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{layout as e}from"../../terrain/TerrainAttributes.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t,depthOnlyOutputBuffersOr as r}from"../core/shaderTechnique/ShaderTechnique.js";import{renderWhenBitIsNotSet as n}from"../lib/StencilUtils.js";import{a as l}from"../../../../chunks/Terrain.glsl.js";import{makePipelineState as s,defaultColorWrite as c,defaultDepthWrite as u,backFaceCullingParams as a,premultipliedAlpha as o}from"../../../webgl/renderState.js";class p extends t{constructor(t,r){super(t,r,new i(l,()=>import("./Terrain.glsl.js")),e.locations),this.type="TerrainTechnique",this.useStencil=!1}initializePipeline(e){return this._stencilPipelineState=this._createPipeline(e,!0),this._createPipeline(e,!1)}_createPipeline(e,i){const{renderOccluded:t,output:l}=e,p=e.backfaceCullingEnabled&&!t;return s({blending:t?o:null,culling:p?a:null,depthTest:t?null:{func:513},depthWrite:t?null:u,colorWrite:c,stencilTest:i?n(1):null,drawBuffers:r(l)})}getPipeline(){return this.useStencil?this._stencilPipelineState:super.getPipeline()}}export{p as TerrainTechnique};
5
+ import{__decorate as e}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{layout as i}from"../../terrain/TerrainAttributes.js";import{ReloadableShader as t}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s,depthOnlyOutputBuffersOr as n}from"../core/shaderTechnique/ShaderTechnique.js";import{renderWhenBitIsNotSet as l}from"../lib/StencilUtils.js";import{a as o}from"../../../../chunks/Terrain.glsl.js";import{makePipelineState as c,defaultColorWrite as a,defaultDepthWrite as p,backFaceCullingParams as u,premultipliedAlpha as m}from"../../../webgl/renderState.js";let h=class extends s{constructor(e,r){super(e,r,i.locations),this.shader=new t(o,()=>import("./Terrain.glsl.js")),this.useStencil=!1}initializePipeline(e){return this._stencilPipelineState=this._createPipeline(e,!0),this._createPipeline(e,!1)}_createPipeline(e,r){const{renderOccluded:i,output:t}=e,s=e.backfaceCullingEnabled&&!i;return c({blending:i?m:null,culling:s?u:null,depthTest:i?null:{func:513},depthWrite:i?null:p,colorWrite:a,stencilTest:r?l(1):null,drawBuffers:n(t)})}getPipeline(){return this.useStencil?this._stencilPipelineState:super.getPipeline()}};h=e([r("esri.views.3d.webgl-engine.shaders.TerrainTechnique")],h);export{h as TerrainTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{Pos2Locations as o}from"../lib/DefaultVertexBufferLayouts.js";import{a as i}from"../../../../chunks/Viewshed.glsl.js";import{makePipelineState as s,unpremultipliedAlphaToPremultipliedAlpha as t,defaultColorWrite as l}from"../../../webgl/renderState.js";class a extends r{constructor(r,s){super(r,s,new e(i,()=>import("./Viewshed.glsl.js")),o)}initializePipeline(){return s({colorWrite:l,blending:t})}}export{a as ViewshedTechnique};
5
+ import{__decorate as e}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../chunks/Viewshed.glsl.js";import{makePipelineState as t,unpremultipliedAlphaToPremultipliedAlpha as c,defaultColorWrite as a}from"../../../webgl/renderState.js";let m=class extends o{constructor(){super(...arguments),this.shader=new s(i,()=>import("./Viewshed.glsl.js"))}initializePipeline(){return t({colorWrite:a,blending:c})}};m=e([r("esri.views.3d.webgl-engine.shaders.ViewshedTechnique")],m);export{m as ViewshedTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../core/Accessor.js";import t from"../core/Collection.js";import{when as s,watch as i}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 n}from"../core/accessorSupport/decorators/subclass.js";import{toExtent as o}from"./3d/support/cameraUtils.js";import{GroundElevationSampler as p}from"./support/GroundElevationSampler.js";import{IntegratedMeshElevationSampler as l}from"./support/IntegratedMeshElevationSampler.js";let d=class extends r{constructor(e){super(e),this.view=null,this.layerViews=new t}initialize(){this.addHandles(s(()=>this.view?.map?.ground,async e=>e.load())),"3d"===this.view.type&&this.addHandles([i(()=>this.view.map?.basemap,()=>this._groundLayersChanged(),{initial:!0}),i(()=>this.view.map?.basemap?.groundLayers,e=>{this._groundLayersChanged(),e?.on("after-changes",()=>this._groundLayersChanged())},{initial:!0}),i(()=>this.view.basemapView?.groundLayerViews,e=>{this._groundLayersChanged(),e?.on("after-changes",()=>this._groundLayersChanged())},{initial:!0}),s(()=>"3d"===this.view.type&&(this.view?.basemapTerrain??!1),async()=>{this._groundLayersChanged()})])}_groundLayersChanged(){const{view:e}=this;if(null!=e&&"3d"===e.type){const r=e.basemapTerrain;if(r){const t=e.map?.basemap?.groundLayers.some(r=>!!e.basemapView?.groundLayerViews.find(e=>e.layer===r)&&"replacesTerrain"in r&&r.replacesTerrain);r.enable(!t)}}}get ground(){return this.view?.map?.ground}destroy(){this._set("view",null),this.layerViews.destroyAll()}get elevationSampler(){return"3d"===this.view.type?new p({view:this.view}):null}get integratedMeshElevationSampler(){return this.view?new l({view:this.view}):null}get extent(){const{view:e}=this;return e?.ready?o(e,e.state.camera,e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation):null}get updating(){return!this.suspended&&this.layerViews.some(({updating:e})=>e)}get suspended(){return this.view?.suspended??!0}};e([a({readOnly:!0})],d.prototype,"elevationSampler",null),e([a({readOnly:!0})],d.prototype,"integratedMeshElevationSampler",null),e([a({readOnly:!0})],d.prototype,"extent",null),e([a({type:Boolean,readOnly:!0})],d.prototype,"updating",null),e([a({constructOnly:!0})],d.prototype,"view",void 0),e([a({type:t,readOnly:!0})],d.prototype,"layerViews",void 0),e([a({readOnly:!0})],d.prototype,"suspended",null),d=e([n("esri.views.GroundView")],d);const u=d;export{u as default};
5
+ import{__decorate as e}from"tslib";import r from"../core/Accessor.js";import t from"../core/Collection.js";import{when as s,watch as i}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 o}from"../core/accessorSupport/decorators/subclass.js";import{toExtent as n}from"./3d/support/cameraUtils.js";import{GroundElevationSampler as p}from"./support/GroundElevationSampler.js";import{IntegratedMeshElevationSampler as l}from"./support/IntegratedMeshElevationSampler.js";let d=class extends r{constructor(e){super(e),this.view=null,this.layerViews=new t}initialize(){this.addHandles([s(()=>this.view?.map?.ground,async e=>e.load()),i(()=>this.view.map?.basemap,()=>this._groundLayersChanged(),{initial:!0}),i(()=>this.view.map?.basemap?.groundLayers,e=>{this._groundLayersChanged(),e?.on("after-changes",()=>this._groundLayersChanged())},{initial:!0}),i(()=>this.view.basemapView?.groundLayerViews,e=>{this._groundLayersChanged(),e?.on("after-changes",()=>this._groundLayersChanged())},{initial:!0}),s(()=>"3d"===this.view.type&&(this.view?.basemapTerrain??!1),()=>this._groundLayersChanged())])}_groundLayersChanged(){const{view:e}=this;if(null!=e&&"3d"===e.type){const r=e.basemapTerrain;if(r){const t=e.map?.basemap?.groundLayers.some(r=>!!e.basemapView?.groundLayerViews.find(e=>e.layer===r)&&"replacesTerrain"in r&&r.replacesTerrain);r.enable(!t)}}}get ground(){return this.view?.map?.ground}destroy(){this._set("view",null),this.layerViews.destroyAll()}get elevationSampler(){return"3d"===this.view.type?new p({view:this.view}):null}get integratedMeshElevationSampler(){return this.view?new l({view:this.view}):null}get extent(){const{view:e}=this;return e?.ready?n(e,e.state.camera,e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation):null}get updating(){return!this.suspended&&this.layerViews.some(({updating:e})=>e)}get suspended(){return this.view?.suspended??!0}};e([a({readOnly:!0})],d.prototype,"elevationSampler",null),e([a({readOnly:!0})],d.prototype,"integratedMeshElevationSampler",null),e([a({readOnly:!0})],d.prototype,"extent",null),e([a({type:Boolean,readOnly:!0})],d.prototype,"updating",null),e([a({constructOnly:!0})],d.prototype,"view",void 0),e([a({type:t,readOnly:!0})],d.prototype,"layerViews",void 0),e([a({readOnly:!0})],d.prototype,"suspended",null),d=e([o("esri.views.GroundView")],d);const u=d;export{u 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{destroyMaybe as p,maybeProperty as h}from"../core/maybe.js";import{throwIfDestroyed as d,throwIfAborted as u,createAbortError as c}from"../core/promiseUtils.js";import g from"../core/ReactiveSet.js";import{on as m,watch as y,initial as f,sync as w,whenOnce as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{setFrameDuration as b,cleanupScheduling as M}from"../core/scheduling.js";import{createScreenPointArray as S,createScreenPoint as V}from"../core/screenUtils.js";import{cleanupWhereClauseCache as j}from"../core/sql.js";import{getMetersPerUnitForSR as C}from"../core/unitUtils.js";import{initialize as T}from"../core/workers/workers.js";import{property as R}from"../core/accessorSupport/decorators/property.js";import{cast as x}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as O}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as E,ensureClass as A}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as L}from"../core/accessorSupport/overrideDefaultsFrom.js";import{drainNotificationQueue as H}from"../core/accessorSupport/trackingUtils.js";import{create as I}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as P}from"../core/libs/rbush/PooledRBush.js";import{owningCollectionProperty as F}from"../core/support/OwningCollection.js";import D from"../geometry/Extent.js";import U from"../geometry/HeightModelInfo.js";import G from"../geometry/Point.js";import{project as W,canProjectWithoutEngine as q}from"../geometry/projectionUtils.js";import z from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as k}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as B}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as N}from"../geometry/projection/projectPointToVector.js";import{toExtent as Q,create as Y}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Z}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as $}from"../geometry/support/scaleUtils.js";import{isImageryTileLayer as J,isTiledLayer as K,isVoxelLayer as X,isIntegratedMeshLayer as ee}from"../layers/support/layerUtils.js";import{TilemapCache as te}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as ie}from"../portal/portalDefault.js";import{AnalysesCollection as re}from"../support/AnalysesCollection.js";import{WebSceneTag as se}from"../support/tagSymbols.js";import{BreakpointsOwner as ne}from"./BreakpointsOwner.js";import{DOMContainer as ae}from"./DOMContainer.js";import{PopupView as oe}from"./PopupView.js";import le from"./View.js";import pe from"./ViewAnimation.js";import{stringFromViewingMode as he,viewingModeFromString as de}from"./ViewingMode.js";import{GroundView3D as ue}from"./3d/GroundView3D.js";import{layerView3DImporter as ce}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as ge}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as me}from"./3d/camera/intersectionUtils.js";import{Constraints as ye}from"./3d/constraints/Constraints.js";import{EnvironmentManager as fe}from"./3d/environment/EnvironmentManager.js";import we from"./3d/environment/SceneViewEnvironment.js";import ve from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as _e}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as be}from"./3d/layers/graphics/Labeler.js";import Me from"./3d/layers/i3s/I3SLodHandling.js";import{cleanupStageLayerElevationProvider as Se}from"./3d/layers/support/StageLayerElevationProvider.js";import{ScreenSizePerspective as Ve}from"./3d/state/ScreenSizePerspective.js";import je from"./3d/state/ViewState.js";import{ViewStateManager as Ce,cleanupViewStateManager as Te}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Re}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as xe}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as Oe}from"./3d/state/utils/navigationUtils.js";import{CombinedElevationProvider as Ee}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as Ae}from"./3d/support/debugFlags.js";import Le from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as He}from"./3d/support/ElevationProvider.js";import{toMap as Ie,hitTest as Pe}from"./3d/support/hitTest.js";import{popupHitTest as Fe}from"./3d/support/popupHitTest.js";import De from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Ue}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Ge}from"./3d/support/ResourceController.js";import We from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as qe}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as ze}from"./3d/support/ViewSlice.js";import{PointsOfInterest as ke}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Be from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ne,getTiledLayerInfo as Qe,checkIfTileInfoSupportedForView as Ye}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as Ze}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as $e}from"./3d/terrain/TileRenderer.js";import{Stage as Je}from"./3d/webgl-engine/Stage.js";import{olidEnabled as Ke}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as Xe}from"./3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js";import{defaultTolerance as et}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as tt}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as it}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as rt}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import st from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as nt}from"./support/drapedUtils.js";import{defaultHighlightName as at}from"./support/HighlightDefaults.js";import ot from"./support/HighlightOptions.js";import{occludeesSupported as lt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as pt,createScreenPointFromSupportedEvent as ht}from"./support/screenUtils.js";import{isSpatialReferenceSupported as dt}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as ut,destroyTextureCompressionWorker as ct}from"./support/TextureCompressionHelper.js";import{check as gt}from"./support/WebGLRequirements.js";import mt from"./ui/DefaultUI.js";import yt from"./ui/3d/DefaultUI3D.js";import ft from"../webscene/Environment.js";import{clearVNodeCache as wt}from"../widgets/support/vnodeCache.js";var vt;const _t=Symbol(),bt=Symbol();let Mt=class extends(ne(oe(ae(le)))){static{vt=this}constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=Ge(this),this.deconflictor=new _e({view:this}),this.labeler=new be({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new re,this.animationsEnabled=!0,this.basemapTerrain=null,this.elevationProvider=new Ee({view:this}),this._canvas=null,this.constraints=new ye,this._environment=new we,this.environmentManager=new fe,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new st({importAnalysisViewModule:e=>ge(e),view:this}),this.groundView=null,this.map=null,this._featureTileTreeClients=new g,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new je({view:this}),this.slice=new ze,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new yt,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,T();const t=(e=null)=>{null!=e&&4===e.type||(this._updatingChanged(),this.map?.allLayers.forEach(async e=>{try{await e.when()}catch(t){}this._updatingChanged()}))};this.addHandles([m(()=>this.map?.allLayers,"after-changes",e=>t(e),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),y(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new ve({view:this}),this.stateManager=new Ce({view:this}),this.screenSizePerspective=new Ve({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=ut(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ue({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>b(e>0?1e3/Math.ceil(e):0),f),this.addHandles([y(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),w),y(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),w)])}destroy(){this.destroyed||(ct(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._set("analysisViewManager",p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set("labeler",p(this.labeler)),this._set("deconflictor",p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set("stateManager",p(this.stateManager)),this._set("inputManager",p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",p(this.environmentManager)),this._set("environment",p(this.environment)),this.groundView=p(this.groundView),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set("ui",null),this._set("renderCanvas",null),this._set("canvas",null),this._canvas=null,this.screenSizePerspective.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=e)}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||h(e,"clippingArea");return!this._userClippingArea&&!h(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof D?this.spatialReference&&(t=St(t,this.spatialReference),null==t)?(l.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==t.intersection(this._groundAndLayersExtent)&&(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?l.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(1===this.state.viewingMode)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:St(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||z.WGS84,i=St(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||z.WGS84;let t;const i=i=>{const r=St(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{basemapTerrain:r}=this;if(r?.spatialReference){const e=r.groundExtent;i(new D({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}const s=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach(e=>s(e)),null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const n=this._get("_groundAndLayersExtent");return t.equals(n)?n:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;const{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange("environment")}castEnvironment(e){return e?e instanceof we?e:e instanceof ft?this.environment?.cloneWithWebsceneEnvironment(e)??we.fromWebsceneEnvironment(e):E(we,e):new we}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return vt._layerToLayerview}static{this._layerToLayerview=le._layerToLayerview.concat([["view.map.ground.layers","view.groundView.layerViews"]])}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&se in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){Le.isValidProfile(e)&&(Le.apply(e,this.qualitySettings),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||Le.getDefaultProfile()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?$(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?U.deriveUnitFromSR(e,this.spatialReference):null}get alphaCompositingEnabled(){return this._get("alphaCompositingEnabled")}set alphaCompositingEnabled(e){this._stage&&l.getLogger(this).warn("alphaCompositingEnabled cannot be changed after the view has become ready"),this._set("alphaCompositingEnabled",e)}get updating(){if(this.destroying||this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Ne(r))return;++i,e+=r.updatingProgress}}else++i});for(const s of this._updatingObjects)if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of this._updatingObjectsWithProgress)null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return he(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?he(this.defaultsFromMap.viewingMode):dt(t,1)?"global":"local":"global"}set viewingMode(e){this.ready?l.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get highlightOptions(){return this.highlights.find(({name:e})=>e===at)??new ot}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===at)return void this.highlights.items[t].assignFrom(e)}}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new We(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=pt(e)?ht(this,e):e;return Ie(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=(null==e.z?He(this.elevationProvider,e):null)??0;return N(e,Vt,this.renderSpatialReference,t),this.state.camera.projectToScreen(Vt,jt),V(jt[0],jt[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;N(e,Vt,i);const r=this.state.camera.computeScreenPixelSizeAt(Vt);return t&&i!==t?r*C(i)/C(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=pt(e)?ht(this,e):e;return Pe(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return Fe(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":case"viewshed":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import("./support/screenshotUtils.js");return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await import("./support/screenshotUtils.js"),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!Ke())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await import("./support/screenshotUtils.js"),i=await this._completeSettings(e);i.olidColor=!0,await this.whenReady();const r=await this.stage.renderView.takeScreenshot(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true")}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return ce.importLayerView(e)}hasLayerViewModule(e){return ce.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}getSurface(){return this.surface}async validate(){let e=gt(this.type);const t=has("safari");if(t&&t<9&&(e=new n("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw l.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?de(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,2),s=this._validateSpatialReferenceForViewingMode(e,t,1);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,2)}:{constraints:this._makeSpatialReferenceConstraints(e,t,1)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!dt(e,i)&&(null==t||(!!J(t)||(!K(t)||null!=Qe(t,e,i))&&(!X(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(J(t)&&(r||s)){return!s||2===i||null===Ye(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:z.WebMercator,viewingMode:i}]:[{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}return K(t)||X(t)||!r&&!s?K(t)&&r&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:z.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${he(i)} viewing mode.`):e.isGeographic&&l.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}maskOccludee(e){if(!e)return l.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&lt(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>"media-3d"!==e.type).find(t=>t.layer===e.layer):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await v(()=>this.graphicsView),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise((t,i)=>{const r=this.map.allLayers.on("change",s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))})}):this.whenLayerView(e.layer):null}enableFeatureTiles(){const e=Symbol();return this._featureTileTreeClients.add(e),o(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await Tt[e]();if(t&&(d(this),u(i.signal),await t(i.signal)),this.destroyed)throw c();return u(i.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set("basemapTerrain",new Be({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){const{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set("basemapTerrain",null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new ke({view:this})),this.addHandles([this.updatingHandles.add(()=>Ae.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&Ae.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},_),this.updatingHandles.add(()=>({basemapExtent:this.basemapTerrain?.extent,basemapSpatialReference:this.basemapTerrain?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:i,featureTiles:r})=>{if(!r)return;const s=!!e;if(i||s)if(s&&t){const s=e&&t?W(Q(e,t),this.spatialReference):null;r.filterExtent=i?i.intersection(s):s}else r.filterExtent=i;else r.filterExtent=null},_),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.addPromise(this._ensureFeatureTileTree()):this._featureTiles=p(this._featureTiles)},w)],_t),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has("FeatureTileTree3D"))return;const e=(await this.updatingHandles.addPromise(this._importModule("FeatureTileTree3D")))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(bt),this.removeHandles(_t),this._featureTiles=p(this.featureTiles),this._set("pointsOfInterest",p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=Z(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Ue.create(this.state.viewingMode,i)),t||this.addHandles(y(()=>this.basemapTerrain?.extent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!B(e,this.basemapTerrain.spatialReference,Ct,t)||(this.renderCoordsHelper.extent=Ct)},w),bt),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(et/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles(bt),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&4===e.type||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(y(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),w),"updatingMonitors"),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new xe(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new Je({view:this,options:e,container:i}),this.notifyChange("stage"),this._updateSlice(),this.addHandles([this.updatingHandles.add(()=>this.qualitySettings.highQualityTransparency,e=>this.stage.renderer.setParameters({highQualityTransparency:e}),f),this.on("pointer-move",()=>this.stage?.renderer.resetAnimation()),a(this.stage.renderView.canvas,"webglcontextlost",e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage)})],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(et/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set("sceneIntersectionHelper",null),this._stage=p(this.stage),this._set("stage",null),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new qe({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has("GraphicsView3D")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this.updatingHandles.addPromise(this._importModule("GraphicsView3D",e=>v(()=>this.basemapTerrain?.ready,e))))?.default;e&&this._set("graphicsView",new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport("GraphicsView3D"),this.removeHandles("GraphicsView3D"),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_disposeFocusAreasView(){this._abortImport("FocusAreasView"),this.removeHandles("FocusAreasView"),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has("FocusAreasView")||0===e)return;this.removeHandles("FocusAreasView");const t=(await this.updatingHandles.addPromise(this._importModule("FocusAreasView")))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){1===de(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set("ready",!0),this.addHandles(m(()=>this.graphics,"after-changes",()=>this._ensureGraphicsView()),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(y(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),"FocusAreasView");const e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?L(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const i=this._resolveWhenReady;this._resolveWhenReady=[],i.forEach(e=>e(this))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(it);for(const t of this.allLayerViews)ee(t.layer)&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(it);for(const t of this.allLayerViews)ee(t.layer)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){wt(),H(),j(),rt(),Te(),me(),Se(),k(),nt(),ie(),$e(),tt(),Re(),Oe(),P(),M(),Xe(),Ze(),Me.cleanupI3SLodHandling(),te.cleanupTilemapCache(),je.cleanupViewstate(),Be.cleanupTerrainSurface()}};function St(e,t){return null!=e&&q(e.spatialReference,t)?W(e,t):null}e([R()],Mt.prototype,"_userClippingArea",void 0),e([R()],Mt.prototype,"_resourceController",void 0),e([R()],Mt.prototype,"stage",null),e([R({readOnly:!0})],Mt.prototype,"deconflictor",void 0),e([R({readOnly:!0})],Mt.prototype,"labeler",void 0),e([R(F(re,"analyses"))],Mt.prototype,"analyses",void 0),e([R({type:pe,readOnly:!0})],Mt.prototype,"animation",null),e([R()],Mt.prototype,"animationsEnabled",void 0),e([R({readOnly:!0})],Mt.prototype,"basemapTerrain",void 0),e([R({readOnly:!0})],Mt.prototype,"overlayManager",null),e([R({readOnly:!0})],Mt.prototype,"elevationProvider",void 0),e([R()],Mt.prototype,"camera",null),e([R({type:t})],Mt.prototype,"contentCamera",null),e([R({readOnly:!0})],Mt.prototype,"canvas",null),e([R({type:G})],Mt.prototype,"center",null),e([R({type:D})],Mt.prototype,"clippingArea",null),e([R({type:ye,nonNullable:!0})],Mt.prototype,"constraints",void 0),e([R({type:D,readOnly:!0})],Mt.prototype,"renderDataExtent",null),e([R({readOnly:!0})],Mt.prototype,"tileInfo",null),e([R({type:D,readOnly:!0})],Mt.prototype,"dataExtent",null),e([R({type:D,readOnly:!0})],Mt.prototype,"_groundAndLayersExtent",null),e([R({type:we})],Mt.prototype,"environment",null),e([x("environment")],Mt.prototype,"castEnvironment",null),e([R({readOnly:!0})],Mt.prototype,"environmentManager",void 0),e([R({type:D})],Mt.prototype,"extent",null),e([R({type:r})],Mt.prototype,"floors",void 0),e([R()],Mt.prototype,"screenCenter",null),e([R()],Mt.prototype,"frustum",null),e([R({type:Number,readOnly:!0})],Mt.prototype,"fullOpacity",void 0),e([R({readOnly:!0})],Mt.prototype,"graphicsView",void 0),e([R()],Mt.prototype,"analysisViewManager",void 0),e([R()],Mt.prototype,"groundView",void 0),e([R({readOnly:!0})],Mt.prototype,"layerviewCollections",null),e([R({type:Boolean})],Mt.prototype,"initialExtentRequired",null),e([R()],Mt.prototype,"defaultsFromMapSettings",null),e([R()],Mt.prototype,"interacting",null),e([R()],Mt.prototype,"stationary",null),e([R()],Mt.prototype,"navigating",null),e([R()],Mt.prototype,"map",void 0),e([R()],Mt.prototype,"padding",null),e([R({type:ke,readOnly:!0})],Mt.prototype,"pointsOfInterest",void 0),e([R()],Mt.prototype,"_featureTiles",void 0),e([R()],Mt.prototype,"featureTiles",null),e([R()],Mt.prototype,"_featureTreeDebugger",void 0),e([R({constructOnly:!0})],Mt.prototype,"deactivatedWebGLExtensions",void 0),e([R({constructOnly:!0})],Mt.prototype,"debugWebGLExtensions",void 0),e([R({constructOnly:!0})],Mt.prototype,"renderCanvas",void 0),e([R({constructOnly:!0})],Mt.prototype,"state",void 0),e([R()],Mt.prototype,"screenSizePerspective",void 0),e([R({readOnly:!0})],Mt.prototype,"inputManager",void 0),e([R({readOnly:!0})],Mt.prototype,"stateManager",void 0),e([R({type:["low","medium","high"]})],Mt.prototype,"qualityProfile",null),e([R({type:De,get(){let e=this._get("qualitySettings");return e||(e=new De,Le.apply(this.qualityProfile,e)),e}})],Mt.prototype,"qualitySettings",void 0),e([R()],Mt.prototype,"slice",void 0),e([R({readOnly:!0})],Mt.prototype,"typeSpecificPreconditionsReady",null),e([R({readOnly:!0})],Mt.prototype,"renderCoordsHelper",void 0),e([R({readOnly:!0})],Mt.prototype,"sceneIntersectionHelper",void 0),e([R({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],Mt.prototype,"resolution",null),e([R({type:Number})],Mt.prototype,"scale",null),e([R()],Mt.prototype,"heightModelInfo",null),e([R()],Mt.prototype,"spatialReference",void 0),e([R({type:Boolean,value:!1})],Mt.prototype,"alphaCompositingEnabled",null),e([R({constructOnly:!0})],Mt.prototype,"preserveDrawingBufferEnabled",void 0),e([R({type:Boolean})],Mt.prototype,"supersampleScreenshotsEnabled",void 0),e([R({readOnly:!0})],Mt.prototype,"type",void 0),e([R(),x(e=>e instanceof mt?e:A(yt,e))],Mt.prototype,"ui",void 0),e([R({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],Mt.prototype,"updating",null),e([R()],Mt.prototype,"_updatingObjects",null),e([R()],Mt.prototype,"_updatingObjectsWithProgress",null),e([R({type:Number,readOnly:!0,dependsOn:["updating"]})],Mt.prototype,"updatingProgress",void 0),e([R({type:["global","local"]})],Mt.prototype,"viewingMode",null),e([R({type:i})],Mt.prototype,"viewpoint",null),e([R({readOnly:!0})],Mt.prototype,"visibleArea",null),e([R({type:Number})],Mt.prototype,"zoom",null),e([R({type:ot})],Mt.prototype,"highlightOptions",null),e([R({readOnly:!0})],Mt.prototype,"quality",null),e([R({readOnly:!0})],Mt.prototype,"resolutionScale",null),e([R()],Mt.prototype,"focusAreasView",void 0),e([R()],Mt.prototype,"_defaultToMapOptions",null),e([R()],Mt.prototype,"_defaultHitTestOptions",null),Mt=vt=e([O("esri.views.SceneView")],Mt);const Vt=I(),jt=S(),Ct=Y(),Tt={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js"),FeatureTileTree3D:()=>import("./3d/layers/support/FeatureTileTree3D.js")},Rt=Mt;export{Rt as default};
5
+ import{__decorate as e}from"tslib";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{destroyMaybe as p,maybeProperty as h}from"../core/maybe.js";import{throwIfDestroyed as d,throwIfAborted as u,createAbortError as c}from"../core/promiseUtils.js";import g from"../core/ReactiveSet.js";import{on as m,watch as y,initial as f,sync as w,whenOnce as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{setFrameDuration as b,cleanupScheduling as M}from"../core/scheduling.js";import{createScreenPointArray as S,createScreenPoint as V}from"../core/screenUtils.js";import{cleanupWhereClauseCache as j}from"../core/sql.js";import{getMetersPerUnitForSR as C}from"../core/unitUtils.js";import{initialize as T}from"../core/workers/workers.js";import{property as R}from"../core/accessorSupport/decorators/property.js";import{cast as x}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as O}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as E,ensureClass as A}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as L}from"../core/accessorSupport/overrideDefaultsFrom.js";import{drainNotificationQueue as H}from"../core/accessorSupport/trackingUtils.js";import{create as I}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as P}from"../core/libs/rbush/PooledRBush.js";import{owningCollectionProperty as F}from"../core/support/OwningCollection.js";import D from"../geometry/Extent.js";import U from"../geometry/HeightModelInfo.js";import G from"../geometry/Point.js";import{project as W,canProjectWithoutEngine as q}from"../geometry/projectionUtils.js";import z from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as k}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as B}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as N}from"../geometry/projection/projectPointToVector.js";import{toExtent as Q,create as Y}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Z}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as $}from"../geometry/support/scaleUtils.js";import{isImageryTileLayer as J,isTiledLayer as K,isVoxelLayer as X,isIntegratedMeshLayer as ee}from"../layers/support/layerUtils.js";import{TilemapCache as te}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as ie}from"../portal/portalDefault.js";import{AnalysesCollection as re}from"../support/AnalysesCollection.js";import{WebSceneTag as se}from"../support/tagSymbols.js";import{BreakpointsOwner as ne}from"./BreakpointsOwner.js";import{DOMContainer as ae}from"./DOMContainer.js";import{PopupView as oe}from"./PopupView.js";import le from"./View.js";import pe from"./ViewAnimation.js";import{stringFromViewingMode as he,viewingModeFromString as de}from"./ViewingMode.js";import{GroundView3D as ue}from"./3d/GroundView3D.js";import{layerView3DImporter as ce}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as ge}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as me}from"./3d/camera/intersectionUtils.js";import{Constraints as ye}from"./3d/constraints/Constraints.js";import{EnvironmentManager as fe}from"./3d/environment/EnvironmentManager.js";import we from"./3d/environment/SceneViewEnvironment.js";import ve from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as _e}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as be}from"./3d/layers/graphics/Labeler.js";import Me from"./3d/layers/i3s/I3SLodHandling.js";import{cleanupStageLayerElevationProvider as Se}from"./3d/layers/support/StageLayerElevationProvider.js";import{ScreenSizePerspective as Ve}from"./3d/state/ScreenSizePerspective.js";import je from"./3d/state/ViewState.js";import{ViewStateManager as Ce,cleanupViewStateManager as Te}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Re}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as xe}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as Oe}from"./3d/state/utils/navigationUtils.js";import{CombinedElevationProvider as Ee}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as Ae}from"./3d/support/debugFlags.js";import{getElevationAtPoint as Le}from"./3d/support/ElevationProvider.js";import{toMap as He,hitTest as Ie}from"./3d/support/hitTest.js";import{popupHitTest as Pe}from"./3d/support/popupHitTest.js";import{getQualityProfileSettings as Fe,getDefaultQualityProfileName as De}from"./3d/support/QualityProfile.js";import Ue from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Ge}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as We}from"./3d/support/ResourceController.js";import qe from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as ze}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as ke}from"./3d/support/ViewSlice.js";import{PointsOfInterest as Be}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ne from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Qe,getTiledLayerInfo as Ye,checkIfTileInfoSupportedForView as Ze}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as $e}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as Je}from"./3d/terrain/TileRenderer.js";import{Stage as Ke}from"./3d/webgl-engine/Stage.js";import{olidEnabled as Xe}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as et}from"./3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js";import{defaultTolerance as tt}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as it}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as rt}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as st}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import nt from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as at}from"./support/drapedUtils.js";import{defaultHighlightName as ot}from"./support/HighlightDefaults.js";import lt from"./support/HighlightOptions.js";import{occludeesSupported as pt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as ht,createScreenPointFromSupportedEvent as dt}from"./support/screenUtils.js";import{isSpatialReferenceSupported as ut}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as ct,destroyTextureCompressionWorker as gt}from"./support/TextureCompressionHelper.js";import{check as mt}from"./support/WebGLRequirements.js";import yt from"./ui/DefaultUI.js";import ft from"./ui/3d/DefaultUI3D.js";import wt from"../webscene/Environment.js";import{clearVNodeCache as vt}from"../widgets/support/vnodeCache.js";var _t;const bt=Symbol(),Mt=Symbol();let St=class extends(ne(oe(ae(le)))){static{_t=this}constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=We(this),this.deconflictor=new _e({view:this}),this.labeler=new be({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new re,this.animationsEnabled=!0,this.basemapTerrain=null,this.elevationProvider=new Ee({view:this}),this._canvas=null,this.constraints=new ye,this._environment=new we,this.environmentManager=new fe,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new nt({importAnalysisViewModule:e=>ge(e),view:this}),this.groundView=null,this.map=null,this._featureTileTreeClients=new g,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new je({view:this}),this.slice=new ke,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new ft,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,T();const t=(e=null)=>{null!=e&&4===e.type||(this._updatingChanged(),this.map?.allLayers.forEach(async e=>{try{await e.when()}catch(t){}this._updatingChanged()}))};this.addHandles([m(()=>this.map?.allLayers,"after-changes",e=>t(e),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),y(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new ve({view:this}),this.stateManager=new Ce({view:this}),this.screenSizePerspective=new Ve({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=ct(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ue({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>b(e>0?1e3/Math.ceil(e):0),f),this.addHandles([y(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),w),y(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),w)])}destroy(){this.destroyed||(gt(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._set("analysisViewManager",p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set("labeler",p(this.labeler)),this._set("deconflictor",p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set("stateManager",p(this.stateManager)),this._set("inputManager",p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",p(this.environmentManager)),this._set("environment",p(this.environment)),this.groundView=p(this.groundView),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set("ui",null),this._set("renderCanvas",null),this._set("canvas",null),this._canvas=null,this.screenSizePerspective.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=e)}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||h(e,"clippingArea");return!this._userClippingArea&&!h(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof D?this.spatialReference&&(t=Vt(t,this.spatialReference),null==t)?(l.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==t.intersection(this._groundAndLayersExtent)&&(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?l.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(1===this.state.viewingMode)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:Vt(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||z.WGS84,i=Vt(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||z.WGS84;let t;const i=i=>{const r=Vt(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{basemapTerrain:r}=this;if(r?.spatialReference){const e=r.groundExtent;i(new D({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}const s=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach(e=>s(e)),null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const n=this._get("_groundAndLayersExtent");return t.equals(n)?n:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;const{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange("environment")}castEnvironment(e){return e?e instanceof we?e:e instanceof wt?this.environment?.cloneWithWebsceneEnvironment(e)??we.fromWebsceneEnvironment(e):E(we,e):new we}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return _t._layerToLayerview}static{this._layerToLayerview=le._layerToLayerview.concat([["view.map.ground.layers","view.groundView.layerViews"]])}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&se in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){const t=Fe(e);t&&this._get("qualityProfile")!==e&&(this.qualitySettings=new Ue(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||De()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?$(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){const e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;const i=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return i<=0?null:Math.max(0,Math.min(i,r||1/0))}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?U.deriveUnitFromSR(e,this.spatialReference):null}get alphaCompositingEnabled(){return this._get("alphaCompositingEnabled")}set alphaCompositingEnabled(e){this._stage&&l.getLogger(this).warn("alphaCompositingEnabled cannot be changed after the view has become ready"),this._set("alphaCompositingEnabled",e)}get updating(){if(this.destroying||this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Qe(r))return;++i,e+=r.updatingProgress}}else++i});for(const s of this._updatingObjects)if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of this._updatingObjectsWithProgress)null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return he(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?he(this.defaultsFromMap.viewingMode):ut(t,1)?"global":"local":"global"}set viewingMode(e){this.ready?l.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get highlightOptions(){return this.highlights.find(({name:e})=>e===ot)??new lt}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===ot)return void this.highlights.items[t].assignFrom(e)}}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new qe(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=ht(e)?dt(this,e):e;return He(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=(null==e.z?Le(this.elevationProvider,e):null)??0;return N(e,jt,this.renderSpatialReference,t),this.state.camera.projectToScreen(jt,Ct),V(Ct[0],Ct[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;N(e,jt,i);const r=this.state.camera.computeScreenPixelSizeAt(jt);return t&&i!==t?r*C(i)/C(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=ht(e)?dt(this,e):e;return Ie(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return Pe(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":case"viewshed":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import("./support/screenshotUtils.js");return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await import("./support/screenshotUtils.js"),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!Xe())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await import("./support/screenshotUtils.js"),i=await this._completeSettings(e);i.olidColor=!0,await this.whenReady();const r=await this.stage.renderView.takeScreenshot(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true")}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return ce.importLayerView(e)}hasLayerViewModule(e){return ce.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}getSurface(){return this.surface}async validate(){let e=mt(this.type);const t=has("safari");if(t&&t<9&&(e=new n("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw l.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?de(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,2),s=this._validateSpatialReferenceForViewingMode(e,t,1);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,2)}:{constraints:this._makeSpatialReferenceConstraints(e,t,1)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!ut(e,i)&&(null==t||(!!J(t)||(!K(t)||null!=Ye(t,e,i))&&(!X(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(J(t)&&(r||s)){return!s||2===i||null===Ze(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:z.WebMercator,viewingMode:i}]:[{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}return K(t)||X(t)||!r&&!s?K(t)&&r&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:z.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${he(i)} viewing mode.`):e.isGeographic&&l.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}maskOccludee(e){if(!e)return l.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&pt(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>"media-3d"!==e.type).find(t=>t.layer===e.layer):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await v(()=>this.graphicsView),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise((t,i)=>{const r=this.map.allLayers.on("change",s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))})}):this.whenLayerView(e.layer):null}enableFeatureTiles(){const e=Symbol();return this._featureTileTreeClients.add(e),o(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await Rt[e]();if(t&&(d(this),u(i.signal),await t(i.signal)),this.destroyed)throw c();return u(i.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set("basemapTerrain",new Ne({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){const{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set("basemapTerrain",null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Be({view:this})),this.addHandles([this.updatingHandles.add(()=>Ae.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&Ae.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},_),this.updatingHandles.add(()=>({basemapExtent:this.basemapTerrain?.extent,basemapSpatialReference:this.basemapTerrain?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:i,featureTiles:r})=>{if(!r)return;const s=!!e;if(i||s)if(s&&t){const s=e&&t?W(Q(e,t),this.spatialReference):null;r.filterExtent=i?i.intersection(s):s}else r.filterExtent=i;else r.filterExtent=null},_),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.addPromise(this._ensureFeatureTileTree()):this._featureTiles=p(this._featureTiles)},w)],bt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has("FeatureTileTree3D"))return;const e=(await this.updatingHandles.addPromise(this._importModule("FeatureTileTree3D")))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(Mt),this.removeHandles(bt),this._featureTiles=p(this.featureTiles),this._set("pointsOfInterest",p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=Z(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Ge.create(this.state.viewingMode,i)),t||this.addHandles(y(()=>this.basemapTerrain?.extent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!B(e,this.basemapTerrain.spatialReference,Tt,t)||(this.renderCoordsHelper.extent=Tt)},w),Mt),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(tt/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles(Mt),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&4===e.type||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(y(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),w),"updatingMonitors"),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new xe(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new Ke({view:this,options:e,container:i}),this.notifyChange("stage"),this._updateSlice(),this.addHandles([this.on("pointer-move",()=>this.stage?.renderer.resetAnimation()),a(this.stage.renderView.canvas,"webglcontextlost",e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage)})],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(tt/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set("sceneIntersectionHelper",null),this._stage=p(this.stage),this._set("stage",null),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new ze({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has("GraphicsView3D")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this.updatingHandles.addPromise(this._importModule("GraphicsView3D",e=>v(()=>this.basemapTerrain?.ready,e))))?.default;e&&this._set("graphicsView",new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport("GraphicsView3D"),this.removeHandles("GraphicsView3D"),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_disposeFocusAreasView(){this._abortImport("FocusAreasView"),this.removeHandles("FocusAreasView"),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has("FocusAreasView")||0===e)return;this.removeHandles("FocusAreasView");const t=(await this.updatingHandles.addPromise(this._importModule("FocusAreasView")))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){1===de(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set("ready",!0),this.addHandles(m(()=>this.graphics,"after-changes",()=>this._ensureGraphicsView()),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(y(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),"FocusAreasView");const e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?L(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const i=this._resolveWhenReady;this._resolveWhenReady=[],i.forEach(e=>e(this))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(rt);for(const t of this.allLayerViews)ee(t.layer)&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(rt);for(const t of this.allLayerViews)ee(t.layer)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){vt(),H(),j(),st(),Te(),me(),Se(),k(),at(),ie(),Je(),it(),Re(),Oe(),P(),M(),et(),$e(),Me.cleanupI3SLodHandling(),te.cleanupTilemapCache(),je.cleanupViewstate(),Ne.cleanupTerrainSurface()}};function Vt(e,t){return null!=e&&q(e.spatialReference,t)?W(e,t):null}e([R()],St.prototype,"_userClippingArea",void 0),e([R()],St.prototype,"_resourceController",void 0),e([R()],St.prototype,"stage",null),e([R({readOnly:!0})],St.prototype,"deconflictor",void 0),e([R({readOnly:!0})],St.prototype,"labeler",void 0),e([R(F(re,"analyses"))],St.prototype,"analyses",void 0),e([R({type:pe,readOnly:!0})],St.prototype,"animation",null),e([R()],St.prototype,"animationsEnabled",void 0),e([R({readOnly:!0})],St.prototype,"basemapTerrain",void 0),e([R({readOnly:!0})],St.prototype,"overlayManager",null),e([R({readOnly:!0})],St.prototype,"elevationProvider",void 0),e([R()],St.prototype,"camera",null),e([R({type:t})],St.prototype,"contentCamera",null),e([R({readOnly:!0})],St.prototype,"canvas",null),e([R({type:G})],St.prototype,"center",null),e([R({type:D})],St.prototype,"clippingArea",null),e([R({type:ye,nonNullable:!0})],St.prototype,"constraints",void 0),e([R({type:D,readOnly:!0})],St.prototype,"renderDataExtent",null),e([R({readOnly:!0})],St.prototype,"tileInfo",null),e([R({type:D,readOnly:!0})],St.prototype,"dataExtent",null),e([R({type:D,readOnly:!0})],St.prototype,"_groundAndLayersExtent",null),e([R({type:we})],St.prototype,"environment",null),e([x("environment")],St.prototype,"castEnvironment",null),e([R({readOnly:!0})],St.prototype,"environmentManager",void 0),e([R({type:D})],St.prototype,"extent",null),e([R({type:r})],St.prototype,"floors",void 0),e([R()],St.prototype,"screenCenter",null),e([R()],St.prototype,"frustum",null),e([R({type:Number,readOnly:!0})],St.prototype,"fullOpacity",void 0),e([R({readOnly:!0})],St.prototype,"graphicsView",void 0),e([R()],St.prototype,"analysisViewManager",void 0),e([R()],St.prototype,"groundView",void 0),e([R({readOnly:!0})],St.prototype,"layerviewCollections",null),e([R({type:Boolean})],St.prototype,"initialExtentRequired",null),e([R()],St.prototype,"defaultsFromMapSettings",null),e([R()],St.prototype,"interacting",null),e([R()],St.prototype,"stationary",null),e([R()],St.prototype,"navigating",null),e([R()],St.prototype,"map",void 0),e([R()],St.prototype,"padding",null),e([R({type:Be,readOnly:!0})],St.prototype,"pointsOfInterest",void 0),e([R()],St.prototype,"_featureTiles",void 0),e([R()],St.prototype,"featureTiles",null),e([R()],St.prototype,"_featureTreeDebugger",void 0),e([R({constructOnly:!0})],St.prototype,"deactivatedWebGLExtensions",void 0),e([R({constructOnly:!0})],St.prototype,"debugWebGLExtensions",void 0),e([R({constructOnly:!0})],St.prototype,"renderCanvas",void 0),e([R({constructOnly:!0})],St.prototype,"state",void 0),e([R()],St.prototype,"screenSizePerspective",void 0),e([R({readOnly:!0})],St.prototype,"inputManager",void 0),e([R({readOnly:!0})],St.prototype,"stateManager",void 0),e([R({type:["low","medium","high"]})],St.prototype,"qualityProfile",null),e([R({type:Ue,get(){let e=this._get("qualitySettings");if(!e){const t=Fe(this.qualityProfile);e=new Ue(t)}return e}})],St.prototype,"qualitySettings",void 0),e([R()],St.prototype,"slice",void 0),e([R({readOnly:!0})],St.prototype,"typeSpecificPreconditionsReady",null),e([R({readOnly:!0})],St.prototype,"renderCoordsHelper",void 0),e([R({readOnly:!0})],St.prototype,"sceneIntersectionHelper",void 0),e([R({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],St.prototype,"resolution",null),e([R({type:Number})],St.prototype,"scale",null),e([R({readOnly:!0,type:Number})],St.prototype,"terrainLevel",null),e([R()],St.prototype,"heightModelInfo",null),e([R()],St.prototype,"spatialReference",void 0),e([R({type:Boolean,value:!1})],St.prototype,"alphaCompositingEnabled",null),e([R({constructOnly:!0})],St.prototype,"preserveDrawingBufferEnabled",void 0),e([R({type:Boolean})],St.prototype,"supersampleScreenshotsEnabled",void 0),e([R({readOnly:!0})],St.prototype,"type",void 0),e([R(),x(e=>e instanceof yt?e:A(ft,e))],St.prototype,"ui",void 0),e([R({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],St.prototype,"updating",null),e([R()],St.prototype,"_updatingObjects",null),e([R()],St.prototype,"_updatingObjectsWithProgress",null),e([R({type:Number,readOnly:!0,dependsOn:["updating"]})],St.prototype,"updatingProgress",void 0),e([R({type:["global","local"]})],St.prototype,"viewingMode",null),e([R({type:i})],St.prototype,"viewpoint",null),e([R({readOnly:!0})],St.prototype,"visibleArea",null),e([R({type:Number})],St.prototype,"zoom",null),e([R({type:lt})],St.prototype,"highlightOptions",null),e([R({readOnly:!0})],St.prototype,"quality",null),e([R({readOnly:!0})],St.prototype,"resolutionScale",null),e([R()],St.prototype,"focusAreasView",void 0),e([R()],St.prototype,"_defaultToMapOptions",null),e([R()],St.prototype,"_defaultHitTestOptions",null),St=_t=e([O("esri.views.SceneView")],St);const jt=I(),Ct=S(),Tt=Y(),Rt={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js"),FeatureTileTree3D:()=>import("./3d/layers/support/FeatureTileTree3D.js")},xt=St;export{xt 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import s from"../../../core/Accessor.js";import{createTask as i}from"../../../core/asyncUtils.js";import"../../../core/has.js";import{makeHandle as a}from"../../../core/handleUtils.js";import{ignoreAbortErrors as r,isAborted as o,throwIfAborted as n}from"../../../core/promiseUtils.js";import{watch as l,syncAndInitial as c}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as d}from"../../../core/support/UpdatingHandles.js";import m from"../../../layers/GraphicsLayer.js";import{getGraphicEffectiveElevationInfo as y}from"../../../support/elevationInfoUtils.js";import u from"../../../symbols/CIMSymbol.js";import g from"../../../symbols/SimpleLineSymbol.js";import _ from"../../../symbols/support/ElevationInfo.js";import{ExclusiveOperationManager as f}from"../ExclusiveOperationManager.js";import{isPolyline as k,isValidInputGraphic as v,isInternalGraphic as w}from"./elevationProfileGeometryUtils.js";import{ViewEventPriorities as b}from"../../input/InputManager.js";import{isCancelEvent as G}from"../../interactive/interactiveToolUtils.js";import S from"../../../widgets/Sketch/SketchViewModel.js";let M=class extends s{constructor(e){super(e),this._updatingHandles=new d,this._operationManager=new f}initialize(){const{view:e}=this;this._graphicsLayer=new m({listMode:"hide",internal:!0}),this._sketchViewModel=new S({layer:this._graphicsLayer,view:e,defaultCreateOptions:{mode:"click",hasZ:!0},updateOnGraphicClick:!1,defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{shapeOperation:"none"},toggleToolOnClick:!1,tool:"reshape"},polylineSymbol:this._lineSymbol,activeLineSymbol:this._lineSymbol}),this.addHandles([l(()=>({map:e.map,internalGraphicsLayer:this._graphicsLayer,state:this.state,geometryVisualizationVisible:this._analysis.viewOptions.geometryVisualizationVisible,visible:this.analysisViewData.visible}),({map:e,internalGraphicsLayer:t,state:s,geometryVisualizationVisible:i,visible:a})=>{L(e,t);const o=this.sketchGraphic;switch(o&&(o.visible=a),s){case"idle":case"reshaping-disabled":o&&!i&&(o.visible=!1),this._operationManager.stop(),this._ensureUpdatedSketchGraphic();break;case"reshaping":r(this._startReshape());break;case"awaiting-sketch":this.analysisViewData.interactive=!0}},c),l(()=>this._analysis.elevationInfo,e=>{this._graphicsLayer.elevationInfo=e},c)])}destroy(){this._operationManager.destroy(),this._sketchViewModel.destroy();const e=this._graphicsLayer;this.view.map?.remove(e),e.destroy()}get sketchGraphic(){return this._get("sketchGraphic")}set sketchGraphic(e){e!==this._get("sketchGraphic")&&(this._set("sketchGraphic",e),V(this._graphicsLayer,e),this._updateAnalysisFromSketchGraphic())}get state(){const{visible:e,interactive:t}=this.analysisViewData;if(!e)return"idle";switch(this._operationManager.currentOperationType){case"place":return this._sketchViewModel.createGraphic===this.sketchGraphic?"sketching":"awaiting-sketch";case"pick-feature":return"picking";default:return this._analysis.geometry?t?"reshaping":"reshaping-disabled":"idle"}}get updating(){return this._sketchViewModel.updating||this._updatingHandles.updating}get _analysis(){return this.analysisViewData.analysis}get _lineSymbol(){return j(this.view.type)}place(e){return this._operationManager.start("place",async t=>{const s=this._analysis.clone();this._ensureUpdatedSketchGraphic();const i=this._stashSketchGraphic(),n=this._sketchViewModel.on("create",e=>{switch(e.state){case"start":this.sketchGraphic=e.graphic,this._analysis.elevationInfo=this._graphicsLayer.elevationInfo,i.remove();break;case"active":this._updateAnalysisFromSketchGraphic();break;case"complete":this._updateAnalysisFromSketchGraphic(),t.stop();break;case"cancel":t.stop()}});t.handles.push(n,a(()=>(n.remove(),this._sketchViewModel.cancel(),this._updateAnalysisFromSketchGraphic(),this._analysis.valid?o(e)||s.equals(this._analysis)?t.reject():void t.resolve({}):(this._clear(),t.reject()))),i),this._graphicsLayer.elevationInfo=I,await this._updatingHandles.addPromise(r(this._sketchViewModel.create("polyline")))},e)}_stashSketchGraphic(){const e=this.sketchGraphic;if(!e)return a();const t=this._analysis.elevationInfo,s=new m({listMode:"hide",internal:!0,elevationInfo:t});return this.view.map.add(s),s.graphics.add(e),a(()=>{this.sketchGraphic===e&&(this._graphicsLayer.elevationInfo=t,this._graphicsLayer.add(e)),s.removeFromParent(),s.destroy()})}async pickFeature(e){return this._operationManager.start("pick-feature",async e=>{const{view:t}=this;t.closePopup();let s=null;const r=a=>{a.defer(async()=>{s?.abort(),s=i(async s=>{const{results:i}=await t.hitTest(a);n(s);let r=null;for(const e of i)if("graphic"===e.type&&v(e.graphic)&&!w(e.graphic)){r=e.graphic;break}r?(a.preventDefault(),a.stopPropagation(),this.sketchGraphic=null,this._analysis.geometry=r.geometry,this._analysis.elevationInfo=new _({...y(r)}),e.resolve({feature:r}),e.stop()):e.reject()}),await s.promise})},o=t=>{G(t)&&(e.reject(),e.stop())};e.handles.push(t.on("immediate-click",r,b.TOOL),t.on("key-down",o,b.TOOL),t.acquireCursor("crosshair","high"),a(()=>{s?.abort(),e.reject()})),t.focus()},e)}_startReshape(){return this._operationManager.start("reshape",async e=>{const t=()=>{const e=this._ensureUpdatedSketchGraphic();return e?(V(this._graphicsLayer,e),this._updatingHandles.addPromise(this._sketchViewModel.update(e,{tool:"reshape"}))):Promise.resolve()};if(!this._ensureUpdatedSketchGraphic())return;const s=this._sketchViewModel.on("update",s=>{this._updateAnalysisFromSketchGraphic(),"complete"===s.state&&("reshaping"===this.state?r(t()):e.resolve())});e.handles.push(s,a(()=>{s.remove(),this._sketchViewModel.cancel(),e.resolve()})),await t()})}_ensureUpdatedSketchGraphic(){const{geometry:e}=this._analysis;if(!e)return this.sketchGraphic=null,null;const s=this.sketchGraphic??=new t({symbol:this._lineSymbol,geometry:e});return s.geometry=e,s}_clear(){this.sketchGraphic=null,this._analysis.clear()}_updateAnalysisFromSketchGraphic(){let e=this.sketchGraphic?.geometry;k(e)||(e=null);const t=this._analysis;t.geometry!==e&&(t.geometry=e)}};function j(e){if("2d"===e){const e={type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",width:1.5};return new u({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{...e,effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,4],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],color:[0,0,0,255]},{...e,color:[255,255,255,255]}]}}})}return new g({color:[0,0,0,0]})}function L(e,t){t&&(t.removeFromParent(),e?.add(t))}function V({graphics:e},t){t?(e.includes(t)||e.add(t),1!==e.length&&e.removeMany(e.filter(e=>e!==t))):e.removeAll()}e([h({constructOnly:!0})],M.prototype,"analysisViewData",void 0),e([h({constructOnly:!0})],M.prototype,"view",void 0),e([h()],M.prototype,"sketchGraphic",null),e([h({nonNullable:!0})],M.prototype,"state",null),e([h()],M.prototype,"updating",null),e([h()],M.prototype,"_analysis",null),e([h()],M.prototype,"_lineSymbol",null),M=e([p("esri.views.analysis.ElevationProfile.ElevationProfileTool")],M);const I=new _({mode:"on-the-ground",offset:0});export{M as ElevationProfileTool};
5
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import s from"../../../core/Accessor.js";import{createTask as i}from"../../../core/asyncUtils.js";import a from"../../../core/Collection.js";import"../../../core/has.js";import{makeHandle as r}from"../../../core/handleUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{ignoreAbortErrors as n,isAborted as c,throwIfAborted as h}from"../../../core/promiseUtils.js";import{watch as l,syncAndInitial as p}from"../../../core/reactiveUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../../core/support/UpdatingHandles.js";import u from"../../../layers/GraphicsLayer.js";import{getGraphicEffectiveElevationInfo as g}from"../../../support/elevationInfoUtils.js";import _ from"../../../symbols/CIMSymbol.js";import k from"../../../symbols/SimpleLineSymbol.js";import f from"../../../symbols/support/ElevationInfo.js";import{ExclusiveOperationManager as v}from"../ExclusiveOperationManager.js";import{isPolyline as b,isValidInputGraphic as w,isInternalGraphic as G}from"./elevationProfileGeometryUtils.js";import{ViewEventPriorities as S}from"../../input/InputManager.js";import{isCancelEvent as j}from"../../interactive/interactiveToolUtils.js";import M from"../../../widgets/Sketch/SketchViewModel.js";let L=class extends s{constructor(e){super(e),this._sketchViewModels=new a,this._updatingHandles=new y,this._operationManager=new v}initialize(){const{view:e}=this;this._graphicsLayer=new u({listMode:"hide",internal:!0}),this.addHandles([l(()=>({map:e.map,internalGraphicsLayer:this._graphicsLayer,state:this.state,geometryVisualizationVisible:this._analysis.viewOptions.geometryVisualizationVisible,visible:this.analysisViewData.visible}),({map:e,internalGraphicsLayer:t,state:s,geometryVisualizationVisible:i,visible:a})=>{I(e,t);const r=this.sketchGraphic;switch(r&&(r.visible=a),s){case"idle":case"reshaping-disabled":r&&!i&&(r.visible=!1),this._operationManager.stop(),this._ensureUpdatedSketchGraphic();break;case"reshaping":n(this._startReshape());break;case"awaiting-sketch":this.analysisViewData.interactive=!0}},p),l(()=>this._analysis.elevationInfo,e=>{this._graphicsLayer.elevationInfo=e},p)])}destroy(){this._operationManager.destroy(),this._sketchViewModels.drain(e=>o(e));const e=this._graphicsLayer;this.view.map?.remove(e),e.destroy()}get sketchGraphic(){return this._get("sketchGraphic")}set sketchGraphic(e){e!==this._get("sketchGraphic")&&(this._set("sketchGraphic",e),this._updateAnalysisFromSketchGraphic())}get state(){const{visible:e,interactive:t}=this.analysisViewData;if(!e)return"idle";switch(this._operationManager.currentOperationType){case"place":return this._sketching?"sketching":"awaiting-sketch";case"pick-feature":return"picking";default:return this._analysis.geometry?t?"reshaping":"reshaping-disabled":"idle"}}get updating(){return this._sketchViewModels.some(e=>e.updating)||this._updatingHandles.updating}get _sketching(){return this._sketchViewModels.some(e=>e.createGraphic===this.sketchGraphic)}get _analysis(){return this.analysisViewData.analysis}get _lineSymbol(){return V(this.view.type)}place(e){return this._operationManager.start("place",async t=>{const s=this._createSketchViewModel(),i=this._analysis.clone();this._ensureUpdatedSketchGraphic();const a=this.sketchGraphic,o=this._analysis.elevationInfo,h=r(()=>{this.sketchGraphic===a&&(this._graphicsLayer.elevationInfo=o)}),l=s.on("create",e=>{switch(e.state){case"start":this._graphicsLayer.removeAll(),this.sketchGraphic=e.graphic,this._analysis.elevationInfo=this._graphicsLayer.elevationInfo;break;case"active":this._updateAnalysisFromSketchGraphic();break;case"complete":this.sketchGraphic&&(this._updateAnalysisFromSketchGraphic(),this._addSketchGraphic(this.sketchGraphic)),t.stop();break;case"cancel":t.stop()}});t.handles.push(l,r(()=>(l.remove(),s.destroy(),this._sketchViewModels.remove(s),this._updateAnalysisFromSketchGraphic(),this._analysis.valid?c(e)||i.equals(this._analysis)?t.reject():void t.resolve({}):(this._clear(),t.reject()))),h),this._graphicsLayer.elevationInfo=O,await this._updatingHandles.addPromise(n(s.create("polyline")))},e)}async pickFeature(e){return this._operationManager.start("pick-feature",async e=>{const{view:t}=this;t.closePopup();let s=null;const a=a=>{a.defer(async()=>{s?.abort(),s=i(async s=>{const{results:i}=await t.hitTest(a);h(s);let r=null;for(const e of i)if("graphic"===e.type&&w(e.graphic)&&!G(e.graphic)){r=e.graphic;break}r?(a.preventDefault(),a.stopPropagation(),this.sketchGraphic=null,this._analysis.geometry=r.geometry,this._analysis.elevationInfo=new f({...g(r)}),e.resolve({feature:r}),e.stop()):e.reject()}),await s.promise})},o=t=>{j(t)&&(e.reject(),e.stop())};e.handles.push(t.on("immediate-click",a,S.TOOL),t.on("key-down",o,S.TOOL),t.acquireCursor("crosshair","high"),r(()=>{s?.abort(),e.reject()})),t.focus()},e)}_startReshape(){const e=this._createSketchViewModel();return this._sketchViewModels.add(e),this._operationManager.start("reshape",async t=>{const s=()=>{const t=this._ensureUpdatedSketchGraphic();return t?this._updatingHandles.addPromise(e.update(t,{tool:"reshape"})):Promise.resolve()};if(!this._ensureUpdatedSketchGraphic())return;const i=e.on("update",e=>{this._updateAnalysisFromSketchGraphic(),"complete"===e.state&&("reshaping"===this.state?n(s()):t.resolve())});t.handles.push(i,r(()=>{i.remove(),this._sketchViewModels.remove(e),e.destroy(),t.resolve()})),await s()})}_createSketchViewModel(){return new M({layer:this._graphicsLayer,view:this.view,defaultCreateOptions:{mode:"click",hasZ:!0},updateOnGraphicClick:!1,defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{shapeOperation:"none"},toggleToolOnClick:!1,tool:"reshape"},polylineSymbol:this._lineSymbol,activeLineSymbol:this._lineSymbol})}_ensureUpdatedSketchGraphic(){const{geometry:e}=this._analysis;if(!e)return this.sketchGraphic=null,this._graphicsLayer.removeAll(),null;const s=this.sketchGraphic??=new t({symbol:this._lineSymbol,geometry:e});return s.geometry=e,this._addSketchGraphic(s),s}_addSketchGraphic(e){const{graphics:t}=this._graphicsLayer;t.includes(e)||t.add(e),1!==t.length&&t.removeMany(t.filter(t=>t!==e))}_clear(){this.sketchGraphic=null,this._analysis.clear()}_updateAnalysisFromSketchGraphic(){let e=this.sketchGraphic?.geometry;b(e)||(e=null);const t=this._analysis;t.geometry!==e&&(t.geometry=e)}};function V(e){if("2d"===e){const e={type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",width:1.5};return new _({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{...e,effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,4],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],color:[0,0,0,255]},{...e,color:[255,255,255,255]}]}}})}return new k({color:[0,0,0,0]})}function I(e,t){t&&(t.removeFromParent(),e?.add(t))}e([m({constructOnly:!0})],L.prototype,"analysisViewData",void 0),e([m({constructOnly:!0})],L.prototype,"view",void 0),e([m()],L.prototype,"sketchGraphic",null),e([m({nonNullable:!0})],L.prototype,"state",null),e([m()],L.prototype,"updating",null),e([m()],L.prototype,"_sketching",null),e([m()],L.prototype,"_analysis",null),e([m()],L.prototype,"_lineSymbol",null),L=e([d("esri.views.analysis.ElevationProfile.ElevationProfileTool")],L);const O=new f({mode:"on-the-ground",offset:0});export{L as ElevationProfileTool};
@@ -0,0 +1,5 @@
1
+ import "../../../interfaces";
2
+
3
+ export type ElevationProfilePlacementResult = __esri.ElevationProfileTypes.ElevationProfilePlacementResult;
4
+ export type ElevationProfilePickResult = __esri.ElevationProfileTypes.ElevationProfilePickResult;
5
+ export type ElevationProfileEffectiveDisplayUnits = __esri.ElevationProfileTypes.ElevationProfileEffectiveDisplayUnits;
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ function n(){}export{n as __exported__};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import has from"../../core/has.js";function n(e){return e&&"function"==typeof e.highlight}function i(e){return e&&"function"==typeof e.maskOccludee}function r(e,n,i){return null==e||e>=i&&(0===n||e<=n)}function t(e,n){if(n&&e){const{minScale:i,maxScale:t}=e;if(c(i,t))return r(n,i,t)}return!0}function c(e,n){return null!=e&&e>0||null!=n&&n>0}function u(e){return!e?.minScale||!e.maxScale||e.minScale>=e.maxScale}const a=()=>!has("disable-feature:layer-based-scale-visibility");function o(e){return null!=e&&"object"==typeof e&&"createQuery"in e&&"queryFeatures"in e&&"layer"in e&&"view"in e}function l(n,i,r){return new e("layerview:spatial-reference-incompatible",`The spatial reference of this ${n} (wkid: ${i??"undefined"}) is incompatible with the spatial reference of the view (wkid: ${r??"undefined"}).`,{})}export{a as hasLayerBasedScaleVisibility,n as highlightsSupported,t as isInEffectiveScaleRange,c as isScaleRangeActive,o as isSelectableLayerView2D,i as occludeesSupported,r as scaleBoundsPredicate,l as spatialReferenceIncompatibleError,u as validateScaleRange};
5
+ import e from"../../core/Error.js";import has from"../../core/has.js";function n(e){return e&&"function"==typeof e.highlight}function t(e){return e&&"function"==typeof e.maskOccludee}function i(e,n,t){return null==e||e>=t&&(0===n||e<=n)}function r(e,n){if(n&&e){const{minScale:t,maxScale:r}=e;if(u(t,r))return i(n,t,r)}return!0}function u(e,n){return null!=e&&e>0||null!=n&&n>0}function c(e){return!e?.minScale||!e.maxScale||e.minScale>=e.maxScale}const a=()=>!has("disable-feature:layer-based-scale-visibility");function o(e){return null!=e&&"object"==typeof e&&"createQuery"in e&&"queryFeatures"in e&&"layer"in e&&"view"in e}function l(n,t,i){return new e("layerview:spatial-reference-incompatible",`The spatial reference of this ${n} (wkid: ${t??"undefined"}) is incompatible with the spatial reference of the view (wkid: ${i??"undefined"}).`,{})}function f(e){return"integrated-mesh-3d"===e.type||"integrated-mesh-3dtiles"===e.type}export{a as hasLayerBasedScaleVisibility,n as highlightsSupported,r as isInEffectiveScaleRange,f as isIntegratedMeshLayerView,u as isScaleRangeActive,o as isSelectableLayerView2D,t as occludeesSupported,i as scaleBoundsPredicate,l as spatialReferenceIncompatibleError,c as validateScaleRange};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../core/Error.js";import has from"../../core/has.js";import e from"../../core/Logger.js";import{abortMaybe as i}from"../../core/maybe.js";import{hasValue as r}from"../../core/object.js";import{throwIfAborted as s,isAbortError as o}from"../../core/promiseUtils.js";import{checkWebGLError as a}from"./checkWebGLError.js";import{ResourceType as n,CompressedTextureFormat as p}from"./enums.js";import{estimateMemory as l}from"./TextureDescriptor.js";import{isCompressedData as m,deriveInternalFormat as h,isTexImageSource as d,is3DTarget as c,validateTexture as _,isCompressedFormat as u,getDimensions as g,calcMipmapLevels as x,isSizedPixelFormat as T,isSizedDepthFormat as M,isSizedDepthStencilFormat as b}from"./textureUtils.js";import{ValidatedTextureDescriptor as f}from"./ValidatedTextureDescriptor.js";const w=null,D=!!has("esri-tests-disable-gpu-memory-measurements"),E=()=>e.getLogger("esri/views/webgl/Texture");let A=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,i=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=i;else{const r=f.validate(e,i);if(!r)throw new t("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return D?0:l(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(n.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new t("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=i,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compress=t}disableCompression(){this._descriptor.compress=void 0}setData(t){this.abortCompression(),!m(t)&&this._descriptor.internalFormat&&r(p,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(t),!m(t)&&this._descriptor.compress&&this._compressOnWorker(t)}updateData(i,r,s,o,a,n,p=0){n||E().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||E().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=h(l);const{context:c,pixelFormat:_,dataType:u,target:g,isImmutable:x}=l;if(x&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");const T=c.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||s<0||r+o>l.width||s+a>l.height)&&E().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=c;p&&(o&&a||E().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),M.pixelStorei(M.UNPACK_SKIP_ROWS,p)),d(n)?M.texSubImage2D(g,i,r,s,o,a,_,u,n):m(n)?M.compressedTexSubImage2D(g,i,r,s,o,a,l.internalFormat,n.levels[i]):M.texSubImage2D(g,i,r,s,o,a,_,u,n),p&&M.pixelStorei(M.UNPACK_SKIP_ROWS,0),c.bindTexture(T,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(i,r,s,o,a,n,p,l){l||E().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||E().error("An attempt to update an uninitialized texture!");const d=this._descriptor;d.internalFormat=h(d);const{context:_,pixelFormat:u,dataType:g,isImmutable:x,target:T}=d;if(x&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");c(T)||E().warn("Attempting to set 3D texture data on a non-3D texture");const M=_.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);_.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||s<0||o<0||r+a>d.width||s+n>d.height||o+p>d.depth)&&E().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:b}=_;if(m(l))l=l.levels[i],b.compressedTexSubImage3D(T,i,r,s,o,a,n,p,d.internalFormat,l);else{const t=l;b.texSubImage3D(T,i,r,s,o,a,n,p,u,g,t)}_.bindTexture(M,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const i=this._descriptor;if(0===i.width||0===i.height)return;if(!i.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");i.hasMipmap=!0,this._samplingModeDirty=!0,_(i)}9729===i.samplingMode?(this._samplingModeDirty=!0,i.samplingMode=9985):9728===i.samplingMode&&(this._samplingModeDirty=!0,i.samplingMode=9984);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(i.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,_(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,_(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=t,this.setSamplingMode(t?9729:9728),_(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=i(this._compressionAbortController)}_setData(i,r){const s=this._descriptor,o=s.context?.gl;if(!o)return;a(o),this.hasWebGLTextureObject||(this._glName=o.createTexture(),s.context.instanceCounter.increment(n.Texture,this)),_(s);const p=s.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);s.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),a(o);const l=r??s.target,g=c(l);if(d(i))this._setDataFromTexImageSource(i,l);else{const{width:e,height:r,depth:n}=s;if(null==e||null==r)throw new t("texture:missing-size","Width and height must be specified!");if(g&&null==n)throw new t("texture:missing-depth","Depth must be specified!");if(s.internalFormat=h(s),s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,s.internalFormat,s.hasMipmap,e,r,n),m(i)){if(!u(s.internalFormat))throw new t("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(i,s.internalFormat,l)}else this._texImage(l,0,s.internalFormat,e,r,n,i),a(o),s.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),a(o),s.context.bindTexture(p,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=34069;e<=34074;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=h(r);const s=c(e),{width:o,height:n,depth:p}=g(t);r.width&&r.height,r.width||(r.width=o),r.height||(r.height=n),s&&r.depth,s&&(r.depth=p),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,o,n,p),this._texImage(e,0,r.internalFormat,o,n,p,t),a(i),r.hasMipmap&&(this.generateMipmap(),a(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:s,height:o,depth:a}=r,n=t.levels,p=x(i,s,o,a),l=Math.min(p,n.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,l),this._forEachMipmapLevel((t,r,s,o)=>{const a=n[Math.min(t,n.length-1)];this._compressedTexImage(i,t,e,r,s,o,a)},l)}_texStorage(e,i,r,s,o,a){const{gl:n}=this._descriptor.context;if(!T(i)&&!M(i)&&!b(i))throw new t("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const p=r?x(e,s,o,a):1;if(c(e)){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");n.texStorage3D(e,p,i,s,o,a)}else n.texStorage2D(e,p,i,s,o);this._wasImmutablyAllocated=!0}_texImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=c(e),{isImmutable:m,pixelFormat:h,dataType:d}=this._descriptor;if(m){if(null!=n){const r=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texSubImage3D(e,i,0,0,0,s,o,a,h,d,r)}else p.texSubImage2D(e,i,0,0,s,o,h,d,r)}}else{const m=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texImage3D(e,i,r,s,o,a,0,h,d,m)}else p.texImage2D(e,i,r,s,o,0,h,d,m)}}_compressedTexImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=c(e);if(this._descriptor.isImmutable){if(null!=n)if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexSubImage3D(e,i,0,0,0,s,o,a,r,n)}else p.compressedTexSubImage2D(e,i,0,0,s,o,r,n)}else if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexImage3D(e,i,r,s,o,a,0,n)}else p.compressedTexImage2D(e,i,r,s,o,0,n)}async _compressOnWorker(t){const{width:i,height:r,context:a,flipped:n,preMultiplyAlpha:p,hasMipmap:l}=this._descriptor,m=this._descriptor.compress?.compressionTracker,h=this._descriptor.compress?.compressionCallback,{compressedTextureETC:d,compressedTextureS3TC:c}=a.capabilities;if(!e.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!d&&!c)return;this.abortCompression();const _=new AbortController;let u;this._compressionAbortController=_,m?.increment();try{t instanceof Uint8Array?u=t.buffer:(u=await createImageBitmap(t,{imageOrientation:n?"flipY":"none"}),s(_));const o={data:u,width:i,height:r,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:p,hasMipmap:l,hasETC:!!d,hasS3TC:!!c},a=await e.compressionWorkerHandle.invoke(o,_.signal,1);if(s(_),a.compressedTexture&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),h?.(t-this.usedMemory)}}catch(g){o(g)||E().error("Texture compression failed!")}finally{m?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),u instanceof ImageBitmap&&u.close()}}_forEachMipmapLevel(e,i=1/0){let{width:r,height:s,depth:o,hasMipmap:a,target:n}=this._descriptor;const p=32879===n;if(null==r||null==s||p&&null==o)throw new t("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let t=0;e(t,r,s,o),a&&(1!==r||1!==s||p&&1!==o)&&!(t>=i);++t)r=Math.max(1,r>>1),s=Math.max(1,s>>1),p&&(o=Math.max(1,o>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;9985===i||9987===i?(i=9729,t.hasMipmap||(r=9729)):9984!==i&&9986!==i||(i=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),a(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;if(!e)return;t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}};export{A as Texture,w as tracer};
5
+ import t from"../../core/Error.js";import has from"../../core/has.js";import e from"../../core/Logger.js";import{abortMaybe as i}from"../../core/maybe.js";import{hasValue as r}from"../../core/object.js";import{throwIfAborted as s,isAbortError as o}from"../../core/promiseUtils.js";import{checkWebGLError as a}from"./checkWebGLError.js";import{ResourceType as n,CompressedTextureFormat as p}from"./enums.js";import{estimateMemory as l}from"./TextureDescriptor.js";import{isCompressedData as m,deriveInternalFormat as h,isTexImageSource as d,is3DTarget as c,validateTexture as _,isCompressedFormat as u,getDimensions as g,calcMipmapLevels as x,isSizedPixelFormat as T,isSizedDepthFormat as M,isSizedDepthStencilFormat as b}from"./textureUtils.js";import{ValidatedTextureDescriptor as f}from"./ValidatedTextureDescriptor.js";const w=null,D=!!has("esri-tests-disable-gpu-memory-measurements"),E=()=>e.getLogger("esri/views/webgl/Texture");class A{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,i=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=i;else{const r=f.validate(e,i);if(!r)throw new t("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return D?0:l(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(n.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new t("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=i,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compress=t}disableCompression(){this._descriptor.compress=void 0}setData(t){this.abortCompression(),!m(t)&&this._descriptor.internalFormat&&r(p,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(t),!m(t)&&this._descriptor.compress&&this._compressOnWorker(t)}updateData(e,i,r,s,o,a,n=0){a||E().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||E().error("An attempt to update uninitialized texture!");const p=this._descriptor;p.internalFormat=h(p);const{context:l,pixelFormat:c,dataType:_,target:u,isImmutable:g}=p;if(g&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");const x=l.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES,!0);(i<0||r<0||i+s>p.width||r+o>p.height)&&E().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:T}=l;n&&(s&&o||E().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),T.pixelStorei(T.UNPACK_SKIP_ROWS,n)),d(a)?T.texSubImage2D(u,e,i,r,s,o,c,_,a):m(a)?T.compressedTexSubImage2D(u,e,i,r,s,o,p.internalFormat,a.levels[e]):T.texSubImage2D(u,e,i,r,s,o,c,_,a),n&&T.pixelStorei(T.UNPACK_SKIP_ROWS,0),l.bindTexture(x,A.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,i,r,s,o,a,n,p){p||E().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||E().error("An attempt to update an uninitialized texture!");const l=this._descriptor;l.internalFormat=h(l);const{context:d,pixelFormat:_,dataType:u,isImmutable:g,target:x}=l;if(g&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");c(x)||E().warn("Attempting to set 3D texture data on a non-3D texture");const T=d.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES);d.setActiveTexture(A.TEXTURE_UNIT_FOR_UPDATES),(i<0||r<0||s<0||i+o>l.width||r+a>l.height||s+n>l.depth)&&E().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=d;if(m(p))p=p.levels[e],M.compressedTexSubImage3D(x,e,i,r,s,o,a,n,l.internalFormat,p);else{const t=p;M.texSubImage3D(x,e,i,r,s,o,a,n,_,u,t)}d.bindTexture(T,A.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,_(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);const i=this._descriptor.context.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(A.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(i,A.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,_(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,_(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=t,this.setSamplingMode(t?9729:9728),_(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=i(this._compressionAbortController)}_setData(e,i){const r=this._descriptor,s=r.context?.gl;if(!s)return;a(s),this.hasWebGLTextureObject||(this._glName=s.createTexture(),r.context.instanceCounter.increment(n.Texture,this)),_(r);const o=r.context.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(A.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),a(s);const p=i??r.target,l=c(p);if(d(e))this._setDataFromTexImageSource(e,p);else{const{width:i,height:o,depth:n}=r;if(null==i||null==o)throw new t("texture:missing-size","Width and height must be specified!");if(l&&null==n)throw new t("texture:missing-depth","Depth must be specified!");if(r.internalFormat=h(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(p,r.internalFormat,r.hasMipmap,i,o,n),m(e)){if(!u(r.internalFormat))throw new t("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,p)}else this._texImage(p,0,r.internalFormat,i,o,n,e),a(s),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),a(s),r.context.bindTexture(o,A.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=34069;e<=34074;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=h(r);const s=c(e),{width:o,height:n,depth:p}=g(t);r.width&&r.height,r.width||(r.width=o),r.height||(r.height=n),s&&r.depth,s&&(r.depth=p),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,o,n,p),this._texImage(e,0,r.internalFormat,o,n,p,t),a(i),r.hasMipmap&&(this.generateMipmap(),a(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:s,height:o,depth:a}=r,n=t.levels,p=x(i,s,o,a),l=Math.min(p,n.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,l),this._forEachMipmapLevel((t,r,s,o)=>{const a=n[Math.min(t,n.length-1)];this._compressedTexImage(i,t,e,r,s,o,a)},l)}_texStorage(e,i,r,s,o,a){const{gl:n}=this._descriptor.context;if(!T(i)&&!M(i)&&!b(i))throw new t("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const p=r?x(e,s,o,a):1;if(c(e)){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");n.texStorage3D(e,p,i,s,o,a)}else n.texStorage2D(e,p,i,s,o);this._wasImmutablyAllocated=!0}_texImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=c(e),{isImmutable:m,pixelFormat:h,dataType:d}=this._descriptor;if(m){if(null!=n){const r=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texSubImage3D(e,i,0,0,0,s,o,a,h,d,r)}else p.texSubImage2D(e,i,0,0,s,o,h,d,r)}}else{const m=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texImage3D(e,i,r,s,o,a,0,h,d,m)}else p.texImage2D(e,i,r,s,o,0,h,d,m)}}_compressedTexImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=c(e);if(this._descriptor.isImmutable){if(null!=n)if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexSubImage3D(e,i,0,0,0,s,o,a,r,n)}else p.compressedTexSubImage2D(e,i,0,0,s,o,r,n)}else if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexImage3D(e,i,r,s,o,a,0,n)}else p.compressedTexImage2D(e,i,r,s,o,0,n)}async _compressOnWorker(t){const{width:e,height:i,context:r,flipped:a,preMultiplyAlpha:n,hasMipmap:p}=this._descriptor,l=this._descriptor.compress?.compressionTracker,m=this._descriptor.compress?.compressionCallback,{compressedTextureETC:h,compressedTextureS3TC:d}=r.capabilities;if(!A.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!h&&!d)return;this.abortCompression();const c=new AbortController;let _;this._compressionAbortController=c,l?.increment();try{t instanceof Uint8Array?_=t.buffer:(_=await createImageBitmap(t,{imageOrientation:a?"flipY":"none"}),s(c));const r={data:_,width:e,height:i,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:n,hasMipmap:p,hasETC:!!h,hasS3TC:!!d},o=await A.compressionWorkerHandle.invoke(r,c.signal,1);if(s(c),o.compressedTexture&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=o.internalFormat,this._setData(o.compressedTexture),m?.(t-this.usedMemory)}}catch(u){o(u)||E().error("Texture compression failed!")}finally{l?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),_ instanceof ImageBitmap&&_.close()}}_forEachMipmapLevel(e,i=1/0){let{width:r,height:s,depth:o,hasMipmap:a,target:n}=this._descriptor;const p=32879===n;if(null==r||null==s||p&&null==o)throw new t("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let t=0;e(t,r,s,o),a&&(1!==r||1!==s||p&&1!==o)&&!(t>=i);++t)r=Math.max(1,r>>1),s=Math.max(1,s>>1),p&&(o=Math.max(1,o>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;9985===i||9987===i?(i=9729,t.hasMipmap||(r=9729)):9984!==i&&9986!==i||(i=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),a(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;if(!e)return;t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}export{A as Texture,w as tracer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- function n(n){let t=0;return new Map(n.map(({name:n,count:r})=>{const e=[n,t];return 16===r?t+=4:9===r?t+=3:++t,e}))}function t(n){const t=new Map;let r=0;return n.forEach(n=>n.forEach(({name:n,count:e})=>{t.set(n,r),16===e?r+=4:9===e?r+=3:++r})),t}function r(n){return t(Array.from(n.values()).map(({layout:n})=>n))}export{r as fromBuffers,n as fromLayout,t as fromLayouts};
5
+ import{toConst as n}from"../../core/compilerUtils.js";function r(r){let t=0;return n(new Map(r.map(({name:n,count:r})=>{const o=[n,t];return 16===r?t+=4:9===r?t+=3:++t,o})))}function t(n){const r=new Map;let t=0;return n.forEach(n=>n.forEach(({name:n,count:o})=>{r.set(n,t),16===o?t+=4:9===o?t+=3:++t})),r}function o(n){return t(Array.from(n.values()).map(({layout:n})=>n))}export{o as fromBuffers,r as fromLayout,t as fromLayouts};