@arcgis/core 5.0.0-next.7 → 5.0.0-next.9

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 (365) hide show
  1. package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{8f56f298e7c1a283f407.js → 0030d68d9edf42b4af57.js} +1 -1
  4. package/assets/esri/core/workers/chunks/01d460398f3ba6767a37.js +1 -0
  5. package/assets/esri/core/workers/chunks/02e7359162cf974b41b6.js +1 -0
  6. package/assets/esri/core/workers/chunks/{17d5f8dba6ebb1184506.js → 042cd64e1f4eb326c30f.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{66db5f77e09d25e33951.js → 063905fbf9a0c6586949.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{9486032af3e934d85582.js → 0a5d74414dd02a2fb8e1.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{3815ffa13e7b439bca6e.js → 0d5212f59e9b62c16164.js} +1 -1
  10. package/assets/esri/core/workers/chunks/0f735b0dec173142f3b6.js +2 -0
  11. package/assets/esri/core/workers/chunks/{a8f998b8ec8c56150479.js.LICENSE.txt → 0f735b0dec173142f3b6.js.LICENSE.txt} +1 -1
  12. package/assets/esri/core/workers/chunks/{73487b9d85e726e9c012.js → 1257c37bf04d39c27b62.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{398f356b11fd33bd3831.js → 136a7d781dad05a7463b.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{1e4e7aedf4b779241a02.js → 15c7c10ff9ac63f0e792.js} +1 -1
  15. package/assets/esri/core/workers/chunks/17784cf16fa91504b9ea.js +1 -0
  16. package/assets/esri/core/workers/chunks/{a395373e3173e6458a56.js → 1ab37e13947d0e2e4181.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{f03635ddf56e2ef90e4c.js → 1d06fcae4c2f02fb1c95.js} +1 -1
  18. package/assets/esri/core/workers/chunks/1dfca37f95f2b968aa54.js +1 -0
  19. package/assets/esri/core/workers/chunks/{5bd36dbf46c25bd961c8.js → 21293b0c6405a10ec7b6.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{285762ff92d5388b6024.js → 2166238a7ad63a2d43c7.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{620a94b54be3ed78350d.js → 22ca80f491e070b2a5e7.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{88074189fa10c335370b.js → 24cd7b84cd0f3de4bff2.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{ccc0da0e01f023c8aa1f.js → 28d1f2cf6aae547615c3.js} +1 -1
  24. package/assets/esri/core/workers/chunks/292daac70bb828e4923f.js +1 -0
  25. package/assets/esri/core/workers/chunks/{7e43c105f1cfc44b7bd0.js → 2fa01bd3f3608616fd7f.js} +1 -1
  26. package/assets/esri/core/workers/chunks/30e220f4f843681a4cdd.js +1 -0
  27. package/assets/esri/core/workers/chunks/{5d3661d1fe46dd29aae9.js → 311b564e44ae637c960d.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{f4d0ae6be1b3984228d0.js → 31b6406960261da21dd4.js} +1 -1
  29. package/assets/esri/core/workers/chunks/31c7ce65e16f7858400f.js +1 -0
  30. package/assets/esri/core/workers/chunks/31dbe07047dc61303d7d.js +1 -0
  31. package/assets/esri/core/workers/chunks/{8a314b3790313e6dc5db.js → 333b62dad3811cff0f14.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{c8733cd621105afab2ac.js → 35c9b24e4430bd6c2b6b.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{e31192ae920e3e19b6aa.js → 37c1f155da14de91565a.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{c55c096669677321a227.js → 38cd3648932bf2534b0f.js} +1 -1
  35. package/assets/esri/core/workers/chunks/3a457e718a901a45902e.js.LICENSE.txt +1 -1
  36. package/assets/esri/core/workers/chunks/{f5e47eea8720ba84665b.js → 3c07aa2015ab1dff5f7b.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{e9311386f58f3cb95c22.js → 42a1e71d09e8583a7327.js} +1 -1
  38. package/assets/esri/core/workers/chunks/443dfe7029ec208f670c.js +1 -0
  39. package/assets/esri/core/workers/chunks/{b75930d60449eceb0f1c.js → 4baf6f6e7ddedb25f806.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{bb5484b5eeacc9ad2ceb.js → 4d0cbf9584446f411a37.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{17103e6542aae53c7301.js → 4e3e27673d0671fc2b58.js} +1 -1
  42. package/assets/esri/core/workers/chunks/4fb5f1c671892001a4fd.js +1 -0
  43. package/assets/esri/core/workers/chunks/{5fc7b61f467f1d60a284.js → 51ab2acac4ecc1ca9c34.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{fc4417d1260b717a9385.js → 52282f767bd0e99ddca0.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{dedc4583b5f32a278124.js → 5350d50b47b6a4e0e169.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{fc06014fb484fc8c697e.js → 53654edd766d9b4ef750.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{90f8b4bda28af43ea019.js → 538f509d7fc8337d37ac.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{ed8a85efbd90241512bb.js → 588533c3abe876f20f62.js} +1 -1
  49. package/assets/esri/core/workers/chunks/58e59ead33368ce38c8f.js +1 -0
  50. package/assets/esri/core/workers/chunks/5db37547963857295273.js +1 -0
  51. package/assets/esri/core/workers/chunks/{72846fb9c87c6642daf0.js → 5e2ce34def5e053913b2.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{8c056eac35d05d9524b7.js → 5f29422a051311ef9b3c.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{ac26e3e77df4302f47a2.js → 604777417722d4effe06.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{ff35a077ac6776469805.js → 61d970ed75c2c358b1e9.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{7a6a96edc892d7060b7d.js → 629127877042ad784ad2.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{90b2b43b8b54c9a1ec35.js → 664ae441617afe4b17ec.js} +1 -1
  57. package/assets/esri/core/workers/chunks/67f03d042455cd0f7009.js +1 -0
  58. package/assets/esri/core/workers/chunks/{4c5a7249a311070d8f43.js → 6af18d7a0d314d7c1756.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{f35aaa04cca676c2d3f8.js → 6b59f94040c7d2f6728a.js} +1 -1
  60. package/assets/esri/core/workers/chunks/6d9f2b113d6bde936a04.js +1 -0
  61. package/assets/esri/core/workers/chunks/{5132ca68e8c7af111a47.js → 6e22b02a9715c10578d0.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{f0e0a63962784acb4ba1.js → 6f0aec7428021e440ac9.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{deb2854bb7d082a26f52.js → 7005d956c990a04ee8b2.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{a3991ae8caa713d4ddcd.js → 731f7b552dde0fb325cd.js} +1 -1
  65. package/assets/esri/core/workers/chunks/7565b382f6b3d2cb46a3.js +2 -0
  66. package/assets/esri/core/workers/chunks/{b96eb0ea506379182d62.js.LICENSE.txt → 7565b382f6b3d2cb46a3.js.LICENSE.txt} +1 -1
  67. package/assets/esri/core/workers/chunks/{464d42bebb365287808d.js → 773f2c6c9d38db76dfed.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{3f3d492f1093b7832aab.js → 7803495f8862d9025bcd.js} +1 -1
  69. package/assets/esri/core/workers/chunks/7d641f2f5edd95b9bc18.js +1 -0
  70. package/assets/esri/core/workers/chunks/7e4c14d4502e3f06d94b.js +1 -0
  71. package/assets/esri/core/workers/chunks/812f2ccc01f44e3cfd41.js +1 -0
  72. package/assets/esri/core/workers/chunks/826fa0dfb63df77bfd95.js +1 -0
  73. package/assets/esri/core/workers/chunks/{7544316a75dbd981aea6.js → 86cb097deec50b0da3f3.js} +1 -1
  74. package/assets/esri/core/workers/chunks/87921f3fa9001f5801ed.js +1 -0
  75. package/assets/esri/core/workers/chunks/{95c594a87b732f5c4979.js → 89b748e064ca90b4f76a.js} +1 -1
  76. package/assets/esri/core/workers/chunks/8a40ed2ee4b032822c30.js +1 -0
  77. package/assets/esri/core/workers/chunks/{09de8be660174a229efb.js → 8cbb28476151a37ae958.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{fe77ae6cf232a7a3298e.js → 8d9d3797c6d62fdfff9d.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{62a49cfd9a2508950e9f.js → 8fedfd33c37172dba6bf.js} +1 -1
  80. package/assets/esri/core/workers/chunks/91aa1157da32f650983b.js +1 -0
  81. package/assets/esri/core/workers/chunks/{e7638b9ab6674bc8a18f.js → 91dfd29e2dba200eab09.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{794748fd1edc29a621cd.js → 9698f36c143953a975d4.js} +1 -1
  83. package/assets/esri/core/workers/chunks/98584902c9db6faa3e4d.js +1 -0
  84. package/assets/esri/core/workers/chunks/9e5e05d6430712b0b1bc.js +1 -0
  85. package/assets/esri/core/workers/chunks/{e5a06ce0ef6a9a90e100.js → 9f21436016ff7a899e79.js} +1 -1
  86. package/assets/esri/core/workers/chunks/{67d9cfe02613cb73ee37.js → 9ff8ee6ed6b98c03ae7e.js} +2 -2
  87. package/assets/esri/core/workers/chunks/{67d9cfe02613cb73ee37.js.LICENSE.txt → 9ff8ee6ed6b98c03ae7e.js.LICENSE.txt} +1 -1
  88. package/assets/esri/core/workers/chunks/a6ee40dfc471d6612f3c.js +1 -0
  89. package/assets/esri/core/workers/chunks/aa78b69219d9a0ef1c54.js.LICENSE.txt +1 -1
  90. package/assets/esri/core/workers/chunks/{a4db5c9a90107e097df8.js → af47272aaaef0ea57e71.js} +1 -1
  91. package/assets/esri/core/workers/chunks/b05208d56a724a8f1661.js +1 -0
  92. package/assets/esri/core/workers/chunks/{79968c183135281d2a6f.js → b3613a38178cad2ebc82.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{22d6b8102e75bdef204c.js → b7eb486354994dc70855.js} +1 -1
  94. package/assets/esri/core/workers/chunks/bc19a232076d98825eef.js +1 -0
  95. package/assets/esri/core/workers/chunks/c29486c4eeb3e72effff.js +1 -0
  96. package/assets/esri/core/workers/chunks/{2b94623cabc6ae0f86ce.js → c37f7756d48ff9af2656.js} +1 -1
  97. package/assets/esri/core/workers/chunks/{1c52999a6392370844a6.js → c4090a60d149a5962179.js} +1 -1
  98. package/assets/esri/core/workers/chunks/c715fd32f814a0f14f40.js +1 -0
  99. package/assets/esri/core/workers/chunks/{73c1d43070b4fe1e5c1e.js → c8e686efe344a33a0258.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{6bb5158de43c4b59107f.js → c9b16fd41cd59d452522.js} +1 -1
  101. package/assets/esri/core/workers/chunks/ce16489cf7eb0d78c741.js.LICENSE.txt +1 -1
  102. package/assets/esri/core/workers/chunks/cf971e7b1b98d9c502d3.js +1 -0
  103. package/assets/esri/core/workers/chunks/{279366e6b743f9680603.js → cfff044859e6e6dcc75d.js} +1 -1
  104. package/assets/esri/core/workers/chunks/d07f911d40bf05fc0306.js +1 -0
  105. package/assets/esri/core/workers/chunks/{8833c3d168951be4bf20.js → d0d79dd3e88eecf5c314.js} +1 -1
  106. package/assets/esri/core/workers/chunks/d1ca7c3a32ce00ed8b81.js +1 -0
  107. package/assets/esri/core/workers/chunks/{76ae1702fecc7ad7017c.js → d1e97cce5047f1791e22.js} +1 -1
  108. package/assets/esri/core/workers/chunks/{17acde0245ecd956306c.js → d233cc33497a663450f9.js} +1 -1
  109. package/assets/esri/core/workers/chunks/{b017bac40dc8328013e3.js → d391bfbaf0e790cd10d6.js} +2 -2
  110. package/assets/esri/core/workers/chunks/{b017bac40dc8328013e3.js.LICENSE.txt → d391bfbaf0e790cd10d6.js.LICENSE.txt} +1 -1
  111. package/assets/esri/core/workers/chunks/d6e0528eacee7ea4c1ce.js.LICENSE.txt +1 -1
  112. package/assets/esri/core/workers/chunks/{36fe6b8228e622407ec2.js → d8793eead02491136841.js} +1 -1
  113. package/assets/esri/core/workers/chunks/{4d599008e1ea42321b37.js → da24ad57747714ac5eda.js} +1 -1
  114. package/assets/esri/core/workers/chunks/db678a6e352275e507a9.js +1 -0
  115. package/assets/esri/core/workers/chunks/{facb3886714222772ab2.js → ddfd01bb9ba8577c3ffc.js} +1 -1
  116. package/assets/esri/core/workers/chunks/de2ebd9cc3d9e68d435b.js +1 -0
  117. package/assets/esri/core/workers/chunks/{50d9f69d5255af4b29bb.js → df5afa06c6deb6b40109.js} +1 -1
  118. package/assets/esri/core/workers/chunks/e25c4b4a03270d48f408.js +1 -0
  119. package/assets/esri/core/workers/chunks/e3294318daf1192b8319.js +1 -0
  120. package/assets/esri/core/workers/chunks/e599125e746c27de106e.js +1 -0
  121. package/assets/esri/core/workers/chunks/{da573ecc68e6aa8f6da9.js → e767f83f9e2de6650f80.js} +1 -1
  122. package/assets/esri/core/workers/chunks/e9d4cae2144974489d6e.js +1 -0
  123. package/assets/esri/core/workers/chunks/{91df8638b8b904e6d8c5.js → ead8d0cbcebd12dbfad7.js} +1 -1
  124. package/assets/esri/core/workers/chunks/{f9324e88c359c03f35aa.js → eb9c166db0db6fa60e95.js} +1 -1
  125. package/assets/esri/core/workers/chunks/ebcc94234d9d4be1941f.js +316 -0
  126. package/assets/esri/core/workers/chunks/ee5f0fd5384caa11c986.js +1 -0
  127. package/assets/esri/core/workers/chunks/{bc241c7735e4efba734a.js → f34e3fa0c5b28531e289.js} +1 -1
  128. package/assets/esri/core/workers/chunks/f64037a88ab03662dc2a.js +1 -0
  129. package/assets/esri/core/workers/chunks/f651c05604eab83aef5f.js.LICENSE.txt +1 -1
  130. package/assets/esri/core/workers/chunks/{d97fadbc69e055d183a0.js → f77f4bd6a577b92cf66f.js} +1 -1
  131. package/assets/esri/core/workers/chunks/f80f5dbf96c343ac4df6.js +1 -0
  132. package/assets/esri/core/workers/chunks/{16d66770ef841564ee3f.js → f89c90f98c85667b0ebc.js} +1 -1
  133. package/assets/esri/core/workers/chunks/{4c4227b0ea21a5e429ab.js → fb192de7e4fa152342bb.js} +1 -1
  134. package/assets/esri/core/workers/chunks/fbd8d2f61f8a15bcf3db.js +1 -0
  135. package/assets/esri/core/workers/chunks/fccd931f95d81ecc57b2.js +1 -0
  136. package/assets/esri/core/workers/chunks/{2f78861afe0e9037dd8d.js → fe49321dca22dc60d105.js} +1 -1
  137. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  138. package/assets/esri/themes/base/widgets/_NavigationToggle.scss +1 -1
  139. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +4 -4
  140. package/assets/esri/themes/base/widgets/_Widget.scss +1 -1
  141. package/assets/esri/themes/dark/main.css +1 -1
  142. package/assets/esri/themes/light/main.css +1 -1
  143. package/assets/esri/themes/light/view.css +1 -1
  144. package/chunks/MultiPathImpl.js +1 -1
  145. package/chunks/Point2D.js +1 -1
  146. package/chunks/UnitFactory.js +1 -1
  147. package/config.js +1 -1
  148. package/core/QueueProcessor.js +1 -1
  149. package/core/SetUtils.js +1 -1
  150. package/core/has.js +1 -1
  151. package/form/FormTemplate.js +1 -1
  152. package/form/elements/Element.js +1 -1
  153. package/form/elements/FieldElement.js +1 -1
  154. package/form/elements/GroupElement.js +1 -1
  155. package/geometry/operators/gx/operatorOffset.js +1 -1
  156. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  157. package/identity/Credential.js +1 -1
  158. package/identity/IdentityManager.js +1 -1
  159. package/identity/IdentityManagerBase.js +1 -1
  160. package/interfaces.d.ts +92 -50
  161. package/kernel.js +1 -1
  162. package/layers/FeatureLayer.js +1 -1
  163. package/layers/SceneLayer.js +1 -1
  164. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  165. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  166. package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
  167. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  168. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  169. package/layers/knowledgeGraph/layerUtils.js +1 -1
  170. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  171. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  172. package/layers/support/RasterJobHandler.js +1 -1
  173. package/layers/support/RasterWorker.js +1 -1
  174. package/layers/support/fieldConfigUtils.js +1 -1
  175. package/layers/support/rasterDatasets/pixelReader.js +1 -1
  176. package/layers/support/rasterFunctions/pixelTransformUtils.js +5 -0
  177. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  178. package/layers/support/source/DataLayerSource.js +1 -1
  179. package/package.json +4 -4
  180. package/popup/FieldInfo.js +1 -1
  181. package/processRequest.js +5 -0
  182. package/request.js +1 -1
  183. package/requestConfig.js +5 -0
  184. package/requestQueue.js +5 -0
  185. package/rest/query/executeForCount.js +1 -1
  186. package/rest/query/executeForExtent.js +1 -1
  187. package/rest/query/executeForIds.js +1 -1
  188. package/rest/query/executeQueryJSON.js +1 -1
  189. package/rest/query/executeQueryPBF.js +1 -1
  190. package/rest/query/operations/query.js +1 -1
  191. package/rest/support/BaseImageMeasureResultValue.js +5 -0
  192. package/rest/support/ImageAreaResult.js +1 -1
  193. package/rest/support/ImageDistanceResult.js +1 -1
  194. package/rest/support/ImageHeightResult.js +1 -1
  195. package/rest/support/ImageMeasureResultAngleValue.js +5 -0
  196. package/rest/support/ImageMeasureResultAreaValue.js +5 -0
  197. package/rest/support/ImageMeasureResultLengthValue.js +5 -0
  198. package/rest/support/ImageWithType.js +5 -0
  199. package/rest/support/imageMeasureUtils.js +1 -1
  200. package/smartMapping/renderers/size.js +1 -1
  201. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  202. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  203. package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
  204. package/smartMapping/support/adapters/support/utils.js +1 -1
  205. package/support/revision.js +1 -1
  206. package/symbols/support/utils.js +1 -1
  207. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  208. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  209. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  210. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  211. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  212. package/views/2d/layers/features/sources/strategies/AFeatureLoadStrategy.js +1 -1
  213. package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
  214. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
  215. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  216. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  217. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  218. package/views/{3d/support/ImageWithType.js → 2d/layers/features/sources/strategies/constants.js} +1 -1
  219. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  220. package/views/3d/GroundView3D.js +1 -1
  221. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  222. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  223. package/views/3d/analysis/VolumeMeasurement/volumeMeasurementErrors.js +1 -1
  224. package/views/3d/glTF/DefaultLoadingContext.js +1 -1
  225. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  226. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  227. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  228. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  229. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  230. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  231. package/views/3d/layers/graphics/FeatureGraphics3DGraphicsPipeline.js +1 -1
  232. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  233. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  234. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  235. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  236. package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
  237. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  238. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  239. package/views/3d/layers/graphics/pipeline/fetching/Tile3DFetcher.js +1 -1
  240. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  241. package/views/3d/layers/i3s/I3SDataRequester.js +5 -0
  242. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  243. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  244. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  245. package/views/3d/layers/support/FeatureTile.js +1 -1
  246. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  247. package/views/3d/layers/support/MediaLayerInteractionOptions.js +1 -1
  248. package/views/3d/layers/support/MediaLayerInteractionReshapeOptions.js +5 -0
  249. package/views/3d/layers/support/SampledGeometryMaxDistanceRatio.js +5 -0
  250. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  251. package/views/3d/layers/support/fetchTile.js +1 -1
  252. package/views/3d/support/ResourceController.js +1 -1
  253. package/views/3d/support/SharedSymbolResources.js +1 -1
  254. package/views/3d/support/StreamTextureCollection.js +1 -1
  255. package/views/3d/terrain/TerrainSurface.js +1 -1
  256. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  257. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  258. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +6 -0
  259. package/views/SceneView.js +1 -1
  260. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  261. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  262. package/views/draw/MultipointDrawAction.js +1 -1
  263. package/views/draw/PointDrawAction.js +1 -1
  264. package/views/draw/PolygonDrawAction.js +1 -1
  265. package/views/draw/PolylineDrawAction.js +1 -1
  266. package/views/draw/SegmentDrawAction.js +1 -1
  267. package/views/draw/input/CursorUpdateEvents.js +5 -0
  268. package/views/draw/input/DrawCompleteEvent.js +5 -0
  269. package/views/draw/input/VertexAddEvent.js +5 -0
  270. package/views/draw/input/VertexRemoveEvent.js +5 -0
  271. package/views/draw/input/VertexUpdateEvent.js +5 -0
  272. package/views/interactive/editGeometry/CheckpointingEditGeometryOperations.js +5 -0
  273. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  274. package/views/interactive/editGeometry/operations/ReplayableAppendVertex.js +5 -0
  275. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  276. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  277. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  278. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  279. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
  280. package/views/support/PromiseQueue.js +1 -1
  281. package/views/support/Scheduler.js +1 -1
  282. package/webscene/spec-certification/api.js +1 -1
  283. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  284. package/widgets/CoordinateConversion.js +1 -1
  285. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  286. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  287. package/widgets/Editor/EditorViewModel.js +1 -1
  288. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  289. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  290. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  291. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  292. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  293. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  294. package/widgets/Editor/UpdateWorkflow.js +1 -1
  295. package/widgets/Editor/UpdateWorkflowData.js +1 -1
  296. package/widgets/Editor/support/SketchController.js +1 -1
  297. package/widgets/Editor/support/errors.js +5 -0
  298. package/widgets/Editor/workflowUtils.js +1 -1
  299. package/widgets/Editor.js +1 -1
  300. package/widgets/Legend/LegendViewModel.js +1 -1
  301. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  302. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  303. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  304. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  305. package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
  306. package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
  307. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  308. package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
  309. package/widgets/PanoramicViewer/support/PanoramicMeshManager.js +1 -1
  310. package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
  311. package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
  312. package/widgets/PanoramicViewer/support/getVisibleTiles.js +5 -0
  313. package/widgets/Sketch/CreateToolVisibilityMap.js +5 -0
  314. package/widgets/Sketch/SelectionToolVisibilityMap.js +5 -0
  315. package/widgets/Sketch/VisibleElements.js +1 -1
  316. package/widgets/Sketch.js +1 -1
  317. package/assets/esri/core/workers/chunks/020c8913d8e35d63080b.js +0 -1
  318. package/assets/esri/core/workers/chunks/02e69f0c63d97661da60.js +0 -1
  319. package/assets/esri/core/workers/chunks/05eee334d58a0b9f6316.js +0 -1
  320. package/assets/esri/core/workers/chunks/06ba43843e9c4988049b.js +0 -1
  321. package/assets/esri/core/workers/chunks/087973e7c4fea5fcfa5e.js +0 -1
  322. package/assets/esri/core/workers/chunks/326a76a4e80269d4029d.js +0 -1
  323. package/assets/esri/core/workers/chunks/377a66034e7c1bad5599.js +0 -1
  324. package/assets/esri/core/workers/chunks/4442817beb7a76c95770.js +0 -1
  325. package/assets/esri/core/workers/chunks/459a67928bde4a62b6a4.js +0 -1
  326. package/assets/esri/core/workers/chunks/4eebd74ebc20579dade8.js +0 -1
  327. package/assets/esri/core/workers/chunks/53bd8996e8812f1ad7b2.js +0 -1
  328. package/assets/esri/core/workers/chunks/557960763695abee4a83.js +0 -1
  329. package/assets/esri/core/workers/chunks/6201356f7f91e5c06425.js +0 -1
  330. package/assets/esri/core/workers/chunks/6c3b99209d542efa64d4.js +0 -1
  331. package/assets/esri/core/workers/chunks/6f4bd0ee85e7e5a74340.js +0 -1
  332. package/assets/esri/core/workers/chunks/7413e582bc2b16af6a0f.js +0 -1
  333. package/assets/esri/core/workers/chunks/7461124454bfb4fb6474.js +0 -1
  334. package/assets/esri/core/workers/chunks/75bf27271a31e26e1b21.js +0 -1
  335. package/assets/esri/core/workers/chunks/7aaaebbabee27690283c.js +0 -1
  336. package/assets/esri/core/workers/chunks/7c4a63aeead2505d6f02.js +0 -1
  337. package/assets/esri/core/workers/chunks/811d4c46c75cf6a63e78.js +0 -1
  338. package/assets/esri/core/workers/chunks/8ffd4710d168c2fcfd96.js +0 -1
  339. package/assets/esri/core/workers/chunks/90250e9239c173aace88.js +0 -1
  340. package/assets/esri/core/workers/chunks/9786f91455350eaae493.js +0 -1
  341. package/assets/esri/core/workers/chunks/99859dce1925b406ccd0.js +0 -1
  342. package/assets/esri/core/workers/chunks/9c5cbf8810f37b1a4718.js +0 -1
  343. package/assets/esri/core/workers/chunks/9e8dceef4c961f56940d.js +0 -1
  344. package/assets/esri/core/workers/chunks/9fac5a12e878cd745354.js +0 -1
  345. package/assets/esri/core/workers/chunks/a06bac9b8f9e18874de8.js +0 -316
  346. package/assets/esri/core/workers/chunks/a712cdff78fc826acd8c.js +0 -1
  347. package/assets/esri/core/workers/chunks/a8f998b8ec8c56150479.js +0 -2
  348. package/assets/esri/core/workers/chunks/aa54b6f2aba6952af149.js +0 -1
  349. package/assets/esri/core/workers/chunks/b96eb0ea506379182d62.js +0 -2
  350. package/assets/esri/core/workers/chunks/c476643002387f60ea42.js +0 -1
  351. package/assets/esri/core/workers/chunks/c4e4da69969499a89a2c.js +0 -1
  352. package/assets/esri/core/workers/chunks/cd1930f08e1fc8b30b14.js +0 -1
  353. package/assets/esri/core/workers/chunks/d1fe816b6990918c13c7.js +0 -1
  354. package/assets/esri/core/workers/chunks/d305a21666b1ed5bf33d.js +0 -1
  355. package/assets/esri/core/workers/chunks/d40f57f9fc47f9a9f97c.js +0 -1
  356. package/assets/esri/core/workers/chunks/e0bbfbe1ed39c82f1bd4.js +0 -1
  357. package/assets/esri/core/workers/chunks/e82f5437bd66779c6740.js +0 -1
  358. package/assets/esri/core/workers/chunks/f6c8beb60f6d29945a2e.js +0 -1
  359. package/assets/esri/core/workers/chunks/f746e3f7ebff2bbdf333.js +0 -1
  360. package/assets/esri/core/workers/chunks/fd2efd1d1cf9d95a87e6.js +0 -1
  361. package/views/3d/layers/i3s/I3SStreamDataController.js +0 -5
  362. package/views/3d/support/StreamDataLoader.js +0 -5
  363. package/views/3d/support/StreamDataRequester.js +0 -5
  364. package/views/3d/support/downloadSlots.js +0 -5
  365. package/views/draw/input/DrawEvents.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{EventedMixin as r}from"../../core/Evented.js";import{when as t}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import a from"../GroundView.js";let s=class extends(r(a)){constructor(e){super(e)}initialize(){super.initialize(),this.addHandles(t(()=>this._terrainSurface,e=>e.on("elevation-change",e=>this._elevationChange(e)))),this.addHandles(t(()=>this._integratedMeshGroundLayerView,e=>{this.removeHandles(o),e&&this.addHandles(e.elevationProvider.on("elevation-change",e=>this._elevationChange(e)),o)}))}_elevationChange(e){this.emit("elevation-change",e)}get _integratedMeshGroundLayerView(){const e=this.ground?.integratedMeshGround;if(e)return this.view.basemapView?.groundLayerViews.find(r=>r.layer===e)}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return this._terrainSurface?.enabled??!1}get _usingIntegratedMesh(){return this._integratedMeshGroundLayerView?.visible??!1}get spatialReference(){return this._terrainSurface?.spatialReference}intersect(e,r,t,n){this._usingTerrain&&this._terrainSurface?.intersect(e,r,t,n),this._allIntegratedMeshLayerViews.forEach(i=>i.intersect(e,r,t,n))}get _allIntegratedMeshLayerViews(){return this.view.allLayerViews.filter(u)}get updating(){return!this.suspended&&((this._source?.updating??!1)||this.layerViews.some(({updating:e})=>e))}get elevationQueryCache(){return this._usingTerrain?this._terrainSurface?.elevationQueryCache:null}get extentAABR(){return this._terrainSurface?.extent}get suspended(){return this._source?.suspended??!1}get ready(){return this._source?.ready??!0}updateOverlayParameters(){this._terrainSurface?.updateOverlayParameters()}get _source(){return this._usingTerrain?this._terrainSurface:this._usingIntegratedMesh?this._integratedMeshGroundLayerView:null}requestRender(e){this.view.stage.renderView?.requestRender(e)}};e([n({readOnly:!0})],s.prototype,"_integratedMeshGroundLayerView",null),e([n({readOnly:!0})],s.prototype,"_terrainSurface",null),e([n({readOnly:!0})],s.prototype,"_usingTerrain",null),e([n({readOnly:!0})],s.prototype,"_usingIntegratedMesh",null),e([n({readOnly:!0})],s.prototype,"spatialReference",null),e([n()],s.prototype,"_allIntegratedMeshLayerViews",null),e([n({type:Boolean,readOnly:!0})],s.prototype,"updating",null),e([n({readOnly:!0})],s.prototype,"elevationQueryCache",null),e([n({readOnly:!0})],s.prototype,"extentAABR",null),e([n({readOnly:!0})],s.prototype,"suspended",null),e([n({readOnly:!0})],s.prototype,"ready",null),s=e([i("esri.views.3d.GroundView3D")],s);const o=Symbol("integratedMeshHandleKey");function u(e){return"integrated-mesh-3d"===e.type||"integrated-mesh-3dtiles"===e.type}export{s as GroundView3D,u as isIntegratedMeshLayerView};
5
+ import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../core/Evented.js";import{when as r}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import i from"../GroundView.js";let s=class extends(t(i)){constructor(e){super(e),this._allIntegratedMeshLayerViewElevationUpdateHandles=new Map}initialize(){super.initialize(),this.addHandles(r(()=>this._terrainSurface,e=>e.on("elevation-change",e=>this._elevationChange(e))));const e=this._allIntegratedMeshLayerViewElevationUpdateHandles;this.addHandles(this.view.allLayerViews.on("change",t=>{t.added.forEach(t=>{if(!o(t))return;const r=t.elevationProvider.on("elevation-change",e=>this._elevationChange(e));e.set(t,r)}),t.removed.forEach(t=>{o(t)&&(e.get(t)?.remove(),e.delete(t))})}))}destroy(){this._allIntegratedMeshLayerViewElevationUpdateHandles.forEach(e=>e.remove()),this._allIntegratedMeshLayerViewElevationUpdateHandles.clear()}_elevationChange(e){this.emit("elevation-change",e)}get _integratedMeshGroundLayerView(){const e=this.ground?.integratedMeshGround;if(e)return this.view.basemapView?.groundLayerViews.find(t=>t.layer===e)}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return this._terrainSurface?.enabled??!1}get _usingIntegratedMesh(){return this._integratedMeshGroundLayerView?.visible??!1}get spatialReference(){return this._terrainSurface?.spatialReference}intersect(e,t,r,a){this._usingTerrain&&this._terrainSurface?.intersect(e,t,r,a);for(const[n,i]of this._allIntegratedMeshLayerViewElevationUpdateHandles)n.intersect(e,t,r,a)}get updating(){return!this.suspended&&((this._source?.updating??!1)||this.layerViews.some(({updating:e})=>e))}get elevationQueryCache(){return this._usingTerrain?this._terrainSurface?.elevationQueryCache:null}get extentAABR(){return this._terrainSurface?.extent}get suspended(){return this._source?.suspended??!1}get ready(){return this._source?.ready??!0}updateOverlayParameters(){this._terrainSurface?.updateOverlayParameters()}get _source(){return this._usingTerrain?this._terrainSurface:this._usingIntegratedMesh?this._integratedMeshGroundLayerView:null}requestRender(e){this.view.stage.renderView?.requestRender(e)}};function o(e){return"integrated-mesh-3d"===e.type||"integrated-mesh-3dtiles"===e.type}e([a({readOnly:!0})],s.prototype,"_integratedMeshGroundLayerView",null),e([a({readOnly:!0})],s.prototype,"_terrainSurface",null),e([a({readOnly:!0})],s.prototype,"_usingTerrain",null),e([a({readOnly:!0})],s.prototype,"_usingIntegratedMesh",null),e([a({readOnly:!0})],s.prototype,"spatialReference",null),e([a({type:Boolean,readOnly:!0})],s.prototype,"updating",null),e([a({readOnly:!0})],s.prototype,"elevationQueryCache",null),e([a({readOnly:!0})],s.prototype,"extentAABR",null),e([a({readOnly:!0})],s.prototype,"suspended",null),e([a({readOnly:!0})],s.prototype,"ready",null),s=e([n("esri.views.3d.GroundView3D")],s);export{s as GroundView3D,o as isIntegratedMeshLayerView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../../Color.js";import i from"../../../../analysis/LengthDimension.js";import a from"../../../../core/Accessor.js";import n from"../../../../core/Handles.js";import{destroyHandle as s,handlesGroup as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{equals as r}from"../../../../core/lang.js";import{mapCollection as p}from"../../../../core/mapCollectionUtils.js";import{releaseMaybe as l,destroyMaybe as u}from"../../../../core/maybe.js";import{memoize as d}from"../../../../core/memoize.js";import{ignoreAbortErrors as c}from"../../../../core/promiseUtils.js";import{watch as m,initial as h,sync as g,syncAndInitial as f,when as _}from"../../../../core/reactiveUtils.js";import{property as M}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as v}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as C}from"../../../../core/support/UpdatingHandles.js";import S from"../../../../geometry/Point.js";import{clonePoint as w}from"../../../../layers/graphics/hydratedFeatures.js";import{reapplyConstraint as b,applyConstraint as P,computeConstraint as O,constraintDependencies as D}from"./lengthDimensionConstraintUtils.js";import{LengthDimensionManipulators as H,LengthDimensionPointManipulator as j,pointManipulatorHandles as T,createOffsetManipulator as x,offsetManipulatorHandles as G,LineOfSightOrientationManipulator as z,headingManipulatorHandles as U,rotationManipulatorHandles as I,createMeasureTypeManipulator as V,measureTypeManipulatorHandles as R,updateOffsetManipulatorTransform as A,updateHeadingManipulatorTransform as E,updateRotationManipulatorTransform as k,updateMeasureTypeManipulatorTransform as L,unfocusedOffsetWidth as F,focusedOffsetWidth as q}from"./lengthDimensionManipulatorUtils.js";import{isValidComputation as B,arePointsVerticallyAligned as N,computationToGeometryDependencies as J,computeGeometryFromDimension as K}from"./lengthDimensionUtils.js";import{disabledPointColor as Q,pointRadius as W,getTransparentAccentColor as X,getContrastColor as Y,initialOffsetPx as Z}from"./settings.js";import{getRotateHeadingTexture as $}from"../images/Factory.js";import{SnappingVisualizer3D as tt}from"../../interactive/SnappingVisualizer3D.js";import{LineVisualElement as et}from"../../interactive/visualElements/LineVisualElement.js";import{VerticesVisualElement as it}from"../../interactive/visualElements/VerticesVisualElement.js";import{ImageMaterial as at}from"../../webgl-engine/materials/ImageMaterial.js";import{createStipplePatternSimple as nt}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as st}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createCoordinateHelper as ot}from"../../../interactive/coordinateHelper.js";import{EditGeometry as rt}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as pt}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as lt}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as ut}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as dt}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as ct}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as mt}from"../../../interactive/snapping/snappingUtils.js";let ht=class extends a{constructor(t){super(t),this._stagedDimension=null,this._computationManipulators=new Map,this._computationHandles=new n,this._updatingHandles=new C,this._getSnappingContext=d(t=>new lt({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new pt(new rt("point",ot(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new tt}));const{view:i}=t;this._snappingManagerResult=dt(i),this.addHandles(this._snappingManagerResult),this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(i),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(i),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(i),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:nt(2)}),this._constraintSnappingIndicator=new et({view:i,attached:!0,width:1,renderOccluded:4,stipplePattern:nt(5),isDecoration:!0});const a=e.toUnitRGBA(Q);this._stagedStartIndicator=new it({view:i,attached:!1,elevationInfo:{mode:"absolute-height",offset:0},spatialReference:t.view.renderCoordsHelper.spatialReference,color:a,size:2*W,outlineSize:0,renderOccluded:4,isDecoration:!0})}initialize(){const{view:t}=this;this._snappingOperation=new ct({view:t});const i=X(t.effectiveTheme),a=Y(t.effectiveTheme),n=!t.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._textureHandle=$(t.stage.textures,{accentColor:i,contrastColor:a,preMultiplyAlpha:n}),this._orientationManipulatorMaterial=new at({draped:!1,texture:this._textureHandle.texture,writeDepth:!1,renderOccluded:16,isDecoration:!0});const o=p(()=>this.analysisViewData.computations,({computation:t})=>this._createManipulators(t));this.addHandles([m(()=>({accentColor:X(t.effectiveTheme),contrastColor:Y(t.effectiveTheme)}),({accentColor:i,contrastColor:a})=>{const s=this._textureHandle;this._textureHandle=$(t.stage.textures,{accentColor:i,contrastColor:a,preMultiplyAlpha:n}),this._orientationManipulatorMaterial.setParameters({texture:this._textureHandle.texture}),s?.release();const o=e.toUnitRGBA(i);this._unfocusedOffsetManipulatorMaterial.setParameters({color:o}),this._focusedOffsetManipulatorMaterial.setParameters({color:o}),this._thinOffsetManipulatorMaterial.setParameters({color:o}),this._constraintSnappingIndicator.color=o},h),s(o),m(()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation}),({stagedPoint:t,stagedComputation:e})=>{if(null==e||null==t)return;const i=w(t,new S);this._applyPointUpdate(e,{endPoint:i})},g),m(()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}),(t,e)=>{const{stagedDimension:i,selectedComputation:a,firstGrabbedManipulator:n}=t;if(i===e?.stagedDimension&&n===e?.firstGrabbedManipulator){for(const s of[a,e?.selectedComputation])if(null!=s){const e=this._computationManipulators.get(s);null!=e&&this._updateManipulators(s,e,t)}}else for(const[s,o]of this._computationManipulators)this._updateManipulators(s,o,t)},f),m(()=>this.analysis.style.lineSize,t=>this._updateManipulatorStyle(t),h),m(()=>this.view.state.camera,()=>{null!=this._stagedComputation&&this._updateStagedDimensionOffset(this._stagedComputation)}),m(()=>{const t=this._stagedComputation;if(!t)return null;const e=t.elevationAlignedStartPoint,i=y();return null!=e&&this.view.renderCoordsHelper.toRenderCoords(e,i)?i:null},t=>{null!=t?(this._stagedStartIndicator.vertices=[t],this._stagedStartIndicator.attached=!0):this._stagedStartIndicator.attached=!1})]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),mt(this,()=>{const t=this._activeComputation,e=this._stagedComputation;if(null==t||null!=e){const t=this.view.inputManager.latestPointerInfo?.type??"mouse",e=this._getSnappingContext(t);this._updatingHandles.addPromise(c(this._snappingOperation.snapAgainNearPreviousMapPoint(this._snappingManager,e)))}if(null!=t){const{start:e,end:i}=this._computationManipulators.get(t);if(e.grabbing||i.grabbing){const i=e.grabbing?"start":"end",a=this._computeConstraint(t);b(t,i,{constraint:a,view:this.view})}}})}destroy(){this._textureHandle=l(this._textureHandle),this._snappingOperation=u(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy(),this._orientationManipulatorMaterial.dispose()}get updating(){return this._updatingHandles.updating||this._snappingManager.updating}get firstGrabbedManipulator(){return this.parentTool.firstGrabbedManipulator}get hasGrabbedManipulators(){return this.parentTool.hasGrabbedManipulators}get snappingOptions(){return this._snappingManager.options}get _snappingManager(){return this._snappingManagerResult.snappingManager}get _activeComputation(){if(null!=this._stagedComputation)return this._stagedComputation;const{selectedComputation:t}=this.analysisViewData;return this.hasGrabbedManipulators&&null!=t?t:null}get _stagedComputation(){const t=this._stagedDimension,e=this.analysisViewData.computations.at(-1)?.computation;return null==t||null==e||e.dimension!==t?null:e}get _constraintHandles(){return[_(()=>this.analysisViewData.selectedComputation,t=>{t.previousConstraint=this._computeConstraint(t)},{...f,equals:r}),m(()=>{const t=this._activeComputation;if(null==t)return null;const{measureType:e,orientation:i}=t.dimension;return{measureType:e,orientation:i,computation:t}},(t,e)=>{if(null!=t&&null==e){const{measureType:e,orientation:i,computation:a}=t;switch(a.previousConstraint){case 0:a.preConstraintProperties={measureType:"horizontal",orientation:0};break;case 1:a.preConstraintProperties={measureType:"vertical",orientation:0};break;case 2:a.preConstraintProperties={measureType:"direct",orientation:i};break;default:a.preConstraintProperties={measureType:e,orientation:i}}}null==t&&null!=e&&(e.computation.preConstraintProperties=null)},g)]}get _snappingIndicatorHandles(){const t="snapping-indicator-event-handles";return[m(()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation}),({stagedComputation:e,activeComputation:i})=>{const a=this._constraintSnappingIndicator;if(this.removeHandles(t),null!=i)if(i===e)a.attached=!0;else{const{start:e,end:n}=this._computationManipulators.get(i),s=()=>{a.attached=e.grabbing||n.grabbing};s(),this.addHandles([e.events.on("grab-changed",s),n.events.on("grab-changed",s)],t)}else a.attached=!1}),m(()=>{const t=this._activeComputation;return null!=t?{geometry:t.geometry,constraint:t.previousConstraint}:{}},({geometry:t,constraint:e})=>{const i=this._constraintSnappingIndicator;null!=t&&null!=e&&2!==e?(i.visible=!0,i.setGeometryFromSegment(t.directSegment)):i.visible=!1})]}removeStaged(){return null!=this._stagedDimension&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(t){const{_stagedDimension:e}=this;if(null==e){const e=this._onUnstagedClick(t);return this.analysis.dimensions.add(e),null}return this._onStagedClick(t),e}onPointerMove({mapPoint:t,pointerType:e}){if("touch"===e)return;const i=this._getSnappingContext(e);this._updatingHandles.addPromise(c(this._snappingOperation.snap({point:t},this._snappingManager,i)))}onManipulatorSelectionChanged(){if(null!=this.analysisViewData.selectedComputation){this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null)}}_onUnstagedClick({mapPoint:t,pointerType:e}){let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._snappingManager.update({point:t,context:i})}const n=new i({startPoint:w(a,new S),endPoint:null,measureType:"horizontal"});return this._stagedDimension=n,this._resetSnappingState(),n}_onStagedClick({mapPoint:t,pointerType:e}){const i=this._stagedComputation;if(null==i)return;let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._snappingManager.update({point:t,context:i})}const n=w(a,new S);this._applyPointUpdate(i,{endPoint:n}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._snappingManager.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(t){const e=this._setupPointManipulator(t,{isStart:!0}),i=this._setupPointManipulator(t,{isStart:!1}),a=this._setupOffsetManipulator(t),n=this._setupHeadingManipulator(t),s=this._setupRotationManipulator(t),r=this._setupMeasureTypeManipulator(t,"direct"),p=this._setupMeasureTypeManipulator(t,"horizontal"),l=this._setupMeasureTypeManipulator(t,"vertical"),u=new H({start:e,end:i,offset:a,heading:n,rotation:s,direct:r,horizontal:p,vertical:l});this._setupComputationToManipulatorsSync(t,u),this._computationManipulators.set(t,u),this.manipulators.addMany(u.values());const d=o(u.values().map(t=>t.events.on("focus-changed",()=>{u.values().some(t=>t.focused)&&this._resetSnappingState()})));return{manipulators:u,remove:()=>{d.remove(),this._computationHandles.remove(t),this._computationManipulators.delete(t);for(const t of u.values())this.manipulators.remove(t)}}}_setupComputationToManipulatorsSync(t,e){this._computationHandles.add([m(()=>t.geometry,()=>this._updateManipulators(t,e),{...f,equals:r})],t)}_setupPointManipulator(t,e){const{view:i}=this,{dimension:a}=t,n=new j(i,{metadata:a}),s=T(n,{isStart:e.isStart,createSnappingPipelineStep:t=>ut({snappingContext:this._getSnappingContext(t),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:a,onUpdate:e=>this._applyPointUpdate(t,e),view:i});return this._computationHandles.add(s,t),n}_setupOffsetManipulator(t){const{view:e}=this,i=x(e,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:t.dimension}),a=G(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupHeadingManipulator(t){const{view:e}=this,i=new z(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=U(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupRotationManipulator(t){const{view:e}=this,i=new z(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=I(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupMeasureTypeManipulator(t,e){const{view:i}=this,a=V(i,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:t.dimension}),n=R(a,{computation:t,manipulatorMeasureType:e,view:i});return this._computationHandles.add(n,t),a}_updateManipulators(t,e,i={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){const{stagedDimension:a,selectedComputation:n,firstGrabbedManipulator:s}=i,{start:o,end:r,offset:p,heading:l,rotation:u}=e,d=n===t,c=B(t),{dimension:m}=t;for(const f of e.values()){const t=c&&null==a&&(null==s||f===s);f===p?(f.available=t,f.selected=d):f.available=t&&d}if(!c)return;null!=this._computeConstraint(t)?e.forEachMeasureTypeManipulator(t=>t.available=!1):e.manipulatorForMeasureType(m.measureType).available=!1;for(const f of[l,u])"direct"===m.measureType&&0!==m.offset||(f.available=!1);N(t)?u.available=!1:l.available=!1;const{geometry:h}=t;o.renderLocation=h.directSegment.startRenderSpace,r.renderLocation=h.directSegment.endRenderSpace;const{renderCoordsHelper:g}=this.view;A(p,h,g),l.available&&E(l,t,g),u.available&&k(u,t,g),e.forEachMeasureTypeManipulator((e,i)=>{e.available&&L(e,t,i,g)})}_updateManipulatorStyle(t){const e=F(t),i=q(t),a={lineSizePt:t,material:this._orientationManipulatorMaterial};for(const{offset:n,heading:s,rotation:o}of this._computationManipulators.values())n.radius=i/2,s.update(a),o.update(a);this._unfocusedOffsetManipulatorMaterial.setParameters({width:e}),this._focusedOffsetManipulatorMaterial.setParameters({width:i})}_applyPointUpdate(t,e){const{view:i}=this,a=J(t);"startPoint"in e&&(a.elevationAlignedStartPoint=e.startPoint),"endPoint"in e&&(a.elevationAlignedEndPoint=e.endPoint);const n=K(a,i.renderCoordsHelper);if(null==n)return;const s=this._computeConstraint({...a,geometry:n});P(t,e,{...a,constraint:s,unconstrainedGeometry:n,view:i}),t===this._stagedComputation&&this._updateStagedDimensionOffset(t)}_updateStagedDimensionOffset(t){if(null==t.geometry)return;t.geometry.directSegment.eval(.5,gt);const{state:e,renderCoordsHelper:i}=this.view,a=e.camera.computeScreenPixelSizeAt(gt);t.dimension.offset=Z*a*i.unitInMeters}_computeConstraint(t){return O(D(t,this._snappingManager.options),this.view)}_createOffsetManipulatorMaterial(t){return new st({width:1,renderOccluded:4,writeDepth:!1,hasPolygonOffset:!0,isDecoration:!0},t.state.isGlobal)}get test(){}};t([M({constructOnly:!0})],ht.prototype,"analysis",void 0),t([M({constructOnly:!0})],ht.prototype,"analysisViewData",void 0),t([M({constructOnly:!0})],ht.prototype,"manipulators",void 0),t([M({constructOnly:!0})],ht.prototype,"parentTool",void 0),t([M({constructOnly:!0,nonNullable:!0})],ht.prototype,"view",void 0),t([M({readOnly:!0})],ht.prototype,"updating",null),t([M()],ht.prototype,"firstGrabbedManipulator",null),t([M()],ht.prototype,"hasGrabbedManipulators",null),t([M()],ht.prototype,"snappingOptions",null),t([M()],ht.prototype,"_stagedDimension",void 0),t([M()],ht.prototype,"_activeComputation",null),t([M()],ht.prototype,"_stagedComputation",null),ht=t([v("esri.views.3d.analysis.Dimension.LengthDimensionSubTool")],ht);const gt=y();export{ht as LengthDimensionSubTool};
5
+ import{__decorate as t}from"tslib";import e from"../../../../Color.js";import i from"../../../../analysis/LengthDimension.js";import a from"../../../../core/Accessor.js";import n from"../../../../core/Handles.js";import{destroyHandle as s,handlesGroup as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{equals as r}from"../../../../core/lang.js";import{mapCollection as p}from"../../../../core/mapCollectionUtils.js";import{releaseMaybe as l,destroyMaybe as u}from"../../../../core/maybe.js";import{memoize as d}from"../../../../core/memoize.js";import{ignoreAbortErrors as c}from"../../../../core/promiseUtils.js";import{watch as m,initial as h,sync as g,syncAndInitial as f,when as _}from"../../../../core/reactiveUtils.js";import{property as M}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as v}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as S}from"../../../../core/support/UpdatingHandles.js";import C from"../../../../geometry/Point.js";import{clonePoint as w}from"../../../../layers/graphics/hydratedFeatures.js";import{reapplyConstraint as b,applyConstraint as P,computeConstraint as O,constraintDependencies as D}from"./lengthDimensionConstraintUtils.js";import{LengthDimensionManipulators as H,LengthDimensionPointManipulator as j,pointManipulatorHandles as T,createOffsetManipulator as x,offsetManipulatorHandles as G,LineOfSightOrientationManipulator as z,headingManipulatorHandles as U,rotationManipulatorHandles as R,createMeasureTypeManipulator as I,measureTypeManipulatorHandles as V,updateOffsetManipulatorTransform as A,updateHeadingManipulatorTransform as E,updateRotationManipulatorTransform as k,updateMeasureTypeManipulatorTransform as L,unfocusedOffsetWidth as F,focusedOffsetWidth as q}from"./lengthDimensionManipulatorUtils.js";import{isValidComputation as B,arePointsVerticallyAligned as N,computationToGeometryDependencies as J,computeGeometryFromDimension as K}from"./lengthDimensionUtils.js";import{disabledPointColor as Q,pointRadius as W,getTransparentAccentColor as X,getContrastColor as Y,initialOffsetPx as Z}from"./settings.js";import{getRotateHeadingTexture as $}from"../images/Factory.js";import{SnappingVisualizer3D as tt}from"../../interactive/SnappingVisualizer3D.js";import{LineVisualElement as et}from"../../interactive/visualElements/LineVisualElement.js";import{VerticesVisualElement as it}from"../../interactive/visualElements/VerticesVisualElement.js";import{ImageMaterial as at}from"../../webgl-engine/materials/ImageMaterial.js";import{createStipplePatternSimple as nt}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as st}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createCoordinateHelper as ot}from"../../../interactive/coordinateHelper.js";import{EditGeometry as rt}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as pt}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as lt}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as ut}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as dt}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as ct}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as mt}from"../../../interactive/snapping/snappingUtils.js";let ht=class extends a{constructor(t){super(t),this._stagedDimension=null,this._snappingManagerResult=null,this._computationManipulators=new Map,this._computationHandles=new n,this._updatingHandles=new S,this._getSnappingContext=d(t=>new lt({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new pt(new rt("point",ot(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new tt}));const{view:i}=t;this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(i),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(i),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(i),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:nt(2)}),this._constraintSnappingIndicator=new et({view:i,attached:!0,width:1,renderOccluded:4,stipplePattern:nt(5),isDecoration:!0});const a=e.toUnitRGBA(Q);this._stagedStartIndicator=new it({view:i,attached:!1,elevationInfo:{mode:"absolute-height",offset:0},spatialReference:t.view.renderCoordsHelper.spatialReference,color:a,size:2*W,outlineSize:0,renderOccluded:4,isDecoration:!0})}initialize(){const{view:t}=this;this._snappingOperation=new ct({view:t});const i=X(t.effectiveTheme),a=Y(t.effectiveTheme),n=!t.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._textureHandle=$(t.stage.textures,{accentColor:i,contrastColor:a,preMultiplyAlpha:n}),this._orientationManipulatorMaterial=new at({draped:!1,texture:this._textureHandle.texture,writeDepth:!1,renderOccluded:16,isDecoration:!0});const o=p(()=>this.analysisViewData.computations,({computation:t})=>this._createManipulators(t));this.addHandles([m(()=>({accentColor:X(t.effectiveTheme),contrastColor:Y(t.effectiveTheme)}),({accentColor:i,contrastColor:a})=>{const s=this._textureHandle;this._textureHandle=$(t.stage.textures,{accentColor:i,contrastColor:a,preMultiplyAlpha:n}),this._orientationManipulatorMaterial.setParameters({texture:this._textureHandle.texture}),s?.release();const o=e.toUnitRGBA(i);this._unfocusedOffsetManipulatorMaterial.setParameters({color:o}),this._focusedOffsetManipulatorMaterial.setParameters({color:o}),this._thinOffsetManipulatorMaterial.setParameters({color:o}),this._constraintSnappingIndicator.color=o},h),s(o),m(()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation}),({stagedPoint:t,stagedComputation:e})=>{if(null==e||null==t)return;const i=w(t,new C);this._applyPointUpdate(e,{endPoint:i})},g),m(()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}),(t,e)=>{const{stagedDimension:i,selectedComputation:a,firstGrabbedManipulator:n}=t;if(i===e?.stagedDimension&&n===e?.firstGrabbedManipulator){for(const s of[a,e?.selectedComputation])if(null!=s){const e=this._computationManipulators.get(s);null!=e&&this._updateManipulators(s,e,t)}}else for(const[s,o]of this._computationManipulators)this._updateManipulators(s,o,t)},f),m(()=>this.analysis.style.lineSize,t=>this._updateManipulatorStyle(t),h),m(()=>this.view.state.camera,()=>{null!=this._stagedComputation&&this._updateStagedDimensionOffset(this._stagedComputation)}),m(()=>{const t=this._stagedComputation;if(!t)return null;const e=t.elevationAlignedStartPoint,i=y();return null!=e&&this.view.renderCoordsHelper.toRenderCoords(e,i)?i:null},t=>{null!=t?(this._stagedStartIndicator.vertices=[t],this._stagedStartIndicator.attached=!0):this._stagedStartIndicator.attached=!1})]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),mt(this,()=>{const t=this._activeComputation,e=this._stagedComputation;if(null==t||null!=e){const t=this.view.inputManager.latestPointerInfo?.type??"mouse",e=this._getSnappingContext(t);this._updatingHandles.addPromise(c(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),e)))}if(null!=t){const{start:e,end:i}=this._computationManipulators.get(t);if(e.grabbing||i.grabbing){const i=e.grabbing?"start":"end",a=this._computeConstraint(t);b(t,i,{constraint:a,view:this.view})}}})}destroy(){this._textureHandle=l(this._textureHandle),this._snappingOperation=u(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy(),this._orientationManipulatorMaterial.dispose()}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}get firstGrabbedManipulator(){return this.parentTool.firstGrabbedManipulator}get hasGrabbedManipulators(){return this.parentTool.hasGrabbedManipulators}get snappingOptions(){return this._snappingManager?.options}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){return this._snappingManagerResult||(this._snappingManagerResult=dt(this.view),this.addHandles(this._snappingManagerResult)),this._snappingManagerResult.snappingManager}get _activeComputation(){if(null!=this._stagedComputation)return this._stagedComputation;const{selectedComputation:t}=this.analysisViewData;return this.hasGrabbedManipulators&&null!=t?t:null}get _stagedComputation(){const t=this._stagedDimension,e=this.analysisViewData.computations.at(-1)?.computation;return null==t||null==e||e.dimension!==t?null:e}get _constraintHandles(){return[_(()=>this.analysisViewData.selectedComputation,t=>{t.previousConstraint=this._computeConstraint(t)},{...f,equals:r}),m(()=>{const t=this._activeComputation;if(null==t)return null;const{measureType:e,orientation:i}=t.dimension;return{measureType:e,orientation:i,computation:t}},(t,e)=>{if(null!=t&&null==e){const{measureType:e,orientation:i,computation:a}=t;switch(a.previousConstraint){case 0:a.preConstraintProperties={measureType:"horizontal",orientation:0};break;case 1:a.preConstraintProperties={measureType:"vertical",orientation:0};break;case 2:a.preConstraintProperties={measureType:"direct",orientation:i};break;default:a.preConstraintProperties={measureType:e,orientation:i}}}null==t&&null!=e&&(e.computation.preConstraintProperties=null)},g)]}get _snappingIndicatorHandles(){const t="snapping-indicator-event-handles";return[m(()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation}),({stagedComputation:e,activeComputation:i})=>{const a=this._constraintSnappingIndicator;if(this.removeHandles(t),null!=i)if(i===e)a.attached=!0;else{const{start:e,end:n}=this._computationManipulators.get(i),s=()=>{a.attached=e.grabbing||n.grabbing};s(),this.addHandles([e.events.on("grab-changed",s),n.events.on("grab-changed",s)],t)}else a.attached=!1}),m(()=>{const t=this._activeComputation;return null!=t?{geometry:t.geometry,constraint:t.previousConstraint}:{}},({geometry:t,constraint:e})=>{const i=this._constraintSnappingIndicator;null!=t&&null!=e&&2!==e?(i.visible=!0,i.setGeometryFromSegment(t.directSegment)):i.visible=!1})]}removeStaged(){return null!=this._stagedDimension&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(t){const{_stagedDimension:e}=this;if(null==e){const e=this._onUnstagedClick(t);return this.analysis.dimensions.add(e),null}return this._onStagedClick(t),e}onPointerMove({mapPoint:t,pointerType:e}){if("touch"===e)return;const i=this._getSnappingContext(e);this._updatingHandles.addPromise(c(this._snappingOperation.snap({point:t},this._ensureSnappingManager(),i)))}onManipulatorSelectionChanged(){if(null!=this.analysisViewData.selectedComputation){this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null)}}_onUnstagedClick({mapPoint:t,pointerType:e}){let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._ensureSnappingManager().update({point:t,context:i})}const n=new i({startPoint:w(a,new C),endPoint:null,measureType:"horizontal"});return this._stagedDimension=n,this._resetSnappingState(),n}_onStagedClick({mapPoint:t,pointerType:e}){const i=this._stagedComputation;if(null==i)return;let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._ensureSnappingManager().update({point:t,context:i})}const n=w(a,new C);this._applyPointUpdate(i,{endPoint:n}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._ensureSnappingManager().doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(t){const e=this._setupPointManipulator(t,{isStart:!0}),i=this._setupPointManipulator(t,{isStart:!1}),a=this._setupOffsetManipulator(t),n=this._setupHeadingManipulator(t),s=this._setupRotationManipulator(t),r=this._setupMeasureTypeManipulator(t,"direct"),p=this._setupMeasureTypeManipulator(t,"horizontal"),l=this._setupMeasureTypeManipulator(t,"vertical"),u=new H({start:e,end:i,offset:a,heading:n,rotation:s,direct:r,horizontal:p,vertical:l});this._setupComputationToManipulatorsSync(t,u),this._computationManipulators.set(t,u),this.manipulators.addMany(u.values());const d=o(u.values().map(t=>t.events.on("focus-changed",()=>{u.values().some(t=>t.focused)&&this._resetSnappingState()})));return{manipulators:u,remove:()=>{d.remove(),this._computationHandles.remove(t),this._computationManipulators.delete(t);for(const t of u.values())this.manipulators.remove(t)}}}_setupComputationToManipulatorsSync(t,e){this._computationHandles.add([m(()=>t.geometry,()=>this._updateManipulators(t,e),{...f,equals:r})],t)}_setupPointManipulator(t,e){const{view:i}=this,{dimension:a}=t,n=new j(i,{metadata:a}),s=T(n,{isStart:e.isStart,createSnappingPipelineStep:t=>ut({snappingContext:this._getSnappingContext(t),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:a,onUpdate:e=>this._applyPointUpdate(t,e),view:i});return this._computationHandles.add(s,t),n}_setupOffsetManipulator(t){const{view:e}=this,i=x(e,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:t.dimension}),a=G(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupHeadingManipulator(t){const{view:e}=this,i=new z(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=U(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupRotationManipulator(t){const{view:e}=this,i=new z(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=R(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupMeasureTypeManipulator(t,e){const{view:i}=this,a=I(i,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:t.dimension}),n=V(a,{computation:t,manipulatorMeasureType:e,view:i});return this._computationHandles.add(n,t),a}_updateManipulators(t,e,i={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){const{stagedDimension:a,selectedComputation:n,firstGrabbedManipulator:s}=i,{start:o,end:r,offset:p,heading:l,rotation:u}=e,d=n===t,c=B(t),{dimension:m}=t;for(const f of e.values()){const t=c&&null==a&&(null==s||f===s);f===p?(f.available=t,f.selected=d):f.available=t&&d}if(!c)return;null!=this._computeConstraint(t)?e.forEachMeasureTypeManipulator(t=>t.available=!1):e.manipulatorForMeasureType(m.measureType).available=!1;for(const f of[l,u])"direct"===m.measureType&&0!==m.offset||(f.available=!1);N(t)?u.available=!1:l.available=!1;const{geometry:h}=t;o.renderLocation=h.directSegment.startRenderSpace,r.renderLocation=h.directSegment.endRenderSpace;const{renderCoordsHelper:g}=this.view;A(p,h,g),l.available&&E(l,t,g),u.available&&k(u,t,g),e.forEachMeasureTypeManipulator((e,i)=>{e.available&&L(e,t,i,g)})}_updateManipulatorStyle(t){const e=F(t),i=q(t),a={lineSizePt:t,material:this._orientationManipulatorMaterial};for(const{offset:n,heading:s,rotation:o}of this._computationManipulators.values())n.radius=i/2,s.update(a),o.update(a);this._unfocusedOffsetManipulatorMaterial.setParameters({width:e}),this._focusedOffsetManipulatorMaterial.setParameters({width:i})}_applyPointUpdate(t,e){const{view:i}=this,a=J(t);"startPoint"in e&&(a.elevationAlignedStartPoint=e.startPoint),"endPoint"in e&&(a.elevationAlignedEndPoint=e.endPoint);const n=K(a,i.renderCoordsHelper);if(null==n)return;const s=this._computeConstraint({...a,geometry:n});P(t,e,{...a,constraint:s,unconstrainedGeometry:n,view:i}),t===this._stagedComputation&&this._updateStagedDimensionOffset(t)}_updateStagedDimensionOffset(t){if(null==t.geometry)return;t.geometry.directSegment.eval(.5,gt);const{state:e,renderCoordsHelper:i}=this.view,a=e.camera.computeScreenPixelSizeAt(gt);t.dimension.offset=Z*a*i.unitInMeters}_computeConstraint(t){return O(D(t,this._ensureSnappingManager().options),this.view)}_createOffsetManipulatorMaterial(t){return new st({width:1,renderOccluded:4,writeDepth:!1,hasPolygonOffset:!0,isDecoration:!0},t.state.isGlobal)}get test(){}};t([M({constructOnly:!0})],ht.prototype,"analysis",void 0),t([M({constructOnly:!0})],ht.prototype,"analysisViewData",void 0),t([M({constructOnly:!0})],ht.prototype,"manipulators",void 0),t([M({constructOnly:!0})],ht.prototype,"parentTool",void 0),t([M({constructOnly:!0,nonNullable:!0})],ht.prototype,"view",void 0),t([M({readOnly:!0})],ht.prototype,"updating",null),t([M()],ht.prototype,"firstGrabbedManipulator",null),t([M()],ht.prototype,"hasGrabbedManipulators",null),t([M()],ht.prototype,"snappingOptions",null),t([M()],ht.prototype,"_stagedDimension",void 0),t([M()],ht.prototype,"_snappingManager",null),t([M()],ht.prototype,"_activeComputation",null),t([M()],ht.prototype,"_stagedComputation",null),t([M()],ht.prototype,"_snappingManagerResult",void 0),ht=t([v("esri.views.3d.analysis.Dimension.LengthDimensionSubTool")],ht);const gt=y();export{ht as LengthDimensionSubTool};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import o from"../../../../core/Logger.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{initial as n,watch as s,when as a,syncAndInitial as l,sync as p}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as u}from"../../../../core/screenUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{e as d}from"../../../../chunks/earcut.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as y,x as g}from"../../../../chunks/vec32.js";import{fromValues as _,create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as v}from"../../../../core/support/UpdatingHandles.js";import{projectOrLoad as j}from"../../../../geometry/projectionUtils.js";import{computeTranslationToOriginAndRotation as w}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as E}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as G,create as x,expand as R,width as b,height as L,fromExtent as V,intersects as T}from"../../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as C}from"../../../../geometry/support/DoubleArray.js";import{t as M}from"../../../../chunks/vec3.js";import H from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as P}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as O}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementProjectionError as U,VolumeMeasurementInvalidGeometryError as D,VolumeMeasurementDistanceTooCloseError as A,VolumeMeasurementDistanceTooFarError as S,VolumeMeasurementPerimeterTooLargeError as F,VolumeMeasurementUnsupportedCoordinateSystemError as I,VolumeMeasurementUnsupportedLayerTransparencyError as k}from"./volumeMeasurementErrors.js";import N from"./VolumeMeasurementResult.js";import{getRawResult as z}from"./volumeMeasurementUtils.js";import{ElevationContext as W}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as B}from"../../support/ElevationProvider.js";import{polygonToRenderInfo as q}from"../../support/renderInfoUtils/polygon.js";import{CutFillDepth as J,TargetGeometry as K}from"../../webgl-engine/lib/CutFillDepth.js";import{euclideanDirectDistance as Q}from"../../../support/euclideanLengthMeasurementUtils.js";let X=class extends r{constructor(e){super(e),this._projectionError=null,this._getElevationProvider=()=>this.view.elevationProvider,this._updatingHandles=new v,this._computationValue=null}initialize(){const e=this.view;this._renderer=new J({view:e}),this._updatingHandles.add(()=>({computation:this._computation,renderGeometry:this._renderGeometry}),({computation:e,renderGeometry:t})=>{e&&t&&(this._renderer.setup(e,t),this._renderer.start())},n),this.addHandles([this._createElevationUpdateHandle(),s(()=>this._targetGeometry,e=>this.analysisViewData.targetGeometry=e,l),s(()=>this._elevationAlignedGeometry,e=>this.analysisViewData.elevationAlignedGeometry=e,l),s(()=>({computation:this._computation,extent:this._projectedGeometry?.extent,localOrigin:this._renderGeometry?.localOrigin}),({computation:e,extent:t,localOrigin:r})=>{e&&t&&r&&(e.extent=t,e.localOrigin=r)},p),a(()=>this._renderer.done,()=>this._updateResult())])}destroy(){this._updatingHandles.destroy(),this._renderer.destroy()}get _projectedGeometry(){if(this._projectionError=null,!this.analysis.valid)return null;const e=this.analysis.geometry,t=j(e,this.view.spatialReference);return t.pending?(this._updatingHandles.addPromise(t.pending),null):(e&&!t.geometry&&(this._projectionError=new U,P(this.analysis,e.spatialReference,o.getLogger(this))),t.geometry)}get _elevationAlignedGeometry(){const e=this._projectedGeometry;if(!e)return null;const t=e.clone();return Y(this._getElevationProvider(),t),t}get _targetGeometry(){const e=this._elevationAlignedGeometry;if(!e)return null;const t=this.analysis.measureType,{effectiveTargetElevation:r}=this.analysisViewData;if("stockpile"===t||null==r)return e;const o=e.clone();return o.rings[0].forEach(e=>e[2]=r),o}get _renderGeometry(){const e=this._targetGeometry;if(!e)return null;const t=this._projectedGeometry?.extent;if(!t)return null;const{elevationProvider:r,renderCoordsHelper:o}=this.view;if(!r||!o)return null;const i=q(e,r,o,W.fromElevationInfo(new H({mode:"absolute-height"}))),{polygons:n}=i,s=n[0],a=d(s.position,s.holeIndices,3),l=C(3*s.count),p=h(),u=h(),m=_(t.center.x,t.center.y,0);return w(t.spatialReference,m,p,o.spatialReference),u[12]=-p[12],u[13]=-p[13],u[14]=-p[14],M(l,s.position,u),new K(m,l,a)}get updating(){return this._renderer.updating||this._updatingHandles.updating}get result(){const e=this._computation?.rawResult;return e?new N({measureType:this.analysis.measureType,rawResult:e,unit:this.analysisViewData.effectiveDisplayUnits.volume}):null}get error(){return this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._invalidGeometryError??this._projectionError??this._perimeterTooLargeError??this._tooNearFarError}get _invalidGeometryError(){return this.analysis.valid?null:new D}get _tooNearFarError(){const e=this._renderGeometry;if(!e)return null;const{view:r}=this,{camera:o}=r.state,{positions:i,localOrigin:n}=e;r.renderCoordsHelper.toRenderCoords(n,r.spatialReference,ie),G(ne);for(let t=0;t<i.length;t+=3)o.projectToScreen(y(oe,i[t]+ie[0],i[t+1]+ie[1],i[t+2]+ie[2]),se),R(ne,se,ne);const s=b(ne),a=L(ne),{maxVolumeExtentSizeVw:l,minVolumeExtentSizePixels:p}=t;return s>o.width/o.pixelRatio*l||a>o.height/o.pixelRatio*l?new A:Math.max(s,a)<p?new S:null}get _perimeterTooLargeError(){return this._perimeterTooLargeLocalError??this._perimeterTooLargeGlobalError}get _perimeterTooLargeLocalError(){const{spatialReference:e,state:{isLocal:r}}=this.view;if(!r||!e.isWebMercator)return null;const o=this._perimeter,{maxPerimeterLocalWebMercator:i}=t;return null!=o&&o>i?new F:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;const e=this._perimeter,{maxPerimeterGlobal:r}=t;return null!=e&&e>r?new F:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new I:null}get _unsupportedLayerTransparencyError(){return(this.view.map?.ground.opacity??1)<1?new k:null}get _perimeter(){const e=this._renderGeometry?.positions,t=e?$(ee(e)):null;return null!=t?t/this.view.renderCoordsHelper.unitInMeters:null}get _enabled(){return!this.error}get _computation(){const e=this._projectedGeometry?.extent;if(!e||!this._enabled)return this._computationValue=i(this._computationValue),null;if(this._computationValue)return this._computationValue;const t=this._renderGeometry?.localOrigin;if(!t)return null;const{renderCoordsHelper:r}=this.view;return this._computationValue=new O({extent:e,localOrigin:t,renderCoordsHelper:r}),this._computationValue}_createElevationUpdateHandle(){const e=e=>{const t=this._projectedGeometry?.extent;"ground"===e.context&&this._enabled&&t&&(E(e.extent,e.spatialReference,te,this.view.spatialReference),V(t,re),T(te,re)&&(this._getElevationProvider=()=>this.view.elevationProvider))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_updateResult(){if(!this._computation)return;const{spatialReference:e,viewingMode:t}=this.view,{extent:r,boundingRect:o,cameraNearFar:{near:i,far:n}}=this._computation,{width:s,height:a}=this._renderer;let l,p;"local"===t&&e.isWebMercator?({width:l,height:p}=Z(r)):(l=b(o),p=L(o));const u=l/s*(p/a),m=this._renderer.getDepth(),c=e=>e*(n-i)+i,d=c(m.cut)*u,h=c(m.fill)*u;this._computation.rawResult=z(Math.abs(d),h)}};function Y(e,t){t.rings[0].forEach(t=>{t[2]=B(e,t,"ground")??0})}function Z(e){const t=Q([e.xmin,e.ymin,0],[e.xmax,e.ymin,0],e.spatialReference),r=Q([e.xmin,e.ymin,0],[e.xmin,e.ymax,0],e.spatialReference);return{width:t?.value??0,height:r?.value??0}}function $(e){if(!e)return null;let t=null,r=null,o=0;for(const i of e)t||(t=[i[0],i[1],i[2]??0]),r?o+=g(r,i):r=[0,0,0],r[0]=i[0],r[1]=i[1],r[2]=i[2];return t&&r&&(o+=g(r,t)),Math.sqrt(o)}function*ee(e){const t=f();for(let r=0;r<e.length;r+=3)t[0]=e[r],t[1]=e[r+1],t[2]=e[r+2],yield t}e([m()],X.prototype,"_projectionError",void 0),e([m()],X.prototype,"_projectedGeometry",null),e([m()],X.prototype,"_getElevationProvider",void 0),e([m()],X.prototype,"_elevationAlignedGeometry",null),e([m()],X.prototype,"_targetGeometry",null),e([m()],X.prototype,"_renderGeometry",null),e([m({constructOnly:!0})],X.prototype,"analysis",void 0),e([m({constructOnly:!0})],X.prototype,"analysisViewData",void 0),e([m({constructOnly:!0})],X.prototype,"view",void 0),e([m()],X.prototype,"updating",null),e([m()],X.prototype,"result",null),e([m()],X.prototype,"error",null),e([m()],X.prototype,"_invalidGeometryError",null),e([m()],X.prototype,"_tooNearFarError",null),e([m()],X.prototype,"_perimeterTooLargeError",null),e([m()],X.prototype,"_perimeterTooLargeLocalError",null),e([m()],X.prototype,"_perimeterTooLargeGlobalError",null),e([m()],X.prototype,"_unsupportedCoordinateSystemError",null),e([m()],X.prototype,"_unsupportedLayerTransparencyError",null),e([m()],X.prototype,"_perimeter",null),e([m()],X.prototype,"_enabled",null),e([m()],X.prototype,"_renderer",void 0),e([m({readOnly:!0})],X.prototype,"_updatingHandles",void 0),e([m()],X.prototype,"_computation",null),X=e([c("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillController")],X);const te=G(),re=G(),oe=f(),ie=f(),ne=x(),se=u();export{X as VolumeMeasurementCutFillController};
5
+ import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import o from"../../../../core/Logger.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{initial as n,watch as s,when as a,syncAndInitial as l,sync as p}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as u}from"../../../../core/screenUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{e as d}from"../../../../chunks/earcut.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as y,x as g}from"../../../../chunks/vec32.js";import{fromValues as _,create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as v}from"../../../../core/support/UpdatingHandles.js";import{projectOrLoad as j}from"../../../../geometry/projectionUtils.js";import{computeTranslationToOriginAndRotation as w}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as E}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as x,create as G,expand as R,width as b,height as L,fromExtent as V,intersects as T}from"../../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as C}from"../../../../geometry/support/DoubleArray.js";import{t as M}from"../../../../chunks/vec3.js";import H from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as P}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as O}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementDistanceTooCloseError as U,VolumeMeasurementDistanceTooFarError as D,VolumeMeasurementPerimeterTooLargeError as A,VolumeMeasurementUnsupportedCoordinateSystemError as S,VolumeMeasurementUnsupportedLayerTransparencyError as F}from"./volumeMeasurementErrors.js";import I from"./VolumeMeasurementResult.js";import{getRawResult as k}from"./volumeMeasurementUtils.js";import{ElevationContext as N}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as z}from"../../support/ElevationProvider.js";import{polygonToRenderInfo as W}from"../../support/renderInfoUtils/polygon.js";import{CutFillDepth as B,TargetGeometry as q}from"../../webgl-engine/lib/CutFillDepth.js";import{euclideanDirectDistance as J}from"../../../support/euclideanLengthMeasurementUtils.js";let K=class extends r{constructor(e){super(e),this._getElevationProvider=()=>this.view.elevationProvider,this._updatingHandles=new v,this._computationValue=null}initialize(){const e=this.view;this._renderer=new B({view:e}),this._updatingHandles.add(()=>({computation:this._computation,renderGeometry:this._renderGeometry}),({computation:e,renderGeometry:t})=>{e&&t&&(this._renderer.setup(e,t),this._renderer.start())},n),this.addHandles([this._createElevationUpdateHandle(),s(()=>this._targetGeometry,e=>this.analysisViewData.targetGeometry=e,l),s(()=>this._elevationAlignedGeometry,e=>this.analysisViewData.elevationAlignedGeometry=e,l),s(()=>({computation:this._computation,extent:this._projectedGeometry?.extent,localOrigin:this._renderGeometry?.localOrigin}),({computation:e,extent:t,localOrigin:r})=>{e&&t&&r&&(e.extent=t,e.localOrigin=r)},p),a(()=>this._renderer.done,()=>this._updateResult())])}destroy(){this._updatingHandles.destroy(),this._renderer.destroy()}get _projectedGeometry(){if(!this.analysis.valid)return null;const e=this.analysis.geometry,t=j(e,this.view.spatialReference);return t.pending?(this._updatingHandles.addPromise(t.pending),null):(e&&!t.geometry&&P(this.analysis,e.spatialReference,o.getLogger(this)),t.geometry)}get _elevationAlignedGeometry(){const e=this._projectedGeometry;if(!e)return null;const t=e.clone();return Q(this._getElevationProvider(),t),t}get _targetGeometry(){const e=this._elevationAlignedGeometry;if(!e)return null;const t=this.analysis.measureType,{effectiveTargetElevation:r}=this.analysisViewData;if("stockpile"===t||null==r)return e;const o=e.clone();return o.rings[0].forEach(e=>e[2]=r),o}get _renderGeometry(){const e=this._targetGeometry;if(!e)return null;const t=this._projectedGeometry?.extent;if(!t)return null;const{elevationProvider:r,renderCoordsHelper:o}=this.view;if(!r||!o)return null;const i=W(e,r,o,N.fromElevationInfo(new H({mode:"absolute-height"}))),{polygons:n}=i,s=n[0],a=d(s.position,s.holeIndices,3),l=C(3*s.count),p=h(),u=h(),m=_(t.center.x,t.center.y,0);return w(t.spatialReference,m,p,o.spatialReference),u[12]=-p[12],u[13]=-p[13],u[14]=-p[14],M(l,s.position,u),new q(m,l,a)}get updating(){return this._renderer.updating||this._updatingHandles.updating}get result(){const e=this._computation?.rawResult;return e?new I({measureType:this.analysis.measureType,rawResult:e,unit:this.analysisViewData.effectiveDisplayUnits.volume}):null}get error(){return this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._perimeterTooLargeError??this._tooNearFarError}get _tooNearFarError(){const e=this._renderGeometry;if(!e)return null;const{view:r}=this,{camera:o}=r.state,{positions:i,localOrigin:n}=e;r.renderCoordsHelper.toRenderCoords(n,r.spatialReference,re),x(oe);for(let t=0;t<i.length;t+=3)o.projectToScreen(y(te,i[t]+re[0],i[t+1]+re[1],i[t+2]+re[2]),ie),R(oe,ie,oe);const s=b(oe),a=L(oe),{maxVolumeExtentSizeVw:l,minVolumeExtentSizePixels:p}=t;return s>o.width/o.pixelRatio*l||a>o.height/o.pixelRatio*l?new U:Math.max(s,a)<p?new D:null}get _perimeterTooLargeError(){return this._perimeterTooLargeLocalError??this._perimeterTooLargeGlobalError}get _perimeterTooLargeLocalError(){const{spatialReference:e,state:{isLocal:r}}=this.view;if(!r||!e.isWebMercator)return null;const o=this._perimeter,{maxPerimeterLocalWebMercator:i}=t;return null!=o&&o>i?new A:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;const e=this._perimeter,{maxPerimeterGlobal:r}=t;return null!=e&&e>r?new A:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new S:null}get _unsupportedLayerTransparencyError(){return(this.view.map?.ground.opacity??1)<1?new F:null}get _perimeter(){const e=this._renderGeometry?.positions,t=e?Y(Z(e)):null;return null!=t?t/this.view.renderCoordsHelper.unitInMeters:null}get _enabled(){return!this.error}get _computation(){const e=this._projectedGeometry?.extent;if(!e||!this._enabled)return this._computationValue=i(this._computationValue),null;if(this._computationValue)return this._computationValue;const t=this._renderGeometry?.localOrigin;if(!t)return null;const{renderCoordsHelper:r}=this.view;return this._computationValue=new O({extent:e,localOrigin:t,renderCoordsHelper:r}),this._computationValue}_createElevationUpdateHandle(){const e=e=>{const t=this._projectedGeometry?.extent;"ground"===e.context&&t&&(E(e.extent,e.spatialReference,$,this.view.spatialReference),V(t,ee),T($,ee)&&(this._getElevationProvider=()=>this.view.elevationProvider))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_updateResult(){if(!this._computation)return;const{spatialReference:e,viewingMode:t}=this.view,{extent:r,boundingRect:o,cameraNearFar:{near:i,far:n}}=this._computation,{width:s,height:a}=this._renderer;let l,p;"local"===t&&e.isWebMercator?({width:l,height:p}=X(r)):(l=b(o),p=L(o));const u=l/s*(p/a),m=this._renderer.getDepth(),c=e=>e*(n-i)+i,d=c(m.cut)*u,h=c(m.fill)*u;this._computation.rawResult=k(Math.abs(d),h)}};function Q(e,t){t.rings[0].forEach(t=>{t[2]=z(e,t,"ground")??0})}function X(e){const t=J([e.xmin,e.ymin,0],[e.xmax,e.ymin,0],e.spatialReference),r=J([e.xmin,e.ymin,0],[e.xmin,e.ymax,0],e.spatialReference);return{width:t?.value??0,height:r?.value??0}}function Y(e){if(!e)return null;let t=null,r=null,o=0;for(const i of e)t||(t=[i[0],i[1],i[2]??0]),r?o+=g(r,i):r=[0,0,0],r[0]=i[0],r[1]=i[1],r[2]=i[2];return t&&r&&(o+=g(r,t)),Math.sqrt(o)}function*Z(e){const t=f();for(let r=0;r<e.length;r+=3)t[0]=e[r],t[1]=e[r+1],t[2]=e[r+2],yield t}e([m()],K.prototype,"_projectedGeometry",null),e([m()],K.prototype,"_getElevationProvider",void 0),e([m()],K.prototype,"_elevationAlignedGeometry",null),e([m()],K.prototype,"_targetGeometry",null),e([m()],K.prototype,"_renderGeometry",null),e([m({constructOnly:!0})],K.prototype,"analysis",void 0),e([m({constructOnly:!0})],K.prototype,"analysisViewData",void 0),e([m({constructOnly:!0})],K.prototype,"view",void 0),e([m()],K.prototype,"updating",null),e([m()],K.prototype,"result",null),e([m()],K.prototype,"error",null),e([m()],K.prototype,"_tooNearFarError",null),e([m()],K.prototype,"_perimeterTooLargeError",null),e([m()],K.prototype,"_perimeterTooLargeLocalError",null),e([m()],K.prototype,"_perimeterTooLargeGlobalError",null),e([m()],K.prototype,"_unsupportedCoordinateSystemError",null),e([m()],K.prototype,"_unsupportedLayerTransparencyError",null),e([m()],K.prototype,"_perimeter",null),e([m()],K.prototype,"_enabled",null),e([m()],K.prototype,"_renderer",void 0),e([m({readOnly:!0})],K.prototype,"_updatingHandles",void 0),e([m()],K.prototype,"_computation",null),K=e([c("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillController")],K);const $=x(),ee=x(),te=f(),re=f(),oe=G(),ie=u();export{K as VolumeMeasurementCutFillController};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"./VolumeMeasurementError.js";class r extends e{constructor(){super("perimeter-too-large","The input geometry's perimeter is too large for the current viewing mode and spatial reference.")}}class t extends e{constructor(){super("distance-too-far","The measurement geometry is too far from the camera.")}}class s extends e{constructor(){super("distance-too-close","The measurement geometry is too close to the camera.")}}class o extends e{constructor(){super("invalid-geometry","The measurement geometry is invalid.")}}class n extends e{constructor(){super("invalid-geometry","The measurement geometry cannot be projected to the view spatial reference.")}}class a extends e{constructor(){super("unsupported-coordinate-system","The coordinate system of the view (viewing mode and spatial reference) is not supported.")}}class c extends e{constructor(){super("unsupported-layer-transparency","The volume measurement analysis does not support transparent layers.")}}export{s as VolumeMeasurementDistanceTooCloseError,t as VolumeMeasurementDistanceTooFarError,o as VolumeMeasurementInvalidGeometryError,r as VolumeMeasurementPerimeterTooLargeError,n as VolumeMeasurementProjectionError,a as VolumeMeasurementUnsupportedCoordinateSystemError,c as VolumeMeasurementUnsupportedLayerTransparencyError};
5
+ import e from"./VolumeMeasurementError.js";class r extends e{constructor(){super("perimeter-too-large","The input geometry's perimeter is too large for the current viewing mode and spatial reference.")}}class t extends e{constructor(){super("distance-too-far","The measurement geometry is too far from the camera.")}}class s extends e{constructor(){super("distance-too-close","The measurement geometry is too close to the camera.")}}class o extends e{constructor(){super("unsupported-coordinate-system","The coordinate system of the view (viewing mode and spatial reference) is not supported.")}}class a extends e{constructor(){super("unsupported-layer-transparency","The volume measurement analysis does not support transparent layers.")}}export{s as VolumeMeasurementDistanceTooCloseError,t as VolumeMeasurementDistanceTooFarError,r as VolumeMeasurementPerimeterTooLargeError,o as VolumeMeasurementUnsupportedCoordinateSystemError,a as VolumeMeasurementUnsupportedLayerTransparencyError};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import r from"../../../request.js";import{result as e}from"../../../core/asyncUtils.js";import t from"../../../core/Error.js";import{throwIfAborted as o,throwIfAbortError as s}from"../../../core/promiseUtils.js";import{isDataProtocol as a,dataToArrayBuffer as i}from"../../../core/urlUtils.js";class l{constructor(r){this._streamDataRequester=r}async loadJSON(r,e){return this._load(0,r,e)}async loadBinary(r,e){return a(r)?(o(e),i(r)):this._load(1,r,e)}async loadImage(r,e){return this._load(2,r,e)}async _load(o,a,i){if(null==this._streamDataRequester)return(await r(a,{responseType:n[o]})).data;const l=await e(this._streamDataRequester.request(a,o,i));if(!0===l.ok)return l.value;throw s(l.error),new t("gltf-loader-request-error",`Request for resource failed: ${l.error}`)}}const n={2:"image",1:"array-buffer",0:"json",3:void 0};export{l as DefaultLoadingContext};
5
+ import r from"../../../request.js";import{result as o}from"../../../core/asyncUtils.js";import e from"../../../core/Error.js";import{throwIfAborted as s,throwIfAbortError as t}from"../../../core/promiseUtils.js";import{isDataProtocol as a,dataToArrayBuffer as i}from"../../../core/urlUtils.js";class l{constructor(r=r=>r){this._resolveURI=r}async loadJSON(r,o){return this._load("json",r,o)}async loadBinary(r,o){return a(r)?(s(o),i(r)):this._load("array-buffer",r,o)}async loadImage(r,o){return this._load("image",r,o)}async _load(s,a,i){a=this._resolveURI(a);const l=await o(r(a,{responseType:s,...i}));if(l.ok)return l.value.data;throw t(l.error),new e("gltf-loader-request-error",`Request for resource failed: ${l.error}`)}}export{l as DefaultLoadingContext};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{memoize as i}from"../../../../../core/memoize.js";import{ignoreAbortErrors as a}from"../../../../../core/promiseUtils.js";import{syncAndInitial as n,when as s}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as p}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as h}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as g}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as m}from"../../SnappingVisualizer3D.js";import{hideManipulatorWhileDragging as d,screenToMap3D as u}from"../../editingTools/dragEventPipeline3D.js";import c from"./AreaMeasurement3DView.js";import{PickRequest as y}from"../support/PickRequest.js";import{AnalysisToolBase as w}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as _}from"../../../../interactive/dragEventPipeline.js";import{sketchKeys as f}from"../../../../interactive/keybindings.js";import{ManipulatorCollection as S}from"../../../../interactive/ManipulatorCollection.js";import{EditGeometry as P}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as V}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as D}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as j}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as M}from"../../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as x}from"../../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as O}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as b}from"../../../../support/screenUtils.js";let k=class extends w{constructor(t){super(t),this._updatingHandles=new p,this.polygonState="initial",this.removeIncompleteOnCancel=!1,this.manipulators=new S,this._getSnappingContext=i(t=>new D({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new V(new P("point",v(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new m}))}initialize(){const{view:t,analysisViewData:e,manipulators:i,visible:o}=this;this.measurementView=new c({view:t,analysisViewData:e,toolState:this,manipulators:i,visible:o});const r=M(t);this._snappingManagerResult=r,this.addHandles(r),this._snappingOperation=new x({view:t}),this._updatingHandles.add(()=>this.stagedPoint,t=>{this.analysisViewData.stagedPoint=null!=t?h(t,new l):null},n),O(this,()=>{const t=this.view.inputManager.latestPointerInfo?.type??"mouse",e=this._getSnappingContext(t);this._updatingHandles.addPromise(a(this._snappingOperation.snapAgainNearPreviousMapPoint(this._snappingManager,e)))}),this._setupManipulators(),this.addHandles([s(()=>"measured"===this.state,()=>this.finishToolCreation(),n),this.analysisViewData.path.on("change",()=>{const t=this.analysisViewData.path;"initial"!==this.polygonState||t.isEmptyPolygon||(t.isValidPolygon?this.polygonState="measured":this.polygonState="drawing")})])}destroy(){this.measurementView.destroy(),this._set("measurementView",null),this._updatingHandles=e(this._updatingHandles)}get _snappingManager(){return this._snappingManagerResult.snappingManager}get state(){return 0===this.analysisViewData.path.numVertices?"ready":this.analysisViewData.path.isValidPolygon&&"editing"!==this.polygonState?"measured":"measuring"}get cursor(){return this.active?"crosshair":null}get updating(){return this._updatingHandles.updating||this._snappingManager.updating}get stagedPoint(){return this._snappingOperation.stagedPoint}set stagedPoint(t){this._snappingOperation.stagedPoint=t}get snappingOptions(){return this._snappingManager.options}finishMeasurement(){const{path:t}=this.analysisViewData;t.numVertices<=2||(t.close(),this.polygonState="measured",this._resetSnappingState(),this.active&&(this.view.activeTool=null))}resetCreated(){super.resetCreated(),this._resetSnappingState(),this.polygonState="initial","measured"===this.state&&(this.polygonState="measured",this.finishToolCreation())}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._resetSnappingState()}onInputEvent(t){switch(t.type){case"immediate-double-click":this._handleImmediateDoubleClick(t);break;case"immediate-click":this._handleImmediateClick(t);break;case"pointer-move":this._handlePointerMove(t);break;case"drag":this._handleDrag(t);break;case"key-down":this._handleKeyDown(t)}}_setupManipulators(){const t=t=>t.events.on("grab-changed",()=>{if(this.analysisViewData.path.isValidPolygon){const t=this.manipulators.some(t=>t.manipulator.grabbing);this.polygonState=t?"editing":"measured"}}),e=e=>{this.addHandles([_(e,(t,e,i,a)=>{const n=d(t),s=t.metadata,o=this._snappingManager,r=this._getSnappingContext(a),p=this._updatingHandles,{snappingStep:l,cancelSnapping:g}=j({snappingManager:o,snappingContext:r,updatingHandles:p});i=i.next(n).next(e=>(this.analysisViewData.lastDraggedVertex=null,this.analysisViewData.path.setVertexPosition(s,m),t.location=m,e)).next(g),e.next(n).next(u(this.view)).next(...l).next(e=>{t.location=e.mapEnd,this.analysisViewData.lastDraggedVertex="end"===e.action?null:s,this.analysisViewData.path.setVertexPosition(s,h(e.mapEnd))});const m=h(this.analysisViewData.path.getVertexPositionAsPoint(s))}),t(e)],e)};this.manipulators.forEach(({manipulator:t})=>{e(t)}),this.addHandles([this.manipulators.on("after-add",({item:{manipulator:t}})=>{e(t)}),this.manipulators.on("after-remove",({item:{manipulator:t}})=>this.removeHandles(t))])}_handleImmediateDoubleClick(t){g(t)&&("drawing"===this.polygonState&&this.finishMeasurement(),t.stopPropagation())}_handleDrag(t){"editing"===this.polygonState&&t.stopPropagation()}_handleImmediateClick(t){if(!g(t))return;const e=b(t),{pointerType:i}=t;if(this.active)switch(this.polygonState){case"initial":case"measured":if(this._addVertexAt(e,i))return this.stagedPoint=null,this.polygonState="drawing",void t.stopPropagation();break;case"drawing":{const a=this.measurementView.vertexHandleAt(e,i);if(null==a){if(this._addVertexAt(e,i))return this.stagedPoint=null,void t.stopPropagation()}else 0===a.index&&(this.finishMeasurement(),t.stopPropagation());break}}"mouse"===t.pointerType&&this._hoverAt(e)}_handlePointerMove(t){if("mouse"===t.pointerType){const e=b(t);this._hoverAt(e)}}_handleKeyDown(t){const{path:e}=this.analysisViewData;t.key===f.complete&&"drawing"===this.polygonState&&e.numVertices>=3&&(this.stagedPoint=null,this.finishMeasurement(),t.stopPropagation())}_hoverAt(t){const{polygonState:e}=this;if(this.active&&C.has(e)){const e=this._pick(t);if(null!=e?.mapPoint){const t=this._getSnappingContext("mouse");this._updatingHandles.addPromise(a(this._snappingOperation.snap({point:e.mapPoint},this._snappingManager,t)))}}else this.stagedPoint=null}_addVertexAt(t,e){const i=this._pick(t),a=i?.mapPoint;if(null==a)return!1;this.analysis.valid&&"measured"===this.polygonState&&(this.analysis.clear(),this._set("created",!1),this.polygonState="initial");const n=this._getSnappingContext(e),s=this._snappingOperation.update({point:a},this._snappingManager,n),o=h(s,new l);return this.analysisViewData.path.add(o),!0}_pick(t){const e=new y(t);return this.measurementView.pick(e)}_resetSnappingState(){this._snappingManager.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}get test(){}};t([o({readOnly:!0})],k.prototype,"state",null),t([o()],k.prototype,"polygonState",void 0),t([o({readOnly:!0})],k.prototype,"cursor",null),t([o()],k.prototype,"measurementView",void 0),t([o()],k.prototype,"removeIncompleteOnCancel",void 0),t([o({constructOnly:!0})],k.prototype,"view",void 0),t([o({constructOnly:!0})],k.prototype,"analysis",void 0),t([o({constructOnly:!0})],k.prototype,"analysisViewData",void 0),t([o({readOnly:!0})],k.prototype,"manipulators",void 0),t([o()],k.prototype,"updating",null),t([o()],k.prototype,"stagedPoint",null),t([o()],k.prototype,"snappingOptions",null),k=t([r("esri.views.3d.interactive.measurementTools.areaMeasurement3D.AreaMeasurement3DTool")],k);const C=new Set(["initial","drawing","measured"]);export{k as default};
5
+ import{__decorate as t}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{memoize as i}from"../../../../../core/memoize.js";import{ignoreAbortErrors as a}from"../../../../../core/promiseUtils.js";import{syncAndInitial as n,when as s}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as p}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as g}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as h}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as m}from"../../SnappingVisualizer3D.js";import{hideManipulatorWhileDragging as d,screenToMap3D as u}from"../../editingTools/dragEventPipeline3D.js";import c from"./AreaMeasurement3DView.js";import{PickRequest as y}from"../support/PickRequest.js";import{AnalysisToolBase as _}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as w}from"../../../../interactive/dragEventPipeline.js";import{sketchKeys as f}from"../../../../interactive/keybindings.js";import{ManipulatorCollection as S}from"../../../../interactive/ManipulatorCollection.js";import{EditGeometry as P}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as V}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as M}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as D}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as j}from"../../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as x}from"../../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as O}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as b}from"../../../../support/screenUtils.js";let k=class extends _{constructor(t){super(t),this._updatingHandles=new p,this._snappingManagerResult=null,this.polygonState="initial",this.removeIncompleteOnCancel=!1,this.manipulators=new S,this._getSnappingContext=i(t=>new M({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new V(new P("point",v(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new m}))}initialize(){const{view:t,analysisViewData:e,manipulators:i,visible:o}=this;this.measurementView=new c({view:t,analysisViewData:e,toolState:this,manipulators:i,visible:o}),this._snappingOperation=new x({view:t}),this._updatingHandles.add(()=>this.stagedPoint,t=>{this.analysisViewData.stagedPoint=null!=t?g(t,new l):null},n),O(this,()=>{const t=this.view.inputManager.latestPointerInfo?.type??"mouse",e=this._getSnappingContext(t);this._updatingHandles.addPromise(a(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),e)))}),this._setupManipulators(),this.addHandles([s(()=>"measured"===this.state,()=>this.finishToolCreation(),n),this.analysisViewData.path.on("change",()=>{const t=this.analysisViewData.path;"initial"!==this.polygonState||t.isEmptyPolygon||(t.isValidPolygon?this.polygonState="measured":this.polygonState="drawing")})])}destroy(){this.measurementView.destroy(),this._set("measurementView",null),this._updatingHandles=e(this._updatingHandles)}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){if(null==this._snappingManagerResult){const t=j(this.view);this._snappingManagerResult=t,this.addHandles(t)}return this._snappingManagerResult.snappingManager}get state(){return 0===this.analysisViewData.path.numVertices?"ready":this.analysisViewData.path.isValidPolygon&&"editing"!==this.polygonState?"measured":"measuring"}get cursor(){return this.active?"crosshair":null}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}get stagedPoint(){return this._snappingOperation.stagedPoint}set stagedPoint(t){this._snappingOperation.stagedPoint=t}get snappingOptions(){return this._snappingManager?.options}finishMeasurement(){const{path:t}=this.analysisViewData;t.numVertices<=2||(t.close(),this.polygonState="measured",this._resetSnappingState(),this.active&&(this.view.activeTool=null))}resetCreated(){super.resetCreated(),this._resetSnappingState(),this.polygonState="initial","measured"===this.state&&(this.polygonState="measured",this.finishToolCreation())}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._resetSnappingState()}onInputEvent(t){switch(t.type){case"immediate-double-click":this._handleImmediateDoubleClick(t);break;case"immediate-click":this._handleImmediateClick(t);break;case"pointer-move":this._handlePointerMove(t);break;case"drag":this._handleDrag(t);break;case"key-down":this._handleKeyDown(t)}}_setupManipulators(){const t=t=>t.events.on("grab-changed",()=>{if(this.analysisViewData.path.isValidPolygon){const t=this.manipulators.some(t=>t.manipulator.grabbing);this.polygonState=t?"editing":"measured"}}),e=e=>{this.addHandles([w(e,(t,e,i,a)=>{const n=d(t),s=t.metadata,o=this._snappingManager,r=this._getSnappingContext(a),p=this._updatingHandles,{snappingStep:l,cancelSnapping:h}=D({snappingManager:o,snappingContext:r,updatingHandles:p});i=i.next(n).next(e=>(this.analysisViewData.lastDraggedVertex=null,this.analysisViewData.path.setVertexPosition(s,m),t.location=m,e)).next(h),e.next(n).next(u(this.view)).next(...l).next(e=>{t.location=e.mapEnd,this.analysisViewData.lastDraggedVertex="end"===e.action?null:s,this.analysisViewData.path.setVertexPosition(s,g(e.mapEnd))});const m=g(this.analysisViewData.path.getVertexPositionAsPoint(s))}),t(e)],e)};this.manipulators.forEach(({manipulator:t})=>{e(t)}),this.addHandles([this.manipulators.on("after-add",({item:{manipulator:t}})=>{e(t)}),this.manipulators.on("after-remove",({item:{manipulator:t}})=>this.removeHandles(t))])}_handleImmediateDoubleClick(t){h(t)&&("drawing"===this.polygonState&&this.finishMeasurement(),t.stopPropagation())}_handleDrag(t){"editing"===this.polygonState&&t.stopPropagation()}_handleImmediateClick(t){if(!h(t))return;const e=b(t),{pointerType:i}=t;if(this.active)switch(this.polygonState){case"initial":case"measured":if(this._addVertexAt(e,i))return this.stagedPoint=null,this.polygonState="drawing",void t.stopPropagation();break;case"drawing":{const a=this.measurementView.vertexHandleAt(e,i);if(null==a){if(this._addVertexAt(e,i))return this.stagedPoint=null,void t.stopPropagation()}else 0===a.index&&(this.finishMeasurement(),t.stopPropagation());break}}"mouse"===t.pointerType&&this._hoverAt(e)}_handlePointerMove(t){if("mouse"===t.pointerType){const e=b(t);this._hoverAt(e)}}_handleKeyDown(t){const{path:e}=this.analysisViewData;t.key===f.complete&&"drawing"===this.polygonState&&e.numVertices>=3&&(this.stagedPoint=null,this.finishMeasurement(),t.stopPropagation())}_hoverAt(t){const{polygonState:e}=this;if(this.active&&C.has(e)){const e=this._pick(t);if(null!=e?.mapPoint){const t=this._getSnappingContext("mouse");this._updatingHandles.addPromise(a(this._snappingOperation.snap({point:e.mapPoint},this._ensureSnappingManager(),t)))}}else this.stagedPoint=null}_addVertexAt(t,e){const i=this._pick(t),a=i?.mapPoint;if(null==a)return!1;this.analysis.valid&&"measured"===this.polygonState&&(this.analysis.clear(),this._set("created",!1),this.polygonState="initial");const n=this._getSnappingContext(e),s=this._snappingOperation.update({point:a},this._ensureSnappingManager(),n),o=g(s,new l);return this.analysisViewData.path.add(o),!0}_pick(t){const e=new y(t);return this.measurementView.pick(e)}_resetSnappingState(){this._ensureSnappingManager().doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}get test(){}};t([o()],k.prototype,"_snappingManagerResult",void 0),t([o()],k.prototype,"_snappingManager",null),t([o({readOnly:!0})],k.prototype,"state",null),t([o()],k.prototype,"polygonState",void 0),t([o({readOnly:!0})],k.prototype,"cursor",null),t([o()],k.prototype,"measurementView",void 0),t([o()],k.prototype,"removeIncompleteOnCancel",void 0),t([o({constructOnly:!0})],k.prototype,"view",void 0),t([o({constructOnly:!0})],k.prototype,"analysis",void 0),t([o({constructOnly:!0})],k.prototype,"analysisViewData",void 0),t([o({readOnly:!0})],k.prototype,"manipulators",void 0),t([o()],k.prototype,"updating",null),t([o()],k.prototype,"stagedPoint",null),t([o()],k.prototype,"snappingOptions",null),k=t([r("esri.views.3d.interactive.measurementTools.areaMeasurement3D.AreaMeasurement3DTool")],k);const C=new Set(["initial","drawing","measured"]);export{k as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{memoize as i}from"../../../../../core/memoize.js";import{when as n,watch as a,syncAndInitial as s}from"../../../../../core/reactiveUtils.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../../../../../core/support/UpdatingHandles.js";import u from"../../../../../geometry/Point.js";import{clonePoint as p}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as c}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as d}from"../../SnappingVisualizer3D.js";import{hideManipulatorWhileDragging as h,screenToMap3D as m}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as g}from"./DirectLineMeasurement3DView.js";import{getElevationAtPoint as v}from"../../../support/ElevationProvider.js";import{AnalysisToolBase as P}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as y}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as f,resetProperties as w}from"../../../../interactive/dragEventPipeline.js";import{EditGeometry as S}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as _}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as M}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as D}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as j}from"../../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as b}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as L}from"../../../../support/screenUtils.js";let x=class extends P{constructor(t){super(t),this._updatingHandles=new l,this._emulatedDrag=null,this.lineState="initial",this.removeIncompleteOnCancel=!1,this.startPointSurfaceLocation=null,this.endPointSurfaceLocation=null,this.cursorPointSurfaceLocation=null,this.startManipulator=null,this.endManipulator=null,this.cursorManipulator=null,this._getSnappingContext=i(t=>new M({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new _(new S("point",y(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new d}))}initialize(){const{view:t,analysis:e,analysisViewData:i,visible:r}=this;this.measurementView=new g({toolState:this,view:t,analysis:e,analysisViewData:i,visible:r});const o=j(t);this._snappingManagerResult=o,this.addHandles(o);const{start:l,end:c,cursor:d}=this.measurementView.createManipulators(),v=(t,e,i)=>{const n=f(t,(t,n,a,s)=>{const r=h(t),o=this._snappingManager,l=this._getSnappingContext(s),c=this._updatingHandles,{lineState:d}=this;a=a.next(r).next(w(this,[i,e])).next(i=>{if("cursorPoint"!==e){const i=this.analysis[e];null!=i&&(t.location=i)}return i});const g=m(this.view),v=t=>{const n=g(t);return n||"drawing"!==this.lineState&&"initial"!==this.lineState||(this[e]=null,this[i]=null),n};let P=n.next(r).next(v);if("touch"!==s||"editing"===d){const{snappingStep:t,cancelSnapping:e}=D({snappingManager:o,snappingContext:l,updatingHandles:c});a=a.next(e),P=P.next(...t)}P.next(t=>"start"!==t.action?t:null).next(n=>{const a=p(n.mapEnd,new u);this[e]=a,t.location=a,this[i]=this._surfaceLocation(a,n.surfaceType)})});return"cursorPoint"===e?[n]:[n,t.events.on("grab-changed",()=>{const t=l.grabbing||c.grabbing;this.lineState=t?"editing":"measured"}),a(()=>this.analysis[e],e=>{e&&(t.location=e)})]};this.startManipulator=l,this.endManipulator=c,this.cursorManipulator=d,this.manipulators.add(l),this.manipulators.add(c),this.manipulators.add(d),this.addHandles([...v(l,"startPoint","startPointSurfaceLocation"),...v(c,"endPoint","endPointSurfaceLocation"),...v(d,"cursorPoint","cursorPointSurfaceLocation"),n(()=>"measured"===this.state,()=>{this.finishToolCreation(),this.active&&(this.view.activeTool=null)},s),a(()=>({startPointAvailable:null!=this.startPoint,endPointAvailable:null!=this.endPoint}),({startPointAvailable:t,endPointAvailable:e})=>{this.startManipulator.available=t,this.endManipulator.available=e},s)]),b(this)}destroy(){this._updatingHandles=e(this._updatingHandles),this.measurementView=e(this.measurementView)}get _snappingManager(){return this._snappingManagerResult.snappingManager}get state(){const{analysis:t}=this;if(null==t.startPoint&&null==t.endPoint)return"ready";const{lineState:e}=this;return this.validMeasurement&&"editing"!==e&&"drawing"!==e?"measured":"measuring"}get cursor(){return!this.active||"ready"!==this.state&&"measured"===this.lineState?null:"crosshair"}get startPoint(){return this.analysis.startPoint}set startPoint(t){this.analysis.startPoint=t}get endPoint(){return this.analysis.endPoint}set endPoint(t){this.analysis.endPoint=t}get cursorPoint(){return this.measurementView.cursorPoint}set cursorPoint(t){this.measurementView.cursorPoint=t}get snappingOptions(){return this._snappingManager.options}get validMeasurement(){return null!=this.analysis.startPoint&&null!=this.analysis.endPoint}get updating(){return this._updatingHandles.updating||this._snappingManager.updating}resetCreated(){super.resetCreated(),this.lineState="initial",this.cursorPoint=null,"measured"===this.state&&this.finishToolCreation()}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._emulatedDrag?.cancel(),this._emulatedDrag=null}onInputEvent(t){switch(t.type){case"immediate-click":this._handleImmediateClick(t);break;case"pointer-move":this._handlePointerMove(t)}}_handlePointerMove(t){if(!this.active||this.view.navigating)return;const{pointerType:e}=t;if("mouse"!==e)return;const i=L(t),{lineState:n,cursorManipulator:a,endManipulator:s}=this;let r=!1;null==this.cursorPoint&&(this._emulatedDrag?.cancel(),this._emulatedDrag=V(a,e,i),r=!0),"initial"===n&&(this._emulatedDrag?.update(i),r=!0),"drawing"===n&&(s.events.emit("drag",{action:"update",start:i,screenPoint:i}),r=!0),r&&t.stopPropagation()}_handleImmediateClick(t){if(!this.active||!c(t))return;const e=L(t),{pointerType:i}=t,{cursorManipulator:n,startManipulator:a,endManipulator:s,lineState:r}=this;let o=!1;switch(null==this.cursorPoint&&(this._emulatedDrag?.cancel(),this._emulatedDrag=V(n,i,e)),r){case"initial":if(this._emulatedDrag?.update(e),null!=this.cursorPoint){this._emulatedDrag?.end(e),this._emulatedDrag=null,this.endPoint=null;const{cursorPoint:t}=this;this.startPoint=t,this.startPointSurfaceLocation=this.cursorPointSurfaceLocation,a.location=t,a.interactive=!1,s.interactive=!1,this.lineState="drawing",this._emulatedDrag=V(s,i,e),o=!0}break;case"drawing":this._emulatedDrag?.update(e),null!=this.endPoint&&(this._emulatedDrag?.end(e),this._emulatedDrag=null,a.interactive=!0,s.interactive=!0,this.lineState="measured",o=!0)}o&&t.stopPropagation()}_surfaceLocation(t,e){return 0===e?"on-the-surface":(t.z??0)>=this._getElevation(t)?"above-the-surface":"below-the-surface"}_getElevation(t){return this.view.basemapTerrain.ready?v(this.view.elevationProvider,t)??0:0}get test(){}};function V(t,e,i){return t.events.emit("drag",{action:"start",pointerType:e,start:i,screenPoint:i}),{update:e=>t.events.emit("drag",{action:"update",start:e,screenPoint:e}),end:e=>t.events.emit("drag",{action:"end",start:e,screenPoint:e}),cancel:()=>t.events.emit("drag",{action:"cancel"})}}t([r({readOnly:!0})],x.prototype,"state",null),t([r()],x.prototype,"lineState",void 0),t([r({readOnly:!0})],x.prototype,"cursor",null),t([r()],x.prototype,"startPoint",null),t([r()],x.prototype,"endPoint",null),t([r()],x.prototype,"cursorPoint",null),t([r({constructOnly:!0})],x.prototype,"analysis",void 0),t([r({constructOnly:!0})],x.prototype,"analysisViewData",void 0),t([r()],x.prototype,"measurementView",void 0),t([r()],x.prototype,"removeIncompleteOnCancel",void 0),t([r({constructOnly:!0})],x.prototype,"view",void 0),t([r({readOnly:!0})],x.prototype,"validMeasurement",null),t([r({value:null})],x.prototype,"startPointSurfaceLocation",void 0),t([r({value:null})],x.prototype,"endPointSurfaceLocation",void 0),t([r({value:null})],x.prototype,"cursorPointSurfaceLocation",void 0),t([r()],x.prototype,"updating",null),x=t([o("esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DTool")],x);export{x as default};
5
+ import{__decorate as t}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{memoize as i}from"../../../../../core/memoize.js";import{when as n,watch as a,syncAndInitial as s}from"../../../../../core/reactiveUtils.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../../../../../core/support/UpdatingHandles.js";import u from"../../../../../geometry/Point.js";import{clonePoint as p}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as c}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as d}from"../../SnappingVisualizer3D.js";import{hideManipulatorWhileDragging as h,screenToMap3D as m}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as g}from"./DirectLineMeasurement3DView.js";import{getElevationAtPoint as v}from"../../../support/ElevationProvider.js";import{AnalysisToolBase as P}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as y}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as f,resetProperties as w}from"../../../../interactive/dragEventPipeline.js";import{EditGeometry as _}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as M}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as S}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as D}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as j}from"../../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as b}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as L}from"../../../../support/screenUtils.js";let x=class extends P{constructor(t){super(t),this._updatingHandles=new l,this._snappingManagerResult=null,this._emulatedDrag=null,this.lineState="initial",this.removeIncompleteOnCancel=!1,this.startPointSurfaceLocation=null,this.endPointSurfaceLocation=null,this.cursorPointSurfaceLocation=null,this.startManipulator=null,this.endManipulator=null,this.cursorManipulator=null,this._getSnappingContext=i(t=>new S({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new M(new _("point",y(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new d}))}initialize(){const{view:t,analysis:e,analysisViewData:i,visible:r}=this;this.measurementView=new g({toolState:this,view:t,analysis:e,analysisViewData:i,visible:r});const{start:o,end:l,cursor:c}=this.measurementView.createManipulators(),d=(t,e,i)=>{const n=f(t,(t,n,a,s)=>{const r=h(t),o=this._ensureSnappingManager(),l=this._getSnappingContext(s),c=this._updatingHandles,{lineState:d}=this;a=a.next(r).next(w(this,[i,e])).next(i=>{if("cursorPoint"!==e){const i=this.analysis[e];null!=i&&(t.location=i)}return i});const g=m(this.view),v=t=>{const n=g(t);return n||"drawing"!==this.lineState&&"initial"!==this.lineState||(this[e]=null,this[i]=null),n};let P=n.next(r).next(v);if("touch"!==s||"editing"===d){const{snappingStep:t,cancelSnapping:e}=D({snappingManager:o,snappingContext:l,updatingHandles:c});a=a.next(e),P=P.next(...t)}P.next(t=>"start"!==t.action?t:null).next(n=>{const a=p(n.mapEnd,new u);this[e]=a,t.location=a,this[i]=this._surfaceLocation(a,n.surfaceType)})});return"cursorPoint"===e?[n]:[n,t.events.on("grab-changed",()=>{const t=o.grabbing||l.grabbing;this.lineState=t?"editing":"measured"}),a(()=>this.analysis[e],e=>{e&&(t.location=e)})]};this.startManipulator=o,this.endManipulator=l,this.cursorManipulator=c,this.manipulators.add(o),this.manipulators.add(l),this.manipulators.add(c),this.addHandles([...d(o,"startPoint","startPointSurfaceLocation"),...d(l,"endPoint","endPointSurfaceLocation"),...d(c,"cursorPoint","cursorPointSurfaceLocation"),n(()=>"measured"===this.state,()=>{this.finishToolCreation(),this.active&&(this.view.activeTool=null)},s),a(()=>({startPointAvailable:null!=this.startPoint,endPointAvailable:null!=this.endPoint}),({startPointAvailable:t,endPointAvailable:e})=>{this.startManipulator.available=t,this.endManipulator.available=e},s)]),b(this)}destroy(){this._updatingHandles=e(this._updatingHandles),this.measurementView=e(this.measurementView)}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){if(null==this._snappingManagerResult){const t=j(this.view);this._snappingManagerResult=t,this.addHandles(t)}return this._snappingManagerResult.snappingManager}get state(){const{analysis:t}=this;if(null==t.startPoint&&null==t.endPoint)return"ready";const{lineState:e}=this;return this.validMeasurement&&"editing"!==e&&"drawing"!==e?"measured":"measuring"}get cursor(){return!this.active||"ready"!==this.state&&"measured"===this.lineState?null:"crosshair"}get startPoint(){return this.analysis.startPoint}set startPoint(t){this.analysis.startPoint=t}get endPoint(){return this.analysis.endPoint}set endPoint(t){this.analysis.endPoint=t}get cursorPoint(){return this.measurementView.cursorPoint}set cursorPoint(t){this.measurementView.cursorPoint=t}get snappingOptions(){return this._snappingManager?.options}get validMeasurement(){return null!=this.analysis.startPoint&&null!=this.analysis.endPoint}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}resetCreated(){super.resetCreated(),this.lineState="initial",this.cursorPoint=null,"measured"===this.state&&this.finishToolCreation()}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._emulatedDrag?.cancel(),this._emulatedDrag=null}onInputEvent(t){switch(t.type){case"immediate-click":this._handleImmediateClick(t);break;case"pointer-move":this._handlePointerMove(t)}}_handlePointerMove(t){if(!this.active||this.view.navigating)return;const{pointerType:e}=t;if("mouse"!==e)return;const i=L(t),{lineState:n,cursorManipulator:a,endManipulator:s}=this;let r=!1;null==this.cursorPoint&&(this._emulatedDrag?.cancel(),this._emulatedDrag=V(a,e,i),r=!0),"initial"===n&&(this._emulatedDrag?.update(i),r=!0),"drawing"===n&&(s.events.emit("drag",{action:"update",start:i,screenPoint:i}),r=!0),r&&t.stopPropagation()}_handleImmediateClick(t){if(!this.active||!c(t))return;const e=L(t),{pointerType:i}=t,{cursorManipulator:n,startManipulator:a,endManipulator:s,lineState:r}=this;let o=!1;switch(null==this.cursorPoint&&(this._emulatedDrag?.cancel(),this._emulatedDrag=V(n,i,e)),r){case"initial":if(this._emulatedDrag?.update(e),null!=this.cursorPoint){this._emulatedDrag?.end(e),this._emulatedDrag=null,this.endPoint=null;const{cursorPoint:t}=this;this.startPoint=t,this.startPointSurfaceLocation=this.cursorPointSurfaceLocation,a.location=t,a.interactive=!1,s.interactive=!1,this.lineState="drawing",this._emulatedDrag=V(s,i,e),o=!0}break;case"drawing":this._emulatedDrag?.update(e),null!=this.endPoint&&(this._emulatedDrag?.end(e),this._emulatedDrag=null,a.interactive=!0,s.interactive=!0,this.lineState="measured",o=!0)}o&&t.stopPropagation()}_surfaceLocation(t,e){return 0===e?"on-the-surface":(t.z??0)>=this._getElevation(t)?"above-the-surface":"below-the-surface"}_getElevation(t){return this.view.basemapTerrain.ready?v(this.view.elevationProvider,t)??0:0}get test(){}};function V(t,e,i){return t.events.emit("drag",{action:"start",pointerType:e,start:i,screenPoint:i}),{update:e=>t.events.emit("drag",{action:"update",start:e,screenPoint:e}),end:e=>t.events.emit("drag",{action:"end",start:e,screenPoint:e}),cancel:()=>t.events.emit("drag",{action:"cancel"})}}t([r()],x.prototype,"_snappingManagerResult",void 0),t([r()],x.prototype,"_snappingManager",null),t([r({readOnly:!0})],x.prototype,"state",null),t([r()],x.prototype,"lineState",void 0),t([r({readOnly:!0})],x.prototype,"cursor",null),t([r()],x.prototype,"startPoint",null),t([r()],x.prototype,"endPoint",null),t([r()],x.prototype,"cursorPoint",null),t([r({constructOnly:!0})],x.prototype,"analysis",void 0),t([r({constructOnly:!0})],x.prototype,"analysisViewData",void 0),t([r()],x.prototype,"measurementView",void 0),t([r()],x.prototype,"removeIncompleteOnCancel",void 0),t([r({constructOnly:!0})],x.prototype,"view",void 0),t([r({readOnly:!0})],x.prototype,"validMeasurement",null),t([r({value:null})],x.prototype,"startPointSurfaceLocation",void 0),t([r({value:null})],x.prototype,"endPointSurfaceLocation",void 0),t([r({value:null})],x.prototype,"cursorPointSurfaceLocation",void 0),t([r()],x.prototype,"updating",null),x=t([o("esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DTool")],x);export{x as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../../../core/Accessor.js";import{equals as r}from"../../../../../../core/arrayUtils.js";import{watch as i}from"../../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../../core/accessorSupport/decorators/property.js";import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import{subclass as s}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{create as n}from"../../../../../../geometry/support/aaBoundingRect.js";import{TileKey as l}from"../../../../../../layers/support/TileKey.js";import{distanceToTile as p}from"../../../../../interactive/snapping/featureSources/featureServiceSource/tileUtils.js";let c=class extends t{get _sortedTilesCoveringView(){const e=(this.view.featureTiles?.tiles?.toArray()??[]).map(a),t=this._effectivePointOfInterest;return null!=t&&e.sort((e,r)=>p(t,e)-p(t,r)),e}get tileInfo(){return this.view.featureTiles?.tilingScheme?.toTileInfo()??null}get tileSize(){return this.view.featureTiles?.tileSize??256}get _effectivePointOfInterest(){const e=this.pointOfInterest;return null!=e?e:this.view.pointsOfInterest?.focus.location}constructor(e){super(e),this.tiles=[],this.pointOfInterest=null}initialize(){this.addHandles([this.view.enableFeatureTiles(),i(()=>this._sortedTilesCoveringView,e=>this._set("tiles",e),{initial:!0,equals:(e,t)=>r(e,t,(e,t)=>e.id===t.id)})])}};function a({lij:[e,t,r],extent:i}){return new l(e,t,r,i??n())}e([o({readOnly:!0})],c.prototype,"tiles",void 0),e([o({readOnly:!0})],c.prototype,"_sortedTilesCoveringView",null),e([o({readOnly:!0})],c.prototype,"tileInfo",null),e([o({readOnly:!0})],c.prototype,"tileSize",null),e([o({constructOnly:!0})],c.prototype,"view",void 0),e([o()],c.prototype,"pointOfInterest",void 0),e([o()],c.prototype,"_effectivePointOfInterest",null),c=e([s("esri.views.3d.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiles3D")],c);export{c as FeatureServiceTiles3D};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../../core/Accessor.js";import{equals as r}from"../../../../../../core/arrayUtils.js";import{watch as i}from"../../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../../core/accessorSupport/decorators/property.js";import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import{subclass as s}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{create as n}from"../../../../../../geometry/support/aaBoundingRect.js";import{TileKey as l}from"../../../../../../layers/support/TileKey.js";import{distanceToTile as p}from"../../../../../interactive/snapping/featureSources/featureServiceSource/tileUtils.js";let u=class extends t{get _sortedTilesCoveringView(){const e=(this.view.featureTiles?.tiles?.toArray()??[]).map(a),t=this._effectivePointOfInterest;return null!=t&&e.sort((e,r)=>p(t,e)-p(t,r)),e}get tileInfo(){return this.view.featureTiles?.tilingScheme?.toTileInfo()??null}get tileSize(){return this.view.featureTiles?.tileSize??256}get _effectivePointOfInterest(){const e=this.pointOfInterest;return null!=e?e:this.view.pointsOfInterest?.focus.location}get updating(){return!this.view.featureTiles}constructor(e){super(e),this.tiles=[],this.pointOfInterest=null}initialize(){this.addHandles([this.view.enableFeatureTiles(),i(()=>this._sortedTilesCoveringView,e=>this._set("tiles",e),{initial:!0,equals:(e,t)=>r(e,t,(e,t)=>e.id===t.id)})])}};function a({lij:[e,t,r],extent:i}){return new l(e,t,r,i??n())}e([o({readOnly:!0})],u.prototype,"tiles",void 0),e([o({readOnly:!0})],u.prototype,"_sortedTilesCoveringView",null),e([o({readOnly:!0})],u.prototype,"tileInfo",null),e([o({readOnly:!0})],u.prototype,"tileSize",null),e([o({constructOnly:!0})],u.prototype,"view",void 0),e([o()],u.prototype,"pointOfInterest",void 0),e([o()],u.prototype,"_effectivePointOfInterest",null),e([o()],u.prototype,"updating",null),u=e([s("esri.views.3d.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiles3D")],u);export{u as FeatureServiceTiles3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import o from"../../../core/Error.js";import t from"../../../core/Logger.js";import{releaseMaybe as i}from"../../../core/maybe.js";import{isAborted as r}from"../../../core/promiseUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{ElevationTileData as n}from"../../../layers/support/ElevationTileData.js";import{acquireDecoder as l}from"../../../layers/support/LercDecoder.js";import{ElevationLayerView3DModifications as c,ElevationLayerView3DModification as m}from"./ElevationLayerView3DModifications.js";import{LayerView3D as p}from"./LayerView3D.js";import{TiledLayerView3D as d}from"./TiledLayerView3D.js";import{elevationNoDataValue as f}from"../terrain/TerrainConst.js";import{useFetchTileForLayer as y}from"../terrain/terrainUtils.js";import h from"../../layers/LayerView.js";let g=class extends(d(p(h))){constructor(){super(...arguments),this.type="elevation-3d",this.modifications=new c}get tileInfo(){return this.layer.tileInfo}initialize(){const e=this.view,t=e.map?.allLayers,i=t&&t.includes(this.layer),r=e.map?.ground?.layers,s=r&&r.includes(this.layer);if(i&&!s){const e=new o("layerview:elevation-layer-only",`3D elevation layer '${this.layer.id}' can only be added to layers in map.ground`);this.addResolvingPromise(Promise.reject(e))}this._lercDecoder=l(e.resourceController),this._addTilingSchemeMatchPromise()}destroy(){this._lercDecoder=i(this._lercDecoder)}async fetchElevationTile(e,o){const t=await this._fetchTileData(e.lij,o);if(!r(o))return t&&await this.modifications.apply(t,e,o.signal),t}async _fetchTileData(e,o){const i=this.layer;if(y(i)){const s=await i.fetchTile(e[0],e[1],e[2],{noDataValue:f,signal:o.signal});return r(o)?void t.getLogger(this).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true."):s}const s=this.getTileUrl(e),a=await o.requester.request(s,1,o),l=await this._lercDecoder.decode(a,{noDataValue:f},o.signal);if(l)return new n(l);throw new Error("LERC decoding failed")}async setModifications(e){if(this.modifications.modifications.length=0,!e||0===e.length)return;this._simplifyOperatorPromise??=import("../../../geometry/operators/simplifyOperator.js");const o=await this._simplifyOperatorPromise;for(const i of e){const e=i.geometry;if("polygon"===e?.type){const r=o.execute(e);if("polygon"===r?.type){const e=new m(i.type,r);this.modifications.modifications.push(e)}else t.getLogger(this).warn("Failed to simplify modification polygon")}else t.getLogger(this).warn("Invalid modification added to elevation layer: "+(e?`non polygon geometry ${e.type}`:"no geometry"))}}};e([s()],g.prototype,"layer",void 0),e([s()],g.prototype,"tileInfo",null),e([s()],g.prototype,"modifications",void 0),g=e([a("esri.views.3d.layers.ElevationLayerView3D")],g);const u=g;export{u as default};
5
+ import{__decorate as e}from"tslib";import o from"../../../request.js";import{queueHighPriority as r}from"../../../requestQueue.js";import t from"../../../core/Error.js";import i from"../../../core/Logger.js";import{releaseMaybe as s}from"../../../core/maybe.js";import{isAborted as a}from"../../../core/promiseUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{ElevationTileData as c}from"../../../layers/support/ElevationTileData.js";import{acquireDecoder as m}from"../../../layers/support/LercDecoder.js";import{ElevationLayerView3DModifications as p,ElevationLayerView3DModification as d}from"./ElevationLayerView3DModifications.js";import{LayerView3D as f}from"./LayerView3D.js";import{TiledLayerView3D as y}from"./TiledLayerView3D.js";import{elevationNoDataValue as h}from"../terrain/TerrainConst.js";import{useFetchTileForLayer as g}from"../terrain/terrainUtils.js";import u from"../../layers/LayerView.js";let w=class extends(y(f(u))){constructor(){super(...arguments),this.type="elevation-3d",this.modifications=new p}get tileInfo(){return this.layer.tileInfo}initialize(){const e=this.view,o=e.map?.allLayers,r=o&&o.includes(this.layer),i=e.map?.ground?.layers,s=i&&i.includes(this.layer);if(r&&!s){const e=new t("layerview:elevation-layer-only",`3D elevation layer '${this.layer.id}' can only be added to layers in map.ground`);this.addResolvingPromise(Promise.reject(e))}this._lercDecoder=m(e.resourceController),this._addTilingSchemeMatchPromise()}destroy(){this._lercDecoder=s(this._lercDecoder)}async fetchElevationTile(e,o){const r=await this._fetchTileData(e.lij,o);if(!a(o))return r&&await this.modifications.apply(r,e,o.signal),r}async _fetchTileData(e,t){const s=this.layer;if(g(s)){const o=await s.fetchTile(e[0],e[1],e[2],{noDataValue:h,signal:t.signal});return a(t)?void i.getLogger(this).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true."):o}t={...r,responseType:"array-buffer",...t};const n=this.getTileUrl(e),l=(await o(n,t)).data,m=await this._lercDecoder.decode(l,{noDataValue:h},t.signal);if(m)return new c(m);throw new Error("LERC decoding failed")}async setModifications(e){if(this.modifications.modifications.length=0,!e||0===e.length)return;this._simplifyOperatorPromise??=import("../../../geometry/operators/simplifyOperator.js");const o=await this._simplifyOperatorPromise;for(const r of e){const e=r.geometry;if("polygon"===e?.type){const t=o.execute(e);if("polygon"===t?.type){const e=new d(r.type,t);this.modifications.modifications.push(e)}else i.getLogger(this).warn("Failed to simplify modification polygon")}else i.getLogger(this).warn("Invalid modification added to elevation layer: "+(e?`non polygon geometry ${e.type}`:"no geometry"))}}};e([n()],w.prototype,"layer",void 0),e([n()],w.prototype,"tileInfo",null),e([n()],w.prototype,"modifications",void 0),w=e([l("esri.views.3d.layers.ElevationLayerView3D")],w);const j=w;export{j as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import has from"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{getObjectId as u}from"../../../layers/graphics/dehydratedFeatures.js";import{packFields as n}from"../../../layers/support/fieldUtils.js";import{FeatureLikeLayerView3D as p}from"./FeatureLikeLayerView3D.js";import{LayerView3D as l}from"./LayerView3D.js";import{FeatureGraphics3DGraphicsPipeline as m}from"./graphics/FeatureGraphics3DGraphicsPipeline.js";import{updatingProgress as c}from"../support/updatingProperties.js";import d from"../../layers/FeatureLayerView.js";import h from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";let f=class extends(y(p(d(l(h))))){constructor(e){super(e)}initialize(){this.addHandles(i(()=>this._updatingRequiredPromise,e=>this._updatingHandles.addPromise(e),s))}destroy(){this._updatingHandles.removeAll(),this._fetcherContext=t(this._fetcherContext)}get maximumNumberOfFeatures(){return this.graphicsPipeline.maximumNumberOfFeatures}set maximumNumberOfFeatures(e){this.graphicsPipeline.maximumNumberOfFeatures=e}get maximumNumberOfFeaturesExceeded(){return null!=this.graphicsPipeline&&!this.suspended&&this.graphicsPipeline.maximumNumberOfFeaturesExceeded}get updatingProgressValue(){return this.graphicsPipeline?.updatingProgressValue??0}get updatePolicy(){return this.graphicsPipeline?.updatePolicy??0}get hasZ(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsZ)&&("returnZ"in e&&null!=e.returnZ?e.returnZ:r.supportsZ)}get hasM(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsM)&&("returnM"in e&&null!=e.returnM&&e.returnM)}get availableFieldsForQuery(){return n(this.layer.fieldsIndex,this.availableFields)}setVisibility(e,r){this.graphicsPipeline?.setVisibility(e,r)}createQuery(){return super.createQuery()}queryFeatures(e,r){const t=()=>super.queryFeatures(e,r);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(e),t):t()}async createGraphicsPipeline(){if(has("feature-pipeline-3d-test")){const{Feature3DPipeline:e}=await import("./graphics/pipeline/Feature3DPipeline.js");return new e({layerView:this})}return new m({layerView:this})}async doRefresh(e){return await this.graphicsPipeline.doRefresh(e)}_popupFeatureHasRequiredFields(e,r){if(!super._popupFeatureHasRequiredFields(e,r))return!1;const t=u(e,this.layer.objectIdField);if(null==t)return!0;const i=this.graphicsPipeline.getMissingAttributesForFeature(t);if(null==i)return!0;for(const s of r)if(i.has(s))return!1;return!0}get usedMemory(){return this.graphicsPipeline?.usedMemory??0}get unloadedMemory(){return this.graphicsPipeline?.unloadedMemory??0}get ignoresMemoryFactor(){return this.graphicsPipeline?.ignoresMemoryFactor??!1}async _queryFeaturesMesh(e,r){this._validateQueryFeaturesMesh(e);const t=await r(),i=this.graphicsPipeline;if(e?.outStatistics||null==i)return t;const s=this.layer.objectIdField,a=[];for(const o of t.features)if(o.geometry){const e=i.getHydratedGeometry(o.attributes[s]);e&&(o.geometry=e,a.push(o))}else a.push(o);return t.features=a,t}_validateQueryFeaturesMesh(e){if(!e)return;const t=e=>{throw new r("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${e}'`)},i=["quantizationParameters","geometryPrecision","maxAllowableOffset"];for(const r of i)null!=e[r]&&t(r);"returnM"in e&&e.returnM&&t("returnM"),"returnCentroid"in e&&e.returnCentroid&&t("returnCentroid"),null==e.outSpatialReference||e.outSpatialReference.equals(this.view.spatialReference)||t("outSpatialReference")}get test(){}};e([a()],f.prototype,"layer",void 0),e([a()],f.prototype,"graphicsPipeline",void 0),e([a()],f.prototype,"maximumNumberOfFeatures",null),e([a()],f.prototype,"maximumNumberOfFeaturesExceeded",null),e([a(c)],f.prototype,"updatingProgress",void 0),e([a({readOnly:!0})],f.prototype,"updatingProgressValue",null),e([a({readOnly:!0})],f.prototype,"updatePolicy",null),e([a({readOnly:!0})],f.prototype,"hasZ",null),e([a({readOnly:!0})],f.prototype,"hasM",null),e([a()],f.prototype,"availableFieldsForQuery",null),f=e([o("esri.views.3d.layers.FeatureLayerViewBase3D")],f);export{f as default};
5
+ import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import has from"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{getObjectId as u}from"../../../layers/graphics/dehydratedFeatures.js";import{packFields as p}from"../../../layers/support/fieldUtils.js";import{FeatureLikeLayerView3D as n}from"./FeatureLikeLayerView3D.js";import{LayerView3D as l}from"./LayerView3D.js";import{FeatureGraphics3DGraphicsPipeline as m}from"./graphics/FeatureGraphics3DGraphicsPipeline.js";import{updatingProgress as c}from"../support/updatingProperties.js";import d from"../../layers/FeatureLayerView.js";import y from"../../layers/LayerView.js";import{RefreshableLayerView as h}from"../../layers/RefreshableLayerView.js";let f=class extends(h(n(d(l(y))))){constructor(e){super(e)}initialize(){this.addHandles(i(()=>this._updatingRequiredPromise,e=>this._updatingHandles.addPromise(e),s))}destroy(){this._updatingHandles.removeAll(),this._fetcherContext=t(this._fetcherContext)}get maximumNumberOfFeatures(){return this.graphicsPipeline.maximumNumberOfFeatures}set maximumNumberOfFeatures(e){this.graphicsPipeline.maximumNumberOfFeatures=e}get maximumNumberOfFeaturesExceeded(){return null!=this.graphicsPipeline&&!this.suspended&&this.graphicsPipeline.maximumNumberOfFeaturesExceeded}get updatingProgressValue(){return this.graphicsPipeline?.updatingProgressValue??0}get updatePolicy(){return this.graphicsPipeline?.updatePolicy??0}get snappingComplexityExceeded(){return this.graphicsPipeline?.snappingComplexityExceeded??!0}get hasZ(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsZ)&&("returnZ"in e&&null!=e.returnZ?e.returnZ:r.supportsZ)}get hasM(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsM)&&("returnM"in e&&null!=e.returnM&&e.returnM)}get availableFieldsForQuery(){return p(this.layer.fieldsIndex,this.availableFields)}setVisibility(e,r){this.graphicsPipeline?.setVisibility(e,r)}createQuery(){return super.createQuery()}queryFeatures(e,r){const t=()=>super.queryFeatures(e,r);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(e),t):t()}async createGraphicsPipeline(){if(has("feature-pipeline-3d-test")){const{Feature3DPipeline:e}=await import("./graphics/pipeline/Feature3DPipeline.js");return new e({layerView:this})}return new m({layerView:this})}async doRefresh(e){return await this.graphicsPipeline.doRefresh(e)}_popupFeatureHasRequiredFields(e,r){if(!super._popupFeatureHasRequiredFields(e,r))return!1;const t=u(e,this.layer.objectIdField);if(null==t)return!0;const i=this.graphicsPipeline.getMissingAttributesForFeature(t);if(null==i)return!0;for(const s of r)if(i.has(s))return!1;return!0}get usedMemory(){return this.graphicsPipeline?.usedMemory??0}get unloadedMemory(){return this.graphicsPipeline?.unloadedMemory??0}get ignoresMemoryFactor(){return this.graphicsPipeline?.ignoresMemoryFactor??!1}async _queryFeaturesMesh(e,r){this._validateQueryFeaturesMesh(e);const t=await r(),i=this.graphicsPipeline;if(e?.outStatistics||null==i)return t;const s=this.layer.objectIdField,a=[];for(const o of t.features)if(o.geometry){const e=i.getHydratedGeometry(o.attributes[s]);e&&(o.geometry=e,a.push(o))}else a.push(o);return t.features=a,t}_validateQueryFeaturesMesh(e){if(!e)return;const t=e=>{throw new r("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${e}'`)},i=["quantizationParameters","geometryPrecision","maxAllowableOffset"];for(const r of i)null!=e[r]&&t(r);"returnM"in e&&e.returnM&&t("returnM"),"returnCentroid"in e&&e.returnCentroid&&t("returnCentroid"),null==e.outSpatialReference||e.outSpatialReference.equals(this.view.spatialReference)||t("outSpatialReference")}get test(){}};e([a()],f.prototype,"layer",void 0),e([a()],f.prototype,"graphicsPipeline",void 0),e([a()],f.prototype,"maximumNumberOfFeatures",null),e([a()],f.prototype,"maximumNumberOfFeaturesExceeded",null),e([a(c)],f.prototype,"updatingProgress",void 0),e([a({readOnly:!0})],f.prototype,"updatingProgressValue",null),e([a({readOnly:!0})],f.prototype,"updatePolicy",null),e([a()],f.prototype,"snappingComplexityExceeded",null),e([a({readOnly:!0})],f.prototype,"hasZ",null),e([a({readOnly:!0})],f.prototype,"hasM",null),e([a()],f.prototype,"availableFieldsForQuery",null),f=e([o("esri.views.3d.layers.FeatureLayerViewBase3D")],f);export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import{result as r,forEach as s}from"../../../core/asyncUtils.js";import"../../../core/has.js";import o from"../../../core/Logger.js";import{destroyMaybe as n,abortMaybe as a}from"../../../core/maybe.js";import{estimateNumberArrayMemory as d,baseObjectMemory as l,estimateNumberMemory as u,estimateFixedArrayMemory as h,baseArrayMemory as p}from"../../../core/memoryEstimations.js";import{isAbortError as c,allSettledValues as _,throwIfAborted as m}from"../../../core/promiseUtils.js";import{initial as g,watch as f,sync as y,syncAndInitial as b}from"../../../core/reactiveUtils.js";import{pt2px as w}from"../../../core/screenUtils.js";import{isArrayBuffer as P}from"../../../core/typedArrayUtil.js";import{property as N}from"../../../core/accessorSupport/decorators/property.js";import{subclass as v}from"../../../core/accessorSupport/decorators/subclass.js";import{b as x,g as C,f as S,d as I}from"../../../chunks/vec32.js";import{clone as A}from"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{fromValues as R}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import j from"../../../geometry/Extent.js";import k from"../../../geometry/Point.js";import{projectBoundingSphere as V}from"../../../geometry/projection/projectBoundingSphere.js";import{projectVectorToVector as Q}from"../../../geometry/projection/projectVectorToVector.js";import{create as F,fromMinMax as L}from"../../../geometry/support/aaBoundingBox.js";import{fromNormalAndOffset as D,create as E}from"../../../geometry/support/plane.js";import{f as O}from"../../../chunks/sphere.js";import U from"../../../layers/graphics/OptimizedGeometry.js";import{QueryEngine as q}from"../../../layers/graphics/data/QueryEngine.js";import{CodedValue as M}from"../../../layers/support/CodedValue.js";import W from"../../../layers/support/CodedValueDomain.js";import"../../../layers/support/Domain.js";import"../../../layers/support/InheritedDomain.js";import"../../../layers/support/RangeDomain.js";import{unpackFieldNames as G}from"../../../layers/support/fieldUtils.js";import z from"../../../rest/support/FeatureSet.js";import H from"../../../rest/support/Query.js";import{getElevationOffset as B}from"../../../support/elevationInfoUtils.js";import{LayerView3D as T}from"./LayerView3D.js";import{PointCloudLayerViewPerformanceInfo as $,QueuePerformanceInfo as J}from"./PointCloudLayerViewPerformanceInfo.js";import{PointCloudWorkerHandle as K}from"./PointCloudWorkerHandle.js";import{I3SQueryFeatureStore as Z}from"./i3s/I3SQueryFeatureStore.js";import{checkPointCloudLayerValid as Y,checkPointCloudLayerCompatibleWithView as X}from"./i3s/I3SUtil.js";import{nodeDiff as ee,sortFrontToBack as te,splitWorkEntries as ie}from"./i3s/LoDUtil.js";import{PagedNodeIndex as re}from"./i3s/PagedNodeIndex.js";import{PointCloudGraphic as se}from"./i3s/PointCloudGraphic.js";import{PointCloudRenderer as oe}from"./i3s/PointCloudRenderer.js";import{isPointRendererNode as ne,PointCloudRendererNode as ae}from"./i3s/PointCloudRendererNode.js";import{getSplatSizeAlgorithm as de,getFixedSizeAlgorithm as le,getRendererInfo as ue,getFilterInfo as he,rendererUsesFixedSizes as pe,getAttributeInfo as ce}from"./i3s/PointCloudRendererUtil.js";import{getAttributeValues as _e,readGeometry as me,elevationFromPositions as ge}from"./i3s/PointCloudWorkerUtil.js";import{normalizeHighlightTarget as fe,emptyHighlightHandle as ye}from"./support/highlightUtils.js";import{PopupSceneLayerView as be}from"./support/PopupSceneLayerView.js";import{projectToBoundingBox as we}from"../support/extentUtils.js";import{computeMapPointFromVec3d as Pe}from"../support/hitTest.js";import{Obb as Ne}from"../support/orientedBoundingBox.js";import{updatingProgress as ve}from"../support/updatingProperties.js";import xe from"../../layers/LayerView.js";import{PointCloudLayerView as Ce}from"../../layers/PointCloudLayerView.js";import{getHighlightName as Se}from"../../support/highlightOptionsUtils.js";import{isInEffectiveScaleRange as Ie}from"../../support/layerViewUtils.js";import{PromiseQueue as Ae}from"../../support/PromiseQueue.js";import{TaskPriority as Re}from"../../support/Scheduler.js";const je=8,ke=E();let Ve=class extends(Ce(be(T(xe)))){constructor(){super(...arguments),this.type="point-cloud-3d",this.maximumPointCount=4e6,this.slicePlaneEnabled=!1,this._renderer=null,this._rendererAdded=!1,this._renderedNodes=new Set,this._updateViewNeeded=!0,this._lodFactor=1,this._maxLoggedBoxWarnings=5,this._pageMultiplier=1,this._nodeLoadEpoch=0,this._indexQueue=[],this._workQueue=new Array,this._idleQueue=new Ae,this._indexPagesLoading=new Map,this._loadingNodes=new Map,this._recalcWork=!0,this._layerIsVisible=!1,this._codedDomainPopulationPromise=null,this._codedDomainPopulationAbortController=null,this._totalWork=0,this._index=null,this._loadingInitNodePage=!1,this._nodeIdArray=[],this.ignoresMemoryFactor=!1}get baseUrl(){return this.layer.parsedUrl?.path??""}get pointScale(){const e=de(this.layer?.renderer),t=1;return null!=e?.scaleFactor?e.scaleFactor:t}get useRealWorldSymbolSizes(){const e=le(this.layer?.renderer),t=!1;return null!=e?.useRealWorldSymbolSizes?e.useRealWorldSymbolSizes:t}get pointSize(){const e=le(this.layer?.renderer),t=0;return null!=e?.size?e.size:t}get inverseDensity(){const e=96;return this.layer?.renderer?1*e/this.layer.renderer.pointsPerInch:5}get availableFields(){const e=ue(this.layer),t=new Set;e.primaryAttribute&&t.add(e.primaryAttribute.name),e.modulationAttribute&&t.add(e.modulationAttribute.name);const i=he(this.layer);if(i)for(const r of i)r.attributeInfo&&t.add(r.attributeInfo.name);if(this.layer.outFields)for(const r of G(this.layer.fieldsIndex,this.layer.outFields))t.add(r);return Array.from(t)}get _clippingBox(){if(!this.view||!this.view.clippingArea)return null;const e=F(),t=this.view.renderSpatialReference;return we(this.view.clippingArea,e,t)?e:null}get _elevationOffset(){const e=this.layer&&this.layer.elevationInfo;return e&&"absolute-height"===e.mode?B(e,this.layer.spatialReference):0}get _graphicOrigin(){return this.layer.graphicOrigin}initialize(){const e=this.view.resourceController,t=Ee(e);this._worker=new K(t),this.addResolvingPromise(this._worker.promise),Y(this.layer),X(this.layer,this.view),this._indexRequester=e.createStreamDataRequester(2),this._dataRequester=e.createStreamDataRequester(3),this._initRenderer();const i=this._initNodePages(),r=this.view.resourceController.memoryController;this._memCache=r.newCache(`pcl-${this.layer.uid}`),this._queryFeaturesCache=r.newCache(`pcl-query-features-${this.layer.uid};`),this._updatingHandles.add(()=>this._clippingBox,()=>this._setUpdateViewNeeded(),g),this._updatingHandles.add(()=>this._elevationOffset,()=>this._elevationOffsetChanged(),g),this._updatingHandles.add(()=>this.layer.renderer,()=>this._rendererChanged(),g),this._updatingHandles.add(()=>this.layer.filters,()=>this._reload(),g),this._updatingHandles.add(()=>this.layer.outFields,()=>this._reload(),g),this._updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this._setUpdateViewNeeded()),this._updatingHandles.add(()=>this.view.state.contentCamera,()=>this._setUpdateViewNeeded()),this.addHandles([f(()=>this.view.quality,()=>this._setUpdateViewNeeded(),y)]),this.addResolvingPromise(i),this.when(()=>{this.addHandles([e.scheduler.registerTask(Re.POINT_CLOUD_LAYER,this),f(()=>2===this.view.state.mode,()=>this._setUpdateViewNeeded(),b),this._updatingHandles.add(()=>this.suspended,e=>{e?this._clearNodeState():this._setUpdateViewNeeded()},g)])},()=>{this._updatingHandles.removeAll(),this.removeAllHandles()})}_setUpdateViewNeeded(){this._updateViewNeeded=!0,this._updateLoading()}destroy(){this.cancelLoading(),this._worker=n(this._worker),this._destroyRenderer(),this._memCache=n(this._memCache),this._queryFeaturesCache=n(this._queryFeaturesCache),this._queryEngine=n(this._queryEngine),this._codedDomainPopulationAbortController=a(this._codedDomainPopulationAbortController),this._codedDomainPopulationPromise=null}_initRenderer(){this._renderer=new oe({createGraphic:(e,t,i)=>this._createGraphic(e,t,i)}),this._renderer.layerViewUid=this.uid,this._updatingHandles.add(()=>this._clippingBox,e=>this._renderer.clippingBox=e,g),this._updatingHandles.add(()=>this.suspended,e=>this._setPointsVisible(!e),g),this._updatingHandles.add(()=>this.pointScale,e=>this._renderer.scaleFactor=e,g),this._renderer.minSizePx=Math.sqrt(2),this._updatingHandles.add(()=>this.useRealWorldSymbolSizes,e=>this._renderer.useRealWorldSymbolSizes=e,g),this._updatingHandles.add(()=>this.pointSize,e=>{const t=w(e);this._renderer.size=e,this._renderer.sizePx=t},g),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._renderer.slicePlaneEnabled=e,g),this._updatingHandles.add(()=>this.inverseDensity,()=>this._setUpdateViewNeeded(),g),this._updatingHandles.add(()=>this.maximumPointCount,()=>this._setUpdateViewNeeded(),g),this._updatingHandles.add(()=>this.view.qualitySettings.sceneService.pointCloud.lodFactor,e=>{this._lodFactor=e,this._setUpdateViewNeeded()},g)}_destroyRenderer(){this._renderer.removeAll(),this._setPointsVisible(!1)}_createGraphic(e,t,i,r){const s=null!=e.pointIdFilterMap?e.pointIdFilterMap[t]:t,o=i?"declaredClass"in i?i:Pe(this.view,i):null;return r??=this._createGraphicAttributes(e,s),new se({pointCloudMetadata:{nodeId:e.id,pointIndexInNode:t,attributePointIndexInNode:s,epoch:this._nodeLoadEpoch},geometry:o,attributes:r,layer:this.layer,sourceLayer:this.layer,origin:this._graphicOrigin})}_createGraphicAttributes(e,t){const i={};for(const r of e.attributes)this._encodeGraphicAttribute(r.attributeInfo,r.values,t,i);return i}_getGraphicAttribute(e,t,i){const r=e.storageInfo?.attributeValues,s=r?.valuesPerElement??1;if(1===s)return t[i];if("UInt8"===r?.valueType&&s<=4){let e=0;const r=i*s;for(let i=r;i<r+s;i++)e=(e<<8)+t[i];return e}}_encodeGraphicAttribute(e,t,i,r){r[e.name]=this._getGraphicAttribute(e,t,i)}_setPointsVisible(e){e&&!this._rendererAdded?(this.view.stage.addRenderPlugin(this._renderer),this._rendererAdded=!0):!e&&this._rendererAdded&&(this.view.stage.removeRenderPlugin(this._renderer),this._rendererAdded=!1)}_rendererChanged(){this._renderer.useFixedSizes=pe(this.layer.renderer),this._reload()}_reload(){this._clearNodeState(),this._memCache.clear(),this._setUpdateViewNeeded()}_elevationOffsetChanged(){this._clearNodeState(),this._memCache.clear(),this._initNodePages()}_displayNodes(e){this._workQueue=ee([...this._renderedNodes],e,this._index),te(this._workQueue,this.view.state.contentCamera.viewForward,this._index),ie(this._workQueue,je,this._index),this._updateQueues(),this._totalWork=this._computeWork(),this._updateLoading(),this._layerIsVisible=e.length>0||this._loadingInitNodePage,this.notifyChange("suspended")}cancelLoading(){this._cancelNodeLoading(),this._cancelIndexLoading()}_cancelNodeLoading(){const e=new Array;this._loadingNodes.forEach(({abortController:t})=>e.push(t)),this._loadingNodes.clear();for(const t of e)t.abort();this._workQueue=[],this._idleQueue.cancelAll(),this._totalWork=this._computeWork(),this._updateLoading()}_updateQueues(){const e=new Set;this._workQueue.forEach(t=>t.load.forEach(t=>e.add(t)));const t=new Array,i=new Map;this._loadingNodes.forEach((r,s)=>{e.has(s)?i.set(s,r):t.push(r)}),this._loadingNodes=i;for(const{abortController:r}of t)r.abort();this._workQueue=this._workQueue.filter(e=>{for(const t of e.load)if(this._loadingNodes.has(t))return this._recalcWork=!0,!1;return!0}),this._totalWork=this._computeWork(),this._updateLoading()}_cancelIndexLoading(){this._indexQueue=[],this._indexPagesLoading.forEach(({abortController:e})=>e.abort()),this._indexPagesLoading.clear(),this._totalWork=this._computeWork(),this._updateLoading()}_clearNodeState(){this._nodeLoadEpoch++,this._renderedNodes.forEach(e=>this._removeFromRenderer(e)),this._cancelNodeLoading()}get readyToRun(){return this.suspended?this._updateViewNeeded:this._updateViewNeeded||this._indexQueue.length>0||this._workQueue.length>0||this._idleQueue.readyToRun}runTask(e){if(this.suspended){if(this._updateViewNeeded){this._updateViewNeeded=!1;const e=this._isRootNodeVisible();e!==this._layerIsVisible&&(this._layerIsVisible=e,this.notifyChange("suspended")),this._updateLoading()}}else{for(e.run(()=>this._updateWorkQueues());this._indexQueue.length>0&&e.run(()=>this._processIndexQueue()););this._processWorkQueue(e),this._idleQueue.runTask(e)}}_processIndexQueue(){const e=this._indexQueue.shift(),t=this._loadNodePage(e);return this._indexPagesLoading.set(e,t),t.promise.then(t=>{this._index.addPage(e,t,this._elevationOffset),this._setUpdateViewNeeded()}).then(()=>{this._indexPagesLoading.delete(e)},()=>{this._indexPagesLoading.delete(e)}),!0}_processWorkQueue(e){for(;!e.done;){const t=this._scheduleWorkEntry();if(null==t)return void e.madeProgress();this._processWorkEntry(t),e.madeProgress()}}_scheduleWorkEntry(){let e=this._workQueue.length;for(;e--;){const e=this._workQueue.shift();if(!e.remove.find(e=>!this._renderedNodes.has(e)))return e;this._workQueue.push(e)}return null}_processWorkEntry(e){if(0!==e.load.length)Promise.all(e.load.map(e=>{const t=new AbortController,i=this._memCache.pop(e.toString());return null!=i?this._loadingNodes.set(e,{abortController:t,promise:Promise.resolve(i)}):this._loadingNodes.has(e)||this._loadingNodes.set(e,{abortController:t,promise:this._loadNode(e,t.signal)}),this._loadingNodes.get(e).promise})).then(t=>{for(let i=0;i<e.load.length;i++)if(t[i]){const r=this._setupRendererData(e.load[i],t[i]);this._addToRenderer(r)}for(const i of e.remove)this._removeFromRenderer(i)}).catch(()=>{}).then(()=>{for(const t of e.load)this._loadingNodes.delete(t);this._updateLoading(),this._recalcWork&&!this._idleQueue.updating&&0===this._indexQueue.length&&0===this._loadingNodes.size&&(this._recalcWork=!1,this._setUpdateViewNeeded())}),this._updateLoading();else for(const t of e.remove)this._removeFromRenderer(t)}async _populateClassCodeCodedDomain(e,t){const i="CLASS_CODE",s=this.layer.fieldsIndex.get(i);if(!s||s.domain)return;if(!e.includes(s.name))return;const o=await r(this.layer.queryCachedStatistics(i,{signal:t}));if(!1===o.ok)return;const n=o.value?.stats?.labels?.labels;n&&Array.isArray(n)&&(s.domain=new W({name:"CLASS_CODE",codedValues:n.map(e=>new M({code:e.value,name:e.label}))}))}async prepareFetchPopupFeatures(e){return this._codedDomainPopulationPromise||(this._codedDomainPopulationAbortController=new AbortController,this._codedDomainPopulationPromise=this._populateClassCodeCodedDomain(e,this._codedDomainPopulationAbortController.signal).then(()=>{this._codedDomainPopulationAbortController=null})),this._codedDomainPopulationPromise}async whenGraphicAttributes(e,t){const r=this._splitGraphicsPerNode(e),o=this.layer.attributeStorageInfo,n=t.map(e=>ce(o,e)).filter(i),a=async(e,t)=>{const i=this._index.getNode(t);await s(n,async t=>{const r=t.useElevation?await this._loadElevationAttributeFromGeometry(i.resourceId):await this._loadAndParseAttribute(i,t);if(r)for(const i of e)if(this._isValidPointGraphic(i)){const e=i.pointCloudMetadata.attributePointIndexInNode;this._encodeGraphicAttribute(t,r,e,i.attributes)}})},d=[];return r.forEach((e,t)=>{d.push(a(e,t))}),await Promise.allSettled(d),e}_isValidPointGraphic(e){return e instanceof se&&e.pointCloudMetadata?.epoch===this._nodeLoadEpoch}_splitGraphicsPerNode(e){const t=new Map;for(const i of e){if(!this._isValidPointGraphic(i))continue;const e=i.pointCloudMetadata,r=t.get(e.nodeId);r?r.push(i):t.set(e.nodeId,[i])}return t}async _loadAndParseAttribute(e,t){const i=await this._loadAttribute(e.resourceId,t,null);return i?_e({attributeInfo:t,buffer:i},null,e.vertexCount):null}async _loadElevationAttributeFromGeometry(e){const t=this.layer.store.defaultGeometrySchema,i=me(t,await this._loadGeometry(e,null));return ge(i,i.length/3)}highlight(e,i){const r=fe(e);if(0===r.length)return ye;if(!(r[0]instanceof t))return ye;const s=r;return this._renderer.highlight(s.map(e=>this._graphicToPointDefinition(e)),Se(i))}_graphicToPointDefinition(e){if(!this._isValidPointGraphic(e))return null;const{nodeId:t,pointIndexInNode:i}=e.pointCloudMetadata;return null!=t&&null!=i?{nodeId:t,pointId:i}:null}_computeWork(){let e=0;for(const t of this._workQueue)e+=t.load.length+t.remove.length;return e+=this._loadingNodes.size,e+=(this._indexQueue.length+this._indexPagesLoading.size)*this._index.pageSize,e+=this._loadingInitNodePage?100:0,e+=this._updateViewNeeded?100:0,e}get updatingProgressValue(){if(this.suspended)return this._updateViewNeeded?0:1;const e=this._computeWork();return 1-Math.min(this._totalWork,e)/this._totalWork}_updateLoading(){this.notifyChange("updating"),this.notifyChange("updatingProgressValue")}canResume(){return super.canResume()&&this._layerIsVisible}isUpdating(){return this.suspended?this._updateViewNeeded:this._computeWork()>0}get visibleAtCurrentScale(){return Ie(this.layer.effectiveScaleRange,this.view.scale)}async queryFeatures(e,i){const r=await this._ensureQueryEngine().executeQuery(this._ensureQueryJSON(e),i?.signal),s=r.features;r.features=[];const o=z.fromJSON(r),n=this.view.spatialReference;return o.features=s.map(e=>{const{attributes:i,metadata:r}=e;if(!r){const i=t.fromJSON(e);return i.geometry&&(i.geometry.spatialReference=o.spatialReference??n),i.layer=this.layer,i.sourceLayer=this.layer,i.origin=this._graphicOrigin,i}const s=e.geometry?k.fromJSON(e.geometry):void 0;return s&&(s.spatialReference=o.spatialReference??n),this._createGraphic(r.node,r.pointId,s,i)}),o}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference,returnZ:!0};return new H(e)}async queryFeatureCount(e,t){return await this._ensureQueryEngine().executeQueryForCount(this._ensureQueryJSON(e),t?.signal)}async queryExtent(e,t){const{count:i,extent:r}=await this._ensureQueryEngine().executeQueryForExtent(this._ensureQueryJSON(e),t?.signal);return{count:i,extent:j.fromJSON(r)}}_ensureQueryJSON(e){return null==e?new H({outSpatialReference:this.view.spatialReference}).toJSON():H.from(e).toJSON()}_ensureQueryEngine(){if(this._queryEngine)return this._queryEngine;const{spatialReference:e}=this.view;return this._queryEngine=new q({fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:"esriGeometryPoint",spatialReference:e,featureIdInfo:{type:"object-id",fieldName:"objectId"},hasZ:!0,featureStore:new Z({sourceSpatialReference:e,viewSpatialReference:e,forAllFeatures:(e,t)=>{let i=!1;this._renderer.forEachNode(r=>{if(i)return;if(t){const e=r.obb,s=O(e.center[0],e.center[1],e.center[2],x(e.halfSize));V(s,this.view.renderSpatialReference,s,this.view.spatialReference);const o=t(s);if(2===o)return;if(i=0===o,i)return}let s=this._queryFeaturesCache.get(`${r.id}`);s||(s=this._createQueryPointFeatures(r),this._queryFeaturesCache.put(`${r.id}`,s)),s.features.forEach(e)})},getFeatureExtent:({point:e},t)=>L(e,e,t),featureAdapter:{cloneWithGeometry:(e,t)=>new Fe(e.node,e.pointId,t.coords),getAttribute:({node:e,attributePointId:t},i)=>{for(const r of e.attributes)if(r.attributeInfo.name===i)return this._getGraphicAttribute(r.attributeInfo,r.values,t)},getAttributes:({node:e,attributePointId:t})=>this._createGraphicAttributes(e,t),getCentroid:e=>e.getGeometry(),getGeometry:e=>e.getGeometry(),getObjectId:()=>{},getMetadata:e=>e}})}),this._queryEngine}_createQueryPointFeatures(e){const t=e.coordinates,i=new Array;for(let r=0;r<t.length/3;r++){const s=3*r,o=R(t[s+0],t[s+1],t[s+2]);C(o,o,e.origin),Q(o,this.view.renderSpatialReference,o,this.view.spatialReference);const n=new Fe(e,r,o);i.push(n)}return new Le(i)}_initNodePages(){const e=this.layer.store.index,t=e.nodesPerPage||e.nodePerIndexBlock;return this._index=new re(this.layer.spatialReference,this.view.renderCoordsHelper.spatialReference,t),this._cancelIndexLoading(),this._traverseVisible=this._index.createVisibilityTraverse(),this._loadingInitNodePage=!0,this._layerIsVisible=!0,this.notifyChange("suspended"),this._updateLoading(),this._pageMultiplier=null!=e.nodesPerPage?1:e.nodePerIndexBlock,this._loadNodePage(0).promise.then(e=>{this._index.addPage(0,e,this._elevationOffset),this._loadingInitNodePage=!1,this._setUpdateViewNeeded()})}_loadNodePage(e){const t=new AbortController,i=`${this.baseUrl}/nodepages/${e*this._pageMultiplier}`;return{promise:this._requestNodePage(i,t.signal).then(t=>t.nodes.map((t,i)=>({resourceId:null!=t.resourceId?t.resourceId:e*this._index.pageSize+i,obb:Ne.fromJSON(t.obb),obbInRenderSR:new Ne,firstChild:t.firstChild,childCount:t.childCount,vertexCount:t.vertexCount??t.pointCount,lodThreshold:t.lodThreshold??t.effectiveArea}))),abortController:t}}_updateWorkQueues(){if(!this._updateViewNeeded)return!1;const e=this.view.quality;let t=this.inverseDensity/this._lodFactor*e;const i=this.maximumPointCount*this._lodFactor*e;let r=this._computeNodesForMinimumDensity(t),s=this._computePointCount(r),o=Math.sqrt(s/(.75*i));for(;s>i;)t*=o,r=this._computeNodesForMinimumDensity(t),s=this._computePointCount(r),o=Math.sqrt(2);return this._displayNodes(r),this._updateViewNeeded=!1,this._updateLoading(),!0}_computePointCount(e){let t=0;for(let i=0;i<e.length;i++){const r=this._index.getNode(e[i]);r&&(t+=r.vertexCount)}return t}_isRootNodeVisible(){let e=!1;return this._traverseVisible({frustum:this.view.state.contentCamera.frustum,clippingBox:this._clippingBox},{predicate:(t,i,r)=>(e=r,!1),pageMiss:()=>{}}),e}_computeNodesForMinimumDensity(e){const t=this.view.state.contentCamera,i=t.frustum,r=this._clippingBox,s=t.viewForward,o=S(s,t.eye),n=D(s,-o,ke),a=t.perScreenPixelRatio/2,d=e*e,l=this._nodeIdArray;l.length=0;const u=e=>l.push(e);return this._traverseVisible({frustum:i,clippingBox:r},{predicate:(e,t,i)=>{if(!i)return!1;if(0===t.childCount)return u(e),!1;const r=this._index.getRenderObb(e);return!(this._computeAveragePixelArea(r,t.lodThreshold,t.vertexCount,n,a)<=d)||(u(e),!1)},pageMiss:(e,t)=>{u(e),this._indexQueue.includes(t)||this._indexQueue.push(t)}}),l}_computeAveragePixelArea(e,t,i,r,s){const o=1e-7,n=Math.max(o,e.minimumDistancePlane(r));return t/(n*n)/(4*s*s)/i}_loadNode(e,t){try{return this._loadNodeAsync(e,t)}catch(i){throw c(i)||o.getLogger(this).error(i),i}}async _loadAdditionalUserAttributes(e,t,r){const s=this.layer.outFields;if(!s)return[];const o=G(this.layer.fieldsIndex,s),n=new Set(e.map(e=>null!=e?e.name:null)),a=this.layer.attributeStorageInfo,d=[];for(const i of o){if(n.has(i))continue;const e=ce(a,i);e&&d.push(t(e))}const l=await _(d);return m(r),l.filter(i)}async _loadNodeAsync(e,t){const i=this._index.getNode(e),r=ue(this.layer),s=he(this.layer),o=i.resourceId,n=async e=>{if(!e)return null;if(e.useElevation)return{attributeInfo:e,buffer:null};const i=await this._loadAttribute(o,e,t);return null!=i?{attributeInfo:e,buffer:i}:null};return this._idleQueue.push(async()=>{const i=this._loadGeometry(o,t),{primaryAttribute:a,modulationAttribute:d}=r,l=n(a),u=n(d),h=s.map(e=>e.attributeInfo),p=h.map(e=>n(e)),c=this._loadAdditionalUserAttributes([a,d,...h],n,t),[_,g,f,y,b]=await Promise.all([i,l,u,Promise.all(p),c]);m(t);const w={geometryBuffer:_,primaryAttributeData:g,modulationAttributeData:f,filterAttributesData:y,userAttributesData:b,schema:this.layer.store.defaultGeometrySchema,rendererInfo:r,filterInfo:s,obbData:this._index.getRenderObb(e).data,elevationOffset:this._elevationOffset,inSR:this.layer.spatialReference.toJSON(),outSR:this.view.renderCoordsHelper.spatialReference.toJSON()};return this._worker.invoke(w,t)},t)}async _loadGeometry(e,t){return this._requestData(`${this.baseUrl}/nodes/${e}/geometries/0`,t)}async _loadAttribute(e,t,i){if(!t?.storageInfo)return null;const r=t.storageInfo.key;return this._requestData(`${this.baseUrl}/nodes/${e}/attributes/${r}`,i)}_requestNodePage(e,t){const i={f:"json",...this.layer.customParameters,token:this.layer.apiKey};return this._indexRequester.request(e,0,{query:i,signal:t})}_requestData(e,t){return this._dataRequester.request(e,1,{query:{...this.layer.customParameters,token:this.layer.apiKey},signal:t})}_removeFromRenderer(e){if(this._renderedNodes.has(e)){const t=this._renderer.removeNode(e);this._renderedNodes.delete(e),this._memCache.put(t.id.toString(),t)}}_addToRenderer(e){this._renderedNodes.has(e.id)||(this._renderedNodes.add(e.id),this._renderer.addNode(e))}_setupRendererData(e,t){const i=this._index.getNode(e),r=Math.sqrt(i.lodThreshold/i.vertexCount),s=this._index.getRenderObb(e);if(ne(t))return t.splatSize=r,t.obb=s,I(t.origin,t.obb.center),t;const n=Ne.fromData(t.obbData),a=n.halfSize,d=s.halfSize,l=.01*Math.max(d[0],d[1],d[2]);if(a[0]>d[0]+l||a[1]>d[1]+l||a[2]>d[2]+l){if(this._maxLoggedBoxWarnings>0){const t=e=>`[${e.halfSize[0]}, ${e.halfSize[1]}, ${e.halfSize[2]}]`;o.getLogger(this).warn(`Node ${e} reported bounding box too small. got ${t(s)} but points cover ${t(n)}`),0===--this._maxLoggedBoxWarnings&&o.getLogger(this).warn(" Too many bounding box errors, stopping reporting for this layer.")}this._index.setRenderObb(e,n)}return new ae(e,r,A(s.center),s,0===i.childCount,t.points,t.rgb,t.attributes,t.pointIdFilterMap)}get usedMemory(){let e=0;return this._renderer.forEachNode(t=>{e+=De,e+=d(t.coordinates);for(const i of t.attributes){const t=i.values;P(t.buffer)&&(e+=d(t))}}),e}get unloadedMemory(){const e=this._renderedNodes.size;if(e<4)return 0;const t=[...this._renderedNodes].reduce((e,t)=>e+this._index.getNode(t).vertexCount);let i=this._loadingNodes.size;for(let r=0;r<this._workQueue.length;r++)i+=this._workQueue[r].load.length,i-=this._workQueue[r].remove.length;if(i<0)return 0;return i*t/e*((this.usedMemory-e*De)/t)+i*De}get performanceInfo(){return new $(this.usedMemory,this._renderedNodes.size,[...this._renderedNodes].reduce((e,t)=>e+this._index.getNode(t).vertexCount,0),this.maximumPointCount,new J(this._loadingNodes.size,this._indexQueue.length,this._workQueue.length,this._idleQueue.length))}get test(){}};e([N()],Ve.prototype,"layer",void 0),e([N()],Ve.prototype,"baseUrl",null),e([N()],Ve.prototype,"pointScale",null),e([N()],Ve.prototype,"useRealWorldSymbolSizes",null),e([N()],Ve.prototype,"pointSize",null),e([N()],Ve.prototype,"inverseDensity",null),e([N()],Ve.prototype,"maximumPointCount",void 0),e([N({readOnly:!0})],Ve.prototype,"availableFields",null),e([N({readOnly:!0})],Ve.prototype,"_clippingBox",null),e([N({readOnly:!0})],Ve.prototype,"_elevationOffset",null),e([N({type:Boolean})],Ve.prototype,"slicePlaneEnabled",void 0),e([N()],Ve.prototype,"_graphicOrigin",null),e([N()],Ve.prototype,"updating",void 0),e([N(ve)],Ve.prototype,"updatingProgress",void 0),e([N({readOnly:!0})],Ve.prototype,"updatingProgressValue",null),e([N({readOnly:!0})],Ve.prototype,"visibleAtCurrentScale",null),Ve=e([v("esri.views.3d.layers.PointCloudLayerView3D")],Ve);const Qe=Ve;class Fe{constructor(e,t,i){this.node=e,this.pointId=t,this.point=i}getGeometry(){return new U([],Array.from(this.point),!0,!1)}get attributePointId(){const{node:e,pointId:t}=this;return null!=e.pointIdFilterMap?e.pointIdFilterMap[t]:t}get usedMemory(){return l+l+u+h(this.point,u)}}class Le{constructor(e){this.features=e}get usedMemory(){return this.features.reduce((e,t)=>e+t.usedMemory,l+p)}}const De=160;function Ee(e){return t=>e.immediate.schedule(t)}export{Qe as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import i from"../../../request.js";import{queueAutoPriority as r}from"../../../requestQueue.js";import{isSome as s}from"../../../core/arrayUtils.js";import{result as o,forEach as n}from"../../../core/asyncUtils.js";import"../../../core/has.js";import a from"../../../core/Logger.js";import{destroyMaybe as d,abortMaybe as l}from"../../../core/maybe.js";import{estimateNumberArrayMemory as u,baseObjectMemory as h,estimateNumberMemory as p,estimateFixedArrayMemory as c,baseArrayMemory as _}from"../../../core/memoryEstimations.js";import{isAbortError as m,allSettledValues as g,throwIfAborted as f}from"../../../core/promiseUtils.js";import{initial as y,watch as b,sync as w,syncAndInitial as P}from"../../../core/reactiveUtils.js";import{pt2px as N}from"../../../core/screenUtils.js";import{isArrayBuffer as v}from"../../../core/typedArrayUtil.js";import{property as x}from"../../../core/accessorSupport/decorators/property.js";import{subclass as C}from"../../../core/accessorSupport/decorators/subclass.js";import{b as S,g as I,f as A,d as j}from"../../../chunks/vec32.js";import{clone as R}from"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{fromValues as k}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import V from"../../../geometry/Extent.js";import Q from"../../../geometry/Point.js";import{projectBoundingSphere as F}from"../../../geometry/projection/projectBoundingSphere.js";import{projectVectorToVector as L}from"../../../geometry/projection/projectVectorToVector.js";import{create as E,fromMinMax as D}from"../../../geometry/support/aaBoundingBox.js";import{fromNormalAndOffset as O,create as U}from"../../../geometry/support/plane.js";import{f as M}from"../../../chunks/sphere.js";import W from"../../../layers/graphics/OptimizedGeometry.js";import{QueryEngine as G}from"../../../layers/graphics/data/QueryEngine.js";import{CodedValue as z}from"../../../layers/support/CodedValue.js";import q from"../../../layers/support/CodedValueDomain.js";import"../../../layers/support/Domain.js";import"../../../layers/support/InheritedDomain.js";import"../../../layers/support/RangeDomain.js";import{unpackFieldNames as H}from"../../../layers/support/fieldUtils.js";import T from"../../../rest/support/FeatureSet.js";import B from"../../../rest/support/Query.js";import{getElevationOffset as $}from"../../../support/elevationInfoUtils.js";import{LayerView3D as J}from"./LayerView3D.js";import{PointCloudLayerViewPerformanceInfo as K,QueuePerformanceInfo as Z}from"./PointCloudLayerViewPerformanceInfo.js";import{PointCloudWorkerHandle as Y}from"./PointCloudWorkerHandle.js";import{I3SQueryFeatureStore as X}from"./i3s/I3SQueryFeatureStore.js";import{checkPointCloudLayerValid as ee,checkPointCloudLayerCompatibleWithView as te}from"./i3s/I3SUtil.js";import{nodeDiff as ie,sortFrontToBack as re,splitWorkEntries as se}from"./i3s/LoDUtil.js";import{PagedNodeIndex as oe}from"./i3s/PagedNodeIndex.js";import{PointCloudGraphic as ne}from"./i3s/PointCloudGraphic.js";import{PointCloudRenderer as ae}from"./i3s/PointCloudRenderer.js";import{isPointRendererNode as de,PointCloudRendererNode as le}from"./i3s/PointCloudRendererNode.js";import{getSplatSizeAlgorithm as ue,getFixedSizeAlgorithm as he,getRendererInfo as pe,getFilterInfo as ce,rendererUsesFixedSizes as _e,getAttributeInfo as me}from"./i3s/PointCloudRendererUtil.js";import{getAttributeValues as ge,readGeometry as fe,elevationFromPositions as ye}from"./i3s/PointCloudWorkerUtil.js";import{normalizeHighlightTarget as be,emptyHighlightHandle as we}from"./support/highlightUtils.js";import{PopupSceneLayerView as Pe}from"./support/PopupSceneLayerView.js";import{projectToBoundingBox as Ne}from"../support/extentUtils.js";import{computeMapPointFromVec3d as ve}from"../support/hitTest.js";import{Obb as xe}from"../support/orientedBoundingBox.js";import{updatingProgress as Ce}from"../support/updatingProperties.js";import Se from"../../layers/LayerView.js";import{PointCloudLayerView as Ie}from"../../layers/PointCloudLayerView.js";import{getHighlightName as Ae}from"../../support/highlightOptionsUtils.js";import{isInEffectiveScaleRange as je}from"../../support/layerViewUtils.js";import{PromiseQueue as Re}from"../../support/PromiseQueue.js";import{TaskPriority as ke}from"../../support/Scheduler.js";const Ve=8,Qe=U();let Fe=class extends(Ie(Pe(J(Se)))){constructor(){super(...arguments),this.type="point-cloud-3d",this.maximumPointCount=4e6,this.slicePlaneEnabled=!1,this._renderer=null,this._rendererAdded=!1,this._renderedNodes=new Set,this._updateViewNeeded=!0,this._lodFactor=1,this._maxLoggedBoxWarnings=5,this._pageMultiplier=1,this._nodeLoadEpoch=0,this._indexQueue=[],this._workQueue=new Array,this._idleQueue=new Re,this._indexPagesLoading=new Map,this._loadingNodes=new Map,this._recalcWork=!0,this._layerIsVisible=!1,this._codedDomainPopulationPromise=null,this._codedDomainPopulationAbortController=null,this._totalWork=0,this._index=null,this._loadingInitNodePage=!1,this._nodeIdArray=[],this.ignoresMemoryFactor=!1}get baseUrl(){return this.layer.parsedUrl?.path??""}get pointScale(){const e=ue(this.layer?.renderer),t=1;return null!=e?.scaleFactor?e.scaleFactor:t}get useRealWorldSymbolSizes(){const e=he(this.layer?.renderer),t=!1;return null!=e?.useRealWorldSymbolSizes?e.useRealWorldSymbolSizes:t}get pointSize(){const e=he(this.layer?.renderer),t=0;return null!=e?.size?e.size:t}get inverseDensity(){const e=96;return this.layer?.renderer?1*e/this.layer.renderer.pointsPerInch:5}get availableFields(){const e=pe(this.layer),t=new Set;e.primaryAttribute&&t.add(e.primaryAttribute.name),e.modulationAttribute&&t.add(e.modulationAttribute.name);const i=ce(this.layer);if(i)for(const r of i)r.attributeInfo&&t.add(r.attributeInfo.name);if(this.layer.outFields)for(const r of H(this.layer.fieldsIndex,this.layer.outFields))t.add(r);return Array.from(t)}get _clippingBox(){if(!this.view||!this.view.clippingArea)return null;const e=E(),t=this.view.renderSpatialReference;return Ne(this.view.clippingArea,e,t)?e:null}get _elevationOffset(){const e=this.layer&&this.layer.elevationInfo;return e&&"absolute-height"===e.mode?$(e,this.layer.spatialReference):0}get _graphicOrigin(){return this.layer.graphicOrigin}initialize(){const e=this.view.resourceController,t=Ue(e);this._worker=new Y(t),this.addResolvingPromise(this._worker.promise),ee(this.layer),te(this.layer,this.view),this._initRenderer();const i=this._initNodePages(),r=this.view.resourceController.memoryController;this._memCache=r.newCache(`pcl-${this.layer.uid}`),this._queryFeaturesCache=r.newCache(`pcl-query-features-${this.layer.uid};`),this._updatingHandles.add(()=>this._clippingBox,()=>this._setUpdateViewNeeded(),y),this._updatingHandles.add(()=>this._elevationOffset,()=>this._elevationOffsetChanged(),y),this._updatingHandles.add(()=>this.layer.renderer,()=>this._rendererChanged(),y),this._updatingHandles.add(()=>this.layer.filters,()=>this._reload(),y),this._updatingHandles.add(()=>this.layer.outFields,()=>this._reload(),y),this._updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this._setUpdateViewNeeded()),this._updatingHandles.add(()=>this.view.state.contentCamera,()=>this._setUpdateViewNeeded()),this.addHandles([b(()=>this.view.quality,()=>this._setUpdateViewNeeded(),w)]),this.addResolvingPromise(i),this.when(()=>{this.addHandles([e.scheduler.registerTask(ke.POINT_CLOUD_LAYER,this),b(()=>2===this.view.state.mode,()=>this._setUpdateViewNeeded(),P),this._updatingHandles.add(()=>this.suspended,e=>{e?this._clearNodeState():this._setUpdateViewNeeded()},y)])},()=>{this._updatingHandles.removeAll(),this.removeAllHandles()})}_setUpdateViewNeeded(){this._updateViewNeeded=!0,this._updateLoading()}destroy(){this.cancelLoading(),this._worker=d(this._worker),this._destroyRenderer(),this._memCache=d(this._memCache),this._queryFeaturesCache=d(this._queryFeaturesCache),this._queryEngine=d(this._queryEngine),this._codedDomainPopulationAbortController=l(this._codedDomainPopulationAbortController),this._codedDomainPopulationPromise=null}_initRenderer(){this._renderer=new ae({createGraphic:(e,t,i)=>this._createGraphic(e,t,i)}),this._renderer.layerViewUid=this.uid,this._updatingHandles.add(()=>this._clippingBox,e=>this._renderer.clippingBox=e,y),this._updatingHandles.add(()=>this.suspended,e=>this._setPointsVisible(!e),y),this._updatingHandles.add(()=>this.pointScale,e=>this._renderer.scaleFactor=e,y),this._renderer.minSizePx=Math.sqrt(2),this._updatingHandles.add(()=>this.useRealWorldSymbolSizes,e=>this._renderer.useRealWorldSymbolSizes=e,y),this._updatingHandles.add(()=>this.pointSize,e=>{const t=N(e);this._renderer.size=e,this._renderer.sizePx=t},y),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._renderer.slicePlaneEnabled=e,y),this._updatingHandles.add(()=>this.inverseDensity,()=>this._setUpdateViewNeeded(),y),this._updatingHandles.add(()=>this.maximumPointCount,()=>this._setUpdateViewNeeded(),y),this._updatingHandles.add(()=>this.view.qualitySettings.sceneService.pointCloud.lodFactor,e=>{this._lodFactor=e,this._setUpdateViewNeeded()},y)}_destroyRenderer(){this._renderer.removeAll(),this._setPointsVisible(!1)}_createGraphic(e,t,i,r){const s=null!=e.pointIdFilterMap?e.pointIdFilterMap[t]:t,o=i?"declaredClass"in i?i:ve(this.view,i):null;return r??=this._createGraphicAttributes(e,s),new ne({pointCloudMetadata:{nodeId:e.id,pointIndexInNode:t,attributePointIndexInNode:s,epoch:this._nodeLoadEpoch},geometry:o,attributes:r,layer:this.layer,sourceLayer:this.layer,origin:this._graphicOrigin})}_createGraphicAttributes(e,t){const i={};for(const r of e.attributes)this._encodeGraphicAttribute(r.attributeInfo,r.values,t,i);return i}_getGraphicAttribute(e,t,i){const r=e.storageInfo?.attributeValues,s=r?.valuesPerElement??1;if(1===s)return t[i];if("UInt8"===r?.valueType&&s<=4){let e=0;const r=i*s;for(let i=r;i<r+s;i++)e=(e<<8)+t[i];return e}}_encodeGraphicAttribute(e,t,i,r){r[e.name]=this._getGraphicAttribute(e,t,i)}_setPointsVisible(e){e&&!this._rendererAdded?(this.view.stage.addRenderPlugin(this._renderer),this._rendererAdded=!0):!e&&this._rendererAdded&&(this.view.stage.removeRenderPlugin(this._renderer),this._rendererAdded=!1)}_rendererChanged(){this._renderer.useFixedSizes=_e(this.layer.renderer),this._reload()}_reload(){this._clearNodeState(),this._memCache.clear(),this._setUpdateViewNeeded()}_elevationOffsetChanged(){this._clearNodeState(),this._memCache.clear(),this._initNodePages()}_displayNodes(e){this._workQueue=ie([...this._renderedNodes],e,this._index),re(this._workQueue,this.view.state.contentCamera.viewForward,this._index),se(this._workQueue,Ve,this._index),this._updateQueues(),this._totalWork=this._computeWork(),this._updateLoading(),this._layerIsVisible=e.length>0||this._loadingInitNodePage,this.notifyChange("suspended")}cancelLoading(){this._cancelNodeLoading(),this._cancelIndexLoading()}_cancelNodeLoading(){const e=new Array;this._loadingNodes.forEach(({abortController:t})=>e.push(t)),this._loadingNodes.clear();for(const t of e)t.abort();this._workQueue=[],this._idleQueue.cancelAll(),this._totalWork=this._computeWork(),this._updateLoading()}_updateQueues(){const e=new Set;this._workQueue.forEach(t=>t.load.forEach(t=>e.add(t)));const t=new Array,i=new Map;this._loadingNodes.forEach((r,s)=>{e.has(s)?i.set(s,r):t.push(r)}),this._loadingNodes=i;for(const{abortController:r}of t)r.abort();this._workQueue=this._workQueue.filter(e=>{for(const t of e.load)if(this._loadingNodes.has(t))return this._recalcWork=!0,!1;return!0}),this._totalWork=this._computeWork(),this._updateLoading()}_cancelIndexLoading(){this._indexQueue=[],this._indexPagesLoading.forEach(({abortController:e})=>e.abort()),this._indexPagesLoading.clear(),this._totalWork=this._computeWork(),this._updateLoading()}_clearNodeState(){this._nodeLoadEpoch++,this._renderedNodes.forEach(e=>this._removeFromRenderer(e)),this._cancelNodeLoading()}get readyToRun(){return this.suspended?this._updateViewNeeded:this._updateViewNeeded||this._indexQueue.length>0||this._workQueue.length>0||this._idleQueue.readyToRun}runTask(e){if(this.suspended){if(this._updateViewNeeded){this._updateViewNeeded=!1;const e=this._isRootNodeVisible();e!==this._layerIsVisible&&(this._layerIsVisible=e,this.notifyChange("suspended")),this._updateLoading()}}else{for(e.run(()=>this._updateWorkQueues());this._indexQueue.length>0&&e.run(()=>this._processIndexQueue()););this._processWorkQueue(e),this._idleQueue.runTask(e)}}_processIndexQueue(){const e=this._indexQueue.shift(),t=this._loadNodePage(e);return this._indexPagesLoading.set(e,t),t.promise.then(t=>{this._index.addPage(e,t,this._elevationOffset),this._setUpdateViewNeeded()}).then(()=>{this._indexPagesLoading.delete(e)},()=>{this._indexPagesLoading.delete(e)}),!0}_processWorkQueue(e){for(;!e.done;){const t=this._scheduleWorkEntry();if(null==t)return void e.madeProgress();this._processWorkEntry(t),e.madeProgress()}}_scheduleWorkEntry(){let e=this._workQueue.length;for(;e--;){const e=this._workQueue.shift();if(!e.remove.find(e=>!this._renderedNodes.has(e)))return e;this._workQueue.push(e)}return null}_processWorkEntry(e){if(0!==e.load.length)Promise.all(e.load.map(e=>{const t=new AbortController,i=this._memCache.pop(e.toString());return null!=i?this._loadingNodes.set(e,{abortController:t,promise:Promise.resolve(i)}):this._loadingNodes.has(e)||this._loadingNodes.set(e,{abortController:t,promise:this._loadNode(e,t.signal)}),this._loadingNodes.get(e).promise})).then(t=>{for(let i=0;i<e.load.length;i++)if(t[i]){const r=this._setupRendererData(e.load[i],t[i]);this._addToRenderer(r)}for(const i of e.remove)this._removeFromRenderer(i)}).catch(()=>{}).then(()=>{for(const t of e.load)this._loadingNodes.delete(t);this._updateLoading(),this._recalcWork&&!this._idleQueue.updating&&0===this._indexQueue.length&&0===this._loadingNodes.size&&(this._recalcWork=!1,this._setUpdateViewNeeded())}),this._updateLoading();else for(const t of e.remove)this._removeFromRenderer(t)}async _populateClassCodeCodedDomain(e,t){const i="CLASS_CODE",r=this.layer.fieldsIndex.get(i);if(!r||r.domain)return;if(!e.includes(r.name))return;const s=await o(this.layer.queryCachedStatistics(i,{signal:t}));if(!1===s.ok)return;const n=s.value?.stats?.labels?.labels;n&&Array.isArray(n)&&(r.domain=new q({name:"CLASS_CODE",codedValues:n.map(e=>new z({code:e.value,name:e.label}))}))}async prepareFetchPopupFeatures(e){return this._codedDomainPopulationPromise||(this._codedDomainPopulationAbortController=new AbortController,this._codedDomainPopulationPromise=this._populateClassCodeCodedDomain(e,this._codedDomainPopulationAbortController.signal).then(()=>{this._codedDomainPopulationAbortController=null})),this._codedDomainPopulationPromise}async whenGraphicAttributes(e,t){const i=this._splitGraphicsPerNode(e),r=this.layer.attributeStorageInfo,o=t.map(e=>me(r,e)).filter(s),a=async(e,t)=>{const i=this._index.getNode(t);await n(o,async t=>{const r=t.useElevation?await this._loadElevationAttributeFromGeometry(i.resourceId):await this._loadAndParseAttribute(i,t);if(r)for(const i of e)if(this._isValidPointGraphic(i)){const e=i.pointCloudMetadata.attributePointIndexInNode;this._encodeGraphicAttribute(t,r,e,i.attributes)}})},d=[];return i.forEach((e,t)=>{d.push(a(e,t))}),await Promise.allSettled(d),e}_isValidPointGraphic(e){return e instanceof ne&&e.pointCloudMetadata?.epoch===this._nodeLoadEpoch}_splitGraphicsPerNode(e){const t=new Map;for(const i of e){if(!this._isValidPointGraphic(i))continue;const e=i.pointCloudMetadata,r=t.get(e.nodeId);r?r.push(i):t.set(e.nodeId,[i])}return t}async _loadAndParseAttribute(e,t){const i=await this._loadAttribute(e.resourceId,t,null);return i?ge({attributeInfo:t,buffer:i},null,e.vertexCount):null}async _loadElevationAttributeFromGeometry(e){const t=this.layer.store.defaultGeometrySchema,i=fe(t,await this._loadGeometry(e,null));return ye(i,i.length/3)}highlight(e,i){const r=be(e);if(0===r.length)return we;if(!(r[0]instanceof t))return we;const s=r;return this._renderer.highlight(s.map(e=>this._graphicToPointDefinition(e)),Ae(i))}_graphicToPointDefinition(e){if(!this._isValidPointGraphic(e))return null;const{nodeId:t,pointIndexInNode:i}=e.pointCloudMetadata;return null!=t&&null!=i?{nodeId:t,pointId:i}:null}_computeWork(){let e=0;for(const t of this._workQueue)e+=t.load.length+t.remove.length;return e+=this._loadingNodes.size,e+=(this._indexQueue.length+this._indexPagesLoading.size)*this._index.pageSize,e+=this._loadingInitNodePage?100:0,e+=this._updateViewNeeded?100:0,e}get updatingProgressValue(){if(this.suspended)return this._updateViewNeeded?0:1;const e=this._computeWork();return 1-Math.min(this._totalWork,e)/this._totalWork}_updateLoading(){this.notifyChange("updating"),this.notifyChange("updatingProgressValue")}canResume(){return super.canResume()&&this._layerIsVisible}isUpdating(){return this.suspended?this._updateViewNeeded:this._computeWork()>0}get visibleAtCurrentScale(){return je(this.layer.effectiveScaleRange,this.view.scale)}async queryFeatures(e,i){const r=await this._ensureQueryEngine().executeQuery(this._ensureQueryJSON(e),i?.signal),s=r.features;r.features=[];const o=T.fromJSON(r),n=this.view.spatialReference;return o.features=s.map(e=>{const{attributes:i,metadata:r}=e;if(!r){const i=t.fromJSON(e);return i.geometry&&(i.geometry.spatialReference=o.spatialReference??n),i.layer=this.layer,i.sourceLayer=this.layer,i.origin=this._graphicOrigin,i}const s=e.geometry?Q.fromJSON(e.geometry):void 0;return s&&(s.spatialReference=o.spatialReference??n),this._createGraphic(r.node,r.pointId,s,i)}),o}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference,returnZ:!0};return new B(e)}async queryFeatureCount(e,t){return await this._ensureQueryEngine().executeQueryForCount(this._ensureQueryJSON(e),t?.signal)}async queryExtent(e,t){const{count:i,extent:r}=await this._ensureQueryEngine().executeQueryForExtent(this._ensureQueryJSON(e),t?.signal);return{count:i,extent:V.fromJSON(r)}}_ensureQueryJSON(e){return null==e?new B({outSpatialReference:this.view.spatialReference}).toJSON():B.from(e).toJSON()}_ensureQueryEngine(){if(this._queryEngine)return this._queryEngine;const{spatialReference:e}=this.view;return this._queryEngine=new G({fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:"esriGeometryPoint",spatialReference:e,featureIdInfo:{type:"object-id",fieldName:"objectId"},hasZ:!0,featureStore:new X({sourceSpatialReference:e,viewSpatialReference:e,forAllFeatures:(e,t)=>{let i=!1;this._renderer.forEachNode(r=>{if(i)return;if(t){const e=r.obb,s=M(e.center[0],e.center[1],e.center[2],S(e.halfSize));F(s,this.view.renderSpatialReference,s,this.view.spatialReference);const o=t(s);if(2===o)return;if(i=0===o,i)return}let s=this._queryFeaturesCache.get(`${r.id}`);s||(s=this._createQueryPointFeatures(r),this._queryFeaturesCache.put(`${r.id}`,s)),s.features.forEach(e)})},getFeatureExtent:({point:e},t)=>D(e,e,t),featureAdapter:{cloneWithGeometry:(e,t)=>new Ee(e.node,e.pointId,t.coords),getAttribute:({node:e,attributePointId:t},i)=>{for(const r of e.attributes)if(r.attributeInfo.name===i)return this._getGraphicAttribute(r.attributeInfo,r.values,t)},getAttributes:({node:e,attributePointId:t})=>this._createGraphicAttributes(e,t),getCentroid:e=>e.getGeometry(),getGeometry:e=>e.getGeometry(),getObjectId:()=>{},getMetadata:e=>e}})}),this._queryEngine}_createQueryPointFeatures(e){const t=e.coordinates,i=new Array;for(let r=0;r<t.length/3;r++){const s=3*r,o=k(t[s+0],t[s+1],t[s+2]);I(o,o,e.origin),L(o,this.view.renderSpatialReference,o,this.view.spatialReference);const n=new Ee(e,r,o);i.push(n)}return new De(i)}_initNodePages(){const e=this.layer.store.index,t=e.nodesPerPage||e.nodePerIndexBlock;return this._index=new oe(this.layer.spatialReference,this.view.renderCoordsHelper.spatialReference,t),this._cancelIndexLoading(),this._traverseVisible=this._index.createVisibilityTraverse(),this._loadingInitNodePage=!0,this._layerIsVisible=!0,this.notifyChange("suspended"),this._updateLoading(),this._pageMultiplier=null!=e.nodesPerPage?1:e.nodePerIndexBlock,this._loadNodePage(0).promise.then(e=>{this._index.addPage(0,e,this._elevationOffset),this._loadingInitNodePage=!1,this._setUpdateViewNeeded()})}_loadNodePage(e){const t=new AbortController,i=`${this.baseUrl}/nodepages/${e*this._pageMultiplier}`;return{promise:this._requestNodePage(i,t.signal).then(t=>t.nodes.map((t,i)=>({resourceId:null!=t.resourceId?t.resourceId:e*this._index.pageSize+i,obb:xe.fromJSON(t.obb),obbInRenderSR:new xe,firstChild:t.firstChild,childCount:t.childCount,vertexCount:t.vertexCount??t.pointCount,lodThreshold:t.lodThreshold??t.effectiveArea}))),abortController:t}}_updateWorkQueues(){if(!this._updateViewNeeded)return!1;const e=this.view.quality;let t=this.inverseDensity/this._lodFactor*e;const i=this.maximumPointCount*this._lodFactor*e;let r=this._computeNodesForMinimumDensity(t),s=this._computePointCount(r),o=Math.sqrt(s/(.75*i));for(;s>i;)t*=o,r=this._computeNodesForMinimumDensity(t),s=this._computePointCount(r),o=Math.sqrt(2);return this._displayNodes(r),this._updateViewNeeded=!1,this._updateLoading(),!0}_computePointCount(e){let t=0;for(let i=0;i<e.length;i++){const r=this._index.getNode(e[i]);r&&(t+=r.vertexCount)}return t}_isRootNodeVisible(){let e=!1;return this._traverseVisible({frustum:this.view.state.contentCamera.frustum,clippingBox:this._clippingBox},{predicate:(t,i,r)=>(e=r,!1),pageMiss:()=>{}}),e}_computeNodesForMinimumDensity(e){const t=this.view.state.contentCamera,i=t.frustum,r=this._clippingBox,s=t.viewForward,o=A(s,t.eye),n=O(s,-o,Qe),a=t.perScreenPixelRatio/2,d=e*e,l=this._nodeIdArray;l.length=0;const u=e=>l.push(e);return this._traverseVisible({frustum:i,clippingBox:r},{predicate:(e,t,i)=>{if(!i)return!1;if(0===t.childCount)return u(e),!1;const r=this._index.getRenderObb(e);return!(this._computeAveragePixelArea(r,t.lodThreshold,t.vertexCount,n,a)<=d)||(u(e),!1)},pageMiss:(e,t)=>{u(e),this._indexQueue.includes(t)||this._indexQueue.push(t)}}),l}_computeAveragePixelArea(e,t,i,r,s){const o=1e-7,n=Math.max(o,e.minimumDistancePlane(r));return t/(n*n)/(4*s*s)/i}_loadNode(e,t){try{return this._loadNodeAsync(e,t)}catch(i){throw m(i)||a.getLogger(this).error(i),i}}async _loadAdditionalUserAttributes(e,t,i){const r=this.layer.outFields;if(!r)return[];const o=H(this.layer.fieldsIndex,r),n=new Set(e.map(e=>null!=e?e.name:null)),a=this.layer.attributeStorageInfo,d=[];for(const s of o){if(n.has(s))continue;const e=me(a,s);e&&d.push(t(e))}const l=await g(d);return f(i),l.filter(s)}async _loadNodeAsync(e,t){const i=this._index.getNode(e),r=pe(this.layer),s=ce(this.layer),o=i.resourceId,n=async e=>{if(!e)return null;if(e.useElevation)return{attributeInfo:e,buffer:null};const i=await this._loadAttribute(o,e,t);return null!=i?{attributeInfo:e,buffer:i}:null};return this._idleQueue.push(async()=>{const i=this._loadGeometry(o,t),{primaryAttribute:a,modulationAttribute:d}=r,l=n(a),u=n(d),h=s.map(e=>e.attributeInfo),p=h.map(e=>n(e)),c=this._loadAdditionalUserAttributes([a,d,...h],n,t),[_,m,g,y,b]=await Promise.all([i,l,u,Promise.all(p),c]);f(t);const w={geometryBuffer:_,primaryAttributeData:m,modulationAttributeData:g,filterAttributesData:y,userAttributesData:b,schema:this.layer.store.defaultGeometrySchema,rendererInfo:r,filterInfo:s,obbData:this._index.getRenderObb(e).data,elevationOffset:this._elevationOffset,inSR:this.layer.spatialReference.toJSON(),outSR:this.view.renderCoordsHelper.spatialReference.toJSON()};return this._worker.invoke(w,t)},t)}async _loadGeometry(e,t){return this._requestData(`${this.baseUrl}/nodes/${e}/geometries/0`,t)}async _loadAttribute(e,t,i){if(!t?.storageInfo)return null;const r=t.storageInfo.key;return this._requestData(`${this.baseUrl}/nodes/${e}/attributes/${r}`,i)}async _requestNodePage(e,t){const s={f:"json",...this.layer.customParameters,token:this.layer.apiKey},o={...r,query:s,responseType:"json",signal:t};return(await i(e,o)).data}async _requestData(e,t){const s={...this.layer.customParameters,token:this.layer.apiKey},o={...r,query:s,responseType:"array-buffer",signal:t};return(await i(e,o)).data}_removeFromRenderer(e){if(this._renderedNodes.has(e)){const t=this._renderer.removeNode(e);this._renderedNodes.delete(e),this._memCache.put(t.id.toString(),t)}}_addToRenderer(e){this._renderedNodes.has(e.id)||(this._renderedNodes.add(e.id),this._renderer.addNode(e))}_setupRendererData(e,t){const i=this._index.getNode(e),r=Math.sqrt(i.lodThreshold/i.vertexCount),s=this._index.getRenderObb(e);if(de(t))return t.splatSize=r,t.obb=s,j(t.origin,t.obb.center),t;const o=xe.fromData(t.obbData),n=o.halfSize,d=s.halfSize,l=.01*Math.max(d[0],d[1],d[2]);if(n[0]>d[0]+l||n[1]>d[1]+l||n[2]>d[2]+l){if(this._maxLoggedBoxWarnings>0){const t=e=>`[${e.halfSize[0]}, ${e.halfSize[1]}, ${e.halfSize[2]}]`;a.getLogger(this).warn(`Node ${e} reported bounding box too small. got ${t(s)} but points cover ${t(o)}`),0===--this._maxLoggedBoxWarnings&&a.getLogger(this).warn(" Too many bounding box errors, stopping reporting for this layer.")}this._index.setRenderObb(e,o)}return new le(e,r,R(s.center),s,0===i.childCount,t.points,t.rgb,t.attributes,t.pointIdFilterMap)}get usedMemory(){let e=0;return this._renderer.forEachNode(t=>{e+=Oe,e+=u(t.coordinates);for(const i of t.attributes){const t=i.values;v(t.buffer)&&(e+=u(t))}}),e}get unloadedMemory(){const e=this._renderedNodes.size;if(e<4)return 0;const t=[...this._renderedNodes].reduce((e,t)=>e+this._index.getNode(t).vertexCount);let i=this._loadingNodes.size;for(let r=0;r<this._workQueue.length;r++)i+=this._workQueue[r].load.length,i-=this._workQueue[r].remove.length;if(i<0)return 0;return i*t/e*((this.usedMemory-e*Oe)/t)+i*Oe}get performanceInfo(){return new K(this.usedMemory,this._renderedNodes.size,[...this._renderedNodes].reduce((e,t)=>e+this._index.getNode(t).vertexCount,0),this.maximumPointCount,new Z(this._loadingNodes.size,this._indexQueue.length,this._workQueue.length,this._idleQueue.length))}get test(){}};e([x()],Fe.prototype,"layer",void 0),e([x()],Fe.prototype,"baseUrl",null),e([x()],Fe.prototype,"pointScale",null),e([x()],Fe.prototype,"useRealWorldSymbolSizes",null),e([x()],Fe.prototype,"pointSize",null),e([x()],Fe.prototype,"inverseDensity",null),e([x()],Fe.prototype,"maximumPointCount",void 0),e([x({readOnly:!0})],Fe.prototype,"availableFields",null),e([x({readOnly:!0})],Fe.prototype,"_clippingBox",null),e([x({readOnly:!0})],Fe.prototype,"_elevationOffset",null),e([x({type:Boolean})],Fe.prototype,"slicePlaneEnabled",void 0),e([x()],Fe.prototype,"_graphicOrigin",null),e([x()],Fe.prototype,"updating",void 0),e([x(Ce)],Fe.prototype,"updatingProgress",void 0),e([x({readOnly:!0})],Fe.prototype,"updatingProgressValue",null),e([x({readOnly:!0})],Fe.prototype,"visibleAtCurrentScale",null),Fe=e([C("esri.views.3d.layers.PointCloudLayerView3D")],Fe);const Le=Fe;class Ee{constructor(e,t,i){this.node=e,this.pointId=t,this.point=i}getGeometry(){return new W([],Array.from(this.point),!0,!1)}get attributePointId(){const{node:e,pointId:t}=this;return null!=e.pointIdFilterMap?e.pointIdFilterMap[t]:t}get usedMemory(){return h+h+p+c(this.point,p)}}class De{constructor(e){this.features=e}get usedMemory(){return this.features.reduce((e,t)=>e+t.usedMemory,h+_)}}const Oe=160;function Ue(e){return t=>e.immediate.schedule(t)}export{Le as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as t,initial as s,syncAndInitial as o,when as i}from"../../../../core/reactiveUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{hydrateGeometry as l}from"../../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as u}from"../../../../layers/graphics/controllers/FeatureTileController3D.js";import{FeatureLayerViewPerformanceInfo as c}from"../FeatureLayerViewPerformanceInfo.js";import{Graphics3DGraphicsPipeline as p}from"./Graphics3DGraphicsPipeline.js";import{FeatureTileFetcher3DContext as h}from"../support/FeatureTileFetcher3DContext.js";import{EventedSet as m}from"../../support/EventedSet.js";let d=class extends p{constructor(e){super(e),this._controllerTotal=0,this._processorTotal=0,this._needsRefresh=!1,this.suspendResumeExtentMode="data"}initialize(){this.addHandles(t(()=>({controller:this.controller,suspended:this.suspended}),({controller:e,suspended:r})=>{e&&!r&&this._needsRefresh&&(e.refetch(),this._needsRefresh=!1)}))}destroy(){this._fetcherContext=r(this._fetcherContext)}get maximumNumberOfFeatures(){return this.controller?.maximumNumberOfFeatures??this._get("maximumNumberOfFeatures")}set maximumNumberOfFeatures(e){this._set("maximumNumberOfFeatures",e),this.controller&&(this.controller.maximumNumberOfFeatures=e)}get maximumNumberOfFeaturesExceeded(){return!!this.controller&&!(this.suspended||!this.controller.maximumNumberOfFeaturesExceeded)}get updatingProgressValue(){let e=0;if(this.controller?.updating){const r=this.controller.updatingRemaining,t=Math.max(this.controller.updatingTotal,this._controllerTotal);t>0&&(e=(t-r)/t,this._controllerTotal=t)}let r=0;if(this.processor?.updating){const e=this.processor.updatingRemaining,t=Math.max(e,this._processorTotal);t>0&&(r=(t-e)/t,this._processorTotal=t)}return.5*(e+r)}get updatePolicy(){if(!this.controller)return 0;switch(this.controller.mode){case"snapshot":{const e=f.get(this.layer.geometryType);return null==e||this.controller.serviceDataCount>e?0:1}case"tiles":return 0}}get usedMemory(){return(this.processor?.usedMemory??0)+(this.controller?.memoryForUnusedFeatures??0)}get unloadedMemory(){const e=this.processor?.unprocessedMemoryEstimate??0,r=this.controller?.expectedFeatureDiff??0,t=this.processor?.loadedFeatures??0,s=t+r>0?t/(t+r):1;return e+r*(this.processor?.usedMemoryPerFeature??0)*s}get ignoresMemoryFactor(){return this.controller?.hasMaximumNumberOfFeaturesOverride}get performanceInfo(){const e=this.controller?.displayFeatureLimit,r=null!=e?e.averageSymbolComplexity:void 0,t=null!=r?`f:${r.verticesPerFeature},v:${r.verticesPerCoordinate}`:"n/a";return new c(super.performanceInfo,this.controller?.performanceInfo?.storedFeatures??0,this.controller?.performanceInfo?.totalVertices??0,this.maximumNumberOfFeaturesExceeded,this.controller?.mode??"n/a",t)}async doRefresh(e){const{controller:r,processor:t,suspended:s}=this;e&&r&&(s?this._needsRefresh=!0:(r.refetch(),this._needsRefresh=!1)),t.refreshFilter()}setVisibility(e,r){this.processor?.setObjectIdVisibility(e,r)}getMissingAttributesForFeature(e){return this.controller.getMissingAttributesForFeature(e)}getHydratedGeometry(e){const r=this.graphics3DProcessor;if(null==r)return null;const t=r.graphics3DGraphicsByObjectID;if(null==t)return null;const s=t.get(e);return null==s?null:l(s.graphic.geometry)}createController(){this._fetcherContext=new h({layerView:this.layerView,returnZ:this.hasZ,returnM:this.hasM});const e=new u({layerView:this.layerView,context:this._fetcherContext,graphics:new m,extent:this.clippingExtent});return this.updatingHandles.add(()=>e.serviceDataExtent,e=>{this.processor&&(this.processor.dataExtent=e)},s),this.addHandles(t(()=>this.suspended&&this.layerView.updateSuspended,r=>{r?e.suspend():e.resume()},o)),this.updatingHandles.add(()=>this.processor?.displayFeatureLimit,r=>e.displayFeatureLimit=r,s),this.addHandles(i(()=>!this.updating,()=>{this._controllerTotal=0,this._processorTotal=0})),e}beforeSetController(e){e.maximumNumberOfFeatures=this.maximumNumberOfFeatures}get test(){return{controller:this.controller,graphics3DProcessor:this.graphics3DProcessor,heatmapProcessor:this.heatmapProcessor,loadedGraphics:this.loadedGraphics}}};e([a()],d.prototype,"layerView",void 0),e([a()],d.prototype,"controller",void 0),e([a()],d.prototype,"_controllerTotal",void 0),e([a()],d.prototype,"_processorTotal",void 0),e([a()],d.prototype,"_needsRefresh",void 0),e([a()],d.prototype,"maximumNumberOfFeatures",null),e([a()],d.prototype,"maximumNumberOfFeaturesExceeded",null),e([a()],d.prototype,"updatingProgressValue",null),e([a()],d.prototype,"updatePolicy",null),e([a()],d.prototype,"suspendResumeExtentMode",void 0),d=e([n("esri.views.3d.layers.graphics.FeatureGraphics3DGraphicsPipeline")],d);const f=new Map([["point",5e3],["polygon",500],["polyline",1e3]]);export{d as FeatureGraphics3DGraphicsPipeline};
5
+ import{__decorate as e}from"tslib";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as t,initial as s,syncAndInitial as o,when as i}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{hydrateGeometry as l}from"../../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as c}from"../../../../layers/graphics/controllers/FeatureTileController3D.js";import{FeatureLayerViewPerformanceInfo as u}from"../FeatureLayerViewPerformanceInfo.js";import{Graphics3DGraphicsPipeline as p}from"./Graphics3DGraphicsPipeline.js";import{FeatureTileFetcher3DContext as m}from"../support/FeatureTileFetcher3DContext.js";import{EventedSet as h}from"../../support/EventedSet.js";let d=class extends p{constructor(e){super(e),this._controllerTotal=0,this._processorTotal=0,this._needsRefresh=!1,this.suspendResumeExtentMode="data"}initialize(){this.addHandles(t(()=>({controller:this.controller,suspended:this.suspended}),({controller:e,suspended:r})=>{e&&!r&&this._needsRefresh&&(e.refetch(),this._needsRefresh=!1)}))}destroy(){this._fetcherContext=r(this._fetcherContext)}get maximumNumberOfFeatures(){return this.controller?.maximumNumberOfFeatures??this._get("maximumNumberOfFeatures")}set maximumNumberOfFeatures(e){this._set("maximumNumberOfFeatures",e),this.controller&&(this.controller.maximumNumberOfFeatures=e)}get snappingComplexityExceeded(){return this.controller?.snappingComplexityExceeded??!0}get maximumNumberOfFeaturesExceeded(){return!!this.controller&&!(this.suspended||!this.controller.maximumNumberOfFeaturesExceeded)}get updatingProgressValue(){let e=0;if(this.controller?.updating){const r=this.controller.updatingRemaining,t=Math.max(this.controller.updatingTotal,this._controllerTotal);t>0&&(e=(t-r)/t,this._controllerTotal=t)}let r=0;if(this.processor?.updating){const e=this.processor.updatingRemaining,t=Math.max(e,this._processorTotal);t>0&&(r=(t-e)/t,this._processorTotal=t)}return.5*(e+r)}get updatePolicy(){if(!this.controller)return 0;switch(this.controller.mode){case"snapshot":{const e=f.get(this.layer.geometryType);return null==e||this.controller.serviceDataCount>e?0:1}case"tiles":return 0}}get usedMemory(){return(this.processor?.usedMemory??0)+(this.controller?.memoryForUnusedFeatures??0)}get unloadedMemory(){const e=this.processor?.unprocessedMemoryEstimate??0,r=this.controller?.expectedFeatureDiff??0,t=this.processor?.loadedFeatures??0,s=t+r>0?t/(t+r):1;return e+r*(this.processor?.usedMemoryPerFeature??0)*s}get ignoresMemoryFactor(){return this.controller?.hasMaximumNumberOfFeaturesOverride}get performanceInfo(){const e=this.controller?.displayFeatureLimit,r=null!=e?e.averageSymbolComplexity:void 0,t=null!=r?`f:${r.verticesPerFeature},v:${r.verticesPerCoordinate}`:"n/a";return new u(super.performanceInfo,this.controller?.performanceInfo?.storedFeatures??0,this.controller?.performanceInfo?.totalVertices??0,this.maximumNumberOfFeaturesExceeded,this.controller?.mode??"n/a",t)}async doRefresh(e){const{controller:r,processor:t,suspended:s}=this;e&&r&&(s?this._needsRefresh=!0:(r.refetch(),this._needsRefresh=!1)),t.refreshFilter()}setVisibility(e,r){this.processor?.setObjectIdVisibility(e,r)}getMissingAttributesForFeature(e){return this.controller.getMissingAttributesForFeature(e)}getHydratedGeometry(e){const r=this.graphics3DProcessor;if(null==r)return null;const t=r.graphics3DGraphicsByObjectID;if(null==t)return null;const s=t.get(e);return null==s?null:l(s.graphic.geometry)}createController(){this._fetcherContext=new m({layerView:this.layerView,returnZ:this.hasZ,returnM:this.hasM});const e=new c({layerView:this.layerView,context:this._fetcherContext,graphics:new h,extent:this.clippingExtent});return this.updatingHandles.add(()=>e.serviceDataExtent,e=>{this.processor&&(this.processor.dataExtent=e)},s),this.addHandles(t(()=>this.suspended&&this.layerView.updateSuspended,r=>{r?e.suspend():e.resume()},o)),this.updatingHandles.add(()=>this.processor?.displayFeatureLimit,r=>e.displayFeatureLimit=r,s),this.addHandles(i(()=>!this.updating,()=>{this._controllerTotal=0,this._processorTotal=0})),e}beforeSetController(e){e.maximumNumberOfFeatures=this.maximumNumberOfFeatures}get test(){return{controller:this.controller,graphics3DProcessor:this.graphics3DProcessor,heatmapProcessor:this.heatmapProcessor,loadedGraphics:this.loadedGraphics}}};e([n()],d.prototype,"layerView",void 0),e([n()],d.prototype,"controller",void 0),e([n()],d.prototype,"_controllerTotal",void 0),e([n()],d.prototype,"_processorTotal",void 0),e([n()],d.prototype,"_needsRefresh",void 0),e([n()],d.prototype,"maximumNumberOfFeatures",null),e([n()],d.prototype,"snappingComplexityExceeded",null),e([n()],d.prototype,"maximumNumberOfFeaturesExceeded",null),e([n()],d.prototype,"updatingProgressValue",null),e([n()],d.prototype,"updatePolicy",null),e([n()],d.prototype,"suspendResumeExtentMode",void 0),d=e([a("esri.views.3d.layers.graphics.FeatureGraphics3DGraphicsPipeline")],d);const f=new Map([["point",5e3],["polygon",500],["polyline",1e3]]);export{d as FeatureGraphics3DGraphicsPipeline};