@arcgis/core 5.0.0-next.86 → 5.0.0-next.88

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 (508) hide show
  1. package/Ground.js +1 -1
  2. package/Map.d.ts +4 -0
  3. package/WebLinkChart.d.ts +6 -3
  4. package/WebScene.js +1 -1
  5. package/analysis/ShadowCastAnalysis.d.ts +1 -0
  6. package/analysis/VolumeMeasurement/VolumeMeasurementDisplayUnits.d.ts +14 -2
  7. package/analysis/VolumeMeasurement/VolumeMeasurementDisplayUnits.js +1 -1
  8. package/applications/Components/OrientedImageryViewer/galleryUtils.d.ts +80 -0
  9. package/applications/Components/OrientedImageryViewer/galleryUtils.js +5 -0
  10. package/applications/Components/clipboard.d.ts +106 -0
  11. package/applications/Components/clipboard.js +5 -0
  12. package/assets/esri/core/libs/libtess/libtess-f32.wasm +0 -0
  13. package/assets/esri/core/libs/libtess/libtess-f64.wasm +0 -0
  14. package/assets/esri/core/t9n/Units.json +1 -1
  15. package/assets/esri/core/t9n/Units_ar.json +1 -1
  16. package/assets/esri/core/t9n/Units_bg.json +1 -1
  17. package/assets/esri/core/t9n/Units_bs.json +1 -1
  18. package/assets/esri/core/t9n/Units_ca.json +1 -1
  19. package/assets/esri/core/t9n/Units_cs.json +1 -1
  20. package/assets/esri/core/t9n/Units_da.json +1 -1
  21. package/assets/esri/core/t9n/Units_de.json +1 -1
  22. package/assets/esri/core/t9n/Units_el.json +1 -1
  23. package/assets/esri/core/t9n/Units_en.json +1 -1
  24. package/assets/esri/core/t9n/Units_es.json +1 -1
  25. package/assets/esri/core/t9n/Units_et.json +1 -1
  26. package/assets/esri/core/t9n/Units_fi.json +1 -1
  27. package/assets/esri/core/t9n/Units_fr.json +1 -1
  28. package/assets/esri/core/t9n/Units_he.json +1 -1
  29. package/assets/esri/core/t9n/Units_hr.json +1 -1
  30. package/assets/esri/core/t9n/Units_hu.json +1 -1
  31. package/assets/esri/core/t9n/Units_id.json +1 -1
  32. package/assets/esri/core/t9n/Units_it.json +1 -1
  33. package/assets/esri/core/t9n/Units_ja.json +1 -1
  34. package/assets/esri/core/t9n/Units_ko.json +1 -1
  35. package/assets/esri/core/t9n/Units_lt.json +1 -1
  36. package/assets/esri/core/t9n/Units_lv.json +1 -1
  37. package/assets/esri/core/t9n/Units_nl.json +1 -1
  38. package/assets/esri/core/t9n/Units_no.json +1 -1
  39. package/assets/esri/core/t9n/Units_pl.json +1 -1
  40. package/assets/esri/core/t9n/Units_pt-BR.json +1 -1
  41. package/assets/esri/core/t9n/Units_pt-PT.json +1 -1
  42. package/assets/esri/core/t9n/Units_ro.json +1 -1
  43. package/assets/esri/core/t9n/Units_ru.json +1 -1
  44. package/assets/esri/core/t9n/Units_sk.json +1 -1
  45. package/assets/esri/core/t9n/Units_sl.json +1 -1
  46. package/assets/esri/core/t9n/Units_sr.json +1 -1
  47. package/assets/esri/core/t9n/Units_sv.json +1 -1
  48. package/assets/esri/core/t9n/Units_th.json +1 -1
  49. package/assets/esri/core/t9n/Units_tr.json +1 -1
  50. package/assets/esri/core/t9n/Units_uk.json +1 -1
  51. package/assets/esri/core/t9n/Units_vi.json +1 -1
  52. package/assets/esri/core/t9n/Units_zh-CN.json +1 -1
  53. package/assets/esri/core/t9n/Units_zh-HK.json +1 -1
  54. package/assets/esri/core/t9n/Units_zh-TW.json +1 -1
  55. package/assets/esri/core/workers/RemoteClient.js +1 -1
  56. package/assets/esri/core/workers/chunks/{6298e71e6c480d6f46e3.js → 0276e689e1371b40cff3.js} +1 -1
  57. package/assets/esri/core/workers/chunks/045a9cc900bb4ac8afde.js +1 -0
  58. package/assets/esri/core/workers/chunks/048173088bbeb1f6b8b6.js +1 -0
  59. package/assets/esri/core/workers/chunks/0be8b9d9ef56c37e74c3.js +1 -0
  60. package/assets/esri/core/workers/chunks/0bef671165e64f90ac86.js +1 -0
  61. package/assets/esri/core/workers/chunks/0c025d2b0d3162b07feb.js +1 -0
  62. package/assets/esri/core/workers/chunks/0c4ed18d67dea0c99f01.js +1 -0
  63. package/assets/esri/core/workers/chunks/0e0208b87566f4470f1d.js +1 -0
  64. package/assets/esri/core/workers/chunks/{981f05b5ef6f9c3f7e8a.js → 0fc0fd7618ef25dd6b67.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{1facc1b45345a095b9a7.js → 149c4181eaea32e9ac15.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{f1e1666bede364c069fc.js → 15c180deb8d09127ad31.js} +1 -1
  67. package/assets/esri/core/workers/chunks/1616ee2f6dce0203f1d5.js +1 -0
  68. package/assets/esri/core/workers/chunks/21bb414cb0623ffad577.js +1 -0
  69. package/assets/esri/core/workers/chunks/21c84e014c73bd85f4a3.js +1 -0
  70. package/assets/esri/core/workers/chunks/262677294d8c653e2b0b.js +1 -0
  71. package/assets/esri/core/workers/chunks/{5139bbe8f94df01467c7.js → 28a6a59033baa44bafab.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{c5d56b85d34026507902.js → 28c273f34ffde25cebc6.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{b7e40118b4d645e9f8e1.js → 2a12026f1ca9e8900a8b.js} +1 -1
  74. package/assets/esri/core/workers/chunks/2bc9f407f89d554a43ce.js +1 -0
  75. package/assets/esri/core/workers/chunks/2f21c5ae4fbe85c2792b.js +1 -0
  76. package/assets/esri/core/workers/chunks/3332ee9727874953523c.js +1 -0
  77. package/assets/esri/core/workers/chunks/{c477b0ce55211339c4cb.js → 33f44cc192c72064b5b6.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{1cf27708d17a4de75b68.js → 3672125daca3df24c8ab.js} +1 -1
  79. package/assets/esri/core/workers/chunks/37a607f3835ec6f60834.js +1 -0
  80. package/assets/esri/core/workers/chunks/{3ebd4cdafa7682062447.js → 39dd80c184ac48f877f1.js} +1 -1
  81. package/assets/esri/core/workers/chunks/3a3adf9b6502ad698aea.js +1 -0
  82. package/assets/esri/core/workers/chunks/{4a857a7f5e00dfab2b44.js → 3c663035cf872b66cb98.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{32b09ca094377a305881.js → 3d924488471601a17915.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{743165f9bc4d85748a0d.js → 42b56932340b6d0bc712.js} +1 -1
  85. package/assets/esri/core/workers/chunks/4de93e9f91fd891ed96f.js +1 -0
  86. package/assets/esri/core/workers/chunks/4eb02a03956d1c9c77ee.js +1 -0
  87. package/assets/esri/core/workers/chunks/{15132d36e7ccbb3c009e.js → 555a252bdb87e340bd02.js} +1 -1
  88. package/assets/esri/core/workers/chunks/{5d791bfca20791d8e0af.js → 5670e430584f020a3530.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{70df4331ed29d823bf38.js → 5b297353b058323f8080.js} +1 -1
  90. package/assets/esri/core/workers/chunks/5ef5dcca7c9b376f7f77.js +1 -0
  91. package/assets/esri/core/workers/chunks/{c12c095937b21e39ad3c.js → 614c63dae0158da0ed3d.js} +1 -1
  92. package/assets/esri/core/workers/chunks/{5734aefbce8b6425630c.js → 63b46983155b1672e07a.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{8b575ac55bc396c0c477.js → 687677acc05b5e87effe.js} +1 -1
  94. package/assets/esri/core/workers/chunks/{1aee859eaffa54ef2515.js → 727321c615f35d708d46.js} +1 -1
  95. package/assets/esri/core/workers/chunks/731cab5887c05f221279.js +1 -0
  96. package/assets/esri/core/workers/chunks/779fe8ccc4041f0b65a0.js +1 -0
  97. package/assets/esri/core/workers/chunks/782c24211daacb47b0b2.js +1 -0
  98. package/assets/esri/core/workers/chunks/79067e7d1ebc46afd775.js +1 -0
  99. package/assets/esri/core/workers/chunks/7a454e4d6df3360e0ab9.js +1 -0
  100. package/assets/esri/core/workers/chunks/7da56ba34c81d2bbaf25.js +1 -0
  101. package/assets/esri/core/workers/chunks/{d8b72c6f5f9b2d013b7f.js → 824b45b04b4f4f91dbce.js} +1 -1
  102. package/assets/esri/core/workers/chunks/836d10ceb93ed19f0aa6.js +1 -0
  103. package/assets/esri/core/workers/chunks/{68d0bae1816061d96307.js → 837d39e70880e4310bda.js} +1 -1
  104. package/assets/esri/core/workers/chunks/{746190bb70aa78ba0bfc.js → 8936f9398414be26b83f.js} +4 -4
  105. package/assets/esri/core/workers/chunks/8bcb2180ecc88a39b317.js +1 -0
  106. package/assets/esri/core/workers/chunks/{e95f90d59041640727da.js → 8c5d827cbf8869defb87.js} +1 -1
  107. package/assets/esri/core/workers/chunks/{7449af8f3637c1694660.js → 97155c8ac832d7c46f24.js} +1 -1
  108. package/assets/esri/core/workers/chunks/{fbf21fda283836e8633c.js → 98cb131b62e30aee35e1.js} +1 -1
  109. package/assets/esri/core/workers/chunks/{e067bbf12f711fd5b9a6.js → 9b3b9df0aa0fdcc77aa2.js} +1 -1
  110. package/assets/esri/core/workers/chunks/{5852d291ef41201030d5.js → 9fa1512baa6e95d3f878.js} +21 -21
  111. package/assets/esri/core/workers/chunks/{8cb13b3776f07536c79f.js → a0d459bdb91ee892d4b6.js} +1 -1
  112. package/assets/esri/core/workers/chunks/{96616126aaf319cd1c6f.js → a5ed35f53769feb751db.js} +1 -1
  113. package/assets/esri/core/workers/chunks/{b6530c66804bede649d7.js → aa09e261d1f7dffaad8c.js} +1 -1
  114. package/assets/esri/core/workers/chunks/b268b4cbf5b0c856f88e.js +1 -0
  115. package/assets/esri/core/workers/chunks/b2f6cee006788ce3bd16.js +1 -0
  116. package/assets/esri/core/workers/chunks/{198ae9e02366870d3ec8.js → b46e772e415e2cfca896.js} +1 -1
  117. package/assets/esri/core/workers/chunks/{cee29c3a94376f6740d7.js → b4ab715a3c506e122f35.js} +1 -1
  118. package/assets/esri/core/workers/chunks/{b5ca894a6cb1a19676d5.js → b9756dce0b3af1a9dc54.js} +1 -1
  119. package/assets/esri/core/workers/chunks/baa7e90ec5259057d86b.js +1 -0
  120. package/assets/esri/core/workers/chunks/{52ae2073604deef63ea2.js → c083045d21636b95f26f.js} +1 -1
  121. package/assets/esri/core/workers/chunks/c267e57eb7f779115aba.js +1 -0
  122. package/assets/esri/core/workers/chunks/{5a0c5271304189a2401d.js → c38098f7073a10efdb1e.js} +1 -1
  123. package/assets/esri/core/workers/chunks/{adecd31fd64d6753682d.js → c7c865dc1a93e781a3e3.js} +1 -1
  124. package/assets/esri/core/workers/chunks/c8e56dc1239118ac2a60.js +1 -0
  125. package/assets/esri/core/workers/chunks/cb6083f7294c8de297e1.js +1 -0
  126. package/assets/esri/core/workers/chunks/cb6c9469d7c16727cd12.js +1 -0
  127. package/assets/esri/core/workers/chunks/{e7e508258ad27468a6a5.js → cc6d9b2062b9de629111.js} +1 -1
  128. package/assets/esri/core/workers/chunks/d5386c0e77063c87fddd.js +1 -0
  129. package/assets/esri/core/workers/chunks/d782671235af2db1c458.js +1 -0
  130. package/assets/esri/core/workers/chunks/de33ce9b6f4e6c0e1389.js +1 -0
  131. package/assets/esri/core/workers/chunks/{0abb084b8a137f4fcdfc.js → e1c5773c12d9947bdc5f.js} +1 -1
  132. package/assets/esri/core/workers/chunks/e55ce8466aa979ac1e6b.js +1 -0
  133. package/assets/esri/core/workers/chunks/{21739c37160061f229ef.js → e585883d0036aa866420.js} +1 -1
  134. package/assets/esri/core/workers/chunks/e6d6d664fc9f2cd6a042.js +1 -0
  135. package/assets/esri/core/workers/chunks/e7cdc2a21104d84aec4a.js +1 -0
  136. package/assets/esri/core/workers/chunks/e9edf3987039def65859.js +1 -0
  137. package/assets/esri/core/workers/chunks/{3b434f318fdbbe4111e3.js → edbe52c2848486d64b16.js} +1 -1
  138. package/assets/esri/core/workers/chunks/{4f8895eb57ec6ab4b318.js → f5a61fa75ac877b5bb74.js} +1 -1
  139. package/assets/esri/core/workers/chunks/feba6c9ae162a0a8ea3a.js +1 -0
  140. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  141. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  142. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  143. package/assets/esri/themes/base/widgets/_FeatureTable.scss +9 -1
  144. package/assets/esri/themes/dark/main.css +1 -1
  145. package/assets/esri/themes/light/main.css +1 -1
  146. package/assets/esri/themes/light/view.css +1 -1
  147. package/chunks/{TextureOnly.glsl.js → Texture.glsl.js} +2 -2
  148. package/chunks/{WaterSurface.glsl.js → Water.glsl.js} +6 -6
  149. package/chunks/bundle.js +1 -1
  150. package/chunks/libtess-f32.js +1 -1
  151. package/chunks/libtess-f64.js +1 -1
  152. package/config.js +1 -1
  153. package/copyright.txt +84 -0
  154. package/core/Promise.d.ts +1 -1
  155. package/core/arrayUtils.js +1 -1
  156. package/core/quantity.js +1 -1
  157. package/core/quantityFormatUtils.js +1 -1
  158. package/core/units.d.ts +1 -1
  159. package/core/units.js +1 -1
  160. package/core/workers/WorkerHandle.js +1 -1
  161. package/editing/Clipboard.js +5 -0
  162. package/effects/FocusAreas.d.ts +1 -0
  163. package/form/FormTemplate.js +1 -1
  164. package/geometry/ellipsoidUtils.js +1 -1
  165. package/geometry/libtess.js +1 -1
  166. package/geometry/operators/geodesicBufferOperator.d.ts +1 -0
  167. package/geometry/operators/geodesicProximityOperator.d.ts +1 -0
  168. package/geometry/operators/geodeticAreaOperator.d.ts +1 -0
  169. package/geometry/operators/geodeticDensifyOperator.d.ts +1 -0
  170. package/geometry/operators/geodeticDistanceOperator.d.ts +1 -0
  171. package/geometry/operators/geodeticLengthOperator.d.ts +1 -0
  172. package/geometry/operators/geodeticUtilsOperator.d.ts +1 -0
  173. package/geometry/operators/shapePreservingProjectOperator.d.ts +1 -0
  174. package/geometry/operators/support/geographicTransformationUtils.d.ts +1 -0
  175. package/geometry/projection/projectors.js +1 -1
  176. package/geometry/projectionUtils.js +1 -1
  177. package/geometry/support/meshUtils/projection.js +1 -1
  178. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  179. package/geometry/support/planetGCSUtils.js +1 -1
  180. package/geometry/support/spatialReferenceUtils.js +1 -1
  181. package/identity/IdentityModal.js +1 -1
  182. package/interfaces.d.ts +2 -2
  183. package/kernel.js +1 -1
  184. package/layers/CatalogLayer.d.ts +1 -0
  185. package/layers/FeatureLayer.d.ts +6 -0
  186. package/layers/GeoJSONLayer.d.ts +1 -0
  187. package/layers/Layer.d.ts +1 -0
  188. package/layers/LinkChartLayer.d.ts +2 -2
  189. package/layers/MediaLayer.d.ts +1 -0
  190. package/layers/OGCFeatureLayer.d.ts +1 -0
  191. package/layers/ParquetLayer.d.ts +6 -0
  192. package/layers/SubtypeGroupLayer.d.ts +1 -0
  193. package/layers/WFSLayer.d.ts +1 -0
  194. package/layers/catalog/CatalogFootprintLayer.d.ts +1 -0
  195. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  196. package/layers/mixins/ArcGISImageService.d.ts +30 -16
  197. package/layers/mixins/BlendLayer.d.ts +1 -0
  198. package/layers/mixins/FeatureEffectLayer.d.ts +2 -0
  199. package/layers/mixins/ImageryTileMixin.d.ts +2 -1
  200. package/layers/mixins/ImageryTileMixin.js +1 -1
  201. package/layers/mixins/ScaleRangeLayer.d.ts +0 -42
  202. package/layers/orientedImagery/transformations/utils.js +1 -1
  203. package/layers/raster/datasets/RawBlockCache.js +1 -1
  204. package/layers/raster/functions/SpectralConversionFunction.js +5 -0
  205. package/layers/raster/functions/SpectralConversionFunctionArguments.js +5 -0
  206. package/layers/raster/functions/conversionUtils.js +1 -1
  207. package/layers/raster/functions/rasterFunctionHelper.js +1 -1
  208. package/layers/raster/functions/vectorFieldUtils.js +1 -1
  209. package/layers/support/FeatureFilter.d.ts +4 -0
  210. package/layers/support/parquetUtils.d.ts +44 -1
  211. package/layers/support/rasterFunctionUtils.d.ts +0 -4
  212. package/layers/support/vectorTileLayerLoader.js +1 -1
  213. package/layers/support/wmsUtils.js +1 -1
  214. package/networks/CircuitManager.d.ts +6 -5
  215. package/networks/CircuitManager.js +1 -1
  216. package/networks/Network.d.ts +1 -0
  217. package/networks/UtilityNetwork.js +1 -1
  218. package/networks/support/Circuit.d.ts +2 -4
  219. package/networks/support/CircuitLocation.d.ts +1 -7
  220. package/networks/support/CircuitLocation.js +1 -1
  221. package/networks/support/CircuitPathConnectivityElement.js +1 -1
  222. package/networks/support/CircuitSection.d.ts +2 -4
  223. package/networks/support/Subcircuit.d.ts +2 -2
  224. package/package.json +4 -4
  225. package/renderers/FlowRenderer.d.ts +1 -0
  226. package/renderers/support/colorRampUtils.js +1 -1
  227. package/rest/featureService/types.d.ts +2 -2
  228. package/rest/imageService.d.ts +36 -19
  229. package/rest/imageService.js +1 -1
  230. package/rest/knowledgeGraph/GraphSearch.d.ts +0 -1
  231. package/rest/knowledgeGraph/GraphSearchStreaming.d.ts +0 -1
  232. package/rest/networks/circuits/support/QueryCircuitsParameters.js +1 -1
  233. package/rest/networks/circuits/support/VerifyCircuitsParameters.d.ts +30 -0
  234. package/rest/networks/circuits/support/VerifyCircuitsParameters.js +1 -1
  235. package/rest/networks/circuits/verifyCircuits.js +1 -1
  236. package/rest/networks/support/Association.js +1 -1
  237. package/rest/networks/support/NetworkElement.d.ts +2 -1
  238. package/rest/networks/support/TelecomNetworkElement.js +1 -1
  239. package/rest/networks/support/TraceLocation.d.ts +1 -1
  240. package/rest/query.d.ts +4 -0
  241. package/rest/support/BinParametersBase.d.ts +9 -28
  242. package/rest/support/DateBinParameters.d.ts +0 -17
  243. package/rest/support/TopFeaturesQuery.d.ts +1 -0
  244. package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
  245. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  246. package/support/revision.js +1 -1
  247. package/symbols/CIMSymbol.d.ts +1 -0
  248. package/symbols/LineSymbolMarker.d.ts +2 -2
  249. package/symbols/SimpleFillSymbol.d.ts +2 -1
  250. package/symbols/SimpleLineSymbol.d.ts +4 -4
  251. package/symbols/support/cimSymbolUtils.d.ts +2 -0
  252. package/symbols/types.d.ts +140 -28
  253. package/views/2d/constraints/ZoomConstraint.js +1 -1
  254. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  255. package/views/2d/engine/imagery/RasterVFContainer.js +1 -1
  256. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  257. package/views/2d/engine/imagery/RasterVFTileContainer.js +1 -1
  258. package/views/2d/engine/rasterBrushes.js +1 -1
  259. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterProcessorTechnique.js +1 -1
  260. package/views/2d/engine/webgl/shaderGraph/techniques/raster/VectorFieldTechnique.js +5 -0
  261. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/AspectTechnique.js +1 -1
  262. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BandArithmeticTechnique.js +1 -1
  263. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ColormapToRGBTechnique.js +1 -1
  264. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CompositeBandTechnique.js +1 -1
  265. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ComputeChangeTechnique.js +1 -1
  266. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ContrastBrightnessTechnique.js +1 -1
  267. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ConvolutionTechnique.js +1 -1
  268. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CurvatureTechnique.js +1 -1
  269. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ExtractBandTechnique.js +1 -1
  270. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/FocalStatisticsTechnique.js +1 -1
  271. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/GrayscaleTechnique.js +1 -1
  272. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/HillshadeTechnique.js +1 -1
  273. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/LocalTechnique.js +1 -1
  274. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/MaskTechnique.js +1 -1
  275. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/NDVITechnique.js +1 -1
  276. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/RemapTechnique.js +1 -1
  277. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ReprojectTechnique.js +1 -1
  278. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ShadedReliefTechnique.js +1 -1
  279. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/SlopeTechnique.js +1 -1
  280. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/SpectralConversionTechnique.js +5 -0
  281. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/StretchTechnique.js +1 -1
  282. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/MagDirShader.js +5 -0
  283. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/ScalarShader.js +5 -0
  284. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/SpectralConversionShader.js +5 -0
  285. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  286. package/views/2d/layers/MediaLayerView2D.js +1 -1
  287. package/views/2d/layers/TileLayerView2D.js +1 -1
  288. package/views/2d/layers/imagery/ImageryVFStrategy.js +1 -1
  289. package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
  290. package/views/2d/types.d.ts +6 -1
  291. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  292. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  293. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  294. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  295. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementRawResult.js +5 -0
  296. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementResult.d.ts +5 -1
  297. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementResult.js +1 -1
  298. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  299. package/views/3d/environment/EnvironmentManager.js +1 -1
  300. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  301. package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
  302. package/views/3d/layers/FlowSubView3D.js +1 -1
  303. package/views/3d/layers/I3SMeshViewLabeler.js +1 -1
  304. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  305. package/views/3d/layers/SceneLayerWorker.js +1 -1
  306. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  307. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  308. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  309. package/views/3d/layers/graphics/emissiveUtils.js +5 -0
  310. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  311. package/views/3d/layers/support/layerUtils.js +1 -1
  312. package/views/3d/state/ViewState.js +1 -1
  313. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  314. package/views/3d/support/mathUtils.js +1 -1
  315. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  316. package/views/3d/support/supportedSpatialReference.js +1 -1
  317. package/views/3d/terrain/BlendLayers.glsl.js +5 -0
  318. package/views/3d/terrain/BlendLayersTechnique.js +1 -1
  319. package/views/3d/terrain/OverlayRenderer.js +1 -1
  320. package/views/3d/terrain/RasterColorizer.glsl.js +5 -0
  321. package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
  322. package/views/3d/terrain/terrainUtils.js +1 -1
  323. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +3 -3
  324. package/views/3d/webgl-engine/core/shaderLibrary/shading/{Water.glsl.js → WaterColor.glsl.js} +2 -2
  325. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
  326. package/views/3d/webgl-engine/core/shaderLibrary/util/EllipsoidMode.js +1 -1
  327. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  328. package/views/3d/webgl-engine/effects/highlight/HighlightApply.glsl.js +5 -0
  329. package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
  330. package/views/3d/webgl-engine/effects/highlight/HighlightBlur.glsl.js +5 -0
  331. package/views/3d/webgl-engine/effects/highlight/HighlightBlurTechnique.js +1 -1
  332. package/views/3d/webgl-engine/effects/highlight/HighlightDownsample.glsl.js +5 -0
  333. package/views/3d/webgl-engine/effects/highlight/HighlightDownsampleTechnique.js +1 -1
  334. package/views/3d/webgl-engine/effects/highlight/HighlightToSingle.glsl.js +5 -0
  335. package/views/3d/webgl-engine/effects/highlight/HighlightToSingleTechnique.js +1 -1
  336. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.glsl.js +5 -0
  337. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
  338. package/views/3d/webgl-engine/effects/laserlines/Laserline.glsl.js +5 -0
  339. package/views/3d/webgl-engine/effects/laserlines/LaserlinePath.glsl.js +5 -0
  340. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechnique.js +1 -1
  341. package/views/3d/webgl-engine/effects/laserlines/LaserlineTechnique.js +1 -1
  342. package/views/3d/webgl-engine/effects/magnifier/Magnifier.glsl.js +5 -0
  343. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  344. package/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique.js +1 -1
  345. package/views/3d/webgl-engine/effects/smaa/BlendWeights.glsl.js +5 -0
  346. package/views/3d/webgl-engine/effects/smaa/Blur.glsl.js +5 -0
  347. package/views/3d/webgl-engine/effects/smaa/EdgeDetect.glsl.js +5 -0
  348. package/views/3d/webgl-engine/effects/smaa/SMAABlendWeightsTechnique.js +1 -1
  349. package/views/3d/webgl-engine/effects/smaa/SMAABlurTechnique.js +1 -1
  350. package/views/3d/webgl-engine/effects/smaa/SMAAEdgeDetectTechnique.js +1 -1
  351. package/views/3d/webgl-engine/effects/ssao/SSAO.glsl.js +5 -0
  352. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  353. package/views/3d/webgl-engine/effects/ssao/SSAOBlur.glsl.js +5 -0
  354. package/views/3d/webgl-engine/effects/ssao/SSAOBlurTechnique.js +1 -1
  355. package/views/3d/webgl-engine/effects/ssao/SSAOTechnique.js +1 -1
  356. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  357. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  358. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  359. package/views/3d/webgl-engine/lib/Texture.glsl.js +5 -0
  360. package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
  361. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +5 -0
  362. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
  363. package/views/3d/webgl-engine/{shaders → materials}/Path.glsl.js +1 -1
  364. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  365. package/views/3d/webgl-engine/{shaders/WaterSurface.glsl.js → materials/Water.glsl.js} +1 -1
  366. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  367. package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
  368. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  369. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +31 -23
  370. package/views/3d/webgl.js +1 -1
  371. package/views/VideoView.d.ts +1 -0
  372. package/views/VideoView.js +1 -1
  373. package/views/input/ViewEvents.js +1 -1
  374. package/views/input/recognizers/VerticalTwoFingerDrag.js +1 -1
  375. package/views/input/types.d.ts +94 -0
  376. package/views/interactive/snapping/FeatureSnappingLayerSource.d.ts +1 -0
  377. package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
  378. package/views/layers/FeatureLayerViewMixin.d.ts +1 -0
  379. package/views/support/MeasurementWorker.js +1 -1
  380. package/views/support/MeasurementWorkerHandle.js +1 -1
  381. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  382. package/views/support/measurementUtils.js +1 -1
  383. package/views/support/screenUtils.js +1 -1
  384. package/views/webgl/ShaderBuilder.js +1 -1
  385. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  386. package/widgets/AreaMeasurement2D.d.ts +1 -0
  387. package/widgets/AreaMeasurement2D.js +1 -1
  388. package/widgets/Attachments.d.ts +1 -0
  389. package/widgets/BasemapLayerList.d.ts +1 -0
  390. package/widgets/BasemapLayerList.js +1 -1
  391. package/widgets/BuildingExplorer.d.ts +1 -1
  392. package/widgets/CatalogLayerList.d.ts +1 -0
  393. package/widgets/CatalogLayerList.js +1 -1
  394. package/widgets/Directions.d.ts +1 -0
  395. package/widgets/Directions.js +1 -1
  396. package/widgets/DistanceMeasurement2D.d.ts +1 -0
  397. package/widgets/DistanceMeasurement2D.js +1 -1
  398. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  399. package/widgets/Editor.d.ts +1 -0
  400. package/widgets/Editor.js +1 -1
  401. package/widgets/FeatureForm.d.ts +1 -0
  402. package/widgets/FeatureForm.js +1 -1
  403. package/widgets/FeatureTable.d.ts +1 -0
  404. package/widgets/FeatureTable.js +1 -1
  405. package/widgets/FloorFilter.d.ts +1 -0
  406. package/widgets/FloorFilter.js +1 -1
  407. package/widgets/LayerList.d.ts +1 -0
  408. package/widgets/LayerList.js +1 -1
  409. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  410. package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
  411. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  412. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  413. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  414. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  415. package/widgets/OrientedImageryViewer/components/OverlayLayersListViewModel.js +1 -1
  416. package/widgets/OrientedImageryViewer/services/TransformationService.js +5 -0
  417. package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +5 -0
  418. package/widgets/OrientedImageryViewer/support/geometryUtils.js +5 -0
  419. package/widgets/OrientedImageryViewer/support/typeUtils.js +5 -0
  420. package/widgets/ScaleRangeSlider/ScaleRanges.d.ts +43 -1
  421. package/widgets/ScaleRangeSlider.d.ts +1 -0
  422. package/widgets/ScaleRangeSlider.js +1 -1
  423. package/widgets/Sketch.d.ts +1 -0
  424. package/widgets/Sketch.js +1 -1
  425. package/widgets/Slider/SliderViewModel.js +1 -1
  426. package/widgets/Swipe.d.ts +1 -1
  427. package/widgets/TableList.d.ts +2 -0
  428. package/widgets/TableList.js +1 -1
  429. package/widgets/TimeSlider.d.ts +1 -0
  430. package/widgets/TimeSlider.js +1 -1
  431. package/widgets/UtilityNetworkAssociations.d.ts +2 -0
  432. package/widgets/UtilityNetworkAssociations.js +1 -1
  433. package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
  434. package/widgets/UtilityNetworkTrace.d.ts +2 -0
  435. package/widgets/UtilityNetworkTrace.js +1 -1
  436. package/widgets/UtilityNetworkValidateTopology.d.ts +2 -0
  437. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  438. package/widgets/ValuePicker.d.ts +1 -0
  439. package/widgets/ValuePicker.js +1 -1
  440. package/widgets/support/SnappingControls.d.ts +1 -0
  441. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  442. package/widgets/support/UtilityNetworkAssociations/utils/createAssociation.js +1 -1
  443. package/assets/esri/core/workers/chunks/00e135dc1b4cb024973d.js +0 -1
  444. package/assets/esri/core/workers/chunks/03d037f9f04f165aac63.js +0 -1
  445. package/assets/esri/core/workers/chunks/03da31c7635d077e8d99.js +0 -1
  446. package/assets/esri/core/workers/chunks/0dcf1f3b6aa84cbe03a9.js +0 -1
  447. package/assets/esri/core/workers/chunks/165cf8031af160c99d70.js +0 -1
  448. package/assets/esri/core/workers/chunks/185c97bc63ce546995ce.js +0 -1
  449. package/assets/esri/core/workers/chunks/1a62c456e791c82050fe.js +0 -1
  450. package/assets/esri/core/workers/chunks/21163137e345badb1aaf.js +0 -1
  451. package/assets/esri/core/workers/chunks/25dead73dfc5a4c19285.js +0 -1
  452. package/assets/esri/core/workers/chunks/2767b69085c9f7a1e1af.js +0 -1
  453. package/assets/esri/core/workers/chunks/43e9eaedf65921b58eb2.js +0 -1
  454. package/assets/esri/core/workers/chunks/4caec60ac0a5851730c6.js +0 -1
  455. package/assets/esri/core/workers/chunks/4f4bdf9f5323fa702e6c.js +0 -1
  456. package/assets/esri/core/workers/chunks/5119e3159617b8e1ea13.js +0 -1
  457. package/assets/esri/core/workers/chunks/59d3f3fbae775fd7686e.js +0 -1
  458. package/assets/esri/core/workers/chunks/5a706eecd8a988fae6b7.js +0 -1
  459. package/assets/esri/core/workers/chunks/5ba2bbbb42ef1920579d.js +0 -1
  460. package/assets/esri/core/workers/chunks/5cc731f161012b63c77a.js +0 -1
  461. package/assets/esri/core/workers/chunks/5fa8fe6353dbdda0b06a.js +0 -1
  462. package/assets/esri/core/workers/chunks/6107b58457a70c8de9da.js +0 -1
  463. package/assets/esri/core/workers/chunks/654eef3ad30f34c42e12.js +0 -1
  464. package/assets/esri/core/workers/chunks/6d9e92d9c2503d5dc8dd.js +0 -1
  465. package/assets/esri/core/workers/chunks/7130b09300032d3a5925.js +0 -1
  466. package/assets/esri/core/workers/chunks/7f7c4ffbdf7b20dc7a54.js +0 -1
  467. package/assets/esri/core/workers/chunks/804c9666d0dc548b9f79.js +0 -1
  468. package/assets/esri/core/workers/chunks/8258b1c8ba6d44ba19c3.js +0 -1
  469. package/assets/esri/core/workers/chunks/8f2fc50eb988c0228b05.js +0 -1
  470. package/assets/esri/core/workers/chunks/8f3abaabc61858e929a5.js +0 -1
  471. package/assets/esri/core/workers/chunks/97ad3eb25ad003c16148.js +0 -1
  472. package/assets/esri/core/workers/chunks/a270e34bb248114ec280.js +0 -1
  473. package/assets/esri/core/workers/chunks/a56a5e00964d4cd59a66.js +0 -1
  474. package/assets/esri/core/workers/chunks/a774b4fc7df801503bea.js +0 -1
  475. package/assets/esri/core/workers/chunks/b1015e1f25b60c08d2cf.js +0 -1
  476. package/assets/esri/core/workers/chunks/c18a2948ae3cb527d8bb.js +0 -1
  477. package/assets/esri/core/workers/chunks/cb66a74448a6c0c20d5d.js +0 -1
  478. package/assets/esri/core/workers/chunks/d4f4c0201d8b641709c0.js +0 -1
  479. package/assets/esri/core/workers/chunks/d6d9d56b3733622deab6.js +0 -1
  480. package/assets/esri/core/workers/chunks/dedd9d47ccc019ffc484.js +0 -1
  481. package/assets/esri/core/workers/chunks/e271065410ba5c872f53.js +0 -1
  482. package/assets/esri/core/workers/chunks/e8a0654cebafa22b5b56.js +0 -1
  483. package/assets/esri/core/workers/chunks/ecf7d34b37ce6f0877af.js +0 -1
  484. package/assets/esri/core/workers/chunks/f25eb512592a84a508c1.js +0 -1
  485. package/assets/esri/core/workers/chunks/f64ec13167eb51da2f9b.js +0 -1
  486. package/layers/graphics/sources/ParquetSource.d.ts +0 -45
  487. package/views/2d/engine/imagery/BrushVectorField.js +0 -5
  488. package/views/3d/analysis/AreaMeasurement/support/utils.js +0 -5
  489. package/views/3d/analysis/VolumeMeasurement/volumeMeasurementUtils.js +0 -5
  490. package/views/3d/webgl-engine/core/shaderLibrary/raster/RasterColorizer.glsl.js +0 -5
  491. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +0 -5
  492. package/views/3d/webgl-engine/core/shaderLibrary/util/TextureOnly.glsl.js +0 -5
  493. package/views/3d/webgl-engine/shaders/BlendWeights.glsl.js +0 -5
  494. package/views/3d/webgl-engine/shaders/Blur.glsl.js +0 -5
  495. package/views/3d/webgl-engine/shaders/EdgeDetect.glsl.js +0 -5
  496. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +0 -5
  497. package/views/3d/webgl-engine/shaders/HighlightBlur.glsl.js +0 -5
  498. package/views/3d/webgl-engine/shaders/HighlightDownsample.glsl.js +0 -5
  499. package/views/3d/webgl-engine/shaders/HighlightToSingle.glsl.js +0 -5
  500. package/views/3d/webgl-engine/shaders/LaserlinePath.glsl.js +0 -5
  501. package/views/3d/webgl-engine/shaders/Laserlines.glsl.js +0 -5
  502. package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +0 -5
  503. package/views/3d/webgl-engine/shaders/SSAO.glsl.js +0 -5
  504. package/views/3d/webgl-engine/shaders/SSAOBlur.glsl.js +0 -5
  505. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +0 -5
  506. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShader.glsl.js +0 -5
  507. package/widgets/OrientedImageryViewer/dataCaptureUtils.js +0 -5
  508. /package/chunks/{Laserlines.glsl.js → Laserline.glsl.js} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{throwIfAborted as e}from"../../../../core/promiseUtils.js";import{pt2px as t}from"../../../../core/screenUtils.js";import{identity as s,scale as r,translate as i,copy as a}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{length as n,negate as l,copy as c,multiply as h,add as d,set as m}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromArray as p,ONES as u,create as f,ZEROS as y,fromValues as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as g,ONES as b,create as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{computeTranslationToOriginAndRotation as P}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectPointToVector as x}from"../../../../geometry/projection/projectPointToVector.js";import{create as R,size as S,containsPoint as C,center as w}from"../../../../geometry/support/aaBoundingBox.js";import{getEmissiveMode as L}from"../../../../symbols/support/materialUtils.js";import{defaultObjectPrimitive as O}from"../../../../symbols/support/primitives.js";import{objectSymbolLayerPrimitiveBoundingBox as U,objectSymbolLayerSizeWithResourceSize as E}from"../../../../symbols/support/symbolLayerUtils3D.js";import{estimateNumVerticesForLods as j,defaultSymbolLayerMemoryComplexity as T}from"./defaultSymbolComplexity.js";import{perLodInstanceElevationAligner as B}from"./ElevationAligners.js";import{needsElevationUpdates3D as G,SampleElevationInfo as z,evaluateElevationInfoAtPoint as D}from"./elevationAlignmentUtils.js";import{Graphics3DLodInstanceGraphicLayer as V}from"./Graphics3DLodInstanceGraphicLayer.js";import{Graphics3DSymbolLayer as F,nanFallbackColor as A}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as I,computeObjectScale as k,computeObjectRotation as H}from"./graphicUtils.js";import{makeLodResources as M}from"./lodResourceUtils.js";import{fetch as W}from"./objectResourceUtils.js";import{placePointOnGeometry as N,extendPointGraphicElevationContext as q}from"./pointUtils.js";import{isValidPrimitive as $,primitiveLodResources as Z}from"./primitiveObjectSymbolUtils.js";import{SymbolComplexity as J}from"./SymbolComplexity.js";import{getResourceUrlFromSymbolStyle as K}from"./webStyleUtils.js";import{initFastSymbolUpdatesState as Q,updateFastSymbolUpdatesState as X,ConvertOptions as Y,evaluateModelTransformScale as ee,evaluateModelTransform as te}from"../support/FastSymbolUpdates.js";import{VerticalOffsetParameters as se}from"../../webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{LodRenderer as re}from"../../webgl-engine/lib/lodRendering/LodRenderer.js";import{DefaultMaterial as ie}from"../../webgl-engine/materials/DefaultMaterial.js";import{schematicMRRFactors as ae}from"../../webgl-engine/materials/pbrUtils.js";class oe{constructor(e,t,s,r,i,a,o,n,l,c,h=null){this.lodResources=e,this.lodRenderer=t,this.stageResources=s,this.resourceSize=r,this.isEsriSymbolResource=i,this.isWosr=a,this.resourceBoundingBox=o,this.symbolSize=n,this.extentPadding=l,this.physicalBasedRenderingEnabled=c,this.pivotOffset=h}}class ne extends F{getCachedSize(){const[e,t,s]=null!=this._resources?this._resources.symbolSize:[1,1,1];return{width:e,depth:t,height:s}}constructor(e,t,s,r){super(e,t,s,r,he(t)),this._resources=null,this._instanceIndexToGraphicUid=new Map,this._hasLoadedPBRTextures=!1,this._disposeResourceHandles=new Array,this.skipHighSymbolLodsChanged=!1,this.ensureDrapedStatus(!1),this._hasLoadedPBRTextures=s.physicalBasedRenderingEnabled}async doLoad(e){if(!this._drivenProperties.size){const e=I(this.symbolLayer);if(e)throw new Error(e)}if(this._isPrimitive){const t=this.symbolLayer.resource,s=t&&$(t?.primitive)?t.primitive:O;this._resources=await this._createResourcesForPrimitive(s,e)}else{const t=await K(this.symbol.styleOrigin),s=t?.href??this.symbolLayer.resource?.href;this._resources=await this._createResourcesForUrl(s,e)}this.layerOpacityChanged(),this.slicePlaneEnabledChanged(),this.physicalBasedRenderingChanged(),this.updateComplexity()}get extentPadding(){return null!=this._resources?this._resources.extentPadding:0}get _isPrimitive(){return null!=this._primitive}get lodRenderer(){return this._resources?.lodRenderer}get materials(){return this._resources?.stageResources.materials??[]}async _createResourcesForPrimitive(e,t){const s=this.symbolLayer,r=R(U(e)),i=p(S(r)),a=p(E(i,s)),o=n(a),l=!1,c=!1,h=s?.material,d={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,mrrFactors:ae,ambient:u,diffuse:u,opacity:1,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:s.castShadows,emissiveStrengthFromSymbol:h?.emissive?.strength??0,emissiveSource:1,offsetTransparentBackfaces:!1,drivenOpacity:this.needsDrivenTransparentPass},m=!!d.usePBR,f=this.symbol;"point-3d"===f.type&&f.verticalOffset&&(d.verticalOffset=new se(f.verticalOffset),d.castShadows=!1),this._context.screenSizePerspectiveEnabled&&(d.screenSizePerspective=this.view.screenSizePerspective.parameters),this._hasDrivenColorOrOpacity?d.externalColor=A:d.externalColor=this._materialColor?.toUnitRGBA()??g,this._fastUpdates=Q(this._context.renderer,this._fastVisualVariableConvertOptions(r,a,i,null)),d.instanced=!0,this._fastUpdates?(Object.assign(d,this._fastUpdates.materialParameters),d.instancedFeatureAttribute=!0):this._hasDrivenColorOrOpacity&&(d.instancedColor=!0);const y=new ie(d,this._context);y.setParameters({cullFace:de(y.transparent)});const _=Z(e,y);if(!_)throw new Error(`Unknown object symbol primitive: ${e}`);const b=await this._createStageResources(_,m,t),v=await this._createLodRenderer(_,t);return new oe(_,v,b,i,l,c,r,a,o,m)}async _createResourcesForUrl(e,s){const r={instanced:!0,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows},i={spherical:this._context.spherical,materialParameters:r,cache:this._context.sharedResources.objectResourceCache,compressionOptions:{compressionTracker:this._context.compressionTracker,compressionCallback:()=>this.updateComplexity()}};this._fastUpdates=Q(this._context.renderer,this._fastVisualVariableConvertOptions(null,null,null,null)),this._fastUpdates?(Object.assign(i.materialParameters,this._fastUpdates.materialParameters),i.materialParameters.instancedFeatureAttribute=!0):this._hasDrivenColorOrOpacity&&(i.materialParameters.instancedColor=!0);const a=this.symbol;if("point-3d"===a.type&&a.verticalOffset){const{screenLength:e,minWorldLength:s,maxWorldLength:r}=a.verticalOffset;i.materialParameters.verticalOffset={screenLength:t(e),minWorldLength:s||0,maxWorldLength:null!=r?r:1/0},i.materialParameters.castShadows=!1}const o=this._context.physicalBasedRenderingEnabled;i.signal=s,i.usePBR=o,i.useEmissive=this.view.stage.renderView.renderingContext.driverTest.floatBufferBlend.result,i.skipHighLods=this._context.skipHighSymbolLods;const l=this.symbolLayer.material;i.materialParameters.emissiveStrengthFromSymbol=l?.emissive?.strength??1,i.materialParameters.emissiveSource=L(l?.emissive?.source??"emissive");const c=await W(e,i),h=c.isEsriSymbolResource,d=c.isWosr,m=M(c.lods),u=this._context,f=this._getExternalColorParameters(l),y=this.needsDrivenTransparentPass,_=m.getMaterials();_.forEach(e=>{e.setParameters({...f,drivenOpacity:y}),u.screenSizePerspectiveEnabled&&e.setParameters({screenSizePerspective:this.view.screenSizePerspective.parameters})});const g=c.referenceBoundingBox,b=p(S(g)),v=p(m.levels[0].pivotOffset),P=p(E(b,this.symbolLayer)),x=n(P),R=this._fastUpdates;X(R,this._context.renderer,this._fastVisualVariableConvertOptions(g,P,b,v))&&_.forEach(e=>e.setParameters(R.materialParameters));const C=await this._createStageResources(m,o,s),w=await this._createLodRenderer(m,s);return new oe(m,w,C,b,h,d,g,P,x,o,v)}_addDisposeResource(e){this._disposeResourceHandles.push(e)}async _createStageResources(t,s,r){const i=this._context.stage,a=t.getMaterials();s!==this._context.physicalBasedRenderingEnabled&&this.physicalBasedRenderingChanged();const o=t.getTextures();i.addTextures(o),this._addDisposeResource(()=>{o.forEach(e=>e.unload()),i.removeTextures(o)}),await Promise.all(o.map(e=>this._context.stage.schedule(()=>e.load(i.renderView.renderingContext),r))),e(r);const n=t.getEngineGeometries();return{materials:a,textures:o,geometries:n}}async _createLodRenderer(e,t){const s=this._context.stage,r={layerViewUid:this._context.layerViewUid,graphicUid:e=>this._instanceIndexToGraphicUid.get(e),notifyGraphicGeometryChanged:e=>this._context.notifyGraphicGeometryChanged(this._instanceIndexToGraphicUid.get(e)),notifyGraphicVisibilityChanged:e=>this._context.notifyGraphicVisibilityChanged(this._instanceIndexToGraphicUid.get(e))},i=this._fastUpdates,o=new re({symbol:e,metadata:r,shaderTransformation:i?{applyTransform:(e,t,s)=>{e.getFeatureAttribute(t,fe),a(s,te(i.materialParameters,fe,s))},scaleFactor:(e,t,s)=>{t.getFeatureAttribute(s,fe),ee(e,i.materialParameters,fe)}}:null},this._context.scheduler);return o.slicePlaneEnabled=this._context.slicePlaneEnabled,this._addDisposeResource(()=>{s.removeRenderPlugin(o),o.destroy()}),await s.addRenderPlugin(o,t),o}_getExternalColorParameters(e){const t={};if(t.externalColor=A,!this._drivenProperties.color&&null!=e?.color){const s=e.color.toUnitRGBA();this._drivenProperties.opacity&&(s[3]=NaN),t.externalColor=s}return t}destroy(){super.destroy(),this._cleanupResources()}_cleanupResources(){this._disposeResourceHandles.forEach(e=>e()),this._disposeResourceHandles.length=0,this._resources=null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;const s=N(t.geometry);if(null==s)return this.logger.warn(`unsupported geometry type for object symbol: ${t.geometry.type}`),null;const r=this.createElevationContextForGraphic(t),i=e.renderingInfo;return this._createAs3DShape(t,s,i,r,t.uid)}notifyDestroyGraphicLayer(e){this._instanceIndexToGraphicUid.delete(e.instanceIndex)}graphicLayerToGraphicId(){return 0}layerOpacityChanged(){if(null==this._resources)return;const e=this._getLayerOpacity(),t=this._resources.stageResources.materials;for(let s=0;s<t.length;s++){const r=t[s];r.setParameters({layerOpacity:e}),this._isPrimitive&&r.setParameters({cullFace:de(r.transparent)})}}layerScreenSizePerspectiveChanged(){if(null==this._resources)return;const e=this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null;for(const t of this._resources.stageResources.materials)t.setParameters({screenSizePerspective:e})}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,G)}slicePlaneEnabledChanged(){if(null==this._resources)return!0;this._resources.lodRenderer.slicePlaneEnabled=this._context.slicePlaneEnabled;for(const e of this._resources.stageResources.materials)e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});return!0}physicalBasedRenderingChanged(){if(null==this._resources)return!0;const{stageResources:e,isWosr:t}=this._resources;for(const s of e.materials)this._isPrimitive?s.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}):t||s.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!1});return!1!==this._hasLoadedPBRTextures||!0!==this._context.physicalBasedRenderingEnabled||(this._hasLoadedPBRTextures=!0,!1)}applyRendererDiff(e,t){if(null==this._resources)return 0;const{stageResources:{materials:s},lodRenderer:r,resourceBoundingBox:i,symbolSize:a,resourceSize:o,pivotOffset:n}=this._resources;for(const l in e.diff){if("visualVariables"!==l)return 0;if(!X(this._fastUpdates,t,this._fastVisualVariableConvertOptions(i,a,o,n)))return 0;for(const e of s)e.setParameters(this._fastUpdates.materialParameters);r.notifyShaderTransformationChanged()}return 2}computeComplexity(){if(null==this._resources)return super.computeComplexity();const e=this._resources.lodResources,t=j(e.levels),s=e.computeUsedMemory(),r={...T(this.symbol,this.symbolLayer),resourceBytes:s};return new J({verticesPerFeature:t,memory:r})}_hasLodRenderer(){return null!=this._resources}_createAs3DShape(e,t,s,r,i){if(!this._hasLodRenderer()||null==this._resources)return null;const a=this.getFastUpdateAttrValues(e),o=this._context.clippingExtent;if(x(t,me,this._context.elevationProvider.spatialReference),null!=o&&!C(o,me))return null;const n=ce(r),l=this._computeGlobalTransform(t,r,ue,ye),c=this._computeLocalTransform(this._resources,this.symbolLayer,s,pe),h=this._resources.lodRenderer.instanceData,d=h.addInstance();this._instanceIndexToGraphicUid.set(d,i),h.setLocalTransform(d,c,!1),h.setGlobalTransform(d,l),a&&h.setFeatureAttribute(d,a),null==this._fastUpdates&&this._hasDrivenColorOrOpacity&&h.setColor(d,this._getDrivenUInt8ColorWithNaNSupport(s,this._materialColor,!this._isPrimitive));const m=this._context.stage.renderView.olidRenderHelper;if(m){const e=m.getObjectAndLayerIdColor({graphicUid:i,layerViewUid:this._context.layerViewUid});h.setObjectAndLayerIdColor(d,e)}const p=new V(this,d,B,r,this._context.stage.view.state.highlightOrderMap);return n&&(p.alignedSampledElevation=ye.sampledElevation),p.needsElevationUpdates=G(r.mode),q(p,t,this._context.elevationProvider),p}_computeGlobalTransform(e,t,s,r){return D(e,this._context.elevationProvider,t,this._context.renderCoordsHelper,r),me[0]=e.x,me[1]=e.y,me[2]=r.z,P(e.spatialReference,me,s,this._context.renderCoordsHelper.spatialReference),s}_computeLocalTransform(e,t,r,i){return s(i),this._applyObjectRotation(r,!1,i),this._applyObjectRotation(t,!0,i),this._applyObjectScale(e,r,i),this._applyAnchor(e,t,i),i}_applyObjectScale(e,t,s){if(this._fastUpdates?.requiresShaderTransformation)return;const i=this._drivenProperties.size&&t.size?t.size:e.symbolSize,a=k(i,e.symbolSize,e.resourceSize,this._context.renderCoordsHelper.unitInMeters);1===a[0]&&1===a[1]&&1===a[2]||r(s,s,a)}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchTransform(e,t),this._preparePatchColor(e,t),this._preparePatchEmissive(e,t)}updateGeometry(e,t){if(null==this._resources)return!0;const s=e.geometry;if(!s)return!1;const r=N(s);if(null==r)return!1;const i=this.getGeometryElevationMode(s),{elevationContext:a}=t;return a.mode===i&&(a.updateFeatureExpressionFeature(e,this._context.layer),this._computeGlobalTransform(r,a,ue,ye),ce(a)&&(t.alignedSampledElevation=ye.sampledElevation),this._resources.lodRenderer.instanceData.setGlobalTransform(t.instanceIndex,ue,!0),q(t,r,this._context.elevationProvider),!0)}_preparePatchTransform(e,t){if(!(t.heading||t.tilt||t.roll||t.width||t.height||t.depth||t.anchor||t.anchorPosition))return;if(null==this._resources)return;const s=(e,t,s)=>(null!=e&&"complete"===e.type?e.newValue:t)??s,r=s(t.heading,this.symbolLayer.heading,0),i=s(t.tilt,this.symbolLayer.tilt,0),a=s(t.roll,this.symbolLayer.roll,0),o=s(t.width,this.symbolLayer.width,void 0),n=s(t.height,this.symbolLayer.height,void 0),l=s(t.depth,this.symbolLayer.depth,void 0),c=s(t.anchor,this.symbolLayer.anchor,void 0),h=s(t.anchorPosition,this.symbolLayer.anchorPosition,void 0);delete t.heading,delete t.tilt,delete t.roll,delete t.width,delete t.height,delete t.depth,delete t.anchor,delete t.anchorPosition;const d={heading:r,tilt:i,roll:a,anchor:c,anchorPosition:h},m=this._resources;1===this.loadStatus&&e.symbolLayerStatePatches.push(()=>{m.symbolSize=p(E(m.resourceSize,{width:o,height:n,depth:l,isPrimitive:this._isPrimitive}))}),e.graphics3DGraphicPatches.push(({instanceIndex:e},t)=>{const s=this._computeLocalTransform(m,d,t,pe);m.lodRenderer.instanceData.setLocalTransform(e,s,!0)})}_preparePatchColor(e,t){if(!t.material||"partial"!==t.material.type)return;const s=t.material.diff;if(!s.color||"complete"!==s.color.type||null==s.color.newValue||null==s.color.oldValue)return;const r=s.color.newValue,i=null!=r?r.toUnitRGBA():b;delete s.color;const a=this._resources;if(null==a)return;const o=this._isPrimitive;e.graphics3DGraphicPatches.push(({instanceIndex:e})=>{if(this._hasDrivenColorOrOpacity)a.lodRenderer.instanceData.setColor(e,i);else{const e={externalColor:i};for(const t of a.stageResources.materials)t.setParameters(e),o&&t.setParameters({cullFace:de(t.transparent)})}})}_preparePatchEmissive(e,t){if(!this.view.stage.renderView.renderingContext.driverTest.floatBufferBlend.result||!t.material||"partial"!==t.material.type||!t.material.diff)return;const s=t.material.diff;if(!s.emissive)return;const r=s.emissive.type;if("collection"===r||"complete"===r)return;const i=s.emissive.diff,a=i?.strength,o=i?.source;if(!i||o||!a||"complete"!==a.type)return;const n={emissiveStrengthFromSymbol:a.newValue??(this._isPrimitive?0:1)};e.graphics3DGraphicPatches.push(()=>{this._resources?.stageResources.materials.forEach(e=>e.setParameters(n))}),delete s.emissive}_applyObjectRotation(e,t,s){if(!this._fastUpdates?.requiresShaderTransformation||!t)return H(e.heading,e.tilt,e.roll,s)}_applyAnchor(e,t,s){if(this._fastUpdates?.requiresShaderTransformation)return;const r=le(e.resourceBoundingBox,e.pivotOffset,t);r&&i(s,s,r)}_fastVisualVariableConvertOptions(e,t,s,r){const i=null!=e?p(S(e)):u,a=null!=e?le(e,r,this.symbolLayer):y,o=this._context.renderCoordsHelper.unitInMeters,n=k(null!=t?t:void 0,t,s,o),l=_(this.symbolLayer.tilt||0,this.symbolLayer.roll||0,this.symbolLayer.heading||0);return new Y({supports:{size:!0,color:!0,rotation:!0,opacity:!1},modelSize:i,symbolSize:t??u,unitInMeters:o,anchor:a,scale:n,rotation:l,fallbackColor:this._getFallbackOpacityAndColor(),fallbackSize:n})}get _primitive(){const{resource:e}=this.symbolLayer;return null!=e?.href?null:e?.primitive??O}_getFallbackOpacityAndColor(){return this._materialColor?.toUnitRGBA()??(this._isPrimitive?g:A)}get _materialColor(){return this.symbolLayer.material?.color}}function le(e,t,s){const r=f();switch(s.anchor){case"center":c(r,w(e)),l(r,r);break;case"top":{const t=w(e);m(r,-t[0],-t[1],-e[5]);break}case"bottom":{const t=w(e);m(r,-t[0],-t[1],-e[2]);break}case"relative":{const t=w(e),i=S(e),a=s.anchorPosition,o=a?_(a.x,a.y,a.z):y;h(r,i,o),d(r,r,t),l(r,r);break}default:null!=t?l(r,t):c(r,y)}return r}function ce(e){return"absolute-height"!==e.mode}function he(e){return 1===(e.material?.color?.a??0)&&null==e.resource?.href}function de(e){return e?0:2}const me=f(),pe=o(),ue=o(),fe=v(),ye=new z;export{ne as Graphics3DObjectSymbolLayer};
5
+ import{throwIfAborted as e}from"../../../../core/promiseUtils.js";import{pt2px as t}from"../../../../core/screenUtils.js";import{identity as s,scale as r,translate as i,copy as a}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{length as n,negate as l,copy as c,multiply as h,add as d,set as m}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromArray as u,ONES as p,create as f,ZEROS as y,fromValues as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as g,ONES as b,create as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{computeTranslationToOriginAndRotation as P}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectPointToVector as x}from"../../../../geometry/projection/projectPointToVector.js";import{create as R,size as S,containsPoint as C,center as w}from"../../../../geometry/support/aaBoundingBox.js";import{getEmissiveMode as L}from"../../../../symbols/support/materialUtils.js";import{defaultObjectPrimitive as U}from"../../../../symbols/support/primitives.js";import{objectSymbolLayerPrimitiveBoundingBox as O,objectSymbolLayerSizeWithResourceSize as E}from"../../../../symbols/support/symbolLayerUtils3D.js";import{estimateNumVerticesForLods as j,defaultSymbolLayerMemoryComplexity as T}from"./defaultSymbolComplexity.js";import{perLodInstanceElevationAligner as B}from"./ElevationAligners.js";import{needsElevationUpdates3D as G,SampleElevationInfo as z,evaluateElevationInfoAtPoint as D}from"./elevationAlignmentUtils.js";import{preparePatchEmissiveStrength as V}from"./emissiveUtils.js";import{Graphics3DLodInstanceGraphicLayer as F}from"./Graphics3DLodInstanceGraphicLayer.js";import{Graphics3DSymbolLayer as A,nanFallbackColor as I}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as k,computeObjectScale as H,computeObjectRotation as M}from"./graphicUtils.js";import{makeLodResources as W}from"./lodResourceUtils.js";import{fetch as N}from"./objectResourceUtils.js";import{placePointOnGeometry as q,extendPointGraphicElevationContext as $}from"./pointUtils.js";import{isValidPrimitive as Z,primitiveLodResources as J}from"./primitiveObjectSymbolUtils.js";import{SymbolComplexity as K}from"./SymbolComplexity.js";import{getResourceUrlFromSymbolStyle as Q}from"./webStyleUtils.js";import{initFastSymbolUpdatesState as X,updateFastSymbolUpdatesState as Y,ConvertOptions as ee,evaluateModelTransformScale as te,evaluateModelTransform as se}from"../support/FastSymbolUpdates.js";import{VerticalOffsetParameters as re}from"../../webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{LodRenderer as ie}from"../../webgl-engine/lib/lodRendering/LodRenderer.js";import{DefaultMaterial as ae}from"../../webgl-engine/materials/DefaultMaterial.js";import{schematicMRRFactors as oe}from"../../webgl-engine/materials/pbrUtils.js";class ne{constructor(e,t,s,r,i,a,o,n,l,c,h=null){this.lodResources=e,this.lodRenderer=t,this.stageResources=s,this.resourceSize=r,this.isEsriSymbolResource=i,this.isWosr=a,this.resourceBoundingBox=o,this.symbolSize=n,this.extentPadding=l,this.physicalBasedRenderingEnabled=c,this.pivotOffset=h}}class le extends A{getCachedSize(){const[e,t,s]=null!=this._resources?this._resources.symbolSize:[1,1,1];return{width:e,depth:t,height:s}}constructor(e,t,s,r){super(e,t,s,r,de(t)),this._resources=null,this._instanceIndexToGraphicUid=new Map,this._hasLoadedPBRTextures=!1,this._disposeResourceHandles=new Array,this.skipHighSymbolLodsChanged=!1,this.ensureDrapedStatus(!1),this._hasLoadedPBRTextures=s.physicalBasedRenderingEnabled}async doLoad(e){if(!this._drivenProperties.size){const e=k(this.symbolLayer);if(e)throw new Error(e)}if(this._isPrimitive){const t=this.symbolLayer.resource,s=t&&Z(t?.primitive)?t.primitive:U;this._resources=await this._createResourcesForPrimitive(s,e)}else{const t=await Q(this.symbol.styleOrigin),s=t?.href??this.symbolLayer.resource?.href;this._resources=await this._createResourcesForUrl(s,e)}this.layerOpacityChanged(),this.slicePlaneEnabledChanged(),this.physicalBasedRenderingChanged(),this.updateComplexity()}get extentPadding(){return null!=this._resources?this._resources.extentPadding:0}get _isPrimitive(){return null!=this._primitive}get lodRenderer(){return this._resources?.lodRenderer}get materials(){return this._resources?.stageResources.materials??[]}async _createResourcesForPrimitive(e,t){const s=this.symbolLayer,r=R(O(e)),i=u(S(r)),a=u(E(i,s)),o=n(a),l=!1,c=!1,h=s?.material,d={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,mrrFactors:oe,ambient:p,diffuse:p,opacity:1,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:s.castShadows,emissiveStrengthFromSymbol:h?.emissive?.strength??0,emissiveSource:1,offsetTransparentBackfaces:!1,drivenOpacity:this.needsDrivenTransparentPass},m=!!d.usePBR,f=this.symbol;"point-3d"===f.type&&f.verticalOffset&&(d.verticalOffset=new re(f.verticalOffset),d.castShadows=!1),this._context.screenSizePerspectiveEnabled&&(d.screenSizePerspective=this.view.screenSizePerspective.parameters),this._hasDrivenColorOrOpacity?d.externalColor=I:d.externalColor=this._materialColor?.toUnitRGBA()??g,this._fastUpdates=X(this._context.renderer,this._fastVisualVariableConvertOptions(r,a,i,null)),d.instanced=!0,this._fastUpdates?(Object.assign(d,this._fastUpdates.materialParameters),d.instancedFeatureAttribute=!0):this._hasDrivenColorOrOpacity&&(d.instancedColor=!0);const y=new ae(d,this._context);y.setParameters({cullFace:me(y.transparent)});const _=J(e,y);if(!_)throw new Error(`Unknown object symbol primitive: ${e}`);const b=await this._createStageResources(_,m,t),v=await this._createLodRenderer(_,t);return new ne(_,v,b,i,l,c,r,a,o,m)}async _createResourcesForUrl(e,s){const r={instanced:!0,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows},i={spherical:this._context.spherical,materialParameters:r,cache:this._context.sharedResources.objectResourceCache,compressionOptions:{compressionTracker:this._context.compressionTracker,compressionCallback:()=>this.updateComplexity()}};this._fastUpdates=X(this._context.renderer,this._fastVisualVariableConvertOptions(null,null,null,null)),this._fastUpdates?(Object.assign(i.materialParameters,this._fastUpdates.materialParameters),i.materialParameters.instancedFeatureAttribute=!0):this._hasDrivenColorOrOpacity&&(i.materialParameters.instancedColor=!0);const a=this.symbol;if("point-3d"===a.type&&a.verticalOffset){const{screenLength:e,minWorldLength:s,maxWorldLength:r}=a.verticalOffset;i.materialParameters.verticalOffset={screenLength:t(e),minWorldLength:s||0,maxWorldLength:null!=r?r:1/0},i.materialParameters.castShadows=!1}const o=this._context.physicalBasedRenderingEnabled;i.signal=s,i.usePBR=o,i.useEmissive=this.view.stage.renderView.renderingContext.driverTest.floatBufferBlend.result,i.skipHighLods=this._context.skipHighSymbolLods;const l=this.symbolLayer.material;i.materialParameters.emissiveStrengthFromSymbol=l?.emissive?.strength??1,i.materialParameters.emissiveSource=L(l?.emissive?.source??"emissive");const c=await N(e,i),h=c.isEsriSymbolResource,d=c.isWosr,m=W(c.lods),p=this._context,f=this._getExternalColorParameters(l),y=this.needsDrivenTransparentPass,_=m.getMaterials();_.forEach(e=>{e.setParameters({...f,drivenOpacity:y}),p.screenSizePerspectiveEnabled&&e.setParameters({screenSizePerspective:this.view.screenSizePerspective.parameters})});const g=c.referenceBoundingBox,b=u(S(g)),v=u(m.levels[0].pivotOffset),P=u(E(b,this.symbolLayer)),x=n(P),R=this._fastUpdates;Y(R,this._context.renderer,this._fastVisualVariableConvertOptions(g,P,b,v))&&_.forEach(e=>e.setParameters(R.materialParameters));const C=await this._createStageResources(m,o,s),w=await this._createLodRenderer(m,s);return new ne(m,w,C,b,h,d,g,P,x,o,v)}_addDisposeResource(e){this._disposeResourceHandles.push(e)}async _createStageResources(t,s,r){const i=this._context.stage,a=t.getMaterials();s!==this._context.physicalBasedRenderingEnabled&&this.physicalBasedRenderingChanged();const o=t.getTextures();i.addTextures(o),this._addDisposeResource(()=>{o.forEach(e=>e.unload()),i.removeTextures(o)}),await Promise.all(o.map(e=>this._context.stage.schedule(()=>e.load(i.renderView.renderingContext),r))),e(r);const n=t.getEngineGeometries();return{materials:a,textures:o,geometries:n}}async _createLodRenderer(e,t){const s=this._context.stage,r={layerViewUid:this._context.layerViewUid,graphicUid:e=>this._instanceIndexToGraphicUid.get(e),notifyGraphicGeometryChanged:e=>this._context.notifyGraphicGeometryChanged(this._instanceIndexToGraphicUid.get(e)),notifyGraphicVisibilityChanged:e=>this._context.notifyGraphicVisibilityChanged(this._instanceIndexToGraphicUid.get(e))},i=this._fastUpdates,o=new ie({symbol:e,metadata:r,shaderTransformation:i?{applyTransform:(e,t,s)=>{e.getFeatureAttribute(t,ye),a(s,se(i.materialParameters,ye,s))},scaleFactor:(e,t,s)=>{t.getFeatureAttribute(s,ye),te(e,i.materialParameters,ye)}}:null},this._context.scheduler);return o.slicePlaneEnabled=this._context.slicePlaneEnabled,this._addDisposeResource(()=>{s.removeRenderPlugin(o),o.destroy()}),await s.addRenderPlugin(o,t),o}_getExternalColorParameters(e){const t={};if(t.externalColor=I,!this._drivenProperties.color&&null!=e?.color){const s=e.color.toUnitRGBA();this._drivenProperties.opacity&&(s[3]=NaN),t.externalColor=s}return t}destroy(){super.destroy(),this._cleanupResources()}_cleanupResources(){this._disposeResourceHandles.forEach(e=>e()),this._disposeResourceHandles.length=0,this._resources=null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;const s=q(t.geometry);if(null==s)return this.logger.warn(`unsupported geometry type for object symbol: ${t.geometry.type}`),null;const r=this.createElevationContextForGraphic(t),i=e.renderingInfo;return this._createAs3DShape(t,s,i,r,t.uid)}notifyDestroyGraphicLayer(e){this._instanceIndexToGraphicUid.delete(e.instanceIndex)}graphicLayerToGraphicId(){return 0}layerOpacityChanged(){if(null==this._resources)return;const e=this._getLayerOpacity(),t=this._resources.stageResources.materials;for(let s=0;s<t.length;s++){const r=t[s];r.setParameters({layerOpacity:e}),this._isPrimitive&&r.setParameters({cullFace:me(r.transparent)})}}layerScreenSizePerspectiveChanged(){if(null==this._resources)return;const e=this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null;for(const t of this._resources.stageResources.materials)t.setParameters({screenSizePerspective:e})}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,G)}slicePlaneEnabledChanged(){if(null==this._resources)return!0;this._resources.lodRenderer.slicePlaneEnabled=this._context.slicePlaneEnabled;for(const e of this._resources.stageResources.materials)e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});return!0}physicalBasedRenderingChanged(){if(null==this._resources)return!0;const{stageResources:e,isWosr:t}=this._resources;for(const s of e.materials)this._isPrimitive?s.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}):t||s.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!1});return!1!==this._hasLoadedPBRTextures||!0!==this._context.physicalBasedRenderingEnabled||(this._hasLoadedPBRTextures=!0,!1)}applyRendererDiff(e,t){if(null==this._resources)return 0;const{stageResources:{materials:s},lodRenderer:r,resourceBoundingBox:i,symbolSize:a,resourceSize:o,pivotOffset:n}=this._resources;for(const l in e.diff){if("visualVariables"!==l)return 0;if(!Y(this._fastUpdates,t,this._fastVisualVariableConvertOptions(i,a,o,n)))return 0;for(const e of s)e.setParameters(this._fastUpdates.materialParameters);r.notifyShaderTransformationChanged()}return 2}computeComplexity(){if(null==this._resources)return super.computeComplexity();const e=this._resources.lodResources,t=j(e.levels),s=e.computeUsedMemory(),r={...T(this.symbol,this.symbolLayer),resourceBytes:s};return new K({verticesPerFeature:t,memory:r})}_hasLodRenderer(){return null!=this._resources}_createAs3DShape(e,t,s,r,i){if(!this._hasLodRenderer()||null==this._resources)return null;const a=this.getFastUpdateAttrValues(e),o=this._context.clippingExtent;if(x(t,ue,this._context.elevationProvider.spatialReference),null!=o&&!C(o,ue))return null;const n=he(r),l=this._computeGlobalTransform(t,r,fe,_e),c=this._computeLocalTransform(this._resources,this.symbolLayer,s,pe),h=this._resources.lodRenderer.instanceData,d=h.addInstance();this._instanceIndexToGraphicUid.set(d,i),h.setLocalTransform(d,c,!1),h.setGlobalTransform(d,l),a&&h.setFeatureAttribute(d,a),null==this._fastUpdates&&this._hasDrivenColorOrOpacity&&h.setColor(d,this._getDrivenUInt8ColorWithNaNSupport(s,this._materialColor,!this._isPrimitive));const m=this._context.stage.renderView.olidRenderHelper;if(m){const e=m.getObjectAndLayerIdColor({graphicUid:i,layerViewUid:this._context.layerViewUid});h.setObjectAndLayerIdColor(d,e)}const u=new F(this,d,B,r,this._context.stage.view.state.highlightOrderMap);return n&&(u.alignedSampledElevation=_e.sampledElevation),u.needsElevationUpdates=G(r.mode),$(u,t,this._context.elevationProvider),u}_computeGlobalTransform(e,t,s,r){return D(e,this._context.elevationProvider,t,this._context.renderCoordsHelper,r),ue[0]=e.x,ue[1]=e.y,ue[2]=r.z,P(e.spatialReference,ue,s,this._context.renderCoordsHelper.spatialReference),s}_computeLocalTransform(e,t,r,i){return s(i),this._applyObjectRotation(r,!1,i),this._applyObjectRotation(t,!0,i),this._applyObjectScale(e,r,i),this._applyAnchor(e,t,i),i}_applyObjectScale(e,t,s){if(this._fastUpdates?.requiresShaderTransformation)return;const i=this._drivenProperties.size&&t.size?t.size:e.symbolSize,a=H(i,e.symbolSize,e.resourceSize,this._context.renderCoordsHelper.unitInMeters);1===a[0]&&1===a[1]&&1===a[2]||r(s,s,a)}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchTransform(e,t),this._preparePatchColor(e,t),this._preparePatchEmissive(e,t)}updateGeometry(e,t){if(null==this._resources)return!0;const s=e.geometry;if(!s)return!1;const r=q(s);if(null==r)return!1;const i=this.getGeometryElevationMode(s),{elevationContext:a}=t;return a.mode===i&&(a.updateFeatureExpressionFeature(e,this._context.layer),this._computeGlobalTransform(r,a,fe,_e),he(a)&&(t.alignedSampledElevation=_e.sampledElevation),this._resources.lodRenderer.instanceData.setGlobalTransform(t.instanceIndex,fe,!0),$(t,r,this._context.elevationProvider),!0)}_preparePatchTransform(e,t){if(!(t.heading||t.tilt||t.roll||t.width||t.height||t.depth||t.anchor||t.anchorPosition))return;if(null==this._resources)return;const s=(e,t,s)=>(null!=e&&"complete"===e.type?e.newValue:t)??s,r=s(t.heading,this.symbolLayer.heading,0),i=s(t.tilt,this.symbolLayer.tilt,0),a=s(t.roll,this.symbolLayer.roll,0),o=s(t.width,this.symbolLayer.width,void 0),n=s(t.height,this.symbolLayer.height,void 0),l=s(t.depth,this.symbolLayer.depth,void 0),c=s(t.anchor,this.symbolLayer.anchor,void 0),h=s(t.anchorPosition,this.symbolLayer.anchorPosition,void 0);delete t.heading,delete t.tilt,delete t.roll,delete t.width,delete t.height,delete t.depth,delete t.anchor,delete t.anchorPosition;const d={heading:r,tilt:i,roll:a,anchor:c,anchorPosition:h},m=this._resources;1===this.loadStatus&&e.symbolLayerStatePatches.push(()=>{m.symbolSize=u(E(m.resourceSize,{width:o,height:n,depth:l,isPrimitive:this._isPrimitive}))}),e.graphics3DGraphicPatches.push(({instanceIndex:e},t)=>{const s=this._computeLocalTransform(m,d,t,pe);m.lodRenderer.instanceData.setLocalTransform(e,s,!0)})}_preparePatchColor(e,t){if(!t.material||"partial"!==t.material.type)return;const s=t.material.diff;if(!s.color||"complete"!==s.color.type||null==s.color.newValue||null==s.color.oldValue)return;const r=s.color.newValue,i=null!=r?r.toUnitRGBA():b;delete s.color;const a=this._resources;if(null==a)return;const o=this._isPrimitive;e.graphics3DGraphicPatches.push(({instanceIndex:e})=>{if(this._hasDrivenColorOrOpacity)a.lodRenderer.instanceData.setColor(e,i);else{const e={externalColor:i};for(const t of a.stageResources.materials)t.setParameters(e),o&&t.setParameters({cullFace:me(t.transparent)})}})}_preparePatchEmissive(e,t){return V(e,t,e=>{this._resources?.stageResources.materials.forEach(t=>t.setParameters({emissiveStrengthFromSymbol:e??(this._isPrimitive?0:1)}))},this.view.stage.renderView.renderingContext.driverTest.floatBufferBlend.result)}_applyObjectRotation(e,t,s){if(!this._fastUpdates?.requiresShaderTransformation||!t)return M(e.heading,e.tilt,e.roll,s)}_applyAnchor(e,t,s){if(this._fastUpdates?.requiresShaderTransformation)return;const r=ce(e.resourceBoundingBox,e.pivotOffset,t);r&&i(s,s,r)}_fastVisualVariableConvertOptions(e,t,s,r){const i=null!=e?u(S(e)):p,a=null!=e?ce(e,r,this.symbolLayer):y,o=this._context.renderCoordsHelper.unitInMeters,n=H(null!=t?t:void 0,t,s,o),l=_(this.symbolLayer.tilt||0,this.symbolLayer.roll||0,this.symbolLayer.heading||0);return new ee({supports:{size:!0,color:!0,rotation:!0,opacity:!1},modelSize:i,symbolSize:t??p,unitInMeters:o,anchor:a,scale:n,rotation:l,fallbackColor:this._getFallbackOpacityAndColor(),fallbackSize:n})}get _primitive(){const{resource:e}=this.symbolLayer;return null!=e?.href?null:e?.primitive??U}_getFallbackOpacityAndColor(){return this._materialColor?.toUnitRGBA()??(this._isPrimitive?g:I)}get _materialColor(){return this.symbolLayer.material?.color}}function ce(e,t,s){const r=f();switch(s.anchor){case"center":c(r,w(e)),l(r,r);break;case"top":{const t=w(e);m(r,-t[0],-t[1],-e[5]);break}case"bottom":{const t=w(e);m(r,-t[0],-t[1],-e[2]);break}case"relative":{const t=w(e),i=S(e),a=s.anchorPosition,o=a?_(a.x,a.y,a.z):y;h(r,i,o),d(r,r,t),l(r,r);break}default:null!=t?l(r,t):c(r,y)}return r}function he(e){return"absolute-height"!==e.mode}function de(e){return 1===(e.material?.color?.a??0)&&null==e.resource?.href}function me(e){return e?0:2}const ue=f(),pe=o(),fe=o(),ye=v(),_e=new z;export{le as Graphics3DObjectSymbolLayer};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ function e(e,t,i,s){if(!s||!t.material||"partial"!==t.material.type||!t.material.diff)return;const r=t.material.diff;if(!r.emissive)return;const a=r.emissive.type;if("collection"===a||"complete"===a)return;const l=r.emissive.diff,m=l?.strength,n=l?.source;l&&!n&&m&&"complete"===m.type&&(e.symbolLayerStatePatches.push(()=>{i(m.newValue)}),delete r.emissive)}export{e as preparePatchEmissiveStrength};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{indexOf as r,PositionHint as i}from"../../../../core/arrayUtils.js";import s from"../../../../core/Logger.js";import{clamp as n}from"../../../../core/mathUtils.js";import{unwrapUpdating as o,updating as l,isUpdating as a}from"../../../../core/maybeUpdating.js";import{whenOnce as c}from"../../../../core/reactiveUtils.js";import{getUnitString as p}from"../../../../core/units.js";import{property as u,subclass as g}from"../../../../core/accessorSupport/decorators.js";import{transformMat3 as d,add as m,set as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"../../../../core/sql/WhereClause.js";import{getReferenceEllipsoid as j}from"../../../../geometry/ellipsoidUtils.js";import{load as w,project as b}from"../../../../geometry/projectionUtils.js";import v from"../../../../geometry/SpatialReference.js";import{projectBoundingSphere as R}from"../../../../geometry/projection/projectBoundingSphere.js";import{projectVectorToVector as F}from"../../../../geometry/projection/projectVectorToVector.js";import{create as S}from"../../../../geometry/support/aaBoundingBox.js";import{fromValues as _,expandWithNestedArray as k,expand as M}from"../../../../geometry/support/aaBoundingRect.js";import{doubleArrayFrom as E}from"../../../../geometry/support/DoubleArray.js";import{earth as I}from"../../../../geometry/support/Ellipsoid.js";import{isWGS84 as G,isWebMercator as x}from"../../../../geometry/support/spatialReferenceUtils.js";import{Sphere as L}from"../../../../geometry/support/sphere.js";import{project as O}from"../../../../geometry/support/webMercatorUtils.js";import B from"../../../../layers/support/FeatureFilter.js";import{objectIdFilter as T,filterInPlace as U}from"./I3SUtil.js";let C=class extends t{constructor(e){super(e),this._projectionEngineLoaded=!1}initialize(){c(()=>this.viewFilter?.geometry||null!=this.layerFilter).then(()=>this.loadAsyncModule(import("../../../../geometry/geometryEngine.js").then(e=>{this.destroyed||(this._geometryEngine=e)})))}get sortedObjectIds(){if(null==this.viewFilter?.objectIds)return null;const e=E(this.viewFilter.objectIds);return e.sort(),e}get parsedWhereClause(){const e=this.viewFilter?.where;if(null==e||!e)return null;try{return h.create(e,{fieldsIndex:this.layerFieldsIndex})}catch(t){s.getLogger(this).error(`Failed to parse filter where clause: ${t}`)}return null}addFilters(e,t,r,i){const n=this.sortedObjectIds;null!=n&&e.push(e=>T(n,!0,e)),this.addSqlFilter(e,this.parsedWhereClause),this.addTimeFilter(e,this.viewFilter?.timeExtent);const l=o(this._layerMaskGeometries),a=this._geometryEngine,c=()=>s.getLogger(this);if(null!=l&&null!=this.layerFilter&&null!=a){const s=this.layerFilter.spatialRelationship;e.push((e,n)=>N(c,a,e,n,i,t,r,l,s))}const p=o(this._viewMaskGeometries);if(null!=p&&null!=this.viewFilter&&null!=a){const s=this.viewFilter.spatialRelationship;e.push((e,n)=>N(c,a,e,n,i,t,r,p,s))}}isMBSGeometryVisible(e,t,r){const i=o(this._layerMaskGeometries),n=this._geometryEngine;if(null!=i&&null!=this.layerFilter&&null!=n){const o=this.layerFilter.spatialRelationship,l=i[0].spatialReference||t;if(!R(e,r,$,l))return s.getLogger(this).warnOnce("SceneLayer.mask geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0;return q(n,$,i,l,o)}const l=o(this._viewMaskGeometries);if(null!=l&&null!=this.viewFilter&&null!=n){const i=this.viewFilter.spatialRelationship,o=l[0].spatialReference||t;if(!R(e,r,$,o))return s.getLogger(this).warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0;return q(n,$,l,o,i)}return!0}get parsedGeometry(){const e=o(this._viewMaskGeometries),t=o(this._layerMaskGeometries);return null==e||null==t?e||t:t.concat(e)}get _layerMaskGeometries(){const e=this.layerFilter;return null==e?null:null==this._geometryEngine?l:"disjoint"===e.spatialRelationship?e.geometries.map(e=>({type:"polygon",rings:e.rings,spatialReference:e.spatialReference,cache:{}})):[e.geometries.reduce((e,t)=>(e.rings=[...e.rings,...t.rings],e),{type:"polygon",rings:[],spatialReference:e.geometries[0].spatialReference,cache:{}})]}get _viewMaskGeometries(){if(null==this.viewFilter)return null;const{geometry:e}=this.viewFilter;if(null==e)return null;if(null==this.viewFilter||null==this._geometryEngine)return l;const{distance:t,units:r}=this.viewFilter,i=this.viewFilter.spatialRelationship,n="mesh"===e.type?e.extent:e;if(null==t||0===t)return V(this._geometryEngine,n,i);const o=r||p(n.spatialReference);if(n.spatialReference.isWGS84){const e=this._geometryEngine.geodesicBuffer(n,t,o);return V(this._geometryEngine,e,i)}const a=O(n,v.WGS84);if(null!=a){const e=O(this._geometryEngine.geodesicBuffer(a,t,o),n.spatialReference);return V(this._geometryEngine,e,i)}if(!this._projectionEngineLoaded&&(this.loadAsyncModule(w().then(()=>this._projectionEngineLoaded=!0)),!this._projectionEngineLoaded))return null;let c=null;try{c=b(n,v.WGS84)}catch(u){}if(c)try{c=b(this._geometryEngine.geodesicBuffer(c,t,o),n.spatialReference)}catch(u){c=null}return c||s.getLogger(this).error(`Filter by geodesic buffer (distance) unsupported, failed to project input geometry (${n.spatialReference.wkid}) to WGS84.`),V(this._geometryEngine,c,i)}get updating(){return a(this._layerMaskGeometries)||a(this._viewMaskGeometries)}static checkSupport(e){return null!=e&&(!!A(e.spatialRelationship)||(s.getLogger(this.prototype).warn(`Filters with spatialRelationship other than ${W.join(", ")} are not supported for mesh scene layers`),!1))}};e([u()],C.prototype,"layerFilter",void 0),e([u({type:B})],C.prototype,"viewFilter",void 0),e([u()],C.prototype,"layerFieldsIndex",void 0),e([u()],C.prototype,"loadAsyncModule",void 0),e([u()],C.prototype,"addSqlFilter",void 0),e([u()],C.prototype,"addTimeFilter",void 0),e([u({readOnly:!0})],C.prototype,"sortedObjectIds",null),e([u({readOnly:!0})],C.prototype,"parsedWhereClause",null),e([u({readOnly:!0})],C.prototype,"parsedGeometry",null),e([u({readOnly:!0})],C.prototype,"_layerMaskGeometries",null),e([u({readOnly:!0})],C.prototype,"_viewMaskGeometries",null),e([u()],C.prototype,"updating",null),e([u()],C.prototype,"_projectionEngineLoaded",void 0),e([u()],C.prototype,"_geometryEngine",void 0),C=e([g("esri.views.3d.layers.i3s.I3SMeshViewFilter")],C);const W=(e=>e)(["contains","intersects","disjoint"]);function A(e){return null!=e&&W.includes(e)}function V(e,t,s){if(null==t)return null;if("disjoint"===s&&"polygon"===t.type){const s=t.rings.length,n=t.spatialReference,o=new Array(s);for(let e=0;e<s;++e){const r=_(1/0,1/0,-1/0,-1/0);k(r,t.rings[e]),o[e]={type:"polygon",rings:[t.rings[e]],spatialReference:n,cache:{},aabr:r}}o.sort((e,t)=>e.aabr[0]-t.aabr[0]);const l=new Set,a=new i;for(let t=0;t<o.length;++t){const i=o[t],s=i.aabr[0];l.forEach(t=>{if(s>=t.aabr[2])return void l.delete(t);if(i.aabr[1]>t.aabr[3]||i.aabr[3]<t.aabr[1]||!e.intersects(i,t))return;i.rings=i.rings.concat(t.rings),M(i.aabr,t.aabr,i.aabr),i.cache={},l.delete(t);const n=r(o,t,o.length,a);o.splice(n,1)}),l.add(i)}for(const e of o)e.aabr=void 0;return o}return[t]}function q(e,t,r,i,s){if(t.radius>=.5*(t.center[2]+j(i).radius))return!0;const n=D(e,t,i);return r.every(t=>1!==H(e,t,n,s))}function N(e,t,r,i,s,n,o,l,a){const c=l[0].spatialReference||n.spatialReference;if(!R(i.node.serviceMbsInIndexSR,o,$,c))return void e().warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter");const p=D(t,$,c),u=z(a,n,c,s,i.objectHandle),g="intersects"===a;let d=null;for(const m of l){if(0===r.length)return;switch(H(t,m,p,a)){case 1:return g&&(i.weaklyRemovedIds=i.weaklyRemovedIds?.concat(r)??r.slice()),void(r.length=0);case 0:continue}U(r,i.featureIds,e=>!!J(t,m,e,u)||(g&&(d||=[],d.push(i.featureIds[e])),!1))}d&&(i.weaklyRemovedIds=i.weaklyRemovedIds?.concat(d)??d)}const $=new L;function z(e,t,r,i,s){const n=t.renderSpatialReference,o=new Map,l={type:"polygon",rings:[[[0,0,0],[0,0,0],[0,0,0],[0,0,0]]],spatialReference:r};l.rings[0][3]=l.rings[0][0];const a={indices:null,data:null,stride:0,startIndex:0,endIndex:0};let c,p;switch(e){case"intersects":c=(e,t,r)=>e.intersects(t,r)?0:2,p=P;break;case"contains":c=(e,t,r)=>e.contains(t,r)?2:1,p=P;break;default:c=(e,t,r)=>e.disjoint(t,r)?2:1,p=Z}return{collection:i,object:s,type:e,maskSR:r,renderSR:n,aabbCache:o,triangle:l,positions:a,triangleTest:c,geometryTest:p}}function D(e,t,r){const i={type:"point",x:t.center[0],y:t.center[1],hasZ:!1,hasM:!1,spatialReference:r},s=!G(r)&&!x(r),o=Number.isNaN(t.radius)?0:n(t.radius,0,2*I.radius),l=s?e.buffer(i,o,1):e.geodesicBuffer(i,o,1);return l.type="polygon",l}function H(e,t,r,i){switch(i){case"intersects":case"contains":return P(e,t,r);case"disjoint":return Z(e,t,r)}}function P(e,t,r){return e.intersects(t,r)?e.contains(t,r)?0:2:1}function Z(e,t,r){return e.intersects(t,r)?e.contains(t,r)?1:2:0}function J(e,t,r,i){const{collection:s,object:n,renderSR:o,maskSR:l,geometryTest:a,aabbCache:c}=i;let p=c.get(r);if(!p){const e=s.getObjectTransform(n);s.getComponentAabb(n,r,K);const t=[y(K[0],K[1],0),y(K[0],K[4],0),y(K[3],K[4],0),y(K[3],K[1],0)];for(let r=0;r<4;++r)d(t[r],t[r],e.rotationScale),m(t[r],t[r],e.position),F(t[r],o,t[r],l);p={type:"polygon",rings:[t],spatialReference:l,cache:{}},p.rings[0][4]=p.rings[0][0],c.set(r,p)}switch(a(e,t,p)){case 1:return!1;case 0:return!0}const{triangle:u,triangleTest:g,positions:h}=i,j=u.rings[0][0],w=u.rings[0][1],b=u.rings[0][2],v=s.getObjectTransform(n);s.getComponentPositions(n,r,h);const{indices:R,data:S,stride:_,startIndex:k,endIndex:M}=h;for(let y=k;y<M;y+=3){const r=_*R[y],i=_*R[y+1],s=_*R[y+2];switch(f(j,S[r],S[r+1],S[r+2]),f(w,S[i],S[i+1],S[i+2]),f(b,S[s],S[s+1],S[s+2]),d(j,j,v.rotationScale),d(w,w,v.rotationScale),d(b,b,v.rotationScale),m(j,j,v.position),m(w,w,v.position),m(b,b,v.position),F(j,o,j,l),F(w,o,w,l),F(b,o,b,l),g(e,t,u)){case 1:return!1;case 0:return!0}}return"intersects"!==i.type}const K=S();export{C as I3SMeshViewFilter};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{indexOf as r,PositionHint as i}from"../../../../core/arrayUtils.js";import s from"../../../../core/Logger.js";import{clamp as o}from"../../../../core/mathUtils.js";import{unwrapUpdating as n,updating as a,isUpdating as l}from"../../../../core/maybeUpdating.js";import{whenOnce as c}from"../../../../core/reactiveUtils.js";import{getUnitString as p,lengthUnits as u}from"../../../../core/units.js";import{property as m,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{transformMat3 as g,add as f,set as y}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import j from"../../../../core/sql/WhereClause.js";import{getReferenceEllipsoid as w}from"../../../../geometry/ellipsoidUtils.js";import{projectBoundingSphere as v}from"../../../../geometry/projection/projectBoundingSphere.js";import{projectVectorToVector as R}from"../../../../geometry/projection/projectVectorToVector.js";import{create as O}from"../../../../geometry/support/aaBoundingBox.js";import{fromValues as b,expandWithNestedArray as F,expand as S}from"../../../../geometry/support/aaBoundingRect.js";import{doubleArrayFrom as x}from"../../../../geometry/support/DoubleArray.js";import{earth as _}from"../../../../geometry/support/Ellipsoid.js";import{isWGS84 as k,isWebMercator as I}from"../../../../geometry/support/spatialReferenceUtils.js";import{Sphere as M}from"../../../../geometry/support/sphere.js";import G from"../../../../layers/support/FeatureFilter.js";import{objectIdFilter as L,filterInPlace as T}from"./I3SUtil.js";let B=class extends t{constructor(e){super(e)}initialize(){c(()=>this.viewFilter?.geometry||this.layerFilter).then(()=>Promise.all([this._loadOperator(import("../../../../geometry/operators/json/geodesicBufferOperator.js")),this._loadOperator(import("../../../../geometry/operators/json/bufferOperator.js")),this._loadOperator(import("../../../../geometry/operators/json/intersectsOperator.js")),this._loadOperator(import("../../../../geometry/operators/json/containsOperator.js")),this._loadOperator(import("../../../../geometry/operators/json/disjointOperator.js"))]).then(async e=>{this.destroyed||(this._geometryOperators=e)}))}_loadOperator(e){return this.loadAsyncModule(e).then(e=>"load"in e&&"function"==typeof e.load?e.load().then(()=>e):e)}get sortedObjectIds(){return null==this.viewFilter?.objectIds?null:x(this.viewFilter.objectIds).sort()}get parsedWhereClause(){const e=this.viewFilter?.where;if(null==e||!e)return null;try{return j.create(e,{fieldsIndex:this.layerFieldsIndex})}catch(t){s.getLogger(this).error(`Failed to parse filter where clause: ${t}`)}return null}addFilters(e,t,r,i){const o=this.sortedObjectIds;null!=o&&e.push(e=>L(o,!0,e)),this.addSqlFilter(e,this.parsedWhereClause),this.addTimeFilter(e,this.viewFilter?.timeExtent);const a=this._geometryOperators;if(!a)return;const l=()=>s.getLogger(this),c=n(this._layerMaskGeometries);if(c&&this.layerFilter){const s=this.layerFilter.spatialRelationship;e.push((e,o)=>J(l,a,e,o,i,t,r,c,s))}const p=n(this._viewMaskGeometries);if(p&&this.viewFilter){const s=this.viewFilter.spatialRelationship;e.push((e,o)=>J(l,a,e,o,i,t,r,p,s))}}isMBSGeometryVisible(e,t,r){const i=this._geometryOperators;if(!i)return!0;const o=n(this._layerMaskGeometries);if(o&&this.layerFilter){const n=this.layerFilter.spatialRelationship,a=o[0].spatialReference||t;if(!v(e,r,W,a))return s.getLogger(this).warnOnce("SceneLayer.mask geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0;return A(i,W,o,a,n)}const a=n(this._viewMaskGeometries);if(a&&this.viewFilter){const o=this.viewFilter.spatialRelationship,n=a[0].spatialReference||t;if(!v(e,r,W,n))return s.getLogger(this).warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0;return A(i,W,a,n,o)}return!0}get parsedGeometry(){const e=n(this._viewMaskGeometries),t=n(this._layerMaskGeometries);return null==e||null==t?e??t:t.concat(e)}get _layerMaskGeometries(){const e=this.layerFilter;return null==e?null:null==this._geometryOperators?a:"disjoint"===e.spatialRelationship?e.geometries.map(e=>({type:"polygon",rings:e.rings,spatialReference:e.spatialReference,cache:{}})):[e.geometries.reduce((e,t)=>(e.rings=[...e.rings,...t.rings],e),{type:"polygon",rings:[],spatialReference:e.geometries[0].spatialReference,cache:{}})]}get _viewMaskGeometries(){const e=this.viewFilter?.geometry;if(!this.viewFilter||!e)return null;if(!this._geometryOperators)return a;const{distance:t,units:r}=this.viewFilter,i=this.viewFilter.spatialRelationship,o="mesh"===e.type?e.extent:e;if(null==t||0===t)return V(this._geometryOperators,o,i);try{const e=U(r,o.spatialReference),s=this._geometryOperators[0].execute(o.toJSON(),t,{unit:e});return V(this._geometryOperators,s,i)}catch(n){s.getLogger(this).error(`Filter by geodesic buffer (distance) unsupported, failed execute with input geometry (${JSON.stringify(o.toJSON())}).`)}return null}get updating(){return l(this._layerMaskGeometries)||l(this._viewMaskGeometries)}static checkSupport(e){return null!=e&&(!!N(e.spatialRelationship)||(s.getLogger(this.prototype).warn(`Filters with spatialRelationship other than ${C.join(", ")} are not supported for mesh scene layers`),!1))}};e([m()],B.prototype,"layerFilter",void 0),e([m({type:G})],B.prototype,"viewFilter",void 0),e([m()],B.prototype,"layerFieldsIndex",void 0),e([m()],B.prototype,"loadAsyncModule",void 0),e([m()],B.prototype,"addSqlFilter",void 0),e([m()],B.prototype,"addTimeFilter",void 0),e([m({readOnly:!0})],B.prototype,"sortedObjectIds",null),e([m({readOnly:!0})],B.prototype,"parsedWhereClause",null),e([m({readOnly:!0})],B.prototype,"parsedGeometry",null),e([m({readOnly:!0})],B.prototype,"_layerMaskGeometries",null),e([m({readOnly:!0})],B.prototype,"_viewMaskGeometries",null),e([m()],B.prototype,"updating",null),e([m()],B.prototype,"_geometryOperators",void 0),B=e([d("esri.views.3d.layers.i3s.I3SMeshViewFilter")],B);const C=(e=>e)(["contains","intersects","disjoint"]);function N(e){return null!=e&&C.includes(e)}function U(e,t){const r=e??p(t);return u.includes(r)?r:void 0}function V(e,t,s){if(null==t)return null;if("disjoint"===s&&"rings"in t){const s=t.spatialReference,o=t.rings.map(e=>{const t=b(1/0,1/0,-1/0,-1/0);return F(t,e),new q({rings:[e],spatialReference:s},t)});o.sort((e,t)=>e.aabr[0]-t.aabr[0]);const n=new Set,a=new i;for(let t=0;t<o.length;++t){const{polygon:i,aabr:s}=o[t],l=s[0];n.forEach(t=>{if(l>=t.aabr[2])return void n.delete(t);if(s[1]>t.aabr[3]||s[3]<t.aabr[1]||!e[2].execute(i,t.polygon))return;i.rings=i.rings.concat(t.polygon.rings),S(s,t.aabr,s),n.delete(t);const c=r(o,t,o.length,a);o.splice(c,1)}),n.add(o[t])}return o.map(({polygon:e})=>e)}return["toJSON"in t?t.toJSON():t]}function A(e,t,r,i,s){if(t.radius>=.5*(t.center[2]+w(i).radius))return!0;const o=$(e,t,i);return!o||r.every(t=>1!==P(e,t,o,s))}function J(e,t,r,i,s,o,n,a,l){const c=a[0].spatialReference||o.spatialReference;if(!v(i.node.serviceMbsInIndexSR,n,W,c))return void e().warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter");const p=$(t,W,c);if(!p)return;const u=E(l,o,c,s,i.objectHandle),m="intersects"===l;let d=null;for(const g of a){if(0===r.length)return;switch(P(t,g,p,l)){case 1:return m&&(i.weaklyRemovedIds=i.weaklyRemovedIds?.concat(r)??r.slice()),void(r.length=0);case 0:continue}T(r,i.featureIds,e=>!!H(t,g,e,u)||(m&&(d||=[],d.push(i.featureIds[e])),!1))}d&&(i.weaklyRemovedIds=i.weaklyRemovedIds?.concat(d)??d)}const W=new M;class q{constructor(e,t){this.aabr=t,this.polygon={rings:e.rings,spatialReference:e.spatialReference}}}function E(e,t,r,i,s){const o=t.renderSpatialReference,n=new Map,a={rings:[[[0,0,0],[0,0,0],[0,0,0],[0,0,0]]],spatialReference:r};a.rings[0][3]=a.rings[0][0];const l={indices:null,data:null,stride:0,startIndex:0,endIndex:0};let c,p;switch(e){case"intersects":c=(e,t,r)=>e[2].execute(t,r)?0:2,p=z;break;case"contains":c=(e,t,r)=>e[3].execute(t,r)?2:1,p=z;break;default:c=(e,t,r)=>e[4].execute(t,r)?2:1,p=D}return{collection:i,object:s,type:e,maskSR:r,renderSR:o,aabbCache:n,triangle:a,positions:l,triangleTest:c,geometryTest:p}}function $(e,t,r){const i={x:t.center[0],y:t.center[1],spatialReference:r},s=!k(r)&&!I(r),n=Number.isNaN(t.radius)?0:o(t.radius,0,2*_.radius);return s?e[1].execute(i,n):e[0].execute(i,n)}function P(e,t,r,i){if(!r)return 0;switch(i){case"intersects":case"contains":return z(e,t,r);case"disjoint":return D(e,t,r)}}function z(e,t,r){return e[2].execute(t,r)?e[3].execute(t,r)?0:2:1}function D(e,t,r){return e[2].execute(t,r)?e[3].execute(t,r)?1:2:0}function H(e,t,r,i){const{collection:s,object:o,renderSR:n,maskSR:a,geometryTest:l,aabbCache:c}=i;let p=c.get(r);if(!p){const e=s.getObjectTransform(o);s.getComponentAabb(o,r,K);const t=[h(K[0],K[1],0),h(K[0],K[4],0),h(K[3],K[4],0),h(K[3],K[1],0)];for(let r=0;r<4;++r)g(t[r],t[r],e.rotationScale),f(t[r],t[r],e.position),R(t[r],n,t[r],a);p={rings:[t],spatialReference:a},p.rings[0][4]=p.rings[0][0],c.set(r,p)}switch(l(e,t,p)){case 1:return!1;case 0:return!0}const{triangle:u,triangleTest:m,positions:d}=i,j=u.rings[0][0],w=u.rings[0][1],v=u.rings[0][2],O=s.getObjectTransform(o);s.getComponentPositions(o,r,d);const{indices:b,data:F,stride:S,startIndex:x,endIndex:_}=d;for(let h=x;h<_;h+=3){const r=S*b[h],i=S*b[h+1],s=S*b[h+2];switch(y(j,F[r],F[r+1],F[r+2]),y(w,F[i],F[i+1],F[i+2]),y(v,F[s],F[s+1],F[s+2]),g(j,j,O.rotationScale),g(w,w,O.rotationScale),g(v,v,O.rotationScale),f(j,j,O.position),f(w,w,O.position),f(v,v,O.position),R(j,n,j,a),R(w,n,w,a),R(v,n,v,a),m(e,t,u)){case 1:return!1;case 0:return!0}}return"intersects"!==i.type}const K=O();export{B as I3SMeshViewFilter};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- function t(t){return"fill"===t.type}function e(t){return"extrude"===t.type}export{e as isExtrudeSymbol3DLayer,t as isFillSymbol3DLayer};
5
+ function t(t){return"fill"===t?.type}function n(t){return"extrude"===t?.type}function e(t){return"object"===t?.type}function r(r){return e(r)||n(r)||t(r)}export{n as isExtrudeSymbol3DLayer,t as isFillSymbol3DLayer,e as isObjectSymbol3DLayer,r as supportsEmissive};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{prefersReducedMotion as t}from"../../../core/a11yUtils.js";import r from"../../../core/Accessor.js";import{EventEmitter as o}from"../../../core/Evented.js";import{destroyMaybe as a}from"../../../core/maybe.js";import{when as i}from"../../../core/reactiveUtils.js";import{property as n,subclass as s}from"../../../core/accessorSupport/decorators.js";import{afterDispatch as l}from"../../../core/accessorSupport/watch.js";import{fromValues as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../geometry/ellipsoidUtils.js";import m from"../../ViewAnimation.js";import{viewingModeFromString as h}from"../../ViewingMode.js";import{Constraints as d}from"./Constraints.js";import{AnimationController as u}from"./controllers/AnimationController.js";import g from"../webgl/RenderCamera.js";import{DepthRange as y}from"../webgl-engine/lib/DepthRange.js";import{maximumHighlights as C}from"../../support/HighlightDefaults.js";import{PropertiesPool as f}from"../../support/PropertiesPool.js";let w=class extends r{constructor(e){super(e),this._propertiesPool=new f({camera:()=>new g},this),this._lastSeenCameraProjectionValues=new g,this.mode=0,this._cssCamera=new g,this._camera=new g,this.rasterPixelRatio=1,this.contentPixelRatio=1,this.constraints=new d({state:this}),this.events=new o,this.fading=!1,this._cameraChanged=!1,this._updateQueue=new Array,this._processingUpdates=!1}reset(){this.cameraController=null,this._propertiesPool.destroy(),this._propertiesPool=new f({camera:()=>new g},this)}destroy(){this.cameraController=a(this.cameraController),this._propertiesPool=a(this._propertiesPool)}createInitialCamera(){if(1===this.viewingMode){const e=c(this.spatialReference).radius;this.camera=new g({eye:p(4*e,0,0),center:p(e,0,0),up:p(0,0,1)})}else this.camera=new g({eye:p(0,0,100),center:p(0,0,0),up:p(0,1,0)})}get animation(){return this.cameraController instanceof u&&null!=this.cameraController.viewAnimation?this.cameraController.viewAnimation:null}get cssCamera(){const e=this._cssCamera.copyFrom(this.camera),{height:t,width:r,pixelRatio:o}=this.camera;return e.pixelRatio=1,e.height=Math.round(t/o),e.width=Math.round(r/o),e}get camera(){return this._camera}set camera(e){e!==j&&j.copyFrom(e),j.computeUp(this.viewingMode),this.events.emit("before-camera-change",{camera:j});const t=this._camera;if(_(this._lastSeenCameraProjectionValues,j)&&(this._lastSeenCameraProjectionValues.copyFrom(j),this.events.emit("camera-projection-changed",this._lastSeenCameraProjectionValues)),!t.equals(j)&&(this._camera=this._propertiesPool.get("camera").copyFrom(j),this._cameraChanged=!t.almostEquals(j),this._cameraChanged)){const e=l(()=>{this._cameraChanged=!1,e.remove()})}}get pixelRatio(){return this.camera.pixelRatio}get alignPixelEnabled(){return this.pixelRatio===this.rasterPixelRatio&&2===this.mode}get updating(){return 2!==this.mode}get contentCamera(){return this._contentCamera??this.camera}set contentCamera(e){if(null==e)return void(this._contentCamera=null);const t=e.clone();this.events.emit("before-camera-change",{camera:t,sceneDepthRange:y.Infinite}),this._contentCamera=t}get fixedContentCamera(){return null!=this._contentCamera}get isGlobal(){return 1===this.viewingMode}get isLocal(){return 2===this.viewingMode}get viewingMode(){return h(this.view.viewingMode)}get spatialReference(){return this.view.spatialReference}get highlights(){const e=this.view.highlights.items.slice(0,C);for(let t=0;t<e.length;){const r=e[t],o=e.findIndex(e=>e.name===r.name);o>=0&&t>o?e.splice(t,1):++t}return e}get highlightOrderMap(){return new Map(this.highlights.map(({name:e},t)=>[e,t]))}get animationsEnabled(){return this.view.animationsEnabled&&!t()}get navigating(){return!!this.cameraController?.isInteractive}get stationary(){return!this._cameraChanged&&!this.navigating}get cameraController(){return this._get("cameraController")}set cameraController(e){this.stopActiveCameraController()?(this.removeHandles(x),this.cameraController?.destroy(),e&&(this.addHandles(i(()=>4===e.state||3===e.state,()=>{this.updateCamera(t=>e.onControllerEnd(t)),this.cameraController===e&&(this._set("cameraController",null),e.destroy())},{sync:!0,once:!0}),x),e.onControllerStart(this.camera)),this._set("cameraController",e)):e&&(e.state=1)}switchCameraController(e){this.cameraController=e}stopActiveCameraController(){return!this.cameraController||this.cameraController.stopController()}updateCamera(e){this._updateQueue.push(e),this._processUpdateQueue()}_processUpdateQueue(){if(0===this._updateQueue.length||this._processingUpdates)return;this._processingUpdates=!0;const e=this._updateQueue.shift();j.copyFrom(this.camera),e(j),this.camera=j,this._processingUpdates=!1,this._processUpdateQueue()}static cleanupViewstate(){j=new g}};e([n({constructOnly:!0})],w.prototype,"view",void 0),e([n()],w.prototype,"mode",void 0),e([n({readOnly:!0,type:m})],w.prototype,"animation",null),e([n({type:g})],w.prototype,"cssCamera",null),e([n()],w.prototype,"_cssCamera",void 0),e([n({type:g})],w.prototype,"camera",null),e([n()],w.prototype,"_camera",void 0),e([n({readOnly:!0})],w.prototype,"pixelRatio",null),e([n()],w.prototype,"rasterPixelRatio",void 0),e([n()],w.prototype,"contentPixelRatio",void 0),e([n({readOnly:!0})],w.prototype,"alignPixelEnabled",null),e([n({readOnly:!0})],w.prototype,"updating",null),e([n({})],w.prototype,"_contentCamera",void 0),e([n({type:g})],w.prototype,"contentCamera",null),e([n({readOnly:!0})],w.prototype,"fixedContentCamera",null),e([n({readOnly:!0})],w.prototype,"events",void 0),e([n({readOnly:!0})],w.prototype,"isGlobal",null),e([n({readOnly:!0})],w.prototype,"isLocal",null),e([n({readOnly:!0})],w.prototype,"viewingMode",null),e([n({readOnly:!0})],w.prototype,"highlights",null),e([n({readOnly:!0})],w.prototype,"highlightOrderMap",null),e([n({readOnly:!0})],w.prototype,"navigating",null),e([n()],w.prototype,"fading",void 0),e([n({readOnly:!0})],w.prototype,"stationary",null),e([n()],w.prototype,"_cameraChanged",void 0),e([n()],w.prototype,"cameraController",null),w=e([s("esri.views.3d.state.ViewState")],w);const v=w;function _(e,t){return e.fov!==t.fov||(e.fullViewport[0]!==t.fullViewport[0]||e.fullViewport[1]!==t.fullViewport[1]||e.fullViewport[2]!==t.fullViewport[2]||e.fullViewport[3]!==t.fullViewport[3]||(e.padding[0]!==t.padding[0]||e.padding[1]!==t.padding[1]||e.padding[2]!==t.padding[2]||e.padding[3]!==t.padding[3]))}let j=new g;const x="ViewStateHandles";export{v as default};
5
+ import{__decorate as e}from"tslib";import{prefersReducedMotion as t}from"../../../core/a11yUtils.js";import r from"../../../core/Accessor.js";import{EventEmitter as o}from"../../../core/Evented.js";import{destroyMaybe as a}from"../../../core/maybe.js";import{when as i}from"../../../core/reactiveUtils.js";import{property as n,subclass as s}from"../../../core/accessorSupport/decorators.js";import{afterDispatch as l}from"../../../core/accessorSupport/watch.js";import{fromValues as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../geometry/ellipsoidUtils.js";import m from"../../ViewAnimation.js";import{viewingModeFromString as h}from"../../ViewingMode.js";import{Constraints as d}from"./Constraints.js";import{AnimationController as u}from"./controllers/AnimationController.js";import g from"../webgl/RenderCamera.js";import{DepthRange as y}from"../webgl-engine/lib/DepthRange.js";import{maximumHighlights as C}from"../../support/HighlightDefaults.js";import{PropertiesPool as f}from"../../support/PropertiesPool.js";let w=class extends r{constructor(e){super(e),this._propertiesPool=new f({camera:()=>new g},this),this._lastSeenCameraProjectionValues=new g,this.mode=0,this._cssCamera=new g,this._camera=new g,this.rasterPixelRatio=1,this.contentPixelRatio=1,this.constraints=new d({state:this}),this.events=new o,this.fading=!1,this._cameraChanged=!1,this._updateQueue=new Array,this._processingUpdates=!1}reset(){this.cameraController=null,this._propertiesPool.destroy(),this._propertiesPool=new f({camera:()=>new g},this)}destroy(){this.cameraController=null,this._propertiesPool=a(this._propertiesPool)}createInitialCamera(){if(1===this.viewingMode){const e=c(this.spatialReference).radius;this.camera=new g({eye:p(4*e,0,0),center:p(e,0,0),up:p(0,0,1)})}else this.camera=new g({eye:p(0,0,100),center:p(0,0,0),up:p(0,1,0)})}get animation(){return this.cameraController instanceof u&&null!=this.cameraController.viewAnimation?this.cameraController.viewAnimation:null}get cssCamera(){const e=this._cssCamera.copyFrom(this.camera),{height:t,width:r,pixelRatio:o}=this.camera;return e.pixelRatio=1,e.height=Math.round(t/o),e.width=Math.round(r/o),e}get camera(){return this._camera}set camera(e){e!==j&&j.copyFrom(e),j.computeUp(this.viewingMode),this.events.emit("before-camera-change",{camera:j});const t=this._camera;if(_(this._lastSeenCameraProjectionValues,j)&&(this._lastSeenCameraProjectionValues.copyFrom(j),this.events.emit("camera-projection-changed",this._lastSeenCameraProjectionValues)),!t.equals(j)&&(this._camera=this._propertiesPool.get("camera").copyFrom(j),this._cameraChanged=!t.almostEquals(j),this._cameraChanged)){const e=l(()=>{this._cameraChanged=!1,e.remove()})}}get pixelRatio(){return this.camera.pixelRatio}get alignPixelEnabled(){return this.pixelRatio===this.rasterPixelRatio&&2===this.mode}get updating(){return 2!==this.mode}get contentCamera(){return this._contentCamera??this.camera}set contentCamera(e){if(null==e)return void(this._contentCamera=null);const t=e.clone();this.events.emit("before-camera-change",{camera:t,sceneDepthRange:y.Infinite}),this._contentCamera=t}get fixedContentCamera(){return null!=this._contentCamera}get isGlobal(){return 1===this.viewingMode}get isLocal(){return 2===this.viewingMode}get viewingMode(){return h(this.view.viewingMode)}get spatialReference(){return this.view.spatialReference}get highlights(){const e=this.view.highlights.items.slice(0,C);for(let t=0;t<e.length;){const r=e[t],o=e.findIndex(e=>e.name===r.name);o>=0&&t>o?e.splice(t,1):++t}return e}get highlightOrderMap(){return new Map(this.highlights.map(({name:e},t)=>[e,t]))}get animationsEnabled(){return this.view.animationsEnabled&&!t()}get navigating(){return!!this.cameraController?.isInteractive}get stationary(){return!this._cameraChanged&&!this.navigating}get cameraController(){return this._get("cameraController")}set cameraController(e){this.stopActiveCameraController()?(this.removeHandles(x),this.cameraController?.destroy(),e&&(this.addHandles(i(()=>4===e.state||3===e.state,()=>{this.updateCamera(t=>e.onControllerEnd(t)),this.cameraController===e&&(this._set("cameraController",null),e.destroy())},{sync:!0,once:!0}),x),e.onControllerStart(this.camera)),this._set("cameraController",e)):e&&(e.state=1)}switchCameraController(e){this.cameraController=e}stopActiveCameraController(){return!this.cameraController||this.cameraController.stopController()}updateCamera(e){this._updateQueue.push(e),this._processUpdateQueue()}_processUpdateQueue(){if(0===this._updateQueue.length||this._processingUpdates)return;this._processingUpdates=!0;const e=this._updateQueue.shift();j.copyFrom(this.camera),e(j),this.camera=j,this._processingUpdates=!1,this._processUpdateQueue()}static cleanupViewstate(){j=new g}};e([n({constructOnly:!0})],w.prototype,"view",void 0),e([n()],w.prototype,"mode",void 0),e([n({readOnly:!0,type:m})],w.prototype,"animation",null),e([n({type:g})],w.prototype,"cssCamera",null),e([n()],w.prototype,"_cssCamera",void 0),e([n({type:g})],w.prototype,"camera",null),e([n()],w.prototype,"_camera",void 0),e([n({readOnly:!0})],w.prototype,"pixelRatio",null),e([n()],w.prototype,"rasterPixelRatio",void 0),e([n()],w.prototype,"contentPixelRatio",void 0),e([n({readOnly:!0})],w.prototype,"alignPixelEnabled",null),e([n({readOnly:!0})],w.prototype,"updating",null),e([n({})],w.prototype,"_contentCamera",void 0),e([n({type:g})],w.prototype,"contentCamera",null),e([n({readOnly:!0})],w.prototype,"fixedContentCamera",null),e([n({readOnly:!0})],w.prototype,"events",void 0),e([n({readOnly:!0})],w.prototype,"isGlobal",null),e([n({readOnly:!0})],w.prototype,"isLocal",null),e([n({readOnly:!0})],w.prototype,"viewingMode",null),e([n({readOnly:!0})],w.prototype,"highlights",null),e([n({readOnly:!0})],w.prototype,"highlightOrderMap",null),e([n({readOnly:!0})],w.prototype,"navigating",null),e([n()],w.prototype,"fading",void 0),e([n({readOnly:!0})],w.prototype,"stationary",null),e([n()],w.prototype,"_cameraChanged",void 0),e([n()],w.prototype,"cameraController",null),w=e([s("esri.views.3d.state.ViewState")],w);const v=w;function _(e,t){return e.fov!==t.fov||(e.fullViewport[0]!==t.fullViewport[0]||e.fullViewport[1]!==t.fullViewport[1]||e.fullViewport[2]!==t.fullViewport[2]||e.fullViewport[3]!==t.fullViewport[3]||(e.padding[0]!==t.padding[0]||e.padding[1]!==t.padding[1]||e.padding[2]!==t.padding[2]||e.padding[3]!==t.padding[3]))}let j=new g;const x="ViewStateHandles";export{v as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{signal as i}from"../../../../core/signal.js";class e{static{this.fadeInEase=i=>i*(2-i)}static{this.fadeOutEase=i=>i*i}constructor(e){this.layerView=e,this._numFadingTiles=i(0)}get numFadingTiles(){return this._numFadingTiles.value}fadeTile(i,e){const t=this._getTargetOpacity(e);if(i.fadeDirection=e,0===this.fadeDuration)return void this._instantTileFading(i,t);const a=i.opacityModifier;if(a!==t){const e=1-Math.abs(t-a);this._startTileFading(i,e)}else this._stopTileFading(i)}updateAllTileFading(i){this.layerView.tileHandles.forEach(e=>this._updateTileFading(e,i)),this.layerView.updateGaussians()}onFadeDurationChanged(i){0===i&&this.numFadingTiles>0&&this._instantlyFullyFadeAllTiles()}isTileFadingOut(i){return null!=i.fadeProgress&&1===i.fadeDirection}isUpdating(){return this._numFadingTiles.value>0}get fadeDuration(){return this.layerView.view.qualitySettings.fadeDuration}get fadingEnabled(){return 0!==this.fadeDuration}_startTileFading(i,e){null==i.fadeProgress&&this._numFadingTiles.value++,i.fadeProgress=e}_stopTileFading(i){null!=i.fadeProgress&&(1===i.fadeDirection&&this._onTileFullyFadedOut(i),this._numFadingTiles.value--,i.fadeProgress=null)}_updateTileFading(i,t){const{fadeProgress:a,fadeDirection:s}=i;if(null==a)return;const n=this._fadeDirectionToSign(s),l=n*this.fadeDuration,d=this._getTargetOpacity(s),r=t/Math.abs(l||1),o=Math.min(a+r,1),u=n*(1-(0===s?e.fadeInEase:e.fadeOutEase)(o)),g=1===o;i.opacityModifier=g?d:d-u,g?this._stopTileFading(i):i.fadeProgress=o,this._updateOpacityModifier(i)}_updateOpacityModifier(i){const e=255*i.opacityModifier;for(let t=0;t<i.pageIds.length;t++){const a=i.pageIds[t];this.layerView.data.fadingTexture.updateBuffer(e,a)}}_instantTileFading(i,e){i.fadeProgress=null,i.opacityModifier=e,this._updateOpacityModifier(i),1===i.fadeDirection&&this._onTileFullyFadedOut(i)}_instantlyFullyFadeAllTiles(){this.layerView.tileHandles.forEach(i=>{null!=i.fadeProgress&&this._instantTileFading(i,this._getTargetOpacity(i.fadeDirection))}),this.layerView.updateGaussians(),this._numFadingTiles.value=0}_onTileFullyFadedOut(i){i.isVisible=!1,this.layerView.moveTileToCache(i)}_fadeDirectionToSign(i){return 0===i?1:-1}_getTargetOpacity(i){return 0===i?1:0}}export{e as GaussianSplatFadeHelper};
5
+ import{signal as i}from"../../../../core/signal.js";class e{static{this.fadeInEase=i=>i*(2-i)}static{this.fadeOutEase=i=>i*i}constructor(e){this.layerView=e,this._numFadingTiles=i(0)}get numFadingTiles(){return this._numFadingTiles.value}fadeTile(i,e){const t=this._getTargetOpacity(e);if(i.fadeDirection=e,0===this.fadeDuration)return void this._instantTileFading(i,t);const a=i.opacityModifier;if(a!==t){const e=1-Math.abs(t-a);this._startTileFading(i,e)}else this._stopTileFading(i)}updateAllTileFading(i){this.layerView.tileHandles.forEach(e=>this._updateTileFading(e,i)),this.layerView.updateGaussians()}onFadeDurationChanged(i){0===i&&this.numFadingTiles>0&&this._instantlyFullyFadeAllTiles()}isTileFadingOut(i){return null!=i.fadeProgress&&1===i.fadeDirection}isUpdating(){return this._numFadingTiles.value>0}get fadeDuration(){return 0}get fadingEnabled(){return 0!==this.fadeDuration}_startTileFading(i,e){null==i.fadeProgress&&this._numFadingTiles.value++,i.fadeProgress=e}_stopTileFading(i){null!=i.fadeProgress&&(1===i.fadeDirection&&this._onTileFullyFadedOut(i),this._numFadingTiles.value--,i.fadeProgress=null)}_updateTileFading(i,t){const{fadeProgress:a,fadeDirection:s}=i;if(null==a)return;const n=this._fadeDirectionToSign(s),d=n*this.fadeDuration,l=this._getTargetOpacity(s),r=t/Math.abs(d||1),o=Math.min(a+r,1),u=n*(1-(0===s?e.fadeInEase:e.fadeOutEase)(o)),g=1===o;i.opacityModifier=g?l:l-u,g?this._stopTileFading(i):i.fadeProgress=o,this._updateOpacityModifier(i)}_updateOpacityModifier(i){const e=255*i.opacityModifier;for(let t=0;t<i.pageIds.length;t++){const a=i.pageIds[t];this.layerView.data.fadingTexture.updateBuffer(e,a)}}_instantTileFading(i,e){i.fadeProgress=null,i.opacityModifier=e,this._updateOpacityModifier(i),1===i.fadeDirection&&this._onTileFullyFadedOut(i)}_instantlyFullyFadeAllTiles(){this.layerView.tileHandles.forEach(i=>{null!=i.fadeProgress&&this._instantTileFading(i,this._getTargetOpacity(i.fadeDirection))}),this.layerView.updateGaussians(),this._numFadingTiles.value=0}_onTileFullyFadedOut(i){i.isVisible=!1,this.layerView.moveTileToCache(i)}_fadeDirectionToSign(i){return 0===i?1:-1}_getTargetOpacity(i){return 0===i?1:0}}export{e as GaussianSplatFadeHelper};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{acosClamped as t}from"../../../core/mathUtils.js";import{length as n,dot as r,scale as o,add as c,lerp as s,set as a,cross as i,normalize as u,subtract as e}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";function f(t,n){return t>n?Math.cos(n):Math.cos(t)}function M(t,n,r){return 2*Math.atan(r*Math.tan(.5*t)/n)}function l(t,n,r){return 2*Math.atan(n*Math.tan(.5*t)/r)}function m(t){const n=t[0]*t[0]+t[4]*t[4]+t[8]*t[8],r=t[1]*t[1]+t[5]*t[5]+t[9]*t[9],o=t[2]*t[2]+t[6]*t[6]+t[10]*t[10];return Math.sqrt(Math.max(n,r,o))}function g(t,n){const r=Math.sqrt(n[0]*n[0]+n[4]*n[4]+n[8]*n[8]),o=Math.sqrt(n[1]*n[1]+n[5]*n[5]+n[9]*n[9]),c=Math.sqrt(n[2]*n[2]+n[6]*n[6]+n[10]*n[10]);return a(t,r,o,c),t}function b(t,n,o){o=o||t;const c=r(t,n);a(o,t[0]-c*n[0],t[1]-c*n[1],t[2]-c*n[2]),u(o,o)}function p(t,n,r){Math.abs(t[0])>Math.abs(t[1])?a(n,0,1,0):a(n,1,0,0),i(r,t,n),i(n,r,t),u(r,r),u(n,n)}function q(t,n,r,o,c,s){const a=t+(n-t)*c;return a+(r+(o-r)*c-a)*s}function x(t,a,i,u=h()){const e=n(t),f=n(a),M=r(t,a)/(e*f);if(M<.9999999999999999){const n=Math.acos(M),r=((1-i)*e+i*f)/Math.sin(n),s=r/e*Math.sin((1-i)*n),h=r/f*Math.sin(i*n);return o(A,t,s),o(B,a,h),c(u,A,B)}return s(u,t,a,i)}function j(t,a,i,f=h(),M=h()){const l=n(t),m=n(a),g=r(t,a)/(l*m);if(g<.9999999999999999){const n=Math.acos(g),r=Math.sin(n),s=Math.sin(i*n),u=Math.sin((1-i)*n),e=(1-i)*l+i*m;{const n=e/r,i=n/m*s;o(A,t,n/l*u),o(B,a,i),c(f,A,B)}{const h=1/l*(-Math.cos((1-i)*n)*n*e+u*(-l+m));o(A,t,h);const f=1/m*(Math.cos(i*n)*n*e+s*(-l+m));o(B,a,f),c(M,A,B),o(M,M,1/r)}return M}return s(f,t,a,i),e(M,a,t),u(M,M),M}function v(n,o,c){n=u(A,n),o=u(B,o);const s=t(r(n,o));if(c){const t=i(z,n,o);if(r(t,c)<0)return-s}return s}function U(t){const n=t.length;return r=>{if(r<=t[0][0])return t[0][1];if(r>=t[n-1][0])return t[n-1][1];let o=1;for(;r>t[o][0];)o++;const c=t[o-1][0],s=t[o][0],a=(s-r)/(s-c);return a*t[o-1][1]+(1-a)*t[o][1]}}function d(t,n,o,c){e(w,n,t),e(y,o,t),i(c,w,y),u(c,c),c[3]=-r(t,c)}function k(t,n){if(a(n,0,0,0),t.length>0){for(let r=0;r<t.length;++r)c(n,n,t[r]);o(n,n,1/t.length)}}const w=h(),y=h(),z=h(),A=h(),B=h();export{v as angle,q as bilerp,f as cosCapped,M as fovx2fovy,l as fovy2fovx,b as makeOrthonormal,U as makePiecewiseLinearFunction,m as maxScale,k as midpoint3d,d as planeFromPoints,g as scaleFromMatrix,x as slerp,j as slerpTangent,p as tangentFrame};
5
+ import{acosClamped as t}from"../../../core/mathUtils.js";import{dot as n,set as r,normalize as o,length as c,scale as s,add as a,lerp as i,cross as u,subtract as e}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";function f(t,n){return t>n?Math.cos(n):Math.cos(t)}function M(t,n,r){return 2*Math.atan(r*Math.tan(.5*t)/n)}function l(t,n,r){return 2*Math.atan(n*Math.tan(.5*t)/r)}function m(t){const n=t[0]*t[0]+t[4]*t[4]+t[8]*t[8],r=t[1]*t[1]+t[5]*t[5]+t[9]*t[9],o=t[2]*t[2]+t[6]*t[6]+t[10]*t[10];return Math.sqrt(Math.max(n,r,o))}function g(t,n){const o=Math.sqrt(n[0]*n[0]+n[4]*n[4]+n[8]*n[8]),c=Math.sqrt(n[1]*n[1]+n[5]*n[5]+n[9]*n[9]),s=Math.sqrt(n[2]*n[2]+n[6]*n[6]+n[10]*n[10]);return r(t,o,c,s),t}function b(t,c,s){s=s||t;const a=n(t,c);r(s,t[0]-a*c[0],t[1]-a*c[1],t[2]-a*c[2]),o(s,s)}function p(t,n,c){Math.abs(t[0])>Math.abs(t[1])?r(n,0,1,0):r(n,1,0,0),u(c,t,n),u(n,c,t),o(c,c),o(n,n)}function q(t,n,r,o,c,s){const a=t+(n-t)*c;return a+(r+(o-r)*c-a)*s}function x(t,r,o,u=h()){const e=c(t),f=c(r),M=n(t,r)/(e*f);if(M<.9999999999999999){const n=Math.acos(M),c=((1-o)*e+o*f)/Math.sin(n),i=c/e*Math.sin((1-o)*n),h=c/f*Math.sin(o*n);return s(A,t,i),s(B,r,h),a(u,A,B)}return i(u,t,r,o)}function j(t,r,u,f=h(),M=h()){const l=c(t),m=c(r),g=n(t,r)/(l*m);if(g<.9999999999999999){const n=Math.acos(g),o=Math.sin(n),c=Math.sin(u*n),i=Math.sin((1-u)*n),e=(1-u)*l+u*m;{const n=e/o,u=n/m*c;s(A,t,n/l*i),s(B,r,u),a(f,A,B)}{const h=1/l*(-Math.cos((1-u)*n)*n*e+i*(-l+m));s(A,t,h);const f=1/m*(Math.cos(u*n)*n*e+c*(-l+m));s(B,r,f),a(M,A,B),s(M,M,1/o)}return M}return i(f,t,r,u),e(M,r,t),o(M,M),M}function v(r,c,s){r=o(A,r),c=o(B,c);const a=t(n(r,c));if(s){const t=u(z,r,c);if(n(t,s)<0)return-a}return a}function U(t){const n=t.length;return r=>{if(r<=t[0][0])return t[0][1];if(r>=t[n-1][0])return t[n-1][1];let o=1;for(;r>t[o][0];)o++;const c=t[o-1][0],s=t[o][0],a=(s-r)/(s-c);return a*t[o-1][1]+(1-a)*t[o][1]}}function d(t,r,c,s){e(w,r,t),e(y,c,t),u(s,w,y),o(s,s),s[3]=-n(t,s)}function k(t,n){if(r(n,0,0,0),t.length>0){for(let r=0;r<t.length;++r)a(n,n,t[r]);s(n,n,1/t.length)}}const w=h(),y=h(),z=h(),A=h(),B=h();export{v as angle,q as bilerp,f as cosCapped,M as fovx2fovy,l as fovy2fovx,b as makeOrthonormal,U as makePiecewiseLinearFunction,m as maxScale,k as midpoint3d,d as planeFromPoints,g as scaleFromMatrix,x as slerp,j as slerpTangent,p as tangentFrame};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import"../../../../core/has.js";import{abortMaybe as o}from"../../../../core/maybe.js";import"../../../../core/RandomLCG.js";import"../../../../core/Logger.js";import{watch as r,on as i}from"../../../../core/reactiveUtils.js";import{property as s,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import p from"../../../../geometry/Point.js";import{center as a}from"../../../../geometry/support/aaBoundingRect.js";import"../../../../core/asyncUtils.js";import"../../../../core/units.js";import"../../../../geometry/ellipsoidUtils.js";import"../../../../geometry/Extent.js";import"../../../../geometry/Geometry.js";import"../../../../geometry/Multipoint.js";import"../../../../geometry/Polygon.js";import"../../../../geometry/Polyline.js";import"../../../../geometry/SpatialReference.js";import"../../../../geometry/operators/support/GeographicTransformation.js";import"../../../../geometry/projection/projectors.js";import"../../../../geometry/support/spatialReferenceUtils.js";import"../../../../layers/support/ElevationTileData.js";import"../../../../layers/support/TileElevationSampler.js";let u=class extends e{constructor(t){super(t),this.location=null,this._updateController=null}initialize(){this.view.state.isLocal&&(this.addHandles([r(()=>[this._groundView?.spatialReference,this._groundView?.groundExtent],()=>this._update()),i(()=>this._ground?.layers,"change",()=>this._update())]),this._update())}destroy(){this._updateController=o(this._updateController)}get renderLocation(){if(!this.location)return null;const t=l();return this.view.renderCoordsHelper.toRenderCoords(this.location,t),t}get _ground(){return this.view.map?.ground}get _groundView(){return this.view.groundView}_update(){if(this._updateController=o(this._updateController),null==this._groundView?.groundExtent||null==this._groundView?.spatialReference)return void this._set("location",null);const t=a(this._groundView.groundExtent),e=new p({x:t[0],y:t[1],z:0,spatialReference:this._groundView.spatialReference});this._ground&&this._ground.layers.length>0?(this._set("location",null),this._updateController=new AbortController,this._ground.queryElevation(e,{noDataValue:0,signal:this._updateController.signal,cache:this.cache}).then(t=>{this._updateController=null,this._set("location",t.geometry)}).catch(t=>{})):this._set("location",e)}};t([s({constructOnly:!0})],u.prototype,"view",void 0),t([s({constructOnly:!0})],u.prototype,"cache",void 0),t([s({readOnly:!0})],u.prototype,"location",void 0),t([s({readOnly:!0})],u.prototype,"renderLocation",null),t([s()],u.prototype,"_ground",null),t([s()],u.prototype,"_groundView",null),u=t([n("esri.views.3d.support.pointsOfInterest.StableSurfaceCenter")],u);export{u as StableSurfaceCenter};
5
+ import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import"../../../../core/has.js";import{abortMaybe as o}from"../../../../core/maybe.js";import"../../../../core/RandomLCG.js";import"../../../../core/Logger.js";import{watch as r,on as i}from"../../../../core/reactiveUtils.js";import{property as s,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import p from"../../../../geometry/Point.js";import{center as a}from"../../../../geometry/support/aaBoundingRect.js";import"../../../../core/asyncUtils.js";import"../../../../core/units.js";import"../../../../geometry/ellipsoidUtils.js";import"../../../../geometry/Extent.js";import"../../../../geometry/Geometry.js";import"../../../../geometry/Multipoint.js";import"../../../../geometry/Polygon.js";import"../../../../geometry/Polyline.js";import"../../../../geometry/SpatialReference.js";import"../../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../../geometry/operators/support/GeographicTransformation.js";import"../../../../geometry/projection/projectors.js";import"../../../../geometry/support/spatialReferenceUtils.js";import"../../../../layers/support/ElevationTileData.js";import"../../../../layers/support/TileElevationSampler.js";let u=class extends e{constructor(t){super(t),this.location=null,this._updateController=null}initialize(){this.view.state.isLocal&&(this.addHandles([r(()=>[this._groundView?.spatialReference,this._groundView?.groundExtent],()=>this._update()),i(()=>this._ground?.layers,"change",()=>this._update())]),this._update())}destroy(){this._updateController=o(this._updateController)}get renderLocation(){if(!this.location)return null;const t=l();return this.view.renderCoordsHelper.toRenderCoords(this.location,t),t}get _ground(){return this.view.map?.ground}get _groundView(){return this.view.groundView}_update(){if(this._updateController=o(this._updateController),null==this._groundView?.groundExtent||null==this._groundView?.spatialReference)return void this._set("location",null);const t=a(this._groundView.groundExtent),e=new p({x:t[0],y:t[1],z:0,spatialReference:this._groundView.spatialReference});this._ground&&this._ground.layers.length>0?(this._set("location",null),this._updateController=new AbortController,this._ground.queryElevation(e,{noDataValue:0,signal:this._updateController.signal,cache:this.cache}).then(t=>{this._updateController=null,this._set("location",t.geometry)}).catch(t=>{})):this._set("location",e)}};t([s({constructOnly:!0})],u.prototype,"view",void 0),t([s({constructOnly:!0})],u.prototype,"cache",void 0),t([s({readOnly:!0})],u.prototype,"location",void 0),t([s({readOnly:!0})],u.prototype,"renderLocation",null),t([s()],u.prototype,"_ground",null),t([s()],u.prototype,"_groundView",null),u=t([n("esri.views.3d.support.pointsOfInterest.StableSurfaceCenter")],u);export{u as StableSurfaceCenter};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{isWGS84 as r,isCGCS2000 as t,isMars as e,isMoon as n}from"../../../geometry/support/spatialReferenceUtils.js";function o(r){return i(r)||e(r)||n(r)}function i(e){return r(e)||t(e)}export{i as isSupportedEarthGCS,o as isSupportedGCSOnGlobe};
5
+ import{isMars as r,isMoon as t}from"../../../geometry/ellipsoidUtils.js";import{isWGS84 as e,isCGCS2000 as o}from"../../../geometry/support/spatialReferenceUtils.js";function i(e){return n(e)||r(e)||t(e)}function n(r){return e(r)||o(r)}export{n as isSupportedEarthGCS,i as isSupportedGCSOnGlobe};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import"../webgl-engine/core/shaderLibrary/terrain/BackgroundGrid.glsl.js";import"../webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js";import"../webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js";import"../webgl-engine/core/shaderModules/Float3PassUniform.js";import"../webgl-engine/core/shaderModules/FloatPassUniform.js";import"../webgl-engine/core/shaderModules/glsl.js";import"../webgl-engine/core/shaderModules/Texture2DPassUniform.js";import"../../webgl/ShaderBuilder.js";export{b as build}from"../../../chunks/BlendLayers.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../core/accessorSupport/decorators.js";import{ZEROS as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{TileCompositePassParameters as i}from"../webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js";import{B as o}from"../../../chunks/BlendLayers.glsl.js";import{ReloadableShader as t}from"../webgl-engine/core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{Pos2TexF16 as a}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{PrimitiveType as n}from"../../webgl/enums.js";class c extends i{constructor(){super(...arguments),this.opacity=1,this.baseOpacity=1,this.texture=null,this.fboTexture=null,this.backgroundColor=s}}let m=class extends l{constructor(e,r){super(e,r,a),this.shader=new t(o,()=>import("../webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js")),this.primitiveType=n.TRIANGLE_STRIP}};m=e([r("esri.views.3d.terrain.BlendLayersTechnique")],m);export{c as BlendLayersPassParameters,m as BlendLayersTechnique};
5
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../core/accessorSupport/decorators.js";import{ZEROS as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{B as o}from"../../../chunks/BlendLayers.glsl.js";import{TileCompositePassParameters as i}from"../webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js";import{ReloadableShader as t}from"../webgl-engine/core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{Pos2TexF16 as a}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{PrimitiveType as n}from"../../webgl/enums.js";class c extends i{constructor(){super(...arguments),this.opacity=1,this.baseOpacity=1,this.texture=null,this.fboTexture=null,this.backgroundColor=s}}let m=class extends l{constructor(e,r){super(e,r,a),this.shader=new t(o,()=>import("./BlendLayers.glsl.js")),this.primitiveType=n.TRIANGLE_STRIP}};m=e([r("esri.views.3d.terrain.BlendLayersTechnique")],m);export{c as BlendLayersPassParameters,m as BlendLayersTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{unique as r}from"../../../core/arrayUtils.js";import{EventEmitter as t}from"../../../core/Evented.js";import"../../../core/has.js";import{someMap as s,everyMap as i}from"../../../core/MapUtils.js";import{disposeMaybe as n}from"../../../core/maybe.js";import o from"../../../core/PooledArray.js";import{watch as a,on as h,syncAndInitial as d,initial as l}from"../../../core/reactiveUtils.js";import{someSet as c}from"../../../core/SetUtils.js";import{property as u,subclass as p}from"../../../core/accessorSupport/decorators.js";import{ortho as _,fromTranslation as g}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{set as m}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ones as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{debugFlags as f}from"../support/debugFlags.js";import{Overlay as R}from"./Overlay.js";import{OverlayRenderTargets as v}from"./OverlayRenderTargets.js";import x from"../webgl/RenderCamera.js";import{T as w}from"../../../chunks/TextureOnly.glsl.js";import{SyncRenderPlugin as T}from"../webgl-engine/effects/RenderPlugin.js";import{trackHighlightOptions as b,renderHighlightBuffer as O}from"../webgl-engine/effects/highlight/Highlight.js";import{GLMaterialRepository as S}from"../webgl-engine/lib/GLMaterialRepository.js";import{GridLocalOriginFactory as D}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{RenderContext as C,defaultRenderOccludedMask as P}from"../webgl-engine/lib/RenderContext.js";import{ShadowMap as j}from"../webgl-engine/lib/ShadowMap.js";import{TextureTechnique as E}from"../webgl-engine/lib/TextureTechnique.js";import{TextureTechniqueConfiguration as M}from"../webgl-engine/lib/TextureTechniqueConfiguration.js";import{AmbientLight as F}from"../webgl-engine/lighting/Lightsources.js";import{O as W}from"../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as q}from"../webgl-engine/shaders/OverlayCompositingTechnique.js";import{TaskPriority as V,noBudget as A}from"../../support/Scheduler.js";import G from"../../webgl/Texture.js";import{TextureDescriptor as k}from"../../webgl/TextureDescriptor.js";let I=class extends T{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new W,this.hasHighlights=!1,this.renderOccludedFlags=1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new o,this._passParameters=new w,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new x,this.events=new t,this.longitudeCyclical=null,this.produces=new Map([[19,e=>8!==e||this.hasHighlights],[20,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1,this._hasDrapedFlowSource=!1}initialize(){const e=this._view,r=e.stage,t=r.renderer.fboCache,{waterTextures:s,techniques:i}=r.renderView;this._renderContext=new C(this._rctx,new j(t,e.state.viewingMode),i),this.addHandles([a(()=>s.updating,()=>this.events.emit("content-changed"),d),a(()=>this._spatialReference,e=>this._localOriginFactory=new D(e),d),h(()=>e.allLayerViews,"after-changes",()=>this._sortedDrapeSourceRenderersDirty=!0),a(()=>b(e.state.highlights),()=>this._sortedDrapeSourceRenderersDirty=!0,l),a(()=>e.state.highlights,r=>{this._bindParameters.highlights=r,this._bindParameters.highlightOrderMap=e.state.highlightOrderMap},l),e.resourceController.scheduler.registerTask(V.OVERLAY_RENDERER,this)]);const n=this._camera;n.near=1,n.far=1e4,n.relativeElevation=null,this._bindParameters.slot=19,this._bindParameters.camera=n,this._bindParameters.updateLighting([new F(y())],0,0,0)}destroy(){this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._passParameters.texture=n(this._passParameters.texture),this.disposeOverlays(),this._renderContext=null,this._sortedRenderers.prune()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get _spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}set time(e){this._renderContext.time=e}get pluginContext(){return this._pluginContext}initializeRenderContext(e){const r=new S(this._view.stage.renderView.textures,this._techniques,()=>{this._onMaterialOrContentChanged(),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")},()=>this.events.emit("content-changed"));this._pluginContext={...e,materials:r},this._techniques.precompile(q)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||s(this._renderers,e=>e.updating||e.canCompact)}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(e){for(const r of this._renderers.values()){const t=r.getMaterialRenderer(e);if(t)return t}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),r(this._sortedRenderers.map(e=>e.drapeSource.layer).filter(e=>!!e))}registerDrapeSource(e,r){const t=this._renderers.get(e);null!=t&&t.destroy(),this._renderers.set(e,r),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles(a(()=>e.fullOpacity,()=>this.events.emit("content-changed")),e)}removeDrapeSourceRenderer(e){if(null==e)return;const r=this._renderers.get(e);null!=r&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),r.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(e){this._renderTargets?.dispose(e)}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&c(e,e=>1===e.drapeTargetType)}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=c(e,e=>1===e.drapeSourceType),this._hasDrapedRasterSource=c(e,e=>0===e.drapeSourceType),this._hasDrapedFlowSource=c(e,e=>2===e.drapeSourceType)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=this._hasDrapedFlowSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,r,t=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new v(this._stage.renderer.fboCache),this._overlays=[new R,new R]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r),this._bindParameters.overlayStretch=t}disposeOverlays(){this._overlays=null,this._renderTargets?.dispose(1),this._renderTargets=null,this.events.emit("textures-disposed")}_useOverlayColorInsteadOfColorNoRasterImage(e){return 1===e&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource}getTexture(e){const r=this._useOverlayColorInsteadOfColorNoRasterImage(e);return this._renderTargets?.getTexture(r?0:e)}get readyToRun(){return this.updating}runTask(e){this._processDrapeSources(e,()=>!0)}_onMaterialOrContentChanged(){this.renderOccludedFlags=s(this._renderers,e=>e.hasOccluders)?L:1}_processDrapeSources(e,r){let t=!1;for(const[s,i]of this._renderers){if(e.done)break;(s.destroyed||r(s))&&(i.commitChanges()&&(t=!0,e.madeProgress()))}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,t=!0,this._updateSortedDrapeSourceRenderers(),e.madeProgress()),this.compact(e),t&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this._onMaterialOrContentChanged(),this.hasHighlights=s(this._renderers,e=>e.hasHighlights),this.events.emit("content-changed"))}compact(e){let r=!1;for(const t of this._renderers.values()){if(e.done)break;r=t.compact(e)||r}return r&&this.notifyChange("updating"),r}hasHighlight(e){return s(this._renderers,r=>r.hasHighlight(e))}processSyncDrapeSources(){this._processDrapeSources(A,e=>1===e.updatePolicy)}get isEmpty(){return!f.OVERLAY_DRAW_DEBUG_TEXTURE&&i(this._renderers,e=>e.isEmpty)}get hasWater(){const e=s(this._renderers,({hasWater:e})=>e);return e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water")),this._hasWater}renders(e){if(f.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==e&&2!==e)return!0;if(!this._overlays)return!1;const r=this._overlays[0];for(const i of this._overlays)i.setupGeometryViews(this.longitudeCyclical);if(!r.hasSomeSizedView())return!1;const t=this._setOutput(this._renderTargets?.targets.find(r=>r.content===e)?.output??0);++this._techniques.precompiling;const s=this._sortedRenderers.some(({renderer:e})=>e.precompile(this._renderContext));return--this._techniques.precompiling,this._setOutput(t),s}_setOutput(e){const r=this._renderContext.output;return this._renderContext.output=e,this._bindParameters.slot=2===e?20:19,r}get mode(){return this.isEmpty?0:this.hasWater&&this.renders(3)?2:this._renderTargets?.getTexture(0)?1:0}updateAnimation(e){let r=!1;return this._renderers.forEach(t=>r=t.updateAnimation(e)||r),r&&this.parent.requestRender(0),r}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return!1;const r=this._bindParameters;r.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(const t of this._renderTargets.targets){if(1===t.content&&!this._needsColorWithoutRasterImage)continue;const{output:e}=t;this._setOutput(e),8===e&&(r.highlightMixTexture=r.highlights.length>1?this._rctx.emptyTexture:null);const s=this._renderContext.renderOccludedMask;4===t.content&&(this._renderContext.renderOccludedMask=L),this._sortedRenderers.forAll(({drapeSource:e,renderer:r})=>{1===t.content&&0===e.drapeSourceType||4===t.content&&r.hasOnlyOccluders||r.precompile(this._renderContext)}),this._renderContext.renderOccludedMask=s,r.highlightMixTexture=null}return--this._techniques.precompiling,!0}drawOverlays(e,r){if(!this._overlays||!this._renderTargets)return;for(const s of this._overlays)s.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;const t=this.allSourcesOccluders;for(const s of this._renderTargets.targets){if(!(0===s.content&&this._hasDrapedFlowSource)&&!s.handleRenderRequest(r)||1===s.content&&!this._needsColorWithoutRasterImage||4===s.content&&t)continue;const e=this._drawTarget(0,s),i=this._drawTarget(1,s);(e||i)&&s.fbo.generateMipMap()}}_drawTarget(e,r){const t=this._overlays[e],s=t.canvasGeometries;if(0===s.numViews)return!1;const i=this._view.state.contentPixelRatio;this._screenToWorldRatio=i*t.mapUnitsPerPixel/this._bindParameters.overlayStretch;const{output:n,content:o}=r;if(this.isEmpty||2===n&&!this.hasWater||!t.hasSomeSizedView())return!1;const{_rctx:a,_camera:h,_renderContext:d,_bindParameters:l}=this;if(h.pixelRatio=t.pixelRatio*i,this._setOutput(n),l.screenToWorldRatio=this._screenToWorldRatio,l.screenToPCSRatio=this._screenToWorldRatio*this.parent.worldToPCSRatio,4===o&&(d.renderOccludedMask=L),!this.renders(o))return d.renderOccludedMask=P,!1;const{resolution:c}=t,u=0===e,p=u?0:c;a.setViewport(p,0,c,c),this._bindTargetFBO(r),u&&(8===n?a.gl.clearBufferuiv(a.gl.COLOR,0,[0,0,0,0]):(a.setClearColor(0,0,0,0),a.clear(16384)));if(f.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==o&&2!==o){this._techniques.precompile(E,z);const r=this._techniques.get(E,z);for(let i=0;i<s.numViews;i++)this._setViewParameters(s.extents[i],t),this._ensureDebugPatternResources(t.resolution,B[e]),a.bindTechnique(r,l,this._passParameters),a.screen.draw()}if(8===n){const{fboCache:t}=this._stage.renderer,s=this._resolution;this._bindTargetFBO(r),O(a,t,{width:s,height:s},l,()=>this._renderAllGeometry(e,r),p)}else this._renderAllGeometry(e,r);return a.bindFramebuffer(null),d.renderOccludedMask=P,!0}get allSourcesOccluders(){return i(this._renderers,e=>e.hasOnlyOccluders)}_renderAllGeometry(e,r){const t=this._overlays[e],s=t.canvasGeometries;this._sortedRenderers.forAll(({drapeSource:i,renderer:n})=>{if(1===r.content&&0===i.drapeSourceType)return;const{fullOpacity:o}=i,a=null!=o&&o<1&&0===r.output&&this._bindTemporaryFBO();for(let e=0;e<s.numViews;e++)this._setViewParameters(s.extents[e],t),n.render(this._renderContext);if(a){this._bindTargetFBO(r),this._overlayParameters.texture=a.getTexture(),this._overlayParameters.opacity=o,this._overlayParameters.overlayIndex=e;const t=this._techniques.get(q);this._rctx.bindTechnique(t,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),a.release()}})}_bindTargetFBO(e){const r=this._resolution,t=2*r;e.fbo.ensureFramebuffer(t,r),e.fbo.bind(this._rctx)}_bindTemporaryFBO(){const e=this._resolution,r=2*e,t=this._stage.renderer.fboCache,s=t.acquire(r,e,"overlay tmp");return t.rctx.bindFramebuffer(s.fbo),t.rctx.clear(16384),s}get _resolution(){return this._overlays?.[0].resolution??0}notifyContentChanged(){this.events.emit("content-changed")}intersect(e,r,t,s){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let i=0;for(const{renderer:n}of this._sortedRenderers)i=n.intersect?.(e,r,t,s,i)??i}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this._view.map.allLayers.map(e=>e.uid),r=e.length;this._renderers.forEach((t,s)=>{const i=e.indexOf(s.layer?.uid),n=i>=0,o=s.renderGroup??(n?0:1),a=s.drapeSourcePriorityOffset??0,h=r*o+(n?i:0)+a;this._sortedRenderers.push(new U(s,t,h))}),this._sortedRenderers.sort((e,r)=>e.index-r.index)}_setViewParameters(e,r){const t=this._camera;t.viewport=[0,0,r.resolution,r.resolution],_(t.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],t.near,t.far),g(t.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,r){if(m(this._passParameters.color,r[0],r[1],r[2]),this._passParameters.texture)return;const t=new Uint8Array(e*e*4);let s=0;for(let n=0;n<e;n++)for(let r=0;r<e;r++){const i=Math.floor(r/10),o=Math.floor(n/10);i<2||o<2||10*i>e-20||10*o>e-20?(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=255):(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=1&i&&1&o?1&r^1&n?0:255:1&i^1&o?0:128)}const i=new k(e);i.samplingMode=9728,this._passParameters.texture=new G(this._rctx,i,t)}get test(){}};e([u()],I.prototype,"hasHighlights",void 0),e([u()],I.prototype,"renderOccludedFlags",void 0),e([u()],I.prototype,"_sortedDrapeSourceRenderersDirty",void 0),e([u({constructOnly:!0})],I.prototype,"parent",void 0),e([u({readOnly:!0})],I.prototype,"_techniques",null),e([u({type:Boolean,readOnly:!0})],I.prototype,"updating",null),e([u()],I.prototype,"isEmpty",null),I=e([p("esri.views.3d.terrain.OverlayRenderer")],I);class U{constructor(e,r,t){this.drapeSource=e,this.renderer=r,this.index=t}}const B=[[1,.5,.5],[.5,.5,1]],H=-2,L=4,z=new M;z.hasAlpha=!0;export{I as OverlayRenderer,H as drapedZ,L as overlayRenderOccludedFlag};
5
+ import{__decorate as e}from"tslib";import{unique as r}from"../../../core/arrayUtils.js";import{EventEmitter as t}from"../../../core/Evented.js";import"../../../core/has.js";import{someMap as s,everyMap as i}from"../../../core/MapUtils.js";import{disposeMaybe as n}from"../../../core/maybe.js";import o from"../../../core/PooledArray.js";import{watch as a,on as h,syncAndInitial as d,initial as l}from"../../../core/reactiveUtils.js";import{someSet as c}from"../../../core/SetUtils.js";import{property as u,subclass as p}from"../../../core/accessorSupport/decorators.js";import{ortho as _,fromTranslation as g}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{set as m}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ones as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{debugFlags as f}from"../support/debugFlags.js";import{Overlay as R}from"./Overlay.js";import{OverlayRenderTargets as v}from"./OverlayRenderTargets.js";import x from"../webgl/RenderCamera.js";import{SyncRenderPlugin as w}from"../webgl-engine/effects/RenderPlugin.js";import{trackHighlightOptions as T,renderHighlightBuffer as b}from"../webgl-engine/effects/highlight/Highlight.js";import{GLMaterialRepository as S}from"../webgl-engine/lib/GLMaterialRepository.js";import{GridLocalOriginFactory as O}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{RenderContext as D,defaultRenderOccludedMask as C}from"../webgl-engine/lib/RenderContext.js";import{ShadowMap as P}from"../webgl-engine/lib/ShadowMap.js";import{T as j}from"../../../chunks/Texture.glsl.js";import{TextureTechnique as E}from"../webgl-engine/lib/TextureTechnique.js";import{TextureTechniqueConfiguration as M}from"../webgl-engine/lib/TextureTechniqueConfiguration.js";import{AmbientLight as F}from"../webgl-engine/lighting/Lightsources.js";import{O as W}from"../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as q}from"../webgl-engine/shaders/OverlayCompositingTechnique.js";import{TaskPriority as V,noBudget as A}from"../../support/Scheduler.js";import G from"../../webgl/Texture.js";import{TextureDescriptor as k}from"../../webgl/TextureDescriptor.js";let I=class extends w{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new W,this.hasHighlights=!1,this.renderOccludedFlags=1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new o,this._passParameters=new j,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new x,this.events=new t,this.longitudeCyclical=null,this.produces=new Map([[19,e=>8!==e||this.hasHighlights],[20,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1,this._hasDrapedFlowSource=!1}initialize(){const e=this._view,r=e.stage,t=r.renderer.fboCache,{waterTextures:s,techniques:i}=r.renderView;this._renderContext=new D(this._rctx,new P(t,e.state.viewingMode),i),this.addHandles([a(()=>s.updating,()=>this.events.emit("content-changed"),d),a(()=>this._spatialReference,e=>this._localOriginFactory=new O(e),d),h(()=>e.allLayerViews,"after-changes",()=>this._sortedDrapeSourceRenderersDirty=!0),a(()=>T(e.state.highlights),()=>this._sortedDrapeSourceRenderersDirty=!0,l),a(()=>e.state.highlights,r=>{this._bindParameters.highlights=r,this._bindParameters.highlightOrderMap=e.state.highlightOrderMap},l),e.resourceController.scheduler.registerTask(V.OVERLAY_RENDERER,this)]);const n=this._camera;n.near=1,n.far=1e4,n.relativeElevation=null,this._bindParameters.slot=19,this._bindParameters.camera=n,this._bindParameters.updateLighting([new F(y())],0,0,0)}destroy(){this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._passParameters.texture=n(this._passParameters.texture),this.disposeOverlays(),this._renderContext=null,this._sortedRenderers.prune()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get _spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}set time(e){this._renderContext.time=e}get pluginContext(){return this._pluginContext}initializeRenderContext(e){const r=new S(this._view.stage.renderView.textures,this._techniques,()=>{this._onMaterialOrContentChanged(),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")},()=>this.events.emit("content-changed"));this._pluginContext={...e,materials:r},this._techniques.precompile(q)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||s(this._renderers,e=>e.updating||e.canCompact)}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(e){for(const r of this._renderers.values()){const t=r.getMaterialRenderer(e);if(t)return t}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),r(this._sortedRenderers.map(e=>e.drapeSource.layer).filter(e=>!!e))}registerDrapeSource(e,r){const t=this._renderers.get(e);null!=t&&t.destroy(),this._renderers.set(e,r),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles(a(()=>e.fullOpacity,()=>this.events.emit("content-changed")),e)}removeDrapeSourceRenderer(e){if(null==e)return;const r=this._renderers.get(e);null!=r&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),r.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(e){this._renderTargets?.dispose(e)}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&c(e,e=>1===e.drapeTargetType)}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=c(e,e=>1===e.drapeSourceType),this._hasDrapedRasterSource=c(e,e=>0===e.drapeSourceType),this._hasDrapedFlowSource=c(e,e=>2===e.drapeSourceType)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=this._hasDrapedFlowSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,r,t=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new v(this._stage.renderer.fboCache),this._overlays=[new R,new R]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r),this._bindParameters.overlayStretch=t}disposeOverlays(){this._overlays=null,this._renderTargets?.dispose(1),this._renderTargets=null,this.events.emit("textures-disposed")}_useOverlayColorInsteadOfColorNoRasterImage(e){return 1===e&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource}getTexture(e){const r=this._useOverlayColorInsteadOfColorNoRasterImage(e);return this._renderTargets?.getTexture(r?0:e)}get readyToRun(){return this.updating}runTask(e){this._processDrapeSources(e,()=>!0)}_onMaterialOrContentChanged(){this.renderOccludedFlags=s(this._renderers,e=>e.hasOccluders)?L:1}_processDrapeSources(e,r){let t=!1;for(const[s,i]of this._renderers){if(e.done)break;(s.destroyed||r(s))&&(i.commitChanges()&&(t=!0,e.madeProgress()))}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,t=!0,this._updateSortedDrapeSourceRenderers(),e.madeProgress()),this.compact(e),t&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this._onMaterialOrContentChanged(),this.hasHighlights=s(this._renderers,e=>e.hasHighlights),this.events.emit("content-changed"))}compact(e){let r=!1;for(const t of this._renderers.values()){if(e.done)break;r=t.compact(e)||r}return r&&this.notifyChange("updating"),r}hasHighlight(e){return s(this._renderers,r=>r.hasHighlight(e))}processSyncDrapeSources(){this._processDrapeSources(A,e=>1===e.updatePolicy)}get isEmpty(){return!f.OVERLAY_DRAW_DEBUG_TEXTURE&&i(this._renderers,e=>e.isEmpty)}get hasWater(){const e=s(this._renderers,({hasWater:e})=>e);return e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water")),this._hasWater}renders(e){if(f.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==e&&2!==e)return!0;if(!this._overlays)return!1;const r=this._overlays[0];for(const i of this._overlays)i.setupGeometryViews(this.longitudeCyclical);if(!r.hasSomeSizedView())return!1;const t=this._setOutput(this._renderTargets?.targets.find(r=>r.content===e)?.output??0);++this._techniques.precompiling;const s=this._sortedRenderers.some(({renderer:e})=>e.precompile(this._renderContext));return--this._techniques.precompiling,this._setOutput(t),s}_setOutput(e){const r=this._renderContext.output;return this._renderContext.output=e,this._bindParameters.slot=2===e?20:19,r}get mode(){return this.isEmpty?0:this.hasWater&&this.renders(3)?2:this._renderTargets?.getTexture(0)?1:0}updateAnimation(e){let r=!1;return this._renderers.forEach(t=>r=t.updateAnimation(e)||r),r&&this.parent.requestRender(0),r}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return!1;const r=this._bindParameters;r.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(const t of this._renderTargets.targets){if(1===t.content&&!this._needsColorWithoutRasterImage)continue;const{output:e}=t;this._setOutput(e),8===e&&(r.highlightMixTexture=r.highlights.length>1?this._rctx.emptyTexture:null);const s=this._renderContext.renderOccludedMask;4===t.content&&(this._renderContext.renderOccludedMask=L),this._sortedRenderers.forAll(({drapeSource:e,renderer:r})=>{1===t.content&&0===e.drapeSourceType||4===t.content&&r.hasOnlyOccluders||r.precompile(this._renderContext)}),this._renderContext.renderOccludedMask=s,r.highlightMixTexture=null}return--this._techniques.precompiling,!0}drawOverlays(e,r){if(!this._overlays||!this._renderTargets)return;for(const s of this._overlays)s.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;const t=this.allSourcesOccluders;for(const s of this._renderTargets.targets){if(!(0===s.content&&this._hasDrapedFlowSource)&&!s.handleRenderRequest(r)||1===s.content&&!this._needsColorWithoutRasterImage||4===s.content&&t)continue;const e=this._drawTarget(0,s),i=this._drawTarget(1,s);(e||i)&&s.fbo.generateMipMap()}}_drawTarget(e,r){const t=this._overlays[e],s=t.canvasGeometries;if(0===s.numViews)return!1;const i=this._view.state.contentPixelRatio;this._screenToWorldRatio=i*t.mapUnitsPerPixel/this._bindParameters.overlayStretch;const{output:n,content:o}=r;if(this.isEmpty||2===n&&!this.hasWater||!t.hasSomeSizedView())return!1;const{_rctx:a,_camera:h,_renderContext:d,_bindParameters:l}=this;if(h.pixelRatio=t.pixelRatio*i,this._setOutput(n),l.screenToWorldRatio=this._screenToWorldRatio,l.screenToPCSRatio=this._screenToWorldRatio*this.parent.worldToPCSRatio,4===o&&(d.renderOccludedMask=L),!this.renders(o))return d.renderOccludedMask=C,!1;const{resolution:c}=t,u=0===e,p=u?0:c;a.setViewport(p,0,c,c),this._bindTargetFBO(r),u&&(8===n?a.gl.clearBufferuiv(a.gl.COLOR,0,[0,0,0,0]):(a.setClearColor(0,0,0,0),a.clear(16384)));if(f.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==o&&2!==o){this._techniques.precompile(E,z);const r=this._techniques.get(E,z);for(let i=0;i<s.numViews;i++)this._setViewParameters(s.extents[i],t),this._ensureDebugPatternResources(t.resolution,B[e]),a.bindTechnique(r,l,this._passParameters),a.screen.draw()}if(8===n){const{fboCache:t}=this._stage.renderer,s=this._resolution;this._bindTargetFBO(r),b(a,t,{width:s,height:s},l,()=>this._renderAllGeometry(e,r),p)}else this._renderAllGeometry(e,r);return a.bindFramebuffer(null),d.renderOccludedMask=C,!0}get allSourcesOccluders(){return i(this._renderers,e=>e.hasOnlyOccluders)}_renderAllGeometry(e,r){const t=this._overlays[e],s=t.canvasGeometries;this._sortedRenderers.forAll(({drapeSource:i,renderer:n})=>{if(1===r.content&&0===i.drapeSourceType)return;const{fullOpacity:o}=i,a=null!=o&&o<1&&0===r.output&&this._bindTemporaryFBO();for(let e=0;e<s.numViews;e++)this._setViewParameters(s.extents[e],t),n.render(this._renderContext);if(a){this._bindTargetFBO(r),this._overlayParameters.texture=a.getTexture(),this._overlayParameters.opacity=o,this._overlayParameters.overlayIndex=e;const t=this._techniques.get(q);this._rctx.bindTechnique(t,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),a.release()}})}_bindTargetFBO(e){const r=this._resolution,t=2*r;e.fbo.ensureFramebuffer(t,r),e.fbo.bind(this._rctx)}_bindTemporaryFBO(){const e=this._resolution,r=2*e,t=this._stage.renderer.fboCache,s=t.acquire(r,e,"overlay tmp");return t.rctx.bindFramebuffer(s.fbo),t.rctx.clear(16384),s}get _resolution(){return this._overlays?.[0].resolution??0}notifyContentChanged(){this.events.emit("content-changed")}intersect(e,r,t,s){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let i=0;for(const{renderer:n}of this._sortedRenderers)i=n.intersect?.(e,r,t,s,i)??i}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this._view.map.allLayers.map(e=>e.uid),r=e.length;this._renderers.forEach((t,s)=>{const i=e.indexOf(s.layer?.uid),n=i>=0,o=s.renderGroup??(n?0:1),a=s.drapeSourcePriorityOffset??0,h=r*o+(n?i:0)+a;this._sortedRenderers.push(new U(s,t,h))}),this._sortedRenderers.sort((e,r)=>e.index-r.index)}_setViewParameters(e,r){const t=this._camera;t.viewport=[0,0,r.resolution,r.resolution],_(t.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],t.near,t.far),g(t.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,r){if(m(this._passParameters.color,r[0],r[1],r[2]),this._passParameters.texture)return;const t=new Uint8Array(e*e*4);let s=0;for(let n=0;n<e;n++)for(let r=0;r<e;r++){const i=Math.floor(r/10),o=Math.floor(n/10);i<2||o<2||10*i>e-20||10*o>e-20?(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=255):(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=1&i&&1&o?1&r^1&n?0:255:1&i^1&o?0:128)}const i=new k(e);i.samplingMode=9728,this._passParameters.texture=new G(this._rctx,i,t)}get test(){}};e([u()],I.prototype,"hasHighlights",void 0),e([u()],I.prototype,"renderOccludedFlags",void 0),e([u()],I.prototype,"_sortedDrapeSourceRenderersDirty",void 0),e([u({constructOnly:!0})],I.prototype,"parent",void 0),e([u({readOnly:!0})],I.prototype,"_techniques",null),e([u({type:Boolean,readOnly:!0})],I.prototype,"updating",null),e([u()],I.prototype,"isEmpty",null),I=e([p("esri.views.3d.terrain.OverlayRenderer")],I);class U{constructor(e,r,t){this.drapeSource=e,this.renderer=r,this.index=t}}const B=[[1,.5,.5],[.5,.5,1]],H=-2,L=4,z=new M;z.hasAlpha=!0;export{I as OverlayRenderer,H as drapedZ,L as overlayRenderOccludedFlag};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../webgl-engine/core/shaderLibrary/raster/Colormap.glsl.js";import"../webgl-engine/core/shaderLibrary/raster/Common.glsl.js";import"../webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js";import"../webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js";import"../webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import"../webgl-engine/core/shaderModules/BooleanPassUniform.js";import"../webgl-engine/core/shaderModules/Float2PassUniform.js";import"../webgl-engine/core/shaderModules/Float3PassUniform.js";import"../webgl-engine/core/shaderModules/FloatPassUniform.js";import"../webgl-engine/core/shaderModules/FloatsPassUniform.js";import"../webgl-engine/core/shaderModules/glsl.js";import"../webgl-engine/core/shaderModules/IntegerPassUniform.js";import"../webgl-engine/core/shaderModules/Texture2DPassUniform.js";import"../../webgl/ShaderBuilder.js";export{b as ColorizerHillshadeUniforms,a as ColorizerStretchUniforms,C as ColorizerUniforms,c as build}from"../../../chunks/RasterColorizer.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../core/accessorSupport/decorators.js";import{R as o}from"../../../chunks/RasterColorizer.glsl.js";import{ReloadableShader as s}from"../webgl-engine/core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as i}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{Pos2TexF16 as t}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{PrimitiveType as a}from"../../webgl/enums.js";let l=class extends i{constructor(e,r){super(e,r,t),this.shader=new s(o,()=>import("../webgl-engine/core/shaderLibrary/raster/RasterColorizer.glsl.js")),this.primitiveType=a.TRIANGLE_STRIP}};l=e([r("esri.views.3d.terrain.RasterColorizerTechnique")],l);export{l as RasterColorizerTechnique};
5
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../core/accessorSupport/decorators.js";import{R as o}from"../../../chunks/RasterColorizer.glsl.js";import{ReloadableShader as s}from"../webgl-engine/core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as i}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{Pos2TexF16 as t}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{PrimitiveType as l}from"../../webgl/enums.js";let a=class extends i{constructor(e,r){super(e,r,t),this.shader=new s(o,()=>import("./RasterColorizer.glsl.js")),this.primitiveType=l.TRIANGLE_STRIP}};a=e([r("esri.views.3d.terrain.RasterColorizerTechnique")],a);export{a as RasterColorizerTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import n from"../../../core/Collection.js";import{isCGCS2000 as t,isEarth as e}from"../../../geometry/support/spatialReferenceUtils.js";import{getTileMaxtrixSetFromActiveLayer as r}from"../../../layers/support/layerUtils.js";import{isRasterTile as o,isImageWithType as i,isTileTexture as u,isVectorTile as l}from"./TerrainData.js";import{t as f}from"../../../chunks/terrainUtilsPlanar.js";import{t as c}from"../../../chunks/terrainUtilsSpherical.js";const a={1:c,2:f};function s(n,t){n||console.warn("Terrain: "+t)}let p=!1,m=!1;function I(n){m=n,p=p||n}function y(n){p=n}function d(n,t){if(p&&!n){const n=(new Error).stack?.slice(5);throw console.warn("Terrain internal: "+(t??"")+" at "+n),new Error("Assertion failed"+(t?": "+t:""))}}function E(n){return"imagery-tile"===n?.type||"wcs"===n?.type}function T(n){return"imagery-tile-3d"===n?.type}function x(n){return"tile-3d"===n?.type}function h(n){return"vector-tile-3d"===n?.type}function L(n){return"wmts-3d"===n?.type}function g(n){return"elevation-3d"===n?.type}function w(n){return"group"===n?.type}function C(n){return n&&(x(n)||L(n)||T(n)||h(n))}function v(n){return n&&(x(n)||T(n)||h(n)||L(n))}function j(n){return v(n)||g(n)}function b(n){return o(n?.sourceLayerInfo?.data)}function k(n){return F(n?.sourceLayerInfo)||!!n?.isVTLBackground}function M(n){return u(n?.sourceLayerInfo?.data)}function V(n){const t=n?.sourceLayerInfo?.data;return i(t)||t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof ImageData}function F(n){return l(n?.data)}function S(n){return null!=n&&"release"in n&&n.release(),null}function U(n){return n.fetchTile&&!1!==n.hasOverriddenFetchTile}function D(n,t,e,r,o){return a[r].checkIfTileInfoSupportedForViewSR(n,e,t,o)}function H(n,t,e){let r=null,o=null;if("wmts"===n?.type){const i=O(n,t,e);r=i.tileInfo,o=i.fullExtent}else{o=E(n)?n.getCompatibleFullExtent(t):n.fullExtent;const i=2===e;if(E(n))r=n.getCompatibleTileInfo(t,o,i);else if("vector-tile"===n?.type){r=i&&!R(t)||W.force512VTL?n.tileInfo:n.tileInfo.getCompatibleForVTL(256)}else r=n.tileInfo}const i="tilemapCache"in n?n.tilemapCache?.effectiveMaxLOD:void 0;return null!=r&&null!=o&&null==D(r,o,t,e,i)?{tileInfo:r,fullExtent:o}:null}function O(t,e,o){const i=r(t);if(null!=i){if(!n.isCollection(i))return{tileInfo:i.tileInfo,fullExtent:i.fullExtent};{const n=i.find(n=>null==D(n.tileInfo,n.fullExtent,e,o));if(n)return{tileInfo:n.tileInfo,fullExtent:n.fullExtent}}}return{tileInfo:null,fullExtent:null}}function R(n){return n.isWGS84||n.isWebMercator||t(n)||!e(n)}const W={force512VTL:!1};function A(n){return"["+n[0]+","+n[1]+","+n[2]+"]"}function B(n){return"("+n[0]+","+n[1]+","+n[2]+")"}function G(n,t,e=$){return Math.abs(n-t)<e}function P(n){return 1===n?5:7===n?3:5===n?1:7}function q(n){return 0===n?4:2===n?6:4===n?0:2}function z(n){return 7===n||5===n}function J(n){return 7===n||1===n}function K(n){return 7===n||6===n||5===n}function N(n){return 1===n||2===n||3===n}function Q(n){return 3===n||4===n||5===n}function X(n){return 1===n||0===n||7===n}const Y=[0,2,4,6],Z=[1,3,5,7],$=1e-5;export{G as almostEquals,D as checkIfTileInfoSupportedForView,y as enableInternalTerrainChecks,p as enableTerrainInternalChecks,I as enableTerrainWaterproofChecks,m as enableWaterproofTests,$ as eps,O as getTileInfoAndExtentFromWMTSLayer,H as getTiledLayerInfo,d as internalAssert,C as isBlendableLayerView,N as isEast,g as isElevationLayerView,w as isGroupLayerView,V as isImageSourceRenderInfo,T as isImageryTileLayerView,b as isImageryTileRenderInfo,v as isMapTileLayerView,X as isNorth,J as isNorthCorner,E as isProjectableRasterLayer,Q as isSouth,j as isSurfaceLayerView,M as isTextureTileRenderInfo,x as isTileLayerView,h as isVectorTileLayerView,F as isVectorTilePerLayerInfo,k as isVectorTileRenderInfo,L as isWMTSLayerView,K as isWest,z as isWestCorner,A as lij2s,Z as neighborCornerIndices,Y as neighborEdgeIndices,P as oppositeCorner,q as oppositeEdge,S as releaseTerrainData,W as test,U as useFetchTileForLayer,B as v32s,R as vtlAssumes256PixelSizeAsDefault,s as weakAssert};
5
+ import n from"../../../core/Collection.js";import{isEarth as t}from"../../../geometry/ellipsoidUtils.js";import{isCGCS2000 as e}from"../../../geometry/support/spatialReferenceUtils.js";import{getTileMaxtrixSetFromActiveLayer as r}from"../../../layers/support/layerUtils.js";import{isRasterTile as o,isImageWithType as i,isTileTexture as u,isVectorTile as l}from"./TerrainData.js";import{t as f}from"../../../chunks/terrainUtilsPlanar.js";import{t as c}from"../../../chunks/terrainUtilsSpherical.js";const a={1:c,2:f};function s(n,t){n||console.warn("Terrain: "+t)}let p=!1,m=!1;function y(n){m=n,p=p||n}function I(n){p=n}function d(n,t){if(p&&!n){const n=(new Error).stack?.slice(5);throw console.warn("Terrain internal: "+(t??"")+" at "+n),new Error("Assertion failed"+(t?": "+t:""))}}function E(n){return"imagery-tile"===n?.type||"wcs"===n?.type}function T(n){return"imagery-tile-3d"===n?.type}function x(n){return"tile-3d"===n?.type}function g(n){return"vector-tile-3d"===n?.type}function h(n){return"wmts-3d"===n?.type}function L(n){return"elevation-3d"===n?.type}function w(n){return"group"===n?.type}function C(n){return n&&(x(n)||h(n)||T(n)||g(n))}function j(n){return n&&(x(n)||T(n)||g(n)||h(n))}function v(n){return j(n)||L(n)}function b(n){return o(n?.sourceLayerInfo?.data)}function k(n){return V(n?.sourceLayerInfo)||!!n?.isVTLBackground}function M(n){return u(n?.sourceLayerInfo?.data)}function U(n){const t=n?.sourceLayerInfo?.data;return i(t)||t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof ImageData}function V(n){return l(n?.data)}function F(n){return null!=n&&"release"in n&&n.release(),null}function S(n){return n.fetchTile&&!1!==n.hasOverriddenFetchTile}function D(n,t,e,r,o){return a[r].checkIfTileInfoSupportedForViewSR(n,e,t,o)}function H(n,t,e){let r=null,o=null;if("wmts"===n?.type){const i=O(n,t,e);r=i.tileInfo,o=i.fullExtent}else{o=E(n)?n.getCompatibleFullExtent(t):n.fullExtent;const i=2===e;if(E(n))r=n.getCompatibleTileInfo(t,o,i);else if("vector-tile"===n?.type){r=i&&!R(t)||W.force512VTL?n.tileInfo:n.tileInfo.getCompatibleForVTL(256)}else r=n.tileInfo}const i="tilemapCache"in n?n.tilemapCache?.effectiveMaxLOD:void 0;return null!=r&&null!=o&&null==D(r,o,t,e,i)?{tileInfo:r,fullExtent:o}:null}function O(t,e,o){const i=r(t);if(null!=i){if(!n.isCollection(i))return{tileInfo:i.tileInfo,fullExtent:i.fullExtent};{const n=i.find(n=>null==D(n.tileInfo,n.fullExtent,e,o));if(n)return{tileInfo:n.tileInfo,fullExtent:n.fullExtent}}}return{tileInfo:null,fullExtent:null}}function R(n){return n.isWGS84||n.isWebMercator||e(n)||!t(n)}const W={force512VTL:!1};function A(n){return"["+n[0]+","+n[1]+","+n[2]+"]"}function B(n){return"("+n[0]+","+n[1]+","+n[2]+")"}function G(n,t,e=$){return Math.abs(n-t)<e}function P(n){return 1===n?5:7===n?3:5===n?1:7}function q(n){return 0===n?4:2===n?6:4===n?0:2}function z(n){return 7===n||5===n}function J(n){return 7===n||1===n}function K(n){return 7===n||6===n||5===n}function N(n){return 1===n||2===n||3===n}function Q(n){return 3===n||4===n||5===n}function X(n){return 1===n||0===n||7===n}const Y=[0,2,4,6],Z=[1,3,5,7],$=1e-5;export{G as almostEquals,D as checkIfTileInfoSupportedForView,I as enableInternalTerrainChecks,p as enableTerrainInternalChecks,y as enableTerrainWaterproofChecks,m as enableWaterproofTests,$ as eps,O as getTileInfoAndExtentFromWMTSLayer,H as getTiledLayerInfo,d as internalAssert,C as isBlendableLayerView,N as isEast,L as isElevationLayerView,w as isGroupLayerView,U as isImageSourceRenderInfo,T as isImageryTileLayerView,b as isImageryTileRenderInfo,j as isMapTileLayerView,X as isNorth,J as isNorthCorner,E as isProjectableRasterLayer,Q as isSouth,v as isSurfaceLayerView,M as isTextureTileRenderInfo,x as isTileLayerView,g as isVectorTileLayerView,V as isVectorTilePerLayerInfo,k as isVectorTileRenderInfo,h as isWMTSLayerView,K as isWest,z as isWestCorner,A as lij2s,Z as neighborCornerIndices,Y as neighborEdgeIndices,P as oppositeCorner,q as oppositeEdge,F as releaseTerrainData,W as test,S as useFetchTileForLayer,B as v32s,R as vtlAssumes256PixelSizeAsDefault,s as weakAssert};
@@ -2,7 +2,7 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import has from"../../../../../core/has.js";import{translate as s}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{add as a,transformMat4 as l,subtract as o,set as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as c,create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{InstancedDoubleConfiguration as t}from"./attributes/InstancedDoubleConfiguration.js";import{Float3DrawUniform as f}from"../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as d}from"../shaderModules/Float3PassUniform.js";import{glsl as u}from"../shaderModules/glsl.js";import{parameter as p}from"../shaderTechnique/ShaderTechniqueConfiguration.js";import{NoParameters as m}from"../../../../webgl/NoParameters.js";class P extends t{constructor(){super(...arguments),this.hasSlicePlane=!1,this.hasSliceTranslatedView=!1}}e([p()],P.prototype,"hasSlicePlane",void 0);class b extends m{constructor(e){super(),this.slicePlaneLocalOrigin=e}}function v(e,s){g(e,s,new d("slicePlaneOrigin",(e,i)=>x(s,e,i)),new d("slicePlaneBasis1",(e,i)=>O(s,e,i,i.slicePlane?.basis1)),new d("slicePlaneBasis2",(e,i)=>O(s,e,i,i.slicePlane?.basis2)))}function h(e,s){g(e,s,new f("slicePlaneOrigin",(e,i)=>x(s,e,i)),new f("slicePlaneBasis1",(e,i)=>O(s,e,i,i.slicePlane?.basis1)),new f("slicePlaneBasis2",(e,i)=>O(s,e,i,i.slicePlane?.basis2)))}function w(e,s){B(e,s,new f("slicePlaneOrigin",(e,i)=>x(s,e,i)),new f("slicePlaneBasis1",(e,i)=>O(s,e,i,i.slicePlane?.basis1)),new f("slicePlaneBasis2",(e,i)=>O(s,e,i,i.slicePlane?.basis2)))}const S=u`struct SliceFactors {
5
+ import{__decorate as e}from"tslib";import{translate as s}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{add as a,transformMat4 as l,subtract as o,set as c}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as n,create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{InstancedDoubleConfiguration as t}from"./attributes/InstancedDoubleConfiguration.js";import{Float3DrawUniform as f}from"../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as d}from"../shaderModules/Float3PassUniform.js";import{glsl as u}from"../shaderModules/glsl.js";import{parameter as p}from"../shaderTechnique/ShaderTechniqueConfiguration.js";import{NoParameters as P}from"../../../../webgl/NoParameters.js";class m extends t{constructor(){super(...arguments),this.hasSlicePlane=!1,this.hasSliceTranslatedView=!1}}e([p()],m.prototype,"hasSlicePlane",void 0);class b extends P{constructor(e){super(),this.slicePlaneLocalOrigin=e}}function v(e,s){g(e,s,new d("slicePlaneOrigin",(e,i)=>x(s,e,i)),new d("slicePlaneBasis1",(e,i)=>O(s,e,i,i.slicePlane?.basis1)),new d("slicePlaneBasis2",(e,i)=>O(s,e,i,i.slicePlane?.basis2)))}function h(e,s){g(e,s,new f("slicePlaneOrigin",(e,i)=>x(s,e,i)),new f("slicePlaneBasis1",(e,i)=>O(s,e,i,i.slicePlane?.basis1)),new f("slicePlaneBasis2",(e,i)=>O(s,e,i,i.slicePlane?.basis2)))}function w(e,s){B(e,s,new f("slicePlaneOrigin",(e,i)=>x(s,e,i)),new f("slicePlaneBasis1",(e,i)=>O(s,e,i,i.slicePlane?.basis1)),new f("slicePlaneBasis2",(e,i)=>O(s,e,i,i.slicePlane?.basis2)))}const S=u`struct SliceFactors {
6
6
  float front;
7
7
  float side0;
8
8
  float side1;
@@ -37,5 +37,5 @@ return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
37
37
  }
38
38
  bool rejectBySlice(vec3 pos) {
39
39
  return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
40
- }`;function B(e,s,...i){s.hasSlicePlane?(e.uniforms.add(...i),e.code.add(S)):e.code.add("bool rejectBySlice(vec3 pos) { return false; }")}function g(e,s,...i){e.constants.add("groundSliceOpacity","float",has("enable-feature:oit-ground")?.25:.2),B(e,s,...i),s.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (rejectBySlice(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(u`void discardBySlice(vec3 pos) { }
41
- vec4 applySlice(vec4 color, vec3 pos) { return color; }`)}function y(e,s,i){return e.instancedDoublePrecision?n(D,i.camera.viewInverseTransposeMatrix[3],i.camera.viewInverseTransposeMatrix[7],i.camera.viewInverseTransposeMatrix[11]):s.slicePlaneLocalOrigin}function F(e,s){return null!=e?o(L,s.origin,e):s.origin}function j(e,i,a){return e.hasSliceTranslatedView?null!=i?s(T,a.camera.viewMatrix,i):a.camera.viewMatrix:null}function x(e,s,i){if(null==i.slicePlane)return c;const a=y(e,s,i),o=F(a,i.slicePlane),n=j(e,a,i);return null!=n?l(L,o,n):o}function O(e,s,i,n){if(null==n||null==i.slicePlane)return c;const r=y(e,s,i),t=F(r,i.slicePlane),f=j(e,r,i);return null!=f?(a(M,n,t),l(L,t,f),l(M,M,f),o(M,M,L)):n}const D=r(),L=r(),M=r(),T=i();export{w as RejectBySlice,P as SliceConfiguration,h as SliceDraw,v as SlicePass,b as SlicePlaneParameters};
40
+ }`;function B(e,s,...i){s.hasSlicePlane?(e.uniforms.add(...i),e.code.add(S)):e.code.add("bool rejectBySlice(vec3 pos) { return false; }")}function g(e,s,...i){e.constants.add("groundSliceOpacity","float",.2),B(e,s,...i),s.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (rejectBySlice(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(u`void discardBySlice(vec3 pos) { }
41
+ vec4 applySlice(vec4 color, vec3 pos) { return color; }`)}function y(e,s,i){return e.instancedDoublePrecision?c(D,i.camera.viewInverseTransposeMatrix[3],i.camera.viewInverseTransposeMatrix[7],i.camera.viewInverseTransposeMatrix[11]):s.slicePlaneLocalOrigin}function F(e,s){return null!=e?o(L,s.origin,e):s.origin}function j(e,i,a){return e.hasSliceTranslatedView?null!=i?s(T,a.camera.viewMatrix,i):a.camera.viewMatrix:null}function x(e,s,i){if(null==i.slicePlane)return n;const a=y(e,s,i),o=F(a,i.slicePlane),c=j(e,a,i);return null!=c?l(L,o,c):o}function O(e,s,i,c){if(null==c||null==i.slicePlane)return n;const r=y(e,s,i),t=F(r,i.slicePlane),f=j(e,r,i);return null!=f?(a(M,c,t),l(L,t,f),l(M,M,f),o(M,M,L)):c}const D=r(),L=r(),M=r(),T=i();export{w as RejectBySlice,m as SliceConfiguration,h as SliceDraw,v as SlicePass,b as SlicePlaneParameters};
@@ -6,7 +6,7 @@ import{FoamColor as e}from"./FoamRendering.glsl.js";import{Gamma as o}from"./Gam
6
6
  vec3 getSkyGradientColor(in float cosTheta, in vec3 horizon, in vec3 zenit) {
7
7
  float exponent = pow((1.0 - cosTheta), fresnelSky[2]);
8
8
  return mix(zenit, horizon, exponent);
9
- }`),u.uniforms.add(new l("lightingSpecularStrength",e=>e.lighting.mainLight.specularStrength),new l("lightingEnvironmentStrength",e=>e.lighting.mainLight.environmentStrength)),u.code.add(d`vec3 getSeaColor(in vec3 n, in vec3 v, in vec3 l, vec3 color, in vec3 lightIntensity, in vec3 localUp, in float shadow, float foamIntensity, vec3 viewPosition, vec3 position) {
9
+ }`),u.uniforms.add(new l("lightingSpecularStrength",e=>e.lighting.mainLight.specularStrength),new l("lightingEnvironmentStrength",e=>e.lighting.mainLight.environmentStrength)),u.code.add(d`vec3 getWaterColor(in vec3 n, in vec3 v, in vec3 l, vec3 color, in vec3 lightIntensity, in vec3 localUp, in float shadow, float foamIntensity, vec3 viewPosition, vec3 position) {
10
10
  float reflectionHit = 0.0;
11
11
  float reflectionHitDiffused = 0.0;
12
12
  vec3 seaWaterColor = linearizeGamma(color);
@@ -66,4 +66,4 @@ vec3 waterRenderedColor = tonemapACES((1.0 - reflectionHitDiffused) * reflSky +
66
66
  reflSea * seaColorMod + specular + foam);`):u.code.add(d`vec3 waterRenderedColor = tonemapACES(reflSky + reflSea * waterSeaColorMod + specular + foam);`),v.cloudReflections?v.screenSpaceReflections?u.code.add(d`return waterRenderedColor * (1.0 - (1.0 - reflectionHit) * cloudsColor.a) + (1.0 - reflectionHit) * cloudsColor.xyz;
67
67
  }`):u.code.add(d`return waterRenderedColor * (1.0 - cloudsColor.a) + cloudsColor.xyz;
68
68
  }`):u.code.add(d`return waterRenderedColor;
69
- }`)}export{m as Water};
69
+ }`)}export{m as WaterColor};
@@ -2,7 +2,7 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{hasArea as o,width as r,height as t}from"../../../../../../geometry/support/aaBoundingRect.js";import{isColor as l}from"../ShaderOutput.js";import{addMainLightDirection as a,addMainLightIntensity as i}from"../shading/MainLighting.glsl.js";import{Water as c}from"../shading/Water.glsl.js";import{Float4DrawUniform as s}from"../../shaderModules/Float4DrawUniform.js";import{FloatPassUniform as n}from"../../shaderModules/FloatPassUniform.js";import{glsl as v}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as d}from"../../shaderModules/Texture2DPassUniform.js";import{Texture2DUintPassUniform as u}from"../../shaderModules/Texture2DUintPassUniform.js";import{Uniform as x}from"../../../../../webgl/Uniform.js";function y(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new s("overlayTexOffset",(e,r)=>h(o.spherical,e,r)),new s("overlayTexScale",(e,r)=>O(o.spherical,e,r))),t.uniforms.add(new s("overlayTexOffset",(e,r)=>h(o.spherical,e,r)),new s("overlayTexScale",(e,r)=>O(o.spherical,e,r))),t.constants.add("overlayOpacity","float",1),t.uniforms.add(new d("ovColorTex",(e,o)=>f(e,o))),g(e,o)}function f(e,o){return 0===e.identifier&&l(e.output)?e.occludedGround?o.overlay?.allSourcesOccluders?o.overlay?.getTexture(1):o.overlay?.getTexture(4):o.overlay?.getTexture(1):0===e.identifier&&9===e.output?o.overlay?.getTexture(5):2===e.identifier?o.overlay?.getTexture(2):null}function m(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new V("overlayTexOffset"),new V("overlayTexScale")),t.uniforms.add(new n("overlayOpacity",e=>e.overlayOpacity)),8!==o.output&&t.uniforms.add(new d("ovColorTex",(e,o)=>o.overlay?.getTexture(e.overlayContent))),g(e,o)}function p(e,o){switch(e){case 0:return 10!==o.slot||o.overlay?.allSourcesOccluders?0:4;case 1:case 2:return 0;case 8:return 2;case 3:case 5:case 6:case 7:return null;case 9:return 5}return null}function g(e,o){const{hasWater:r,output:t}=o;r&&e.include(c,o);const{vertex:l,fragment:s,varyings:n}=e;n.add("vtcOverlay","vec4");const d=8===t;l.code.add(v`void setOverlayVTC(in vec2 uv) {
5
+ import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{hasArea as o,width as r,height as t}from"../../../../../../geometry/support/aaBoundingRect.js";import{isColor as l}from"../ShaderOutput.js";import{addMainLightDirection as a,addMainLightIntensity as i}from"../shading/MainLighting.glsl.js";import{WaterColor as c}from"../shading/WaterColor.glsl.js";import{Float4DrawUniform as s}from"../../shaderModules/Float4DrawUniform.js";import{FloatPassUniform as n}from"../../shaderModules/FloatPassUniform.js";import{glsl as v}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as d}from"../../shaderModules/Texture2DPassUniform.js";import{Texture2DUintPassUniform as u}from"../../shaderModules/Texture2DUintPassUniform.js";import{Uniform as x}from"../../../../../webgl/Uniform.js";function y(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new s("overlayTexOffset",(e,r)=>h(o.spherical,e,r)),new s("overlayTexScale",(e,r)=>O(o.spherical,e,r))),t.uniforms.add(new s("overlayTexOffset",(e,r)=>h(o.spherical,e,r)),new s("overlayTexScale",(e,r)=>O(o.spherical,e,r))),t.constants.add("overlayOpacity","float",1),t.uniforms.add(new d("ovColorTex",(e,o)=>f(e,o))),g(e,o)}function f(e,o){return 0===e.identifier&&l(e.output)?e.occludedGround?o.overlay?.allSourcesOccluders?o.overlay?.getTexture(1):o.overlay?.getTexture(4):o.overlay?.getTexture(1):0===e.identifier&&9===e.output?o.overlay?.getTexture(5):2===e.identifier?o.overlay?.getTexture(2):null}function m(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new V("overlayTexOffset"),new V("overlayTexScale")),t.uniforms.add(new n("overlayOpacity",e=>e.overlayOpacity)),8!==o.output&&t.uniforms.add(new d("ovColorTex",(e,o)=>o.overlay?.getTexture(e.overlayContent))),g(e,o)}function p(e,o){switch(e){case 0:return 10!==o.slot||o.overlay?.allSourcesOccluders?0:4;case 1:case 2:return 0;case 8:return 2;case 3:case 5:case 6:case 7:return null;case 9:return 5}return null}function g(e,o){const{hasWater:r,output:t}=o;r&&e.include(c,o);const{vertex:l,fragment:s,varyings:n}=e;n.add("vtcOverlay","vec4");const d=8===t;l.code.add(v`void setOverlayVTC(in vec2 uv) {
6
6
  vtcOverlay = vec4(uv, uv) * overlayTexScale + overlayTexOffset;
7
7
  }`),s.code.add(v`bool isValid(vec2 uv, vec2 dxdy) {
8
8
  return (uv.x >= 0.0 + dxdy.x) && (uv.x <= 1.0 - dxdy.x) && (uv.y >= 0.0 + dxdy.y) && (uv.y <= 1.0 - dxdy.y);
@@ -42,6 +42,6 @@ return mix(color1 * float(isValid1), color0, float(isValid0));
42
42
  float shadow, vec3 localUp, mat3 tbn, vec3 position, vec3 positionWorld) {
43
43
  vec3 n = normalize(tbn * (2.0 * maskInput.rgb - vec3(1.0)));
44
44
  vec3 v = vposEyeDir;
45
- vec3 final = getSeaColor(n, v, mainLightDirection, colorInput.rgb, mainLightIntensity, localUp, 1.0 - shadow, maskInput.w, position, positionWorld);
45
+ vec3 final = getWaterColor(n, v, mainLightDirection, colorInput.rgb, mainLightIntensity, localUp, 1.0 - shadow, maskInput.w, position, positionWorld);
46
46
  return vec4(final, colorInput.w);
47
47
  }`))}function C(e,o){return e.overlay?.overlays[o]?.extent}function h(e,l,a){const i=T,c=e&&!l.useENUForGlobalOverlayUV,s=c?0:l.toMapSpace[0],n=c?0:l.toMapSpace[1],v=(e,l)=>{const c=C(a,l);o(c)&&(i[e+0]=(s-c[0])/r(c),i[e+1]=(n-c[1])/t(c))};return v(0,0),v(2,1),i}function O(e,l,a){const i=T,c=e&&!l.useENUForGlobalOverlayUV,s=c?1:l.toMapSpace[2],n=c?1:l.toMapSpace[3],v=(e,l)=>{const c=C(a,l);o(c)&&(i[e+0]=s/r(c),i[e+1]=n/t(c))};return v(0,0),v(2,1),i}const T=e();class V extends x{constructor(e){super(e,"vec4")}}export{y as OverlayIM,m as OverlayTerrain,f as getIMColorTexture,p as getOverlayContentForOutputTerrain};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{isMars as e,isMoon as r}from"../../../../../../geometry/support/spatialReferenceUtils.js";function t(t){return t&&e(t)?2:t&&r(t)?3:1}export{t as getEllipsoidMode};
5
+ import{isMars as o,isMoon as r}from"../../../../../../geometry/ellipsoidUtils.js";function t(t){return t&&o(t)?2:t&&r(t)?3:1}export{t as getEllipsoidMode};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{releaseMaybe as t,disposeMaybe as i}from"../../../../../core/maybe.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{set as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as l}from"../../../webgl.js";import a from"../../../webgl/RenderNode.js";import{HighlightApplyTechnique as g}from"./HighlightApplyTechnique.js";import{HighlightBlurTechnique as c}from"./HighlightBlurTechnique.js";import{HighlightDownsampleTechnique as u}from"./HighlightDownsampleTechnique.js";import{HighlightPassParameters as p}from"./HighlightPassParameters.js";import{HighlightToSingleTechnique as m}from"./HighlightToSingleTechnique.js";import{NoVertex as d}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as f}from"../../lib/VertexArrayObject.js";import{H as b}from"../../../../../chunks/HighlightBlur.glsl.js";import{H as w,g as x}from"../../../../../chunks/HighlightDownsample.glsl.js";import{BufferObject as T}from"../../../../webgl/BufferObject.js";import{PrimitiveType as _,DataType as v}from"../../../../webgl/enums.js";import C from"../../../../webgl/Texture.js";import{TextureDescriptor as H}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as j}from"../../../../webgl/VertexBuffer.js";let q=class extends a{constructor(){super(...arguments),this.produces=l.HIGHLIGHTS,this.consumes={required:[l.HIGHLIGHTS,"highlights"]},this._downsampleDrawParameters=new w,this._passParameters=new p,this._highlightBlurDrawParameters=new b,this._grid=new P}initialize(){this.addHandles([r(()=>this._updateOptionsTexture(),()=>{},s)])}destroy(){this._grid.coverage=t(this._grid.coverage),this._grid.vao=i(this._grid.vao),this._passParameters.highlightOptionsTexture=t(this._passParameters.highlightOptionsTexture)}_updateOptionsTexture(){if(null==this._passParameters.highlightOptionsTexture){const e=new H(16,2);e.internalFormat=6408,e.samplingMode=9728,this._passParameters.highlightOptionsTexture=new C(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(O(this.view.state.highlights)),this.requestRender(1)}precompile(){this.techniques.precompile(u),this.techniques.precompile(m),this.techniques.precompile(c),this.techniques.precompile(g)}render(e){const t=e.find(({name:e})=>e===l.HIGHLIGHTS),{techniques:i,bindParameters:r}=this;if(!r.decorations)return t;if(!i.get(u).compiled)return this.requestRender(1),t;const s=e.find(({name:e})=>"highlights"===e).getTexture();return this._renderHighlightPostprocess(s,t),t}_prepareAndDownSample(e){this._gridUpdateResources(e);const t=this.techniques.get(u),i=this._gridComputeCoverage(t,e),{horizontalCellCount:r,verticalCellCount:s}=i,o=this._passParameters;return o.horizontalCellCount=r,o.verticalCellCount=s,o.coverageTexture=i.coverage?.getTexture(),i}_renderGrid(e){const t=e.verticalCellCount*e.horizontalCellCount;this.renderingContext.bindVAO(e.vao),this.renderingContext.drawElementsInstanced(_.TRIANGLES,6,v.UNSIGNED_BYTE,0,t)}_renderHighlightPostprocess(e,t){const{fboCache:i,techniques:r,bindParameters:s,_passParameters:o,renderingContext:h}=this,l=r.get(m),a=r.get(c),u=r.get(g);if(!u.compiled||!a.compiled||!l.compiled)return void this.requestRender(1);o.highlightTexture=e;const p=this._prepareAndDownSample(e),{width:d,height:f}=e.descriptor;o.highlightTexture=e;const{camera:b}=s,{fullWidth:w,fullHeight:x,pixelRatio:T,fullViewport:_}=b,v=Math.ceil(w/T),C=Math.ceil(x/T),{_highlightBlurDrawParameters:H}=this,j=this.view.stage.renderView.renderer,{highlights:q}=s;for(let g=0;g<q.length;++g){const{name:e}=q[g];if(!j.hasHighlight(e))continue;o.highlightLevel=g,h.setClearColor(0,0,0,0);const r=i.acquire(d,f,"single highlight",2);h.bindFramebuffer(r.fbo),h.setViewport(0,0,d,f),h.clear(16384),h.bindTechnique(l,s,o),this._renderGrid(p),H.blurInput=r.getTexture(),n(H.blurSize,1/v,0);const c=i.acquire(v,C,"single highlight blur",2);h.unbindTexture(c.fbo?.colorTexture),h.bindFramebuffer(c.fbo),h.setViewport(0,0,v,C),h.clear(16384),h.bindTechnique(a,s,o,H),this._renderGrid(p),r.release(),n(H.blurSize,0,1/C),o.highlightBlurTexture=c.getTexture(),h.bindFramebuffer(t.fbo),h.setViewport4fv(_),h.bindTechnique(u,s,o,H),this._renderGrid(p),c.release()}o.coverageTexture=o.highlightTexture=null}_gridUpdateResources(e){const t=this._grid,{width:i,height:r}=e.descriptor;if(t.horizontalCellCount=Math.ceil(i/x),t.verticalCellCount=Math.ceil(r/x),t.vao)return;const s=this.renderingContext,o=T.createIndex(s,35044,I);t.vao=new f(s,new j(s,d),o)}_gridComputeCoverage(e,t){const i=this.renderingContext,r=this._grid,s=t.descriptor,o=Math.ceil(s.width/x),h=Math.ceil(s.height/x);this._downsampleDrawParameters.input=t;const{highlights:n}=this.bindParameters;r.coverage?.release();const l=this.fboCache.acquire(o,h,"highlight coverage",n.length>G?3:1);return r.coverage=l,i.bindFramebuffer(l.fbo),i.bindTechnique(e,this.bindParameters,this._passParameters,this._downsampleDrawParameters),i.setViewport(0,0,o,h),i.screen.draw(),r}get test(){}};e([o()],q.prototype,"produces",void 0),e([o()],q.prototype,"consumes",void 0),q=e([h("esri.views.3d.webgl-engine.effects.highlight.Highlight")],q);class P{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}function O(e){const t=new Uint8Array(128);let i=0;for(const r of e){const e=4*i,s=4*i+64;++i;const{color:o}=r,h=r.haloColor??o;t[e+0]=o.r,t[e+1]=o.g,t[e+2]=o.b,t[e+3]=r.fillOpacity*o.a*255,t[s+0]=h.r,t[s+1]=h.g,t[s+2]=h.b,t[s+3]=r.haloOpacity*h.a*255}return t}let D=0;function y(e){let t=0;for(const r of e){const{name:e}=r;t+=e.length;const{color:i,fillOpacity:s,haloColor:o,haloOpacity:h}=r;t+=i.r+i.g+i.b+i.a+s,t+=o?o.r+o.g+o.b+o.a+h:0}const i=e.at(0);if(i){const{shadowOpacity:e,shadowDifference:r,shadowColor:s}=i;t+=e+r+s.r+s.g+s.b+s.a}return D+++(t>=0?0:1)}const I=new Uint8Array([0,1,2,2,1,3]);function S(e,t,i,r,s,o=0){const{highlights:h}=r,l=h.length>1?t.acquire(i.width,i.height,"highlight mix",h.length>G?3:1):null,{gl:a}=e;if(l){const t=e.getBoundFramebufferObject();e.bindFramebuffer(l.fbo),a.clearBufferuiv(a.COLOR,0,[0,0,0,0]),e.bindFramebuffer(t)}const g=l?.getTexture();r.highlightMixTexture=g,n(r.highlightMixOrigin,o,0),h.forEach((t,h)=>{if(h>0){const t=C.TEXTURE_UNIT_FOR_UPDATES;e.bindTexture(g,t),e.setActiveTexture(t),a.copyTexSubImage2D(3553,0,0,0,o,0,i.width,i.height),e.bindTexture(null,t)}e.clear(256),r.highlightLevel=h,s()}),r.highlightLevel=null,r.highlightMixTexture=null,l?.release()}const G=4;export{q as Highlight,G as maxHighlightsPerChannel,S as renderHighlightBuffer,y as trackHighlightOptions};
5
+ import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{releaseMaybe as t,disposeMaybe as i}from"../../../../../core/maybe.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{set as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as l}from"../../../webgl.js";import a from"../../../webgl/RenderNode.js";import{HighlightApplyTechnique as g}from"./HighlightApplyTechnique.js";import{H as c}from"../../../../../chunks/HighlightBlur.glsl.js";import{HighlightBlurTechnique as u}from"./HighlightBlurTechnique.js";import{H as p,g as m}from"../../../../../chunks/HighlightDownsample.glsl.js";import{HighlightDownsampleTechnique as d}from"./HighlightDownsampleTechnique.js";import{HighlightPassParameters as f}from"./HighlightPassParameters.js";import{HighlightToSingleTechnique as b}from"./HighlightToSingleTechnique.js";import{NoVertex as w}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as x}from"../../lib/VertexArrayObject.js";import{BufferObject as T}from"../../../../webgl/BufferObject.js";import{PrimitiveType as _,DataType as v}from"../../../../webgl/enums.js";import C from"../../../../webgl/Texture.js";import{TextureDescriptor as H}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as j}from"../../../../webgl/VertexBuffer.js";let q=class extends a{constructor(){super(...arguments),this.produces=l.HIGHLIGHTS,this.consumes={required:[l.HIGHLIGHTS,"highlights"]},this._downsampleDrawParameters=new p,this._passParameters=new f,this._highlightBlurDrawParameters=new c,this._grid=new P}initialize(){this.addHandles([r(()=>this._updateOptionsTexture(),()=>{},s)])}destroy(){this._grid.coverage=t(this._grid.coverage),this._grid.vao=i(this._grid.vao),this._passParameters.highlightOptionsTexture=t(this._passParameters.highlightOptionsTexture)}_updateOptionsTexture(){if(null==this._passParameters.highlightOptionsTexture){const e=new H(16,2);e.internalFormat=6408,e.samplingMode=9728,this._passParameters.highlightOptionsTexture=new C(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(O(this.view.state.highlights)),this.requestRender(1)}precompile(){this.techniques.precompile(d),this.techniques.precompile(b),this.techniques.precompile(u),this.techniques.precompile(g)}render(e){const t=e.find(({name:e})=>e===l.HIGHLIGHTS),{techniques:i,bindParameters:r}=this;if(!r.decorations)return t;if(!i.get(d).compiled)return this.requestRender(1),t;const s=e.find(({name:e})=>"highlights"===e).getTexture();return this._renderHighlightPostprocess(s,t),t}_prepareAndDownSample(e){this._gridUpdateResources(e);const t=this.techniques.get(d),i=this._gridComputeCoverage(t,e),{horizontalCellCount:r,verticalCellCount:s}=i,o=this._passParameters;return o.horizontalCellCount=r,o.verticalCellCount=s,o.coverageTexture=i.coverage?.getTexture(),i}_renderGrid(e){const t=e.verticalCellCount*e.horizontalCellCount;this.renderingContext.bindVAO(e.vao),this.renderingContext.drawElementsInstanced(_.TRIANGLES,6,v.UNSIGNED_BYTE,0,t)}_renderHighlightPostprocess(e,t){const{fboCache:i,techniques:r,bindParameters:s,_passParameters:o,renderingContext:h}=this,l=r.get(b),a=r.get(u),c=r.get(g);if(!c.compiled||!a.compiled||!l.compiled)return void this.requestRender(1);o.highlightTexture=e;const p=this._prepareAndDownSample(e),{width:m,height:d}=e.descriptor;o.highlightTexture=e;const{camera:f}=s,{fullWidth:w,fullHeight:x,pixelRatio:T,fullViewport:_}=f,v=Math.ceil(w/T),C=Math.ceil(x/T),{_highlightBlurDrawParameters:H}=this,j=this.view.stage.renderView.renderer,{highlights:q}=s;for(let g=0;g<q.length;++g){const{name:e}=q[g];if(!j.hasHighlight(e))continue;o.highlightLevel=g,h.setClearColor(0,0,0,0);const r=i.acquire(m,d,"single highlight",2);h.bindFramebuffer(r.fbo),h.setViewport(0,0,m,d),h.clear(16384),h.bindTechnique(l,s,o),this._renderGrid(p),H.blurInput=r.getTexture(),n(H.blurSize,1/v,0);const u=i.acquire(v,C,"single highlight blur",2);h.unbindTexture(u.fbo?.colorTexture),h.bindFramebuffer(u.fbo),h.setViewport(0,0,v,C),h.clear(16384),h.bindTechnique(a,s,o,H),this._renderGrid(p),r.release(),n(H.blurSize,0,1/C),o.highlightBlurTexture=u.getTexture(),h.bindFramebuffer(t.fbo),h.setViewport4fv(_),h.bindTechnique(c,s,o,H),this._renderGrid(p),u.release()}o.coverageTexture=o.highlightTexture=null}_gridUpdateResources(e){const t=this._grid,{width:i,height:r}=e.descriptor;if(t.horizontalCellCount=Math.ceil(i/m),t.verticalCellCount=Math.ceil(r/m),t.vao)return;const s=this.renderingContext,o=T.createIndex(s,35044,I);t.vao=new x(s,new j(s,w),o)}_gridComputeCoverage(e,t){const i=this.renderingContext,r=this._grid,s=t.descriptor,o=Math.ceil(s.width/m),h=Math.ceil(s.height/m);this._downsampleDrawParameters.input=t;const{highlights:n}=this.bindParameters;r.coverage?.release();const l=this.fboCache.acquire(o,h,"highlight coverage",n.length>G?3:1);return r.coverage=l,i.bindFramebuffer(l.fbo),i.bindTechnique(e,this.bindParameters,this._passParameters,this._downsampleDrawParameters),i.setViewport(0,0,o,h),i.screen.draw(),r}get test(){}};e([o()],q.prototype,"produces",void 0),e([o()],q.prototype,"consumes",void 0),q=e([h("esri.views.3d.webgl-engine.effects.highlight.Highlight")],q);class P{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}function O(e){const t=new Uint8Array(128);let i=0;for(const r of e){const e=4*i,s=4*i+64;++i;const{color:o}=r,h=r.haloColor??o;t[e+0]=o.r,t[e+1]=o.g,t[e+2]=o.b,t[e+3]=r.fillOpacity*o.a*255,t[s+0]=h.r,t[s+1]=h.g,t[s+2]=h.b,t[s+3]=r.haloOpacity*h.a*255}return t}let D=0;function y(e){let t=0;for(const r of e){const{name:e}=r;t+=e.length;const{color:i,fillOpacity:s,haloColor:o,haloOpacity:h}=r;t+=i.r+i.g+i.b+i.a+s,t+=o?o.r+o.g+o.b+o.a+h:0}const i=e.at(0);if(i){const{shadowOpacity:e,shadowDifference:r,shadowColor:s}=i;t+=e+r+s.r+s.g+s.b+s.a}return D+++(t>=0?0:1)}const I=new Uint8Array([0,1,2,2,1,3]);function S(e,t,i,r,s,o=0){const{highlights:h}=r,l=h.length>1?t.acquire(i.width,i.height,"highlight mix",h.length>G?3:1):null,{gl:a}=e;if(l){const t=e.getBoundFramebufferObject();e.bindFramebuffer(l.fbo),a.clearBufferuiv(a.COLOR,0,[0,0,0,0]),e.bindFramebuffer(t)}const g=l?.getTexture();r.highlightMixTexture=g,n(r.highlightMixOrigin,o,0),h.forEach((t,h)=>{if(h>0){const t=C.TEXTURE_UNIT_FOR_UPDATES;e.bindTexture(g,t),e.setActiveTexture(t),a.copyTexSubImage2D(3553,0,0,0,o,0,i.width,i.height),e.bindTexture(null,t)}e.clear(256),r.highlightLevel=h,s()}),r.highlightLevel=null,r.highlightMixTexture=null,l?.release()}const G=4;export{q as Highlight,G as maxHighlightsPerChannel,S as renderHighlightBuffer,y as trackHighlightOptions};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import"../../core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js";import"../../core/shaderLibrary/HighlightReadBitmap.glsl.js";import"../../core/shaderModules/Float2DrawUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/IntegerPassUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../core/shaderModules/Texture2DUintPassUniform.js";import"../../../../../chunks/HighlightDownsample.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../chunks/HighlightApply.glsl.js";