@arcgis/core 5.0.0-next.4 → 5.0.0-next.5

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 (363) hide show
  1. package/Map.js +1 -1
  2. package/analysis/ElevationProfileAnalysis.js +1 -1
  3. package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +1 -1
  4. package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +4 -0
  5. package/applications/KnowledgeStudio/generalSdkInternalAccess.js +5 -0
  6. package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +1 -0
  7. package/applications/KnowledgeStudio/generalSharedKgUtils.js +1 -1
  8. package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +2 -0
  9. package/applications/KnowledgeStudio/layerInternalAccessUtils.js +1 -1
  10. package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
  11. package/assets/components/assets/sort-handle/t9n/messages.uk.json +1 -1
  12. package/assets/esri/core/workers/RemoteClient.js +1 -1
  13. package/assets/esri/core/workers/chunks/0366b78b0ccf4ed5f6ac.js +1 -0
  14. package/assets/esri/core/workers/chunks/037b2548bf85e2d7c6ac.js +1 -0
  15. package/assets/esri/core/workers/chunks/{c0feec6e2f0e45900ae0.js → 0686243904381ef863dc.js} +1 -1
  16. package/assets/esri/core/workers/chunks/06ba43843e9c4988049b.js +1 -0
  17. package/assets/esri/core/workers/chunks/0f100e163e1847e04155.js +1 -0
  18. package/assets/esri/core/workers/chunks/{388482cea4b9fdeaf06e.js → 0f30a9514571c7be9978.js} +1 -1
  19. package/assets/esri/core/workers/chunks/0f8847f9ae3068833fa4.js +1 -0
  20. package/assets/esri/core/workers/chunks/{14ace5dc4b8984212a57.js → 17d5f8dba6ebb1184506.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{b2add7338258ca7c24dd.js → 1da74aa308ded5748ef5.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{651b9144abb1895cc510.js → 1e848d9da1c61a27cf18.js} +1 -1
  23. package/assets/esri/core/workers/chunks/1eedac33c9fcd7681427.js +1 -0
  24. package/assets/esri/core/workers/chunks/239377336a2009caea01.js +1 -0
  25. package/assets/esri/core/workers/chunks/285762ff92d5388b6024.js +1 -0
  26. package/assets/esri/core/workers/chunks/{40b81d1c2d53cf598b8e.js → 2f03d33f4ca8a48461fc.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{4f01be74dd26e639330f.js → 2f24017e72d41c259faa.js} +1 -1
  28. package/assets/esri/core/workers/chunks/3271614322ba4b44fb5a.js +1 -0
  29. package/assets/esri/core/workers/chunks/36b1f47d70b57d79df7b.js +1 -0
  30. package/assets/esri/core/workers/chunks/{3d65b8a2fbe1df050a25.js → 377a66034e7c1bad5599.js} +1 -1
  31. package/assets/esri/core/workers/chunks/37f2ef14399546e697e6.js +1 -0
  32. package/assets/esri/core/workers/chunks/{0f9bb3187306f89e3d63.js → 398f356b11fd33bd3831.js} +1 -1
  33. package/assets/esri/core/workers/chunks/3a457e718a901a45902e.js.LICENSE.txt +1 -1
  34. package/assets/esri/core/workers/chunks/4442817beb7a76c95770.js +1 -0
  35. package/assets/esri/core/workers/chunks/4c5a7249a311070d8f43.js +1 -0
  36. package/assets/esri/core/workers/chunks/551c6c89b51b99f4864b.js +1 -0
  37. package/assets/esri/core/workers/chunks/{9a723d739ac44b45432c.js → 557960763695abee4a83.js} +1 -1
  38. package/assets/esri/core/workers/chunks/655360995c1cbc78a5a3.js +1 -0
  39. package/assets/esri/core/workers/chunks/67d9cfe02613cb73ee37.js.LICENSE.txt +1 -1
  40. package/assets/esri/core/workers/chunks/6a69dafeb7c9ca8a3d84.js +1 -0
  41. package/assets/esri/core/workers/chunks/6c3b99209d542efa64d4.js +1 -0
  42. package/assets/esri/core/workers/chunks/{8215015f11221a354273.js → 6d049182bec34a22abcd.js} +1 -1
  43. package/assets/esri/core/workers/chunks/71762199aef5d3107da2.js +1 -0
  44. package/assets/esri/core/workers/chunks/72c851c400752094b162.js +1 -0
  45. package/assets/esri/core/workers/chunks/7558919912f7fdc4837b.js +1 -0
  46. package/assets/esri/core/workers/chunks/7596d005a4dc3964b140.js +1 -0
  47. package/assets/esri/core/workers/chunks/762fe93015b705546188.js +1 -0
  48. package/assets/esri/core/workers/chunks/79dbfa2b9b332ca0002f.js +1 -0
  49. package/assets/esri/core/workers/chunks/7a23ab84e1144f081c92.js +1 -0
  50. package/assets/esri/core/workers/chunks/{2a5f331c0f18d8574b4e.js → 811d4c46c75cf6a63e78.js} +1 -1
  51. package/assets/esri/core/workers/chunks/829bc5dbda2f51561446.js +1 -0
  52. package/assets/esri/core/workers/chunks/8372f142c4d7a65c7954.js +1 -0
  53. package/assets/esri/core/workers/chunks/8605ec4678eb4511c715.js +1 -0
  54. package/assets/esri/core/workers/chunks/883ffaa69b3e6eb158bf.js +1 -0
  55. package/assets/esri/core/workers/chunks/{3d22fe2f2c40abbc246e.js → 88d942cd25bef74fd50a.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{0086a09441627842d34a.js → 8f3503b2fb6cd38757b9.js} +1 -1
  57. package/assets/esri/core/workers/chunks/9786f91455350eaae493.js +1 -0
  58. package/assets/esri/core/workers/chunks/98311fec6c16a1b23586.js +1 -0
  59. package/assets/esri/core/workers/chunks/9c5cbf8810f37b1a4718.js +1 -0
  60. package/assets/esri/core/workers/chunks/a091623bbfb3d771c8d8.js +1 -0
  61. package/assets/esri/core/workers/chunks/a137c27ce078bea44f89.js +1 -0
  62. package/assets/esri/core/workers/chunks/a29d7205394cb8b2a847.js +1 -0
  63. package/assets/esri/core/workers/chunks/a2a284d4dd5caaecbc2e.js +1 -0
  64. package/assets/esri/core/workers/chunks/{135e270b4f03c4270870.js → a4db5c9a90107e097df8.js} +1 -1
  65. package/assets/esri/core/workers/chunks/a61cb4f1ca282bf8b75d.js +1 -0
  66. package/assets/esri/core/workers/chunks/a6ac1ff89c40f3a4797a.js +1 -0
  67. package/assets/esri/core/workers/chunks/{dc31865edea480f0ebba.js → a8c4fd779e454e4075c4.js} +1 -1
  68. package/assets/esri/core/workers/chunks/a8f998b8ec8c56150479.js.LICENSE.txt +1 -1
  69. package/assets/esri/core/workers/chunks/aa6eb55e4fb57c4e8eeb.js +1 -0
  70. package/assets/esri/core/workers/chunks/aa78b69219d9a0ef1c54.js.LICENSE.txt +1 -1
  71. package/assets/esri/core/workers/chunks/af3fc2562bb6d217adf6.js +1 -0
  72. package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js → b017bac40dc8328013e3.js} +2 -2
  73. package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js.LICENSE.txt → b017bac40dc8328013e3.js.LICENSE.txt} +1 -1
  74. package/assets/esri/core/workers/chunks/b59f9c3f7a149214256f.js +1 -0
  75. package/assets/esri/core/workers/chunks/b96eb0ea506379182d62.js +2 -0
  76. package/assets/esri/core/workers/chunks/{24921d31efa8d222ad2d.js.LICENSE.txt → b96eb0ea506379182d62.js.LICENSE.txt} +1 -1
  77. package/assets/esri/core/workers/chunks/{b5863afafd3a7d2d5c05.js → bb5484b5eeacc9ad2ceb.js} +3 -3
  78. package/assets/esri/core/workers/chunks/bb56717c4e36f28d4c08.js +1 -0
  79. package/assets/esri/core/workers/chunks/bb7976e2f883b544add6.js +1 -0
  80. package/assets/esri/core/workers/chunks/c0b7e86860838638537f.js +1 -0
  81. package/assets/esri/core/workers/chunks/c134ebbaeac514cbd657.js +1 -0
  82. package/assets/esri/core/workers/chunks/c2b47a7dc961863d283f.js +1 -0
  83. package/assets/esri/core/workers/chunks/{0eaa4dccba0d844b9da3.js → c3ddcf9148dd2640c402.js} +1 -1
  84. package/assets/esri/core/workers/chunks/c476643002387f60ea42.js +1 -0
  85. package/assets/esri/core/workers/chunks/ce16489cf7eb0d78c741.js.LICENSE.txt +1 -1
  86. package/assets/esri/core/workers/chunks/d048e4926e78458afa3e.js +1 -0
  87. package/assets/esri/core/workers/chunks/d39a10155317e6f7a21c.js +1 -0
  88. package/assets/esri/core/workers/chunks/d6e0528eacee7ea4c1ce.js.LICENSE.txt +1 -1
  89. package/assets/esri/core/workers/chunks/d886fb97bdb348a16f25.js +1 -0
  90. package/assets/esri/core/workers/chunks/{00aa85ae6419aad183ea.js → dc4982b0ac007bd70213.js} +1 -1
  91. package/assets/esri/core/workers/chunks/e1258b6a404e58878c7a.js +1 -0
  92. package/assets/esri/core/workers/chunks/e31192ae920e3e19b6aa.js +1 -0
  93. package/assets/esri/core/workers/chunks/e6a86cad44056735ed26.js +1 -0
  94. package/assets/esri/core/workers/chunks/e82f5437bd66779c6740.js +1 -0
  95. package/assets/esri/core/workers/chunks/{039ec0fbe3b4b398b8c6.js → f26dc1d83beed63b6045.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{fa5c87889c2f0bef896b.js → f35aaa04cca676c2d3f8.js} +1 -1
  97. package/assets/esri/core/workers/chunks/f5b7e7f2860a825ed373.js +1 -0
  98. package/assets/esri/core/workers/chunks/f651c05604eab83aef5f.js.LICENSE.txt +1 -1
  99. package/assets/esri/core/workers/chunks/{18da83afbc324fef9fd8.js → f779034623980bf9a37c.js} +2 -2
  100. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  101. package/assets/esri/themes/base/widgets/_Directions.scss +17 -18
  102. package/assets/esri/themes/dark/main.css +1 -1
  103. package/assets/esri/themes/light/main.css +1 -1
  104. package/assets/esri/themes/light/view.css +1 -1
  105. package/chunks/ComponentShader.glsl.js +72 -39
  106. package/chunks/OITBlend.glsl.js +3 -3
  107. package/chunks/bundle.js +1 -1
  108. package/config.js +1 -1
  109. package/core/QueueProcessor.js +1 -1
  110. package/core/has.js +1 -1
  111. package/core/sanitizerUtils.js +1 -1
  112. package/core/workers/Connection.js +1 -1
  113. package/core/workers/WorkerHandle.js +1 -1
  114. package/core/workers/utils.js +1 -1
  115. package/geohash/GeohashCell.js +1 -1
  116. package/geohash/geohashUtils.js +1 -1
  117. package/geometry/GeometryCursor.js +1 -1
  118. package/geometry/geometryCursorCollectUtils.js +1 -1
  119. package/geometry/libtess.js +1 -1
  120. package/geometry/support/jsonUtils.js +1 -1
  121. package/geometry/support/normalizeUtilsSync.js +1 -1
  122. package/geometry/support/triangulationUtils.js +1 -1
  123. package/interfaces.d.ts +426 -347
  124. package/intl/date.js +1 -1
  125. package/intl.d.ts +2 -0
  126. package/intl.js +1 -1
  127. package/kernel.js +1 -1
  128. package/layers/FeatureLayer.js +1 -1
  129. package/layers/graphics/OptimizedFeature.js +1 -1
  130. package/layers/graphics/OptimizedGeometry.js +1 -1
  131. package/layers/graphics/centroid.js +1 -1
  132. package/layers/graphics/contains.js +1 -1
  133. package/layers/graphics/data/AttributesBuilder.js +1 -1
  134. package/layers/graphics/data/FeatureStore.js +1 -1
  135. package/layers/graphics/data/QueryEngine.js +1 -1
  136. package/layers/graphics/data/QueryEngineResult.js +1 -1
  137. package/layers/graphics/data/geometryUtils.js +1 -1
  138. package/layers/graphics/data/spatialQuerySupport.js +1 -1
  139. package/layers/graphics/featureConversionUtils.js +1 -1
  140. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  141. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  142. package/layers/graphics/sources/geojson/geojson.js +1 -1
  143. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  144. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  145. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  146. package/layers/knowledgeGraph/layerUtils.js +1 -1
  147. package/layers/mixins/ArcGISImageService.js +1 -1
  148. package/layers/mixins/ImageryTileMixin.js +1 -1
  149. package/layers/support/PixelBlock.js +1 -1
  150. package/layers/support/RasterInfo.js +1 -1
  151. package/layers/support/RasterJobHandler.js +1 -1
  152. package/layers/support/RasterSensorInfo.js +1 -1
  153. package/layers/support/RasterStorageInfo.js +1 -1
  154. package/layers/support/RasterWorker.js +1 -1
  155. package/layers/support/TitleCreator.js +1 -1
  156. package/layers/support/arcgisLayerUrl.js +1 -1
  157. package/layers/support/capabilities.js +1 -1
  158. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  159. package/layers/support/rasterDatasets/pixelReader.js +1 -1
  160. package/layers/support/rasterFieldUtils.js +1 -1
  161. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  162. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  163. package/package.json +5 -5
  164. package/request.js +1 -1
  165. package/rest/print.js +1 -1
  166. package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
  167. package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
  168. package/rest/query/operations/query.js +1 -1
  169. package/rest/query/operations/queryZScale.js +1 -1
  170. package/rest/versionManagement/getVersionInfos.js +1 -1
  171. package/smartMapping/statistics/histogram.js +1 -1
  172. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  173. package/smartMapping/support/utils.js +1 -1
  174. package/support/elevationInfoUtils.js +1 -1
  175. package/support/requestImageUtils.js +1 -1
  176. package/support/revision.js +1 -1
  177. package/views/2d/GoToManager.js +1 -1
  178. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  179. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  180. package/views/2d/engine/webgl/Mesh2D.js +1 -1
  181. package/views/2d/engine/webgl/brushes/WGLBrushVTLSymbol.js +1 -1
  182. package/views/2d/engine/webgl/mesh/templates/templateUtils.js +1 -1
  183. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  184. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  185. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  186. package/views/2d/layers/features/aggregation/GridCell.js +1 -1
  187. package/views/2d/layers/features/processor/AAggregateStrategy.js +1 -1
  188. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  189. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  190. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  191. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  192. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  193. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  194. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  195. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  196. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  197. package/views/2d/layers/features/support/FeatureFilterEvaluator.js +1 -1
  198. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  199. package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
  200. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  201. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  202. package/views/2d/layers/features/support/GraphicsReader.js +1 -1
  203. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  204. package/views/3d/FocusAreasView.js +1 -1
  205. package/views/3d/GroundView3D.js +1 -1
  206. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  207. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  208. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  209. package/views/3d/glTF/DefaultLoadingContext.js +1 -1
  210. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  211. package/views/3d/layers/FlowSubView3D.js +1 -1
  212. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  213. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  214. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  215. package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
  216. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  217. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  218. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  219. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  220. package/views/3d/layers/graphics/pipeline/featureSet/PBFPointFeatureSetView.js +1 -1
  221. package/views/3d/layers/graphics/pipeline/featureSet/TiledFeatureStore.js +1 -1
  222. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  223. package/views/3d/layers/i3s/I3SQueryFeatureAdapter.js +1 -1
  224. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  225. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  226. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  227. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  228. package/views/3d/state/ViewStateManager.js +1 -1
  229. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  230. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  231. package/views/3d/state/controllers/RotateController.js +1 -1
  232. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  233. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  234. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  235. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  236. package/views/3d/state/utils/navigationUtils.js +1 -1
  237. package/views/3d/support/DisplayQualityProfile.js +1 -1
  238. package/views/3d/support/QualitySettings.js +1 -1
  239. package/views/3d/support/StreamDataLoader.js +1 -1
  240. package/views/3d/support/engineContent/line.js +1 -1
  241. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  242. package/views/3d/support/flow/FlowWorker.js +1 -1
  243. package/views/3d/support/flow/StreamlineResources3D.js +1 -1
  244. package/views/3d/support/flow/constants.js +1 -1
  245. package/views/3d/support/hitTest.js +1 -1
  246. package/views/3d/support/renderInfoUtils/polygon.js +1 -1
  247. package/views/3d/terrain/Tile.js +1 -1
  248. package/views/3d/terrain/TileOverlayData.js +1 -1
  249. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  250. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  251. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  252. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  253. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  254. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +7 -7
  255. package/views/3d/webgl-engine/core/shaderModules/BooleanDrawUniform.js +5 -0
  256. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConstructionContext.js +1 -1
  257. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  258. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  259. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  260. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  261. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +4 -4
  262. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  263. package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +1 -1
  264. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  265. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  266. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  267. package/views/draw/support/Reshape.js +1 -1
  268. package/views/draw/support/reshapeUtils.js +1 -1
  269. package/views/interactive/dragEventPipeline.js +1 -1
  270. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  271. package/views/webgl/ShaderBuilder.js +1 -1
  272. package/views/webgl/Texture.js +1 -1
  273. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  274. package/widgets/BatchAttributeForm.js +1 -1
  275. package/widgets/Directions/css.js +1 -1
  276. package/widgets/Directions.js +1 -1
  277. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  278. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  279. package/widgets/Editor/EditorViewModel.js +1 -1
  280. package/widgets/Editor/Edits.js +1 -1
  281. package/widgets/Editor/MergeFeaturesWorkflow.d.ts +4 -0
  282. package/widgets/Editor/MergeFeaturesWorkflow.js +5 -0
  283. package/widgets/Editor/MergeFeaturesWorkflowData.d.ts +4 -0
  284. package/widgets/Editor/MergeFeaturesWorkflowData.js +5 -0
  285. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  286. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  287. package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
  288. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  289. package/widgets/Editor/components/UploadDetails.js +1 -1
  290. package/widgets/Editor/support/EditorItem.js +1 -1
  291. package/widgets/Editor/support/mergeFeaturesUtils.js +5 -0
  292. package/widgets/Editor/workflowUtils.js +1 -1
  293. package/widgets/Editor.js +1 -1
  294. package/widgets/Feature/FeatureExpression.js +1 -1
  295. package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
  296. package/widgets/Feature/FeatureFields.js +1 -1
  297. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  298. package/widgets/Feature/FeatureMedia.js +1 -1
  299. package/widgets/Feature/FeatureViewModel.js +1 -1
  300. package/widgets/Feature/support/featureUtils.js +1 -1
  301. package/widgets/Feature.js +1 -1
  302. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  303. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  304. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  305. package/widgets/Print.js +1 -1
  306. package/widgets/support/ColorPicker.js +1 -1
  307. package/widgets/support/SelectionList/LayerItem.js +1 -1
  308. package/widgets/support/jsxWidgetSupport.js +1 -1
  309. package/assets/esri/core/workers/chunks/065f2bbcaeef1f13fd48.js +0 -1
  310. package/assets/esri/core/workers/chunks/0731e588afd1f561ec3b.js +0 -1
  311. package/assets/esri/core/workers/chunks/188272af9a6470ccfe31.js +0 -1
  312. package/assets/esri/core/workers/chunks/1a9f544f20f643161a36.js +0 -1
  313. package/assets/esri/core/workers/chunks/1cfcadaa98ac528fea37.js +0 -1
  314. package/assets/esri/core/workers/chunks/1db0bf570a04687b3130.js +0 -1
  315. package/assets/esri/core/workers/chunks/24921d31efa8d222ad2d.js +0 -2
  316. package/assets/esri/core/workers/chunks/2a900a632a1231deb713.js +0 -1
  317. package/assets/esri/core/workers/chunks/31c6e951b99315e8e68a.js +0 -1
  318. package/assets/esri/core/workers/chunks/35491fbdd287470d40a4.js +0 -1
  319. package/assets/esri/core/workers/chunks/36247c6f6fc2891df2cf.js +0 -1
  320. package/assets/esri/core/workers/chunks/3d53307efbc3f07d7bf2.js +0 -1
  321. package/assets/esri/core/workers/chunks/42a72e1d963e4636323b.js +0 -1
  322. package/assets/esri/core/workers/chunks/456161a323be7d640c61.js +0 -1
  323. package/assets/esri/core/workers/chunks/500d09d2191127371081.js +0 -1
  324. package/assets/esri/core/workers/chunks/5707713c2f27588b9194.js +0 -1
  325. package/assets/esri/core/workers/chunks/5713f96bade5ebb54c81.js +0 -1
  326. package/assets/esri/core/workers/chunks/5718cf135e105e1e026b.js +0 -1
  327. package/assets/esri/core/workers/chunks/5c585b338a9e9aa0e205.js +0 -1
  328. package/assets/esri/core/workers/chunks/5d1d909354c90cb8eb60.js +0 -1
  329. package/assets/esri/core/workers/chunks/5ea03f53d4d64d9e7cae.js +0 -1
  330. package/assets/esri/core/workers/chunks/63019a7eb5222dc5e420.js +0 -1
  331. package/assets/esri/core/workers/chunks/64629ddcf008349eaf41.js +0 -1
  332. package/assets/esri/core/workers/chunks/64ee8d2acae2d6fce608.js +0 -1
  333. package/assets/esri/core/workers/chunks/6fcacfcb3d83515c37c9.js +0 -1
  334. package/assets/esri/core/workers/chunks/72ecf49d03bb24bf0998.js +0 -1
  335. package/assets/esri/core/workers/chunks/7421f9575487cdc9e28e.js +0 -1
  336. package/assets/esri/core/workers/chunks/77a11d7d53325d108ed8.js +0 -1
  337. package/assets/esri/core/workers/chunks/7a05b1f6163112bc9db2.js +0 -1
  338. package/assets/esri/core/workers/chunks/7d9882ddfa6495f72baa.js +0 -1
  339. package/assets/esri/core/workers/chunks/7fffad8ff6878fa1fd56.js +0 -1
  340. package/assets/esri/core/workers/chunks/81bbe5251ed13c0d91cc.js +0 -1
  341. package/assets/esri/core/workers/chunks/8b16aa50d879b92a5375.js +0 -1
  342. package/assets/esri/core/workers/chunks/8bc64fc7c4b9eb8fca4d.js +0 -1
  343. package/assets/esri/core/workers/chunks/8bfa19c24be0e3f3fd74.js +0 -1
  344. package/assets/esri/core/workers/chunks/8eefa133c36a004c054c.js +0 -1
  345. package/assets/esri/core/workers/chunks/9834bc11586a2d8d6f35.js +0 -1
  346. package/assets/esri/core/workers/chunks/9c6fc4fe2c46f40d63d9.js +0 -1
  347. package/assets/esri/core/workers/chunks/a5f25104938ab33e7a85.js +0 -1
  348. package/assets/esri/core/workers/chunks/a7bd294996e6c8b8354a.js +0 -1
  349. package/assets/esri/core/workers/chunks/abf4f018c692c18c3320.js +0 -1
  350. package/assets/esri/core/workers/chunks/b1f667006cba60ef4aa7.js +0 -1
  351. package/assets/esri/core/workers/chunks/b2d9f4e057af26a538fb.js +0 -1
  352. package/assets/esri/core/workers/chunks/b62807c6fcfb70a87cd4.js +0 -1
  353. package/assets/esri/core/workers/chunks/b8339c1d60847a9eed3e.js +0 -1
  354. package/assets/esri/core/workers/chunks/c362fbbafec91c44eeb2.js +0 -1
  355. package/assets/esri/core/workers/chunks/c941d15190fc08523d0d.js +0 -1
  356. package/assets/esri/core/workers/chunks/cc70a4a915b0b2ccb2a0.js +0 -1
  357. package/assets/esri/core/workers/chunks/d121045cddbe55c2ecb2.js +0 -1
  358. package/assets/esri/core/workers/chunks/d2120a623b1bd91b9ed9.js +0 -1
  359. package/assets/esri/core/workers/chunks/d78c2833cdc4730a88a3.js +0 -1
  360. package/assets/esri/core/workers/chunks/df438b62702007267798.js +0 -1
  361. package/assets/esri/core/workers/chunks/f4eb090bcc3eca64306a.js +0 -1
  362. package/assets/esri/core/workers/chunks/f7846523adacbfe5047e.js +0 -1
  363. package/assets/esri/core/workers/chunks/f839b86bee15deaf84e4.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../Camera.js";import i from"../../../Viewpoint.js";import r from"../../../core/Accessor.js";import a from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{on as n,watch as o,sync as h,when as l}from"../../../core/reactiveUtils.js";import{addFrameTask as p}from"../../../core/scheduling.js";import{createScreenPoint as c}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 d}from"../../../core/accessorSupport/decorators/subclass.js";import{s as v}from"../../../chunks/vec32.js";import{fromArray as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as w}from"../../../chunks/vec42.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import _ from"../../../geometry/Extent.js";import y from"../../../geometry/Point.js";import f from"../../../geometry/Polygon.js";import{isLoadedOrLoadFor as C,requiresLoad as x}from"../../../geometry/projectionUtils.js";import{fromRenderCamera as R,toRenderCamera as P}from"../webgl.js";import{applyAll as S}from"../camera/constraintUtils.js";import{cameraOnContentAlongViewDirection as O,surfaceElevationBelowRenderLocation as b}from"../camera/intersectionUtils.js";import{ConstraintsManager as T}from"./ConstraintsManager.js";import{Frustum as j}from"./Frustum.js";import{GoToOperation as z}from"./GoToOperation.js";import{SurfaceCollisionCorrectionController as M}from"./controllers/SurfaceCollisionCorrectionController.js";import{toArea as I,toExtent as H,applyTiltAdjustToScale as B,scaleToZoom as E,fromExtentSync as L,getObserverForPointAtDistanceSync as V,viewScaleToCameraDistance as A,zoomToScale as U}from"../support/cameraUtils.js";import{fromCamera as k,toCameraSync as D}from"../support/viewpointUtils.js";import F from"../webgl/RenderCamera.js";import{PropertiesPool as G}from"../../support/PropertiesPool.js";import{ensureAttachmentMaxSize as N}from"../../webgl/FramebufferObject.js";let q=class extends r{constructor(e){super(e),this.ready=!1,this._windowDevicePixelRatio=1,this._devicePixelRatioOverride=null,this._idleTimeout=te,this.test={viewStateManager:this,contentCameraResetState:new Map,setDevicePixelRatio:e=>this._devicePixelRatioOverride=e,getDevicePixelRatioOverride:()=>this._devicePixelRatioOverride,renderState:null,get maximumPixelRatio(){return this.viewStateManager.view.qualitySettings.maximumPixelRatio},get updatingIgnoreRenderState(){return null!=this.renderState},get idleTimeoutEnabled(){return this.viewStateManager._idleTimeout>0},set idleTimeoutEnabled(e){this.viewStateManager._idleTimeout=e?te:0}},this._propertiesPool=new G({frustum:()=>new j(null)},this),this._cameraSetByUser=!1,this._gotoOperation=null,this._cameraChangeTime=0,this._tmpCanvasSize=new W}initialize(){this._cameraChangeTime=performance.now(),this.addHandles([n(()=>this.view.state.events,"before-camera-change",({camera:e})=>e&&this._updateElevation(e)),o(()=>this.view.state?.camera,(e,t)=>this._cameraChangedHandler(e,t),h)]),l(()=>this.view.state?.camera,e=>this._updateElevation(e),{once:!0,sync:!0}),this.addHandles([p({prepare:()=>this._prepareFrame()}),o(()=>this.view.state.cameraController,()=>{this._cameraSetByUser=!0,this.removeHandles($)}),n(()=>this.view.state.events,"camera-projection-changed",()=>this.notifyChange("scale"))])}destroy(){this.exit(),this._propertiesPool=s(this._propertiesPool)}get camera(){const e=this._get("camera");if(!this.ready)return e;const t=R(this.view,this.view.state.camera,Q);return t&&e&&t.equals(e)?e:t.clone()}set camera(e){this._updatePropertyBeforeReady("camera",e)||(this.view.elevationProvider.enableCache(!0),this.setStateCamera(P(this.view,e),{applyConstraints:!1})||a.getLogger(this).error("#camera=","Invalid camera",e),this.view.elevationProvider.enableCache(!1))}get contentCamera(){const e=this._get("contentCamera");if(!this.ready)return e;const t=R(this.view,this.view.state.contentCamera,Q);return t&&e&&t.equals(e)?e:t.clone()}set contentCamera(e){if(this._updatePropertyBeforeReady("contentCamera",e))return;const t=P(this.view,e);this.view.state.contentCamera=null!=t?t:null}installContentCameraReset(e){if(this.removeHandles(ee),this.test.contentCameraResetState.clear(),!this.view.state.fixedContentCamera)return!1;const t=this.zoom,i=this.view.state.camera.distance**2,r=u(this.view.state.camera.center),a=e.sticky?this.contentCamera.clone():null;return this.addHandles([o(()=>this.contentCamera,()=>{e.sticky||(this.removeHandles(ee),this.test.contentCameraResetState.clear())}),o(()=>this.zoom,e=>{void 0!==e&&void 0!==t&&(this.test.contentCameraResetState.set("view.zoom",Math.abs(e-t)/2),Math.abs(e-t)>2?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a))}),o(()=>this.view.state.camera,e=>{const t=v(r,e.center);this.test.contentCameraResetState.set("camera.center",t/i),t>i?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a)})],ee),!0}get center(){return this.ready?this.view.pointsOfInterest.centerOnContent.location:this._get("center")}set center(e){this._updatePropertyBeforeReady("center",e)||(e?this.isCompatible(e)?this.setStateCamera(this._centerToCamera(e),{applyConstraints:!0})?this.view.pointsOfInterest.centerOnContent.runTask():a.getLogger(this).error("#center=","Invalid center",e):a.getLogger(this).error("#center=","Center has an incompatible spatial reference (center: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#center=","Center may not be null or undefined"))}get visibleArea(){if(!this.ready){const e=this._get("extent");return e?f.fromExtent(e):null}return I(this.view,this.view.pointsOfInterest.focus.renderLocation)}get extent(){if(!this.ready)return this._get("extent");const e=this.view,t=H(e,e.state.camera,e.pointsOfInterest.centerOnContent.renderLocation);return null!=t?t:this._get("extent")}set extent(e){this._updatePropertyBeforeReady("extent",e)||(e?this.isCompatible(e)?this.setStateCamera(this._extentToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#extent=","Invalid extent",e):a.getLogger(this).error("#extent=","Extent has an incompatible spatial reference (extent: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#extent=","Extent may not be null or undefined"))}get frustum(){const e=this._propertiesPool.get("frustum");return e.renderCoordsHelper=this.view.renderCoordsHelper,e.update(this.view.state.camera),e}get constraintsManager(){return this._constraintsManager}get _initialViewpoint(){const e=this.view.map;return e&&"initialViewProperties"in e?e.initialViewProperties?.viewpoint:void 0}get hasInitialView(){return!!this._initialViewpoint}get scale(){if(!this.ready)return this._get("scale");const e=this.view.basemapTerrain.tilingScheme,t=this.view.pointsOfInterest.cameraOnSurface.scale;return e&&t?B(this.view,t,this.view.state.contentCamera,e):this._get("scale")}set scale(e){this._updatePropertyBeforeReady("scale",e)||this.setStateCamera(this._scaleToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#scale=","Invalid scale",e)}get padding(){if(!this.ready)return this._get("padding");const e=this.view.state.camera,t=e.padding,i=e.pixelRatio,r=this._get("padding"),a=Math.round(t[0]/i),s=Math.round(t[1]/i),n=Math.round(t[2]/i),o=Math.round(t[3]/i);return null!=r&&r.top===a&&r.right===s&&r.bottom===n&&r.left===o?r:{top:a,right:s,bottom:n,left:o}}set padding(e){this._updatePropertyBeforeReady("padding",e)||(this._paddingToArray(e,this.view.state.camera.pixelRatio,Y),this.view.state.updateCamera(e=>e.padding=Y))}_paddingToArray(e,t,i){e?w(i,e.top||0,e.right||0,e.bottom||0,e.left||0):w(i,0,0,0,0);for(let r=0;r<4;r++)i[r]=Math.round(i[r]*t)}get screenCenter(){const e=this.padding;return c((this.view.width-(e.left+e.right))/2+e.left,(this.view.height-(e.top+e.bottom))/2+e.top)}get viewpoint(){return this.ready?k(this.view,this.camera):this._get("viewpoint")}set viewpoint(e){if(!this._updatePropertyBeforeReady("viewpoint",e))if(e){if(!this.isCompatible(e)){const t=null!=e.camera?e.camera.position:e.targetGeometry,i=null!=t&&t.spatialReference;return void a.getLogger(this).error("#viewpoint=","Viewpoint has an incompatible spatial reference (viewpoint: "+(i?i.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e)}this.setStateCamera(this._viewpointToCamera(e),{applyConstraints:!e.camera})||a.getLogger(this).error("#viewpoint=","Invalid viewpoint",e)}else a.getLogger(this).error("#viewpoint=","Viewpoint may not be null or undefined")}get zoom(){return this.ready?E(this.view,this.scale):this._get("zoom")}set zoom(e){this._updatePropertyBeforeReady("zoom",e)||void 0===e||this.setStateCamera(this._zoomToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#zoom=","Invalid zoom",e)}_computeCanvasSize(){if(this._devicePixelRatioOverride)return this.view.state.contentPixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*this._devicePixelRatioOverride),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*this._devicePixelRatioOverride),this._tmpCanvasSize.pixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize;const e=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio),t=(this._usePhysicalPixelRendering?this._windowDevicePixelRatio:e)*this.view.resolutionScale;this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*t),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*t);const i=this.view.stage.renderView.renderingContext?.parameters.maxTextureSize;return i&&N(this._tmpCanvasSize,i),this._tmpCanvasSize.pixelRatio=this._tmpCanvasSize.width>0?this._tmpCanvasSize.width/this.view.surface.clientWidth*.5+this._tmpCanvasSize.height/this.view.surface.clientHeight*.5:t,this.view.state&&(this.view.state.contentPixelRatio=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)),this._tmpCanvasSize}get _rasterPixelRatio(){return null!=this._devicePixelRatioOverride?this._devicePixelRatioOverride:this._usePhysicalPixelRenderingAny?this._windowDevicePixelRatio:Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)}get _usePhysicalPixelRendering(){return this.view?.stage?.renderer.isFeatureEnabled(8)??!1}get _usePhysicalPixelRenderingAny(){const e=this.view?.stage?.renderer;return e&&(e.isFeatureEnabled(8,2)||e.isFeatureEnabled(8,1)||e.isFeatureEnabled(8,0))}preinit(e){return!(this._isOverridden("center")&&!C(this.center.spatialReference,e))&&(!(this._isOverridden("camera")&&!C(this.camera.position.spatialReference,e))&&(!(this._isOverridden("extent")&&!C(this.extent.spatialReference,e))&&!!(!this._isOverridden("viewpoint")||C(this.viewpoint.targetGeometry?.spatialReference,e)&&C(this.viewpoint.camera?.position?.spatialReference,e))))}init(){this._constraintsManager=new T({view:this.view}),this._prepareFrame();const e=this._getInitialProperties();this._cameraSetByUser=!1,this._set("ready",!0);for(const t of e)this.set(t.name,t.value);if(!this._cameraSetByUser){const e=this._initialViewpoint||this.view.initialExtent;e&&this.isCompatible(e)?this._setInitialView(e):2===this.view.state.viewingMode&&this.addHandles(l(()=>this.view.basemapTerrain.ready,()=>{this.removeHandles($),this._setInitialView(this.view.dataExtent)},{once:!0,initial:!0}),$)}}exit(){this._cancelGoToOperation(),this.ready&&(this._override("padding",this.padding),this._set("ready",!1),this._clearOverride("hasInitialView"),this._cameraSetByUser=!1,this.removeHandles($),this._constraintsManager=s(this._constraintsManager))}async goTo(e,t){return t={animate:!0,...t},null!=this._gotoOperation&&this._gotoOperation.abort(t.animate),this._gotoOperation=new z(e,t,this.view),this.view.resourceController.scheduler.stopFrame(),this._gotoOperation.promise}debugSetCameraOnContent(){this.setStateCamera(O(this.view),{applyConstraints:!1})}step(e){const t=this.view.state?.cameraController;t?.stepController&&this.view.state.updateCamera(i=>t.stepController(e,i))}_cancelGoToOperation(){null!=this._gotoOperation&&(this._gotoOperation.abort(),this._gotoOperation=null)}_getInitialProperties(){const e=new Set,t=[];for(const{propertyName:i,overrides:r}of J){const a=e.has(i),s=this._isOverridden(i);!a&&s&&t.push({name:i,value:this._get(i)}),this._clearOverride(i),(a||s)&&r.forEach(t=>e.add(t))}return t}_setInitialView(e){if(null==e||this._cameraSetByUser)return;if(e instanceof t)return void this.setStateCamera(P(this.view,e),{applyConstraints:!1});if(e instanceof i){if(e.targetGeometry instanceof _){const t=L(this.view,e.targetGeometry,0,.5,0);return void(null!=t&&this.setStateCamera(P(this.view,t),{applyConstraints:!0}))}const t={applyConstraints:!e.camera},i=this._viewpointToCamera(e);return void this.setStateCamera(i,t)}const r=L(this.view,e,0,.5,0);null!=r&&this.setStateCamera(P(this.view,r),{applyConstraints:!0})}_updatePropertyBeforeReady(e,t){return!this.ready&&(this._override(e,t),t&&Z.has(e)&&this._override("hasInitialView",!0),!0)}isCompatible(e){return null!=e&&(e instanceof i?e.camera?this.isCompatible(e.camera):this.isCompatible(e.targetGeometry):e instanceof t?this.isCompatible(e.position):e.spatialReference&&!x(e.spatialReference,this.view.spatialReference))}_getPreservingHeadingTilt(e=K){return this._cameraSetByUser?(e.heading=this.camera.heading,e.tilt=this.camera.tilt):(e.heading=0,e.tilt=.5),e}_centerPointAtDistanceToCamera(e,t,i=X){const{heading:r,tilt:a}=this._getPreservingHeadingTilt(),s=V(this.view,r,a,e,t,1);return null==s?null:(i.copyFrom(this.view.state.camera),i.eye=s.eye,i.center=s.center,i.up=s.up,i)}_centerToCamera(e){let t;if(e.hasZ)t=this.view.state.camera.distance;else{const{centerOnContent:e}=this.view.pointsOfInterest;e.runTask(),t=e.distance}return this._centerPointAtDistanceToCamera(e,t)}_extentToCamera(e){const{heading:t,tilt:i}=this._getPreservingHeadingTilt(),r=L(this.view,e,t,i,1,Q);return r?P(this.view,r):null}_scaleToCamera(e){if(null==e)return null;const t=this.view,i=t.pointsOfInterest.centerOnContent;i.runTask();const r=i.renderLocation,a=t.pointsOfInterest.cameraOnSurface.renderLocation,s=A(t,e,r,a);return this._centerPointAtDistanceToCamera(r,s)}_zoomToCamera(e){return this._scaleToCamera(U(this.view,e))}_viewpointToCamera(e){return P(this.view,D(this.view,e))}setStateCamera(e,t){return!(null==e||!this.view.state.stopActiveCameraController())&&(this._cameraSetByUser=!0,t.doNotCancelGoToOperation||this._cancelGoToOperation(),this.view.state.updateCamera(i=>{t.positionAndOrientationOnly?(i.eye=e.eye,i.center=e.center,i.up=e.up,i.fov=e.fov):i.copyFrom(e),t.applyConstraints&&S(this.view,i)}),t.applyConstraints||(this.view.state.cameraController=new M({view:this.view,desiredCamera:e})),!0)}_prepareFrame(){const{surface:e,canvas:t,stage:i}=this.view;if(!e||!t||!i||i.destroyed||i.destroying)return;this._windowDevicePixelRatio=window.devicePixelRatio;const r=this._computeCanvasSize();if(0!==r.width&&0!==r.height&&(t.width===r.width&&t.height===r.height||(t.width=r.width,t.height=r.height),this.view.state)){const e=this.view.state.camera;e.fullWidth===r.width&&e.fullHeight===r.height&&e.pixelRatio===r.pixelRatio||(X.copyFrom(e),X.pixelRatio!==r.pixelRatio&&(this._paddingToArray(this.padding,r.pixelRatio,Y),X.padding=Y),X.fullWidth=r.width,X.fullHeight=r.height,X.pixelRatio=r.pixelRatio,this.view.state.camera=X),this._updateState()}}_updateElevation(e){const t=this.view.renderCoordsHelper?.getAltitude(e.eye)??0,i=this.view.basemapTerrain?.spatialReference,r=i?b(this.view,e.eye):0;e.relativeElevation=t-r}_updateState(){null!=this.test.renderState?this.view.state.mode=this.test.renderState:this.view.animation?this.view.state.mode=0:this.view.interacting?this.view.state.mode=1:(0===this.view.state.mode&&(this._cameraChangeTime=0),performance.now()-this._cameraChangeTime<this._idleTimeout?this.view.state.mode=1:this.view.state.mode=2),this.view.state.rasterPixelRatio=this._rasterPixelRatio}_cameraChangedHandler(e,t){e&&t&&e.almostEquals(t)||(this._cameraChangeTime=performance.now(),this._updateState())}};e([m({type:t,dependsOn:["view.state.camera","ready"]})],q.prototype,"camera",null),e([m({type:t,dependsOn:["view.state.contentCamera","ready"]})],q.prototype,"contentCamera",null),e([m({type:y})],q.prototype,"center",null),e([m()],q.prototype,"visibleArea",null),e([m({type:_})],q.prototype,"extent",null),e([m({readOnly:!0})],q.prototype,"frustum",null),e([m()],q.prototype,"_constraintsManager",void 0),e([m({readOnly:!0})],q.prototype,"constraintsManager",null),e([m()],q.prototype,"_initialViewpoint",null),e([m({readOnly:!0})],q.prototype,"hasInitialView",null),e([m({readOnly:!0,type:Boolean})],q.prototype,"ready",void 0),e([m({type:Number})],q.prototype,"scale",null),e([m()],q.prototype,"padding",null),e([m({readOnly:!0})],q.prototype,"screenCenter",null),e([m({constructOnly:!0})],q.prototype,"view",void 0),e([m({type:i})],q.prototype,"viewpoint",null),e([m({type:Number})],q.prototype,"zoom",null),e([m({readOnly:!0})],q.prototype,"_rasterPixelRatio",null),e([m({readOnly:!0})],q.prototype,"_usePhysicalPixelRendering",null),e([m({readOnly:!0})],q.prototype,"_usePhysicalPixelRenderingAny",null),e([m()],q.prototype,"_windowDevicePixelRatio",void 0),e([m()],q.prototype,"_devicePixelRatioOverride",void 0),q=e([d("esri.views.3d.state.ViewStateManager")],q);class W{constructor(){this.width=0,this.height=0,this.pixelRatio=1}}const Z=new Set(["camera","viewpoint","extent","scale","center","zoom"]),J=[{propertyName:"camera",overrides:["viewpoint"]},{propertyName:"viewpoint",overrides:["extent"]},{propertyName:"extent",overrides:["center","scale"]},{propertyName:"center",overrides:[]},{propertyName:"scale",overrides:["zoom"]},{propertyName:"zoom",overrides:[]},{propertyName:"padding",overrides:[]}],K={heading:0,tilt:0};let Q=new t,X=new F;const Y=g(),$="pending-initial-view",ee="content-camera-reset",te=300,ie=100;function re(){Q=new t,X=new F}export{q as ViewStateManager,re as cleanupViewStateManager,ie as interactingTimeout};
5
+ import{__decorate as e}from"tslib";import t from"../../../Camera.js";import i from"../../../Viewpoint.js";import r from"../../../core/Accessor.js";import a from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{on as n,watch as o,sync as h,when as l}from"../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../core/scheduling.js";import{createScreenPoint as p}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 d}from"../../../core/accessorSupport/decorators/subclass.js";import{s as v}from"../../../chunks/vec32.js";import{fromArray as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as w}from"../../../chunks/vec42.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import y from"../../../geometry/Extent.js";import _ from"../../../geometry/Point.js";import f from"../../../geometry/Polygon.js";import{isLoadedOrLoadFor as C,requiresLoad as x}from"../../../geometry/projectionUtils.js";import{fromRenderCamera as R,toRenderCamera as P}from"../webgl.js";import{applyAll as S}from"../camera/constraintUtils.js";import{cameraOnContentAlongViewDirection as O,surfaceElevationBelowRenderLocation as b}from"../camera/intersectionUtils.js";import{ConstraintsManager as T}from"./ConstraintsManager.js";import{Frustum as j}from"./Frustum.js";import{GoToOperation as z}from"./GoToOperation.js";import{SurfaceCollisionCorrectionController as M}from"./controllers/SurfaceCollisionCorrectionController.js";import{toArea as I,toExtent as H,applyTiltAdjustToScale as L,scaleToZoom as B,fromExtentSync as E,getObserverForPointAtDistanceSync as V,viewScaleToCameraDistance as A,zoomToScale as U}from"../support/cameraUtils.js";import{fromCamera as k,toCameraSync as D}from"../support/viewpointUtils.js";import F from"../webgl/RenderCamera.js";import{PropertiesPool as G}from"../../support/PropertiesPool.js";import{ensureAttachmentMaxSize as N}from"../../webgl/FramebufferObject.js";let q=class extends r{constructor(e){super(e),this.ready=!1,this._windowDevicePixelRatio=1,this._devicePixelRatioOverride=null,this._idleTimeout=te,this.test={viewStateManager:this,contentCameraResetState:new Map,setDevicePixelRatio:e=>this._devicePixelRatioOverride=e,getDevicePixelRatioOverride:()=>this._devicePixelRatioOverride,renderState:null,get maximumPixelRatio(){return this.viewStateManager.view.qualitySettings.maximumPixelRatio},get updatingIgnoreRenderState(){return null!=this.renderState},get idleTimeoutEnabled(){return this.viewStateManager._idleTimeout>0},set idleTimeoutEnabled(e){this.viewStateManager._idleTimeout=e?te:0}},this._propertiesPool=new G({frustum:()=>new j(null)},this),this._cameraSetByUser=!1,this._gotoOperation=null,this._cameraChangeTime=0,this._tmpCanvasSize=new W}initialize(){this._cameraChangeTime=performance.now(),this.addHandles([n(()=>this.view.state.events,"before-camera-change",({camera:e})=>e&&this._updateElevation(e)),o(()=>this.view.state?.camera,(e,t)=>this._cameraChangedHandler(e,t),h)]),l(()=>this.view.state?.camera,e=>this._updateElevation(e),{once:!0,sync:!0}),this.addHandles([c({prepare:()=>this._prepareFrame()}),o(()=>this.view.state.cameraController,()=>{this._cameraSetByUser=!0,this.removeHandles($)}),n(()=>this.view.state.events,"camera-projection-changed",()=>this.notifyChange("scale"))])}destroy(){this.exit(),this._propertiesPool=s(this._propertiesPool)}get camera(){const e=this._get("camera");if(!this.ready)return e;const t=R(this.view,this.view.state.camera,Q);return t&&e&&t.equals(e)?e:t.clone()}set camera(e){if(this._updatePropertyBeforeReady("camera",e))return;this.view.elevationProvider.enableCache(!0);const t=P(this.view,e);t?this.setStateCamera(t,{applyConstraints:!1})||a.getLogger(this).warnOnce("#camera=","There is a currently active camera controller that has priority."):a.getLogger(this).error("#camera=","Invalid camera",e),this.view.elevationProvider.enableCache(!1)}get contentCamera(){const e=this._get("contentCamera");if(!this.ready)return e;const t=R(this.view,this.view.state.contentCamera,Q);return t&&e&&t.equals(e)?e:t.clone()}set contentCamera(e){if(this._updatePropertyBeforeReady("contentCamera",e))return;const t=P(this.view,e);this.view.state.contentCamera=null!=t?t:null}installContentCameraReset(e){if(this.removeHandles(ee),this.test.contentCameraResetState.clear(),!this.view.state.fixedContentCamera)return!1;const t=this.zoom,i=this.view.state.camera.distance**2,r=u(this.view.state.camera.center),a=e.sticky?this.contentCamera.clone():null;return this.addHandles([o(()=>this.contentCamera,()=>{e.sticky||(this.removeHandles(ee),this.test.contentCameraResetState.clear())}),o(()=>this.zoom,e=>{void 0!==e&&void 0!==t&&(this.test.contentCameraResetState.set("view.zoom",Math.abs(e-t)/2),Math.abs(e-t)>2?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a))}),o(()=>this.view.state.camera,e=>{const t=v(r,e.center);this.test.contentCameraResetState.set("camera.center",t/i),t>i?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a)})],ee),!0}get center(){return this.ready?this.view.pointsOfInterest.centerOnContent.location:this._get("center")}set center(e){this._updatePropertyBeforeReady("center",e)||(e?this.isCompatible(e)?this.setStateCamera(this._centerToCamera(e),{applyConstraints:!0})?this.view.pointsOfInterest.centerOnContent.runTask():a.getLogger(this).error("#center=","Invalid center",e):a.getLogger(this).error("#center=","Center has an incompatible spatial reference (center: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#center=","Center may not be null or undefined"))}get visibleArea(){if(!this.ready){const e=this._get("extent");return e?f.fromExtent(e):null}return I(this.view,this.view.pointsOfInterest.focus.renderLocation)}get extent(){if(!this.ready)return this._get("extent");const e=this.view,t=H(e,e.state.camera,e.pointsOfInterest.centerOnContent.renderLocation);return null!=t?t:this._get("extent")}set extent(e){this._updatePropertyBeforeReady("extent",e)||(e?this.isCompatible(e)?this.setStateCamera(this._extentToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#extent=","Invalid extent",e):a.getLogger(this).error("#extent=","Extent has an incompatible spatial reference (extent: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#extent=","Extent may not be null or undefined"))}get frustum(){const e=this._propertiesPool.get("frustum");return e.renderCoordsHelper=this.view.renderCoordsHelper,e.update(this.view.state.camera),e}get constraintsManager(){return this._constraintsManager}get _initialViewpoint(){const e=this.view.map;return e&&"initialViewProperties"in e?e.initialViewProperties?.viewpoint:void 0}get hasInitialView(){return!!this._initialViewpoint}get scale(){if(!this.ready)return this._get("scale");const e=this.view.basemapTerrain.tilingScheme,t=this.view.pointsOfInterest.cameraOnSurface.scale;return e&&t?L(this.view,t,this.view.state.contentCamera,e):this._get("scale")}set scale(e){this._updatePropertyBeforeReady("scale",e)||this.setStateCamera(this._scaleToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#scale=","Invalid scale",e)}get padding(){if(!this.ready)return this._get("padding");const e=this.view.state.camera,t=e.padding,i=e.pixelRatio,r=this._get("padding"),a=Math.round(t[0]/i),s=Math.round(t[1]/i),n=Math.round(t[2]/i),o=Math.round(t[3]/i);return null!=r&&r.top===a&&r.right===s&&r.bottom===n&&r.left===o?r:{top:a,right:s,bottom:n,left:o}}set padding(e){this._updatePropertyBeforeReady("padding",e)||(this._paddingToArray(e,this.view.state.camera.pixelRatio,Y),this.view.state.updateCamera(e=>e.padding=Y))}_paddingToArray(e,t,i){e?w(i,e.top||0,e.right||0,e.bottom||0,e.left||0):w(i,0,0,0,0);for(let r=0;r<4;r++)i[r]=Math.round(i[r]*t)}get screenCenter(){const e=this.padding;return p((this.view.width-(e.left+e.right))/2+e.left,(this.view.height-(e.top+e.bottom))/2+e.top)}get viewpoint(){return this.ready?k(this.view,this.camera):this._get("viewpoint")}set viewpoint(e){if(!this._updatePropertyBeforeReady("viewpoint",e))if(e){if(!this.isCompatible(e)){const t=null!=e.camera?e.camera.position:e.targetGeometry,i=null!=t&&t.spatialReference;return void a.getLogger(this).error("#viewpoint=","Viewpoint has an incompatible spatial reference (viewpoint: "+(i?i.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e)}this.setStateCamera(this._viewpointToCamera(e),{applyConstraints:!e.camera})||a.getLogger(this).error("#viewpoint=","Invalid viewpoint",e)}else a.getLogger(this).error("#viewpoint=","Viewpoint may not be null or undefined")}get zoom(){return this.ready?B(this.view,this.scale):this._get("zoom")}set zoom(e){this._updatePropertyBeforeReady("zoom",e)||void 0===e||this.setStateCamera(this._zoomToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#zoom=","Invalid zoom",e)}_computeCanvasSize(){if(this._devicePixelRatioOverride)return this.view.state.contentPixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*this._devicePixelRatioOverride),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*this._devicePixelRatioOverride),this._tmpCanvasSize.pixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize;const e=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio),t=(this._usePhysicalPixelRendering?this._windowDevicePixelRatio:e)*this.view.resolutionScale;this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*t),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*t);const i=this.view.stage.renderView.renderingContext?.parameters.maxTextureSize;return i&&N(this._tmpCanvasSize,i),this._tmpCanvasSize.pixelRatio=this._tmpCanvasSize.width>0?this._tmpCanvasSize.width/this.view.surface.clientWidth*.5+this._tmpCanvasSize.height/this.view.surface.clientHeight*.5:t,this.view.state&&(this.view.state.contentPixelRatio=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)),this._tmpCanvasSize}get _rasterPixelRatio(){return null!=this._devicePixelRatioOverride?this._devicePixelRatioOverride:this._usePhysicalPixelRenderingAny?this._windowDevicePixelRatio:Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)}get _usePhysicalPixelRendering(){return this.view?.stage?.renderer.isFeatureEnabled(8)??!1}get _usePhysicalPixelRenderingAny(){const e=this.view?.stage?.renderer;return e&&(e.isFeatureEnabled(8,2)||e.isFeatureEnabled(8,1)||e.isFeatureEnabled(8,0))}preinit(e){return!(this._isOverridden("center")&&!C(this.center.spatialReference,e))&&(!(this._isOverridden("camera")&&!C(this.camera.position.spatialReference,e))&&(!(this._isOverridden("extent")&&!C(this.extent.spatialReference,e))&&!!(!this._isOverridden("viewpoint")||C(this.viewpoint.targetGeometry?.spatialReference,e)&&C(this.viewpoint.camera?.position?.spatialReference,e))))}init(){this._constraintsManager=new T({view:this.view}),this._prepareFrame();const e=this._getInitialProperties();this._cameraSetByUser=!1,this._set("ready",!0);for(const t of e)this.set(t.name,t.value);if(!this._cameraSetByUser){const e=this._initialViewpoint||this.view.initialExtent;e&&this.isCompatible(e)?this._setInitialView(e):2===this.view.state.viewingMode&&this.addHandles(l(()=>this.view.basemapTerrain.ready,()=>{this.removeHandles($),this._setInitialView(this.view.dataExtent)},{once:!0,initial:!0}),$)}}exit(){this._cancelGoToOperation(),this.ready&&(this._override("padding",this.padding),this._set("ready",!1),this._clearOverride("hasInitialView"),this._cameraSetByUser=!1,this.removeHandles($),this._constraintsManager=s(this._constraintsManager))}async goTo(e,t){return t={animate:!0,...t},null!=this._gotoOperation&&this._gotoOperation.abort(t.animate),this._gotoOperation=new z(e,t,this.view),this.view.resourceController.scheduler.stopFrame(),this._gotoOperation.promise}debugSetCameraOnContent(){this.setStateCamera(O(this.view),{applyConstraints:!1})}step(e){const t=this.view.state?.cameraController;t?.stepController&&this.view.state.updateCamera(i=>t.stepController(e,i))}_cancelGoToOperation(){null!=this._gotoOperation&&(this._gotoOperation.abort(),this._gotoOperation=null)}_getInitialProperties(){const e=new Set,t=[];for(const{propertyName:i,overrides:r}of J){const a=e.has(i),s=this._isOverridden(i);!a&&s&&t.push({name:i,value:this._get(i)}),this._clearOverride(i),(a||s)&&r.forEach(t=>e.add(t))}return t}_setInitialView(e){if(null==e||this._cameraSetByUser)return;if(e instanceof t)return void this.setStateCamera(P(this.view,e),{applyConstraints:!1});if(e instanceof i){if(e.targetGeometry instanceof y){const t=E(this.view,e.targetGeometry,0,.5,0);return void(null!=t&&this.setStateCamera(P(this.view,t),{applyConstraints:!0}))}const t={applyConstraints:!e.camera},i=this._viewpointToCamera(e);return void this.setStateCamera(i,t)}const r=E(this.view,e,0,.5,0);null!=r&&this.setStateCamera(P(this.view,r),{applyConstraints:!0})}_updatePropertyBeforeReady(e,t){return!this.ready&&(this._override(e,t),t&&Z.has(e)&&this._override("hasInitialView",!0),!0)}isCompatible(e){return null!=e&&(e instanceof i?e.camera?this.isCompatible(e.camera):this.isCompatible(e.targetGeometry):e instanceof t?this.isCompatible(e.position):e.spatialReference&&!x(e.spatialReference,this.view.spatialReference))}_getPreservingHeadingTilt(e=K){return this._cameraSetByUser?(e.heading=this.camera.heading,e.tilt=this.camera.tilt):(e.heading=0,e.tilt=.5),e}_centerPointAtDistanceToCamera(e,t,i=X){const{heading:r,tilt:a}=this._getPreservingHeadingTilt(),s=V(this.view,r,a,e,t,1);return null==s?null:(i.copyFrom(this.view.state.camera),i.eye=s.eye,i.center=s.center,i.up=s.up,i)}_centerToCamera(e){let t;if(e.hasZ)t=this.view.state.camera.distance;else{const{centerOnContent:e}=this.view.pointsOfInterest;e.runTask(),t=e.distance}return this._centerPointAtDistanceToCamera(e,t)}_extentToCamera(e){const{heading:t,tilt:i}=this._getPreservingHeadingTilt(),r=E(this.view,e,t,i,1,Q);return r?P(this.view,r):null}_scaleToCamera(e){if(null==e)return null;const t=this.view,i=t.pointsOfInterest.centerOnContent;i.runTask();const r=i.renderLocation,a=t.pointsOfInterest.cameraOnSurface.renderLocation,s=A(t,e,r,a);return this._centerPointAtDistanceToCamera(r,s)}_zoomToCamera(e){return this._scaleToCamera(U(this.view,e))}_viewpointToCamera(e){return P(this.view,D(this.view,e))}setStateCamera(e,t){return!(null==e||!this.view.state.stopActiveCameraController())&&(this._cameraSetByUser=!0,t.doNotCancelGoToOperation||this._cancelGoToOperation(),this.view.state.updateCamera(i=>{t.positionAndOrientationOnly?(i.eye=e.eye,i.center=e.center,i.up=e.up,i.fov=e.fov):i.copyFrom(e),t.applyConstraints&&S(this.view,i)}),t.applyConstraints||(this.view.state.cameraController=new M({view:this.view,desiredCamera:e})),!0)}_prepareFrame(){const{surface:e,canvas:t,stage:i}=this.view;if(!e||!t||!i||i.destroyed||i.destroying)return;this._windowDevicePixelRatio=window.devicePixelRatio;const r=this._computeCanvasSize();if(0!==r.width&&0!==r.height&&(t.width===r.width&&t.height===r.height||(t.width=r.width,t.height=r.height),this.view.state)){const e=this.view.state.camera;e.fullWidth===r.width&&e.fullHeight===r.height&&e.pixelRatio===r.pixelRatio||(X.copyFrom(e),X.pixelRatio!==r.pixelRatio&&(this._paddingToArray(this.padding,r.pixelRatio,Y),X.padding=Y),X.fullWidth=r.width,X.fullHeight=r.height,X.pixelRatio=r.pixelRatio,this.view.state.camera=X),this._updateState()}}_updateElevation(e){const t=this.view.renderCoordsHelper?.getAltitude(e.eye)??0,i=this.view.basemapTerrain?.spatialReference,r=i?b(this.view,e.eye):0;e.relativeElevation=t-r}_updateState(){null!=this.test.renderState?this.view.state.mode=this.test.renderState:this.view.animation?this.view.state.mode=0:this.view.interacting?this.view.state.mode=1:(0===this.view.state.mode&&(this._cameraChangeTime=0),performance.now()-this._cameraChangeTime<this._idleTimeout?this.view.state.mode=1:this.view.state.mode=2),this.view.state.rasterPixelRatio=this._rasterPixelRatio}_cameraChangedHandler(e,t){e&&t&&e.almostEquals(t)||(this._cameraChangeTime=performance.now(),this._updateState())}};e([m({type:t,dependsOn:["view.state.camera","ready"]})],q.prototype,"camera",null),e([m({type:t,dependsOn:["view.state.contentCamera","ready"]})],q.prototype,"contentCamera",null),e([m({type:_})],q.prototype,"center",null),e([m()],q.prototype,"visibleArea",null),e([m({type:y})],q.prototype,"extent",null),e([m({readOnly:!0})],q.prototype,"frustum",null),e([m()],q.prototype,"_constraintsManager",void 0),e([m({readOnly:!0})],q.prototype,"constraintsManager",null),e([m()],q.prototype,"_initialViewpoint",null),e([m({readOnly:!0})],q.prototype,"hasInitialView",null),e([m({readOnly:!0,type:Boolean})],q.prototype,"ready",void 0),e([m({type:Number})],q.prototype,"scale",null),e([m()],q.prototype,"padding",null),e([m({readOnly:!0})],q.prototype,"screenCenter",null),e([m({constructOnly:!0})],q.prototype,"view",void 0),e([m({type:i})],q.prototype,"viewpoint",null),e([m({type:Number})],q.prototype,"zoom",null),e([m({readOnly:!0})],q.prototype,"_rasterPixelRatio",null),e([m({readOnly:!0})],q.prototype,"_usePhysicalPixelRendering",null),e([m({readOnly:!0})],q.prototype,"_usePhysicalPixelRenderingAny",null),e([m()],q.prototype,"_windowDevicePixelRatio",void 0),e([m()],q.prototype,"_devicePixelRatioOverride",void 0),q=e([d("esri.views.3d.state.ViewStateManager")],q);class W{constructor(){this.width=0,this.height=0,this.pixelRatio=1}}const Z=new Set(["camera","viewpoint","extent","scale","center","zoom"]),J=[{propertyName:"camera",overrides:["viewpoint"]},{propertyName:"viewpoint",overrides:["extent"]},{propertyName:"extent",overrides:["center","scale"]},{propertyName:"center",overrides:[]},{propertyName:"scale",overrides:["zoom"]},{propertyName:"zoom",overrides:[]},{propertyName:"padding",overrides:[]}],K={heading:0,tilt:0};let Q=new t,X=new F;const Y=g(),$="pending-initial-view",ee="content-camera-reset",te=300,ie=100;function re(){Q=new t,X=new F}export{q as ViewStateManager,re as cleanupViewStateManager,ie as interactingTimeout};
@@ -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{cyclicalPI as i}from"../../../../core/Cyclical.js";import{deg2rad as e}from"../../../../core/mathUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as s}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as r,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{d as m,u as h,b as c,e as _,n as p,g as u,h as l,f as d}from"../../../../chunks/vec32.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as P}from"../../../../geometry/ellipsoidUtils.js";import{wrapAxisAngle as v}from"../../../../geometry/support/axisAngle.js";import{create as C,fromPositionAndNormal as w,getNormal as M}from"../../../../geometry/support/plane.js";import{c as b,n as S,a as f}from"../../../../chunks/sphere.js";import{pixelDistanceToInteractionFactor as j,applyAll as E}from"../../camera/constraintUtils.js";import{ConstraintOptions as y}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as A}from"../../input/util.js";import{InteractiveController as O}from"./InteractiveController.js";import{PanPlanarMomentumController as R}from"./momentum/PanPlanarMomentumController.js";import{PanSphericalMomentumController as x}from"./momentum/PanSphericalMomentumController.js";import{RotationMomentumController as k}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as z}from"./momentum/ZoomPlanarMomentumController.js";import{ZoomSphericalMomentumController as F}from"./momentum/ZoomSphericalMomentumController.js";import{pickPointAndInitSphere as H,excludeTerrain as D,navigationMode as T,sphereOrPlanePointFromScreenPoint as U,maxPanDistanceModifier as G,minPinchAndPanCameraHeight as I,pivotSearchAreaSize as Z,intersectPlaneFromScreenPointAtEye as L,applyZoomOnSphere as V,shouldPreserveHeading as q,applyPanSphericalPreserveHeading as B,applyPanSphericalDirectRotation as J,normalizeRotationDelta as K,applyRotation as N,applyPanPlanar as Q,applyZoomToPoint as W}from"../utils/navigationUtils.js";import X from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as Y}from"../../../navigation/PanPlanarMomentumEstimator.js";import{PanSphericalMomentumEstimator as $}from"../../../navigation/PanSphericalMomentumEstimator.js";import{RotationMomentumEstimator as tt}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as it}from"../../../navigation/ZoomMomentumEstimator.js";let et=class extends O{constructor(){super(...arguments),this._smoothRotation=new A(.05),this._rotationAxis=g(),this._beginAngle=0,this._beginHeading=0,this._panningPlane=C(),this._beginRadius=0,this._smoothScaling=new A(.05),this._zoomCenterScreen=n(),this._zoomMomentumEstimator=new it,this._rotationMomentumEstimator=new tt,this._panSphericalMomentumEstimator=new $,this._panPlanarMomentumEstimator=new Y,this._adjustedSphere=b(),this._tmp3d=g(),this._tmpScreenPointArray=n(),this._beginScreenPoint=n(),this._beginScenePoint=g(),this._screenPickPoint=n(),this._scenePickPoint=g(),this._navMode=1,this._sphere=b(),this._pointerCount=0,this._tmpInteractionDirection=g(),this._beginCamera=new X,this._constraintOptions=new y(15,0,0,this._beginCamera)}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;this._zoomMomentumEstimator.enabled=this._rotationMomentumEstimator.enabled=this._panPlanarMomentumEstimator.enabled=this._panSphericalMomentumEstimator.enabled=this.view.navigation.momentumEnabled,this._beginHeading=-i.normalize(e(this.view.camera.heading)),this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._smoothRotation.reset(),s(t.center,this._screenPickPoint),r(this._beginScreenPoint,this._screenPickPoint);const n=H(this._intersectionHelper,this.startCamera,this._screenPickPoint,P(this.view.spatialReference).radius,1,this.view.basemapTerrain.invisible?D:{});null!=n.scenePickPoint&&(this._scenePickPoint=n.scenePickPoint,this._sphere=n.sphere,m(this._beginScenePoint,this._scenePickPoint),this._navMode=T(this.startCamera,this._screenPickPoint,this.view.renderCoordsHelper,this.view.viewingMode),0===this._navMode&&this._preparePlanarPanMode(t,n.hasGeometryIntersection),this._beginCamera.copyFrom(this.startCamera))}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1;1===this._navMode?(i&&this._zoomSpherical(t),this._panningSpherical(t),i&&this._rotateSpherical(t)):(i&&this._zoomPlanar(t),this._panningPlanar(t),i&&this._rotatePlanar(t)),this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this._zoomMomentumEstimator.evaluateMomentum();if(i)return 1===this._navMode?new F({view:this.view,momentum:i,screenCenter:this._zoomCenterScreen,sceneCenter:this._beginScenePoint,radius:this._sphere[3]}):new z({view:this.view,momentum:i,zoomCenter:this._beginScenePoint});const e=this._rotationMomentumEstimator.evaluateMomentum();if(e)return new k({view:this.view,momentum:e,center:S(this._sphere,g()),axis:this._rotationAxis});if(1===this._navMode){const t=this._panSphericalMomentumEstimator.evaluateMomentum();if(t)return new x({view:this.view,momentum:t})}else{const t=this._panPlanarMomentumEstimator.evaluateMomentum();if(t)return new R({view:this.view,momentum:t})}return null}_preparePlanarPanMode(t,i){const e=h(this._tmp3d,this.startCamera.viewForward);w(this._scenePickPoint,e,this._panningPlane);const o=n(this._screenPickPoint[0],0),r=g(),a=c(this.startCamera.eye);this._adjustedSphere[3]=a<this._sphere[3]?a-100:this._sphere[3],U(this._adjustedSphere,this.startCamera,o,r);const P=g(),v=g(),C=g();_(P,this._scenePickPoint,this.currentCamera.eye);const b=c(P);p(P,P);const S=G*Math.max(Math.abs(this.view.camera.position.z),I),f=this.view.stage.renderView.getMinimalDepthForArea(null,this._screenPickPoint[0],this._screenPickPoint[1],this.view.state.camera,Z);let j=null!=f?f:S;i&&(j=Math.min(j,b)),m(C,u(v,this.currentCamera.eye,l(v,P,j))),this._panningPlane[3]=-d(M(this._panningPlane),C),this.startCamera.center=u(v,this.startCamera.eye,l(v,this.startCamera.viewForward,j));const E=s(t.center,this._tmpScreenPointArray);L(this._panningPlane,this.startCamera,E,this._beginScenePoint)}_zoomSpherical(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),V(this._sphere,this.currentCamera,this._smoothScaling.value),s(t.center,this._zoomCenterScreen),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_panningSpherical(t){const i=s(t.center,this._tmpScreenPointArray);U(this._sphere,this.currentCamera,i,this._tmp3d),q(this._beginScenePoint,d(this.currentCamera.up,this._beginScenePoint),this._sphere[3],this._beginHeading,this.view.camera.tilt,this.startCamera.aboveGround)?(B(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this._beginHeading,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumPreserveHeading(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere,this._beginHeading,this.view.camera.tilt)):(J(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumDirectRotation(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere[3],this.view.camera.tilt)),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=j(a(this._screenPickPoint,i)),E(this.view,this.currentCamera,this._constraintOptions)}_rotateSpherical(t){p(this._rotationAxis,this._scenePickPoint),this.currentCamera.aboveGround||h(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value,e=i+K(t.angle-i),n=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=n,this._smoothRotation.update(e);const s=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(s,.001*t.timestamp),N(this.currentCamera,f(this._sphere),v(this._rotationAxis,s)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=j(t.radius*e),E(this.view,this.currentCamera,this._constraintOptions)}_panningPlanar(t){const i=s(t.center,this._tmpScreenPointArray);L(this._panningPlane,this.currentCamera,i,this._tmp3d)&&(Q(this.currentCamera,this._beginScenePoint,this._tmp3d),this._panPlanarMomentumEstimator.add(i,this._tmp3d,.001*t.timestamp),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=j(a(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this._tmpInteractionDirection),E(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null)}_zoomPlanar(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),W(this.currentCamera,this._beginScenePoint,this._smoothScaling.value,this.view.state.constraints.minimumPoiDistance),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_rotatePlanar(t){m(this._rotationAxis,this._beginScenePoint),this.currentCamera.aboveGround||h(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value;let e=t.angle-i;e=K(e);const n=i+e,s=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=s,this._smoothRotation.update(n);const o=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(o,.001*t.timestamp),N(this.currentCamera,f(this._sphere),v(this._rotationAxis,o)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=j(t.radius*o),E(this.view,this.currentCamera,this._constraintOptions)}};et=t([o("esri.views.3d.state.controllers.PinchAndPanControllerGlobal")],et);export{et as PinchAndPanControllerGlobal};
5
+ import{__decorate as t}from"tslib";import{cyclicalPI as i}from"../../../../core/Cyclical.js";import{deg2rad as e}from"../../../../core/mathUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as s}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as r,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{d as m,u as h,b as c,e as _,n as p,g as u,h as l,f as g}from"../../../../chunks/vec32.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as P}from"../../../../geometry/ellipsoidUtils.js";import{wrapAxisAngle as v}from"../../../../geometry/support/axisAngle.js";import{create as C,fromPositionAndNormal as w,getNormal as M}from"../../../../geometry/support/plane.js";import{c as b,n as S,a as f}from"../../../../chunks/sphere.js";import{pixelDistanceToInteractionFactor as j,applyAll as E}from"../../camera/constraintUtils.js";import{ConstraintOptions as y}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as A}from"../../input/util.js";import{InteractiveController as O}from"./InteractiveController.js";import{PanPlanarMomentumController as R}from"./momentum/PanPlanarMomentumController.js";import{PanSphericalMomentumController as x}from"./momentum/PanSphericalMomentumController.js";import{RotationMomentumController as k}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as z}from"./momentum/ZoomPlanarMomentumController.js";import{ZoomSphericalMomentumController as F}from"./momentum/ZoomSphericalMomentumController.js";import{pickPointAndInitSphere as H,excludeTerrain as D,inferNavigationMode as T,sphereOrPlanePointFromScreenPoint as U,maxPanDistanceModifier as G,minPinchAndPanCameraHeight as I,pivotSearchAreaSize as Z,intersectPlaneFromScreenPointAtEye as L,applyZoomOnSphere as V,shouldPreserveHeading as q,applyPanSphericalPreserveHeading as B,applyPanSphericalDirectRotation as J,normalizeRotationDelta as K,applyRotation as N,applyPanPlanar as Q,applyZoomToPoint as W}from"../utils/navigationUtils.js";import X from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as Y}from"../../../navigation/PanPlanarMomentumEstimator.js";import{PanSphericalMomentumEstimator as $}from"../../../navigation/PanSphericalMomentumEstimator.js";import{RotationMomentumEstimator as tt}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as it}from"../../../navigation/ZoomMomentumEstimator.js";let et=class extends O{constructor(){super(...arguments),this._smoothRotation=new A(.05),this._rotationAxis=d(),this._beginAngle=0,this._beginHeading=0,this._panningPlane=C(),this._beginRadius=0,this._smoothScaling=new A(.05),this._zoomCenterScreen=n(),this._zoomMomentumEstimator=new it,this._rotationMomentumEstimator=new tt,this._panSphericalMomentumEstimator=new $,this._panPlanarMomentumEstimator=new Y,this._adjustedSphere=b(),this._tmp3d=d(),this._tmpScreenPointArray=n(),this._beginScreenPoint=n(),this._beginScenePoint=d(),this._screenPickPoint=n(),this._scenePickPoint=d(),this._navigationMode=1,this._sphere=b(),this._pointerCount=0,this._tmpInteractionDirection=d(),this._beginCamera=new X,this._constraintOptions=new y(15,0,0,this._beginCamera)}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;this._zoomMomentumEstimator.enabled=this._rotationMomentumEstimator.enabled=this._panPlanarMomentumEstimator.enabled=this._panSphericalMomentumEstimator.enabled=this.view.navigation.momentumEnabled,this._beginHeading=-i.normalize(e(this.view.camera.heading)),this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._smoothRotation.reset(),s(t.center,this._screenPickPoint),r(this._beginScreenPoint,this._screenPickPoint);const n=H(this._intersectionHelper,this.startCamera,this._screenPickPoint,P(this.view.spatialReference).radius,1,this.view.basemapTerrain.invisible?D:{});null!=n.scenePickPoint&&(this._scenePickPoint=n.scenePickPoint,this._sphere=n.sphere,m(this._beginScenePoint,this._scenePickPoint),this._navigationMode=T(this.startCamera,this._screenPickPoint,this.view.renderCoordsHelper,this.view.viewingMode),0===this._navigationMode&&this._preparePlanarPanMode(t,n.hasGeometryIntersection),this._beginCamera.copyFrom(this.startCamera))}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1;1===this._navigationMode?(i&&this._zoomSpherical(t),this._panningSpherical(t),i&&this._rotateSpherical(t)):(i&&this._zoomPlanar(t),this._panningPlanar(t),i&&this._rotatePlanar(t)),this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this._zoomMomentumEstimator.evaluateMomentum();if(i)return 1===this._navigationMode?new F({view:this.view,momentum:i,screenCenter:this._zoomCenterScreen,sceneCenter:this._beginScenePoint,radius:this._sphere[3]}):new z({view:this.view,momentum:i,zoomCenter:this._beginScenePoint});const e=this._rotationMomentumEstimator.evaluateMomentum();if(e)return new k({view:this.view,momentum:e,center:S(this._sphere,d()),axis:this._rotationAxis});if(1===this._navigationMode){const t=this._panSphericalMomentumEstimator.evaluateMomentum();if(t)return new x({view:this.view,momentum:t})}else{const t=this._panPlanarMomentumEstimator.evaluateMomentum();if(t)return new R({view:this.view,momentum:t})}return null}_preparePlanarPanMode(t,i){const e=h(this._tmp3d,this.startCamera.viewForward);w(this._scenePickPoint,e,this._panningPlane);const o=n(this._screenPickPoint[0],0),r=d(),a=c(this.startCamera.eye);this._adjustedSphere[3]=a<this._sphere[3]?a-100:this._sphere[3],U(this._adjustedSphere,this.startCamera,o,r);const P=d(),v=d(),C=d();_(P,this._scenePickPoint,this.currentCamera.eye);const b=c(P);p(P,P);const S=G*Math.max(Math.abs(this.view.camera.position.z),I),f=this.view.stage.renderView.getMinimalDepthForArea(null,this._screenPickPoint[0],this._screenPickPoint[1],this.view.state.camera,Z);let j=null!=f?f:S;i&&(j=Math.min(j,b)),m(C,u(v,this.currentCamera.eye,l(v,P,j))),this._panningPlane[3]=-g(M(this._panningPlane),C),this.startCamera.center=u(v,this.startCamera.eye,l(v,this.startCamera.viewForward,j));const E=s(t.center,this._tmpScreenPointArray);L(this._panningPlane,this.startCamera,E,this._beginScenePoint)}_zoomSpherical(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),V(this._sphere,this.currentCamera,this._smoothScaling.value),s(t.center,this._zoomCenterScreen),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_panningSpherical(t){const i=s(t.center,this._tmpScreenPointArray);U(this._sphere,this.currentCamera,i,this._tmp3d),q(this._beginScenePoint,g(this.currentCamera.up,this._beginScenePoint),this._sphere[3],this._beginHeading,this.view.camera.tilt,this.startCamera.aboveGround)?(B(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this._beginHeading,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumPreserveHeading(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere,this._beginHeading,this.view.camera.tilt)):(J(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumDirectRotation(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere[3],this.view.camera.tilt)),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=j(a(this._screenPickPoint,i)),E(this.view,this.currentCamera,this._constraintOptions)}_rotateSpherical(t){p(this._rotationAxis,this._scenePickPoint),this.currentCamera.aboveGround||h(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value,e=i+K(t.angle-i),n=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=n,this._smoothRotation.update(e);const s=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(s,.001*t.timestamp),N(this.currentCamera,f(this._sphere),v(this._rotationAxis,s)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=j(t.radius*e),E(this.view,this.currentCamera,this._constraintOptions)}_panningPlanar(t){const i=s(t.center,this._tmpScreenPointArray);L(this._panningPlane,this.currentCamera,i,this._tmp3d)&&(Q(this.currentCamera,this._beginScenePoint,this._tmp3d),this._panPlanarMomentumEstimator.add(i,this._tmp3d,.001*t.timestamp),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=j(a(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this._tmpInteractionDirection),E(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null)}_zoomPlanar(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),W(this.currentCamera,this._beginScenePoint,this._smoothScaling.value,this.view.state.constraints.minimumPoiDistance),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_rotatePlanar(t){m(this._rotationAxis,this._beginScenePoint),this.currentCamera.aboveGround||h(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value;let e=t.angle-i;e=K(e);const n=i+e,s=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=s,this._smoothRotation.update(n);const o=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(o,.001*t.timestamp),N(this.currentCamera,f(this._sphere),v(this._rotationAxis,o)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=j(t.radius*o),E(this.view,this.currentCamera,this._constraintOptions)}};et=t([o("esri.views.3d.state.controllers.PinchAndPanControllerGlobal")],et);export{et as PinchAndPanControllerGlobal};
@@ -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{createScreenPointArray as i,screenPointObjectToArray as e}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{distance as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{u as o,d as r,f as a,e as m,b as h,n as l,h as c,g as p}from"../../../../chunks/vec32.js";import{create as _,fromValues as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrapAxisAngle as d}from"../../../../geometry/support/axisAngle.js";import{create as g,fromNormalAndOffset as C,setOffsetFromPoint as v,negate as b,getNormal as w}from"../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as M,applyAll as f}from"../../camera/constraintUtils.js";import{ConstraintOptions as j}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as P}from"../../input/util.js";import{getVoxelWasm as V}from"../../layers/VoxelWasm.js";import{InteractiveController as z}from"./InteractiveController.js";import{PanPlanarMomentumController as S}from"./momentum/PanPlanarMomentumController.js";import{RotationMomentumController as E}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as H}from"./momentum/ZoomPlanarMomentumController.js";import{excludeTerrain as y,navigationMode as x,getTiltScaleFactor as O,maxPanDistanceModifier as F,minPinchAndPanCameraHeight as R,pivotSearchAreaSize as A,centroid as T,applyZoomToPoint as U,applyPanPlanar as L,normalizeRotationDelta as k,applyRotation as D,intersectPlaneFromScreenPointAtEye as G}from"../utils/navigationUtils.js";import I from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as Z}from"../../../navigation/PanPlanarMomentumEstimator.js";import{RotationMomentumEstimator as W}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as q}from"../../../navigation/ZoomMomentumEstimator.js";const B=u(0,0,1);let J=class extends z{constructor(){super(...arguments),this._rotationValueSmooth=new P(.05),this._scalingValueSmooth=new P(.05),this._planeHorizontal=g(),this._planeVertical=g(),this._rotationMomentumEstimator=new W,this._panMomentumEstimator=new Z(300,12,.9),this._zoomMomentumEstimator=new q,this._beginRadius=0,this._beginCenter=_(),this._beginAngle=0,this._tmpPoints=[],this._navMode=1,this._beginCenterScreen=i(),this._tmpCentroid3d=_(),this._tmpCentroid2d=i(),this._tmp2d=i(),this._pointerCount=0,this._beginCamera=new I,this._constraintOptions=new j(15,0,0,this._beginCamera)}begin(t){if(!this.running)return;const i=this.view.navigation.momentumEnabled;this._zoomMomentumEstimator.enabled=i,this._rotationMomentumEstimator.enabled=i,this._panMomentumEstimator.enabled=i,this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._rotationValueSmooth.reset(),this._scalingValueSmooth.reset(),e(t.center,this._beginCenterScreen),C(B,0,this._planeHorizontal);const n=_(),s=this._intersectionHelper.intersectScreenFreePointFallback(this._beginCenterScreen,n,this.view.basemapTerrain.invisible?y:{}),u=_();o(u,this.startCamera.viewForward);const d=_();r(d,B);const g=a(u,d);this._navMode=x(this.startCamera,this._beginCenterScreen,this.view.renderCoordsHelper,this.view.viewingMode);const M=O(d,this.startCamera.viewForward,F)*Math.max(Math.abs(this.view.camera.position.z),R);v(this._planeHorizontal,this._planeHorizontal,n),this.startCamera.aboveGround||b(this._planeHorizontal,this._planeHorizontal);const f=_(),j=_(),P=_();m(f,n,this.currentCamera.eye);const z=h(f);if(l(f,f),0===this._navMode){c(d,d,g),m(w(this._planeVertical),u,d),l(w(this._planeVertical),w(this._planeVertical)),v(this._planeVertical,this._planeVertical,n);const i=this.view.stage.renderView.getMinimalDepthForArea(V(this.view),this._beginCenterScreen[0],this._beginCenterScreen[1],this.view.state.camera,A);let e=null!=i?i:M;s&&(e=Math.min(e,z)),r(P,p(j,this.currentCamera.eye,c(j,f,e))),this._planeVertical[3]=-a(w(this._planeVertical),P),this._computePlanePoints(t.pointers,this._planeVertical,this.startCamera,this._tmpPoints),T(this._tmpPoints,this._beginCenter)}else{const i=s?z:M;r(P,p(j,this.currentCamera.eye,c(j,f,i))),this._planeHorizontal[3]=-a(w(this._planeHorizontal),P),this._computePlanePoints(t.pointers,this._planeHorizontal,this.startCamera,this._tmpPoints),T(this._tmpPoints,this._beginCenter)}this._beginCamera.copyFrom(this.startCamera)}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1,n=1===this._navMode?this._planeHorizontal:this._planeVertical,o=this._beginCenter;if(i){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._scalingValueSmooth.gain=e,this._scalingValueSmooth.update(i),U(this.currentCamera,o,this._scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance),this._zoomMomentumEstimator.add(this._scalingValueSmooth.value,.001*t.timestamp),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=M(Math.abs(t.radius-this._beginRadius)),f(this.view,this.currentCamera,this._constraintOptions)}if(this._computePlanePoints(t.pointers,n,this.currentCamera,this._tmpPoints),T(this._tmpPoints,this._tmpCentroid3d),e(t.center,this._tmpCentroid2d),L(this.currentCamera,o,this._tmpCentroid3d),this._panMomentumEstimator.add(this._tmpCentroid2d,this._tmpCentroid3d,.001*t.timestamp),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=M(s(this._beginCenterScreen,this._tmpCentroid2d)),f(this.view,this.currentCamera,this._constraintOptions),i){const i=o,e=this._rotationValueSmooth.value,n=e+k(t.angle-e),s=.00125*Math.min(Math.max(t.radius,40),120);this._rotationValueSmooth.gain=s,this._rotationValueSmooth.update(n);const r=this._rotationValueSmooth.value-this._beginAngle;this._rotationMomentumEstimator.add(r,.001*t.timestamp);const a=w(this._planeHorizontal);D(this.currentCamera,i,d(a,r)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=M(Math.abs(t.radius*r)),f(this.view,this.currentCamera,this._constraintOptions)}this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this._zoomMomentumEstimator.evaluateMomentum();if(i)return new H({view:this.view,momentum:i,zoomCenter:this._beginCenter});const e=this._rotationMomentumEstimator.evaluateMomentum();if(e)return new E({view:this.view,momentum:e,center:this._beginCenter,axis:w(this._planeHorizontal)});const n=this._panMomentumEstimator.evaluateMomentum();return n?new S({view:this.view,momentum:n}):null}_computePlanePoints(t,i,e,n){n.length=t.size;const s=this._tmp2d;let o=0;return t.forEach(t=>{s[0]=t.x,s[1]=t.y,void 0===n[o]&&(n[o]=_()),G(i,e,s,n[o]),o+=1}),n}get _intersectionHelper(){return this.view.sceneIntersectionHelper}};J=t([n("esri.views.3d.state.controllers.PinchAndPanControllerLocal")],J);export{J as PinchAndPanControllerLocal};
5
+ import{__decorate as t}from"tslib";import{createScreenPointArray as i,screenPointObjectToArray as e}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{distance as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{u as o,d as r,f as a,e as m,b as h,n as l,h as c,g as p}from"../../../../chunks/vec32.js";import{create as _,fromValues as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrapAxisAngle as g}from"../../../../geometry/support/axisAngle.js";import{create as d,fromNormalAndOffset as C,setOffsetFromPoint as v,negate as b,getNormal as w}from"../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as M,applyAll as f}from"../../camera/constraintUtils.js";import{ConstraintOptions as j}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as P}from"../../input/util.js";import{getVoxelWasm as V}from"../../layers/VoxelWasm.js";import{InteractiveController as z}from"./InteractiveController.js";import{PanPlanarMomentumController as S}from"./momentum/PanPlanarMomentumController.js";import{RotationMomentumController as E}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as H}from"./momentum/ZoomPlanarMomentumController.js";import{excludeTerrain as y,inferNavigationMode as x,getTiltScaleFactor as O,maxPanDistanceModifier as F,minPinchAndPanCameraHeight as R,pivotSearchAreaSize as A,centroid as T,applyZoomToPoint as U,applyPanPlanar as L,normalizeRotationDelta as k,applyRotation as D,intersectPlaneFromScreenPointAtEye as G}from"../utils/navigationUtils.js";import I from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as Z}from"../../../navigation/PanPlanarMomentumEstimator.js";import{RotationMomentumEstimator as W}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as q}from"../../../navigation/ZoomMomentumEstimator.js";const B=u(0,0,1);let J=class extends z{constructor(){super(...arguments),this._rotationValueSmooth=new P(.05),this._scalingValueSmooth=new P(.05),this._planeHorizontal=d(),this._planeVertical=d(),this._rotationMomentumEstimator=new W,this._panMomentumEstimator=new Z(300,12,.9),this._zoomMomentumEstimator=new q,this._beginRadius=0,this._beginCenter=_(),this._beginAngle=0,this._tmpPoints=[],this._navigationMode=1,this._beginCenterScreen=i(),this._tmpCentroid3d=_(),this._tmpCentroid2d=i(),this._tmp2d=i(),this._pointerCount=0,this._beginCamera=new I,this._constraintOptions=new j(15,0,0,this._beginCamera)}begin(t){if(!this.running)return;const i=this.view.navigation.momentumEnabled;this._zoomMomentumEstimator.enabled=i,this._rotationMomentumEstimator.enabled=i,this._panMomentumEstimator.enabled=i,this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._rotationValueSmooth.reset(),this._scalingValueSmooth.reset(),e(t.center,this._beginCenterScreen),C(B,0,this._planeHorizontal);const n=_(),s=this._intersectionHelper.intersectScreenFreePointFallback(this._beginCenterScreen,n,this.view.basemapTerrain.invisible?y:{}),u=_();o(u,this.startCamera.viewForward);const g=_();r(g,B);const d=a(u,g);this._navigationMode=x(this.startCamera,this._beginCenterScreen,this.view.renderCoordsHelper,this.view.viewingMode);const M=O(g,this.startCamera.viewForward,F)*Math.max(Math.abs(this.view.camera.position.z),R);v(this._planeHorizontal,this._planeHorizontal,n),this.startCamera.aboveGround||b(this._planeHorizontal,this._planeHorizontal);const f=_(),j=_(),P=_();m(f,n,this.currentCamera.eye);const z=h(f);if(l(f,f),0===this._navigationMode){c(g,g,d),m(w(this._planeVertical),u,g),l(w(this._planeVertical),w(this._planeVertical)),v(this._planeVertical,this._planeVertical,n);const i=this.view.stage.renderView.getMinimalDepthForArea(V(this.view),this._beginCenterScreen[0],this._beginCenterScreen[1],this.view.state.camera,A);let e=null!=i?i:M;s&&(e=Math.min(e,z)),r(P,p(j,this.currentCamera.eye,c(j,f,e))),this._planeVertical[3]=-a(w(this._planeVertical),P),this._computePlanePoints(t.pointers,this._planeVertical,this.startCamera,this._tmpPoints),T(this._tmpPoints,this._beginCenter)}else{const i=s?z:M;r(P,p(j,this.currentCamera.eye,c(j,f,i))),this._planeHorizontal[3]=-a(w(this._planeHorizontal),P),this._computePlanePoints(t.pointers,this._planeHorizontal,this.startCamera,this._tmpPoints),T(this._tmpPoints,this._beginCenter)}this._beginCamera.copyFrom(this.startCamera)}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1,n=1===this._navigationMode?this._planeHorizontal:this._planeVertical,o=this._beginCenter;if(i){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._scalingValueSmooth.gain=e,this._scalingValueSmooth.update(i),U(this.currentCamera,o,this._scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance),this._zoomMomentumEstimator.add(this._scalingValueSmooth.value,.001*t.timestamp),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=M(Math.abs(t.radius-this._beginRadius)),f(this.view,this.currentCamera,this._constraintOptions)}if(this._computePlanePoints(t.pointers,n,this.currentCamera,this._tmpPoints),T(this._tmpPoints,this._tmpCentroid3d),e(t.center,this._tmpCentroid2d),L(this.currentCamera,o,this._tmpCentroid3d),this._panMomentumEstimator.add(this._tmpCentroid2d,this._tmpCentroid3d,.001*t.timestamp),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=M(s(this._beginCenterScreen,this._tmpCentroid2d)),f(this.view,this.currentCamera,this._constraintOptions),i){const i=o,e=this._rotationValueSmooth.value,n=e+k(t.angle-e),s=.00125*Math.min(Math.max(t.radius,40),120);this._rotationValueSmooth.gain=s,this._rotationValueSmooth.update(n);const r=this._rotationValueSmooth.value-this._beginAngle;this._rotationMomentumEstimator.add(r,.001*t.timestamp);const a=w(this._planeHorizontal);D(this.currentCamera,i,g(a,r)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=M(Math.abs(t.radius*r)),f(this.view,this.currentCamera,this._constraintOptions)}this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this._zoomMomentumEstimator.evaluateMomentum();if(i)return new H({view:this.view,momentum:i,zoomCenter:this._beginCenter});const e=this._rotationMomentumEstimator.evaluateMomentum();if(e)return new E({view:this.view,momentum:e,center:this._beginCenter,axis:w(this._planeHorizontal)});const n=this._panMomentumEstimator.evaluateMomentum();return n?new S({view:this.view,momentum:n}):null}_computePlanePoints(t,i,e,n){n.length=t.size;const s=this._tmp2d;let o=0;return t.forEach(t=>{s[0]=t.x,s[1]=t.y,void 0===n[o]&&(n[o]=_()),G(i,e,s,n[o]),o+=1}),n}get _intersectionHelper(){return this.view.sceneIntersectionHelper}};J=t([n("esri.views.3d.state.controllers.PinchAndPanControllerLocal")],J);export{J as PinchAndPanControllerLocal};
@@ -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{acosClamped as i,clamp as s}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as a,rotate as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as p}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{d as c,e as l,b as _,n as v,g as f,h as P,f as u,i as w,t as C}from"../../../../chunks/vec32.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAll as g}from"../../camera/constraintUtils.js";import{ConstraintOptions as j}from"../../camera/constraintUtils/ConstraintOptions.js";import{getVoxelWasm as x}from"../../layers/VoxelWasm.js";import{TiltRange as y}from"../Constraints.js";import{InteractiveController as b}from"./InteractiveController.js";import{excludeTerrain as R,normalizeCoordinate as M,getTiltScaleFactor as U,maxRotatePivotDistanceModifier as V,minRotatePivotDistance as D,navigationMode as O,rotatePivotSearchAreaSize as T}from"../utils/navigationUtils.js";let A=class extends b{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(t){super(t),this.pivot=0,this._rotScale=0,this._lastPoint=m(),this._tmpWorldUp=d(),this._tmpViewDir=d(),this._tmpRotCurPoint=m(),this._tmpTransf=h(),this._tmpAxis=d(),this._tmpPivotPoint=d(),this._pivotPos=d(),this._constraintOptions=new j(15,2,0,this.startCamera)}initialize(){this._rotScale=0===this.pivot?3:1.5}begin(t){if(this.running){switch(this.pivot){case 1:c(this._pivotPos,this.startCamera.eye),this._constraintOptions.interactionType=3,this._constraintOptions.tiltMode=1,this._constraintOptions.selection=0;break;case 0:{const i=this._intersectionHelper.intersectRayFreePointFallback(this.startCamera.ray,this._pivotPos,this.view.basemapTerrain.invisible?R:{});i||c(this._pivotPos,this.startCamera.center),this._constrainPivotPoint(t,i),this.startCamera.center=this._pivotPos,this._constraintOptions.interactionType=2,this._constraintOptions.tiltMode=0,this._constraintOptions.selection=11;break}}M(this.startCamera,t,this._lastPoint)}}_constrainPivotPoint(t,i){const s=this.startCamera,o=d();l(o,this._pivotPos,s.eye);const e=_(o),a=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(s.eye,S);let n=Math.max(U(S,s.viewForward,V)*a,D);i&&(n=Math.min(e,n));const h=r(s.width/s.pixelRatio*.5,s.height/s.pixelRatio*.5),p=O(this.startCamera,h,this.view.renderCoordsHelper,this.view.viewingMode);let m=this.view.stage.renderView.getMinimalDepthForArea(x(this.view),s.fullWidth/s.pixelRatio*.5,s.fullHeight/s.pixelRatio*.5,s,2.5*T,T),u=this.view.stage.renderView.getMinimalDepthForArea(x(this.view),t[0],t[1],s,T);null==m&&null==u||(m=m??u??0,u=null==u||1===p?m:u,n=m>u?u:m,n=i?Math.min(n,e):n),v(o,o),c(this._pivotPos,f(this._tmpPivotPoint,s.eye,P(this._tmpPivotPoint,o,n)))}update(t){if(this.running){switch(this.pivot){case 1:this.currentCamera.center=this._applyRotation(this.currentCamera,t,this.currentCamera.center,this._pivotPos);break;case 0:this.currentCamera.center=this._pivotPos,this.currentCamera.eye=this._applyRotation(this.currentCamera,t,this.currentCamera.eye,this._pivotPos)}g(this.view,this.currentCamera,this._constraintOptions),this.commitCamera()}}end(){this.running&&this.finishController()}_applyRotation(t,r,o,e){this.view.renderCoordsHelper.worldUpAtPosition(e,this._tmpWorldUp),M(t,r,this._tmpRotCurPoint);let h=(this._lastPoint[1]-this._tmpRotCurPoint[1])*this._rotScale,m=(this._tmpRotCurPoint[0]-this._lastPoint[0])*this._rotScale;l(this._tmpViewDir,o,e);const c=_(this._tmpViewDir),v=i(u(this._tmpViewDir,this._tmpWorldUp)/c);if(1===this.pivot){h*=-.5;const t=.5*Math.PI-v,i=.5*Math.PI*.99;h=t-Math.max(-i,Math.min(i,t+h))}return h=s(h+v,y.min,y.max)-v,w(this._tmpAxis,t.up,this._tmpViewDir),0===this.pivot&&(m=-m),a(this._tmpTransf,m,this._tmpWorldUp),n(this._tmpTransf,this._tmpTransf,h,this._tmpAxis),C(this._tmpViewDir,this._tmpViewDir,this._tmpTransf),t.up=C(H,t.up,this._tmpTransf),f(H,e,this._tmpViewDir),p(this._lastPoint,this._tmpRotCurPoint),H}};t([o()],A.prototype,"pivot",void 0),A=t([e("esri.views.3d.state.controllers.RotateController")],A);const H=d(),S=d();export{A as RotateController};
5
+ import{__decorate as t}from"tslib";import{acosClamped as i,clamp as s}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as a,rotate as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as p}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{d as c,e as l,b as _,n as v,g as f,h as P,f as u,i as w,t as C}from"../../../../chunks/vec32.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAll as g}from"../../camera/constraintUtils.js";import{ConstraintOptions as j}from"../../camera/constraintUtils/ConstraintOptions.js";import{getVoxelWasm as x}from"../../layers/VoxelWasm.js";import{TiltRange as y}from"../Constraints.js";import{InteractiveController as b}from"./InteractiveController.js";import{excludeTerrain as R,normalizeCoordinate as M,getTiltScaleFactor as U,maxRotatePivotDistanceModifier as V,minRotatePivotDistance as D,inferNavigationMode as O,rotatePivotSearchAreaSize as T}from"../utils/navigationUtils.js";let A=class extends b{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(t){super(t),this.pivot=0,this._rotScale=0,this._lastPoint=m(),this._tmpWorldUp=d(),this._tmpViewDir=d(),this._tmpRotCurPoint=m(),this._tmpTransf=h(),this._tmpAxis=d(),this._tmpPivotPoint=d(),this._pivotPos=d(),this._constraintOptions=new j(15,2,0,this.startCamera)}initialize(){this._rotScale=0===this.pivot?3:1.5}begin(t){if(this.running){switch(this.pivot){case 1:c(this._pivotPos,this.startCamera.eye),this._constraintOptions.interactionType=3,this._constraintOptions.tiltMode=1,this._constraintOptions.selection=0;break;case 0:{const i=this._intersectionHelper.intersectRayFreePointFallback(this.startCamera.ray,this._pivotPos,this.view.basemapTerrain.invisible?R:{});i||c(this._pivotPos,this.startCamera.center),this._constrainPivotPoint(t,i),this.startCamera.center=this._pivotPos,this._constraintOptions.interactionType=2,this._constraintOptions.tiltMode=0,this._constraintOptions.selection=11;break}}M(this.startCamera,t,this._lastPoint)}}_constrainPivotPoint(t,i){const s=this.startCamera,o=d();l(o,this._pivotPos,s.eye);const e=_(o),a=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(s.eye,S);let n=Math.max(U(S,s.viewForward,V)*a,D);i&&(n=Math.min(e,n));const h=r(s.width/s.pixelRatio*.5,s.height/s.pixelRatio*.5),p=O(this.startCamera,h,this.view.renderCoordsHelper,this.view.viewingMode);let m=this.view.stage.renderView.getMinimalDepthForArea(x(this.view),s.fullWidth/s.pixelRatio*.5,s.fullHeight/s.pixelRatio*.5,s,2.5*T,T),u=this.view.stage.renderView.getMinimalDepthForArea(x(this.view),t[0],t[1],s,T);null==m&&null==u||(m=m??u??0,u=null==u||1===p?m:u,n=m>u?u:m,n=i?Math.min(n,e):n),v(o,o),c(this._pivotPos,f(this._tmpPivotPoint,s.eye,P(this._tmpPivotPoint,o,n)))}update(t){if(this.running){switch(this.pivot){case 1:this.currentCamera.center=this._applyRotation(this.currentCamera,t,this.currentCamera.center,this._pivotPos);break;case 0:this.currentCamera.center=this._pivotPos,this.currentCamera.eye=this._applyRotation(this.currentCamera,t,this.currentCamera.eye,this._pivotPos)}g(this.view,this.currentCamera,this._constraintOptions),this.commitCamera()}}end(){this.running&&this.finishController()}_applyRotation(t,r,o,e){this.view.renderCoordsHelper.worldUpAtPosition(e,this._tmpWorldUp),M(t,r,this._tmpRotCurPoint);let h=(this._lastPoint[1]-this._tmpRotCurPoint[1])*this._rotScale,m=(this._tmpRotCurPoint[0]-this._lastPoint[0])*this._rotScale;l(this._tmpViewDir,o,e);const c=_(this._tmpViewDir),v=i(u(this._tmpViewDir,this._tmpWorldUp)/c);if(1===this.pivot){h*=-.5;const t=.5*Math.PI-v,i=.5*Math.PI*.99;h=t-Math.max(-i,Math.min(i,t+h))}return h=s(h+v,y.min,y.max)-v,w(this._tmpAxis,t.up,this._tmpViewDir),0===this.pivot&&(m=-m),a(this._tmpTransf,m,this._tmpWorldUp),n(this._tmpTransf,this._tmpTransf,h,this._tmpAxis),C(this._tmpViewDir,this._tmpViewDir,this._tmpTransf),t.up=C(H,t.up,this._tmpTransf),f(H,e,this._tmpViewDir),p(this._lastPoint,this._tmpRotCurPoint),H}};t([o()],A.prototype,"pivot",void 0),A=t([e("esri.views.3d.state.controllers.RotateController")],A);const H=d(),S=d();export{A as RotateController};
@@ -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{clamp as i}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as s,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{n as o,e as h,b as c,h as m,g as p}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../../geometry/ellipsoidUtils.js";import{create as u,fromPoints as P}from"../../../../geometry/support/axisAngle.js";import{c as g,a as C}from"../../../../chunks/sphere.js";import{pixelDistanceToInteractionFactor as d,applyAll as y}from"../../camera/constraintUtils.js";import{ConstraintOptions as f}from"../../camera/constraintUtils/ConstraintOptions.js";import{applySurfaceCollisionConstraint as v}from"../../camera/constraintUtils/surfaceCollision.js";import{InteractiveController as R}from"./InteractiveController.js";import{normalizeCoordinate as j,pickPointAndInitSphere as k,excludeTerrain as w,navigationMode as D,zoomPivotDistanceClamp as b,getTiltScaleFactor as A,maxZoomPivotDistanceModifier as M,pivotSearchAreaSize as x,sphereOrPlanePointFromScreenPoint as U,applyRotation as O}from"../utils/navigationUtils.js";import{fromScreenAtEye as z}from"../../support/geometryUtils/ray.js";let H=class extends R{constructor(){super(...arguments),this._pickPoint=l(),this._tmpP0=n(),this._panAxisAngle=u(),this._tmpRayDir=l(),this._tmpRayDirPick=l(),this._targetOnSphere=l(),this._navigationMode=1,this._tmpRay={origin:l(),direction:l()},this.dragBeginPoint=r(),this._normalizedAnchorPoint=n(),this._constraintOptions=new f(7,1,0,this.startCamera),this._sphere=g(),this._hasPickPoint=!1}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;s(this.dragBeginPoint,t),j(this.startCamera,t,this._normalizedAnchorPoint);const r=_(this.view.spatialReference),e=k(this._intersectionHelper,this.startCamera,t,r.radius,0,this.view.basemapTerrain.invisible?w:{});if(this._navigationMode=D(this.startCamera,t,this.view.renderCoordsHelper,this.view.viewingMode),1===this._navigationMode)this._hasPickPoint=!!e.scenePickPoint,this._pickPoint=e.scenePickPoint??this._pickPoint,this._sphere=e.sphere;else{let r;z(this.startCamera,t,this._tmpRay),o(this._tmpRay.direction,this._tmpRay.direction),null!=e.scenePickPoint&&(h(this._tmpRayDirPick,this.startCamera.eye,e.scenePickPoint),r=c(this._tmpRayDirPick));const s=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,S);const a=i(A(S,this._tmpRay.direction,M)*s,b[0],b[1]),n=this.view.stage.renderView.getMinimalDepthForArea(null,t[0],t[1],this.view.state.camera,x);let l=null!=n?n:a;null!=r&&(l=Math.min(l,r)),this._hasPickPoint=!0,m(this._tmpRay.direction,this._tmpRay.direction,l),p(this._pickPoint,this._tmpRay.origin,this._tmpRay.direction)}}update(t){if(this.running){if(this.currentCamera.eye=this.startCamera.eye,this.currentCamera.center=this.startCamera.center,this.currentCamera.up=this.startCamera.up,1===this._navigationMode){h(this._tmpRayDir,this.currentCamera.center,this.currentCamera.eye);const i=c(this._tmpRayDir);j(this.currentCamera,t,this._tmpP0);const r=12*(this._normalizedAnchorPoint[1]-this._tmpP0[1]);let e=i*2**r;const s=this.view.state.constraints.minimumPoiDistance;if(r<0&&e<s&&(e=s),Math.abs(i-e)<1e-6)return;if(this._hasPickPoint&&e<i){const t=1-(1-e/i)*(1-this._sphere[3]/c(this.currentCamera.center));this.currentCamera.center=m(B,this.currentCamera.center,t)}m(this._tmpRayDir,this._tmpRayDir,-e/i),this.currentCamera.eye=p(B,this.currentCamera.center,this._tmpRayDir),this._constraintOptions.interactionFactor=d(a(this.dragBeginPoint,t)),y(this.view,this.currentCamera,this._constraintOptions),this._hasPickPoint&&(U(this._sphere,this.currentCamera,this.dragBeginPoint,this._targetOnSphere),P(this._pickPoint,this._targetOnSphere,this._panAxisAngle),O(this.currentCamera,C(this._sphere),this._panAxisAngle))}else{const i=c(this._tmpRay.direction);j(this.currentCamera,t,this._tmpP0);const r=12*(this._normalizedAnchorPoint[1]-this._tmpP0[1]);let e=i*2**r;const s=this.view.state.constraints.minimumPoiDistance;if(r<0&&e<s&&(e=s),Math.abs(i-e)<1e-6)return;m(this._tmpRayDir,this._tmpRay.direction,1-e/i),this.currentCamera.eye=p(B,this.currentCamera.eye,this._tmpRayDir),this.currentCamera.center=p(B,this.currentCamera.center,this._tmpRayDir)}v(this.view,this.currentCamera),this.commitCamera()}}finish(){this.running&&this.finishController()}};H=t([e("esri.views.3d.state.controllers.ZoomControllerGlobal")],H);const B=l(),S=l();export{H as ZoomControllerGlobal};
5
+ import{__decorate as t}from"tslib";import{clamp as i}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as e,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{n as o,e as h,b as c,h as m,g as p}from"../../../../chunks/vec32.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../../geometry/ellipsoidUtils.js";import{create as u,fromPoints as P}from"../../../../geometry/support/axisAngle.js";import{c as C,a as g}from"../../../../chunks/sphere.js";import{pixelDistanceToInteractionFactor as y,applyAll as d}from"../../camera/constraintUtils.js";import{ConstraintOptions as f}from"../../camera/constraintUtils/ConstraintOptions.js";import{applySurfaceCollisionConstraint as R}from"../../camera/constraintUtils/surfaceCollision.js";import{InteractiveController as v}from"./InteractiveController.js";import{normalizeCoordinate as j,pickPointAndInitSphere as D,excludeTerrain as k,inferNavigationMode as w,zoomPivotDistanceClamp as b,getTiltScaleFactor as A,maxZoomPivotDistanceModifier as M,pivotSearchAreaSize as O,distanceComparisonTolerance as x,sphereOrPlanePointFromScreenPoint as U,applyRotation as z}from"../utils/navigationUtils.js";import{fromScreenAtEye as H}from"../../support/geometryUtils/ray.js";const B=12;let S=class extends v{constructor(){super(...arguments),this._pickPoint=_(),this._tmpP0=n(),this._panAxisAngle=u(),this._tmpRayDir=_(),this._tmpRayDirPick=_(),this._targetOnSphere=_(),this._navigationMode=1,this._tmpRay={origin:_(),direction:_()},this.dragBeginPoint=r(),this._normalizedAnchorPoint=n(),this._constraintOptions=new f(7,1,0,this.startCamera),this._sphere=C(),this._hasPickPoint=!1}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;e(this.dragBeginPoint,t),j(this.startCamera,t,this._normalizedAnchorPoint);const r=l(this.view.spatialReference),s=D(this._intersectionHelper,this.startCamera,t,r.radius,0,this.view.basemapTerrain.invisible?k:{});if(this._navigationMode=w(this.startCamera,t,this.view.renderCoordsHelper,this.view.viewingMode),1===this._navigationMode)this._hasPickPoint=!!s.scenePickPoint,this._pickPoint=s.scenePickPoint??this._pickPoint,this._sphere=s.sphere;else{let r;H(this.startCamera,t,this._tmpRay),o(this._tmpRay.direction,this._tmpRay.direction),null!=s.scenePickPoint&&(h(this._tmpRayDirPick,this.startCamera.eye,s.scenePickPoint),r=c(this._tmpRayDirPick));const e=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,G);const a=i(A(G,this._tmpRay.direction,M)*e,b[0],b[1]),n=this.view.stage.renderView.getMinimalDepthForArea(null,t[0],t[1],this.view.state.camera,O);let _=null!=n?n:a;null!=r&&(_=Math.min(_,r)),this._hasPickPoint=!0,m(this._tmpRay.direction,this._tmpRay.direction,_),p(this._pickPoint,this._tmpRay.origin,this._tmpRay.direction)}}update(t){if(this.running){if(this.currentCamera.eye=this.startCamera.eye,this.currentCamera.center=this.startCamera.center,this.currentCamera.up=this.startCamera.up,1===this._navigationMode){h(this._tmpRayDir,this.currentCamera.center,this.currentCamera.eye);const i=c(this._tmpRayDir);j(this.currentCamera,t,this._tmpP0);const r=(this._normalizedAnchorPoint[1]-this._tmpP0[1])*B;let s=i*2**r;const e=this.view.state.constraints.minimumPoiDistance;if(r<0&&s<e&&(s=e),Math.abs(i-s)<x)return;if(this._hasPickPoint&&s<i){const t=1-(1-s/i)*(1-this._sphere[3]/c(this.currentCamera.center));this.currentCamera.center=m(F,this.currentCamera.center,t)}m(this._tmpRayDir,this._tmpRayDir,-s/i),this.currentCamera.eye=p(F,this.currentCamera.center,this._tmpRayDir),this._constraintOptions.interactionFactor=y(a(this.dragBeginPoint,t)),d(this.view,this.currentCamera,this._constraintOptions),this._hasPickPoint&&(U(this._sphere,this.currentCamera,this.dragBeginPoint,this._targetOnSphere),P(this._pickPoint,this._targetOnSphere,this._panAxisAngle),z(this.currentCamera,g(this._sphere),this._panAxisAngle))}else{const i=c(this._tmpRay.direction);j(this.currentCamera,t,this._tmpP0);const r=(this._normalizedAnchorPoint[1]-this._tmpP0[1])*B;let s=i*2**r;const e=this.view.state.constraints.minimumPoiDistance;if(r<0&&s<e&&(s=e),Math.abs(i-s)<x)return;m(this._tmpRayDir,this._tmpRay.direction,1-s/i),this.currentCamera.eye=p(F,this.currentCamera.eye,this._tmpRayDir),this.currentCamera.center=p(F,this.currentCamera.center,this._tmpRayDir),o(this._tmpRayDir,this._tmpRayDir),this._constraintOptions.interactionDirection=this._tmpRayDir,d(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null}R(this.view,this.currentCamera),this.commitCamera()}}finish(){this.running&&this.finishController()}};S=t([s("esri.views.3d.state.controllers.ZoomControllerGlobal")],S);const F=_(),G=_();export{S as ZoomControllerGlobal};
@@ -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{clamp as i}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as e,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{e as o,b as m,n as h,h as c,g as p,u as _,d as l,l as u}from"../../../../chunks/vec32.js";import{create as P,fromValues as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as C,fromPositionAndNormal as f}from"../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as D,applyAll as j}from"../../camera/constraintUtils.js";import{ConstraintOptions as v}from"../../camera/constraintUtils/ConstraintOptions.js";import{getVoxelWasm as d}from"../../layers/VoxelWasm.js";import{InteractiveController as y}from"./InteractiveController.js";import{normalizeCoordinate as b,excludeTerrain as w,zoomPivotDistanceClamp as N,getTiltScaleFactor as O,maxZoomPivotDistanceModifier as R,pivotSearchAreaSize as x,intersectPlaneFromScreenPoint as M}from"../utils/navigationUtils.js";let z=class extends y{constructor(){super(...arguments),this._tmpP=P(),this._tmpDir=P(),this._tmpN=P(),this._tmpP0=n(),this._tmpPoi=P(),this._tmpRayDir=P(),this.dragBeginPoint=r(),this._normalizedAnchorPoint=n(),this._constraintOptions=new v(15,1,0,this.startCamera,P()),this._plane=C()}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;e(this.dragBeginPoint,t),b(this.startCamera,t,this._normalizedAnchorPoint);const r=this._intersectionHelper.intersectScreenFreePointFallback(t,this._tmpP,this.view.basemapTerrain.invisible?w:{});o(this._tmpDir,this._tmpP,this.startCamera.eye);const s=m(this._tmpDir);h(this._tmpDir,this._tmpDir);const a=Math.abs(this.view.camera.position.z),n=i(O(U,this._tmpDir,R)*a,N[0],N[1]),l=this.view.stage.renderView.getMinimalDepthForArea(d(this.view),t[0],t[1],this.view.state.camera,x);let u=null!=l?l:n;r&&(u=Math.min(u,s)),c(this._tmpDir,this._tmpDir,u),p(this._tmpP,this.startCamera.eye,this._tmpDir),o(this._tmpN,this.startCamera.eye,this.startCamera.center),h(this._tmpN,this._tmpN),this._tmpN[1]<0&&_(this._tmpN,this._tmpN),f(this._tmpP,this._tmpN,this._plane)}update(t){if(!this.running)return;M(this._plane,this.currentCamera,this.dragBeginPoint,this._tmpPoi)||l(this._tmpPoi,this.currentCamera.center),b(this.currentCamera,t,this._tmpP0);let i=4*(this._tmpP0[1]-this._normalizedAnchorPoint[1]);e(this._normalizedAnchorPoint,this._tmpP0),o(this._tmpRayDir,this._tmpPoi,this.currentCamera.eye);const r=m(this._tmpRayDir);let s=r*(1-i);this._constraintOptions.interactionDirection&&(l(this._constraintOptions.interactionDirection,this._tmpRayDir),c(this._constraintOptions.interactionDirection,this._constraintOptions.interactionDirection,Math.sign(i)/r));const n=this.view.state.constraints.minimumPoiDistance;i>=0&&s<n&&(s=n,i=-(s-r)/r),Math.abs(r-s)<1e-6||(c(this._tmpRayDir,this._tmpRayDir,i),this.currentCamera.eye=p(A,this.currentCamera.eye,this._tmpRayDir),u(A,this.currentCamera.center,this._tmpPoi,i),this._tmpPoi[2]>this.startCamera.center[2]?A[2]=Math.max(this.startCamera.center[2],A[2]):A[2]=Math.min(this.startCamera.center[2],A[2]),this.currentCamera.center=A,this._constraintOptions.interactionFactor=D(a(this.dragBeginPoint,t)),j(this.view,this.currentCamera,this._constraintOptions),this.commitCamera())}finish(){this.running&&this.finishController()}};z=t([s("esri.views.3d.state.controllers.ZoomControllerLocal")],z);const A=P(),U=g(0,0,1);export{z as ZoomControllerLocal};
5
+ import{__decorate as t}from"tslib";import{clamp as i}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as e,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{e as o,b as m,n as h,h as c,g as p,u as _,d as l,l as u}from"../../../../chunks/vec32.js";import{create as P,fromValues as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as C,fromPositionAndNormal as f}from"../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as D,applyAll as j}from"../../camera/constraintUtils.js";import{ConstraintOptions as v}from"../../camera/constraintUtils/ConstraintOptions.js";import{getVoxelWasm as d}from"../../layers/VoxelWasm.js";import{InteractiveController as y}from"./InteractiveController.js";import{normalizeCoordinate as b,excludeTerrain as w,zoomPivotDistanceClamp as N,getTiltScaleFactor as O,maxZoomPivotDistanceModifier as R,pivotSearchAreaSize as x,intersectPlaneFromScreenPoint as M,distanceComparisonTolerance as z}from"../utils/navigationUtils.js";let A=class extends y{constructor(){super(...arguments),this._tmpP=P(),this._tmpDir=P(),this._tmpN=P(),this._tmpP0=n(),this._tmpPoi=P(),this._tmpRayDir=P(),this.dragBeginPoint=r(),this._normalizedAnchorPoint=n(),this._constraintOptions=new v(15,1,0,this.startCamera,P()),this._plane=C()}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;e(this.dragBeginPoint,t),b(this.startCamera,t,this._normalizedAnchorPoint);const r=this._intersectionHelper.intersectScreenFreePointFallback(t,this._tmpP,this.view.basemapTerrain.invisible?w:{});o(this._tmpDir,this._tmpP,this.startCamera.eye);const s=m(this._tmpDir);h(this._tmpDir,this._tmpDir);const a=Math.abs(this.view.camera.position.z),n=i(O(B,this._tmpDir,R)*a,N[0],N[1]),l=this.view.stage.renderView.getMinimalDepthForArea(d(this.view),t[0],t[1],this.view.state.camera,x);let u=null!=l?l:n;r&&(u=Math.min(u,s)),c(this._tmpDir,this._tmpDir,u),p(this._tmpP,this.startCamera.eye,this._tmpDir),o(this._tmpN,this.startCamera.eye,this.startCamera.center),h(this._tmpN,this._tmpN),this._tmpN[1]<0&&_(this._tmpN,this._tmpN),f(this._tmpP,this._tmpN,this._plane)}update(t){if(!this.running)return;M(this._plane,this.currentCamera,this.dragBeginPoint,this._tmpPoi)||l(this._tmpPoi,this.currentCamera.center),b(this.currentCamera,t,this._tmpP0);let i=4*(this._tmpP0[1]-this._normalizedAnchorPoint[1]);e(this._normalizedAnchorPoint,this._tmpP0),o(this._tmpRayDir,this._tmpPoi,this.currentCamera.eye);const r=m(this._tmpRayDir);let s=r*(1-i);this._constraintOptions.interactionDirection&&(l(this._constraintOptions.interactionDirection,this._tmpRayDir),c(this._constraintOptions.interactionDirection,this._constraintOptions.interactionDirection,Math.sign(i)/r));const n=this.view.state.constraints.minimumPoiDistance;i>=0&&s<n&&(s=n,i=-(s-r)/r),Math.abs(r-s)<z||(c(this._tmpRayDir,this._tmpRayDir,i),this.currentCamera.eye=p(U,this.currentCamera.eye,this._tmpRayDir),u(U,this.currentCamera.center,this._tmpPoi,i),this._tmpPoi[2]>this.startCamera.center[2]?U[2]=Math.max(this.startCamera.center[2],U[2]):U[2]=Math.min(this.startCamera.center[2],U[2]),this.currentCamera.center=U,this._constraintOptions.interactionFactor=D(a(this.dragBeginPoint,t)),j(this.view,this.currentCamera,this._constraintOptions),this.commitCamera())}finish(){this.running&&this.finishController()}};A=t([s("esri.views.3d.state.controllers.ZoomControllerLocal")],A);const U=P(),B=g(0,0,1);export{A as ZoomControllerLocal};
@@ -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{clamp as i}from"../../../../core/mathUtils.js";import{Milliseconds as e}from"../../../../core/time.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as s,n as o,h as a,b as n,e as m,g as h,s as p}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as _}from"../../../../geometry/support/ray.js";import{c as l}from"../../../../chunks/sphere.js";import{applyAll as y}from"../../camera/constraintUtils.js";import{ConstraintOptions as g}from"../../camera/constraintUtils/ConstraintOptions.js";import{applySurfaceCollisionConstraint as w}from"../../camera/constraintUtils/surfaceCollision.js";import{PointToPointAnimationController as d}from"./PointToPointAnimationController.js";import{excludeTerrain as f,navigationMode as C,zoomStepDistanceClamp as u,getTiltScaleFactor as D,panToPosition as j,maxZoomStepDistanceModifier as v}from"../utils/navigationUtils.js";import{fromScreenAtEye as b}from"../../support/geometryUtils/ray.js";import{intersectScreen as R}from"../../support/geometryUtils/sphere.js";import M from"../../webgl/RenderCamera.js";import{Intersector as V}from"../../webgl-engine/lib/Intersector.js";import{outExpo as z}from"../../../animation/easing.js";const L=.6,S=4,U=60;let O=class extends d{constructor(){super(...arguments),this._zoomLocation=c(),this._tmpCamera=new M,this._tmpViewDir=c(),this._tmpRayDir=_(),this._targetOnSphere=c(),this._tmpCenter=c(),this._beginCamera=new M,this._constraintOptions=new g(7,1,null,this._beginCamera),this._sphere=l()}initialize(){this._intersector=new V(this.view.state.viewingMode)}step(t,i){if(!this.running)return;const e=this.view.state;this.animation.finished?this._beginCamera.copyFrom(e.camera):this.animation.cameraAt(1,this._beginCamera);let r=!1,o=!1;this._intersectionHelper.intersectScreen(i,this._zoomLocation,0===this.view.map.ground.opacity?f:{})&&(r=t>0,o=!0),this._tmpCamera.copyFrom(e.camera),r?this._intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter):this._intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:s(this._zoomLocation,this._tmpCamera.center),this._updateCamera(this._tmpCamera,t,i,o),this.begin(this._tmpCamera)}animationSettings(){return{duration:e(600),easing:z}}_updateCamera(t,e,r,s){const c=C(t,r,this.view.renderCoordsHelper,this.view.viewingMode),_=Math.abs(this.view.camera.position.z),l=this._zoomLocation;o(F,t.eye),a(F,F,-1),b(t,r,this._tmpRayDir),o(this._tmpRayDir.direction,this._tmpRayDir.direction);const g=i(D(F,this._tmpRayDir.direction,v)*_,u[0],u[1]);if(1===c){let i=L**e;this._sphere[3]=n(l),m(this._tmpViewDir,t.center,t.eye);const s=Math.min(n(this._tmpViewDir),g);let o=s*i;if(i<=1&&o<S&&(o=S,i=o/s),Math.abs(s-o)<1e-6)return;const c=n(t.center);if(this._sphere[3]!==c){const e=this._sphere[3]+i*(c-this._sphere[3]);t.center=a(x,t.center,e/c)}a(this._tmpViewDir,this._tmpViewDir,-i),t.eye=h(x,t.center,this._tmpViewDir),y(this.view,t,this._constraintOptions),p(l,t.center)>1e-12&&R(this._sphere,t,r,this._targetOnSphere)&&j(this._sphere,t,l,this._targetOnSphere,this.view.camera.heading,this.view.camera.tilt,!0)}else{let i=L**Math.abs(e);const o=e>0?1:-1;m(this._tmpViewDir,l,t.eye);const p=n(this._tmpViewDir),c=this.view.stage.renderView.getMinimalDepthForArea(null,r[0],r[1],this.view.state.camera,U);let _=null!=c?c:g;s&&e>0&&(_=Math.min(_,p)),a(this._tmpRayDir.direction,this._tmpRayDir.direction,_),h(l,this._tmpRayDir.origin,this._tmpRayDir.direction);let y=_*i;const w=Math.max(S,1.01*t.nearFar[0]);if(e>0&&y<w&&(y=w,i=y/_),Math.abs(_-y)<1e-6)return;a(this._tmpRayDir.direction,this._tmpRayDir.direction,o*(1-i)),t.eye=h(x,t.eye,this._tmpRayDir.direction),t.center=h(x,t.center,this._tmpRayDir.direction)}w(this.view,t)}};O=t([r("esri.views.3d.state.controllers.ZoomStepControllerGlobal")],O);const x=c(),F=c();export{O as ZoomStepControllerGlobal};
5
+ import{__decorate as t}from"tslib";import{clamp as i}from"../../../../core/mathUtils.js";import{Milliseconds as e}from"../../../../core/time.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as s,n as o,h as a,b as n,e as m,g as h,s as c}from"../../../../chunks/vec32.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as _}from"../../../../geometry/support/ray.js";import{c as l}from"../../../../chunks/sphere.js";import{applyAll as y}from"../../camera/constraintUtils.js";import{ConstraintOptions as w}from"../../camera/constraintUtils/ConstraintOptions.js";import{applySurfaceCollisionConstraint as d}from"../../camera/constraintUtils/surfaceCollision.js";import{PointToPointAnimationController as g}from"./PointToPointAnimationController.js";import{excludeTerrain as f,inferNavigationMode as D,zoomStepDistanceClamp as C,getTiltScaleFactor as u,distanceComparisonTolerance as j,panToPosition as R,maxZoomStepDistanceModifier as v}from"../utils/navigationUtils.js";import{fromScreenAtEye as b}from"../../support/geometryUtils/ray.js";import{intersectScreen as M}from"../../support/geometryUtils/sphere.js";import O from"../../webgl/RenderCamera.js";import{Intersector as V}from"../../webgl-engine/lib/Intersector.js";import{outExpo as z}from"../../../animation/easing.js";const L=.6,S=4,U=60;let x=class extends g{constructor(){super(...arguments),this._zoomLocation=p(),this._tmpCamera=new O,this._tmpViewDir=p(),this._tmpRayDir=_(),this._targetOnSphere=p(),this._tmpCenter=p(),this._beginCamera=new O,this._constraintOptions=new w(7,1,null,this._beginCamera),this._sphere=l()}initialize(){this._intersector=new V(this.view.state.viewingMode)}step(t,i){if(!this.running)return;const e=this.view.state;this.animation.finished?this._beginCamera.copyFrom(e.camera):this.animation.cameraAt(1,this._beginCamera);let r=!1,o=!1;this._intersectionHelper.intersectScreen(i,this._zoomLocation,0===this.view.map.ground.opacity?f:{})&&(r=t>0,o=!0),this._tmpCamera.copyFrom(e.camera),r?this._intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter):this._intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:s(this._zoomLocation,this._tmpCamera.center),this._updateCamera(this._tmpCamera,t,i,o),this.begin(this._tmpCamera)}animationSettings(){return{duration:e(600),easing:z}}_updateCamera(t,e,r,s){const p=D(t,r,this.view.renderCoordsHelper,this.view.viewingMode),_=Math.abs(this.view.camera.position.z),l=this._zoomLocation;o(H,t.eye),a(H,H,-1),b(t,r,this._tmpRayDir),o(this._tmpRayDir.direction,this._tmpRayDir.direction);const w=i(u(H,this._tmpRayDir.direction,v)*_,C[0],C[1]);if(1===p){let i=L**e;this._sphere[3]=n(l),m(this._tmpViewDir,t.center,t.eye);const s=Math.min(n(this._tmpViewDir),w);let o=s*i;if(i<=1&&o<S&&(o=S,i=o/s),Math.abs(s-o)<j)return;const p=n(t.center);if(this._sphere[3]!==p){const e=this._sphere[3]+i*(p-this._sphere[3]);t.center=a(F,t.center,e/p)}a(this._tmpViewDir,this._tmpViewDir,-i),t.eye=h(F,t.center,this._tmpViewDir),y(this.view,t,this._constraintOptions),c(l,t.center)>1e-12&&M(this._sphere,t,r,this._targetOnSphere)&&R(this._sphere,t,l,this._targetOnSphere,this.view.camera.heading,this.view.camera.tilt,!0)}else{let i=L**Math.abs(e);const c=e>0?1:-1;m(this._tmpViewDir,l,t.eye);const p=n(this._tmpViewDir),_=this.view.stage.renderView.getMinimalDepthForArea(null,r[0],r[1],this.view.state.camera,U);let d=null!=_?_:w;s&&e>0&&(d=Math.min(d,p)),a(this._tmpRayDir.direction,this._tmpRayDir.direction,d),h(l,this._tmpRayDir.origin,this._tmpRayDir.direction);let g=d*i;const f=Math.max(S,1.01*t.nearFar[0]);if(e>0&&g<f&&(g=f,i=g/d),Math.abs(d-g)<j)return;a(this._tmpRayDir.direction,this._tmpRayDir.direction,c*(1-i)),t.eye=h(F,t.eye,this._tmpRayDir.direction),t.center=h(F,t.center,this._tmpRayDir.direction),o(this._tmpRayDir.direction,this._tmpRayDir.direction),this._constraintOptions.interactionDirection=this._tmpRayDir.direction,y(this.view,t,this._constraintOptions),this._constraintOptions.interactionDirection=null}d(this.view,t)}};x=t([r("esri.views.3d.state.controllers.ZoomStepControllerGlobal")],x);const F=p(),H=p();export{x as ZoomStepControllerGlobal};
@@ -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{clamp as i}from"../../../../core/mathUtils.js";import{Milliseconds as e}from"../../../../core/time.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as r,e as o,n as a,b as m,g as n,h as c,l as h}from"../../../../chunks/vec32.js";import{create as p,fromValues as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAll as l}from"../../camera/constraintUtils.js";import{ConstraintOptions as C}from"../../camera/constraintUtils/ConstraintOptions.js";import{getVoxelWasm as g}from"../../layers/VoxelWasm.js";import{PointToPointAnimationController as f}from"./PointToPointAnimationController.js";import{excludeTerrain as y,zoomStepDistanceClamp as b,getTiltScaleFactor as j,maxZoomStepDistanceModifier as w}from"../utils/navigationUtils.js";import u from"../../webgl/RenderCamera.js";import{Intersector as v}from"../../webgl-engine/lib/Intersector.js";import{outExpo as d}from"../../../animation/easing.js";const L=.6,z=4,R=60;let D=class extends f{constructor(){super(...arguments),this._zoomLocation=p(),this._tmpCamera=new u,this._tmpRayDir=p(),this._tmpCenter=p(),this._beginCamera=new u,this._constraintOptions=new C(15,1,null,this._beginCamera)}step(t,e){if(!this.running)return;const s=this.view.state;this.animation.finished?this._beginCamera.copyFrom(s.camera):this.animation.cameraAt(1,this._beginCamera),this._tmpCamera.copyFrom(s.camera);const h=new v(this.view.state.viewingMode);let _=!1;t>0?(_=this._intersectionHelper.intersectScreenFreePointFallback(e,this._zoomLocation,this.view.basemapTerrain.invisible?y:{}),this._intersectionHelper.intersectRay(this._tmpCamera.ray,h,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter)):this._intersectionHelper.intersectRay(this._tmpCamera.ray,h,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:r(this._zoomLocation,this._tmpCamera.center);const l=L**t;let C=this.view.stage.renderView.getMinimalDepthForArea(g(this.view),e[0],e[1],this.view.state.camera,R);o(M,this._tmpCamera.eye,this._zoomLocation),a(M,M);const f=Math.abs(this.view.camera.position.z),u=i(j(x,M,w)*f,b[0],b[1]);C=null!=C?C:u;const d=p();o(d,this._zoomLocation,this._tmpCamera.eye),(C<m(d)||!_)&&(a(d,d),n(this._zoomLocation,this._tmpCamera.eye,c(d,d,C))),this._updateCamera(this._tmpCamera,l,this._zoomLocation),this.begin(this._tmpCamera)}animationSettings(){return{duration:e(600),easing:d}}_updateCamera(t,i,e){o(this._tmpRayDir,e,t.eye);const s=m(this._tmpRayDir);let r=s*i;const a=i<=1,n=Math.max(z,1.01*t.nearFar[0]);0!==r&&(a&&r<n&&(r=n,i=r/s),Math.abs(s-r)<1e-6||(c(this._tmpRayDir,this._tmpRayDir,i),t.eye=o(F,e,this._tmpRayDir),t.center=h(F,t.center,e,1-i),l(this.view,t,this._constraintOptions)))}};D=t([s("esri.views.3d.state.controllers.ZoomStepControllerLocal")],D);const F=p(),x=_(0,0,1),M=p();export{D as ZoomStepControllerLocal};
5
+ import{__decorate as t}from"tslib";import{clamp as i}from"../../../../core/mathUtils.js";import{Milliseconds as e}from"../../../../core/time.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as r,e as o,n as a,b as m,g as n,h as c,l as h}from"../../../../chunks/vec32.js";import{create as p,fromValues as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAll as l}from"../../camera/constraintUtils.js";import{ConstraintOptions as C}from"../../camera/constraintUtils/ConstraintOptions.js";import{getVoxelWasm as g}from"../../layers/VoxelWasm.js";import{PointToPointAnimationController as f}from"./PointToPointAnimationController.js";import{excludeTerrain as y,zoomStepDistanceClamp as b,getTiltScaleFactor as j,maxZoomStepDistanceModifier as w,distanceComparisonTolerance as u}from"../utils/navigationUtils.js";import v from"../../webgl/RenderCamera.js";import{Intersector as d}from"../../webgl-engine/lib/Intersector.js";import{outExpo as L}from"../../../animation/easing.js";const z=.6,R=4,D=60;let F=class extends f{constructor(){super(...arguments),this._zoomLocation=p(),this._tmpCamera=new v,this._tmpRayDir=p(),this._tmpCenter=p(),this._beginCamera=new v,this._constraintOptions=new C(15,1,null,this._beginCamera)}step(t,e){if(!this.running)return;const s=this.view.state;this.animation.finished?this._beginCamera.copyFrom(s.camera):this.animation.cameraAt(1,this._beginCamera),this._tmpCamera.copyFrom(s.camera);const h=new d(this.view.state.viewingMode);let _=!1;t>0?(_=this._intersectionHelper.intersectScreenFreePointFallback(e,this._zoomLocation,this.view.basemapTerrain.invisible?y:{}),this._intersectionHelper.intersectRay(this._tmpCamera.ray,h,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter)):this._intersectionHelper.intersectRay(this._tmpCamera.ray,h,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:r(this._zoomLocation,this._tmpCamera.center);const l=z**t;let C=this.view.stage.renderView.getMinimalDepthForArea(g(this.view),e[0],e[1],this.view.state.camera,D);o(S,this._tmpCamera.eye,this._zoomLocation),a(S,S);const f=Math.abs(this.view.camera.position.z),u=i(j(M,S,w)*f,b[0],b[1]);C=null!=C?C:u;const v=p();o(v,this._zoomLocation,this._tmpCamera.eye),(C<m(v)||!_)&&(a(v,v),n(this._zoomLocation,this._tmpCamera.eye,c(v,v,C))),this._updateCamera(this._tmpCamera,l,this._zoomLocation),this.begin(this._tmpCamera)}animationSettings(){return{duration:e(600),easing:L}}_updateCamera(t,i,e){o(this._tmpRayDir,e,t.eye);const s=m(this._tmpRayDir);let r=s*i;const a=i<=1,n=Math.max(R,1.01*t.nearFar[0]);0!==r&&(a&&r<n&&(r=n,i=r/s),Math.abs(s-r)<u||(c(this._tmpRayDir,this._tmpRayDir,i),t.eye=o(x,e,this._tmpRayDir),t.center=h(x,t.center,e,1-i),l(this.view,t,this._constraintOptions)))}};F=t([s("esri.views.3d.state.controllers.ZoomStepControllerLocal")],F);const x=p(),M=_(0,0,1),S=p();export{F as ZoomStepControllerLocal};
@@ -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{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as o,asinClamped as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as a}from"../../../../core/screenUtils.js";import{fromRotation as s,exactEquals as i,rotate as c,multiply as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as m,create as u}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{f as h,b as M,e as g,t as y,g as b,n as d,s as x,d as j,i as v,h as P,l as z,j as w}from"../../../../chunks/vec32.js";import{create as I}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as A,fromPoints as k,axis as T,wrapAxisAngle as U}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as G,vectorCoordinates as R}from"../../../../geometry/support/coordinateSystem.js";import{create as S,fromNormalAndOffset as E,intersectRay as H}from"../../../../geometry/support/plane.js";import{a as q,c as C,l as F,i as O}from"../../../../chunks/sphere.js";import{sm4d as W,sv3d as B}from"../../../../geometry/support/vectorStacks.js";import{fromScreenAtEye as D,fromScreen as J}from"../../support/geometryUtils/ray.js";import{intersectScreen as K}from"../../support/geometryUtils/sphere.js";import L from"../../webgl/RenderCamera.js";import{terrainId as N}from"../../webgl-engine/lib/verticalOffsetUtils.js";const Q=30,V=[1,3e8],X=8,Y=[200,1508e5],Z=5,$=50,_=5,tt=10,et=80,nt=90,ot={exclude:new Set([N])};function rt(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function at(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function st(t,e,n){const o=s(W.get(),n[3],T(n));null==o||i(o,m)||(g(ne,t.eye,e),y(ne,ne,o),t.eye=b(ne,ne,e),g(ne,t.center,e),y(ne,ne,o),t.center=b(ne,ne,e),t.up=y(ne,t.up,o))}function it(t,e,n,o){return H(t,J(e,n,ce),o)}function ct(t,e,n,o){return H(t,D(e,n,ce),o)}function lt(t,e,n,o){const r=B.get();let a=1-n;g(r,e,t.eye);const s=M(r);let i=s*(1-a);a>=0&&i<o&&(i=o,a=-(i-s)/s),Math.abs(s-i)<1e-6||(P(r,r,a),t.eye=b(ne,t.eye,r),t.center=z(ne,t.center,e,a))}function mt(t,e,n){e.getScreenCenter(ut),K(t,e,ut,ne)&&(e.center=ne);const o=e.distance,r=o*n;if(Math.abs(o-r)<1e-6)return;const a=P(B.get(),e.viewForward,r);e.eye=g(ne,e.center,a)}const ut=a();function ft(t,e){w(e,0,0,0);for(const n of t)b(e,e,n);P(e,e,1/t.length)}function pt(t,e,n,o){return Math.sin(t/M(e))*(n+o.radius)}function ht(t,e,n,o){return pt(Math.PI/2,e,n,o)+(t-Math.PI/2)}const Mt={Elevation:3e4,Angle:e(16)},gt=e(80);function yt(t,e,n,o,r,a){const s=I(),i=C();let c=!0,l=!0;return t.intersectScreen(n,s,a)?i[3]=M(s):(l=!1,e.aboveGround&&0!==r?i[3]=Math.max(M(e.center),.9*o):i[3]=M(e.eye)-e.relativeElevation,1===r?jt(i,e,n,s):c=K(i,e,n,s)),{sphere:i,scenePickPoint:c?s:null,hasGeometryIntersection:l}}function bt(t,e,n,o){const r=t.relativeElevation;if(r>Mt.Elevation&&"global"===o)return 1;D(t,e,le);const a=Math.sign(r),s=n.worldUpAtPosition(t.eye,ne);return-a*h(s,le.direction)<Math.sin(Mt.Angle)*M(le.direction)?0:1}function dt(t,e,n){g(xt,n,e),t.eye=g(ne,t.eye,xt),t.center=g(ne,t.center,xt)}const xt=I();function jt(t,e,n,o){const r=D(e,n,ce);return null!=r&&(F(t,r,vt),O(t,r,o)?!(x(vt,r.origin)<x(o,r.origin))||(j(o,vt),!1):(g(Pt,e.eye,e.center),d(Pt,Pt),E(Pt,-h(d(Pt,Pt),vt),zt),H(zt,r,o),!1))}const vt=I(),Pt=I(),zt=S();function wt(a,s,i,c,l,m){let u=0;if(v(ae,a,s),g(oe,a,s),M(a)<=l||!c.aboveGround){v(i,oe,c.eye);const f=h(a,s)/(M(a)*M(s));if(f<.9999)u=o(f);else{const t=M(v(I(),a,s))/(M(a)*M(s));u=r(t)}const p=Math.cos(n(t.normalize(e(m)),0,gt));u=-u-Math.max(0,M(s)-l)/(p*l)}else g(It,c.eye,c.center),v(i,oe,It),u=-M(oe)/l;return d(i,i),P(i,i,M(ae)),u}const It=I();function At(r,a,s,i){let c,l;const m=Math.cos(n(t.normalize(e(i)),0,gt));return c=a>s?-(a-s)/(m*s):a<-s?Math.PI-(a+s)/(m*s):o(a/s),l=r>s?-(r-s)/(m*s):r<-s?Math.PI-(r+s)/(m*s):o(r/s),(l-c)*s}function kt(t,e,n,o,r,a,s,i,c,l){const m=At(t[2],e[2],a[3],i),u=c?At(t[0],e[0],a[3],180):e[0]-t[0],p=Math.sin(s)*u-Math.cos(s)*m,M=Math.cos(s)*u+Math.sin(s)*m;d(ne,r);const g=c?p/Math.sqrt(Math.abs(a[3]**2-h(n,ne)**2)):p/a[3],y=M/Math.sqrt(Math.abs(a[3]**2-h(n,o)**2));f(l,g,y)}function Tt(t,e,n,o,r,a,s,i,c,l){v(ae,t,e),G(a.up,a.eye,Lt,Nt,Qt),G([0,0,1],a.eye,Dt,Jt,Kt),j(n,Jt),j(o,Dt),d(n,n),P(n,n,M(ae)),R(t,d(Nt,Nt),d(Qt,Qt),d(Lt,Lt),Vt),R(e,Nt,Qt,Lt,Xt),kt(Vt,Xt,t,Dt,Jt,s,i,c,l,r)}function Ut(t,e,n,o,r,a,i){s($t,r,o),s(_t,i,a),l(te,$t,_t),g(e,t,n),y(e,e,te),b(e,e,n)}function Gt(t,e,n,o,r,a){s($t,o,n),s(_t,a,r),l(te,$t,_t),g(ne,t.eye,e),y(ne,ne,te),t.eye=b(ne,ne,e),g(ne,t.center,e),y(ne,ne,te),t.center=b(ne,ne,e),g(ne,t.up,e),y(ne,ne,te),t.up=b(ne,ne,e)}const Rt={Pole:.95,Angle:e(18),Tilt:45,TiltHysteresisMargin:1e-7};let St=!1;function Et(t,e,n,o,r,a){const s=Math.abs(o)>Math.PI-Rt.Angle||Math.abs(o)<Rt.Angle,i=(Math.abs(t[2])<n*Rt.Pole||Math.abs(e)>n)&&a;return s&&i?!St&&r<Rt.Tilt-Rt.TiltHysteresisMargin?St=!0:St&&r>Rt.Tilt+Rt.TiltHysteresisMargin&&(St=!1):St=!1,St}function Ht(t,e,n,o,r,a){if(a)k(n,o,Zt),st(e,q(t),Zt);else{const a=wt(n,o,se,e,t[3],r);st(e,q(t),U(se,a))}}function qt(t,e,n,o,r,a,s){const i=s?20:1,c=1e-12;let l,m;j(ee,o),re.copyFrom(e);for(let u=0;u<i&&x(n,ee)>c&&(l=x(n,ee),Tt(n,ee,Jt,Dt,Yt,re,t,r,a,s),Gt(re,q(t),Dt,Yt[1],Jt,Yt[0]),Ut(ee,ee,q(t),Dt,Yt[1],Jt,Yt[0]),m=x(n,ee),m<l||0===u);u++)e.copyFrom(re)}function Ct(n,o,r,a,s,i,c){Et(r,h(o.up,r),n[3],-t.normalize(e(s)),i,o.aboveGround)?qt(n,o,r,a,-t.normalize(e(s)),i,c):Ht(n,o,r,a,i,c)}function Ft(t,e,n,o,r,a){const{eye:s}=t;G([0,0,1],s,Dt,Jt,Kt);const i=e.translation[0]*n.pan,l="zoom"===r.mode?0:e.translation[1]*n.pan,m=Math.max(Math.sqrt(Math.abs(1-h(t.center,Dt)**2/M(t.center)**2)),.5),u=(Math.sin(a)*l+Math.cos(a)*i)/m,f=-Math.cos(a)*l+Math.sin(a)*i;switch(c(o.pan.matrix,o.pan.matrix,u,Dt),o.pan.enabled=!0,r.mode){case"pan":c(o.pan.matrix,o.pan.matrix,f,Jt),o.pan.enabled=!0;break;case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Ot(t,e,n,o,r){const{eye:a,viewRight:s}=t,i=v(B.get(),s,a),l=e.translation[0]*n.pan;switch(0!==l&&(c(o.pan.matrix,o.pan.matrix,-l,i),o.pan.enabled=!0),r.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(c(o.pan.matrix,o.pan.matrix,t,s),o.pan.enabled=!0);break}case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Wt(n,o,r,a,s,i,c,l,m){Et(n.center,h(n.up,n.center),M(n.center),-t.normalize(e(i)),c,o.aboveGround)?Ft(o,r,a,l,m,-t.normalize(e(s))):Ot(o,r,a,l,m)}function Bt(t,e,n=1/0){const o=Math.abs(h(t,e));return Math.min(n,1/o)}const Dt=I(),Jt=I(),Kt=I(),Lt=I(),Nt=I(),Qt=I(),Vt=I(),Xt=I(),Yt=p(),Zt=A(),$t=u(),_t=u(),te=u(),ee=I(),ne=I(),oe=I();let re=new L;const ae=I(),se=I();function ie(){re=new L}const ce={origin:I(),direction:I()},le={origin:I(),direction:I()};export{gt as TiltThresholdPanningSpeed,Mt as VerticalPanTresholds,dt as applyPanPlanar,Ht as applyPanSphericalDirectRotation,qt as applyPanSphericalPreserveHeading,st as applyRotation,Gt as applyRotationWithTwoAxes,mt as applyZoomOnSphere,lt as applyZoomToPoint,ft as centroid,ie as cleanupNavigationUtils,ot as excludeTerrain,Bt as getTiltScaleFactor,it as intersectPlaneFromScreenPoint,ct as intersectPlaneFromScreenPointAtEye,At as lengthFromPoints,Z as maxPanDistanceModifier,_ as maxRotatePivotDistanceModifier,Q as maxZoomPivotDistanceModifier,X as maxZoomStepDistanceModifier,$ as minPinchAndPanCameraHeight,tt as minRotatePivotDistance,bt as navigationMode,rt as normalizeCoordinate,at as normalizeRotationDelta,ht as offSurfaceTiltToEyeTiltGlobal,pt as onSurfaceTiltToEyeTiltGlobal,Wt as panMotionToRotationMatrix,Ct as panToPosition,yt as pickPointAndInitSphere,et as pivotSearchAreaSize,Rt as preservingHeadingThresholds,nt as rotatePivotSearchAreaSize,Ut as rotatePointAroundTwoAxes,wt as rotationAngleAndAxisDirectRotation,Tt as rotationAnglesAndAxesHeadingPreserving,kt as rotationAnglesHeadingPreserving,Et as shouldPreserveHeading,jt as sphereOrPlanePointFromScreenPoint,V as zoomPivotDistanceClamp,Y as zoomStepDistanceClamp};
5
+ import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as o,asinClamped as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as a}from"../../../../core/screenUtils.js";import{fromRotation as s,exactEquals as i,rotate as c,multiply as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as m,create as u}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{f as h,b as M,e as g,t as y,g as b,n as d,s as x,d as j,i as v,h as P,l as z,j as w}from"../../../../chunks/vec32.js";import{create as I}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as A,fromPoints as k,axis as T,wrapAxisAngle as U}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as G,vectorCoordinates as R}from"../../../../geometry/support/coordinateSystem.js";import{create as S,fromNormalAndOffset as E,intersectRay as H}from"../../../../geometry/support/plane.js";import{a as q,c as C,l as F,i as O}from"../../../../chunks/sphere.js";import{sm4d as W,sv3d as B}from"../../../../geometry/support/vectorStacks.js";import{fromScreenAtEye as D,fromScreen as J}from"../../support/geometryUtils/ray.js";import{intersectScreen as K}from"../../support/geometryUtils/sphere.js";import L from"../../webgl/RenderCamera.js";import{terrainId as N}from"../../webgl-engine/lib/verticalOffsetUtils.js";const Q=30,V=[1,3e8],X=8,Y=[200,1508e5],Z=5,$=50,_=5,tt=10,et=80,nt=90,ot=1e-6,rt={exclude:new Set([N])};function at(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function st(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function it(t,e,n){const o=s(W.get(),n[3],T(n));null==o||i(o,m)||(g(oe,t.eye,e),y(oe,oe,o),t.eye=b(oe,oe,e),g(oe,t.center,e),y(oe,oe,o),t.center=b(oe,oe,e),t.up=y(oe,t.up,o))}function ct(t,e,n,o){return H(t,J(e,n,le),o)}function lt(t,e,n,o){return H(t,D(e,n,le),o)}function mt(t,e,n,o){const r=B.get();let a=1-n;g(r,e,t.eye);const s=M(r);let i=s*(1-a);a>=0&&i<o&&(i=o,a=-(i-s)/s),Math.abs(s-i)<ot||(P(r,r,a),t.eye=b(oe,t.eye,r),t.center=z(oe,t.center,e,a))}function ut(t,e,n){e.getScreenCenter(ft),K(t,e,ft,oe)&&(e.center=oe);const o=e.distance,r=o*n;if(Math.abs(o-r)<ot)return;const a=P(B.get(),e.viewForward,r);e.eye=g(oe,e.center,a)}const ft=a();function pt(t,e){w(e,0,0,0);for(const n of t)b(e,e,n);P(e,e,1/t.length)}function ht(t,e,n,o){return Math.sin(t/M(e))*(n+o.radius)}function Mt(t,e,n,o){return ht(Math.PI/2,e,n,o)+(t-Math.PI/2)}const gt={Elevation:3e4,Angle:e(16)},yt=e(80);function bt(t,e,n,o,r,a){const s=I(),i=C();let c=!0,l=!0;return t.intersectScreen(n,s,a)?i[3]=M(s):(l=!1,e.aboveGround&&0!==r?i[3]=Math.max(M(e.center),.9*o):i[3]=M(e.eye)-e.relativeElevation,1===r?vt(i,e,n,s):c=K(i,e,n,s)),{sphere:i,scenePickPoint:c?s:null,hasGeometryIntersection:l}}function dt(t,e,n,o){const r=t.relativeElevation;if(r>gt.Elevation&&"global"===o)return 1;D(t,e,me);const a=Math.sign(r),s=n.worldUpAtPosition(t.eye,oe);return-a*h(s,me.direction)<Math.sin(gt.Angle)*M(me.direction)?0:1}function xt(t,e,n){g(jt,n,e),t.eye=g(oe,t.eye,jt),t.center=g(oe,t.center,jt)}const jt=I();function vt(t,e,n,o){const r=D(e,n,le);return null!=r&&(F(t,r,Pt),O(t,r,o)?!(x(Pt,r.origin)<x(o,r.origin))||(j(o,Pt),!1):(g(zt,e.eye,e.center),d(zt,zt),E(zt,-h(d(zt,zt),Pt),wt),H(wt,r,o),!1))}const Pt=I(),zt=I(),wt=S();function It(a,s,i,c,l,m){let u=0;if(v(se,a,s),g(re,a,s),M(a)<=l||!c.aboveGround){v(i,re,c.eye);const f=h(a,s)/(M(a)*M(s));if(f<.9999)u=o(f);else{const t=M(v(I(),a,s))/(M(a)*M(s));u=r(t)}const p=Math.cos(n(t.normalize(e(m)),0,yt));u=-u-Math.max(0,M(s)-l)/(p*l)}else g(At,c.eye,c.center),v(i,re,At),u=-M(re)/l;return d(i,i),P(i,i,M(se)),u}const At=I();function kt(r,a,s,i){let c,l;const m=Math.cos(n(t.normalize(e(i)),0,yt));return c=a>s?-(a-s)/(m*s):a<-s?Math.PI-(a+s)/(m*s):o(a/s),l=r>s?-(r-s)/(m*s):r<-s?Math.PI-(r+s)/(m*s):o(r/s),(l-c)*s}function Tt(t,e,n,o,r,a,s,i,c,l){const m=kt(t[2],e[2],a[3],i),u=c?kt(t[0],e[0],a[3],180):e[0]-t[0],p=Math.sin(s)*u-Math.cos(s)*m,M=Math.cos(s)*u+Math.sin(s)*m;d(oe,r);const g=c?p/Math.sqrt(Math.abs(a[3]**2-h(n,oe)**2)):p/a[3],y=M/Math.sqrt(Math.abs(a[3]**2-h(n,o)**2));f(l,g,y)}function Ut(t,e,n,o,r,a,s,i,c,l){v(se,t,e),G(a.up,a.eye,Nt,Qt,Vt),G([0,0,1],a.eye,Jt,Kt,Lt),j(n,Kt),j(o,Jt),d(n,n),P(n,n,M(se)),R(t,d(Qt,Qt),d(Vt,Vt),d(Nt,Nt),Xt),R(e,Qt,Vt,Nt,Yt),Tt(Xt,Yt,t,Jt,Kt,s,i,c,l,r)}function Gt(t,e,n,o,r,a,i){s(_t,r,o),s(te,i,a),l(ee,_t,te),g(e,t,n),y(e,e,ee),b(e,e,n)}function Rt(t,e,n,o,r,a){s(_t,o,n),s(te,a,r),l(ee,_t,te),g(oe,t.eye,e),y(oe,oe,ee),t.eye=b(oe,oe,e),g(oe,t.center,e),y(oe,oe,ee),t.center=b(oe,oe,e),g(oe,t.up,e),y(oe,oe,ee),t.up=b(oe,oe,e)}const St={Pole:.95,Angle:e(18),Tilt:45,TiltHysteresisMargin:1e-7};let Et=!1;function Ht(t,e,n,o,r,a){const s=Math.abs(o)>Math.PI-St.Angle||Math.abs(o)<St.Angle,i=(Math.abs(t[2])<n*St.Pole||Math.abs(e)>n)&&a;return s&&i?!Et&&r<St.Tilt-St.TiltHysteresisMargin?Et=!0:Et&&r>St.Tilt+St.TiltHysteresisMargin&&(Et=!1):Et=!1,Et}function qt(t,e,n,o,r,a){if(a)k(n,o,$t),it(e,q(t),$t);else{const a=It(n,o,ie,e,t[3],r);it(e,q(t),U(ie,a))}}function Ct(t,e,n,o,r,a,s){const i=s?20:1,c=1e-12;let l,m;j(ne,o),ae.copyFrom(e);for(let u=0;u<i&&x(n,ne)>c&&(l=x(n,ne),Ut(n,ne,Kt,Jt,Zt,ae,t,r,a,s),Rt(ae,q(t),Jt,Zt[1],Kt,Zt[0]),Gt(ne,ne,q(t),Jt,Zt[1],Kt,Zt[0]),m=x(n,ne),m<l||0===u);u++)e.copyFrom(ae)}function Ft(n,o,r,a,s,i,c){Ht(r,h(o.up,r),n[3],-t.normalize(e(s)),i,o.aboveGround)?Ct(n,o,r,a,-t.normalize(e(s)),i,c):qt(n,o,r,a,i,c)}function Ot(t,e,n,o,r,a){const{eye:s}=t;G([0,0,1],s,Jt,Kt,Lt);const i=e.translation[0]*n.pan,l="zoom"===r.mode?0:e.translation[1]*n.pan,m=Math.max(Math.sqrt(Math.abs(1-h(t.center,Jt)**2/M(t.center)**2)),.5),u=(Math.sin(a)*l+Math.cos(a)*i)/m,f=-Math.cos(a)*l+Math.sin(a)*i;switch(c(o.pan.matrix,o.pan.matrix,u,Jt),o.pan.enabled=!0,r.mode){case"pan":c(o.pan.matrix,o.pan.matrix,f,Kt),o.pan.enabled=!0;break;case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Wt(t,e,n,o,r){const{eye:a,viewRight:s}=t,i=v(B.get(),s,a),l=e.translation[0]*n.pan;switch(0!==l&&(c(o.pan.matrix,o.pan.matrix,-l,i),o.pan.enabled=!0),r.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(c(o.pan.matrix,o.pan.matrix,t,s),o.pan.enabled=!0);break}case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Bt(n,o,r,a,s,i,c,l,m){Ht(n.center,h(n.up,n.center),M(n.center),-t.normalize(e(i)),c,o.aboveGround)?Ot(o,r,a,l,m,-t.normalize(e(s))):Wt(o,r,a,l,m)}function Dt(t,e,n=1/0){const o=Math.abs(h(t,e));return Math.min(n,1/o)}const Jt=I(),Kt=I(),Lt=I(),Nt=I(),Qt=I(),Vt=I(),Xt=I(),Yt=I(),Zt=p(),$t=A(),_t=u(),te=u(),ee=u(),ne=I(),oe=I(),re=I();let ae=new L;const se=I(),ie=I();function ce(){ae=new L}const le={origin:I(),direction:I()},me={origin:I(),direction:I()};export{yt as TiltThresholdPanningSpeed,gt as VerticalPanTresholds,xt as applyPanPlanar,qt as applyPanSphericalDirectRotation,Ct as applyPanSphericalPreserveHeading,it as applyRotation,Rt as applyRotationWithTwoAxes,ut as applyZoomOnSphere,mt as applyZoomToPoint,pt as centroid,ce as cleanupNavigationUtils,ot as distanceComparisonTolerance,rt as excludeTerrain,Dt as getTiltScaleFactor,dt as inferNavigationMode,ct as intersectPlaneFromScreenPoint,lt as intersectPlaneFromScreenPointAtEye,kt as lengthFromPoints,Z as maxPanDistanceModifier,_ as maxRotatePivotDistanceModifier,Q as maxZoomPivotDistanceModifier,X as maxZoomStepDistanceModifier,$ as minPinchAndPanCameraHeight,tt as minRotatePivotDistance,at as normalizeCoordinate,st as normalizeRotationDelta,Mt as offSurfaceTiltToEyeTiltGlobal,ht as onSurfaceTiltToEyeTiltGlobal,Bt as panMotionToRotationMatrix,Ft as panToPosition,bt as pickPointAndInitSphere,et as pivotSearchAreaSize,St as preservingHeadingThresholds,nt as rotatePivotSearchAreaSize,Gt as rotatePointAroundTwoAxes,It as rotationAngleAndAxisDirectRotation,Ut as rotationAnglesAndAxesHeadingPreserving,Tt as rotationAnglesHeadingPreserving,Ht as shouldPreserveHeading,vt as sphereOrPlanePointFromScreenPoint,V as zoomPivotDistanceClamp,Y as zoomStepDistanceClamp};
@@ -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 has from"../../../core/has.js";import{Milliseconds as e}from"../../../core/time.js";class a{static isValidProfile(e){return e in l}static getDefaultProfile(){return has("esri-iPhone")?"low":"medium"}static apply(e,a){const i=l[e];a.graphics3D.maxTotalNumberOfFeatures=i.graphics3D.maxTotalNumberOfFeatures,a.graphics3D.maxNumberOfDrawCalls=i.graphics3D.maxNumberOfDrawCalls,a.graphics3D.maxTotalNumberOfVertices=i.graphics3D.maxTotalNumberOfVertices,a.graphics3D.polygonLodFactor=i.graphics3D.polygonLodFactor,a.graphics3D.polylineLodFactor=i.graphics3D.polylineLodFactor,a.graphics3D.snapshotAvailable=i.graphics3D.snapshotAvailable,a.graphics3D.skipHighSymbolLods=i.graphics3D.skipHighSymbolLods;const t=a.sceneService.object,o=i.sceneService.object;t.lodFactor=o.lodFactor,a.sceneService.point.lodFactor=i.sceneService.point.lodFactor,a.sceneService.integratedMesh.lodFactor=i.sceneService.integratedMesh.lodFactor,a.sceneService.pointCloud.lodFactor=i.sceneService.pointCloud.lodFactor,a.tiledSurface.lodBias=i.tiledSurface.lodBias,a.tiledSurface.angledSplitBias=i.tiledSurface.angledSplitBias,a.tiledSurface.vtlContentZoom=i.tiledSurface.vtlContentZoom,a.tiledSurface.elevationLevelDelta=i.tiledSurface.elevationLevelDelta,a.tiledSurface.reduceTileLevelDifferences=i.tiledSurface.reduceTileLevelDifferences,a.gaussianSplat.minimumSplatPixelRadius=i.gaussianSplat.minimumSplatPixelRadius,a.gaussianSplat.minimumOpacity=i.gaussianSplat.minimumOpacity,a.gaussianSplat.maxAllowedVisibleGaussians=i.gaussianSplat.maxAllowedVisibleGaussians,a.heatmap.pixelRatio=i.heatmap.pixelRatio,a.heatmap.maxTotalNumberOfFeatures=i.heatmap.maxTotalNumberOfFeatures,a.fadeDuration=i.fadeDuration,a.antialiasingEnabled=i.antialiasingEnabled,a.physicallyBasedRenderingEnabled=i.physicalBasedRenderingEnabled,a.highQualityTransparency=i.highQualityTransparency,a.highResolutionAtmosphere=i.highResolutionAtmosphere,a.reflections=i.reflections,a.ambientOcclusion=i.ambientOcclusion,a.maxTexturePixels=i.maxTexturePixels,a.memoryLimit=i.memoryLimit,a.additionalCacheMemory=i.additionalCacheMemory,a.frameRate=i.frameRate,a.maximumPixelRatio=i.maximumPixelRatio}static{this.test={reset(){const e=t();for(const a of Object.keys(e))l[a]=e[a]}}}}const i={IPhone12Pro:120,GalaxyS20:200,FullHD:240,SurfacePro7:300,FullHDRetina:430},l=t();function t(){const a=!!has("esri-mobile"),l=!!has("ios"),t=e(400);return{low:{graphics3D:{maxTotalNumberOfFeatures:25e3,maxNumberOfDrawCalls:8e3,maxTotalNumberOfVertices:255e4,polygonLodFactor:.5,polylineLodFactor:1,snapshotAvailable:!1,skipHighSymbolLods:!0},heatmap:{pixelRatio:.125,maxTotalNumberOfFeatures:5e4},sceneService:{object:{lodFactor:.2},point:{lodFactor:1},integratedMesh:{lodFactor:.6},pointCloud:{lodFactor:.5}},gaussianSplat:{minimumSplatPixelRadius:2,minimumOpacity:.1,maxAllowedVisibleGaussians:4e6},tiledSurface:{lodBias:-1,angledSplitBias:.5,vtlContentZoom:.75,elevationLevelDelta:3,reduceTileLevelDifferences:!0},fadeDuration:e(0),antialiasingEnabled:!1,physicalBasedRenderingEnabled:!1,highQualityTransparency:!1,highResolutionAtmosphere:!1,reflections:!1,ambientOcclusion:!1,maxTexturePixels:a?1048576:4194304,memoryLimit:200+i.IPhone12Pro,additionalCacheMemory:0,frameRate:0,maximumPixelRatio:1},medium:{graphics3D:{maxTotalNumberOfFeatures:1e5,maxNumberOfDrawCalls:17e3,maxTotalNumberOfVertices:625e4,polygonLodFactor:a?.8:1,polylineLodFactor:a?1.2:1.5,snapshotAvailable:!l,skipHighSymbolLods:!1},heatmap:{pixelRatio:.25,maxTotalNumberOfFeatures:13e4},sceneService:{object:{lodFactor:1},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1}},gaussianSplat:{minimumSplatPixelRadius:1,minimumOpacity:.05,maxAllowedVisibleGaussians:8e6},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,elevationLevelDelta:3,reduceTileLevelDifferences:!has("disable-feature:reduce-map-tile-levels")},fadeDuration:t,antialiasingEnabled:!1,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highResolutionAtmosphere:!1,reflections:!1,ambientOcclusion:!1,maxTexturePixels:a?4194304:4096**2,memoryLimit:a?600+i.GalaxyS20:750+i.FullHD,additionalCacheMemory:a?-100:150,frameRate:0,maximumPixelRatio:1},high:{graphics3D:{maxTotalNumberOfFeatures:1e5,maxNumberOfDrawCalls:17e3,maxTotalNumberOfVertices:125e5,polygonLodFactor:a?1.2:2,polylineLodFactor:a?1.2:2,snapshotAvailable:!l,skipHighSymbolLods:!1},heatmap:{pixelRatio:.5,maxTotalNumberOfFeatures:23e4},sceneService:{object:{lodFactor:1},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1}},gaussianSplat:{minimumSplatPixelRadius:.5,minimumOpacity:.005,maxAllowedVisibleGaussians:16e6},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,elevationLevelDelta:2,reduceTileLevelDifferences:!has("disable-feature:reduce-map-tile-levels")},fadeDuration:t,antialiasingEnabled:!0,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highResolutionAtmosphere:!0,reflections:!0,ambientOcclusion:!0,maxTexturePixels:a?4096**2:1/0,memoryLimit:a?900+i.SurfacePro7:1500+i.FullHDRetina,additionalCacheMemory:a?-150:0,frameRate:0,maximumPixelRatio:a?1:1/0}}}export{a as default};
5
+ import has from"../../../core/has.js";import{Milliseconds as e}from"../../../core/time.js";class a{static isValidProfile(e){return e in l}static getDefaultProfile(){return has("esri-iPhone")?"low":"medium"}static apply(e,a){const i=l[e];a.graphics3D.maxTotalNumberOfFeatures=i.graphics3D.maxTotalNumberOfFeatures,a.graphics3D.maxNumberOfDrawCalls=i.graphics3D.maxNumberOfDrawCalls,a.graphics3D.maxTotalNumberOfVertices=i.graphics3D.maxTotalNumberOfVertices,a.graphics3D.polygonLodFactor=i.graphics3D.polygonLodFactor,a.graphics3D.polylineLodFactor=i.graphics3D.polylineLodFactor,a.graphics3D.snapshotAvailable=i.graphics3D.snapshotAvailable,a.graphics3D.skipHighSymbolLods=i.graphics3D.skipHighSymbolLods;const t=a.sceneService.object,o=i.sceneService.object;t.lodFactor=o.lodFactor,a.sceneService.point.lodFactor=i.sceneService.point.lodFactor,a.sceneService.integratedMesh.lodFactor=i.sceneService.integratedMesh.lodFactor,a.sceneService.pointCloud.lodFactor=i.sceneService.pointCloud.lodFactor,a.tiledSurface.lodBias=i.tiledSurface.lodBias,a.tiledSurface.angledSplitBias=i.tiledSurface.angledSplitBias,a.tiledSurface.vtlContentZoom=i.tiledSurface.vtlContentZoom,a.tiledSurface.elevationLevelDelta=i.tiledSurface.elevationLevelDelta,a.tiledSurface.reduceTileLevelDifferences=i.tiledSurface.reduceTileLevelDifferences,a.gaussianSplat.minimumSplatPixelRadius=i.gaussianSplat.minimumSplatPixelRadius,a.gaussianSplat.minimumOpacity=i.gaussianSplat.minimumOpacity,a.gaussianSplat.maxAllowedVisibleGaussians=i.gaussianSplat.maxAllowedVisibleGaussians,a.heatmap.pixelRatio=i.heatmap.pixelRatio,a.fadeDuration=i.fadeDuration,a.antialiasingEnabled=i.antialiasingEnabled,a.physicallyBasedRenderingEnabled=i.physicalBasedRenderingEnabled,a.highQualityTransparency=i.highQualityTransparency,a.highResolutionAtmosphere=i.highResolutionAtmosphere,a.reflections=i.reflections,a.ambientOcclusion=i.ambientOcclusion,a.maxTexturePixels=i.maxTexturePixels,a.memoryLimit=i.memoryLimit,a.additionalCacheMemory=i.additionalCacheMemory,a.frameRate=i.frameRate,a.maximumPixelRatio=i.maximumPixelRatio}static{this.test={reset(){const e=t();for(const a of Object.keys(e))l[a]=e[a]}}}}const i={IPhone12Pro:120,GalaxyS20:200,FullHD:240,SurfacePro7:300,FullHDRetina:430},l=t();function t(){const a=!!has("esri-mobile"),l=!!has("ios"),t=e(400);return{low:{graphics3D:{maxTotalNumberOfFeatures:5e4,maxNumberOfDrawCalls:8e3,maxTotalNumberOfVertices:255e4,polygonLodFactor:.5,polylineLodFactor:1,snapshotAvailable:!1,skipHighSymbolLods:!0},heatmap:{pixelRatio:.125},sceneService:{object:{lodFactor:.2},point:{lodFactor:1},integratedMesh:{lodFactor:.6},pointCloud:{lodFactor:.5}},gaussianSplat:{minimumSplatPixelRadius:2,minimumOpacity:.1,maxAllowedVisibleGaussians:4e6},tiledSurface:{lodBias:-1,angledSplitBias:.5,vtlContentZoom:.75,elevationLevelDelta:3,reduceTileLevelDifferences:!0},fadeDuration:e(0),antialiasingEnabled:!1,physicalBasedRenderingEnabled:!1,highQualityTransparency:!1,highResolutionAtmosphere:!1,reflections:!1,ambientOcclusion:!1,maxTexturePixels:a?1048576:4194304,memoryLimit:200+i.IPhone12Pro,additionalCacheMemory:0,frameRate:0,maximumPixelRatio:1},medium:{graphics3D:{maxTotalNumberOfFeatures:15e4,maxNumberOfDrawCalls:17e3,maxTotalNumberOfVertices:625e4,polygonLodFactor:a?.8:1,polylineLodFactor:a?1.2:1.5,snapshotAvailable:!l,skipHighSymbolLods:!1},heatmap:{pixelRatio:.25},sceneService:{object:{lodFactor:1},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1}},gaussianSplat:{minimumSplatPixelRadius:1,minimumOpacity:.05,maxAllowedVisibleGaussians:8e6},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,elevationLevelDelta:3,reduceTileLevelDifferences:!has("disable-feature:reduce-map-tile-levels")},fadeDuration:t,antialiasingEnabled:!1,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highResolutionAtmosphere:!1,reflections:!1,ambientOcclusion:!1,maxTexturePixels:a?4194304:4096**2,memoryLimit:a?600+i.GalaxyS20:750+i.FullHD,additionalCacheMemory:a?-100:150,frameRate:0,maximumPixelRatio:1},high:{graphics3D:{maxTotalNumberOfFeatures:3e5,maxNumberOfDrawCalls:17e3,maxTotalNumberOfVertices:125e5,polygonLodFactor:a?1.2:2,polylineLodFactor:a?1.2:2,snapshotAvailable:!l,skipHighSymbolLods:!1},heatmap:{pixelRatio:.5},sceneService:{object:{lodFactor:1},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1}},gaussianSplat:{minimumSplatPixelRadius:.5,minimumOpacity:.005,maxAllowedVisibleGaussians:16e6},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,elevationLevelDelta:2,reduceTileLevelDifferences:!has("disable-feature:reduce-map-tile-levels")},fadeDuration:t,antialiasingEnabled:!0,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highResolutionAtmosphere:!0,reflections:!0,ambientOcclusion:!0,maxTexturePixels:a?4096**2:1/0,memoryLimit:a?900+i.SurfacePro7:1500+i.FullHDRetina,additionalCacheMemory:a?-150:0,frameRate:0,maximumPixelRatio:a?1:1/0}}}export{a 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 e from"../../../core/Accessor.js";import{Milliseconds as o}from"../../../core/time.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";let r=class extends e{constructor(){super(...arguments),this.minTotalNumberOfFeatures=2e3,this.maxTotalNumberOfFeatures=5e4,this.maxNumberOfDrawCalls=17e3,this.maxTotalNumberOfVertices=17e5,this.snapshotAvailable=!0,this.polygonLodFactor=1,this.polylineLodFactor=1,this.skipHighSymbolLods=!1}};t([i()],r.prototype,"minTotalNumberOfFeatures",void 0),t([i()],r.prototype,"maxTotalNumberOfFeatures",void 0),t([i()],r.prototype,"maxNumberOfDrawCalls",void 0),t([i()],r.prototype,"maxTotalNumberOfVertices",void 0),t([i()],r.prototype,"snapshotAvailable",void 0),t([i()],r.prototype,"polygonLodFactor",void 0),t([i()],r.prototype,"polylineLodFactor",void 0),t([i()],r.prototype,"skipHighSymbolLods",void 0),r=t([s("esri.views.3d.support.QualitySettings.Graphics3DSettings")],r);let p=class{constructor(){this.minimumSplatPixelRadius=1,this.minimumOpacity=.05,this.maxAllowedVisibleGaussians=8e6}};t([i()],p.prototype,"minimumSplatPixelRadius",void 0),t([i()],p.prototype,"minimumOpacity",void 0),t([i()],p.prototype,"maxAllowedVisibleGaussians",void 0),p=t([s("esri.views.3d.support.QualitySettings.GaussianSplatSettings")],p);let a=class extends e{constructor(){super(...arguments),this.lodFactor=1}};t([i()],a.prototype,"lodFactor",void 0),a=t([s("esri.views.3d.support.QualitySettings.LoDFactorSettings")],a);let l=class extends e{constructor(){super(...arguments),this.object=new a,this.point=new a,this.integratedMesh=new a,this.pointCloud=new a}};t([i({type:a})],l.prototype,"object",void 0),t([i({type:a})],l.prototype,"point",void 0),t([i({type:a})],l.prototype,"integratedMesh",void 0),t([i({type:a})],l.prototype,"pointCloud",void 0),l=t([s("esri.views.3d.support.QualitySettings.SceneServiceSettings")],l);let n=class extends e{constructor(){super(...arguments),this.lodBias=0,this.angledSplitBias=1,this.vtlContentZoom=1,this.elevationLevelDelta=3,this.reduceTileLevelDifferences=!0}};t([i()],n.prototype,"lodBias",void 0),t([i()],n.prototype,"angledSplitBias",void 0),t([i()],n.prototype,"vtlContentZoom",void 0),t([i()],n.prototype,"elevationLevelDelta",void 0),t([i()],n.prototype,"reduceTileLevelDifferences",void 0),n=t([s("esri.views.3d.support.QualitySettings.TiledSurfaceSettings")],n);let d=class extends e{constructor(){super(...arguments),this.pixelRatio=1,this.maxTotalNumberOfFeatures=5e4}};t([i()],d.prototype,"pixelRatio",void 0),t([i()],d.prototype,"maxTotalNumberOfFeatures",void 0),d=t([s("esri.views.3d.support.QualitySettings.HeatmapSettings")],d);let c=class extends e{constructor(){super(...arguments),this.graphics3D=new r,this.sceneService=new l,this.tiledSurface=new n,this.gaussianSplat=new p,this.heatmap=new d,this.fadeDuration=o(400),this.antialiasingEnabled=!0,this.physicallyBasedRenderingEnabled=!1,this.highQualityTransparency=!0,this.highResolutionAtmosphere=!1,this.reflections=!1,this.ambientOcclusion=!1,this.glow=!1,this.maxTexturePixels=1/0,this.memoryLimit=750,this.additionalCacheMemory=0,this.frameRate=void 0,this.maximumPixelRatio=1/0}};t([i({type:r})],c.prototype,"graphics3D",void 0),t([i({type:l})],c.prototype,"sceneService",void 0),t([i({type:n})],c.prototype,"tiledSurface",void 0),t([i({type:p})],c.prototype,"gaussianSplat",void 0),t([i({type:d})],c.prototype,"heatmap",void 0),t([i()],c.prototype,"fadeDuration",void 0),t([i()],c.prototype,"antialiasingEnabled",void 0),t([i()],c.prototype,"physicallyBasedRenderingEnabled",void 0),t([i()],c.prototype,"highQualityTransparency",void 0),t([i()],c.prototype,"highResolutionAtmosphere",void 0),t([i()],c.prototype,"reflections",void 0),t([i()],c.prototype,"ambientOcclusion",void 0),t([i()],c.prototype,"glow",void 0),t([i()],c.prototype,"maxTexturePixels",void 0),t([i()],c.prototype,"memoryLimit",void 0),t([i()],c.prototype,"additionalCacheMemory",void 0),t([i()],c.prototype,"frameRate",void 0),t([i()],c.prototype,"maximumPixelRatio",void 0),c=t([s("esri.views.3d.support.QualitySettings")],c);const m=c;export{m as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{Milliseconds as o}from"../../../core/time.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";let r=class extends e{constructor(){super(...arguments),this.minTotalNumberOfFeatures=2e3,this.maxTotalNumberOfFeatures=5e4,this.maxNumberOfDrawCalls=17e3,this.maxTotalNumberOfVertices=17e5,this.snapshotAvailable=!0,this.polygonLodFactor=1,this.polylineLodFactor=1,this.skipHighSymbolLods=!1}};t([i()],r.prototype,"minTotalNumberOfFeatures",void 0),t([i()],r.prototype,"maxTotalNumberOfFeatures",void 0),t([i()],r.prototype,"maxNumberOfDrawCalls",void 0),t([i()],r.prototype,"maxTotalNumberOfVertices",void 0),t([i()],r.prototype,"snapshotAvailable",void 0),t([i()],r.prototype,"polygonLodFactor",void 0),t([i()],r.prototype,"polylineLodFactor",void 0),t([i()],r.prototype,"skipHighSymbolLods",void 0),r=t([s("esri.views.3d.support.QualitySettings.Graphics3DSettings")],r);let p=class{constructor(){this.minimumSplatPixelRadius=1,this.minimumOpacity=.05,this.maxAllowedVisibleGaussians=8e6}};t([i()],p.prototype,"minimumSplatPixelRadius",void 0),t([i()],p.prototype,"minimumOpacity",void 0),t([i()],p.prototype,"maxAllowedVisibleGaussians",void 0),p=t([s("esri.views.3d.support.QualitySettings.GaussianSplatSettings")],p);let a=class extends e{constructor(){super(...arguments),this.lodFactor=1}};t([i()],a.prototype,"lodFactor",void 0),a=t([s("esri.views.3d.support.QualitySettings.LoDFactorSettings")],a);let l=class extends e{constructor(){super(...arguments),this.object=new a,this.point=new a,this.integratedMesh=new a,this.pointCloud=new a}};t([i({type:a})],l.prototype,"object",void 0),t([i({type:a})],l.prototype,"point",void 0),t([i({type:a})],l.prototype,"integratedMesh",void 0),t([i({type:a})],l.prototype,"pointCloud",void 0),l=t([s("esri.views.3d.support.QualitySettings.SceneServiceSettings")],l);let n=class extends e{constructor(){super(...arguments),this.lodBias=0,this.angledSplitBias=1,this.vtlContentZoom=1,this.elevationLevelDelta=3,this.reduceTileLevelDifferences=!0}};t([i()],n.prototype,"lodBias",void 0),t([i()],n.prototype,"angledSplitBias",void 0),t([i()],n.prototype,"vtlContentZoom",void 0),t([i()],n.prototype,"elevationLevelDelta",void 0),t([i()],n.prototype,"reduceTileLevelDifferences",void 0),n=t([s("esri.views.3d.support.QualitySettings.TiledSurfaceSettings")],n);let d=class extends e{constructor(){super(...arguments),this.pixelRatio=1}};t([i()],d.prototype,"pixelRatio",void 0),d=t([s("esri.views.3d.support.QualitySettings.HeatmapSettings")],d);let c=class extends e{constructor(){super(...arguments),this.graphics3D=new r,this.sceneService=new l,this.tiledSurface=new n,this.gaussianSplat=new p,this.heatmap=new d,this.fadeDuration=o(400),this.antialiasingEnabled=!0,this.physicallyBasedRenderingEnabled=!1,this.highQualityTransparency=!0,this.highResolutionAtmosphere=!1,this.reflections=!1,this.ambientOcclusion=!1,this.glow=!1,this.maxTexturePixels=1/0,this.memoryLimit=750,this.additionalCacheMemory=0,this.frameRate=void 0,this.maximumPixelRatio=1/0}};t([i({type:r})],c.prototype,"graphics3D",void 0),t([i({type:l})],c.prototype,"sceneService",void 0),t([i({type:n})],c.prototype,"tiledSurface",void 0),t([i({type:p})],c.prototype,"gaussianSplat",void 0),t([i({type:d})],c.prototype,"heatmap",void 0),t([i()],c.prototype,"fadeDuration",void 0),t([i()],c.prototype,"antialiasingEnabled",void 0),t([i()],c.prototype,"physicallyBasedRenderingEnabled",void 0),t([i()],c.prototype,"highQualityTransparency",void 0),t([i()],c.prototype,"highResolutionAtmosphere",void 0),t([i()],c.prototype,"reflections",void 0),t([i()],c.prototype,"ambientOcclusion",void 0),t([i()],c.prototype,"glow",void 0),t([i()],c.prototype,"maxTexturePixels",void 0),t([i()],c.prototype,"memoryLimit",void 0),t([i()],c.prototype,"additionalCacheMemory",void 0),t([i()],c.prototype,"frameRate",void 0),t([i()],c.prototype,"maximumPixelRatio",void 0),c=t([s("esri.views.3d.support.QualitySettings")],c);const y=c;export{y 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"../../../request.js";import s from"../../../core/Accessor.js";import{removeUnordered as r}from"../../../core/arrayUtils.js";import o from"../../../core/Error.js";import"../../../core/has.js";import{clone as a}from"../../../core/lang.js";import{removeMaybe as n,abortMaybe as i,destroyMaybe as u}from"../../../core/maybe.js";import{createResolver as l,createAbortError as h,onAbort as d,throwIfAborted as c,isAbortError as m}from"../../../core/promiseUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{AsyncWorkerQueue as g,BaseTask as f}from"./AsyncWorkerQueue.js";import{ImageWithType as k}from"./ImageWithType.js";import{isImageWithType as b}from"../terrain/TerrainData.js";import{assert as y}from"../webgl-engine/lib/Util.js";import{TaskPriority as T}from"../../support/Scheduler.js";let L=class extends s{constructor(){super(...arguments),this._tasks=new Map,this._onLoadQueue=new Array,this._doneQueue=new Array,this.updating=!1}setup(e,t,s){this._loadQueue=new g((e,t)=>this._startLoading(e,t),(e,t)=>this._doneLoadingCB(e,t),e,t),s&&(this._frameTask=s.registerTask(T.STREAM_DATA_LOADER,this))}destroy(){this._frameTask=n(this._frameTask),this._tasks.forEach(e=>i(e.abortController)),this._loadQueue=u(this._loadQueue),this._onLoadQueue.length=0,this._onLoadQueue=null,this._doneQueue.length=0,this._doneQueue=null,this._tasks.forEach(e=>e.destroy()),this._tasks.clear(),this._tasks=null}hasDownloadSlots(e){return this._loadQueue.hasQuota(e)}request(e,t,s,r={}){const o=l();return o.__signal=null!=r?r.signal:null,this._createOrUpdateTask(e,t,s,r,o),o.promise}_createTask(e,t,s,r,o,a){const n=new j(e,t,s,r,o);return this._updateTask(n,a),this._tasks.set(o,n),1===this._tasks.size&&this._set("updating",!0),this._loadQueue.push(n),n}_cancelRequest(e,t){const s=this._tasks.get(e);s&&(r(s.resolvers,t),t.reject(h()),0===s.resolvers.length&&(2===s.status&&this._loadQueue.cancel(s),s.status=4,this._removeTask(s)))}_updateTask(e,t){e.resolvers.push(t)}_createOrUpdateTask(e,t,s,r,o){const a=v(r?.uid||e,t,s);let n=this._tasks.get(a);n?this._updateTask(n,o):(n=this._createTask(e,r,t,s,a,o),n.abortHandle=d(r,()=>this._cancelRequest(a,o)))}_doneLoadingCB(e,t){this._loadQueue&&(y(2===e.status),e.status=3,this._frameTask?this._doneQueue.push({task:e,err:t}):this._doneLoading(e,t))}get readyToRun(){return this._doneQueue.length>0||this._onLoadQueue.length>0}runTask(e){for(;!e.done&&this._onLoadQueue.length>0;){const t=this._onLoadQueue.shift();c(t.task.abortController),t.task.abortController=null,t.callback(t.task),e.madeProgress()}for(;!e.done&&this._doneQueue.length>0;){const t=this._doneQueue.shift();3!==t.task.status&&(t.err=t.err||h()),this._doneLoading(t.task,t.err),e.madeProgress()}}_doneLoading(e,t){if(t&&!m(t)&&e.numRetries>0)return--e.numRetries,void this._loadQueue.push(e);let s=b(e.result)||e.result instanceof HTMLImageElement?0:e.resolvers.length;for(const r of e.resolvers)if(t)m(t)?r.reject(t):r.reject(new o("stream-data-loader:request-error",`Failed to request resource at '${e.url}'. ${t}`,{url:e.url,error:t}));else{--s;const t=s>0?a(e.result):e.result;r.resolve(t)}this._removeTask(e)}_removeTask(e){this._tasks.delete(e.key),e.destroy(),0===this._tasks.size&&this._set("updating",!1)}_startLoading(e,s){if(4===e.status)return!1;let r,o;switch(e.startTime=performance.now(),e.status=2,e.docType){case 1:o="array-buffer",r=0;break;case 2:o="image";break;case 3:o="array-buffer";break;default:o="json"}e.abortController=new AbortController;const a=e.abortController.signal;e.request=t(e.url,{...e.options,responseType:o,timeout:r,signal:a});const n=t=>{e.duration=performance.now()-e.startTime,e.size=t instanceof ArrayBuffer?t.byteLength:e.size||0,e.result=t,this._frameTask?this._onLoadQueue.push({callback:s,task:e}):(e.abortController=null,s(e))},i=t=>{2===e.status&&s(e,t)};return 3!==e.docType?(e.request.then(e=>n(e.data),i),!0):(e.request.then(s=>{const u=s.data,l=Q(u);if(o="image",e.size=u.byteLength,"unknown"===l)return e.request=t(e.url,{responseType:o,timeout:r,signal:a}),void e.request.then(e=>n(e.data),i);const h=new Blob([u],{type:l}),d=window.URL.createObjectURL(h);e.request=t(d,{responseType:o,timeout:r,signal:a}),e.request.then(e=>n(new k(e.data,l)),i).finally(()=>window.URL.revokeObjectURL(d))},i),!0)}get test(){}};e([p({readOnly:!0})],L.prototype,"updating",void 0),L=e([_("esri.views.3d.support.StreamDataLoader")],L);const w={numRetries:0};function Q(e){if(e.byteLength<2)return"unknown";const t=new Uint8Array(e,0,e.byteLength);return 137===t[0]&&80===t[1]?"image/png":71===t[0]&&73===t[1]?"image/gif":66===t[0]&&77===t[1]?"image/bmp":255===t[0]&&216===t[1]?"image/jpeg":"unknown"}class j extends f{constructor(e,t,s,r,o){super(r),this.url=e,this.options=t,this.docType=s,this.key=o,this.abortHandle=null,this.result=null,this.status=1,this.request=null,this.abortController=null,this.resolvers=new Array,this.startTime=0,this.numRetries=w.numRetries}destroy(){this.result=null,this.request=null,this.abortController?.abort(),this.abortController=null,this.resolvers.length=0,this.options=null,this.abortHandle=n(this.abortHandle)}}function v(e,t,s){return`${e}:${t}:${s}`}export{L as StreamDataLoader,w as test};
5
+ import{__decorate as e}from"tslib";import t from"../../../request.js";import s from"../../../core/Accessor.js";import{removeUnordered as r}from"../../../core/arrayUtils.js";import{neverReached as o}from"../../../core/compilerUtils.js";import a from"../../../core/Error.js";import"../../../core/has.js";import{clone as n}from"../../../core/lang.js";import{removeMaybe as i,abortMaybe as u,destroyMaybe as l}from"../../../core/maybe.js";import{createResolver as h,createAbortError as d,onAbort as c,throwIfAborted as m,isAbortError as p}from"../../../core/promiseUtils.js";import{property as _}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as g}from"../../../core/accessorSupport/decorators/subclass.js";import{AsyncWorkerQueue as f,BaseTask as k}from"./AsyncWorkerQueue.js";import{ImageWithType as b}from"./ImageWithType.js";import{isImageWithType as y}from"../terrain/TerrainData.js";import{assert as T}from"../webgl-engine/lib/Util.js";import{TaskPriority as L}from"../../support/Scheduler.js";let j=class extends s{constructor(){super(...arguments),this._tasks=new Map,this._onLoadQueue=new Array,this._doneQueue=new Array,this.updating=!1}setup(e,t,s){this._loadQueue=new f((e,t)=>this._startLoading(e,t),(e,t)=>this._doneLoadingCB(e,t),e,t),s&&(this._frameTask=s.registerTask(L.STREAM_DATA_LOADER,this))}destroy(){this._frameTask=i(this._frameTask),this._tasks.forEach(e=>u(e.abortController)),this._loadQueue=l(this._loadQueue),this._onLoadQueue.length=0,this._onLoadQueue=null,this._doneQueue.length=0,this._doneQueue=null,this._tasks.forEach(e=>e.destroy()),this._tasks.clear(),this._tasks=null}hasDownloadSlots(e){return this._loadQueue.hasQuota(e)}request(e,t,s,r={}){const o=h();return o.__signal=null!=r?r.signal:null,this._createOrUpdateTask(e,t,s,r,o),o.promise}_createTask(e,t,s,r,o,a){const n=new v(e,t,s,r,o);return this._updateTask(n,a),this._tasks.set(o,n),1===this._tasks.size&&this._set("updating",!0),this._loadQueue.push(n),n}_cancelRequest(e,t){const s=this._tasks.get(e);s&&(r(s.resolvers,t),t.reject(d()),0===s.resolvers.length&&(2===s.status&&this._loadQueue.cancel(s),s.status=4,this._removeTask(s)))}_updateTask(e,t){e.resolvers.push(t)}_createOrUpdateTask(e,t,s,r,o){const a=q(r?.uid||e,t,s);let n=this._tasks.get(a);n?this._updateTask(n,o):(n=this._createTask(e,r,t,s,a,o),n.abortHandle=c(r,()=>this._cancelRequest(a,o)))}_doneLoadingCB(e,t){this._loadQueue&&(T(2===e.status),e.status=3,this._frameTask?this._doneQueue.push({task:e,err:t}):this._doneLoading(e,t))}get readyToRun(){return this._doneQueue.length>0||this._onLoadQueue.length>0}runTask(e){for(;!e.done&&this._onLoadQueue.length>0;){const t=this._onLoadQueue.shift();m(t.task.abortController),t.task.abortController=null,t.callback(t.task),e.madeProgress()}for(;!e.done&&this._doneQueue.length>0;){const t=this._doneQueue.shift();3!==t.task.status&&(t.err=t.err||d()),this._doneLoading(t.task,t.err),e.madeProgress()}}_doneLoading(e,t){if(t&&!p(t)&&e.numRetries>0)return--e.numRetries,void this._loadQueue.push(e);let s=y(e.result)||e.result instanceof HTMLImageElement?0:e.resolvers.length;for(const r of e.resolvers)if(t)p(t)?r.reject(t):r.reject(new a("stream-data-loader:request-error",`Failed to request resource at '${e.url}'. ${t}`,{url:e.url,error:t}));else{--s;const t=s>0?n(e.result):e.result;r.resolve(t)}this._removeTask(e)}_removeTask(e){this._tasks.delete(e.key),e.destroy(),0===this._tasks.size&&this._set("updating",!1)}_startLoading(e,s){if(4===e.status)return!1;let r;e.startTime=performance.now(),e.status=2;let a="json";switch(e.docType){case 1:a="array-buffer",r=0;break;case 2:a="image";break;case 3:a="array-buffer";break;case 0:a="json";break;default:o(e.docType)}e.abortController=new AbortController;const n=e.abortController.signal;e.request=t(e.url,{...e.options,responseType:a,timeout:r,signal:n});const i=t=>{e.duration=performance.now()-e.startTime,e.size=t instanceof ArrayBuffer?t.byteLength:e.size||0,e.result=t,this._frameTask?this._onLoadQueue.push({callback:s,task:e}):(e.abortController=null,s(e))},u=t=>{2===e.status&&s(e,t)};return 3!==e.docType?(e.request.then(e=>i(e.data),u),!0):(e.request.then(s=>{const o=s.data,l=Q(o);if(a="image",e.size=o.byteLength,"unknown"===l)return e.request=t(e.url,{responseType:a,timeout:r,signal:n}),void e.request.then(e=>i(e.data),u);const h=new Blob([o],{type:l}),d=window.URL.createObjectURL(h);e.request=t(d,{responseType:a,timeout:r,signal:n}),e.request.then(e=>i(new b(e.data,l)),u).finally(()=>window.URL.revokeObjectURL(d))},u),!0)}get test(){}};e([_({readOnly:!0})],j.prototype,"updating",void 0),j=e([g("esri.views.3d.support.StreamDataLoader")],j);const w={numRetries:0};function Q(e){if(e.byteLength<2)return"unknown";const t=new Uint8Array(e,0,e.byteLength);return 137===t[0]&&80===t[1]?"image/png":71===t[0]&&73===t[1]?"image/gif":66===t[0]&&77===t[1]?"image/bmp":255===t[0]&&216===t[1]?"image/jpeg":"unknown"}class v extends k{constructor(e,t,s,r,o){super(r),this.url=e,this.options=t,this.docType=s,this.key=o,this.abortHandle=null,this.result=null,this.status=1,this.request=null,this.abortController=null,this.resolvers=new Array,this.startTime=0,this.numRetries=w.numRetries}destroy(){this.result=null,this.request=null,this.abortController?.abort(),this.abortController=null,this.resolvers.length=0,this.options=null,this.abortHandle=i(this.abortHandle)}}function q(e,t,s){return`${e}:${t}:${s}`}export{j as StreamDataLoader,w as test};
@@ -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{set as t,dist as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{ONES as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as n}from"../../../../geometry/ellipsoidUtils.js";import{lonLatToWebMercatorComparable as i}from"../../../../geometry/projection/projectors.js";import{newDoubleArray as a}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as s}from"../../../../geometry/support/HalfFloatArray.js";import{getZeroIndexArray as l}from"../../../../geometry/support/Indices.js";import{Attribute as c}from"../../webgl-engine/lib/Attribute.js";import{Geometry as p}from"../../webgl-engine/lib/Geometry.js";function f(t,e,r=null){const o=[],n=e.mapPositions,i=m(e,o),a=i.data,u=i.indices.length,s=l(u);return h(e,o,s),y(e,o,s),g(e,o,s),b(e,o,i.indices,s),w(e,o,i.indices,s),D(e,o),F(e,o,i.indices,s),d(e,o,a),new p(t,o,n,2,r)}function m(t,e){const{attributeData:{position:r},removeDuplicateStartEnd:o}=t,n=j(r)&&o,i=r.length/3-(n?1:0),a=new Array(2*(i-1)),u=n?r.slice(0,-3):r;let s=0;for(let c=0;c<i-1;c++)a[s++]=c,a[s++]=c+1;const l=new c(u,a,3,n);return e.push(["position",l]),l}function h(t,e,r){if(null!=t.attributeData.colorFeature)return;const n=t.attributeData.color;e.push(["color",new c(n??o,r,4)])}function g(t,e,r){t.attributeData.normal&&e.push(["normal",new c(t.attributeData.normal,r,3)])}function b(t,e,r,o){const n=t.attributeData.colorFeature;null!=n&&("number"==typeof n?e.push(["colorFeatureAttribute",new c([n],o,1,!0)]):e.push(["colorFeatureAttribute",new c(n,r,1,!0)]))}function y(t,e,r){null==t.attributeData.sizeFeature&&e.push(["size",new c([t.attributeData.size??1],r,1,!0)])}function w(t,e,r,o){const n=t.attributeData.sizeFeature;null!=n&&("number"==typeof n?e.push(["sizeFeatureAttribute",new c([n],o,1,!0)]):e.push(["sizeFeatureAttribute",new c(n,r,1,!0)]))}function D(t,e){const{attributeData:{position:r,timeStamps:o}}=t;if(!o)return;const n=r.length/3,i=new Array(2*(n-1));let a=0;for(let u=0;u<n-1;u++)i[a++]=u,i[a++]=u+1;e.push(["timeStamps",new c(o,i,z,!0)])}function F(t,e,r,o){const n=t.attributeData.opacityFeature;null!=n&&("number"==typeof n?e.push(["opacityFeatureAttribute",new c([n],o,1,!0)]):e.push(["opacityFeatureAttribute",new c(n,r,1,!0)]))}function d(r,o,s){if(null==r.overlayInfo||1!==r.overlayInfo.renderCoordsHelper.viewingMode||!r.overlayInfo.spatialReference.isGeographic)return;const l=a(s.length),p=n(r.overlayInfo.spatialReference);for(let t=0;t<l.length;t+=3)i(s,t,l,t,p);const f=s.length/3,m=u(f+1);let h=A,g=v,b=0,y=0;t(h,l[y++],l[y++]),y++,m[0]=0;for(let n=1;n<f+1;++n)n===f&&(y=0),t(g,l[y++],l[y++]),y++,b+=e(h,g),m[n]=b,[h,g]=[g,h];o.push(["distanceToStart",new c(m,o[0][1].indices,1,!0)])}function j(t){const e=t.length;return t[0]===t[e-3]&&t[1]===t[e-2]&&t[2]===t[e-1]}const A=r(),v=r(),z=4;function S(t,e,r,o,n){if(null==t||0===t.length)return[];const i=[];return t.forEach((t,u)=>{const s=t.length,l=a(3*s);t.forEach((t,e)=>{l[3*e]=t[0],l[3*e+1]=t[1],l[3*e+2]=t[2]});const c={attributeData:{position:l,normal:e,colorFeature:r?.[u],opacityFeature:o?.[u],sizeFeature:n?.[u]},removeDuplicateStartEnd:!1};i.push(c)}),i}function E(t,e,r,o,n,i){if(null==t||0===t.length)return[];const a=S(t,e,o,n,i);return t.forEach((t,e)=>{const o=r?.[e],n=null!=o?x(o.timeStamps,o.streamlineType):void 0;a[e].attributeData.timeStamps=n}),a}function I(t,e=0,r=.01){const o=s(t.length);o[0]=0;for(let i=1;i<t.length;i++){const e=t[i-1],r=t[i],n=Math.sqrt((r[0]-e[0])**2+(r[1]-e[1])**2+(r[2]-e[2])**2);o[i]=o[i-1]+n}const n=o.map(t=>t*r);if(0!==e&&e<n.length){const t=n[e];for(let e=0;e<n.length;e++)n[e]-=t}return n}function x(t,e){const r=s(t.length*z),o=t[0],n=t[t.length-1];for(let i=0;i<t.length;i++)r[i*z]=t[i],r[i*z+1]=o,r[i*z+2]=n,r[i*z+3]=e;return r}export{E as animatedLineStripsToParameters,f as createGeometry,I as getLinearTimeStamps,S as lineStripsToParameters,z as numTimeStampValuesPerVertex,x as timeStampsToAttribute};
5
+ import{set as t,dist as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{ONES as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as n}from"../../../../geometry/ellipsoidUtils.js";import{lonLatToWebMercatorComparable as i}from"../../../../geometry/projection/projectors.js";import{newDoubleArray as a}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as s}from"../../../../geometry/support/HalfFloatArray.js";import{getZeroIndexArray as l}from"../../../../geometry/support/Indices.js";import{Attribute as c}from"../../webgl-engine/lib/Attribute.js";import{Geometry as p}from"../../webgl-engine/lib/Geometry.js";function f(t,e,r=null){const o=[],n=e.mapPositions,i=m(e,o),a=i.data,u=i.indices.length,s=l(u);return h(e,o,s),y(e,o,s),g(e,o,s),b(e,o,i.indices,s),w(e,o,i.indices,s),D(e,o),F(e,o,i.indices,s),d(e,o,a),new p(t,o,n,2,r)}function m(t,e){const{attributeData:{position:r},removeDuplicateStartEnd:o}=t,n=j(r)&&o,i=r.length/3-(n?1:0),a=new Array(2*(i-1)),u=n?r.slice(0,-3):r;let s=0;for(let c=0;c<i-1;c++)a[s++]=c,a[s++]=c+1;const l=new c(u,a,3,n);return e.push(["position",l]),l}function h(t,e,r){if(null!=t.attributeData.colorFeature)return;const n=t.attributeData.color;e.push(["color",new c(n??o,r,4)])}function g(t,e,r){t.attributeData.normal&&e.push(["normal",new c(t.attributeData.normal,r,3)])}function b(t,e,r,o){const n=t.attributeData.colorFeature;null!=n&&("number"==typeof n?e.push(["colorFeatureAttribute",new c([n],o,1,!0)]):e.push(["colorFeatureAttribute",new c(n,r,1,!0)]))}function y(t,e,r){null==t.attributeData.sizeFeature&&e.push(["size",new c([t.attributeData.size??1],r,1,!0)])}function w(t,e,r,o){const n=t.attributeData.sizeFeature;null!=n&&("number"==typeof n?e.push(["sizeFeatureAttribute",new c([n],o,1,!0)]):e.push(["sizeFeatureAttribute",new c(n,r,1,!0)]))}function D(t,e){const{attributeData:{position:r,timeStamps:o}}=t;if(!o)return;const n=r.length/3,i=new Array(2*(n-1));let a=0;for(let u=0;u<n-1;u++)i[a++]=u,i[a++]=u+1;e.push(["timeStamps",new c(o,i,z,!0)])}function F(t,e,r,o){const n=t.attributeData.opacityFeature;null!=n&&("number"==typeof n?e.push(["opacityFeatureAttribute",new c([n],o,1,!0)]):e.push(["opacityFeatureAttribute",new c(n,r,1,!0)]))}function d(r,o,s){if(null==r.overlayInfo||1!==r.overlayInfo.renderCoordsHelper.viewingMode||!r.overlayInfo.spatialReference.isGeographic)return;const l=a(s.length),p=n(r.overlayInfo.spatialReference);for(let t=0;t<l.length;t+=3)i(s,t,l,t,p);const f=s.length/3,m=u(f+1);let h=A,g=v,b=0,y=0;t(h,l[y++],l[y++]),y++,m[0]=0;for(let n=1;n<f+1;++n)n===f&&(y=0),t(g,l[y++],l[y++]),y++,b+=e(h,g),m[n]=b,[h,g]=[g,h];o.push(["distanceToStart",new c(m,o[0][1].indices,1,!0)])}function j(t){const e=t.length;return t[0]===t[e-3]&&t[1]===t[e-2]&&t[2]===t[e-1]}const A=r(),v=r(),z=4;function S(t,e,r,o,n){if(null==t||0===t.length)return[];const i=[];return t.forEach((t,u)=>{const s=t.length,l=a(3*s);t.forEach((t,e)=>{l[3*e]=t[0],l[3*e+1]=t[1],l[3*e+2]=t[2]});const c={attributeData:{position:l,normal:e,colorFeature:r?.[u],opacityFeature:o?.[u],sizeFeature:n?.[u]},removeDuplicateStartEnd:!1};i.push(c)}),i}function E(t,e,r,o,n,i){if(null==t||0===t.length)return[];const a=S(t,e,o,n,i);return t.forEach((t,e)=>{const o=r?.[e],n=null!=o?x(o.timeStamps,o.streamlineType):void 0;a[e].attributeData.timeStamps=n}),a}function I(t,e=0,r=.01){const o=s(t.length);o[0]=0;for(let i=1;i<t.length;i++){const e=t[i-1],r=t[i],n=Math.sqrt((r[0]-e[0])**2+(r[1]-e[1])**2+(r[2]-e[2])**2);o[i]=o[i-1]+n}const n=o.map(t=>t*r);if(0!==e&&e<n.length){const t=n[e];for(let e=0;e<n.length;e++)n[e]-=t}return n}function x(t,e){const r=s(t.length*z),o=t[0],n=t[t.length-1];for(let i=0;i<t.length;i++)r[i*z]=t[i],r[i*z+1]=o,r[i*z+2]=n,r[i*z+3]=e+.5;return r}export{E as animatedLineStripsToParameters,f as createGeometry,I as getLinearTimeStamps,S as lineStripsToParameters,z as numTimeStampValuesPerVertex,x as timeStampsToAttribute};
@@ -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{watch as e,sync as r}from"../../../../core/reactiveUtils.js";import{throttle as s}from"../../../../core/throttle.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{clone as a}from"../../../../geometry/support/aaBoundingRect.js";import{toFlowData as l}from"../../../2d/engine/flow/dataUtils.js";import n from"../../layers/FlowSubView3D.js";import{tilesWaitingTime as d}from"./constants.js";import{tileToKey as u,FlowDataTile as h}from"./loadUtils.js";import{isRasterTile as g}from"../../terrain/TerrainData.js";let c=class extends n{constructor(t){super(t),this._resetTileData=!0,this._throttledTriggerLoad=null,this._throttling=!1}initialize(){this.addHandles([this.surface.on("tile-data-changed",({tile:t,layerIndex:e,layerClass:r})=>{const{renderedTiles:s}=this;null!=s&&e===this._layerIndex&&1===r&&this._updateFlowDataTile(t)}),e(()=>this.renderedTiles,t=>{const e=this.frameTask.scheduleGenerator(e=>this._updateFlowDataTiles(t,e));this.updatingHandles.addPromise(e)},r)]),this._throttledTriggerLoad=s(()=>{super.triggerLoad(),this._throttling=!1},()=>this._throttling=!0,d,this),this.addHandles(this._throttledTriggerLoad)}async*_updateFlowDataTiles(t,e){const r=f();for(const s of t??[]){const t=this._flowDataTiles?.get(u(s)),i=null==t||"delete"===t?this._getFlowDataCopy(s):t;null!=i&&r.set(u(s),i),e.madeProgress(),e.done&&(e=yield)}this._flowDataTiles=r,this._resetTileData=!0,this.triggerLoad()}abort(){super.abort(),this._throttling=!1}get _layerIndex(){return this.surface.getLayerIndexByUID(1,this.layerView.uid)}get readyToLoad(){return super.readyToLoad&&null!=this._flowDataTiles}triggerLoad(){const t=this._numberLoadedTiles===this.renderedTiles?.size,{_throttledTriggerLoad:e}=this;t?(e.hasPendingUpdates()||e(),e.forceUpdate()):e()}async fetchDataAndGenerateStreamlines(t,e){const{_flowDataTiles:r,needsMagnitude:s,workerHandle:i}=this,o=this.getSimulationSettings(t);if(null==o||null==i||null==r)return;const a=this._resetTileData;this._resetTileData=!1;const l=f();r.forEach((t,e)=>{"delete"===t?(l.set(e,"delete"),r.delete(e)):(a||"on-worker"!==t)&&(l.set(e,t),r.set(e,"on-worker"))});const n={simulationSettings:o,flowExtentInfo:t.flowExtentInfo,flowDataTiles:l,pixelSize:this.surface.tilingScheme.pixelSize,reset:a,needsMagnitude:s,startPositions:this.startPositions(t)},{streamlines:d}=await i.generateTiledStreamlines(n,e);return d}getUpdating(){return super.getUpdating()||this._throttling}_getFlowDataCopy(t){const{_layerIndex:e}=this,r=null==t.surface;if(null==e||r)return null;const s=t.getLayerInfo(e,1);if(null==s)return null;if(!t.visible&&null==s.requestAbort)return s.requestAbort=new AbortController,this.surface.requestTileData(t,e,1,s.requestAbort),null;if(s.dataMissing||!t.hasLayerData(e,1))return null;const{data:i}=s;if(!g(i))return null;const o=l(this.layer.serviceRasterInfo.dataType,i.source),n=new Uint8Array(o.width*o.height);for(let a=0;a<n.length;a++)n[a]=o.mask[a];return new h(o.data,n,o.width,o.height,t.lij,a(t.extent))}_updateFlowDataTile(t){const e=this.renderedTiles?.has(t)?this._getFlowDataCopy(t)??"delete":"delete";this._setTileData(t,e)&&this.triggerLoad()}_setTileData(t,e){const{_flowDataTiles:r}=this;if(null==r)return!1;const s=u(t);return(null!=r.get(s)||"delete"!==e)&&(r.set(s,e),!0)}get _numberLoadedTiles(){let t=0;for(const e of this._flowDataTiles?.values()??[])"delete"!==e&&t++;return t}get test(){return{...super.test,loadedTiles:this._flowDataTiles??f()}}};function f(){return new Map}t([i()],c.prototype,"_throttling",void 0),c=t([o("esri.views.3d.support.flow.FlowSubViewTiles3D")],c);export{c as default};
5
+ import{__decorate as e}from"tslib";import{watch as t,sync as s}from"../../../../core/reactiveUtils.js";import{throttle as r}from"../../../../core/throttle.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{clone as a}from"../../../../geometry/support/aaBoundingRect.js";import{toFlowData as o}from"../../../2d/engine/flow/dataUtils.js";import n from"../../layers/FlowSubView3D.js";import{tilesWaitingTime as d}from"./constants.js";import{tileToKey as h,FlowDataTile as u}from"./loadUtils.js";import{isRasterTile as g}from"../../terrain/TerrainData.js";let c=class extends n{constructor(e){super(e),this._resetTileData=!0,this._throttledTriggerLoad=null,this._throttling=!1}initialize(){this.addHandles([this.surface.on("tile-data-changed",({tile:e,layerIndex:t,layerClass:s})=>{null!=this.renderedTiles&&this.loadByTileTreesAllowed&&t===this._layerIndex&&1===s&&this._updateFlowDataTile(e)}),t(()=>this.renderedTiles,e=>{const t=this.frameTask.scheduleGenerator(t=>this._updateFlowDataTiles(e,t));this.updatingHandles.addPromise(t)},s)]),this._throttledTriggerLoad=r(()=>{super.triggerLoad(),this._throttling=!1},()=>this._throttling=!0,d,this),this.addHandles(this._throttledTriggerLoad)}async*_updateFlowDataTiles(e,t){const s=f();for(const r of e??[]){const e=this._flowDataTiles?.get(h(r)),i=null==e||"delete"===e||"waiting"===e?this._getFlowDataCopy(r):e;null!=i&&s.set(h(r),i),t.madeProgress(),t.done&&(t=yield)}this._flowDataTiles=s,this._resetTileData=!0,this.triggerLoad()}abort(){super.abort(),this._throttling=!1}get _layerIndex(){return this.surface.getLayerIndexByUID(1,this.layerView.uid)}get loadByTileTreesAllowed(){return super.loadByTileTreesAllowed||!this._allTilesLoaded}doRefresh(){const{_flowDataTiles:e}=this;null!=e&&(e.forEach((t,s)=>{e.set(s,"waiting")}),super.doRefresh())}triggerLoad(){const{_throttledTriggerLoad:e}=this;this._allTilesLoaded?(e.hasPendingUpdates()||e(),e.forceUpdate()):e()}async fetchDataAndGenerateStreamlines(e,t){const{_flowDataTiles:s,needsMagnitude:r,workerHandle:i}=this,l=this.getSimulationSettings(e);if(null==l||null==i||null==s)return;const a=this._resetTileData;this._resetTileData=!1;const o=f();s.forEach((e,t)=>{"delete"===e?(o.set(t,"delete"),s.delete(t)):(a||"on-worker"!==e&&"waiting"!==e)&&(o.set(t,e),s.set(t,"on-worker"))});const n={simulationSettings:l,flowExtentInfo:e.flowExtentInfo,flowDataTiles:o,pixelSize:this.surface.tilingScheme.pixelSize,reset:a,needsMagnitude:r,startPositions:this.startPositions(e)},{streamlines:d}=await i.generateTiledStreamlines(n,t);return d}getUpdating(){return super.getUpdating()||this._throttling}_getFlowDataCopy(e){const{_layerIndex:t}=this,s=null==e.surface;if(null==t||s)return null;const r=e.getLayerInfo(t,1);if(null==r)return null;if(!e.visible&&null==r.requestAbort)return r.requestAbort=new AbortController,this.surface.requestTileData(e,t,1,r.requestAbort),null;if(r.dataMissing||!e.hasLayerData(t,1))return null;const{data:i}=r;if(!g(i))return null;const l=o(this.layer.serviceRasterInfo.dataType,i.source),n=new Uint8Array(l.width*l.height);for(let a=0;a<n.length;a++)n[a]=l.mask[a];return new u(l.data,n,l.width,l.height,e.lij,a(e.extent))}_updateFlowDataTile(e){const t=this.renderedTiles?.has(e)?this._getFlowDataCopy(e)??"delete":"delete";this._setTileData(e,t)&&this.triggerLoad()}_setTileData(e,t){const{_flowDataTiles:s}=this;if(null==s)return!1;const r=h(e);return(null!=s.get(r)||"delete"!==t)&&(s.set(r,t),!0)}get _allTilesLoaded(){let e=0;for(const t of this._flowDataTiles?.values()??[])"delete"!==t&&"waiting"!==t&&e++;return e===this.renderedTiles?.size}get test(){return{...super.test,loadedTiles:this._flowDataTiles??f()}}};function f(){return new Map}e([i()],c.prototype,"_throttling",void 0),c=e([l("esri.views.3d.support.flow.FlowSubViewTiles3D")],c);export{c as default};