@arcgis/core 6.0.0-next.42 → 6.0.0-next.43

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 (489) hide show
  1. package/Basemap.js +1 -1
  2. package/Graphic.js +1 -1
  3. package/Ground.js +1 -1
  4. package/WebDocument2D.js +1 -1
  5. package/WebScene.js +1 -1
  6. package/analysis/ElevationProfile/ElevationProfileLineScene.d.ts +1 -0
  7. package/analysis/ElevationProfileAnalysis.d.ts +15 -0
  8. package/analysis/LineOfSightAnalysis.d.ts +6 -1
  9. package/analysis/ShadowCastAnalysis.d.ts +18 -22
  10. package/analysis/ShadowCastAnalysis.js +1 -1
  11. package/analysis/ViewshedAnalysis.d.ts +6 -1
  12. package/applications/Components/analysisUtils.d.ts +6 -0
  13. package/applications/Components/analysisUtils.js +1 -1
  14. package/arcade/ArcadeModuleResolver.js +1 -1
  15. package/arcade/arcadeCompiler.js +1 -1
  16. package/arcade/featureset/actions/Adapted.js +1 -1
  17. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  18. package/arcade/featureset/support/FeatureSet.js +1 -1
  19. package/arcade/featureset/support/shared.js +1 -1
  20. package/arcade/featureset/support/sqlUtils.js +1 -1
  21. package/arcade/functions/knowledgegraph.js +1 -1
  22. package/arcade/functions/maths.js +1 -1
  23. package/assets/esri/core/workers/RemoteClient.js +1 -1
  24. package/assets/esri/core/workers/chunks/{2f54e4feb554c1a7b9c4.js → 02debe67e6fef9d88bdd.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{bd046399e05e759e0bc2.js → 035204000954973b0ebc.js} +1 -1
  26. package/assets/esri/core/workers/chunks/05225506fdba0c827407.js +1 -0
  27. package/assets/esri/core/workers/chunks/{4c73c493dabe949c2512.js → 077b755688346e0dc8d3.js} +1 -1
  28. package/assets/esri/core/workers/chunks/0c1d8e0c2eae21f97fc0.js +1 -0
  29. package/assets/esri/core/workers/chunks/105865a4d8cb4ddf8a8a.js +1 -0
  30. package/assets/esri/core/workers/chunks/{afe3e89737fb45189a99.js → 14ed0c34b910eba3434e.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{f67b37253d6d05d1e339.js → 14ef986665b4a1f6ccdc.js} +1 -1
  32. package/assets/esri/core/workers/chunks/158cbf4075d3eca83a6a.js +1 -0
  33. package/assets/esri/core/workers/chunks/{a03f15f2cbc3fed291c2.js → 15f2b27b8edc0d53e399.js} +1 -1
  34. package/assets/esri/core/workers/chunks/181d24ced5ef6b1f959b.js +1 -0
  35. package/assets/esri/core/workers/chunks/18dbee576b7b9dbe69fb.js +1 -0
  36. package/assets/esri/core/workers/chunks/1aebb8fe0692058bf2fb.js +1 -0
  37. package/assets/esri/core/workers/chunks/1cdb55d9a5ab1a5e3f08.js +1 -0
  38. package/assets/esri/core/workers/chunks/{cf2e5f827cea7d7319ce.js → 1e5c5029b0653047a769.js} +1 -1
  39. package/assets/esri/core/workers/chunks/20db6e844708d3e71437.js +1 -0
  40. package/assets/esri/core/workers/chunks/21a4c3d8265aca775616.js +1 -0
  41. package/assets/esri/core/workers/chunks/23fff0505e02fd364909.js +1 -0
  42. package/assets/esri/core/workers/chunks/286e3e050b29e6158e6f.js +1 -0
  43. package/assets/esri/core/workers/chunks/29ef9d357e30082d267a.js +1 -0
  44. package/assets/esri/core/workers/chunks/29feef121b0916fb90bf.js +1 -0
  45. package/assets/esri/core/workers/chunks/2ef91e8da260454f46d8.js +1 -0
  46. package/assets/esri/core/workers/chunks/32b9bedd4bb0504f0b1d.js +1 -0
  47. package/assets/esri/core/workers/chunks/{279089a6a3f08022c678.js → 361d620b3f91868b1490.js} +1 -1
  48. package/assets/esri/core/workers/chunks/37c16e20f022ca27cdae.js +1 -0
  49. package/assets/esri/core/workers/chunks/380aefa522dfeccb8c65.js +1 -0
  50. package/assets/esri/core/workers/chunks/394ae3199c78a94c6a2a.js +1 -0
  51. package/assets/esri/core/workers/chunks/{fdd2b35388f9fe42b623.js → 3a90b6eafa92f1a68ac5.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{6a65fc1a2931230fe994.js → 3bb1e06861cd0563ed9f.js} +1 -1
  53. package/assets/esri/core/workers/chunks/3f92afa58c895bf87e62.js +1 -0
  54. package/assets/esri/core/workers/chunks/422784ceae0d511868a0.js +1 -0
  55. package/assets/esri/core/workers/chunks/44782e8318dc47cb08a0.js +1 -0
  56. package/assets/esri/core/workers/chunks/{5882f349f3771868e67f.js → 4521f72ab0ea872e5d7c.js} +1 -1
  57. package/assets/esri/core/workers/chunks/45b5a61c4e9fbd9ca0b3.js +1 -0
  58. package/assets/esri/core/workers/chunks/47af220003adfca2167e.js +1 -0
  59. package/assets/esri/core/workers/chunks/487500443a6037d3599f.js +1 -0
  60. package/assets/esri/core/workers/chunks/4a4fab74442c3d914505.js +1 -0
  61. package/assets/esri/core/workers/chunks/4a8903fb1a5d30a68df9.js +1 -0
  62. package/assets/esri/core/workers/chunks/4d818b231e6d1fa73cc5.js +1 -0
  63. package/assets/esri/core/workers/chunks/{e0cf6e1e21d0ee739009.js → 4e03aa5518d46a36661c.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{1a614bac5db42c6263f8.js → 4fe10650ba3cd30aa9a2.js} +1 -1
  65. package/assets/esri/core/workers/chunks/50b8b1cce0a5f77c8372.js +1 -0
  66. package/assets/esri/core/workers/chunks/5470a29a69010c8361c4.js +1 -0
  67. package/assets/esri/core/workers/chunks/564d7f2e58fbc16853c0.js +1 -0
  68. package/assets/esri/core/workers/chunks/5c2e79f2ca401741bf3e.js +1 -0
  69. package/assets/esri/core/workers/chunks/5c9ab86bec07264dc9f2.js +1 -0
  70. package/assets/esri/core/workers/chunks/{04d55ed51e8b2683c4b4.js → 5d908a823b324bafda1e.js} +1 -1
  71. package/assets/esri/core/workers/chunks/5e6d6676a5c47c0e132a.js +1 -0
  72. package/assets/esri/core/workers/chunks/5fd4d3cb3c9350131a59.js +1 -0
  73. package/assets/esri/core/workers/chunks/60637f38159e9bf68d4e.js +1 -0
  74. package/assets/esri/core/workers/chunks/69b73251257088ce7099.js +1 -0
  75. package/assets/esri/core/workers/chunks/6cd17c3a254a0b5c2476.js +1 -0
  76. package/assets/esri/core/workers/chunks/{06102715e9a8f218e07c.js → 6f3732e7ba2d031ba789.js} +1 -1
  77. package/assets/esri/core/workers/chunks/7191ab31fa040a7c561e.js +1 -0
  78. package/assets/esri/core/workers/chunks/71ba848c3352ea3ff96f.js +1 -0
  79. package/assets/esri/core/workers/chunks/76dc8e3264a456f33e61.js +1 -0
  80. package/assets/esri/core/workers/chunks/77d80b6d65d761214a7c.js +1 -0
  81. package/assets/esri/core/workers/chunks/{e2430bc3a1edeb5c3266.js → 78a69594c82d37aecbfb.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{787c1a8bda7d745633f2.js → 81b9894e81cce3490984.js} +1 -1
  83. package/assets/esri/core/workers/chunks/85cd525705eec6803dd3.js +1 -0
  84. package/assets/esri/core/workers/chunks/863f04cacdc843d3f208.js +1 -0
  85. package/assets/esri/core/workers/chunks/8766832c7253557da8fe.js +1 -0
  86. package/assets/esri/core/workers/chunks/87992070008812f8ae6f.js +1 -0
  87. package/assets/esri/core/workers/chunks/892fd2c3533ce46a9258.js +1 -0
  88. package/assets/esri/core/workers/chunks/89b9d716d96135d4f057.js +1 -0
  89. package/assets/esri/core/workers/chunks/{4b2d392ad8e381bfd6b3.js → 89e9ebc8d5c1022cb265.js} +1 -1
  90. package/assets/esri/core/workers/chunks/8b38798ac6d774185238.js +1 -0
  91. package/assets/esri/core/workers/chunks/8b53369cace136ed1329.js +1 -0
  92. package/assets/esri/core/workers/chunks/8ba4f5e1912edf397947.js +1 -0
  93. package/assets/esri/core/workers/chunks/{987424121cf30b0f3c50.js → 8d3e92a3367a3ddc02bd.js} +1 -1
  94. package/assets/esri/core/workers/chunks/8e7a3b1b088c160f4db7.js +1 -0
  95. package/assets/esri/core/workers/chunks/8f4fba4d2339c91c8b3f.js +1 -0
  96. package/assets/esri/core/workers/chunks/{45aaefbdffe5e15dfb24.js → 919a6aedf38e9631ee09.js} +1 -1
  97. package/assets/esri/core/workers/chunks/{487c46d5245cfb35c4bb.js → 921917e53bac82693ec8.js} +1 -1
  98. package/assets/esri/core/workers/chunks/92809b209b68abcb97ee.js +1 -0
  99. package/assets/esri/core/workers/chunks/{beccbfff549902733c4e.js → 9869c696e6321c8db0a9.js} +1 -1
  100. package/assets/esri/core/workers/chunks/98957dba728c93506e50.js +1 -0
  101. package/assets/esri/core/workers/chunks/99ffb839407cb3c26ad8.js +1 -0
  102. package/assets/esri/core/workers/chunks/9b517c8d26a86dedb921.js +1 -0
  103. package/assets/esri/core/workers/chunks/{cb2329d1ea72ce5cc057.js → 9c3f56f22e9baa80a387.js} +1 -1
  104. package/assets/esri/core/workers/chunks/{1860104c2b33f68785dd.js → 9d0976f5979c4f9154dc.js} +1 -1
  105. package/assets/esri/core/workers/chunks/9fe1812aad6e566aea31.js +1 -0
  106. package/assets/esri/core/workers/chunks/a1602995ef96beb7df29.js +1 -0
  107. package/assets/esri/core/workers/chunks/{dff845574c0037a1dca6.js → a332e31165b65a6fb92e.js} +1 -1
  108. package/assets/esri/core/workers/chunks/a553478664a688f32488.js +1 -0
  109. package/assets/esri/core/workers/chunks/a7937b06f4b0860c7671.js +1 -0
  110. package/assets/esri/core/workers/chunks/{1980fd7ae1617ef4d19d.js → a95186214f1206efd8ed.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{853563c66ecf58d53d36.js → ab60e8fbe0f92340616a.js} +1 -1
  112. package/assets/esri/core/workers/chunks/acea0946049136578354.js +1 -0
  113. package/assets/esri/core/workers/chunks/{342a97974a78007b25e0.js → ad94f54b4c88b3a047bc.js} +1 -1
  114. package/assets/esri/core/workers/chunks/ae29fec228e70a93ced1.js +1 -0
  115. package/assets/esri/core/workers/chunks/ae6dc159be974ca0e8da.js +1 -0
  116. package/assets/esri/core/workers/chunks/ae70972bf88d586fd453.js +1 -0
  117. package/assets/esri/core/workers/chunks/b021fa4654ede1d04279.js +1 -0
  118. package/assets/esri/core/workers/chunks/b03f32f02858244c6cd0.js +1 -0
  119. package/assets/esri/core/workers/chunks/b2d922ecc2c4899dbee1.js +1 -0
  120. package/assets/esri/core/workers/chunks/b42e50ec6b819f669400.js +1 -0
  121. package/assets/esri/core/workers/chunks/b6a82775b83d20599635.js +1 -0
  122. package/assets/esri/core/workers/chunks/b6d365b9198b74b05338.js +1 -0
  123. package/assets/esri/core/workers/chunks/{48c6230b8a6d3a8a7906.js → bc21241bc9acb83d1b1c.js} +1 -1
  124. package/assets/esri/core/workers/chunks/bd02d927b0b4991b61c5.js +1 -0
  125. package/assets/esri/core/workers/chunks/bdf1c4c038d556527483.js +1 -0
  126. package/assets/esri/core/workers/chunks/c1273f14a5ef3d81de0d.js +1 -0
  127. package/assets/esri/core/workers/chunks/c752f1e732bb019f657d.js +1 -0
  128. package/assets/esri/core/workers/chunks/{3f74c61359b4bd6dcf00.js → c7f49493bd548d5dc1e0.js} +1 -1
  129. package/assets/esri/core/workers/chunks/{36bafcc29ac133a05558.js → c86d3af148b28ded5875.js} +10 -10
  130. package/assets/esri/core/workers/chunks/{692f0093c444fcc752b5.js → cadd60fa4370284c7ae3.js} +1 -1
  131. package/assets/esri/core/workers/chunks/{d5e251cddd41d643510c.js → cb62326b6526cde429c1.js} +1 -1
  132. package/assets/esri/core/workers/chunks/cd8304b1db83d48c57db.js +1 -0
  133. package/assets/esri/core/workers/chunks/cdf0c7706d3e1221f49b.js +1 -0
  134. package/assets/esri/core/workers/chunks/d00dd961a5b79f563123.js +1 -0
  135. package/assets/esri/core/workers/chunks/d893c3bb093104d3db95.js +1 -0
  136. package/assets/esri/core/workers/chunks/d8fb1d9da16492574a11.js +1 -0
  137. package/assets/esri/core/workers/chunks/{520f499d79fa71f262c7.js → dd7e4c94a88452425750.js} +1 -1
  138. package/assets/esri/core/workers/chunks/ddb4689624d091922471.js +1 -0
  139. package/assets/esri/core/workers/chunks/df32a3fe81d60f0d7462.js +1 -0
  140. package/assets/esri/core/workers/chunks/dfc6b33f51dc81f3a7be.js +1 -0
  141. package/assets/esri/core/workers/chunks/e55934eb4a17a5b24c94.js +1 -0
  142. package/assets/esri/core/workers/chunks/{5473409fee59db80f87d.js → e5bdfef7c2cc5354be52.js} +1 -1
  143. package/assets/esri/core/workers/chunks/e8cdec961e9cff1cb73b.js +1 -0
  144. package/assets/esri/core/workers/chunks/{446d172834f8675f1202.js → eaf720dfdf6ceca31249.js} +1 -1
  145. package/assets/esri/core/workers/chunks/ef274db3fa260eadf371.js +1 -0
  146. package/assets/esri/core/workers/chunks/efca82a4dc494f57380b.js +1 -0
  147. package/assets/esri/core/workers/chunks/f05990e6fb378e2e1a3b.js +1 -0
  148. package/assets/esri/core/workers/chunks/f0fc89cdf50a40913c02.js +1 -0
  149. package/assets/esri/core/workers/chunks/{8b5dcc4282772bf6b675.js → f11eaab5354cc6aa9569.js} +1 -1
  150. package/assets/esri/core/workers/chunks/f1c2f7c7ce4bd4096eb0.js +1 -0
  151. package/assets/esri/core/workers/chunks/f4e63c5f82b8c2bbfacb.js +1 -0
  152. package/assets/esri/core/workers/chunks/f86ff791a10c802879ec.js +1 -0
  153. package/assets/esri/core/workers/chunks/{7452b5ae971a9ff2e6e9.js → fdffefd7de540272a8a6.js} +1 -1
  154. package/assets/esri/core/workers/chunks/fe0248af95d3f37e099e.js +1 -0
  155. package/chunks/languageUtils.js +1 -1
  156. package/config.js +1 -1
  157. package/core/Accessor.js +1 -1
  158. package/core/Collection.js +1 -1
  159. package/core/LRUCache.js +1 -1
  160. package/core/MapUtils.js +1 -1
  161. package/core/Version.js +1 -1
  162. package/core/asyncUtils.js +1 -1
  163. package/core/fontUtils.js +1 -1
  164. package/core/has.js +1 -1
  165. package/core/sql/SqlInterval.js +1 -1
  166. package/core/sql/WhereClause.js +1 -1
  167. package/core/sql/writeUtils.js +1 -1
  168. package/core/sql.js +1 -1
  169. package/core/urlUtils.js +1 -1
  170. package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
  171. package/editing/sharedTemplates/executor/builders/polygonBoundary.js +1 -1
  172. package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
  173. package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
  174. package/geometry/Point.js +1 -1
  175. package/geometry/Polygon.js +1 -1
  176. package/geometry/SpatialReference.js +1 -1
  177. package/geometry/support/webMercatorUtils.js +1 -1
  178. package/kernel.js +1 -1
  179. package/layers/FeatureLayer.js +1 -1
  180. package/layers/GeoJSONLayer.d.ts +5 -1
  181. package/layers/GeospatialPDFLayer.js +1 -1
  182. package/layers/KnowledgeGraphLayer.js +1 -1
  183. package/layers/LineOfSightLayer.d.ts +6 -1
  184. package/layers/LinkChartLayer.js +1 -1
  185. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  186. package/layers/SubtypeGroupLayer.js +1 -1
  187. package/layers/TileLayer.js +1 -1
  188. package/layers/VectorTileLayer.d.ts +53 -0
  189. package/layers/VectorTileLayer.js +1 -1
  190. package/layers/VideoLayer.js +1 -1
  191. package/layers/ViewshedLayer.d.ts +6 -1
  192. package/layers/VoxelLayer.js +1 -1
  193. package/layers/effects/jsonUtils.js +1 -1
  194. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
  195. package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
  196. package/layers/graphics/data/QueryEngineResult.js +1 -1
  197. package/layers/graphics/data/projectionSupport.js +1 -1
  198. package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
  199. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  200. package/layers/graphics/sources/geojson/geojson.js +1 -1
  201. package/layers/graphics/sources/parquet/FileProvider.js +1 -1
  202. package/layers/graphics/sources/support/QueryTask.js +1 -1
  203. package/layers/graphics/sources/support/uploads.js +1 -1
  204. package/layers/knowledgeGraph/cypherUtils.js +1 -1
  205. package/layers/mixins/refresh.js +1 -1
  206. package/layers/ogc/ogcFeatureUtils.js +1 -1
  207. package/layers/ogc/wfsUtils.js +1 -1
  208. package/layers/parquet.js +1 -1
  209. package/layers/raster/datasets/BaseRaster.js +1 -1
  210. package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
  211. package/layers/raster/datasets/TIFFRaster.js +1 -1
  212. package/layers/raster/datasets/wcsCoverageParser.js +1 -1
  213. package/layers/raster/formats/Lerc.js +1 -1
  214. package/layers/support/ClientSideConnection.js +1 -1
  215. package/layers/support/ElevationSampler.js +1 -1
  216. package/layers/support/MultidimensionalSubset.js +1 -1
  217. package/layers/support/SpriteSource.js +1 -1
  218. package/layers/support/TileInfo.js +1 -1
  219. package/layers/support/fieldUtils.js +1 -1
  220. package/layers/support/infoFor3D.js +1 -1
  221. package/layers/support/vectorTileLayerLoader.js +1 -1
  222. package/layers/support/wmsUtils.js +1 -1
  223. package/layers/support/wmtsUtils.js +1 -1
  224. package/layers/video/videoUtils.js +1 -1
  225. package/libs/lyr3d/Lyr3DModule.js +1 -1
  226. package/linkChart/utils.js +1 -1
  227. package/networks/support/Circuit.js +1 -1
  228. package/networks/support/CircuitSection.js +1 -1
  229. package/package.json +2 -2
  230. package/portal/Portal.js +1 -1
  231. package/portal/PortalItemResource.js +1 -1
  232. package/portal/PortalQueryParams.js +1 -1
  233. package/renderers/HeatmapRenderer.js +1 -1
  234. package/renderers/UniqueValueRenderer.js +1 -1
  235. package/rest/knowledgeGraphService.js +1 -1
  236. package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
  237. package/rest/query/operations/queryAttachments.js +1 -1
  238. package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
  239. package/symbols/cim/types.d.ts +15 -11
  240. package/symbols/support/previewSymbol3D.js +1 -1
  241. package/tables/support/templateUtils.js +1 -1
  242. package/views/2d/engine/vectorTiles/SourceLayerData.js +1 -1
  243. package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
  244. package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
  245. package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
  246. package/views/2d/engine/vectorTiles/TileManager.js +1 -1
  247. package/views/2d/engine/vectorTiles/TileParser.js +1 -1
  248. package/views/2d/engine/vectorTiles/VectorTileFeatureIndex.js +1 -1
  249. package/views/2d/engine/vectorTiles/VectorTileSourceData.js +2 -0
  250. package/views/2d/engine/vectorTiles/WorkerTile.js +1 -1
  251. package/views/2d/engine/vectorTiles/WorkerTileHandler.js +1 -1
  252. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
  253. package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
  254. package/views/2d/engine/vectorTiles/style/Filter.js +1 -1
  255. package/views/2d/engine/vectorTiles/style/GeoJSONVectorTileSourceWorker.js +1 -1
  256. package/views/2d/engine/vectorTiles/style/StyleProperty.js +1 -1
  257. package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
  258. package/views/2d/engine/webgl/mesh/factories/MeshWriterGroupCoordinator.js +1 -1
  259. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +4 -4
  260. package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
  261. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  262. package/views/2d/layers/features/Processor.js +1 -1
  263. package/views/2d/layers/features/support/TileStore.js +1 -1
  264. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  265. package/views/2d/tiling/TileKey.js +1 -1
  266. package/views/2d/tiling/TileStrategy.js +1 -1
  267. package/views/3d/analysis/Dimension/LengthDimensionComputation.js +1 -1
  268. package/views/3d/analysis/LineOfSight/LineOfSightManipulators.js +1 -1
  269. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  270. package/views/3d/analysis/images/generateTextures.js +1 -1
  271. package/views/3d/environment/EnvironmentView.js +1 -1
  272. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  273. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  274. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  275. package/views/3d/layers/I3SMeshView3D.js +1 -1
  276. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  277. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  278. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  279. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  280. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  281. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  282. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  283. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  284. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  285. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  286. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  287. package/views/3d/layers/graphics/MeshFastUpdateProcessor.js +1 -1
  288. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  289. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  290. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  291. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  292. package/views/3d/layers/i3s/I3SAsyncElevationUpdater.js +1 -1
  293. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  294. package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
  295. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  296. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  297. package/views/3d/state/ConstraintsManager.js +1 -1
  298. package/views/3d/state/controllers/GroundNavigationController.js +1 -1
  299. package/views/3d/support/QualityProfile.js +1 -1
  300. package/views/3d/support/TextureCollection.js +1 -1
  301. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  302. package/views/3d/terrain/TerrainRenderer.js +1 -1
  303. package/views/3d/terrain/Tile.js +1 -1
  304. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  305. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  306. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  307. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  308. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechniqueConfiguration.js +1 -1
  309. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  310. package/views/3d/webgl-engine/lib/CutFill.js +1 -1
  311. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  312. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  313. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  314. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  315. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  316. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  317. package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
  318. package/views/3d/webgl-engine/materials/intersectWithPolygonOffset.js +1 -1
  319. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  320. package/views/SceneView.js +1 -1
  321. package/views/SelectionManager.js +1 -1
  322. package/views/analysis/ElevationProfile/ElevationProfileChart.js +2 -2
  323. package/views/analysis/ElevationProfile/elevationProfileChartBoundsUtils.js +1 -1
  324. package/views/draw/DrawAction.js +1 -1
  325. package/views/draw/support/PluginContext.js +1 -1
  326. package/views/interactive/sketch/normalizedPoint.js +1 -1
  327. package/views/interactive/tooltip/fields/TooltipFieldElevation.js +1 -1
  328. package/views/interactive/tooltip/fields/TooltipFieldOrientation.js +1 -1
  329. package/views/interactive/tooltip/fields/TooltipFieldSize.js +1 -1
  330. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  331. package/widgets/Attachments.js +1 -1
  332. package/widgets/Attribution/AttributionViewModel.js +1 -1
  333. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  334. package/widgets/BasemapLayerList/BasemapLayerListViewModel.js +1 -1
  335. package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
  336. package/widgets/BatchAttributeForm/ReactiveContingentValuesManager.js +1 -1
  337. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  338. package/widgets/BatchAttributeForm.js +1 -1
  339. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  340. package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
  341. package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.js +1 -1
  342. package/widgets/CatalogLayerList/CatalogLayerListViewModel.js +1 -1
  343. package/widgets/CatalogLayerList.js +1 -1
  344. package/widgets/Compass/CompassViewModel.js +1 -1
  345. package/widgets/CoordinateConversion/support/Format.js +1 -1
  346. package/widgets/CoordinateConversion/support/formatUtils.js +1 -1
  347. package/widgets/Daylight/DaylightViewModel.js +1 -1
  348. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  349. package/widgets/Editor/support/SketchController.js +1 -1
  350. package/widgets/ElevationProfile/ElevationProfileLine.js +1 -1
  351. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  352. package/widgets/Expand/ExpandViewModel.js +1 -1
  353. package/widgets/Expand.js +1 -1
  354. package/widgets/Feature/FeatureMedia.js +1 -1
  355. package/widgets/Feature/FeatureViewModel.js +1 -1
  356. package/widgets/Feature.js +1 -1
  357. package/widgets/FeatureForm.js +1 -1
  358. package/widgets/FeatureTemplates.js +1 -1
  359. package/widgets/Features/FeaturesViewModel.js +1 -1
  360. package/widgets/Features.js +1 -1
  361. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  362. package/widgets/Fullscreen/FullscreenViewModel.js +1 -1
  363. package/widgets/Histogram/HistogramViewModel.js +1 -1
  364. package/widgets/Histogram.js +1 -1
  365. package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.js +1 -1
  366. package/widgets/Home/HomeViewModel.js +1 -1
  367. package/widgets/LayerList/LayerListViewModel.js +1 -1
  368. package/widgets/Legend/LegendViewModel.js +1 -1
  369. package/widgets/Legend/styles/card/CardView.js +1 -1
  370. package/widgets/Legend/styles/classic/ClassicView.js +1 -1
  371. package/widgets/Locate/LocateViewModel.js +1 -1
  372. package/widgets/Locate.js +1 -1
  373. package/widgets/NavigationToggle/NavigationToggleViewModel.js +1 -1
  374. package/widgets/NavigationToggle.js +1 -1
  375. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  376. package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
  377. package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
  378. package/widgets/OrientedImageryViewer/support/urlUtils.js +1 -1
  379. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  380. package/widgets/Search.js +1 -1
  381. package/widgets/ShadowCast/DiscreteOptions.js +1 -1
  382. package/widgets/ShadowCast/DurationOptions.js +1 -1
  383. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  384. package/widgets/ShadowCast/ThresholdOptions.js +1 -1
  385. package/widgets/Sketch.js +1 -1
  386. package/widgets/Slider/SliderViewModel.js +1 -1
  387. package/widgets/Slider.js +1 -1
  388. package/widgets/TableList/TableListViewModel.js +1 -1
  389. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  390. package/widgets/Weather/WeatherViewModel.js +1 -1
  391. package/widgets/Widget.js +1 -1
  392. package/widgets/Zoom/ZoomViewModel.js +1 -1
  393. package/widgets/support/AnalysisViewModelMixin.js +1 -1
  394. package/widgets/support/GridControls.js +1 -1
  395. package/widgets/support/dateUtils.js +1 -1
  396. package/assets/esri/core/workers/chunks/00d43f02119167531d1b.js +0 -1
  397. package/assets/esri/core/workers/chunks/0696fa44a04b99738d7b.js +0 -1
  398. package/assets/esri/core/workers/chunks/091ec4fe83038f3558f4.js +0 -1
  399. package/assets/esri/core/workers/chunks/098ac10877d92fde1006.js +0 -1
  400. package/assets/esri/core/workers/chunks/0a29d87b6e58a3c6df8f.js +0 -1
  401. package/assets/esri/core/workers/chunks/0d04353843ccb7440342.js +0 -1
  402. package/assets/esri/core/workers/chunks/0d87cb6417672de95d53.js +0 -1
  403. package/assets/esri/core/workers/chunks/1132e28aaa5825b10b6e.js +0 -1
  404. package/assets/esri/core/workers/chunks/1380cec385426673f294.js +0 -1
  405. package/assets/esri/core/workers/chunks/1b24a40c0fa197014873.js +0 -1
  406. package/assets/esri/core/workers/chunks/1c7096eb48a3a7f27d4f.js +0 -1
  407. package/assets/esri/core/workers/chunks/1cc03067f8405285057c.js +0 -1
  408. package/assets/esri/core/workers/chunks/1f76f6dcdae9f55389cb.js +0 -1
  409. package/assets/esri/core/workers/chunks/21e1d423ee33f916547e.js +0 -1
  410. package/assets/esri/core/workers/chunks/247617c0dbae2386ab3b.js +0 -1
  411. package/assets/esri/core/workers/chunks/25657f70c5f04a4ed978.js +0 -1
  412. package/assets/esri/core/workers/chunks/2690d5fcd9d5ca92ebf6.js +0 -1
  413. package/assets/esri/core/workers/chunks/2853606099602f73d379.js +0 -1
  414. package/assets/esri/core/workers/chunks/28ed020d9995b6577be5.js +0 -1
  415. package/assets/esri/core/workers/chunks/2b27d3bc492e000bbe58.js +0 -1
  416. package/assets/esri/core/workers/chunks/2d64a13c2303e9cae613.js +0 -1
  417. package/assets/esri/core/workers/chunks/36e5f070009b29b7ac3d.js +0 -1
  418. package/assets/esri/core/workers/chunks/3b5e9e0b180dc10491ec.js +0 -1
  419. package/assets/esri/core/workers/chunks/46edd6c9ed6701e6b975.js +0 -1
  420. package/assets/esri/core/workers/chunks/4e17665dd9048c300d87.js +0 -1
  421. package/assets/esri/core/workers/chunks/4e4f747de424941a0bfa.js +0 -1
  422. package/assets/esri/core/workers/chunks/4e8e322b469657ac22e2.js +0 -1
  423. package/assets/esri/core/workers/chunks/5396b6e99a0546a25d19.js +0 -1
  424. package/assets/esri/core/workers/chunks/553a8bf5bc5c56d1bcaf.js +0 -1
  425. package/assets/esri/core/workers/chunks/55c0c074e4afe05f5d4d.js +0 -1
  426. package/assets/esri/core/workers/chunks/5bfb962ca192f90a2724.js +0 -1
  427. package/assets/esri/core/workers/chunks/60c8eedd06080edab3e3.js +0 -1
  428. package/assets/esri/core/workers/chunks/61d36730564c5ac5edab.js +0 -1
  429. package/assets/esri/core/workers/chunks/6588725275c75fae0d9c.js +0 -1
  430. package/assets/esri/core/workers/chunks/661c6324529dd17b297e.js +0 -1
  431. package/assets/esri/core/workers/chunks/6699fac01ccd842851ba.js +0 -1
  432. package/assets/esri/core/workers/chunks/672a5390182b20d632be.js +0 -1
  433. package/assets/esri/core/workers/chunks/67caef2ecf0dc5f2eed3.js +0 -1
  434. package/assets/esri/core/workers/chunks/68dd1fd2025c7125ead1.js +0 -1
  435. package/assets/esri/core/workers/chunks/68fd7b314377d27aaa54.js +0 -1
  436. package/assets/esri/core/workers/chunks/69627b2634da64dd885f.js +0 -1
  437. package/assets/esri/core/workers/chunks/6f2e7e663229b223b4df.js +0 -1
  438. package/assets/esri/core/workers/chunks/7390af96250e89194332.js +0 -1
  439. package/assets/esri/core/workers/chunks/7b45ac83e279fe9516a5.js +0 -1
  440. package/assets/esri/core/workers/chunks/7e0ed6e8f7b77e43f628.js +0 -1
  441. package/assets/esri/core/workers/chunks/832c887fdc5af4c08cf2.js +0 -1
  442. package/assets/esri/core/workers/chunks/84fb27e3425515cd0e3f.js +0 -1
  443. package/assets/esri/core/workers/chunks/8502274806ea52308822.js +0 -1
  444. package/assets/esri/core/workers/chunks/867502158997cb2d6406.js +0 -1
  445. package/assets/esri/core/workers/chunks/8ceb6697e8adbeffe019.js +0 -1
  446. package/assets/esri/core/workers/chunks/8e391b5b82429f39791e.js +0 -1
  447. package/assets/esri/core/workers/chunks/8e6276ddd8d094c61f08.js +0 -1
  448. package/assets/esri/core/workers/chunks/8fe22c2370219f25c15b.js +0 -1
  449. package/assets/esri/core/workers/chunks/90d797ab82d4a68ba32f.js +0 -1
  450. package/assets/esri/core/workers/chunks/91586bf29492735e692d.js +0 -1
  451. package/assets/esri/core/workers/chunks/96f87c8efd4b11b37686.js +0 -1
  452. package/assets/esri/core/workers/chunks/9826baa3c15ea2062669.js +0 -1
  453. package/assets/esri/core/workers/chunks/9c3de54513bf8619271c.js +0 -1
  454. package/assets/esri/core/workers/chunks/a125650edbed802e419a.js +0 -1
  455. package/assets/esri/core/workers/chunks/a18c3cbe505a19d29569.js +0 -1
  456. package/assets/esri/core/workers/chunks/a422a801e55fa125546e.js +0 -1
  457. package/assets/esri/core/workers/chunks/a5f17e9a025ac2b6e1bf.js +0 -1
  458. package/assets/esri/core/workers/chunks/a6e846361bf5dd3a11c7.js +0 -1
  459. package/assets/esri/core/workers/chunks/a91dc05a6a609d04ed04.js +0 -1
  460. package/assets/esri/core/workers/chunks/a99c50b4e1c7568210e1.js +0 -1
  461. package/assets/esri/core/workers/chunks/ab48faea5432e2dbd45c.js +0 -1
  462. package/assets/esri/core/workers/chunks/ac107079342251a984dd.js +0 -1
  463. package/assets/esri/core/workers/chunks/acf4737ba509cbd73cce.js +0 -1
  464. package/assets/esri/core/workers/chunks/b7205620ca248f4efc88.js +0 -1
  465. package/assets/esri/core/workers/chunks/bbddeb1c893ff8bbae5d.js +0 -1
  466. package/assets/esri/core/workers/chunks/bc2e2bdf1194e6e9eb5e.js +0 -1
  467. package/assets/esri/core/workers/chunks/c0eb27263f608dc3684b.js +0 -1
  468. package/assets/esri/core/workers/chunks/c3ba1a3247e14f6b7b3a.js +0 -1
  469. package/assets/esri/core/workers/chunks/c5d0a034ff31d5954571.js +0 -1
  470. package/assets/esri/core/workers/chunks/c8057b47c7c6c02a0bda.js +0 -1
  471. package/assets/esri/core/workers/chunks/ca21786e519c914fc9e1.js +0 -1
  472. package/assets/esri/core/workers/chunks/cd46d9b4a8de644e7332.js +0 -1
  473. package/assets/esri/core/workers/chunks/d4c8673ca65df874a7ce.js +0 -1
  474. package/assets/esri/core/workers/chunks/da1e6962ba0c85c37953.js +0 -1
  475. package/assets/esri/core/workers/chunks/dcdf837a452dc0cac582.js +0 -1
  476. package/assets/esri/core/workers/chunks/e0864ca82ffa3c9a0776.js +0 -1
  477. package/assets/esri/core/workers/chunks/e69cd62f824ce7a22fa0.js +0 -1
  478. package/assets/esri/core/workers/chunks/e9457a67befc61e11095.js +0 -1
  479. package/assets/esri/core/workers/chunks/f190a3124d6d03417d73.js +0 -1
  480. package/assets/esri/core/workers/chunks/f4135779bfdaf349352a.js +0 -1
  481. package/assets/esri/core/workers/chunks/f6bd7b52745b82ba73dc.js +0 -1
  482. package/assets/esri/core/workers/chunks/fbe3a3b9d6c8c0b52f65.js +0 -1
  483. package/assets/esri/core/workers/chunks/fc77eb7683e708774168.js +0 -1
  484. package/assets/esri/core/workers/chunks/fe7184993ef5713d13fb.js +0 -1
  485. package/assets/esri/core/workers/chunks/fecaf0bc28aeea4d15db.js +0 -1
  486. package/views/2d/engine/vectorTiles/style/VectorTilePbfWriter.js +0 -2
  487. package/views/2d/engine/vectorTiles/style/encodeVectorTileFeatures.js +0 -2
  488. package/views/2d/layers/features/support/FeatureSetReaderVectorTileFeatureCursor.js +0 -2
  489. /package/views/2d/engine/vectorTiles/{Feature.js → PbfFeature.js} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isSome as t,equals as n}from"../../../core/arrayUtils.js";import{createTask as r}from"../../../core/asyncUtils.js";import i from"../../../core/Error.js";import"../../../core/has.js";import a from"../../../core/Logger.js";import{abortMaybe as o,destroyMaybe as s}from"../../../core/maybe.js";import{after as c,throwIfAborted as l,isPromiseLike as u}from"../../../core/promiseUtils.js";import{watch as d,syncAndInitial as f}from"../../../core/reactiveUtils.js";import{createScreenPointArray as p,createRenderScreenPointArray as m}from"../../../core/screenUtils.js";import{convertTime as h}from"../../../core/timeUtils.js";import{property as g,subclass as _}from"../../../core/accessorSupport/decorators.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as y}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as b}from"../../../core/support/UpdatingHandles.js";import{projectAsync as x}from"../../../geometry/projectionUtils.js";import{containsExecute as S}from"../../../geometry/operators/containsOperator.js";import{equals as C}from"../../../geometry/support/boundedPlane.js";import{polygonToVolume as w}from"../focusAreaUtils.js";import T from"./AnalysisView3D.js";import{registerAnalysisView as E,hideOtherAnalysisViews as D}from"./ShadowCast/analysisViewRegister.js";import O from"./ShadowCast/ShadowCastError.js";import{ShadowCastTooltip as k}from"./ShadowCast/ShadowCastTooltip.js";import{getSunlightIntervals as A,getDateTimeUTC as j}from"./ShadowCast/sunlightUtils.js";import{ElevationContext as M}from"../layers/graphics/ElevationContext.js";import{longitudeToTimezone as N}from"../support/earthUtils.js";import{computeDirectionsOverTime as P}from"../support/sunUtils.js";import{maxColorRampSize as F}from"../webgl-engine/shaders/colorRampParameters.js";import{breadthFirstBinaryPartitioning as I}from"../../../widgets/support/traversalUtils.js";let L=class extends T{constructor(e){super(e),this.type=`shadow-cast-view-3d`,this.analysis=null,this._updatingHandles=new b,this._visibleOverride=null,this._stopPreviewingTask=null,this._updatedRecently=!1,this._tooltip=null,this._previousVolume=null}initialize(){this.addHandles([E(this.view,this),d(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{o(this._stopPreviewingTask),this._updatedRecently=!0,this._stopPreviewingTask=r(async e=>{await c(W,e),l(e),this._updatedRecently=!1})},{sync:!0,initial:!0,equals:(e,t)=>H(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),d(()=>({renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t},n)=>{t&&D(this.view,this),(t||n?.visible)&&e?.setParameters({shadowCast:{enabled:t}})},f),d(()=>({renderer:this._renderer,parameters:this._visualizationParameters,visible:this.visible}),({renderer:e,parameters:t,visible:n})=>{z(e,n,t)},f),d(()=>({renderer:this._renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext,visible:this.visible}),({renderer:e,lightDirections:t,lightDirectionsContext:n,visible:r})=>{z(e,r,{lightDirections:t,lightDirectionsContext:n})},f),d(()=>({renderer:this._renderer,previewing:this._previewing,visible:this.visible}),({renderer:e,previewing:t,visible:n})=>{z(e,n,{previewing:t})},{sync:!0,initial:!0,equals:()=>!1}),d(()=>({analysisVolume:this._analysisVolume,renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t,analysisVolume:n})=>{z(e,t,{analysisVolume:n})},f)]),this.interactive=!0,this._tooltip=new k({getDuration:(e,t)=>this._getDurationAtScreen(e,t),getMode:()=>this.analysis.mode,getShowsSeparateZeroBucketInHourlyMode:()=>this._showsSeparateZeroBucketInHourlyMode,getTotalDuration:()=>this._totalDuration,getTotalDurationMode:()=>this.analysis.totalDurationOptions.mode,getVisualizeSunlight:()=>this.analysis.visualizeSunlight,isVisible:()=>this.interactive&&this.visible,view:this.view})}destroy(){this.visible&&z(this._renderer,!0,{enabled:!1}),this._tooltip=s(this._tooltip),this._stopPreviewingTask=o(this._stopPreviewingTask),this._updatingHandles=s(this._updatingHandles)}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return this._previewing||this._stopPreviewingTask!=null&&!this._stopPreviewingTask.finished||this._tooltip?.updating===!0||this._updatingHandles.updating}get visible(){let e=(this.parent?.visible&&!this.parent.suspended)??!0;return(this._visibleOverride??e)&&this.error==null}set visible(e){this._visibleOverride=e}get error(){let e=this._sunlightIntervals;switch(e.state){case`ready`:break;case`unavailable`:return new O(e.state,`The camera's geographic reference position is not available.`);default:return new O(e.state,`The selected date, time zone, or daylight calculation could not be resolved.`)}let{startTimeOfDay:t,endTimeOfDay:n}=this.analysis;if(!Number.isFinite(t)||!Number.isFinite(n)||t<0||n>h(1,`days`,`milliseconds`)||n<t)return new O(`invalid`,`The selected time range must be ordered and within the calendar day.`);let r=this._startDateTimeUTC.getTime(),i=this._endDateTimeUTC.getTime();if(!Number.isFinite(r)||!Number.isFinite(i)||i<r)return new O(`invalid`,`The selected time range could not be resolved to ordered UTC instants.`);let{intervals:a}=e;return a.length?a.some(e=>r>=e.start&&i<=e.end)?null:a.length>1?new O(`split-daylight`,`Daylight crosses midnight in the selected time zone and the selected time range includes nighttime.`):new O(`outside-daylight`,`The selected time range includes nighttime at the current camera location.`):new O(`no-daylight`,`No daylight is expected at the current camera location on the selected date.`)}get _sunlightIntervals(){let{date:e,timeZone:t}=this.analysis;return A({date:e,timeZone:t,utcOffset:t==null?this._effectiveUtcOffset:0,position:this._referencePosition})}get _previewing(){let e=this._updatedRecently,t=this._sceneUpdating;return e||t}get _sceneUpdating(){let{view:e}=this;if(e?.allLayerViews==null)return!0;let{stationary:t,navigating:n,interacting:r,graphicsView:i}=e,a=!t||n||r,o=this._shadowLayerViews.some(e=>e.updating),s=!i?.suspended&&!!i?.updating;return a||o||s}get _effectiveUtcOffset(){return this.analysis.utcOffset??this._utcOffsetAuto}get _utcOffsetAuto(){let e=this._referencePosition;return e==null?0:N(e[0],!1)}get _startDateTimeUTC(){return this._getDateTimeUTC(this.analysis.startTimeOfDay)}get _endDateTimeUTC(){return this._getDateTimeUTC(this.analysis.endTimeOfDay)}_getDateTimeUTC(e){let{date:t,timeZone:n}=this.analysis,r=j(t,e,n,n==null?this._effectiveUtcOffset:0);if(r==null)throw RangeError(`Invalid shadow cast date or time zone`);return r}get _referencePosition(){return this.view?.environmentView?.referencePositionGeographic}get _totalDurationInterval(){return this._totalDuration>0?Math.floor(this._totalDuration/(G-1)):G}get _interval(){let e=this._totalDurationInterval;switch(this.analysis.mode){case`min-duration`:return this._totalDuration>0?e:0;case`total-duration`:return e;case`discrete`:return this.analysis.discreteOptions.interval||e}}get _intervalContext(){let{mode:e,minDurationOptions:t}=this.analysis;return e===`min-duration`&&t.contextEnabled?t.contextOptions.interval||this._totalDurationInterval:-1}get _totalDurationSampleCount(){return this._lightDirections.length}get _totalDuration(){return this._endDateTimeUTC.getTime()-this._startDateTimeUTC.getTime()}get _lightDirections(){return this.error==null?this._calculateLightDirections(this._interval):[]}get _lightDirectionsContext(){return this.error==null?this._calculateLightDirections(this._intervalContext):[]}_calculateLightDirections(e){let{view:t}=this;if(e<=0)return[];let n=t.viewingMode===`global`?K:this._referencePosition;if(n==null)return[];let r=P(this._startDateTimeUTC,this._endDateTimeUTC,e,n,t.state.viewingMode,G),i=r.length;q.length=0;let a=I(0,i,q),o=Array(i);for(let e=0;e<i;++e)o[e]=r[a[e]];return o}get _analysisVolume(){let{geometry:e}=this.analysis;if(e==null)return this._previousVolume=null,null;try{let t=w(e,this.view,J);return t==null?(this._previousVolume=null,null):u(t)?(this._updatingHandles.consumePromise(t),this._previousVolume):(this._previousVolume=t,t)}catch(t){return a.getLogger(this).error(new i(`shadowcastanalysisview3d:projection-failed`,`Failed to project analysis area geometry to view spatial reference`,{geometry:e,error:t})),null}}get _visualizationParameters(){if(!this.visible)return null;switch(this.analysis.mode){case`min-duration`:return this._minDurationVisualizationParameters;case`total-duration`:return this._durationVisualizationParameters;case`discrete`:return this._discreteVisualizationParameters}}get _minDurationVisualizationParameters(){let{color:e,minDuration:t}=this.analysis.minDurationOptions,n=this._totalDuration;return{rendersSunlight:this.analysis.visualizeSunlight,visualization:2,thresholdColor:e.toUnitRGBA(),threshold:n>0?t/this._totalDuration:0,...this._minDurationContextVisualizationParameters}}get _minDurationContextVisualizationParameters(){let{minDurationOptions:e,visualizeSunlight:t}=this.analysis;if(!e.contextEnabled||t)return{};let{color:n,colorStops:r}=e.contextOptions,i=1/this._lightDirectionsContext.length;return{visualization:3,gradientColorRamp:this._getEffectiveShadowCastColorRamp(n,r,i)}}get _durationVisualizationParameters(){let{color:e,colorStops:t,mode:n}=this.analysis.totalDurationOptions,r=this._totalDuration,i=r>0&&n===`hourly`?U/r:0,a=this._getEffectiveShadowCastColorRamp(e,t,1/r);return i===0?{...this._discreteVisualizationParameters,gradientColorRamp:a}:{rendersSunlight:this.analysis.visualizeSunlight,bandedGradientColorRamp:a,visualization:1,bandSize:i}}get _showsSeparateZeroBucketInHourlyMode(){let{colorStops:e}=this.analysis.totalDurationOptions;return e==null||e.length===0||e.reduce((e,t)=>Math.min(e,t.value),1/0)<=0}get _discreteVisualizationParameters(){let{color:e,colorStops:t}=this.analysis.discreteOptions,n=1/this._lightDirections.length;return{rendersSunlight:this.analysis.visualizeSunlight,gradientColorRamp:this._getEffectiveShadowCastColorRamp(e,t,n),visualization:0}}get _shadowLayerViews(){return this.view.allLayerViews.items.filter(V)}get _previewDependencies(){if(this.error!=null)return null;let{view:e}=this,n=e.slice.plane,r=this._shadowLayerViews,i=r.map(e=>e.layer).filter(t),a=r.map(e=>e.suspended),o=i.map(e=>e.visible),s=i.map(e=>e.opacity),c=!!e.graphicsView?.suspended,l=i.filter(e=>`definitionExpression`in e).map(e=>e.definitionExpression),u=r.filter(e=>`filter`in e).map(e=>e.filter);return{slicePlane:n,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:a,graphicsViewSuspended:c,layerVisibilities:o,layerOpacities:s,filters:u,definitionExpressions:l}}get _renderer(){return this.view?.stage?.renderer}get testData(){}async getDurationAtScreen(e){return this._getDurationAtScreen(e)}async _getDurationAtScreen(e,t){if(!await this._isScreenPointInAnalysisArea(e,t))return-1;let{_renderer:n,_totalDurationSampleCount:r}=this;if(n==null||r===0)return 0;let i=this.view.state.camera.screenToRender(p(e.x,e.y),m()),a=n.readAccumulatedShadow(i);return(this.analysis.visualizeSunlight?1-a:a)*this._totalDuration}async _isScreenPointInAnalysisArea(e,t){let{geometry:n}=this.analysis;if(!n)return!0;let r=await this.view.hitTest(e);l(t);let i=r.results.find(e=>e.mapPoint)?.mapPoint??r?.ground?.mapPoint;if(!i)return!1;let a=await x(i,n.spatialReference,{signal:t});return l(t),a!=null&&S(n,a)}_getEffectiveShadowCastColorRamp(e,t,n){if(t!=null){t.length>F&&a.getLogger(this).warnOnce(`ShadowCastAnalysis supports at most 8 color stops`);let e=t.map(e=>[e.value*n,e.color.toUnitRGBA()]);return e.sort(([e],[t])=>e-t),e}return B(e)}};e([g({readOnly:!0,type:[`shadow-cast-view-3d`]})],L.prototype,`type`,void 0),e([g({constructOnly:!0,nonNullable:!0})],L.prototype,`analysis`,void 0),e([g({readOnly:!0})],L.prototype,`updating`,null),e([g()],L.prototype,`visible`,null),e([g()],L.prototype,`error`,null),e([g()],L.prototype,`_visibleOverride`,void 0),e([g()],L.prototype,`_sunlightIntervals`,null),e([g()],L.prototype,`_stopPreviewingTask`,void 0),e([g()],L.prototype,`_updatedRecently`,void 0),e([g()],L.prototype,`_tooltip`,void 0),e([g()],L.prototype,`_sceneUpdating`,null),e([g()],L.prototype,`_effectiveUtcOffset`,null),e([g()],L.prototype,`_utcOffsetAuto`,null),e([g()],L.prototype,`_startDateTimeUTC`,null),e([g()],L.prototype,`_endDateTimeUTC`,null),e([g()],L.prototype,`_referencePosition`,null),e([g()],L.prototype,`_interval`,null),e([g()],L.prototype,`_intervalContext`,null),e([g()],L.prototype,`_totalDurationSampleCount`,null),e([g()],L.prototype,`_totalDuration`,null),e([g()],L.prototype,`_lightDirections`,null),e([g()],L.prototype,`_lightDirectionsContext`,null),e([g()],L.prototype,`_analysisVolume`,null),e([g()],L.prototype,`_visualizationParameters`,null),e([g()],L.prototype,`_minDurationVisualizationParameters`,null),e([g()],L.prototype,`_minDurationContextVisualizationParameters`,null),e([g()],L.prototype,`_durationVisualizationParameters`,null),e([g()],L.prototype,`_showsSeparateZeroBucketInHourlyMode`,null),e([g()],L.prototype,`_discreteVisualizationParameters`,null),e([g()],L.prototype,`_shadowLayerViews`,null),e([g()],L.prototype,`_previewDependencies`,null),e([g()],L.prototype,`_renderer`,null),L=e([_(`esri.views.3d.analysis.ShadowCastAnalysisView3D`)],L);const R=L;function z(e,t,n){t&&n!=null&&e?.setParameters({shadowCast:n})}function B(e){let t=e.toUnitRGBA();return[[0,y(t[0],t[1],t[2],0)],[1,t]]}function V(e){if(e.suspended)return!1;switch(e.type){case`building-scene-3d`:case`csv-3d`:case`elevation-3d`:case`feature-3d`:case`gaussian-splat-3d`:case`geojson-3d`:case`integrated-mesh-3d`:case`integrated-mesh-3dtiles`:case`ogc-feature-3d`:case`route-3d`:case`scene-layer-3d`:case`scene-layer-graphics-3d`:case`stream-3d`:case`wms-3d`:case`catalog-footprint-3d`:return!0;case`base-dynamic-3d`:case`catalog-3d`:case`catalog-dynamic-group-3d`:case`dimension-3d`:case`imagery-3d`:case`imagery-tile-3d`:case`line-of-sight-3d`:case`map-image-3d`:case`point-cloud-3d`:case`tile-3d`:case`vector-tile-3d`:case`viewshed-3d`:case`voxel-3d`:case`wfs-3d`:case`wmts-3d`:case`media-3d`:return!1;case`group`:return!1;case`graphics-3d`:return e.layer.graphics.some(e=>{let{symbol:t}=e;return t==null||t.type!==`text`&&!(`symbolLayers`in t)||t.type!==`text`&&t.symbolLayers.some(e=>e.type!==`text`)});default:return!1}}function H(e,t){if(e===t||e==null&&t==null)return!0;if(e==null||t==null)return!1;let r=C(e.slicePlane,t.slicePlane),i=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),a=n(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,o=n(e.layerVisibilities,t.layerVisibilities),s=n(e.layerOpacities,t.layerOpacities),c=n(e.filters,t.filters),l=n(e.definitionExpressions,t.definitionExpressions);return r&&i&&a&&o&&s&&c&&l}const U=h(1,`hours`,`milliseconds`),W=500,G=255,K=v(),q=[],J=new M;export{R as default};
2
+ import{__decorate as e}from"tslib";import{isSome as t,equals as n}from"../../../core/arrayUtils.js";import{createTask as r}from"../../../core/asyncUtils.js";import i from"../../../core/Error.js";import"../../../core/has.js";import a from"../../../core/Logger.js";import{abortMaybe as o,destroyMaybe as s}from"../../../core/maybe.js";import{after as c,throwIfAborted as l,isPromiseLike as u}from"../../../core/promiseUtils.js";import{watch as d,syncAndInitial as f}from"../../../core/reactiveUtils.js";import{createScreenPointArray as p,createRenderScreenPointArray as m}from"../../../core/screenUtils.js";import{convertTime as h}from"../../../core/timeUtils.js";import{property as g,subclass as _}from"../../../core/accessorSupport/decorators.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as y}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as b}from"../../../core/support/UpdatingHandles.js";import{projectAsync as x}from"../../../geometry/projectionUtils.js";import{containsExecute as S}from"../../../geometry/operators/containsOperator.js";import{equals as C}from"../../../geometry/support/boundedPlane.js";import{polygonToVolume as w}from"../focusAreaUtils.js";import T from"./AnalysisView3D.js";import{registerAnalysisView as E,hideOtherAnalysisViews as D}from"./ShadowCast/analysisViewRegister.js";import O from"./ShadowCast/ShadowCastError.js";import{ShadowCastTooltip as k}from"./ShadowCast/ShadowCastTooltip.js";import{getSunlightIntervals as A,getDateTimeUTC as j}from"./ShadowCast/sunlightUtils.js";import{ElevationContext as M}from"../layers/graphics/ElevationContext.js";import{longitudeToTimezone as N}from"../support/earthUtils.js";import{computeDirectionsOverTime as P}from"../support/sunUtils.js";import{maxColorRampSize as F}from"../webgl-engine/shaders/colorRampParameters.js";import{breadthFirstBinaryPartitioning as I}from"../../../widgets/support/traversalUtils.js";let L=class extends T{constructor(e){super(e),this.type=`shadow-cast-view-3d`,this.analysis=null,this._updatingHandles=new b,this._visibleOverride=null,this._stopPreviewingTask=null,this._updatedRecently=!1,this._tooltip=null,this._previousVolume=null}initialize(){this.addHandles([E(this.view,this),d(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{o(this._stopPreviewingTask),this._updatedRecently=!0,this._stopPreviewingTask=r(async e=>{await c(W,e),l(e),this._updatedRecently=!1})},{sync:!0,initial:!0,equals:(e,t)=>H(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),d(()=>({renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t},n)=>{t&&D(this.view,this),(t||n?.visible)&&e?.setParameters({shadowCast:{enabled:t}})},f),d(()=>({renderer:this._renderer,parameters:this._visualizationParameters,visible:this.visible}),({renderer:e,parameters:t,visible:n})=>{z(e,n,t)},f),d(()=>({renderer:this._renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext,visible:this.visible}),({renderer:e,lightDirections:t,lightDirectionsContext:n,visible:r})=>{z(e,r,{lightDirections:t,lightDirectionsContext:n})},f),d(()=>({renderer:this._renderer,previewing:this._previewing,visible:this.visible}),({renderer:e,previewing:t,visible:n})=>{z(e,n,{previewing:t})},{sync:!0,initial:!0,equals:()=>!1}),d(()=>({analysisVolume:this._analysisVolume,renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t,analysisVolume:n})=>{z(e,t,{analysisVolume:n})},f)]),this.interactive=!0,this._tooltip=new k({getDuration:(e,t)=>this._getDurationAtScreen(e,t),getMode:()=>this.analysis.mode,getShowsSeparateZeroBucketInHourlyMode:()=>this._showsSeparateZeroBucketInHourlyMode,getTotalDuration:()=>this._totalDuration,getTotalDurationMode:()=>this.analysis.totalDurationOptions.mode,getVisualizeSunlight:()=>this.analysis.visualizeSunlight,isVisible:()=>this.interactive&&this.visible,view:this.view})}destroy(){this.visible&&z(this._renderer,!0,{enabled:!1}),this._tooltip=s(this._tooltip),this._stopPreviewingTask=o(this._stopPreviewingTask),this._updatingHandles=s(this._updatingHandles)}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return this._previewing||this._stopPreviewingTask!=null&&!this._stopPreviewingTask.finished||this._tooltip?.updating===!0||this._updatingHandles.updating}get visible(){let e=(this.parent?.visible&&!this.parent.suspended)??!0;return(this._visibleOverride??e)&&this.error==null}set visible(e){this._visibleOverride=e}get error(){let e=this._sunlightIntervals;switch(e.state){case`ready`:break;case`unavailable`:return new O(e.state,`The camera's geographic reference position is not available.`);default:return new O(e.state,`The selected date, time zone, or daylight calculation could not be resolved.`)}let{startTimeOfDay:t,endTimeOfDay:n}=this.analysis;if(!Number.isFinite(t)||!Number.isFinite(n)||t<0||n>h(1,`days`,`milliseconds`)||n<t)return new O(`invalid`,`The selected time range must be ordered and within the calendar day.`);let r=this._startDateTimeUTC.getTime(),i=this._endDateTimeUTC.getTime();if(!Number.isFinite(r)||!Number.isFinite(i)||i<r)return new O(`invalid`,`The selected time range could not be resolved to ordered UTC instants.`);let{intervals:a}=e;return a.length?a.some(e=>r>=e.start&&i<=e.end)?null:a.length>1?new O(`split-daylight`,`Daylight crosses midnight in the selected time zone and the selected time range includes nighttime.`):new O(`outside-daylight`,`The selected time range includes nighttime at the current camera location.`):new O(`no-daylight`,`No daylight is expected at the current camera location on the selected date.`)}get _sunlightIntervals(){let{date:e}=this.analysis,t=this._timeZone;return A({date:e,timeZone:t,utcOffset:t==null?this._effectiveUtcOffset:0,position:this._referencePosition})}get _previewing(){let e=this._updatedRecently,t=this._sceneUpdating;return e||t}get _sceneUpdating(){let{view:e}=this;if(e?.allLayerViews==null)return!0;let{stationary:t,navigating:n,interacting:r,graphicsView:i}=e,a=!t||n||r,o=this._shadowLayerViews.some(e=>e.updating),s=!i?.suspended&&!!i?.updating;return a||o||s}get _timeZone(){return this.analysis.timeZoneMode===`region`?this.view.timeZone:null}get _effectiveUtcOffset(){return this.analysis.utcOffset??this._utcOffsetAuto}get _utcOffsetAuto(){let e=this._referencePosition;return e==null?0:N(e[0],!1)}get _startDateTimeUTC(){return this._getDateTimeUTC(this.analysis.startTimeOfDay)}get _endDateTimeUTC(){return this._getDateTimeUTC(this.analysis.endTimeOfDay)}_getDateTimeUTC(e){let{date:t}=this.analysis,n=this._timeZone,r=j(t,e,n,n==null?this._effectiveUtcOffset:0);if(r==null)throw RangeError(`Invalid shadow cast date or time zone`);return r}get _referencePosition(){return this.view?.environmentView?.referencePositionGeographic}get _totalDurationInterval(){return this._totalDuration>0?Math.floor(this._totalDuration/(G-1)):G}get _interval(){let e=this._totalDurationInterval;switch(this.analysis.mode){case`min-duration`:return this._totalDuration>0?e:0;case`total-duration`:return e;case`discrete`:return this.analysis.discreteOptions.interval||e}}get _intervalContext(){let{mode:e,minDurationOptions:t}=this.analysis;return e===`min-duration`&&t.contextEnabled?t.contextOptions.interval||this._totalDurationInterval:-1}get _totalDurationSampleCount(){return this._lightDirections.length}get _totalDuration(){return this._endDateTimeUTC.getTime()-this._startDateTimeUTC.getTime()}get _lightDirections(){return this.error==null?this._calculateLightDirections(this._interval):[]}get _lightDirectionsContext(){return this.error==null?this._calculateLightDirections(this._intervalContext):[]}_calculateLightDirections(e){let{view:t}=this;if(e<=0)return[];let n=t.viewingMode===`global`?K:this._referencePosition;if(n==null)return[];let r=P(this._startDateTimeUTC,this._endDateTimeUTC,e,n,t.state.viewingMode,G),i=r.length;q.length=0;let a=I(0,i,q),o=Array(i);for(let e=0;e<i;++e)o[e]=r[a[e]];return o}get _analysisVolume(){let{geometry:e}=this.analysis;if(e==null)return this._previousVolume=null,null;try{let t=w(e,this.view,J);return t==null?(this._previousVolume=null,null):u(t)?(this._updatingHandles.consumePromise(t),this._previousVolume):(this._previousVolume=t,t)}catch(t){return a.getLogger(this).error(new i(`shadowcastanalysisview3d:projection-failed`,`Failed to project analysis area geometry to view spatial reference`,{geometry:e,error:t})),null}}get _visualizationParameters(){if(!this.visible)return null;switch(this.analysis.mode){case`min-duration`:return this._minDurationVisualizationParameters;case`total-duration`:return this._durationVisualizationParameters;case`discrete`:return this._discreteVisualizationParameters}}get _minDurationVisualizationParameters(){let{color:e,minDuration:t}=this.analysis.minDurationOptions,n=this._totalDuration;return{rendersSunlight:this.analysis.visualizeSunlight,visualization:2,thresholdColor:e.toUnitRGBA(),threshold:n>0?t/this._totalDuration:0,...this._minDurationContextVisualizationParameters}}get _minDurationContextVisualizationParameters(){let{minDurationOptions:e,visualizeSunlight:t}=this.analysis;if(!e.contextEnabled||t)return{};let{color:n,colorStops:r}=e.contextOptions,i=1/this._lightDirectionsContext.length;return{visualization:3,gradientColorRamp:this._getEffectiveShadowCastColorRamp(n,r,i)}}get _durationVisualizationParameters(){let{color:e,colorStops:t,mode:n}=this.analysis.totalDurationOptions,r=this._totalDuration,i=r>0&&n===`hourly`?U/r:0,a=this._getEffectiveShadowCastColorRamp(e,t,1/r);return i===0?{...this._discreteVisualizationParameters,gradientColorRamp:a}:{rendersSunlight:this.analysis.visualizeSunlight,bandedGradientColorRamp:a,visualization:1,bandSize:i}}get _showsSeparateZeroBucketInHourlyMode(){let{colorStops:e}=this.analysis.totalDurationOptions;return e==null||e.length===0||e.reduce((e,t)=>Math.min(e,t.value),1/0)<=0}get _discreteVisualizationParameters(){let{color:e,colorStops:t}=this.analysis.discreteOptions,n=1/this._lightDirections.length;return{rendersSunlight:this.analysis.visualizeSunlight,gradientColorRamp:this._getEffectiveShadowCastColorRamp(e,t,n),visualization:0}}get _shadowLayerViews(){return this.view.allLayerViews.items.filter(V)}get _previewDependencies(){if(this.error!=null)return null;let{view:e}=this,n=e.slice.plane,r=this._shadowLayerViews,i=r.map(e=>e.layer).filter(t),a=r.map(e=>e.suspended),o=i.map(e=>e.visible),s=i.map(e=>e.opacity),c=!!e.graphicsView?.suspended,l=i.filter(e=>`definitionExpression`in e).map(e=>e.definitionExpression),u=r.filter(e=>`filter`in e).map(e=>e.filter);return{slicePlane:n,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:a,graphicsViewSuspended:c,layerVisibilities:o,layerOpacities:s,filters:u,definitionExpressions:l}}get _renderer(){return this.view?.stage?.renderer}get testData(){}async getDurationAtScreen(e){return this._getDurationAtScreen(e)}async _getDurationAtScreen(e,t){if(!await this._isScreenPointInAnalysisArea(e,t))return-1;let{_renderer:n,_totalDurationSampleCount:r}=this;if(n==null||r===0)return 0;let i=this.view.state.camera.screenToRender(p(e.x,e.y),m()),a=n.readAccumulatedShadow(i);return(this.analysis.visualizeSunlight?1-a:a)*this._totalDuration}async _isScreenPointInAnalysisArea(e,t){let{geometry:n}=this.analysis;if(!n)return!0;let r=await this.view.hitTest(e);l(t);let i=r.results.find(e=>e.mapPoint)?.mapPoint??r?.ground?.mapPoint;if(!i)return!1;let a=await x(i,n.spatialReference,{signal:t});return l(t),a!=null&&S(n,a)}_getEffectiveShadowCastColorRamp(e,t,n){if(t!=null){t.length>F&&a.getLogger(this).warnOnce(`ShadowCastAnalysis supports at most 8 color stops`);let e=t.map(e=>[e.value*n,e.color.toUnitRGBA()]);return e.sort(([e],[t])=>e-t),e}return B(e)}};e([g({readOnly:!0,type:[`shadow-cast-view-3d`]})],L.prototype,`type`,void 0),e([g({constructOnly:!0,nonNullable:!0})],L.prototype,`analysis`,void 0),e([g({readOnly:!0})],L.prototype,`updating`,null),e([g()],L.prototype,`visible`,null),e([g()],L.prototype,`error`,null),e([g()],L.prototype,`_visibleOverride`,void 0),e([g()],L.prototype,`_sunlightIntervals`,null),e([g()],L.prototype,`_stopPreviewingTask`,void 0),e([g()],L.prototype,`_updatedRecently`,void 0),e([g()],L.prototype,`_tooltip`,void 0),e([g()],L.prototype,`_sceneUpdating`,null),e([g()],L.prototype,`_timeZone`,null),e([g()],L.prototype,`_effectiveUtcOffset`,null),e([g()],L.prototype,`_utcOffsetAuto`,null),e([g()],L.prototype,`_startDateTimeUTC`,null),e([g()],L.prototype,`_endDateTimeUTC`,null),e([g()],L.prototype,`_referencePosition`,null),e([g()],L.prototype,`_interval`,null),e([g()],L.prototype,`_intervalContext`,null),e([g()],L.prototype,`_totalDurationSampleCount`,null),e([g()],L.prototype,`_totalDuration`,null),e([g()],L.prototype,`_lightDirections`,null),e([g()],L.prototype,`_lightDirectionsContext`,null),e([g()],L.prototype,`_analysisVolume`,null),e([g()],L.prototype,`_visualizationParameters`,null),e([g()],L.prototype,`_minDurationVisualizationParameters`,null),e([g()],L.prototype,`_minDurationContextVisualizationParameters`,null),e([g()],L.prototype,`_durationVisualizationParameters`,null),e([g()],L.prototype,`_showsSeparateZeroBucketInHourlyMode`,null),e([g()],L.prototype,`_discreteVisualizationParameters`,null),e([g()],L.prototype,`_shadowLayerViews`,null),e([g()],L.prototype,`_previewDependencies`,null),e([g()],L.prototype,`_renderer`,null),L=e([_(`esri.views.3d.analysis.ShadowCastAnalysisView3D`)],L);const R=L;function z(e,t,n){t&&n!=null&&e?.setParameters({shadowCast:n})}function B(e){let t=e.toUnitRGBA();return[[0,y(t[0],t[1],t[2],0)],[1,t]]}function V(e){if(e.suspended)return!1;switch(e.type){case`building-scene-3d`:case`csv-3d`:case`elevation-3d`:case`feature-3d`:case`gaussian-splat-3d`:case`geojson-3d`:case`integrated-mesh-3d`:case`integrated-mesh-3dtiles`:case`ogc-feature-3d`:case`route-3d`:case`scene-layer-3d`:case`scene-layer-graphics-3d`:case`stream-3d`:case`wms-3d`:case`catalog-footprint-3d`:return!0;case`base-dynamic-3d`:case`catalog-3d`:case`catalog-dynamic-group-3d`:case`dimension-3d`:case`imagery-3d`:case`imagery-tile-3d`:case`line-of-sight-3d`:case`map-image-3d`:case`point-cloud-3d`:case`tile-3d`:case`vector-tile-3d`:case`viewshed-3d`:case`voxel-3d`:case`wfs-3d`:case`wmts-3d`:case`media-3d`:return!1;case`group`:return!1;case`graphics-3d`:return e.layer.graphics.some(e=>{let{symbol:t}=e;return t==null||t.type!==`text`&&!(`symbolLayers`in t)||t.type!==`text`&&t.symbolLayers.some(e=>e.type!==`text`)});default:return!1}}function H(e,t){if(e===t||e==null&&t==null)return!0;if(e==null||t==null)return!1;let r=C(e.slicePlane,t.slicePlane),i=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),a=n(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,o=n(e.layerVisibilities,t.layerVisibilities),s=n(e.layerOpacities,t.layerOpacities),c=n(e.filters,t.filters),l=n(e.definitionExpressions,t.definitionExpressions);return r&&i&&a&&o&&s&&c&&l}const U=h(1,`hours`,`milliseconds`),W=500,G=255,K=v(),q=[],J=new M;export{R as default};
@@ -3,4 +3,4 @@ function e(e,a){return i(r(t(n(e),a)),a.size)}function t(e,{accentColor:t,contra
3
3
  .contrast-fill { fill: ${a}; fill-opacity: ${o}; }
4
4
  .contrast-stroke { stroke: ${a}; stroke-opacity: ${o}; }
5
5
  .accent-fill { fill: ${r}; fill-opacity: ${i}; }
6
- .accent-stroke { stroke: ${r}; stroke-opacity: ${i}; }`),e}function n(e){let t=e.split(`,`)[1],n=atob(t);return new DOMParser().parseFromString(n,`image/svg+xml`)}function r(e){let t=new XMLSerializer().serializeToString(e);return`data:image/svg+xml;base64,${btoa(t)}`}function i(e,t){let n=new Image(t,t);return n.src=e,n}export{e as generateStyledTexture};
6
+ .accent-stroke { stroke: ${r}; stroke-opacity: ${i}; }`),e}function n(e){let t=e.split(`,`,2)[1],n=atob(t);return new DOMParser().parseFromString(n,`image/svg+xml`)}function r(e){let t=new XMLSerializer().serializeToString(e);return`data:image/svg+xml;base64,${btoa(t)}`}function i(e,t){let n=new Image(t,t);return n.src=e,n}export{e as generateStyledTexture};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../core/Evented.js";import{watch as n,sync as r,syncAndInitial as i,when as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{length as c,equals as l,copy as u,scale as d,lerp as f}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as p,create as m,fromValues as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isEarth as g,getReferenceEllipsoid as _}from"../../../geometry/ellipsoidUtils.js";import{isLoadedOrLoadFor as v}from"../../../geometry/projectionUtils.js";import y from"../../../geometry/SpatialReference.js";import{projectPointToVector as b}from"../../../geometry/projection/projectPointToVector.js";import{getGCSForPlanet as x}from"../../../geometry/support/planetGCSUtils.js";import{heightLimit as S}from"./weather.js";import{positionToTimezoneInfo as C}from"../support/earthUtils.js";import{ColorAndIntensity as w,computeShadowsEnabled as T,computeColorAndIntensity as E,computeVirtualLightDirection as D}from"../support/sunUtils.js";import{MainLight as O,AmbientLight as k,FillLight as A}from"../webgl-engine/lighting/Lightsources.js";let j=class extends t{constructor(){super(),this._view=null,this._tmpLightParameters=new w,this._defaultLightParameters=new w,this._tmpDate=new Date,this._tmpTz={hours:0,minutes:0,seconds:0},this._viewHandlesKey=`viewHandles`,this._trackingEnabled=!1,this._mainLight=new O,this._ambientLight=new k,this._moonLight=new A,this.shadowsAvailable=!1,this._resetReferencePosition()}destroy(){this.disconnectView()}get updating(){return!this._canProjectCameraPosition}get weatherEnabled(){return this._view?.stage?.renderer?.weatherFader!=null&&this._view.environment.atmosphereEnabled&&this._view.state.viewingMode===1&&g(this._view.spatialReference)}get _weatherAvailable(){let e=this._view;return e!=null&&this.weatherEnabled&&c(e.state.camera.eye)-_(e.spatialReference).radius<=S}get weather(){return this._weatherAvailable?this._view?.environment.weather:null}_modifyShadowsAvailable(){if(this._view==null)return;let e=this.referencePositionGeographic,t=e==null||T(e[2],this._view.state.viewingMode);this.shadowsAvailable=this._view.environment.lighting.directShadowsEnabled&&t}get referencePositionGeographic(){return this._referencePositionGeographic}get _canProjectCameraPosition(){let e=this._view?.stateManager?.camera?.position?.spatialReference??y.WGS84,t=x(e);return v(e,t)}connectView(e){this._view=e,this.addHandles([n(()=>e.environment.lighting,e=>this._updateLightingHandler(e),r),n(()=>e.environment.lighting.type===`virtual`?null:e.environment.lighting.date,e=>this._lightingDateHandler(e),r),n(()=>e.environment.lighting.directShadowsEnabled,()=>this._modifyShadowsAvailable(),r),n(()=>e.spatialReference,()=>this._resetReferencePosition(!0),r),n(()=>[e.environment.weather.type,this.weatherEnabled],()=>this._updateLighting(null,1),r),n(()=>this._weatherAvailable,t=>e.environment.setWeatherAvailable(t),i),n(()=>e.viewingMode,()=>this._resetReferencePosition(!0),i),n(()=>e.environment.lighting.type!==`virtual`&&e.environment.lighting.cameraTrackingEnabled,e=>this._updateCameraTracking(e),i),n(()=>e.state.camera,()=>this._cameraHandler(),i),a(()=>this._canProjectCameraPosition,()=>this._resetReferencePosition(!0),r)],this._viewHandlesKey),this._modifyShadowsAvailable(),this._updateLighting(),this._cameraHandler(),this.notifyChange(`updating`)}disconnectView(){this.removeHandles(this._viewHandlesKey),this._resetReferencePosition()}_updateLightingHandler(e){this._updateCameraTracking(e.type!==`virtual`&&e.cameraTrackingEnabled),this._lightingDateHandler(e.type===`virtual`?null:e.date),this._modifyShadowsAvailable()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{if(!this._view)return;let e=this._view.environment.lighting;e?.type!==`virtual`&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){if(!this._view)return;let t=this._view.environment.lighting;if(t?.type===`virtual`)this._updateLighting();else if(e){if(!t.positionTimezoneInfo.autoUpdated&&(this._preupdateTracking(e),this._referencePositionGeographic!=null)){let e=C(this._referencePositionGeographic,this._tmpTz);e!=null&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}this._updateLighting(e)}}_preupdateTracking(e){this._view&&!this._trackingEnabled&&this._view.environment.lighting.type!==`virtual`&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){let t=this._view;if(!t||!t.ready)return;let n=t.stateManager.camera;if(!n)return;let r=n.position,i=r.spatialReference??y.WGS84,a=x(i);if(b(r,P,a,F))this._referencePositionGeographic?l(this._referencePositionGeographic,P)||(u(this._referencePositionGeographic,P),this.notifyChange(`referencePositionGeographic`)):this._referencePositionGeographic=p(P),this._autoUpdateTimezone(this._referencePositionGeographic,e)||this._updateLighting(e);else{if(this._referencePositionGeographic==null)return;this._referencePositionGeographic=null,this._updateLighting()}}_updateLighting(e,t=0){let n=this._view;if(!n)return;let{lighting:r}=n.environment,i=r.type===`virtual`,a=this._referencePositionGeographic,o=a==null?this._defaultLightParameters:this._tmpLightParameters;if(a){e??=i?null:r.date;let t=this.weather?.type??`disabled`;E(e,a,n.state.viewingMode,t,n.state.camera,o)}else i&&D(n.state.camera,n.state.viewingMode,o.direct.directionToLightSource);let s=this._mainLight,c=o.direct;d(s.intensity,c.color,c.intensity*Math.PI),u(s.direction,c.directionToLightSource),s.specularStrength=o.specularStrength,s.environmentStrength=o.environmentStrength;let l=this._ambientLight;d(l.intensity,o.ambient.color,o.ambient.intensity);let p=this._moonLight;f(p.intensity,M,N,o.globalFactor);let m=(1-.5*o.globalFactor)*(1-.4*o.noonFactor*(1-o.globalFactor));d(p.intensity,p.intensity,m),u(p.direction,c.directionToLightSource),n.stage.renderer.updateLighting([s,l,p],o.noonFactor,o.globalFactor,this.weather?t:0),this._modifyShadowsAvailable()}_autoUpdateTimezone(e,t=null){if(!this._view||this._view.environment.lighting.type===`virtual`||!this._view.environment.lighting.cameraTrackingEnabled||e==null)return!1;let n=this._tmpDate;n.setTime((t||this._view.environment.lighting.date).getTime());let r=C(e,this._tmpTz);if(r==null)return!1;let i=this._view.environment.lighting.positionTimezoneInfo;if(!i.autoUpdated)i=r;else if(i.hours===r.hours&&i.minutes===r.minutes&&i.seconds===r.seconds)return!1;let a=n.getUTCHours()-(r.hours-i.hours),o=n.getUTCMinutes()-(r.minutes-i.minutes),s=n.getUTCSeconds()-(r.seconds-i.seconds);return n.setUTCHours(a),n.setUTCMinutes(o),n.setUTCSeconds(s),!t&&this._view.environment.lighting.autoUpdate(n,r)}_resetReferencePosition(e=!1){this._referencePositionGeographic=null,e&&this._cameraHandler()}};e([o()],j.prototype,`_view`,void 0),e([o({type:Boolean,readOnly:!0})],j.prototype,`updating`,null),e([o()],j.prototype,`weatherEnabled`,null),e([o()],j.prototype,`_weatherAvailable`,null),e([o()],j.prototype,`shadowsAvailable`,void 0),e([o()],j.prototype,`referencePositionGeographic`,null),e([o()],j.prototype,`_referencePositionGeographic`,void 0),e([o()],j.prototype,`_canProjectCameraPosition`,null),j=e([s(`esri.views.3d.environment.EnvironmentView`)],j);const M=h(.22,.22,.33),N=h(.22,.22,.22),P=m(),F={zConversionDisabled:!0};export{j as EnvironmentView};
2
+ import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../core/Evented.js";import{watch as n,sync as r,syncAndInitial as i,when as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{length as c,equals as l,copy as u,scale as d,lerp as f}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as p,create as m,fromValues as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isEarth as g,getReferenceEllipsoid as _}from"../../../geometry/ellipsoidUtils.js";import{isLoadedOrLoadFor as v}from"../../../geometry/projectionUtils.js";import y from"../../../geometry/SpatialReference.js";import{projectPointToVector as b}from"../../../geometry/projection/projectPointToVector.js";import{getGCSForPlanet as x}from"../../../geometry/support/planetGCSUtils.js";import{heightLimit as S}from"./weather.js";import{positionToTimezoneInfo as C}from"../support/earthUtils.js";import{ColorAndIntensity as w,computeShadowsEnabled as T,computeColorAndIntensity as E,computeVirtualLightDirection as D}from"../support/sunUtils.js";import{MainLight as O,AmbientLight as k,FillLight as A}from"../webgl-engine/lighting/Lightsources.js";let j=class extends t{constructor(){super(),this._view=null,this._tmpLightParameters=new w,this._defaultLightParameters=new w,this._tmpDate=new Date,this._tmpTz={hours:0,minutes:0,seconds:0},this._viewHandlesKey=`viewHandles`,this._trackingEnabled=!1,this._mainLight=new O,this._ambientLight=new k,this._moonLight=new A,this.shadowsAvailable=!1,this._resetReferencePosition()}destroy(){this.disconnectView()}get updating(){return!this._canProjectCameraPosition}get weatherEnabled(){return this._view?.stage?.renderer?.weatherFader!=null&&this._view.environment.atmosphereEnabled&&this._view.state.isGlobal&&g(this._view.spatialReference)}get _weatherAvailable(){let e=this._view;return e!=null&&this.weatherEnabled&&c(e.state.camera.eye)-_(e.spatialReference).radius<=S}get weather(){return this._weatherAvailable?this._view?.environment.weather:null}_modifyShadowsAvailable(){if(this._view==null)return;let e=this.referencePositionGeographic,t=e==null||T(e[2],this._view.state.viewingMode);this.shadowsAvailable=this._view.environment.lighting.directShadowsEnabled&&t}get referencePositionGeographic(){return this._referencePositionGeographic}get _canProjectCameraPosition(){let e=this._view?.stateManager?.camera?.position?.spatialReference??y.WGS84,t=x(e);return v(e,t)}connectView(e){this._view=e,this.addHandles([n(()=>e.environment.lighting,e=>this._updateLightingHandler(e),r),n(()=>e.environment.lighting.type===`virtual`?null:e.environment.lighting.date,e=>this._lightingDateHandler(e),r),n(()=>e.environment.lighting.directShadowsEnabled,()=>this._modifyShadowsAvailable(),r),n(()=>e.spatialReference,()=>this._resetReferencePosition(!0),r),n(()=>[e.environment.weather.type,this.weatherEnabled],()=>this._updateLighting(null,1),r),n(()=>this._weatherAvailable,t=>e.environment.setWeatherAvailable(t),i),n(()=>e.viewingMode,()=>this._resetReferencePosition(!0),i),n(()=>e.environment.lighting.type!==`virtual`&&e.environment.lighting.cameraTrackingEnabled,e=>this._updateCameraTracking(e),i),n(()=>e.state.camera,()=>this._cameraHandler(),i),a(()=>this._canProjectCameraPosition,()=>this._resetReferencePosition(!0),r)],this._viewHandlesKey),this._modifyShadowsAvailable(),this._updateLighting(),this._cameraHandler(),this.notifyChange(`updating`)}disconnectView(){this.removeHandles(this._viewHandlesKey),this._resetReferencePosition()}_updateLightingHandler(e){this._updateCameraTracking(e.type!==`virtual`&&e.cameraTrackingEnabled),this._lightingDateHandler(e.type===`virtual`?null:e.date),this._modifyShadowsAvailable()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{if(!this._view)return;let e=this._view.environment.lighting;e?.type!==`virtual`&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){if(!this._view)return;let t=this._view.environment.lighting;if(t?.type===`virtual`)this._updateLighting();else if(e){if(!t.positionTimezoneInfo.autoUpdated&&(this._preupdateTracking(e),this._referencePositionGeographic!=null)){let e=C(this._referencePositionGeographic,this._tmpTz);e!=null&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}this._updateLighting(e)}}_preupdateTracking(e){this._view&&!this._trackingEnabled&&this._view.environment.lighting.type!==`virtual`&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){let t=this._view;if(!t||!t.ready)return;let n=t.stateManager.camera;if(!n)return;let r=n.position,i=r.spatialReference??y.WGS84,a=x(i);if(b(r,P,a,F))this._referencePositionGeographic?l(this._referencePositionGeographic,P)||(u(this._referencePositionGeographic,P),this.notifyChange(`referencePositionGeographic`)):this._referencePositionGeographic=p(P),this._autoUpdateTimezone(this._referencePositionGeographic,e)||this._updateLighting(e);else{if(this._referencePositionGeographic==null)return;this._referencePositionGeographic=null,this._updateLighting()}}_updateLighting(e,t=0){let n=this._view;if(!n)return;let{lighting:r}=n.environment,i=r.type===`virtual`,a=this._referencePositionGeographic,o=a==null?this._defaultLightParameters:this._tmpLightParameters;if(a){e??=i?null:r.date;let t=this.weather?.type??`disabled`;E(e,a,n.state.viewingMode,t,n.state.camera,o)}else i&&D(n.state.camera,n.state.viewingMode,o.direct.directionToLightSource);let s=this._mainLight,c=o.direct;d(s.intensity,c.color,c.intensity*Math.PI),u(s.direction,c.directionToLightSource),s.specularStrength=o.specularStrength,s.environmentStrength=o.environmentStrength;let l=this._ambientLight;d(l.intensity,o.ambient.color,o.ambient.intensity);let p=this._moonLight;f(p.intensity,M,N,o.globalFactor);let m=(1-.5*o.globalFactor)*(1-.4*o.noonFactor*(1-o.globalFactor));d(p.intensity,p.intensity,m),u(p.direction,c.directionToLightSource),n.stage.renderer.updateLighting([s,l,p],o.noonFactor,o.globalFactor,this.weather?t:0),this._modifyShadowsAvailable()}_autoUpdateTimezone(e,t=null){if(!this._view||this._view.environment.lighting.type===`virtual`||!this._view.environment.lighting.cameraTrackingEnabled||e==null)return!1;let n=this._tmpDate;n.setTime((t||this._view.environment.lighting.date).getTime());let r=C(e,this._tmpTz);if(r==null)return!1;let i=this._view.environment.lighting.positionTimezoneInfo;if(!i.autoUpdated)i=r;else if(i.hours===r.hours&&i.minutes===r.minutes&&i.seconds===r.seconds)return!1;let a=n.getUTCHours()-(r.hours-i.hours),o=n.getUTCMinutes()-(r.minutes-i.minutes),s=n.getUTCSeconds()-(r.seconds-i.seconds);return n.setUTCHours(a),n.setUTCMinutes(o),n.setUTCSeconds(s),!t&&this._view.environment.lighting.autoUpdate(n,r)}_resetReferencePosition(e=!1){this._referencePositionGeographic=null,e&&this._cameraHandler()}};e([o()],j.prototype,`_view`,void 0),e([o({type:Boolean,readOnly:!0})],j.prototype,`updating`,null),e([o()],j.prototype,`weatherEnabled`,null),e([o()],j.prototype,`_weatherAvailable`,null),e([o()],j.prototype,`shadowsAvailable`,void 0),e([o()],j.prototype,`referencePositionGeographic`,null),e([o()],j.prototype,`_referencePositionGeographic`,void 0),e([o()],j.prototype,`_canProjectCameraPosition`,null),j=e([s(`esri.views.3d.environment.EnvironmentView`)],j);const M=h(.22,.22,.33),N=h(.22,.22,.22),P=m(),F={zConversionDisabled:!0};export{j as EnvironmentView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{handlesGroup as t,makeHandle as n}from"../../../../../core/handleUtils.js";import{destroyMaybe as r,removeMaybe as i}from"../../../../../core/maybe.js";import{watch as a,syncAndInitial as o,initial as s,when as c}from"../../../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../../../core/accessorSupport/decorators.js";import{set as d}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import p from"../../../../../geometry/Point.js";import{getEffectiveElevationInfo as m,getEffectiveElevationMode as h}from"../../../../../support/elevationInfoUtils.js";import g from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as _}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as v}from"../../SnappingVisualizer3D.js";import{meshTransformFastUpdateHandles as y}from"../meshFastUpdateUtils.js";import{Settings as b}from"../settings.js";import{ExtendedLineVisualElement as x}from"../../visualElements/ExtendedLineVisualElement.js";import{OutlineVisualElement as S}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as C}from"../../visualElements/VerticesVisualElement.js";import{evaluateElevationAlignmentAtPoint as w}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as T}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as E}from"../../../layers/graphics/GraphicState.js";import{DrawGraphicTool as D,geometryTypeToDrawOperationGeometryType as O}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as k}from"../../../../draw/DrawOperation.js";import{ElevationDrawSurface as A,SceneDrawSurface as j}from"../../../../draw/drawSurfaces.js";import{updateMeshTransformFromTooltipInfo as M}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{autorun as N}from"../../../../../core/accessorSupport/trackingUtils.js";let P=class extends D{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this._verticalLineVisualElement=null,this._settings=new b({getTheme:()=>this.view.effectiveTheme}),this.geometryType=null,this.type=`draw-3d`}initialize(){let{mode:e,offset:t,unit:n,featureExpressionInfo:r}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new g({mode:e,offset:t,unit:n,featureExpressionInfo:r})}normalizeCtorArgs(e){if(!e.elevationInfo){let t=e.hasZ??!0;return{...e,elevationInfo:m(t)}}return e}initializeGraphic(e){let{view:n}=this,r=this._createGraphicState=new E({graphic:e});return t([n.maskOccludee(e),n.trackGraphicState(r),a(()=>({element:this._outlineVisualElement,isDraped:r.isDraped}),({element:e,isDraped:t})=>{e&&(e.isDraped=t)},o),N(()=>{M(this.tooltipInfos.mesh,this.geometryToPlace)}),this._setupLoadingIndicator(r),...y(r)])}makeDrawOperation(){let{geometryType:e}=this,t=e!==`circle`&&e!==`rectangle`;return new k({view:this.view,manipulators:this.manipulators,geometryType:O(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new j(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new A(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new v,segmentLabels:t?new _:null,labelOptions:this.toolOptions.labels,isDraped:this._createGraphicState?this._createGraphicState.isDraped:h(this.hasZ,this.elevationInfo)===`on-the-ground`,cursor:this.cursor,constraintsEnabled:!0})}onActiveVertexChanged(e){let{view:i}=this;if(this._activeVertexVisualElement)return this._activeVertexVisualElement.vertices=[e],this._activeVertexVisualElement.recreate(),this._updateVerticalLineVisualElement(e),n();let a=this._settings,o=a.manipulators.vertex,c=new C({view:i,spatialReference:i.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,size:o.size,outlineSize:o.outlineSize,renderOccluded:o.renderOccluded,attached:!1,isDecoration:!0});this._activeVertexVisualElement=c;let l=a.visualElements.zVerticalLine,u=new x({view:i,extensionType:l.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._verticalLineVisualElement=u;let d=t([this._updatingHandles.add(()=>a.visualElements.zVerticalLine,e=>e.apply(u),s),this._updatingHandles.add(()=>({selectedColor:a.colors.selected.toUnitRGBA(),outlineColor:a.manipulators.vertex.outlineColor.toUnitRGBA()}),({selectedColor:e,outlineColor:t})=>{c.color=e,c.outlineColor=t},s),n(()=>{this._activeVertexVisualElement=r(this._activeVertexVisualElement),this._verticalLineVisualElement=r(this._verticalLineVisualElement)})]);return c.attached=!0,this._updateVerticalLineVisualElement(e),d}_updateVerticalLineVisualElement(e){let t=this._verticalLineVisualElement;if(!t)return;let{renderCoordsHelper:n,elevationProvider:r}=this.view;d(I,e[0],e[1],e[2]),F.setFromElevationInfo(this.elevationInfo),L.x=I[0],L.y=I[1],L.z=I[2],L.spatialReference=this.view.spatialReference,I[2]=w(L,r,F,n),n.toRenderCoords(I,this.view.spatialReference,I)?(t.setStartEndFromWorldDownAtLocation(I),t.attached=!0):t.attached=!1}onOutlineChanged(e){if(this._outlineVisualElement)return this._outlineVisualElement.geometry=e,n();let i=this.internalGraphicsLayer.elevationInfo,{view:a}=this,o=this._settings,c=new S({view:a,geometry:e,elevationInfo:i,isDraped:this._createGraphicState?this._createGraphicState.isDraped:h(this.hasZ,i)===`on-the-ground`,attached:!1,isDecoration:!0});this._outlineVisualElement=c;let l=t([this._updatingHandles.add(()=>o.visualElements.lineObjects.outline,e=>e.apply(c),s),this._updatingHandles.add(()=>o.visualElements.lineObjects.shadowStyle,e=>e.apply(c),s),n(()=>{this._outlineVisualElement=r(this._outlineVisualElement)})]);return c.attached=!0,c.laserlineEnabled=!0,l}onRegularVerticesChanged(e){if(this._verticesVisualElement)return this._verticesVisualElement.vertices=e,n();let{view:i}=this,a=this._settings,o=a.manipulators.vertex,c=new C({view:i,spatialReference:i.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,size:o.size,outlineSize:o.outlineSize,renderOccluded:o.renderOccluded,attached:!1,isDecoration:!0}),l=t([this._updatingHandles.add(()=>({color:a.manipulators.vertex.color.toUnitRGBA(),outlineColor:a.manipulators.vertex.outlineColor.toUnitRGBA()}),({color:e,outlineColor:t})=>{c.color=e,c.outlineColor=t},s),n(()=>{this._verticesVisualElement=r(this._verticesVisualElement)})]);return c.attached=!0,this._verticesVisualElement=c,l}updateGraphicGeometry(e){if(this.geometryType===`mesh`&&e?.type===`point`){let t=this.geometryToPlace;t?.centerAt(e),M(this.tooltipInfos.mesh,t);let n=this._graphic;t&&n.geometry===t||(n.geometry=t)}else super.updateGraphicGeometry(e)}_setupLoadingIndicator(e){let{drawOperation:r}=this;if(!this.geometryToPlace||e.displaying)return r.loading=!1,null;r.loading=!0;let a=n(()=>{r.loading=!1}),s,l=()=>{s&&cancelAnimationFrame(s)},u=()=>{l(),s=requestAnimationFrame(()=>a.remove())},d=null;return d=e.on(`changed`,()=>{d=i(d),u()}),t([d,c(()=>e.displaying,u,{...o,once:!0}),n(l),a])}};e([l({constructOnly:!0})],P.prototype,`elevationInfo`,void 0),e([l({constructOnly:!0})],P.prototype,`geometryType`,void 0),e([l()],P.prototype,`type`,void 0),e([l({constructOnly:!0})],P.prototype,`view`,void 0),P=e([u(`esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D`)],P);const F=new T,I=f(),L=new p;export{P as DrawGraphicTool3D};
2
+ import{__decorate as e}from"tslib";import{handlesGroup as t,makeHandle as n}from"../../../../../core/handleUtils.js";import{destroyMaybe as r,removeMaybe as i}from"../../../../../core/maybe.js";import{watch as a,syncAndInitial as o,initial as s,when as c}from"../../../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../../../core/accessorSupport/decorators.js";import{set as d}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import p from"../../../../../geometry/Point.js";import{getEffectiveElevationMode as m,getEffectiveElevationInfo as h}from"../../../../../support/elevationInfoUtils.js";import g from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as _}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as v}from"../../SnappingVisualizer3D.js";import{meshTransformFastUpdateHandles as y}from"../meshFastUpdateUtils.js";import{Settings as b}from"../settings.js";import{ExtendedLineVisualElement as x}from"../../visualElements/ExtendedLineVisualElement.js";import{OutlineVisualElement as S}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as C}from"../../visualElements/VerticesVisualElement.js";import{evaluateElevationAlignmentAtPoint as w}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as T}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as E}from"../../../layers/graphics/GraphicState.js";import{DrawGraphicTool as D,geometryTypeToDrawOperationGeometryType as O}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as k}from"../../../../draw/DrawOperation.js";import{ElevationDrawSurface as A,SceneDrawSurface as j}from"../../../../draw/drawSurfaces.js";import{updateMeshTransformFromTooltipInfo as M}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{autorun as N}from"../../../../../core/accessorSupport/trackingUtils.js";let P=class extends D{constructor(e){super(R(e)),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this._verticalLineVisualElement=null,this._settings=new b({getTheme:()=>this.view.effectiveTheme}),this.geometryType=null,this.type=`draw-3d`}initialize(){let{mode:e,offset:t,unit:n,featureExpressionInfo:r}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new g({mode:e,offset:t,unit:n,featureExpressionInfo:r})}initializeGraphic(e){let{view:n}=this,r=this._createGraphicState=new E({graphic:e});return t([n.maskOccludee(e),n.trackGraphicState(r),a(()=>({element:this._outlineVisualElement,isDraped:r.isDraped}),({element:e,isDraped:t})=>{e&&(e.isDraped=t)},o),N(()=>{M(this.tooltipInfos.mesh,this.geometryToPlace)}),this._setupLoadingIndicator(r),...y(r)])}makeDrawOperation(){let{geometryType:e}=this,t=e!==`circle`&&e!==`rectangle`;return new k({view:this.view,manipulators:this.manipulators,geometryType:O(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new j(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new A(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new v,segmentLabels:t?new _:null,labelOptions:this.toolOptions.labels,isDraped:this._createGraphicState?this._createGraphicState.isDraped:m(this.hasZ,this.elevationInfo)===`on-the-ground`,cursor:this.cursor,constraintsEnabled:!0})}onActiveVertexChanged(e){let{view:i}=this;if(this._activeVertexVisualElement)return this._activeVertexVisualElement.vertices=[e],this._activeVertexVisualElement.recreate(),this._updateVerticalLineVisualElement(e),n();let a=this._settings,o=a.manipulators.vertex,c=new C({view:i,spatialReference:i.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,size:o.size,outlineSize:o.outlineSize,renderOccluded:o.renderOccluded,attached:!1,isDecoration:!0});this._activeVertexVisualElement=c;let l=a.visualElements.zVerticalLine,u=new x({view:i,extensionType:l.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._verticalLineVisualElement=u;let d=t([this._updatingHandles.add(()=>a.visualElements.zVerticalLine,e=>e.apply(u),s),this._updatingHandles.add(()=>({selectedColor:a.colors.selected.toUnitRGBA(),outlineColor:a.manipulators.vertex.outlineColor.toUnitRGBA()}),({selectedColor:e,outlineColor:t})=>{c.color=e,c.outlineColor=t},s),n(()=>{this._activeVertexVisualElement=r(this._activeVertexVisualElement),this._verticalLineVisualElement=r(this._verticalLineVisualElement)})]);return c.attached=!0,this._updateVerticalLineVisualElement(e),d}_updateVerticalLineVisualElement(e){let t=this._verticalLineVisualElement;if(!t)return;let{renderCoordsHelper:n,elevationProvider:r}=this.view;d(I,e[0],e[1],e[2]),F.setFromElevationInfo(this.elevationInfo),L.x=I[0],L.y=I[1],L.z=I[2],L.spatialReference=this.view.spatialReference,I[2]=w(L,r,F,n),n.toRenderCoords(I,this.view.spatialReference,I)?(t.setStartEndFromWorldDownAtLocation(I),t.attached=!0):t.attached=!1}onOutlineChanged(e){if(this._outlineVisualElement)return this._outlineVisualElement.geometry=e,n();let i=this.internalGraphicsLayer.elevationInfo,{view:a}=this,o=this._settings,c=new S({view:a,geometry:e,elevationInfo:i,isDraped:this._createGraphicState?this._createGraphicState.isDraped:m(this.hasZ,i)===`on-the-ground`,attached:!1,isDecoration:!0});this._outlineVisualElement=c;let l=t([this._updatingHandles.add(()=>o.visualElements.lineObjects.outline,e=>e.apply(c),s),this._updatingHandles.add(()=>o.visualElements.lineObjects.shadowStyle,e=>e.apply(c),s),n(()=>{this._outlineVisualElement=r(this._outlineVisualElement)})]);return c.attached=!0,c.laserlineEnabled=!0,l}onRegularVerticesChanged(e){if(this._verticesVisualElement)return this._verticesVisualElement.vertices=e,n();let{view:i}=this,a=this._settings,o=a.manipulators.vertex,c=new C({view:i,spatialReference:i.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,size:o.size,outlineSize:o.outlineSize,renderOccluded:o.renderOccluded,attached:!1,isDecoration:!0}),l=t([this._updatingHandles.add(()=>({color:a.manipulators.vertex.color.toUnitRGBA(),outlineColor:a.manipulators.vertex.outlineColor.toUnitRGBA()}),({color:e,outlineColor:t})=>{c.color=e,c.outlineColor=t},s),n(()=>{this._verticesVisualElement=r(this._verticesVisualElement)})]);return c.attached=!0,this._verticesVisualElement=c,l}updateGraphicGeometry(e){if(this.geometryType===`mesh`&&e?.type===`point`){let t=this.geometryToPlace;t?.centerAt(e),M(this.tooltipInfos.mesh,t);let n=this._graphic;t&&n.geometry===t||(n.geometry=t)}else super.updateGraphicGeometry(e)}_setupLoadingIndicator(e){let{drawOperation:r}=this;if(!this.geometryToPlace||e.displaying)return r.loading=!1,null;r.loading=!0;let a=n(()=>{r.loading=!1}),s,l=()=>{s&&cancelAnimationFrame(s)},u=()=>{l(),s=requestAnimationFrame(()=>a.remove())},d=null;return d=e.on(`changed`,()=>{d=i(d),u()}),t([d,c(()=>e.displaying,u,{...o,once:!0}),n(l),a])}};e([l({constructOnly:!0})],P.prototype,`elevationInfo`,void 0),e([l({constructOnly:!0})],P.prototype,`geometryType`,void 0),e([l()],P.prototype,`type`,void 0),e([l({constructOnly:!0})],P.prototype,`view`,void 0),P=e([u(`esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D`)],P);const F=new T,I=f(),L=new p;function R(e){if(!e.elevationInfo){let t=e.hasZ??!0;return{...e,elevationInfo:h(t)}}return e}export{P as DrawGraphicTool3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{darken as e}from"../../../../../core/colorUtils.js";import{EventEmitter as t}from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{clamp as r}from"../../../../../core/mathUtils.js";import{removeMaybe as i}from"../../../../../core/maybe.js";import{watch as a}from"../../../../../core/reactiveUtils.js";import{translate as o,rotateX as s}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{dist as l,subtract as u,normalize as d,dot as f,cross as p,scale as m}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as h,create as g}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Manipulator3D as _}from"../../Manipulator3D.js";import{createManipulatorMaterial as v}from"../../manipulatorUtils.js";import{RenderObject as y}from"../../RenderObject.js";import{screenToZConstrained as b}from"../dragEventPipeline3D.js";import{Settings as x}from"../settings.js";import{discRadius as S}from"./config.js";import{Manipulation as C}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as w}from"./moveUtils.js";import{createTubeGeometry as T,createConeGeometry as E}from"../../../webgl-engine/lib/GeometryUtil.js";import{createManipulatorDragEventPipeline as D,addScreenDelta as O}from"../../../../interactive/dragEventPipeline.js";class k extends C{constructor(e){super(),this._radius=S,this.events=new t,this._tool=e.tool,this._view=e.view;let n=new x({getTheme:()=>this._view.effectiveTheme});this._settings=n,e.radius!=null&&(this._radius=e.radius);let r=this._view.effectiveTheme.accentColor;this._materials={materialUnfocused:v(A(r,1,.25),1),materialFocused:v(A(r,1,0),1),materialOccludedUnfocused:v(A(r,.7,0),n.zManipulator.renderOccluded),materialOccludedFocused:v(A(r,.85,0),n.zManipulator.renderOccluded)},this._themeHandle=a(()=>this._view.effectiveTheme.accentColor,e=>{let t=A(e,1,.25),n=A(e,1,0),r=A(e,.7,0),i=A(e,.85,0),{materialUnfocused:a,materialFocused:o,materialOccludedUnfocused:s,materialOccludedFocused:c}=this._materials;a.setParameters({color:t}),o.setParameters({color:n}),s.setParameters({color:r}),c.setParameters({color:i})}),this._createManipulator(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}destroy(){this._themeHandle=i(this._themeHandle),this._manipulator.applyObjectTransform=P,this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()})}forEachManipulator(e){e(this._manipulator,0)}createManipulatedObjectDragPipeline(e,t,r){if(!t.operations)return n();let i=t.operations.data.spatialReference;return w(t,r,t=>this.createDragPipeline((n,r,i,a,o)=>({steps:r,cancel:i}=e(n,r,i,a,o),t(n,r,i)),i))}createDragPipeline(e,t){let n=this._view;return D(this._manipulator,(r,i,a,o,s)=>{e(r,i.next(e=>({...e,manipulatorType:0})).next(b(n,r.renderLocation,t)).next(O()),a,o,s)})}get radius(){return this._radius}set radius(e){e!==this._radius&&(this._radius=e,this._updateManipulator())}_updateManipulator(){let e=this._settings,t=this._radius/S,n=e.zManipulator.height*t,r=e.zManipulator.coneHeight*t,i=e.zManipulator.coneWidth*t,a=e.zManipulator.width*t,l=[h(0,0,0),h(0,0,n)],u=[h(0,0,0),h(0,0,n+r)],d=(e=>{let t=c();return o(t,t,[0,0,n]),s(t,t,Math.PI/2),t})(),{materialUnfocused:f,materialFocused:p,materialOccludedUnfocused:m,materialOccludedFocused:g}=this._materials,_=T(f,l,a/2,16,!1),v=E(f,r,i/2,16,!1);v.transformation=d,this._manipulator.renderObjects=[new y(v,1),new y(_,1),new y(v.instantiate({material:p}),2),new y(_.instantiate({material:p}),2),new y(v.instantiate({material:m}),1),new y(_.instantiate({material:m}),1),new y(v.instantiate({material:g}),2),new y(_.instantiate({material:g}),2)],this._manipulator.radius=a/2+2,this._manipulator.collisionType={type:`line`,paths:[u]}}_createManipulator(){let e=this._view,t=new _({view:e,autoScaleRenderObjects:!1,worldSized:!1,selectable:!1,cursor:`ns-resize`,elevationInfo:this.elevationInfo,worldOriented:!0,collisionPriority:1.6});t.applyObjectTransform=t=>{let n=e.state.camera,i=j;e.renderCoordsHelper.toRenderCoords(this._manipulator.elevationAlignedLocation,i);let a=l(n.eye,i),o=n.computeRenderPixelSizeAtDistance(a),s=u(M,i,n.eye);d(s,s);let c=N;e.renderCoordsHelper.worldUpAtPosition(j,c);let h=Math.abs(f(s,c)),g=p(M,s,c),_=p(M,g,c),v=r(h,.01,1),y=1-Math.sqrt(1-v*v)/v/n.fullWidth,b=this._settings,x=this._radius/S,C=b.zManipulator.width*x;m(_,d(_,_),(1/y-1)*a+o*C),t[12]-=M[0],t[13]-=M[1],t[14]-=M[2]},this._manipulator=t,this._updateManipulator()}get test(){}}function A(t,n,r){let i=e(t,r);return i.a*=n,i.toUnitRGBA()}const j=g(),M=g(),N=g(),P=()=>{};export{k as MoveZManipulation};
2
+ import{darken as e}from"../../../../../core/colorUtils.js";import{EventEmitter as t}from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{clamp as r}from"../../../../../core/mathUtils.js";import{removeMaybe as i}from"../../../../../core/maybe.js";import{watch as a}from"../../../../../core/reactiveUtils.js";import{translate as o,rotateX as s}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{dist as l,subtract as u,normalize as d,dot as f,cross as p,scale as m}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as h,create as g}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Manipulator3D as _}from"../../Manipulator3D.js";import{createManipulatorMaterial as v}from"../../manipulatorUtils.js";import{RenderObject as y}from"../../RenderObject.js";import{screenToZConstrained as b}from"../dragEventPipeline3D.js";import{Settings as x}from"../settings.js";import{discRadius as S}from"./config.js";import{Manipulation as C}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as w}from"./moveUtils.js";import{createTubeGeometry as T,createConeGeometry as E}from"../../../webgl-engine/lib/GeometryUtil.js";import{createManipulatorDragEventPipeline as D,addScreenDelta as O}from"../../../../interactive/dragEventPipeline.js";class k extends C{constructor(e){super(),this._radius=S,this.events=new t,this._tool=e.tool,this._view=e.view;let n=new x({getTheme:()=>this._view.effectiveTheme});this._settings=n,e.radius!=null&&(this._radius=e.radius);let r=this._view.effectiveTheme.accentColor;this._materials={materialUnfocused:v(A(r,1,.25),1),materialFocused:v(A(r,1,0),1),materialOccludedUnfocused:v(A(r,.7,0),n.zManipulator.renderOccluded),materialOccludedFocused:v(A(r,.85,0),n.zManipulator.renderOccluded)},this._themeHandle=a(()=>this._view.effectiveTheme.accentColor,e=>{let t=A(e,1,.25),n=A(e,1,0),r=A(e,.7,0),i=A(e,.85,0),{materialUnfocused:a,materialFocused:o,materialOccludedUnfocused:s,materialOccludedFocused:c}=this._materials;a.setParameters({color:t}),o.setParameters({color:n}),s.setParameters({color:r}),c.setParameters({color:i})}),this._createManipulator(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}destroy(){this._themeHandle=i(this._themeHandle),this._manipulator.applyObjectTransform=P,this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()})}forEachManipulator(e){e(this._manipulator,0)}createManipulatedObjectDragPipeline(e,t,r){if(!t.operations)return n();let i=t.operations.data.spatialReference;return w(t,r,t=>this.createDragPipeline((n,r,i,a,o)=>({steps:r,cancel:i}=e(n,r,i,a,o),t(n,r,i)),i))}createDragPipeline(e,t){let n=this._view;return D(this._manipulator,(r,i,a,o,s)=>{e(r,i.next(e=>({...e,manipulatorType:0})).next(b(n,r.renderLocation,t)).next(O()),a,o,s)})}get radius(){return this._radius}set radius(e){e!==this._radius&&(this._radius=e,this._updateManipulator())}_updateManipulator(){let e=this._settings,t=this._radius/S,n=e.zManipulator.height*t,r=e.zManipulator.coneHeight*t,i=e.zManipulator.coneWidth*t,a=e.zManipulator.width*t,l=[h(0,0,0),h(0,0,n)],u=[h(0,0,0),h(0,0,n+r)],d=c();o(d,d,[0,0,n]),s(d,d,Math.PI/2);let{materialUnfocused:f,materialFocused:p,materialOccludedUnfocused:m,materialOccludedFocused:g}=this._materials,_=T(f,l,a/2,16,!1),v=E(f,r,i/2,16,!1);v.transformation=d,this._manipulator.renderObjects=[new y(v,1),new y(_,1),new y(v.instantiate({material:p}),2),new y(_.instantiate({material:p}),2),new y(v.instantiate({material:m}),1),new y(_.instantiate({material:m}),1),new y(v.instantiate({material:g}),2),new y(_.instantiate({material:g}),2)],this._manipulator.radius=a/2+2,this._manipulator.collisionType={type:`line`,paths:[u]}}_createManipulator(){let e=this._view,t=new _({view:e,autoScaleRenderObjects:!1,worldSized:!1,selectable:!1,cursor:`ns-resize`,elevationInfo:this.elevationInfo,worldOriented:!0,collisionPriority:1.6});t.applyObjectTransform=t=>{let n=e.state.camera,i=j;e.renderCoordsHelper.toRenderCoords(this._manipulator.elevationAlignedLocation,i);let a=l(n.eye,i),o=n.computeRenderPixelSizeAtDistance(a),s=u(M,i,n.eye);d(s,s);let c=N;e.renderCoordsHelper.worldUpAtPosition(j,c);let h=Math.abs(f(s,c)),g=p(M,s,c),_=p(M,g,c),v=r(h,.01,1),y=1-Math.sqrt(1-v*v)/v/n.fullWidth,b=this._settings,x=this._radius/S,C=b.zManipulator.width*x;m(_,d(_,_),(1/y-1)*a+o*C),t[12]-=M[0],t[13]-=M[1],t[14]-=M[2]},this._manipulator=t,this._updateManipulator()}get test(){}}function A(t,n,r){let i=e(t,r);return i.a*=n,i.toUnitRGBA()}const j=g(),M=g(),N=g(),P=()=>{};export{k as MoveZManipulation};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{clamp as e}from"../../../../core/mathUtils.js";import{normalFromMat4 as t,identity as n}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{subtract as a,add as o,set as s,transformMat4 as c,transformMat3 as l,normalize as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{UNIT_Z as d,create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as p,copy as m}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectVectorToVector as g}from"../../../../geometry/projection/projectVectorToVector.js";import{expandWithBuffer as _}from"../../../../geometry/support/aaBoundingBox.js";import{StageObjectVisualElement as v}from"./StageObjectVisualElement.js";import{evaluateElevationAlignmentAtPoint as y}from"../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as b}from"../../layers/graphics/ElevationContext.js";import{defaultBoundingBox as x,requiresHalfTexelOffset as S,defaultSymbolSizeRatio as C,createTexture as w}from"../../support/engineContent/sdfPrimitives.js";import{updateObjectVertexField as T,updateVertexFieldVec3f as E}from"../../webgl-engine/lib/bufferGeometryUtils.js";import{BufferObject3D as D}from"../../webgl-engine/lib/BufferObject3D.js";import{createPointBufferGeometry as O}from"../../webgl-engine/lib/GeometryUtil.js";import{HUDMaterial as k}from"../../webgl-engine/materials/HUDMaterial.js";class A extends v{constructor(e){super(e),this._material=null,this._texture=null,this._geometry=null,this._size=3,this._color=h(1,0,1,1),this._pixelSnappingEnabled=!0,this._primitive=`square`,this._outlineSize=1,this._outlineColor=h(1,1,1,1),this._elevationInfo=null,this.applyProperties(e)}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get size(){return this._size}set size(e){if(e!==this._size){let t=this._preferredTextureSize;this._size=e,t<this._preferredTextureSize?this.recreate():this._updateSizeParameter()}}get color(){return this._color}set color(e){p(e,this._color)||(m(this._color,e),this._updateMaterial())}get pixelSnappingEnabled(){return this._pixelSnappingEnabled}set pixelSnappingEnabled(e){this._pixelSnappingEnabled!==e&&(this._pixelSnappingEnabled=e,this._updateMaterial())}get primitive(){return this._primitive}set primitive(e){this._primitive!==e&&(this._primitive=e,this.recreate())}get outlineSize(){return this._outlineSize}set outlineSize(e){e!==this._outlineSize&&(this._outlineSize=e,this._updateMaterial())}get outlineColor(){return this._outlineColor}set outlineColor(e){p(e,this._outlineColor)||(m(this._outlineColor,e),this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}_updateMaterial(){this._material?.setParameters(this._materialParameters)}_updateSizeParameter(){if(this.object?.geometries[0]==null)return;let e=this._geometrySize;this._material?.setParameters({size:i(e,e)})}get _materialParameters(){let e=this._geometrySize;return{color:this._color,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:S(this._primitive),distanceFieldBoundingBox:x,outlineColor:this._outlineColor,outlineSize:this._outlineSize,textureId:this._texture?.id,shaderPolygonOffset:0,drawAsLabel:!0,depthEnabled:!1,pixelSnappingEnabled:this.pixelSnappingEnabled,isDecoration:this.isDecoration,size:i(e,e)}}get _geometrySize(){return this._size/C}createExternalResources(){this._texture=w(this._primitive,this._preferredTextureSize),this._material=new k(this._materialParameters,this.view.state.viewingMode===1);let e=this.view.stage;this._texture.load(e.renderView.renderingContext),e.addTexture(this._texture)}destroyExternalResources(){this._texture&&=(this.view.stage.removeTexture(this._texture),this._texture.dispose(),null),this._material=null}createObject(){return new D({geometries:[]})}updateObjectTransform(e){let t=e.geometries[0],n=this.geometry;t!=null&&n!=null&&(this._computeRenderPositionAndNormal(j,M,n),this.view.stage.localOriginFactory.needsOriginUpdate(t.localOrigin,j,0)?this.recreateGeometry():(a(j,j,t.localOrigin.vec3),T(e,E,t,`position`,0,j),T(e,E,t,`normal`,0,M)))}createGeometries(e){let t=this._createRenderGeometry();t!=null&&e.addGeometry(t)}forEachMaterial(e){e(this._material)}get _preferredTextureSize(){return e(this._geometrySize*2,16,128)}calculateMapBounds(e){let t=this.object?.geometries[0];return t?(t.readPrimitivePosition(j,0),o(j,j,t.localOrigin.vec3),g(j,this.view.renderCoordsHelper.spatialReference,j,this.view.spatialReference),_(e,j),!0):!1}_createRenderGeometry(){let{geometry:e,_material:t}=this;if(e==null||t==null)return null;this._computeRenderPositionAndNormal(j,M,e);let n=this.view.stage.localOriginFactory.getOrigin(j);return O(t,n,{position:j,normal:M})}_computeRenderPositionAndNormal(e,r,i){let{renderCoordsHelper:a,elevationProvider:o}=this.view,f=y(i,o,b.fromElevationInfo(this.elevationInfo),a);s(j,i.x,i.y,f),g(j,i.spatialReference,e,a.spatialReference),c(e,e,this.transform),t(N,this.transform)??n(N),l(r,d,N),u(r,r)}}const j=f(),M=f(),N=r();export{A as PointVisualElement};
2
+ import{clamp as e}from"../../../../core/mathUtils.js";import{normalFromMat4 as t,identity as n}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{subtract as a,add as o,set as s,transformMat4 as c,transformMat3 as l,normalize as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{UNIT_Z as d,create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as p,copy as m}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectVectorToVector as g}from"../../../../geometry/projection/projectVectorToVector.js";import{expandWithBuffer as _}from"../../../../geometry/support/aaBoundingBox.js";import{StageObjectVisualElement as v}from"./StageObjectVisualElement.js";import{evaluateElevationAlignmentAtPoint as y}from"../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as b}from"../../layers/graphics/ElevationContext.js";import{defaultBoundingBox as x,requiresHalfTexelOffset as S,defaultSymbolSizeRatio as C,createTexture as w}from"../../support/engineContent/sdfPrimitives.js";import{updateObjectVertexField as T,updateVertexFieldVec3f as E}from"../../webgl-engine/lib/bufferGeometryUtils.js";import{BufferObject3D as D}from"../../webgl-engine/lib/BufferObject3D.js";import{createPointBufferGeometry as O}from"../../webgl-engine/lib/GeometryUtil.js";import{HUDMaterial as k}from"../../webgl-engine/materials/HUDMaterial.js";class A extends v{constructor(e){super(e),this._material=null,this._texture=null,this._geometry=null,this._size=3,this._color=h(1,0,1,1),this._pixelSnappingEnabled=!0,this._primitive=`square`,this._outlineSize=1,this._outlineColor=h(1,1,1,1),this._elevationInfo=null,this.applyProperties(e)}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get size(){return this._size}set size(e){if(e!==this._size){let t=this._preferredTextureSize;this._size=e,t<this._preferredTextureSize?this.recreate():this._updateSizeParameter()}}get color(){return this._color}set color(e){p(e,this._color)||(m(this._color,e),this._updateMaterial())}get pixelSnappingEnabled(){return this._pixelSnappingEnabled}set pixelSnappingEnabled(e){this._pixelSnappingEnabled!==e&&(this._pixelSnappingEnabled=e,this._updateMaterial())}get primitive(){return this._primitive}set primitive(e){this._primitive!==e&&(this._primitive=e,this.recreate())}get outlineSize(){return this._outlineSize}set outlineSize(e){e!==this._outlineSize&&(this._outlineSize=e,this._updateMaterial())}get outlineColor(){return this._outlineColor}set outlineColor(e){p(e,this._outlineColor)||(m(this._outlineColor,e),this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}_updateMaterial(){this._material?.setParameters(this._materialParameters)}_updateSizeParameter(){if(this.object?.geometries[0]==null)return;let e=this._geometrySize;this._material?.setParameters({size:i(e,e)})}get _materialParameters(){let e=this._geometrySize;return{color:this._color,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:S(this._primitive),distanceFieldBoundingBox:x,outlineColor:this._outlineColor,outlineSize:this._outlineSize,textureId:this._texture?.id,shaderPolygonOffset:0,drawAsLabel:!0,depthEnabled:!1,pixelSnappingEnabled:this.pixelSnappingEnabled,isDecoration:this.isDecoration,size:i(e,e)}}get _geometrySize(){return this._size/C}createExternalResources(){this._texture=w(this._primitive,this._preferredTextureSize),this._material=new k(this._materialParameters,this.view.state.isGlobal);let e=this.view.stage;this._texture.load(e.renderView.renderingContext),e.addTexture(this._texture)}destroyExternalResources(){this._texture&&=(this.view.stage.removeTexture(this._texture),this._texture.dispose(),null),this._material=null}createObject(){return new D({geometries:[]})}updateObjectTransform(e){let t=e.geometries[0],n=this.geometry;t!=null&&n!=null&&(this._computeRenderPositionAndNormal(j,M,n),this.view.stage.localOriginFactory.needsOriginUpdate(t.localOrigin,j,0)?this.recreateGeometry():(a(j,j,t.localOrigin.vec3),T(e,E,t,`position`,0,j),T(e,E,t,`normal`,0,M)))}createGeometries(e){let t=this._createRenderGeometry();t!=null&&e.addGeometry(t)}forEachMaterial(e){e(this._material)}get _preferredTextureSize(){return e(this._geometrySize*2,16,128)}calculateMapBounds(e){let t=this.object?.geometries[0];return t?(t.readPrimitivePosition(j,0),o(j,j,t.localOrigin.vec3),g(j,this.view.renderCoordsHelper.spatialReference,j,this.view.spatialReference),_(e,j),!0):!1}_createRenderGeometry(){let{geometry:e,_material:t}=this;if(e==null||t==null)return null;this._computeRenderPositionAndNormal(j,M,e);let n=this.view.stage.localOriginFactory.getOrigin(j);return O(t,n,{position:j,normal:M})}_computeRenderPositionAndNormal(e,r,i){let{renderCoordsHelper:a,elevationProvider:o}=this.view,f=y(i,o,b.fromElevationInfo(this.elevationInfo),a);s(j,i.x,i.y,f),g(j,i.spatialReference,e,a.spatialReference),c(e,e,this.transform),t(N,this.transform)??n(N),l(r,d,N),u(r,r)}}const j=f(),M=f(),N=r();export{A as PointVisualElement};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../Color.js";import n from"../../../Graphic.js";import{removeUnordered as r,isSome as i}from"../../../core/arrayUtils.js";import has from"../../../core/has.js";import a from"../../../core/Logger.js";import{equals as o}from"../../../core/MapUtils.js";import{destroyMaybe as s}from"../../../core/maybe.js";import c from"../../../core/PooledArray.js";import{ignoreAbortErrors as l,isAbortError as u,throwIfAborted as d}from"../../../core/promiseUtils.js";import{initial as f,watch as p}from"../../../core/reactiveUtils.js";import{schedule as m}from"../../../core/scheduling.js";import{equals as h}from"../../../core/SetUtils.js";import{isArrayBuffer as g}from"../../../core/typedArrayUtil.js";import{property as _,subclass as v}from"../../../core/accessorSupport/decorators.js";import{fromMat4 as y,exactEquals as ee,invert as te}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as ne,IDENTITY as re}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{multiply as ie,getTranslation as ae}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{clone as oe,create as se}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as ce}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{set as b,transformMat4 as x,transformMat3 as le,sub as ue,add as S,scale as de,subtract as C}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as T}from"../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as fe}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as E}from"../../../core/support/UpdatingHandles.js";import{getSphericalPCPF as D}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{localLinearScaleFactors as pe}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectBoundingSphere as me}from"../../../geometry/projection/projectBoundingSphere.js";import{projectBuffer as he}from"../../../geometry/projection/projectBuffer.js";import{getProjectorName as O}from"../../../geometry/projection/projectors.js";import{projectVectorToVector as k}from"../../../geometry/projection/projectVectorToVector.js";import{create as A,fromBuffer as ge,toRect as j}from"../../../geometry/support/aaBoundingBox.js";import{create as M,intersects as N}from"../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as P,ensurePackedMat4f64 as _e}from"../../../geometry/support/DoubleArray.js";import{compactFloatArray as ve}from"../../../geometry/support/FloatArray.js";import{compactIndices as ye}from"../../../geometry/support/Indices.js";import{Sphere as F}from"../../../geometry/support/sphere.js";import{newUByteArray as I}from"../../../geometry/support/UByteArray.js";import{fallbackObjectIDAttribute as L}from"../../../layers/LayerConstants.js";import be from"../../../layers/graphics/controllers/I3SOnDemandController.js";import{fixFields as xe}from"../../../layers/support/fieldUtils.js";import{I3SExtractChanges as Se}from"../../../layers/support/I3SExtractChanges.js";import R from"../../../layers/support/SceneModification.js";import{getColor as Ce,getOpacity as we}from"../../../renderers/visualVariables/support/visualVariableUtils.js";import{isBasemapLayerView as z}from"../../../support/basemapUtils.js";import{getElevationOffset as B}from"../../../support/elevationInfoUtils.js";import{loadArcade as Te}from"../../../support/loadArcade.js";import V from"../../../symbols/MeshSymbol3D.js";import Ee from"../../../symbols/SimpleFillSymbol.js";import{ContentGeometryUpdateEvent as De}from"./ContentGeometryLayerView.js";import Oe from"./I3SMeshViewLabeler.js";import{I3SMeshViewPerformanceInfo as ke}from"./I3SMeshViewPerformanceInfo.js";import{initialize as Ae,setModificationsSync as je,filterObbsForModificationsSync as Me,interpretObbModificationResults as Ne}from"./SceneLayerWorker.js";import{SceneLayerWorkerHandle as Pe,toWasmModification as Fe}from"./SceneLayerWorkerHandle.js";import{overrideColor as Ie}from"./graphics/graphicUtils.js";import{areLabelsVisible as Le}from"./graphics/Labeler.js";import Re from"./i3s/Highlights.js";import{I3SAsyncElevationUpdater as ze}from"./i3s/I3SAsyncElevationUpdater.js";import{getCachedAttributeValue as H}from"./i3s/I3SBinaryReader.js";import{I3SCrossfadeHelper as Be,NodeCrossfadeMetaData as Ve}from"./i3s/I3SCrossfadeHelper.js";import{boundingBoxCornerPoints as He}from"./i3s/I3SGeometryUtil.js";import{I3SIntersectionHandler as Ue,TraversedIntersectionNode as We}from"./i3s/I3SIntersectionHandler.js";import{getSupportedEncodings as Ge,selectEncoding as Ke,defaultMaterial as qe,createTexture as Je,configureMaterial as Ye}from"./i3s/I3SMaterialUtil.js";import{I3SOverrides as Xe}from"./i3s/I3SOverrides.js";import{computeGlobalTransformation as Ze}from"./i3s/I3SProjectionUtil.js";import{rendererNeedsTextures as Qe,checkSceneLayerValid as $e,checkSceneLayerCompatibleWithView as et,whenGraphicAttributes as tt,computeVisibilityObb as nt,filterInPlace as rt,intersectBoundingRectWithMbs as it,addWraparound as U,getSymbolInfo as at,transparentEdgeMaterial as W,getClipRect as ot}from"./i3s/I3SUtil.js";import{IDBCache as st}from"./i3s/IDBCache.js";import{IDBMockCache as ct}from"./i3s/IDBMockCache.js";import{LayerElevationProvider as lt}from"./i3s/LayerElevationProvider.js";import{SymbologyInfo as ut}from"./i3s/SymbologyInfo.js";import{attributeLookup as G}from"./support/attributeUtils.js";import{normalizeHighlightTarget as dt,emptyHighlightHandle as ft}from"./support/highlightUtils.js";import{makeScheduleFunction as pt}from"./support/makeScheduleFunction.js";import{debugFlags as K}from"../support/debugFlags.js";import{ElevationRange as q}from"../support/ElevationRange.js";import{toBoundingRect as mt}from"../support/extentUtils.js";import{Obb as J,ensurePackedObbData as ht}from"../support/orientedBoundingBox.js";import{updatingProgress as gt}from"../support/updatingProperties.js";import{glLayout as _t}from"../support/buffer/glUtil.js";import{ObjectParameters as vt}from"../webgl-engine/collections/Component/ObjectParameters.js";import{createVertexBufferLayout as yt,ComponentGeometryParameters as bt,SourceGeometry as xt,VertexBufferLayoutCreationParameters as St}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as Ct}from"../webgl-engine/collections/Component/Transform.js";import{emissiveStrengthDefault as Y}from"../webgl-engine/core/shaderLibrary/output/getEmissions.glsl.js";import{getHighlightName as wt}from"../../support/highlightOptionsUtils.js";import{TextureCompressionTracker as Tt}from"../../support/TextureCompressionTracker.js";import{alphaCutoff as Et}from"../../../webscene/support/AlphaCutoff.js";const Dt=[1,1,1,1];class Ot extends Ve{constructor(e,t,n,r,i,a,o,s,c,l,u){super(),this.node=e,this.featureIds=t,this.objectHandle=n,this.cachedRendererVersion=r,this.attributeInfo=i,this.material=a,this.textures=o,this.anchorIds=s,this.anchors=c,this._elevationAlignmentRange=new q,this._geometryElevationRange=new q,this.cachedElevationAnchors=null,this.cachedEdgeMaterials=[],this.edgeMemoryUsage=0,this.cachedSymbologyStride=5,this.elevationAlignmentOffset=0,this._baseGeometryElevationRange=new q(l,u),this.updateGeometryElevationRange()}get geometryElevationRange(){return this._geometryElevationRange}updateGeometryElevationRange(){let e=this._baseGeometryElevationRange;if(!e.elevationRangeValid||e.isEmpty){this._elevationAlignmentRange.invalidateElevationRange(),this._geometryElevationRange.invalidateElevationRange();return}let t=this.elevationOffsets;if(!t||t.length===0){let t=this.elevationAlignmentOffset;this._elevationAlignmentRange.setElevationRangeValues(t,t),this._geometryElevationRange.setElevationRangeValues(e.minElevation+t,e.maxElevation+t);return}let n=1/0,r=-1/0;for(let e=0;e<t.length;++e){let i=this.elevationAlignmentOffset+(t[e]??0);n=Math.min(n,i),r=Math.max(r,i)}this._elevationAlignmentRange.setElevationRangeValues(n,r),this._geometryElevationRange.setElevationRangeValues(e.minElevation+n,e.maxElevation+r)}get usedMemory(){return this.node.memory}get featureExtents(){return this._featureExtents??=new Float64Array(6*this.featureIds.length).fill(1/0),this._featureExtents}}const kt=t=>{let g=t,F=class extends g{constructor(){super(...arguments),this._extractChanges=null,this._applySSAO=!0,this._imShading=!!has(`enable-feature:im-shading`),this._imVertexNormals=!!has(`enable-feature:im-vertex-normals`),this._updatingHandles=new E,this._highlights=null,this._nodeId2Meta=new Map,this._nodeId2MetaReloading=new Map,this._i3sWasmLoaded=!1,this._snappingSourcesTrackers=[],this._compressionTracker=new Tt,this._hasLoadedPBRTextures=!1,this._asyncModuleLoading=0,this._addTasks=new Map,this._currentRenderer=null,this._rendererVersion=0,this._colorVariable=null,this._opacityVariable=null,this._rendererFields=null,this._symbologyFields=null,this._symbologyOverride=null,this._symbologyOverrideFields=null,this._symbolInfos=new Map,this._visibleGeometryChangedSchedulerHandle=null,this._hasComponentData=!1,this._hasVertexColors=!1,this._nodeColorOverride=null,this.updating=!0,this.holeFilling=`auto`,this._hasColors=!1,this._hasTextures=!1,this._hasData=!1,this.slicePlaneEnabled=!1,this._modifications=[],this.ignoresMemoryFactor=!1,this._layerUrl=``,this._cacheKeySuffix=null,this._meshUtilsImporterModule=null,this._meshUtilsImporterPromise=null,this._planetRadiusInGlobalMode=0,this._elevationTask=null,this._needFilterResolve=!1,this._filters=[],this._arcade=null,this._tmpAttributeOnlyGraphic=new n,this._crossfadeHelper=new Be(this)}get lodCrossfadeoutDuration(){return 0}get lodCrossfadeinDuration(){return 0}get lodCrossfadeUncoveredDuration(){return 0}get extractChanges(){return this._extractChanges?.layer!==this.layer&&(this._extractChanges?.destroy(),this._extractChanges=new Se({layer:this.layer})),this._extractChanges}get layerViewUid(){return this.uid}get layerId(){return this.layer.id}get sublayerId(){return null}get _isIntegratedMesh(){return this.layer.type===`integrated-mesh`}get contentVisible(){return!this.suspended&&this._controller?.rootNodeVisible&&this.fullOpacity>Et}get legendEnabled(){return this.contentVisible&&this.layer?.legendEnabled===!0}get updatingProgressValue(){return this._controller?.updatingProgress??0}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?`yes`:`probably-not`:`unknown`}get rendererTextureUsage(){return Qe(this._currentRenderer)?this._usePBR||this._hasLoadedPBRTextures?63:53:this._usePBR||this._hasLoadedPBRTextures?44:36}get elevationOffset(){let e=this.layer?.elevationInfo;return e?.mode===`absolute-height`?B(e,this.layer.spatialReference):0}get elevationInfo(){let e=this.layer?.elevationInfo;switch(e?.mode){case`absolute-height`:return new Z(0,B(e,this.layer.spatialReference));case`relative-to-ground`:return new Z(1,B(e,this.layer.spatialReference));case`on-the-ground`:return new Z(2,0);default:return new Z(0,0)}}get supportedTextureEncodings(){return Ge(this.view.stage.renderView.capabilities)}get clientGeometry(){return this.i3sOverrides.geometryOverrides}get elevationRange(){let e=this._nodeId2Meta,t=new q;for(let n of e.values()){let e=n?.geometryElevationRange;e?.elevationRangeValid&&!e.isEmpty&&t.expandElevationRange(e)}return t.elevationRangeValid&&!t.isEmpty?t:null}get fullExtent(){return this.layer.fullExtent}initialize(){let e=has(`enable-feature:idb-mock-cache`);this._idbCache=e?new ct(this.view,e):new st(`esri-scenelayer-cache`,`geometries`),this.addResolvingPromise(this.layer.indexInfo);let t=this.view.resourceController,n=t.memoryController;this.i3sOverrides=new Xe({view:this.view,layer:this.layer,memoryController:n,extractChanges:this.extractChanges}),this._workerHandle=new Pe(pt(t)),this.addResolvingPromise(this._workerHandle.promise),$e(this.layer),et(this.layer,this.view);let r=this.layer.store.defaultGeometrySchema;if(this.addResolvingPromise(this._workerHandle.setLegacySchema(this.uid,r).catch(l)),this._layerUrl=this.layer.parsedUrl.path,this._controller=new be({layerView:this,worker:this._workerHandle}),this._gpuMemoryEstimate=0,this._texMemoryEstimate=0,this._geoMemoryEstimate=0,this._stage=this.view.stage,this._collection=this._stage.renderView.componentObjectCollection,this._isIntegratedMesh||!r)this._hasComponentData=!1;else{let e=r.featureAttributes;this._hasComponentData=!!(e&&e.faceRange&&e.id)}this._hasVertexColors=(r?.vertexAttributes.color??null)!=null&&!this.layer.cachedDrawingInfo?.color;let i=this.view.resourceController.memoryController.newCache(`sl-${this.uid}`,e=>this._deleteComponentObject(e));this._memCache=i;let o=this._controller,c=this._nodeId2Meta,u=this._nodeId2MetaReloading;function*d(e){let t=o.index;if(!t)return;let n=t.rootNode;if(!n)return;let r=null;for(let i of t.traverseValues(n,t=>(r=(c.get(t.index)||u.get(t.index))?.objectHandle??null,e(t,r))))yield new We(i,r)}this._intersectionHandler=new Ue({layerViewUid:this.layerViewUid,sublayerId:this.sublayerId,collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:has(`enable-feature:im-as-ground`)?this.layer.isUsedAsGroundLayer:this._isIntegratedMesh,traverseNodeHierarchy:d}),this._elevationProvider=new lt({view:this.view,layerElevationSource:this,intersectionHandler:this._intersectionHandler}),this._hasLoadedPBRTextures=this._usePBR,this._updatingHandles.add(()=>this.view.clippingArea,()=>this._clippingAreaChanged(),f),this._updatingHandles.add(()=>this.fullOpacity,e=>this._opacityChange(e)),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this.elevationOffset,(e,t)=>{this._reloadAll(t),this._controller.invalidateVisibilityObbs()}),this._updatingHandles.add(()=>this.elevationInfo,(e,t)=>this._elevationInfoChanged(e,t),f),this._updatingHandles.add(()=>!this.suspended&&this.elevationInfo.mode!==0,(e,t)=>{e?this.addHandles(this.view.groundView.on(`elevation-change`,({extent:e})=>this._ensureElevationTask().addExtent(e)),Wt):t&&this.removeHandles(Wt)},f),this._updatingHandles.add(()=>this._usePBR,e=>this._updatePBR(e)),this._updatingHandles.add(()=>this.rendererTextureUsage,()=>{this._reloadAll(),this.clearMemCache()}),this._updatingHandles.add(()=>this.contentVisible,e=>this._contentVisibleChanged(e),f),this._updatingHandles.add(()=>this.layer.labelsVisible,()=>this._labelingChanged(),f),this._updatingHandles.add(()=>this.layer.labelingInfo,()=>this._labelingChanged(),f),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged(),f),this.addHandles([p(()=>K.I3S_TREE_SHOW_TILES,e=>{if(e&&!this._treeDebugger){let e=this._controller.crsIndex;import(`./support/I3STreeDebugger.js`).then(({I3STreeDebugger:t})=>{!this._treeDebugger&&K.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))})}else!e&&!K.I3S_TREE_SHOW_TILES&&(this._treeDebugger=s(this._treeDebugger))},f),p(()=>K.I3S_SHOW_MODIFICATIONS,()=>this._showModifications(),f)]),this._cacheKeySuffix=this._getCacheKeySuffix(),this._idbCache.init().catch(e=>a.getLogger(this).warn(`Failed to initialize IndexedDB cache: ${e}`));let{view:m}=this,{viewingMode:h,renderCoordsHelper:g}=m;this._planetRadiusInGlobalMode=h===`local`?0:g.referenceEllipsoid.radius}destroy(){this._clearAddTasks(),this._elevationTask=s(this._elevationTask),this.i3sOverrides=s(this.i3sOverrides),this._extractChanges=s(this._extractChanges),this._elevationProvider&&=(this._elevationProvider.notifyObjectsChanged(this.getVisibleObbs()),this.view.elevationProvider.unregister(this._elevationProvider),null),this._intersectionHandler&&=(this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),null);let e=this._workerHandle;e&&(e.destroyContextAndSelf(this.uid),this._workerHandle=null),this._removeAllNodeDataFromStage(),this._memCache=s(this._memCache),this._collection=null,this._stage=null,this._edgeView=null,this._labeler=s(this._labeler),this._treeDebugger=s(this._treeDebugger),this._controller=s(this._controller),this._highlights=s(this._highlights),this._nodeId2Meta.clear(),this._nodeId2MetaReloading.clear(),this._crossfadeHelper=s(this._crossfadeHelper),this.emit(`visible-geometry-changed`),this._visibleGeometryChangedSchedulerHandle&&=(this._visibleGeometryChangedSchedulerHandle.remove(),null),this._updatingHandles=s(this._updatingHandles)}_memEstimateTextureAdded(e){let t=e.usedMemory;return this._gpuMemoryEstimate+=t,this._texMemoryEstimate+=t,t}_memEstimateTextureRemoved(e){if(e!=null){let t=e.usedMemory;this._gpuMemoryEstimate-=t,this._texMemoryEstimate-=t}}_memEstimateGeometryAdded(e){let t=this._collection.getObjectGPUMemoryUsage(e);return this._gpuMemoryEstimate+=t,this._geoMemoryEstimate+=t,t}_memEstimateGeometryRemoved(e){let t=this._collection.getObjectGPUMemoryUsage(e);this._gpuMemoryEstimate-=t,this._geoMemoryEstimate-=t}isNodeLoaded(e){return this._nodeId2Meta.has(e)}isNodeReloading(e){return this._nodeId2MetaReloading.has(e)}get usedMemory(){let e=this._labeler==null?0:this._labeler.usedMemory;return this._nodeId2Meta.forEach(t=>e+=t==null?0:t.node.memory),this._nodeId2MetaReloading.forEach(t=>e+=t==null?0:t.node.memory),e}get unloadedMemory(){return(this._controller==null?0:this._controller.unloadedMemoryEstimate)+(this._labeler==null?0:this._labeler.unloadedMemoryEstimate)}_labelingChanged(){if(!(Le(this.layer)&&this._supportsLabeling)){this._labeler!=null&&(this._labeler.destroy(),this._labeler=null);return}if(this._labeler!=null)return;let e=new Oe({view:this.view,layer:this.layer,collection:this._collection,overrides:this.i3sOverrides,layerViewUid:this.uid});this._nodeId2Meta.forEach(t=>t!=null&&this._addMetaToLabeler(e,t)),this._labeler=e}_loadAsyncModule(e){return++this._asyncModuleLoading,e.then(e=>(--this._asyncModuleLoading,e),e=>{throw--this._asyncModuleLoading,e})}_modificationsChanged(){if(!this._i3sWasmLoaded&&this.hasModifications){this._i3sWasmLoaded=Ae().then(()=>{this._i3sWasmLoaded=!0,this._modificationsChanged(),this.notifyUpdate()},()=>{}),this.notifyUpdate();return}if(this._i3sWasmLoaded!==!0)return;let e=e=>a.getLogger(this).error(`set-modifications-error`,`Error when setting modifications:`,e),t=this.uid,n=this.layer.spatialReference,r=n.isGeographic,i=Fe(this._layerClippingArea,this._modifications,n,this.view.state.isGlobal);this._workerHandle.setModifications(t,i,r).catch(e);try{je({context:t,modifications:i,isGeodetic:r})}catch(t){e(t)}this._controller.modificationsChanged();let o=this.hasModifications?new c:null;this._nodeId2Meta.forEach((e,t)=>{e==null?(this._nodeId2Meta.delete(t),this._controller.updateLoadStatus(t,!1)):e.node.hasModifications?(this._updateFeatureIdCounts(e,-1),this._nodeId2Meta.delete(t),this._nodeId2MetaReloading.set(t,e)):o?.push(e.node)}),this.notifyChange(`elevationRange`),o!=null&&this._nodeId2MetaReloading.forEach(e=>o.push(e.node)),o!=null&&o.length>0&&(this.updateNodeModificationStatus(o),o.forAll(e=>{if(e.imModificationImpact!==2){let t=this._nodeId2Meta.get(e.index);this._controller.invalidateGeometryVisibility(e.index),t==null?this._nodeId2Meta.has(e.index)&&(this._nodeId2Meta.delete(e.index),this._controller.updateLoadStatus(e.index,!1)):(this._updateFeatureIdCounts(t,-1),this._nodeId2Meta.delete(e.index),this._nodeId2MetaReloading.set(e.index,t),this.notifyChange(`elevationRange`))}})),this.clearMemCache(),this._controller.restartNodeLoading(),this._showModifications()}_showModifications(){if(this._modificationGraphics!=null&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null),!K.I3S_SHOW_MODIFICATIONS||this._modifications.length===0)return;let e={clip:[227,227,79,.8],mask:[227,139,79,.8],replace:[139,227,79,.8]},t={outline:{color:[255,255,255],width:1}};this._modificationGraphics=[];for(let r of this._modifications){let i=r.geometry;i.spatialReference=this.layer.spatialReference;let a=new Ee({...t,color:e[r.type]});this._modificationGraphics.push(new n({geometry:i,symbol:a}))}this.view.graphics.addMany(this._modificationGraphics)}_addMetaToLabeler(e,t){e.addNodeMeta(t,(e,t)=>this._createAttributes(e,t))}_contentVisibleChanged(e){e?(this.view.elevationProvider.register(this._elevationContext,this._elevationProvider),this._stage.view.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler)):(this._removeAllNodeDataFromStage(),this.view.elevationProvider&&this.view.elevationProvider.unregister(this._elevationProvider),this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler))}getLoadedAttributes(e){let t=this._nodeId2Meta.get(e);if(t?.attributeInfo!=null)return t.attributeInfo.loadedAttributes}getAttributeData(e){let t=this._nodeId2Meta.get(e);if(t?.attributeInfo!=null)return t.attributeInfo.attributeData}setAttributeData(e,t){let n=this._nodeId2Meta.get(e);n?.attributeInfo!=null&&(n.attributeInfo.attributeData=t,this._attributeValuesChanged(n))}async updateAttributes(e,t,n){let r=this._nodeId2Meta.get(e);r!=null&&(await this.i3sOverrides.applyAttributeOverrides(r.featureIds,t,n,this._controller.requiredAttributes),r.attributeInfo=t,this._controller.reschedule(()=>{this._nodeId2Meta.get(e)===r&&this._attributeValuesChanged(r)},n).catch(e=>{u(e)||a.getLogger(this).warn(`Error while updating attribute values. Layer might not display correctly.`,e)}))}_attributeValuesChanged(e){e.cachedRendererVersion=this._getInvalidRendererVersion(),e.appliedFilters=null,this._labeler!=null&&this._labeler.setNodeMetaAttributes(e,(e,t)=>this._createAttributes(e,t)),this._updateEngineObject(e)}clearMemCache(){this._memCache!=null&&this._memCache.clear(),this._addTasks.forEach(e=>e.allowMemCache=!1)}getVisibleNodes(){let e=[];return this._nodeId2Meta.forEach(t=>t!=null&&e.push(t.node)),e}getVisibleObbs(){let e=[];return this._nodeId2Meta.forEach(t=>t&&e.push(this._collection.getComponentObb(t.objectHandle))),e}getLoadedNodeIndices(e){this._nodeId2Meta.forEach((t,n)=>e.push(n)),this._nodeId2MetaReloading.forEach((t,n)=>e.push(n))}_getVertexBufferLayout(e,t){return _t(yt(this._getGeometryParameters({hasTexture:It(e.params.material),hasNormals:t.normal,hasRegions:t.uvRegion})))}_getObjectIdField(){return this.layer.objectIdField||L}_getGlobalIdField(){return this.layer.globalIdField}_findGraphicNodeAndIndex(e){let t=G(this.layer.fieldsIndex,e.attributes,this._getObjectIdField());for(let e of this._nodeId2Meta.values()){let n=e?.featureIds.indexOf(t);if(n!=null&&n>=0)return{node:e.node,index:n}}return null}_getGraphicIndices(e,t){let n=this._nodeId2Meta.get(e.index);if(n==null)return[];let r=[],i=this._getObjectIdField(),a=this.layer.fieldsIndex;for(let e of t){let t=G(a,e.attributes,i),o=n.featureIds.indexOf(t);o!==-1&&r.push(o)}return r}whenGraphicBounds(e){let t=this._findGraphicNodeAndIndex(e);if(!t)return Promise.reject();let n=this.getAABB(t.node.index,t.index);return n==null?Promise.reject():Promise.resolve({boundingBox:n,screenSpaceObjects:[]})}getAABBFromIntersectorTarget(e){return e.nodeIndex==null||e.componentIndex==null?null:this.getAABB(e.nodeIndex,e.componentIndex)}getAABB(e,t){let n=this._nodeId2Meta.get(e);if(n?.featureIds==null||t>=n.featureIds.length)return null;let r=n.objectHandle,i=He(t,this._collection,r,P(24),0),a=this.view.renderSpatialReference,o=this.view.spatialReference;return he(i,a,0,i,o,0)?ge(i):null}whenGraphicAttributes(e,t){return tt(this.layer,e,this._getObjectIdField(),t,()=>this._nodeId2Meta.values().filter(i).toArray())}getGraphicFromIntersectorTarget(e,t){if(e.nodeIndex==null||e.componentIndex==null)return null;let n=this._nodeId2Meta.get(e.nodeIndex);if(n?.featureIds==null||e.componentIndex>=n.featureIds.length)return null;let r=this._createLayerGraphic(this._createAttributes(e.componentIndex,n));return r?this._meshUtilsImporterModule?(r.geometry=this._meshUtilsImporterModule.createMesh({layerView:this,nodeIndex:e.nodeIndex,featureIndex:e.componentIndex}),r):t.defer?(t.defer(async()=>(r.geometry=(await this._meshUtilsImporter).createMesh({layerView:this,nodeIndex:e.nodeIndex,featureIndex:e.componentIndex}),r)),null):r:null}_getCacheKey(e){return`${this._layerUrl}/v30/${e}${this._cacheKeySuffix}`}get _meshUtilsImporter(){return this._meshUtilsImporterPromise||(this._meshUtilsImporterPromise=import(`./i3s/meshUtils.js`),this._meshUtilsImporterPromise.then(e=>this._meshUtilsImporterModule=e,()=>{})),this._meshUtilsImporterPromise}_getCacheKeySuffix(){let e=this.view.renderSpatialReference;return e==null?Kt:e===D(e)?qt:this.layer.spatialReference.equals(e)?Gt:e.wkid==null?null:`@${e.wkid}`}_getMemCacheKey(e,t=this.elevationOffset){return e+`#`+t}get _idbCacheEnabled(){return!this._controller.disableIDBCache&&!this.hasModifications&&this.elevationOffset===0&&this._cacheKeySuffix!=null}loadCachedGPUData(e){return this._memCache==null?null:this._memCache.pop(this._getMemCacheKey(e))}deleteCachedGPUData(e){e!=null&&this._deleteComponentObject(e)}_cacheGPUData(e,t=this.elevationOffset){if(this._memCache==null){this._deleteComponentObject(e);return}let n=this._controller.indexDepth-e.node.level;this._memCache.put(this._getMemCacheKey(e.node.index,t),e,n)}loadMissingTextures(e,t,n,r){let i=e?.filter((e,n)=>{if((e.usage&this.rendererTextureUsage)===0)return!1;if(t==null)return!0;let r=Ke(e.encodings,this.supportedTextureEncodings),i=t[n];return!!(i?.data==null||r&&i.encoding!==r.encoding)})??[];return i.length===0?Promise.resolve(!1):n(i,r).then(n=>{let r=0;for(let i=0;i<e.length;i++)r<n.length&&n[r].id===e[i].id&&(t[i]=n[r],r++);return!0})}loadCachedNodeData(e,t,n){return this._idbCacheEnabled?this._idbCache.get(this._getCacheKey(e.id),t).then(r=>r==null?null:(r.globalTrafo=_e(r.globalTrafo),r.nodeVersion===e.version?(this.elevationInfo.mode===0&&(e.geometryObbInRenderSR=J.fromData(r.geometryObbData)),this.loadMissingTextures(r.requiredTextures,r.textureData,n,t).then(n=>(n&&this._idbCache.initialized&&r.textureData!=null&&(r.byteSize=zt(r.transformedGeometry,r.textureData),r.textureData.every(Rt)&&this._indexedDbSizeCheck(e,r)&&this._idbCache.put(this._getCacheKey(e.id),r).catch(t=>a.getLogger(this).warn(`Failed to update node with textures in IndexedDB cache: ${e.id}: ${t}`))),d(t),r))):(this._idbCache.remove(this._getCacheKey(e.id)),null))):Promise.resolve(null)}addNode(e,t,n){return Lt(t)?t.geometryBuffer==null?(this._addNodeMeta(e.index,null),Promise.resolve()):this._addData(e,t.attributeDataInfo,()=>this._transformNode(e,t,n).then(r=>this._safeReschedule(()=>{if(r==null)return e.hasModifications=!1,this._addCachedNodeData(e,null,n);let{obb:i,componentOffsets:o,featureIds:s,anchorIds:c,anchors:l,transformedGeometry:u,geometryMinElevation:d,geometryMaxElevation:f}=r;e.hasModifications=u.hasModifications;let p=_e(r.globalTrafo),m=b(Ht,i.center.x,i.center.y,i.center.z);x(m,m,p);let h=new J(m,[i.extents.x,i.extents.y,i.extents.z],ce(i.orientation.x,i.orientation.y,i.orientation.z,i.orientation.w));this.elevationInfo.mode===0&&(e.geometryObbInRenderSR=h),t.geometryData.componentOffsets=o,s&&(t.geometryData.featureIds=Array.from(s)),t.geometryData.anchorIds=c,t.geometryData.anchors=l;let g={nodeVersion:e.version,geometryData:t.geometryData,requiredTextures:t.requiredTextures,textureData:t.textureData,transformedGeometry:u,globalTrafo:p,geometryObbData:h.data,geometryMinElevation:d,geometryMaxElevation:f,byteSize:zt(u,t.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&this._indexedDbSizeCheck(e,g)){let t=g.textureData==null?null:g.textureData.map(e=>Rt(e)?e:null);this._idbCache.put(this._getCacheKey(e.id),{...g,textureData:t}).catch(t=>a.getLogger(this).warn(`Failed to store node in IndexedDB cache: ${e.id}: ${t}`))}return this._addCachedNodeData(e,g,n)},n))):Promise.reject()}getElevationRange(e){let t=new q,n=this._controller,{index:r}=n;if(!r)return t;let{rootNode:i}=r;if(!i)return t;let a=this._nodeId2Meta,o=n.viewportQueries;return r.traverse(i,n=>{let{childrenLoaded:r}=n;if(r===0)return!1;let i=o.getAndUpdateVisibilityObbInRenderSR(n),s=null;if(i){if(!i.intersectSphereWithMBS(e,i.radius))return!1}else if(s=o.calculateServiceMbsInRenderSRElevationAdjusted(n),s?.isValid&&!e.intersects(s))return!1;let c=a.get(n.index);if(c){let{geometryObbInRenderSR:r}=n;if(!r||r.intersectSphereWithMBS(e)){let e=c.geometryElevationRange;e.elevationRangeValid&&!e.isEmpty&&t.expandElevationRange(e)}}return r-+!!c>0}),t}computeVisibilityObb(e){return nt(e,this.view.renderSpatialReference,this._controller.crsIndex,this.layer.spatialReference,this.elevationOffset,this._modifications,this.view.renderCoordsHelper.sphericalPCPF)}_transformNode(e,t,n){let r=t.geometryData.geometries??[],i=Array(r.length);for(let e=0;e<r.length;++e)i[e]=this._getVertexBufferLayout(r[e],t.geometryDescriptor);let a=this.layer.normalReferenceFrame,o=t.normalReferenceFrame??a??`none`,s=e.serviceMbsInIndexSR,c=this.elevationOffset,l=this._controller.crsIndex,u=this._controller.crsVertex,d=this.view.renderSpatialReference,f=Ze(s,c,o,l,d),p=O(l,u),m=O(u,d);if(p==null||m==null)return Promise.resolve(null);let h={context:this.uid,geometryBuffer:t.geometryBuffer,geometryData:t.geometryData,geometryDescriptor:t.geometryDescriptor,layouts:i,globalTrafo:f,geometryElevationOffset:c,mbs:s.toJSON(),obbData:e.serviceObbInIndexSR?.data,elevationOffset:c,planetRadiusInGlobalMode:this._planetRadiusInGlobalMode,needNormals:this._controller.isMeshPyramid||this._imVertexNormals,computeNormals:this._isIntegratedMesh&&this._imVertexNormals,normalReferenceFrame:o,indexToVertexProjector:p,vertexToRenderProjector:m};return this._workerHandle.invoke(h,n)}get _supportsNodeCrossFading(){return!this.view?.stage?.renderer.shadowsEnabled}get nodeCrossfadingEnabled(){return this._supportsNodeCrossFading&&(this.lodCrossfadeinDuration>0||this.lodCrossfadeoutDuration>0||this.lodCrossfadeUncoveredDuration>0)}get nodeFadeoutEnabled(){return this._supportsNodeCrossFading&&this.lodCrossfadeoutDuration>0}_setNewNodeOpacity(e){let t=this.nodeCrossfadingEnabled?0:this.fullOpacity;this._setNodeOpacity(e,t)}addCachedGPUData(e,t,n){if(this.elevationInfo.mode===0&&(e.geometryObbInRenderSR=this._collection.getComponentObb(t.objectHandle).clone()),!this._controller.isGeometryVisible(e)){this._cacheGPUData(t);return}let r=e.index;this._addNodeMeta(r,t),this.updateNodeState(r,n),this._collection.setObjectVisibility(t.objectHandle,!0),this._updateElevationOffsets(t),this._labeler!=null&&this._addMetaToLabeler(this._labeler,t),this._updateMaterial(t),this._setNewNodeOpacity(t),this.elevationInfo.mode!==0&&this._ensureElevationTask().schedule(r),this._updateEngineObject(t),this._highlights?.objectCreated(t),this._treeDebugger!=null&&this._treeDebugger.update()}addCachedNodeData(e,t,n,r){return this._addData(e,n,()=>this._addCachedNodeData(e,t,r))}async deleteCachedNodeData(e){if(this._idbCacheEnabled)return this._idbCache.remove(this._getCacheKey(e))}async _addCachedNodeData(e,t,n){if(!this.contentVisible||!this._controller.isGeometryVisible(e)){this._removeNodeStageData(e.index,this.elevationOffset,this._nodeId2MetaReloading);return}if(t==null){this._addNodeMeta(e.index,null);return}let r=this._addTasks.get(e.index),{geometryData:i,transformedGeometry:o}=t;await this.i3sOverrides.applyAttributeOverrides(i.featureIds,r.attributeInfo,n,this._controller.requiredAttributes);let s=t.textureData==null?[]:t.textureData.filter(e=>e!=null&&(e.usage&this.rendererTextureUsage)!==0);e.memory=0;let{componentOffsets:c,geometries:l,featureIds:u,anchorIds:d,anchors:f}=i,p=this._collection,m=l[0],{layout:h,indices:g,interleavedVertexData:_,positionData:v,hasColors:ce}=o,{material:b,geometryParameters:x}=this._materialParameters(m,h),S=_.byteLength/h[0].stride,de=c||new Uint32Array([0,g?g.length:S]),C=m.transformation?oe(m.transformation):se(),T=_e(t.globalTrafo);ie(C,T,C);let E=ae(w(),C),D=y(ne(),C),me=this._isIntegratedMesh?this._imShading?2:0:1,he=x.textureCoordinateType,O=!ee(D,re),A=new bt(h,me,he,+!!O),ge=new xt({interleavedVertexData:_,vertexCount:S,indexData:g},{positions:ve(v.data),indices:ye(v.indices)},de,A),j=this.view.renderSpatialReference,M=this.view.groundView.spatialReference,N=J.fromData(ht(t.geometryObbData)).getCenter(Xt),P=[1,1,1];pe(N,j,P,M)||a.getLogger(this).errorOnce(`Unsupported coordinate system for IM overlay`);let F=w();k(N,j,F,M);let I=ne();te(I,D);let L=w();le(L,ue(L,N,E),I);let be=F[0]-L[0]*P[0],xe=F[1]-L[1]*P[1],Se=x.textureCoordinateType===2,{textures:R,texturePromise:Ce,materialParameters:we}=this._initMaterialAndTextures(b,s,Se,e),z=p.createObject(new vt(fe(be,xe,P[0],P[1]),new Ct(E,D),J.fromData(ht(t.geometryObbData)),ge,has(`enable-feature:im-as-ground`)?!this.layer.isUsedAsGroundLayer:!this._isIntegratedMesh),we);e.memory+=this._memEstimateGeometryAdded(z),e.memory+=R.reduce((e,t)=>e+(t==null?0:this._memEstimateTextureAdded(t)),0);let B=!!b.hasParametersFromSource,Te=b.alphaMode!==`blend`&&b.metallicRoughness.baseColorFactor[3]>=1,V=new Ot(e,u,z,this._getInvalidRendererVersion(),r.attributeInfo,{hasParametersFromSource:B,isOpaque:Te},R,d,f,t.geometryMinElevation,t.geometryMaxElevation);r.meta=V,this._hasTextures||=t.requiredTextures?.some(({usage:e})=>!!(e&19))||!!e.resources.texture,this._hasData=!0,this._hasColors||=ce,this.notifyChange(`hasTexturesOrVertexColors`);let Ee=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(V),Ce]).then(([t,r])=>(this._addTasks.has(e.index)&&t?.updateObjectVisibility(V.objectHandle,!1).catch(e=>this._logEdgeViewError(e,this.layer.title)),this._safeReschedule(()=>{let n=this._addTasks.get(e.index);if(!n)return;if(this._addNodeMeta(e.index,V),n.meta=null,!this.contentVisible){this._removeNodeStageData(e.index,this.elevationOffset);return}p.setObjectVisibility(z,!0),t?.updateObjectVisibility(V.objectHandle,!0).catch(e=>this._logEdgeViewError(e,this.layer.title)),V.attributeInfo=n.attributeInfo;let r=V.cachedRendererVersion!==this._rendererVersion,i=Ee!==this.slicePlaneEnabled;this._updateElevationOffsets(V);let a=V.elevationOffsets;this._updateComponentData(V);let o=this._applyFiltersToNode(V);(r||t!=null&&(i||o||a))&&this._addOrUpdateEdgeRendering(V).catch(()=>{}),this._labeler!=null&&this._addMetaToLabeler(this._labeler,V),this._visibleGeometryChanged(V,0),this._highlights?.objectCreated(V),this._updateMaterial(V),this._setNewNodeOpacity(V),this._treeDebugger!=null&&this._treeDebugger.update()},n))).catch(e=>{let{meta:t,allowMemCache:n}=r;throw r.meta=null,t&&n?this._cacheGPUData(t):t&&this._deleteComponentObject(t),e})}_addNodeMeta(e,t){if(this._removeNodeStageData(e,this.elevationOffset,this._nodeId2MetaReloading),this._nodeId2Meta.has(e)){a.getLogger(this).error(`Removing duplicated node`);let t=this._nodeId2Meta.get(e);t&&(this._deleteComponentObject(t),this._updateFeatureIdCounts(t,-1))}else this._controller.updateLoadStatus(e,!0);t&&(t.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&X(t.cachedEdgeMaterials,0),this._updateFeatureIdCounts(t,1)),this._nodeId2Meta.set(e,t),this.notifyChange(`elevationRange`)}_updateElevationOffsets(e){if(!e.node.serviceMbsInIndexSR)return;let{view:t,elevationInfo:n}=this,r=this._controller.crsIndex,{groundView:i,groundSpatialReference:a,renderSpatialReference:o}=t,s=n.mode;if(s===0){e.elevationAlignmentOffset=n.offset,e.elevationOffsets=null,e.updateGeometryElevationRange(),this.notifyChange(`elevationRange`);return}if(e.elevationAlignmentOffset=0,o==null||a==null){e.elevationOffsets=null,e.updateGeometryElevationRange(),this.notifyChange(`elevationRange`);return}let c=this._collection.getObjectTransform(e.objectHandle);e.elevationOffsets=e.elevationOffsets??[];let l=Ht,u=Ut,d=s===2,f=this.view.renderCoordsHelper,p=e.featureIds.length,m=(()=>{if(e.cachedElevationAnchors)return e.cachedElevationAnchors;let t=P(p*3);e.cachedElevationAnchors=t;let{center:n}=e.node.serviceMbsInIndexSR;for(let i=0;i<p;i++){let s=i*3,d=e.anchorIds?.indexOf(i)??-1;e.anchors&&d>=0?(b(l,e.anchors[d*3],e.anchors[d*3+1],e.anchors[d*3+2]),S(l,l,n),k(l,r,l,o),t[s+2]=f.getAltitude(l),k(l,o,l,a),t[s]=l[0],t[s+1]=l[1]):(this._collection.getComponentAabb(e.objectHandle,i,u,!0),b(l,(u[0]+u[3])/2,(u[1]+u[4])/2,u[2]),le(l,l,c.rotationScale),S(l,l,c.position),t[s+2]=f.getAltitude(l),k(l,o,l,a),t[s]=l[0],t[s+1]=l[1])}return t})(),h=n.offset,g=e.elevationOffsets;i.getElevations(m,p,(e,t)=>{let n=d?m[e*3+2]:0;g[e]=h+(t??0)-n}),e.updateGeometryElevationRange(),this.notifyChange(`elevationRange`)}_ensureElevationTask(){return this._elevationTask??=new ze(this.view.resourceController.scheduler,e=>this._controller.updateElevationChanged(e,this.view.groundView.spatialReference)?.filterInPlace(e=>this._nodeId2Meta.get(e)!=null),e=>this._nodeElevationAlignmentChanged(this._nodeId2Meta.get(e)),()=>this.elevationInfo?.mode),this._elevationTask}_elevationInfoChanged(e,t){let n=e.mode!==0,r=!!t&&t!==e&&t.mode!==0;this._intersectionHandler.updateElevationAlignState(n,this.view.state.viewingMode),n&&!r&&this._controller.removeAllGeometryObbs(),this._nodeId2Meta.forEach(e=>this._nodeElevationAlignmentChanged(e))}_nodeElevationAlignmentChanged(e){e!=null&&(this._updateElevationOffsets(e),this._updateComponentData(e),this._updateEdgeRendering(e),this._labeler!=null&&this._labeler.updateLabelPositions(e),this._updateSnappingSources(e,2),this._elevationProvider.notifyObjectChanged(this._collection.getComponentObb(e.objectHandle)))}_safeReschedule(e,t){return d(t),this._controller.reschedule(e,t)}_materialParameters(e,t){let n=e.params.material==null?qe():e.params.material,r=t.some(({name:e})=>e===`uvRegion`),i=t.some(({name:e})=>e===`normalCompressed`),a=It(n);return{geometryParameters:this._getGeometryParameters({hasTexture:a,hasNormals:i,hasRegions:r}),material:n}}_initMaterialAndTextures(e,t,n,r){let i=this._stage.renderView,a=e=>{this._gpuMemoryEstimate-=e,this._texMemoryEstimate-=e,r.memory-=e},o=t.map(t=>Je(t,e,n,i,this._compressionTracker,a));this._stage.addTextures(o);let{materialParameters:s,texturePromise:c}=Ye(e,o,t,this.view.stage.renderView.textures,{rendererTextureUsage:this.rendererTextureUsage,usePBR:this._usePBR,isIntegratedMesh:this._isIntegratedMesh,isGround:this.layer.isUsedAsGroundLayer,slicePlaneEnabled:this.slicePlaneEnabled,viewSpatialReference:this.view.spatialReference,applySSAO:this._applySSAO});return{textures:o,texturePromise:c,materialParameters:s}}_getGeometryParameters(e){return new St(this._hasVertexColors,e.hasNormals,e.hasTexture?e.hasRegions?2:1:0)}_addData(e,t,n){let r=this._addTasks.get(e.index);if(r)r.attributeInfo=t;else{let i=Promise.withResolvers();r=new Vt(t,null,i.promise),this._addTasks.set(e.index,r),n().then(i.resolve,i.reject).then(()=>this._addTasks.delete(e.index)).catch(t=>{throw this._addTasks.delete(e.index),t})}return r.promise}_clearAddTasks(){this._addTasks.forEach(e=>{e.meta!=null&&(this._cacheGPUData(e.meta),e.meta=null)}),this._addTasks.clear()}_clippingAreaChanged(){let e=this.view.renderSpatialReference,t=this.layer.spatialReference,n=M();this._renderClippingArea=mt(this.view.clippingArea,n,e)?n:null;let r=M();this._layerClippingArea=mt(this.view.clippingArea,r,t)?r:null,this._filterChange(),this._controller&&this._controller.updateClippingArea(this.view.clippingArea),this._isIntegratedMesh&&this._modificationsChanged()}get hasGeometryFilter(){return!1}_geometryFilterChange(){let e=this.hasGeometryFilter;this._controller.geometryFilterChanged(e),this._applyFilters(e),this._assertFeatureIdNodeCounts(e)}_assertFeatureIdNodeCounts(e){e&&!this._featureIdCounts?(this._featureIdCounts=$(this._nodeId2Meta.values()),this._filteredIdCounts=$(this._nodeId2Meta.values(),1),this._weaklyRemovedIdCounts=$(this._nodeId2Meta.values(),2),this.addHandles(p(()=>this._controller.updating,e=>{!e&&this._needFilterResolve&&(this.multiGeometryFilterResolve(),this._needFilterResolve=!1,this.notifyUpdate())},{sync:!0}),`updateFinished`)):!e&&this._featureIdCounts&&(this._featureIdCounts=null,this._filteredIdCounts=null,this._weaklyRemovedIdCounts=null,this._mismatchShow=null,this._mismatchHide=null,this.removeHandles(`updateFinished`),this._needFilterResolve=!1,this.notifyUpdate())}_updateFeatureIdCounts(e,t){this._featureIdCounts&&(this._needFilterResolve=!0,Q(this._featureIdCounts,e.featureIds,t),Q(this._filteredIdCounts,e.filteredIds,t),Q(this._weaklyRemovedIdCounts,e.weaklyRemovedIds,t))}_updateFilteredIdCounts(e,t,n){this._filteredIdCounts&&(this._needFilterResolve=!0,Q(this._filteredIdCounts,t,-1),Q(this._filteredIdCounts,e.filteredIds,1),Q(this._weaklyRemovedIdCounts,n,-1),Q(this._weaklyRemovedIdCounts,e.weaklyRemovedIds,1))}_checkFeatureIdNodeCountInvariant(){let e=this._featureIdCounts!=null;if(this.hasGeometryFilter!==e&&a.getLogger(this).error(`checkFeatureIdNodeCountInvariant()`,`LayerView should have feature id node counts if and only if it has a geometry filter`,{layerView:this,hasNodeCounts:e}),!this._featureIdCounts||!this._filteredIdCounts)return;let t=$(this._nodeId2Meta.values());o(this._featureIdCounts,t)||a.getLogger(this).error(`checkFeatureIdNodeCountInvariant()`,`Incorrect _featureIdCounts`,{layerView:this,counts:this._featureIdCounts,expected:t});let n=$(this._nodeId2Meta.values(),1);o(this._filteredIdCounts,n)||a.getLogger(this).error(`checkFeatureIdNodeCountInvariant()`,`Incorrect _filteredIdCounts`,{layerView:this,counts:this._filteredIdCounts,expected:n});let r=$(this._nodeId2Meta.values(),2);o(this._weaklyRemovedIdCounts,r)||a.getLogger(this).error(`checkFeatureIdNodeCountInvariant()`,`Incorrect _weaklyRemovedIdCounts`,{layerView:this,counts:this._weaklyRemovedIdCounts,expected:n})}multiGeometryFilterResolve(){if(!this._featureIdCounts||!this._filteredIdCounts)return;let e=null,t=null;for(let[n,r]of this._filteredIdCounts){let i=this._featureIdCounts.get(n);i!==r&&(r+(this._weaklyRemovedIdCounts?.get(n)??0)===i?(e??=new Set,e.add(n)):(t??=new Set,t.add(n)))}h(e,this._mismatchShow)&&h(t,this._mismatchHide)||(this._mismatchShow=e,this._mismatchHide=t,this._nodeId2Meta.forEach(e=>{if(!e?.filteredIds)return;let t=Yt(e,this._mismatchShow,this._mismatchHide);this._collection.setAllComponentVisibilities(e.objectHandle,t),this._visibleGeometryChanged(e,2)}))}_filterChange(){this._applyFilters(this.hasGeometryFilter)}_applyFilters(e){this._filters=this.getFilters(),e?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach(e=>{e&&this._applyFiltersToNode(e)&&(this._addOrUpdateEdgeRendering(e).catch(()=>{}),this._visibleGeometryChanged(e,2))})}getFilters(){let e=[],t=this._renderClippingArea;return t!=null&&e.push((e,n)=>this._boundingRectFilter(e,n,t)),e}addSqlFilter(e,t,n){if(t!=null){let r=t.fieldNames;e.push((e,i)=>this._sqlFilter(e,i,t,r,n))}}_sqlFilter(e,t,n,r,i){let a={},o=this._createLayerGraphic(a);if(!o)return;let s=this.layer.objectIdField,c=t.featureIds,l=t.attributeInfo?.attributeData;r.every(e=>e===s||l?.[e]!=null)&&rt(e,c,e=>{a[s]=c[e];for(let t of r)t!==s&&(a[t]=l?H(l[t],e):null);try{return n.testFeature(o)}catch(e){return i(e),!1}})}_boundingRectNodeTest(e,t){return me(e.node.serviceMbsInIndexSR,this._controller.crsIndex,Ft,this.view.renderSpatialReference),it(t,Ft)}_boundingRectFeatureTest(e,t,n){return this._collection.getComponentAabb(e.objectHandle,t,At),j(At,jt),N(n,jt)}_boundingRectFilter(e,t,n){let r=this._collection,i=this._boundingRectNodeTest(t,n);if(i===3)return;if(i===0){e.length=0;return}let a=r.getComponentCount(t.objectHandle);if(a.invisible+a.visible!==t.featureIds.length)return;let o=this._transformClippingArea(Mt,n,t.objectHandle);rt(e,t.featureIds,e=>this._boundingRectFeatureTest(t,e,o))}_transformClippingArea(e,t,n){let r=this._collection.getObjectTransform(n),i=r.position,a=r.rotationScale;return e[0]=(t[0]-i[0])/a[0],e[1]=(t[1]-i[1])/a[4],e[2]=(t[2]-i[0])/a[0],e[3]=(t[3]-i[1])/a[4],e}async _addOrUpdateEdgeRendering(e,t=!0){let n=e.objectHandle,{hasEdges:r,perFeatureEdgeMaterials:i}=this._getFilteredEdgeMaterials(e);if(r&&!this._edgeView)try{this._edgeView=await this._stage.renderer.loadEdgeView()}catch(e){if(!u(e))throw e}let a=this._edgeView;if(!a)return null;let o=a.hasObject(n);if(r){if(o)return this.nodeCrossfadingEnabled&&X(i,this.getNodeOpacity(e)),a.updateAllComponentMaterials(n,i,this.slicePlaneEnabled,t).catch(e=>this._logEdgeViewError(e,this.layer.title)),a.updateObjectVisibility(n,!0).catch(e=>this._logEdgeViewError(e,this.layer.title)),a.updateAllVerticalOffsets(n,e.elevationOffsets).catch(e=>this._logEdgeViewError(e,this.layer.title)),a;let r=await this._collection.addEdges(n,a,i,this.slicePlaneEnabled,e.elevationOffsets);return e.edgeMemoryUsage=r,e.node.memory+=r,a}return o&&(e.node.memory-=e.edgeMemoryUsage,e.edgeMemoryUsage=0,a.removeObject(n)),null}_applyFiltersToNode(e){let{filteredIds:t,weaklyRemovedIds:n}=e,r=this._applyFiltersToNodeComponents(e);return this._updateFilteredIdCounts(e,t,n),r&&this._labeler?.applyFilterChange(e),r}_applyFiltersToNodeComponents(e){let t=this._collection,n=t.getComponentCount(e.objectHandle),r=e.filteredIds!=null,i=n.invisible===0;if(t.setAllComponentVisibilities(e.objectHandle,`all`),this._filters.length===0)return e.filteredIds=null,!i;if((e.filteredIds==null||e.appliedFilters!==this._filters)&&(e.weaklyRemovedIds=null,e.filteredIds=Jt(e,this._filters),e.appliedFilters=this._filters),r&&e.filteredIds===e.featureIds&&(!this._mismatchHide||e.filteredIds.every(e=>!this._mismatchHide?.has(e))))return!i;let a=Yt(e,this._mismatchShow,this._mismatchHide);return t.setAllComponentVisibilities(e.objectHandle,a),!0}_removeAllNodeDataFromStage(e=this.elevationOffset){this._nodeId2Meta.forEach((t,n)=>this._removeNodeStageData(n,e)),this._nodeId2MetaReloading.forEach((t,n)=>this._removeNodeStageData(n,e,this._nodeId2MetaReloading)),this._elevationTask=s(this._elevationTask)}removeNode(e){let t=this.elevationOffset;this._removeNodeStageData(e,t),this._removeNodeStageData(e,t,this._nodeId2MetaReloading),this._elevationTask!=null&&this._elevationTask.remove(e)}_removeNodeStageData(e,t,n=this._nodeId2Meta){n.has(e)&&this._controller.updateLoadStatus(e,!1);let r=n.get(e);r==null?n.delete(e):(this._collection.setObjectVisibility(r.objectHandle,!1),this._edgeView!=null&&this._edgeView.hasObject(r.objectHandle)&&this._edgeView.updateObjectVisibility(r.objectHandle,!1).catch(e=>this._logEdgeViewError(e,this.layer.title)),this._visibleGeometryChanged(r,1),this._labeler!=null&&this._labeler.removeNodeMeta(r),n.delete(e),this._highlights?.objectDeleted(r),n===this._nodeId2Meta?(this._updateFeatureIdCounts(r,-1),this._cacheGPUData(r,t),this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopNodeFading(r)):this._deleteComponentObject(r),this._treeDebugger!=null&&this._treeDebugger.update())}_deleteComponentObject(e){if(this._edgeView!=null&&this._edgeView.removeObject(e.objectHandle),this._memEstimateGeometryRemoved(e.objectHandle),this._collection.destroyObject(e.objectHandle),e.textures)for(let t of e.textures)this._memEstimateTextureRemoved(t),this._stage.removeTexture(t)}updateNodeState(e,t){this._nodeId2Meta.get(e)?.objectHandle.updatePolygonOffset(+(t===0))}updateNodeIndex(e,t){if(this._nodeId2Meta.has(e)){let n=this._nodeId2Meta.get(e);this._nodeId2Meta.delete(e),this._nodeId2Meta.set(t,n),this.notifyChange(`elevationRange`)}let n=this._nodeId2MetaReloading.get(e);n&&(this._nodeId2MetaReloading.delete(e),this._nodeId2MetaReloading.set(t,n))}_invalidateAllSymbols(){this._rendererVersion=U(this._rendererVersion,1),this._controller?.requestUpdate()}_getInvalidRendererVersion(){return U(this._rendererVersion,-1)}async _rendererChange(e){if(this._currentRenderer=e,this.notifyChange(`rendererTextureUsage`),this._rendererVersion=U(this._rendererVersion,1),this._rendererFields=null,this._colorVariable=null,this._opacityVariable=null,this._invalidateAllSymbols(),e&&(this._rendererFields=await e.getRequiredFields(this.layer.fieldsIndex)),this._updateSymbologyFields(),!this._arcade&&e&&`arcadeRequired`in e&&e.arcadeRequired&&(this._arcade=await Te()),e&&`visualVariables`in e&&e.visualVariables)for(let t of e.visualVariables)t.type===`color`?this._colorVariable=t:t.type===`opacity`?this._opacityVariable=t:a.getLogger(this).warn(`Unsupported visual variable type for 3D Object Scene Services: ${t.type}`);if(e)for(let t of e.symbols)t.type!==`mesh-3d`&&a.getLogger(this).error(`Symbols of type '${t.type}' are not supported for 3D Object Scene Services.`);this._controller&&this._controller.requestUpdate()}_getCachedEdgeMaterials(e){return this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e),e.cachedEdgeMaterials}_getComponentParameters(e){this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e);let t=e.cachedSymbology;return(n,r)=>{let i=n*e.cachedSymbologyStride;T(r.externalColor,t[i]/255,t[i+1]/255,t[i+2]/255,t[i+3]/255);let a=this._stage.renderView.olidRenderHelper;if(a){let t=e.featureIds[n],i=this.sublayerId?`${this.layerViewUid}_${this.sublayerId}`:this.layerViewUid,o=z(this.view,this.uid);a.setUidToObjectAndLayerId(t,t,this.layerId,i,this.layerPopupEnabledAndHasTemplate&&!o,e.node.resources.attributes,n,this.sublayerId),r.olidColor=a.getObjectAndLayerIdColor({graphicUid:t,layerViewUid:i})}r.externalColorMixMode=t[i+4]&15,r.castShadows=!!(t[i+4]&16),r.pickable=!!(t[i+4]&32),r.elevationOffset=e.elevationOffsets?.[n]??0,r.emissiveStrength=e.emissiveStrengths?.[n]??1,r.emissiveSource=e.emissiveSources?.[n]??0}}_getSymbolInfo(e,t){let n=e?.getSymbol(t,{arcade:this._arcade});if(!(n instanceof V))return null;let r=n.id;if(this._symbolInfos.has(r))return this._symbolInfos.get(r);let i=at(n);return this._symbolInfos.set(r,i),i}_setSymbologyOverride(e,t){this._symbologyOverride!==e&&(this._symbologyOverride=e,this._symbologyOverrideFields=t,this._invalidateAllSymbols(),this._updateSymbologyFields())}_updateSymbologyFields(){this._symbologyFields=this._symbologyOverrideFields!=null&&this._symbologyOverrideFields.length>0?this._rendererFields!=null&&this._rendererFields.length>0?xe(this.layer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(e){if(e.cachedRendererVersion=this._rendererVersion,!this._hasComponentData)return;let t=this._tmpAttributeOnlyGraphic,n={};t.attributes=n;let r=this._currentRenderer,i=e.attributeInfo?.attributeData,a=e.featureIds?this.layer.objectIdField:null,o=i!=null&&this._symbologyFields!=null&&this._symbologyFields.length>0,s=null,c=null;if(o&&this._symbologyFields!=null){s=[],c=[];for(let e of this._symbologyFields){let t=i[e];t&&(s.push(e),c.push(t))}}e.cachedSymbology||=I(e.featureIds.length*e.cachedSymbologyStride);let l=new ut,u=this.fullOpacity,d=this.nodeCrossfadingEnabled?this.getNodeOpacity(e):u,f=null,p=1,m=W,h=0;for(let i=0;i<e.featureIds.length;i++){if(a!=null&&(n[a]=e.featureIds[i]),o&&s)for(let e=0;e<s.length;e++)n[s[e]]=H(c[e],i);let u=r?this._getSymbolInfo(r,t):null,g,_;if(l.pickable=!0,r&&`visualVariables`in r){if(this._colorVariable){let e=Ce(this._colorVariable,t,{color:Pt,arcade:this._arcade});e&&(g=l.color,g[0]=e.r/255,g[1]=e.g/255,g[2]=e.b/255,g[3]=e.a??1,!this._opacityVariable&&e.a!==null&&(_=e.a))}this._opacityVariable&&(_=we(this._opacityVariable,t,{arcade:this._arcade}))}if(u?.material){let e=u.material;g=g==null||_==null?Ie(g,_,e.color,e.alpha,Dt,l.color):Ie(g,_,null,null,Dt,l.color)}g??=T(l.color,1,1,1,1);let v=u?.material;if(l.colorMixMode=v?.colorMixMode??1,l.edgeMaterial=u?.edgeMaterial,this._symbologyOverride?.(t,l),this._nodeColorOverride!=null&&(this._nodeColorOverride(e.node,g),l.colorMixMode=3),l.pickable&&=g[3]>=Et,l.castShadows=u?u.castShadows:l.pickable,l.edgeMaterial!=null){let t=g[3]>=1&&(e.material.isOpaque||l.colorMixMode===3)?1:0;(l.edgeMaterial!==f||t!==p)&&(m={...l.edgeMaterial,opacity:d,objectTransparency:t},f=l.edgeMaterial,p=t),e.cachedEdgeMaterials[i]=m}else e.cachedEdgeMaterials[i]=W;e.cachedSymbology[h++]=Math.round(g[0]*255),e.cachedSymbology[h++]=Math.round(g[1]*255),e.cachedSymbology[h++]=Math.round(g[2]*255),e.cachedSymbology[h++]=Math.round(g[3]*255),e.cachedSymbology[h++]=l.colorMixMode|l.castShadows<<4|l.pickable<<5;let y=v?.emissive?.strength==null?Y:v?.emissive?.strength;y!==Y&&!e.emissiveStrengths&&(e.emissiveStrengths=Array(e.featureIds.length).fill(Y)),e.emissiveStrengths&&(e.emissiveStrengths[i]=y);let ee=v?.emissive?.source||0;ee!==0&&!e.emissiveSources&&(e.emissiveSources=Array(e.featureIds.length).fill(0)),e.emissiveSources&&(e.emissiveSources[i]=ee)}}_getFilteredEdgeMaterials(e){let t=this._getCachedEdgeMaterials(e);this.nodeCrossfadingEnabled||X(t,this.fullOpacity);let n=e.filteredIds;if(n==null)return{hasEdges:t.some(e=>e!==W),perFeatureEdgeMaterials:t};let r=0,i=!1,a=t.map((t,a)=>e.featureIds[a]===n[r]?(i||=t!==W,r++,t):W);return{hasEdges:i,perFeatureEdgeMaterials:a}}_updateComponentData(e){if(!this._hasComponentData)return;let{objectHandle:t}=e,n=this._getComponentParameters(e);this._collection.setComponentData(t,n),this._stage.renderView.requestRender()}_reloadAll(e=this.elevationOffset){this._removeAllNodeDataFromStage(e),this._controller!=null&&this._controller.restartNodeLoading()}_refreshGroundUsage(){this._intersectionHandler.isGround=has(`enable-feature:im-as-ground`)?this.layer.isUsedAsGroundLayer:this._isIntegratedMesh,this.contentVisible&&(this.view.elevationProvider.unregister(this._elevationProvider),this.view.elevationProvider.register(this._elevationContext,this._elevationProvider)),this._reloadAll(),this.clearMemCache()}_opacityChange(e){this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopAllNodeFading(),this._nodeId2Meta.forEach(t=>{t!=null&&(this._collection.updateObjectOpacity(t.objectHandle,e),X(t.cachedEdgeMaterials,e),this._updateEdgeRendering(t))})}_updateMaterial(e){e.objectHandle.updateMaterial({slicePlaneEnabled:this.slicePlaneEnabled,usePBR:this._usePBR})}_updateEngineObject(e){this._updateComponentData(e),this._applyFiltersToNode(e),this._addOrUpdateEdgeRendering(e).catch(()=>{}),this._visibleGeometryChanged(e,2)}intersect(e,t,n,r){this._intersectionHandler.intersectRay(e,t,n,r,null,!1)}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),this._labeler!=null&&(this._labeler.slicePlaneEnabled=e),this._foreachMeta(t=>{t.objectHandle.updateMaterial({slicePlaneEnabled:e}),this._updateEdgeRendering(t,!1)})}_updatePBR(e){this._foreachMeta(t=>t.objectHandle.updateMaterial({usePBR:e})),this._hasLoadedPBRTextures=!0}_foreachMeta(e){this._nodeId2Meta.forEach(t=>{t!=null&&e(t)})}get _usePBR(){return this._imShading&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(e,t=!0){this._edgeView!=null&&this._edgeView.hasObject(e.objectHandle)&&this._addOrUpdateEdgeRendering(e,t).catch(()=>{})}_forAllNodes(e){this._nodeId2Meta.forEach(e)}_ignoreClientNodeOverriddenFeatures(e){return this.i3sOverrides.hasGeometryChanges?(t,n,r)=>r.node.index>=0&&this.i3sOverrides.featureHasGeometryChanges(t)?0:e(t,n,r):e}_forAllFeatures(e,t,n){for(let r of this._nodeId2Meta.values())if(r!=null&&!(t&&r.node.serviceMbsInIndexSR&&t(r.node.serviceMbsInIndexSR)===1))switch(n){case 1:this._forAllFeaturesOfNode(r,e);break;case 0:this._forAllVisibleFeaturesOfNode(r,e);break;case 2:this._forAllQueryableFeaturesOfNode(r,e)}}_forAllFeaturesOfNode(e,t){e.featureIds.forEach((n,r)=>t(n,r,e))}_forAllVisibleFeaturesOfNode(e,t){let n=e.featureIds;this._collection.forEachVisibleComponent(e.objectHandle,r=>t(n[r],r,e)===0)}_forAllQueryableFeaturesOfNode(e,t){let n=this._ignoreClientNodeOverriddenFeatures(t);if(this._renderClippingArea==null)return this._forAllFeaturesOfNode(e,n);let r=this._boundingRectNodeTest(e,this._renderClippingArea);if(r===0)return;if(r===3)return this._forAllFeaturesOfNode(e,n);let i=e.featureIds,a=e.objectHandle,o=ot(this._renderClippingArea,this._collection.getObjectTransform(a));for(let t=0;t<i.length;t++)this._boundingRectFeatureTest(e,t,o)&&n(i[t],t,e)}_createAttributes(e,t){let n={};t.featureIds!=null&&(n[this._getObjectIdField()]=t.featureIds[e]);let r=t.attributeInfo?.attributeData;if(r!=null)for(let t of Object.keys(r))n[t]=H(r[t],e);return n}_createGraphic(e,t){return this._createLayerGraphic(this._createAttributes(e,t))}highlight(e,t){let r=dt(e);if(r.length===0)return ft;let i=wt(t),a=r[0]instanceof n?this._featureIdsFromGraphics(r):typeof r[0]==`number`?r:null;if(!a)return ft;let o=this._ensureHighlights(),{set:s,handle:c}=o.acquireSet(i);return o.setFeatureIds(s,a),c}_featureIdsFromGraphics(e){let t=this.layer.fieldsIndex,n=this._getObjectIdField();return e.map(e=>G(t,e.attributes,n))}_ensureHighlights(){return this._highlights??=new Re({collection:this._collection,forAllFeatures:e=>this._forAllFeatures(e,null,1),forAllFeaturesOfNode:(e,t)=>this._forAllFeaturesOfNode(e,t)}),this._highlights}resetHighlights(){this._highlights=s(this._highlights)}_visibleGeometryChanged(e,t){this._elevationProvider&&(this._visibleGeometryChangedSchedulerHandle??=m(()=>{let{node:t}=e,n=t.visibilityObbInRenderSR??t.geometryObbInRenderSR??t.serviceObbInRenderSR;if(n!=null){let e=A();n.toAaBoundingBox(e),this.emit(`visible-geometry-changed`,new De(e))}else this.emit(`visible-geometry-changed`);this._visibleGeometryChangedSchedulerHandle=null}),this._updateSnappingSources(e,t),this._elevationProvider.notifyObjectChanged(this._collection.getComponentObb(e.objectHandle)))}get performanceInfo(){return new ke(this.usedMemory,this._nodeId2Meta.size,Math.round(this._gpuMemoryEstimate/1048576),Math.round(this._geoMemoryEstimate/1048576),Math.round(this._texMemoryEstimate/1048576),Math.round(this.unloadedMemory/1048576),this._idbCacheEnabled?Math.round(this._idbCache.getHitRate()*100):0)}checkInvariants(){}get test(){}getNodeOpacityByIndex(e){let t=this._nodeId2Meta.get(e);return this.getNodeOpacity(t)}getNodeOpacity(e){return e==null?0:this._collection.getObjectOpacity(e.objectHandle)}isNodeFullyFadedIn(e){return this._crossfadeHelper.isNodeFullyFadedIn(e)}getNodeCrossfadeMetaData(e){return this._nodeId2Meta.get(e)}getNodeComponentHandle(e){return this._nodeId2Meta.get(e)?.objectHandle}markNodeToRemove(e){this._controller&&this._controller.markNodeToRemove(e)}removeMarkedNodes(){this._controller&&this._controller.removeMarkedNodes()}foreachCrossfadeNode(e){this._nodeId2Meta.forEach(e)}fadeNode(e,t,n){if(!this.nodeCrossfadingEnabled)return;let r=this._nodeId2Meta.get(e);r!=null&&this._crossfadeHelper.fadeNode(e,r,t,n)}setNodeOpacityByIndex(e,t){let n=this._nodeId2Meta.get(e);n!=null&&this._setNodeOpacity(n,t)}_setNodeOpacity(e,t){this._collection.updateObjectOpacity(e.objectHandle,t),this._setNodeEdgeOpacity(e,t)}_setNodeEdgeOpacity(e,t){if(this._edgeView==null||!e.cachedEdgeMaterials)return;X(e.cachedEdgeMaterials,t);let n=e.objectHandle;this._edgeView.hasObject(n)&&this._edgeView.updateAllComponentOpacities(n,t).catch(e=>this._logEdgeViewError(e,this.layer.title))}get hasModifications(){return this._isIntegratedMesh&&this._layerClippingArea!=null||this._modifications&&this._modifications.length>0}updateNodeModificationStatus(e){let t=e.length;if(!this.hasModifications||t<=0||this._i3sWasmLoaded!==!0)return;let n=this.uid,r=Bt(e);if(r){let t={context:n,buffer:r.buffer};Me(t);let i=new Float64Array(r.buffer);e.forAll((e,t)=>{let n=i[t],r=Ne(n);e.imModificationImpact=r,r!==0&&this._controller.invalidateGeometryVisibility(e.index)})}}notifyUpdate(){this.notifyChange(`updating`)}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){return!!(this._controller&&this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||this._labeler!=null&&this._labeler.updating||this._crossfadeHelper?.updating||this._i3sWasmLoaded instanceof Promise||this._asyncModuleLoading>0||this._elevationTask!=null&&this._elevationTask.readyToRun||this._needFilterResolve||this._compressionTracker.compressing}trackSnappingSources(e){let t={events:e,fetchEdgeLocations:async(e,t,n)=>{let r=this._nodeId2Meta.get(e);if(r==null)throw Error(`invalid-node`);let{origin:i,buffer:a}=await this._collection.extractEdgeInformation(r.objectHandle,t,n);return this._snappingLocationsApplyElevation(r,a,i),{type:`components`,objectIds:r.featureIds,locations:a,origin:i}},remove:()=>r(this._snappingSourcesTrackers,t)};return this._snappingSourcesTrackers.push(t),this._nodeId2Meta.forEach((t,n)=>{if(t==null)return;let r=this._controller.getRenderMbs(t.node);r&&e.add(n,r)}),t}_snappingLocationsApplyElevation(e,t,n){if(!e.elevationOffsets||this.elevationInfo.mode===0)return;let r=t.position0,i=t.position1,a=t.componentIndex,o=w(),s=w(),c=(e,t)=>{S(e,e,n),this.view.renderCoordsHelper.worldUpAtPosition(e,s),S(e,e,de(s,s,t)),C(e,e,n)};for(let t=0;t<r.count;t++){let n=e.elevationOffsets[a.get(t)];r.getVec(t,o),c(o,n),r.setVec(t,o),i.getVec(t,o),c(o,n),i.setVec(t,o)}}_updateSnappingSources(e,t){let{index:n}=e.node,r=this._controller.getRenderMbs(e.node);if(r!=null)for(let e of this._snappingSourcesTrackers)(t===1||t===2)&&e.events.remove(n),(t===0||t===2)&&e.events.add(n,r)}_logEdgeViewError(e,t){u(e)||a.getLogger(this).warn(`Error while processing edges. Edges on this layer might not display correctly`,t,e)}_indexedDbSizeCheck(e,t){return t.byteSize>104857600?(a.getLogger(this).warn(`Node is too big to store in IndexedDB cache: ${e.id} (${t.byteSize} bytes)`),!1):t.byteSize>0}get elevationProvider(){return this._elevationProvider}};return e([_()],F.prototype,`extractChanges`,null),e([_()],F.prototype,`_hasLoadedPBRTextures`,void 0),e([_()],F.prototype,`_asyncModuleLoading`,void 0),e([_()],F.prototype,`_visibleGeometryChangedSchedulerHandle`,void 0),e([_()],F.prototype,`view`,void 0),e([_()],F.prototype,`layer`,void 0),e([_()],F.prototype,`_controller`,void 0),e([_()],F.prototype,`_labeler`,void 0),e([_()],F.prototype,`updating`,void 0),e([_()],F.prototype,`suspended`,void 0),e([_()],F.prototype,`contentVisible`,null),e([_({readOnly:!0})],F.prototype,`legendEnabled`,null),e([_(gt)],F.prototype,`updatingProgress`,void 0),e([_()],F.prototype,`updatingProgressValue`,null),e([_()],F.prototype,`hasTexturesOrVertexColors`,null),e([_()],F.prototype,`rendererTextureUsage`,null),e([_()],F.prototype,`elevationOffset`,null),e([_()],F.prototype,`elevationInfo`,null),e([_({type:Boolean})],F.prototype,`slicePlaneEnabled`,void 0),e([_()],F.prototype,`supportedTextureEncodings`,null),e([_({type:[R]})],F.prototype,`_modifications`,void 0),e([_({readOnly:!0})],F.prototype,`clientGeometry`,null),e([_()],F.prototype,`elevationRange`,null),e([_()],F.prototype,`fullExtent`,null),e([_()],F.prototype,`_elevationTask`,void 0),e([_({readOnly:!0})],F.prototype,`_usePBR`,null),F=e([v(`esri.views.3d.layers.I3SMeshView3D`)],F),F},At=A(),jt=M(),Mt=M(),Nt=new J,Pt=new t([0,0,0,0]),Ft=new F(0,0,0,0);function It(e){if(e==null)return!1;let t=e.metallicRoughness;return t&&t.baseColorTextureId>=0||t&&t.metallicRoughnessTextureId>=0||e.normalTextureId>=0||e.emissiveTextureId>=0||e.occlusionTextureId>=0}function Lt(e){return`geometryData`in e}function Rt(e){return e!=null&&g(e.data)}function zt(e,t){let n=1024+e.interleavedVertexData.byteLength+(e.indices?e.indices.byteLength:0)+e.positionData.data.byteLength+e.positionData.indices.byteLength;if(t!=null)for(let e of t)e!=null&&g(e.data)&&(n+=e.data.byteLength);return n}function Bt(e){if(e.length===0)return;let t=e.length*10,n=new Float64Array(t),r=0;return e.forAll(e=>{let t=e.serviceObbInIndexSR;t??(t=Nt,e.serviceMbsInIndexSR?(t.setCenter(e.serviceMbsInIndexSR.center),t.setHalfSizeFromValues(e.serviceMbsInIndexSR.radius,e.serviceMbsInIndexSR.radius,e.serviceMbsInIndexSR.radius)):t.invalidate());let i=t.data;n[r++]=i[0],n[r++]=i[1],n[r++]=i[2],n[r++]=i[3],n[r++]=i[4],n[r++]=i[5],n[r++]=i[6],n[r++]=i[7],n[r++]=i[8],n[r++]=i[9]}),n}class Vt{constructor(e,t,n){this.attributeInfo=e,this.meta=t,this.promise=n,this.allowMemCache=!0}}function X(e,t){e.forEach(e=>e.opacity=t)}class Z{constructor(e,t){this.mode=e,this.offset=t}}const Ht=w(),Ut=A(),Wt=`elevation-change`,Gt=``,Kt=`@null`,qt=`@ECEF`;function Jt(e,t){let n=e.featureIds.slice();for(let r of t)if(r(n,e),n.length===0)break;return n.length===e.featureIds.length?e.featureIds:n}function Yt(e,t,n){let r=[],i=e.filteredIds;if(i!=null&&!t?.size&&!n?.size)e.featureIds.forEach((e,t)=>{i[r.length]===e&&r.push(t)});else if(i!=null){let a=0;e.featureIds.forEach((e,o)=>{if(i[a]===e)++a;else if(!t?.has(e))return;n?.has(e)||r.push(o)})}return r}function Q(e,t,n){if(e&&t)for(let r of t){let t=(e.get(r)??0)+n;t>0?e.set(r,t):e.delete(r)}}function $(e,t=0){let n=new Map;for(let r of e)Q(n,t===0?r?.featureIds:t===1?r?.filteredIds:r?.weaklyRemovedIds,1);return n}const Xt=w();export{kt as I3SMeshView3D};
2
+ import{__decorate as e}from"tslib";import t from"../../../Color.js";import n from"../../../Graphic.js";import{removeUnordered as r,isSome as i}from"../../../core/arrayUtils.js";import has from"../../../core/has.js";import a from"../../../core/Logger.js";import{equals as o}from"../../../core/MapUtils.js";import{destroyMaybe as s}from"../../../core/maybe.js";import c from"../../../core/PooledArray.js";import{ignoreAbortErrors as l,isAbortError as u,throwIfAborted as d}from"../../../core/promiseUtils.js";import{initial as f,watch as p}from"../../../core/reactiveUtils.js";import{schedule as m}from"../../../core/scheduling.js";import{equals as h}from"../../../core/SetUtils.js";import{isArrayBuffer as g}from"../../../core/typedArrayUtil.js";import{property as _,subclass as v}from"../../../core/accessorSupport/decorators.js";import{fromMat4 as y,exactEquals as ee,invert as te}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as ne,IDENTITY as re}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{multiply as ie,getTranslation as ae}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{clone as oe,create as se}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as ce}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{set as b,transformMat4 as x,transformMat3 as le,sub as ue,add as S,scale as de,subtract as C}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as T}from"../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as fe}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as E}from"../../../core/support/UpdatingHandles.js";import{getSphericalPCPF as D}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{localLinearScaleFactors as pe}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectBoundingSphere as me}from"../../../geometry/projection/projectBoundingSphere.js";import{projectBuffer as he}from"../../../geometry/projection/projectBuffer.js";import{getProjectorName as O}from"../../../geometry/projection/projectors.js";import{projectVectorToVector as k}from"../../../geometry/projection/projectVectorToVector.js";import{create as A,fromBuffer as ge,toRect as j}from"../../../geometry/support/aaBoundingBox.js";import{create as M,intersects as N}from"../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as P,ensurePackedMat4f64 as _e}from"../../../geometry/support/DoubleArray.js";import{compactFloatArray as ve}from"../../../geometry/support/FloatArray.js";import{compactIndices as ye}from"../../../geometry/support/Indices.js";import{Sphere as F}from"../../../geometry/support/sphere.js";import{newUByteArray as I}from"../../../geometry/support/UByteArray.js";import{fallbackObjectIDAttribute as L}from"../../../layers/LayerConstants.js";import be from"../../../layers/graphics/controllers/I3SOnDemandController.js";import{fixFields as xe}from"../../../layers/support/fieldUtils.js";import{I3SExtractChanges as Se}from"../../../layers/support/I3SExtractChanges.js";import R from"../../../layers/support/SceneModification.js";import{getColor as Ce,getOpacity as we}from"../../../renderers/visualVariables/support/visualVariableUtils.js";import{isBasemapLayerView as z}from"../../../support/basemapUtils.js";import{getElevationOffset as B}from"../../../support/elevationInfoUtils.js";import{loadArcade as Te}from"../../../support/loadArcade.js";import V from"../../../symbols/MeshSymbol3D.js";import Ee from"../../../symbols/SimpleFillSymbol.js";import{ContentGeometryUpdateEvent as De}from"./ContentGeometryLayerView.js";import Oe from"./I3SMeshViewLabeler.js";import{I3SMeshViewPerformanceInfo as ke}from"./I3SMeshViewPerformanceInfo.js";import{initialize as Ae,setModificationsSync as je,filterObbsForModificationsSync as Me,interpretObbModificationResults as Ne}from"./SceneLayerWorker.js";import{SceneLayerWorkerHandle as Pe,toWasmModification as Fe}from"./SceneLayerWorkerHandle.js";import{overrideColor as Ie}from"./graphics/graphicUtils.js";import{areLabelsVisible as Le}from"./graphics/Labeler.js";import Re from"./i3s/Highlights.js";import{I3SAsyncElevationUpdater as ze}from"./i3s/I3SAsyncElevationUpdater.js";import{getCachedAttributeValue as H}from"./i3s/I3SBinaryReader.js";import{I3SCrossfadeHelper as Be,NodeCrossfadeMetaData as Ve}from"./i3s/I3SCrossfadeHelper.js";import{boundingBoxCornerPoints as He}from"./i3s/I3SGeometryUtil.js";import{I3SIntersectionHandler as Ue,TraversedIntersectionNode as We}from"./i3s/I3SIntersectionHandler.js";import{getSupportedEncodings as Ge,selectEncoding as Ke,defaultMaterial as qe,createTexture as Je,configureMaterial as Ye}from"./i3s/I3SMaterialUtil.js";import{I3SOverrides as Xe}from"./i3s/I3SOverrides.js";import{computeGlobalTransformation as Ze}from"./i3s/I3SProjectionUtil.js";import{rendererNeedsTextures as Qe,checkSceneLayerValid as $e,checkSceneLayerCompatibleWithView as et,whenGraphicAttributes as tt,computeVisibilityObb as nt,filterInPlace as rt,intersectBoundingRectWithMbs as it,addWraparound as U,getSymbolInfo as at,transparentEdgeMaterial as W,getClipRect as ot}from"./i3s/I3SUtil.js";import{IDBCache as st}from"./i3s/IDBCache.js";import{IDBMockCache as ct}from"./i3s/IDBMockCache.js";import{LayerElevationProvider as lt}from"./i3s/LayerElevationProvider.js";import{SymbologyInfo as ut}from"./i3s/SymbologyInfo.js";import{attributeLookup as G}from"./support/attributeUtils.js";import{normalizeHighlightTarget as dt,emptyHighlightHandle as ft}from"./support/highlightUtils.js";import{makeScheduleFunction as pt}from"./support/makeScheduleFunction.js";import{debugFlags as K}from"../support/debugFlags.js";import{ElevationRange as q}from"../support/ElevationRange.js";import{toBoundingRect as mt}from"../support/extentUtils.js";import{Obb as J,ensurePackedObbData as ht}from"../support/orientedBoundingBox.js";import{updatingProgress as gt}from"../support/updatingProperties.js";import{glLayout as _t}from"../support/buffer/glUtil.js";import{ObjectParameters as vt}from"../webgl-engine/collections/Component/ObjectParameters.js";import{createVertexBufferLayout as yt,ComponentGeometryParameters as bt,SourceGeometry as xt,VertexBufferLayoutCreationParameters as St}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as Ct}from"../webgl-engine/collections/Component/Transform.js";import{emissiveStrengthDefault as Y}from"../webgl-engine/core/shaderLibrary/output/getEmissions.glsl.js";import{getHighlightName as wt}from"../../support/highlightOptionsUtils.js";import{TextureCompressionTracker as Tt}from"../../support/TextureCompressionTracker.js";import{alphaCutoff as Et}from"../../../webscene/support/AlphaCutoff.js";const Dt=[1,1,1,1];class Ot extends Ve{constructor(e,t,n,r,i,a,o,s,c,l,u){super(),this.node=e,this.featureIds=t,this.objectHandle=n,this.cachedRendererVersion=r,this.attributeInfo=i,this.material=a,this.textures=o,this.anchorIds=s,this.anchors=c,this._elevationAlignmentRange=new q,this._geometryElevationRange=new q,this.cachedElevationAnchors=null,this.cachedEdgeMaterials=[],this.edgeMemoryUsage=0,this.cachedSymbologyStride=5,this.elevationAlignmentOffset=0,this._baseGeometryElevationRange=new q(l,u),this.updateGeometryElevationRange()}get geometryElevationRange(){return this._geometryElevationRange}updateGeometryElevationRange(){let e=this._baseGeometryElevationRange;if(!e.elevationRangeValid||e.isEmpty){this._elevationAlignmentRange.invalidateElevationRange(),this._geometryElevationRange.invalidateElevationRange();return}let t=this.elevationOffsets;if(!t||t.length===0){let t=this.elevationAlignmentOffset;this._elevationAlignmentRange.setElevationRangeValues(t,t),this._geometryElevationRange.setElevationRangeValues(e.minElevation+t,e.maxElevation+t);return}let n=1/0,r=-1/0;for(let e=0;e<t.length;++e){let i=this.elevationAlignmentOffset+(t[e]??0);n=Math.min(n,i),r=Math.max(r,i)}this._elevationAlignmentRange.setElevationRangeValues(n,r),this._geometryElevationRange.setElevationRangeValues(e.minElevation+n,e.maxElevation+r)}get usedMemory(){return this.node.memory}get featureExtents(){return this._featureExtents??=new Float64Array(6*this.featureIds.length).fill(1/0),this._featureExtents}}const kt=t=>{let g=t,F=class extends g{constructor(){super(...arguments),this._extractChanges=null,this._applySSAO=!0,this._imShading=!!has(`enable-feature:im-shading`),this._imVertexNormals=!!has(`enable-feature:im-vertex-normals`),this._updatingHandles=new E,this._highlights=null,this._nodeId2Meta=new Map,this._nodeId2MetaReloading=new Map,this._i3sWasmLoaded=!1,this._snappingSourcesTrackers=[],this._compressionTracker=new Tt,this._hasLoadedPBRTextures=!1,this._asyncModuleLoading=0,this._addTasks=new Map,this._currentRenderer=null,this._rendererVersion=0,this._colorVariable=null,this._opacityVariable=null,this._rendererFields=null,this._symbologyFields=null,this._symbologyOverride=null,this._symbologyOverrideFields=null,this._symbolInfos=new Map,this._visibleGeometryChangedSchedulerHandle=null,this._hasComponentData=!1,this._hasVertexColors=!1,this._nodeColorOverride=null,this.updating=!0,this.holeFilling=`auto`,this._hasColors=!1,this._hasTextures=!1,this._hasData=!1,this.slicePlaneEnabled=!1,this._modifications=[],this.ignoresMemoryFactor=!1,this._layerUrl=``,this._cacheKeySuffix=null,this._meshUtilsImporterModule=null,this._meshUtilsImporterPromise=null,this._planetRadiusInGlobalMode=0,this._elevationTask=null,this._needFilterResolve=!1,this._filters=[],this._arcade=null,this._tmpAttributeOnlyGraphic=new n,this._crossfadeHelper=new Be(this)}get lodCrossfadeoutDuration(){return 0}get lodCrossfadeinDuration(){return 0}get lodCrossfadeUncoveredDuration(){return 0}get extractChanges(){return this._extractChanges?.layer!==this.layer&&(this._extractChanges?.destroy(),this._extractChanges=new Se({layer:this.layer})),this._extractChanges}get layerViewUid(){return this.uid}get layerId(){return this.layer.id}get sublayerId(){return null}get _isIntegratedMesh(){return this.layer.type===`integrated-mesh`}get contentVisible(){return!this.suspended&&this._controller?.rootNodeVisible&&this.fullOpacity>=Et}get legendEnabled(){return this.contentVisible&&this.layer?.legendEnabled===!0}get updatingProgressValue(){return this._controller?.updatingProgress??0}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?`yes`:`probably-not`:`unknown`}get rendererTextureUsage(){return Qe(this._currentRenderer)?this._usePBR||this._hasLoadedPBRTextures?63:53:this._usePBR||this._hasLoadedPBRTextures?44:36}get elevationOffset(){let e=this.layer?.elevationInfo;return e?.mode===`absolute-height`?B(e,this.layer.spatialReference):0}get elevationInfo(){let e=this.layer?.elevationInfo;switch(e?.mode){case`absolute-height`:return new Z(0,B(e,this.layer.spatialReference));case`relative-to-ground`:return new Z(1,B(e,this.layer.spatialReference));case`on-the-ground`:return new Z(2,0);default:return new Z(0,0)}}get supportedTextureEncodings(){return Ge(this.view.stage.renderView.capabilities)}get clientGeometry(){return this.i3sOverrides.geometryOverrides}get elevationRange(){let e=this._nodeId2Meta,t=new q;for(let n of e.values()){let e=n?.geometryElevationRange;e?.elevationRangeValid&&!e.isEmpty&&t.expandElevationRange(e)}return t.elevationRangeValid&&!t.isEmpty?t:null}get fullExtent(){return this.layer.fullExtent}initialize(){let e=has(`enable-feature:idb-mock-cache`);this._idbCache=e?new ct(this.view,e):new st(`esri-scenelayer-cache`,`geometries`),this.addResolvingPromise(this.layer.indexInfo);let t=this.view.resourceController,n=t.memoryController;this.i3sOverrides=new Xe({view:this.view,layer:this.layer,memoryController:n,extractChanges:this.extractChanges}),this._workerHandle=new Pe(pt(t)),this.addResolvingPromise(this._workerHandle.promise),$e(this.layer),et(this.layer,this.view);let r=this.layer.store.defaultGeometrySchema;if(this.addResolvingPromise(this._workerHandle.setLegacySchema(this.uid,r).catch(l)),this._layerUrl=this.layer.parsedUrl.path,this._controller=new be({layerView:this,worker:this._workerHandle}),this._gpuMemoryEstimate=0,this._texMemoryEstimate=0,this._geoMemoryEstimate=0,this._stage=this.view.stage,this._collection=this._stage.renderView.componentObjectCollection,this._isIntegratedMesh||!r)this._hasComponentData=!1;else{let e=r.featureAttributes;this._hasComponentData=!!(e&&e.faceRange&&e.id)}this._hasVertexColors=(r?.vertexAttributes.color??null)!=null&&!this.layer.cachedDrawingInfo?.color;let i=this.view.resourceController.memoryController.newCache(`sl-${this.uid}`,e=>this._deleteComponentObject(e));this._memCache=i;let o=this._controller,c=this._nodeId2Meta,u=this._nodeId2MetaReloading;function*d(e){let t=o.index;if(!t)return;let n=t.rootNode;if(!n)return;let r=null;for(let i of t.traverseValues(n,t=>(r=(c.get(t.index)||u.get(t.index))?.objectHandle??null,e(t,r))))yield new We(i,r)}this._intersectionHandler=new Ue({layerViewUid:this.layerViewUid,sublayerId:this.sublayerId,collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:has(`enable-feature:im-as-ground`)?this.layer.isUsedAsGroundLayer:this._isIntegratedMesh,traverseNodeHierarchy:d}),this._elevationProvider=new lt({view:this.view,layerElevationSource:this,intersectionHandler:this._intersectionHandler}),this._hasLoadedPBRTextures=this._usePBR,this._updatingHandles.add(()=>this.view.clippingArea,()=>this._clippingAreaChanged(),f),this._updatingHandles.add(()=>this.fullOpacity,e=>this._opacityChange(e)),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this.elevationOffset,(e,t)=>{this._reloadAll(t),this._controller.invalidateVisibilityObbs()}),this._updatingHandles.add(()=>this.elevationInfo,(e,t)=>this._elevationInfoChanged(e,t),f),this._updatingHandles.add(()=>!this.suspended&&this.elevationInfo.mode!==0,(e,t)=>{e?this.addHandles(this.view.groundView.on(`elevation-change`,({extent:e})=>this._ensureElevationTask().addExtent(e)),Wt):t&&this.removeHandles(Wt)},f),this._updatingHandles.add(()=>this._usePBR,e=>this._updatePBR(e)),this._updatingHandles.add(()=>this.rendererTextureUsage,()=>{this._reloadAll(),this.clearMemCache()}),this._updatingHandles.add(()=>this.contentVisible,e=>this._contentVisibleChanged(e),f),this._updatingHandles.add(()=>this.layer.labelsVisible,()=>this._labelingChanged(),f),this._updatingHandles.add(()=>this.layer.labelingInfo,()=>this._labelingChanged(),f),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged(),f),this.addHandles([p(()=>K.I3S_TREE_SHOW_TILES,e=>{if(e&&!this._treeDebugger){let e=this._controller.crsIndex;import(`./support/I3STreeDebugger.js`).then(({I3STreeDebugger:t})=>{!this._treeDebugger&&K.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))})}else!e&&!K.I3S_TREE_SHOW_TILES&&(this._treeDebugger=s(this._treeDebugger))},f),p(()=>K.I3S_SHOW_MODIFICATIONS,()=>this._showModifications(),f)]),this._cacheKeySuffix=this._getCacheKeySuffix(),this._idbCache.init().catch(e=>a.getLogger(this).warn(`Failed to initialize IndexedDB cache: ${e}`));let{view:m}=this,{viewingMode:h,renderCoordsHelper:g}=m;this._planetRadiusInGlobalMode=h===`local`?0:g.referenceEllipsoid.radius}destroy(){this._clearAddTasks(),this._elevationTask=s(this._elevationTask),this.i3sOverrides=s(this.i3sOverrides),this._extractChanges=s(this._extractChanges),this._elevationProvider&&=(this._elevationProvider.notifyObjectsChanged(this.getVisibleObbs()),this.view.elevationProvider.unregister(this._elevationProvider),null),this._intersectionHandler&&=(this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),null);let e=this._workerHandle;e&&(e.destroyContextAndSelf(this.uid),this._workerHandle=null),this._removeAllNodeDataFromStage(),this._memCache=s(this._memCache),this._collection=null,this._stage=null,this._edgeView=null,this._labeler=s(this._labeler),this._treeDebugger=s(this._treeDebugger),this._controller=s(this._controller),this._highlights=s(this._highlights),this._nodeId2Meta.clear(),this._nodeId2MetaReloading.clear(),this._crossfadeHelper=s(this._crossfadeHelper),this.emit(`visible-geometry-changed`),this._visibleGeometryChangedSchedulerHandle&&=(this._visibleGeometryChangedSchedulerHandle.remove(),null),this._updatingHandles=s(this._updatingHandles)}_memEstimateTextureAdded(e){let t=e.usedMemory;return this._gpuMemoryEstimate+=t,this._texMemoryEstimate+=t,t}_memEstimateTextureRemoved(e){if(e!=null){let t=e.usedMemory;this._gpuMemoryEstimate-=t,this._texMemoryEstimate-=t}}_memEstimateGeometryAdded(e){let t=this._collection.getObjectGPUMemoryUsage(e);return this._gpuMemoryEstimate+=t,this._geoMemoryEstimate+=t,t}_memEstimateGeometryRemoved(e){let t=this._collection.getObjectGPUMemoryUsage(e);this._gpuMemoryEstimate-=t,this._geoMemoryEstimate-=t}isNodeLoaded(e){return this._nodeId2Meta.has(e)}isNodeReloading(e){return this._nodeId2MetaReloading.has(e)}get usedMemory(){let e=this._labeler==null?0:this._labeler.usedMemory;return this._nodeId2Meta.forEach(t=>e+=t==null?0:t.node.memory),this._nodeId2MetaReloading.forEach(t=>e+=t==null?0:t.node.memory),e}get unloadedMemory(){return(this._controller==null?0:this._controller.unloadedMemoryEstimate)+(this._labeler==null?0:this._labeler.unloadedMemoryEstimate)}_labelingChanged(){if(!(Le(this.layer)&&this._supportsLabeling)){this._labeler!=null&&(this._labeler.destroy(),this._labeler=null);return}if(this._labeler!=null)return;let e=new Oe({view:this.view,layer:this.layer,collection:this._collection,overrides:this.i3sOverrides,layerViewUid:this.uid});this._nodeId2Meta.forEach(t=>t!=null&&this._addMetaToLabeler(e,t)),this._labeler=e}_loadAsyncModule(e){return++this._asyncModuleLoading,e.then(e=>(--this._asyncModuleLoading,e),e=>{throw--this._asyncModuleLoading,e})}_modificationsChanged(){if(!this._i3sWasmLoaded&&this.hasModifications){this._i3sWasmLoaded=Ae().then(()=>{this._i3sWasmLoaded=!0,this._modificationsChanged(),this.notifyUpdate()},()=>{}),this.notifyUpdate();return}if(this._i3sWasmLoaded!==!0)return;let e=e=>a.getLogger(this).error(`set-modifications-error`,`Error when setting modifications:`,e),t=this.uid,n=this.layer.spatialReference,r=n.isGeographic,i=Fe(this._layerClippingArea,this._modifications,n,this.view.state.isGlobal);this._workerHandle.setModifications(t,i,r).catch(e);try{je({context:t,modifications:i,isGeodetic:r})}catch(t){e(t)}this._controller.modificationsChanged();let o=this.hasModifications?new c:null;this._nodeId2Meta.forEach((e,t)=>{e==null?(this._nodeId2Meta.delete(t),this._controller.updateLoadStatus(t,!1)):e.node.hasModifications?(this._updateFeatureIdCounts(e,-1),this._nodeId2Meta.delete(t),this._nodeId2MetaReloading.set(t,e)):o?.push(e.node)}),this.notifyChange(`elevationRange`),o!=null&&this._nodeId2MetaReloading.forEach(e=>o.push(e.node)),o!=null&&o.length>0&&(this.updateNodeModificationStatus(o),o.forAll(e=>{if(e.imModificationImpact!==2){let t=this._nodeId2Meta.get(e.index);this._controller.invalidateGeometryVisibility(e.index),t==null?this._nodeId2Meta.has(e.index)&&(this._nodeId2Meta.delete(e.index),this._controller.updateLoadStatus(e.index,!1)):(this._updateFeatureIdCounts(t,-1),this._nodeId2Meta.delete(e.index),this._nodeId2MetaReloading.set(e.index,t),this.notifyChange(`elevationRange`))}})),this.clearMemCache(),this._controller.restartNodeLoading(),this._showModifications()}_showModifications(){if(this._modificationGraphics!=null&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null),!K.I3S_SHOW_MODIFICATIONS||this._modifications.length===0)return;let e={clip:[227,227,79,.8],mask:[227,139,79,.8],replace:[139,227,79,.8]},t={outline:{color:[255,255,255],width:1}};this._modificationGraphics=[];for(let r of this._modifications){let i=r.geometry;i.spatialReference=this.layer.spatialReference;let a=new Ee({...t,color:e[r.type]});this._modificationGraphics.push(new n({geometry:i,symbol:a}))}this.view.graphics.addMany(this._modificationGraphics)}_addMetaToLabeler(e,t){e.addNodeMeta(t,(e,t)=>this._createAttributes(e,t))}_contentVisibleChanged(e){e?(this.view.elevationProvider.register(this._elevationContext,this._elevationProvider),this._stage.view.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler)):(this._removeAllNodeDataFromStage(),this.view.elevationProvider&&this.view.elevationProvider.unregister(this._elevationProvider),this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler))}getLoadedAttributes(e){let t=this._nodeId2Meta.get(e);if(t?.attributeInfo!=null)return t.attributeInfo.loadedAttributes}getAttributeData(e){let t=this._nodeId2Meta.get(e);if(t?.attributeInfo!=null)return t.attributeInfo.attributeData}setAttributeData(e,t){let n=this._nodeId2Meta.get(e);n?.attributeInfo!=null&&(n.attributeInfo.attributeData=t,this._attributeValuesChanged(n))}async updateAttributes(e,t,n){let r=this._nodeId2Meta.get(e);r!=null&&(await this.i3sOverrides.applyAttributeOverrides(r.featureIds,t,n,this._controller.requiredAttributes),r.attributeInfo=t,this._controller.reschedule(()=>{this._nodeId2Meta.get(e)===r&&this._attributeValuesChanged(r)},n).catch(e=>{u(e)||a.getLogger(this).warn(`Error while updating attribute values. Layer might not display correctly.`,e)}))}_attributeValuesChanged(e){e.cachedRendererVersion=this._getInvalidRendererVersion(),e.appliedFilters=null,this._labeler!=null&&this._labeler.setNodeMetaAttributes(e,(e,t)=>this._createAttributes(e,t)),this._updateEngineObject(e)}clearMemCache(){this._memCache!=null&&this._memCache.clear(),this._addTasks.forEach(e=>e.allowMemCache=!1)}getVisibleNodes(){let e=[];return this._nodeId2Meta.forEach(t=>t!=null&&e.push(t.node)),e}getVisibleObbs(){let e=[];return this._nodeId2Meta.forEach(t=>t&&e.push(this._collection.getComponentObb(t.objectHandle))),e}getLoadedNodeIndices(e){this._nodeId2Meta.forEach((t,n)=>e.push(n)),this._nodeId2MetaReloading.forEach((t,n)=>e.push(n))}_getVertexBufferLayout(e,t){return _t(yt(this._getGeometryParameters({hasTexture:It(e.params.material),hasNormals:t.normal,hasRegions:t.uvRegion})))}_getObjectIdField(){return this.layer.objectIdField||L}_getGlobalIdField(){return this.layer.globalIdField}_findGraphicNodeAndIndex(e){let t=G(this.layer.fieldsIndex,e.attributes,this._getObjectIdField());for(let e of this._nodeId2Meta.values()){let n=e?.featureIds.indexOf(t);if(n!=null&&n>=0)return{node:e.node,index:n}}return null}_getGraphicIndices(e,t){let n=this._nodeId2Meta.get(e.index);if(n==null)return[];let r=[],i=this._getObjectIdField(),a=this.layer.fieldsIndex;for(let e of t){let t=G(a,e.attributes,i),o=n.featureIds.indexOf(t);o!==-1&&r.push(o)}return r}whenGraphicBounds(e){let t=this._findGraphicNodeAndIndex(e);if(!t)return Promise.reject();let n=this.getAABB(t.node.index,t.index);return n==null?Promise.reject():Promise.resolve({boundingBox:n,screenSpaceObjects:[]})}getAABBFromIntersectorTarget(e){return e.nodeIndex==null||e.componentIndex==null?null:this.getAABB(e.nodeIndex,e.componentIndex)}getAABB(e,t){let n=this._nodeId2Meta.get(e);if(n?.featureIds==null||t>=n.featureIds.length)return null;let r=n.objectHandle,i=He(t,this._collection,r,P(24),0),a=this.view.renderSpatialReference,o=this.view.spatialReference;return he(i,a,0,i,o,0)?ge(i):null}whenGraphicAttributes(e,t){return tt(this.layer,e,this._getObjectIdField(),t,()=>this._nodeId2Meta.values().filter(i).toArray())}getGraphicFromIntersectorTarget(e,t){if(e.nodeIndex==null||e.componentIndex==null)return null;let n=this._nodeId2Meta.get(e.nodeIndex);if(n?.featureIds==null||e.componentIndex>=n.featureIds.length)return null;let r=this._createLayerGraphic(this._createAttributes(e.componentIndex,n));return r?this._meshUtilsImporterModule?(r.geometry=this._meshUtilsImporterModule.createMesh({layerView:this,nodeIndex:e.nodeIndex,featureIndex:e.componentIndex}),r):t.defer?(t.defer(async()=>(r.geometry=(await this._meshUtilsImporter).createMesh({layerView:this,nodeIndex:e.nodeIndex,featureIndex:e.componentIndex}),r)),null):r:null}_getCacheKey(e){return`${this._layerUrl}/v30/${e}${this._cacheKeySuffix}`}get _meshUtilsImporter(){return this._meshUtilsImporterPromise||(this._meshUtilsImporterPromise=import(`./i3s/meshUtils.js`),this._meshUtilsImporterPromise.then(e=>this._meshUtilsImporterModule=e,()=>{})),this._meshUtilsImporterPromise}_getCacheKeySuffix(){let e=this.view.renderSpatialReference;return e==null?Kt:e===D(e)?qt:this.layer.spatialReference.equals(e)?Gt:e.wkid==null?null:`@${e.wkid}`}_getMemCacheKey(e,t=this.elevationOffset){return e+`#`+t}get _idbCacheEnabled(){return!this._controller.disableIDBCache&&!this.hasModifications&&this.elevationOffset===0&&this._cacheKeySuffix!=null}loadCachedGPUData(e){return this._memCache==null?null:this._memCache.pop(this._getMemCacheKey(e))}deleteCachedGPUData(e){e!=null&&this._deleteComponentObject(e)}_cacheGPUData(e,t=this.elevationOffset){if(this._memCache==null){this._deleteComponentObject(e);return}let n=this._controller.indexDepth-e.node.level;this._memCache.put(this._getMemCacheKey(e.node.index,t),e,n)}loadMissingTextures(e,t,n,r){let i=e?.filter((e,n)=>{if((e.usage&this.rendererTextureUsage)===0)return!1;if(t==null)return!0;let r=Ke(e.encodings,this.supportedTextureEncodings),i=t[n];return!!(i?.data==null||r&&i.encoding!==r.encoding)})??[];return i.length===0?Promise.resolve(!1):n(i,r).then(n=>{let r=0;for(let i=0;i<e.length;i++)r<n.length&&n[r].id===e[i].id&&(t[i]=n[r],r++);return!0})}loadCachedNodeData(e,t,n){return this._idbCacheEnabled?this._idbCache.get(this._getCacheKey(e.id),t).then(r=>r==null?null:(r.globalTrafo=_e(r.globalTrafo),r.nodeVersion===e.version?(this.elevationInfo.mode===0&&(e.geometryObbInRenderSR=J.fromData(r.geometryObbData)),this.loadMissingTextures(r.requiredTextures,r.textureData,n,t).then(n=>(n&&this._idbCache.initialized&&r.textureData!=null&&(r.byteSize=zt(r.transformedGeometry,r.textureData),r.textureData.every(Rt)&&this._indexedDbSizeCheck(e,r)&&this._idbCache.put(this._getCacheKey(e.id),r).catch(t=>a.getLogger(this).warn(`Failed to update node with textures in IndexedDB cache: ${e.id}: ${t}`))),d(t),r))):(this._idbCache.remove(this._getCacheKey(e.id)),null))):Promise.resolve(null)}addNode(e,t,n){return Lt(t)?t.geometryBuffer==null?(this._addNodeMeta(e.index,null),Promise.resolve()):this._addData(e,t.attributeDataInfo,()=>this._transformNode(e,t,n).then(r=>this._safeReschedule(()=>{if(r==null)return e.hasModifications=!1,this._addCachedNodeData(e,null,n);let{obb:i,componentOffsets:o,featureIds:s,anchorIds:c,anchors:l,transformedGeometry:u,geometryMinElevation:d,geometryMaxElevation:f}=r;e.hasModifications=u.hasModifications;let p=_e(r.globalTrafo),m=b(Ht,i.center.x,i.center.y,i.center.z);x(m,m,p);let h=new J(m,[i.extents.x,i.extents.y,i.extents.z],ce(i.orientation.x,i.orientation.y,i.orientation.z,i.orientation.w));this.elevationInfo.mode===0&&(e.geometryObbInRenderSR=h),t.geometryData.componentOffsets=o,s&&(t.geometryData.featureIds=Array.from(s)),t.geometryData.anchorIds=c,t.geometryData.anchors=l;let g={nodeVersion:e.version,geometryData:t.geometryData,requiredTextures:t.requiredTextures,textureData:t.textureData,transformedGeometry:u,globalTrafo:p,geometryObbData:h.data,geometryMinElevation:d,geometryMaxElevation:f,byteSize:zt(u,t.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&this._indexedDbSizeCheck(e,g)){let t=g.textureData==null?null:g.textureData.map(e=>Rt(e)?e:null);this._idbCache.put(this._getCacheKey(e.id),{...g,textureData:t}).catch(t=>a.getLogger(this).warn(`Failed to store node in IndexedDB cache: ${e.id}: ${t}`))}return this._addCachedNodeData(e,g,n)},n))):Promise.reject()}getElevationRange(e){let t=new q,n=this._controller,{index:r}=n;if(!r)return t;let{rootNode:i}=r;if(!i)return t;let a=this._nodeId2Meta,o=n.viewportQueries;return r.traverse(i,n=>{let{childrenLoaded:r}=n;if(r===0)return!1;let i=o.getAndUpdateVisibilityObbInRenderSR(n),s=null;if(i){if(!i.intersectSphereWithMBS(e,i.radius))return!1}else if(s=o.calculateServiceMbsInRenderSRElevationAdjusted(n),s?.isValid&&!e.intersects(s))return!1;let c=a.get(n.index);if(c){let{geometryObbInRenderSR:r}=n;if(!r||r.intersectSphereWithMBS(e)){let e=c.geometryElevationRange;e.elevationRangeValid&&!e.isEmpty&&t.expandElevationRange(e)}}return r-+!!c>0}),t}computeVisibilityObb(e){return nt(e,this.view.renderSpatialReference,this._controller.crsIndex,this.layer.spatialReference,this.elevationOffset,this._modifications,this.view.renderCoordsHelper.sphericalPCPF)}_transformNode(e,t,n){let r=t.geometryData.geometries??[],i=Array(r.length);for(let e=0;e<r.length;++e)i[e]=this._getVertexBufferLayout(r[e],t.geometryDescriptor);let a=this.layer.normalReferenceFrame,o=t.normalReferenceFrame??a??`none`,s=e.serviceMbsInIndexSR,c=this.elevationOffset,l=this._controller.crsIndex,u=this._controller.crsVertex,d=this.view.renderSpatialReference,f=Ze(s,c,o,l,d),p=O(l,u),m=O(u,d);if(p==null||m==null)return Promise.resolve(null);let h={context:this.uid,geometryBuffer:t.geometryBuffer,geometryData:t.geometryData,geometryDescriptor:t.geometryDescriptor,layouts:i,globalTrafo:f,geometryElevationOffset:c,mbs:s.toJSON(),obbData:e.serviceObbInIndexSR?.data,elevationOffset:c,planetRadiusInGlobalMode:this._planetRadiusInGlobalMode,needNormals:this._controller.isMeshPyramid||this._imVertexNormals,computeNormals:this._isIntegratedMesh&&this._imVertexNormals,normalReferenceFrame:o,indexToVertexProjector:p,vertexToRenderProjector:m};return this._workerHandle.invoke(h,n)}get _supportsNodeCrossFading(){return!this.view?.stage?.renderer.shadowsEnabled}get nodeCrossfadingEnabled(){return this._supportsNodeCrossFading&&(this.lodCrossfadeinDuration>0||this.lodCrossfadeoutDuration>0||this.lodCrossfadeUncoveredDuration>0)}get nodeFadeoutEnabled(){return this._supportsNodeCrossFading&&this.lodCrossfadeoutDuration>0}_setNewNodeOpacity(e){let t=this.nodeCrossfadingEnabled?0:this.fullOpacity;this._setNodeOpacity(e,t)}addCachedGPUData(e,t,n){if(this.elevationInfo.mode===0&&(e.geometryObbInRenderSR=this._collection.getComponentObb(t.objectHandle).clone()),!this._controller.isGeometryVisible(e)){this._cacheGPUData(t);return}let r=e.index;this._addNodeMeta(r,t),this.updateNodeState(r,n),this._collection.setObjectVisibility(t.objectHandle,!0),this._updateElevationOffsets(t),this._labeler!=null&&this._addMetaToLabeler(this._labeler,t),this._updateMaterial(t),this._setNewNodeOpacity(t),this.elevationInfo.mode!==0&&this._ensureElevationTask().schedule(r),this._updateEngineObject(t),this._highlights?.objectCreated(t),this._treeDebugger!=null&&this._treeDebugger.update()}addCachedNodeData(e,t,n,r){return this._addData(e,n,()=>this._addCachedNodeData(e,t,r))}async deleteCachedNodeData(e){if(this._idbCacheEnabled)return this._idbCache.remove(this._getCacheKey(e))}async _addCachedNodeData(e,t,n){if(!this.contentVisible||!this._controller.isGeometryVisible(e)){this._removeNodeStageData(e.index,this.elevationOffset,this._nodeId2MetaReloading);return}if(t==null){this._addNodeMeta(e.index,null);return}let r=this._addTasks.get(e.index),{geometryData:i,transformedGeometry:o}=t;await this.i3sOverrides.applyAttributeOverrides(i.featureIds,r.attributeInfo,n,this._controller.requiredAttributes);let s=t.textureData==null?[]:t.textureData.filter(e=>e!=null&&(e.usage&this.rendererTextureUsage)!==0);e.memory=0;let{componentOffsets:c,geometries:l,featureIds:u,anchorIds:d,anchors:f}=i,p=this._collection,m=l[0],{layout:h,indices:g,interleavedVertexData:_,positionData:v,hasColors:ce}=o,{material:b,geometryParameters:x}=this._materialParameters(m,h),S=_.byteLength/h[0].stride,de=c||new Uint32Array([0,g?g.length:S]),C=m.transformation?oe(m.transformation):se(),T=_e(t.globalTrafo);ie(C,T,C);let E=ae(w(),C),D=y(ne(),C),me=this._isIntegratedMesh?this._imShading?2:0:1,he=x.textureCoordinateType,O=!ee(D,re),A=new bt(h,me,he,+!!O),ge=new xt({interleavedVertexData:_,vertexCount:S,indexData:g},{positions:ve(v.data),indices:ye(v.indices)},de,A),j=this.view.renderSpatialReference,M=this.view.groundView.spatialReference,N=J.fromData(ht(t.geometryObbData)).getCenter(Xt),P=[1,1,1];pe(N,j,P,M)||a.getLogger(this).errorOnce(`Unsupported coordinate system for IM overlay`);let F=w();k(N,j,F,M);let I=ne();te(I,D);let L=w();le(L,ue(L,N,E),I);let be=F[0]-L[0]*P[0],xe=F[1]-L[1]*P[1],Se=x.textureCoordinateType===2,{textures:R,texturePromise:Ce,materialParameters:we}=this._initMaterialAndTextures(b,s,Se,e),z=p.createObject(new vt(fe(be,xe,P[0],P[1]),new Ct(E,D),J.fromData(ht(t.geometryObbData)),ge,has(`enable-feature:im-as-ground`)?!this.layer.isUsedAsGroundLayer:!this._isIntegratedMesh),we);e.memory+=this._memEstimateGeometryAdded(z),e.memory+=R.reduce((e,t)=>e+(t==null?0:this._memEstimateTextureAdded(t)),0);let B=!!b.hasParametersFromSource,Te=b.alphaMode!==`blend`&&b.metallicRoughness.baseColorFactor[3]>=1,V=new Ot(e,u,z,this._getInvalidRendererVersion(),r.attributeInfo,{hasParametersFromSource:B,isOpaque:Te},R,d,f,t.geometryMinElevation,t.geometryMaxElevation);r.meta=V,this._hasTextures||=t.requiredTextures?.some(({usage:e})=>!!(e&19))||!!e.resources.texture,this._hasData=!0,this._hasColors||=ce,this.notifyChange(`hasTexturesOrVertexColors`);let Ee=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(V),Ce]).then(([t,r])=>(this._addTasks.has(e.index)&&t?.updateObjectVisibility(V.objectHandle,!1).catch(e=>this._logEdgeViewError(e,this.layer.title)),this._safeReschedule(()=>{let n=this._addTasks.get(e.index);if(!n)return;if(this._addNodeMeta(e.index,V),n.meta=null,!this.contentVisible){this._removeNodeStageData(e.index,this.elevationOffset);return}p.setObjectVisibility(z,!0),t?.updateObjectVisibility(V.objectHandle,!0).catch(e=>this._logEdgeViewError(e,this.layer.title)),V.attributeInfo=n.attributeInfo;let r=V.cachedRendererVersion!==this._rendererVersion,i=Ee!==this.slicePlaneEnabled;this._updateElevationOffsets(V);let a=V.elevationOffsets;this._updateComponentData(V);let o=this._applyFiltersToNode(V);(r||t!=null&&(i||o||a))&&this._addOrUpdateEdgeRendering(V).catch(()=>{}),this._labeler!=null&&this._addMetaToLabeler(this._labeler,V),this._visibleGeometryChanged(V,0),this._highlights?.objectCreated(V),this._updateMaterial(V),this._setNewNodeOpacity(V),this._treeDebugger!=null&&this._treeDebugger.update()},n))).catch(e=>{let{meta:t,allowMemCache:n}=r;throw r.meta=null,t&&n?this._cacheGPUData(t):t&&this._deleteComponentObject(t),e})}_addNodeMeta(e,t){if(this._removeNodeStageData(e,this.elevationOffset,this._nodeId2MetaReloading),this._nodeId2Meta.has(e)){a.getLogger(this).error(`Removing duplicated node`);let t=this._nodeId2Meta.get(e);t&&(this._deleteComponentObject(t),this._updateFeatureIdCounts(t,-1))}else this._controller.updateLoadStatus(e,!0);t&&(t.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&X(t.cachedEdgeMaterials,0),this._updateFeatureIdCounts(t,1)),this._nodeId2Meta.set(e,t),this.notifyChange(`elevationRange`)}_updateElevationOffsets(e){if(!e.node.serviceMbsInIndexSR)return;let{view:t,elevationInfo:n}=this,r=this._controller.crsIndex,{groundView:i,groundSpatialReference:a,renderSpatialReference:o}=t,s=n.mode;if(s===0){e.elevationAlignmentOffset=n.offset,e.elevationOffsets=null,e.updateGeometryElevationRange(),this.notifyChange(`elevationRange`);return}if(e.elevationAlignmentOffset=0,o==null||a==null){e.elevationOffsets=null,e.updateGeometryElevationRange(),this.notifyChange(`elevationRange`);return}let c=this._collection.getObjectTransform(e.objectHandle);e.elevationOffsets=e.elevationOffsets??[];let l=Ht,u=Ut,d=s===2,f=this.view.renderCoordsHelper,p=e.featureIds.length,m=(()=>{if(e.cachedElevationAnchors)return e.cachedElevationAnchors;let t=P(p*3);e.cachedElevationAnchors=t;let{center:n}=e.node.serviceMbsInIndexSR;for(let i=0;i<p;i++){let s=i*3,d=e.anchorIds?.indexOf(i)??-1;e.anchors&&d>=0?(b(l,e.anchors[d*3],e.anchors[d*3+1],e.anchors[d*3+2]),S(l,l,n),k(l,r,l,o),t[s+2]=f.getAltitude(l),k(l,o,l,a),t[s]=l[0],t[s+1]=l[1]):(this._collection.getComponentAabb(e.objectHandle,i,u,!0),b(l,(u[0]+u[3])/2,(u[1]+u[4])/2,u[2]),le(l,l,c.rotationScale),S(l,l,c.position),t[s+2]=f.getAltitude(l),k(l,o,l,a),t[s]=l[0],t[s+1]=l[1])}return t})(),h=n.offset,g=e.elevationOffsets;i.getElevations(m,p,(e,t)=>{let n=d?m[e*3+2]:0;g[e]=h+(t??0)-n}),e.updateGeometryElevationRange(),this.notifyChange(`elevationRange`)}_ensureElevationTask(){return this._elevationTask??=new ze(this.view.resourceController.scheduler,e=>this._controller.updateElevationChanged(e,this.view.groundView.spatialReference)?.filterInPlace(e=>this._nodeId2Meta.get(e)!=null),e=>this._nodeElevationAlignmentChanged(this._nodeId2Meta.get(e)),()=>this.elevationInfo?.mode),this._elevationTask}_elevationInfoChanged(e,t){let n=e.mode!==0,r=!!t&&t!==e&&t.mode!==0;this._intersectionHandler.updateElevationAlignState(n,this.view.state.viewingMode),n&&!r&&this._controller.removeAllGeometryObbs(),this._nodeId2Meta.forEach(e=>this._nodeElevationAlignmentChanged(e))}_nodeElevationAlignmentChanged(e){e!=null&&(this._updateElevationOffsets(e),this._updateComponentData(e),this._updateEdgeRendering(e),this._labeler!=null&&this._labeler.updateLabelPositions(e),this._updateSnappingSources(e,2),this._elevationProvider.notifyObjectChanged(this._collection.getComponentObb(e.objectHandle)))}_safeReschedule(e,t){return d(t),this._controller.reschedule(e,t)}_materialParameters(e,t){let n=e.params.material==null?qe():e.params.material,r=t.some(({name:e})=>e===`uvRegion`),i=t.some(({name:e})=>e===`normalCompressed`),a=It(n);return{geometryParameters:this._getGeometryParameters({hasTexture:a,hasNormals:i,hasRegions:r}),material:n}}_initMaterialAndTextures(e,t,n,r){let i=this._stage.renderView,a=e=>{this._gpuMemoryEstimate-=e,this._texMemoryEstimate-=e,r.memory-=e},o=t.map(t=>Je(t,e,n,i,this._compressionTracker,a));this._stage.addTextures(o);let{materialParameters:s,texturePromise:c}=Ye(e,o,t,this.view.stage.renderView.textures,{rendererTextureUsage:this.rendererTextureUsage,usePBR:this._usePBR,isIntegratedMesh:this._isIntegratedMesh,isGround:this.layer.isUsedAsGroundLayer,slicePlaneEnabled:this.slicePlaneEnabled,viewSpatialReference:this.view.spatialReference,applySSAO:this._applySSAO});return{textures:o,texturePromise:c,materialParameters:s}}_getGeometryParameters(e){return new St(this._hasVertexColors,e.hasNormals,e.hasTexture?e.hasRegions?2:1:0)}_addData(e,t,n){let r=this._addTasks.get(e.index);if(r)r.attributeInfo=t;else{let i=Promise.withResolvers();r=new Vt(t,null,i.promise),this._addTasks.set(e.index,r),n().then(i.resolve,i.reject).then(()=>this._addTasks.delete(e.index)).catch(t=>{throw this._addTasks.delete(e.index),t})}return r.promise}_clearAddTasks(){this._addTasks.forEach(e=>{e.meta!=null&&(this._cacheGPUData(e.meta),e.meta=null)}),this._addTasks.clear()}_clippingAreaChanged(){let e=this.view.renderSpatialReference,t=this.layer.spatialReference,n=M();this._renderClippingArea=mt(this.view.clippingArea,n,e)?n:null;let r=M();this._layerClippingArea=mt(this.view.clippingArea,r,t)?r:null,this._filterChange(),this._controller&&this._controller.updateClippingArea(this.view.clippingArea),this._isIntegratedMesh&&this._modificationsChanged()}get hasGeometryFilter(){return!1}_geometryFilterChange(){let e=this.hasGeometryFilter;this._controller.geometryFilterChanged(e),this._applyFilters(e),this._assertFeatureIdNodeCounts(e)}_assertFeatureIdNodeCounts(e){e&&!this._featureIdCounts?(this._featureIdCounts=$(this._nodeId2Meta.values()),this._filteredIdCounts=$(this._nodeId2Meta.values(),1),this._weaklyRemovedIdCounts=$(this._nodeId2Meta.values(),2),this.addHandles(p(()=>this._controller.updating,e=>{!e&&this._needFilterResolve&&(this.multiGeometryFilterResolve(),this._needFilterResolve=!1,this.notifyUpdate())},{sync:!0}),`updateFinished`)):!e&&this._featureIdCounts&&(this._featureIdCounts=null,this._filteredIdCounts=null,this._weaklyRemovedIdCounts=null,this._mismatchShow=null,this._mismatchHide=null,this.removeHandles(`updateFinished`),this._needFilterResolve=!1,this.notifyUpdate())}_updateFeatureIdCounts(e,t){this._featureIdCounts&&(this._needFilterResolve=!0,Q(this._featureIdCounts,e.featureIds,t),Q(this._filteredIdCounts,e.filteredIds,t),Q(this._weaklyRemovedIdCounts,e.weaklyRemovedIds,t))}_updateFilteredIdCounts(e,t,n){this._filteredIdCounts&&(this._needFilterResolve=!0,Q(this._filteredIdCounts,t,-1),Q(this._filteredIdCounts,e.filteredIds,1),Q(this._weaklyRemovedIdCounts,n,-1),Q(this._weaklyRemovedIdCounts,e.weaklyRemovedIds,1))}_checkFeatureIdNodeCountInvariant(){let e=this._featureIdCounts!=null;if(this.hasGeometryFilter!==e&&a.getLogger(this).error(`checkFeatureIdNodeCountInvariant()`,`LayerView should have feature id node counts if and only if it has a geometry filter`,{layerView:this,hasNodeCounts:e}),!this._featureIdCounts||!this._filteredIdCounts)return;let t=$(this._nodeId2Meta.values());o(this._featureIdCounts,t)||a.getLogger(this).error(`checkFeatureIdNodeCountInvariant()`,`Incorrect _featureIdCounts`,{layerView:this,counts:this._featureIdCounts,expected:t});let n=$(this._nodeId2Meta.values(),1);o(this._filteredIdCounts,n)||a.getLogger(this).error(`checkFeatureIdNodeCountInvariant()`,`Incorrect _filteredIdCounts`,{layerView:this,counts:this._filteredIdCounts,expected:n});let r=$(this._nodeId2Meta.values(),2);o(this._weaklyRemovedIdCounts,r)||a.getLogger(this).error(`checkFeatureIdNodeCountInvariant()`,`Incorrect _weaklyRemovedIdCounts`,{layerView:this,counts:this._weaklyRemovedIdCounts,expected:n})}multiGeometryFilterResolve(){if(!this._featureIdCounts||!this._filteredIdCounts)return;let e=null,t=null;for(let[n,r]of this._filteredIdCounts){let i=this._featureIdCounts.get(n);i!==r&&(r+(this._weaklyRemovedIdCounts?.get(n)??0)===i?(e??=new Set,e.add(n)):(t??=new Set,t.add(n)))}h(e,this._mismatchShow)&&h(t,this._mismatchHide)||(this._mismatchShow=e,this._mismatchHide=t,this._nodeId2Meta.forEach(e=>{if(!e?.filteredIds)return;let t=Yt(e,this._mismatchShow,this._mismatchHide);this._collection.setAllComponentVisibilities(e.objectHandle,t),this._visibleGeometryChanged(e,2)}))}_filterChange(){this._applyFilters(this.hasGeometryFilter)}_applyFilters(e){this._filters=this.getFilters(),e?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach(e=>{e&&this._applyFiltersToNode(e)&&(this._addOrUpdateEdgeRendering(e).catch(()=>{}),this._visibleGeometryChanged(e,2))})}getFilters(){let e=[],t=this._renderClippingArea;return t!=null&&e.push((e,n)=>this._boundingRectFilter(e,n,t)),e}addSqlFilter(e,t,n){if(t!=null){let r=t.fieldNames;e.push((e,i)=>this._sqlFilter(e,i,t,r,n))}}_sqlFilter(e,t,n,r,i){let a={},o=this._createLayerGraphic(a);if(!o)return;let s=this.layer.objectIdField,c=t.featureIds,l=t.attributeInfo?.attributeData;r.every(e=>e===s||l?.[e]!=null)&&rt(e,c,e=>{a[s]=c[e];for(let t of r)t!==s&&(a[t]=l?H(l[t],e):null);try{return n.testFeature(o)}catch(e){return i(e),!1}})}_boundingRectNodeTest(e,t){return me(e.node.serviceMbsInIndexSR,this._controller.crsIndex,Ft,this.view.renderSpatialReference),it(t,Ft)}_boundingRectFeatureTest(e,t,n){return this._collection.getComponentAabb(e.objectHandle,t,At),j(At,jt),N(n,jt)}_boundingRectFilter(e,t,n){let r=this._collection,i=this._boundingRectNodeTest(t,n);if(i===3)return;if(i===0){e.length=0;return}let a=r.getComponentCount(t.objectHandle);if(a.invisible+a.visible!==t.featureIds.length)return;let o=this._transformClippingArea(Mt,n,t.objectHandle);rt(e,t.featureIds,e=>this._boundingRectFeatureTest(t,e,o))}_transformClippingArea(e,t,n){let r=this._collection.getObjectTransform(n),i=r.position,a=r.rotationScale;return e[0]=(t[0]-i[0])/a[0],e[1]=(t[1]-i[1])/a[4],e[2]=(t[2]-i[0])/a[0],e[3]=(t[3]-i[1])/a[4],e}async _addOrUpdateEdgeRendering(e,t=!0){let n=e.objectHandle,{hasEdges:r,perFeatureEdgeMaterials:i}=this._getFilteredEdgeMaterials(e);if(r&&!this._edgeView)try{this._edgeView=await this._stage.renderer.loadEdgeView()}catch(e){if(!u(e))throw e}let a=this._edgeView;if(!a)return null;let o=a.hasObject(n);if(r){if(o)return this.nodeCrossfadingEnabled&&X(i,this.getNodeOpacity(e)),a.updateAllComponentMaterials(n,i,this.slicePlaneEnabled,t).catch(e=>this._logEdgeViewError(e,this.layer.title)),a.updateObjectVisibility(n,!0).catch(e=>this._logEdgeViewError(e,this.layer.title)),a.updateAllVerticalOffsets(n,e.elevationOffsets).catch(e=>this._logEdgeViewError(e,this.layer.title)),a;let r=await this._collection.addEdges(n,a,i,this.slicePlaneEnabled,e.elevationOffsets);return e.edgeMemoryUsage=r,e.node.memory+=r,a}return o&&(e.node.memory-=e.edgeMemoryUsage,e.edgeMemoryUsage=0,a.removeObject(n)),null}_applyFiltersToNode(e){let{filteredIds:t,weaklyRemovedIds:n}=e,r=this._applyFiltersToNodeComponents(e);return this._updateFilteredIdCounts(e,t,n),r&&this._labeler?.applyFilterChange(e),r}_applyFiltersToNodeComponents(e){let t=this._collection,n=t.getComponentCount(e.objectHandle),r=e.filteredIds!=null,i=n.invisible===0;if(t.setAllComponentVisibilities(e.objectHandle,`all`),this._filters.length===0)return e.filteredIds=null,!i;if((e.filteredIds==null||e.appliedFilters!==this._filters)&&(e.weaklyRemovedIds=null,e.filteredIds=Jt(e,this._filters),e.appliedFilters=this._filters),r&&e.filteredIds===e.featureIds&&(!this._mismatchHide||e.filteredIds.every(e=>!this._mismatchHide?.has(e))))return!i;let a=Yt(e,this._mismatchShow,this._mismatchHide);return t.setAllComponentVisibilities(e.objectHandle,a),!0}_removeAllNodeDataFromStage(e=this.elevationOffset){this._nodeId2Meta.forEach((t,n)=>this._removeNodeStageData(n,e)),this._nodeId2MetaReloading.forEach((t,n)=>this._removeNodeStageData(n,e,this._nodeId2MetaReloading)),this._elevationTask=s(this._elevationTask)}removeNode(e){let t=this.elevationOffset;this._removeNodeStageData(e,t),this._removeNodeStageData(e,t,this._nodeId2MetaReloading),this._elevationTask!=null&&this._elevationTask.remove(e)}_removeNodeStageData(e,t,n=this._nodeId2Meta){n.has(e)&&this._controller.updateLoadStatus(e,!1);let r=n.get(e);r==null?n.delete(e):(this._collection.setObjectVisibility(r.objectHandle,!1),this._edgeView!=null&&this._edgeView.hasObject(r.objectHandle)&&this._edgeView.updateObjectVisibility(r.objectHandle,!1).catch(e=>this._logEdgeViewError(e,this.layer.title)),this._visibleGeometryChanged(r,1),this._labeler!=null&&this._labeler.removeNodeMeta(r),n.delete(e),this._highlights?.objectDeleted(r),n===this._nodeId2Meta?(this._updateFeatureIdCounts(r,-1),this._cacheGPUData(r,t),this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopNodeFading(r)):this._deleteComponentObject(r),this._treeDebugger!=null&&this._treeDebugger.update())}_deleteComponentObject(e){if(this._edgeView!=null&&this._edgeView.removeObject(e.objectHandle),this._memEstimateGeometryRemoved(e.objectHandle),this._collection.destroyObject(e.objectHandle),e.textures)for(let t of e.textures)this._memEstimateTextureRemoved(t),this._stage.removeTexture(t)}updateNodeState(e,t){this._nodeId2Meta.get(e)?.objectHandle.updatePolygonOffset(+(t===0))}updateNodeIndex(e,t){if(this._nodeId2Meta.has(e)){let n=this._nodeId2Meta.get(e);this._nodeId2Meta.delete(e),this._nodeId2Meta.set(t,n),this.notifyChange(`elevationRange`)}let n=this._nodeId2MetaReloading.get(e);n&&(this._nodeId2MetaReloading.delete(e),this._nodeId2MetaReloading.set(t,n))}_invalidateAllSymbols(){this._rendererVersion=U(this._rendererVersion,1),this._controller?.requestUpdate()}_getInvalidRendererVersion(){return U(this._rendererVersion,-1)}async _rendererChange(e){if(this._currentRenderer=e,this.notifyChange(`rendererTextureUsage`),this._rendererVersion=U(this._rendererVersion,1),this._rendererFields=null,this._colorVariable=null,this._opacityVariable=null,this._invalidateAllSymbols(),e&&(this._rendererFields=await e.getRequiredFields(this.layer.fieldsIndex)),this._updateSymbologyFields(),!this._arcade&&e&&`arcadeRequired`in e&&e.arcadeRequired&&(this._arcade=await Te()),e&&`visualVariables`in e&&e.visualVariables)for(let t of e.visualVariables)t.type===`color`?this._colorVariable=t:t.type===`opacity`?this._opacityVariable=t:a.getLogger(this).warn(`Unsupported visual variable type for 3D Object Scene Services: ${t.type}`);if(e)for(let t of e.symbols)t.type!==`mesh-3d`&&a.getLogger(this).error(`Symbols of type '${t.type}' are not supported for 3D Object Scene Services.`);this._controller&&this._controller.requestUpdate()}_getCachedEdgeMaterials(e){return this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e),e.cachedEdgeMaterials}_getComponentParameters(e){this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e);let t=e.cachedSymbology;return(n,r)=>{let i=n*e.cachedSymbologyStride;T(r.externalColor,t[i]/255,t[i+1]/255,t[i+2]/255,t[i+3]/255);let a=this._stage.renderView.olidRenderHelper;if(a){let t=e.featureIds[n],i=this.sublayerId?`${this.layerViewUid}_${this.sublayerId}`:this.layerViewUid,o=z(this.view,this.uid);a.setUidToObjectAndLayerId(t,t,this.layerId,i,this.layerPopupEnabledAndHasTemplate&&!o,e.node.resources.attributes,n,this.sublayerId),r.olidColor=a.getObjectAndLayerIdColor({graphicUid:t,layerViewUid:i})}r.externalColorMixMode=t[i+4]&15,r.castShadows=!!(t[i+4]&16),r.pickable=!!(t[i+4]&32),r.elevationOffset=e.elevationOffsets?.[n]??0,r.emissiveStrength=e.emissiveStrengths?.[n]??1,r.emissiveSource=e.emissiveSources?.[n]??0}}_getSymbolInfo(e,t){let n=e?.getSymbol(t,{arcade:this._arcade});if(!(n instanceof V))return null;let r=n.id;if(this._symbolInfos.has(r))return this._symbolInfos.get(r);let i=at(n);return this._symbolInfos.set(r,i),i}_setSymbologyOverride(e,t){this._symbologyOverride!==e&&(this._symbologyOverride=e,this._symbologyOverrideFields=t,this._invalidateAllSymbols(),this._updateSymbologyFields())}_updateSymbologyFields(){this._symbologyFields=this._symbologyOverrideFields!=null&&this._symbologyOverrideFields.length>0?this._rendererFields!=null&&this._rendererFields.length>0?xe(this.layer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(e){if(e.cachedRendererVersion=this._rendererVersion,!this._hasComponentData)return;let t=this._tmpAttributeOnlyGraphic,n={};t.attributes=n;let r=this._currentRenderer,i=e.attributeInfo?.attributeData,a=e.featureIds?this.layer.objectIdField:null,o=i!=null&&this._symbologyFields!=null&&this._symbologyFields.length>0,s=null,c=null;if(o&&this._symbologyFields!=null){s=[],c=[];for(let e of this._symbologyFields){let t=i[e];t&&(s.push(e),c.push(t))}}e.cachedSymbology||=I(e.featureIds.length*e.cachedSymbologyStride);let l=new ut,u=this.fullOpacity,d=this.nodeCrossfadingEnabled?this.getNodeOpacity(e):u,f=null,p=1,m=W,h=0;for(let i=0;i<e.featureIds.length;i++){if(a!=null&&(n[a]=e.featureIds[i]),o&&s)for(let e=0;e<s.length;e++)n[s[e]]=H(c[e],i);let u=r?this._getSymbolInfo(r,t):null,g,_;if(l.pickable=!0,r&&`visualVariables`in r){if(this._colorVariable){let e=Ce(this._colorVariable,t,{color:Pt,arcade:this._arcade});e&&(g=l.color,g[0]=e.r/255,g[1]=e.g/255,g[2]=e.b/255,g[3]=e.a??1,!this._opacityVariable&&e.a!==null&&(_=e.a))}this._opacityVariable&&(_=we(this._opacityVariable,t,{arcade:this._arcade}))}if(u?.material){let e=u.material;g=g==null||_==null?Ie(g,_,e.color,e.alpha,Dt,l.color):Ie(g,_,null,null,Dt,l.color)}g??=T(l.color,1,1,1,1);let v=u?.material;if(l.colorMixMode=v?.colorMixMode??1,l.edgeMaterial=u?.edgeMaterial,this._symbologyOverride?.(t,l),this._nodeColorOverride!=null&&(this._nodeColorOverride(e.node,g),l.colorMixMode=3),l.pickable&&=g[3]>=Et,l.castShadows=u?u.castShadows:l.pickable,l.edgeMaterial!=null){let t=g[3]>=1&&(e.material.isOpaque||l.colorMixMode===3)?1:0;(l.edgeMaterial!==f||t!==p)&&(m={...l.edgeMaterial,opacity:d,objectTransparency:t},f=l.edgeMaterial,p=t),e.cachedEdgeMaterials[i]=m}else e.cachedEdgeMaterials[i]=W;e.cachedSymbology[h++]=Math.round(g[0]*255),e.cachedSymbology[h++]=Math.round(g[1]*255),e.cachedSymbology[h++]=Math.round(g[2]*255),e.cachedSymbology[h++]=Math.round(g[3]*255),e.cachedSymbology[h++]=l.colorMixMode|l.castShadows<<4|l.pickable<<5;let y=v?.emissive?.strength==null?Y:v?.emissive?.strength;y!==Y&&!e.emissiveStrengths&&(e.emissiveStrengths=Array(e.featureIds.length).fill(Y)),e.emissiveStrengths&&(e.emissiveStrengths[i]=y);let ee=v?.emissive?.source||0;ee!==0&&!e.emissiveSources&&(e.emissiveSources=Array(e.featureIds.length).fill(0)),e.emissiveSources&&(e.emissiveSources[i]=ee)}}_getFilteredEdgeMaterials(e){let t=this._getCachedEdgeMaterials(e);this.nodeCrossfadingEnabled||X(t,this.fullOpacity);let n=e.filteredIds;if(n==null)return{hasEdges:t.some(e=>e!==W),perFeatureEdgeMaterials:t};let r=0,i=!1,a=t.map((t,a)=>e.featureIds[a]===n[r]?(i||=t!==W,r++,t):W);return{hasEdges:i,perFeatureEdgeMaterials:a}}_updateComponentData(e){if(!this._hasComponentData)return;let{objectHandle:t}=e,n=this._getComponentParameters(e);this._collection.setComponentData(t,n),this._stage.renderView.requestRender()}_reloadAll(e=this.elevationOffset){this._removeAllNodeDataFromStage(e),this._controller!=null&&this._controller.restartNodeLoading()}_refreshGroundUsage(){this._intersectionHandler.isGround=has(`enable-feature:im-as-ground`)?this.layer.isUsedAsGroundLayer:this._isIntegratedMesh,this.contentVisible&&(this.view.elevationProvider.unregister(this._elevationProvider),this.view.elevationProvider.register(this._elevationContext,this._elevationProvider)),this._reloadAll(),this.clearMemCache()}_opacityChange(e){this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopAllNodeFading(),this._nodeId2Meta.forEach(t=>{t!=null&&(this._collection.updateObjectOpacity(t.objectHandle,e),X(t.cachedEdgeMaterials,e),this._updateEdgeRendering(t))})}_updateMaterial(e){e.objectHandle.updateMaterial({slicePlaneEnabled:this.slicePlaneEnabled,usePBR:this._usePBR})}_updateEngineObject(e){this._updateComponentData(e),this._applyFiltersToNode(e),this._addOrUpdateEdgeRendering(e).catch(()=>{}),this._visibleGeometryChanged(e,2)}intersect(e,t,n,r){this._intersectionHandler.intersectRay(e,t,n,r,null,!1)}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),this._labeler!=null&&(this._labeler.slicePlaneEnabled=e),this._foreachMeta(t=>{t.objectHandle.updateMaterial({slicePlaneEnabled:e}),this._updateEdgeRendering(t,!1)})}_updatePBR(e){this._foreachMeta(t=>t.objectHandle.updateMaterial({usePBR:e})),this._hasLoadedPBRTextures=!0}_foreachMeta(e){this._nodeId2Meta.forEach(t=>{t!=null&&e(t)})}get _usePBR(){return this._imShading&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(e,t=!0){this._edgeView!=null&&this._edgeView.hasObject(e.objectHandle)&&this._addOrUpdateEdgeRendering(e,t).catch(()=>{})}_forAllNodes(e){this._nodeId2Meta.forEach(e)}_ignoreClientNodeOverriddenFeatures(e){return this.i3sOverrides.hasGeometryChanges?(t,n,r)=>r.node.index>=0&&this.i3sOverrides.featureHasGeometryChanges(t)?0:e(t,n,r):e}_forAllFeatures(e,t,n){for(let r of this._nodeId2Meta.values())if(r!=null&&!(t&&r.node.serviceMbsInIndexSR&&t(r.node.serviceMbsInIndexSR)===1))switch(n){case 1:this._forAllFeaturesOfNode(r,e);break;case 0:this._forAllVisibleFeaturesOfNode(r,e);break;case 2:this._forAllQueryableFeaturesOfNode(r,e)}}_forAllFeaturesOfNode(e,t){e.featureIds.forEach((n,r)=>t(n,r,e))}_forAllVisibleFeaturesOfNode(e,t){let n=e.featureIds;this._collection.forEachVisibleComponent(e.objectHandle,r=>t(n[r],r,e)===0)}_forAllQueryableFeaturesOfNode(e,t){let n=this._ignoreClientNodeOverriddenFeatures(t);if(this._renderClippingArea==null)return this._forAllFeaturesOfNode(e,n);let r=this._boundingRectNodeTest(e,this._renderClippingArea);if(r===0)return;if(r===3)return this._forAllFeaturesOfNode(e,n);let i=e.featureIds,a=e.objectHandle,o=ot(this._renderClippingArea,this._collection.getObjectTransform(a));for(let t=0;t<i.length;t++)this._boundingRectFeatureTest(e,t,o)&&n(i[t],t,e)}_createAttributes(e,t){let n={};t.featureIds!=null&&(n[this._getObjectIdField()]=t.featureIds[e]);let r=t.attributeInfo?.attributeData;if(r!=null)for(let t of Object.keys(r))n[t]=H(r[t],e);return n}_createGraphic(e,t){return this._createLayerGraphic(this._createAttributes(e,t))}highlight(e,t){let r=dt(e);if(r.length===0)return ft;let i=wt(t),a=r[0]instanceof n?this._featureIdsFromGraphics(r):typeof r[0]==`number`?r:null;if(!a)return ft;let o=this._ensureHighlights(),{set:s,handle:c}=o.acquireSet(i);return o.setFeatureIds(s,a),c}_featureIdsFromGraphics(e){let t=this.layer.fieldsIndex,n=this._getObjectIdField();return e.map(e=>G(t,e.attributes,n))}_ensureHighlights(){return this._highlights??=new Re({collection:this._collection,forAllFeatures:e=>this._forAllFeatures(e,null,1),forAllFeaturesOfNode:(e,t)=>this._forAllFeaturesOfNode(e,t)}),this._highlights}resetHighlights(){this._highlights=s(this._highlights)}_visibleGeometryChanged(e,t){this._elevationProvider&&(this._visibleGeometryChangedSchedulerHandle??=m(()=>{let{node:t}=e,n=t.visibilityObbInRenderSR??t.geometryObbInRenderSR??t.serviceObbInRenderSR;if(n!=null){let e=A();n.toAaBoundingBox(e),this.emit(`visible-geometry-changed`,new De(e))}else this.emit(`visible-geometry-changed`);this._visibleGeometryChangedSchedulerHandle=null}),this._updateSnappingSources(e,t),this._elevationProvider.notifyObjectChanged(this._collection.getComponentObb(e.objectHandle)))}get performanceInfo(){return new ke(this.usedMemory,this._nodeId2Meta.size,Math.round(this._gpuMemoryEstimate/1048576),Math.round(this._geoMemoryEstimate/1048576),Math.round(this._texMemoryEstimate/1048576),Math.round(this.unloadedMemory/1048576),this._idbCacheEnabled?Math.round(this._idbCache.getHitRate()*100):0)}checkInvariants(){}get test(){}getNodeOpacityByIndex(e){let t=this._nodeId2Meta.get(e);return this.getNodeOpacity(t)}getNodeOpacity(e){return e==null?0:this._collection.getObjectOpacity(e.objectHandle)}isNodeFullyFadedIn(e){return this._crossfadeHelper.isNodeFullyFadedIn(e)}getNodeCrossfadeMetaData(e){return this._nodeId2Meta.get(e)}getNodeComponentHandle(e){return this._nodeId2Meta.get(e)?.objectHandle}markNodeToRemove(e){this._controller&&this._controller.markNodeToRemove(e)}removeMarkedNodes(){this._controller&&this._controller.removeMarkedNodes()}foreachCrossfadeNode(e){this._nodeId2Meta.forEach(e)}fadeNode(e,t,n){if(!this.nodeCrossfadingEnabled)return;let r=this._nodeId2Meta.get(e);r!=null&&this._crossfadeHelper.fadeNode(e,r,t,n)}setNodeOpacityByIndex(e,t){let n=this._nodeId2Meta.get(e);n!=null&&this._setNodeOpacity(n,t)}_setNodeOpacity(e,t){this._collection.updateObjectOpacity(e.objectHandle,t),this._setNodeEdgeOpacity(e,t)}_setNodeEdgeOpacity(e,t){if(this._edgeView==null||!e.cachedEdgeMaterials)return;X(e.cachedEdgeMaterials,t);let n=e.objectHandle;this._edgeView.hasObject(n)&&this._edgeView.updateAllComponentOpacities(n,t).catch(e=>this._logEdgeViewError(e,this.layer.title))}get hasModifications(){return this._isIntegratedMesh&&this._layerClippingArea!=null||this._modifications&&this._modifications.length>0}updateNodeModificationStatus(e){let t=e.length;if(!this.hasModifications||t<=0||this._i3sWasmLoaded!==!0)return;let n=this.uid,r=Bt(e);if(r){let t={context:n,buffer:r.buffer};Me(t);let i=new Float64Array(r.buffer);e.forAll((e,t)=>{let n=i[t],r=Ne(n);e.imModificationImpact=r,r!==0&&this._controller.invalidateGeometryVisibility(e.index)})}}notifyUpdate(){this.notifyChange(`updating`)}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){return!!(this._controller&&this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||this._labeler!=null&&this._labeler.updating||this._crossfadeHelper?.updating||this._i3sWasmLoaded instanceof Promise||this._asyncModuleLoading>0||this._elevationTask!=null&&this._elevationTask.readyToRun||this._needFilterResolve||this._compressionTracker.compressing}trackSnappingSources(e){let t={events:e,fetchEdgeLocations:async(e,t,n)=>{let r=this._nodeId2Meta.get(e);if(r==null)throw Error(`invalid-node`);let{origin:i,buffer:a}=await this._collection.extractEdgeInformation(r.objectHandle,t,n);return this._snappingLocationsApplyElevation(r,a,i),{type:`components`,objectIds:r.featureIds,locations:a,origin:i}},remove:()=>r(this._snappingSourcesTrackers,t)};return this._snappingSourcesTrackers.push(t),this._nodeId2Meta.forEach((t,n)=>{if(t==null)return;let r=this._controller.getRenderMbs(t.node);r&&e.add(n,r)}),t}_snappingLocationsApplyElevation(e,t,n){if(!e.elevationOffsets||this.elevationInfo.mode===0)return;let r=t.position0,i=t.position1,a=t.componentIndex,o=w(),s=w(),c=(e,t)=>{S(e,e,n),this.view.renderCoordsHelper.worldUpAtPosition(e,s),S(e,e,de(s,s,t)),C(e,e,n)};for(let t=0;t<r.count;t++){let n=e.elevationOffsets[a.get(t)];r.getVec(t,o),c(o,n),r.setVec(t,o),i.getVec(t,o),c(o,n),i.setVec(t,o)}}_updateSnappingSources(e,t){let{index:n}=e.node,r=this._controller.getRenderMbs(e.node);if(r!=null)for(let e of this._snappingSourcesTrackers)(t===1||t===2)&&e.events.remove(n),(t===0||t===2)&&e.events.add(n,r)}_logEdgeViewError(e,t){u(e)||a.getLogger(this).warn(`Error while processing edges. Edges on this layer might not display correctly`,t,e)}_indexedDbSizeCheck(e,t){return t.byteSize>104857600?(a.getLogger(this).warn(`Node is too big to store in IndexedDB cache: ${e.id} (${t.byteSize} bytes)`),!1):t.byteSize>0}get elevationProvider(){return this._elevationProvider}};return e([_()],F.prototype,`extractChanges`,null),e([_()],F.prototype,`_hasLoadedPBRTextures`,void 0),e([_()],F.prototype,`_asyncModuleLoading`,void 0),e([_()],F.prototype,`_visibleGeometryChangedSchedulerHandle`,void 0),e([_()],F.prototype,`view`,void 0),e([_()],F.prototype,`layer`,void 0),e([_()],F.prototype,`_controller`,void 0),e([_()],F.prototype,`_labeler`,void 0),e([_()],F.prototype,`updating`,void 0),e([_()],F.prototype,`suspended`,void 0),e([_()],F.prototype,`contentVisible`,null),e([_({readOnly:!0})],F.prototype,`legendEnabled`,null),e([_(gt)],F.prototype,`updatingProgress`,void 0),e([_()],F.prototype,`updatingProgressValue`,null),e([_()],F.prototype,`hasTexturesOrVertexColors`,null),e([_()],F.prototype,`rendererTextureUsage`,null),e([_()],F.prototype,`elevationOffset`,null),e([_()],F.prototype,`elevationInfo`,null),e([_({type:Boolean})],F.prototype,`slicePlaneEnabled`,void 0),e([_()],F.prototype,`supportedTextureEncodings`,null),e([_({type:[R]})],F.prototype,`_modifications`,void 0),e([_({readOnly:!0})],F.prototype,`clientGeometry`,null),e([_()],F.prototype,`elevationRange`,null),e([_()],F.prototype,`fullExtent`,null),e([_()],F.prototype,`_elevationTask`,void 0),e([_({readOnly:!0})],F.prototype,`_usePBR`,null),F=e([v(`esri.views.3d.layers.I3SMeshView3D`)],F),F},At=A(),jt=M(),Mt=M(),Nt=new J,Pt=new t([0,0,0,0]),Ft=new F(0,0,0,0);function It(e){if(e==null)return!1;let t=e.metallicRoughness;return t&&t.baseColorTextureId>=0||t&&t.metallicRoughnessTextureId>=0||e.normalTextureId>=0||e.emissiveTextureId>=0||e.occlusionTextureId>=0}function Lt(e){return`geometryData`in e}function Rt(e){return e!=null&&g(e.data)}function zt(e,t){let n=1024+e.interleavedVertexData.byteLength+(e.indices?e.indices.byteLength:0)+e.positionData.data.byteLength+e.positionData.indices.byteLength;if(t!=null)for(let e of t)e!=null&&g(e.data)&&(n+=e.data.byteLength);return n}function Bt(e){if(e.length===0)return;let t=e.length*10,n=new Float64Array(t),r=0;return e.forAll(e=>{let t=e.serviceObbInIndexSR;t??(t=Nt,e.serviceMbsInIndexSR?(t.setCenter(e.serviceMbsInIndexSR.center),t.setHalfSizeFromValues(e.serviceMbsInIndexSR.radius,e.serviceMbsInIndexSR.radius,e.serviceMbsInIndexSR.radius)):t.invalidate());let i=t.data;n[r++]=i[0],n[r++]=i[1],n[r++]=i[2],n[r++]=i[3],n[r++]=i[4],n[r++]=i[5],n[r++]=i[6],n[r++]=i[7],n[r++]=i[8],n[r++]=i[9]}),n}class Vt{constructor(e,t,n){this.attributeInfo=e,this.meta=t,this.promise=n,this.allowMemCache=!0}}function X(e,t){e.forEach(e=>e.opacity=t)}class Z{constructor(e,t){this.mode=e,this.offset=t}}const Ht=w(),Ut=A(),Wt=`elevation-change`,Gt=``,Kt=`@null`,qt=`@ECEF`;function Jt(e,t){let n=e.featureIds.slice();for(let r of t)if(r(n,e),n.length===0)break;return n.length===e.featureIds.length?e.featureIds:n}function Yt(e,t,n){let r=[],i=e.filteredIds;if(i!=null&&!t?.size&&!n?.size)e.featureIds.forEach((e,t)=>{i[r.length]===e&&r.push(t)});else if(i!=null){let a=0;e.featureIds.forEach((e,o)=>{if(i[a]===e)++a;else if(!t?.has(e))return;n?.has(e)||r.push(o)})}return r}function Q(e,t,n){if(e&&t)for(let r of t){let t=(e.get(r)??0)+n;t>0?e.set(r,t):e.delete(r)}}function $(e,t=0){let n=new Map;for(let r of e)Q(n,t===0?r?.featureIds:t===1?r?.filteredIds:r?.weaklyRemovedIds,1);return n}const Xt=w();export{kt as I3SMeshView3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import has from"../../../core/has.js";import{initial as t}from"../../../core/reactiveUtils.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import{isInEffectiveScaleRange as i}from"../../../geometry/support/scaleUtils.js";import{I3SMeshView3D as a}from"./I3SMeshView3D.js";import{LayerView3D as o}from"./LayerView3D.js";import{ElevationRange as s}from"../support/ElevationRange.js";import{updatingProgress as c}from"../support/updatingProperties.js";import{getGroundTransparencyModeFromOpacity as l}from"../terrain/TransparencyMode.js";import u from"../../layers/LayerView.js";let d=class extends a(o(u)){constructor(){super(...arguments),this.type=`integrated-mesh-3d`,this.visibleElevationRange=new s(1/0,-1/0),this._supportsLabeling=!1,this._applySSAO=!has(`disable-feature:im-ssao`)}get usedAsGround(){return this.layer.isUsedAsGroundLayer}get replacesTerrain(){return this.layer.replacesTerrain}get updatingProgressValue(){return this._controller?.updatingProgress??0}get lodFactor(){return this.view?.qualitySettings?.sceneService?.meshLoDFactor??1}get progressiveLoadFactor(){return this.lodFactor>=1?.2:1}get visibleAtCurrentScale(){return i(this.layer.effectiveScaleRange,this.view.scale)}get fullOpacity(){return has(`enable-feature:im-as-ground`)?this.usedAsGround?this.view.map.ground.opacity:this.layer.opacity:1}get opaque(){return this._groundTransparencyMode===0}get invisible(){return this._groundTransparencyMode===3}get _groundTransparencyMode(){return!has(`enable-feature:im-as-ground`)||!this.usedAsGround?0:l(this.fullOpacity,this.view.overlayManager.renderer.isEmpty)}get layerPopupEnabledAndHasTemplate(){return!1}get _elevationContext(){return has(`enable-feature:im-as-ground`)?this.layer.isUsedAsGroundLayer?1:2:1}get drapeTargetType(){return has(`enable-feature:im-as-ground`)?+!this.usedAsGround:1}initialize(){this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),t),this._updatingHandles.add(()=>this.layer.isUsedAsGroundLayer,()=>this._groundUsageChanged()),this.view.overlayManager.registerDrapeTarget(this)}_groundUsageChanged(){this._refreshGroundUsage(),this.view.overlayManager.unregisterDrapeTarget(this),this.view.overlayManager.registerDrapeTarget(this)}destroy(){this.view.overlayManager.unregisterDrapeTarget(this)}get ready(){return this.layer.loaded}_createLayerGraphic(){}canResume(){return super.canResume()&&(!this._controller||this._controller.rootNodeVisible)}_loadModifications(){if(this.removeHandles(`modifications`),this.layer.modifications==null){this._modifications=[];return}let e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>this._modifications=e.toArray(),t),`modifications`)}};e([n()],d.prototype,`layer`,void 0),e([n(c)],d.prototype,`updatingProgress`,void 0),e([n()],d.prototype,`updatingProgressValue`,null),e([n()],d.prototype,`lodFactor`,null),e([n({readOnly:!0})],d.prototype,`progressiveLoadFactor`,null),e([n({readOnly:!0})],d.prototype,`visibleAtCurrentScale`,null),e([n({readOnly:!0})],d.prototype,`visibleElevationRange`,void 0),e([n()],d.prototype,`fullOpacity`,null),e([n()],d.prototype,`opaque`,null),e([n()],d.prototype,`invisible`,null),d=e([r(`esri.views.3d.layers.IntegratedMeshLayerView3D`)],d);const f=d;export{f as default};
2
+ import{__decorate as e}from"tslib";import has from"../../../core/has.js";import{initial as t}from"../../../core/reactiveUtils.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import{isInEffectiveScaleRange as i}from"../../../geometry/support/scaleUtils.js";import{I3SMeshView3D as a}from"./I3SMeshView3D.js";import{LayerView3D as o}from"./LayerView3D.js";import{ElevationRange as s}from"../support/ElevationRange.js";import{updatingProgress as c}from"../support/updatingProperties.js";import{getGroundTransparencyModeFromOpacity as l}from"../terrain/TransparencyMode.js";import u from"../../layers/LayerView.js";import{alphaCutoff as d}from"../../../webscene/support/AlphaCutoff.js";let f=class extends a(o(u)){constructor(){super(...arguments),this.type=`integrated-mesh-3d`,this.visibleElevationRange=new s(1/0,-1/0),this._supportsLabeling=!1,this._applySSAO=!has(`disable-feature:im-ssao`)}get usedAsGround(){return this.layer.isUsedAsGroundLayer}get replacesTerrain(){return this.layer.replacesTerrain}get updatingProgressValue(){return this._controller?.updatingProgress??0}get lodFactor(){return this.view?.qualitySettings?.sceneService?.meshLoDFactor??1}get progressiveLoadFactor(){return this.lodFactor>=1?.2:1}get visibleAtCurrentScale(){return i(this.layer.effectiveScaleRange,this.view.scale)}get fullOpacity(){if(has(`enable-feature:im-as-ground`)){let e=this.usedAsGround?this.view.map.ground.opacity:this.layer.opacity;return e===0&&!this.view.overlayManager.renderer.isEmpty?d:e}return 1}get opaque(){return this._groundTransparencyMode===0}get invisible(){return this._groundTransparencyMode===3}get _groundTransparencyMode(){if(!has(`enable-feature:im-as-ground`))return 0;let e=this.usedAsGround?this.view.map.ground.opacity:this.layer.opacity;return l(e,this.view.overlayManager.renderer.isEmpty)}get layerPopupEnabledAndHasTemplate(){return!1}get _elevationContext(){return has(`enable-feature:im-as-ground`)?this.layer.isUsedAsGroundLayer?1:2:1}get drapeTargetType(){return has(`enable-feature:im-as-ground`)?+!this.usedAsGround:1}initialize(){this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),t),this._updatingHandles.add(()=>this.layer.isUsedAsGroundLayer,()=>this._groundUsageChanged()),this.view.overlayManager.registerDrapeTarget(this)}_groundUsageChanged(){this._refreshGroundUsage(),this.view.overlayManager.unregisterDrapeTarget(this),this.view.overlayManager.registerDrapeTarget(this)}destroy(){this.view.overlayManager.unregisterDrapeTarget(this)}get ready(){return this.layer.loaded}_createLayerGraphic(){}canResume(){return super.canResume()&&(!this._controller||this._controller.rootNodeVisible)}_loadModifications(){if(this.removeHandles(`modifications`),this.layer.modifications==null){this._modifications=[];return}let e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>this._modifications=e.toArray(),t),`modifications`)}};e([n()],f.prototype,`layer`,void 0),e([n(c)],f.prototype,`updatingProgress`,void 0),e([n()],f.prototype,`updatingProgressValue`,null),e([n()],f.prototype,`lodFactor`,null),e([n({readOnly:!0})],f.prototype,`progressiveLoadFactor`,null),e([n({readOnly:!0})],f.prototype,`visibleAtCurrentScale`,null),e([n({readOnly:!0})],f.prototype,`visibleElevationRange`,void 0),e([n()],f.prototype,`fullOpacity`,null),e([n()],f.prototype,`opaque`,null),e([n()],f.prototype,`invisible`,null),f=e([r(`esri.views.3d.layers.IntegratedMeshLayerView3D`)],f);const p=f;export{p as default};