@arcgis/core 6.0.0-next.55 → 6.0.0-next.57

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 (298) hide show
  1. package/arcgisGlobal.d.ts +1 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/00c227bcecc28fe278bb.js +1 -0
  4. package/assets/esri/core/workers/chunks/033b9fcd9833db3b6e7d.js +1 -0
  5. package/assets/esri/core/workers/chunks/0978e12dd6a1cbc50b80.js +1 -0
  6. package/assets/esri/core/workers/chunks/{88df1b8b295d3aed649f.js → 10499abb7678e95d9f05.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{e956845255bce0910944.js → 1507297550c3cd1268e2.js} +1 -1
  8. package/assets/esri/core/workers/chunks/1afc8820c283ef785729.js +1 -0
  9. package/assets/esri/core/workers/chunks/1c0f5c42331fb6fc26cb.js +1 -0
  10. package/assets/esri/core/workers/chunks/1c874f86bfd0963aa3d2.js +1 -0
  11. package/assets/esri/core/workers/chunks/2a84c9a81ec2bed3d4e5.js +1 -0
  12. package/assets/esri/core/workers/chunks/2cd2fcf4a37d180d5d5c.js +1 -0
  13. package/assets/esri/core/workers/chunks/2f31766bc0f9d1d70c5a.js +1 -0
  14. package/assets/esri/core/workers/chunks/2f9adf0b809ce8797ebf.js +1 -0
  15. package/assets/esri/core/workers/chunks/35109db6a6be66f895f7.js +1 -0
  16. package/assets/esri/core/workers/chunks/373b140f92eda3857f82.js +1 -0
  17. package/assets/esri/core/workers/chunks/38bba952c38af5a150e7.js +1 -0
  18. package/assets/esri/core/workers/chunks/3982409149571a827390.js +1 -0
  19. package/assets/esri/core/workers/chunks/3aea09191b737dc1de70.js +1 -0
  20. package/assets/esri/core/workers/chunks/3d851710f7fcc27c5b60.js +2 -0
  21. package/assets/esri/core/workers/chunks/3e8d70039800f2395d66.js +1 -0
  22. package/assets/esri/core/workers/chunks/3fc4b7d0ee460fc96176.js +1 -0
  23. package/assets/esri/core/workers/chunks/457bd1bd37c67b61efe8.js +1 -0
  24. package/assets/esri/core/workers/chunks/4d8539674fc2e4fea03c.js +1 -0
  25. package/assets/esri/core/workers/chunks/{e61082f56c08abe54b3a.js → 5954f02c3901b28d8e73.js} +1 -1
  26. package/assets/esri/core/workers/chunks/5ba6007c3c49a8153256.js +1 -0
  27. package/assets/esri/core/workers/chunks/5bdd95eeb8f34dbf26f2.js +2 -0
  28. package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js → 5e47026c681238038955.js} +2 -2
  29. package/assets/esri/core/workers/chunks/{2baf35b1b19482d603b5.js → 5f7505ada0991cfbdd84.js} +1 -1
  30. package/assets/esri/core/workers/chunks/601d668e70c5d72fe58c.js +1 -0
  31. package/assets/esri/core/workers/chunks/651e33be8bb3995d749f.js +1 -0
  32. package/assets/esri/core/workers/chunks/{542a9c414c99d84d52ab.js → 6a202ef9ba9b89e09153.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{0826feebdca8a31eb630.js → 6ba6fece5c11fe2a6ace.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{5eb69e2895e5aec81051.js → 6fd10891506925560443.js} +1 -1
  35. package/assets/esri/core/workers/chunks/721f43554b9654481de7.js +1 -0
  36. package/assets/esri/core/workers/chunks/75274ac3ddf7c45f47d7.js +1 -0
  37. package/assets/esri/core/workers/chunks/7b6fd287e7043ad50f4e.js +1 -0
  38. package/assets/esri/core/workers/chunks/7baa49055bc31618b56e.js +1 -0
  39. package/assets/esri/core/workers/chunks/80d1267606383ae537f2.js +1 -0
  40. package/assets/esri/core/workers/chunks/8570e3df90fb76a8741a.js +1 -0
  41. package/assets/esri/core/workers/chunks/{c3c0f24a9e0047232ae1.js → 8679dfc0c53355b6feb0.js} +1 -1
  42. package/assets/esri/core/workers/chunks/8920d0b11951b57d6a66.js +1 -0
  43. package/assets/esri/core/workers/chunks/8a636dc51372e14c98f5.js +1 -0
  44. package/assets/esri/core/workers/chunks/{14259910f44c08fd5bbd.js → 9117c9b720c9ba6e7a6e.js} +1 -1
  45. package/assets/esri/core/workers/chunks/92d97e0fcc20dd5f5ac4.js +1 -0
  46. package/assets/esri/core/workers/chunks/9ca84fa9423654061d05.js +1 -0
  47. package/assets/esri/core/workers/chunks/9e372af03d62fa5ad10e.js +1 -0
  48. package/assets/esri/core/workers/chunks/a22458e5272332d86cb9.js +1 -0
  49. package/assets/esri/core/workers/chunks/{3ea480cebf8ee56228a5.js → a7dfca326883384d2751.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{723d8316f5d4b6ce2942.js → a9539393e2f1812a973a.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{be0b8bb4f09aae6ff5de.js → ab784764ddf9d7f693a1.js} +1 -1
  52. package/assets/esri/core/workers/chunks/b10c534cbe311d17b7d5.js +1 -0
  53. package/assets/esri/core/workers/chunks/b38b6fe08a367e9de4f5.js +1 -0
  54. package/assets/esri/core/workers/chunks/{4e651869e9a196494694.js → b6e628b5d2643af4c19b.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{b37ab6b1cb4cfc85cd9d.js → b7828d7e2c5b75644057.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{ec465abb0344ad719e9d.js → bd8e329ec74d921d311a.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{9e508f930086d2ef5f22.js → be0133fa63c5d6545a7f.js} +40 -41
  58. package/assets/esri/core/workers/chunks/{56e6e70aa40e51827290.js → c3f94024c6c9eed9f273.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{6d17b45022dfd2548098.js → c5ddf8b347c31fe772a3.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{ee9af58ae202b803bba7.js → c7a0c4ca37ebd1d98cf1.js} +1 -1
  61. package/assets/esri/core/workers/chunks/cb0e3614b78c78040662.js +1 -0
  62. package/assets/esri/core/workers/chunks/d22e3b5d836dffdf91cc.js +1 -0
  63. package/assets/esri/core/workers/chunks/d7763c42754152510e13.js +2 -0
  64. package/assets/esri/core/workers/chunks/e0341def2d81e679a200.js +1 -0
  65. package/assets/esri/core/workers/chunks/e42e9dd3c933f5f864ab.js +1 -0
  66. package/assets/esri/core/workers/chunks/e566102c7ed7a8ebf89e.js +1 -0
  67. package/assets/esri/core/workers/chunks/e74586b074d0fa6abb4b.js +1 -0
  68. package/assets/esri/core/workers/chunks/e7dff025780726d5feae.js +1 -0
  69. package/assets/esri/core/workers/chunks/e96fa029acba59c04e4e.js +2 -0
  70. package/assets/esri/core/workers/chunks/f4fcf87da4495584223d.js +1 -0
  71. package/assets/esri/core/workers/chunks/f989588dfdbb69056491.js +1 -0
  72. package/assets/esri/core/workers/chunks/fc5b920f9756e11c2f88.js +1 -0
  73. package/assets/esri/core/workers/chunks/fdfbd201be372d3796bf.js +2 -0
  74. package/assets/esri/core/workers/chunks/ff0a0819bba5e8264c47.js +1 -0
  75. package/chunks/BlendLayers.glsl.js +1 -1
  76. package/chunks/ColorMaterial.glsl.js +14 -14
  77. package/chunks/Component.glsl.js +38 -37
  78. package/chunks/DefaultMaterial.glsl.js +15 -15
  79. package/chunks/GlobalIllumination.glsl.js +12 -11
  80. package/chunks/GlobalIlluminationBlur.glsl.js +6 -4
  81. package/chunks/HUDMaterial.glsl.js +3 -3
  82. package/chunks/Path.glsl.js +15 -15
  83. package/chunks/Pattern.glsl.js +20 -20
  84. package/chunks/RasterColorizer.glsl.js +1 -1
  85. package/chunks/ShadowHighlight.glsl.js +1 -1
  86. package/chunks/Terrain.glsl.js +28 -27
  87. package/chunks/Water.glsl.js +30 -20
  88. package/chunks/pdf.js +57 -0
  89. package/config.js +1 -1
  90. package/core/accessorSupport/write.js +1 -1
  91. package/core/memoryEstimations.js +1 -1
  92. package/core/scheduling.js +1 -1
  93. package/interfaces.d.ts +0 -1
  94. package/kernel.js +1 -1
  95. package/layers/LinkChartLayer.js +1 -1
  96. package/layers/VoxelWasmPerSceneView.js +1 -1
  97. package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
  98. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -56
  99. package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
  100. package/layers/geospatialPDF/parserUtils.js +2 -0
  101. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  102. package/layers/graphics/dehydratedFeatures.js +1 -1
  103. package/layers/graphics/transferFeatures.js +1 -1
  104. package/layers/support/ControlPoint.js +1 -1
  105. package/layers/support/ControlPointsGeoreference.js +1 -1
  106. package/layers/support/commonProperties.js +1 -1
  107. package/layers/support/fieldUtils.d.ts +129 -57
  108. package/layers/support/fieldUtils.js +1 -1
  109. package/layers/support/geospatialPDFUtils.d.ts +63 -0
  110. package/layers/support/geospatialPDFUtils.js +2 -0
  111. package/networks/Network.js +1 -1
  112. package/networks/support/TopologyValidationJobInfo.js +1 -1
  113. package/package.json +5 -5
  114. package/symbols/CIMSymbol.d.ts +9 -9
  115. package/symbols/PathSymbol3DLayer.d.ts +1 -1
  116. package/symbols/WaterSymbol3DLayer.d.ts +13 -1
  117. package/symbols/WaterSymbol3DLayer.js +1 -1
  118. package/views/3d/GroundView3D.js +1 -1
  119. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  120. package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
  121. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  122. package/views/3d/camera/intersectionUtils.js +1 -1
  123. package/views/3d/environment/EnvironmentView.js +1 -1
  124. package/views/3d/input/handlers/ground/GroundNavigation.js +1 -1
  125. package/views/3d/interactive/Manipulator3D.js +1 -1
  126. package/views/3d/interactive/Manipulator3DBase.js +1 -1
  127. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  128. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  129. package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
  130. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  131. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  132. package/views/3d/layers/DrapedSubView3D.js +1 -1
  133. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  134. package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
  135. package/views/3d/layers/FlowSubView3D.js +1 -1
  136. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  137. package/views/3d/layers/I3SMeshView3D.js +1 -1
  138. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  139. package/views/3d/layers/RouteLayerView3D.js +1 -1
  140. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  141. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  142. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  143. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  144. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  145. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  146. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  147. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  148. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  149. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  150. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  151. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  152. package/views/3d/layers/support/Tiles3DBVH.js +1 -1
  153. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  154. package/views/3d/layers/support/createTileBVHForLayer.js +1 -1
  155. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  156. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  157. package/views/3d/state/controllers/RotateController.js +1 -1
  158. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  159. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  160. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  161. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  162. package/views/3d/state/utils/navigationUtils.js +1 -1
  163. package/views/3d/support/GroundAndIMSurface.js +1 -1
  164. package/views/3d/support/QualityProfile.js +1 -1
  165. package/views/3d/support/QualitySettings.js +1 -1
  166. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  167. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  168. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  169. package/views/3d/terrain/BlendLayersTechniqueConfiguration.js +1 -1
  170. package/views/3d/terrain/OverlayManager.js +1 -1
  171. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  172. package/views/3d/terrain/RasterColorizerTechniqueConfiguration.js +1 -1
  173. package/views/3d/terrain/TerrainRenderer.js +1 -1
  174. package/views/3d/terrain/TerrainSurface.js +1 -1
  175. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  176. package/views/3d/webgl-engine/collections/Component/ComponentObjectFixedBVH.js +1 -1
  177. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  178. package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
  179. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  180. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  181. package/views/3d/webgl-engine/core/shaderLibrary/clampShadowPosition.glsl.js +2 -0
  182. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +14 -14
  183. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -1
  184. package/views/3d/webgl-engine/core/shaderLibrary/lastFrameUniforms.js +1 -1
  185. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +15 -12
  186. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js +2 -3
  187. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  188. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
  189. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  190. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationBlur.glsl.js +1 -1
  191. package/views/3d/webgl-engine/effects/globalIllumination/globalIlluminationUniforms.js +1 -1
  192. package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
  193. package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
  194. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  195. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  196. package/views/3d/webgl-engine/lib/Program.js +1 -1
  197. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  198. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  199. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  200. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  201. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  202. package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
  203. package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
  204. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  205. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  206. package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
  207. package/views/3d/webgl-engine/materials/getWaterColor.glsl.js +89 -0
  208. package/views/3d/webgl-engine/parts/Model.js +1 -1
  209. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  210. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  211. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  212. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  213. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  214. package/views/Attribution.js +5 -5
  215. package/views/DOMContainer.d.ts +2 -1
  216. package/views/SceneView.js +1 -1
  217. package/views/draw/DrawGraphicTool.js +1 -1
  218. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  219. package/views/webgl/Program.js +3 -3
  220. package/views/webgl/ShaderBuilder.js +23 -23
  221. package/webscene/Slide.js +1 -1
  222. package/webscene/VirtualLighting.d.ts +2 -4
  223. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +17 -1
  224. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  225. package/widgets/BatchAttributeForm/inputs/support/inputUtils.d.ts +7 -0
  226. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  227. package/widgets/BatchAttributeForm.js +1 -1
  228. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  229. package/widgets/Sketch/SketchViewModel.js +1 -1
  230. package/widgets/Weather/WeatherViewModel.js +1 -1
  231. package/widgets/support/ContingentValuesManager.js +1 -1
  232. package/widgets/support/forms/types.d.ts +23 -1
  233. package/assets/esri/core/workers/chunks/144f18a3dd2c8cf07cf7.js +0 -1
  234. package/assets/esri/core/workers/chunks/193a73a2c7f4f8482c21.js +0 -1
  235. package/assets/esri/core/workers/chunks/20acb6f3ed5140b6c6c6.js +0 -1
  236. package/assets/esri/core/workers/chunks/23fc1c1ed483ed3b2298.js +0 -1
  237. package/assets/esri/core/workers/chunks/249a687ce1b6d0815242.js +0 -1
  238. package/assets/esri/core/workers/chunks/2634927d26cb1139c6d0.js +0 -1
  239. package/assets/esri/core/workers/chunks/2d1b8154ee40afc9d40b.js +0 -1
  240. package/assets/esri/core/workers/chunks/2d4788be418a4e5f6606.js +0 -1
  241. package/assets/esri/core/workers/chunks/333140b18aeb5a50b654.js +0 -1
  242. package/assets/esri/core/workers/chunks/4401b3f8ebb658abe789.js +0 -1
  243. package/assets/esri/core/workers/chunks/4761cd436abceee858bf.js +0 -1
  244. package/assets/esri/core/workers/chunks/4a41bf3d1e2e9bb79771.js +0 -2
  245. package/assets/esri/core/workers/chunks/4de08ead94660025075b.js +0 -1
  246. package/assets/esri/core/workers/chunks/56f227e1a9e51d1fd742.js +0 -1
  247. package/assets/esri/core/workers/chunks/5bd451c7db17ee8f0315.js +0 -1
  248. package/assets/esri/core/workers/chunks/5c34d49a6c9cc34b7626.js +0 -1
  249. package/assets/esri/core/workers/chunks/5f324d88785ffcb73ae0.js +0 -1
  250. package/assets/esri/core/workers/chunks/703373f529c1c334cfad.js +0 -1
  251. package/assets/esri/core/workers/chunks/70695e0fb53018d48e7b.js +0 -2
  252. package/assets/esri/core/workers/chunks/723c9ad4c25be2b82476.js +0 -1
  253. package/assets/esri/core/workers/chunks/733c32d8091427d84de7.js +0 -1
  254. package/assets/esri/core/workers/chunks/766a1357be2ed7f4e125.js +0 -1
  255. package/assets/esri/core/workers/chunks/844c593754b2692257f4.js +0 -1
  256. package/assets/esri/core/workers/chunks/846248697c398468d8e6.js +0 -1
  257. package/assets/esri/core/workers/chunks/860552f49f17de2f3353.js +0 -1
  258. package/assets/esri/core/workers/chunks/89e55895683369b5277a.js +0 -1
  259. package/assets/esri/core/workers/chunks/8c94e987754b3919181e.js +0 -1
  260. package/assets/esri/core/workers/chunks/919115788da38049aea7.js +0 -2
  261. package/assets/esri/core/workers/chunks/976303f47c342b9d1cc0.js +0 -1
  262. package/assets/esri/core/workers/chunks/9b727f45dfea84357b57.js +0 -1
  263. package/assets/esri/core/workers/chunks/a05a2c2aaf0c288f9681.js +0 -1
  264. package/assets/esri/core/workers/chunks/a116dd204921e7464944.js +0 -1
  265. package/assets/esri/core/workers/chunks/ab76170c374fd67ce8cd.js +0 -1
  266. package/assets/esri/core/workers/chunks/aebd12488b4004e207a3.js +0 -1
  267. package/assets/esri/core/workers/chunks/b33e7e74cf8fa3926617.js +0 -1
  268. package/assets/esri/core/workers/chunks/bb2af16e55cb39163827.js +0 -1
  269. package/assets/esri/core/workers/chunks/c7b1c6d57603fa385c54.js +0 -1
  270. package/assets/esri/core/workers/chunks/cd8181600623e18f511c.js +0 -1
  271. package/assets/esri/core/workers/chunks/cef537fa9705dd1cf685.js +0 -1
  272. package/assets/esri/core/workers/chunks/d33403d578fbeecaf844.js +0 -1
  273. package/assets/esri/core/workers/chunks/d5bb9f9b7b341c671525.js +0 -1
  274. package/assets/esri/core/workers/chunks/d96e63d66f7b1f4ea54a.js +0 -2
  275. package/assets/esri/core/workers/chunks/ddbfa664e69612295785.js +0 -1
  276. package/assets/esri/core/workers/chunks/ded81c504bf44806ca7d.js +0 -1
  277. package/assets/esri/core/workers/chunks/e0466387b2ab54d706ca.js +0 -1
  278. package/assets/esri/core/workers/chunks/e3bcd2e356f75afc316a.js +0 -1
  279. package/assets/esri/core/workers/chunks/e80526571f1a34de3278.js +0 -1
  280. package/assets/esri/core/workers/chunks/ea71850ba87ae6038000.js +0 -1
  281. package/assets/esri/core/workers/chunks/ee70be138831cc2a0f56.js +0 -1
  282. package/assets/esri/core/workers/chunks/f23c4fd014126ea7abc6.js +0 -1
  283. package/assets/esri/core/workers/chunks/f537a5e808dc546813c7.js +0 -1
  284. package/assets/esri/core/workers/chunks/f6e40f3faf0c80cf1b3a.js +0 -1
  285. package/assets/esri/core/workers/chunks/fe811d651d201f698b8f.js +0 -2
  286. package/chunks/NativeLine.glsl.js +0 -8
  287. package/layers/geospatialPDF/geospatialPDFParserUtils.js +0 -2
  288. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +0 -70
  289. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +0 -2
  290. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +0 -2
  291. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +0 -2
  292. package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +0 -2
  293. /package/assets/esri/core/workers/chunks/{919115788da38049aea7.js.LICENSE.txt → 3d851710f7fcc27c5b60.js.LICENSE.txt} +0 -0
  294. /package/assets/esri/core/workers/chunks/{fe811d651d201f698b8f.js.LICENSE.txt → 5bdd95eeb8f34dbf26f2.js.LICENSE.txt} +0 -0
  295. /package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js.LICENSE.txt → 5e47026c681238038955.js.LICENSE.txt} +0 -0
  296. /package/assets/esri/core/workers/chunks/{4a41bf3d1e2e9bb79771.js.LICENSE.txt → d7763c42754152510e13.js.LICENSE.txt} +0 -0
  297. /package/assets/esri/core/workers/chunks/{d96e63d66f7b1f4ea54a.js.LICENSE.txt → e96fa029acba59c04e4e.js.LICENSE.txt} +0 -0
  298. /package/assets/esri/core/workers/chunks/{70695e0fb53018d48e7b.js.LICENSE.txt → fdfbd201be372d3796bf.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../core/Error.js";import{getDeepValue as t,setDeepValue as n}from"../../core/object.js";import{union as r}from"../../core/SetUtils.js";import{parseWhereClause as i}from"../../core/sql.js";import{getFieldNameFromSimpleExpression as a}from"../../support/arcadeExpressionUtils.js";import{isStringOrNull as o,isString as s}from"../../support/guards.js";import{loadArcade as c}from"../../support/loadArcade.js";import{DomainValidationError as l,getDomainRange as u}from"./domainUtils.js";import{RequiredFieldsCollector as d,ReferencedFieldsCollector as ee}from"./FieldCollector.js";const f=/^([0-9_])/,p=/[^a-z0-9_\u0080-\uffff]+/gi;function m(e){return e==null?null:e.trim().replaceAll(p,`_`).replace(f,`F$1`)||null}const h=[`field`,`field2`,`field3`,`normalizationField`,`rotationInfo.field`,`proportionalSymbolInfo.field`,`proportionalSymbolInfo.normalizationField`,`colorInfo.field`,`colorInfo.normalizationField`],g=[`field`,`normalizationField`];function te(e,t){if(e!=null&&t!=null){for(let n of Array.isArray(e)?e:[e])if(_(h,n,t),`visualVariables`in n&&n.visualVariables)for(let e of n.visualVariables)_(g,e,t)}}function _(e,r,i){if(e)for(let a of e){let e=t(a,r),o=e&&typeof e!=`function`&&i.get(e);o&&n(a,o.name,r)}}function ne(e,t){if(e!=null&&t?.fields?.length){if(`startField`in e){let n=t.get(e.startField),r=t.get(e.endField);e.startField=n?.name??null,e.endField=r?.name??null}else{let n=t.get(e.startTimeField),r=t.get(e.endTimeField);e.startTimeField=n?.name??null,e.endTimeField=r?.name??null}e.trackIdField=t.get(e.trackIdField)?.name??null}}const v=new Set;function y(e,t){return!e||!t?[]:(v.clear(),new d(v,e).collectAll(t),Array.from(v).sort())}function re(e,t){return t==null||e==null?[]:t.includes(`*`)?(e.fields??[]).map(e=>e.name):t}function ie(e,t,n=1){if(!t||!e)return[];if(t.includes(`*`))return[`*`];let r=y(e,t);return r.length/e.fields.length>=n?[`*`]:r}async function b(e,t,n){let{fieldsIndex:r}=e;if(!n)return;let i=t?void 0:a(n);if(i)e.collect(i);else{let{arcadeUtils:i}=await c(),a=i.extractFieldNames(n,t?.partitions??r?.fields?.map(e=>e.name)),o=t?.index?e.withFieldsIndex(t.index):e;for(let e of a)o.collect(e)}}async function x(t,n){let{fieldsIndex:r}=t;if(n&&n!==`1=1`){let a=await i(n,r&&`getTimeZone`in r?r:null);if(!a.isStandardized)throw new e(`fieldUtils:collectFilterFields`,`Where clause is not standardized`,{where:n});t.collectAll(a.fieldNames)}}function ae({displayField:e,fields:t}){return e||(t?.length?S(t):null)}function S(e){return C(e,`name-or-title`)||C(e,`unique-identifier`)||C(e,`type-or-category`)||oe(e)}function oe(e){for(let t of e){if(!t?.name)continue;let e=t.name.toLowerCase();if(e.includes(`name`)||e.includes(`title`))return t.name}return null}function C(e,t){for(let n of e)if(n?.valueType&&n.valueType===t)return n.name;return null}async function se(e){if(!e)return[];let t=new Set;return await ce(new d(t,e.fieldsIndex),e),Array.from(t).sort()}async function ce(e,t){if(!t)return;let n=t.elevationInfo?.featureExpressionInfo;if(n)return n.collectRequiredFields(e)}async function w(e,t){t.onStatisticExpression?await b(e,null,t.onStatisticExpression.expression):e.collect(t.onStatisticField)}async function le(e,t,n){if(!t||!n||!(`fields`in n))return;let r=[],i=n.popupTemplate;r.push(T(e,i)),n.fields&&r.push(...n.fields.map(async t=>w(e,t))),await Promise.all(r)}async function ue(e,t,n){let r=[];for(let i of n){let n=t.get(i);n&&r.push(w(e,n))}await Promise.all(r)}async function de(t){if(!t.loaded)throw new e(`fieldUtils:layer-not-loaded`,`The layer must be loaded before inspecting field usage.`);let{fieldsIndex:n,featureEffect:r,formTemplate:i}=t,{timeInfo:a}=t,o=[],s=[];if(t.definitionExpression){let e=t.definitionExpression;s.push(h({type:`definitionExpression`,value:e,owner:t},t=>x(t,e)))}r&&s.push(h({type:`featureEffect`,value:r,owner:t},e=>pe(e,{timeInfo:a},r.filter)));for(let e of t.displayFilterInfo?.filters??[])if(e.where){let t=e.where;s.push(h({type:`displayFilterInfo`,value:t,owner:e},e=>x(e,t)))}for(let e of t.orderBy??[])s.push(h({type:`orderBy`,value:e,owner:t},t=>E(t,e)));let{renderer:c,popupTemplate:l,featureReduction:u}=t;if(c&&s.push(h({type:`renderer`,value:c,owner:t},e=>c.collectRequiredFields?.(e))),l&&s.push(h({type:`popupTemplate`,value:l,owner:t},e=>l.collectRequiredFields(e))),i&&s.push(h({type:`formTemplate`,value:i,owner:t},async e=>{await i.collectRequiredFields(e,t.relationships??void 0)})),g(t.labelingInfo),u&&`fieldsIndex`in u){let e=u.fieldsIndex;for(let t of e.fields)s.push(h({type:`featureReduction.fields`,value:t,owner:u},e=>w(e,t)));let{renderer:t,popupTemplate:r}=u;if(t&&s.push(h({type:`featureReduction.renderer`,value:t,owner:u},e=>t.collectRequiredFields?.(e),e)),r){let t={type:`featureReduction.popupTemplate`,value:r,owner:u};s.push(h(t,t=>r.collectRequiredFields(t,{partitions:new Map([[`$feature`,e.fields.map(e=>e.name)]])}),e),h(t,e=>T(e,r,{partitions:new Map([[`$aggregatedFeatures`,n.fields.map(e=>e.name)]])})))}g(u.labelingInfo,e)}if(a&&s.push(h({type:`timeInfo`,value:a,owner:t},e=>e.collectAll([a.startField,a.endField,a.trackIdField]))),t.trackIdField){let e=t.trackIdField;s.push(h({type:`trackIdField`,value:e,owner:t},t=>t.collect(e)))}await Promise.all(s);let f=new Map,p=[];for(let{location:e,fieldNames:t,unknownNames:r}of o){for(let t of Array.from(r).sort())p.some(n=>n.fieldName===t&&m(n,e))||p.push({...e,fieldName:t});let i=y(n,Array.from(t));for(let t of i){let r=n.get(t);if(!r)continue;let i=f.get(r);i||(i=[],f.set(r,i)),i.some(t=>m(t,e))||i.push(e)}}for(let e of f.values())e.sort((e,t)=>e.type.localeCompare(t.type));return p.sort((e,t)=>e.type.localeCompare(t.type)),{unknownFields:p,getLocations(e){let t=n.get(e);return(t&&f.get(t))??[]}};function m(e,t){return e.type===t.type&&e.owner===t.owner&&e.value===t.value}async function h(e,t,r){let i=new Set,a=new Set;o.push({location:e,fieldNames:i,unknownNames:a});let s=r?new Set:i,c=r??n;await t(new ee(s,c));for(let e of s)e&&e!==`*`&&!c.has(e)&&a.add(e);r&&await ue(new d(i,n),r,s)}function g(e,t){let n=t?`featureReduction.labeling.expression`:`labeling.expression`,r=t?`featureReduction.labeling.where`:`labeling.where`;for(let i of e??[]){let e=i.getLabelExpression(),a=i.labelExpressionInfo?.expression??i.labelExpression??e.expression;if(s.push(h({type:n,value:a,owner:i},t=>P(t,e),t)),i.where){let e=i.where;s.push(h({type:r,value:e,owner:i},t=>x(t,e),t))}}}}async function fe(e,t){let{fieldsIndex:n,trackInfo:r}=t;if(!t||!r||!n)return;let i=[r.latestObservations.renderer?.collectRequiredFields(e),r.previousObservations.renderer?.collectRequiredFields(e),r.trackLines.renderer?.collectRequiredFields(e)];r.popupTemplate&&i.push(T(e,r.popupTemplate));for(let t of[r.latestObservations.labelingInfo,r.previousObservations.labelingInfo,r.trackLines.labelingInfo])if(t)for(let n of t)i.push(N(e,n));await Promise.all(i)}async function T(e,t,n){let r=[];t?.expressionInfos&&r.push(...t.expressionInfos.map(t=>b(e,n,t.expression)));let i=t?.content;if(Array.isArray(i))for(let t of i)t.type===`expression`&&t.expressionInfo&&r.push(b(e,n,t.expressionInfo.expression));await Promise.all(r)}async function pe(e,t,n){t&&(t.timeInfo&&n?.timeExtent&&e.collectAll([t.timeInfo.startField,t.timeInfo.endField]),t.floorInfo&&e.collectAll([t.floorInfo.floorField]),n?.where!=null&&await x(e,n.where))}async function me(e,t,n){t&&n&&await Promise.all(n.map(t=>E(e,t)))}async function E(e,t){t&&(t.valueExpression?await b(e,null,t.valueExpression):t.field&&e.collect(t.field))}async function he(e){if(!e)return[];let t=`timeInfo`in e&&e.timeInfo;return t?y(e.fieldsIndex,[e.trackIdField,t.startField,t.endField]):[]}function ge(e){return e?y(e.fieldsIndex,k(e)):[]}function D(e){if(!e)return[];let t=e.geometryFieldsInfo;return t?y(e.fieldsIndex,[t.shapeAreaField,t.shapeLengthField]):[]}async function _e(e,t,n){t&&n&&await Promise.all(n.filters.map(t=>x(e,t.where)))}const ve=new Set([`oid`,`global-id`,`guid`]),ye=new Set([`oid`,`global-id`]),be=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^shape$/i,/^shape_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/objectid/i,/^perimeter_/i,/_perimeter$/i,/_i$/i];function O(e){let t=new Set;A(e).forEach(e=>t.add(e)),D(e).forEach(e=>t.add(e.toLowerCase()));let n=e&&`infoFor3D`in e?e.infoFor3D:void 0;return n&&(Object.values(n.assetMapFieldRoles).forEach(e=>t.add(e.toLowerCase())),Object.values(n.transformFieldRoles).forEach(e=>t.add(e.toLowerCase()))),Array.from(t)}function k(e){if(!e)return[];let t=`editFieldsInfo`in e&&e.editFieldsInfo;if(!t)return[];let{creationDateField:n,creatorField:r,editDateField:i,editorField:a}=t;return[n,r,i,a].filter(Boolean)}function A(e){return k(e).map(e=>e.toLowerCase())}function j(e){return!!e.type}function xe(e,t){return!!e.editable&&j(e)&&!ve.has(e.type)&&!A(t).includes(e.name?.toLowerCase()??``)}function Se(e,t){let n=e.name?.toLowerCase()??``;return(t?.objectIdField==null||n!==t.objectIdField.toLowerCase())&&(t?.globalIdField==null||n!==t.globalIdField.toLowerCase())&&!O(t).includes(n)&&!ye.has(e.type)&&!be.some(e=>e.test(n))}async function Ce(e){if(!e)return[];let t=new Set;return await M(new d(t,e.fieldsIndex),e),Array.from(t).sort()}async function M(e,t){let{labelingInfo:n}=t;n?.length&&await Promise.all(n.map(t=>N(e,t)))}async function N(e,t){t&&await Promise.all([P(e,t.getLabelExpression()),x(e,t.where)])}async function P(e,t){if(t.type===`arcade`)await b(e,null,t.expression);else{let n=t.expression.match(/{[^}]*}/g);n&&n.forEach(t=>{e.collect(t.slice(1,-1))})}}function we(e){let t=e.defaultValue;if(t!==void 0&&I(e,t))return t;if(e.nullable)return null}function Te(e){let t=typeof e==`string`?{type:e}:e;if(U(t))return 255;if(t.type===`esriFieldTypeDate`||t.type===`date`)return 8}function F(e){return typeof e==`number`&&!isNaN(e)&&isFinite(e)}function Ee(e){return e===null||F(e)}function De(e){return e===null||Number.isInteger(e)}function Oe(){return!0}function I(e,t){let n;switch(e.type){case`date`:case`integer`:case`long`:case`small-integer`:case`big-integer`:case`esriFieldTypeDate`:case`esriFieldTypeInteger`:case`esriFieldTypeLong`:case`esriFieldTypeSmallInteger`:case`esriFieldTypeBigInteger`:n=e.nullable?De:Number.isInteger;break;case`double`:case`single`:case`esriFieldTypeSingle`:case`esriFieldTypeDouble`:n=e.nullable?Ee:F;break;case`string`:case`esriFieldTypeString`:n=e.nullable?o:s;break;default:n=Oe}return arguments.length===1?n:n(t)}const L=[`integer`,`small-integer`,`big-integer`,`long`],R=[`single`,`double`],ke=[...L,...R],z=[`esriFieldTypeInteger`,`esriFieldTypeSmallInteger`,`esriFieldTypeLong`,`esriFieldTypeBigInteger`],B=[`esriFieldTypeSingle`,`esriFieldTypeDouble`],V=new Set([...L,...z]),Ae=new Set([...R,...B]),je=r(V,Ae);function Me(e){return e!=null&&V.has(e.type)}function H(e){return e!=null&&je.has(e.type)}function U(e){return e!=null&&(e.type===`string`||e.type===`esriFieldTypeString`)}function W(e){return e!=null&&(e.type===`date`||e.type===`esriFieldTypeDate`)}function Ne(e){return e!=null&&(e.type===`date-only`||e.type===`esriFieldTypeDateOnly`)}function Pe(e){return e!=null&&(e.type===`guid`||e.type===`esriFieldTypeGUID`)}function Fe(e){return e!=null&&(e.type===`timestamp-offset`||e.type===`esriFieldTypeTimestampOffset`)}function Ie(e){return e!=null&&(e.type===`time-only`||e.type===`esriFieldTypeTimeOnly`)}function Le(e){return e!=null&&(e.type===`date`||e.type===`date-only`||e.type===`time-only`||e.type===`timestamp-offset`)}function Re(e){return e!=null&&(e.type===`oid`||e.type===`esriFieldTypeOID`)}function ze(e){return e!=null&&(e.type===`global-id`||e.type===`esriFieldTypeGlobalID`)}function Be(e,t){return Ue(e,t)===null}const G={OUT_OF_RANGE:`numeric-range-validation-error::out-of-range`},K={INVALID_TYPE:`type-validation-error::invalid-type`};function Ve(e){return e==null||typeof e==`number`&&isNaN(e)?null:e}function He(e){return parseFloat(e.replaceAll(`_`,``))}function Ue(e,t){return e==null||e.nullable&&t===null?null:I(e,t)?H(e)&&!We(e.type,Number(t))?G.OUT_OF_RANGE:null:K.INVALID_TYPE}function We(e,t){let n=typeof e==`string`?q(e):e;if(!n)return!1;let r=n.min,i=n.max;return n.isInteger?Number.isInteger(t)&&t>=r&&t<=i:t>=r&&t<=i}function Ge(e,t){let n=u(e,t);if(n)return n;if(H(e))return q(e.type)}function q(e){switch(e){case`esriFieldTypeSmallInteger`:case`small-integer`:return J;case`esriFieldTypeInteger`:case`esriFieldTypeLong`:case`integer`:case`long`:return Y;case`esriFieldTypeBigInteger`:case`big-integer`:return X;case`esriFieldTypeSingle`:case`single`:return Q;case`esriFieldTypeDouble`:case`double`:return Ye}}function Ke(e){if(!F(e))return null;if(Number.isInteger(e)){if(e>=J.min&&e<=J.max)return`esriFieldTypeSmallInteger`;if(e>=Y.min&&e<=Y.max)return`esriFieldTypeInteger`;if(e>=X.min&&e<=X.max)return`esriFieldTypeBigInteger`}return e>=Q.min&&e<=Q.max?`esriFieldTypeSingle`:`esriFieldTypeDouble`}const J={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},qe=-0x80000000,Je=2**31-1,Y={min:qe,max:Je,isInteger:!0,rawMin:qe,rawMax:Je},X={min:-(2**53-1),max:2**53-1,isInteger:!0,rawMin:-(2**53-1),rawMax:2**53-1},Z=(2-2**-23)*2**127,Q={min:-Z,max:Z,isInteger:!1,rawMin:-Z,rawMax:Z},Ye={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function Xe(e,t,n){switch(e){case l.INVALID_CODED_VALUE:return`Value ${n} is not in the coded domain - field: ${t.name}, domain: ${JSON.stringify(t.domain)}`;case l.VALUE_OUT_OF_RANGE:return`Value ${n} is out of the range of valid values - field: ${t.name}, domain: ${JSON.stringify(t.domain)}`;case K.INVALID_TYPE:return`Value ${n} is not a valid value for the field type - field: ${t.name}, type: ${t.type}, nullable: ${t.nullable}`;case G.OUT_OF_RANGE:{let{min:e,max:r}=q(t.type);return`Value ${n} is out of range for the number type - field: ${t.name}, type: ${t.type}, value range is ${e} to ${r}`}}}function Ze(e,t){return!$(e,t,null)}function $(e,t,n){if(!e?.attributes||!t){if(n!=null)for(let e of t??[])n.add(e);return!0}let r=new Set(Object.keys(e.attributes)),i=!1;for(let e of t)if(!r.has(e)){if(i=!0,n!=null)n.add(e);else break}return i}async function Qe(e,t){let n=new Set,r=new d(n,e.fieldsIndex);for(let e of t)await b(r,null,e);return Array.from(n).sort()}function $e(e){return e?[`raster.itempixelvalue`,`raster.servicepixelvalue`].some(t=>e.toLowerCase().startsWith(t)):!1}async function et(e,t){let n=new Set;return e?.collectRequiredFields&&await e.collectRequiredFields(new d(n,t)),Array.from(n).sort()}function tt(e){let t=e?.match(/{[^}]+}/g);return t?t.map(e=>e.slice(1,-1).split(`:`,1)[0].trim()):[]}function nt(e,t){let{statisticType:n,onStatisticField:r,onStatisticExpression:i}=e,a=t.get(r),o=H(a),s=i?.returnType;switch(n){case`avg`:case`avg_angle`:return a?o||W(a)?`double`:null:s&&s===`number`?`double`:null;case`count`:return`integer`;case`min`:case`max`:return a?o||Le(a)?a?.type??null:null:s&&s===`number`?`double`:null;case`sum`:return a?o?a?.type??null:null:s&&s===`number`?`double`:null;case`mode`:return a?a?.type??null:s?s===`number`?`double`:`string`:null;default:return null}}function rt(e){let{fieldName:t,fieldsMap:n,normalizedFieldsMap:r}=e;if(!t)return;let i=n.get(t);return i||(i=n.get(it(t))??r.get(at(t)),i&&n.set(t,i),i)}function it(e){return e.trim().toLowerCase()}function at(e){return m(e)?.toLowerCase()??``}export{G as NumericRangeValidationError,K as TypeValidationError,it as applyLowerCaseFieldName,X as bigIntegerRange,b as collectArcadeFieldNames,_e as collectDisplayFilterFields,ce as collectElevationFields,le as collectFeatureReductionFields,pe as collectFilterFields,M as collectLabelingFields,me as collectOrderByInfos,T as collectPopupTemplateFields,x as collectSQLFieldNames,fe as collectTrackInfoFields,Ye as doubleRange,tt as extractSubstitutionTemplatesFromString,Ze as featureHasFields,y as fixFields,te as fixRendererFields,ne as fixTimeInfoFields,B as floatJSONTypes,R as floatTypes,nt as getAggregateFieldType,ae as getDisplayFieldName,S as getDisplayFieldNameFromFields,k as getEditTrackingFields,se as getElevationFields,Qe as getExpressionFields,ge as getFeatureEditFields,D as getFeatureGeometryFields,Te as getFieldDefaultLength,we as getFieldDefaultValue,rt as getFieldFromIndex,Ge as getFieldRange,de as getFieldUsage,Ce as getLabelingFields,O as getLowerCaseDefaultHiddenFields,A as getLowerCaseEditTrackingFields,Ke as getNumericTypeForValue,et as getRendererFields,he as getTimeFields,z as integerJSONTypes,Y as integerRange,L as integerTypes,W as isDateField,Ne as isDateOnlyField,xe as isFieldEditable,Se as isFieldVisibleByDefault,j as isFieldWithType,ze as isGlobalIDField,Pe as isGuidField,Me as isIntegerField,We as isNumberInRange,H as isNumericField,Re as isObjectIDField,$e as isRasterPixelValueField,U as isStringField,Ie as isTimeOnlyField,Fe as isTimestampOffsetField,Be as isValidFieldValue,I as isValueMatchingFieldType,at as lowerCaseNormalizedFieldName,m as normalizeFieldName,ke as numericTypes,ie as packFields,$ as populateMissingFields,h as rendererFields,Ve as sanitizeNullFieldValue,He as sanitizedParseFloat,Q as singleRange,J as smallIntegerRange,re as unpackFieldNames,Ue as validateFieldValue,Xe as validationErrorToString,g as visualVariableFields};
2
+ import e from"../../core/Error.js";import{getDeepValue as t,setDeepValue as n}from"../../core/object.js";import{union as r}from"../../core/SetUtils.js";import{parseWhereClause as i}from"../../core/sql.js";import{getFieldNameFromSimpleExpression as a}from"../../support/arcadeExpressionUtils.js";import{isStringOrNull as o,isString as s}from"../../support/guards.js";import{loadArcade as c}from"../../support/loadArcade.js";import{DomainValidationError as l,getDomainRange as u}from"./domainUtils.js";import{RequiredFieldsCollector as d,ReferencedFieldsCollector as ee}from"./FieldCollector.js";const f=/^([0-9_])/,p=/[^a-z0-9_\u0080-\uffff]+/gi;function m(e){return e==null?null:e.trim().replaceAll(p,`_`).replace(f,`F$1`)||null}const h=[`field`,`field2`,`field3`,`normalizationField`,`rotationInfo.field`,`proportionalSymbolInfo.field`,`proportionalSymbolInfo.normalizationField`,`colorInfo.field`,`colorInfo.normalizationField`],te=[`field`,`normalizationField`];function ne(e,t){if(e!=null&&t!=null){for(let n of Array.isArray(e)?e:[e])if(g(h,n,t),`visualVariables`in n&&n.visualVariables)for(let e of n.visualVariables)g(te,e,t)}}function g(e,r,i){if(e)for(let a of e){let e=t(a,r),o=e&&typeof e!=`function`&&i.get(e);o&&n(a,o.name,r)}}function re(e,t){if(e!=null&&t?.fields?.length){if(`startField`in e){let n=t.get(e.startField),r=t.get(e.endField);e.startField=n?.name??null,e.endField=r?.name??null}else{let n=t.get(e.startTimeField),r=t.get(e.endTimeField);e.startTimeField=n?.name??null,e.endTimeField=r?.name??null}e.trackIdField=t.get(e.trackIdField)?.name??null}}const _=new Set;function v(e,t){return!e||!t?[]:(_.clear(),new d(_,e).collectAll(t),Array.from(_).sort())}function ie(e,t){return t==null||e==null?[]:t.includes(`*`)?(e.fields??[]).map(e=>e.name):t}function ae(e,t,n=1){if(!t||!e)return[];if(t.includes(`*`))return[`*`];let r=v(e,t);return r.length/e.fields.length>=n?[`*`]:r}async function y(e,t,n){let{fieldsIndex:r}=e;if(!n)return;let i=t?void 0:a(n);if(i)e.collect(i);else{let{arcadeUtils:i}=await c(),a=i.extractFieldNames(n,t?.partitions??r?.fields?.map(e=>e.name)),o=t?.index?e.withFieldsIndex(t.index):e;for(let e of a)o.collect(e)}}async function b(t,n){let{fieldsIndex:r}=t;if(n&&n!==`1=1`){let a=await i(n,r&&`getTimeZone`in r?r:null);if(!a.isStandardized)throw new e(`fieldUtils:collectFilterFields`,`Where clause is not standardized`,{where:n});t.collectAll(a.fieldNames)}}function oe({displayField:e,fields:t}){return e||(t?.length?x(t):null)}function x(e){return S(e,`name-or-title`)||S(e,`unique-identifier`)||S(e,`type-or-category`)||se(e)}function se(e){for(let t of e){if(!t?.name)continue;let e=t.name.toLowerCase();if(e.includes(`name`)||e.includes(`title`))return t.name}return null}function S(e,t){for(let n of e)if(n?.valueType&&n.valueType===t)return n.name;return null}async function ce(e){if(!e)return[];let t=new Set;return await le(new d(t,e.fieldsIndex),e),Array.from(t).sort()}async function le(e,t){if(!t)return;let n=t.elevationInfo?.featureExpressionInfo;if(n)return n.collectRequiredFields(e)}async function C(e,t){t.onStatisticExpression?await y(e,null,t.onStatisticExpression.expression):e.collect(t.onStatisticField)}async function ue(e,t,n){if(!t||!n||!(`fields`in n))return;let r=[],i=n.popupTemplate;r.push(w(e,i)),n.fields&&r.push(...n.fields.map(async t=>C(e,t))),await Promise.all(r)}async function de(e,t,n){let r=[];for(let i of n){let n=t.get(i);n&&r.push(C(e,n))}await Promise.all(r)}async function fe(e){await e.load();let{fieldsIndex:t,featureEffect:n,formTemplate:r}=e,{timeInfo:i}=e,a=[],o=[];if(e.definitionExpression){let t=e.definitionExpression;o.push(m({type:`definitionExpression`,value:t,owner:e},e=>b(e,t)))}n&&o.push(m({type:`featureEffect`,value:n,owner:e},e=>me(e,{timeInfo:i},n.filter)));for(let t of e.displayFilterInfo?.filters??[])if(t.where){let e=t.where;o.push(m({type:`displayFilterInfo`,value:e,owner:t},t=>b(t,e)))}for(let t of e.orderBy??[])o.push(m({type:`orderBy`,value:t,owner:e},e=>T(e,t)));let{renderer:s,popupTemplate:c,featureReduction:l}=e;if(s&&o.push(m({type:`renderer`,value:s,owner:e},e=>s.collectRequiredFields?.(e))),c&&o.push(m({type:`popupTemplate`,value:c,owner:e},e=>c.collectRequiredFields(e))),r&&o.push(m({type:`formTemplate`,value:r,owner:e},async t=>{await r.collectRequiredFields(t,e.relationships??void 0)})),h(e.labelingInfo),l&&`fieldsIndex`in l){let e=l.fieldsIndex;for(let t of e.fields)o.push(m({type:`featureReduction.fields`,value:t,owner:l},e=>C(e,t)));let{renderer:n,popupTemplate:r}=l;if(n&&o.push(m({type:`featureReduction.renderer`,value:n,owner:l},e=>n.collectRequiredFields?.(e),e)),r){let n={type:`featureReduction.popupTemplate`,value:r,owner:l};o.push(m(n,t=>r.collectRequiredFields(t,{partitions:new Map([[`$feature`,e.fields.map(e=>e.name)]])}),e),m(n,e=>w(e,r,{partitions:new Map([[`$aggregatedFeatures`,t.fields.map(e=>e.name)]])})))}h(l.labelingInfo,e)}if(i&&o.push(m({type:`timeInfo`,value:i,owner:e},e=>e.collectAll([i.startField,i.endField,i.trackIdField]))),e.trackIdField){let t=e.trackIdField;o.push(m({type:`trackIdField`,value:t,owner:e},e=>e.collect(t)))}await Promise.all(o);let u=new Map,f=[];for(let{location:e,fieldNames:n,unknownNames:r}of a){for(let t of Array.from(r).sort())f.some(n=>n.fieldName===t&&p(n,e))||f.push({...e,fieldName:t});let i=v(t,Array.from(n));for(let n of i){let r=t.get(n);if(!r)continue;let i=u.get(r);i||(i=[],u.set(r,i)),i.some(t=>p(t,e))||i.push(e)}}for(let e of u.values())e.sort((e,t)=>e.type.localeCompare(t.type));return f.sort((e,t)=>e.type.localeCompare(t.type)),{unknownFields:f,getLocations(e){let n=t.get(e);return(n&&u.get(n))??[]}};function p(e,t){return e.type===t.type&&e.owner===t.owner&&e.value===t.value}async function m(e,n,r){let i=new Set,o=new Set;a.push({location:e,fieldNames:i,unknownNames:o});let s=r?new Set:i,c=r??t;await n(new ee(s,c));for(let e of s)e&&e!==`*`&&!c.has(e)&&o.add(e);r&&await de(new d(i,t),r,s)}function h(e,t){let n=t?`featureReduction.labeling.expression`:`labeling.expression`,r=t?`featureReduction.labeling.where`:`labeling.where`;for(let i of e??[]){let e=i.getLabelExpression(),a=i.labelExpressionInfo?.expression??i.labelExpression??e.expression;if(o.push(m({type:n,value:a,owner:i},t=>N(t,e),t)),i.where){let e=i.where;o.push(m({type:r,value:e,owner:i},t=>b(t,e),t))}}}}async function pe(e,t){let{fieldsIndex:n,trackInfo:r}=t;if(!t||!r||!n)return;let i=[r.latestObservations.renderer?.collectRequiredFields(e),r.previousObservations.renderer?.collectRequiredFields(e),r.trackLines.renderer?.collectRequiredFields(e)];r.popupTemplate&&i.push(w(e,r.popupTemplate));for(let t of[r.latestObservations.labelingInfo,r.previousObservations.labelingInfo,r.trackLines.labelingInfo])if(t)for(let n of t)i.push(M(e,n));await Promise.all(i)}async function w(e,t,n){let r=[];t?.expressionInfos&&r.push(...t.expressionInfos.map(t=>y(e,n,t.expression)));let i=t?.content;if(Array.isArray(i))for(let t of i)t.type===`expression`&&t.expressionInfo&&r.push(y(e,n,t.expressionInfo.expression));await Promise.all(r)}async function me(e,t,n){t&&(t.timeInfo&&n?.timeExtent&&e.collectAll([t.timeInfo.startField,t.timeInfo.endField]),t.floorInfo&&e.collectAll([t.floorInfo.floorField]),n?.where!=null&&await b(e,n.where))}async function he(e,t,n){t&&n&&await Promise.all(n.map(t=>T(e,t)))}async function T(e,t){t&&(t.valueExpression?await y(e,null,t.valueExpression):t.field&&e.collect(t.field))}async function ge(e){if(!e)return[];let t=`timeInfo`in e&&e.timeInfo;return t?v(e.fieldsIndex,[e.trackIdField,t.startField,t.endField]):[]}function _e(e){return e?v(e.fieldsIndex,O(e)):[]}function E(e){if(!e)return[];let t=e.geometryFieldsInfo;return t?v(e.fieldsIndex,[t.shapeAreaField,t.shapeLengthField]):[]}async function ve(e,t,n){t&&n&&await Promise.all(n.filters.map(t=>b(e,t.where)))}const ye=new Set([`oid`,`global-id`,`guid`]),be=new Set([`oid`,`global-id`]),xe=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^shape$/i,/^shape_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/objectid/i,/^perimeter_/i,/_perimeter$/i,/_i$/i];function D(e){let t=new Set;k(e).forEach(e=>t.add(e)),E(e).forEach(e=>t.add(e.toLowerCase()));let n=e&&`infoFor3D`in e?e.infoFor3D:void 0;return n&&(Object.values(n.assetMapFieldRoles).forEach(e=>t.add(e.toLowerCase())),Object.values(n.transformFieldRoles).forEach(e=>t.add(e.toLowerCase()))),Array.from(t)}function O(e){if(!e)return[];let t=`editFieldsInfo`in e&&e.editFieldsInfo;if(!t)return[];let{creationDateField:n,creatorField:r,editDateField:i,editorField:a}=t;return[n,r,i,a].filter(Boolean)}function k(e){return O(e).map(e=>e.toLowerCase())}function A(e){return!!e.type}function Se(e,t){return!!e.editable&&A(e)&&!ye.has(e.type)&&!k(t).includes(e.name?.toLowerCase()??``)}function Ce(e,t){let n=e.name?.toLowerCase()??``;return(t?.objectIdField==null||n!==t.objectIdField.toLowerCase())&&(t?.globalIdField==null||n!==t.globalIdField.toLowerCase())&&!D(t).includes(n)&&!be.has(e.type)&&!xe.some(e=>e.test(n))}async function we(e){if(!e)return[];let t=new Set;return await j(new d(t,e.fieldsIndex),e),Array.from(t).sort()}async function j(e,t){let{labelingInfo:n}=t;n?.length&&await Promise.all(n.map(t=>M(e,t)))}async function M(e,t){t&&await Promise.all([N(e,t.getLabelExpression()),b(e,t.where)])}async function N(e,t){if(t.type===`arcade`)await y(e,null,t.expression);else{let n=t.expression.match(/{[^}]*}/g);n&&n.forEach(t=>{e.collect(t.slice(1,-1))})}}function Te(e){let t=e.defaultValue;if(t!==void 0&&F(e,t))return t;if(e.nullable)return null}function Ee(e){let t=typeof e==`string`?{type:e}:e;if(H(t))return 255;if(t.type===`esriFieldTypeDate`||t.type===`date`)return 8}function P(e){return typeof e==`number`&&!isNaN(e)&&isFinite(e)}function De(e){return e===null||P(e)}function Oe(e){return e===null||Number.isInteger(e)}function ke(){return!0}function F(e,t){let n;switch(e.type){case`date`:case`integer`:case`long`:case`small-integer`:case`big-integer`:case`esriFieldTypeDate`:case`esriFieldTypeInteger`:case`esriFieldTypeLong`:case`esriFieldTypeSmallInteger`:case`esriFieldTypeBigInteger`:n=e.nullable?Oe:Number.isInteger;break;case`double`:case`single`:case`esriFieldTypeSingle`:case`esriFieldTypeDouble`:n=e.nullable?De:P;break;case`string`:case`esriFieldTypeString`:n=e.nullable?o:s;break;default:n=ke}return arguments.length===1?n:n(t)}const I=[`integer`,`small-integer`,`big-integer`,`long`],L=[`single`,`double`],Ae=[...I,...L],R=[`esriFieldTypeInteger`,`esriFieldTypeSmallInteger`,`esriFieldTypeLong`,`esriFieldTypeBigInteger`],z=[`esriFieldTypeSingle`,`esriFieldTypeDouble`],B=new Set([...I,...R]),je=new Set([...L,...z]),Me=r(B,je);function Ne(e){return e!=null&&B.has(e.type)}function V(e){return e!=null&&Me.has(e.type)}function H(e){return e!=null&&(e.type===`string`||e.type===`esriFieldTypeString`)}function U(e){return e!=null&&(e.type===`date`||e.type===`esriFieldTypeDate`)}function Pe(e){return e!=null&&(e.type===`date-only`||e.type===`esriFieldTypeDateOnly`)}function Fe(e){return e!=null&&(e.type===`guid`||e.type===`esriFieldTypeGUID`)}function Ie(e){return e!=null&&(e.type===`timestamp-offset`||e.type===`esriFieldTypeTimestampOffset`)}function Le(e){return e!=null&&(e.type===`time-only`||e.type===`esriFieldTypeTimeOnly`)}function Re(e){return e!=null&&(e.type===`date`||e.type===`date-only`||e.type===`time-only`||e.type===`timestamp-offset`)}function ze(e){return e!=null&&(e.type===`oid`||e.type===`esriFieldTypeOID`)}function Be(e){return e!=null&&(e.type===`global-id`||e.type===`esriFieldTypeGlobalID`)}function Ve(e,t){return We(e,t)===null}const W={OUT_OF_RANGE:`numeric-range-validation-error::out-of-range`},G={INVALID_TYPE:`type-validation-error::invalid-type`};function He(e){return e==null||typeof e==`number`&&isNaN(e)?null:e}function Ue(e){return parseFloat(e.replaceAll(`_`,``))}function We(e,t){return e==null||e.nullable&&t===null?null:F(e,t)?V(e)&&!Ge(e.type,Number(t))?W.OUT_OF_RANGE:null:G.INVALID_TYPE}function Ge(e,t){let n=typeof e==`string`?K(e):e;if(!n)return!1;let r=n.min,i=n.max;return n.isInteger?Number.isInteger(t)&&t>=r&&t<=i:t>=r&&t<=i}function Ke(e,t){let n=u(e,t);if(n)return n;if(V(e))return K(e.type)}function K(e){switch(e){case`esriFieldTypeSmallInteger`:case`small-integer`:return q;case`esriFieldTypeInteger`:case`esriFieldTypeLong`:case`integer`:case`long`:return J;case`esriFieldTypeBigInteger`:case`big-integer`:return Y;case`esriFieldTypeSingle`:case`single`:return Z;case`esriFieldTypeDouble`:case`double`:return Xe}}function qe(e){if(!P(e))return null;if(Number.isInteger(e)){if(e>=q.min&&e<=q.max)return`esriFieldTypeSmallInteger`;if(e>=J.min&&e<=J.max)return`esriFieldTypeInteger`;if(e>=Y.min&&e<=Y.max)return`esriFieldTypeBigInteger`}return e>=Z.min&&e<=Z.max?`esriFieldTypeSingle`:`esriFieldTypeDouble`}const q={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},Je=-0x80000000,Ye=2**31-1,J={min:Je,max:Ye,isInteger:!0,rawMin:Je,rawMax:Ye},Y={min:-(2**53-1),max:2**53-1,isInteger:!0,rawMin:-(2**53-1),rawMax:2**53-1},X=(2-2**-23)*2**127,Z={min:-X,max:X,isInteger:!1,rawMin:-X,rawMax:X},Xe={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function Ze(e,t,n){switch(e){case l.INVALID_CODED_VALUE:return`Value ${n} is not in the coded domain - field: ${t.name}, domain: ${JSON.stringify(t.domain)}`;case l.VALUE_OUT_OF_RANGE:return`Value ${n} is out of the range of valid values - field: ${t.name}, domain: ${JSON.stringify(t.domain)}`;case G.INVALID_TYPE:return`Value ${n} is not a valid value for the field type - field: ${t.name}, type: ${t.type}, nullable: ${t.nullable}`;case W.OUT_OF_RANGE:{let{min:e,max:r}=K(t.type);return`Value ${n} is out of range for the number type - field: ${t.name}, type: ${t.type}, value range is ${e} to ${r}`}}}function Qe(e,t){return!Q(e,t,null)}function Q(e,t,n){if(!e?.attributes||!t){if(n!=null)for(let e of t??[])n.add(e);return!0}let r=new Set(Object.keys(e.attributes)),i=!1;for(let e of t)if(!r.has(e)){if(i=!0,n!=null)n.add(e);else break}return i}async function $e(e,t){let n=new Set,r=new d(n,e.fieldsIndex);for(let e of t)await y(r,null,e);return Array.from(n).sort()}function et(e){return e?[`raster.itempixelvalue`,`raster.servicepixelvalue`].some(t=>e.toLowerCase().startsWith(t)):!1}async function tt(e,t){let n=new Set;return e?.collectRequiredFields&&await e.collectRequiredFields(new d(n,t)),Array.from(n).sort()}function nt(e){let t=e?.match(/{[^}]+}/g);return t?t.map(e=>e.slice(1,-1).split(`:`,1)[0].trim()):[]}function rt(e,t){let{statisticType:n,onStatisticField:r,onStatisticExpression:i}=e,a=t.get(r),o=V(a),s=i?.returnType;switch(n){case`avg`:case`avg_angle`:return a?o||U(a)?`double`:null:s&&s===`number`?`double`:null;case`count`:return`integer`;case`min`:case`max`:return a?o||Re(a)?a?.type??null:null:s&&s===`number`?`double`:null;case`sum`:return a?o?a?.type??null:null:s&&s===`number`?`double`:null;case`mode`:return a?a?.type??null:s?s===`number`?`double`:`string`:null;default:return null}}function it(e){let{fieldName:t,fieldsMap:n,normalizedFieldsMap:r}=e;if(!t)return;let i=n.get(t);return i||(i=n.get(at(t))??r.get($(t)),i&&n.set(t,i),i)}function at(e){return e.trim().toLowerCase()}function $(e){return m(e)?.toLowerCase()??``}export{W as NumericRangeValidationError,G as TypeValidationError,at as applyLowerCaseFieldName,Y as bigIntegerRange,y as collectArcadeFieldNames,ve as collectDisplayFilterFields,le as collectElevationFields,ue as collectFeatureReductionFields,me as collectFilterFields,j as collectLabelingFields,he as collectOrderByInfos,w as collectPopupTemplateFields,b as collectSQLFieldNames,pe as collectTrackInfoFields,Xe as doubleRange,nt as extractSubstitutionTemplatesFromString,Qe as featureHasFields,v as fixFields,ne as fixRendererFields,re as fixTimeInfoFields,z as floatJSONTypes,L as floatTypes,rt as getAggregateFieldType,oe as getDisplayFieldName,x as getDisplayFieldNameFromFields,O as getEditTrackingFields,ce as getElevationFields,$e as getExpressionFields,_e as getFeatureEditFields,E as getFeatureGeometryFields,Ee as getFieldDefaultLength,Te as getFieldDefaultValue,it as getFieldFromIndex,Ke as getFieldRange,we as getLabelingFields,fe as getLayerFieldUsage,D as getLowerCaseDefaultHiddenFields,k as getLowerCaseEditTrackingFields,qe as getNumericTypeForValue,tt as getRendererFields,ge as getTimeFields,R as integerJSONTypes,J as integerRange,I as integerTypes,U as isDateField,Pe as isDateOnlyField,Se as isFieldEditable,Ce as isFieldVisibleByDefault,A as isFieldWithType,Be as isGlobalIDField,Fe as isGuidField,Ne as isIntegerField,Ge as isNumberInRange,V as isNumericField,ze as isObjectIDField,et as isRasterPixelValueField,H as isStringField,Le as isTimeOnlyField,Ie as isTimestampOffsetField,Ve as isValidFieldValue,F as isValueMatchingFieldType,$ as lowerCaseNormalizedFieldName,m as normalizeFieldName,Ae as numericTypes,ae as packFields,Q as populateMissingFields,h as rendererFields,He as sanitizeNullFieldValue,Ue as sanitizedParseFloat,Z as singleRange,q as smallIntegerRange,ie as unpackFieldNames,We as validateFieldValue,Ze as validationErrorToString,te as visualVariableFields};
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Provides utility functions for the [GeospatialPDFLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeospatialPDFLayer/).
3
+ *
4
+ * @since 6.0
5
+ * @see [GeospatialPDFLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeospatialPDFLayer/)
6
+ */
7
+ import type Extent from "../../geometry/Extent.js";
8
+ import type SpatialReference from "../../geometry/SpatialReference.js";
9
+ import type GeospatialPDFLayer from "../GeospatialPDFLayer.js";
10
+ import type { AbortOptions } from "../../core/promiseUtils.js";
11
+
12
+ /**
13
+ * todo: doc information about the unsupported PDF for the [getGeospatialPDFInfo()](https://developers.arcgis.com/javascript/latest/references/core/layers/support/geospatialPDFUtils/#getGeospatialPDFInfo) function.
14
+ * is supported - false (it wont work for layer)
15
+ * loaded - was the data for the pdf downloaded
16
+ * corrupted - is the pdf corrupt
17
+ * password protected - is the pdf password protected
18
+ * hasValidGeoreference - is the PDF properly georeferenced
19
+ */
20
+ export interface UnsupportedGeospatialPDFInfo {
21
+ isSupported: false;
22
+ loaded: boolean;
23
+ corrupted: boolean;
24
+ passwordProtected: boolean;
25
+ hasValidGeoreference: boolean;
26
+ }
27
+
28
+ /** todo: doc information about a supported geospatial PDF map frame. */
29
+ export interface GeospatialPDFMapFrameInfo {
30
+ spatialReference: SpatialReference;
31
+ page: number;
32
+ fullExtent: Extent;
33
+ neatlineExtent: Extent;
34
+ coverage: number;
35
+ }
36
+
37
+ /**
38
+ * todo: total result for PDF [getGeospatialPDFInfo()](https://developers.arcgis.com/javascript/latest/references/core/layers/support/geospatialPDFUtils/#getGeospatialPDFInfo) function.
39
+ * isSupported - true ( it will work for layer)
40
+ * data - the data type that it is
41
+ * loaded data- array buffer that represents the data of PDF
42
+ * coverage - the percent of the frame area compared to the page area
43
+ * mapframe - the map frames found in document. One per page. Max area of each page is picked.
44
+ */
45
+ export interface SupportedGeospatialPDFInfo {
46
+ isSupported: true;
47
+ title: string | null;
48
+ data: GeospatialPDFLayer["data"];
49
+ loadedData: ArrayBuffer;
50
+ mapFrames: GeospatialPDFMapFrameInfo[];
51
+ }
52
+
53
+ /** Result of [getGeospatialPDFInfo()](https://developers.arcgis.com/javascript/latest/references/core/layers/support/geospatialPDFUtils/#getGeospatialPDFInfo). */
54
+ export type GeospatialPDFInfo = UnsupportedGeospatialPDFInfo | SupportedGeospatialPDFInfo;
55
+
56
+ /**
57
+ * The GeospatialPDF info inferred for the layer
58
+ *
59
+ * @param pdfSource - The PDF file or URL.
60
+ * @param options - An object specifying additional options.
61
+ * @returns A promise that resolves to the PDF information.
62
+ */
63
+ export function getGeospatialPDFInfo(pdfSource: File | string, options?: AbortOptions): Promise<GeospatialPDFInfo>;
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{getAssetUrl as e}from"../../assets.js";import{throwIfAborted as t,onAbort as n,throwIfAbortError as r}from"../../core/promiseUtils.js";import{G as i,g as a}from"../../chunks/pdf.js";import o from"../../request.js";import{parseAttachments as s}from"../geospatialPDF/parseAttachmentUtils.js";import{parseAllFrames as c}from"../geospatialPDF/parserUtils.js";async function l(c,l={}){let p=null,m=null,h=null,g=null,_=()=>(g||=p?.destroy().catch(()=>{})??Promise.resolve(),g),v=!1,y=!1;try{t(l);let g=typeof c==`string`?c:URL.createObjectURL(c);typeof c!=`string`&&(m=g);let{data:b}=await o(g,{responseType:`array-buffer`,signal:l.signal});t(l),v=!0,i.workerSrc=e(`esri/libs/pdfjs/pdf.worker.mjs`),p=a({data:b.slice(),wasmUrl:e(`esri/libs/pdfjs/wasm/`),useWasm:!0,useWorkerFetch:!0,verbosity:0}),h=n(l,()=>{_()})??null;let x=await p.promise;t(l);let S=await x.getAttachments();t(l);let C=s(S),w=[];for(let e=1;e<=x.numPages;e++){let n=null;try{n=await x.getPage(e),t(l);let r=await n.getGeospatialPDFMetadata();t(l);let i=await u({...r,geographicBounds:C},e);t(l),i.length>0&&(w.push(i[0]),y=!0)}catch(e){r(e)}finally{n?.cleanup()}}return w.length?{isSupported:!0,title:await f(x,l),data:c,loadedData:b,mapFrames:w}:d(null,v,y)}catch(e){return t(l),r(e),d(e,v,y)}finally{m&&URL.revokeObjectURL(m),h?.remove(),await _()}}async function u(e,t){let{mapFrames:n}=await c(e);return n.map(({frame:e,pageCoveragePercent:n})=>({spatialReference:e.spatialReference,fullExtent:e.outerExtentMediabox,neatlineExtent:e.toExtent(),page:t,coverage:Math.round(n)}))}function d(e,t,n){let r=e instanceof Error?e.name:null;return{isSupported:!1,loaded:t,corrupted:r===`InvalidPDFException`,passwordProtected:r===`PasswordException`,hasValidGeoreference:n}}async function f(e,n){let{info:r}=await e.getMetadata();return t(n),r.Title||null}export{l as getGeospatialPDFInfo};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../core/accessorSupport/decorators.js";import r from"../core/Error.js";import{Loadable as i}from"../core/Loadable.js";import a from"../core/Logger.js";import{MultiOriginJSONSupportMixin as o}from"../core/MultiOriginJSONSupport.js";import{isAbortError as s}from"../core/promiseUtils.js";import{urlToObject as c}from"../core/urlUtils.js";import{generateUUID as l}from"../core/uuid.js";import u from"../geometry/Extent.js";import d from"../geometry/SpatialReference.js";import{fromJSON as f}from"../geometry/support/jsonUtils.js";import p from"../Graphic.js";import{versionMatches as m,onApplyEditsEvent as h,onUpdateMomentEvent as g,emitApplyEditsEvent as _}from"../layers/mixins/EditBusLayer.js";import{parse as v}from"../layers/support/arcgisLayerUrl.js";import y from"../request.js";import{isVersionInEditSession as b,currentSessionId as x,isSafeToEditVersion as S}from"../versionManagement/support/versionManagementUtils.js";import C from"./support/TopologyValidationJobInfo.js";import{networkFromPortalItem as w}from"./support/utils.js";let T=class extends o(i){static fromPortalItem(e){return w(e)}constructor(e){super(e),this.id=l(),this.title=null,this.layerUrl=null,this.dataElement=null,this.fullExtent=null,this.spatialReference=null,this.type=null,this.sourceJSON=null,this._historicMoment=null,this._gdbVersion=null,this._sourceIdByLayerId=new Map,this._layerIdBySourceId=new Map,this._applyEditsHandler=e=>{let{serviceUrl:t,gdbVersion:n,result:r}=e,i=t===this.featureServiceUrl,a=m(t,n,this.gdbVersion);i&&a&&r.then(e=>{b(t,n)&&(this.historicMoment=e.historicMoment)})},this._updateMomentHandler=e=>{let{serviceUrl:t,gdbVersion:n,moment:r}=e,i=t===this.featureServiceUrl,a=m(t,n,this.gdbVersion);i&&a&&(this.historicMoment=r)},this.when().then(()=>{this.addHandles([h(this._applyEditsHandler),g(this._updateMomentHandler)])},()=>{})}initialize(){this.when().catch(e=>{s(e)||a.getLogger(this).error(`#load()`,`Failed to load layer (title: '${this.title??`no title`}', id: '${this.id??`no id`}')`,{error:e})})}get loaded(){return super.loaded}get datasetName(){return this.dataElement?.name??null}get owner(){return this.dataElement?.userIdentity??null}get schemaGeneration(){return this.dataElement?.schemaGeneration??null}get parsedUrl(){return c(this.layerUrl)}get featureServiceUrl(){return v(this.parsedUrl.path).url.path}get networkServiceUrl(){return this.featureServiceUrl.replace(/\/FeatureServer/i,`/UtilityNetworkServer`)}get layerId(){return v(this.parsedUrl.path).sublayer}get networkSystemLayers(){return null}get gdbVersion(){return this._gdbVersion}set gdbVersion(e){this._gdbVersion=e}get historicMoment(){return this._historicMoment}set historicMoment(e){this._historicMoment=e}async load(e){return this.addResolvingPromise(this._load(e)),this}async _load(e){await Promise.all([this._fetchDataElement(this.featureServiceUrl,this.layerId.toString(),e),this._fetchLayerMetaData(this.layerUrl,e)])}getLayerIdBySourceId(e){if(!this.dataElement)return null;let t=this._layerIdBySourceId.get(e);if(t!=null)return t;let n=this.dataElement.domainNetworks,r=this._traverseNetworkSources(n,this._layerIdBySourceId,`sourceId`,`layerId`,e);return r>=0?r:null}getSourceIdByLayerId(e){if(!this.dataElement)return null;let t=this._sourceIdByLayerId.get(e);if(t!=null)return t;let n=this.dataElement.domainNetworks,r=this._traverseNetworkSources(n,this._sourceIdByLayerId,`layerId`,`sourceId`,e);return r>=0?r:null}getObjectIdsFromElements(e){let t=[],n=new Map;for(let t of e){let e=this.getLayerIdBySourceId(t.networkSourceId);if(e==null)continue;let r=n.get(e);r===void 0&&(r=[]),r.push(t.objectId),n.set(e,r)}let r=this.featureServiceUrl;return n.forEach((e,n)=>t.push({layerUrl:`${r}/${n}`,objectIds:e})),t}async queryNamedTraceConfigurations(e,t){let[{queryNamedTraceConfigurations:n},{default:r}]=await Promise.all([import(`../rest/networks/queryNamedTraceConfigurations.js`),import(`../rest/networks/support/QueryNamedTraceConfigurationsParameters.js`)]);return(await n(this.networkServiceUrl,r.from(e),{...t}))?.namedTraceConfigurations}async validateTopology(e,t){if(!e.validateArea)throw new r(`network:undefined-validateArea`,`the network must have validateArea defined in the validate network topology parameters.`);let[{validateNetworkTopology:n},{default:i}]=await Promise.all([import(`../rest/networks/validateNetworkTopology.js`),import(`../rest/networks/support/ValidateNetworkTopologyParameters.js`)]),a=i.from(e);b(this.featureServiceUrl,this.gdbVersion||null)?(a.sessionID=x,await S(this.featureServiceUrl,this.gdbVersion,!0)):a.sessionID=null,a.gdbVersion=this.gdbVersion;let o=this.networkServiceUrl,s=this.featureServiceUrl,c=_(s,null,this.gdbVersion,!0),l=await n(o,a,{...t});if(l?.serviceEdits){let e=[];for(let t of l.serviceEdits){let{editedFeatures:n}=t,r=n?.spatialReference?new d(n.spatialReference):null;e.push({layerId:t.layerId,editedFeatures:{adds:n?.adds?.map(e=>E(e,r))||[],updates:n?.updates?.map(e=>({original:E(e[0],r),current:E(e[1],r)}))||[],deletes:n?.deletes?.map(e=>E(e,r))||[],spatialReference:r}})}c.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],editedFeatures:e,exceededTransferLimit:!1,historicMoment:l.moment})}return l}async submitTopologyValidationJob(e,t){let n=null;if(!e.validateArea)throw new r(`network:undefined-validateArea`,`the network must have validateArea defined in the validate network topology parameters.`);if(!this.gdbVersion){let e=this.layerUrl.replace(/\/FeatureServer/i,`/VersionManagementServer`).replace(/\/\d*$/,``);n=(await y(e,{responseType:`json`,query:{f:`json`}})).data.defaultVersionName}let[{submitValidateNetworkTopologyJob:i},{default:a}]=await Promise.all([import(`../rest/networks/validateNetworkTopology.js`),import(`../rest/networks/support/ValidateNetworkTopologyParameters.js`)]),o=a.from(e);b(this.featureServiceUrl,this.gdbVersion||null)?(o.sessionID=x,await S(this.featureServiceUrl,this.gdbVersion,!0)):o.sessionID=null,o.gdbVersion=this.gdbVersion||n;let s=this.networkServiceUrl,c=this.featureServiceUrl?_(this.featureServiceUrl,null,this.gdbVersion,!0):void 0,l=await i(s,o,{...t});return new C({statusUrl:l,editsResolver:c})}getSourceTypeById(e){if(!this.dataElement)return null;for(let t of this.dataElement.domainNetworks)for(let n of[t.edgeSources??[],t.junctionSources??[]])for(let r of n)if(r.sourceId===e)return n===t.edgeSources?`edge`:`junction`;return null}_traverseNetworkSources(e,t,n,r,i){for(let a of e)for(let e of[a.edgeSources??[],a.junctionSources??[]])for(let a of e)if(a[n]===i)return t.set(i,a[r]),a[r];return-1}async _fetchLayerMetaData(e,t){let{data:n}=await y(e,{responseType:`json`,query:{f:`json`},...t});this.sourceJSON=n,this.read(n,{origin:`service`})}async _fetchDataElement(e,t,n){if(this.dataElement)return;let i=(await y(`${e}/queryDataElements`,{responseType:`json`,query:{layers:JSON.stringify([t]),f:`json`},...n})).data.layerDataElements?.[0];if(!(i&&typeof i==`object`&&`dataElement`in i&&i.dataElement&&typeof i.dataElement==`object`))throw new r(`network:invalid-data-element`,`No data element was found for layer ${t}.`);this.read(i,{origin:`service`})}};e([t({type:String,nonNullable:!0,json:{origins:{"web-map":{read:!0,write:{isRequired:!0}}},read:!1}})],T.prototype,`id`,void 0),e([t({type:String,nonNullable:!0,json:{origins:{"web-map":{read:!0,write:{isRequired:!0}},service:{read:{source:`name`}}},read:!1}})],T.prototype,`title`,void 0),e([t({type:String,nonNullable:!0,json:{origins:{"web-map":{read:{source:`url`},write:{target:`url`,isRequired:!0}}},read:!1}})],T.prototype,`layerUrl`,void 0),e([t({type:Object,json:{origins:{service:{read:!0}},read:!1}})],T.prototype,`dataElement`,void 0),e([t({type:u,json:{origins:{service:{read:{source:`extent`}}},read:!1}})],T.prototype,`fullExtent`,void 0),e([t({type:d,json:{origins:{service:{read:{source:`extent.spatialReference`}}},read:!1}})],T.prototype,`spatialReference`,void 0),e([t({type:[`utility`,`trace`],readOnly:!0,json:{read:!1,write:!1}})],T.prototype,`type`,void 0),e([t({readOnly:!0})],T.prototype,`datasetName`,null),e([t({readOnly:!0})],T.prototype,`owner`,null),e([t({readOnly:!0})],T.prototype,`schemaGeneration`,null),e([t({readOnly:!0})],T.prototype,`parsedUrl`,null),e([t({readOnly:!0})],T.prototype,`featureServiceUrl`,null),e([t({readOnly:!0})],T.prototype,`networkServiceUrl`,null),e([t({readOnly:!0})],T.prototype,`layerId`,null),e([t()],T.prototype,`sourceJSON`,void 0),e([t({readOnly:!0})],T.prototype,`networkSystemLayers`,null),e([t({type:String})],T.prototype,`gdbVersion`,null),e([t({type:Date})],T.prototype,`historicMoment`,null),e([t()],T.prototype,`_historicMoment`,void 0),e([t()],T.prototype,`_gdbVersion`,void 0),T=e([n(`esri.networks.Network`)],T);function E(e,t){return new p({attributes:e.attributes,geometry:f({...e.geometry,spatialReference:t})})}export{T as default};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../core/accessorSupport/decorators.js";import r from"../core/Error.js";import{Loadable as i}from"../core/Loadable.js";import a from"../core/Logger.js";import{MultiOriginJSONSupportMixin as o}from"../core/MultiOriginJSONSupport.js";import{isAbortError as s}from"../core/promiseUtils.js";import{urlToObject as c}from"../core/urlUtils.js";import{generateUUID as l}from"../core/uuid.js";import u from"../geometry/Extent.js";import d from"../geometry/SpatialReference.js";import{fromJSON as f}from"../geometry/support/jsonUtils.js";import p from"../Graphic.js";import{versionMatches as m,onApplyEditsEvent as h,onUpdateMomentEvent as g,emitApplyEditsEvent as _}from"../layers/mixins/EditBusLayer.js";import{parse as v}from"../layers/support/arcgisLayerUrl.js";import y from"../request.js";import{isVersionInEditSession as b,currentSessionId as x,isSafeToEditVersion as S}from"../versionManagement/support/versionManagementUtils.js";import C from"./support/TopologyValidationJobInfo.js";import{networkFromPortalItem as w}from"./support/utils.js";let T=class extends o(i){static fromPortalItem(e){return w(e)}constructor(e){super(e),this.id=l(),this.title=null,this.layerUrl=null,this.dataElement=null,this.fullExtent=null,this.spatialReference=null,this.type=null,this.sourceJSON=null,this._historicMoment=null,this._gdbVersion=null,this._sourceIdByLayerId=new Map,this._layerIdBySourceId=new Map,this._applyEditsHandler=e=>{let{serviceUrl:t,gdbVersion:n,result:r}=e,i=t===this.featureServiceUrl,a=m(t,n,this.gdbVersion);i&&a&&r.then(e=>{b(t,n)&&(this.historicMoment=e.historicMoment)},()=>{})},this._updateMomentHandler=e=>{let{serviceUrl:t,gdbVersion:n,moment:r}=e,i=t===this.featureServiceUrl,a=m(t,n,this.gdbVersion);i&&a&&(this.historicMoment=r)},this.when().then(()=>{this.addHandles([h(this._applyEditsHandler),g(this._updateMomentHandler)])},()=>{})}initialize(){this.when().catch(e=>{s(e)||a.getLogger(this).error(`#load()`,`Failed to load layer (title: '${this.title??`no title`}', id: '${this.id??`no id`}')`,{error:e})})}get loaded(){return super.loaded}get datasetName(){return this.dataElement?.name??null}get owner(){return this.dataElement?.userIdentity??null}get schemaGeneration(){return this.dataElement?.schemaGeneration??null}get parsedUrl(){return c(this.layerUrl)}get featureServiceUrl(){return v(this.parsedUrl.path).url.path}get networkServiceUrl(){return this.featureServiceUrl.replace(/\/FeatureServer/i,`/UtilityNetworkServer`)}get layerId(){return v(this.parsedUrl.path).sublayer}get networkSystemLayers(){return null}get gdbVersion(){return this._gdbVersion}set gdbVersion(e){this._gdbVersion=e}get historicMoment(){return this._historicMoment}set historicMoment(e){this._historicMoment=e}async load(e){return this.addResolvingPromise(this._load(e)),this}async _load(e){await Promise.all([this._fetchDataElement(this.featureServiceUrl,this.layerId.toString(),e),this._fetchLayerMetaData(this.layerUrl,e)])}getLayerIdBySourceId(e){if(!this.dataElement)return null;let t=this._layerIdBySourceId.get(e);if(t!=null)return t;let n=this.dataElement.domainNetworks,r=this._traverseNetworkSources(n,this._layerIdBySourceId,`sourceId`,`layerId`,e);return r>=0?r:null}getSourceIdByLayerId(e){if(!this.dataElement)return null;let t=this._sourceIdByLayerId.get(e);if(t!=null)return t;let n=this.dataElement.domainNetworks,r=this._traverseNetworkSources(n,this._sourceIdByLayerId,`layerId`,`sourceId`,e);return r>=0?r:null}getObjectIdsFromElements(e){let t=[],n=new Map;for(let t of e){let e=this.getLayerIdBySourceId(t.networkSourceId);if(e==null)continue;let r=n.get(e);r===void 0&&(r=[]),r.push(t.objectId),n.set(e,r)}let r=this.featureServiceUrl;return n.forEach((e,n)=>t.push({layerUrl:`${r}/${n}`,objectIds:e})),t}async queryNamedTraceConfigurations(e,t){let[{queryNamedTraceConfigurations:n},{default:r}]=await Promise.all([import(`../rest/networks/queryNamedTraceConfigurations.js`),import(`../rest/networks/support/QueryNamedTraceConfigurationsParameters.js`)]);return(await n(this.networkServiceUrl,r.from(e),{...t}))?.namedTraceConfigurations}async validateTopology(e,t){if(!e.validateArea)throw new r(`network:undefined-validateArea`,`the network must have validateArea defined in the validate network topology parameters.`);let[{validateNetworkTopology:n},{default:i}]=await Promise.all([import(`../rest/networks/validateNetworkTopology.js`),import(`../rest/networks/support/ValidateNetworkTopologyParameters.js`)]),a=i.from(e);b(this.featureServiceUrl,this.gdbVersion||null)?(a.sessionID=x,await S(this.featureServiceUrl,this.gdbVersion,!0)):a.sessionID=null,a.gdbVersion=this.gdbVersion;let o=this.networkServiceUrl,s=this.featureServiceUrl,c=_(s,null,this.gdbVersion,!0),l=await n(o,a,{...t});if(l?.serviceEdits){let e=[];for(let t of l.serviceEdits){let{editedFeatures:n}=t,r=n?.spatialReference?new d(n.spatialReference):null;e.push({layerId:t.layerId,editedFeatures:{adds:n?.adds?.map(e=>E(e,r))||[],updates:n?.updates?.map(e=>({original:E(e[0],r),current:E(e[1],r)}))||[],deletes:n?.deletes?.map(e=>E(e,r))||[],spatialReference:r}})}c.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],editedFeatures:e,exceededTransferLimit:!1,historicMoment:l.moment})}return l}async submitTopologyValidationJob(e,t){let n=null;if(!e.validateArea)throw new r(`network:undefined-validateArea`,`the network must have validateArea defined in the validate network topology parameters.`);if(!this.gdbVersion){let e=this.layerUrl.replace(/\/FeatureServer/i,`/VersionManagementServer`).replace(/\/\d*$/,``);n=(await y(e,{responseType:`json`,query:{f:`json`}})).data.defaultVersionName}let[{submitValidateNetworkTopologyJob:i},{default:a}]=await Promise.all([import(`../rest/networks/validateNetworkTopology.js`),import(`../rest/networks/support/ValidateNetworkTopologyParameters.js`)]),o=a.from(e);b(this.featureServiceUrl,this.gdbVersion||null)?(o.sessionID=x,await S(this.featureServiceUrl,this.gdbVersion,!0)):o.sessionID=null,o.gdbVersion=this.gdbVersion||n;let s=this.networkServiceUrl,c=this.featureServiceUrl?_(this.featureServiceUrl,null,this.gdbVersion,!0):void 0,l=await i(s,o,{...t});return new C({statusUrl:l,editsResolver:c})}getSourceTypeById(e){if(!this.dataElement)return null;for(let t of this.dataElement.domainNetworks)for(let n of[t.edgeSources??[],t.junctionSources??[]])for(let r of n)if(r.sourceId===e)return n===t.edgeSources?`edge`:`junction`;return null}_traverseNetworkSources(e,t,n,r,i){for(let a of e)for(let e of[a.edgeSources??[],a.junctionSources??[]])for(let a of e)if(a[n]===i)return t.set(i,a[r]),a[r];return-1}async _fetchLayerMetaData(e,t){let{data:n}=await y(e,{responseType:`json`,query:{f:`json`},...t});this.sourceJSON=n,this.read(n,{origin:`service`})}async _fetchDataElement(e,t,n){if(this.dataElement)return;let i=(await y(`${e}/queryDataElements`,{responseType:`json`,query:{layers:JSON.stringify([t]),f:`json`},...n})).data.layerDataElements?.[0];if(!(i&&typeof i==`object`&&`dataElement`in i&&i.dataElement&&typeof i.dataElement==`object`))throw new r(`network:invalid-data-element`,`No data element was found for layer ${t}.`);this.read(i,{origin:`service`})}};e([t({type:String,nonNullable:!0,json:{origins:{"web-map":{read:!0,write:{isRequired:!0}}},read:!1}})],T.prototype,`id`,void 0),e([t({type:String,nonNullable:!0,json:{origins:{"web-map":{read:!0,write:{isRequired:!0}},service:{read:{source:`name`}}},read:!1}})],T.prototype,`title`,void 0),e([t({type:String,nonNullable:!0,json:{origins:{"web-map":{read:{source:`url`},write:{target:`url`,isRequired:!0}}},read:!1}})],T.prototype,`layerUrl`,void 0),e([t({type:Object,json:{origins:{service:{read:!0}},read:!1}})],T.prototype,`dataElement`,void 0),e([t({type:u,json:{origins:{service:{read:{source:`extent`}}},read:!1}})],T.prototype,`fullExtent`,void 0),e([t({type:d,json:{origins:{service:{read:{source:`extent.spatialReference`}}},read:!1}})],T.prototype,`spatialReference`,void 0),e([t({type:[`utility`,`trace`],readOnly:!0,json:{read:!1,write:!1}})],T.prototype,`type`,void 0),e([t({readOnly:!0})],T.prototype,`datasetName`,null),e([t({readOnly:!0})],T.prototype,`owner`,null),e([t({readOnly:!0})],T.prototype,`schemaGeneration`,null),e([t({readOnly:!0})],T.prototype,`parsedUrl`,null),e([t({readOnly:!0})],T.prototype,`featureServiceUrl`,null),e([t({readOnly:!0})],T.prototype,`networkServiceUrl`,null),e([t({readOnly:!0})],T.prototype,`layerId`,null),e([t()],T.prototype,`sourceJSON`,void 0),e([t({readOnly:!0})],T.prototype,`networkSystemLayers`,null),e([t({type:String})],T.prototype,`gdbVersion`,null),e([t({type:Date})],T.prototype,`historicMoment`,null),e([t()],T.prototype,`_historicMoment`,void 0),e([t()],T.prototype,`_gdbVersion`,void 0),T=e([n(`esri.networks.Network`)],T);function E(e,t){return new p({attributes:e.attributes,geometry:f({...e.geometry,spatialReference:t})})}export{T as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{strict as r}from"../../core/jsonMap.js";import{createAbortError as i}from"../../core/promiseUtils.js";import a from"../../request.js";import o from"../../rest/networks/support/ValidateNetworkTopologyResult.js";import{enumeration as s}from"../../core/accessorSupport/decorators/enumeration.js";const c=r()({Pending:`job-waiting`,InProgress:`job-executing`,Completed:`job-succeeded`});let l=class extends o{constructor(e){super(e),this.statusUrl=null,this.status=null,this.submissionTime=null,this.lastUpdatedTime=null,this._timer=void 0}destroy(){clearInterval(this._timer)}async checkJobStatus(e){let t={...e,query:{f:`json`}},{data:n}=await a(this.statusUrl,t);return this.read(n),this.editsResolver&&this.editsResolver.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:!0,historicMoment:null}),this}async waitForJobCompletion(e={}){let{interval:t=1e3,statusCallback:n}=e;return new Promise((e,r)=>{this._clearTimer();let a=setInterval(()=>{this._timer||r(i()),this.checkJobStatus().then(t=>{let{status:r}=t;switch(this.status=r,r){case`job-succeeded`:this._clearTimer(),e(this);break;case`job-waiting`:case`job-executing`:n&&n(this)}},e=>{this._clearTimer(),r(e)})},t);this._timer=a})}_clearTimer(){clearInterval(this._timer),this._timer=void 0}};e([t()],l.prototype,`editsResolver`,void 0),e([t({type:String,json:{write:!0}})],l.prototype,`statusUrl`,void 0),e([s(c)],l.prototype,`status`,void 0),e([t({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.submissionTime=e?e.getTime():null}}}})],l.prototype,`submissionTime`,void 0),e([t({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.lastUpdatedTime=e?e.getTime():null}}}})],l.prototype,`lastUpdatedTime`,void 0),l=e([n(`esri.networks.support.TopologyValidationJobInfo`)],l);export{l as default};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{strict as r}from"../../core/jsonMap.js";import{createAbortError as i}from"../../core/promiseUtils.js";import a from"../../request.js";import o from"../../rest/networks/support/ValidateNetworkTopologyResult.js";import{enumeration as s}from"../../core/accessorSupport/decorators/enumeration.js";const c=r()({Pending:`job-waiting`,InProgress:`job-executing`,Completed:`job-succeeded`});let l=class extends o{constructor(e){super(e),this.statusUrl=null,this.status=null,this.submissionTime=null,this.lastUpdatedTime=null,this._timer=void 0}destroy(){clearInterval(this._timer)}async checkJobStatus(e){let t={...e,query:{f:`json`}},{data:n}=await a(this.statusUrl,t).catch(e=>{throw typeof e?.details?.raw?.extendedCode==`number`&&this.editsResolver?.reject(e),e});return this.read(n),this.editsResolver&&this.status===`job-succeeded`&&this.editsResolver.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:!0,historicMoment:null}),this}async waitForJobCompletion(e={}){let{interval:t=1e3,statusCallback:n}=e;return new Promise((e,r)=>{this._clearTimer();let a=setInterval(()=>{this._timer||r(i()),this.checkJobStatus().then(t=>{let{status:r}=t;switch(this.status=r,r){case`job-succeeded`:this._clearTimer(),e(this);break;case`job-waiting`:case`job-executing`:n&&n(this)}},e=>{this._clearTimer(),r(e)})},t);this._timer=a})}_clearTimer(){clearInterval(this._timer),this._timer=void 0}};e([t()],l.prototype,`editsResolver`,void 0),e([t({type:String,json:{write:!0}})],l.prototype,`statusUrl`,void 0),e([s(c)],l.prototype,`status`,void 0),e([t({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.submissionTime=e?e.getTime():null}}}})],l.prototype,`submissionTime`,void 0),e([t({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.lastUpdatedTime=e?e.getTime():null}}}})],l.prototype,`lastUpdatedTime`,void 0),l=e([n(`esri.networks.support.TopologyValidationJobInfo`)],l);export{l as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "6.0.0-next.55",
3
+ "version": "6.0.0-next.57",
4
4
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
5
5
  "keywords": [
6
6
  "ArcGIS",
@@ -19,14 +19,14 @@
19
19
  "type": "module",
20
20
  "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
- "@amcharts/amcharts5": "~5.24.1",
23
- "@arcgis/toolkit": "6.0.0-next.55",
22
+ "@amcharts/amcharts5": "~5.25.0",
23
+ "@arcgis/toolkit": "6.0.0-next.57",
24
24
  "@esri/arcgis-html-sanitizer": "~4.2.0",
25
- "@esri/calcite-components": "^5.2.1",
25
+ "@esri/calcite-components": "^5.2.2",
26
26
  "@vaadin/grid": "~25.3.7",
27
27
  "@zip.js/zip.js": "~2.25.1",
28
28
  "luxon": "~3.7.2",
29
- "marked": "~18.3.0",
29
+ "marked": "~18.4.0",
30
30
  "tslib": "^2.8.1"
31
31
  }
32
32
  }
