@arcgis/core 4.23.0-next.20220128 → 4.23.0-next.20220202

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 (288) hide show
  1. package/Graphic.js +1 -1
  2. package/TimeExtent.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/01a10fe5ad6941b0ee8c.js +1 -0
  5. package/assets/esri/core/workers/chunks/{7a5f5acfbd4ca1a5c1f3.js → 06116433eb6e669f146b.js} +1 -1
  6. package/assets/esri/core/workers/chunks/09a05d778b6fac710828.js +1 -0
  7. package/assets/esri/core/workers/chunks/{83d00afae4406ec78bc9.js → 0c6be307709523eb8a05.js} +1 -1
  8. package/assets/esri/core/workers/chunks/0e215fa28a0448169132.js +1 -0
  9. package/assets/esri/core/workers/chunks/{391e96192d1ec4e55ce2.js → 101b4f02f0572afb666f.js} +1 -1
  10. package/assets/esri/core/workers/chunks/11750e96065b4d7b926b.js +1 -0
  11. package/assets/esri/core/workers/chunks/{929c9b7cdab7c4ca3d87.js → 17c51f5a13f471e6656a.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{ed0bcc66fb1e0ee75a4b.js → 1f34957ef42e5b5977d0.js} +1 -1
  13. package/assets/esri/core/workers/chunks/2f4e425be3a3bdfd8d29.js +1 -0
  14. package/assets/esri/core/workers/chunks/34bed896b68993cabaa1.js +1 -0
  15. package/assets/esri/core/workers/chunks/3e1679b01429fd73cffe.js +1 -0
  16. package/assets/esri/core/workers/chunks/{99619fcb772807c74f3b.js → 444829a840b8ded16fd7.js} +1 -1
  17. package/assets/esri/core/workers/chunks/467b5faa1c90d9821609.js +1 -0
  18. package/assets/esri/core/workers/chunks/49353182a16218a84251.js +1 -0
  19. package/assets/esri/core/workers/chunks/4bfc2eeb0738c393d8ec.js +1 -0
  20. package/assets/esri/core/workers/chunks/4de996ebc432f5e149bc.js +1 -0
  21. package/assets/esri/core/workers/chunks/{422537fc3df707bb62c9.js → 5038935db9b1ebe61d02.js} +1 -1
  22. package/assets/esri/core/workers/chunks/50976921acf7bd636123.js +1 -0
  23. package/assets/esri/core/workers/chunks/50ef2622fd0d9a241979.js +1 -0
  24. package/assets/esri/core/workers/chunks/{5790d171072b3c7d108f.js → 53aa2ab4e569c994a32d.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{7903a3e2e0faff0f86c0.js → 56657f890e0f79f5d2ad.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{db3c729ce0c0b2690dc9.js → 574e33f28c106d607fe3.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{952980635afc7ec81804.js → 5b02ba8ed152dba53155.js} +1 -1
  28. package/assets/esri/core/workers/chunks/60c06d1bb3f8a26cb5ac.js +1 -0
  29. package/assets/esri/core/workers/chunks/{c2253a9f29c1aabb2b75.js → 66c47983e93071de28b1.js} +1 -1
  30. package/assets/esri/core/workers/chunks/6be326edd9829781d926.js +1 -0
  31. package/assets/esri/core/workers/chunks/70d6bb3c7112cb702389.js +1 -0
  32. package/assets/esri/core/workers/chunks/{5bcb3240b3c005e5fe72.js → 7215af7810d15e89aa5a.js} +1 -1
  33. package/assets/esri/core/workers/chunks/7509c1693ffedc0fa018.js +1 -0
  34. package/assets/esri/core/workers/chunks/76c1d663f6d3f935c87f.js +1 -0
  35. package/assets/esri/core/workers/chunks/7ccbb923f113b3e21545.js +1 -0
  36. package/assets/esri/core/workers/chunks/810a763373d7f78ae398.js +1 -0
  37. package/assets/esri/core/workers/chunks/82194fec53054c37061f.js +1 -0
  38. package/assets/esri/core/workers/chunks/82c59a71b7f087148089.js +1 -0
  39. package/assets/esri/core/workers/chunks/84eee02122b56a22d49e.js +1 -0
  40. package/assets/esri/core/workers/chunks/{dd13772a5e2eccc6a2bc.js → 8598f762f15ca68d52b7.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{3c673495e5f507c4a9e5.js → 88458dcaff8edc50620c.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{5ec98f4ddac707d0fbd1.js → 88815d533808aabb1fa9.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{0463ba46df855a92b9c0.js → 8941f09329d9d39fb2fe.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{655b55ac0cd533d7e9d7.js → 8ad5dc818dc73f4b9a76.js} +1 -1
  45. package/assets/esri/core/workers/chunks/8e96cddb069b643d864a.js +1 -0
  46. package/assets/esri/core/workers/chunks/{f2124f4d0f2b8a91f0ea.js → 90c5edcd8a609224ce55.js} +1 -1
  47. package/assets/esri/core/workers/chunks/9230b20eba4304d421b4.js +1 -0
  48. package/assets/esri/core/workers/chunks/{bac9fc90e6756e211160.js → 94d9951509c0db09547a.js} +1 -1
  49. package/assets/esri/core/workers/chunks/996d6ae7f2e2273f9bce.js +1 -0
  50. package/assets/esri/core/workers/chunks/{37c03cfc19086ce631c6.js → 9bd603ec98d24cd918e9.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{c1135cb02ec46c491459.js → 9ce961bc390202c87941.js} +1 -1
  52. package/assets/esri/core/workers/chunks/9d4a35d4a85db80c4071.js +1 -0
  53. package/assets/esri/core/workers/chunks/9f0ad28e66862ba971a3.js +1 -0
  54. package/assets/esri/core/workers/chunks/{b3f5e91116112b0b612a.js → 9fd47b8fe25657ac0237.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{b9e9cb354822c6d995a4.js → a276e60209f3d877a8d0.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{aeaa1667c2d9f1b3366b.js → a85ed251d3d3668e474f.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{44f0c3663b293afbd172.js → acf10f747215e9ff54dc.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{69fd99b7c76e9992ccf3.js → b32bf9808cb4be3a6bd0.js} +1 -1
  59. package/assets/esri/core/workers/chunks/b3dc80ddbfa81026e937.js +1 -0
  60. package/assets/esri/core/workers/chunks/b548e6b3add4154ac4e6.js +1 -0
  61. package/assets/esri/core/workers/chunks/b6c55bdd8c957b062bc1.js +1 -0
  62. package/assets/esri/core/workers/chunks/{9d77467aa71d345fc1b6.js → bcc01bbffaa3bb5f60a8.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{1f8c6a179e39fd4c5e6f.js → bd152e8b43cc4a6844dd.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{0d02c6ad1f4688bfa374.js → bf7c44644fe7b0aa60cf.js} +1 -1
  65. package/assets/esri/core/workers/chunks/c0dc5882362479794224.js +1 -0
  66. package/assets/esri/core/workers/chunks/c8b574a76807f4ea7a70.js +1 -0
  67. package/assets/esri/core/workers/chunks/d09a0b2dc3a6fc10fa41.js +1 -0
  68. package/assets/esri/core/workers/chunks/{ec10151a2a95e95a0bb5.js → d304fe0ac836afd46e3d.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{37a7bd30352b1309b8f8.js → d3f05b8e4bd53eb1eb9d.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{be588873c16770ceb9ef.js → d46b511bbb83e68f1ece.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{17de7a324dfa7f57ad5d.js → d780e946149b1c3d1246.js} +1 -1
  72. package/assets/esri/core/workers/chunks/d80bcf5ed1f54e0c4f5a.js +1 -0
  73. package/assets/esri/core/workers/chunks/{8cbb04a9065aa3756638.js → dc04a8ba6c770bdc2bd4.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{89820b200ee44e678af5.js → dd891a98105904f8a06b.js} +1 -1
  75. package/assets/esri/core/workers/chunks/e5ab037c2a90411c453b.js +1 -0
  76. package/assets/esri/core/workers/chunks/ef2df21e1af3aa7ced29.js +1 -0
  77. package/assets/esri/core/workers/chunks/f5a7281ae24e837efc61.js +1 -0
  78. package/assets/esri/core/workers/chunks/{ff6abdc72076f3994659.js → f7150547d7e3259a0f29.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{2c607d30ff8ca1b61286.js → fe0c3b7c9b428d9c3f25.js} +1 -1
  80. package/assets/esri/images/portal/mediaservice16.png +0 -0
  81. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  82. package/assets/esri/widgets/Directions/t9n/Directions.json +1 -1
  83. package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
  84. package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
  85. package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
  86. package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
  87. package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
  88. package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
  89. package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
  90. package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
  91. package/assets/esri/widgets/Directions/t9n/Directions_en.json +1 -1
  92. package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
  93. package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
  94. package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
  95. package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
  96. package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
  97. package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
  98. package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
  99. package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
  100. package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
  101. package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
  102. package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
  103. package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
  104. package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
  105. package/assets/esri/widgets/Directions/t9n/Directions_nb.json +1 -1
  106. package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
  107. package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
  108. package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
  109. package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
  110. package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
  111. package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
  112. package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
  113. package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
  114. package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
  115. package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
  116. package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
  117. package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
  118. package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
  119. package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
  120. package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
  121. package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
  122. package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
  123. package/chunks/Heatmap.glsl.js +10 -0
  124. package/chunks/HeatmapDensity.glsl.js +21 -0
  125. package/core/maybe.js +1 -1
  126. package/core/promiseUtils.js +1 -1
  127. package/interfaces.d.ts +455 -45
  128. package/layers/RouteLayer.d.ts +4 -0
  129. package/layers/RouteLayer.js +1 -1
  130. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  131. package/layers/graphics/data/optimizedFeatureQueryEngineAdapter.js +1 -1
  132. package/layers/graphics/featureConversionUtils.js +1 -1
  133. package/layers/mixins/ArcGISImageService.js +1 -1
  134. package/layers/support/rasterFunctions/vectorFieldUtils.js +1 -1
  135. package/package.json +1 -1
  136. package/portal/PortalItem.js +1 -1
  137. package/renderers/support/rendererConversion.js +1 -1
  138. package/rest/support/DirectionLine.d.ts +4 -0
  139. package/rest/support/DirectionPoint.d.ts +4 -0
  140. package/rest/support/FeatureSet.js +1 -1
  141. package/rest/support/RouteInfo.d.ts +4 -0
  142. package/rest/support/RouteInfo.js +1 -1
  143. package/rest/support/RouteSolveResult.d.ts +4 -0
  144. package/support/featureFlags.js +1 -1
  145. package/support/revision.js +1 -1
  146. package/symbols/TextSymbol3DLayer.js +1 -1
  147. package/symbols/support/Symbol3DHalo.js +1 -1
  148. package/symbols/support/Symbol3DTextBackground.js +5 -0
  149. package/views/2d/engine/RasterVFContainer.js +5 -0
  150. package/views/2d/engine/RasterVFDisplayObject.js +1 -1
  151. package/views/2d/engine/flow/AnimatedFlowView2D.js +1 -1
  152. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  153. package/views/2d/engine/webgl/brushes/raster/BrushVectorField.js +1 -1
  154. package/views/2d/engine/webgl/cpuMapped/Buffer.js +1 -1
  155. package/views/2d/engine/webgl/mesh/templates/WGLBaseTextTemplate.js +1 -1
  156. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  157. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  158. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  159. package/views/2d/layers/RouteLayerView2D.js +1 -1
  160. package/views/2d/layers/features/processors/HeatmapProcessor.js +1 -1
  161. package/views/2d/layers/features/processors/SymbolProcessor.js +1 -1
  162. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  163. package/views/2d/layers/features/support/ClusterStore.js +1 -1
  164. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  165. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  166. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  167. package/views/2d/layers/imagery/ImageryVFStrategy.js +5 -0
  168. package/views/2d/layers/imagery/ImageryView2D.js +1 -1
  169. package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
  170. package/views/2d/layers/imagery/VectorFieldView2D.js +5 -0
  171. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  172. package/views/3d/environment/CloudsComposition.js +1 -1
  173. package/views/3d/environment/CloudsGenerator.js +1 -1
  174. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  175. package/views/3d/environment/Fog.js +1 -1
  176. package/views/3d/environment/NoiseTextureAtlas.js +1 -1
  177. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  178. package/views/3d/environment/Precipitation.js +1 -1
  179. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  180. package/views/3d/environment/Stars.js +1 -1
  181. package/views/3d/interactive/analysisTools/lineOfSight/LineOfSightTool.js +1 -1
  182. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  183. package/views/3d/layers/I3SMeshView3D.js +1 -1
  184. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  185. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  186. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  187. package/views/3d/layers/graphics/labelPlacement.js +1 -1
  188. package/views/3d/layers/i3s/I3SCrossfadeHelper.js +1 -1
  189. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  190. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  191. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  192. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  193. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  194. package/views/3d/support/LaserLineRenderer.js +1 -1
  195. package/views/3d/terrain/OverlayRenderer.js +1 -1
  196. package/views/3d/terrain/TerrainRenderer.js +1 -1
  197. package/views/3d/terrain/TileRenderer.js +1 -1
  198. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  199. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  200. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +5 -0
  201. package/views/3d/webgl-engine/lib/HighlightHelper.js +1 -1
  202. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  203. package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
  204. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  205. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  206. package/views/3d/webgl-engine/lib/ShadowHighlightHelper.js +1 -1
  207. package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
  208. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  209. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  210. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  211. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  212. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  213. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +5 -0
  214. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  215. package/views/3d/webgl-engine/shaders/Heatmap.glsl.js +5 -0
  216. package/views/3d/webgl-engine/shaders/HeatmapDensity.glsl.js +5 -0
  217. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +5 -0
  218. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +5 -0
  219. package/views/draw/support/Box.js +1 -1
  220. package/views/draw/support/GraphicMover.js +1 -1
  221. package/views/draw/support/HighlightHelper.js +5 -0
  222. package/views/draw/support/Reshape.js +1 -1
  223. package/views/draw/support/layerUtils.js +1 -1
  224. package/webdoc/support/{Thumbnail.js → SlideThumbnail.js} +1 -1
  225. package/webmap/Bookmark.js +1 -1
  226. package/webmap/Version.js +1 -1
  227. package/webscene/Slide.js +1 -1
  228. package/webscene/Version.js +1 -1
  229. package/webscene/support/SlideVisibleLayer.js +1 -1
  230. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  231. package/widgets/Bookmarks.js +1 -1
  232. package/widgets/Directions/DirectionsViewModel.js +1 -1
  233. package/widgets/Directions/support/directionsUtils.js +1 -1
  234. package/widgets/Directions/support/resources.js +1 -1
  235. package/widgets/Directions.js +1 -1
  236. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  237. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  238. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  239. package/widgets/FeatureTable.js +1 -1
  240. package/widgets/Sketch/SketchViewModel.js +1 -1
  241. package/widgets/Sketch.js +1 -1
  242. package/widgets/TimeSlider.js +1 -1
  243. package/widgets/Widget.js +1 -1
  244. package/widgets/support/vnodeCache.js +5 -0
  245. package/widgets/support/widgetUtils.js +1 -1
  246. package/assets/esri/core/workers/chunks/0453fad5cb819797b4f6.js +0 -1
  247. package/assets/esri/core/workers/chunks/0cd0a6eef51fc5b9ea61.js +0 -1
  248. package/assets/esri/core/workers/chunks/0d684f16f37d5dc385dd.js +0 -1
  249. package/assets/esri/core/workers/chunks/16b6d0f8378582c051c3.js +0 -1
  250. package/assets/esri/core/workers/chunks/1877ab1b6a115dbba1c5.js +0 -1
  251. package/assets/esri/core/workers/chunks/1b2a961f776a0b57e57a.js +0 -1
  252. package/assets/esri/core/workers/chunks/1b3fd66577b19aa5f2b6.js +0 -1
  253. package/assets/esri/core/workers/chunks/1c733b7db092a2a88ef3.js +0 -1
  254. package/assets/esri/core/workers/chunks/27474b007988855bea9d.js +0 -1
  255. package/assets/esri/core/workers/chunks/357033117dfe61eb81ea.js +0 -1
  256. package/assets/esri/core/workers/chunks/483d5d8593d96d0f0b15.js +0 -1
  257. package/assets/esri/core/workers/chunks/4ba6de8aa7e2960bad49.js +0 -1
  258. package/assets/esri/core/workers/chunks/4be35af7d6babbfe9d84.js +0 -1
  259. package/assets/esri/core/workers/chunks/5457962a70bd3c557a75.js +0 -1
  260. package/assets/esri/core/workers/chunks/57856b4a9b8784a69844.js +0 -1
  261. package/assets/esri/core/workers/chunks/57b349d1dbc0bed75b79.js +0 -1
  262. package/assets/esri/core/workers/chunks/5d11b97b667921d67ae7.js +0 -1
  263. package/assets/esri/core/workers/chunks/5dbe555a5a662ff3d9ce.js +0 -1
  264. package/assets/esri/core/workers/chunks/64b7e8d812ea8fcf269e.js +0 -1
  265. package/assets/esri/core/workers/chunks/75d812955a473d0e8960.js +0 -1
  266. package/assets/esri/core/workers/chunks/96f148a556a2418038de.js +0 -1
  267. package/assets/esri/core/workers/chunks/9876a1bae350795fab36.js +0 -1
  268. package/assets/esri/core/workers/chunks/a8692bffb76444c34760.js +0 -1
  269. package/assets/esri/core/workers/chunks/ba762bcfd74af0bb8218.js +0 -1
  270. package/assets/esri/core/workers/chunks/c093dff4592832ac0973.js +0 -1
  271. package/assets/esri/core/workers/chunks/c984b3040e120e502b11.js +0 -1
  272. package/assets/esri/core/workers/chunks/cdbc005eebec1503b99d.js +0 -1
  273. package/assets/esri/core/workers/chunks/d1fe53b597351dc58305.js +0 -1
  274. package/assets/esri/core/workers/chunks/e218bde41ffbcc5194f5.js +0 -1
  275. package/assets/esri/core/workers/chunks/e287f49184d076af17e2.js +0 -1
  276. package/assets/esri/core/workers/chunks/e93dfdede0532a89ffa5.js +0 -1
  277. package/assets/esri/core/workers/chunks/e9e5196b44b6923be1a3.js +0 -1
  278. package/assets/esri/core/workers/chunks/ea595b0df5050eda2a13.js +0 -1
  279. package/assets/esri/core/workers/chunks/eb82ff10cef2bde6e57f.js +0 -1
  280. package/assets/esri/core/workers/chunks/ee6e0db58dc64410e687.js +0 -1
  281. package/assets/esri/core/workers/chunks/f0a9f161805fc7a30fc5.js +0 -1
  282. package/assets/esri/core/workers/chunks/fc7e31d87555beb63291.js +0 -1
  283. package/assets/esri/core/workers/chunks/fff6b0338f06dad0c45d.js +0 -1
  284. package/views/2d/layers/imagery/ImageryGraphicsView2D.js +0 -5
  285. package/widgets/Directions/support/CostSummary.js +0 -5
  286. package/widgets/Directions/support/RouteSection.js +0 -5
  287. package/widgets/Directions/support/RouteSections.js +0 -5
  288. package/widgets/Directions/support/maneuverUtils.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../geometry.js";import e from"../../../../../core/Evented.js";import t from"../../../../../core/has.js";import{isNone as s,isSome as r,andThen as a}from"../../../../../core/maybe.js";import{diff as i,hasDiff as o}from"../../../../../core/accessorSupport/diffUtils.js";import{GeohashTree as h}from"../../../../../geohash/GeohashTree.js";import{setGeohashBuf as l,setGeohashXY as n}from"../../../../../geohash/geohashUtils.js";import{earth as u}from"../../../../../geometry/support/Ellipsoid.js";import{getInfo as c}from"../../../../../geometry/support/spatialReferenceUtils.js";import{quantizeX as g,quantizeY as d}from"../../../../../layers/graphics/featureConversionUtils.js";import p,{OptimizedFeatureWithGeometry as f}from"../../../../../layers/graphics/OptimizedFeature.js";import _ from"../../../../../layers/graphics/OptimizedGeometry.js";import{checkProjectionSupport as m,project as y}from"../../../../../layers/graphics/data/projectionSupport.js";import{TILE_SIZE as v}from"../../../engine/webgl/definitions.js";import{Store2D as I}from"../Store2D.js";import{FeatureSetReaderJSON as b}from"./FeatureSetReaderJSON.js";import R from"../../../../../geometry/SpatialReference.js";const C=12,M=1;class x extends f{constructor(e,t,s,r,a){super(new _([],[t,s]),r,null,e),this.geohashBoundsInfo=a}get count(){return this.attributes.cluster_count}static create(e,t,s,r,a,i,o,h){const l=new x(t,s,r,i,o);return l.displayId=e.createDisplayId(!0),l.referenceId=h,l.tileLevel=a,l}update(e,t,s,r,a,i){return this.geometry.coords[0]=e,this.geometry.coords[1]=t,this.tileLevel=s,this.attributes=r,this.geohashBoundsInfo=a,this.referenceId=null,this.referenceId=i,this}toJSON(){return{objectId:this.objectId,referenceId:1===this.attributes.cluster_count?this.referenceId:null,attributes:{...this.attributes,clusterId:this.objectId},geometry:{x:this.geometry.coords[0],y:this.geometry.coords[1]}}}}function L(e){return 57.29577951308232*e}class j extends I{constructor(t,s,r){super(t,r),this.events=new e,this._geohashLevel=0,this._tileLevel=0,this._aggregateValueRanges={},this._aggregateValueRangesChanged=!1,this._geohashBuf=[],this._clusters=new Map,this._tiles=new Map,this.geometryInfo=t.geometryInfo,this._spatialReference=s,this._projectionSupportCheck=m(s,R.WGS84),this._bitsets.geohash=r.getBitset(r.createBitset()),this._bitsets.inserted=r.getBitset(r.createBitset())}async updateSchema(e,r){const a=this._schema;try{await super.updateSchema(e,r),await this._projectionSupportCheck}catch(n){}const l=i(a,r);r&&(!s(l)||e.source||e.storage.filters)?((o(l,"params.fields")||!this._tree||e.source)&&(this._tree=new h(this._statisticFields),this._rebuildTree(),t("esri-2d-update-debug")&&console.debug("Aggregate mesh needs update due to tree changing")),t("esri-2d-update-debug")&&console.debug("Applying Update - ClusterStore:",l),e.targets[r.name]=!0,e.mesh=!1,this._aggregateValueRanges={}):a&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,t){this._bitsets.inserted.forEachSet((s=>{if(!e.has(s)){const e=t.lookupByDisplayIdUnsafe(s);this._remove(e)}}))}sweepClusters(e,t,s){this._clusters.forEach(((r,a)=>{r&&r.tileLevel!==s&&(e.releaseDisplayId(r.displayId),t.unsetAttributeData(r.displayId),this._clusters.delete(a))}))}onTileData(e,t,r,a,i=!0){if(!this._schema||s(t.addOrUpdate))return t;const o=this._getTransforms(e,this._spatialReference);{const e=t.addOrUpdate.getCursor();for(;e.next();)this._update(e,a)}if(t.status.mesh||!i)return t;const h=new Array,l=this._schema.params.clusterRadius;this._getClustersForTile(h,e,l,r,o),t.addOrUpdate=b.fromOptimizedFeatures(h,"esriGeometryPoint"),t.addOrUpdate.attachStorage(r),t.end=!0;{const s=t.addOrUpdate.getCursor();for(;s.next();){const t=s.getDisplayId();this._bitsets.computed.unset(t),this.setComputedAttributes(r,s,t,e.scale)}}return this._aggregateValueRangesChanged&&t.end&&(this.events.emit("valueRangesChanged",{valueRanges:this._aggregateValueRanges}),this._aggregateValueRangesChanged=!1),t}onTileUpdate({added:e,removed:t}){if(e.length){const t=e[0].level;this._tileLevel=t,this._setGeohashLevel(t)}if(!this._schema)return;const s=this._schema.params.clusterRadius;t.forEach((e=>{this._tiles.delete(e.key.id),this._markTileClustersForDeletion(e,s)}))}getAggregate(e){for(const t of this._clusters.values())if((null==t?void 0:t.displayId)===e)return t.toJSON();return null}getAggregates(){const e=[];for(const t of this._clusters.values())(null==t?void 0:t.tileLevel)===this._tileLevel&&e.push(t.toJSON());return e}getDisplayId(e){const t=this._clusters.get(e);return t?t.displayId:null}getFeatureDisplayIdsForAggregate(e){const t=this._clusters.get(e);if(!t)return[];const s=t.geohashBoundsInfo;return this._tree.getRegionDisplayIds(s.xLL,s.yLL,s.xTR,s.yTR,s.level)}getDisplayIdForReferenceId(e){for(const t of this._clusters.values())if((null==t?void 0:t.referenceId)===e)return t.displayId;return null}getAggregateValueRanges(){return this._aggregateValueRanges}forEach(e){for(const[t,s]of this._clusters)s&&e(s,t)}size(){let e=0;return this.forEach((t=>e++)),e}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const t=e.getDisplayId(),s=e.getXHydrated(),r=e.getYHydrated(),a=this._geohashBuf[2*t],i=this._geohashBuf[2*t+1];this._bitsets.inserted.has(t)&&(this._bitsets.inserted.unset(t),this._tree.removeCursor(e,s,r,a,i,this._geohashLevel))}_update(e,t){const s=e.getDisplayId(),r=this._bitsets.inserted,a=t.isVisible(s);if(a===r.has(s))return;if(!a)return void this._remove(e);const i=e.getXHydrated(),o=e.getYHydrated();if(!this._setGeohash(s,i,o))return;const h=this._geohashBuf[2*s],l=this._geohashBuf[2*s+1];this._tree.insertCursor(e,s,i,o,h,l,this._geohashLevel),r.set(s)}_setGeohash(e,t,s){if(this._bitsets.geohash.has(e))return!0;const r=this._geohashBuf;if(this._spatialReference.isWebMercator){const a=L(t/u.radius),i=a-360*Math.floor((a+180)/360),o=L(Math.PI/2-2*Math.atan(Math.exp(-s/u.radius)));l(r,e,o,i,C)}else{const a=y({x:t,y:s},this._spatialReference,R.WGS84);if(!a)return!1;l(r,e,a.y,a.x,C)}return this._bitsets.geohash.set(e),!0}_getClustersForTile(e,t,i,o,h,l=!0){const n=this._schema.params.clusterPixelBuffer,u=2*i,c=this._getGeohashLevel(t.key.level),f=Math.ceil(2**t.key.level*v/u),_=Math.ceil(n/u)+0,m=Math.ceil(v/u),{row:y,col:I}=t.key,b=I*v,R=y*v,C=Math.floor(b/u)-_,M=Math.floor(R/u)-_,x=C+m+2*_,L=M+m+2*_,j=t.tileInfoView.getLODInfoAt(t.key.level);for(let v=C;v<=x;v++)for(let i=M;i<=L;i++){let n=v;j.wrap&&(n=v<0?v+f:v%f);const u=j.wrap&&v<0,_=j.wrap&&v%f!==v,m=this._lookupCluster(o,j,t.key.level,n,i,c);if(r(m)){const t=a(h,(e=>u?e.left:_?e.right:e.tile));if(l&&s(t))continue;if(!m.count)continue;if(r(t)&&l){const s=m.geometry.clone();let a=m.attributes;s.coords[0]=g(t,s.coords[0]),s.coords[1]=d(t,s.coords[1]),1===m.count&&r(m.referenceId)&&(a={...m.attributes,referenceId:m.referenceId});const i=new p(s,a);i.displayId=m.displayId,e.push(i)}}}}_getGeohashLevel(e){return Math.min(Math.ceil(e/2+2),C)}_setGeohashLevel(e){const t=this._getGeohashLevel(e),s=(Math.floor(t/M)+1)*M-1;if(this._geohashLevel!==s)return this._geohashLevel=s,this._rebuildTree(),void this._bitsets.geohash.clear()}_getTransforms(e,t){const s={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},r=c(t);if(!r)return{tile:s,left:null,right:null};const[a,i]=r.valid;return{tile:s,left:{...s,translate:[i,e.bounds[3]]},right:{...s,translate:[a-i+e.bounds[0],e.bounds[3]]}}}_getClusterId(e,t,s){return(15&e)<<28|(16383&t)<<14|16383&s}_markForDeletion(e,t,s){const r=this._getClusterId(e,t,s);this._clusters.delete(r)}_getClusterBounds(e,t,s){const r=this._schema.params.clusterRadius,a=2*r;let i=s%2?t*a:t*a-r;const o=s*a;let h=i+a;const l=o-a,n=2**e.level*v;e.wrap&&i<0&&(i=0),e.wrap&&h>n&&(h=n);const u=i/v,c=o/v,g=h/v,d=l/v;return[e.getXForColumn(u),e.getYForRow(c),e.getXForColumn(g),e.getYForRow(d)]}_lookupCluster(e,t,s,a,i,o){const h=this._getClusterId(s,a,i),l=this._clusters.get(h),[c,g,d,p]=this._getClusterBounds(t,a,i),f={x:c,y:g},_={x:d,y:p};let m=0,v=0,I=0,b=0;if(this._spatialReference.isWebMercator){{const e=L(f.x/u.radius);m=e-360*Math.floor((e+180)/360),v=L(Math.PI/2-2*Math.atan(Math.exp(-f.y/u.radius)))}{const e=L(_.x/u.radius);I=e-360*Math.floor((e+180)/360),b=L(Math.PI/2-2*Math.atan(Math.exp(-_.y/u.radius)))}}else{const e=y(f,this._spatialReference,R.WGS84),t=y(_,this._spatialReference,R.WGS84);if(!e||!t)return null;m=e.x,v=e.y,I=t.x,b=t.y}const C={geohashX:0,geohashY:0},M={geohashX:0,geohashY:0};n(C,v,m,o),n(M,b,I,o);const j=C.geohashX,w=C.geohashY,V=M.geohashX,S=M.geohashY,F={xLL:j,yLL:w,xTR:V,yTR:S,level:o},T=this._tree.getRegionStatistics(j,w,V,S,o),{count:D,xTotal:k,yTotal:B,referenceId:G}=T,O=D?k/D:0,A=D?B/D:0;if(0===D)return this._clusters.set(h,null),null;const U={cluster_count:D,...T.attributes},X=r(l)?l.update(O,A,s,U,F,G):x.create(e,h,O,A,s,U,F,G);return 0===D&&(X.geometry.coords[0]=(c+d)/2,X.geometry.coords[1]=(g+p)/2),this._clusters.set(h,X),this._updateAggregateValueRangeForCluster(X,X.tileLevel),X}_updateAggregateValueRangeForCluster(e,t){const s=this._aggregateValueRanges[t]||{minValue:1/0,maxValue:0},r=s.minValue,a=s.maxValue;s.minValue=Math.min(r,e.count),s.maxValue=Math.max(a,e.count),this._aggregateValueRanges[t]=s,r===s.minValue&&a===s.maxValue||(this._aggregateValueRangesChanged=!0)}_markTileClustersForDeletion(e,t){const s=2*t,r=Math.ceil(v/s),{row:a,col:i}=e.key,o=i*v,h=a*v,l=Math.floor(o/s),n=Math.floor(h/s);for(let u=l;u<l+r;u++)for(let t=n;t<n+r;t++)this._markForDeletion(e.key.level,u,t)}}export{x as ClusterInfo,j as ClusterStore};
5
+ import"../../../../../geometry.js";import e from"../../../../../core/Evented.js";import t from"../../../../../core/has.js";import{isNone as s,isSome as r,applySome as a}from"../../../../../core/maybe.js";import{diff as i,hasDiff as o}from"../../../../../core/accessorSupport/diffUtils.js";import{GeohashTree as h}from"../../../../../geohash/GeohashTree.js";import{setGeohashBuf as l,setGeohashXY as n}from"../../../../../geohash/geohashUtils.js";import{earth as u}from"../../../../../geometry/support/Ellipsoid.js";import{getInfo as c}from"../../../../../geometry/support/spatialReferenceUtils.js";import{quantizeX as g,quantizeY as d}from"../../../../../layers/graphics/featureConversionUtils.js";import p,{OptimizedFeatureWithGeometry as f}from"../../../../../layers/graphics/OptimizedFeature.js";import _ from"../../../../../layers/graphics/OptimizedGeometry.js";import{checkProjectionSupport as m,project as y}from"../../../../../layers/graphics/data/projectionSupport.js";import{TILE_SIZE as v}from"../../../engine/webgl/definitions.js";import{Store2D as I}from"../Store2D.js";import{FeatureSetReaderJSON as b}from"./FeatureSetReaderJSON.js";import R from"../../../../../geometry/SpatialReference.js";const C=12,M=1;class x extends f{constructor(e,t,s,r,a){super(new _([],[t,s]),r,null,e),this.geohashBoundsInfo=a}get count(){return this.attributes.cluster_count}static create(e,t,s,r,a,i,o,h){const l=new x(t,s,r,i,o);return l.displayId=e.createDisplayId(!0),l.referenceId=h,l.tileLevel=a,l}update(e,t,s,r,a,i){return this.geometry.coords[0]=e,this.geometry.coords[1]=t,this.tileLevel=s,this.attributes=r,this.geohashBoundsInfo=a,this.referenceId=null,this.referenceId=i,this}toJSON(){return{objectId:this.objectId,referenceId:1===this.attributes.cluster_count?this.referenceId:null,attributes:{...this.attributes,clusterId:this.objectId},geometry:{x:this.geometry.coords[0],y:this.geometry.coords[1]}}}}function L(e){return 57.29577951308232*e}class j extends I{constructor(t,s,r){super(t,r),this.events=new e,this._geohashLevel=0,this._tileLevel=0,this._aggregateValueRanges={},this._aggregateValueRangesChanged=!1,this._geohashBuf=[],this._clusters=new Map,this._tiles=new Map,this.geometryInfo=t.geometryInfo,this._spatialReference=s,this._projectionSupportCheck=m(s,R.WGS84),this._bitsets.geohash=r.getBitset(r.createBitset()),this._bitsets.inserted=r.getBitset(r.createBitset())}async updateSchema(e,r){const a=this._schema;try{await super.updateSchema(e,r),await this._projectionSupportCheck}catch(n){}const l=i(a,r);r&&(!s(l)||e.source||e.storage.filters)?((o(l,"params.fields")||!this._tree||e.source)&&(this._tree=new h(this._statisticFields),this._rebuildTree(),t("esri-2d-update-debug")&&console.debug("Aggregate mesh needs update due to tree changing")),t("esri-2d-update-debug")&&console.debug("Applying Update - ClusterStore:",l),e.targets[r.name]=!0,e.mesh=!1,this._aggregateValueRanges={}):a&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,t){this._bitsets.inserted.forEachSet((s=>{if(!e.has(s)){const e=t.lookupByDisplayIdUnsafe(s);this._remove(e)}}))}sweepClusters(e,t,s){this._clusters.forEach(((r,a)=>{r&&r.tileLevel!==s&&(e.releaseDisplayId(r.displayId),t.unsetAttributeData(r.displayId),this._clusters.delete(a))}))}onTileData(e,t,r,a,i=!0){if(!this._schema||s(t.addOrUpdate))return t;const o=this._getTransforms(e,this._spatialReference);{const e=t.addOrUpdate.getCursor();for(;e.next();)this._update(e,a)}if(t.status.mesh||!i)return t;const h=new Array,l=this._schema.params.clusterRadius;this._getClustersForTile(h,e,l,r,o),t.addOrUpdate=b.fromOptimizedFeatures(h,"esriGeometryPoint"),t.addOrUpdate.attachStorage(r),t.end=!0;{const s=t.addOrUpdate.getCursor();for(;s.next();){const t=s.getDisplayId();this._bitsets.computed.unset(t),this.setComputedAttributes(r,s,t,e.scale)}}return this._aggregateValueRangesChanged&&t.end&&(this.events.emit("valueRangesChanged",{valueRanges:this._aggregateValueRanges}),this._aggregateValueRangesChanged=!1),t}onTileUpdate({added:e,removed:t}){if(e.length){const t=e[0].level;this._tileLevel=t,this._setGeohashLevel(t)}if(!this._schema)return;const s=this._schema.params.clusterRadius;t.forEach((e=>{this._tiles.delete(e.key.id),this._markTileClustersForDeletion(e,s)}))}getAggregate(e){for(const t of this._clusters.values())if((null==t?void 0:t.displayId)===e)return t.toJSON();return null}getAggregates(){const e=[];for(const t of this._clusters.values())(null==t?void 0:t.tileLevel)===this._tileLevel&&e.push(t.toJSON());return e}getDisplayId(e){const t=this._clusters.get(e);return t?t.displayId:null}getFeatureDisplayIdsForAggregate(e){const t=this._clusters.get(e);if(!t)return[];const s=t.geohashBoundsInfo;return this._tree.getRegionDisplayIds(s.xLL,s.yLL,s.xTR,s.yTR,s.level)}getDisplayIdForReferenceId(e){for(const t of this._clusters.values())if((null==t?void 0:t.referenceId)===e)return t.displayId;return null}getAggregateValueRanges(){return this._aggregateValueRanges}forEach(e){for(const[t,s]of this._clusters)s&&e(s,t)}size(){let e=0;return this.forEach((t=>e++)),e}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const t=e.getDisplayId(),s=e.getXHydrated(),r=e.getYHydrated(),a=this._geohashBuf[2*t],i=this._geohashBuf[2*t+1];this._bitsets.inserted.has(t)&&(this._bitsets.inserted.unset(t),this._tree.removeCursor(e,s,r,a,i,this._geohashLevel))}_update(e,t){const s=e.getDisplayId(),r=this._bitsets.inserted,a=t.isVisible(s);if(a===r.has(s))return;if(!a)return void this._remove(e);const i=e.getXHydrated(),o=e.getYHydrated();if(!this._setGeohash(s,i,o))return;const h=this._geohashBuf[2*s],l=this._geohashBuf[2*s+1];this._tree.insertCursor(e,s,i,o,h,l,this._geohashLevel),r.set(s)}_setGeohash(e,t,s){if(this._bitsets.geohash.has(e))return!0;const r=this._geohashBuf;if(this._spatialReference.isWebMercator){const a=L(t/u.radius),i=a-360*Math.floor((a+180)/360),o=L(Math.PI/2-2*Math.atan(Math.exp(-s/u.radius)));l(r,e,o,i,C)}else{const a=y({x:t,y:s},this._spatialReference,R.WGS84);if(!a)return!1;l(r,e,a.y,a.x,C)}return this._bitsets.geohash.set(e),!0}_getClustersForTile(e,t,i,o,h,l=!0){const n=this._schema.params.clusterPixelBuffer,u=2*i,c=this._getGeohashLevel(t.key.level),f=Math.ceil(2**t.key.level*v/u),_=Math.ceil(n/u)+0,m=Math.ceil(v/u),{row:y,col:I}=t.key,b=I*v,R=y*v,C=Math.floor(b/u)-_,M=Math.floor(R/u)-_,x=C+m+2*_,L=M+m+2*_,j=t.tileInfoView.getLODInfoAt(t.key.level);for(let v=C;v<=x;v++)for(let i=M;i<=L;i++){let n=v;j.wrap&&(n=v<0?v+f:v%f);const u=j.wrap&&v<0,_=j.wrap&&v%f!==v,m=this._lookupCluster(o,j,t.key.level,n,i,c);if(r(m)){const t=a(h,(e=>u?e.left:_?e.right:e.tile));if(l&&s(t))continue;if(!m.count)continue;if(r(t)&&l){const s=m.geometry.clone();let a=m.attributes;s.coords[0]=g(t,s.coords[0]),s.coords[1]=d(t,s.coords[1]),1===m.count&&r(m.referenceId)&&(a={...m.attributes,referenceId:m.referenceId});const i=new p(s,a);i.displayId=m.displayId,e.push(i)}}}}_getGeohashLevel(e){return Math.min(Math.ceil(e/2+2),C)}_setGeohashLevel(e){const t=this._getGeohashLevel(e),s=(Math.floor(t/M)+1)*M-1;if(this._geohashLevel!==s)return this._geohashLevel=s,this._rebuildTree(),void this._bitsets.geohash.clear()}_getTransforms(e,t){const s={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},r=c(t);if(!r)return{tile:s,left:null,right:null};const[a,i]=r.valid;return{tile:s,left:{...s,translate:[i,e.bounds[3]]},right:{...s,translate:[a-i+e.bounds[0],e.bounds[3]]}}}_getClusterId(e,t,s){return(15&e)<<28|(16383&t)<<14|16383&s}_markForDeletion(e,t,s){const r=this._getClusterId(e,t,s);this._clusters.delete(r)}_getClusterBounds(e,t,s){const r=this._schema.params.clusterRadius,a=2*r;let i=s%2?t*a:t*a-r;const o=s*a;let h=i+a;const l=o-a,n=2**e.level*v;e.wrap&&i<0&&(i=0),e.wrap&&h>n&&(h=n);const u=i/v,c=o/v,g=h/v,d=l/v;return[e.getXForColumn(u),e.getYForRow(c),e.getXForColumn(g),e.getYForRow(d)]}_lookupCluster(e,t,s,a,i,o){const h=this._getClusterId(s,a,i),l=this._clusters.get(h),[c,g,d,p]=this._getClusterBounds(t,a,i),f={x:c,y:g},_={x:d,y:p};let m=0,v=0,I=0,b=0;if(this._spatialReference.isWebMercator){{const e=L(f.x/u.radius);m=e-360*Math.floor((e+180)/360),v=L(Math.PI/2-2*Math.atan(Math.exp(-f.y/u.radius)))}{const e=L(_.x/u.radius);I=e-360*Math.floor((e+180)/360),b=L(Math.PI/2-2*Math.atan(Math.exp(-_.y/u.radius)))}}else{const e=y(f,this._spatialReference,R.WGS84),t=y(_,this._spatialReference,R.WGS84);if(!e||!t)return null;m=e.x,v=e.y,I=t.x,b=t.y}const C={geohashX:0,geohashY:0},M={geohashX:0,geohashY:0};n(C,v,m,o),n(M,b,I,o);const j=C.geohashX,w=C.geohashY,V=M.geohashX,S=M.geohashY,F={xLL:j,yLL:w,xTR:V,yTR:S,level:o},T=this._tree.getRegionStatistics(j,w,V,S,o),{count:D,xTotal:k,yTotal:B,referenceId:G}=T,O=D?k/D:0,A=D?B/D:0;if(0===D)return this._clusters.set(h,null),null;const U={cluster_count:D,...T.attributes},X=r(l)?l.update(O,A,s,U,F,G):x.create(e,h,O,A,s,U,F,G);return 0===D&&(X.geometry.coords[0]=(c+d)/2,X.geometry.coords[1]=(g+p)/2),this._clusters.set(h,X),this._updateAggregateValueRangeForCluster(X,X.tileLevel),X}_updateAggregateValueRangeForCluster(e,t){const s=this._aggregateValueRanges[t]||{minValue:1/0,maxValue:0},r=s.minValue,a=s.maxValue;s.minValue=Math.min(r,e.count),s.maxValue=Math.max(a,e.count),this._aggregateValueRanges[t]=s,r===s.minValue&&a===s.maxValue||(this._aggregateValueRangesChanged=!0)}_markTileClustersForDeletion(e,t){const s=2*t,r=Math.ceil(v/s),{row:a,col:i}=e.key,o=i*v,h=a*v,l=Math.floor(o/s),n=Math.floor(h/s);for(let u=l;u<l+r;u++)for(let t=n;t<n+r;t++)this._markForDeletion(e.key.level,u,t)}}export{x as ClusterInfo,j as ClusterStore};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{isNone as t,isSome as e}from"../../../../../core/maybe.js";import{convertFromFeatures as r,convertFromFeatureSet as s,convertToFeature as i,convertToGeometry as n,getQuantizedArea as o,unquantizeOptimizedGeometry as a}from"../../../../../layers/graphics/featureConversionUtils.js";import{hasGeometry as u}from"../../../../../layers/graphics/OptimizedFeature.js";import{FeatureSetReader as h}from"./FeatureSetReader.js";function c({coords:t,lengths:e}){let r=0;for(const s of e){for(let e=1;e<s;e++)t[2*(r+e)]+=t[2*(r+e)-2],t[2*(r+e)+1]+=t[2*(r+e)-1];r+=s}}class d extends h{constructor(t,e,r){super(t),this._featureIndex=-1,this._dateFields=new Set,this._geometryType=r,this._features=e}static fromFeatures(t,e,s){const i=r([],t,e,!1,!1,s);for(let r=0;r<i.length;r++)i[r].displayId=t[r].displayId;return d.fromOptimizedFeatures(i,e)}static fromFeatureSet(t,e){const r=s(t,e);return d.fromOptimizedFeatureSet(r)}static fromOptimizedFeatureSet(t){const{features:e,geometryType:r}=t,s=d.fromOptimizedFeatures(e,r);s._exceededTransferLimit=t.exceededTransferLimit,s._transform=t.transform;for(const i of t.fields)"esriFieldTypeDate"===i.type&&s._dateFields.add(i.name);return s}static fromOptimizedFeatures(t,e,r){const s=h.createInstance(),i=new d(s,t,e);return i._transform=r,i}get _current(){return this._features[this._featureIndex]}get geometryType(){return this._geometryType}get hasFeatures(){return!!this._features.length}get hasNext(){return this._featureIndex+1<this._features.length}get exceededTransferLimit(){return this._exceededTransferLimit}get hasZ(){return!1}get hasM(){return!1}removeIds(t){const e=new Set(t);this._features=this._features.filter((t=>!e.has(t.objectId)))}append(t){for(const e of t)this._features.push(e)}getSize(){return this._features.length}getCursor(){return this.copy()}getQuantizationTransform(){return this._transform}getAttributeHash(){let t="";for(const e in this._current.attributes)t+=this._current.attributes[e];return t}getIndex(){return this._featureIndex}setIndex(t){this._featureIndex=t}getObjectId(){return this._current.objectId}getDisplayId(){return this._current.displayId}setDisplayId(t){this._current.displayId=t}getGroupId(){return this._current.groupId}setGroupId(t){this._current.groupId=t}copy(){const t=new d(this.instance,this._features,this.geometryType);return this.copyInto(t),t}next(){for(;++this._featureIndex<this._features.length&&!this._getExists(););return this._featureIndex<this._features.length}readLegacyFeature(){return i(this._current,this.geometryType,this.hasZ,this.hasM)}readOptimizedFeature(){return this._current}readLegacyPointGeometry(){return this.readGeometry()?{x:this.getX(),y:this.getY()}:null}readLegacyGeometry(){const t=this.readGeometry();return n(t,this.geometryType,this.hasZ,this.hasM)}readLegacyCentroid(){const e=this.readCentroid();return t(e)?null:{x:e.coords[0]*this._sx+this._tx,y:e.coords[1]*this._sy+this._ty}}readGeometryArea(){return u(this._current)?o(this._current.geometry,2):0}readUnquantizedGeometry(){const t=this.readGeometry();if("esriGeometryPoint"===this.geometryType||!t)return t;const e=t.clone();return c(e),e}readHydratedGeometry(){const r=this._current.geometry;if(t(r))return null;const s=r.clone();return e(this._transform)&&a(s,s,this.hasZ,this.hasM,this._transform),s}getXHydrated(){if(!u(this._current))return 0;const e=this._current.geometry.coords[0],r=this.getQuantizationTransform();return t(r)?e:e*r.scale[0]+r.translate[0]}getYHydrated(){if(!u(this._current))return 0;const e=this._current.geometry.coords[1],r=this.getQuantizationTransform();return t(r)?e:r.translate[1]-e*r.scale[1]}getX(){return u(this._current)?this._current.geometry.coords[0]*this._sx+this._tx:0}getY(){return u(this._current)?this._current.geometry.coords[1]*this._sy+this._ty:0}readGeometry(){if(!u(this._current))return null;const t=this._current.geometry.clone();if(t.isPoint)return t.coords[0]=t.coords[0]*this._sx+this._tx,t.coords[1]=t.coords[1]*this._sy+this._ty,t;let e=0;for(const r of t.lengths)t.coords[2*e]=t.coords[2*e]*this._sx+this._tx,t.coords[2*e+1]=t.coords[2*e+1]*this._sy+this._ty,e+=r;return t}readCentroid(){if(!u(this._current))return null;if(!this._current.centroid){const t=this._computeCentroid();if(!t)return null;t.coords[0]=(t.coords[0]-this._tx)/this._sx,t.coords[1]=(t.coords[1]-this._ty)/this._sy,this._current.centroid=t}const t=this._current.centroid.clone();return t.coords[0]=t.coords[0]*this._sx+this._tx,t.coords[1]=t.coords[1]*this._sx+this._ty,t}_readAttribute(t,e){const r=this._current.attributes[t];if(void 0!==r)return null!=r&&e&&this._dateFields.has(t)?new Date(r):r;const s=this.readAttributes(),i=t.toLocaleLowerCase().trim();for(const n in s)if(n.toLocaleLowerCase().trim()===i){const t=this._current.attributes[n];return null!=t&&e&&this._dateFields.has(n)?new Date(t):t}}copyInto(t){super.copyInto(t),t._featureIndex=this._featureIndex,t._transform=this._transform,t._dateFields=this._dateFields}_readAttributes(){return this._current.attributes}}export{d as FeatureSetReaderJSON};
5
+ import{isNone as t,isSome as e}from"../../../../../core/maybe.js";import{convertFromFeatures as r,convertFromFeatureSet as s,convertToFeature as i,convertToGeometry as n,getQuantizedArea as o,unquantizeOptimizedGeometry as a}from"../../../../../layers/graphics/featureConversionUtils.js";import{hasGeometry as u}from"../../../../../layers/graphics/OptimizedFeature.js";import{FeatureSetReader as h}from"./FeatureSetReader.js";function c({coords:t,lengths:e}){let r=0;for(const s of e){for(let e=1;e<s;e++)t[2*(r+e)]+=t[2*(r+e)-2],t[2*(r+e)+1]+=t[2*(r+e)-1];r+=s}}class d extends h{constructor(t,e,r){super(t),this._featureIndex=-1,this._dateFields=new Set,this._geometryType=r,this._features=e}static fromFeatures(t,e,s){const i=r([],t,e,!1,!1,s);for(let r=0;r<i.length;r++)i[r].displayId=t[r].displayId;return d.fromOptimizedFeatures(i,e)}static fromFeatureSet(t,e){const r=s(t,e);return d.fromOptimizedFeatureSet(r)}static fromOptimizedFeatureSet(t){const{features:e,geometryType:r}=t,s=d.fromOptimizedFeatures(e,r);s._exceededTransferLimit=t.exceededTransferLimit,s._transform=t.transform;for(const i of t.fields)"esriFieldTypeDate"===i.type&&s._dateFields.add(i.name);return s}static fromOptimizedFeatures(t,e,r){const s=h.createInstance(),i=new d(s,t,e);return i._transform=r,i}get _current(){return this._features[this._featureIndex]}get geometryType(){return this._geometryType}get hasFeatures(){return!!this._features.length}get hasNext(){return this._featureIndex+1<this._features.length}get exceededTransferLimit(){return this._exceededTransferLimit}get hasZ(){return!1}get hasM(){return!1}removeIds(t){const e=new Set(t);this._features=this._features.filter((t=>!e.has(t.objectId)))}append(t){for(const e of t)this._features.push(e)}getSize(){return this._features.length}getCursor(){return this.copy()}getQuantizationTransform(){return this._transform}getAttributeHash(){let t="";for(const e in this._current.attributes)t+=this._current.attributes[e];return t}getIndex(){return this._featureIndex}setIndex(t){this._featureIndex=t}getObjectId(){return this._current.objectId}getDisplayId(){return this._current.displayId}setDisplayId(t){this._current.displayId=t}getGroupId(){return this._current.groupId}setGroupId(t){this._current.groupId=t}copy(){const t=new d(this.instance,this._features,this.geometryType);return this.copyInto(t),t}next(){for(;++this._featureIndex<this._features.length&&!this._getExists(););return this._featureIndex<this._features.length}readLegacyFeature(){return i(this._current,this.geometryType,this.hasZ,this.hasM)}readOptimizedFeature(){return this._current}readLegacyPointGeometry(){return this.readGeometry()?{x:this.getX(),y:this.getY()}:null}readLegacyGeometry(){const t=this.readGeometry();return n(t,this.geometryType,this.hasZ,this.hasM)}readLegacyCentroid(){const e=this.readCentroid();return t(e)?null:{x:e.coords[0]*this._sx+this._tx,y:e.coords[1]*this._sy+this._ty}}readGeometryArea(){return u(this._current)?o(this._current.geometry,2):0}readUnquantizedGeometry(){const t=this.readGeometry();if("esriGeometryPoint"===this.geometryType||!t)return t;const e=t.clone();return c(e),e}readHydratedGeometry(){const r=this._current.geometry;if(t(r))return null;const s=r.clone();return e(this._transform)&&a(s,s,this.hasZ,this.hasM,this._transform),s}getXHydrated(){if(!u(this._current))return 0;const e=this._current.geometry.coords[0],r=this.getQuantizationTransform();return t(r)?e:e*r.scale[0]+r.translate[0]}getYHydrated(){if(!u(this._current))return 0;const e=this._current.geometry.coords[1],r=this.getQuantizationTransform();return t(r)?e:r.translate[1]-e*r.scale[1]}getX(){return u(this._current)?this._current.geometry.coords[0]*this._sx+this._tx:0}getY(){return u(this._current)?this._current.geometry.coords[1]*this._sy+this._ty:0}readGeometry(){if(!u(this._current))return null;const t=this._current.geometry.clone();if(t.isPoint)return t.coords[0]=t.coords[0]*this._sx+this._tx,t.coords[1]=t.coords[1]*this._sy+this._ty,t;let e=0;for(const r of t.lengths)t.coords[2*e]=t.coords[2*e]*this._sx+this._tx,t.coords[2*e+1]=t.coords[2*e+1]*this._sy+this._ty,e+=r;return t}readCentroid(){if(!u(this._current))return null;if(t(this._current.centroid)){const e=this._computeCentroid();if(t(e))return null;e.coords[0]=(e.coords[0]-this._tx)/this._sx,e.coords[1]=(e.coords[1]-this._ty)/this._sy,this._current.centroid=e}const e=this._current.centroid.clone();return e.coords[0]=e.coords[0]*this._sx+this._tx,e.coords[1]=e.coords[1]*this._sx+this._ty,e}_readAttribute(t,e){const r=this._current.attributes[t];if(void 0!==r)return null!=r&&e&&this._dateFields.has(t)?new Date(r):r;const s=this.readAttributes(),i=t.toLocaleLowerCase().trim();for(const n in s)if(n.toLocaleLowerCase().trim()===i){const t=this._current.attributes[n];return null!=t&&e&&this._dateFields.has(n)?new Date(t):t}}copyInto(t){super.copyInto(t),t._featureIndex=this._featureIndex,t._transform=this._transform,t._dateFields=this._dateFields}_readAttributes(){return this._current.attributes}}export{d as FeatureSetReaderJSON};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import{HandleOwner as t}from"../../../../core/HandleOwner.js";import i from"../../../../core/Logger.js";import{isSome as s,isNone as r,unwrap as l}from"../../../../core/maybe.js";import{debounce as a,isAbortError as o,eachAlways as n}from"../../../../core/promiseUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import u from"../../../../geometry/Point.js";import p from"../../../../layers/support/PixelBlock.js";import y from"../../../../layers/support/TileInfo.js";import{update as d,unregister as g,register as m,getRasterId as _}from"../../../../layers/support/rasterDatasets/RawBlockCache.js";import{extractBands as f}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{getWorldWidth as w,computeProjectedScales as b}from"../../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import"../../tiling/PagedTileQueue.js";import P from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import C from"../../tiling/TileQueue.js";import I from"../../tiling/TileStrategy.js";import{getWebGL1Capabilities as v}from"../../../webgl/capabilities.js";import V from"../../../../geometry/Extent.js";const R=[0,0],T=i.getLogger("esri.views.2d.layers.ImageryTileLayerView2D");let S=class extends t{constructor(){super(...arguments),this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=null,this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._globalUpdateRequested=!1,this.container=null,this.layer=null,this.redrawOrRefetch=a(((e,t)=>!this.previousLOD||this.layerView.suspended?Promise.resolve():e?this.doRefresh():this._redrawImage(t)))}get useWebGLForProcessing(){var e;return null==(e=this._get("useWebGLForProcessing"))||e}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return null==this._get("useProgressiveUpdate")||this._get("useProgressiveUpdate")}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:i,scale:s}=e.state,r=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){var l;if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const e=this._srcResolutions[r.level],s=t.toJSON?t:V.fromJSON(t);d(this._blockCacheRegistryUrl,this._blockCacheRegistryId,s,i,e,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,(null==(l=this.previousLOD)?void 0:l.level)!==r.level&&(this.previousLOD=r,null==this._symbolizerParams||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,0===this._fetchQueue.length&&this._redrawImage(this._abortController.signal).then((()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()})));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){return this._fetchQueue.length>0||this._globalUpdateRequested||!(!this.updatingHandles||!this.updatingHandles.updating)}attach(){v().supportsTextureFloat||(this.useWebGLForProcessing=!1),this._initializeTileInfo(),this._tileInfoView=new P(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new C({tileInfoView:this._tileInfoView,concurrency:e,process:(e,t)=>this._fetchTile1(e,t)});const t=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}acquireTile(e){const t=this.container.createTile(e);return this._enqueueTileFetch(t),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",(()=>{e.destroy(),this.layerView.requestUpdate()})),this.layerView.requestUpdate()}uninstall(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,this.notifyChange("updating"),g(this._blockCacheRegistryUrl,this._blockCacheRegistryId)}createEmptyTilePixelBlock(e=null){const t=null==e||e.join(",")===this._tileInfoView.tileInfo.size.join(",");if(t&&s(this._emptyTilePixelBlock))return this._emptyTilePixelBlock;e=e||this._tileInfoView.tileInfo.size;const[i,r]=e,l=new p({width:i,height:r,pixels:[new Uint8Array(i*r)],mask:new Uint8Array(i*r),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=l),l}_fetchTile1(e,t){const i=!r(t)&&t.signal,a=this.canUseWebGLForProcessing(),{layerView:o}=this,n=!o.tileInfo.isWrappable&&s(w(o.view.spatialReference)),h={allowPartialFill:!0,datumTransformation:o.datumTransformation,interpolation:a?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:a,signal:l(i),srcResolution:this._srcResolutions[e.level],timeExtent:o.timeExtent,tileInfo:o.tileInfo,disableWrapAround:n};return this.fetchTile(e,h)}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const e=this.layerView.view.spatialReference,t=new u({x:this.layerView.fullExtent.xmin,y:this.layerView.fullExtent.ymax,spatialReference:e}),{scales:i,srcResolutions:s,isCustomTilingScheme:r}=b(this.layer.rasterInfo,e),l=y.create({spatialReference:e,size:512,scales:i});(0===l.origin.x||l.origin.x>t.x)&&(l.origin=t),this._isCustomTilingScheme=r,this.layerView.set("tileInfo",l),this._srcResolutions=null!=s?s:[]}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.rasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);this.notifyChange("updating");const{bandIds:s}=this.layer;let r=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&0===this._fetchQueue.length){r=!1;try{await this._redrawImage(this._abortController&&this._abortController.signal)}catch(i){o(i)&&T.error(i)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&"rasterVF"!==this.type||this.layerView.hasTilingEffects||null!=this._symbolizerParams||this._updateSymbolizerParams();const l=this._tileInfoView.getTileCoords(R,e.key),a=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:t,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:r,bandIds:s,coords:l,resolution:a}),e.once("attach",(()=>this.layerView.requestUpdate())),this.container.addChild(e)}catch(i){o(i)||T.error(i)}this.layerView.requestUpdate()}}async _redrawImage(e){if(0===this.container.children.length)return;await this.updatingHandles.addPromise(this.layer.updateRenderer()),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(e):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const t=this.container.children.map((async e=>this.updateTileSymbolizerParameters(e,{local:this._symbolizerParams,global:this._globalSymbolizerParams})));await n(t),this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const t={srcResolution:this._srcResolutions[this.previousLOD.level],registryId:this._blockCacheRegistryId,signal:e},i=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,t);if(!i||!i.pixelBlock)return;const s=this.layer.symbolizer.generateWebGLParameters({pixelBlock:f(i.pixelBlock,this.layer.bandIds),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:this.previousLOD.resolution,y:this.previousLOD.resolution},bandIds:this.layer.bandIds});!this.canUseWebGLForProcessing()&&s&&"stretch"===s.type&&this.layer.renderer&&"raster-stretch"===this.layer.renderer.type&&(s.factor=s.factor.map((e=>255*e)),s.outMin=Math.round(255*s.outMin),s.outMax=Math.round(255*s.outMax)),this._globalSymbolizerParams=s}_updateSymbolizerParams(){this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:this.previousLOD.resolution,y:this.previousLOD.resolution},bandIds:this.layer.bandIds})}_updateBlockCacheRegistry(e=!1){const{url:t,rasterInfo:i,raster:s}=this.layer,{multidimensionalDefinition:r}=this.layer.normalizeRasterFetchOptions({multidimensionalDefinition:this.layer.multidimensionalDefinition,timeExtent:this.layerView.timeExtent}),l=null!=i&&i.multidimensionalInfo?s.getSliceIndex(r):null,a=_(t,l);if(a!==this._blockCacheRegistryUrl){if(null!=this._blockCacheRegistryUrl&&g(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=m(a,this.layer.raster.rasterInfo),e){const e=this._tileInfoView.getClosestInfoForScale(this.layerView.view.scale),t=this._srcResolutions[e.level];d(a,this._blockCacheRegistryId,this.layerView.view.extent,this.layerView.view.resolution,t,this.layer.raster.ioConfig.sampling)}this._blockCacheRegistryUrl=a}}async doRefresh(){await this.updatingHandles.addPromise(this.layer.updateRenderer()),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset(),this.notifyChange("updating");const e=[];this._tileStrategy.tiles.forEach((t=>e.push(this._enqueueTileFetch(t)))),await n(e)}};e([h()],S.prototype,"_globalUpdateRequested",void 0),e([h()],S.prototype,"container",void 0),e([h()],S.prototype,"layer",void 0),e([h()],S.prototype,"layerView",void 0),e([h()],S.prototype,"type",void 0),e([h()],S.prototype,"useWebGLForProcessing",null),e([h()],S.prototype,"useProgressiveUpdate",null),e([h()],S.prototype,"updating",null),S=e([c("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],S);export{S as BaseImageryTileSubView2D};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import{HandleOwner as t}from"../../../../core/HandleOwner.js";import i from"../../../../core/Logger.js";import{isSome as s,isNone as r,unwrap as l}from"../../../../core/maybe.js";import{debounce as a,isAbortError as o,eachAlways as n}from"../../../../core/promiseUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import u from"../../../../geometry/Point.js";import p from"../../../../layers/support/PixelBlock.js";import y from"../../../../layers/support/TileInfo.js";import{update as d,unregister as g,register as m,getRasterId as _}from"../../../../layers/support/rasterDatasets/RawBlockCache.js";import{extractBands as f}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{getWorldWidth as w,computeProjectedScales as b}from"../../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import"../../tiling/PagedTileQueue.js";import P from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import C from"../../tiling/TileQueue.js";import I from"../../tiling/TileStrategy.js";import{getWebGL1Capabilities as v}from"../../../webgl/capabilities.js";import V from"../../../../geometry/Extent.js";const R=[0,0],T=i.getLogger("esri.views.2d.layers.ImageryTileLayerView2D");let S=class extends t{constructor(){super(...arguments),this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=null,this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._globalUpdateRequested=!1,this.attached=!1,this.container=null,this.layer=null,this.redrawOrRefetch=a(((e,t)=>!this.previousLOD||this.layerView.suspended?Promise.resolve():e?this.doRefresh():this._redrawImage(t)))}get useWebGLForProcessing(){var e;return null==(e=this._get("useWebGLForProcessing"))||e}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return null==this._get("useProgressiveUpdate")||this._get("useProgressiveUpdate")}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:i,scale:s}=e.state,r=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){var l;if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const e=this._srcResolutions[r.level],s=t.toJSON?t:V.fromJSON(t);d(this._blockCacheRegistryUrl,this._blockCacheRegistryId,s,i,e,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,(null==(l=this.previousLOD)?void 0:l.level)!==r.level&&(this.previousLOD=r,null==this._symbolizerParams||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,0===this._fetchQueue.length&&this._redrawImage(this._abortController.signal).then((()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()})));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){return this._fetchQueue.length>0||this._globalUpdateRequested||!(!this.updatingHandles||!this.updatingHandles.updating)}attach(){v().supportsTextureFloat||(this.useWebGLForProcessing=!1),this._initializeTileInfo(),this._tileInfoView=new P(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new C({tileInfoView:this._tileInfoView,concurrency:e,process:(e,t)=>this._fetchTile1(e,t)});const t=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,this.notifyChange("updating"),g(this._blockCacheRegistryUrl,this._blockCacheRegistryId)}acquireTile(e){const t=this.container.createTile(e);return this._enqueueTileFetch(t),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",(()=>{e.destroy(),this.layerView.requestUpdate()})),this.layerView.requestUpdate()}createEmptyTilePixelBlock(e=null){const t=null==e||e.join(",")===this._tileInfoView.tileInfo.size.join(",");if(t&&s(this._emptyTilePixelBlock))return this._emptyTilePixelBlock;e=e||this._tileInfoView.tileInfo.size;const[i,r]=e,l=new p({width:i,height:r,pixels:[new Uint8Array(i*r)],mask:new Uint8Array(i*r),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=l),l}_fetchTile1(e,t){const i=!r(t)&&t.signal,a=this.canUseWebGLForProcessing(),{layerView:o}=this,n=!o.tileInfo.isWrappable&&s(w(o.view.spatialReference)),h={allowPartialFill:!0,datumTransformation:o.datumTransformation,interpolation:a?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:a,signal:l(i),srcResolution:this._srcResolutions[e.level],timeExtent:o.timeExtent,tileInfo:o.tileInfo,disableWrapAround:n};return this.fetchTile(e,h)}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const e=this.layerView.view.spatialReference,t=new u({x:this.layerView.fullExtent.xmin,y:this.layerView.fullExtent.ymax,spatialReference:e}),{scales:i,srcResolutions:s,isCustomTilingScheme:r}=b(this.layer.rasterInfo,e),l=y.create({spatialReference:e,size:512,scales:i});(0===l.origin.x||l.origin.x>t.x)&&(l.origin=t),this._isCustomTilingScheme=r,this.layerView.set("tileInfo",l),this._srcResolutions=null!=s?s:[]}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.rasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);this.notifyChange("updating");const{bandIds:s}=this.layer;let r=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&0===this._fetchQueue.length){r=!1;try{await this._redrawImage(this._abortController&&this._abortController.signal)}catch(i){o(i)&&T.error(i)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&"rasterVF"!==this.type||this.layerView.hasTilingEffects||null!=this._symbolizerParams||this._updateSymbolizerParams();const l=this._tileInfoView.getTileCoords(R,e.key),a=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:t,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:r,bandIds:s,coords:l,resolution:a}),e.once("attach",(()=>this.layerView.requestUpdate())),this.container.addChild(e)}catch(i){o(i)||T.error(i)}this.layerView.requestUpdate()}}async _redrawImage(e){if(0===this.container.children.length)return;await this.updatingHandles.addPromise(this.layer.updateRenderer()),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(e):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const t=this.container.children.map((async e=>this.updateTileSymbolizerParameters(e,{local:this._symbolizerParams,global:this._globalSymbolizerParams})));await n(t),this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const t={srcResolution:this._srcResolutions[this.previousLOD.level],registryId:this._blockCacheRegistryId,signal:e},i=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,t);if(!i||!i.pixelBlock)return;const s=this.layer.symbolizer.generateWebGLParameters({pixelBlock:f(i.pixelBlock,this.layer.bandIds),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:this.previousLOD.resolution,y:this.previousLOD.resolution},bandIds:this.layer.bandIds});!this.canUseWebGLForProcessing()&&s&&"stretch"===s.type&&this.layer.renderer&&"raster-stretch"===this.layer.renderer.type&&(s.factor=s.factor.map((e=>255*e)),s.outMin=Math.round(255*s.outMin),s.outMax=Math.round(255*s.outMax)),this._globalSymbolizerParams=s}_updateSymbolizerParams(){this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:this.previousLOD.resolution,y:this.previousLOD.resolution},bandIds:this.layer.bandIds})}_updateBlockCacheRegistry(e=!1){const{url:t,rasterInfo:i,raster:s}=this.layer,{multidimensionalDefinition:r}=this.layer.normalizeRasterFetchOptions({multidimensionalDefinition:this.layer.multidimensionalDefinition,timeExtent:this.layerView.timeExtent}),l=null!=i&&i.multidimensionalInfo?s.getSliceIndex(r):null,a=_(t,l);if(a!==this._blockCacheRegistryUrl){if(null!=this._blockCacheRegistryUrl&&g(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=m(a,this.layer.raster.rasterInfo),e){const e=this._tileInfoView.getClosestInfoForScale(this.layerView.view.scale),t=this._srcResolutions[e.level];d(a,this._blockCacheRegistryId,this.layerView.view.extent,this.layerView.view.resolution,t,this.layer.raster.ioConfig.sampling)}this._blockCacheRegistryUrl=a}}async doRefresh(){await this.updatingHandles.addPromise(this.layer.updateRenderer()),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset(),this.notifyChange("updating");const e=[];this._tileStrategy.tiles.forEach((t=>e.push(this._enqueueTileFetch(t)))),await n(e)}};e([h()],S.prototype,"_globalUpdateRequested",void 0),e([h()],S.prototype,"attached",void 0),e([h()],S.prototype,"container",void 0),e([h()],S.prototype,"layer",void 0),e([h()],S.prototype,"layerView",void 0),e([h()],S.prototype,"type",void 0),e([h()],S.prototype,"useWebGLForProcessing",null),e([h()],S.prototype,"useProgressiveUpdate",null),e([h()],S.prototype,"updating",null),S=e([c("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],S);export{S as BaseImageryTileSubView2D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{isSome as r}from"../../../../core/maybe.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{RasterTileContainer as i}from"../../engine/RasterTileContainer.js";import{BaseImageryTileSubView2D as o}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as l}from"../support/util.js";let n=class extends o{constructor(){super(...arguments),this.container=null,this.layer=null,this.type="raster"}canUseWebGLForProcessing(){return this.useWebGLForProcessing&&this.layer.symbolizer.canRenderInWebGL&&!("majority"===this.layer.interpolation&&l(this.layer))}fetchTile(e,r){return this.layer.fetchTile(e.level,e.row,e.col,r)}async updateTileSource(e,t){const{bandIds:s}=this.layer,i=this._getLayerInterpolation(),o=this.canUseWebGLForProcessing(),{source:l,symbolizerParams:n,globalSymbolizerParams:a,suspended:c,coords:p,resolution:u}=t,{bitmap:d}=e;if([d.x,d.y]=p,d.resolution=u,l&&r(l)&&r(l.pixelBlock)){const e={extent:l.extent,pixelBlock:l.pixelBlock};if(d.rawPixelData=e,o)d.source=l.pixelBlock,d.isRendereredSource=!1;else{const r=await this.layer.applyRenderer(e,"stretch"===(null==a?void 0:a.type)?a:null);d.source=r,d.isRendereredSource=!0}d.symbolizerParameters=o?n:null,o?d.transformGrid||(d.transformGrid=l.transformGrid):d.transformGrid=null}else{const e=this.createEmptyTilePixelBlock();d.source=e,d.symbolizerParameters=o?n:null,d.transformGrid=null}d.bandIds=o?s:null,d.width=this._tileInfoView.tileInfo.size[0],d.height=this._tileInfoView.tileInfo.size[1],d.interpolation=i,d.suspended=c,d.invalidateTexture()}async updateTileSymbolizerParameters(e,t){const{local:s,global:i}=t,{bandIds:o}=this.layer,l=this._getLayerInterpolation(),n=this.canUseWebGLForProcessing(),{bitmap:a}=e,{rawPixelData:c}=a;!n&&r(c)?(a.source=await this.layer.applyRenderer(c,"stretch"===(null==i?void 0:i.type)?i:null),a.isRendereredSource=!0):(a.isRendereredSource&&r(c)&&(a.source=c.pixelBlock),a.isRendereredSource=!1),a.symbolizerParameters=n?i||s:null,a.bandIds=n?o:null,a.interpolation=l,a.suspended=!1}install(e){this.container=new i(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,e.addChild(this.container)}uninstall(){this.container.removeAllChildren(),this.container.remove(),super.uninstall()}_getLayerInterpolation(){const e=this.layer.renderer.type;if("raster-colormap"===e||"unique-value"===e||"class-breaks"===e)return"nearest";const{interpolation:r}=this.layer,{renderer:t}=this.layer;return"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===r||"cubic"===r?"bilinear":"nearest":r}};e([t()],n.prototype,"container",void 0),e([t()],n.prototype,"layer",void 0),e([t()],n.prototype,"type",void 0),n=e([s("esri.views.2d.layers.imagery.ImageryTileView2D")],n);const a=n;export{a as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{isSome as r}from"../../../../core/maybe.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{RasterTileContainer as i}from"../../engine/RasterTileContainer.js";import{BaseImageryTileSubView2D as o}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as l}from"../support/util.js";let a=class extends o{constructor(){super(...arguments),this.container=null,this.layer=null,this.type="raster"}attach(){super.attach(),this.container=new i(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}canUseWebGLForProcessing(){return this.useWebGLForProcessing&&this.layer.symbolizer.canRenderInWebGL&&!("majority"===this.layer.interpolation&&l(this.layer))}fetchTile(e,r){return this.layer.fetchTile(e.level,e.row,e.col,r)}async updateTileSource(e,t){const{bandIds:s}=this.layer,i=this._getLayerInterpolation(),o=this.canUseWebGLForProcessing(),{source:l,symbolizerParams:a,globalSymbolizerParams:n,suspended:c,coords:p,resolution:u}=t,{bitmap:d}=e;if([d.x,d.y]=p,d.resolution=u,l&&r(l)&&r(l.pixelBlock)){const e={extent:l.extent,pixelBlock:l.pixelBlock};if(d.rawPixelData=e,o)d.source=l.pixelBlock,d.isRendereredSource=!1;else{const r=await this.layer.applyRenderer(e,"stretch"===(null==n?void 0:n.type)?n:null);d.source=r,d.isRendereredSource=!0}d.symbolizerParameters=o?a:null,o?d.transformGrid||(d.transformGrid=l.transformGrid):d.transformGrid=null}else{const e=this.createEmptyTilePixelBlock();d.source=e,d.symbolizerParameters=o?a:null,d.transformGrid=null}d.bandIds=o?s:null,d.width=this._tileInfoView.tileInfo.size[0],d.height=this._tileInfoView.tileInfo.size[1],d.interpolation=i,d.suspended=c,d.invalidateTexture()}async updateTileSymbolizerParameters(e,t){const{local:s,global:i}=t,{bandIds:o}=this.layer,l=this._getLayerInterpolation(),a=this.canUseWebGLForProcessing(),{bitmap:n}=e,{rawPixelData:c}=n;!a&&r(c)?(n.source=await this.layer.applyRenderer(c,"stretch"===(null==i?void 0:i.type)?i:null),n.isRendereredSource=!0):(n.isRendereredSource&&r(c)&&(n.source=c.pixelBlock),n.isRendereredSource=!1),n.symbolizerParameters=a?i||s:null,n.bandIds=a?o:null,n.interpolation=l,n.suspended=!1}_getLayerInterpolation(){const e=this.layer.renderer.type;if("raster-colormap"===e||"unique-value"===e||"class-breaks"===e)return"nearest";const{interpolation:r}=this.layer,{renderer:t}=this.layer;return"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===r||"cubic"===r?"bilinear":"nearest":r}};e([t()],a.prototype,"container",void 0),e([t()],a.prototype,"layer",void 0),e([t()],a.prototype,"type",void 0),a=e([s("esri.views.2d.layers.imagery.ImageryTileView2D")],a);const n=a;export{n as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
+ */
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import r from"../../../../core/Logger.js";import{isNone as i}from"../../../../core/maybe.js";import{debounce as s,isAbortError as o}from"../../../../core/promiseUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import l from"../../../../geometry/Extent.js";import{RasterVFDisplayObject as c}from"../../engine/RasterVFDisplayObject.js";const p=r.getLogger("esri.views.2d.layers.imagery.VectorFieldView2D");let m=class extends t{constructor(e){super(e),this.update=s(((e,t)=>this._update(e,t).catch((e=>{o(e)||p.error(e)}))))}get updating(){return!!this._loading}redraw(e){if(!this.container.children.length)return;const t=this.container.children[0];t.symbolizerParameters=e,t.invalidateVAO(),this.container.symbolTypes="wind_speed"===e.style?["scalar","triangle"]:"simple_scalar"===e.style?["scalar"]:["triangle"],this.container.requestRender()}async _update(e,t,r){if(!e.stationary)return;const{extent:i,spatialReference:s}=e.state,o=new l({xmin:i.xmin,ymin:i.ymin,xmax:i.xmax,ymax:i.ymax,spatialReference:s}),[a,n]=e.state.size;this._loading=this.fetchPixels(o,a,n,r);const c=await this._loading;this._addToDisplay(c,t,e.state),this._loading=null}_addToDisplay(e,t,r){if(i(e.pixelBlock))return this.container.children.forEach((e=>e.destroy())),void this.container.removeAllChildren();const{extent:s,pixelBlock:o}=e,a=new c(o);a.offset=[0,0],a.symbolizerParameters=t,a.rawPixelData=e,a.invalidateVAO(),a.x=s.xmin,a.y=s.ymax,a.pixelRatio=r.pixelRatio,a.rotation=r.rotation,a.resolution=r.resolution,a.width=o.width*t.symbolTileSize,a.height=o.height*t.symbolTileSize,this.container.children.forEach((e=>e.destroy())),this.container.removeAllChildren(),this.container.symbolTypes="wind_speed"===t.style?["scalar","triangle"]:"simple_scalar"===t.style?["scalar"]:["triangle"],this.container.addChild(a)}};e([a()],m.prototype,"fetchPixels",void 0),e([a()],m.prototype,"container",void 0),e([a()],m.prototype,"_loading",void 0),e([a()],m.prototype,"updating",null),m=e([n("esri.views.2d.layers.imagery.ImageryVFStrategy")],m);const d=m;export{d as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import r from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{isSome as s}from"../../../../core/maybe.js";import{isAbortError as o}from"../../../../core/promiseUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{enumeration as n}from"../../../../core/accessorSupport/decorators/enumeration.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{mosaicPixelData as l}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{BitmapContainer as c}from"../../engine/BitmapContainer.js";import{Container as h}from"../../engine/Container.js";import m from"../../engine/ImageryBitmapSource.js";import d from"../support/ExportStrategy.js";const u=i.getLogger("esri.views.2d.layers.imagery.ImageryView2D");let y=class extends r{constructor(){super(...arguments),this.attached=!1,this.container=new h,this.updateRequested=!1,this.type="Imagery",this._bitmapView=null}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(e){this.strategy.update(e).catch((e=>{o(e)||u.error(e)}))}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren()}hitTest(e){return new t({attributes:{},geometry:e.clone(),layer:this.layer})}attach(){const e=this.layer.version>=10,t=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,r=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this._bitmapView=new c,this.strategy=new d({container:this._bitmapView,imageNormalizationSupported:e,imageMaxHeight:t,imageMaxWidth:r,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()}),this.attached=!0}install(e){this.container.addChild(this._bitmapView),e.addChild(this.container)}uninstall(e){this.container.removeChild(this._bitmapView),e.removeChild(this.container)}redraw(){this.strategy.updateExports((e=>{e.source instanceof HTMLImageElement?e.requestRender():this.layer.applyRenderer({pixelBlock:e.source.pixelBlock}).then((t=>{const r=e.source;r.pixelBlock=t.pixelBlock,r.filter=e=>this.layer.applyFilter(e),this.container.requestRender()}))}))}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const e=this.strategy.bitmaps;if(1===e.length&&e[0].source)return{extent:e[0].source.extent,pixelBlock:e[0].source.originalPixelBlock};if(e.length>1){const t=this.view.extent,r=e.map((e=>e.source)).filter((e=>e.extent&&e.extent.intersects(t))).map((e=>({extent:e.extent,pixelBlock:e.originalPixelBlock}))),i=l(r,t);return s(i)?{extent:i.extent,pixelBlock:i.pixelBlock}:null}return null}_fetchImage(e,t,r,i){return(i=i||{}).timeExtent=this.timeExtent,i.requestAsImageElement=!0,this.layer.fetchImage(e,t,r,i).then((e=>e.imageElement?e.imageElement:this.layer.applyRenderer(e.pixelData,{signal:i.signal}).then((t=>{const r=new m(t.pixelBlock,t.extent.clone(),e.pixelData.pixelBlock);return r.filter=e=>this.layer.applyFilter(e),r}))))}};e([a()],y.prototype,"attached",void 0),e([a()],y.prototype,"container",void 0),e([a()],y.prototype,"layer",void 0),e([a()],y.prototype,"strategy",void 0),e([a()],y.prototype,"timeExtent",void 0),e([a()],y.prototype,"view",void 0),e([a()],y.prototype,"updateRequested",void 0),e([a()],y.prototype,"updating",null),e([n({imagery:"Imagery"})],y.prototype,"type",void 0),y=e([p("esri.views.2d.layers.imagery.ImageryView2D")],y);const g=y;export{g as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import r from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{isSome as s}from"../../../../core/maybe.js";import{isAbortError as o}from"../../../../core/promiseUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{enumeration as p}from"../../../../core/accessorSupport/decorators/enumeration.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{mosaicPixelData as l}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{BitmapContainer as c}from"../../engine/BitmapContainer.js";import{Container as m}from"../../engine/Container.js";import h from"../../engine/ImageryBitmapSource.js";import u from"../support/ExportStrategy.js";const d=i.getLogger("esri.views.2d.layers.imagery.ImageryView2D");let y=class extends r{constructor(){super(...arguments),this.attached=!1,this.container=new m,this.updateRequested=!1,this.type="Imagery",this._bitmapView=new c}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(e){this.strategy.update(e).catch((e=>{o(e)||d.error(e)}))}hitTest(e){return new t({attributes:{},geometry:e.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const e=this.layer.version>=10,t=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,r=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new u({container:this._bitmapView,imageNormalizationSupported:e,imageMaxHeight:t,imageMaxWidth:r,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren()}redraw(){this.strategy.updateExports((e=>{e.source instanceof HTMLImageElement?e.requestRender():this.layer.applyRenderer({pixelBlock:e.source.pixelBlock}).then((t=>{const r=e.source;r.pixelBlock=t.pixelBlock,r.filter=e=>this.layer.applyFilter(e),this.container.requestRender()}))}))}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const e=this.strategy.bitmaps;if(1===e.length&&e[0].source)return{extent:e[0].source.extent,pixelBlock:e[0].source.originalPixelBlock};if(e.length>1){const t=this.view.extent,r=e.map((e=>e.source)).filter((e=>e.extent&&e.extent.intersects(t))).map((e=>({extent:e.extent,pixelBlock:e.originalPixelBlock}))),i=l(r,t);return s(i)?{extent:i.extent,pixelBlock:i.pixelBlock}:null}return null}_fetchImage(e,t,r,i){return(i=i||{}).timeExtent=this.timeExtent,i.requestAsImageElement=!0,this.layer.fetchImage(e,t,r,i).then((e=>e.imageElement?e.imageElement:this.layer.applyRenderer(e.pixelData,{signal:i.signal}).then((t=>{const r=new h(t.pixelBlock,t.extent.clone(),e.pixelData.pixelBlock);return r.filter=e=>this.layer.applyFilter(e),r}))))}};e([a()],y.prototype,"attached",void 0),e([a()],y.prototype,"container",void 0),e([a()],y.prototype,"layer",void 0),e([a()],y.prototype,"strategy",void 0),e([a()],y.prototype,"timeExtent",void 0),e([a()],y.prototype,"view",void 0),e([a()],y.prototype,"updateRequested",void 0),e([a()],y.prototype,"updating",null),e([p({imagery:"Imagery"})],y.prototype,"type",void 0),y=e([n("esri.views.2d.layers.imagery.ImageryView2D")],y);const g=y;export{g as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{isSome as t}from"../../../../core/maybe.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{sampleVectorField as s}from"../../../../layers/support/rasterFunctions/vectorFieldUtils.js";import{RasterVFTileContainer as o}from"../../engine/RasterVFTileContainer.js";import{BaseImageryTileSubView2D as l}from"./BaseImageryTileSubView2D.js";let a=class extends l{constructor(){super(...arguments),this._handle=null,this.container=null,this.layer=null,this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(e,t){const i=await this.layer.fetchTile(e.level,e.row,e.col,t);return"vector-magdir"===this.layer.rasterInfo.dataType&&null!=i&&i.pixelBlock&&(i.pixelBlock=await this.layer.convertVectorFieldData(i.pixelBlock,t)),i}updateTileSource(e,i){const r=i.symbolizerParams,{tileData:s}=e;s.key=e.key,s.width=this._tileInfoView.tileInfo.size[0],s.height=this._tileInfoView.tileInfo.size[1];const{symbolTileSize:o}=r,{source:l}=i;if(s.offset=this._getTileSymbolOffset(s.key,o),t(l)&&t(l.pixelBlock)){const e={extent:l.extent,pixelBlock:l.pixelBlock};s.rawPixelData=e,s.source=this._sampleVectorFieldData(l.pixelBlock,r,s.offset),s.symbolizerParameters=r}else{const e=[Math.round((this._tileInfoView.tileInfo[0]-s.offset[0])/o),Math.round((this._tileInfoView.tileInfo[1]-s.offset[1])/o)],t=this.createEmptyTilePixelBlock(e);s.source=t,s.symbolizerParameters=r}return s.invalidateVAO(),Promise.resolve(null)}updateTileSymbolizerParameters(e,i){var r;const s=i.local,{symbolTileSize:o}=s,{tileData:l}=e;l.offset=this._getTileSymbolOffset(l.key,o);const a=l.symbolizerParameters.symbolTileSize;return l.symbolizerParameters=s,t(null==(r=l.rawPixelData)?void 0:r.pixelBlock)&&a!==o&&(l.source=this._sampleVectorFieldData(l.rawPixelData.pixelBlock,l.symbolizerParameters,l.offset)),Promise.resolve(null)}install(e){this.container=new o(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this._updateSymbolType(this.layer.renderer),this._handle=this.layer.watch("renderer",(e=>this._updateSymbolType(e))),e.addChild(this.container)}uninstall(){this.container.removeAllChildren(),this._handle.remove(),this._handle=null,this.container.remove(),super.uninstall()}_getTileSymbolOffset(e,t){const i=e.col*this._tileInfoView.tileInfo.size[0]%t,r=e.row*this._tileInfoView.tileInfo.size[1]%t;return[i>t/2?t-i:-i,r>t/2?t-r:-r]}_sampleVectorFieldData(e,t,i){const{symbolTileSize:r}=t;return s(e,"vector-uv",r,i)}_updateSymbolType(e){"vector-field"===e.type&&(this.container.symbolTypes="wind-barb"===e.style?["scalar","triangle"]:"simple-scalar"===e.style?["scalar"]:["triangle"])}};e([i()],a.prototype,"container",void 0),e([i()],a.prototype,"layer",void 0),e([i()],a.prototype,"type",void 0),a=e([r("esri.views.2d.layers.imagery.VectorFieldTileView2D")],a);const n=a;export{n as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{isSome as t}from"../../../../core/maybe.js";import{watch as i}from"../../../../core/reactiveUtils.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{sampleVectorField as s}from"../../../../layers/support/rasterFunctions/vectorFieldUtils.js";import{RasterVFTileContainer as l}from"../../engine/RasterVFTileContainer.js";import{BaseImageryTileSubView2D as a}from"./BaseImageryTileSubView2D.js";let n=class extends a{constructor(){super(...arguments),this._handle=null,this.container=null,this.layer=null,this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(e,t){const i=await this.layer.fetchTile(e.level,e.row,e.col,t);return"vector-magdir"===this.layer.rasterInfo.dataType&&null!=i&&i.pixelBlock&&(i.pixelBlock=await this.layer.convertVectorFieldData(i.pixelBlock,t)),i}updateTileSource(e,i){const r=i.symbolizerParams,{tileData:o}=e;o.key=e.key,o.width=this._tileInfoView.tileInfo.size[0],o.height=this._tileInfoView.tileInfo.size[1];const{symbolTileSize:s}=r,{source:l}=i;if(o.offset=this._getTileSymbolOffset(o.key,s),t(l)&&t(l.pixelBlock)){const e={extent:l.extent,pixelBlock:l.pixelBlock};o.rawPixelData=e,o.source=this._sampleVectorFieldData(l.pixelBlock,r,o.offset),o.symbolizerParameters=r}else{const e=[Math.round((this._tileInfoView.tileInfo[0]-o.offset[0])/s),Math.round((this._tileInfoView.tileInfo[1]-o.offset[1])/s)],t=this.createEmptyTilePixelBlock(e);o.source=t,o.symbolizerParameters=r}return o.invalidateVAO(),Promise.resolve(null)}updateTileSymbolizerParameters(e,i){var r;const o=i.local,{symbolTileSize:s}=o,{tileData:l}=e;l.offset=this._getTileSymbolOffset(l.key,s);const a=l.symbolizerParameters.symbolTileSize;return l.symbolizerParameters=o,t(null==(r=l.rawPixelData)?void 0:r.pixelBlock)&&a!==s&&(l.source=this._sampleVectorFieldData(l.rawPixelData.pixelBlock,l.symbolizerParameters,l.offset)),Promise.resolve(null)}attach(){super.attach(),this.container=new l(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this._updateSymbolType(this.layer.renderer),this._handle=i((()=>this.layer.renderer),(e=>this._updateSymbolType(e)))}detach(){super.detach(),this.container.removeAllChildren(),this._handle.remove(),this._handle=null}_getTileSymbolOffset(e,t){const i=e.col*this._tileInfoView.tileInfo.size[0]%t,r=e.row*this._tileInfoView.tileInfo.size[1]%t;return[i>t/2?t-i:-i,r>t/2?t-r:-r]}_sampleVectorFieldData(e,t,i){const{symbolTileSize:r}=t;return s(e,"vector-uv",r,i)}_updateSymbolType(e){"vector-field"===e.type&&(this.container.symbolTypes="wind-barb"===e.style?["scalar","triangle"]:"simple-scalar"===e.style?["scalar"]:["triangle"])}};e([r()],n.prototype,"container",void 0),e([r()],n.prototype,"layer",void 0),e([r()],n.prototype,"type",void 0),n=e([o("esri.views.2d.layers.imagery.VectorFieldTileView2D")],n);const c=n;export{c as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
+ */
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import r from"../../../../request.js";import{HandleOwner as i}from"../../../../core/HandleOwner.js";import{isSome as s,isNone as a,unwrap as o}from"../../../../core/maybe.js";import{watch as n,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import p from"../../../../geometry/Extent.js";import{projectExtent as h}from"../../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{snapImageToSymbolTile as y,convertVectorFieldData as u}from"../../../../layers/support/rasterFunctions/vectorFieldUtils.js";import{RasterVFContainer as d}from"../../engine/RasterVFContainer.js";import x from"./ImageryVFStrategy.js";let f=class extends i{constructor(){super(...arguments),this.attached=!1,this.container=new d,this.type="ImageryVF",this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""},this._fetchpixels=async(e,t,r,i)=>{const n=await this._projectFullExtentPromise,{symbolTileSize:l}=this.layer.renderer,{extent:c,width:m,height:p}=y(e,t,r,l,n);if(s(n)&&!n.intersects(e))return{extent:c,pixelBlock:null};const h={bbox:`${c.xmin}, ${c.ymin}, ${c.xmax}, ${c.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:l,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(h)){const e=this.getPixelData();if(s(e)){if(`${e.extent.xmin}, ${e.extent.ymin}, ${e.extent.xmax}, ${e.extent.ymax}`===h.bbox)return e}}const{pixelData:d}=await this.layer.fetchImage(c,m,p,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:i});if(this._dataParameters=h,a(d.pixelBlock))return{extent:c,pixelBlock:null};return{extent:c,pixelBlock:"vector-uv"===this.layer.rasterInfo.dataType?o(u(d.pixelBlock,"vector-uv")):d.pixelBlock}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference),this._strategy=new x({container:this.container,fetchPixels:this._fetchpixels}),this.handles.add(n((()=>this.layer.renderer),(e=>this._updateSymbolizerParams(e)),l),"vector-field-view-update")}detach(){this._strategy.destroy(),this.container.children.forEach((e=>e.destroy())),this.container.removeAllChildren(),this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){if(this.updating||!this.container.children.length)return null;const{extent:e,pixelBlock:t}=this.container.children[0].rawPixelData;return{extent:e,pixelBlock:t}}hitTest(e){return new t({attributes:{},geometry:e.clone(),layer:this.layer})}update(e){this._strategy.update(e,this._symbolizerParams)}redraw(){this._updateSymbolizerParams(this.layer.renderer),this._strategy.redraw(this._symbolizerParams)}_canReuseVectorFieldData(e){const t=this._dataParameters.exportParametersVersion===e.exportParametersVersion,r=this._dataParameters.time===e.time,i=this._dataParameters.symbolTileSize===e.symbolTileSize,s=this._dataParameters.bbox===e.bbox;return t&&r&&i&&s}async _getProjectedFullExtent(e){try{return await h(this.layer.fullExtent,e)}catch(t){try{const t=(await r(this.layer.url,{query:{option:"footprints",outSR:e.wkid||JSON.stringify(e.toJSON()),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return t?p.fromJSON(t):null}catch{return null}}}_updateSymbolizerParams(e){"vector-field"===e.type&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};e([c()],f.prototype,"attached",void 0),e([c()],f.prototype,"container",void 0),e([c()],f.prototype,"layer",void 0),e([c()],f.prototype,"timeExtent",void 0),e([c()],f.prototype,"type",void 0),e([c()],f.prototype,"view",void 0),e([c()],f.prototype,"updating",null),f=e([m("esri.views.2d.layers.imagery.VectorFieldView2D")],f);const g=f;export{g as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Handles.js";import{lerp as t,smoothstep as i}from"../../../core/mathUtils.js";import{releaseMaybe as s,disposeMaybe as a,destroyMaybe as r,isSome as h,isNone as n,unwrapOr as o}from"../../../core/maybe.js";import{on as d}from"../../../core/watchUtils.js";import{a as _}from"../../../chunks/mat4.js";import{c as m}from"../../../chunks/mat4f64.js";import{s as c}from"../../../chunks/vec2.js";import{a as u}from"../../../chunks/vec2f64.js";import{s as l,l as p,g as f}from"../../../chunks/vec3.js";import{c as v}from"../../../chunks/vec3f64.js";import{c as g,f as b}from"../../../chunks/vec4f64.js";import{earth as T}from"../../../geometry/support/Ellipsoid.js";import{rayLeighScaleHeight as w,atmosphereHeight as R,betaRayleigh as H,betaOzone as j,betaMie as x,innerAtmosphereDepth as q,computeInnerAltitudeFade as E}from"./atmosphereUtils.js";import{ChapmanAtmosphereTechniqueConfiguration as U,ChapmanAtmosphereTechnique as z}from"./ChapmanAtmosphereTechnique.js";import{Pos2Tex as B}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{createQuadVAO as F}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as P}from"../../webgl/enums.js";class y{constructor(e){this._view=e,this.type="realistic",this.canRender=!0,this._cameraPosition=v(),this._projectionInverse=m(),this._viewInverse=m(),this._heightParameters=g(),this._betasRayleigh=v(),this._betasCombined=v(),this._scaleHeight=0,this._radii=u(),this._nearFar=u(),this._cameraHeight=0,this._cameraHeightSq=0,this._cAtmosphere=0,this._innerFadeDistance=0,this._altitudeFade=0,this._lowerElevationBoundRadius=0,this._lowerBoundEarthRadius=T.radius,this._hazeStrength=1,this._darkenHaze=!1,this._updateRadius(T.radius)}destroy(){this._atmosphereTechnique=s(this._atmosphereTechnique),this._atmosphereHazeTechnique=s(this._atmosphereHazeTechnique),this._vao=a(this._vao),this._handles=r(this._handles)}when(){return Promise.resolve()}initializeRenderContext(t){const i=t.renderContext.rctx;this._handles=new e,h(this._view.basemapTerrain.rootTiles)&&this._updateElevation({spatialReference:this._view.basemapTerrain.spatialReference,tile:this._view.basemapTerrain.rootTiles[0],extent:this._view.basemapTerrain.rootTiles[0].extent,context:"ground"}),this._handles.add(d(this._view,"basemapTerrain","elevation-change",(e=>this._updateElevation(e)),(()=>this._updateElevation()))),this._handles.add(d(this._view,"basemapTerrain","elevation-bounds-change",(()=>this._updateVisibleElevationBounds())));const s=new U;s.haze=!1,this._atmosphereTechnique=t.shaderTechniqueRep.acquire(z,s),s.haze=!0,this._atmosphereHazeTechnique=t.shaderTechniqueRep.acquire(z,s),this._vao=F(i,B),this._scaleHeight=w*R,l(this._betasRayleigh,H[0],H[1],H[2]),l(this._betasCombined,H[0]+j[0],H[1]+j[1],H[2]+j[2])}render(e){this._render(e,this._atmosphereTechnique,e.offscreenRenderingHelper.depthTexture)}renderHaze(e,t){this._darkenHaze=t,this._render(e,this._atmosphereHazeTechnique,e.offscreenRenderingHelper.linearDepthTexture)}_render(e,t,i){this._update(e.camera);const s=e.rctx,a=e.offscreenRenderingHelper;s.useProgram(t.program),t.bindPipelineState(s),a.renderDepthDetached((()=>{t.program.bindTexture(i,"depthTex"),this._renderCommon(t.program,e)}))}_renderCommon(e,t){if(n(this._vao))return;const i=t.rctx;t.scenelightingData.setLightDirectionUniform(e),e.setUniform4fv("heightParameters",this._heightParameters),e.setUniform3fv("cameraPosition",this._cameraPosition),e.setUniformMatrix4fv("inverseProjectionMatrix",this._projectionInverse),e.setUniformMatrix4fv("inverseViewMatrix",this._viewInverse),e.setUniform2fv("nearFar",this._nearFar),e.setUniform2fv("radii",this._radii),e.setUniform1f("scaleHeight",this._scaleHeight),e.setUniform1f("betaMie",x),e.setUniform3fv("betaRayleigh",this._betasRayleigh),e.setUniform3fv("betaCombined",this._betasCombined),e.setUniform1f("innerFadeDistance",this._innerFadeDistance),e.setUniform1f("altitudeFade",this._altitudeFade),e.setUniform1f("hazeStrength",this._hazeStrength),i.bindVAO(this._vao),e.assertCompatibleVertexAttributeLocations(this._vao),i.drawArrays(P.TRIANGLE_STRIP,0,4)}_adjustRadiusForTesselation(e){return e*Math.cos(Math.PI/16/16)}_updateElevation(e){const t=e?e.tile:o(this._view.basemapTerrain.rootTiles,[null])[0];if(n(t)||0!==t.level)return;const i=this._adjustRadiusForTesselation(T.radius+t.elevationBounds[0]);i!==this._lowerElevationBoundRadius&&(this._lowerElevationBoundRadius=i,this._lowerBoundEarthRadius=-1,this._updateVisibleElevationBounds())}_updateVisibleElevationBounds(){const e=this._adjustRadiusForTesselation(T.radius+this._view.basemapTerrain.elevationBounds.min);(this._lowerBoundEarthRadius<0||e<this._lowerBoundEarthRadius)&&this._updateRadius(e)}_updateRadius(e){this._lowerBoundEarthRadius=e,c(this._radii,e,e+R),this._innerFadeDistance=2*Math.sqrt((2*e-q)*q)}_update(e){if(n(e))return;this._cameraHeight=p(e.eye),this._cameraHeightSq=this._cameraHeight*this._cameraHeight,this._cAtmosphere=this._cameraHeightSq-this._radii[1]*this._radii[1];const s=Math.min(1,Math.max(0,(this._cameraHeight-this._radii[0])/R));this._heightParameters=b(this._cameraHeight,this._cameraHeightSq,this._cAtmosphere,s),f(this._cameraPosition,e.eye),_(this._projectionInverse,e.projectionMatrix),_(this._viewInverse,e.viewMatrix),c(this._nearFar,e.near,e.far),this._altitudeFade=E(this._cameraHeight-this._lowerBoundEarthRadius),this._hazeStrength=this._darkenHaze?t(.6,1,i(9500,10500,this._cameraHeight-T.radius)):1}static isSupported(e){return e.renderContext.rctx.capabilities.depthTexture}}export{y as ChapmanAtmosphere};
5
+ import e from"../../../core/Handles.js";import{lerp as t,smoothstep as i}from"../../../core/mathUtils.js";import{releaseMaybe as s,disposeMaybe as a,destroyMaybe as r,isSome as h,isNone as n,unwrapOr as o}from"../../../core/maybe.js";import{on as _}from"../../../core/watchUtils.js";import{a as d}from"../../../chunks/mat4.js";import{c as m}from"../../../chunks/mat4f64.js";import{s as c}from"../../../chunks/vec2.js";import{a as u}from"../../../chunks/vec2f64.js";import{s as l,l as p,g as f}from"../../../chunks/vec3.js";import{c as v}from"../../../chunks/vec3f64.js";import{c as g,f as b}from"../../../chunks/vec4f64.js";import{earth as T}from"../../../geometry/support/Ellipsoid.js";import{rayLeighScaleHeight as w,atmosphereHeight as R,betaRayleigh as H,betaOzone as j,betaMie as x,innerAtmosphereDepth as q,computeInnerAltitudeFade as E}from"./atmosphereUtils.js";import{ChapmanAtmosphereTechniqueConfiguration as U,ChapmanAtmosphereTechnique as z}from"./ChapmanAtmosphereTechnique.js";import{Pos2Tex as B}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{createQuadVAO as F}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as y}from"../../webgl/enums.js";class M{constructor(e){this._view=e,this.type="realistic",this.canRender=!0,this._cameraPosition=v(),this._projectionInverse=m(),this._viewInverse=m(),this._heightParameters=g(),this._betasRayleigh=v(),this._betasCombined=v(),this._scaleHeight=0,this._radii=u(),this._nearFar=u(),this._cameraHeight=0,this._cameraHeightSq=0,this._cAtmosphere=0,this._innerFadeDistance=0,this._altitudeFade=0,this._lowerElevationBoundRadius=0,this._lowerBoundEarthRadius=T.radius,this._hazeStrength=1,this._darkenHaze=!1,this._updateRadius(T.radius)}destroy(){this._atmosphereTechnique=s(this._atmosphereTechnique),this._atmosphereHazeTechnique=s(this._atmosphereHazeTechnique),this._vao=a(this._vao),this._handles=r(this._handles)}when(){return Promise.resolve()}initializeRenderContext(t){const i=t.renderContext.rctx;this._handles=new e,h(this._view.basemapTerrain.rootTiles)&&this._updateElevation({spatialReference:this._view.basemapTerrain.spatialReference,tile:this._view.basemapTerrain.rootTiles[0],extent:this._view.basemapTerrain.rootTiles[0].extent,context:"ground"}),this._handles.add(_(this._view,"basemapTerrain","elevation-change",(e=>this._updateElevation(e)),(()=>this._updateElevation()))),this._handles.add(_(this._view,"basemapTerrain","elevation-bounds-change",(()=>this._updateVisibleElevationBounds())));const s=new U;s.haze=!1,this._atmosphereTechnique=t.shaderTechniqueRep.acquire(z,s),s.haze=!0,this._atmosphereHazeTechnique=t.shaderTechniqueRep.acquire(z,s),this._vao=F(i,B),this._scaleHeight=w*R,l(this._betasRayleigh,H[0],H[1],H[2]),l(this._betasCombined,H[0]+j[0],H[1]+j[1],H[2]+j[2])}render(e){this._render(e,this._atmosphereTechnique,e.offscreenRenderingHelper.depthTexture)}renderHaze(e,t){this._darkenHaze=t,this._render(e,this._atmosphereHazeTechnique,e.offscreenRenderingHelper.linearDepthTexture)}_render(e,t,i){this._update(e.camera);const s=e.rctx.useTechnique(t);e.offscreenRenderingHelper.renderDepthDetached((()=>{s.bindTexture(i,"depthTex"),this._renderCommon(t.program,e)}))}_renderCommon(e,t){if(n(this._vao))return;const i=t.rctx;t.scenelightingData.setLightDirectionUniform(e),e.setUniform4fv("heightParameters",this._heightParameters),e.setUniform3fv("cameraPosition",this._cameraPosition),e.setUniformMatrix4fv("inverseProjectionMatrix",this._projectionInverse),e.setUniformMatrix4fv("inverseViewMatrix",this._viewInverse),e.setUniform2fv("nearFar",this._nearFar),e.setUniform2fv("radii",this._radii),e.setUniform1f("scaleHeight",this._scaleHeight),e.setUniform1f("betaMie",x),e.setUniform3fv("betaRayleigh",this._betasRayleigh),e.setUniform3fv("betaCombined",this._betasCombined),e.setUniform1f("innerFadeDistance",this._innerFadeDistance),e.setUniform1f("altitudeFade",this._altitudeFade),e.setUniform1f("hazeStrength",this._hazeStrength),i.bindVAO(this._vao),e.assertCompatibleVertexAttributeLocations(this._vao),i.drawArrays(y.TRIANGLE_STRIP,0,4)}_adjustRadiusForTesselation(e){return e*Math.cos(Math.PI/16/16)}_updateElevation(e){const t=e?e.tile:o(this._view.basemapTerrain.rootTiles,[null])[0];if(n(t)||0!==t.level)return;const i=this._adjustRadiusForTesselation(T.radius+t.elevationBounds[0]);i!==this._lowerElevationBoundRadius&&(this._lowerElevationBoundRadius=i,this._lowerBoundEarthRadius=-1,this._updateVisibleElevationBounds())}_updateVisibleElevationBounds(){const e=this._adjustRadiusForTesselation(T.radius+this._view.basemapTerrain.elevationBounds.min);(this._lowerBoundEarthRadius<0||e<this._lowerBoundEarthRadius)&&this._updateRadius(e)}_updateRadius(e){this._lowerBoundEarthRadius=e,c(this._radii,e,e+R),this._innerFadeDistance=2*Math.sqrt((2*e-q)*q)}_update(e){if(n(e))return;this._cameraHeight=p(e.eye),this._cameraHeightSq=this._cameraHeight*this._cameraHeight,this._cAtmosphere=this._cameraHeightSq-this._radii[1]*this._radii[1];const s=Math.min(1,Math.max(0,(this._cameraHeight-this._radii[0])/R));this._heightParameters=b(this._cameraHeight,this._cameraHeightSq,this._cAtmosphere,s),f(this._cameraPosition,e.eye),d(this._projectionInverse,e.projectionMatrix),d(this._viewInverse,e.viewMatrix),c(this._nearFar,e.near,e.far),this._altitudeFade=E(this._cameraHeight-this._lowerBoundEarthRadius),this._hazeStrength=this._darkenHaze?t(.6,1,i(9500,10500,this._cameraHeight-T.radius)):1}static isSupported(e){return e.renderContext.rctx.capabilities.depthTexture}}export{M as ChapmanAtmosphere};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as a}from"../../../core/mathUtils.js";import{releaseMaybe as t,disposeMaybe as e,isNone as r}from"../../../core/maybe.js";import{a as s,e as i}from"../../../chunks/mat4.js";import{c as o}from"../../../chunks/mat4f64.js";import{y as n,g as h,n as m,a as p,l as _,f as c}from"../../../chunks/vec3.js";import{c as f,f as d}from"../../../chunks/vec3f64.js";import{create as l,fromPoints as I,axis as u}from"../../../geometry/support/axisAngle.js";import{CloudsCompositionTechnique as F}from"./CloudsCompositionTechnique.js";import{weatherHeightLimit as g}from"./weather.js";import{createQuadVAO as H}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as x}from"../../webgl/enums.js";class O{constructor(a,t,e,r){this._viewingMode=t,this._inverseProjectionMatrix=o(),this._inverseViewMatrix=o(),this._technique=new F({rctx:a,viewingMode:this._viewingMode},null),this._vao=H(a),this._setDefaultParallax(e,r)}destroy(){this._technique=t(this._technique),this._vao=e(this._vao)}render(a,t,e){this._parameters.clouds=t;const i=a.camera;if(r(this._vao)||r(i))return;const o=a.rctx,n=this._technique.program;o.useProgram(n),this._technique.bindPipelineState(o),a.scenelightingData.setLightDirectionUniform(n),a.scenelightingData.setUniforms(n),s(this._inverseProjectionMatrix,i.projectionMatrix),s(this._inverseViewMatrix,i.viewMatrix),n.setUniformMatrix4fv("inverseProjectionMatrix",this._inverseProjectionMatrix),n.setUniformMatrix4fv("inverseViewMatrix",this._inverseViewMatrix),n.setUniform2f("cloudVariables",this._parameters.clouds.coverage,this._parameters.clouds.absorption),this._setParallaxParams(i.eye,e),a.cloudsCompositionParams=this._parameters,S(n,a.camera,this._parameters),o.bindVAO(this._vao),n.assertCompatibleVertexAttributeLocations(this._vao),o.drawArrays(x.TRIANGLE_STRIP,0,4)}get isFading(){return this._parameters.crossFade.stage!==N.FINISHED||this._parameters.fadeInOut.stage!==D.FINISHED||this._parameters.fadeIn.stage!==E.FINISHED||this._parameters.fadeInOutHeight.stage!==C.FINISHED}_setDefaultParallax(a,t){this._parameters={parallax:{anchorPointClouds:f(),radius:a,cloudsHeight:1e5,radiusCurvatureCorrectionFactor:0,transform:o()},parallaxNew:{anchorPointClouds:f(),radius:a,cloudsHeight:1e5,radiusCurvatureCorrectionFactor:0,transform:o()},crossFade:{stage:N.FINISHED,factor:0,distanceThresholdFactor:.3},fadeInOut:{stage:D.FINISHED,factor:0,distanceThresholdFactor:.6},fadeIn:{stage:E.FINISHED,factor:0,distanceThresholdFactor:2},fadeInOutHeight:{stage:C.FINISHED,factor:t>g?1:0},cameraPositionLastFrame:f(),startTime:0,startTimeHeightFade:0,clouds:null}}_isCameraPositionFinal(a){return n(this._parameters.cameraPositionLastFrame,a)}_setFadeInStage(a){const t=this._isCameraPositionFinal(a);this._parameters.fadeIn.stage===E.FINISHED&&(this._parameters.fadeIn.factor=1,h(this._parameters.parallax.anchorPointClouds,T),this._parameters.fadeIn.stage=E.CHANGE_ANCHOR,this._parameters.crossFade.stage=N.FINISHED,this._parameters.fadeInOut.stage=D.FINISHED),this._parameters.fadeIn.stage===E.CHANGE_ANCHOR&&t&&(h(this._parameters.parallax.anchorPointClouds,T),this._parameters.fadeIn.stage=E.FADE_IN,this._parameters.startTime=performance.now()),this._parameters.fadeIn.factor>0&&this._parameters.fadeIn.stage===E.FADE_IN&&(this._parameters.fadeIn.factor=1-(performance.now()-this._parameters.startTime)/500),this._parameters.fadeIn.factor<=0&&this._parameters.fadeIn.stage===E.FADE_IN&&(this._parameters.fadeIn.stage=E.FINISHED,this._parameters.fadeIn.factor=0)}_setCrossFadingStage(){this._parameters.crossFade.stage===N.FINISHED&&(h(this._parameters.parallaxNew.anchorPointClouds,T),this._parameters.startTime=performance.now(),this._parameters.crossFade.factor=0,this._parameters.crossFade.stage=N.CROSS_FADE),this._parameters.crossFade.factor<1&&this._parameters.crossFade.stage===N.CROSS_FADE&&(this._parameters.crossFade.factor=(performance.now()-this._parameters.startTime)/500),this._parameters.crossFade.factor>=1&&this._parameters.crossFade.stage===N.CROSS_FADE&&(this._parameters.crossFade.stage=N.FINISHED,this._parameters.crossFade.factor=1,h(this._parameters.parallax.anchorPointClouds,this._parameters.parallaxNew.anchorPointClouds))}_setFadeInOutStage(a){this._parameters.fadeInOut.stage===D.FINISHED&&(this._parameters.startTime=performance.now(),this._parameters.fadeInOut.factor=0,this._parameters.fadeInOut.stage=D.FADE_OUT),this._parameters.fadeInOut.factor<1&&this._parameters.fadeInOut.stage===D.FADE_OUT&&(this._parameters.fadeInOut.factor=(performance.now()-this._parameters.startTime)/250),this._parameters.fadeInOut.factor>=1&&this._parameters.fadeInOut.stage===D.FADE_OUT&&(this._parameters.fadeInOut.factor=1,h(this._parameters.parallax.anchorPointClouds,T)),this._parameters.fadeInOut.factor>=1&&this._parameters.fadeInOut.stage===D.FADE_OUT&&this._isCameraPositionFinal(a)&&(this._parameters.startTime=performance.now(),this._parameters.fadeInOut.factor=1,this._parameters.fadeInOut.stage=D.FADE_IN,this._parameters.crossFade.stage=N.FINISHED,this._parameters.crossFade.factor=0),this._parameters.fadeInOut.factor>0&&this._parameters.fadeInOut.stage===D.FADE_IN&&(this._parameters.fadeInOut.factor=1-(performance.now()-this._parameters.startTime)/500),this._parameters.fadeInOut.factor<=0&&this._parameters.fadeInOut.stage===D.FADE_IN&&(this._parameters.fadeInOut.stage=D.FINISHED,this._parameters.fadeInOut.factor=0)}_setFadeInOutHeight(t){const e=performance.now();this._parameters.startTimeHeightFade=this._parameters.fadeInOutHeight.stage===C.FINISHED?e:this._parameters.startTimeHeightFade,t?this._parameters.fadeInOutHeight.factor+=(e-this._parameters.startTimeHeightFade)/500:this._parameters.fadeInOutHeight.factor-=(e-this._parameters.startTimeHeightFade)/500,this._parameters.startTimeHeightFade=e,this._parameters.fadeInOutHeight.factor=a(this._parameters.fadeInOutHeight.factor,0,1),this._parameters.fadeInOutHeight.stage=C.HEIGHT_FADE}_setParallaxParams(a,t){m(T,a),p(T,T,this._parameters.parallax.radius),0===this._parameters.parallax.anchorPointClouds[0]&&0===this._parameters.parallax.anchorPointClouds[1]&&0===this._parameters.parallax.anchorPointClouds[2]&&h(this._parameters.parallax.anchorPointClouds,T);const e=_(c(v,this._parameters.parallax.anchorPointClouds,T));let r=!0;e>this._parameters.fadeIn.distanceThresholdFactor*this._parameters.parallax.cloudsHeight||this._parameters.fadeIn.stage!==E.FINISHED?this._setFadeInStage(a):e>this._parameters.fadeInOut.distanceThresholdFactor*this._parameters.parallax.cloudsHeight||this._parameters.fadeInOut.stage!==D.FINISHED?this._setFadeInOutStage(a):e>this._parameters.crossFade.distanceThresholdFactor*this._parameters.parallax.cloudsHeight&&!t||this._parameters.crossFade.stage!==N.FINISHED?this._setCrossFadingStage():r=!1;const s=_(a),n=s-this._parameters.parallax.radius;(n>1.7*g||n<-g)&&this._parameters.fadeInOutHeight.factor<1?this._parameters.fadeInOutHeight.factor=1:(n>g||n<-.35*g)&&this._parameters.fadeInOutHeight.factor<1?this._setFadeInOutHeight(!0):n<g&&n>-.35*g&&this._parameters.fadeInOutHeight.factor>0?this._setFadeInOutHeight(!1):this._parameters.fadeInOutHeight.stage=C.FINISHED,this._parameters.parallax.radiusCurvatureCorrectionFactor=.84*Math.sqrt(Math.max(s*s-this._parameters.parallax.radius*this._parameters.parallax.radius,0))/s,I(P,this._parameters.parallax.anchorPointClouds,A),this._parameters.parallax.transform=o(),i(this._parameters.parallax.transform,this._parameters.parallax.transform,A[3],u(A)),r&&(I(P,this._parameters.parallaxNew.anchorPointClouds,A),this._parameters.parallaxNew.transform=o(),i(this._parameters.parallaxNew.transform,this._parameters.parallaxNew.transform,A[3],u(A))),h(this._parameters.cameraPositionLastFrame,a)}}var E,D,N,C;function S(t,e,r){t.bindTexture(r.clouds.cubeMap.colorTexture,"cubeMap"),t.setUniform1f("cloudsHeight",r.parallax.cloudsHeight),t.setUniformMatrix4fv("rotationMatrixClouds",r.parallax.transform),t.setUniformMatrix4fv("rotationMatrixCloudsCrossFade",r.parallaxNew.transform),t.setUniform3fv("anchorPosition",r.parallax.anchorPointClouds),t.setUniform3fv("anchorPositionCrossFade",r.parallaxNew.anchorPointClouds),r.fadeInOut.stage!==D.FINISHED?t.setUniform1f("totalFadeInOut",r.fadeInOutHeight.factor+Math.max(a(r.fadeInOut.factor,0,1))):t.setUniform1f("totalFadeInOut",r.fadeInOutHeight.factor+Math.max(a(r.fadeIn.factor,0,1))),t.setUniform1f("radiusCurvatureCorrectionFactor",r.parallax.radiusCurvatureCorrectionFactor),t.setUniform1i("crossFade",r.crossFade.stage),t.setUniform1f("crossFadeAnchorFactor",a(r.crossFade.factor,0,1)),t.setUniform1f("radius",r.parallax.radius),t.setUniform3fv("cameraPosition",e.eye)}!function(a){a[a.FINISHED=0]="FINISHED",a[a.CHANGE_ANCHOR=1]="CHANGE_ANCHOR",a[a.FADE_IN=2]="FADE_IN"}(E||(E={})),function(a){a[a.FINISHED=0]="FINISHED",a[a.FADE_OUT=1]="FADE_OUT",a[a.FADE_IN=2]="FADE_IN"}(D||(D={})),function(a){a[a.FINISHED=0]="FINISHED",a[a.CROSS_FADE=1]="CROSS_FADE"}(N||(N={})),function(a){a[a.FINISHED=0]="FINISHED",a[a.HEIGHT_FADE=1]="HEIGHT_FADE"}(C||(C={}));const P=d(0,0,1),A=l(),T=f(),v=f();export{O as CloudsComposition,S as bindCloudsComposition};
5
+ import{clamp as a}from"../../../core/mathUtils.js";import{releaseMaybe as t,disposeMaybe as e,isNone as r}from"../../../core/maybe.js";import{a as s,e as i}from"../../../chunks/mat4.js";import{c as o}from"../../../chunks/mat4f64.js";import{y as n,g as h,n as m,a as p,l as c,f as _}from"../../../chunks/vec3.js";import{c as f,f as d}from"../../../chunks/vec3f64.js";import{create as l,fromPoints as I,axis as u}from"../../../geometry/support/axisAngle.js";import{CloudsCompositionTechnique as F}from"./CloudsCompositionTechnique.js";import{weatherHeightLimit as g}from"./weather.js";import{createQuadVAO as H}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as x}from"../../webgl/enums.js";class O{constructor(a,t,e,r){this._viewingMode=t,this._inverseProjectionMatrix=o(),this._inverseViewMatrix=o(),this._technique=new F({rctx:a,viewingMode:this._viewingMode},null),this._vao=H(a),this._setDefaultParallax(e,r)}destroy(){this._technique=t(this._technique),this._vao=e(this._vao)}render(a,t,e){this._parameters.clouds=t;const i=a.camera;if(r(this._vao)||r(i))return;const o=a.rctx,n=o.useTechnique(this._technique);a.scenelightingData.setLightDirectionUniform(n),a.scenelightingData.setUniforms(n),s(this._inverseProjectionMatrix,i.projectionMatrix),s(this._inverseViewMatrix,i.viewMatrix),n.setUniformMatrix4fv("inverseProjectionMatrix",this._inverseProjectionMatrix),n.setUniformMatrix4fv("inverseViewMatrix",this._inverseViewMatrix),n.setUniform2f("cloudVariables",this._parameters.clouds.coverage,this._parameters.clouds.absorption),this._setParallaxParams(i.eye,e),a.cloudsCompositionParams=this._parameters,S(n,a.camera,this._parameters),o.bindVAO(this._vao),n.assertCompatibleVertexAttributeLocations(this._vao),o.drawArrays(x.TRIANGLE_STRIP,0,4)}get isFading(){return this._parameters.crossFade.stage!==N.FINISHED||this._parameters.fadeInOut.stage!==D.FINISHED||this._parameters.fadeIn.stage!==E.FINISHED||this._parameters.fadeInOutHeight.stage!==C.FINISHED}_setDefaultParallax(a,t){this._parameters={parallax:{anchorPointClouds:f(),radius:a,cloudsHeight:1e5,radiusCurvatureCorrectionFactor:0,transform:o()},parallaxNew:{anchorPointClouds:f(),radius:a,cloudsHeight:1e5,radiusCurvatureCorrectionFactor:0,transform:o()},crossFade:{stage:N.FINISHED,factor:0,distanceThresholdFactor:.3},fadeInOut:{stage:D.FINISHED,factor:0,distanceThresholdFactor:.6},fadeIn:{stage:E.FINISHED,factor:0,distanceThresholdFactor:2},fadeInOutHeight:{stage:C.FINISHED,factor:t>g?1:0},cameraPositionLastFrame:f(),startTime:0,startTimeHeightFade:0,clouds:null}}_isCameraPositionFinal(a){return n(this._parameters.cameraPositionLastFrame,a)}_setFadeInStage(a){const t=this._isCameraPositionFinal(a);this._parameters.fadeIn.stage===E.FINISHED&&(this._parameters.fadeIn.factor=1,h(this._parameters.parallax.anchorPointClouds,T),this._parameters.fadeIn.stage=E.CHANGE_ANCHOR,this._parameters.crossFade.stage=N.FINISHED,this._parameters.fadeInOut.stage=D.FINISHED),this._parameters.fadeIn.stage===E.CHANGE_ANCHOR&&t&&(h(this._parameters.parallax.anchorPointClouds,T),this._parameters.fadeIn.stage=E.FADE_IN,this._parameters.startTime=performance.now()),this._parameters.fadeIn.factor>0&&this._parameters.fadeIn.stage===E.FADE_IN&&(this._parameters.fadeIn.factor=1-(performance.now()-this._parameters.startTime)/500),this._parameters.fadeIn.factor<=0&&this._parameters.fadeIn.stage===E.FADE_IN&&(this._parameters.fadeIn.stage=E.FINISHED,this._parameters.fadeIn.factor=0)}_setCrossFadingStage(){this._parameters.crossFade.stage===N.FINISHED&&(h(this._parameters.parallaxNew.anchorPointClouds,T),this._parameters.startTime=performance.now(),this._parameters.crossFade.factor=0,this._parameters.crossFade.stage=N.CROSS_FADE),this._parameters.crossFade.factor<1&&this._parameters.crossFade.stage===N.CROSS_FADE&&(this._parameters.crossFade.factor=(performance.now()-this._parameters.startTime)/500),this._parameters.crossFade.factor>=1&&this._parameters.crossFade.stage===N.CROSS_FADE&&(this._parameters.crossFade.stage=N.FINISHED,this._parameters.crossFade.factor=1,h(this._parameters.parallax.anchorPointClouds,this._parameters.parallaxNew.anchorPointClouds))}_setFadeInOutStage(a){this._parameters.fadeInOut.stage===D.FINISHED&&(this._parameters.startTime=performance.now(),this._parameters.fadeInOut.factor=0,this._parameters.fadeInOut.stage=D.FADE_OUT),this._parameters.fadeInOut.factor<1&&this._parameters.fadeInOut.stage===D.FADE_OUT&&(this._parameters.fadeInOut.factor=(performance.now()-this._parameters.startTime)/250),this._parameters.fadeInOut.factor>=1&&this._parameters.fadeInOut.stage===D.FADE_OUT&&(this._parameters.fadeInOut.factor=1,h(this._parameters.parallax.anchorPointClouds,T)),this._parameters.fadeInOut.factor>=1&&this._parameters.fadeInOut.stage===D.FADE_OUT&&this._isCameraPositionFinal(a)&&(this._parameters.startTime=performance.now(),this._parameters.fadeInOut.factor=1,this._parameters.fadeInOut.stage=D.FADE_IN,this._parameters.crossFade.stage=N.FINISHED,this._parameters.crossFade.factor=0),this._parameters.fadeInOut.factor>0&&this._parameters.fadeInOut.stage===D.FADE_IN&&(this._parameters.fadeInOut.factor=1-(performance.now()-this._parameters.startTime)/500),this._parameters.fadeInOut.factor<=0&&this._parameters.fadeInOut.stage===D.FADE_IN&&(this._parameters.fadeInOut.stage=D.FINISHED,this._parameters.fadeInOut.factor=0)}_setFadeInOutHeight(t){const e=performance.now();this._parameters.startTimeHeightFade=this._parameters.fadeInOutHeight.stage===C.FINISHED?e:this._parameters.startTimeHeightFade,t?this._parameters.fadeInOutHeight.factor+=(e-this._parameters.startTimeHeightFade)/500:this._parameters.fadeInOutHeight.factor-=(e-this._parameters.startTimeHeightFade)/500,this._parameters.startTimeHeightFade=e,this._parameters.fadeInOutHeight.factor=a(this._parameters.fadeInOutHeight.factor,0,1),this._parameters.fadeInOutHeight.stage=C.HEIGHT_FADE}_setParallaxParams(a,t){m(T,a),p(T,T,this._parameters.parallax.radius),0===this._parameters.parallax.anchorPointClouds[0]&&0===this._parameters.parallax.anchorPointClouds[1]&&0===this._parameters.parallax.anchorPointClouds[2]&&h(this._parameters.parallax.anchorPointClouds,T);const e=c(_(v,this._parameters.parallax.anchorPointClouds,T));let r=!0;e>this._parameters.fadeIn.distanceThresholdFactor*this._parameters.parallax.cloudsHeight||this._parameters.fadeIn.stage!==E.FINISHED?this._setFadeInStage(a):e>this._parameters.fadeInOut.distanceThresholdFactor*this._parameters.parallax.cloudsHeight||this._parameters.fadeInOut.stage!==D.FINISHED?this._setFadeInOutStage(a):e>this._parameters.crossFade.distanceThresholdFactor*this._parameters.parallax.cloudsHeight&&!t||this._parameters.crossFade.stage!==N.FINISHED?this._setCrossFadingStage():r=!1;const s=c(a),n=s-this._parameters.parallax.radius;(n>1.7*g||n<-g)&&this._parameters.fadeInOutHeight.factor<1?this._parameters.fadeInOutHeight.factor=1:(n>g||n<-.35*g)&&this._parameters.fadeInOutHeight.factor<1?this._setFadeInOutHeight(!0):n<g&&n>-.35*g&&this._parameters.fadeInOutHeight.factor>0?this._setFadeInOutHeight(!1):this._parameters.fadeInOutHeight.stage=C.FINISHED,this._parameters.parallax.radiusCurvatureCorrectionFactor=.84*Math.sqrt(Math.max(s*s-this._parameters.parallax.radius*this._parameters.parallax.radius,0))/s,I(A,this._parameters.parallax.anchorPointClouds,P),this._parameters.parallax.transform=o(),i(this._parameters.parallax.transform,this._parameters.parallax.transform,P[3],u(P)),r&&(I(A,this._parameters.parallaxNew.anchorPointClouds,P),this._parameters.parallaxNew.transform=o(),i(this._parameters.parallaxNew.transform,this._parameters.parallaxNew.transform,P[3],u(P))),h(this._parameters.cameraPositionLastFrame,a)}}var E,D,N,C;function S(t,e,r){t.bindTexture(r.clouds.cubeMap.colorTexture,"cubeMap"),t.setUniform1f("cloudsHeight",r.parallax.cloudsHeight),t.setUniformMatrix4fv("rotationMatrixClouds",r.parallax.transform),t.setUniformMatrix4fv("rotationMatrixCloudsCrossFade",r.parallaxNew.transform),t.setUniform3fv("anchorPosition",r.parallax.anchorPointClouds),t.setUniform3fv("anchorPositionCrossFade",r.parallaxNew.anchorPointClouds),r.fadeInOut.stage!==D.FINISHED?t.setUniform1f("totalFadeInOut",r.fadeInOutHeight.factor+Math.max(a(r.fadeInOut.factor,0,1))):t.setUniform1f("totalFadeInOut",r.fadeInOutHeight.factor+Math.max(a(r.fadeIn.factor,0,1))),t.setUniform1f("radiusCurvatureCorrectionFactor",r.parallax.radiusCurvatureCorrectionFactor),t.setUniform1i("crossFade",r.crossFade.stage),t.setUniform1f("crossFadeAnchorFactor",a(r.crossFade.factor,0,1)),t.setUniform1f("radius",r.parallax.radius),t.setUniform3fv("cameraPosition",e.eye)}!function(a){a[a.FINISHED=0]="FINISHED",a[a.CHANGE_ANCHOR=1]="CHANGE_ANCHOR",a[a.FADE_IN=2]="FADE_IN"}(E||(E={})),function(a){a[a.FINISHED=0]="FINISHED",a[a.FADE_OUT=1]="FADE_OUT",a[a.FADE_IN=2]="FADE_IN"}(D||(D={})),function(a){a[a.FINISHED=0]="FINISHED",a[a.CROSS_FADE=1]="CROSS_FADE"}(N||(N={})),function(a){a[a.FINISHED=0]="FINISHED",a[a.HEIGHT_FADE=1]="HEIGHT_FADE"}(C||(C={}));const A=d(0,0,1),P=l(),T=f(),v=f();export{O as CloudsComposition,S as bindCloudsComposition};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import i from"../../../core/Handles.js";import s from"../../../core/has.js";import{lerp as r}from"../../../core/mathUtils.js";import{releaseMaybe as o,disposeMaybe as h,destroyMaybe as a,isNone as n}from"../../../core/maybe.js";import{init as c}from"../../../core/watchUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{f as m}from"../../../chunks/mat3.js";import{c as d}from"../../../chunks/mat3f64.js";import{x as f}from"../../../chunks/mat4.js";import{c as l}from"../../../chunks/mat4f64.js";import{f as _,z as g}from"../../../chunks/vec3f32.js";import{getReferenceEllipsoid as y}from"../../../geometry/projectionEllipsoid.js";import{cloudPresets as v}from"./CloudsPresets.js";import{CloudsTechniqueConfiguration as b,CloudsTechnique as x}from"./CloudsTechnique.js";import{NoiseTextureAtlas as S}from"./NoiseTextureAtlas.js";import{createQuadVAO as T}from"../webgl-engine/lib/glUtil3D.js";import{TaskPriority as w}from"../../support/Scheduler.js";import{TextureType as z,PixelFormat as M,PixelType as j,TextureWrapMode as C,TextureSamplingMode as U,TargetType as E}from"../../webgl/enums.js";import{FramebufferObject as R}from"../../webgl/FramebufferObject.js";let q=class extends e{constructor(t){super(t),this._frameTask=null,this._handles=new i,this._cubeMapSize=s("esri-mobile")?1024:2048,this._techniques=[],this._techniqueConfiguration=new b,this.coverage=r(P.coverage[0],P.coverage[1],.5),this.density=r(P.density[0],P.density[1],.5),this.absorption=r(P.absorption[0],P.absorption[1],.5),this.cloudSize=r(P.cloudSize[0],P.cloudSize[1],.5),this.detailSize=r(P.detailSize[0],P.detailSize[1],.5),this.smoothness=r(P.smoothness[0],P.smoothness[1],.5),this.cloudHeight=r(P.cloudHeight[0],P.cloudHeight[1],.5),this.raymarchingStepType=P.raymarchingStepType,this._cloudRadius=0,this._viewMatrix=l(),this._viewMatrix3=d(),this.running=!1}_getTechnique(t){const e=this._techniques[t];return e||(this._techniqueConfiguration.steps=t,this._techniques[t]=new x({rctx:this.rctx,viewingMode:this.view.state.viewingMode},this._techniqueConfiguration),this._techniques[t])}initialize(){this._vao=T(this.rctx);const t=y(this.view.spatialReference);this._cloudRadius=.5*t.radius,this.setDirty(),this._frameTask=this.view.resourceController.scheduler.registerTask(w.CLOUDS_GENERATOR,this),this._handles.add(this._frameTask),this._handles.add(c(this,"coverage",(()=>this.setDirty())));["coverage","density","absorption","cloudSize","detailSize","smoothness","cloudHeight","raymarchingStepType"].forEach((t=>this._handles.add(c(this,t,(()=>this.setDirty())))))}destroy(){this._handles.destroy(),this._techniques.forEach((t=>o(t))),this._techniques=null,this._frameBufferCube=h(this._frameBufferCube),this._vao=h(this._vao),this._noiseTexture=a(this._noiseTexture)}_ensureNoiseTexture(){return n(this._noiseTexture)&&(this._noiseTexture=new S(this.rctx,this.view),this._noiseTexture.render(this.rctx)),this._noiseTexture}get frameBufferCube(){if(n(this._frameBufferCube)){const t={target:z.TEXTURE_CUBE_MAP,pixelFormat:M.RGBA,dataType:j.UNSIGNED_BYTE,wrapMode:C.CLAMP_TO_EDGE,samplingMode:U.LINEAR,hasMipmap:!1,width:this._cubeMapSize,height:this._cubeMapSize};this._frameBufferCube=new R(this.rctx,{colorTarget:E.CUBEMAP,width:this._cubeMapSize,height:this._cubeMapSize},t)}return this._frameBufferCube}get cubeMap(){return this._frameBufferCube}applyPreset(t,e){const i=t.median,s=t=>{const s=r(t[0],t[1],i);return e<.5?r(t[0],s,2*e):r(s,t[1],2*(e-.5))};this.coverage=s(t.coverage),this.density=s(t.density),this.absorption=s(t.absorption),this.cloudSize=s(t.cloudSize),this.detailSize=s(t.detailSize),this.smoothness=s(t.smoothness),this.cloudHeight=s(t.cloudHeight),this.raymarchingStepType=t.raymarchingStepType}setDirty(){this.running=!0}runTask(t){if(0===this.coverage||n(this._vao))return void(this.running=!1);const e=this._ensureNoiseTexture().textureAtlas;if(n(e))return void(this.running=!1);const i=this.rctx.getViewport();this.rctx.setViewport(0,0,this._cubeMapSize,this._cubeMapSize),this.rctx.bindFramebuffer(this.frameBufferCube);const s=this._getTechnique(this.raymarchingStepType),o=s.program;this.rctx.useProgram(o);const h=1+this.absorption,a=r(35,120,this.absorption);o.bindTexture(e,"cloudShapeTexture"),o.setUniform1f("cloudRadius",this._cloudRadius),o.setUniform1f("halfCubeMapSize",.5*this._cubeMapSize),o.setUniform1f("power",a),o.setUniform1f("sigmaE",h),o.setUniform1f("density",r(0,.3,this.density)),o.setUniform1f("cloudSize",r(0,.02,Math.max(.01,1-this.cloudSize))),o.setUniform1f("detailSize",r(0,.2,Math.max(.01,1-this.detailSize))),o.setUniform1f("smoothness",r(0,.5,1-this.smoothness)),o.setUniform1f("cloudHeight",r(0,1500,this.cloudHeight)),o.setUniform1f("coverage",this.coverage),this.rctx.bindVAO(this._vao),o.assertCompatibleVertexAttributeLocations(this._vao),s.bindPipelineState(this.rctx);for(let r=0;r<5;r++){const t=A[r],e=B[r];f(this._viewMatrix,k,t,e),m(this._viewMatrix3,this._viewMatrix),o.setUniformMatrix3fv("view",this._viewMatrix3);const i=z.TEXTURE_CUBE_MAP_POSITIVE_X+r;this.frameBufferCube.setColorTextureTarget(i),this.rctx.gl.drawArrays(this.rctx.gl.TRIANGLE_STRIP,0,4),this.rctx.gl.flush()}this.running=!1,this.rctx.setViewport(i.x,i.y,i.width,i.height),this.requestRender(),t.madeProgress()}};t([u({constructOnly:!0})],q.prototype,"rctx",void 0),t([u({constructOnly:!0})],q.prototype,"view",void 0),t([u({constructOnly:!0})],q.prototype,"requestRender",void 0),t([u()],q.prototype,"_frameTask",void 0),t([u()],q.prototype,"coverage",void 0),t([u()],q.prototype,"density",void 0),t([u()],q.prototype,"absorption",void 0),t([u()],q.prototype,"cloudSize",void 0),t([u()],q.prototype,"detailSize",void 0),t([u()],q.prototype,"smoothness",void 0),t([u()],q.prototype,"cloudHeight",void 0),t([u()],q.prototype,"raymarchingStepType",void 0),t([u()],q.prototype,"running",void 0),q=t([p("esri.views.3d.environment.CloudsGenerator")],q);const A=[_(1,0,0),_(-1,0,0),_(0,1,0),_(0,-1,0),_(0,0,1)],B=[_(0,1,0),_(0,1,0),_(0,0,-1),_(0,0,1),_(0,1,0)],k=g(),P=v.sunny;export{q as CloudsGenerator};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import i from"../../../core/Handles.js";import s from"../../../core/has.js";import{lerp as r}from"../../../core/mathUtils.js";import{releaseMaybe as o,disposeMaybe as h,destroyMaybe as a,isNone as n}from"../../../core/maybe.js";import{init as c}from"../../../core/watchUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{f as m}from"../../../chunks/mat3.js";import{c as d}from"../../../chunks/mat3f64.js";import{x as f}from"../../../chunks/mat4.js";import{c as l}from"../../../chunks/mat4f64.js";import{f as _,z as g}from"../../../chunks/vec3f32.js";import{getReferenceEllipsoid as y}from"../../../geometry/projectionEllipsoid.js";import{cloudPresets as v}from"./CloudsPresets.js";import{CloudsTechniqueConfiguration as b,CloudsTechnique as x}from"./CloudsTechnique.js";import{NoiseTextureAtlas as S}from"./NoiseTextureAtlas.js";import{createQuadVAO as T}from"../webgl-engine/lib/glUtil3D.js";import{TaskPriority as w}from"../../support/Scheduler.js";import{TextureType as z,PixelFormat as M,PixelType as j,TextureWrapMode as C,TextureSamplingMode as U,TargetType as E}from"../../webgl/enums.js";import{FramebufferObject as q}from"../../webgl/FramebufferObject.js";let R=class extends t{constructor(e){super(e),this._frameTask=null,this._handles=new i,this._cubeMapSize=s("esri-mobile")?1024:2048,this._techniques=[],this._techniqueConfiguration=new b,this.coverage=r(H.coverage[0],H.coverage[1],.5),this.density=r(H.density[0],H.density[1],.5),this.absorption=r(H.absorption[0],H.absorption[1],.5),this.cloudSize=r(H.cloudSize[0],H.cloudSize[1],.5),this.detailSize=r(H.detailSize[0],H.detailSize[1],.5),this.smoothness=r(H.smoothness[0],H.smoothness[1],.5),this.cloudHeight=r(H.cloudHeight[0],H.cloudHeight[1],.5),this.raymarchingStepType=H.raymarchingStepType,this._cloudRadius=0,this._viewMatrix=l(),this._viewMatrix3=d(),this.running=!1}_getTechnique(e){const t=this._techniques[e];return t||(this._techniqueConfiguration.steps=e,this._techniques[e]=new x({rctx:this.rctx,viewingMode:this.view.state.viewingMode},this._techniqueConfiguration),this._techniques[e])}initialize(){this._vao=T(this.rctx);const e=y(this.view.spatialReference);this._cloudRadius=.5*e.radius,this.setDirty(),this._frameTask=this.view.resourceController.scheduler.registerTask(w.CLOUDS_GENERATOR,this),this._handles.add(this._frameTask),this._handles.add(c(this,"coverage",(()=>this.setDirty())));["coverage","density","absorption","cloudSize","detailSize","smoothness","cloudHeight","raymarchingStepType"].forEach((e=>this._handles.add(c(this,e,(()=>this.setDirty())))))}destroy(){this._handles.destroy(),this._techniques.forEach((e=>o(e))),this._techniques=null,this._frameBufferCube=h(this._frameBufferCube),this._vao=h(this._vao),this._noiseTexture=a(this._noiseTexture)}_ensureNoiseTexture(){return n(this._noiseTexture)&&(this._noiseTexture=new S(this.rctx,this.view),this._noiseTexture.render(this.rctx)),this._noiseTexture}get frameBufferCube(){if(n(this._frameBufferCube)){const e={target:z.TEXTURE_CUBE_MAP,pixelFormat:M.RGBA,dataType:j.UNSIGNED_BYTE,wrapMode:C.CLAMP_TO_EDGE,samplingMode:U.LINEAR,hasMipmap:!1,width:this._cubeMapSize,height:this._cubeMapSize};this._frameBufferCube=new q(this.rctx,{colorTarget:E.CUBEMAP,width:this._cubeMapSize,height:this._cubeMapSize},e)}return this._frameBufferCube}get cubeMap(){return this._frameBufferCube}applyPreset(e,t){const i=e.median,s=e=>{const s=r(e[0],e[1],i);return t<.5?r(e[0],s,2*t):r(s,e[1],2*(t-.5))};this.coverage=s(e.coverage),this.density=s(e.density),this.absorption=s(e.absorption),this.cloudSize=s(e.cloudSize),this.detailSize=s(e.detailSize),this.smoothness=s(e.smoothness),this.cloudHeight=s(e.cloudHeight),this.raymarchingStepType=e.raymarchingStepType}setDirty(){this.running=!0}runTask(e){if(0===this.coverage||n(this._vao))return void(this.running=!1);const t=this._ensureNoiseTexture().textureAtlas;if(n(t))return void(this.running=!1);const i=this.rctx.getViewport();this.rctx.setViewport(0,0,this._cubeMapSize,this._cubeMapSize),this.rctx.bindFramebuffer(this.frameBufferCube);const s=this._getTechnique(this.raymarchingStepType),o=this.rctx.useTechnique(s),h=1+this.absorption,a=r(35,120,this.absorption);o.bindTexture(t,"cloudShapeTexture"),o.setUniform1f("cloudRadius",this._cloudRadius),o.setUniform1f("halfCubeMapSize",.5*this._cubeMapSize),o.setUniform1f("power",a),o.setUniform1f("sigmaE",h),o.setUniform1f("density",r(0,.3,this.density)),o.setUniform1f("cloudSize",r(0,.02,Math.max(.01,1-this.cloudSize))),o.setUniform1f("detailSize",r(0,.2,Math.max(.01,1-this.detailSize))),o.setUniform1f("smoothness",r(0,.5,1-this.smoothness)),o.setUniform1f("cloudHeight",r(0,1500,this.cloudHeight)),o.setUniform1f("coverage",this.coverage),this.rctx.bindVAO(this._vao),o.assertCompatibleVertexAttributeLocations(this._vao);for(let r=0;r<5;r++){const e=A[r],t=B[r];f(this._viewMatrix,k,e,t),m(this._viewMatrix3,this._viewMatrix),o.setUniformMatrix3fv("view",this._viewMatrix3);const i=z.TEXTURE_CUBE_MAP_POSITIVE_X+r;this.frameBufferCube.setColorTextureTarget(i),this.rctx.gl.drawArrays(this.rctx.gl.TRIANGLE_STRIP,0,4),this.rctx.gl.flush()}this.running=!1,this.rctx.setViewport(i.x,i.y,i.width,i.height),this.requestRender(),e.madeProgress()}};e([u({constructOnly:!0})],R.prototype,"rctx",void 0),e([u({constructOnly:!0})],R.prototype,"view",void 0),e([u({constructOnly:!0})],R.prototype,"requestRender",void 0),e([u()],R.prototype,"_frameTask",void 0),e([u()],R.prototype,"coverage",void 0),e([u()],R.prototype,"density",void 0),e([u()],R.prototype,"absorption",void 0),e([u()],R.prototype,"cloudSize",void 0),e([u()],R.prototype,"detailSize",void 0),e([u()],R.prototype,"smoothness",void 0),e([u()],R.prototype,"cloudHeight",void 0),e([u()],R.prototype,"raymarchingStepType",void 0),e([u()],R.prototype,"running",void 0),R=e([p("esri.views.3d.environment.CloudsGenerator")],R);const A=[_(1,0,0),_(-1,0,0),_(0,1,0),_(0,-1,0),_(0,0,1)],B=[_(0,1,0),_(0,1,0),_(0,0,-1),_(0,0,1),_(0,1,0)],k=g(),H=v.sunny;export{R as CloudsGenerator};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import"../../../core/has.js";import s from"../../../core/Handles.js";import{equalsShallow as i}from"../../../core/lang.js";import{lerp as r}from"../../../core/mathUtils.js";import{isSome as o,destroyMaybe as n,applySome as a,isNone as h}from"../../../core/maybe.js";import{watch as p,syncAndInitial as l}from"../../../core/reactiveUtils.js";import{when as d}from"../../../core/watchUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{l as c}from"../../../chunks/vec3.js";import{getReferenceEllipsoid as u}from"../../../geometry/projectionEllipsoid.js";import{isMoon as g,isEarth as w}from"../../../geometry/support/spatialReferenceUtils.js";import{enablePrecipitation as v}from"../../../support/featureFlags.js";import{ChapmanAtmosphere as y}from"./ChapmanAtmosphere.js";import{CloudsComposition as f}from"./CloudsComposition.js";import{isReadyCloudsData as R}from"./CloudsData.js";import{CloudsGenerator as A}from"./CloudsGenerator.js";import{cloudPresets as P}from"./CloudsPresets.js";import{Fog as C}from"./Fog.js";import{PanoramicAtmosphere as E}from"./PanoramicAtmosphere.js";import{Precipitation as N}from"./Precipitation.js";import{P as b}from"../../../chunks/Precipitation.glsl.js";import j from"./SimpleAtmosphere.js";import{Stars as T}from"./Stars.js";import{weatherHeightLimit as x}from"./weather.js";import{RenderPass as O}from"../webgl-engine/lib/RenderPass.js";import{RenderSlot as S}from"../webgl-engine/lib/RenderSlot.js";const M=[S.POSTPROCESSING_ENVIRONMENT_OPAQUE,S.POSTPROCESSING_ENVIRONMENT_TRANSPARENT];let D=class extends t{constructor(e){super(e),this._handles=new s,this._context=null,this._pendingAtmosphere=null,this._atmosphere=null,this._stars=null,this._precipitation=null,this._clouds=null,this._cloudComposition=null,this._fog=null}get atmosphereType(){return o(this._pendingAtmosphere)?this._pendingAtmosphere.type:o(this._atmosphere)?this._atmosphere.type:"none"}get canRender(){var e;return!(null==(e=this.view.basemapTerrain)||!e.renderer.canRender)||"global"!==this.view.viewingMode}get needsLinearDepth(){return"realistic"===this._selectAtmosphereType()}updateAnimation(e){return!!o(this._precipitation)&&this._precipitation.update(e)}get updating(){return o(this._pendingAtmosphere)||o(this._stars)&&this._stars.updating||o(this._clouds)&&this._clouds.running}get weatherVisible(){return c(this.view.state.camera.eye)-u(this.view.spatialReference).radius<=x}get weatherEnabled(){var e;return!(null==(e=this.view.environmentManager)||!e.weatherEnabled)}get precipitationEnabled(){return v()}initialize(){this.view._stage.addRenderPlugin(M,this)}destroy(){this._pendingAtmosphere=n(this._pendingAtmosphere),this.uninitializeRenderContext(),this._handles=n(this._handles),this.view&&null!=this.view._stage&&(this.view._stage.removeRenderPlugin(this),this._set("view",null))}initializeRenderContext(e=null){this._context=e,this._handles.add([d(this.view,"basemapTerrain",(()=>this._updateBasemapTerrain()),!0),p((()=>({viewingMode:this.view.viewingMode,atmosphereEnabled:this.view.environment.atmosphereEnabled,atmosphereQuality:this.view.environment.atmosphere.quality})),(()=>this._updateAtmosphere()),l),p((()=>this._starsCreationParameters),(e=>this._createOrDestroyStars(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._environmentPostProcessCreationParameters),(e=>this._createOrDestroyPrecipitation(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._cloudsCreationParameters),(e=>this._createOrDestroyClouds(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._environmentPostProcessCreationParameters),(e=>this._createOrDestroyFog(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._weatherUpdateParameters),(e=>{this._updateWeather(e),this._updateFog(e)}),l)])}uninitializeRenderContext(){this._stars=n(this._stars),this._precipitation=n(this._precipitation),this._atmosphere=n(this._atmosphere),this._clouds=n(this._clouds),this._cloudComposition=n(this._cloudComposition),this._fog=n(this._fog)}render(e){if(e.pass===O.MATERIAL)switch(e.slot){case S.POSTPROCESSING_ENVIRONMENT_OPAQUE:o(this._stars)&&this._stars.render(e),o(this._atmosphere)&&this._atmosphere.canRender&&(this._atmosphere.render(e),R(this._clouds)&&o(this._cloudComposition)&&(this._cloudComposition.render(e,this._clouds,o(this.view.animation)),this._cloudComposition.isFading&&this._setNeedsRender()));break;case S.POSTPROCESSING_ENVIRONMENT_TRANSPARENT:if(o(this._atmosphere)&&this._atmosphere.canRender){const t=this.weatherEnabled?this.view.environment.weather.type:"disabled";this._atmosphere.renderHaze(e,"rainy"===t),o(this._fog)&&("foggy"!==t&&"realistic"===this._selectAtmosphereType()||this._fog.render(e,"foggy"===t,"rainy"===t)),"rainy"!==this.view.environment.weather.type&&"snowy"!==this.view.environment.weather.type||o(this._precipitation)&&this._precipitation.render(e,this.view.environment.weather.precipitation,"rainy"===this.view.environment.weather.type?b.RAIN:b.SNOW)}}}get _cloudsCreationParameters(){return this.weatherEnabled?{view:this.view,viewingMode:this.view.state.viewingMode,rctx:o(this._context)?this._context.renderContext.rctx:null,radius:u(this.view.spatialReference).radius}:null}_createOrDestroyClouds(e){this._clouds=n(this._clouds),this._cloudComposition=n(this._cloudComposition),a(e,(({view:e,viewingMode:t,rctx:s,radius:i})=>{this._clouds=new A({rctx:s,view:e,requestRender:()=>this._setNeedsRender()}),this._cloudComposition=new f(s,t,i,c(e.state.camera.eye)-i)})),this._setNeedsRender()}get _weatherUpdateParameters(){const e=this.weatherEnabled?this.view.environment.weather:null;return h(e)?null:{type:e.type,weatherAdjustment:"foggy"===e.type?e.fogStrength:e.cloudCover}}_updateWeather(e){h(e)||h(this._clouds)||this._clouds.applyPreset(P[e.type],e.weatherAdjustment)}_setNeedsRender(){o(this._context)&&this._context.requestRender()}get _starsCreationParameters(){var e,t,s;return{view:this.view,starsEnabled:null!=(e=null==(t=this.view)||null==(s=t.environment)?void 0:s.starsEnabled)&&e}}_createOrDestroyStars({view:e,starsEnabled:t}){t&&h(this._stars)?(this._stars=new T({view:e,requestRender:()=>this._setNeedsRender()}),this._setNeedsRender()):!t&&o(this._stars)&&(this._stars.destroy(),this._stars=null,this._setNeedsRender())}_createOrDestroyPrecipitation(e){this.precipitationEnabled&&h(this._precipitation)?(a(e,(({context:e,view:t})=>{this._precipitation=new N(e,t)})),this._setNeedsRender()):!this.precipitationEnabled&&o(this._precipitation)&&(this._precipitation=n(this._precipitation),this._setNeedsRender())}_updateFog(e){h(this._fog)||h(e)||("foggy"===e.type?this._fog.strength=r(3e-5,.005,e.weatherAdjustment**3):this._fog.strength=4e-6)}get _environmentPostProcessCreationParameters(){return!this.weatherEnabled||h(this._context)?null:{view:this.view,context:this._context}}_createOrDestroyFog(e){this.weatherEnabled&&h(this._fog)?(a(e,(({view:e,context:t})=>{this._fog=new C(t,e)})),this._updateFog(this._weatherUpdateParameters),this._setNeedsRender()):o(this._fog)&&(this._fog.destroy(),this._fog=null,this._setNeedsRender())}_updateAtmosphere(){const e=this._selectAtmosphereType();if(this.atmosphereType===e)return;o(this._pendingAtmosphere)&&(this._pendingAtmosphere!==this._atmosphere&&this._pendingAtmosphere.destroy(),this._pendingAtmosphere=null);const t=this._getAtmosphereClass();if(!t)return o(this._atmosphere)&&(this._atmosphere.destroy(),this._atmosphere=null,this._setNeedsRender()),void this._updateBasemapTerrain();const s=new t(this.view);o(this._context)&&s.initializeRenderContext(this._context),h(this._atmosphere)&&(this._atmosphere=s,this._setNeedsRender()),this._pendingAtmosphere=s,s.when().then((()=>{o(this._atmosphere)&&this._pendingAtmosphere&&this._pendingAtmosphere!==this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=this._pendingAtmosphere),this._pendingAtmosphere=null,this._setNeedsRender(),this._updateBasemapTerrain()})).catch((()=>{this._pendingAtmosphere===s&&(this._pendingAtmosphere=null)}))}_getAtmosphereClass(){switch(this._selectAtmosphereType()){case"none":return null;case"realistic":return y;case"panoramic":return E;case"simple":return j;default:return}}_selectAtmosphereType(){const e=this.view.get("environment.atmosphereEnabled"),t=this.view.get("environment.atmosphere.quality"),s=this.view.viewingMode;return!e||null==t||g(this.view.spatialReference)?"none":"local"===s?"panoramic":"high"===t&&o(this._context)&&y.isSupported(this._context)&&w(this.view.spatialReference)?"realistic":"simple"}_updateBasemapTerrain(){this.view.basemapTerrain&&(this.view.basemapTerrain.velvetOverground=o(this._atmosphere)&&"simple"===this.atmosphereType)}get test(){return{atmosphere:this._atmosphere,clouds:this._clouds,selectAtmosphereType:()=>this._selectAtmosphereType()}}};e([m({constructOnly:!0})],D.prototype,"view",void 0),e([m({type:Boolean,readOnly:!0})],D.prototype,"updating",null),e([m()],D.prototype,"weatherVisible",null),e([m()],D.prototype,"_pendingAtmosphere",void 0),e([m()],D.prototype,"_stars",void 0),e([m()],D.prototype,"_precipitation",void 0),e([m()],D.prototype,"_clouds",void 0),e([m()],D.prototype,"_cloudComposition",void 0),e([m()],D.prototype,"_fog",void 0),e([m()],D.prototype,"weatherEnabled",null),e([m()],D.prototype,"precipitationEnabled",null),e([m()],D.prototype,"_cloudsCreationParameters",null),e([m()],D.prototype,"_weatherUpdateParameters",null),e([m()],D.prototype,"_starsCreationParameters",null),e([m()],D.prototype,"_environmentPostProcessCreationParameters",null),D=e([_("esri.views.3d.environment.EnvironmentRenderer")],D);export{D as EnvironmentRenderer};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import"../../../core/has.js";import s from"../../../core/Handles.js";import{equalsShallow as i}from"../../../core/lang.js";import{lerp as r}from"../../../core/mathUtils.js";import{isSome as o,destroyMaybe as n,applySome as a,isNone as h}from"../../../core/maybe.js";import{watch as p,syncAndInitial as l}from"../../../core/reactiveUtils.js";import{when as m}from"../../../core/watchUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{l as c}from"../../../chunks/vec3.js";import{getReferenceEllipsoid as u}from"../../../geometry/projectionEllipsoid.js";import{isMoon as g,isEarth as v}from"../../../geometry/support/spatialReferenceUtils.js";import{enablePrecipitation as w}from"../../../support/featureFlags.js";import{ChapmanAtmosphere as y}from"./ChapmanAtmosphere.js";import{CloudsComposition as f}from"./CloudsComposition.js";import{isReadyCloudsData as A}from"./CloudsData.js";import{CloudsGenerator as R}from"./CloudsGenerator.js";import{cloudPresets as C}from"./CloudsPresets.js";import{Fog as P}from"./Fog.js";import{PanoramicAtmosphere as E}from"./PanoramicAtmosphere.js";import{Precipitation as N}from"./Precipitation.js";import{P as b}from"../../../chunks/Precipitation.glsl.js";import j from"./SimpleAtmosphere.js";import{Stars as T}from"./Stars.js";import{weatherHeightLimit as x}from"./weather.js";import{RenderPass as O}from"../webgl-engine/lib/RenderPass.js";import{RenderSlot as S}from"../webgl-engine/lib/RenderSlot.js";var M;const D=[S.POSTPROCESSING_ENVIRONMENT_OPAQUE,S.POSTPROCESSING_ENVIRONMENT_TRANSPARENT];let I,U=M=class extends t{constructor(e){super(e),this._handles=new s,this._context=null,this._pendingAtmosphere=null,this._atmosphere=null,this._stars=null,this._precipitation=null,this._clouds=null,this._cloudComposition=null,this._fog=null}get atmosphereType(){return o(this._pendingAtmosphere)?this._pendingAtmosphere.type:o(this._atmosphere)?this._atmosphere.type:"none"}get canRender(){var e;return!(null==(e=this.view.basemapTerrain)||!e.renderer.canRender)||"global"!==this.view.viewingMode}get needsLinearDepth(){return"realistic"===this._selectAtmosphereType()}updateAnimation(e){return!!o(this._precipitation)&&this._precipitation.update(e)}get updating(){return o(this._pendingAtmosphere)||o(this._stars)&&this._stars.updating||o(this._clouds)&&this._clouds.running}get weatherVisible(){return c(this.view.state.camera.eye)-u(this.view.spatialReference).radius<=x}get weatherEnabled(){var e;return!(null==(e=this.view.environmentManager)||!e.weatherEnabled)}get precipitationEnabled(){return w()}initialize(){this.view._stage.addRenderPlugin(D,this)}destroy(){this._pendingAtmosphere=n(this._pendingAtmosphere),this.uninitializeRenderContext(),this._handles=n(this._handles),this.view&&null!=this.view._stage&&(this.view._stage.removeRenderPlugin(this),this._set("view",null))}initializeRenderContext(e=null){this._context=e,this._handles.add([m(this.view,"basemapTerrain",(()=>this._updateBasemapTerrain()),!0),p((()=>({viewingMode:this.view.viewingMode,atmosphereEnabled:this.view.environment.atmosphereEnabled,atmosphereQuality:this.view.environment.atmosphere.quality})),(()=>this._updateAtmosphere()),l),p((()=>this._starsCreationParameters),(e=>this._createOrDestroyStars(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._environmentPostProcessCreationParameters),(e=>this._createOrDestroyPrecipitation(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._cloudsCreationParameters),(e=>this._createOrDestroyClouds(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._environmentPostProcessCreationParameters),(e=>this._createOrDestroyFog(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._weatherUpdateParameters),(e=>{this._updateWeather(e),this._updateFog(e)}),l)])}uninitializeRenderContext(){this._stars=n(this._stars),this._precipitation=n(this._precipitation),this._atmosphere=n(this._atmosphere),this._clouds=n(this._clouds),this._cloudComposition=n(this._cloudComposition),this._fog=n(this._fog)}render(e){if(e.pass===O.MATERIAL)switch(e.slot){case S.POSTPROCESSING_ENVIRONMENT_OPAQUE:o(this._stars)&&this._stars.render(e),o(this._atmosphere)&&this._atmosphere.canRender&&(this._atmosphere.render(e),A(this._clouds)&&o(this._cloudComposition)&&(this._cloudComposition.render(e,this._clouds,o(this.view.animation)),this._cloudComposition.isFading&&this._setNeedsRender()));break;case S.POSTPROCESSING_ENVIRONMENT_TRANSPARENT:if(o(this._atmosphere)&&this._atmosphere.canRender){const t=this.weatherEnabled?this.view.environment.weather.type:"disabled";this._atmosphere.renderHaze(e,"rainy"===t),o(this._fog)&&("foggy"!==t&&"realistic"===this._selectAtmosphereType()||this._fog.render(e,"foggy"===t,"rainy"===t)),"rainy"!==this.view.environment.weather.type&&"snowy"!==this.view.environment.weather.type||o(this._precipitation)&&this._precipitation.render(e,this.view.environment.weather.precipitation,"rainy"===this.view.environment.weather.type?b.RAIN:b.SNOW)}}}get _cloudsCreationParameters(){return this.weatherEnabled?{view:this.view,viewingMode:this.view.state.viewingMode,rctx:o(this._context)?this._context.renderContext.rctx:null,radius:u(this.view.spatialReference).radius}:null}_createOrDestroyClouds(e){this._clouds=n(this._clouds),this._cloudComposition=n(this._cloudComposition),a(e,(({view:e,viewingMode:t,rctx:s,radius:i})=>{this._clouds=new R({rctx:s,view:e,requestRender:()=>this._setNeedsRender()}),this._cloudComposition=new f(s,t,i,c(e.state.camera.eye)-i)})),this._setNeedsRender()}get _weatherUpdateParameters(){const e=this.weatherEnabled?this.view.environment.weather:null;return h(e)?null:{type:e.type,weatherAdjustment:"foggy"===e.type?e.fogStrength:e.cloudCover}}_updateWeather(e){h(e)||h(this._clouds)||this._clouds.applyPreset(C[e.type],e.weatherAdjustment)}_setNeedsRender(){o(this._context)&&this._context.requestRender()}get _starsCreationParameters(){var e,t,s;return{view:this.view,starsEnabled:null!=(e=null==(t=this.view)||null==(s=t.environment)?void 0:s.starsEnabled)&&e}}_createOrDestroyStars({view:e,starsEnabled:t}){t&&h(this._stars)?(this._stars=new T({view:e,requestRender:()=>this._setNeedsRender()}),this._setNeedsRender()):!t&&o(this._stars)&&(this._stars.destroy(),this._stars=null,this._setNeedsRender())}_createOrDestroyPrecipitation(e){this.precipitationEnabled&&h(this._precipitation)?(a(e,(({context:e,view:t})=>{this._precipitation=new N(e,t)})),this._setNeedsRender()):!this.precipitationEnabled&&o(this._precipitation)&&(this._precipitation=n(this._precipitation),this._setNeedsRender())}_updateFog(e){h(this._fog)||h(e)||("foggy"===e.type?this._fog.strength=r(3e-5,.005,e.weatherAdjustment**3):this._fog.strength=4e-6)}get _environmentPostProcessCreationParameters(){return!this.weatherEnabled||h(this._context)?null:{view:this.view,context:this._context}}_createOrDestroyFog(e){this.weatherEnabled&&h(this._fog)?(a(e,(({view:e,context:t})=>{this._fog=new P(t,e)})),this._updateFog(this._weatherUpdateParameters),this._setNeedsRender()):o(this._fog)&&(this._fog.destroy(),this._fog=null,this._setNeedsRender())}_updateAtmosphere(){const e=this._selectAtmosphereType();if(this.atmosphereType===e)return;o(this._pendingAtmosphere)&&(this._pendingAtmosphere!==this._atmosphere&&this._pendingAtmosphere.destroy(),this._pendingAtmosphere=null);const t=this._getAtmosphereClass();if(!t)return o(this._atmosphere)&&(this._atmosphere.destroy(),this._atmosphere=null,this._setNeedsRender()),void this._updateBasemapTerrain();const s=new t(this.view);o(this._context)&&s.initializeRenderContext(this._context),h(this._atmosphere)&&(this._atmosphere=s,this._setNeedsRender()),this._pendingAtmosphere=s,s.when().then((()=>{o(this._atmosphere)&&this._pendingAtmosphere&&this._pendingAtmosphere!==this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=this._pendingAtmosphere),this._pendingAtmosphere=null,this._setNeedsRender(),this._updateBasemapTerrain()})).catch((()=>{this._pendingAtmosphere===s&&(this._pendingAtmosphere=null)}))}_getAtmosphereClass(){switch(this._selectAtmosphereType()){case"none":return null;case"realistic":return y;case"panoramic":return E;case"simple":return j;default:return}}_selectAtmosphereType(){const e=this.view.get("environment.atmosphereEnabled"),t=this.view.get("environment.atmosphere.quality"),s=this.view.viewingMode;return!e||null==t||g(this.view.spatialReference)?"none":"local"===s?"panoramic":"high"===t&&o(this._context)&&y.isSupported(this._context)&&v(this.view.spatialReference)?"realistic":"simple"}_updateBasemapTerrain(){this.view.basemapTerrain&&(this.view.basemapTerrain.velvetOverground=o(this._atmosphere)&&"simple"===this.atmosphereType)}get test(){return{atmosphere:this._atmosphere,clouds:this._clouds,selectAtmosphereType:()=>this._selectAtmosphereType(),stubGetAtmosphereClass:e=>{I=M.prototype._getAtmosphereClass,M.prototype._getAtmosphereClass=e},restoreGetAtmosphereClass:()=>{M.prototype._getAtmosphereClass=I}}}};e([d({constructOnly:!0})],U.prototype,"view",void 0),e([d({type:Boolean,readOnly:!0})],U.prototype,"updating",null),e([d()],U.prototype,"weatherVisible",null),e([d()],U.prototype,"_pendingAtmosphere",void 0),e([d()],U.prototype,"_stars",void 0),e([d()],U.prototype,"_precipitation",void 0),e([d()],U.prototype,"_clouds",void 0),e([d()],U.prototype,"_cloudComposition",void 0),e([d()],U.prototype,"_fog",void 0),e([d()],U.prototype,"weatherEnabled",null),e([d()],U.prototype,"precipitationEnabled",null),e([d()],U.prototype,"_cloudsCreationParameters",null),e([d()],U.prototype,"_weatherUpdateParameters",null),e([d()],U.prototype,"_starsCreationParameters",null),e([d()],U.prototype,"_environmentPostProcessCreationParameters",null),U=M=e([_("esri.views.3d.environment.EnvironmentRenderer")],U);export{U as EnvironmentRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{smoothstep as e,lerp as t}from"../../../core/mathUtils.js";import{isNone as i,releaseMaybe as r,disposeMaybe as s}from"../../../core/maybe.js";import{a}from"../../../chunks/mat4.js";import{c as h}from"../../../chunks/mat4f64.js";import{s as o}from"../../../chunks/vec2.js";import{a as n}from"../../../chunks/vec2f64.js";import{l as c}from"../../../chunks/vec3.js";import{getReferenceEllipsoid as u}from"../../../geometry/projectionEllipsoid.js";import{atmosphereHeight as _}from"./atmosphereUtils.js";import{FogTechniqueConfiguration as f,FogTechnique as m}from"./FogTechnique.js";import{weatherHeightLimit as g}from"./weather.js";import{Pos2Tex as d}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{createQuadVAO as p}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as l}from"../../webgl/enums.js";class v{constructor(e,t){this._projectionInverse=h(),this._viewInverse=h(),this._nearFar=n(),this._darkenHaze=!1,this._hazeMultiplier=1,this._foggyFadeStart=.3,this._foggyFadeEnd=.6,this._hazeFadeStart=.7,this._hazeFadeEnd=1,this._hazeFadeBuffer=500,this._strength=4e-6,this._view=t;const i=e.renderContext.rctx;this._vao=p(i,d),this._shaderTechniqueRepository=e.shaderTechniqueRep;const r=u(t.spatialReference);this._planetRadius=r.radius,this._atmosphereRadius=r.radius+_}set strength(e){this._strength=e}get strength(){return this._strength}get foggyWeatherTechnique(){if(i(this._foggyWeatherTechnique)){const e=new f;e.haze=!1,this._foggyWeatherTechnique=this._shaderTechniqueRepository.acquire(m,e)}return this._foggyWeatherTechnique}get distanceFogTechnique(){if(i(this._distanceFogTechnique)){const e=new f;e.haze=!0,this._distanceFogTechnique=this._shaderTechniqueRepository.acquire(m,e)}return this._distanceFogTechnique}destroy(){this._distanceFogTechnique=r(this._distanceFogTechnique),this._foggyWeatherTechnique=r(this._foggyWeatherTechnique),this._vao=s(this._vao)}when(){return Promise.resolve()}render(e,t,i){if(0===this._view.basemapTerrain.baseOpacity&&!t)return;if(this._darkenHaze=i,this._update(e.camera,t),this._fogAmount<=0)return;const r=e.rctx,s=e.offscreenRenderingHelper,a=t?this.foggyWeatherTechnique:this.distanceFogTechnique;r.useProgram(a.program),a.bindPipelineState(r),s.renderDepthDetached((()=>{a.program.bindTexture(s.depthTexture,"depthTex"),this._renderFog(a.program,e)}))}_renderFog(e,t){if(i(this._vao))return!1;const r=t.rctx;return t.scenelightingData.setLightDirectionUniform(e),e.setUniform3fv("cameraPosition",t.camera.eye),e.setUniformMatrix4fv("inverseProjectionMatrix",this._projectionInverse),e.setUniformMatrix4fv("inverseViewMatrix",this._viewInverse),e.setUniform2fv("nearFar",this._nearFar),e.setUniform1f("atmosphereC",this._atmosphereC),e.setUniform1f("fogStrength",this._strength),e.setUniform1f("fogAmount",this._hazeMultiplier*this._fogAmount),r.bindVAO(this._vao),e.assertCompatibleVertexAttributeLocations(this._vao),r.drawArrays(l.TRIANGLE_STRIP,0,4),!0}_update(r,s){if(i(r))return;a(this._projectionInverse,r.projectionMatrix),a(this._viewInverse,r.viewMatrix),o(this._nearFar,r.near,r.far);const h=c(r.eye),n=h*h;this._atmosphereC=n-this._atmosphereRadius*this._atmosphereRadius,this._fogAmount=s?1-e(this._foggyFadeStart*g,this._foggyFadeEnd*g,Math.abs(h-this._planetRadius)):1-e(this._hazeFadeStart*g,this._hazeFadeEnd*g,Math.abs(h-this._planetRadius)),this._hazeMultiplier=this._darkenHaze?t(.4,1,e(g-this._hazeFadeBuffer,g+this._hazeFadeBuffer,Math.abs(h-this._planetRadius))):1}static isSupported(e){return e.capabilities.depthTexture}}export{v as Fog};
5
+ import{smoothstep as e,lerp as t}from"../../../core/mathUtils.js";import{isNone as i,releaseMaybe as s,disposeMaybe as r}from"../../../core/maybe.js";import{a}from"../../../chunks/mat4.js";import{c as h}from"../../../chunks/mat4f64.js";import{s as n}from"../../../chunks/vec2.js";import{a as o}from"../../../chunks/vec2f64.js";import{l as c}from"../../../chunks/vec3.js";import{getReferenceEllipsoid as u}from"../../../geometry/projectionEllipsoid.js";import{atmosphereHeight as _}from"./atmosphereUtils.js";import{FogTechniqueConfiguration as f,FogTechnique as m}from"./FogTechnique.js";import{weatherHeightLimit as g}from"./weather.js";import{Pos2Tex as d}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{createQuadVAO as p}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as l}from"../../webgl/enums.js";class v{constructor(e,t){this._projectionInverse=h(),this._viewInverse=h(),this._nearFar=o(),this._darkenHaze=!1,this._hazeMultiplier=1,this._foggyFadeStart=.3,this._foggyFadeEnd=.6,this._hazeFadeStart=.7,this._hazeFadeEnd=1,this._hazeFadeBuffer=500,this._strength=4e-6,this._view=t;const i=e.renderContext.rctx;this._vao=p(i,d),this._shaderTechniqueRepository=e.shaderTechniqueRep;const s=u(t.spatialReference);this._planetRadius=s.radius,this._atmosphereRadius=s.radius+_}set strength(e){this._strength=e}get strength(){return this._strength}get foggyWeatherTechnique(){if(i(this._foggyWeatherTechnique)){const e=new f;e.haze=!1,this._foggyWeatherTechnique=this._shaderTechniqueRepository.acquire(m,e)}return this._foggyWeatherTechnique}get distanceFogTechnique(){if(i(this._distanceFogTechnique)){const e=new f;e.haze=!0,this._distanceFogTechnique=this._shaderTechniqueRepository.acquire(m,e)}return this._distanceFogTechnique}destroy(){this._distanceFogTechnique=s(this._distanceFogTechnique),this._foggyWeatherTechnique=s(this._foggyWeatherTechnique),this._vao=r(this._vao)}when(){return Promise.resolve()}render(e,t,i){if(0===this._view.basemapTerrain.baseOpacity&&!t)return;if(this._darkenHaze=i,this._update(e.camera,t),this._fogAmount<=0)return;const s=e.offscreenRenderingHelper,r=t?this.foggyWeatherTechnique:this.distanceFogTechnique,a=e.rctx.useTechnique(r);s.renderDepthDetached((()=>{a.bindTexture(s.depthTexture,"depthTex"),this._renderFog(r.program,e)}))}_renderFog(e,t){if(i(this._vao))return!1;const s=t.rctx;return t.scenelightingData.setLightDirectionUniform(e),e.setUniform3fv("cameraPosition",t.camera.eye),e.setUniformMatrix4fv("inverseProjectionMatrix",this._projectionInverse),e.setUniformMatrix4fv("inverseViewMatrix",this._viewInverse),e.setUniform2fv("nearFar",this._nearFar),e.setUniform1f("atmosphereC",this._atmosphereC),e.setUniform1f("fogStrength",this._strength),e.setUniform1f("fogAmount",this._hazeMultiplier*this._fogAmount),s.bindVAO(this._vao),e.assertCompatibleVertexAttributeLocations(this._vao),s.drawArrays(l.TRIANGLE_STRIP,0,4),!0}_update(s,r){if(i(s))return;a(this._projectionInverse,s.projectionMatrix),a(this._viewInverse,s.viewMatrix),n(this._nearFar,s.near,s.far);const h=c(s.eye),o=h*h;this._atmosphereC=o-this._atmosphereRadius*this._atmosphereRadius,this._fogAmount=r?1-e(this._foggyFadeStart*g,this._foggyFadeEnd*g,Math.abs(h-this._planetRadius)):1-e(this._hazeFadeStart*g,this._hazeFadeEnd*g,Math.abs(h-this._planetRadius)),this._hazeMultiplier=this._darkenHaze?t(.4,1,e(g-this._hazeFadeBuffer,g+this._hazeFadeBuffer,Math.abs(h-this._planetRadius))):1}static isSupported(e){return e.capabilities.depthTexture}}export{v as Fog};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/has.js";import{releaseMaybe as t,disposeMaybe as i,isNone as r}from"../../../core/maybe.js";import{NoiseTextureAtlasTechnique as s}from"./NoiseTextureAtlasTechnique.js";import{createQuadVAO as o}from"../webgl-engine/lib/glUtil3D.js";import{TargetType as a,TextureType as h,PixelFormat as f,PixelType as m,TextureWrapMode as n,TextureSamplingMode as l}from"../../webgl/enums.js";import{FramebufferObject as u}from"../../webgl/FramebufferObject.js";const _=e("esri-mobile")?64:128,c=_/128,g=Math.ceil(Math.sqrt(_)),p=(_+2)*g;class w{constructor(e,t){this._frameBuffer=new u(e,{colorTarget:a.TEXTURE,width:p,height:p},{target:h.TEXTURE_2D,pixelFormat:f.RGBA,dataType:m.UNSIGNED_BYTE,wrapMode:n.CLAMP_TO_EDGE,samplingMode:l.LINEAR,hasMipmap:!1,width:p,height:p}),this._vao=o(e),this._technique=new s({rctx:e,viewingMode:t.state.viewingMode},null)}get textureAtlas(){return this._frameBuffer.colorTexture}destroy(){this._technique=t(this._technique),this._frameBuffer=i(this._frameBuffer),this._vao=i(this._vao)}render(e){if(r(this._vao)||r(this.textureAtlas))return;const t=e.getViewport();e.setViewport(0,0,p,p),e.bindFramebuffer(this._frameBuffer);const i=this._technique.program;e.useProgram(i),this._technique.bindPipelineState(e),i.setUniform1f("tileSize",_),i.setUniform1f("tileRows",g),e.bindVAO(this._vao),i.assertCompatibleVertexAttributeLocations(this._vao),e.gl.drawArrays(e.gl.TRIANGLE_STRIP,0,4),e.setViewport(t.x,t.y,t.width,t.height)}}export{p as ATLAS_SIZE,w as NoiseTextureAtlas,c as TEXTURE_SCALE,g as TILE_ROWS,_ as TILE_SIZE};
5
+ import e from"../../../core/has.js";import{releaseMaybe as t,disposeMaybe as i,isNone as r}from"../../../core/maybe.js";import{NoiseTextureAtlasTechnique as s}from"./NoiseTextureAtlasTechnique.js";import{createQuadVAO as o}from"../webgl-engine/lib/glUtil3D.js";import{TargetType as a,TextureType as h,PixelFormat as f,PixelType as m,TextureWrapMode as n,TextureSamplingMode as u}from"../../webgl/enums.js";import{FramebufferObject as l}from"../../webgl/FramebufferObject.js";const c=e("esri-mobile")?64:128,_=c/128,g=Math.ceil(Math.sqrt(c)),p=(c+2)*g;class w{constructor(e,t){this._frameBuffer=new l(e,{colorTarget:a.TEXTURE,width:p,height:p},{target:h.TEXTURE_2D,pixelFormat:f.RGBA,dataType:m.UNSIGNED_BYTE,wrapMode:n.CLAMP_TO_EDGE,samplingMode:u.LINEAR,hasMipmap:!1,width:p,height:p}),this._vao=o(e),this._technique=new s({rctx:e,viewingMode:t.state.viewingMode},null)}get textureAtlas(){return this._frameBuffer.colorTexture}destroy(){this._technique=t(this._technique),this._frameBuffer=i(this._frameBuffer),this._vao=i(this._vao)}render(e){if(r(this._vao)||r(this.textureAtlas))return;const t=e.getViewport();e.setViewport(0,0,p,p),e.bindFramebuffer(this._frameBuffer);const i=e.useTechnique(this._technique);i.setUniform1f("tileSize",c),i.setUniform1f("tileRows",g),e.bindVAO(this._vao),i.assertCompatibleVertexAttributeLocations(this._vao),e.gl.drawArrays(e.gl.TRIANGLE_STRIP,0,4),e.setViewport(t.x,t.y,t.width,t.height)}}export{p as ATLAS_SIZE,w as NoiseTextureAtlas,_ as TEXTURE_SCALE,g as TILE_ROWS,c as TILE_SIZE};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Logger.js";import{disposeMaybe as t,abortMaybe as r}from"../../../core/maybe.js";import{createResolver as o,isAbortError as i}from"../../../core/promiseUtils.js";import{c as s}from"../../../chunks/mat4.js";import{c as n}from"../../../chunks/mat4f64.js";import{requestImage as a}from"../../../support/requestImageUtils.js";import{S as m}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechniqueConfiguration as l,SimpleAtmosphereTechnique as h}from"./SimpleAtmosphereTechnique.js";import c from"./resources/SimpleAtmosphereTexture.js";import{glLayout as p}from"../support/buffer/glUtil.js";import{newLayout as u}from"../support/buffer/InterleavedLayout.js";import{bindProjectionMatrix as f}from"../webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Default3D as g}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import _ from"../webgl-engine/lib/GeometryUtil.js";import{VertexAttribute as d}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as b}from"../../webgl/BufferObject.js";import{PixelFormat as y,PixelType as j,TextureWrapMode as x,TextureSamplingMode as v,PrimitiveType as w,Usage as A}from"../../webgl/enums.js";import{Texture as T}from"../../webgl/Texture.js";import{vertexCount as C}from"../../webgl/Util.js";import{VertexArrayObject as R}from"../../webgl/VertexArrayObject.js";const q=e.getLogger("esri.views.3d.environment.PanoramicAtmosphere");class I{constructor(){this.type="panoramic",this._atmosphereTechniqueConfig=new l,this._readyResolver=o(),this._readyController=new AbortController}destroy(){this._readyResolver.reject(),this._texture=t(this._texture),this._vao=t(this._vao),this._readyController=r(this._readyController)}when(){return this._readyResolver.promise}initializeRenderContext(e){this._atmosphereTechniqueConfig.geometry=m.Cylinder,this._atmosphereTechnique=e.shaderTechniqueRep.acquire(h,this._atmosphereTechniqueConfig);const t=e.renderContext.rctx;this._vao=this._createVertexArrayObject(t),this._vaoCount=C(this._vao,"geometry"),a(c,{signal:this._readyController.signal}).then((r=>{this._texture=new T(t,{pixelFormat:y.RGBA,dataType:j.UNSIGNED_BYTE,wrapMode:x.CLAMP_TO_EDGE,samplingMode:v.LINEAR,flipped:!0},r),e.requestRender(),this._readyController=null,this._readyResolver.resolve()})).catch((e=>{i(e)||q.error("Unable to initialize atmosphere: image request failed",e),this._readyResolver.reject()}))}get canRender(){return null!=this._texture}render(e){const t=e.rctx,r=this._atmosphereTechnique.program;t.useProgram(r),this._atmosphereTechnique.bindPipelineState(t),r.bindTexture(this._texture,"tex"),f(r,e.camera.projectionMatrix),O(S,e.camera.viewMatrix),r.setUniformMatrix4fv("view",S),r.setUniform4f("uColor",1,1,1,1),e.scenelightingData.setLightDirectionUniform(r),t.bindVAO(this._vao),r.assertCompatibleVertexAttributeLocations(this._vao),t.drawArrays(w.TRIANGLES,0,this._vaoCount)}renderHaze(){return!1}_createVertexArrayObject(e){const t=_.createPolySphereGeometry(1,2,!1),r=t.indices.get(d.POSITION);for(let n=0;n<r.length;n+=3){const e=r[n];r[n]=r[n+2],r[n+2]=e}const o=t.vertexAttributes.get(d.POSITION).data,i=L.createBuffer(r.length),s=i.position;for(let n=0;n<r.length;++n){const e=3*r[n];s.set(n,0,o[e]),s.set(n,1,o[e+1]),s.set(n,2,o[e+2])}return new R(e,g,{geometry:p(L)},{geometry:b.createVertex(e,A.STATIC_DRAW,i.buffer)})}}function O(e,t){s(e,t),e[12]=0,e[13]=0,e[14]=0,e[15]=1}const S=n(),L=u().vec3f(d.POSITION);export{I as PanoramicAtmosphere};
5
+ import e from"../../../core/Logger.js";import{disposeMaybe as t,abortMaybe as r}from"../../../core/maybe.js";import{createResolver as o,isAbortError as i}from"../../../core/promiseUtils.js";import{c as s}from"../../../chunks/mat4.js";import{c as n}from"../../../chunks/mat4f64.js";import{requestImage as a}from"../../../support/requestImageUtils.js";import{S as m}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechniqueConfiguration as l,SimpleAtmosphereTechnique as c}from"./SimpleAtmosphereTechnique.js";import h from"./resources/SimpleAtmosphereTexture.js";import{glLayout as u}from"../support/buffer/glUtil.js";import{newLayout as p}from"../support/buffer/InterleavedLayout.js";import{bindProjectionMatrix as f}from"../webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Default3D as g}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import _ from"../webgl-engine/lib/GeometryUtil.js";import{VertexAttribute as d}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as b}from"../../webgl/BufferObject.js";import{PixelFormat as y,PixelType as j,TextureWrapMode as x,TextureSamplingMode as v,PrimitiveType as w,Usage as A}from"../../webgl/enums.js";import{Texture as C}from"../../webgl/Texture.js";import{vertexCount as T}from"../../webgl/Util.js";import{VertexArrayObject as R}from"../../webgl/VertexArrayObject.js";const q=e.getLogger("esri.views.3d.environment.PanoramicAtmosphere");class I{constructor(){this.type="panoramic",this._techniqueConfig=new l,this._readyResolver=o(),this._readyController=new AbortController}destroy(){this._readyResolver.reject(),this._texture=t(this._texture),this._vao=t(this._vao),this._readyController=r(this._readyController)}when(){return this._readyResolver.promise}initializeRenderContext(e){this._techniqueConfig.geometry=m.Cylinder,this._technique=e.shaderTechniqueRep.acquire(c,this._techniqueConfig);const t=e.renderContext.rctx;this._vao=this._createVertexArrayObject(t),this._vaoCount=T(this._vao,"geometry"),a(h,{signal:this._readyController.signal}).then((r=>{this._texture=new C(t,{pixelFormat:y.RGBA,dataType:j.UNSIGNED_BYTE,wrapMode:x.CLAMP_TO_EDGE,samplingMode:v.LINEAR,flipped:!0},r),e.requestRender(),this._readyController=null,this._readyResolver.resolve()})).catch((e=>{i(e)||q.error("Unable to initialize atmosphere: image request failed",e),this._readyResolver.reject()}))}get canRender(){return null!=this._texture}render(e){const t=e.rctx,r=t.useTechnique(this._technique);r.bindTexture(this._texture,"tex"),f(r,e.camera.projectionMatrix),O(S,e.camera.viewMatrix),r.setUniformMatrix4fv("view",S),r.setUniform4f("uColor",1,1,1,1),e.scenelightingData.setLightDirectionUniform(r),t.bindVAO(this._vao),r.assertCompatibleVertexAttributeLocations(this._vao),t.drawArrays(w.TRIANGLES,0,this._vaoCount)}renderHaze(){return!1}_createVertexArrayObject(e){const t=_.createPolySphereGeometry(1,2,!1),r=t.indices.get(d.POSITION);for(let n=0;n<r.length;n+=3){const e=r[n];r[n]=r[n+2],r[n+2]=e}const o=t.vertexAttributes.get(d.POSITION).data,i=L.createBuffer(r.length),s=i.position;for(let n=0;n<r.length;++n){const e=3*r[n];s.set(n,0,o[e]),s.set(n,1,o[e+1]),s.set(n,2,o[e+2])}return new R(e,g,{geometry:u(L)},{geometry:b.createVertex(e,A.STATIC_DRAW,i.buffer)})}}function O(e,t){s(e,t),e[12]=0,e[13]=0,e[14]=0,e[15]=1}const S=n(),L=p().vec3f(d.POSITION);export{I as PanoramicAtmosphere};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{isNone as t,disposeMaybe as r,isSome as i}from"../../../core/maybe.js";import{secondsFromMilliseconds as s}from"../../../core/time.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as o}from"../../../geometry/projectionEllipsoid.js";import{P as c}from"../../../chunks/Precipitation.glsl.js";import{PrecipitationTechniqueConfiguration as u,PrecipitationTechnique as h}from"./PrecipitationTechnique.js";import{glLayout as p}from"../support/buffer/glUtil.js";import{newLayout as m}from"../support/buffer/InterleavedLayout.js";import{AnimationTimer as _}from"../webgl-engine/lib/AnimationTimer.js";import{VertexAttribute as d}from"../webgl-engine/lib/VertexAttribute.js";import{WatchUpdatingTracking as f}from"../../support/WatchUpdatingTracking.js";import{BufferObject as l}from"../../webgl/BufferObject.js";import{PrimitiveType as T,Usage as g}from"../../webgl/enums.js";import{bindVertexBufferLayout as b,unbindVertexBufferLayout as y}from"../../webgl/Util.js";import{VertexArrayObject as j}from"../../webgl/VertexArrayObject.js";let w=class{constructor(e,t){this._numParticles=25e4,this._rainSpeed=.1,this._snowSpeed=.01,this._renderParameter={camera:null,time:0,radius:1},this._animation=new _,this._updatingTracking=new f,this._renderParameter.time=0,this._renderParameter.radius=o(t.spatialReference).radius,this._shaderTechniqueRepository=e.shaderTechniqueRep}get updating(){return this._updatingTracking.updating}get rainTechnique(){if(t(this._rainTechnique)){const e=new u;e.type=c.RAIN,this._rainTechnique=this._shaderTechniqueRepository.acquire(h,e)}return this._rainTechnique}get snowTechnique(){if(t(this._snowTechnique)){const e=new u;e.type=c.SNOW,this._snowTechnique=this._shaderTechniqueRepository.acquire(h,e)}return this._snowTechnique}destroy(){this._updatingTracking.destroy(),this._numParticles=0,this._snowTechnique=r(this._snowTechnique),this._rainTechnique=r(this._rainTechnique),this._vao=r(this._vao),this._instanceIdBuffer=r(this._instanceIdBuffer)}update(e){return this._animation.advance(e)}render(e,r,i){const{rctx:n,camera:a}=e;this._ensureResources(n);const o=i===c.RAIN?this.rainTechnique:this.snowTechnique;if(t(o)||t(this._vao)||t(this._instanceIdBuffer))return!1;const u=o.program,p=h.attributeLocation;return n.useProgram(u),this._renderParameter.camera=a,this._renderParameter.time=(i===c.RAIN?this._rainSpeed:this._snowSpeed)*s(this._animation.time),o.bindPass(this._renderParameter),o.bindPipelineState(n),n.bindVAO(this._vao),u.assertCompatibleVertexAttributeLocations(this._vao),b(n,p,this._instanceIdBuffer,q,0),n.capabilities.instancing.drawArraysInstanced(T.TRIANGLES,0,3,this._numParticles*r),y(n,p,this._instanceIdBuffer,q),!0}_ensureResources(e){i(this._vao)||(this._vao=this._createVertexArrayObject(e),i(this._instanceIdBuffer)||(this._instanceIdBuffer=this._createInstanceIndices(e)))}_createInstanceIndices(e){const t=[];for(let r=0;r<this._numParticles;r++)t.push(r);return l.createVertex(e,g.STATIC_DRAW,new Float32Array(t))}_createVertexArrayObject(e){const t=new Float32Array([-1,0,1,1,0,-1,1,0,1]);return new j(e,h.attributeLocation,{geometry:p(I)},{geometry:l.createVertex(e,g.STATIC_DRAW,t)})}};e([n({constructOnly:!0})],w.prototype,"requestRender",void 0),e([n({readOnly:!0})],w.prototype,"updating",null),e([n()],w.prototype,"_updatingTracking",void 0),w=e([a("esri.views.3d.environment.Precipitation")],w);const I=m().vec3f(d.POSITION),q=p(m().f32(d.INSTANCEFEATUREATTRIBUTE),1);export{w as Precipitation};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{isNone as t,disposeMaybe as r,isSome as i}from"../../../core/maybe.js";import{secondsFromMilliseconds as s}from"../../../core/time.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as a}from"../../../geometry/projectionEllipsoid.js";import{P as c}from"../../../chunks/Precipitation.glsl.js";import{PrecipitationTechniqueConfiguration as h,PrecipitationTechnique as u}from"./PrecipitationTechnique.js";import{glLayout as p}from"../support/buffer/glUtil.js";import{newLayout as m}from"../support/buffer/InterleavedLayout.js";import{AnimationTimer as _}from"../webgl-engine/lib/AnimationTimer.js";import{VertexAttribute as d}from"../webgl-engine/lib/VertexAttribute.js";import{WatchUpdatingTracking as f}from"../../support/WatchUpdatingTracking.js";import{BufferObject as T}from"../../webgl/BufferObject.js";import{PrimitiveType as l,Usage as g}from"../../webgl/enums.js";import{bindVertexBufferLayout as y,unbindVertexBufferLayout as b}from"../../webgl/Util.js";import{VertexArrayObject as j}from"../../webgl/VertexArrayObject.js";let w=class{constructor(e,t){this._numParticles=25e4,this._rainSpeed=.1,this._snowSpeed=.01,this._renderParameters={camera:null,time:0,radius:1},this._animation=new _,this._updatingTracking=new f,this._renderParameters.time=0,this._renderParameters.radius=a(t.spatialReference).radius,this._shaderTechniqueRepository=e.shaderTechniqueRep}get updating(){return this._updatingTracking.updating}get rainTechnique(){if(t(this._rainTechnique)){const e=new h;e.type=c.RAIN,this._rainTechnique=this._shaderTechniqueRepository.acquire(u,e)}return this._rainTechnique}get snowTechnique(){if(t(this._snowTechnique)){const e=new h;e.type=c.SNOW,this._snowTechnique=this._shaderTechniqueRepository.acquire(u,e)}return this._snowTechnique}destroy(){this._updatingTracking.destroy(),this._numParticles=0,this._snowTechnique=r(this._snowTechnique),this._rainTechnique=r(this._rainTechnique),this._vao=r(this._vao),this._instanceIdBuffer=r(this._instanceIdBuffer)}update(e){return this._animation.advance(e)}render(e,r,i){const{rctx:n,camera:o}=e;this._ensureResources(n);const a=i===c.RAIN?this.rainTechnique:this.snowTechnique;if(t(a)||t(this._vao)||t(this._instanceIdBuffer))return;const h=n.useTechnique(a);this._renderParameters.camera=o,this._renderParameters.time=(i===c.RAIN?this._rainSpeed:this._snowSpeed)*s(this._animation.time),a.bindPass(this._renderParameters),n.bindVAO(this._vao);const p=u.attributeLocation;h.assertCompatibleVertexAttributeLocations(this._vao),y(n,p,this._instanceIdBuffer,I,0),n.capabilities.instancing.drawArraysInstanced(l.TRIANGLES,0,3,this._numParticles*r),b(n,p,this._instanceIdBuffer,I)}_ensureResources(e){i(this._vao)||(this._vao=this._createVertexArrayObject(e),i(this._instanceIdBuffer)||(this._instanceIdBuffer=this._createInstanceIndices(e)))}_createInstanceIndices(e){const t=[];for(let r=0;r<this._numParticles;r++)t.push(r);return T.createVertex(e,g.STATIC_DRAW,new Float32Array(t))}_createVertexArrayObject(e){const t=new Float32Array([-1,0,1,1,0,-1,1,0,1]);return new j(e,u.attributeLocation,{geometry:p(q)},{geometry:T.createVertex(e,g.STATIC_DRAW,t)})}};e([n({constructOnly:!0})],w.prototype,"requestRender",void 0),e([n({readOnly:!0})],w.prototype,"updating",null),e([n()],w.prototype,"_updatingTracking",void 0),w=e([o("esri.views.3d.environment.Precipitation")],w);const q=m().vec3f(d.POSITION),I=p(m().f32(d.INSTANCEFEATUREATTRIBUTE),1);export{w as Precipitation};