@arcgis/core 5.2.0-next.81 → 5.2.0-next.83

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 (269) hide show
  1. package/assets/components/assets/icon/deleteAndReplaceFeatures16.json +1 -0
  2. package/assets/components/assets/icon/deleteAndReplaceFeatures24.json +1 -0
  3. package/assets/components/assets/icon/deleteAndReplaceFeatures32.json +1 -0
  4. package/assets/components/assets/icon/moveAndRotate16.json +1 -0
  5. package/assets/components/assets/icon/moveAndRotate24.json +1 -0
  6. package/assets/components/assets/icon/moveAndRotate32.json +1 -0
  7. package/assets/esri/core/workers/RemoteClient.js +1 -1
  8. package/assets/esri/core/workers/chunks/{88d6a7ebded4d359deb0.js → 027af54888befb209aaa.js} +1 -1
  9. package/assets/esri/core/workers/chunks/028bee58f7bc19e5e39e.js +1 -0
  10. package/assets/esri/core/workers/chunks/{9bd4cda90daf90189bfc.js → 03895d49fbd34ccb3ead.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{694216224d5fd3a8956d.js → 04f5ff688785a4bd3b03.js} +1 -1
  12. package/assets/esri/core/workers/chunks/0775d1e3034d5e7ef7bc.js +1 -0
  13. package/assets/esri/core/workers/chunks/{3adba34224cba869a39c.js → 10ac92dcd3738ec23dfb.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{4a537054c99cbc492715.js → 11d911f70bf0ca252c19.js} +1 -1
  15. package/assets/esri/core/workers/chunks/1354b8442c2c501238f1.js +1 -0
  16. package/assets/esri/core/workers/chunks/{95ff342e5c29bf91a765.js → 13a43c87d7952facbed4.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{8cfe817299eb16cb2664.js → 1438f571f738e83b4d1c.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{bfd532e33800755b1f48.js → 14511c92cbbc26d80c86.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{e59101f1d060d0a30a65.js → 14def8f47ae7265dd71b.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{fbb0b2f4ec0ba458ddeb.js → 19dac19122eeeb5e36b2.js} +1 -1
  21. package/assets/esri/core/workers/chunks/1b00789511c9b27da4a7.js +1 -0
  22. package/assets/esri/core/workers/chunks/1b277311a4beb4243bf8.js +2 -0
  23. package/assets/esri/core/workers/chunks/1d03db4df18524cf391c.js +1 -0
  24. package/assets/esri/core/workers/chunks/{f71a3fe5f30aa782193a.js → 20db27d9828397d0b37a.js} +1 -1
  25. package/assets/esri/core/workers/chunks/24bfe759c8848143361e.js +1 -0
  26. package/assets/esri/core/workers/chunks/{b3081c0b037abc49d09b.js → 26c12804a0d801df29bf.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{8006ffa263fb8016afdb.js → 26c8ed0aef59ed6d5267.js} +1 -1
  28. package/assets/esri/core/workers/chunks/2d1c0d80a9843567df8d.js +1 -0
  29. package/assets/esri/core/workers/chunks/{2b79b376b0d60d2f0d5c.js → 2d6e1bf7c1981bed4357.js} +1 -1
  30. package/assets/esri/core/workers/chunks/30dade7bf6032be32599.js +2 -0
  31. package/assets/esri/core/workers/chunks/{7028671ffdaafe2725bc.js → 33aaa5a49e396a0aca47.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{dcec7fc66385c12ecdf0.js → 33dc93d82407052fafe1.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{578904043e873424904c.js → 3a6990058f1003bd2812.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{0fd7590e545864f5fff4.js → 3ca0d503ce733088a6c2.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{bfac0f47e81055585002.js → 3f0625c31dd46b563160.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{9a5894e8ebdf0e97b98f.js → 43122c435497228a7583.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{8fff4a41a54d39db470a.js → 44d13f65465646e5f6e9.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{9c17bfbfc347ac289b6e.js → 463b7952a4825541eb13.js} +1 -1
  39. package/assets/esri/core/workers/chunks/46b3d6814ba4c0a71111.js +1 -0
  40. package/assets/esri/core/workers/chunks/49784f8e8e5fac0cc5a9.js +1 -0
  41. package/assets/esri/core/workers/chunks/{1ed6a8bb415999c4e8a6.js → 4cf2c33494cb75942511.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{d8b38c196b06e801c4e6.js → 5156d94f01b4fbbf8cde.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{6c372d85b5783dd2a793.js → 52042fd36f4a572938f0.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{e8a9a686a3c23afc9d1f.js → 5568448e7f51508ffdf5.js} +1 -1
  45. package/assets/esri/core/workers/chunks/58e4aecabca047f1d229.js +1 -0
  46. package/assets/esri/core/workers/chunks/598221c7054415b84904.js +1 -0
  47. package/assets/esri/core/workers/chunks/{89df303abcbc0167e4d2.js → 5a006ff759fad9fc25cb.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{218ddad849745d652a28.js → 5a3c1fe24814a345ab39.js} +1 -1
  49. package/assets/esri/core/workers/chunks/5b292831127bf981c1c5.js +1 -0
  50. package/assets/esri/core/workers/chunks/{40ebe69b08ea54e0e780.js → 5b60fc95757b2a53558a.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{c336f300fe6100e36592.js → 5c634b3e6dc76299b1df.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{5a67bd724aa7fcdebe16.js → 5d30accf1dcda0c70f95.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{dbca32f0e0c2c2e2ccf3.js → 5f13ade03500b39c1720.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{8d16d53643dd8d489c25.js → 605da92d28e067f4a4c6.js} +1 -1
  55. package/assets/esri/core/workers/chunks/6154f4d39f9e53fe56cc.js +1 -0
  56. package/assets/esri/core/workers/chunks/62b116307483d5f0e37d.js +2 -0
  57. package/assets/esri/core/workers/chunks/6433a623af765b7e53ab.js +1 -0
  58. package/assets/esri/core/workers/chunks/{5c9a398e659ecd427fb5.js → 657528eb6a3d3b3cb631.js} +1 -1
  59. package/assets/esri/core/workers/chunks/65eff0ae773505495f21.js +1 -0
  60. package/assets/esri/core/workers/chunks/{d845f2115848b56c0369.js → 66292e98b4111ea3658d.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{f57e5e7d0748d9a370f7.js → 680496660b2aaa710099.js} +1 -1
  62. package/assets/esri/core/workers/chunks/6d11b922898a8039dbe7.js +1 -0
  63. package/assets/esri/core/workers/chunks/{fbcc346fa603d6edac98.js → 6db4a4f9a9ce7cc738d0.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{a9e944f28bd573c8230d.js → 6eb28086dc28f6d144ec.js} +1 -1
  65. package/assets/esri/core/workers/chunks/7188559a685e0ba30c4f.js +1 -0
  66. package/assets/esri/core/workers/chunks/{a3cbd3e983e21f40b253.js → 724b2631c9ced80a1661.js} +1 -1
  67. package/assets/esri/core/workers/chunks/7493ce5d02224c07a6d5.js +1 -0
  68. package/assets/esri/core/workers/chunks/7ad70c8a56f2481adc82.js +1 -0
  69. package/assets/esri/core/workers/chunks/7bd8ebb321ecf1f06496.js +1 -0
  70. package/assets/esri/core/workers/chunks/7ca188f824956a5cac35.js +2 -0
  71. package/assets/esri/core/workers/chunks/{d0aaa4ad7f76f577f117.js → 7d5877eede2f552dea9f.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{bf5831a7c12b1e42c669.js → 83a77d3f45c8c21cec45.js} +1 -1
  73. package/assets/esri/core/workers/chunks/852649460d664b0a1a1d.js +1 -0
  74. package/assets/esri/core/workers/chunks/{d62a5a33a24418a3e283.js → 88771a75adcbd54c4fac.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{37fb38db03cb39e3c342.js → 8c6a60d96c73982febd2.js} +1 -1
  76. package/assets/esri/core/workers/chunks/{e63f94c8097555b266ad.js → 8e1b913067b8e88ff365.js} +2 -2
  77. package/assets/esri/core/workers/chunks/{6065caa7981cef255277.js → 911f3a1b8dd4bc5c9782.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{70c371c9f133ab9f7925.js → 918577ea025f67ebe372.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{e3eab61815ef1c521a6c.js → 9568932bafe689c38f63.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{e72fa08b0bd324514a0e.js → 996ac351e2322298a17d.js} +1 -1
  81. package/assets/esri/core/workers/chunks/99966339b061eb9945b8.js +1 -0
  82. package/assets/esri/core/workers/chunks/{d1baf17f3219f70106f7.js → 9be05d32528b395a7d34.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{552d6aecc7d88d16227b.js → 9d41c02601d0bb75b525.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{64a1ffc221e5b63b43fb.js → a4bb0951e1389e7b803c.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{74cd17aca5f7e0caac90.js → a9a1061cdf82b372835f.js} +1 -1
  86. package/assets/esri/core/workers/chunks/{d2448e26e19005ef9ab2.js → aabffe53508730e504ec.js} +1 -1
  87. package/assets/esri/core/workers/chunks/{82da6d98bd4980a3d454.js → af88f8dd1a53e4740aa6.js} +1 -1
  88. package/assets/esri/core/workers/chunks/b61c30cdf698b4d1573a.js +1 -0
  89. package/assets/esri/core/workers/chunks/{61190c833791f0833a39.js → b7bcc2d0b0fa8e703c83.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{37a121316d114999ac70.js → ba67aaa08e4f11e1140a.js} +1 -1
  91. package/assets/esri/core/workers/chunks/bbb97c38d8670329d07e.js +2 -0
  92. package/assets/esri/core/workers/chunks/{5d50a030bf9f4e94f69d.js → bbeb61d9302323bae9fb.js} +1 -1
  93. package/assets/esri/core/workers/chunks/bd8b483e70acf0fc601e.js +1 -0
  94. package/assets/esri/core/workers/chunks/bef32acf368b4d5aba37.js +1 -0
  95. package/assets/esri/core/workers/chunks/c1f125594e684c1b4ffc.js +1 -0
  96. package/assets/esri/core/workers/chunks/c90dfdf2302b7db1f6f7.js +1 -0
  97. package/assets/esri/core/workers/chunks/{09f0805b32e6cab980e6.js → cc1a00694cc9f7c606d6.js} +1 -1
  98. package/assets/esri/core/workers/chunks/{8a36b999cbd65dd2f16c.js → d8c3bdc3c6be8ba7c5e6.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{bc30c0de6dcb106b24a1.js → da233362b06b6db375f1.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{ce81f29134ab3971bd54.js → dd91824692bec809909c.js} +1 -1
  101. package/assets/esri/core/workers/chunks/{f9e9e79f78be32e5d475.js → e706c37b44e98fbcb5f7.js} +1 -1
  102. package/assets/esri/core/workers/chunks/ef269dd559c1c79957e5.js +1 -0
  103. package/assets/esri/core/workers/chunks/{4a6158994a8cc8b8664f.js → f0692e10af5983f6ad93.js} +1 -1
  104. package/assets/esri/core/workers/chunks/{40b842d055b87e442156.js → f20b88f5a6d3b988a055.js} +1 -1
  105. package/assets/esri/core/workers/chunks/{fae32c9ce811934b6a64.js → f6ae0c483579e227a2f2.js} +1 -1
  106. package/assets/esri/core/workers/chunks/{4c15551e33a3c6cda61d.js → f762f0f6c83748d8e328.js} +1 -1
  107. package/assets/esri/core/workers/chunks/{4eaa93859ceec1b38530.js → fa29b5064d6626cfc019.js} +1 -1
  108. package/assets/esri/core/workers/chunks/fcf7299e2ee904ab9882.js +1 -0
  109. package/assets/esri/core/workers/chunks/{388b71211a0ad5cbd6b9.js → fe06cc2f90b2d551e4c1.js} +1 -1
  110. package/assets/esri/core/workers/chunks/{86035e46777ed896c658.js → ffad5fd9c5e98f4fe2c3.js} +1 -1
  111. package/assets/esri/geometry/support/pe-wasm.wasm +0 -0
  112. package/chunks/Bufferer-CclWhXVb.js +1 -1
  113. package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
  114. package/chunks/EmissionComposite.glsl.js +7 -1
  115. package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
  116. package/chunks/GeodeticUtils.js +1 -1
  117. package/chunks/GeographicTransformation.js +2 -0
  118. package/chunks/Geometry.js +1 -1
  119. package/chunks/MultiPathImpl.js +1 -1
  120. package/chunks/OperatorCrosses.js +1 -1
  121. package/chunks/OperatorCut.js +1 -1
  122. package/chunks/OperatorGeodesicBuffer.js +1 -1
  123. package/chunks/OperatorGeodeticArea.js +1 -1
  124. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  125. package/chunks/OperatorGeodeticLength.js +1 -1
  126. package/chunks/OperatorGraphicBuffer.js +1 -1
  127. package/chunks/OperatorIntegrate.js +1 -1
  128. package/chunks/OperatorIntersects.js +1 -1
  129. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  130. package/chunks/OperatorOverlaps.js +1 -1
  131. package/chunks/OperatorProximity.js +1 -1
  132. package/chunks/OperatorProximityGeodesic.js +1 -1
  133. package/chunks/OperatorShapePreservingLength.js +1 -1
  134. package/chunks/OperatorShapePreservingProject.js +1 -1
  135. package/chunks/OperatorSimplifyOGC.js +1 -1
  136. package/chunks/OperatorTouches.js +1 -1
  137. package/chunks/OperatorWithin.js +1 -1
  138. package/chunks/Point2D.js +1 -1
  139. package/chunks/ProjectionTransformation.js +1 -1
  140. package/chunks/SideCalculator2D-DX0718xq.js +1 -1
  141. package/chunks/UnitFactory.js +1 -1
  142. package/chunks/containsOperator.js +1 -1
  143. package/chunks/disjointOperator.js +1 -1
  144. package/chunks/equalsOperator.js +1 -1
  145. package/chunks/pe-wasm.js +1 -1
  146. package/chunks/relateOperator.js +1 -1
  147. package/config.js +1 -1
  148. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  149. package/geometry/operators/gx/operatorBuffer.js +1 -1
  150. package/geometry/operators/gx/operatorDifference.js +1 -1
  151. package/geometry/operators/gx/operatorIntersection.js +1 -1
  152. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  153. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  154. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  155. package/geometry/operators/gx/operatorSimplify.js +1 -1
  156. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  157. package/geometry/operators/gx/operatorUnion.js +1 -1
  158. package/geometry/operators/json/containsOperator.js +1 -1
  159. package/geometry/operators/json/disjointOperator.js +1 -1
  160. package/geometry/operators/reshapeOperator.js +1 -1
  161. package/geometry/operators/support/GeographicTransformation.d.ts +7 -0
  162. package/geometry/operators/support/GeographicTransformation.js +1 -1
  163. package/geometry/operators/support/GeographicTransformationStep.d.ts +7 -1
  164. package/geometry/operators/support/GeographicTransformationStep.js +1 -1
  165. package/geometry/operators/support/geographicTransformationUtils.d.ts +13 -2
  166. package/geometry/operators/support/geographicTransformationUtils.js +1 -1
  167. package/geometry/operators/support/jsonConverter.js +1 -1
  168. package/geometry/operators/support/projectionTransformation.js +1 -1
  169. package/geometry/support/spatialReferenceUtils.js +1 -1
  170. package/kernel.js +1 -1
  171. package/layers/raster/types.d.ts +1 -1
  172. package/layers/support/AggregateField.d.ts +9 -3
  173. package/layers/support/FeatureReductionCluster.d.ts +16 -6
  174. package/layers/support/I3SExtractChanges.js +2 -0
  175. package/package.json +4 -4
  176. package/renderers/UniqueValueRenderer.js +1 -1
  177. package/renderers/support/AuthoringInfo.d.ts +8 -3
  178. package/support/revision.js +1 -1
  179. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
  180. package/views/2d/engine/vectorTiles/style/GeoJSONLabelUtils.js +2 -0
  181. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  182. package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
  183. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
  184. package/views/2d/layers/MediaLayerView2D.js +1 -1
  185. package/views/3d/GroundView3D.js +1 -1
  186. package/views/3d/analysis/LineOfSight/LineOfSightAuthoringUtils.js +1 -1
  187. package/views/3d/analysis/LineOfSight/LineOfSightDrawToolRenderer.js +1 -1
  188. package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
  189. package/views/3d/analysis/LineOfSight/LineOfSightInteractionVisuals.js +1 -1
  190. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
  191. package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
  192. package/views/3d/analysis/LineOfSight/LineOfSightPlacementLeafPlugin.js +1 -1
  193. package/views/3d/analysis/LineOfSight/LineOfSightRootPlugin.js +1 -1
  194. package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
  195. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  196. package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
  197. package/views/3d/input/SceneInputManager.js +1 -1
  198. package/views/3d/input/handlers/PinchAndPanNavigation.js +1 -1
  199. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  200. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  201. package/views/3d/layers/I3SMeshView3D.js +1 -1
  202. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  203. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  204. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  205. package/views/3d/layers/SceneLayerView3D.js +1 -1
  206. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  207. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  208. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  209. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  210. package/views/3d/state/utils/navigationUtils.js +1 -1
  211. package/views/3d/support/GroundAndIMSurface.js +2 -0
  212. package/views/3d/support/PBFDecoder.js +1 -1
  213. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  214. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  215. package/views/3d/support/pointsOfInterest/PointOfInterest.js +1 -1
  216. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  217. package/views/3d/terrain/OverlayManager.js +1 -1
  218. package/views/3d/webgl-engine/Stage.js +1 -1
  219. package/views/3d/webgl-engine/lib/EmissionComposite.glsl.js +1 -1
  220. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  221. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  222. package/views/MapView.d.ts +0 -60
  223. package/views/SceneView.js +1 -1
  224. package/views/View2D.d.ts +59 -1
  225. package/views/draw/support/PluginContext.js +1 -1
  226. package/views/draw/support/managers/InteractiveHandleManager.js +1 -1
  227. package/views/draw/support/types.d.ts +6 -0
  228. package/views/interactive/interactiveToolUtils.js +1 -1
  229. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  230. package/widgets/Legend/support/utils.js +1 -1
  231. package/widgets/Widget.js +1 -1
  232. package/widgets/support/jsxWidgetSupport.js +1 -1
  233. package/assets/esri/core/workers/chunks/0dcfd82a2669df6eb5a0.js +0 -1
  234. package/assets/esri/core/workers/chunks/177c3b23c1cbd4737049.js +0 -1
  235. package/assets/esri/core/workers/chunks/21f763694a41968ac21a.js +0 -1
  236. package/assets/esri/core/workers/chunks/230925079cee040a8d77.js +0 -1
  237. package/assets/esri/core/workers/chunks/25696c194457e42b3bdc.js +0 -1
  238. package/assets/esri/core/workers/chunks/2f3525df00fb265661fc.js +0 -1
  239. package/assets/esri/core/workers/chunks/453c69879f4b82ba13a1.js +0 -1
  240. package/assets/esri/core/workers/chunks/4f36596280142be1c666.js +0 -1
  241. package/assets/esri/core/workers/chunks/53d80202b5f43542d45b.js +0 -1
  242. package/assets/esri/core/workers/chunks/540a3685e614bb006744.js +0 -1
  243. package/assets/esri/core/workers/chunks/61312d3b5477ed9d87d9.js +0 -2
  244. package/assets/esri/core/workers/chunks/6f08c8a1e8e3ffd0a96a.js +0 -1
  245. package/assets/esri/core/workers/chunks/71ee7c51d2c60a180f1e.js +0 -1
  246. package/assets/esri/core/workers/chunks/856dba96332509fb1d7a.js +0 -2
  247. package/assets/esri/core/workers/chunks/9234a293d61e134f121f.js +0 -1
  248. package/assets/esri/core/workers/chunks/927582ec15bff2acbb49.js +0 -1
  249. package/assets/esri/core/workers/chunks/95b9eaf7a49eeb17e62f.js +0 -1
  250. package/assets/esri/core/workers/chunks/973440553c9e058b0132.js +0 -1
  251. package/assets/esri/core/workers/chunks/98739b6e7904045edbab.js +0 -1
  252. package/assets/esri/core/workers/chunks/a69c10bfd632a5546b34.js +0 -1
  253. package/assets/esri/core/workers/chunks/c5853fbb975e169c44c5.js +0 -1
  254. package/assets/esri/core/workers/chunks/c899457f19b749516275.js +0 -1
  255. package/assets/esri/core/workers/chunks/d4b78d11a5ce4320a29a.js +0 -1
  256. package/assets/esri/core/workers/chunks/da0ef984509057ec8507.js +0 -1
  257. package/assets/esri/core/workers/chunks/e2473de49189d93714d3.js +0 -1
  258. package/assets/esri/core/workers/chunks/eca0736953a20cfc64ad.js +0 -2
  259. package/assets/esri/core/workers/chunks/efd176c5ac35f313e7a2.js +0 -1
  260. package/assets/esri/core/workers/chunks/f2d99f693a590f384315.js +0 -1
  261. package/assets/esri/core/workers/chunks/fc2234e0d202631f3abf.js +0 -2
  262. package/assets/esri/core/workers/chunks/fcb943c3b31b1bf62e65.js +0 -2
  263. package/assets/esri/core/workers/chunks/ffe2cbfea38b92a231d6.js +0 -1
  264. /package/assets/esri/core/workers/chunks/{eca0736953a20cfc64ad.js.LICENSE.txt → 1b277311a4beb4243bf8.js.LICENSE.txt} +0 -0
  265. /package/assets/esri/core/workers/chunks/{856dba96332509fb1d7a.js.LICENSE.txt → 30dade7bf6032be32599.js.LICENSE.txt} +0 -0
  266. /package/assets/esri/core/workers/chunks/{fc2234e0d202631f3abf.js.LICENSE.txt → 62b116307483d5f0e37d.js.LICENSE.txt} +0 -0
  267. /package/assets/esri/core/workers/chunks/{61312d3b5477ed9d87d9.js.LICENSE.txt → 7ca188f824956a5cac35.js.LICENSE.txt} +0 -0
  268. /package/assets/esri/core/workers/chunks/{e63f94c8097555b266ad.js.LICENSE.txt → 8e1b913067b8e88ff365.js.LICENSE.txt} +0 -0
  269. /package/assets/esri/core/workers/chunks/{fcb943c3b31b1bf62e65.js.LICENSE.txt → bbb97c38d8670329d07e.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as r,asinClamped as o}from"../../../../core/mathUtils.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{fromRotation as a,exactEquals as s,rotate as c,multiply as u}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as l,create as m}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{exactEquals as h,length as M,dot as g,subtract as y,normalize as d,squaredDistance as b,copy as x,transformMat4 as j,add as v,distance as w,cross as P,scale as z,lerp as I,crossAndNormalize as S,scaleAndAdd as T,set as R}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as q}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as A,axis as F,fromPoints as H,wrapAxisAngle as U}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as E,vectorCoordinates as G}from"../../../../geometry/support/coordinateSystem.js";import{create as k,fromNormalAndOffset as C,intersectRay as O,fromPositionAndNormal as W,distance as B,projectPoint as D,projectVector as J}from"../../../../geometry/support/plane.js";import{create as K}from"../../../../geometry/support/ray.js";import{Sphere as L}from"../../../../geometry/support/sphere.js";import{sm4d as N,sv3d as Q}from"../../../../geometry/support/vectorStacks.js";import{fromScreenAtEye as V,fromScreen as X}from"../../support/geometryUtils/ray.js";import{intersectScreen as Y}from"../../support/geometryUtils/sphere.js";import Z from"../../webgl/RenderCamera.js";import{terrainId as $}from"../../webgl-engine/lib/verticalOffsetUtils.js";const _=30,tt=[1,3e8],et=8,nt=[200,1508e5],rt=5,ot=50,it=5,at=10,st=80,ct=90,ut=1e-6,lt={exclude:new Set([$])};function mt(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function ft(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function pt(t,e,n){const r=a(N.get(),n[3],F(n));null==r||s(r,l)||(y(Ee,t.eye,e),j(Ee,Ee,r),t.eye=v(Ee,Ee,e),y(Ee,t.center,e),j(Ee,Ee,r),t.center=v(Ee,Ee,e),t.up=j(Ee,t.up,r))}function ht(t,e,n,r){return O(t,X(e,n,Be),r)}function Mt(t,e,n,r){return O(t,V(e,n,Be),r)}function gt(t,e,n,r){const o=Q.get();let i=1-n;y(o,e,t.eye);const a=M(o);let s=a*(1-i);i>=0&&s<r&&(s=r,i=-(s-a)/a),Math.abs(a-s)<ut||(z(o,o,i),t.eye=v(Ee,t.eye,o),t.center=I(Ee,t.center,e,i))}function yt(t,e,n){e.getScreenCenter(dt),Y(t,e,dt,Ee)&&(e.center=Ee);const r=e.distance,o=r*n;if(Math.abs(r-o)<ut)return;const i=z(Q.get(),e.viewForward,o);e.eye=y(Ee,e.center,i)}const dt=i();function bt(t,e){R(e,0,0,0);for(const n of t)v(e,e,n);z(e,e,1/t.length)}function xt(t,e,n,r){return Math.sin(t/M(e))*(n+r.radius)}function jt(t,e,n,r){return xt(Math.PI/2,e,n,r)+(t-Math.PI/2)}const vt={Elevation:3e4,Angle:e(16)},wt=e(80);function Pt(t,e,n,r,o,i){const a=q(),s=new L;let c=!0,u=!0;const{eye:l}=e;return t.intersectScreen(n,a,i)&&!h(l,a)&&xe(l,a,r)?s.radius=M(a):(u=!1,e.aboveGround&&0!==o?s.radius=Math.max(M(e.center),.9*r):s.radius=M(e.eye)-e.relativeElevation,1===o?Tt(s,e,n,a):c=Y(s,e,n,a)),{sphere:s,scenePickPoint:c?a:null,hasGeometryIntersection:u}}function zt(t,e,n,r){const o=t.relativeElevation;if(o>vt.Elevation&&"global"===r)return 1;V(t,e,De);const i=Math.sign(o),a=n.worldUpAtPosition(t.eye,Ee);return-i*g(a,De.direction)<Math.sin(vt.Angle)*M(De.direction)?0:1}function It(t,e,n){y(St,n,e),t.eye=y(Ee,t.eye,St),t.center=y(Ee,t.center,St)}const St=q();function Tt(t,e,n,r){const o=V(e,n,Be);return null!=o&&(t.closestPointOnSilhouette(o,Rt),t.intersectRay(o,r)?!(b(Rt,o.origin)<b(r,o.origin))||(x(r,Rt),!1):(y(qt,e.eye,e.center),d(qt,qt),C(qt,-g(d(qt,qt),Rt),At),O(At,o,r),!1))}const Rt=q(),qt=q(),At=k(),Ft=q(),Ht=q(),Ut=i();function Et(t,e){return J(e,t.viewForward,Ft),v(Ht,t.eye,Ft),t.projectToScreen(Ht,Ut),Ut[1]}const Gt=q(),kt=k(),Ct=q(),Ot=q(),Wt=q(),Bt=q(),Dt=q(),Jt=q(),Kt=q(),Lt=q(),Nt=q(),Qt=q(),Vt=i(),Xt=K();function Yt(t,e,n){const r=t.eye;if(w(e.center,r)<e.radius)return d(Dt,r),P(Jt,Dt,t.viewRight),v(Ht,r,Jt),t.projectToScreen(Ht,Vt),Vt[1];const o=t.up;V(t,n,Xt);const i=e.radius;if(S(Gt,o,Xt.direction),W(r,Gt,kt),B(kt,e.center)>i)return null;D(kt,e.center,Ct);const a=w(e.center,Ct),s=Math.sqrt(i**2-a**2);y(Ot,r,Ct),d(Wt,Ot),S(Bt,Gt,Wt);const c=g(Ot,Wt),u=g(Ot,Bt),l=Math.sqrt(c**2+u**2),m=s**2/l**2,f=s/l**2*Math.sqrt(l**2-s**2),p=m*c,h=f*-u,M=m*u,b=f*c,x=p-h,j=M+b,I=M-b;v(Kt,Ct,T(Kt,z(Kt,Wt,p+h),Bt,j)),v(Lt,Ct,T(Lt,z(Lt,Wt,x),Bt,I)),y(Nt,Kt,r),d(Nt,Nt),y(Qt,Lt,r),d(Qt,Qt);return g(t.viewForward,Nt)>=g(t.viewForward,Qt)?t.projectToScreen(Kt,Vt):t.projectToScreen(Lt,Vt),Vt[1]}function Zt(t,e,n){return e?t>n:t<n}const $t=.05,_t=12;function te(t,e){const n=t.fullHeight/t.pixelRatio,r=Math.max(e,n-e);return Math.max(_t,$t*r)}function ee(t,e){const n=t.fullHeight/t.pixelRatio;return Math.min(n,e+te(t,e))}function ne(t,e){return Math.max(0,e-te(t,e))}function re(i,a,s,c,u,l){let m=0;if(P(Ce,i,a),y(Ge,i,a),M(i)<=u||!c.aboveGround){P(s,Ge,c.eye);const f=g(i,a)/(M(i)*M(a));if(f<.9999)m=r(f);else{const t=M(P(q(),i,a))/(M(i)*M(a));m=o(t)}const p=Math.cos(n(t.normalize(e(l)),0,wt));m=-m-Math.max(0,M(a)-u)/(p*u)}else y(oe,c.eye,c.center),P(s,Ge,oe),m=-M(Ge)/u;return d(s,s),z(s,s,M(Ce)),m}const oe=q();function ie(o,i,a,s){let c,u;const l=Math.cos(n(t.normalize(e(s)),0,wt));return c=i>a?-(i-a)/(l*a):i<-a?Math.PI-(i+a)/(l*a):r(i/a),u=o>a?-(o-a)/(l*a):o<-a?Math.PI-(o+a)/(l*a):r(o/a),(u-c)*a}function ae(t,e,n,r,o,i,a,s,c,u){const l=ie(t[2],e[2],i.radius,s),m=c?ie(t[0],e[0],i.radius,180):e[0]-t[0],p=Math.sin(a)*m-Math.cos(a)*l,h=Math.cos(a)*m+Math.sin(a)*l;d(Ee,o);const M=c?p/Math.sqrt(Math.abs(i.radius**2-g(n,Ee)**2)):p/i.radius,y=h/Math.sqrt(Math.abs(i.radius**2-g(n,r)**2));f(u,M,y)}function se(t,e,n,r,o,i,a,s,c,u){P(Ce,t,e),E(i.up,i.eye,Pe,ze,Ie),E([0,0,1],i.eye,je,ve,we),x(n,ve),x(r,je),d(n,n),z(n,n,M(Ce)),G(t,d(ze,ze),d(Ie,Ie),d(Pe,Pe),Se),G(e,ze,Ie,Pe,Te),ae(Se,Te,t,je,ve,a,s,c,u,o)}function ce(t,e,n,r,o,i,s){a(Ae,o,r),a(Fe,s,i),u(He,Ae,Fe),y(e,t,n),j(e,e,He),v(e,e,n)}function ue(t,e,n,r,o,i){a(Ae,r,n),a(Fe,i,o),u(He,Ae,Fe),y(Ee,t.eye,e),j(Ee,Ee,He),t.eye=v(Ee,Ee,e),y(Ee,t.center,e),j(Ee,Ee,He),t.center=v(Ee,Ee,e),y(Ee,t.up,e),j(Ee,Ee,He),t.up=v(Ee,Ee,e)}const le={Pole:.95,Angle:e(18),Tilt:45,TiltHysteresisMargin:1e-7};let me=!1;function fe(t,e,n,r,o,i){const a=Math.abs(r)>Math.PI-le.Angle||Math.abs(r)<le.Angle,s=(Math.abs(t[2])<n*le.Pole||Math.abs(e)>n)&&i;return a&&s?!me&&o<le.Tilt-le.TiltHysteresisMargin?me=!0:me&&o>le.Tilt+le.TiltHysteresisMargin&&(me=!1):me=!1,me}function pe(t,e,n,r,o,i){if(i)H(n,r,qe),pt(e,t.center,qe);else{const i=re(n,r,Oe,e,t.radius,o);pt(e,t.center,U(Oe,i))}}function he(t,e,n,r,o,i,a){const s=a?20:1,c=1e-12;let u,l;x(Ue,r),ke.copyFrom(e);for(let m=0;m<s&&b(n,Ue)>c&&(u=b(n,Ue),se(n,Ue,ve,je,Re,ke,t,o,i,a),ue(ke,t.center,je,Re[1],ve,Re[0]),ce(Ue,Ue,t.center,je,Re[1],ve,Re[0]),l=b(n,Ue),l<u||0===m);m++)e.copyFrom(ke)}function Me(n,r,o,i,a,s,c){fe(o,g(r.up,o),n.radius,-t.normalize(e(a)),s,r.aboveGround)?he(n,r,o,i,-t.normalize(e(a)),s,c):pe(n,r,o,i,s,c)}function ge(t,e,n,r,o,i){const{eye:a}=t;E([0,0,1],a,je,ve,we);const s=e.translation[0]*n.pan,u="zoom"===o.mode?0:e.translation[1]*n.pan,l=Math.max(Math.sqrt(Math.abs(1-g(t.center,je)**2/M(t.center)**2)),.5),m=(Math.sin(i)*u+Math.cos(i)*s)/l,f=-Math.cos(i)*u+Math.sin(i)*s;switch(c(r.pan.matrix,r.pan.matrix,m,je),r.pan.enabled=!0,o.mode){case"pan":c(r.pan.matrix,r.pan.matrix,f,ve),r.pan.enabled=!0;break;case"zoom":r.zoom=-e.translation[1]*n.zoom}}function ye(t,e,n,r,o){const{eye:i,viewRight:a}=t,s=P(Q.get(),a,i),u=e.translation[0]*n.pan;switch(0!==u&&(c(r.pan.matrix,r.pan.matrix,-u,s),r.pan.enabled=!0),o.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(c(r.pan.matrix,r.pan.matrix,t,a),r.pan.enabled=!0);break}case"zoom":r.zoom=-e.translation[1]*n.zoom}}function de(n,r,o,i,a,s,c,u,l){fe(n.center,g(n.up,n.center),M(n.center),-t.normalize(e(s)),c,r.aboveGround)?ge(r,o,i,u,l,-t.normalize(e(a))):ye(r,o,i,u,l)}function be(t,e,n=1/0){const r=Math.abs(g(t,e));return Math.min(n,1/r)}function xe(t,e,n){const r=w(t,e),o=M(t);return r<Math.max(o,n)}const je=q(),ve=q(),we=q(),Pe=q(),ze=q(),Ie=q(),Se=q(),Te=q(),Re=p(),qe=A(),Ae=m(),Fe=m(),He=m(),Ue=q(),Ee=q(),Ge=q();let ke=new Z;const Ce=q(),Oe=q();function We(){ke=new Z}const Be={origin:q(),direction:q()},De={origin:q(),direction:q()};export{wt as TiltThresholdPanningSpeed,vt as VerticalPanTresholds,It as applyPanPlanar,pe as applyPanSphericalDirectRotation,he as applyPanSphericalPreserveHeading,pt as applyRotation,ue as applyRotationWithTwoAxes,yt as applyZoomOnSphere,gt as applyZoomToPoint,bt as centroid,We as cleanupNavigationUtils,ne as computeHorizonDownLimitScreenY,te as computeHorizonPadding,ee as computeHorizonUpLimitScreenY,ut as distanceComparisonTolerance,lt as excludeTerrain,Et as findPlaneHorizonY,Yt as findSphereHorizonY,be as getTiltScaleFactor,zt as inferNavigationMode,ht as intersectPlaneFromScreenPoint,Mt as intersectPlaneFromScreenPointAtEye,xe as isHitOnSamePlanetSide,ie as lengthFromPoints,rt as maxPanDistanceModifier,it as maxRotatePivotDistanceModifier,_ as maxZoomPivotDistanceModifier,et as maxZoomStepDistanceModifier,ot as minPinchAndPanCameraHeight,at as minRotatePivotDistance,mt as normalizeCoordinate,ft as normalizeRotationDelta,jt as offSurfaceTiltToEyeTiltGlobal,xt as onSurfaceTiltToEyeTiltGlobal,de as panMotionToRotationMatrix,Me as panToPosition,Pt as pickPointAndInitSphere,st as pivotSearchAreaSize,le as preservingHeadingThresholds,$t as relativeHorizonPanPadding,ct as rotatePivotSearchAreaSize,ce as rotatePointAroundTwoAxes,re as rotationAngleAndAxisDirectRotation,se as rotationAnglesAndAxesHeadingPreserving,ae as rotationAnglesHeadingPreserving,Zt as shouldClampScreenY,fe as shouldPreserveHeading,Tt as sphereOrPlanePointFromScreenPoint,tt as zoomPivotDistanceClamp,nt as zoomStepDistanceClamp};
2
+ import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as r,asinClamped as o}from"../../../../core/mathUtils.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{fromRotation as a,exactEquals as s,rotate as c,multiply as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as u,create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as p}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{exactEquals as h,length as M,dot as g,subtract as d,normalize as y,squaredDistance as b,copy as x,transformMat4 as j,add as v,distance as w,cross as P,scale as I,lerp as z,set as T,crossAndNormalize as S,scaleAndAdd as R}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as q,create as A}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as H,axis as F,fromPoints as U,wrapAxisAngle as E}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as G,vectorCoordinates as k}from"../../../../geometry/support/coordinateSystem.js";import{create as C,fromNormalAndOffset as O,intersectRay as W,projectVector as B,fromPositionAndNormal as D,distance as J,projectPoint as K}from"../../../../geometry/support/plane.js";import{create as L}from"../../../../geometry/support/ray.js";import{Sphere as N}from"../../../../geometry/support/sphere.js";import{sm4d as Q,sv3d as V}from"../../../../geometry/support/vectorStacks.js";import{fromScreenAtEye as X,fromScreen as Y}from"../../support/geometryUtils/ray.js";import{intersectScreen as Z}from"../../support/geometryUtils/sphere.js";import $ from"../../webgl/RenderCamera.js";import{Intersector as _}from"../../webgl-engine/lib/Intersector.js";import{terrainId as tt}from"../../webgl-engine/lib/verticalOffsetUtils.js";const et=30,nt=[1,3e8],rt=8,ot=[200,1508e5],it=5,at=50,st=5,ct=10,lt=80,ut=90,mt=1e-6,pt={exclude:new Set([tt])};function ft(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function ht(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function Mt(t,e,n){const r=a(Q.get(),n[3],F(n));null==r||s(r,u)||(d(ke,t.eye,e),j(ke,ke,r),t.eye=v(ke,ke,e),d(ke,t.center,e),j(ke,ke,r),t.center=v(ke,ke,e),t.up=j(ke,t.up,r))}function gt(t,e,n,r){return W(t,Y(e,n,Je),r)}function dt(t,e,n,r){return W(t,X(e,n,Je),r)}function yt(t,e,n,r){const o=V.get();let i=1-n;d(o,e,t.eye);const a=M(o);let s=a*(1-i);i>=0&&s<r&&(s=r,i=-(s-a)/a),Math.abs(a-s)<mt||(I(o,o,i),t.eye=v(ke,t.eye,o),t.center=z(ke,t.center,e,i))}function bt(t,e,n){e.getScreenCenter(xt),Z(t,e,xt,ke)&&(e.center=ke);const r=e.distance,o=r*n;if(Math.abs(r-o)<mt)return;const i=I(V.get(),e.viewForward,o);e.eye=d(ke,e.center,i)}const xt=i();function jt(t,e){T(e,0,0,0);for(const n of t)v(e,e,n);I(e,e,1/t.length)}function vt(t,e,n,r){return Math.sin(t/M(e))*(n+r.radius)}function wt(t,e,n,r){return vt(Math.PI/2,e,n,r)+(t-Math.PI/2)}const Pt={Elevation:3e4,Angle:e(16)},It=e(80);function zt(t,e,n,r,o,i){const a=t.sceneIntersectionHelper,s=new _(t.state.viewingMode);s.options.selectionMode=!0,s.options.store=0,s.options.hud=!1,s.options.normalRequired=!0;let c=null;const l=A(),u=new N;let m=!0,p=!0;const{eye:f}=e;a.intersectIntersectorScreen(n,s,i);const g=s.results.min;return g.getIntersectionPoint(l)&&!h(f,l)&&ve(f,l,r)?(c=q(g.normal),u.radius=M(l)):(p=!1,e.aboveGround&&0!==o?u.radius=Math.max(M(e.center),.9*r):u.radius=M(e.eye)-e.relativeElevation,1===o?qt(u,e,n,l):m=Z(u,e,n,l)),{sphere:u,scenePickPoint:m?l:null,hasGeometryIntersection:p,intersectorType:g.intersector,normal:c}}function Tt(t,e,n,r){const o=t.relativeElevation;if(o>Pt.Elevation&&"global"===r)return 1;X(t,e,Ke);const i=Math.sign(o),a=n.worldUpAtPosition(t.eye,ke);return-i*g(a,Ke.direction)<Math.sin(Pt.Angle)*M(Ke.direction)?0:1}function St(t,e,n){d(Rt,n,e),t.eye=d(ke,t.eye,Rt),t.center=d(ke,t.center,Rt)}const Rt=A();function qt(t,e,n,r){const o=X(e,n,Je);return null!=o&&(t.closestPointOnSilhouette(o,At),t.intersectRay(o,r)?!(b(At,o.origin)<b(r,o.origin))||(x(r,At),!1):(d(Ht,e.eye,e.center),y(Ht,Ht),O(Ht,-g(y(Ht,Ht),At),Ft),W(Ft,o,r),!1))}const At=A(),Ht=A(),Ft=C(),Ut=A(),Et=A(),Gt=i();function kt(t,e){return B(e,t.viewForward,Ut),v(Et,t.eye,Ut),t.projectToScreen(Et,Gt),Gt[1]}const Ct=A(),Ot=C(),Wt=A(),Bt=A(),Dt=A(),Jt=A(),Kt=A(),Lt=A(),Nt=A(),Qt=A(),Vt=A(),Xt=A(),Yt=i(),Zt=L();function $t(t,e,n){const r=t.eye;if(w(e.center,r)<e.radius)return y(Kt,r),P(Lt,Kt,t.viewRight),v(Et,r,Lt),t.projectToScreen(Et,Yt),Yt[1];const o=t.up;X(t,n,Zt);const i=e.radius;if(S(Ct,o,Zt.direction),D(r,Ct,Ot),J(Ot,e.center)>i)return null;K(Ot,e.center,Wt);const a=w(e.center,Wt),s=Math.sqrt(i**2-a**2);d(Bt,r,Wt),y(Dt,Bt),S(Jt,Ct,Dt);const c=g(Bt,Dt),l=g(Bt,Jt),u=Math.sqrt(c**2+l**2),m=s**2/u**2,p=s/u**2*Math.sqrt(u**2-s**2),f=m*c,h=p*-l,M=m*l,b=p*c,x=f-h,j=M+b,z=M-b;v(Nt,Wt,R(Nt,I(Nt,Dt,f+h),Jt,j)),v(Qt,Wt,R(Qt,I(Qt,Dt,x),Jt,z)),d(Vt,Nt,r),y(Vt,Vt),d(Xt,Qt,r),y(Xt,Xt);return g(t.viewForward,Vt)>=g(t.viewForward,Xt)?t.projectToScreen(Nt,Yt):t.projectToScreen(Qt,Yt),Yt[1]}function _t(t,e,n){return e?t>n:t<n}const te=.05,ee=12;function ne(t,e){const n=t.fullHeight/t.pixelRatio,r=Math.max(e,n-e);return Math.max(ee,te*r)}function re(t,e){const n=t.fullHeight/t.pixelRatio;return Math.min(n,e+ne(t,e))}function oe(t,e){return Math.max(0,e-ne(t,e))}function ie(i,a,s,c,l,u){let m=0;if(P(We,i,a),d(Ce,i,a),M(i)<=l||!c.aboveGround){P(s,Ce,c.eye);const p=g(i,a)/(M(i)*M(a));if(p<.9999)m=r(p);else{const t=M(P(A(),i,a))/(M(i)*M(a));m=o(t)}const f=Math.cos(n(t.normalize(e(u)),0,It));m=-m-Math.max(0,M(a)-l)/(f*l)}else d(ae,c.eye,c.center),P(s,Ce,ae),m=-M(Ce)/l;return y(s,s),I(s,s,M(We)),m}const ae=A();function se(o,i,a,s){let c,l;const u=Math.cos(n(t.normalize(e(s)),0,It));return c=i>a?-(i-a)/(u*a):i<-a?Math.PI-(i+a)/(u*a):r(i/a),l=o>a?-(o-a)/(u*a):o<-a?Math.PI-(o+a)/(u*a):r(o/a),(l-c)*a}function ce(t,e,n,r,o,i,a,s,c,l){const u=se(t[2],e[2],i.radius,s),m=c?se(t[0],e[0],i.radius,180):e[0]-t[0],f=Math.sin(a)*m-Math.cos(a)*u,h=Math.cos(a)*m+Math.sin(a)*u;y(ke,o);const M=c?f/Math.sqrt(Math.abs(i.radius**2-g(n,ke)**2)):f/i.radius,d=h/Math.sqrt(Math.abs(i.radius**2-g(n,r)**2));p(l,M,d)}function le(t,e,n,r,o,i,a,s,c,l){P(We,t,e),G(i.up,i.eye,ze,Te,Se),G([0,0,1],i.eye,we,Pe,Ie),x(n,Pe),x(r,we),y(n,n),I(n,n,M(We)),k(t,y(Te,Te),y(Se,Se),y(ze,ze),Re),k(e,Te,Se,ze,qe),ce(Re,qe,t,we,Pe,a,s,c,l,o)}function ue(t,e,n,r,o,i,s){a(Fe,o,r),a(Ue,s,i),l(Ee,Fe,Ue),d(e,t,n),j(e,e,Ee),v(e,e,n)}function me(t,e,n,r,o,i){a(Fe,r,n),a(Ue,i,o),l(Ee,Fe,Ue),d(ke,t.eye,e),j(ke,ke,Ee),t.eye=v(ke,ke,e),d(ke,t.center,e),j(ke,ke,Ee),t.center=v(ke,ke,e),d(ke,t.up,e),j(ke,ke,Ee),t.up=v(ke,ke,e)}const pe={Pole:.95,Angle:e(18),Tilt:45,TiltHysteresisMargin:1e-7};let fe=!1;function he(t,e,n,r,o,i){const a=Math.abs(r)>Math.PI-pe.Angle||Math.abs(r)<pe.Angle,s=(Math.abs(t[2])<n*pe.Pole||Math.abs(e)>n)&&i;return a&&s?!fe&&o<pe.Tilt-pe.TiltHysteresisMargin?fe=!0:fe&&o>pe.Tilt+pe.TiltHysteresisMargin&&(fe=!1):fe=!1,fe}function Me(t,e,n,r,o,i){if(i)U(n,r,He),Mt(e,t.center,He);else{const i=ie(n,r,Be,e,t.radius,o);Mt(e,t.center,E(Be,i))}}function ge(t,e,n,r,o,i,a){const s=a?20:1,c=1e-12;let l,u;x(Ge,r),Oe.copyFrom(e);for(let m=0;m<s&&b(n,Ge)>c&&(l=b(n,Ge),le(n,Ge,Pe,we,Ae,Oe,t,o,i,a),me(Oe,t.center,we,Ae[1],Pe,Ae[0]),ue(Ge,Ge,t.center,we,Ae[1],Pe,Ae[0]),u=b(n,Ge),u<l||0===m);m++)e.copyFrom(Oe)}function de(n,r,o,i,a,s,c){he(o,g(r.up,o),n.radius,-t.normalize(e(a)),s,r.aboveGround)?ge(n,r,o,i,-t.normalize(e(a)),s,c):Me(n,r,o,i,s,c)}function ye(t,e,n,r,o,i){const{eye:a}=t;G([0,0,1],a,we,Pe,Ie);const s=e.translation[0]*n.pan,l="zoom"===o.mode?0:e.translation[1]*n.pan,u=Math.max(Math.sqrt(Math.abs(1-g(t.center,we)**2/M(t.center)**2)),.5),m=(Math.sin(i)*l+Math.cos(i)*s)/u,p=-Math.cos(i)*l+Math.sin(i)*s;switch(c(r.pan.matrix,r.pan.matrix,m,we),r.pan.enabled=!0,o.mode){case"pan":c(r.pan.matrix,r.pan.matrix,p,Pe),r.pan.enabled=!0;break;case"zoom":r.zoom=-e.translation[1]*n.zoom}}function be(t,e,n,r,o){const{eye:i,viewRight:a}=t,s=P(V.get(),a,i),l=e.translation[0]*n.pan;switch(0!==l&&(c(r.pan.matrix,r.pan.matrix,-l,s),r.pan.enabled=!0),o.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(c(r.pan.matrix,r.pan.matrix,t,a),r.pan.enabled=!0);break}case"zoom":r.zoom=-e.translation[1]*n.zoom}}function xe(n,r,o,i,a,s,c,l,u){he(n.center,g(n.up,n.center),M(n.center),-t.normalize(e(s)),c,r.aboveGround)?ye(r,o,i,l,u,-t.normalize(e(a))):be(r,o,i,l,u)}function je(t,e,n=1/0){const r=Math.abs(g(t,e));return Math.min(n,1/r)}function ve(t,e,n){const r=w(t,e),o=M(t);return r<Math.max(o,n)}const we=A(),Pe=A(),Ie=A(),ze=A(),Te=A(),Se=A(),Re=A(),qe=A(),Ae=f(),He=H(),Fe=m(),Ue=m(),Ee=m(),Ge=A(),ke=A(),Ce=A();let Oe=new $;const We=A(),Be=A();function De(){Oe=new $}const Je={origin:A(),direction:A()},Ke={origin:A(),direction:A()};export{It as TiltThresholdPanningSpeed,Pt as VerticalPanTresholds,St as applyPanPlanar,Me as applyPanSphericalDirectRotation,ge as applyPanSphericalPreserveHeading,Mt as applyRotation,me as applyRotationWithTwoAxes,bt as applyZoomOnSphere,yt as applyZoomToPoint,jt as centroid,De as cleanupNavigationUtils,oe as computeHorizonDownLimitScreenY,ne as computeHorizonPadding,re as computeHorizonUpLimitScreenY,mt as distanceComparisonTolerance,pt as excludeTerrain,kt as findPlaneHorizonY,$t as findSphereHorizonY,je as getTiltScaleFactor,Tt as inferNavigationMode,gt as intersectPlaneFromScreenPoint,dt as intersectPlaneFromScreenPointAtEye,ve as isHitOnSamePlanetSide,se as lengthFromPoints,it as maxPanDistanceModifier,st as maxRotatePivotDistanceModifier,et as maxZoomPivotDistanceModifier,rt as maxZoomStepDistanceModifier,at as minPinchAndPanCameraHeight,ct as minRotatePivotDistance,ft as normalizeCoordinate,ht as normalizeRotationDelta,wt as offSurfaceTiltToEyeTiltGlobal,vt as onSurfaceTiltToEyeTiltGlobal,xe as panMotionToRotationMatrix,de as panToPosition,zt as pickPointAndInitSphere,lt as pivotSearchAreaSize,pe as preservingHeadingThresholds,te as relativeHorizonPanPadding,ut as rotatePivotSearchAreaSize,ue as rotatePointAroundTwoAxes,ie as rotationAngleAndAxisDirectRotation,le as rotationAnglesAndAxesHeadingPreserving,ce as rotationAnglesHeadingPreserving,_t as shouldClampScreenY,he as shouldPreserveHeading,qt as sphereOrPlanePointFromScreenPoint,nt as zoomPivotDistanceClamp,ot as zoomStepDistanceClamp};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../core/Evented.js";import{on as o}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{isIntegratedMeshLayerView as i}from"../../support/layerViewUtils.js";let a=class extends t{constructor(e){super(e),this._integratedMeshElevationUpdateHandles=new Map}initialize(){const e=this._integratedMeshElevationUpdateHandles;this.addHandles([o(()=>this.view.groundView,"elevation-change",e=>this._elevationChange(e)),this.view.allLayerViews.on("change",t=>{t.added.forEach(t=>{if(!i(t)||t.usedAsGround)return;const o=t.elevationProvider.on("elevation-change",e=>this._elevationChange(e));e.set(t,o),this.addHandles(o,t)}),t.removed.forEach(t=>{i(t)&&(this.removeHandles(t),e.delete(t))})})])}intersect(e,t,o,s){this.view.groundView.intersect(e,t,o,s);for(const r of this._integratedMeshElevationUpdateHandles.keys())r.intersect(e,t,o,s)}_elevationChange(e){this.emit("elevation-change",e)}};e([s({constructOnly:!0})],a.prototype,"view",void 0),a=e([r("esri.views.3d.support.GroundAndIMSurface")],a);export{a as GroundAndIMSurface};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{generateUID as e}from"../../../core/uid.js";import{WorkerHandle as r}from"../../../core/workers/WorkerHandle.js";import s from"../../../geometry/SpatialReference.js";import o from"../../../layers/support/Field.js";class t{constructor(e){this._controller=e,this._handle=new n(r=>e.schedule(r))}destroy(){this._handle.destroy()}invoke(r,t){return r.buffer&&0!==r.buffer.byteLength?(r.options.sourceSpatialReference&&r.options.sourceSpatialReference instanceof s&&(r.options={...r.options,sourceSpatialReference:r.options.sourceSpatialReference.toJSON()}),this._handle.invoke(r,t).then(r=>{let t=0,n=0;const i=s.fromJSON(r.spatialReference);r.spatialReference=i;const p=async s=>{const c=r.fields;if(c)for(;t<c.length;)if(c[t]=o.fromJSON(c[t]),t++,s.madeProgress())return this._controller.reschedule(e=>p(e));const l=r.features;for(;n<l.length;){const r=l[n];++n,r.uid=e();const o=r.geometry;if(null!=o&&(o.spatialReference=i,a(o),s.madeProgress()))return this._controller.reschedule(e=>p(e))}return r};return this._controller.schedule(e=>p(e))})):Promise.resolve(null)}}function a(e){switch(e.type){case"polyline":e.paths=e.hasZ&&e.hasM?e.paths.map(e=>e.map(e=>[e[0],e[1],e[2],e[3]])):e.hasZ||e.hasM?e.paths.map(e=>e.map(e=>[e[0],e[1],e[2]])):e.paths.map(e=>e.map(e=>[e[0],e[1]]));break;case"polygon":e.rings=e.hasZ&&e.hasM?e.rings.map(e=>e.map(e=>[e[0],e[1],e[2],e[3]])):e.hasZ||e.hasM?e.rings.map(e=>e.map(e=>[e[0],e[1],e[2]])):e.rings.map(e=>e.map(e=>[e[0],e[1]]))}}class n extends r{constructor(e){super("PBFDecoderWorker","_parseFeatureQuery",{_parseFeatureQuery:e=>[e.buffer]},e)}}export{t as PBFDecoder};
2
+ import{generateUID as e}from"../../../core/uid.js";import{WorkerHandle as r}from"../../../core/workers/WorkerHandle.js";import s from"../../../geometry/SpatialReference.js";import t from"../../../layers/support/Field.js";class a{constructor(e){this._controller=e,this._handle=new n(r=>e.schedule(r))}destroy(){this._handle.destroy()}async invoke(r,a){if(!r.buffer||0===r.buffer.byteLength)return null;r.options.sourceSpatialReference&&r.options.sourceSpatialReference instanceof s&&(r.options={...r.options,sourceSpatialReference:r.options.sourceSpatialReference.toJSON()});const n=await this._handle.invoke(r,a);return await this._controller.scheduleGenerator(function*(r){const a=s.fromJSON(n.spatialReference);n.spatialReference=a;const i=n.fields;if(i)for(let e=0;e<i.length;++e)i[e]=t.fromJSON(i[e]),r.madeProgress()&&(r=yield);const p=n.features;for(let s=0;s<p.length;++s){const t=p[s];t.uid=e();const n=t.geometry;null!=n&&(n.spatialReference=a,o(n),r.madeProgress()&&(r=yield))}return n})}}function o(e){switch(e.type){case"polyline":e.paths=e.hasZ&&e.hasM?e.paths.map(e=>e.map(e=>[e[0],e[1],e[2],e[3]])):e.hasZ||e.hasM?e.paths.map(e=>e.map(e=>[e[0],e[1],e[2]])):e.paths.map(e=>e.map(e=>[e[0],e[1]]));break;case"polygon":e.rings=e.hasZ&&e.hasM?e.rings.map(e=>e.map(e=>[e[0],e[1],e[2],e[3]])):e.hasZ||e.hasM?e.rings.map(e=>e.map(e=>[e[0],e[1],e[2]])):e.rings.map(e=>e.map(e=>[e[0],e[1]]))}}class n extends r{constructor(e){super("PBFDecoderWorker","_parseFeatureQuery",{_parseFeatureQuery:e=>[e.buffer]},e)}}export{a as PBFDecoder};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{createTask as t}from"../../../../core/asyncUtils.js";import{on as r}from"../../../../core/events.js";import{destroyMaybe as i,abortMaybe as o}from"../../../../core/maybe.js";import{throwIfAborted as s,isAbortError as n}from"../../../../core/promiseUtils.js";import{property as a,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{distance as d,exactEquals as c,copy as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h,clone as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import y from"../../../../geometry/Point.js";import{distanceToScale as _}from"../cameraScaleUtils.js";import{PointOfInterest as m}from"./PointOfInterest.js";import{PropertiesPool as f}from"../../../support/PropertiesPool.js";import{Yield as g}from"../../../support/Yield.js";let Q=class extends m{constructor(e){super(e),this._dirty=!1,this._groundQueryDirty=!0,this._propertiesPool=new f({location:()=>new y,renderLocation:()=>h()},this),this._estimatedSurfaceAltitude=0,this._elevationQueryTask=null,this._lastQueryRenderEye=h(),this.renderLocation=h(),this._tmpPoint=new y}initialize(){this.scheduler&&this.addHandles(this.scheduler.registerTask(this.task,this)),this.surface&&this.addHandles(r(this.surface,"elevation-query-change",()=>this._invalidateElevationQuery())),this.runTask(),this._updateRenderLocation()}destroy(){this._cancelPendingRequest(),this._propertiesPool=i(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const e=this._propertiesPool.get("location");return e.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,e),e}get scale(){const e=this._camera,t=d(e.eye,this.renderLocation),r={renderCoordsHelper:this.renderCoordsHelper,state:{camera:e}};return _(r,t)}get updating(){return this._dirty||null!=this._elevationQueryTask}updateRenderLocation(){this._setDirty(),this._updateRenderLocation()}_setDirty(){this._dirty||(this._dirty=!0)}_cancelPendingRequest(){this._elevationQueryTask=o(this._elevationQueryTask)}get readyToRun(){return!this._elevationQueryTask&&this._dirty&&this._groundQueryReady}runTask(){this._cancelPendingRequest(),this._dirty=!1;const e=p(this._camera.eye);if(this._hasCurrentGroundQuery(e))return g;const r=this.map?.ground;if(!r)return this._updateSurfaceAltitude(0),this._rememberGroundQuery(e),g;if(!this._groundQueryReady)return this._setDirty(),g;const i=this.state.spatialReference;this._tmpPoint.spatialReference=i,this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint);const o=(this._tmpPoint.z??0)>R&&1===this.renderCoordsHelper.viewingMode&&(i.isWGS84||i.isWebMercator)?P:0;let a=null;return a=t(async t=>{try{const i=await r.queryElevation(this._tmpPoint,{signal:t,cache:this.cache,minDemResolution:o});if(s(t),this._elevationQueryTask!==a)return;this._updateSurfaceAltitude(i.geometry.z??0),this._rememberGroundQuery(e)}catch(i){if(this._elevationQueryTask!==a||t.aborted||n(i))return;this._updateSurfaceAltitude(0),this._rememberGroundQuery(e)}finally{this._elevationQueryTask===a&&(this._elevationQueryTask=null)}}),this._elevationQueryTask=a,g}get _groundQueryReady(){return this.surface?.elevationQueryReady??!0}_hasCurrentGroundQuery(e){return!this._groundQueryDirty&&c(this._lastQueryRenderEye,e)}_rememberGroundQuery(e){l(this._lastQueryRenderEye,e),this._groundQueryDirty=!1}_invalidateElevationQuery(){this._cancelPendingRequest(),this.cache?.clear(),this._groundQueryDirty=!0,this._setDirty()}_updateSurfaceAltitude(e){this._estimatedSurfaceAltitude!==e&&(this._estimatedSurfaceAltitude=e,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(v,this._estimatedSurfaceAltitude,this._camera.eye),c(this._get("renderLocation"),v)||(this._set("renderLocation",l(this._propertiesPool.get("renderLocation"),v)),this.notifyChange("renderLocation"))}};e([a({constructOnly:!0})],Q.prototype,"scheduler",void 0),e([a({constructOnly:!0})],Q.prototype,"cache",void 0),e([a({constructOnly:!0})],Q.prototype,"map",void 0),e([a({constructOnly:!0})],Q.prototype,"task",void 0),e([a()],Q.prototype,"_dirty",void 0),e([a()],Q.prototype,"_groundQueryDirty",void 0),e([a()],Q.prototype,"_elevationQueryTask",void 0),e([a()],Q.prototype,"location",null),e([a()],Q.prototype,"renderLocation",void 0),e([a()],Q.prototype,"scale",null),e([a()],Q.prototype,"updating",null),e([a()],Q.prototype,"readyToRun",null),e([a()],Q.prototype,"_groundQueryReady",null),Q=e([u("esri.views.3d.support.pointsOfInterest.CameraOnSurface")],Q);const v=h(),R=1e5,P=1e6;export{Q as CameraOnSurface};
2
+ import{__decorate as e}from"tslib";import{createTask as t}from"../../../../core/asyncUtils.js";import{on as r}from"../../../../core/events.js";import{destroyMaybe as i,abortMaybe as o}from"../../../../core/maybe.js";import{throwIfAborted as s,isAbortError as n}from"../../../../core/promiseUtils.js";import{property as a,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{distance as d,exactEquals as c,copy as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h,clone as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import y from"../../../../geometry/Point.js";import{distanceToScale as _}from"../cameraScaleUtils.js";import{PointOfInterest as m}from"./PointOfInterest.js";import{PropertiesPool as f}from"../../../support/PropertiesPool.js";import{Yield as g}from"../../../support/Yield.js";let v=class extends m{constructor(e){super(e),this._dirty=!1,this._groundQueryDirty=!0,this._propertiesPool=new f({location:()=>new y,renderLocation:()=>h()},this),this._estimatedSurfaceAltitude=0,this._elevationQueryTask=null,this._lastQueryRenderEye=h(),this.renderLocation=h(),this._tmpPoint=new y}initialize(){this.scheduler&&this.addHandles(this.scheduler.registerTask(this.task,this)),this.surface&&this.addHandles(r(this.surface,"elevation-query-change",()=>this._invalidateElevationQuery())),this.runTask(),this._updateRenderLocation()}destroy(){this._cancelPendingRequest(),this._propertiesPool=i(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const e=this._propertiesPool.get("location");return e.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,e),e}get scale(){const e=this._camera,t=d(e.eye,this.renderLocation),r={renderCoordsHelper:this.renderCoordsHelper,state:{camera:e}};return _(r,t)}get updating(){return this._dirty||null!=this._elevationQueryTask}updateRenderLocation(){this._setDirty(),this._updateRenderLocation()}_setDirty(){this._dirty||(this._dirty=!0)}_cancelPendingRequest(){this._elevationQueryTask=o(this._elevationQueryTask)}get readyToRun(){return!this._elevationQueryTask&&this._dirty&&this._groundQueryReady}runTask(){this._cancelPendingRequest(),this._dirty=!1;const e=p(this._camera.eye);if(this._hasCurrentGroundQuery(e))return g;const r=this.map?.ground;if(!r)return this._updateSurfaceAltitude(0),this._rememberGroundQuery(e),g;if(!this._groundQueryReady)return this._setDirty(),g;const i=this.state.spatialReference;this._tmpPoint.spatialReference=i,this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint);const o=(this._tmpPoint.z??0)>R&&1===this.renderCoordsHelper.viewingMode&&(i.isWGS84||i.isWebMercator)?P:0;let a=null;return a=t(async t=>{try{const i=await r.queryElevation(this._tmpPoint,{signal:t,cache:this.cache,minDemResolution:o});if(s(t),this._elevationQueryTask!==a)return;this._updateSurfaceAltitude(i.geometry.z??0),this._rememberGroundQuery(e)}catch(i){if(this._elevationQueryTask!==a||t.aborted||n(i))return;this._updateSurfaceAltitude(0),this._rememberGroundQuery(e)}finally{this._elevationQueryTask===a&&(this._elevationQueryTask=null)}}),this._elevationQueryTask=a,g}get _groundQueryReady(){return this.surface?.elevationQueryReady??!0}_hasCurrentGroundQuery(e){return!this._groundQueryDirty&&c(this._lastQueryRenderEye,e)}_rememberGroundQuery(e){l(this._lastQueryRenderEye,e),this._groundQueryDirty=!1}_invalidateElevationQuery(){this._cancelPendingRequest(),this.cache?.clear(),this._groundQueryDirty=!0,this._setDirty()}_updateSurfaceAltitude(e){this._estimatedSurfaceAltitude!==e&&(this._estimatedSurfaceAltitude=e,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(Q,this._estimatedSurfaceAltitude,this._camera.eye),c(this._get("renderLocation"),Q)||(this._set("renderLocation",l(this._propertiesPool.get("renderLocation"),Q)),this.notifyChange("renderLocation"))}};e([a({constructOnly:!0})],v.prototype,"scheduler",void 0),e([a({constructOnly:!0})],v.prototype,"surface",void 0),e([a({constructOnly:!0})],v.prototype,"cache",void 0),e([a({constructOnly:!0})],v.prototype,"map",void 0),e([a({constructOnly:!0})],v.prototype,"task",void 0),e([a()],v.prototype,"_dirty",void 0),e([a()],v.prototype,"_groundQueryDirty",void 0),e([a()],v.prototype,"_elevationQueryTask",void 0),e([a()],v.prototype,"location",null),e([a()],v.prototype,"renderLocation",void 0),e([a()],v.prototype,"scale",null),e([a()],v.prototype,"updating",null),e([a()],v.prototype,"readyToRun",null),e([a()],v.prototype,"_groundQueryReady",null),v=e([u("esri.views.3d.support.pointsOfInterest.CameraOnSurface")],v);const Q=h(),R=1e5,P=1e6;export{v as CameraOnSurface};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{clamp as e}from"../../../../core/mathUtils.js";import{removeMaybe as r,destroyMaybe as i}from"../../../../core/maybe.js";import{property as s,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{copy as a,distance as n,scale as c,add as u,exactEquals as l,squaredLength as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as h}from"../../../../geometry/ellipsoidUtils.js";import f from"../../../../geometry/Point.js";import{projectBoundingRect as m}from"../../../../geometry/projection/projectBoundingRect.js";import{create as _}from"../../../../geometry/support/aaBoundingRect.js";import{debugFlags as g}from"../debugFlags.js";import{PointOfInterest as y}from"./PointOfInterest.js";import{PropertiesPool as S}from"../../../support/PropertiesPool.js";import{Yield as A}from"../../../support/Yield.js";let j=class extends y{constructor(t){super(t),this._propertiesPool=new S({location:()=>new f,renderLocation:()=>p()},this),this._currentSurfaceAltitude=0,this._latestSurfaceAltitude=0,this.distance=0,this.renderLocation=p(),this.updating=!1}initialize(){this._frameWorker=this.scheduler.registerTask(this.task,this),this.runTask()}destroy(){this._frameWorker=r(this._frameWorker),this._propertiesPool=i(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const t=this._propertiesPool?.get("location");return t?(t.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,t),t):new f}updateRenderLocation(){this.updating=!0,this._updateRenderLocation()}get estimatedSurfaceAltitude(){return this._latestSurfaceAltitude}get readyToRun(){return this.updating}runTask(){return this._latestSurfaceAltitude=this.estimateSurfaceAltitudeAtCenter(),this._updateRenderLocation(),this.updating=!1,A}_updateRenderLocation(){const t=R;let e=this._calculateSurfaceIntersection(this._currentSurfaceAltitude,t);const r=this._currentSurfaceAltitude!==this._latestSurfaceAltitude;!e&&r&&(e=this._calculateSurfaceIntersection(this._latestSurfaceAltitude,t),e&&(this._currentSurfaceAltitude=this._latestSurfaceAltitude));const i=L;e&&this._latestSurfaceAltitudeChangesDistance(t,i)&&(a(t,i),this._currentSurfaceAltitude=this._latestSurfaceAltitude),e?this.distance=n(this._camera.eye,t):(c(t,this._camera.viewForward,this._get("distance")),u(t,t,this._camera.eye)),l(this._get("renderLocation"),t)||this._set("renderLocation",a(this._propertiesPool.get("renderLocation"),t))}_calculateSurfaceIntersection(t,r){const i=this._camera;if(!this.renderCoordsHelper.intersectInfiniteManifold(i.ray,t,r))return!1;if(this.state.isGlobal){const e=h(this.renderCoordsHelper.spatialReference).radius,s=e+t,o=d(i.eye),a=o<s*s,l=n(i.eye,r);if(a&&l>e/4){const t=s-Math.sqrt(o);return c(r,i.viewForward,t),u(r,r,i.eye),!0}}else{const t=this.surface?.ready?this.surface.groundExtent:null;null!=t&&m(t,this.surface?.spatialReference,v,this.renderCoordsHelper.spatialReference)&&(r[0]=e(r[0],v[0],v[2]),r[1]=e(r[1],v[1],v[3]))}return!0}_latestSurfaceAltitudeChangesDistance(t,e){if(this._latestSurfaceAltitude===this._currentSurfaceAltitude||null==t)return!1;if(this._calculateSurfaceIntersection(this._latestSurfaceAltitude,e)){if(!g.ENABLE_OPTIMIZATIONS)return!0;const r=this._camera.eye;if(n(r,t)!==n(r,e))return!0}return!1}};t([s({constructOnly:!0})],j.prototype,"scheduler",void 0),t([s({constructOnly:!0})],j.prototype,"task",void 0),t([s()],j.prototype,"distance",void 0),t([s({constructOnly:!0})],j.prototype,"estimateSurfaceAltitudeAtCenter",void 0),t([s({readOnly:!0})],j.prototype,"location",null),t([s({readOnly:!0})],j.prototype,"renderLocation",void 0),t([s()],j.prototype,"updating",void 0),j=t([o("esri.views.3d.support.pointsOfInterest.CenterOnSurface")],j);const R=p(),L=p(),v=_();export{j as CenterOnSurface};
2
+ import{__decorate as t}from"tslib";import{clamp as e}from"../../../../core/mathUtils.js";import{removeMaybe as r,destroyMaybe as i}from"../../../../core/maybe.js";import{property as s,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{copy as a,distance as n,scale as c,add as u,exactEquals as l,squaredLength as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as h}from"../../../../geometry/ellipsoidUtils.js";import f from"../../../../geometry/Point.js";import{projectBoundingRect as m}from"../../../../geometry/projection/projectBoundingRect.js";import{create as _}from"../../../../geometry/support/aaBoundingRect.js";import{debugFlags as y}from"../debugFlags.js";import{PointOfInterest as g}from"./PointOfInterest.js";import{PropertiesPool as S}from"../../../support/PropertiesPool.js";import{Yield as A}from"../../../support/Yield.js";let j=class extends g{constructor(t){super(t),this._propertiesPool=new S({location:()=>new f,renderLocation:()=>p()},this),this._currentSurfaceAltitude=0,this._latestSurfaceAltitude=0,this.distance=0,this.renderLocation=p(),this.updating=!1}initialize(){this._frameWorker=this.scheduler.registerTask(this.task,this),this.runTask()}destroy(){this._frameWorker=r(this._frameWorker),this._propertiesPool=i(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const t=this._propertiesPool?.get("location");return t?(t.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,t),t):new f}updateRenderLocation(){this.updating=!0,this._updateRenderLocation()}get estimatedSurfaceAltitude(){return this._latestSurfaceAltitude}get readyToRun(){return this.updating}runTask(){return this._latestSurfaceAltitude=this.estimateSurfaceAltitudeAtCenter(),this._updateRenderLocation(),this.updating=!1,A}_updateRenderLocation(){const t=R;let e=this._calculateSurfaceIntersection(this._currentSurfaceAltitude,t);const r=this._currentSurfaceAltitude!==this._latestSurfaceAltitude;!e&&r&&(e=this._calculateSurfaceIntersection(this._latestSurfaceAltitude,t),e&&(this._currentSurfaceAltitude=this._latestSurfaceAltitude));const i=v;e&&this._latestSurfaceAltitudeChangesDistance(t,i)&&(a(t,i),this._currentSurfaceAltitude=this._latestSurfaceAltitude),e?this.distance=n(this._camera.eye,t):(c(t,this._camera.viewForward,this._get("distance")),u(t,t,this._camera.eye)),l(this._get("renderLocation"),t)||this._set("renderLocation",a(this._propertiesPool.get("renderLocation"),t))}_calculateSurfaceIntersection(t,r){const i=this._camera;if(!this.renderCoordsHelper.intersectInfiniteManifold(i.ray,t,r))return!1;if(this.state.isGlobal){const e=h(this.renderCoordsHelper.spatialReference).radius,s=e+t,o=d(i.eye),a=o<s*s,l=n(i.eye,r);if(a&&l>e/4){const t=s-Math.sqrt(o);return c(r,i.viewForward,t),u(r,r,i.eye),!0}}else{const t=this.surface?.ready?this.surface.groundExtent:null;null!=t&&m(t,this.surface?.spatialReference,L,this.renderCoordsHelper.spatialReference)&&(r[0]=e(r[0],L[0],L[2]),r[1]=e(r[1],L[1],L[3]))}return!0}_latestSurfaceAltitudeChangesDistance(t,e){if(this._latestSurfaceAltitude===this._currentSurfaceAltitude||null==t)return!1;if(this._calculateSurfaceIntersection(this._latestSurfaceAltitude,e)){if(!y.ENABLE_OPTIMIZATIONS)return!0;const r=this._camera.eye;if(n(r,t)!==n(r,e))return!0}return!1}};t([s({constructOnly:!0})],j.prototype,"scheduler",void 0),t([s({constructOnly:!0})],j.prototype,"surface",void 0),t([s({constructOnly:!0})],j.prototype,"task",void 0),t([s()],j.prototype,"distance",void 0),t([s({constructOnly:!0})],j.prototype,"estimateSurfaceAltitudeAtCenter",void 0),t([s({readOnly:!0})],j.prototype,"location",null),t([s({readOnly:!0})],j.prototype,"renderLocation",void 0),t([s()],j.prototype,"updating",void 0),j=t([o("esri.views.3d.support.pointsOfInterest.CenterOnSurface")],j);const R=p(),v=p(),L=_();export{j as CenterOnSurface};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as o}from"tslib";import r from"../../../../core/Accessor.js";import{property as t,subclass as e}from"../../../../core/accessorSupport/decorators.js";let s=class extends r{constructor(o){super(o)}};o([t({constructOnly:!0})],s.prototype,"renderCoordsHelper",void 0),o([t({constructOnly:!0})],s.prototype,"surface",void 0),o([t({constructOnly:!0})],s.prototype,"state",void 0),s=o([e("esri.views.3d.support.pointsOfInterest.PointOfInterest")],s);export{s as PointOfInterest};
2
+ import{__decorate as o}from"tslib";import r from"../../../../core/Accessor.js";import{property as t,subclass as e}from"../../../../core/accessorSupport/decorators.js";let s=class extends r{constructor(o){super(o)}};o([t({constructOnly:!0})],s.prototype,"renderCoordsHelper",void 0),o([t({constructOnly:!0})],s.prototype,"state",void 0),s=o([e("esri.views.3d.support.pointsOfInterest.PointOfInterest")],s);export{s as PointOfInterest};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{watch as r,sync as n,initial as s,when as i,on as o}from"../../../../core/reactiveUtils.js";import{property as a,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{add as u,exactEquals as d,copy as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as p}from"../../../../core/support/UpdatingHandles.js";import{create as _}from"../../../../geometry/support/ray.js";import{debugFlags as l}from"../debugFlags.js";import{DebugPoint as m}from"../debugUtils.js";import{fromRenderAtEye as C}from"../geometryUtils/ray.js";import{CameraOnSurface as g}from"./CameraOnSurface.js";import{CenterOnSurface as y}from"./CenterOnSurface.js";import{ContentGeometryUpdates as O}from"./ContentGeometryUpdates.js";import{Focus as A}from"./Focus.js";import{StableSurfaceCenter as w}from"./StableSurfaceCenter.js";import{SurfaceGeometryUpdates as S}from"./SurfaceGeometryUpdates.js";import{Intersector as v}from"../../webgl-engine/lib/Intersector.js";import{terrainId as I}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{PropertiesPool as P}from"../../../support/PropertiesPool.js";import{TaskPriority as R}from"../../../support/Scheduler.js";let b=class extends t{constructor(e){super(e),this.renderPointOfView=f(),this._pois=new Array,this._updatingHandles=new p,this._debugCenters=null,this._tmpRay=_(),this._centerRayDirty=!0,this._surfaceAltitudeAtCenter=0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenter=0,this._contentAltitudeAtCenterDirty=!0,this._contentChangedSinceLastUpdate=!0,this._geometryPois=new Array,this._propertiesPool=new P({renderPointOfView:()=>f()},this),this._contentIntersector=new v(e.view.state.viewingMode),this._surfaceIntersector=new v(e.view.state.viewingMode),this._surfaceIntersector.options.invisibleTerrain=!1,this._surfaceIntersector.options.store=0}initialize(){const{state:e,groundView:t,renderCoordsHelper:a,map:c}=this.view,u=()=>this._estimateSurfaceAltitudeAtCenter(),d=this.view.resourceController.scheduler,h=t?.elevationQueryCache,f={state:e,scheduler:d,surface:t,renderCoordsHelper:a};this._set("centerOnSurfaceInfrequent",new y({...f,task:R.POINT_OF_INTEREST_INFREQUENT,estimateSurfaceAltitudeAtCenter:u})),this._set("centerOnSurfaceFrequent",new y({...f,task:R.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:u})),this._set("centerOnContent",new y({...f,task:R.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:()=>this._estimateContentAltitudeAtCenter()})),this._set("cameraOnSurface",new g({...f,cache:h,task:R.POINT_OF_INTEREST_INFREQUENT,map:c})),this._set("surfaceGeometryUpdates",new S({...f,centerOnSurfaces:[this.centerOnSurfaceFrequent,this.centerOnContent,this.centerOnSurfaceInfrequent]})),this._set("contentGeometryUpdates",new O(this.view.allLayerViews,()=>this.view.graphicsView)),this._set("surfaceOrigin",new w({cache:h,view:this.view})),this._set("focus",new A({state:e,scheduler:d,surface:t,renderCoordsHelper:a,centerOnSurface:this.centerOnSurfaceFrequent,estimateSurfaceIntersectionAtRenderPoint:(e,t)=>this._estimateSurfaceIntersectionAtRenderPoint(e,this.view.state.contentCamera,t)})),this._pois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.cameraOnSurface,this.focus),this._geometryPois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.focus),this.addHandles([r(()=>e.contentCamera,e=>this._cameraChanged(e),n),this._updatingHandles.add(()=>t.groundExtent,()=>this._updateGeometryPointsOfInterest()),this._updatingHandles.add(()=>this.view.map?.ground?.navigationConstraint?.type,e=>{this._surfaceIntersector.options.backfacesTerrain="none"===e},s),i(()=>!t.updating&&this._contentChangedSinceLastUpdate,()=>{this._updateGeometryPointsOfInterest(),this._contentChangedSinceLastUpdate=!1},n),o(()=>this.surfaceGeometryUpdates.events,"request-update",()=>this._updateGeometryPointsOfInterest()),o(()=>this.contentGeometryUpdates.events,"request-update",()=>{this._contentChangedSinceLastUpdate=!0,this._updateCenterOnContent()}),this._updatingHandles.add(()=>l.SHOW_POI,e=>this._setDebug(e),s)]),this._cameraChanged(this.view.state.contentCamera);for(const r of this._pois)r.runTask()}destroy(){this._setDebug(!1),this._propertiesPool.destroy();for(const e of this._pois)e.destroy();this._pois.length=0,this.surfaceOrigin.destroy(),this._updatingHandles.destroy(),this._set("centerOnSurfaceInfrequent",null),this._set("centerOnSurfaceFrequent",null),this._set("centerOnContent",null),this._set("cameraOnSurface",null),this._set("surfaceGeometryUpdates",null),this._set("contentGeometryUpdates",null),this._set("surfaceOrigin",null),this._set("focus",null)}get updating(){return!(!this.surfaceGeometryUpdates?.updating&&!this._pois.some(e=>e.updating))||this._updatingHandles.updating}get _centerRay(){return this._centerRayDirty&&(this._centerRayCached=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(this.view.state.contentCamera,this._tmpRay),this._centerRayDirty=!1),this._centerRayCached}_estimateContentAltitudeAtCenter(){if(!this._contentAltitudeAtCenterDirty)return this._contentAltitudeAtCenter;this._contentAltitudeAtCenterDirty=!1;const e=this._centerRay;return null==e||(this.view.sceneIntersectionHelper.intersectRay(e,this._contentIntersector,U,E)?this._contentAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(U):this._contentAltitudeAtCenter=this._estimateSurfaceAltitudeAtCenter()),this._contentAltitudeAtCenter}_estimateSurfaceAltitudeAtCenter(){const{view:e}=this,{groundView:t}=e;if(!t)return 0;if(!this._surfaceAltitudeAtCenterDirty)return this._surfaceAltitudeAtCenter;this._surfaceAltitudeAtCenterDirty=!1;const r=this._centerRay;if(null==r)return this._surfaceAltitudeAtCenter;const n=r.origin,s=u(U,r.origin,r.direction);return this._surfaceIntersector.resetWithRay(r,e.state.contentCamera),t.intersect(this._surfaceIntersector,null,n,s),this._surfaceIntersector.results.min.getIntersectionPoint(U)&&(this._surfaceAltitudeAtCenter=e.renderCoordsHelper.getAltitude(U)),this._surfaceAltitudeAtCenter}_estimateSurfaceIntersectionAtRenderPoint(e,t,r){const n=C(t,e,j);if(null==n)return null;const s=n.origin,i=u(U,n.origin,n.direction);return this._surfaceIntersector.resetWithRay(n,t),this.view.groundView.intersect(this._surfaceIntersector,null,s,i),this._surfaceIntersector.results.min.getIntersectionPoint(r)?r:null}_cameraChanged(e){this._updateAllPointsOfInterest();const t=e.eye;d(this.renderPointOfView,t)||this._set("renderPointOfView",h(this._propertiesPool.get("renderPointOfView"),t))}_updateAllPointsOfInterest(){this._invalidateCenterEstimates();for(const e of this._pois)e.updateRenderLocation()}_updateGeometryPointsOfInterest(){this._invalidateCenterEstimates();for(const e of this._geometryPois)e.updateRenderLocation()}_invalidateCenterEstimates(){this._centerRayDirty=!0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenterDirty=!0}_updateCenterOnContent(){this._contentAltitudeAtCenterDirty=!0,this.centerOnContent.updateRenderLocation()}_setDebug(e){if(!e)return this._debugCenters?.forEach(e=>e.hide()),void this.removeHandles("debug");if(!this._debugCenters){this._debugCenters=new Map;const e=this.view.graphics;this._debugCenters.set(this.centerOnContent,new m(e,"red","CenterOnContent")),this._debugCenters.set(this.centerOnSurfaceFrequent,new m(e,"red","CenterOnSurface")),this._debugCenters.set(this.centerOnSurfaceInfrequent,new m(e,"red","CenterOnSurface")),this._debugCenters.set(this.cameraOnSurface,new m(e,"blue","CameraOnSurface")),this._debugCenters.set(this.focus,new m(e,"green","Focus"))}for(const t of this._pois)this.addHandles(this._updatingHandles.add(()=>t.renderLocation,e=>this._debugCenters?.get(t)?.show(e,t.renderCoordsHelper.spatialReference),s),"debug")}get test(){}};e([a()],b.prototype,"centerOnContent",void 0),e([a()],b.prototype,"centerOnSurfaceFrequent",void 0),e([a()],b.prototype,"centerOnSurfaceInfrequent",void 0),e([a()],b.prototype,"cameraOnSurface",void 0),e([a()],b.prototype,"focus",void 0),e([a()],b.prototype,"renderPointOfView",void 0),e([a()],b.prototype,"surfaceOrigin",void 0),e([a()],b.prototype,"contentGeometryUpdates",void 0),e([a()],b.prototype,"surfaceGeometryUpdates",void 0),e([a({constructOnly:!0})],b.prototype,"view",void 0),e([a()],b.prototype,"updating",null),b=e([c("esri.views.3d.support.pointsOfInterest.PointsOfInterest")],b);const U=f(),j=_(),E={exclude:new Set([I])};export{b as PointsOfInterest};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{watch as r,sync as n,initial as s,when as i,on as o}from"../../../../core/reactiveUtils.js";import{property as a,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{add as u,exactEquals as d,copy as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as p}from"../../../../core/support/UpdatingHandles.js";import{create as _}from"../../../../geometry/support/ray.js";import{debugFlags as l}from"../debugFlags.js";import{DebugPoint as m}from"../debugUtils.js";import{fromRenderAtEye as C}from"../geometryUtils/ray.js";import{CameraOnSurface as g}from"./CameraOnSurface.js";import{CenterOnSurface as y}from"./CenterOnSurface.js";import{ContentGeometryUpdates as O}from"./ContentGeometryUpdates.js";import{Focus as A}from"./Focus.js";import{StableSurfaceCenter as w}from"./StableSurfaceCenter.js";import{SurfaceGeometryUpdates as S}from"./SurfaceGeometryUpdates.js";import{Intersector as I}from"../../webgl-engine/lib/Intersector.js";import{terrainId as v}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{PropertiesPool as P}from"../../../support/PropertiesPool.js";import{TaskPriority as R}from"../../../support/Scheduler.js";let b=class extends t{constructor(e){super(e),this.renderPointOfView=f(),this._pois=new Array,this._updatingHandles=new p,this._debugCenters=null,this._tmpRay=_(),this._centerRayDirty=!0,this._surfaceAltitudeAtCenter=0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenter=0,this._contentAltitudeAtCenterDirty=!0,this._contentChangedSinceLastUpdate=!0,this._geometryPois=new Array,this._propertiesPool=new P({renderPointOfView:()=>f()},this),this._contentIntersector=new I(e.view.state.viewingMode),this._surfaceIntersector=new I(e.view.state.viewingMode),this._surfaceIntersector.options.invisibleTerrain=!1,this._surfaceIntersector.options.store=0}initialize(){const{state:e,groundView:t,renderCoordsHelper:a,map:c}=this.view,u=this.view.groundAndIMSurface,d=()=>this._estimateSurfaceAltitudeAtCenter(),h=this.view.resourceController.scheduler,f=t?.elevationQueryCache,p={state:e,scheduler:h,renderCoordsHelper:a},_={...p,surface:t};this._set("centerOnSurfaceInfrequent",new y({..._,task:R.POINT_OF_INTEREST_INFREQUENT,estimateSurfaceAltitudeAtCenter:d})),this._set("centerOnSurfaceFrequent",new y({..._,task:R.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:d})),this._set("centerOnContent",new y({..._,task:R.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:()=>this._estimateContentAltitudeAtCenter()})),this._set("cameraOnSurface",new g({..._,cache:f,task:R.POINT_OF_INTEREST_INFREQUENT,map:c})),this._set("surfaceGeometryUpdates",new S({...p,surface:u,centerOnSurfaces:[this.centerOnSurfaceFrequent,this.centerOnContent,this.centerOnSurfaceInfrequent]})),this._set("contentGeometryUpdates",new O(this.view.allLayerViews,()=>this.view.graphicsView)),this._set("surfaceOrigin",new w({cache:f,view:this.view})),this._set("focus",new A({...p,centerOnSurface:this.centerOnSurfaceFrequent,estimateSurfaceIntersectionAtRenderPoint:(e,t)=>this._estimateSurfaceIntersectionAtRenderPoint(e,this.view.state.contentCamera,t)})),this._pois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.cameraOnSurface,this.focus),this._geometryPois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.focus),this.addHandles([r(()=>e.contentCamera,e=>this._cameraChanged(e),n),this._updatingHandles.add(()=>t.groundExtent,()=>this._updateGeometryPointsOfInterest()),this._updatingHandles.add(()=>this.view.map?.ground?.navigationConstraint?.type,e=>{this._surfaceIntersector.options.backfacesTerrain="none"===e},s),i(()=>!t.updating&&this._contentChangedSinceLastUpdate,()=>{this._updateGeometryPointsOfInterest(),this._contentChangedSinceLastUpdate=!1},n),o(()=>this.surfaceGeometryUpdates.events,"request-update",()=>this._updateGeometryPointsOfInterest()),o(()=>this.contentGeometryUpdates.events,"request-update",()=>{this._contentChangedSinceLastUpdate=!0,this._updateCenterOnContent()}),this._updatingHandles.add(()=>l.SHOW_POI,e=>this._setDebug(e),s)]),this._cameraChanged(this.view.state.contentCamera);for(const r of this._pois)r.runTask()}destroy(){this._setDebug(!1),this._propertiesPool.destroy();for(const e of this._pois)e.destroy();this._pois.length=0,this.surfaceOrigin.destroy(),this._updatingHandles.destroy(),this._set("centerOnSurfaceInfrequent",null),this._set("centerOnSurfaceFrequent",null),this._set("centerOnContent",null),this._set("cameraOnSurface",null),this._set("surfaceGeometryUpdates",null),this._set("contentGeometryUpdates",null),this._set("surfaceOrigin",null),this._set("focus",null)}get updating(){return!(!this.surfaceGeometryUpdates?.updating&&!this._pois.some(e=>e.updating))||this._updatingHandles.updating}get _centerRay(){return this._centerRayDirty&&(this._centerRayCached=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(this.view.state.contentCamera,this._tmpRay),this._centerRayDirty=!1),this._centerRayCached}_estimateContentAltitudeAtCenter(){if(!this._contentAltitudeAtCenterDirty)return this._contentAltitudeAtCenter;this._contentAltitudeAtCenterDirty=!1;const e=this._centerRay;return null==e||(this.view.sceneIntersectionHelper.intersectRay(e,this._contentIntersector,U,E)?this._contentAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(U):this._contentAltitudeAtCenter=this._estimateSurfaceAltitudeAtCenter()),this._contentAltitudeAtCenter}_estimateSurfaceAltitudeAtCenter(){const{view:e}=this,{groundAndIMSurface:t}=e;if(!t)return 0;if(!this._surfaceAltitudeAtCenterDirty)return this._surfaceAltitudeAtCenter;this._surfaceAltitudeAtCenterDirty=!1;const r=this._centerRay;if(null==r)return this._surfaceAltitudeAtCenter;const n=r.origin,s=u(U,r.origin,r.direction);return this._surfaceIntersector.resetWithRay(r,e.state.contentCamera),t.intersect(this._surfaceIntersector,null,n,s),this._surfaceIntersector.results.min.getIntersectionPoint(U)&&(this._surfaceAltitudeAtCenter=e.renderCoordsHelper.getAltitude(U)),this._surfaceAltitudeAtCenter}_estimateSurfaceIntersectionAtRenderPoint(e,t,r){const n=C(t,e,j);if(null==n)return null;const s=n.origin,i=u(U,n.origin,n.direction);return this._surfaceIntersector.resetWithRay(n,t),this.view.groundAndIMSurface.intersect(this._surfaceIntersector,null,s,i),this._surfaceIntersector.results.min.getIntersectionPoint(r)?r:null}_cameraChanged(e){this._updateAllPointsOfInterest();const t=e.eye;d(this.renderPointOfView,t)||this._set("renderPointOfView",h(this._propertiesPool.get("renderPointOfView"),t))}_updateAllPointsOfInterest(){this._invalidateCenterEstimates();for(const e of this._pois)e.updateRenderLocation()}_updateGeometryPointsOfInterest(){this._invalidateCenterEstimates();for(const e of this._geometryPois)e.updateRenderLocation()}_invalidateCenterEstimates(){this._centerRayDirty=!0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenterDirty=!0}_updateCenterOnContent(){this._contentAltitudeAtCenterDirty=!0,this.centerOnContent.updateRenderLocation()}_setDebug(e){if(!e)return this._debugCenters?.forEach(e=>e.hide()),void this.removeHandles("debug");if(!this._debugCenters){this._debugCenters=new Map;const e=this.view.graphics;this._debugCenters.set(this.centerOnContent,new m(e,"red","CenterOnContent")),this._debugCenters.set(this.centerOnSurfaceFrequent,new m(e,"red","CenterOnSurface")),this._debugCenters.set(this.centerOnSurfaceInfrequent,new m(e,"red","CenterOnSurface")),this._debugCenters.set(this.cameraOnSurface,new m(e,"blue","CameraOnSurface")),this._debugCenters.set(this.focus,new m(e,"green","Focus"))}for(const t of this._pois)this.addHandles(this._updatingHandles.add(()=>t.renderLocation,e=>this._debugCenters?.get(t)?.show(e,t.renderCoordsHelper.spatialReference),s),"debug")}get test(){}};e([a()],b.prototype,"centerOnContent",void 0),e([a()],b.prototype,"centerOnSurfaceFrequent",void 0),e([a()],b.prototype,"centerOnSurfaceInfrequent",void 0),e([a()],b.prototype,"cameraOnSurface",void 0),e([a()],b.prototype,"focus",void 0),e([a()],b.prototype,"renderPointOfView",void 0),e([a()],b.prototype,"surfaceOrigin",void 0),e([a()],b.prototype,"contentGeometryUpdates",void 0),e([a()],b.prototype,"surfaceGeometryUpdates",void 0),e([a({constructOnly:!0})],b.prototype,"view",void 0),e([a()],b.prototype,"updating",null),b=e([c("esri.views.3d.support.pointsOfInterest.PointsOfInterest")],b);const U=f(),j=_(),E={exclude:new Set([v])};export{b as PointsOfInterest};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{cyclicalPI as r}from"../../../core/Cyclical.js";import"../../../core/has.js";import{clamp as i,deg2rad as s}from"../../../core/mathUtils.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{watch as a,sync as o,when as l}from"../../../core/reactiveUtils.js";import{property as h,subclass as d}from"../../../core/accessorSupport/decorators.js";import{subtract as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{add as u,subtract as p,copy as m,distance as g}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transformMat4 as _,scale as v,add as f}from"../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as w,create as x}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as R}from"../../../geometry/ellipsoidUtils.js";import{projectVectorToVector as S}from"../../../geometry/projection/projectVectorToVector.js";import{create as P,width as O,center as D,copy as T,intersection as M,contains as b,offset as j}from"../../../geometry/support/aaBoundingRect.js";import{createSpatialReferenceCyclical as I}from"../../../geometry/support/normalizeUtils.js";import{create as E,wrap as U}from"../../../geometry/support/ray.js";import{Sphere as V}from"../../../geometry/support/sphere.js";import{angleAroundAxis as C}from"../../../geometry/support/vector.js";import{y2lat as q}from"../../../geometry/support/webMercatorUtils.js";import{viewAngle as A}from"../state/utils/viewUtils.js";import{debugFlags as F}from"../support/debugFlags.js";import{DebugPoint as H}from"../support/debugUtils.js";import{OverlayRenderer as z}from"./OverlayRenderer.js";import{Intersector as G}from"../webgl-engine/lib/Intersector.js";import{fromValues as L}from"../webgl-engine/lib/LocalOriginFactory.js";import{SortedRenderGeometryRenderer as B}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{applyTextureResizeModulo as W,ensureTextureSize as Y}from"../webgl-engine/lib/textureUtils.js";import{removeLoadedShaderModules as k}from"../webgl-engine/parts/renderUtils.js";import{TaskPriority as N,noBudget as X}from"../../support/Scheduler.js";import{Yield as Z}from"../../support/Yield.js";const J=1.3,K=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]];let Q,$=class extends t{constructor(e){super(e),this._renderSR=null,this._overlaySREqualsRenderSR=!0,this._drapeSources=new Set,this._drapeTargets=new Set,this._placementDirty=!1,this._contentUpdated=!1,this._drawTexturesDirty=!1,this._drawTexturesAnimateDirty=!1,this._latestOriginId=0,this.groundView=e.view.groundView}initialize(){const{view:e}=this;this.renderer=new z({parent:this}),e.stage.renderer.plugins.add(this.renderer);const t=()=>this.requestRender();this._groundIntersector=new G(e.state.viewingMode),this._groundIntersector.options.backfacesTerrain=!0,this._groundIntersector.options.invisibleTerrain=!0,this._groundIntersector.options.hud=!1,this.addHandles([a(()=>this.renderer.hasHighlights,t),this.renderer.events.on("has-water",()=>e.stage?.renderer.updateHasFlags()),this.renderer.events.on("content-changed",t),a(()=>e.state.camera.pixelRatio,t),a(()=>e.state.alignPixelEnabled,t),this.renderer.events.on("textures-disposed",()=>this.groundView.requestRender(1)),a(()=>[e.pointsOfInterest?.renderPointOfView,e.pointsOfInterest?.centerOnSurfaceFrequent?.location],()=>this.setPlacementDirty()),a(()=>[e.state?.pixelRatio,e.state?.contentPixelRatio],()=>this.setPlacementDirty(),o),l(()=>this.groundView,e=>e.on("elevation-change",()=>this.setPlacementDirty())),e.on("resize",()=>this.setPlacementDirty()),e.resourceController.scheduler.registerTask(N.OVERLAY,this)]),e.stage.renderer.overlay=this}destroy(){this.view?.stage&&(this.view.stage.renderer.plugins.remove(this.renderer),this.view.stage.renderer.overlay=null,n(this.renderer)),Q&&(Q.hide(),Q=null),this.renderer=null}get spatialReference(){return this._spatialReference}set spatialReference(e){this._spatialReference=e,this.renderer.longitudeCyclical=null;const t=this.view.renderSpatialReference;null!=e&&null!=t?(this._renderSR=t,this._overlaySREqualsRenderSR=e.equals(this._renderSR),this._isSpherical&&(this.renderer.longitudeCyclical=I(e))):this.renderer.disposeOverlays()}get readyToRun(){return this._placementDirty&&(this._drapeSources.size>0||this.view.graphics.length>0||F.OVERLAY_DRAW_DEBUG_TEXTURE)&&!!this._spatialReference&&!(this.terrainSurface.enabled&&this.terrainSurface.freeze)&&this.groundView.ready}get _isSpherical(){return this.view.state.isGlobal}get worldToPCSRatio(){return null!=this._spatialReference&&this._spatialReference.isGeographic&&!this.view.state.isLocal?R(this._spatialReference).metersPerDegree:1}get _overlayStretch(){return J/this.view.resolutionScale}get longitudeCyclical(){return this.renderer.longitudeCyclical}get updating(){return this.readyToRun||!!this.renderer?.updating||this._contentUpdated}render(e){return this._contentUpdated=!1,this.renderer.time=e,this.renderer.processSyncDrapeSources(),this.renderer.precompileShaders(this.view.state)?this._drawOverlays():null}get hasOverlays(){return this.renderer.hasOverlays}registerDrapeSource(e,t){this._drapeSources.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources),this.renderer.registerDrapeSource(e,t),this._updateDrapeSourceExtent(e),this._setContentDirty(),this.notifyChange("readyToRun")}registerGeometryDrapeSource(e){const t=new B({stage:this.view.stage,drapeSource:e,rendererContext:this.renderer});return this.registerDrapeSource(e,t),t}_updateDrapeSourceExtent(e){2===this.renderer.overlays.length&&null!=e.setDrapingExtent&&null!=this._spatialReference&&e.setDrapingExtent(this.renderer.overlays,this._spatialReference)}unregisterDrapeSource(e){this._drapeSources.has(e)&&(this._drapeSources.delete(e),this.renderer.removeDrapeSourceRenderer(e),this.renderer.ensureDrapeSources(this._drapeSources),this._setContentDirty(),this.notifyChange("readyToRun"))}registerDrapeTarget(e){this._drapeTargets.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources)}unregisterDrapeTarget(e){this._drapeTargets.delete(e),this.renderer.ensureDrapeTargets(this._drapeTargets)}_setContentDirty(){this.setPlacementDirty(),this.requestRender()}setPlacementDirty(){this._placementDirty=!0}runTask(e){return this.updateOverlays(e,this.view.state.contentCamera,1)}updateOverlays(e,t,r){if(!this._spatialReference)return Z;if(!this.view.pointsOfInterest?.centerOnSurfaceFrequent)return Z;const i=this._computeOverlayHeight(t);this._computeOverlayExtents(t,i,se),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources,se.stretch);const s=this._updateOverlay(0,se.inner,i,1*se.pixelRatioAdjustment,se.mapUnitsPerPixel),n=O(se.inner)/O(se.outer),a=this._updateOverlay(1,se.outer,i,n*se.pixelRatioAdjustment,se.mapUnitsPerPixel);1!==s&&1!==a||(this._drapeSources.forEach(e=>this._updateDrapeSourceExtent(e)),this.groundView.updateOverlayParameters(),this.groundView.requestRender(r)),0===s&&0===a||this.requestRender(),this._placementDirty=!1,e.madeProgress()}_computeOverlayHeight(e){const t=this.view.state.contentPixelRatio*this.view.resolutionScale,r=e.fullWidth/e.pixelRatio*t,i=e.fullHeight/e.pixelRatio*t,s=Math.ceil(1.5*Math.max(r,i)),{maxPreferredTexturePixels:n,maxTextureSize:a}=this.view.stage.renderView.renderingContext.parameters,o=.5*a;return W(Y({width:s,height:s},{maxPreferredTexturePixels:2*n,maxTextureSize:o})[1],o)}get overlays(){return this.renderer.overlays}_updateOverlay(e,t,r,i,s){if(0===this.renderer.overlays.length)return 0;const n=this.renderer.overlays[e],a=n.mapUnitsPerPixel;if(n.mapUnitsPerPixel=s,n.pixelRatio=i,ee(t,n.extent)&&r===n.resolution)return a===s?0:2;n.setExtent(t),n.resolution=r;const o=D(n.extent);return n.renderLocalOrigin=L(o[0],o[1],0,"OV_"+this._latestOriginId++),1}overlayPixelSizeInMapUnits(e,t){if(0===this.renderer.overlays.length)return t();const r=this.renderer.overlays[0],i=this.renderer.overlays[1],s=this._pointIsInExtent(e,r.extent)?r:i;return(s.extent[2]-s.extent[0])/s.resolution}reloadShaders(){k(),this.requestRender(),this.runTask(X)}requestRender(e=1){this.renderer.hasOverlays?(1===e?(this._contentUpdated=!0,this._drawTexturesDirty=!0):this._drawTexturesAnimateDirty=!0,this.view.stage.renderView.requestRender(e)):this.setPlacementDirty()}_intersectGroundFromView(e,t,r,i,s){const n=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(e,oe,t,r);if(null==n)return!1;const a=n.origin,o=u(ie,n.origin,n.direction);this._groundIntersector.reset(a,o,e),this._groundIntersector.intersect([]),this.view.groundView.intersect(this._groundIntersector,null,a,o);const l=this._groundIntersector.results.min;return l.getIntersectionPoint(s)&&l.withinDistance(i)}_findHorizonBasedPointOfInterest(e,t){let s=.5;const n=.55,a=this.view.renderCoordsHelper.getAltitude(e.eye),o=this.view.pointsOfInterest.centerOnSurfaceFrequent,l=1e-5,h=i(o.estimatedSurfaceAltitude,e.aboveGround?-1/0:a+l,e.aboveGround?a-l:1/0),d=e.aboveGround;if("global"===this.view.viewingMode){const t=ie;le.radius=R(this.view.spatialReference).radius+h,le.closestPointOnSilhouette(U(e.eye,e.viewForward),t),p(t,t,e.eye);const i=r.normalize(C(e.viewForward,t,e.viewRight))/e.fovY+.5,a=i<=0||i>=1?.5:n;s=d?a*i:i+a*(1-i)}else{const t=.5*Math.PI-Math.acos(-e.viewForward[2]),r=Math.tan(t),a=w(0,r,1,0),o=_(a,a,e.projectionMatrix)[1],l=i(.5+.5*o,0,1);s=1===l||0===l?.5:d?l*n:1-(1-l)*n}return this._intersectGroundFromView(e,.5,s,o.distance,t)}_computeOverlayExtents(e,t,r){const{view:i}=this,n=i.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,a=y();this._findHorizonBasedPointOfInterest(e,a)||m(a,n);const o=this._renderSR;F.OVERLAY_SHOW_CENTER?(null==Q&&(Q=new H(i.graphics,"red")),Q.show(a,o)):null!=Q&&Q.hide();const l=Math.max(.1,g(e.eye,a)),h=A(i.renderCoordsHelper,n,e.eye),d=this._spatialReference;this._overlaySREqualsRenderSR||S(a,o,a,d);const u=this._isSpherical,p=this.groundView.groundExtent,_=!u&&d?.isGeographic,w=_&&d?1/R(d).metersPerDegree:1,x=i.state.contentPixelRatio,P=e.perScreenPixelRatio/x*l*w;r.mapUnitsPerPixel=P/this.worldToPCSRatio,r.stretch=this._overlayStretch;let D=t*P/2*r.stretch,j=!1,I=_?90:1/0;u&&p&&d&&(d.isWebMercator?(D/=Math.cos(q(a[1])),I=p[3]):(j=!0,D/=R(d).metersPerDegree,I=90),D>=I&&(D=I,a[1]=0,d.isWebMercator&&(a[0]=0)));let E=1;j&&(E=1/Math.max(.2,Math.cos(Math.abs(s(a[1])))),D*E>180&&(E=180/D),r.mapUnitsPerPixel*=E);const U=Math.log(2)/12;D=Math.exp(Math.round(Math.log(D)/U)*U);const V=D*E,C=32,z=.5*t/(C*V),G=.5*t/(C*D);a[0]=Math.round(a[0]*z)/z,a[1]=Math.round(a[1]*G)/G;const L=r.inner;L[0]=a[0]-V,L[1]=a[1]-D,L[2]=a[0]+V,L[3]=a[1]+D,u&&this._shiftExtentToFitBounds(L,1/0,I);const B=r.outer;if(p&&6*V>O(p))T(B,p);else{if(Math.PI/2-Math.abs(h-Math.PI/2)<=.25*Math.PI)B[0]=L[0]-V,B[1]=L[1]-D,B[2]=L[2]+V,B[3]=L[3]+D;else{S(e.eye,o,ie,d),c(re,a,ie);let t=-Math.atan2(re[1],re[0])+.125*Math.PI;t<0&&(t+=2*Math.PI);const r=Math.floor(t/(.25*Math.PI));v(re,K[r],2*D),re[0]*=E,re[2]*=E,f(B,L,re)}}if(u&&this.longitudeCyclical)B[0]=this.longitudeCyclical.clamp(B[0]),B[2]=this.longitudeCyclical.clamp(B[2]),B[1]=Math.max(B[1],-I),B[3]=Math.min(B[3],I);else{const e=M(L,p,ne),t=M(B,p,ae);b(e,t)&&(B[2]=B[0],B[3]=B[1])}const W=Math.abs(L[2]-L[0])/t;r.mapUnitsPerPixel=Math.max(r.mapUnitsPerPixel,W),r.pixelRatioAdjustment=r.mapUnitsPerPixel/W}_drawOverlays(e=this.view.state){if(!this._drawTexturesDirty&&!this._drawTexturesAnimateDirty)return this.renderer;const t=!this._drawTexturesDirty&&this._drawTexturesAnimateDirty?0:1;this._drawTexturesDirty=this._drawTexturesAnimateDirty=!1;const r=this.renderer.computeValidity();this.renderer.releaseRenderTargets(t),this.renderer.drawOverlays(e,t);return r!==this.renderer.computeValidity()&&(this.groundView.updateOverlayParameters(),this.groundView.requestRender(1)),this.groundView.requestRender(t),1===t&&this.terrainSurface.requestUpdate(),this.renderer}_pointIsInExtent(e,t){if(this.longitudeCyclical)return this.longitudeCyclical.contains(t[0],t[2],e.x)&&e.y>=t[1]&&e.y<=t[3];const r=e.x,i=e.y;return r>t[0]&&r<t[2]&&i>t[1]&&i<t[3]}_shiftExtentToFitBounds(e,t,r){let i=0,s=0;e[0]<-t?i=e[0]+t:e[2]>t&&(i=t-e[2]),e[1]<-r?s=e[1]+r:e[3]>r&&(s=r-e[3]),j(e,i,s)}get test(){}};function ee(e,t){const r=1e-5,i=F.ENABLE_OPTIMIZATIONS?r*Math.max(e[2]-e[0],e[3]-e[1],t[2]-t[0],t[3]-t[1]):0;return Math.abs(t[0]-e[0])<=i&&Math.abs(t[1]-e[1])<=i&&Math.abs(t[2]-e[2])<=i&&Math.abs(t[3]-e[3])<=i}e([h()],$.prototype,"_spatialReference",void 0),e([h({readOnly:!0})],$.prototype,"readyToRun",null),e([h()],$.prototype,"_placementDirty",void 0),e([h()],$.prototype,"_contentUpdated",void 0),e([h()],$.prototype,"_isSpherical",null),e([h()],$.prototype,"worldToPCSRatio",null),e([h()],$.prototype,"renderer",void 0),e([h({constructOnly:!0})],$.prototype,"view",void 0),e([h({constructOnly:!0})],$.prototype,"groundView",void 0),e([h({constructOnly:!0})],$.prototype,"terrainSurface",void 0),e([h()],$.prototype,"updating",null),$=e([d("esri.views.3d.terrain.OverlayManager")],$);class te{constructor(){this.inner=P(),this.outer=P(),this.mapUnitsPerPixel=0,this.pixelRatioAdjustment=1,this.stretch=J}}const re=x(),ie=y(),se=new te,ne=P(),ae=P(),oe=E(),le=new V;export{$ as OverlayManager};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{cyclicalPI as r}from"../../../core/Cyclical.js";import"../../../core/has.js";import{clamp as i,deg2rad as s}from"../../../core/mathUtils.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{watch as a,sync as o,when as l}from"../../../core/reactiveUtils.js";import{property as h,subclass as d}from"../../../core/accessorSupport/decorators.js";import{subtract as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{add as u,subtract as p,copy as m,distance as g}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transformMat4 as _,scale as f,add as v}from"../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as w,create as x}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as R}from"../../../geometry/ellipsoidUtils.js";import{projectVectorToVector as S}from"../../../geometry/projection/projectVectorToVector.js";import{create as P,width as O,center as D,copy as T,intersection as M,contains as b,offset as j}from"../../../geometry/support/aaBoundingRect.js";import{createSpatialReferenceCyclical as I}from"../../../geometry/support/normalizeUtils.js";import{create as E,wrap as U}from"../../../geometry/support/ray.js";import{Sphere as C}from"../../../geometry/support/sphere.js";import{angleAroundAxis as V}from"../../../geometry/support/vector.js";import{y2lat as A}from"../../../geometry/support/webMercatorUtils.js";import{viewAngle as q}from"../state/utils/viewUtils.js";import{debugFlags as F}from"../support/debugFlags.js";import{DebugPoint as H}from"../support/debugUtils.js";import{OverlayRenderer as z}from"./OverlayRenderer.js";import{Intersector as G}from"../webgl-engine/lib/Intersector.js";import{fromValues as L}from"../webgl-engine/lib/LocalOriginFactory.js";import{SortedRenderGeometryRenderer as B}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{applyTextureResizeModulo as W,ensureTextureSize as Y}from"../webgl-engine/lib/textureUtils.js";import{removeLoadedShaderModules as k}from"../webgl-engine/parts/renderUtils.js";import{TaskPriority as N,noBudget as X}from"../../support/Scheduler.js";import{Yield as Z}from"../../support/Yield.js";const J=1.3,K=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]];let Q,$=class extends t{constructor(e){super(e),this._renderSR=null,this._overlaySREqualsRenderSR=!0,this._drapeSources=new Set,this._drapeTargets=new Set,this._placementDirty=!1,this._contentUpdated=!1,this._drawTexturesDirty=!1,this._drawTexturesAnimateDirty=!1,this._latestOriginId=0,this.groundView=e.view.groundView}initialize(){const{view:e}=this;this.renderer=new z({parent:this}),e.stage.renderer.plugins.add(this.renderer);const t=()=>this.requestRender();this._groundIntersector=new G(e.state.viewingMode),this._groundIntersector.options.backfacesTerrain=!0,this._groundIntersector.options.invisibleTerrain=!0,this._groundIntersector.options.hud=!1,this.addHandles([a(()=>this.renderer.hasHighlights,t),this.renderer.events.on("has-water",()=>e.stage?.renderer.updateHasFlags()),this.renderer.events.on("content-changed",t),a(()=>e.state.camera.pixelRatio,t),a(()=>e.state.alignPixelEnabled,t),this.renderer.events.on("textures-disposed",()=>this.groundView.requestRender(1)),a(()=>[e.pointsOfInterest?.renderPointOfView,e.pointsOfInterest?.centerOnSurfaceFrequent?.location],()=>this.setPlacementDirty()),a(()=>[e.state?.pixelRatio,e.state?.contentPixelRatio],()=>this.setPlacementDirty(),o),l(()=>e.groundAndIMSurface,e=>e.on("elevation-change",()=>this.setPlacementDirty())),e.on("resize",()=>this.setPlacementDirty()),e.resourceController.scheduler.registerTask(N.OVERLAY,this)]),e.stage.renderer.overlay=this}destroy(){this.view?.stage&&(this.view.stage.renderer.plugins.remove(this.renderer),this.view.stage.renderer.overlay=null,n(this.renderer)),Q&&(Q.hide(),Q=null),this.renderer=null}get spatialReference(){return this._spatialReference}set spatialReference(e){this._spatialReference=e,this.renderer.longitudeCyclical=null;const t=this.view.renderSpatialReference;null!=e&&null!=t?(this._renderSR=t,this._overlaySREqualsRenderSR=e.equals(this._renderSR),this._isSpherical&&(this.renderer.longitudeCyclical=I(e))):this.renderer.disposeOverlays()}get readyToRun(){return this._placementDirty&&(this._drapeSources.size>0||this.view.graphics.length>0||F.OVERLAY_DRAW_DEBUG_TEXTURE)&&!!this._spatialReference&&!(this.terrainSurface.enabled&&this.terrainSurface.freeze)&&this.groundView.ready}get _isSpherical(){return this.view.state.isGlobal}get worldToPCSRatio(){return null!=this._spatialReference&&this._spatialReference.isGeographic&&!this.view.state.isLocal?R(this._spatialReference).metersPerDegree:1}get _overlayStretch(){return J/this.view.resolutionScale}get longitudeCyclical(){return this.renderer.longitudeCyclical}get updating(){return this.readyToRun||!!this.renderer?.updating||this._contentUpdated}render(e){return this._contentUpdated=!1,this.renderer.time=e,this.renderer.processSyncDrapeSources(),this.renderer.precompileShaders(this.view.state)?this._drawOverlays():null}get hasOverlays(){return this.renderer.hasOverlays}registerDrapeSource(e,t){this._drapeSources.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources),this.renderer.registerDrapeSource(e,t),this._updateDrapeSourceExtent(e),this._setContentDirty(),this.notifyChange("readyToRun")}registerGeometryDrapeSource(e){const t=new B({stage:this.view.stage,drapeSource:e,rendererContext:this.renderer});return this.registerDrapeSource(e,t),t}_updateDrapeSourceExtent(e){2===this.renderer.overlays.length&&null!=e.setDrapingExtent&&null!=this._spatialReference&&e.setDrapingExtent(this.renderer.overlays,this._spatialReference)}unregisterDrapeSource(e){this._drapeSources.has(e)&&(this._drapeSources.delete(e),this.renderer.removeDrapeSourceRenderer(e),this.renderer.ensureDrapeSources(this._drapeSources),this._setContentDirty(),this.notifyChange("readyToRun"))}registerDrapeTarget(e){this._drapeTargets.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources)}unregisterDrapeTarget(e){this._drapeTargets.delete(e),this.renderer.ensureDrapeTargets(this._drapeTargets)}_setContentDirty(){this.setPlacementDirty(),this.requestRender()}setPlacementDirty(){this._placementDirty=!0}runTask(e){return this.updateOverlays(e,this.view.state.contentCamera,1)}updateOverlays(e,t,r){if(!this._spatialReference)return Z;if(!this.view.pointsOfInterest?.centerOnSurfaceFrequent)return Z;const i=this._computeOverlayHeight(t);this._computeOverlayExtents(t,i,se),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources,se.stretch);const s=this._updateOverlay(0,se.inner,i,1*se.pixelRatioAdjustment,se.mapUnitsPerPixel),n=O(se.inner)/O(se.outer),a=this._updateOverlay(1,se.outer,i,n*se.pixelRatioAdjustment,se.mapUnitsPerPixel);1!==s&&1!==a||(this._drapeSources.forEach(e=>this._updateDrapeSourceExtent(e)),this.groundView.updateOverlayParameters(),this.groundView.requestRender(r)),0===s&&0===a||this.requestRender(),this._placementDirty=!1,e.madeProgress()}_computeOverlayHeight(e){const t=this.view.state.contentPixelRatio*this.view.resolutionScale,r=e.fullWidth/e.pixelRatio*t,i=e.fullHeight/e.pixelRatio*t,s=Math.ceil(1.5*Math.max(r,i)),{maxPreferredTexturePixels:n,maxTextureSize:a}=this.view.stage.renderView.renderingContext.parameters,o=.5*a;return W(Y({width:s,height:s},{maxPreferredTexturePixels:2*n,maxTextureSize:o})[1],o)}get overlays(){return this.renderer.overlays}_updateOverlay(e,t,r,i,s){if(0===this.renderer.overlays.length)return 0;const n=this.renderer.overlays[e],a=n.mapUnitsPerPixel;if(n.mapUnitsPerPixel=s,n.pixelRatio=i,ee(t,n.extent)&&r===n.resolution)return a===s?0:2;n.setExtent(t),n.resolution=r;const o=D(n.extent);return n.renderLocalOrigin=L(o[0],o[1],0,"OV_"+this._latestOriginId++),1}overlayPixelSizeInMapUnits(e,t){if(0===this.renderer.overlays.length)return t();const r=this.renderer.overlays[0],i=this.renderer.overlays[1],s=this._pointIsInExtent(e,r.extent)?r:i;return(s.extent[2]-s.extent[0])/s.resolution}reloadShaders(){k(),this.requestRender(),this.runTask(X)}requestRender(e=1){this.renderer.hasOverlays?(1===e?(this._contentUpdated=!0,this._drawTexturesDirty=!0):this._drawTexturesAnimateDirty=!0,this.view.stage.renderView.requestRender(e)):this.setPlacementDirty()}_intersectGroundFromView(e,t,r,i,s){const n=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(e,oe,t,r);if(null==n)return!1;const a=n.origin,o=u(ie,n.origin,n.direction);this._groundIntersector.reset(a,o,e),this._groundIntersector.intersect([]),this.view.groundAndIMSurface.intersect(this._groundIntersector,null,a,o);const l=this._groundIntersector.results.min;return l.getIntersectionPoint(s)&&l.withinDistance(i)}_findHorizonBasedPointOfInterest(e,t){let s=.5;const n=.55,a=this.view.renderCoordsHelper.getAltitude(e.eye),o=this.view.pointsOfInterest.centerOnSurfaceFrequent,l=1e-5,h=i(o.estimatedSurfaceAltitude,e.aboveGround?-1/0:a+l,e.aboveGround?a-l:1/0),d=e.aboveGround;if("global"===this.view.viewingMode){const t=ie;le.radius=R(this.view.spatialReference).radius+h,le.closestPointOnSilhouette(U(e.eye,e.viewForward),t),p(t,t,e.eye);const i=r.normalize(V(e.viewForward,t,e.viewRight))/e.fovY+.5,a=i<=0||i>=1?.5:n;s=d?a*i:i+a*(1-i)}else{const t=.5*Math.PI-Math.acos(-e.viewForward[2]),r=Math.tan(t),a=w(0,r,1,0),o=_(a,a,e.projectionMatrix)[1],l=i(.5+.5*o,0,1);s=1===l||0===l?.5:d?l*n:1-(1-l)*n}return this._intersectGroundFromView(e,.5,s,o.distance,t)}_computeOverlayExtents(e,t,r){const{view:i}=this,n=i.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,a=y();this._findHorizonBasedPointOfInterest(e,a)||m(a,n);const o=this._renderSR;F.OVERLAY_SHOW_CENTER?(null==Q&&(Q=new H(i.graphics,"red")),Q.show(a,o)):null!=Q&&Q.hide();const l=Math.max(.1,g(e.eye,a)),h=q(i.renderCoordsHelper,n,e.eye),d=this._spatialReference;this._overlaySREqualsRenderSR||S(a,o,a,d);const u=this._isSpherical,p=this.groundView.groundExtent,_=!u&&d?.isGeographic,w=_&&d?1/R(d).metersPerDegree:1,x=i.state.contentPixelRatio,P=e.perScreenPixelRatio/x*l*w;r.mapUnitsPerPixel=P/this.worldToPCSRatio,r.stretch=this._overlayStretch;let D=t*P/2*r.stretch,j=!1,I=_?90:1/0;u&&p&&d&&(d.isWebMercator?(D/=Math.cos(A(a[1])),I=p[3]):(j=!0,D/=R(d).metersPerDegree,I=90),D>=I&&(D=I,a[1]=0,d.isWebMercator&&(a[0]=0)));let E=1;j&&(E=1/Math.max(.2,Math.cos(Math.abs(s(a[1])))),D*E>180&&(E=180/D),r.mapUnitsPerPixel*=E);const U=Math.log(2)/12;D=Math.exp(Math.round(Math.log(D)/U)*U);const C=D*E,V=32,z=.5*t/(V*C),G=.5*t/(V*D);a[0]=Math.round(a[0]*z)/z,a[1]=Math.round(a[1]*G)/G;const L=r.inner;L[0]=a[0]-C,L[1]=a[1]-D,L[2]=a[0]+C,L[3]=a[1]+D,u&&this._shiftExtentToFitBounds(L,1/0,I);const B=r.outer;if(p&&6*C>O(p))T(B,p);else{if(Math.PI/2-Math.abs(h-Math.PI/2)<=.25*Math.PI)B[0]=L[0]-C,B[1]=L[1]-D,B[2]=L[2]+C,B[3]=L[3]+D;else{S(e.eye,o,ie,d),c(re,a,ie);let t=-Math.atan2(re[1],re[0])+.125*Math.PI;t<0&&(t+=2*Math.PI);const r=Math.floor(t/(.25*Math.PI));f(re,K[r],2*D),re[0]*=E,re[2]*=E,v(B,L,re)}}if(u&&this.longitudeCyclical)B[0]=this.longitudeCyclical.clamp(B[0]),B[2]=this.longitudeCyclical.clamp(B[2]),B[1]=Math.max(B[1],-I),B[3]=Math.min(B[3],I);else{const e=M(L,p,ne),t=M(B,p,ae);b(e,t)&&(B[2]=B[0],B[3]=B[1])}const W=Math.abs(L[2]-L[0])/t;r.mapUnitsPerPixel=Math.max(r.mapUnitsPerPixel,W),r.pixelRatioAdjustment=r.mapUnitsPerPixel/W}_drawOverlays(e=this.view.state){if(!this._drawTexturesDirty&&!this._drawTexturesAnimateDirty)return this.renderer;const t=!this._drawTexturesDirty&&this._drawTexturesAnimateDirty?0:1;this._drawTexturesDirty=this._drawTexturesAnimateDirty=!1;const r=this.renderer.computeValidity();this.renderer.releaseRenderTargets(t),this.renderer.drawOverlays(e,t);return r!==this.renderer.computeValidity()&&(this.groundView.updateOverlayParameters(),this.groundView.requestRender(1)),this.groundView.requestRender(t),1===t&&this.terrainSurface.requestUpdate(),this.renderer}_pointIsInExtent(e,t){if(this.longitudeCyclical)return this.longitudeCyclical.contains(t[0],t[2],e.x)&&e.y>=t[1]&&e.y<=t[3];const r=e.x,i=e.y;return r>t[0]&&r<t[2]&&i>t[1]&&i<t[3]}_shiftExtentToFitBounds(e,t,r){let i=0,s=0;e[0]<-t?i=e[0]+t:e[2]>t&&(i=t-e[2]),e[1]<-r?s=e[1]+r:e[3]>r&&(s=r-e[3]),j(e,i,s)}get test(){}};function ee(e,t){const r=1e-5,i=F.ENABLE_OPTIMIZATIONS?r*Math.max(e[2]-e[0],e[3]-e[1],t[2]-t[0],t[3]-t[1]):0;return Math.abs(t[0]-e[0])<=i&&Math.abs(t[1]-e[1])<=i&&Math.abs(t[2]-e[2])<=i&&Math.abs(t[3]-e[3])<=i}e([h()],$.prototype,"_spatialReference",void 0),e([h({readOnly:!0})],$.prototype,"readyToRun",null),e([h()],$.prototype,"_placementDirty",void 0),e([h()],$.prototype,"_contentUpdated",void 0),e([h()],$.prototype,"_isSpherical",null),e([h()],$.prototype,"worldToPCSRatio",null),e([h()],$.prototype,"renderer",void 0),e([h({constructOnly:!0})],$.prototype,"view",void 0),e([h({constructOnly:!0})],$.prototype,"groundView",void 0),e([h({constructOnly:!0})],$.prototype,"terrainSurface",void 0),e([h()],$.prototype,"updating",null),$=e([d("esri.views.3d.terrain.OverlayManager")],$);class te{constructor(){this.inner=P(),this.outer=P(),this.mapUnitsPerPixel=0,this.pixelRatioAdjustment=1,this.stretch=J}}const re=x(),ie=y(),se=new te,ne=P(),ae=P(),oe=E(),le=new C;export{$ as OverlayManager};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{removeUnordered as r}from"../../../core/arrayUtils.js";import{toConst as s}from"../../../core/compilerUtils.js";import"../../../core/has.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{isPromiseLike as n}from"../../../core/promiseUtils.js";import{signal as o}from"../../../core/signal.js";import{property as d,subclass as a}from"../../../core/accessorSupport/decorators.js";import{isIntersectionHandler as h}from"../state/helpers/SceneIntersectionHelper.js";import{debugFlags as l}from"../support/debugFlags.js";import{TextureCollection as c}from"../support/TextureCollection.js";import{ChangeSet as y}from"./lib/ChangeSet.js";import{Model as m}from"./parts/Model.js";import{RenderView as u}from"./parts/RenderView.js";import{TaskPriority as p,noBudget as _}from"../../support/Scheduler.js";import{Yield as g}from"../../support/Yield.js";let S=class extends t{constructor(e){super(e),this._model=new m,this._canCompact=o(!1),this._layers=new Array,this._asyncChangeSet=new y,this._syncChangeSet=new y,this._layerSyncSet=new Set,this._textures=new c(this,e.view.resourceController.scheduler),this._frameTask=e.view.resourceController.scheduler.registerTask(p.STAGE,this),this.addHandles(this._frameTask)}initialize(){try{this._renderView=new u({view:this.view},this)}catch(e){return void console.error("Failed to initialize render view",e)}}destroy(){this.removeAllHandles(),this._textures.destroy(),this._set("textures",null),this._renderView=i(this._renderView),this._set("renderView",null),this._layers.length=0,this._model=null,this._set("renderer",null),this.options.canvas=null,this._set("options",null)}get viewingMode(){return this.view.state.viewingMode}get updating(){if(this.destroyed||this.destroying)return!1;const e=this.readyToRun||this.renderView.updating||this._frameTask.updating||this.textures.updating;return e&&l.UPDATING&&console.log(" Stage:",this.readyToRun,this.renderView.updating,this._frameTask.updating,this.textures.updating),e}get renderView(){return this._renderView}get renderer(){return this.renderView?.renderer}get textures(){return this._textures}addTexture(e){this._model.addTexture(e),this.renderView.requestRender()}removeTexture(e){null!=e&&!this.destroyed&&this._model.hasTexture(e)&&(this._model.removeTexture(e),this.renderView.requestRender())}addTextures(e){null!=e&&(this._model.addTextures(e),this.renderView.requestRender())}removeTextures(e){null!=e&&(this._model?.removeTextures(e),this.renderView.requestRender())}forEachTexture(e){this._model.forEachTexture(e)}getTexture(e){return this._model.getTexture(e)}addLayer(e){this._layers.includes(e)||(this._model.addLayer(e),this._layers.push(e),this._model.dirtySet.layerAdded(e),this.renderView.requestRender())}removeLayer(e){null!=e&&!this.destroyed&&this._model.hasLayer(s(e))&&(this._model.dirtySet.layerRemoved(e),this.commitLayer(e),r(this._layers,e),this._model.dirtySet.assertLayerClean(e.id),this._model.removeLayer(e),this.renderView.requestRender())}getLayer(e){return this._model.getLayer(e)}handleEvent(e,t){this.destroyed||(this._model.dirtySet[e](t),this.renderView.requestRender())}get readyToRun(){return this._model.dirtySet.dirty||!this._asyncChangeSet.empty||this._canCompact.value}runTask(e){if(this._frameTask.processQueue(e),this._commit(e),this.renderer.compact(e),this._canCompact.value=this.renderer.canCompact,!e.hasProgressed)return g}compact(e){return this._canCompact.value=!1,this.renderer.compact(e)}_commit(e){const t=this._model.dirtySet;this._asyncChangeSet.empty||e.done||(this.renderer.commit(this._asyncChangeSet,e),this.renderView.requestRender(),e.madeProgress()),this._layers.forEach(r=>{if(e.done)return;const s=this._layerSyncSet.has(r.id)||1===r.updatePolicy,i=s?this._syncChangeSet:this._asyncChangeSet;t.commitLayer(r.id,i),this._layerSyncSet.delete(r.id),i.empty||(this.renderer.commit(i,s?_:e),this.renderView.requestRender(),e.madeProgress())}),this._syncChangeSet.empty||(this.renderer.commit(this._syncChangeSet,_),this.renderView.requestRender(),e.madeProgress()),this._layers.forEach(r=>{e.done||this._layerSyncSet.has(r.id)||0!==r.updatePolicy||(t.commitLayer(r.id,this._asyncChangeSet),this._asyncChangeSet.empty||(this.renderer.commit(this._asyncChangeSet,e),this.renderView.requestRender(),e.madeProgress()))}),this._layerSyncSet.clear(),this.notifyChange("readyToRun")}commitSyncLayers(){const e=this._model.dirtySet;this._layers.forEach(t=>{this._layerSyncSet.has(t.id)||1===t.updatePolicy?(e.commitLayer(t.id,this._syncChangeSet),this._layerSyncSet.delete(t.id)):e.commitSyncUpdates(t.id,this._syncChangeSet)});for(const t of this._layerSyncSet)e.commitLayer(t,this._syncChangeSet);this._layerSyncSet.clear(),this._syncChangeSet.empty||(this.renderer.commit(this._syncChangeSet,_),this.renderView.requestRender())}commitLayer(e){this._model.dirtySet.commitLayer(e.id,this._syncChangeSet),this._layerSyncSet.delete(e.id),this._syncChangeSet.empty||(this.renderer.commit(this._syncChangeSet,_),this.renderView.requestRender())}schedule(e,t){return this._frameTask.schedule(e,t)}reschedule(e,t){return this._frameTask.reschedule(e,t)}syncLayer(e){this._layerSyncSet.add(e),this.renderView.requestRender()}get layers(){return this._layers}addRenderPlugin(e,t){const r=this.renderer.plugins.add(e,t),s=()=>{h(e)&&this.view.sceneIntersectionHelper.addIntersectionHandler(e)};if(n(r))return r.then(s);s()}removeRenderPlugin(e){this.destroyed||(h(e)&&this.view.sceneIntersectionHelper.removeIntersectionHandler(e),this.renderer.plugins.remove(e))}get test(){}};e([d({constructOnly:!0})],S.prototype,"view",void 0),e([d({constructOnly:!0})],S.prototype,"options",void 0),e([d({constructOnly:!0})],S.prototype,"container",void 0),e([d({readOnly:!0})],S.prototype,"viewingMode",null),e([d({readOnly:!0})],S.prototype,"updating",null),e([d({readOnly:!0})],S.prototype,"renderView",null),e([d({readOnly:!0})],S.prototype,"renderer",null),e([d({readOnly:!0})],S.prototype,"textures",null),e([d({readOnly:!0})],S.prototype,"readyToRun",null),S=e([a("esri.views.3d.webgl-engine.Stage")],S);export{S as Stage};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{removeUnordered as r}from"../../../core/arrayUtils.js";import{toConst as s}from"../../../core/compilerUtils.js";import"../../../core/has.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{isPromiseLike as n}from"../../../core/promiseUtils.js";import{signal as o}from"../../../core/signal.js";import{property as d,subclass as a}from"../../../core/accessorSupport/decorators.js";import{isIntersectionHandler as h}from"../state/helpers/SceneIntersectionHelper.js";import{debugFlags as l}from"../support/debugFlags.js";import{TextureCollection as c}from"../support/TextureCollection.js";import{ChangeSet as m}from"./lib/ChangeSet.js";import{Model as y}from"./parts/Model.js";import{RenderView as u}from"./parts/RenderView.js";import{TaskPriority as p,noBudget as _}from"../../support/Scheduler.js";import{Yield as g}from"../../support/Yield.js";let S=class extends t{constructor(e){super(e),this._model=new y,this._canCompact=o(!1),this._layers=new Array,this._asyncChangeSet=new m,this._syncChangeSet=new m,this._layerSyncSet=new Set,this._textures=new c(this,e.view.resourceController.scheduler),this._frameTask=e.view.resourceController.scheduler.registerTask(p.STAGE,this),this.addHandles(this._frameTask)}initialize(){try{this._renderView=new u({view:this.view},this)}catch(e){return void console.error("Failed to initialize render view",e)}}destroy(){this.removeAllHandles(),this._textures.destroy(),this._set("textures",null),this._renderView=i(this._renderView),this._set("renderView",null),this._layers.length=0,this._model=null,this._set("renderer",null),this.options.canvas=null,this._set("options",null)}get viewingMode(){return this.view.state.viewingMode}get updating(){if(this.destroyed||this.destroying)return!1;const e=this.readyToRun||this.renderView.updating||this._frameTask.updating||this.textures.updating;return e&&l.UPDATING&&console.log(" Stage:",this.readyToRun,this.renderView.updating,this._frameTask.updating,this.textures.updating),e}get renderView(){return this._renderView}get renderer(){return this.renderView?.renderer}get textures(){return this._textures}addTexture(e){this._model.addTexture(e),this.renderView.requestRender()}removeTexture(e){null!=e&&!this.destroyed&&this._model.hasTexture(e)&&(this._model.removeTexture(e),this.renderView.requestRender())}addTextures(e){null!=e&&(this._model.addTextures(e),this.renderView.requestRender())}removeTextures(e){null!=e&&(this._model?.removeTextures(e),this.renderView.requestRender())}forEachTexture(e){this._model.forEachTexture(e)}getTexture(e){return this._model.getTexture(e)}addLayer(e){this._layers.includes(e)||(this._model.addLayer(e),this._layers.push(e),this._model.dirtySet.layerAdded(e),this.renderView.requestRender())}removeLayer(e){null!=e&&!this.destroyed&&this._model.hasLayer(s(e))&&(this._model.dirtySet.layerRemoved(e),this.commitLayer(e),r(this._layers,e),this._model.dirtySet.assertLayerClean(e.id),this._model.removeLayer(e),this.renderView.requestRender())}getLayer(e){return this._model.getLayer(e)}handleEvent(e,t){this.destroyed||(this._model.dirtySet[e](t),this.renderView.requestRender())}get readyToRun(){return this._model.dirtySet.dirty||!this._asyncChangeSet.empty||this._canCompact.value}runTask(e){if(this._frameTask.processQueue(e),this._commit(e),this.renderer.compact(e),this._canCompact.value=this.renderer.canCompact,!e.hasProgressed)return g}compact(e){return this._canCompact.value=!1,this.renderer.compact(e)}_commit(e){const t=this._model.dirtySet;this._asyncChangeSet.empty||e.done||(this.renderer.commit(this._asyncChangeSet,e),this.renderView.requestRender(),e.madeProgress()),this._layers.forEach(r=>{if(e.done)return;const s=this._layerSyncSet.has(r.id)||1===r.updatePolicy,i=s?this._syncChangeSet:this._asyncChangeSet;t.commitLayer(r.id,i),this._layerSyncSet.delete(r.id),i.empty||(this.renderer.commit(i,s?_:e),this.renderView.requestRender(),e.madeProgress())}),this._syncChangeSet.empty||(this.renderer.commit(this._syncChangeSet,_),this.renderView.requestRender(),e.madeProgress()),this._layers.forEach(r=>{e.done||this._layerSyncSet.has(r.id)||0!==r.updatePolicy||(t.commitLayer(r.id,this._asyncChangeSet),this._asyncChangeSet.empty||(this.renderer.commit(this._asyncChangeSet,e),this.renderView.requestRender(),e.madeProgress()))}),this._layerSyncSet.clear(),this.notifyChange("readyToRun")}commitSyncLayers(){const e=this._model.dirtySet;this._layers.forEach(t=>{this._layerSyncSet.has(t.id)||1===t.updatePolicy?(e.commitLayer(t.id,this._syncChangeSet),this._layerSyncSet.delete(t.id)):e.commitSyncUpdates(t.id,this._syncChangeSet)});for(const t of this._layerSyncSet)e.commitLayer(t,this._syncChangeSet);this._layerSyncSet.clear(),this._syncChangeSet.empty||(this.renderer.commit(this._syncChangeSet,_),this.renderView.requestRender())}commitLayer(e){this._model.dirtySet.commitLayer(e.id,this._syncChangeSet),this._layerSyncSet.delete(e.id),this._syncChangeSet.empty||(this.renderer.commit(this._syncChangeSet,_),this.renderView.requestRender())}schedule(e,t){return this._frameTask.schedule(e,t)}reschedule(e,t){return this._frameTask.reschedule(e,t)}scheduleGenerator(e,t){return this._frameTask.scheduleGenerator(e,t)}syncLayer(e){this._layerSyncSet.add(e),this.renderView.requestRender()}get layers(){return this._layers}addRenderPlugin(e,t){const r=this.renderer.plugins.add(e,t),s=()=>{h(e)&&this.view.sceneIntersectionHelper.addIntersectionHandler(e)};if(n(r))return r.then(s);s()}removeRenderPlugin(e){this.destroyed||(h(e)&&this.view.sceneIntersectionHelper.removeIntersectionHandler(e),this.renderer.plugins.remove(e))}get test(){}};e([d({constructOnly:!0})],S.prototype,"view",void 0),e([d({constructOnly:!0})],S.prototype,"options",void 0),e([d({constructOnly:!0})],S.prototype,"container",void 0),e([d({readOnly:!0})],S.prototype,"viewingMode",null),e([d({readOnly:!0})],S.prototype,"updating",null),e([d({readOnly:!0})],S.prototype,"renderView",null),e([d({readOnly:!0})],S.prototype,"renderer",null),e([d({readOnly:!0})],S.prototype,"textures",null),e([d({readOnly:!0})],S.prototype,"readyToRun",null),S=e([a("esri.views.3d.webgl-engine.Stage")],S);export{S as Stage};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderLibrary/shading/Gamma.glsl.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../shaders/ToneMapping.glsl.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{E as EmissionCompositePassParameters,b as build}from"../../../../chunks/EmissionComposite.glsl.js";
2
+ import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderLibrary/shading/Gamma.glsl.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../shaders/ToneMapping.glsl.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{E as EmissionCompositePassParameters,b as build}from"../../../../chunks/EmissionComposite.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{property as r,subclass as t}from"../../../../../core/accessorSupport/decorators.js";import{SyncRenderPlugin as s}from"../../effects/RenderPlugin.js";import{MergedBuffer as i}from"./MergedBuffer.js";import{VaoRenderer as a}from"./VaoRenderer.js";import"../../../../../core/mathUtils.js";import"../../../../webgl/enums.js";import"../../../../../core/Logger.js";import"../../../../webgl/Util.js";import"./BufferRange.js";import"./IndexLayout.js";import"../../../../webgl/BufferObject.js";let n=class extends s{constructor(e){super(e),this._dataByBaseInstance=new Map,this._buffer=null,this._renderer=null,this.drapedPriority=0}initialize(){this._buffer=new i({material:this.material,dataByBaseInstance:this._dataByBaseInstance,highlightOrderMap:this.highlightOrderMap}),this._renderer=new a({material:this.material,dataByBaseInstance:this._dataByBaseInstance})}destroy(){this._buffer.destroy(),this._renderer.destroy()}hasHighlight(e){return this._renderer.hasHighlight(e)}initializeRenderContext(e){this._buffer.initializeRenderContext(e),this._renderer.initializeRenderContext(e)}uninitializeRenderContext(){this._buffer.uninitializeRenderContext(),this._renderer.uninitializeRenderContext()}get produces(){return this._renderer.produces}get hasOccludees(){return this._buffer.hasOccludees}get hasOnlyOccluders(){return!!(-2&this.renderOccludedFlags)}get emissions(){return this.material.emissions}get isDecoration(){return this.material.parameters.isDecoration}get renderOccludedFlags(){return this.material.renderOccludedFlags}get testsTransparentRenderOrder(){return"test"===process.env.NODE_ENV?this.material.testsTransparentRenderOrder:0}get numGeometries(){let e=0;for(const r of this._dataByBaseInstance.values())for(const t of r.dataByOrigin.values())e+=t.buffers.reduce((e,r)=>e+r.instances.size,0);return e}get usedMemory(){let e=0;for(const r of this._dataByBaseInstance.values())for(const t of r.dataByOrigin.values())e+=t.buffers.reduce((e,r)=>e+r.vao.usedMemory,0);return e}forEachGeometry(e){for(const r of this._dataByBaseInstance.values())for(const t of r.dataByOrigin.values())for(const r of t.buffers)for(const{geometry:t}of r.instances.values())e(t)}modify(e,r){this._buffer.modify(e,r),this._renderer.updateHighlights()}get canCompact(){return this._buffer.canCompact}compact(e){return this._buffer.compact(e)}updateHighlights(e){this.highlightOrderMap=e,this._buffer.updateHighlights(e),this._renderer.updateHighlights()}updateAnimation(e){return this.material.update(e)}acquireTechniques(e){return this._renderer.acquireTechniques(e)}render(e,r){return this._renderer.render(e,r)}static prune(){i.prune()}get test(){}};e([r({constructOnly:!0})],n.prototype,"material",void 0),e([r()],n.prototype,"highlightOrderMap",void 0),n=e([t("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],n);export{n as MergedRenderer};
2
+ import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{property as r,subclass as t}from"../../../../../core/accessorSupport/decorators.js";import{SyncRenderPlugin as s}from"../../effects/RenderPlugin.js";import{MergedBuffer as i}from"./MergedBuffer.js";import{VaoRenderer as n}from"./VaoRenderer.js";import"../../../../../core/mathUtils.js";import"../../../../webgl/enums.js";import"../../../../../core/Logger.js";import"../../../../webgl/Util.js";import"./BufferRange.js";import"./IndexLayout.js";import"../../../../webgl/BufferObject.js";let a=class extends s{constructor(e){super(e),this._dataByBaseInstance=new Map,this._buffer=null,this._renderer=null,this.drapedPriority=0}initialize(){this._buffer=new i({material:this.material,dataByBaseInstance:this._dataByBaseInstance,highlightOrderMap:this.highlightOrderMap}),this._renderer=new n({material:this.material,dataByBaseInstance:this._dataByBaseInstance})}destroy(){this._buffer.destroy(),this._renderer.destroy()}hasHighlight(e){return this._renderer.hasHighlight(e)}initializeRenderContext(e){this._buffer.initializeRenderContext(e),this._renderer.initializeRenderContext(e)}uninitializeRenderContext(){this._buffer.uninitializeRenderContext(),this._renderer.uninitializeRenderContext()}get produces(){return this._renderer.produces}get hasOccludees(){return this._buffer.hasOccludees}get hasOnlyOccluders(){return!!(-2&this.renderOccludedFlags)}get emissions(){return this.material.emissions}get isDecoration(){return this.material.parameters.isDecoration}get renderOccludedFlags(){return this.material.renderOccludedFlags}get testsTransparentRenderOrder(){return"test"===process.env.NODE_ENV?this.material.testsTransparentRenderOrder:0}get numGeometries(){let e=0;for(const r of this._dataByBaseInstance.values())for(const t of r.dataByOrigin.values())e+=t.buffers.reduce((e,r)=>e+r.instances.size,0);return e}get usedMemory(){let e=0;for(const r of this._dataByBaseInstance.values())for(const t of r.dataByOrigin.values())e+=t.buffers.reduce((e,r)=>e+r.usedMemory,0);return e}forEachGeometry(e){for(const r of this._dataByBaseInstance.values())for(const t of r.dataByOrigin.values())for(const r of t.buffers)for(const{geometry:t}of r.instances.values())e(t)}modify(e,r){this._buffer.modify(e,r),this._renderer.updateHighlights()}get canCompact(){return this._buffer.canCompact}compact(e){return this._buffer.compact(e)}updateHighlights(e){this.highlightOrderMap=e,this._buffer.updateHighlights(e),this._renderer.updateHighlights()}updateAnimation(e){return this.material.update(e)}acquireTechniques(e){return this._renderer.acquireTechniques(e)}render(e,r){return this._renderer.render(e,r)}static prune(){i.prune()}get test(){}};e([r({constructOnly:!0})],a.prototype,"material",void 0),e([r()],a.prototype,"highlightOrderMap",void 0),a=e([t("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],a);export{a as MergedRenderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{getOrCreateMapValue as t}from"../../../../../core/MapUtils.js";import s from"../../../../../core/PooledArray.js";import{assert as e}from"../../lib/Util.js";import{bufferRangePool as n,mergeAdjacentRanges as a}from"./BufferRange.js";import{DrawCommand as i}from"./DrawCommand.js";import{Instance as r}from"./Instance.js";import{InstancedCommandVAO as o}from"./InstancedCommandVAO.js";import{InstancedCommandVAOs as h}from"./InstancedCommandVAOs.js";import{defaultHighlightName as d}from"../../../../support/HighlightDefaults.js";class m{constructor(t,s){this.isInstanced=t,this.targetBuffers=s,this.vao=null,this.textureBuffer=null,this.endElements={geometry:0,texture:0,index:0},this._instances=new Map,this.hasHiddenInstances=!1,this.hasOccludees=!1,this.drawCommandsDirty=!0,this.highlightNames=new Set,this.drawCommandsDefault=l(),this.drawCommandsHighlights=new Map,this.drawCommandsOccludees=l(),this.drawCommandsShadowHighlightRest=l(),this._instancedCommandVAOs=null;const e={},n={};for(const a of s)e[a]=0,n[a]=[];this._numElements=e,this._holes=n,this.useIndexing=s.includes("index"),this._drawRangesTarget=this.useIndexing?"index":"geometry"}getTargetBuffer(t){return"geometry"===t?this.vao?.buffer("geometry"):"texture"===t?this.textureBuffer:this.vao?.indexBuffer}get numElements(){return this._numElements}get instances(){return this._instances}get writeableInstances(){return this._instances}get indexType(){return this.vao?.indexBuffer?.indexType}clearHoles(){for(const t of this.targetBuffers){const s=this._holes[t];for(const t of s)n.release(t);s.length=0}}get holes(){return this._holes}get hasHighlights(){return this.highlightNames.size>0}get instancedCommandVAOs(){return this._instancedCommandVAOs}get _drawTargetHoles(){return this._holes[this._drawRangesTarget]}get _drawTargetEndElement(){return this.endElements[this._drawRangesTarget]}resetInstanceSummary(){this.hasHiddenInstances=!1,this.hasOccludees=!1,this.highlightNames.clear()}updateDirtyDrawCommands(t){if(this.drawCommandsDirty){this.resetInstanceSummary();for(const t of this.instances.values())this.updateDrawState(t);this.updateDrawCommands(t)}}createInstance(t,s,e=this._makeEmptyRanges()){const n=new r(t,e,s,this._drawRangesTarget);return this.addInstance(t.id,n),n}addInstance(t,s){e(!this._instances.has(t)),this._instances.set(t,s);for(const e of this.targetBuffers)this._numElements[e]+=s.targetRanges[e].numElements}deleteInstance(t){const s=this._instances.get(t);if(s){for(const t of this.targetBuffers){const e=s.targetRanges[t];this._numElements[t]-=e.numElements,n.release(e)}this._instances.delete(t)}}updateInstances(){const{targetBuffers:t}=this,s={};for(const e of t)s[e]=0;for(const e of this._instances.values()){for(const n of t)s[n]+=e.targetRanges[n].numElements;this.updateDrawState(e)}this._numElements=s}updateDrawState(t){if(t.isVisible){const{highlightName:s}=t;s&&this.highlightNames.add(s),t.hasOccludees&&(this.hasOccludees=!0)}else this.hasHiddenInstances=!0}updateDrawCommands(t){this._updateDrawCommands(t),this._updateInstancedCommandVAOs()}_updateDrawCommands(t){if(this.drawCommandsDefault.clear(),this.drawCommandsOccludees.clear(),this.drawCommandsDirty=!1,0===this._instances.size)return;const{sortedInstances:s}=this;if(this._updateHighlightDrawCommands(t,s),!this.needsMultipleCommands){const t=this.drawCommandsDefault.pushNew(),s=this._drawTargetHoles,e=s.at(0);return this.vao&&1===s.length&&e.to===this._drawTargetEndElement?(t.first=0,void(t.count=e.from)):(t.first=1/0,t.count=0,this._instances.forEach(s=>{t.first=Math.min(t.first,s.drawRange.from),t.count=Math.max(t.count,s.drawRange.to)}),void(t.count-=t.first))}for(const e of s)e.isVisible&&this.addOrMerge(e.hasOccludees?this.drawCommandsOccludees:this.drawCommandsDefault,e)}get sortedInstances(){return Array.from(this._instances.values()).sort(({drawRange:t},{drawRange:s})=>t.from===s.from?t.to-s.to:t.from-s.from)}updateHighlights(t){this.highlightNames.clear();const s=this.sortedInstances;for(const e of s)e.updateHighlightOptions(t),e.isVisible&&e.highlightName&&this.highlightNames.add(e.highlightName);this._updateHighlightDrawCommands(t,s),this._updateInstancedCommandVAOs()}mergeHoles(){const t=this._holes;for(const s of this.targetBuffers)a(t[s])}_updateHighlightDrawCommands(s,e){const{drawCommandsHighlights:n,drawCommandsShadowHighlightRest:a}=this;n.clear(),a.clear();for(const i of e){if(i.updateHighlightOptions(s),!i.isVisible)continue;const{highlightName:e}=i;if(e){this.highlightNames.add(e);const s=t(n,e,l);this.addOrMerge(s,i)}e&&e===d||this.addOrMerge(a,i)}}_updateInstancedCommandVAOs(){const t=this.vao;if(!this.isInstanced||null==t)return;this._instancedCommandVAOs??=new h;const s=this._instancedCommandVAOs,e=s.commandVAOs.copy();s.clear();const n=s.commandVAOs,a=(s,a)=>{for(const i of s){const{first:s,count:r}=i,h=n.get(s,r)??e.pop(s,r)??new o(t.shallowCloneWithBaseInstances(new Map([["geometry",i.first]])),i.count);n.set(s,r,h),a.push(h)}};a(this.drawCommandsDefault,s.drawCommandsDefault);for(const[i,r]of this.drawCommandsHighlights){const t=new Array;a(r,t),s.drawCommandsHighlights.set(i,t)}a(this.drawCommandsOccludees,s.drawCommandsOccludees),a(this.drawCommandsShadowHighlightRest,s.drawCommandsShadowHighlightRest);for(const i of e.values())i.dispose();e.clear()}get needsMultipleCommands(){return this.hasOccludees||this.hasHighlights||this.hasHiddenInstances}addOrMerge(t,{drawRange:s}){const e=t.back();if(null==e){const e=t.pushNew();return e.first=s.from,void(e.count=s.numElements)}if(u(e,s)){const t=s.from-e.first+s.numElements;e.count=t}else{const e=t.pushNew();e.first=s.from,e.count=s.numElements}}_makeEmptyRanges(){const t={};for(const s of this.targetBuffers)t[s]=n.acquire(0,0);return t}}function c(t){return null!=t.vao}function l(){return new s({allocator:t=>t||new i,deallocator:t=>t})}function u(t,s){return t.first+t.count>=s.from}export{m as PerBufferData,c as hasVao};
2
+ import{getOrCreateMapValue as t}from"../../../../../core/MapUtils.js";import s from"../../../../../core/PooledArray.js";import{assert as e}from"../../lib/Util.js";import{bufferRangePool as n,mergeAdjacentRanges as a}from"./BufferRange.js";import{DrawCommand as i}from"./DrawCommand.js";import{Instance as r}from"./Instance.js";import{InstancedCommandVAO as o}from"./InstancedCommandVAO.js";import{InstancedCommandVAOs as h}from"./InstancedCommandVAOs.js";import{defaultHighlightName as d}from"../../../../support/HighlightDefaults.js";class m{constructor(t,s){this.isInstanced=t,this.targetBuffers=s,this.vao=null,this.textureBuffer=null,this.endElements={geometry:0,texture:0,index:0},this._instances=new Map,this.hasHiddenInstances=!1,this.hasOccludees=!1,this.drawCommandsDirty=!0,this.highlightNames=new Set,this.drawCommandsDefault=u(),this.drawCommandsHighlights=new Map,this.drawCommandsOccludees=u(),this.drawCommandsShadowHighlightRest=u(),this._instancedCommandVAOs=null;const e={},n={};for(const a of s)e[a]=0,n[a]=[];this._numElements=e,this._holes=n,this.useIndexing=s.includes("index"),this._drawRangesTarget=this.useIndexing?"index":"geometry"}getTargetBuffer(t){return"geometry"===t?this.vao?.buffer("geometry"):"texture"===t?this.textureBuffer:this.vao?.indexBuffer}get numElements(){return this._numElements}get instances(){return this._instances}get writeableInstances(){return this._instances}get indexType(){return this.vao?.indexBuffer?.indexType}clearHoles(){for(const t of this.targetBuffers){const s=this._holes[t];for(const t of s)n.release(t);s.length=0}}get holes(){return this._holes}get hasHighlights(){return this.highlightNames.size>0}get instancedCommandVAOs(){return this._instancedCommandVAOs}get _drawTargetHoles(){return this._holes[this._drawRangesTarget]}get _drawTargetEndElement(){return this.endElements[this._drawRangesTarget]}get usedMemory(){return(this.vao?.usedMemory??0)+(this.textureBuffer?.usedMemory??0)}resetInstanceSummary(){this.hasHiddenInstances=!1,this.hasOccludees=!1,this.highlightNames.clear()}updateDirtyDrawCommands(t){if(this.drawCommandsDirty){this.resetInstanceSummary();for(const t of this.instances.values())this.updateDrawState(t);this.updateDrawCommands(t)}}createInstance(t,s,e=this._makeEmptyRanges()){const n=new r(t,e,s,this._drawRangesTarget);return this.addInstance(t.id,n),n}addInstance(t,s){e(!this._instances.has(t)),this._instances.set(t,s);for(const e of this.targetBuffers)this._numElements[e]+=s.targetRanges[e].numElements}deleteInstance(t){const s=this._instances.get(t);if(s){for(const t of this.targetBuffers){const e=s.targetRanges[t];this._numElements[t]-=e.numElements,n.release(e)}this._instances.delete(t)}}updateInstances(){const{targetBuffers:t}=this,s={};for(const e of t)s[e]=0;for(const e of this._instances.values()){for(const n of t)s[n]+=e.targetRanges[n].numElements;this.updateDrawState(e)}this._numElements=s}updateDrawState(t){if(t.isVisible){const{highlightName:s}=t;s&&this.highlightNames.add(s),t.hasOccludees&&(this.hasOccludees=!0)}else this.hasHiddenInstances=!0}updateDrawCommands(t){this._updateDrawCommands(t),this._updateInstancedCommandVAOs()}_updateDrawCommands(t){if(this.drawCommandsDefault.clear(),this.drawCommandsOccludees.clear(),this.drawCommandsDirty=!1,0===this._instances.size)return;const{sortedInstances:s}=this;if(this._updateHighlightDrawCommands(t,s),!this.needsMultipleCommands){const t=this.drawCommandsDefault.pushNew(),s=this._drawTargetHoles,e=s.at(0);return this.vao&&1===s.length&&e.to===this._drawTargetEndElement?(t.first=0,void(t.count=e.from)):(t.first=1/0,t.count=0,this._instances.forEach(s=>{t.first=Math.min(t.first,s.drawRange.from),t.count=Math.max(t.count,s.drawRange.to)}),void(t.count-=t.first))}for(const e of s)e.isVisible&&this.addOrMerge(e.hasOccludees?this.drawCommandsOccludees:this.drawCommandsDefault,e)}get sortedInstances(){return Array.from(this._instances.values()).sort(({drawRange:t},{drawRange:s})=>t.from===s.from?t.to-s.to:t.from-s.from)}updateHighlights(t){this.highlightNames.clear();const s=this.sortedInstances;for(const e of s)e.updateHighlightOptions(t),e.isVisible&&e.highlightName&&this.highlightNames.add(e.highlightName);this._updateHighlightDrawCommands(t,s),this._updateInstancedCommandVAOs()}mergeHoles(){const t=this._holes;for(const s of this.targetBuffers)a(t[s])}_updateHighlightDrawCommands(s,e){const{drawCommandsHighlights:n,drawCommandsShadowHighlightRest:a}=this;n.clear(),a.clear();for(const i of e){if(i.updateHighlightOptions(s),!i.isVisible)continue;const{highlightName:e}=i;if(e){this.highlightNames.add(e);const s=t(n,e,u);this.addOrMerge(s,i)}e&&e===d||this.addOrMerge(a,i)}}_updateInstancedCommandVAOs(){const t=this.vao;if(!this.isInstanced||null==t)return;this._instancedCommandVAOs??=new h;const s=this._instancedCommandVAOs,e=s.commandVAOs.copy();s.clear();const n=s.commandVAOs,a=(s,a)=>{for(const i of s){const{first:s,count:r}=i,h=n.get(s,r)??e.pop(s,r)??new o(t.shallowCloneWithBaseInstances(new Map([["geometry",i.first]])),i.count);n.set(s,r,h),a.push(h)}};a(this.drawCommandsDefault,s.drawCommandsDefault);for(const[i,r]of this.drawCommandsHighlights){const t=new Array;a(r,t),s.drawCommandsHighlights.set(i,t)}a(this.drawCommandsOccludees,s.drawCommandsOccludees),a(this.drawCommandsShadowHighlightRest,s.drawCommandsShadowHighlightRest);for(const i of e.values())i.dispose();e.clear()}get needsMultipleCommands(){return this.hasOccludees||this.hasHighlights||this.hasHiddenInstances}addOrMerge(t,{drawRange:s}){const e=t.back();if(null==e){const e=t.pushNew();return e.first=s.from,void(e.count=s.numElements)}if(l(e,s)){const t=s.from-e.first+s.numElements;e.count=t}else{const e=t.pushNew();e.first=s.from,e.count=s.numElements}}_makeEmptyRanges(){const t={};for(const s of this.targetBuffers)t[s]=n.acquire(0,0);return t}}function c(t){return null!=t.vao}function u(){return new s({allocator:t=>t||new i,deallocator:t=>t})}function l(t,s){return t.first+t.count>=s.from}export{m as PerBufferData,c as hasVao};
@@ -1,5 +1,4 @@
1
1
  import type View2D from "./View2D.js";
2
- import type { Screenshot, UserSettings } from "./types.js";
3
2
  import type { View2DProperties } from "./View2D.js";
4
3
 
5
4
  export interface MapViewProperties extends View2DProperties {}
@@ -336,63 +335,4 @@ export default class MapView extends View2D {
336
335
  * });
337
336
  */
338
337
  constructor(properties?: MapViewProperties);
339
- /**
340
- * Create a screenshot of the current view. Screenshots include only elements
341
- * that are rendered on the canvas (all geographical elements), but excludes overlaid
342
- * DOM elements (UI, popups, measurement labels, etc.). By default, a screenshot of the whole view
343
- * is created. Different options allow for creating different types of screenshots,
344
- * including taking screenshots at different aspect ratios, different resolutions
345
- * and creating thumbnails.
346
- *
347
- * Screenshots are always taken inside the padded area of the view (see
348
- * [padding](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#padding)).
349
- *
350
- * @param options - Screenshot options.
351
- * @returns When resolved, returns an object
352
- * containing an encoded dataUrl and raw image data.
353
- * @since 4.10
354
- * @see [Sample - Take a screenshot of a SceneView](https://developers.arcgis.com/javascript/latest/sample-code/sceneview-screenshot/)
355
- * @example
356
- * // Take a screenshot once view is ready (and data is displaying)
357
- * reactiveUtils.whenOnce(() => !view.updating).then(() => {
358
- * // Take a screenshot at the same resolution of the current view
359
- * view.takeScreenshot().then(function(screenshot) {
360
- * let imageElement = document.getElementById("screenshotImage");
361
- * imageElement.src = screenshot.dataUrl;
362
- * });
363
- * });
364
- * @example
365
- * // Create a square thumbnail from the current view
366
- * let options = {
367
- * width: 200,
368
- * height: 200
369
- * };
370
- *
371
- * view.takeScreenshot(options).then(function(screenshot) {
372
- * let imageElement = document.getElementById("screenshotImage");
373
- * imageElement.src = screenshot.dataUrl;
374
- * });
375
- * @example
376
- * // Take a high resolution, square screenshot
377
- * let options = {
378
- * width: 2048,
379
- * height: 2048
380
- * };
381
- *
382
- * view.takeScreenshot(options).then(function(screenshot) {
383
- * let imageElement = document.getElementById("screenshotImage");
384
- * imageElement.src = screenshot.dataUrl;
385
- * });
386
- * @example
387
- * // Takes a high-resolution screenshot for display on a HiDPI screen
388
- * // The pixelRatio indicates the display has 2x the pixel density of typical screens
389
- * let pixelRatio = 2;
390
- * view.takeScreenshot({ width: view.width * pixelRatio, height: view.height * pixelRatio });
391
- * @example
392
- * // Takes a high-resolution screenshot for display on a HiDPI screen
393
- * // The pixelRatio is the resolution of the display capturing the image
394
- * let pixelRatio = window.devicePixelRatio;
395
- * view.takeScreenshot({ width: view.width * pixelRatio, height: view.height * pixelRatio });
396
- */
397
- takeScreenshot(options?: Partial<UserSettings>): Promise<Screenshot>;
398
338
  }