@@ -64,30 +64,30 @@ export interface CIMSymbolProperties extends SymbolProperties, Partial<Pick<CIMS
64
64
  * <th>Role</th>
65
65
  * </tr>
66
66
  * <tr>
67
- * <td><a href="#CIMPointSymbol">CIMPointSymbol</a></td>
68
- * <td>Marker layers: <a href="#CIMVectorMarker">CIMVectorMarker</a>, <a href="#CIMPictureMarker">CIMPictureMarker</a></td>
67
+ * <td><a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMPointSymbol">CIMPointSymbol</a></td>
68
+ * <td>Marker layers: <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMVectorMarker">CIMVectorMarker</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMPictureMarker">CIMPictureMarker</a></td>
69
69
  * <td>Draw relative to the point geometry</td>
70
70
  * </tr>
71
71
  * <tr>
72
- * <td rowspan="2"><a href="#CIMLineSymbol">CIMLineSymbol</a></td>
73
- * <td>Marker layers: <a href="#CIMVectorMarker">CIMVectorMarker</a>, <a href="#CIMPictureMarker">CIMPictureMarker</a></td>
72
+ * <td rowspan="2"><a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMLineSymbol">CIMLineSymbol</a></td>
73
+ * <td>Marker layers: <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMVectorMarker">CIMVectorMarker</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMPictureMarker">CIMPictureMarker</a></td>
74
74
  * <td>Draw at specified locations relative to the line geometry.</td>
75
75
  * </tr>
76
76
  * <tr>
77
- * <td>Stroke layers: <a href="#CIMSolidStroke">CIMSolidStroke</a>, <a href="#CIMPictureStroke">CIMPictureStroke</a>, <a href="#CIMGradientStroke">CIMGradientStroke</a></td>
77
+ * <td>Stroke layers: <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSolidStroke">CIMSolidStroke</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMPictureStroke">CIMPictureStroke</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMGradientStroke">CIMGradientStroke</a></td>
78
78
  * <td>Draw relative to the line geometry. </td>
79
79
  * </tr>
80
80
  * <tr>
81
- * <td rowspan="3"><a href="#CIMPolygonSymbol">CIMPolygonSymbol</a></td>
82
- * <td>Marker layers: <a href="#CIMVectorMarker">CIMVectorMarker</a>, <a href="#CIMPictureMarker">CIMPictureMarker</a></td>
81
+ * <td rowspan="3"><a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMPolygonSymbol">CIMPolygonSymbol</a></td>
82
+ * <td>Marker layers: <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMVectorMarker">CIMVectorMarker</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMPictureMarker">CIMPictureMarker</a></td>
83
83
  * <td>Draw relative to the polygon outline or within the polygon interior, depending on the marker placement setting.</td>
84
84
  * </tr>
85
85
  * <tr>
86
- * <td>Stroke layers: <a href="#CIMSolidStroke">CIMSolidStroke</a>, <a href="#CIMPictureStroke">CIMPictureStroke</a>, <a href="#CIMGradientStroke">CIMGradientStroke</a></td>
86
+ * <td>Stroke layers: <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSolidStroke">CIMSolidStroke</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMPictureStroke">CIMPictureStroke</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMGradientStroke">CIMGradientStroke</a></td>
87
87
  * <td>Draw relative to the polygon outline. </td>
88
88
  * </tr>
89
89
  * <tr>
90
- * <td>Fill layers: <a href="#CIMSolidFill">CIMSolidFill</a>, <a href="#CIMHatchFill">CIMHatchFill</a>, <a href="#CIMPictureFill">CIMPictureFill</a>, <a href="#CIMGradientFill">CIMGradientFill</a></td>
90
+ * <td>Fill layers: <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSolidFill">CIMSolidFill</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMHatchFill">CIMHatchFill</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMPictureFill">CIMPictureFill</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMGradientFill">CIMGradientFill</a></td>
91
91
  * <td>Draw relative to the polygon interior.</td>
92
92
  * </tr>
93
93
  * </tbody>
@@ -150,7 +150,7 @@ export default class PathSymbol3DLayer extends Symbol3DLayer {
150
150
  * @default true
151
151
  * @since 4.11
152
152
  * @example
153
- * // disables shadow casting
153
+ * // disable shadow casting
154
154
  * symbolLayer.castShadows = false;
155
155
  */
156
156
  accessor castShadows: boolean;
@@ -4,7 +4,7 @@ import type { WaterBodySize, WaveStrength } from "./types.js";
4
4
  import type { ColorLike } from "../Color.js";
5
5
  import type { Symbol3DLayerProperties } from "./Symbol3DLayer.js";
6
6
 
7
- export interface WaterSymbol3DLayerProperties extends Symbol3DLayerProperties, Partial<Pick<WaterSymbol3DLayer, "waterbodySize" | "waveDirection" | "waveStrength">> {
7
+ export interface WaterSymbol3DLayerProperties extends Symbol3DLayerProperties, Partial<Pick<WaterSymbol3DLayer, "castShadows" | "waterbodySize" | "waveDirection" | "waveStrength">> {
8
8
  /**
9
9
  * The dominant color used to shade the water. The water has different shades of the dominant color based
10
10
  * on the reflection of the light. The image below shows how different types of water can be represented with
@@ -58,6 +58,18 @@ export interface WaterSymbol3DLayerProperties extends Symbol3DLayerProperties, P
58
58
  */
59
59
  export default class WaterSymbol3DLayer extends Symbol3DLayer {
60
60
  constructor(properties?: WaterSymbol3DLayerProperties);
61
+ /**
62
+ * Indicates whether the symbol layer geometry casts shadows in the scene.
63
+ * Shadows require direct shadows to be enabled in [SceneView.environment](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#environment).
64
+ * This property has no effect when the symbol layer is draped on the ground.
65
+ *
66
+ * @default true
67
+ * @since 6.0
68
+ * @example
69
+ * // disable shadow casting
70
+ * symbolLayer.castShadows = false;
71
+ */
72
+ accessor castShadows: boolean;
61
73
  /**
62
74
  * The dominant color used to shade the water. The water has different shades of the dominant color based
63
75
  * on the reflection of the light. The image below shows how different types of water can be represented with
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../Color.js";import{property as n,subclass as r}from"../core/accessorSupport/decorators.js";import{Integer as i}from"../core/accessorSupport/ensureType.js";import a from"./Symbol3DLayer.js";import{enumeration as o}from"../core/accessorSupport/decorators/enumeration.js";var s;let c=class extends a{static{s=this}constructor(e){super(e),this.color=l.clone(),this.type=`water`,this.waterbodySize=`medium`,this.waveDirection=null,this.waveStrength=`moderate`}clone(){return new s({color:this.color.clone(),waterbodySize:this.waterbodySize,waveDirection:this.waveDirection,waveStrength:this.waveStrength})}};e([n({type:t,nonNullable:!0,json:{type:[i],write:(e,t,n)=>t[n]=e.toArray(1),default:()=>l.clone(),defaultEquals:e=>e.toCss(!0)===l.toCss(!0)}})],c.prototype,`color`,void 0),e([o({Water:`water`},{readOnly:!0})],c.prototype,`type`,void 0),e([n({type:[`small`,`medium`,`large`],json:{write:!0,default:`medium`}})],c.prototype,`waterbodySize`,void 0),e([n({type:Number,json:{write:!0,default:null}})],c.prototype,`waveDirection`,void 0),e([n({type:[`calm`,`rippled`,`slight`,`moderate`],json:{write:!0,default:`moderate`}})],c.prototype,`waveStrength`,void 0),c=s=e([r(`esri.symbols.WaterSymbol3DLayer`)],c);const l=new t([0,119,190]);export{c as default};
2
+ import{__decorate as e}from"tslib";import t from"../Color.js";import{property as n,subclass as r}from"../core/accessorSupport/decorators.js";import{Integer as i}from"../core/accessorSupport/ensureType.js";import a from"./Symbol3DLayer.js";import{enumeration as o}from"../core/accessorSupport/decorators/enumeration.js";var s;let c=class extends a{static{s=this}constructor(e){super(e),this.color=l.clone(),this.castShadows=!0,this.type=`water`,this.waterbodySize=`medium`,this.waveDirection=null,this.waveStrength=`moderate`}clone(){return new s({castShadows:this.castShadows,color:this.color.clone(),waterbodySize:this.waterbodySize,waveDirection:this.waveDirection,waveStrength:this.waveStrength})}};e([n({type:t,nonNullable:!0,json:{type:[i],write:(e,t,n)=>t[n]=e.toArray(1),default:()=>l.clone(),defaultEquals:e=>e.toCss(!0)===l.toCss(!0)}})],c.prototype,`color`,void 0),e([n({type:Boolean,nonNullable:!0,json:{write:!1,read:!0}})],c.prototype,`castShadows`,void 0),e([o({Water:`water`},{readOnly:!0})],c.prototype,`type`,void 0),e([n({type:[`small`,`medium`,`large`],json:{write:!0,default:`medium`}})],c.prototype,`waterbodySize`,void 0),e([n({type:Number,json:{write:!0,default:null}})],c.prototype,`waveDirection`,void 0),e([n({type:[`calm`,`rippled`,`slight`,`moderate`],json:{write:!0,default:`moderate`}})],c.prototype,`waveStrength`,void 0),c=s=e([r(`esri.symbols.WaterSymbol3DLayer`)],c);const l=new t([0,119,190]);export{c as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t}from"../../core/accessorSupport/decorators/property.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{EventedMixin as r}from"../../core/Evented.js";import{when as i,watch as a,syncAndInitial as o}from"../../core/reactiveUtils.js";import{create as s,equals as c,intersection as l,union as u}from"../../geometry/support/aaBoundingRect.js";import{IntegratedMeshSemantics as d}from"../../layers/support/IntegratedMeshSemantics.js";import f from"../GroundView.js";import{isIntegratedMeshLayerView as p}from"../support/layerViewUtils.js";import{noBudget as m}from"../support/Scheduler.js";import{ElevationRange as h}from"./support/ElevationRange.js";import{toBoundingRect as g}from"./support/extentUtils.js";import{webMercatorWorldExtent as _,geographicWorldExtent as v}from"./terrain/TerrainConst.js";const y=Symbol(`integrated-mesh-elevation-providers`);let b=class extends r(f){initialize(){super.initialize(),this.addHandles(i(()=>this._terrainSurface,e=>e.on(`elevation-change`,e=>this._elevationChange(e)))),a(()=>this._integratedMeshGroundLayerViews,()=>{this.removeHandles(y),this.addHandles(this._integratedMeshGroundLayerViews.map(({elevationProvider:e})=>e.on(`elevation-change`,e=>this._elevationChange(e))),y)},o),this.addHandles([a(()=>this.memoizedElevationQueryDependencies,()=>{this.emit(`elevation-query-change`)})])}get memoizedElevationQueryDependencies(){return(this.ground?.allLayers??[]).filter(e=>e.type===`elevation`||e.type===`integrated-mesh`||e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain).map(e=>e.memoizedElevationQueryDependencies)}_elevationChange(e){this.emit(`elevation-change`,e)}get _integratedMeshGroundLayerViews(){return[...this.view?.basemapView?.groundLayerViews.filter(p).filter(e=>d.shouldRegisterGroundElevationProvider(!1,e.replacesTerrain))??[],...this.layerViews.filter(p).filter(e=>d.shouldRegisterGroundElevationProvider(!0,e.replacesTerrain))]}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return!this.hasTerrainReplacement&&(this._terrainSurface?.enabled??!1)}get spatialReference(){return this._terrainSurface?.spatialReference}get userClippingExtent(){let{spatialReference:e}=this,{clippingArea:t}=this.view;if(t==null||e==null)return null;let n=s(),r=g(t,n,e)?n:null,i=this._get(`userClippingExtent`);return c(r,i)?i:r}isUpdating(){return this._usingTerrain&&this._terrainSurface.updating||super.isUpdating()}getElevation(e,t,n,r){let i=this._usingTerrain?this._terrainSurface?.getElevation(e,t,n,r):null;return this._integratedMeshGroundLayerViews.reduce((i,a)=>{let o=a.elevationProvider.getElevation(e,t,n,r);return o==null?i:Math.max(o,i??o)},i)}getElevations(e,t,n){let r=this.view.groundSpatialReference;if(r==null)for(let e=0;e<t;++e)n(e,null);else for(let i=0;i<t;++i){let t=i*3;n(i,this.getElevation(e[t],e[t+1],e[t+2],r))}}intersect(e,t,n,r){this.intersectBudgeted(e,t,n,r,m)}intersectBudgeted(e,t,n,r,i){return this._usingTerrain&&!this._terrainSurface.intersectBudgeted(e,t,n,r,i)?!1:(this._integratedMeshGroundLayerViews.forEach(i=>i.intersect(e,t,n,r)),!0)}getSphereElevationRange(e,t,n){let r=this._usingTerrain?this._terrainSurface?.getSphereElevationRange?.(e,t):null;return this._integratedMeshGroundLayerViews.reduce((n,r)=>{let i=r.elevationProvider.getSphereElevationRange?.(e,t);return i==null||(n??=new h,n.expandElevationRange(i)),n},r?new h(r.minElevation,r.maxElevation):null)}getRootElevationRange(){let e=this._usingTerrain?this._terrainSurface?.getRootElevationRange?.():null;return this._integratedMeshGroundLayerViews.reduce((e,t)=>{let n=t.elevationProvider.getRootElevationRange?.();return n==null||(e??=new h,e.expandElevationRange(n)),e},e?new h(e.minElevation,e.maxElevation):null)}get elevationQueryCache(){let e=this.view?.basemapTerrain;return e?.enabled?e.elevationQueryCache:null}get elevationQueryReady(){for(let e of this.ground?.allLayers??[])if(e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain&&e.loadStatus!==`failed`&&e.queryElevationCallback==null)return!1;return!0}get groundExtent(){let{fullGroundExtent:e}=this;return e?this.userClippingExtent?l(e,this.userClippingExtent,s()):this.fullGroundExtent:null}get fullGroundExtent(){let e=this._usingTerrain?this._terrainSurface.fullGroundExtent:null;if(this._integratedMeshGroundLayerViews.length===0)return e;let t=this.view.spatialReference;if(!t.isWebMercator&&!t.isWGS84)return e;let n=S(t);return e?u(e,n,s()):n}get visibleElevationRange(){let e=this._usingTerrain?this._terrainSurface.visibleElevationRange:null,t=this._integratedMeshGroundLayerViews.reduce((e,t)=>e==null?new h(t.visibleElevationRange.minElevation,t.visibleElevationRange.maxElevation):(e.expandElevationRange(t.visibleElevationRange),e),e?new h(e.minElevation,e.maxElevation):null);return t&&!t.isEmpty?t:x}get opaque(){return this._usingTerrain&&this._terrainSurface.opaque||this._integratedMeshGroundLayerViews.some(({opaque:e})=>e)}get invisible(){return(!this._usingTerrain||this._terrainSurface.invisible)&&this._integratedMeshGroundLayerViews.every(({invisible:e})=>e)}get baseOpacity(){return this.ground?.opacity??1}get wireframe(){return this._usingTerrain?this._terrainSurface?.wireframe??!1:!1}get freeze(){return this._usingTerrain&&(this._terrainSurface?.freeze??!1)||this._integratedMeshGroundLayerViews.some(e=>e.type===`integrated-mesh-3dtiles`&&e.freeze)}set freeze(e){this._usingTerrain&&(this._terrainSurface.freeze=e),this._integratedMeshGroundLayerViews.forEach(t=>{t.type===`integrated-mesh-3dtiles`&&(t.freeze=e)})}get suspended(){return(!this._usingTerrain||super.suspended)&&this._integratedMeshGroundLayerViews.length>0&&this._integratedMeshGroundLayerViews.every(({suspended:e})=>e)}get ready(){return!this._usingTerrain&&this._integratedMeshGroundLayerViews.length===0?!1:(!this._usingTerrain||this._terrainSurface.ready)&&this._integratedMeshGroundLayerViews.every(({ready:e})=>e)}updateOverlayParameters(){this._terrainSurface?.updateOverlayParameters()}requestRender(e){this.view.stage.renderView?.requestRender(e)}};e([t()],b.prototype,`memoizedElevationQueryDependencies`,null),e([t({readOnly:!0})],b.prototype,`_integratedMeshGroundLayerViews`,null),e([t({readOnly:!0})],b.prototype,`_terrainSurface`,null),e([t({readOnly:!0})],b.prototype,`_usingTerrain`,null),e([t({readOnly:!0})],b.prototype,`spatialReference`,null),e([t({readOnly:!0})],b.prototype,`userClippingExtent`,null),e([t({readOnly:!0})],b.prototype,`elevationQueryCache`,null),e([t()],b.prototype,`elevationQueryReady`,null),e([t({readOnly:!0})],b.prototype,`groundExtent`,null),e([t({readOnly:!0})],b.prototype,`fullGroundExtent`,null),e([t({readOnly:!0})],b.prototype,`visibleElevationRange`,null),e([t({readOnly:!0})],b.prototype,`opaque`,null),e([t({readOnly:!0})],b.prototype,`invisible`,null),e([t({readOnly:!0})],b.prototype,`baseOpacity`,null),e([t({readOnly:!0})],b.prototype,`wireframe`,null),e([t()],b.prototype,`freeze`,null),e([t({readOnly:!0})],b.prototype,`suspended`,null),e([t({readOnly:!0})],b.prototype,`ready`,null),b=e([n(`esri.views.3d.GroundView3D`)],b);const x=new h(0,0);function S(e){return e.isWebMercator?_:v}export{b as GroundView3D};
2
+ import{__decorate as e}from"tslib";import{property as t}from"../../core/accessorSupport/decorators/property.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{EventedMixin as r}from"../../core/Evented.js";import{when as i,watch as a,syncAndInitial as o}from"../../core/reactiveUtils.js";import{create as s,equals as c,intersection as l,union as u}from"../../geometry/support/aaBoundingRect.js";import{IntegratedMeshSemantics as d}from"../../layers/support/IntegratedMeshSemantics.js";import f from"../GroundView.js";import{isIntegratedMeshLayerView as p}from"../support/layerViewUtils.js";import{noBudget as m}from"../support/Scheduler.js";import{ElevationRange as h}from"./support/ElevationRange.js";import{toBoundingRect as g}from"./support/extentUtils.js";import{webMercatorWorldExtent as _,geographicWorldExtent as v}from"./terrain/TerrainConst.js";const y=Symbol(`integrated-mesh-elevation-providers`);let b=class extends r(f){initialize(){super.initialize(),this.addHandles(i(()=>this._terrainSurface,e=>e.on(`elevation-change`,e=>this._elevationChange(e)))),a(()=>this._integratedMeshGroundLayerViews,()=>{this.removeHandles(y),this.addHandles(this._integratedMeshGroundLayerViews.map(({elevationProvider:e})=>e.on(`elevation-change`,e=>this._elevationChange(e))),y)},o),this.addHandles([a(()=>this.memoizedElevationQueryDependencies,()=>{this.emit(`elevation-query-change`)})])}get memoizedElevationQueryDependencies(){return(this.ground?.allLayers??[]).filter(e=>e.type===`elevation`||e.type===`integrated-mesh`||e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain).map(e=>e.memoizedElevationQueryDependencies)}_elevationChange(e){this.emit(`elevation-change`,e)}get _integratedMeshGroundLayerViews(){return[...this.view?.basemapView?.groundLayerViews.filter(p).filter(e=>d.shouldRegisterGroundElevationProvider(!1,e.replacesTerrain))??[],...this.layerViews.filter(p).filter(e=>d.shouldRegisterGroundElevationProvider(!0,e.replacesTerrain))]}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return!this.hasTerrainReplacement&&(this._terrainSurface?.enabled??!1)}get spatialReference(){return this._terrainSurface?.spatialReference}get userClippingExtent(){let{spatialReference:e}=this,{clippingArea:t}=this.view;if(t==null||e==null)return null;let n=s(),r=g(t,n,e)?n:null,i=this._get(`userClippingExtent`);return c(r,i)?i:r}isUpdating(){return this._usingTerrain&&this._terrainSurface.updating||super.isUpdating()}getElevation(e,t,n,r){let i=this._usingTerrain?this._terrainSurface?.getElevation(e,t,n,r):null;return this._integratedMeshGroundLayerViews.reduce((i,a)=>{let o=a.elevationProvider.getElevation(e,t,n,r);return o==null?i:Math.max(o,i??o)},i)}getElevations(e,t,n){let r=this.view.groundSpatialReference;if(r==null)for(let e=0;e<t;++e)n(e,null);else for(let i=0;i<t;++i){let t=i*3;n(i,this.getElevation(e[t],e[t+1],e[t+2],r))}}intersect(e,t,n,r){this.intersectBudgeted(e,t,n,r,m)}intersectBudgeted(e,t,n,r,i){return this._usingTerrain&&!this._terrainSurface.intersectBudgeted(e,t,n,r,i)?!1:this._integratedMeshGroundLayerViews.every(a=>a.intersect(e,t,n,r,i))}getSphereElevationRange(e,t,n){let r=this._usingTerrain?this._terrainSurface?.getSphereElevationRange?.(e,t):null;return this._integratedMeshGroundLayerViews.reduce((n,r)=>{let i=r.elevationProvider.getSphereElevationRange?.(e,t);return i==null||(n??=new h,n.expandElevationRange(i)),n},r?new h(r.minElevation,r.maxElevation):null)}getRootElevationRange(){let e=this._usingTerrain?this._terrainSurface?.getRootElevationRange?.():null;return this._integratedMeshGroundLayerViews.reduce((e,t)=>{let n=t.elevationProvider.getRootElevationRange?.();return n==null||(e??=new h,e.expandElevationRange(n)),e},e?new h(e.minElevation,e.maxElevation):null)}get elevationQueryCache(){let e=this.view?.basemapTerrain;return e?.enabled?e.elevationQueryCache:null}get elevationQueryReady(){for(let e of this.ground?.allLayers??[])if(e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain&&e.loadStatus!==`failed`&&e.queryElevationCallback==null)return!1;return!0}get groundExtent(){let{fullGroundExtent:e}=this;return e?this.userClippingExtent?l(e,this.userClippingExtent,s()):this.fullGroundExtent:null}get fullGroundExtent(){let e=this._usingTerrain?this._terrainSurface.fullGroundExtent:null;if(this._integratedMeshGroundLayerViews.length===0)return e;let t=this.view.spatialReference;if(!t.isWebMercator&&!t.isWGS84)return e;let n=S(t);return e?u(e,n,s()):n}get visibleElevationRange(){let e=this._usingTerrain?this._terrainSurface.visibleElevationRange:null,t=this._integratedMeshGroundLayerViews.reduce((e,t)=>e==null?new h(t.visibleElevationRange.minElevation,t.visibleElevationRange.maxElevation):(e.expandElevationRange(t.visibleElevationRange),e),e?new h(e.minElevation,e.maxElevation):null);return t&&!t.isEmpty?t:x}get opaque(){return this._usingTerrain&&this._terrainSurface.opaque||this._integratedMeshGroundLayerViews.some(({opaque:e})=>e)}get invisible(){return(!this._usingTerrain||this._terrainSurface.invisible)&&this._integratedMeshGroundLayerViews.every(({invisible:e})=>e)}get baseOpacity(){return this.ground?.opacity??1}get wireframe(){return this._usingTerrain?this._terrainSurface?.wireframe??!1:!1}get freeze(){return this._usingTerrain&&(this._terrainSurface?.freeze??!1)||this._integratedMeshGroundLayerViews.some(e=>e.type===`integrated-mesh-3dtiles`&&e.freeze)}set freeze(e){this._usingTerrain&&(this._terrainSurface.freeze=e),this._integratedMeshGroundLayerViews.forEach(t=>{t.type===`integrated-mesh-3dtiles`&&(t.freeze=e)})}get suspended(){return(!this._usingTerrain||super.suspended)&&this._integratedMeshGroundLayerViews.length>0&&this._integratedMeshGroundLayerViews.every(({suspended:e})=>e)}get ready(){return!this._usingTerrain&&this._integratedMeshGroundLayerViews.length===0?!1:(!this._usingTerrain||this._terrainSurface.ready)&&this._integratedMeshGroundLayerViews.every(({ready:e})=>e)}updateOverlayParameters(){this._terrainSurface?.updateOverlayParameters()}requestRender(e){this.view.stage.renderView?.requestRender(e)}};e([t()],b.prototype,`memoizedElevationQueryDependencies`,null),e([t({readOnly:!0})],b.prototype,`_integratedMeshGroundLayerViews`,null),e([t({readOnly:!0})],b.prototype,`_terrainSurface`,null),e([t({readOnly:!0})],b.prototype,`_usingTerrain`,null),e([t({readOnly:!0})],b.prototype,`spatialReference`,null),e([t({readOnly:!0})],b.prototype,`userClippingExtent`,null),e([t({readOnly:!0})],b.prototype,`elevationQueryCache`,null),e([t()],b.prototype,`elevationQueryReady`,null),e([t({readOnly:!0})],b.prototype,`groundExtent`,null),e([t({readOnly:!0})],b.prototype,`fullGroundExtent`,null),e([t({readOnly:!0})],b.prototype,`visibleElevationRange`,null),e([t({readOnly:!0})],b.prototype,`opaque`,null),e([t({readOnly:!0})],b.prototype,`invisible`,null),e([t({readOnly:!0})],b.prototype,`baseOpacity`,null),e([t({readOnly:!0})],b.prototype,`wireframe`,null),e([t()],b.prototype,`freeze`,null),e([t({readOnly:!0})],b.prototype,`suspended`,null),e([t({readOnly:!0})],b.prototype,`ready`,null),b=e([n(`esri.views.3d.GroundView3D`)],b);const x=new h(0,0);function S(e){return e.isWebMercator?_:v}export{b as GroundView3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{isSome as r,equals as i}from"../../../core/arrayUtils.js";import{createTask as a}from"../../../core/asyncUtils.js";import o from"../../../core/Error.js";import"../../../core/has.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as c}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import l from"../../../core/Logger.js";import{abortMaybe as u,destroyMaybe as d}from"../../../core/maybe.js";import{after as f,throwIfAborted as p,isPromiseLike as m}from"../../../core/promiseUtils.js";import{watch as h,syncAndInitial as g}from"../../../core/reactiveUtils.js";import{createScreenPointArray as _,createRenderScreenPointArray as v}from"../../../core/screenUtils.js";import{UpdatingHandles as y}from"../../../core/support/UpdatingHandles.js";import{convertTime as b,getDateTimeUTC as x}from"../../../core/timeUtils.js";import{containsExecute as S}from"../../../geometry/operators/containsOperator.js";import{projectAsync as C}from"../../../geometry/projectionUtils.js";import{equals as w}from"../../../geometry/support/boundedPlane.js";import{getSunlightIntervals as T}from"../../../time/daylightUtils.js";import{breadthFirstBinaryPartitioning as E}from"../../../widgets/support/traversalUtils.js";import{polygonToVolume as D}from"../focusAreaUtils.js";import{ElevationContext as O}from"../layers/graphics/ElevationContext.js";import{longitudeToTimezone as k}from"../support/earthUtils.js";import{computeDirectionsOverTime as A}from"../support/sunUtils.js";import{maxColorRampSize as j}from"../webgl-engine/shaders/colorRampParameters.js";import M from"./AnalysisView3D.js";import{registerAnalysisView as N,hideOtherAnalysisViews as P}from"./ShadowCast/analysisViewRegister.js";import F from"./ShadowCast/ShadowCastError.js";import{ShadowCastTooltip as I}from"./ShadowCast/ShadowCastTooltip.js";let L=class extends M{constructor(e){super(e),this.type=`shadow-cast-view-3d`,this.analysis=null,this._updatingHandles=new y,this._visibleOverride=null,this._stopPreviewingTask=null,this._updatedRecently=!1,this._tooltip=null,this._previousVolume=null}initialize(){this.addHandles([N(this.view,this),h(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{u(this._stopPreviewingTask),this._updatedRecently=!0,this._stopPreviewingTask=a(async e=>{await f(W,e),p(e),this._updatedRecently=!1})},{sync:!0,initial:!0,equals:(e,t)=>H(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),h(()=>({renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t},n)=>{t&&P(this.view,this),(t||n?.visible)&&e?.setParameters({shadowCast:{enabled:t}})},g),h(()=>({renderer:this._renderer,parameters:this._visualizationParameters,visible:this.visible}),({renderer:e,parameters:t,visible:n})=>{z(e,n,t)},g),h(()=>({renderer:this._renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext,visible:this.visible}),({renderer:e,lightDirections:t,lightDirectionsContext:n,visible:r})=>{z(e,r,{lightDirections:t,lightDirectionsContext:n})},g),h(()=>({renderer:this._renderer,previewing:this._previewing,visible:this.visible}),({renderer:e,previewing:t,visible:n})=>{z(e,n,{previewing:t})},{sync:!0,initial:!0,equals:()=>!1}),h(()=>({analysisVolume:this._analysisVolume,renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t,analysisVolume:n})=>{z(e,t,{analysisVolume:n})},g)]),this.interactive=!0,this._tooltip=new I({getDuration:(e,t)=>this._getDurationAtScreen(e,t),getMode:()=>this.analysis.mode,getShowsSeparateZeroBucketInHourlyMode:()=>this._showsSeparateZeroBucketInHourlyMode,getTotalDuration:()=>this._totalDuration,getTotalDurationMode:()=>this.analysis.totalDurationOptions.mode,getVisualizeSunlight:()=>this.analysis.visualizeSunlight,isVisible:()=>this.interactive&&this.visible,view:this.view})}destroy(){this.visible&&z(this._renderer,!0,{enabled:!1}),this._tooltip=d(this._tooltip),this._stopPreviewingTask=u(this._stopPreviewingTask),this._updatingHandles=d(this._updatingHandles)}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return this._previewing||this._stopPreviewingTask!=null&&!this._stopPreviewingTask.finished||this._tooltip?.updating===!0||this._updatingHandles.updating}get visible(){let e=(this.parent?.visible&&!this.parent.suspended)??!0;return(this._visibleOverride??e)&&this.error==null}set visible(e){this._visibleOverride=e}get error(){let e=this._sunlightIntervals;switch(e.state){case`ready`:break;case`unavailable`:return new F(e.state,`The camera's geographic reference position is not available.`);default:return new F(e.state,`The selected date, time zone, or daylight calculation could not be resolved.`)}let{startTimeOfDay:t,endTimeOfDay:n}=this.analysis;if(!Number.isFinite(t)||!Number.isFinite(n)||t<0||n>b(1,`days`,`milliseconds`)||n<t)return new F(`invalid`,`The selected time range must be ordered and within the calendar day.`);let r=this._startDateTimeUTC.getTime(),i=this._endDateTimeUTC.getTime();if(!Number.isFinite(r)||!Number.isFinite(i)||i<r)return new F(`invalid`,`The selected time range could not be resolved to ordered UTC instants.`);let{intervals:a}=e;return a.length?a.some(e=>r>=e.start&&i<=e.end)?null:a.length>1?new F(`split-daylight`,`Daylight crosses midnight in the selected time zone and the selected time range includes nighttime.`):new F(`outside-daylight`,`The selected time range includes nighttime at the current camera location.`):new F(`no-daylight`,`No daylight is expected at the current camera location on the selected date.`)}get _sunlightIntervals(){let{date:e}=this.analysis,t=this._timeZone;return T({date:e,timeZone:t,utcOffset:t==null?this._effectiveUtcOffset:0,position:this._referencePosition})}get _previewing(){let e=this._updatedRecently,t=this._sceneUpdating;return e||t}get _sceneUpdating(){let{view:e}=this;if(e?.allLayerViews==null)return!0;let{stationary:t,navigating:n,interacting:r,graphicsView:i}=e,a=!t||n||r,o=this._shadowLayerViews.some(e=>e.updating),s=!i?.suspended&&!!i?.updating;return a||o||s}get _timeZone(){return this.analysis.timeZoneMode===`region`?this.view.timeZone:null}get _effectiveUtcOffset(){return this.analysis.utcOffset??this._utcOffsetAuto}get _utcOffsetAuto(){let e=this._referencePosition;return e==null?0:k(e[0],!1)}get _startDateTimeUTC(){return this._getDateTimeUTC(this.analysis.startTimeOfDay)}get _endDateTimeUTC(){return this._getDateTimeUTC(this.analysis.endTimeOfDay)}_getDateTimeUTC(e){let{date:t}=this.analysis,n=this._timeZone,r=x({date:t,millisecondsSinceMidnight:e,timeZone:n,utcOffset:n==null?this._effectiveUtcOffset:0});if(r==null)throw RangeError(`Invalid shadow cast date or time zone`);return r}get _referencePosition(){return this.view?.environmentView?.referencePositionGeographic}get _totalDurationInterval(){return this._totalDuration>0?Math.floor(this._totalDuration/(G-1)):G}get _interval(){let e=this._totalDurationInterval;switch(this.analysis.mode){case`min-duration`:return this._totalDuration>0?e:0;case`total-duration`:return e;case`discrete`:return this.analysis.discreteOptions.interval||e}}get _intervalContext(){let{mode:e,minDurationOptions:t}=this.analysis;return e===`min-duration`&&t.contextEnabled?t.contextOptions.interval||this._totalDurationInterval:-1}get _totalDurationSampleCount(){return this._lightDirections.length}get _totalDuration(){return this._endDateTimeUTC.getTime()-this._startDateTimeUTC.getTime()}get _lightDirections(){return this.error==null?this._calculateLightDirections(this._interval):[]}get _lightDirectionsContext(){return this.error==null?this._calculateLightDirections(this._intervalContext):[]}_calculateLightDirections(e){let{view:t}=this;if(e<=0)return[];let n=t.viewingMode===`global`?K:this._referencePosition;if(n==null)return[];let r=A(this._startDateTimeUTC,this._endDateTimeUTC,e,n,t.state.isGlobal,G),i=r.length;q.length=0;let a=E(0,i,q),o=Array(i);for(let e=0;e<i;++e)o[e]=r[a[e]];return o}get _analysisVolume(){let{geometry:e}=this.analysis;if(e==null)return this._previousVolume=null,null;try{let t=D(e,this.view,J);return t==null?(this._previousVolume=null,null):m(t)?(this._updatingHandles.consumePromise(t),this._previousVolume):(this._previousVolume=t,t)}catch(t){return l.getLogger(this).error(new o(`shadowcastanalysisview3d:projection-failed`,`Failed to project analysis area geometry to view spatial reference`,{geometry:e,error:t})),null}}get _visualizationParameters(){if(!this.visible)return null;switch(this.analysis.mode){case`min-duration`:return this._minDurationVisualizationParameters;case`total-duration`:return this._durationVisualizationParameters;case`discrete`:return this._discreteVisualizationParameters}}get _minDurationVisualizationParameters(){let{color:e,minDuration:t}=this.analysis.minDurationOptions,n=this._totalDuration;return{rendersSunlight:this.analysis.visualizeSunlight,visualization:2,thresholdColor:e.toUnitRGBA(),threshold:n>0?t/this._totalDuration:0,...this._minDurationContextVisualizationParameters}}get _minDurationContextVisualizationParameters(){let{minDurationOptions:e,visualizeSunlight:t}=this.analysis;if(!e.contextEnabled||t)return{};let{color:n,colorStops:r}=e.contextOptions,i=1/this._lightDirectionsContext.length;return{visualization:3,gradientColorRamp:this._getEffectiveShadowCastColorRamp(n,r,i)}}get _durationVisualizationParameters(){let{color:e,colorStops:t,mode:n}=this.analysis.totalDurationOptions,r=this._totalDuration,i=r>0&&n===`hourly`?U/r:0,a=this._getEffectiveShadowCastColorRamp(e,t,1/r);return i===0?{...this._discreteVisualizationParameters,gradientColorRamp:a}:{rendersSunlight:this.analysis.visualizeSunlight,bandedGradientColorRamp:a,visualization:1,bandSize:i}}get _showsSeparateZeroBucketInHourlyMode(){let{colorStops:e}=this.analysis.totalDurationOptions;return e==null||e.length===0||e.reduce((e,t)=>Math.min(e,t.value),1/0)<=0}get _discreteVisualizationParameters(){let{color:e,colorStops:t}=this.analysis.discreteOptions,n=1/this._lightDirections.length;return{rendersSunlight:this.analysis.visualizeSunlight,gradientColorRamp:this._getEffectiveShadowCastColorRamp(e,t,n),visualization:0}}get _shadowLayerViews(){return this.view.allLayerViews.items.filter(V)}get _previewDependencies(){if(this.error!=null)return null;let{view:e}=this,t=e.slice.plane,n=this._shadowLayerViews,i=n.map(e=>e.layer).filter(r),a=n.map(e=>e.suspended),o=i.map(e=>e.visible),s=i.map(e=>e.opacity),c=!!e.graphicsView?.suspended,l=i.filter(e=>`definitionExpression`in e).map(e=>e.definitionExpression),u=n.filter(e=>`filter`in e).map(e=>e.filter);return{slicePlane:t,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:a,graphicsViewSuspended:c,layerVisibilities:o,layerOpacities:s,filters:u,definitionExpressions:l}}get _renderer(){return this.view?.stage?.renderer}get testData(){}async getDurationAtScreen(e){return this._getDurationAtScreen(e)}async _getDurationAtScreen(e,t){if(!await this._isScreenPointInAnalysisArea(e,t))return-1;let{_renderer:n,_totalDurationSampleCount:r}=this;if(n==null||r===0)return 0;let i=this.view.state.camera.screenToRender(_(e.x,e.y),v()),a=n.readAccumulatedShadow(i);return(this.analysis.visualizeSunlight?1-a:a)*this._totalDuration}async _isScreenPointInAnalysisArea(e,t){let{geometry:n}=this.analysis;if(!n)return!0;let r=await this.view.hitTest(e);p(t);let i=r.results.find(e=>e.mapPoint)?.mapPoint??r?.ground?.mapPoint;if(!i)return!1;let a=await C(i,n.spatialReference,{signal:t});return p(t),a!=null&&S(n,a)}_getEffectiveShadowCastColorRamp(e,t,n){if(t!=null){t.length>j&&l.getLogger(this).warnOnce(`ShadowCastAnalysis supports at most 8 color stops`);let e=t.map(e=>[e.value*n,e.color.toUnitRGBA()]);return e.sort(([e],[t])=>e-t),e}return B(e)}};e([t({readOnly:!0,type:[`shadow-cast-view-3d`]})],L.prototype,`type`,void 0),e([t({constructOnly:!0,nonNullable:!0})],L.prototype,`analysis`,void 0),e([t({readOnly:!0})],L.prototype,`updating`,null),e([t()],L.prototype,`visible`,null),e([t()],L.prototype,`error`,null),e([t()],L.prototype,`_visibleOverride`,void 0),e([t()],L.prototype,`_sunlightIntervals`,null),e([t()],L.prototype,`_stopPreviewingTask`,void 0),e([t()],L.prototype,`_updatedRecently`,void 0),e([t()],L.prototype,`_tooltip`,void 0),e([t()],L.prototype,`_sceneUpdating`,null),e([t()],L.prototype,`_timeZone`,null),e([t()],L.prototype,`_effectiveUtcOffset`,null),e([t()],L.prototype,`_utcOffsetAuto`,null),e([t()],L.prototype,`_startDateTimeUTC`,null),e([t()],L.prototype,`_endDateTimeUTC`,null),e([t()],L.prototype,`_referencePosition`,null),e([t()],L.prototype,`_interval`,null),e([t()],L.prototype,`_intervalContext`,null),e([t()],L.prototype,`_totalDurationSampleCount`,null),e([t()],L.prototype,`_totalDuration`,null),e([t()],L.prototype,`_lightDirections`,null),e([t()],L.prototype,`_lightDirectionsContext`,null),e([t()],L.prototype,`_analysisVolume`,null),e([t()],L.prototype,`_visualizationParameters`,null),e([t()],L.prototype,`_minDurationVisualizationParameters`,null),e([t()],L.prototype,`_minDurationContextVisualizationParameters`,null),e([t()],L.prototype,`_durationVisualizationParameters`,null),e([t()],L.prototype,`_showsSeparateZeroBucketInHourlyMode`,null),e([t()],L.prototype,`_discreteVisualizationParameters`,null),e([t()],L.prototype,`_shadowLayerViews`,null),e([t()],L.prototype,`_previewDependencies`,null),e([t()],L.prototype,`_renderer`,null),L=e([n(`esri.views.3d.analysis.ShadowCastAnalysisView3D`)],L);const R=L;function z(e,t,n){t&&n!=null&&e?.setParameters({shadowCast:n})}function B(e){let t=e.toUnitRGBA();return[[0,c(t[0],t[1],t[2],0)],[1,t]]}function V(e){if(e.suspended)return!1;switch(e.type){case`building-scene-3d`:case`csv-3d`:case`elevation-3d`:case`feature-3d`:case`gaussian-splat-3d`:case`geojson-3d`:case`integrated-mesh-3d`:case`integrated-mesh-3dtiles`:case`ogc-feature-3d`:case`route-3d`:case`scene-layer-3d`:case`scene-layer-graphics-3d`:case`stream-3d`:case`wms-3d`:case`catalog-footprint-3d`:return!0;case`base-dynamic-3d`:case`catalog-3d`:case`catalog-dynamic-group-3d`:case`dimension-3d`:case`imagery-3d`:case`imagery-tile-3d`:case`line-of-sight-3d`:case`map-image-3d`:case`point-cloud-3d`:case`tile-3d`:case`vector-tile-3d`:case`viewshed-3d`:case`voxel-3d`:case`wfs-3d`:case`wmts-3d`:case`media-3d`:case`group`:return!1;case`graphics-3d`:case`sketch-3d`:return e.layer.graphics.some(e=>{let{symbol:t}=e;return t==null||t.type!==`text`&&!(`symbolLayers`in t)||t.type!==`text`&&t.symbolLayers.some(e=>e.type!==`text`)});default:return!1}}function H(e,t){if(e===t||e==null&&t==null)return!0;if(e==null||t==null)return!1;let n=w(e.slicePlane,t.slicePlane),r=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),a=i(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,o=i(e.layerVisibilities,t.layerVisibilities),s=i(e.layerOpacities,t.layerOpacities),c=i(e.filters,t.filters),l=i(e.definitionExpressions,t.definitionExpressions);return n&&r&&a&&o&&s&&c&&l}const U=b(1,`hours`,`milliseconds`),W=500,G=255,K=s(),q=[],J=new O;export{R as default};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{isSome as r,equals as i}from"../../../core/arrayUtils.js";import{createTask as a}from"../../../core/asyncUtils.js";import o from"../../../core/Error.js";import"../../../core/has.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as c}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import l from"../../../core/Logger.js";import{abortMaybe as u,destroyMaybe as d}from"../../../core/maybe.js";import{after as f,throwIfAborted as p,isPromiseLike as m}from"../../../core/promiseUtils.js";import{watch as h,syncAndInitial as g}from"../../../core/reactiveUtils.js";import{createScreenPointArray as _,createRenderScreenPointArray as v}from"../../../core/screenUtils.js";import{UpdatingHandles as y}from"../../../core/support/UpdatingHandles.js";import{convertTime as b,getDateTimeUTC as x}from"../../../core/timeUtils.js";import{containsExecute as S}from"../../../geometry/operators/containsOperator.js";import{projectAsync as C}from"../../../geometry/projectionUtils.js";import{equals as w}from"../../../geometry/support/boundedPlane.js";import{getSunlightIntervals as T}from"../../../time/daylightUtils.js";import{breadthFirstBinaryPartitioning as E}from"../../../widgets/support/traversalUtils.js";import{polygonToVolume as D}from"../focusAreaUtils.js";import{ElevationContext as O}from"../layers/graphics/ElevationContext.js";import{longitudeToTimezone as k}from"../support/earthUtils.js";import{computeDirectionsOverTime as A}from"../support/sunUtils.js";import{maxColorRampSize as j}from"../webgl-engine/shaders/colorRampParameters.js";import M from"./AnalysisView3D.js";import{registerAnalysisView as N,hideOtherAnalysisViews as P}from"./ShadowCast/analysisViewRegister.js";import F from"./ShadowCast/ShadowCastError.js";import{ShadowCastTooltip as I}from"./ShadowCast/ShadowCastTooltip.js";let L=class extends M{constructor(e){super(e),this.type=`shadow-cast-view-3d`,this.analysis=null,this._updatingHandles=new y,this._visibleOverride=null,this._stopPreviewingTask=null,this._updatedRecently=!1,this._tooltip=null,this._previousVolume=null}initialize(){this.addHandles([N(this.view,this),h(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{u(this._stopPreviewingTask),this._updatedRecently=!0,this._stopPreviewingTask=a(async e=>{await f(W,e),p(e),this._updatedRecently=!1})},{sync:!0,initial:!0,equals:(e,t)=>H(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),h(()=>({renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t},n)=>{t&&P(this.view,this),(t||n?.visible)&&e?.setParameters({shadowCast:{enabled:t}})},g),h(()=>({renderer:this._renderer,parameters:this._visualizationParameters,visible:this.visible}),({renderer:e,parameters:t,visible:n})=>{z(e,n,t)},g),h(()=>({renderer:this._renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext,visible:this.visible}),({renderer:e,lightDirections:t,lightDirectionsContext:n,visible:r})=>{z(e,r,{lightDirections:t,lightDirectionsContext:n})},g),h(()=>({renderer:this._renderer,previewing:this._previewing,visible:this.visible}),({renderer:e,previewing:t,visible:n})=>{z(e,n,{previewing:t})},{sync:!0,initial:!0,equals:()=>!1}),h(()=>({analysisVolume:this._analysisVolume,renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t,analysisVolume:n})=>{z(e,t,{analysisVolume:n})},g)]),this.interactive=!0,this._tooltip=new I({getDuration:(e,t)=>this._getDurationAtScreen(e,t),getMode:()=>this.analysis.mode,getShowsSeparateZeroBucketInHourlyMode:()=>this._showsSeparateZeroBucketInHourlyMode,getTotalDuration:()=>this._totalDuration,getTotalDurationMode:()=>this.analysis.totalDurationOptions.mode,getVisualizeSunlight:()=>this.analysis.visualizeSunlight,isVisible:()=>this.interactive&&this.visible,view:this.view})}destroy(){this.visible&&z(this._renderer,!0,{enabled:!1}),this._tooltip=d(this._tooltip),this._stopPreviewingTask=u(this._stopPreviewingTask),this._updatingHandles=d(this._updatingHandles)}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return this._previewing||this._stopPreviewingTask!=null&&!this._stopPreviewingTask.finished||this._tooltip?.updating===!0||this._updatingHandles.updating}get visible(){let e=(this.parent?.visible&&!this.parent.suspended)??!0;return(this._visibleOverride??e)&&this.error==null}set visible(e){this._visibleOverride=e}get error(){let e=this._sunlightIntervals;switch(e.state){case`ready`:break;case`unavailable`:return new F(e.state,`The camera's geographic reference position is not available.`);default:return new F(e.state,`The selected date, time zone, or daylight calculation could not be resolved.`)}let{startTimeOfDay:t,endTimeOfDay:n}=this.analysis;if(!Number.isFinite(t)||!Number.isFinite(n)||t<0||n>b(1,`days`,`milliseconds`)||n<t)return new F(`invalid`,`The selected time range must be ordered and within the calendar day.`);let r=this._startDateTimeUTC.getTime(),i=this._endDateTimeUTC.getTime();if(!Number.isFinite(r)||!Number.isFinite(i)||i<r)return new F(`invalid`,`The selected time range could not be resolved to ordered UTC instants.`);let{intervals:a}=e;return a.length?a.some(e=>r>=e.start&&i<=e.end)?null:a.length>1?new F(`split-daylight`,`Daylight crosses midnight in the selected time zone and the selected time range includes nighttime.`):new F(`outside-daylight`,`The selected time range includes nighttime at the current camera location.`):new F(`no-daylight`,`No daylight is expected at the current camera location on the selected date.`)}get _sunlightIntervals(){let{date:e}=this.analysis,t=this._timeZone;return T({date:e,timeZone:t,utcOffset:t==null?this._effectiveUtcOffset:0,position:this._referencePosition})}get _previewing(){let e=this._updatedRecently,t=this._sceneUpdating;return e||t}get _sceneUpdating(){let{view:e}=this;if(e?.allLayerViews==null)return!0;let{stationary:t,navigating:n,interacting:r,graphicsView:i}=e,a=!t||n||r,o=this._shadowLayerViews.some(e=>e.updating),s=!i?.suspended&&!!i?.updating;return a||o||s}get _timeZone(){return this.analysis.timeZoneMode===`region`?this.view.timeZone:null}get _effectiveUtcOffset(){return this.analysis.utcOffset??this._utcOffsetAuto}get _utcOffsetAuto(){let e=this._referencePosition;return e==null?0:k(e[0],!1)}get _startDateTimeUTC(){return this._getDateTimeUTC(this.analysis.startTimeOfDay)}get _endDateTimeUTC(){return this._getDateTimeUTC(this.analysis.endTimeOfDay)}_getDateTimeUTC(e){let{date:t}=this.analysis,n=this._timeZone,r=x({date:t,millisecondsSinceMidnight:e,timeZone:n,utcOffset:n==null?this._effectiveUtcOffset:0});if(r==null)throw RangeError(`Invalid shadow cast date or time zone`);return r}get _referencePosition(){return this.view?.environmentView?.referencePositionGeographic}get _totalDurationInterval(){return this._totalDuration>0?Math.floor(this._totalDuration/(G-1)):G}get _interval(){let e=this._totalDurationInterval;switch(this.analysis.mode){case`min-duration`:return this._totalDuration>0?e:0;case`total-duration`:return e;case`discrete`:return this.analysis.discreteOptions.interval||e}}get _intervalContext(){let{mode:e,minDurationOptions:t}=this.analysis;return e===`min-duration`&&t.contextEnabled?t.contextOptions.interval||this._totalDurationInterval:-1}get _totalDurationSampleCount(){return this._lightDirections.length}get _totalDuration(){return this._endDateTimeUTC.getTime()-this._startDateTimeUTC.getTime()}get _lightDirections(){return this.error==null?this._calculateLightDirections(this._interval):[]}get _lightDirectionsContext(){return this.error==null?this._calculateLightDirections(this._intervalContext):[]}_calculateLightDirections(e){let{view:t}=this;if(e<=0)return[];let n=t.state.isGlobal?K:this._referencePosition;if(n==null)return[];let r=A(this._startDateTimeUTC,this._endDateTimeUTC,e,n,t.state.isGlobal,G),i=r.length;q.length=0;let a=E(0,i,q),o=Array(i);for(let e=0;e<i;++e)o[e]=r[a[e]];return o}get _analysisVolume(){let{geometry:e}=this.analysis;if(e==null)return this._previousVolume=null,null;try{let t=D(e,this.view,J);return t==null?(this._previousVolume=null,null):m(t)?(this._updatingHandles.consumePromise(t),this._previousVolume):(this._previousVolume=t,t)}catch(t){return l.getLogger(this).error(new o(`shadowcastanalysisview3d:projection-failed`,`Failed to project analysis area geometry to view spatial reference`,{geometry:e,error:t})),null}}get _visualizationParameters(){if(!this.visible)return null;switch(this.analysis.mode){case`min-duration`:return this._minDurationVisualizationParameters;case`total-duration`:return this._durationVisualizationParameters;case`discrete`:return this._discreteVisualizationParameters}}get _minDurationVisualizationParameters(){let{color:e,minDuration:t}=this.analysis.minDurationOptions,n=this._totalDuration;return{rendersSunlight:this.analysis.visualizeSunlight,visualization:2,thresholdColor:e.toUnitRGBA(),threshold:n>0?t/this._totalDuration:0,...this._minDurationContextVisualizationParameters}}get _minDurationContextVisualizationParameters(){let{minDurationOptions:e,visualizeSunlight:t}=this.analysis;if(!e.contextEnabled||t)return{};let{color:n,colorStops:r}=e.contextOptions,i=1/this._lightDirectionsContext.length;return{visualization:3,gradientColorRamp:this._getEffectiveShadowCastColorRamp(n,r,i)}}get _durationVisualizationParameters(){let{color:e,colorStops:t,mode:n}=this.analysis.totalDurationOptions,r=this._totalDuration,i=r>0&&n===`hourly`?U/r:0,a=this._getEffectiveShadowCastColorRamp(e,t,1/r);return i===0?{...this._discreteVisualizationParameters,gradientColorRamp:a}:{rendersSunlight:this.analysis.visualizeSunlight,bandedGradientColorRamp:a,visualization:1,bandSize:i}}get _showsSeparateZeroBucketInHourlyMode(){let{colorStops:e}=this.analysis.totalDurationOptions;return e==null||e.length===0||e.reduce((e,t)=>Math.min(e,t.value),1/0)<=0}get _discreteVisualizationParameters(){let{color:e,colorStops:t}=this.analysis.discreteOptions,n=1/this._lightDirections.length;return{rendersSunlight:this.analysis.visualizeSunlight,gradientColorRamp:this._getEffectiveShadowCastColorRamp(e,t,n),visualization:0}}get _shadowLayerViews(){return this.view.allLayerViews.items.filter(V)}get _previewDependencies(){if(this.error!=null)return null;let{view:e}=this,t=e.slice.plane,n=this._shadowLayerViews,i=n.map(e=>e.layer).filter(r),a=n.map(e=>e.suspended),o=i.map(e=>e.visible),s=i.map(e=>e.opacity),c=!!e.graphicsView?.suspended,l=i.filter(e=>`definitionExpression`in e).map(e=>e.definitionExpression),u=n.filter(e=>`filter`in e).map(e=>e.filter);return{slicePlane:t,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:a,graphicsViewSuspended:c,layerVisibilities:o,layerOpacities:s,filters:u,definitionExpressions:l}}get _renderer(){return this.view?.stage?.renderer}get testData(){}async getDurationAtScreen(e){return this._getDurationAtScreen(e)}async _getDurationAtScreen(e,t){if(!await this._isScreenPointInAnalysisArea(e,t))return-1;let{_renderer:n,_totalDurationSampleCount:r}=this;if(n==null||r===0)return 0;let i=this.view.state.camera.screenToRender(_(e.x,e.y),v()),a=n.readAccumulatedShadow(i);return(this.analysis.visualizeSunlight?1-a:a)*this._totalDuration}async _isScreenPointInAnalysisArea(e,t){let{geometry:n}=this.analysis;if(!n)return!0;let r=await this.view.hitTest(e);p(t);let i=r.results.find(e=>e.mapPoint)?.mapPoint??r?.ground?.mapPoint;if(!i)return!1;let a=await C(i,n.spatialReference,{signal:t});return p(t),a!=null&&S(n,a)}_getEffectiveShadowCastColorRamp(e,t,n){if(t!=null){t.length>j&&l.getLogger(this).warnOnce(`ShadowCastAnalysis supports at most 8 color stops`);let e=t.map(e=>[e.value*n,e.color.toUnitRGBA()]);return e.sort(([e],[t])=>e-t),e}return B(e)}};e([t({readOnly:!0,type:[`shadow-cast-view-3d`]})],L.prototype,`type`,void 0),e([t({constructOnly:!0,nonNullable:!0})],L.prototype,`analysis`,void 0),e([t({readOnly:!0})],L.prototype,`updating`,null),e([t()],L.prototype,`visible`,null),e([t()],L.prototype,`error`,null),e([t()],L.prototype,`_visibleOverride`,void 0),e([t()],L.prototype,`_sunlightIntervals`,null),e([t()],L.prototype,`_stopPreviewingTask`,void 0),e([t()],L.prototype,`_updatedRecently`,void 0),e([t()],L.prototype,`_tooltip`,void 0),e([t()],L.prototype,`_sceneUpdating`,null),e([t()],L.prototype,`_timeZone`,null),e([t()],L.prototype,`_effectiveUtcOffset`,null),e([t()],L.prototype,`_utcOffsetAuto`,null),e([t()],L.prototype,`_startDateTimeUTC`,null),e([t()],L.prototype,`_endDateTimeUTC`,null),e([t()],L.prototype,`_referencePosition`,null),e([t()],L.prototype,`_interval`,null),e([t()],L.prototype,`_intervalContext`,null),e([t()],L.prototype,`_totalDurationSampleCount`,null),e([t()],L.prototype,`_totalDuration`,null),e([t()],L.prototype,`_lightDirections`,null),e([t()],L.prototype,`_lightDirectionsContext`,null),e([t()],L.prototype,`_analysisVolume`,null),e([t()],L.prototype,`_visualizationParameters`,null),e([t()],L.prototype,`_minDurationVisualizationParameters`,null),e([t()],L.prototype,`_minDurationContextVisualizationParameters`,null),e([t()],L.prototype,`_durationVisualizationParameters`,null),e([t()],L.prototype,`_showsSeparateZeroBucketInHourlyMode`,null),e([t()],L.prototype,`_discreteVisualizationParameters`,null),e([t()],L.prototype,`_shadowLayerViews`,null),e([t()],L.prototype,`_previewDependencies`,null),e([t()],L.prototype,`_renderer`,null),L=e([n(`esri.views.3d.analysis.ShadowCastAnalysisView3D`)],L);const R=L;function z(e,t,n){t&&n!=null&&e?.setParameters({shadowCast:n})}function B(e){let t=e.toUnitRGBA();return[[0,c(t[0],t[1],t[2],0)],[1,t]]}function V(e){if(e.suspended)return!1;switch(e.type){case`building-scene-3d`:case`csv-3d`:case`elevation-3d`:case`feature-3d`:case`gaussian-splat-3d`:case`geojson-3d`:case`integrated-mesh-3d`:case`integrated-mesh-3dtiles`:case`ogc-feature-3d`:case`route-3d`:case`scene-layer-3d`:case`scene-layer-graphics-3d`:case`stream-3d`:case`wms-3d`:case`catalog-footprint-3d`:return!0;case`base-dynamic-3d`:case`catalog-3d`:case`catalog-dynamic-group-3d`:case`dimension-3d`:case`imagery-3d`:case`imagery-tile-3d`:case`line-of-sight-3d`:case`map-image-3d`:case`point-cloud-3d`:case`tile-3d`:case`vector-tile-3d`:case`viewshed-3d`:case`voxel-3d`:case`wfs-3d`:case`wmts-3d`:case`media-3d`:case`group`:return!1;case`graphics-3d`:case`sketch-3d`:return e.layer.graphics.some(e=>{let{symbol:t}=e;return t==null||t.type!==`text`&&!(`symbolLayers`in t)||t.type!==`text`&&t.symbolLayers.some(e=>e.type!==`text`)});default:return!1}}function H(e,t){if(e===t||e==null&&t==null)return!0;if(e==null||t==null)return!1;let n=w(e.slicePlane,t.slicePlane),r=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),a=i(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,o=i(e.layerVisibilities,t.layerVisibilities),s=i(e.layerOpacities,t.layerOpacities),c=i(e.filters,t.filters),l=i(e.definitionExpressions,t.definitionExpressions);return n&&r&&a&&o&&s&&c&&l}const U=b(1,`hours`,`milliseconds`),W=500,G=255,K=s(),q=[],J=new O;export{R as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{EventedAccessor as r}from"../../../../core/Evented.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as a,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{tryProject as s}from"../../../../geometry/projectionUtils.js";import{absoluteHeightElevationInfo as c}from"../../../../support/elevationInfoUtils.js";import l from"../../../../symbols/support/ElevationInfo.js";import{EditGeometryOperations as u}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{isGlobalFromString as d}from"../../../ViewingMode.js";const f=Symbol(`observerOperations`);let p=class extends r{constructor(e){super(e),this._operations=null}initialize(){this.addHandles(a(()=>this.subTool.observer,e=>this._syncObserver(e),o))}destroy(){this.removeHandles(f),this._operations=i(this._operations)}get operations(){return this._operations}get elevationInfo(){return this.subTool.viewshedComputedData?.effectiveElevationInfo??c}get visible(){return this.subTool.analysisViewData.visible&&(this.subTool.viewshedComputedData?.valid??!1)}get isDraped(){return this.elevationInfo.mode===`on-the-ground`}get origin(){return this.subTool.observer}get updating(){return!1}toMap(e){return this.view.toMap(e)}setElevationMode(e){let t=this.subTool.viewshed;if(!t?.observer||e===this.elevationInfo.mode)return;let n=t.elevationInfo?.clone()??new l;n.mode=e,t.elevationInfo=n,this.emit(`committed`)}_syncObserver(e){let t=e==null?null:s(e,this.view.spatialReference);if(t==null){this.removeHandles(f),this._operations=i(this._operations),this.emit(`committed`);return}let n=this._operations?.data.geometry;if(n?.type===`point`&&n.equals(t))return;if(this._operations?.trySetGeometry(t)){this.emit(`modified-externally`),this.emit(`committed`);return}this.removeHandles(f),this._operations=i(this._operations);let r=u.fromGeometry(t,d(this.view.viewingMode));this._operations=r,this.addHandles(r.data.on(`change`,()=>{let e=r.data.geometry;e.type===`point`&&(this.subTool.observer=e,this.emit(`committed`))}),f),this.emit(`committed`)}};e([t({constructOnly:!0})],p.prototype,`view`,void 0),e([t({constructOnly:!0})],p.prototype,`subTool`,void 0),p=e([n(`esri.views.3d.analysis.Viewshed.ViewshedObserverManipulatedObject3D`)],p);export{p as ViewshedObserverManipulatedObject3D};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{EventedAccessor as r}from"../../../../core/Evented.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as a,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{tryProject as s}from"../../../../geometry/projectionUtils.js";import{absoluteHeightElevationInfo as c}from"../../../../support/elevationInfoUtils.js";import l from"../../../../symbols/support/ElevationInfo.js";import{EditGeometryOperations as u}from"../../../interactive/editGeometry/EditGeometryOperations.js";const d=Symbol(`observerOperations`);let f=class extends r{constructor(e){super(e),this._operations=null}initialize(){this.addHandles(a(()=>this.subTool.observer,e=>this._syncObserver(e),o))}destroy(){this.removeHandles(d),this._operations=i(this._operations)}get operations(){return this._operations}get elevationInfo(){return this.subTool.viewshedComputedData?.effectiveElevationInfo??c}get visible(){return this.subTool.analysisViewData.visible&&(this.subTool.viewshedComputedData?.valid??!1)}get isDraped(){return this.elevationInfo.mode===`on-the-ground`}get origin(){return this.subTool.observer}get updating(){return!1}toMap(e){return this.view.toMap(e)}setElevationMode(e){let t=this.subTool.viewshed;if(!t?.observer||e===this.elevationInfo.mode)return;let n=t.elevationInfo?.clone()??new l;n.mode=e,t.elevationInfo=n,this.emit(`committed`)}_syncObserver(e){let t=e==null?null:s(e,this.view.spatialReference);if(t==null){this.removeHandles(d),this._operations=i(this._operations),this.emit(`committed`);return}let n=this._operations?.data.geometry;if(n?.type===`point`&&n.equals(t))return;if(this._operations?.trySetGeometry(t)){this.emit(`modified-externally`),this.emit(`committed`);return}this.removeHandles(d),this._operations=i(this._operations);let r=u.fromGeometry(t,this.view.state.isGlobal);this._operations=r,this.addHandles(r.data.on(`change`,()=>{let e=r.data.geometry;e.type===`point`&&(this.subTool.observer=e,this.emit(`committed`))}),d),this.emit(`committed`)}};e([t({constructOnly:!0})],f.prototype,`view`,void 0),e([t({constructOnly:!0})],f.prototype,`subTool`,void 0),f=e([n(`esri.views.3d.analysis.Viewshed.ViewshedObserverManipulatedObject3D`)],f);export{f as ViewshedObserverManipulatedObject3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{fromRotation as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{subtract as n,transformMat4 as r,scale as i,add as a,squaredLength as o,distance as s,dot as c,normalize as l,length as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{acosClamped as f,clamp as p,asinClamped as m,deg2rad as h}from"../../../../core/mathUtils.js";import{getReferenceEllipsoid as g}from"../../../../geometry/ellipsoidUtils.js";import{Sphere as _}from"../../../../geometry/support/sphere.js";import{viewAngle as v}from"../../state/utils/viewUtils.js";import{defaultConstraintOptions as y,hasConstraintType as b,adjustRangeForInteraction as x}from"./common.js";function S(t,o,s,c=!0){W.eyeCenterDistance=0,W.requiresTwoSteps=!1;let l=C(t,o,s,y,W);if(l===0)return!1;switch(e(R,-l,o.viewRight),s.tiltMode){case 1:r(L,o.viewForward,R),i(L,L,W.eyeCenterDistance),o.center=a(z,o.eye,L);break;case 0:n(L,o.center,o.eye),r(L,L,R),o.eye=n(z,o.center,L);break;default:s.tiltMode}return o.up=r(z,o.up,R),W.requiresTwoSteps&&c?S(t,o,s,!1):!0}function C(e,t,n,r=y,i){if(!e.state.constraints.tilt)return 0;let a=Math.min(t.relativeElevation*V,t.distance),o=e.state.constraints.tilt(a,H);return F(e,n,o),r.interactionType===2&&b(r.selection,2)&&I(e,r.interactionStartCamera,o),n.tiltMode===1||r.tiltMode===1?T(e,t,o,i):w(e,t,o)}function w(e,t,n){let r=v(e.renderCoordsHelper,t.center,t.eye),i=r-p(r,n.min,n.max);return A(i)?i:0}function T(e,t,n,r){switch(r&&(r.requiresTwoSteps=!1),e.viewingMode){case`global`:return D(e,t,n,r);case`local`:return E(e,t,n,r)}}function E(e,t,n,r){let i=v(e.renderCoordsHelper,t.center,t.eye),a=p(i,n.min,n.max),o=i-a;if(!A(o))return 0;if(r){let n=Math.abs(e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude),i=e.renderCoordsHelper.getAltitude(t.eye)-n,o=Math.max(Math.cos(a),1e-4);r.eyeCenterDistance=Math.abs(o)>1e-4?i/o:t.distance}return o}function D(e,t,n,r){let i=O(e,t,U),a=p(i.tiltAtCenter,n.min,n.max);if(!A(i.tiltAtCenter-a))return 0;let o,s;return i.centerIsOnSurface?(o=j(i),s=N(i,o)):(o=i.constraints.clampTilt(i.distance,i.tiltAtCenter),r&&o<Math.PI/2&&(r.requiresTwoSteps=!0,o=Math.PI/2-1e-5),s=P(i,o)),r&&(r.eyeCenterDistance=M(i,o)),s}function O(e,t,n){let r=e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,i=r+g(e.spatialReference).radius,a=e.renderCoordsHelper.intersectManifold(t.ray,r,z);return n.distance=Math.min(t.relativeElevation*V,t.distance),n.centerIsOnSurface=!1,a==null?e.state.isLocal?n.tiltAtCenter=v(e.renderCoordsHelper,t.center,t.eye):(k.radius=i,k.closestPointOnSilhouette(t.ray,z),n.distance=Math.min(t.relativeElevation*V,s(t.eye,z)),n.tiltAtCenter=f(-c(t.viewForward,l(z,z)))):(n.distance=Math.min(t.relativeElevation*V,s(t.eye,a)),n.tiltAtCenter=v(e.renderCoordsHelper,a,t.eye),n.centerIsOnSurface=!0),n.radius=i,n.eyeRadius=u(t.eye),n.constraints=e.state.constraints,n}const k=new _;function A(e){return Math.abs(e)>1e-9}function j(e){let{constraints:t,distance:n,tiltAtCenter:r}=e,i=r,a=t.clampTilt(n,r),o=M(e,a);if(t.clampTilt(o,r)===a)return a;let s=0;for(;s<10&&A(a-i);){let n=(i+a)/2,r=M(e,n);A(t.clampTilt(r,n)-n)?i=n:a=n,s++}return a}function M(e,t){if(!e.centerIsOnSurface)return e.distance;let n=Math.PI-p(t,0,Math.PI),r=m(e.radius/e.eyeRadius*Math.sin(n)),i=Math.PI-n-r,a=Math.sin(i)/Math.sin(n);if(e.eyeRadius<e.radius&&a>1){let t=Math.PI-r,i=Math.PI-n-t;return Math.sin(i)/Math.sin(n)*e.eyeRadius}return a*e.eyeRadius}function N(e,t){let n=m(e.radius/e.eyeRadius*Math.sin(e.tiltAtCenter)),r=m(e.radius/e.eyeRadius*Math.sin(t));return e.eyeRadius>e.radius?n-r:r-n}function P(e,t){return e.tiltAtCenter-Math.PI/2-(t-Math.PI/2)}function F(e,t,n){if(t.interactionType===0)return;let{interactionStartCamera:r,interactionFactor:i}=t;if(!r)return;let{min:a,max:o}=n,s=C(e,r,y,t),c=s===0?0:v(e.renderCoordsHelper,r.center,r.eye);n.min=a,n.max=o,t.interactionType===2?(b(t.selection,2)&&I(e,r,n),x(s,c,!0,i,B,n)):x(s,c,!1,i,B,n)}function I(e,t,n){let r=e.state.constraints;if(e.state.isLocal||!r.altitude||!t)return;let i=o(t.center),a=Math.sqrt(i),s=t.distance,c=g(e.spatialReference).radius,l=r.altitude.min+c,u=r.altitude.max+c,d=(l*l-s*s-i)/(-2*a*s),p=(u*u-s*s-i)/(-2*a*s);n.min=Math.max(n.min,Math.min(Math.PI-f(p),n.max)),n.max=Math.min(n.max,Math.PI-f(d))}const L=d(),R=t(),z=d(),B=h(5),V=30,H={min:0,max:0},U={constraints:null,radius:0,eyeRadius:0,centerIsOnSurface:!0,distance:0,tiltAtCenter:0},W={eyeCenterDistance:0,requiresTwoSteps:!1};export{S as applyTiltConstraint,C as getTiltConstraintError};
2
+ import{fromRotation as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{subtract as n,transformMat4 as r,scale as i,add as a,squaredLength as o,distance as s,dot as c,normalize as l,length as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{acosClamped as f,clamp as p,asinClamped as m,deg2rad as h}from"../../../../core/mathUtils.js";import{getReferenceEllipsoid as g}from"../../../../geometry/ellipsoidUtils.js";import{Sphere as _}from"../../../../geometry/support/sphere.js";import{viewAngle as v}from"../../state/utils/viewUtils.js";import{defaultConstraintOptions as y,hasConstraintType as b,adjustRangeForInteraction as x}from"./common.js";function S(t,o,s,c=!0){W.eyeCenterDistance=0,W.requiresTwoSteps=!1;let l=C(t,o,s,y,W);if(l===0)return!1;switch(e(R,-l,o.viewRight),s.tiltMode){case 1:r(L,o.viewForward,R),i(L,L,W.eyeCenterDistance),o.center=a(z,o.eye,L);break;case 0:n(L,o.center,o.eye),r(L,L,R),o.eye=n(z,o.center,L);break;default:s.tiltMode}return o.up=r(z,o.up,R),W.requiresTwoSteps&&c?S(t,o,s,!1):!0}function C(e,t,n,r=y,i){if(!e.state.constraints.tilt)return 0;let a=Math.min(t.relativeElevation*V,t.distance),o=e.state.constraints.tilt(a,H);return F(e,n,o),r.interactionType===2&&b(r.selection,2)&&I(e,r.interactionStartCamera,o),n.tiltMode===1||r.tiltMode===1?T(e,t,o,i):w(e,t,o)}function w(e,t,n){let r=v(e.renderCoordsHelper,t.center,t.eye),i=r-p(r,n.min,n.max);return A(i)?i:0}function T(e,t,n,r){return r&&(r.requiresTwoSteps=!1),e.state.isGlobal?D(e,t,n,r):E(e,t,n,r)}function E(e,t,n,r){let i=v(e.renderCoordsHelper,t.center,t.eye),a=p(i,n.min,n.max),o=i-a;if(!A(o))return 0;if(r){let n=Math.abs(e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude),i=e.renderCoordsHelper.getAltitude(t.eye)-n,o=Math.max(Math.cos(a),1e-4);r.eyeCenterDistance=Math.abs(o)>1e-4?i/o:t.distance}return o}function D(e,t,n,r){let i=O(e,t,U),a=p(i.tiltAtCenter,n.min,n.max);if(!A(i.tiltAtCenter-a))return 0;let o,s;return i.centerIsOnSurface?(o=j(i),s=N(i,o)):(o=i.constraints.clampTilt(i.distance,i.tiltAtCenter),r&&o<Math.PI/2&&(r.requiresTwoSteps=!0,o=Math.PI/2-1e-5),s=P(i,o)),r&&(r.eyeCenterDistance=M(i,o)),s}function O(e,t,n){let r=e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,i=r+g(e.spatialReference).radius,a=e.renderCoordsHelper.intersectManifold(t.ray,r,z);return n.distance=Math.min(t.relativeElevation*V,t.distance),n.centerIsOnSurface=!1,a==null?e.state.isLocal?n.tiltAtCenter=v(e.renderCoordsHelper,t.center,t.eye):(k.radius=i,k.closestPointOnSilhouette(t.ray,z),n.distance=Math.min(t.relativeElevation*V,s(t.eye,z)),n.tiltAtCenter=f(-c(t.viewForward,l(z,z)))):(n.distance=Math.min(t.relativeElevation*V,s(t.eye,a)),n.tiltAtCenter=v(e.renderCoordsHelper,a,t.eye),n.centerIsOnSurface=!0),n.radius=i,n.eyeRadius=u(t.eye),n.constraints=e.state.constraints,n}const k=new _;function A(e){return Math.abs(e)>1e-9}function j(e){let{constraints:t,distance:n,tiltAtCenter:r}=e,i=r,a=t.clampTilt(n,r),o=M(e,a);if(t.clampTilt(o,r)===a)return a;let s=0;for(;s<10&&A(a-i);){let n=(i+a)/2,r=M(e,n);A(t.clampTilt(r,n)-n)?i=n:a=n,s++}return a}function M(e,t){if(!e.centerIsOnSurface)return e.distance;let n=Math.PI-p(t,0,Math.PI),r=m(e.radius/e.eyeRadius*Math.sin(n)),i=Math.PI-n-r,a=Math.sin(i)/Math.sin(n);if(e.eyeRadius<e.radius&&a>1){let t=Math.PI-r,i=Math.PI-n-t;return Math.sin(i)/Math.sin(n)*e.eyeRadius}return a*e.eyeRadius}function N(e,t){let n=m(e.radius/e.eyeRadius*Math.sin(e.tiltAtCenter)),r=m(e.radius/e.eyeRadius*Math.sin(t));return e.eyeRadius>e.radius?n-r:r-n}function P(e,t){return e.tiltAtCenter-Math.PI/2-(t-Math.PI/2)}function F(e,t,n){if(t.interactionType===0)return;let{interactionStartCamera:r,interactionFactor:i}=t;if(!r)return;let{min:a,max:o}=n,s=C(e,r,y,t),c=s===0?0:v(e.renderCoordsHelper,r.center,r.eye);n.min=a,n.max=o,t.interactionType===2?(b(t.selection,2)&&I(e,r,n),x(s,c,!0,i,B,n)):x(s,c,!1,i,B,n)}function I(e,t,n){let r=e.state.constraints;if(e.state.isLocal||!r.altitude||!t)return;let i=o(t.center),a=Math.sqrt(i),s=t.distance,c=g(e.spatialReference).radius,l=r.altitude.min+c,u=r.altitude.max+c,d=(l*l-s*s-i)/(-2*a*s),p=(u*u-s*s-i)/(-2*a*s);n.min=Math.max(n.min,Math.min(Math.PI-f(p),n.max)),n.max=Math.min(n.max,Math.PI-f(d))}const L=d(),R=t(),z=d(),B=h(5),V=30,H={min:0,max:0},U={constraints:null,radius:0,eyeRadius:0,centerIsOnSurface:!0,distance:0,tiltAtCenter:0},W={eyeCenterDistance:0,requiresTwoSteps:!1};export{S as applyTiltConstraint,C as getTiltConstraintError};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{copy as e,squaredDistance as t,scale as n,subtract as r,add as i,length as a,dot as o,distance as s}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../geometry/ellipsoidUtils.js";import{containsPoint as u}from"../../../geometry/support/aaBoundingRect.js";import{scaleToDistanceAt as d}from"../support/cameraScaleUtils.js";import{Intersector as f}from"../webgl-engine/lib/Intersector.js";function p(e,t,n,r){return e.renderCoordsHelper.fromRenderCoords(t.eye,S,r)!=null&&u(n,S)}function m(e,t){return e.elevationProvider?e.elevationProvider.getElevation(t[0],t[1],t[2],e.renderCoordsHelper.spatialReference,`ground`)??0:0}function h(a,o,s,c,l){let u=a.state.camera.clone();if(o&&s&&c&&(u.eye=o,u.center=s,u.up=c),l){let e=d(a,u,l);i(C,u.eye,n(C,u.viewForward,e))}else v(a,u.ray,C)||e(C,u.center);let f=a.state.constraints,p=f.minimumPoiDistance;if(t(u.eye,C)<p){let t=f.collision.enabled;e(w,u.viewForward),n(w,w,p),t?u.eye=r(S,C,w):i(C,u.eye,w);let o=a.renderCoordsHelper,s=o.getAltitude(u.eye),c=f.collision.elevationMargin;t&&s<c&&(r(w,C,u.eye),u.eye=o.setAltitude(S,c,u.eye),i(C,u.eye,w))}return u.center=C,u}function g(e,t,n){let{origin:r,direction:i}=t;if(a(r)<e)return!0;let c=-o(i,r)/a(i);return c<0||c>=s(n,r)}function _(e,n,r){if(!e.state.isGlobal||!e.stateManager.constraintsManager)return!1;let i=m(e,n),a=e.stateManager.constraintsManager.nearFarHeuristic.computeFarDistance(n,i,e.stage.renderer.sceneDepthRange.value.far),o=a*a;return t(n,r)>o}function v(e,t,n){let r=b[e.viewingMode];r||(r=new f(e.state.isGlobal),r.options.backfacesTerrain=!e.state.isGlobal,r.options.invisibleTerrain=!0,b[e.viewingMode]=r);let{isGlobal:i}=e.state,a=i?l(e.spatialReference).radius:0;return e.sceneIntersectionHelper.intersectRay(t,r,n)&&!_(e,t.origin,n)&&(!i||g(a,r.ray,n))?!0:!e.renderCoordsHelper.intersectManifold(t,0,n)||_(e,t.origin,n)||i&&!g(a,r.ray,n)?i?y(t,n,a):!1:!0}function y(e,t,r){let s=o(e.origin,e.origin)-r*r,c=s>0?Math.sqrt(s)/3:1;return n(t,e.direction,c/a(e.direction)),i(t,t,e.origin),!0}let b={};function x(){b={}}const S=c(),C=c(),w=c();export{h as cameraOnContentAlongViewDirection,x as cleanupIntersectionUtils,p as eyeWithinExtent,m as surfaceElevationBelowRenderLocation};
2
+ import{copy as e,squaredDistance as t,scale as n,subtract as r,add as i,length as a,dot as o,distance as s}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../geometry/ellipsoidUtils.js";import{containsPoint as u}from"../../../geometry/support/aaBoundingRect.js";import{scaleToDistanceAt as d}from"../support/cameraScaleUtils.js";import{Intersector as f}from"../webgl-engine/lib/Intersector.js";function p(e,t,n,r){return e.renderCoordsHelper.fromRenderCoords(t.eye,S,r)!=null&&u(n,S)}function m(e,t){return e.elevationProvider?e.elevationProvider.getElevation(t[0],t[1],t[2],e.renderCoordsHelper.spatialReference,`ground`)??0:0}function h(a,o,s,c,l){let u=a.state.camera.clone();if(o&&s&&c&&(u.eye=o,u.center=s,u.up=c),l){let e=d(a,u,l);i(C,u.eye,n(C,u.viewForward,e))}else v(a,u.ray,C)||e(C,u.center);let f=a.state.constraints,p=f.minimumPoiDistance;if(t(u.eye,C)<p){let t=f.collision.enabled;e(w,u.viewForward),n(w,w,p),t?u.eye=r(S,C,w):i(C,u.eye,w);let o=a.renderCoordsHelper,s=o.getAltitude(u.eye),c=f.collision.elevationMargin;t&&s<c&&(r(w,C,u.eye),u.eye=o.setAltitude(S,c,u.eye),i(C,u.eye,w))}return u.center=C,u}function g(e,t,n){let{origin:r,direction:i}=t;if(a(r)<e)return!0;let c=-o(i,r)/a(i);return c<0||c>=s(n,r)}function _(e,n,r){if(!e.state.isGlobal||!e.stateManager.constraintsManager)return!1;let i=m(e,n),a=e.stateManager.constraintsManager.nearFarHeuristic.computeFarDistance(n,i,e.stage.renderer.sceneDepthRange.value.far),o=a*a;return t(n,r)>o}function v(e,t,n){let r=b[+e.state.isGlobal];r||(r=new f(e.state.isGlobal),r.options.backfacesTerrain=!e.state.isGlobal,r.options.invisibleTerrain=!0,b[+e.state.isGlobal]=r);let{isGlobal:i}=e.state,a=i?l(e.spatialReference).radius:0;return e.sceneIntersectionHelper.intersectRay(t,r,n)&&!_(e,t.origin,n)&&(!i||g(a,r.ray,n))?!0:!e.renderCoordsHelper.intersectManifold(t,0,n)||_(e,t.origin,n)||i&&!g(a,r.ray,n)?i?y(t,n,a):!1:!0}function y(e,t,r){let s=o(e.origin,e.origin)-r*r,c=s>0?Math.sqrt(s)/3:1;return n(t,e.direction,c/a(e.direction)),i(t,t,e.origin),!0}const b=[];function x(){b.length=0}const S=c(),C=c(),w=c();export{h as cameraOnContentAlongViewDirection,x as cleanupIntersectionUtils,p as eyeWithinExtent,m as surfaceElevationBelowRenderLocation};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{EventedAccessor as r}from"../../../core/Evented.js";import{length as i,equals as a,copy as o,scale as s,lerp as c}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as l,create as u,fromValues as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{watch as f,sync as p,syncAndInitial as m,when as h}from"../../../core/reactiveUtils.js";import{isEarth as g,getReferenceEllipsoid as _}from"../../../geometry/ellipsoidUtils.js";import{projectPointToVector as v}from"../../../geometry/projection/projectPointToVector.js";import{isLoadedOrLoadFor as y}from"../../../geometry/projectionUtils.js";import b from"../../../geometry/SpatialReference.js";import{getGCSForPlanet as x}from"../../../geometry/support/planetGCSUtils.js";import{positionToTimezoneInfo as S}from"../support/earthUtils.js";import{ColorAndIntensity as C,areShadowsEnabled as w,computeColorAndIntensity as T,computeVirtualLightDirection as E}from"../support/sunUtils.js";import{MainLight as D,AmbientLight as O,FillLight as k}from"../webgl-engine/lighting/Lightsources.js";import{heightLimit as A}from"./weather.js";let j=class extends r{constructor(){super(),this._view=null,this._tmpLightParameters=new C,this._defaultLightParameters=new C,this._tmpDate=new Date,this._tmpTz={hours:0,minutes:0,seconds:0},this._viewHandlesKey=`viewHandles`,this._trackingEnabled=!1,this._mainLight=new D,this._ambientLight=new O,this._moonLight=new k,this.shadowsAvailable=!1,this._resetReferencePosition()}destroy(){this.disconnectView()}get updating(){return!this._canProjectCameraPosition}get weatherEnabled(){return this._view?.stage?.renderer?.weatherFader!=null&&this._view.environment.atmosphereEnabled&&this._view.state.isGlobal&&g(this._view.spatialReference)}get _weatherAvailable(){let e=this._view;return e!=null&&this.weatherEnabled&&i(e.state.camera.eye)-_(e.spatialReference).radius<=A}get weather(){return this._weatherAvailable?this._view?.environment.weather:null}_modifyShadowsAvailable(){if(this._view==null)return;let e=this.referencePositionGeographic,t=e==null||w(e[2],this._view.state.isGlobal);this.shadowsAvailable=this._view.environment.lighting.directShadowsEnabled&&t}get referencePositionGeographic(){return this._referencePositionGeographic}get _canProjectCameraPosition(){let e=this._view?.stateManager?.camera?.position?.spatialReference??b.WGS84,t=x(e);return y(e,t)}connectView(e){this._view=e,this.addHandles([f(()=>e.environment.lighting,e=>this._updateLightingHandler(e),p),f(()=>e.environment.lighting.type===`virtual`?null:e.environment.lighting.date,e=>this._lightingDateHandler(e),p),f(()=>e.environment.lighting.directShadowsEnabled,()=>this._modifyShadowsAvailable(),p),f(()=>e.spatialReference,()=>this._resetReferencePosition(!0),p),f(()=>[e.environment.weather.type,this.weatherEnabled],()=>this._updateLighting(null,1),p),f(()=>this._weatherAvailable,t=>e.environment.setWeatherAvailable(t),m),f(()=>e.viewingMode,()=>this._resetReferencePosition(!0),m),f(()=>e.environment.lighting.type!==`virtual`&&e.environment.lighting.cameraTrackingEnabled,e=>this._updateCameraTracking(e),m),f(()=>e.state.camera,()=>this._cameraHandler(),m),h(()=>this._canProjectCameraPosition,()=>this._resetReferencePosition(!0),p)],this._viewHandlesKey),this._modifyShadowsAvailable(),this._updateLighting(),this._cameraHandler(),this.notifyChange(`updating`)}disconnectView(){this.removeHandles(this._viewHandlesKey),this._resetReferencePosition()}_updateLightingHandler(e){this._updateCameraTracking(e.type!==`virtual`&&e.cameraTrackingEnabled),this._lightingDateHandler(e.type===`virtual`?null:e.date),this._modifyShadowsAvailable()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{if(!this._view)return;let e=this._view.environment.lighting;e?.type!==`virtual`&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){if(!this._view)return;let t=this._view.environment.lighting;if(t?.type===`virtual`)this._updateLighting();else if(e){if(!t.positionTimezoneInfo.autoUpdated&&(this._preupdateTracking(e),this._referencePositionGeographic!=null)){let e=S(this._referencePositionGeographic,this._tmpTz);e!=null&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}this._updateLighting(e)}}_preupdateTracking(e){this._view&&!this._trackingEnabled&&this._view.environment.lighting.type!==`virtual`&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){let t=this._view;if(!t||!t.ready)return;let n=t.stateManager.camera;if(!n)return;let r=n.position,i=r.spatialReference??b.WGS84,s=x(i);if(v(r,P,s,F))this._referencePositionGeographic?a(this._referencePositionGeographic,P)||(o(this._referencePositionGeographic,P),this.notifyChange(`referencePositionGeographic`)):this._referencePositionGeographic=l(P),this._autoUpdateTimezone(this._referencePositionGeographic,e)||this._updateLighting(e);else{if(this._referencePositionGeographic==null)return;this._referencePositionGeographic=null,this._updateLighting()}}_updateLighting(e,t=0){let n=this._view;if(!n)return;let{lighting:r}=n.environment,i=r.type===`virtual`,a=this._referencePositionGeographic,l=a==null?this._defaultLightParameters:this._tmpLightParameters;if(a){e??=i?null:r.date;let t=this.weather?.type??`disabled`;T(e,a,n.state.isGlobal,t,n.state.camera,l)}else i&&E(n.state.camera,n.state.isGlobal,l.direct.directionToLightSource);let u=this._mainLight,d=l.direct;s(u.intensity,d.color,d.intensity*Math.PI),o(u.direction,d.directionToLightSource),u.specularStrength=l.specularStrength,u.environmentStrength=l.environmentStrength;let f=this._ambientLight;s(f.intensity,l.ambient.color,l.ambient.intensity);let p=this._moonLight;c(p.intensity,M,N,l.globalFactor);let m=(1-.5*l.globalFactor)*(1-.4*l.noonFactor*(1-l.globalFactor));s(p.intensity,p.intensity,m),o(p.direction,d.directionToLightSource),n.stage.renderer.updateLighting([u,f,p],l.noonFactor,l.globalFactor,this.weather?t:0),this._modifyShadowsAvailable()}_autoUpdateTimezone(e,t=null){if(!this._view||this._view.environment.lighting.type===`virtual`||!this._view.environment.lighting.cameraTrackingEnabled||e==null)return!1;let n=this._tmpDate;n.setTime((t||this._view.environment.lighting.date).getTime());let r=S(e,this._tmpTz);if(r==null)return!1;let i=this._view.environment.lighting.positionTimezoneInfo;if(!i.autoUpdated)i=r;else if(i.hours===r.hours&&i.minutes===r.minutes&&i.seconds===r.seconds)return!1;let a=n.getUTCHours()-(r.hours-i.hours),o=n.getUTCMinutes()-(r.minutes-i.minutes),s=n.getUTCSeconds()-(r.seconds-i.seconds);return n.setUTCHours(a),n.setUTCMinutes(o),n.setUTCSeconds(s),!t&&this._view.environment.lighting.autoUpdate(n,r)}_resetReferencePosition(e=!1){this._referencePositionGeographic=null,e&&this._cameraHandler()}};e([t()],j.prototype,`_view`,void 0),e([t({type:Boolean,readOnly:!0})],j.prototype,`updating`,null),e([t()],j.prototype,`weatherEnabled`,null),e([t()],j.prototype,`_weatherAvailable`,null),e([t()],j.prototype,`shadowsAvailable`,void 0),e([t()],j.prototype,`referencePositionGeographic`,null),e([t()],j.prototype,`_referencePositionGeographic`,void 0),e([t()],j.prototype,`_canProjectCameraPosition`,null),j=e([n(`esri.views.3d.environment.EnvironmentView`)],j);const M=d(.22,.22,.33),N=d(.22,.22,.22),P=u(),F={zConversionDisabled:!0};export{j as EnvironmentView};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{EventedAccessor as r}from"../../../core/Evented.js";import{length as i,equals as a,copy as o,scale as s,lerp as c}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as l,create as u,fromValues as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{watch as f,sync as p,syncAndInitial as m,when as h}from"../../../core/reactiveUtils.js";import{isEarth as g,getReferenceEllipsoid as _}from"../../../geometry/ellipsoidUtils.js";import{projectPointToVector as v}from"../../../geometry/projection/projectPointToVector.js";import{isLoadedOrLoadFor as y}from"../../../geometry/projectionUtils.js";import b from"../../../geometry/SpatialReference.js";import{getGCSForPlanet as x}from"../../../geometry/support/planetGCSUtils.js";import{positionToTimezoneInfo as S}from"../support/earthUtils.js";import{ColorAndIntensity as C,areShadowsEnabled as w,computeColorAndIntensity as T,computeVirtualLightDirection as E}from"../support/sunUtils.js";import{MainLight as D,AmbientLight as O,FillLight as k}from"../webgl-engine/lighting/Lightsources.js";import{heightLimit as A}from"./weather.js";let j=class extends r{constructor(){super(),this._view=null,this._tmpLightParameters=new C,this._defaultLightParameters=new C,this._tmpDate=new Date,this._tmpTz={hours:0,minutes:0,seconds:0},this._viewHandlesKey=`viewHandles`,this._trackingEnabled=!1,this._mainLight=new D,this._ambientLight=new O,this._moonLight=new k,this.shadowsAvailable=!1,this._resetReferencePosition()}destroy(){this.disconnectView()}get updating(){return!this._canProjectCameraPosition}get weatherEnabled(){return this._view?.stage?.renderer?.weatherFader!=null&&this._view.environment.atmosphereEnabled&&this._view.state.isGlobal&&g(this._view.spatialReference)}get _weatherAvailable(){let e=this._view;return e!=null&&this.weatherEnabled&&i(e.state.camera.eye)-_(e.spatialReference).radius<=A}get weather(){return this._weatherAvailable?this._view?.environment.weather:null}_modifyShadowsAvailable(){if(this._view==null)return;let e=this.referencePositionGeographic,t=e==null||w(e[2],this._view.state.isGlobal);this.shadowsAvailable=this._view.environment.lighting.directShadowsEnabled&&t}get referencePositionGeographic(){return this._referencePositionGeographic}get _canProjectCameraPosition(){let e=this._view?.stateManager?.camera?.position?.spatialReference??b.WGS84,t=x(e);return y(e,t)}connectView(e){this._view=e,this.addHandles([f(()=>e.environment.lighting,e=>this._updateLightingHandler(e),p),f(()=>e.environment.lighting.type===`virtual`?null:e.environment.lighting.date,e=>this._lightingDateHandler(e),p),f(()=>e.environment.lighting.directShadowsEnabled,()=>this._modifyShadowsAvailable(),p),f(()=>e.spatialReference,()=>this._resetReferencePosition(!0),p),f(()=>[e.environment.weather.type,this.weatherEnabled],()=>this._updateLighting(null,1),p),f(()=>this._weatherAvailable,t=>e.environment.setWeatherAvailable(t),m),f(()=>e.state.isGlobal,()=>this._resetReferencePosition(!0),m),f(()=>e.environment.lighting.type!==`virtual`&&e.environment.lighting.cameraTrackingEnabled,e=>this._updateCameraTracking(e),m),f(()=>e.state.camera,()=>this._cameraHandler(),m),h(()=>this._canProjectCameraPosition,()=>this._resetReferencePosition(!0),p)],this._viewHandlesKey),this._modifyShadowsAvailable(),this._updateLighting(),this._cameraHandler(),this.notifyChange(`updating`)}disconnectView(){this.removeHandles(this._viewHandlesKey),this._resetReferencePosition()}_updateLightingHandler(e){this._updateCameraTracking(e.type!==`virtual`&&e.cameraTrackingEnabled),this._lightingDateHandler(e.type===`virtual`?null:e.date),this._modifyShadowsAvailable()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{if(!this._view)return;let e=this._view.environment.lighting;e?.type!==`virtual`&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){if(!this._view)return;let t=this._view.environment.lighting;if(t?.type===`virtual`)this._updateLighting();else if(e){if(!t.positionTimezoneInfo.autoUpdated&&(this._preupdateTracking(e),this._referencePositionGeographic!=null)){let e=S(this._referencePositionGeographic,this._tmpTz);e!=null&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}this._updateLighting(e)}}_preupdateTracking(e){this._view&&!this._trackingEnabled&&this._view.environment.lighting.type!==`virtual`&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){let t=this._view;if(!t||!t.ready)return;let n=t.stateManager.camera;if(!n)return;let r=n.position,i=r.spatialReference??b.WGS84,s=x(i);if(v(r,P,s,F))this._referencePositionGeographic?a(this._referencePositionGeographic,P)||(o(this._referencePositionGeographic,P),this.notifyChange(`referencePositionGeographic`)):this._referencePositionGeographic=l(P),this._autoUpdateTimezone(this._referencePositionGeographic,e)||this._updateLighting(e);else{if(this._referencePositionGeographic==null)return;this._referencePositionGeographic=null,this._updateLighting()}}_updateLighting(e,t=0){let n=this._view;if(!n)return;let{lighting:r}=n.environment,i=r.type===`virtual`,a=this._referencePositionGeographic,l=a==null?this._defaultLightParameters:this._tmpLightParameters;if(a){e??=i?null:r.date;let t=this.weather?.type??`disabled`;T(e,a,n.state.isGlobal,t,n.state.camera,l)}else i&&E(n.state.camera,n.state.isGlobal,l.direct.directionToLightSource);let u=this._mainLight,d=l.direct;s(u.intensity,d.color,d.intensity*Math.PI),o(u.direction,d.directionToLightSource),u.specularStrength=l.specularStrength,u.environmentStrength=l.environmentStrength;let f=this._ambientLight;s(f.intensity,l.ambient.color,l.ambient.intensity);let p=this._moonLight;c(p.intensity,M,N,l.globalFactor);let m=(1-.5*l.globalFactor)*(1-.4*l.noonFactor*(1-l.globalFactor));s(p.intensity,p.intensity,m),o(p.direction,d.directionToLightSource),n.stage.renderer.updateLighting([u,f,p],l.noonFactor,l.globalFactor,this.weather?t:0),this._modifyShadowsAvailable()}_autoUpdateTimezone(e,t=null){if(!this._view||this._view.environment.lighting.type===`virtual`||!this._view.environment.lighting.cameraTrackingEnabled||e==null)return!1;let n=this._tmpDate;n.setTime((t||this._view.environment.lighting.date).getTime());let r=S(e,this._tmpTz);if(r==null)return!1;let i=this._view.environment.lighting.positionTimezoneInfo;if(!i.autoUpdated)i=r;else if(i.hours===r.hours&&i.minutes===r.minutes&&i.seconds===r.seconds)return!1;let a=n.getUTCHours()-(r.hours-i.hours),o=n.getUTCMinutes()-(r.minutes-i.minutes),s=n.getUTCSeconds()-(r.seconds-i.seconds);return n.setUTCHours(a),n.setUTCMinutes(o),n.setUTCSeconds(s),!t&&this._view.environment.lighting.autoUpdate(n,r)}_resetReferencePosition(e=!1){this._referencePositionGeographic=null,e&&this._cameraHandler()}};e([t()],j.prototype,`_view`,void 0),e([t({type:Boolean,readOnly:!0})],j.prototype,`updating`,null),e([t()],j.prototype,`weatherEnabled`,null),e([t()],j.prototype,`_weatherAvailable`,null),e([t()],j.prototype,`shadowsAvailable`,void 0),e([t()],j.prototype,`referencePositionGeographic`,null),e([t()],j.prototype,`_referencePositionGeographic`,void 0),e([t()],j.prototype,`_canProjectCameraPosition`,null),j=e([n(`esri.views.3d.environment.EnvironmentView`)],j);const M=d(.22,.22,.33),N=d(.22,.22,.22),P=u(),F={zConversionDisabled:!0};export{j as EnvironmentView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"../../../../../core/has.js";import{eventMatchesPointerActions as e}from"../../../../input/handlers/support.js";import{InputHandler as t}from"../../../../input/InputHandler.js";import{GroundNavigationController as n}from"../../../state/controllers/GroundNavigationController.js";import{PinchAndPanControllerGlobal as r}from"../../../state/controllers/PinchAndPanControllerGlobal.js";import{groundNavigationConstants as i}from"../../../state/utils/groundNavigationUtils.js";class a extends t{constructor(e,t,n){super(!0),this._view=e,this.pointerActions=t,this._modifiers=n,this._lastEndTimestamp=0,this._lastTimestamp=0,this.registerIncoming(`drag`,n,e=>this._handleDrag(e))}_handleDrag(t){if(t.data.pointers.size===1&&!e(t.data,this.pointerActions))return;let n=t.timestamp-this._lastEndTimestamp,r=this._momentum&&this._momentum.running&&n<40;switch(t.data.action){case`start`:case`update`:if(r)break;!this._controller||!this._controller.running?this._startController(t):t.data.timestamp-this._lastTimestamp>2&&(this._controller.update(t.data),this._lastTimestamp=t.timestamp);break;case`end`:case`removed`:this._endController(t,!0);break;case`added`:this._endController(t,!1),this._startController(t)}t.stopPropagation()}_endController(e,t){if(this._controller?.running){this._lastEndTimestamp=e.timestamp;let n=this._controller.end(e.data);t&&n&&(this._momentum=n,this._view.state.switchCameraController(this._momentum))}this._controller=null}_startController(e){this._controller=this._createController(),this._view.state.switchCameraController(this._controller),this._controller.begin(e.data),this._lastTimestamp=e.timestamp}_createController(){return this._view.viewingMode===`global`&&this._view.state.camera.relativeElevation>i.maxElevation?new r({view:this._view}):new n({view:this._view})}get test(){}}export{a as GroundNavigation};
2
+ import"../../../../../core/has.js";import{eventMatchesPointerActions as e}from"../../../../input/handlers/support.js";import{InputHandler as t}from"../../../../input/InputHandler.js";import{GroundNavigationController as n}from"../../../state/controllers/GroundNavigationController.js";import{PinchAndPanControllerGlobal as r}from"../../../state/controllers/PinchAndPanControllerGlobal.js";import{groundNavigationConstants as i}from"../../../state/utils/groundNavigationUtils.js";class a extends t{constructor(e,t,n){super(!0),this._view=e,this.pointerActions=t,this._modifiers=n,this._lastEndTimestamp=0,this._lastTimestamp=0,this.registerIncoming(`drag`,n,e=>this._handleDrag(e))}_handleDrag(t){if(t.data.pointers.size===1&&!e(t.data,this.pointerActions))return;let n=t.timestamp-this._lastEndTimestamp,r=this._momentum&&this._momentum.running&&n<40;switch(t.data.action){case`start`:case`update`:if(r)break;!this._controller||!this._controller.running?this._startController(t):t.data.timestamp-this._lastTimestamp>2&&(this._controller.update(t.data),this._lastTimestamp=t.timestamp);break;case`end`:case`removed`:this._endController(t,!0);break;case`added`:this._endController(t,!1),this._startController(t)}t.stopPropagation()}_endController(e,t){if(this._controller?.running){this._lastEndTimestamp=e.timestamp;let n=this._controller.end(e.data);t&&n&&(this._momentum=n,this._view.state.switchCameraController(this._momentum))}this._controller=null}_startController(e){this._controller=this._createController(),this._view.state.switchCameraController(this._controller),this._controller.begin(e.data),this._lastTimestamp=e.timestamp}_createController(){return this._view.state.isGlobal&&this._view.state.camera.relativeElevation>i.maxElevation?new r({view:this._view}):new n({view:this._view})}get test(){}}export{a as GroundNavigation};