@arcgis/core 4.34.0-next.50 → 4.34.0-next.51

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 (256) hide show
  1. package/analysis/ElevationProfile/GroundLine.d.ts +4 -0
  2. package/analysis/ElevationProfile/GroundLine.js +5 -0
  3. package/analysis/ElevationProfile/InputLine.d.ts +4 -0
  4. package/analysis/ElevationProfile/InputLine.js +5 -0
  5. package/analysis/ElevationProfile/Line.d.ts +4 -0
  6. package/analysis/ElevationProfile/Line.js +5 -0
  7. package/analysis/ElevationProfile/LineChartOptions.d.ts +4 -0
  8. package/analysis/ElevationProfile/LineChartOptions.js +5 -0
  9. package/analysis/ElevationProfile/LineViewOptions.d.ts +4 -0
  10. package/analysis/ElevationProfile/LineViewOptions.js +5 -0
  11. package/analysis/ElevationProfile/QueryLine.d.ts +4 -0
  12. package/analysis/ElevationProfile/QueryLine.js +5 -0
  13. package/analysis/ElevationProfile/SceneLine.d.ts +4 -0
  14. package/analysis/ElevationProfile/SceneLine.js +5 -0
  15. package/analysis/ElevationProfile/Units.d.ts +4 -0
  16. package/analysis/ElevationProfile/Units.js +5 -0
  17. package/analysis/ElevationProfile/ViewOptions.d.ts +4 -0
  18. package/analysis/ElevationProfile/ViewOptions.js +5 -0
  19. package/analysis/ElevationProfile/elevationProfileLineTypes.js +5 -0
  20. package/analysis/ElevationProfileAnalysis.js +1 -1
  21. package/assets/esri/core/workers/RemoteClient.js +1 -1
  22. package/assets/esri/core/workers/chunks/{7bd672e534cde0d5787d.js → 0021118bafefd1e47ff7.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{0b52c0ca432761076076.js → 081b22fa73ef7b696409.js} +2 -2
  24. package/assets/esri/core/workers/chunks/0a6d33d013628f671aea.js +1 -0
  25. package/assets/esri/core/workers/chunks/0ce671588de2858516d2.js +1 -0
  26. package/assets/esri/core/workers/chunks/14c6ae4feb4859cfa7c5.js +1 -0
  27. package/assets/esri/core/workers/chunks/20a2b3d1f826e9059884.js +1 -0
  28. package/assets/esri/core/workers/chunks/{c4651243525026e6ddde.js → 2da12a64d3baef4aaaa1.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{3610357c8fa9bec9e0dc.js → 30169cf969d36ea8654e.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{5b0c42bb95d81085061d.js → 35fc8a64674005b1d1d7.js} +1 -1
  31. package/assets/esri/core/workers/chunks/37a97e690786814bf0b3.js +1 -0
  32. package/assets/esri/core/workers/chunks/38f84294fb2fb4663ba5.js +1 -0
  33. package/assets/esri/core/workers/chunks/3eb3af0b6cf3c2f28131.js +1 -0
  34. package/assets/esri/core/workers/chunks/48e64f99720907017778.js +1 -0
  35. package/assets/esri/core/workers/chunks/4bd92232928b832dea76.js +1 -0
  36. package/assets/esri/core/workers/chunks/50e9eafb118d2a221f10.js +1 -0
  37. package/assets/esri/core/workers/chunks/55588e668b6acb6aa390.js +1 -0
  38. package/assets/esri/core/workers/chunks/5b112471dca94b2e8462.js +1 -0
  39. package/assets/esri/core/workers/chunks/5dfe1aed10095385c066.js +1 -0
  40. package/assets/esri/core/workers/chunks/7389841fabe0f319f1e5.js +1 -0
  41. package/assets/esri/core/workers/chunks/77493aa2118d462612a0.js +1 -0
  42. package/assets/esri/core/workers/chunks/7a8d740d1226719a578a.js +1 -0
  43. package/assets/esri/core/workers/chunks/8e0559cc6295008fcdf7.js +1 -0
  44. package/assets/esri/core/workers/chunks/{69e37365c17e7cc4168f.js → 93af38d29d066f27ed28.js} +1 -1
  45. package/assets/esri/core/workers/chunks/944fa8261aad94ae0542.js +1 -0
  46. package/assets/esri/core/workers/chunks/{6775d2ab5faf1fa161db.js → 97a38d700f2cb8807d51.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{45121b7258333c8ebbdb.js → 98ea12c7a000a30f3dc0.js} +1 -1
  48. package/assets/esri/core/workers/chunks/9e479e7e2e51476c3d27.js +1 -0
  49. package/assets/esri/core/workers/chunks/a1e179dd6de9c8769b02.js +1 -0
  50. package/assets/esri/core/workers/chunks/a829969ed44cdb814f27.js +1 -0
  51. package/assets/esri/core/workers/chunks/ac41b882f9cbf8d56f0c.js +1 -0
  52. package/assets/esri/core/workers/chunks/b0ee061747bef6729bb9.js +1 -0
  53. package/assets/esri/core/workers/chunks/b2a035befeeff1a55ad8.js +1 -0
  54. package/assets/esri/core/workers/chunks/ba45dccb4dab5a74d224.js +1 -0
  55. package/assets/esri/core/workers/chunks/c5b2a261d8c216ca4a10.js +1 -0
  56. package/assets/esri/core/workers/chunks/{edc4f230a5bdf928f9fd.js → d1aeb9fe9eb573beefcc.js} +2 -2
  57. package/assets/esri/core/workers/chunks/e3f68f7b408a08d7cd5d.js +1 -0
  58. package/assets/esri/core/workers/chunks/e9716995ce0c3683eafc.js +1 -0
  59. package/assets/esri/core/workers/chunks/{4cc982c99d84e896d535.js → ed25bf087f52e5d3e71b.js} +1 -1
  60. package/assets/esri/core/workers/chunks/f92e608931b1c168cb45.js +1 -0
  61. package/assets/esri/core/workers/chunks/f9f94b5efa9a64cdb407.js +1 -0
  62. package/assets/esri/core/workers/chunks/fb4950995f6780f6c22a.js +1 -0
  63. package/assets/esri/themes/base/widgets/_VideoPlayer.scss +16 -2
  64. package/assets/esri/themes/dark/main.css +1 -1
  65. package/assets/esri/themes/light/main.css +1 -1
  66. package/assets/esri/themes/light/view.css +1 -1
  67. package/chunks/Laserlines.glsl.js +12 -12
  68. package/chunks/sphere.js +1 -1
  69. package/chunks/vec42.js +1 -1
  70. package/config.js +1 -1
  71. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  72. package/core/libs/gl-matrix-2/math/vec4.js +1 -1
  73. package/geometry/projection/projectBoundingSphere.js +1 -1
  74. package/geometry/support/DoubleArray.js +1 -1
  75. package/geometry/support/aaBoundingRect.js +1 -1
  76. package/geometry/support/curves/bezierCurveUtils.js +1 -1
  77. package/geometry/support/curves/circleUtils.js +1 -1
  78. package/geometry/support/curves/ellipticArc4Utils.js +1 -1
  79. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  80. package/geometry/support/curves/mathUtils.js +1 -1
  81. package/geometry/support/sphere.js +1 -1
  82. package/interfaces.d.ts +271 -279
  83. package/kernel.js +1 -1
  84. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  85. package/layers/mixins/ArcGISImageService.js +1 -1
  86. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  87. package/package.json +1 -1
  88. package/support/revision.js +1 -1
  89. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  90. package/views/2d/engine/imagery/RasterTileContainer.js +1 -1
  91. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  92. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +5 -0
  93. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/AspectTechnique.js +1 -1
  94. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BandArithmeticTechnique.js +1 -1
  95. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BaseRasterProcessorTechnique.js +1 -1
  96. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ColormapToRGBTechnique.js +1 -1
  97. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CompositeBandTechnique.js +1 -1
  98. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ComputeChangeTechnique.js +1 -1
  99. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ContrastBrightnessTechnique.js +1 -1
  100. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ConvolutionTechnique.js +1 -1
  101. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CurvatureTechnique.js +1 -1
  102. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ExtractBandTechnique.js +1 -1
  103. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/FocalStatisticsTechnique.js +1 -1
  104. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/GrayscaleTechnique.js +1 -1
  105. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/HillshadeTechnique.js +1 -1
  106. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/LocalTechnique.js +1 -1
  107. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/MaskTechnique.js +1 -1
  108. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/NDVITechnique.js +1 -1
  109. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/RemapTechnique.js +1 -1
  110. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ReprojectTechnique.js +1 -1
  111. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ShadedReliefTechnique.js +1 -1
  112. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/SlopeTechnique.js +1 -1
  113. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/StretchTechnique.js +1 -1
  114. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
  115. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterColorizerShader.js +1 -1
  116. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterRangeHighlightShader.js +5 -0
  117. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  118. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  119. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  120. package/views/2d/layers/imagery/ImageryView2D.js +1 -1
  121. package/views/3d/analysis/ElevationProfile/ProfileLinesVisualization.js +1 -1
  122. package/views/3d/analysis/ElevationProfile/SceneLineComputation.js +5 -0
  123. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  124. package/views/3d/analysis/VolumeMeasurement/CutFillVolumeMeasurementController.js +1 -1
  125. package/views/3d/analysis/support/measurementUtils.js +1 -1
  126. package/views/3d/camera/constraintUtils/distance.js +1 -1
  127. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  128. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  129. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  130. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  131. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  132. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  133. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  134. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  135. package/views/3d/interactive/visualElements/SlicePlaneVisualElement.js +1 -1
  136. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  137. package/views/3d/layers/I3SMeshView3D.js +1 -1
  138. package/views/3d/layers/SceneLayerWorker.js +1 -1
  139. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  140. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  141. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  142. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  143. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  144. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  145. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  146. package/views/3d/layers/i3s/I3SProjectionUtil.js +1 -1
  147. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  148. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  149. package/views/3d/state/NearFarHeuristic.js +1 -1
  150. package/views/3d/state/ViewStateManager.js +1 -1
  151. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  152. package/views/3d/state/utils/navigationUtils.js +1 -1
  153. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  154. package/views/3d/support/orientedBoundingBox.js +1 -1
  155. package/views/3d/terrain/OverlayManager.js +1 -1
  156. package/views/3d/terrain/ScaleRangeQueries.js +1 -1
  157. package/views/3d/terrain/SphericalPatch.js +1 -1
  158. package/views/3d/terrain/TerrainSurface.js +1 -1
  159. package/views/3d/terrain/Tile.js +1 -1
  160. package/views/3d/webgl/RenderCamera.js +1 -1
  161. package/views/3d/webgl-engine/Stage.js +1 -1
  162. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  163. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  164. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  165. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  166. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  167. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  168. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  169. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  170. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  171. package/views/3d/webgl-engine/lib/screenSizePerspectiveUtils.js +1 -1
  172. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  173. package/views/analysis/ElevationProfile/Controller.js +5 -0
  174. package/views/analysis/ElevationProfile/GroundLineComputation.js +5 -0
  175. package/views/analysis/ElevationProfile/InputLineComputation.js +5 -0
  176. package/views/analysis/ElevationProfile/LineComputation.js +5 -0
  177. package/views/analysis/ElevationProfile/QueryLineComputation.js +5 -0
  178. package/views/analysis/ElevationProfile/Result.d.ts +4 -0
  179. package/views/analysis/{ElevationProfileResult.js → ElevationProfile/Result.js} +1 -1
  180. package/views/interactive/coordinateHelper.js +1 -1
  181. package/views/interactive/editGeometry/operations/curveOperationUtils.js +1 -1
  182. package/views/interactive/sketch/constraints.js +1 -1
  183. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  184. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  185. package/views/support/LayerLayerViewInfo.js +1 -1
  186. package/views/support/LayerViewManager.js +1 -1
  187. package/widgets/ElevationProfile/ElevationProfileLine.d.ts +2 -2
  188. package/widgets/ElevationProfile/ElevationProfileLineGround.d.ts +2 -2
  189. package/widgets/ElevationProfile/ElevationProfileLineInput.d.ts +2 -2
  190. package/widgets/ElevationProfile/ElevationProfileLineQuery.d.ts +2 -2
  191. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  192. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  193. package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +5 -0
  194. package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
  195. package/widgets/VideoPlayer/css.js +1 -1
  196. package/widgets/VideoPlayer.js +1 -1
  197. package/analysis/ElevationProfileLine.d.ts +0 -4
  198. package/analysis/ElevationProfileLine.js +0 -5
  199. package/analysis/ElevationProfileLineChartOptions.d.ts +0 -4
  200. package/analysis/ElevationProfileLineChartOptions.js +0 -5
  201. package/analysis/ElevationProfileLineGround.d.ts +0 -4
  202. package/analysis/ElevationProfileLineGround.js +0 -5
  203. package/analysis/ElevationProfileLineInput.d.ts +0 -4
  204. package/analysis/ElevationProfileLineInput.js +0 -5
  205. package/analysis/ElevationProfileLineQuery.d.ts +0 -4
  206. package/analysis/ElevationProfileLineQuery.js +0 -5
  207. package/analysis/ElevationProfileLineScene.d.ts +0 -4
  208. package/analysis/ElevationProfileLineScene.js +0 -5
  209. package/analysis/ElevationProfileLineViewOptions.d.ts +0 -4
  210. package/analysis/ElevationProfileLineViewOptions.js +0 -5
  211. package/analysis/ElevationProfileUnits.d.ts +0 -4
  212. package/analysis/ElevationProfileUnits.js +0 -5
  213. package/analysis/ElevationProfileViewOptions.d.ts +0 -4
  214. package/analysis/ElevationProfileViewOptions.js +0 -5
  215. package/analysis/support/elevationProfileLineTypes.js +0 -5
  216. package/assets/esri/core/workers/chunks/21a90083f29e44ccd735.js +0 -1
  217. package/assets/esri/core/workers/chunks/224872bfd923cf4c9d78.js +0 -1
  218. package/assets/esri/core/workers/chunks/237c96d946efa5ed0386.js +0 -1
  219. package/assets/esri/core/workers/chunks/2942ab268f24cea2e722.js +0 -1
  220. package/assets/esri/core/workers/chunks/32789077e37d5c8191e7.js +0 -1
  221. package/assets/esri/core/workers/chunks/3e3886a51c0f8c86df75.js +0 -1
  222. package/assets/esri/core/workers/chunks/6d786fac4bb5efcb7acc.js +0 -1
  223. package/assets/esri/core/workers/chunks/7b95da70d39ba316b051.js +0 -1
  224. package/assets/esri/core/workers/chunks/7df8c78e36b04ad657d2.js +0 -1
  225. package/assets/esri/core/workers/chunks/838c7fd37b2e78b1d582.js +0 -1
  226. package/assets/esri/core/workers/chunks/8c6119dde0eead8d90d9.js +0 -1
  227. package/assets/esri/core/workers/chunks/8c8c8f1058a4b58a3181.js +0 -1
  228. package/assets/esri/core/workers/chunks/8f70650aba8e55eb7a96.js +0 -1
  229. package/assets/esri/core/workers/chunks/96a34b240d17147902f4.js +0 -1
  230. package/assets/esri/core/workers/chunks/9af47a4da3a0b84f1add.js +0 -1
  231. package/assets/esri/core/workers/chunks/9affcf990ea810fa426b.js +0 -1
  232. package/assets/esri/core/workers/chunks/a3dce23ca98c9b0f945f.js +0 -1
  233. package/assets/esri/core/workers/chunks/a50026e567b1edff87c6.js +0 -1
  234. package/assets/esri/core/workers/chunks/a7ff44157b8cf19de37e.js +0 -1
  235. package/assets/esri/core/workers/chunks/b884bd2f50aaccfa24c5.js +0 -1
  236. package/assets/esri/core/workers/chunks/c483d2149d9d0099bfdb.js +0 -1
  237. package/assets/esri/core/workers/chunks/cfc3f202e7313ca56823.js +0 -1
  238. package/assets/esri/core/workers/chunks/d1c97fdcba6eb443cb1c.js +0 -1
  239. package/assets/esri/core/workers/chunks/d7c679374aa2d256becf.js +0 -1
  240. package/assets/esri/core/workers/chunks/d8d17e3ecccec7e99f0b.js +0 -1
  241. package/assets/esri/core/workers/chunks/e4069352d5d1104749ae.js +0 -1
  242. package/assets/esri/core/workers/chunks/e408ccee12bfe089c913.js +0 -1
  243. package/assets/esri/core/workers/chunks/e5522c85ca4f0efab8ea.js +0 -1
  244. package/assets/esri/core/workers/chunks/e59e09766b130a05c617.js +0 -1
  245. package/assets/esri/core/workers/chunks/ef02e33ea53b46b566cb.js +0 -1
  246. package/assets/esri/core/workers/chunks/ff79a8df1b1941ae350d.js +0 -1
  247. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +0 -5
  248. package/views/analysis/ElevationProfile/ElevationProfileController.js +0 -5
  249. package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +0 -5
  250. package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +0 -5
  251. package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +0 -5
  252. package/views/analysis/ElevationProfile/ElevationProfileLineQueryComputation.js +0 -5
  253. package/views/analysis/ElevationProfileResult.d.ts +0 -4
  254. package/views/support/PixelHighlightOptions.js +0 -5
  255. /package/assets/esri/core/workers/chunks/{edc4f230a5bdf928f9fd.js.LICENSE.txt → d1aeb9fe9eb573beefcc.js.LICENSE.txt} +0 -0
  256. /package/views/analysis/ElevationProfile/{profileUtils.js → profileGenerationUtils.js} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as e}from"../../../../../../../../core/maybe.js";import{tileSize as t}from"../../../../definitions.js";import{Technique as r}from"../../Technique.js";import{createNewFBO as n,createProcessedTexture as s}from"./textureUtils.js";import{createColormapTexture as o}from"../../../../../../../webgl/rasterUtils.js";class a extends r{shutdown(e){super.shutdown(e),this._fbo?.dispose(),this._fbo=void 0}render(r,a){const{rasterFunction:i}=r;if(!i)return;const{context:u}=r,m="indexedColormap"in i.parameters?o(u,i.parameters.indexedColormap):void 0,p="Reproject"===i.name,d=u.getBoundFramebufferObject(),c=u.getViewport();for(const o of a.bitmaps){const d=p?!(o.rasterTexture&&o.projected):!o.processed;if(!o.source||!d||o.suspended)continue;r.timeline.begin(this.name);const{painter:c}=r;c.setPipelineState({depth:!1,stencil:{test:!1,write:!1},color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:1,dstRGB:0,srcAlpha:1,dstAlpha:0}}}),p||(o.processedTexture=e(o.processedTexture)),o.updateTexture(r);const[l,g]=o.getRasterTextureSize(p),f=l===t&&g===t,h=f?a.processorFbo:n(u,l,g);u.bindFramebuffer(h),u.setViewport(0,0,h.width,h.height),this._process(r,o,m);const x=s(r.context,l,g);if(h.copyToTexture(0,0,l,g,0,0,x),p)o.rasterTexture=x;else{const e=r.hasBranches?i.id:0;o.functionTextures[e]=x}f||h.dispose(),r.timeline.end(this.name)}m?.dispose(),u.bindFramebuffer(d),u.setViewport(c.x,c.y,c.width,c.height)}_getCommonConfig(e,t){const{rasterFunction:r,hasBranches:n}=e,{raster:s,rasters:o}=r.parameters,a=n?s?.id??o?.filter(e=>"Constant"!==e.name)?.[0]?.id??-1:0,i=t.functionTextures[a]??t.rasterTexture,u="Reproject"===r.name;return{texture:{texture:i,unit:0},srcImageSize:t.getRasterTextureSize(u)}}_getMultipleInputConfig(e,t){return t?.length?2===t.length?{twoRasterConfig:this._getTwoInputConfig(t,e)}:3===t.length?{threeRasterConfig:this._getThreeInputConfig(t,e)}:{}:{}}_getConstantCount(e){return e?.filter(e=>"Constant"===e.name).length??0}_getTextures(e,t){return e.filter(e=>"Constant"!==e.name).map(e=>null!=e.id&&"Identity"!==e.name?t.functionTextures[e.id]:t.rasterTexture)}_getTwoInputConfig(e,t){const r=this._getTextures(e,t),n=r[1]?{texture:r[1],unit:1}:void 0,s=e.findIndex(e=>"Constant"===e.name),o=0===s?new Float32Array([0,1,0,1,0,0,0,0,0]):new Float32Array([1,0,0,0,1,0,0,0,0]);return{image1:n,image1Const:s>-1?e[s].parameters.value:0,imageSwap:o}}_getThreeInputConfig(e,t){const r=this._getTextures(e,t);let n=0,s=0,o=new Float32Array([1,0,0,0,1,0,0,0,1]);const a=r[1]?{texture:r[1],unit:1}:void 0,i=r[2]?{texture:r[2],unit:2}:void 0,u=[];if(e.forEach((e,t)=>"Constant"===e.name&&u.push(t)),1===u.length)n=e[u[0]].parameters.value,o=0===u[0]?new Float32Array([0,1,0,0,0,1,1,0,0]):1===u[0]?new Float32Array([1,0,0,0,0,1,0,1,0]):new Float32Array([1,0,0,0,1,0,0,0,1]);else if(2===u.length){n=e[u[0]].parameters.value,s=e[u[1]].parameters.value;const t=e.findIndex(e=>"Constant"!==e.name);o=0===t?new Float32Array([1,0,0,0,1,0,0,0,1]):1===t?new Float32Array([0,1,0,1,0,0,0,0,1]):new Float32Array([0,0,1,1,0,0,0,1,0])}return{image1:a,image2:i,image1Const:n,image2Const:s,imageSwap:o}}}export{a as BaseRasterProcessorTechnique};
5
+ import{disposeMaybe as e}from"../../../../../../../../core/maybe.js";import{tileSize as t}from"../../../../definitions.js";import{Technique as r}from"../../Technique.js";import{createNewFBO as n,createProcessedTexture as s}from"./textureUtils.js";import{createColormapTexture as o}from"../../../../../../../webgl/rasterUtils.js";class i extends r{shutdown(e){super.shutdown(e),this._fbo?.dispose(),this._fbo=void 0}render(r,i){const{rasterFunction:a}=r;if(!a)return;const{context:u}=r,m="indexedColormap"in a.parameters?o(u,a.parameters.indexedColormap):void 0,p="Reproject"===a.name,d=u.getBoundFramebufferObject(),c=u.getViewport();for(const o of i.bitmaps){const d=p?!(o.rasterTexture&&o.projected):!o.processed;if(!o.source||!d||o.suspended)continue;r.timeline.begin(this.name);const{painter:c}=r;c.setPipelineState({depth:!1,stencil:{test:!1,write:!1},color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:1,dstRGB:0,srcAlpha:1,dstAlpha:0}}}),p||(o.processedTexture=e(o.processedTexture)),o.updateTexture(r);const[l,g]=o.getRasterTextureSize(p),f=l===t&&g===t,h=f?i.processorFbo:n(u,l,g);u.bindFramebuffer(h),u.setViewport(0,0,h.width,h.height),this._process(r,o,m);const x=s(r.context,l,g);if(h.copyToTexture(0,0,l,g,0,0,x),p)o.rasterTexture=x;else{const e=r.hasBranches?a.id:0;o.functionTextures[e]?.dispose(),o.functionTextures[e]=x}f||h.dispose(),r.timeline.end(this.name)}m?.dispose(),u.bindFramebuffer(d),u.setViewport(c.x,c.y,c.width,c.height)}_getCommonConfig(e,t){const{rasterFunction:r,hasBranches:n}=e,{raster:s,rasters:o}=r.parameters,i=n?s?.id??o?.filter(e=>"Constant"!==e.name)?.[0]?.id??-1:0,a=t.functionTextures[i]??t.rasterTexture,u="Reproject"===r.name;return{texture:{texture:a,unit:0},srcImageSize:t.getRasterTextureSize(u)}}_getMultipleInputConfig(e,t){return t?.length?2===t.length?{twoRasterConfig:this._getTwoInputConfig(t,e)}:3===t.length?{threeRasterConfig:this._getThreeInputConfig(t,e)}:{}:{}}_getConstantCount(e){return e?.filter(e=>"Constant"===e.name).length??0}_getTextures(e,t){return e.filter(e=>"Constant"!==e.name).map(e=>null!=e.id&&"Identity"!==e.name?t.functionTextures[e.id]:t.rasterTexture)}_getTwoInputConfig(e,t){const r=this._getTextures(e,t),n=r[1]?{texture:r[1],unit:1}:void 0,s=e.findIndex(e=>"Constant"===e.name),o=0===s?new Float32Array([0,1,0,1,0,0,0,0,0]):new Float32Array([1,0,0,0,1,0,0,0,0]);return{image1:n,image1Const:s>-1?e[s].parameters.value:0,imageSwap:o}}_getThreeInputConfig(e,t){const r=this._getTextures(e,t);let n=0,s=0,o=new Float32Array([1,0,0,0,1,0,0,0,1]);const i=r[1]?{texture:r[1],unit:1}:void 0,a=r[2]?{texture:r[2],unit:2}:void 0,u=[];if(e.forEach((e,t)=>"Constant"===e.name&&u.push(t)),1===u.length)n=e[u[0]].parameters.value,o=0===u[0]?new Float32Array([0,1,0,0,0,1,1,0,0]):1===u[0]?new Float32Array([1,0,0,0,0,1,0,1,0]):new Float32Array([1,0,0,0,1,0,0,0,1]);else if(2===u.length){n=e[u[0]].parameters.value,s=e[u[1]].parameters.value;const t=e.findIndex(e=>"Constant"!==e.name);o=0===t?new Float32Array([1,0,0,0,1,0,0,0,1]):1===t?new Float32Array([0,1,0,1,0,0,0,0,1]):new Float32Array([0,0,1,1,0,0,0,1,0])}return{image1:i,image2:a,image1Const:n,image2Const:s,imageSwap:o}}}export{i as BaseRasterProcessorTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{BaseRasterProcessorTechnique as o}from"./BaseRasterProcessorTechnique.js";import{ColormapToRGBShader as e}from"../../shaders/raster/processor/ColormapToRGBShader.js";class r extends o{constructor(){super(...arguments),this.name="RasterColormapToRGBProcessor",this.type=4,this.shaders={colormapToRGB:new e}}_process(o,e,r){const s=o.rasterFunction.parameters,t={colormapTexture:{texture:r,unit:1},colormapOffset:s.offset,colormapMaxIndex:s.indexedColormap.length/4-1},a=this._getCommonConfig(o,e),n={shader:this.shaders.colormapToRGB,uniforms:{config:a,colormapConfig:t},defines:{},optionalAttributes:null,useComputeBuffer:!1},{painter:i,context:m}=o;i.submitDrawMesh(m,n,i.quadMesh)}}export{r as ColormapToRGBTechnique};
5
+ import{BaseRasterProcessorTechnique as o}from"./BaseRasterProcessorTechnique.js";import{ColormapToRGBShader as e}from"../../shaders/raster/processor/ColormapToRGBShader.js";class r extends o{constructor(){super(...arguments),this.name="RasterColormapToRGBProcessor",this.type=5,this.shaders={colormapToRGB:new e}}_process(o,e,r){const s=o.rasterFunction.parameters,t={colormapTexture:{texture:r,unit:1},colormapOffset:s.offset,colormapMaxIndex:s.indexedColormap.length/4-1},a=this._getCommonConfig(o,e),n={shader:this.shaders.colormapToRGB,uniforms:{config:a,colormapConfig:t},defines:{},optionalAttributes:null,useComputeBuffer:!1},{painter:i,context:m}=o;i.submitDrawMesh(m,n,i.quadMesh)}}export{r as ColormapToRGBTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{BaseRasterProcessorTechnique as s}from"./BaseRasterProcessorTechnique.js";import{CompositeBandShader as t}from"../../shaders/raster/processor/CompositeBandShader.js";class e extends s{constructor(){super(...arguments),this.name="RasterCompositeBandProcessor",this.type=5,this.shaders={compositeBand:new t}}_process(s,t){const{rasters:e}=s.rasterFunction.parameters,o={constantCount:this._getConstantCount(e),imageCount:e?.length??1},r=this._getMultipleInputConfig(t,e),n=this._getCommonConfig(s,t),a={shader:this.shaders.compositeBand,uniforms:{config:n,...r},defines:o,optionalAttributes:null,useComputeBuffer:!1},{painter:i,context:p}=s;i.submitDrawMesh(p,a,i.quadMesh)}}export{e as CompositeBandTechnique};
5
+ import{BaseRasterProcessorTechnique as s}from"./BaseRasterProcessorTechnique.js";import{CompositeBandShader as t}from"../../shaders/raster/processor/CompositeBandShader.js";class e extends s{constructor(){super(...arguments),this.name="RasterCompositeBandProcessor",this.type=6,this.shaders={compositeBand:new t}}_process(s,t){const{rasters:e}=s.rasterFunction.parameters,o={constantCount:this._getConstantCount(e),imageCount:e?.length??1},r=this._getMultipleInputConfig(t,e),n=this._getCommonConfig(s,t),a={shader:this.shaders.compositeBand,uniforms:{config:n,...r},defines:o,optionalAttributes:null,useComputeBuffer:!1},{painter:i,context:p}=s;i.submitDrawMesh(p,a,i.quadMesh)}}export{e as CompositeBandTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{ComputeChangeShader as t}from"../../shaders/raster/processor/ComputeChangeShader.js";class s extends e{constructor(){super(...arguments),this.name="RasterComputeChangeProcessor",this.type=6,this.shaders={computeChange:new t}}_process(e,t){const s=e.rasterFunction.parameters,{rasters:o}=s,n={constantCount:this._getConstantCount(o),imageCount:o.length,method:s.method,isOutputRounded:s.isOutputRounded},r={domainRange:s.domainRange},{twoRasterConfig:a}=this._getMultipleInputConfig(t,o),i=this._getCommonConfig(e,t),u={shader:this.shaders.computeChange,uniforms:{config:i,domainRangeConfig:r,twoRasterConfig:a},defines:n,optionalAttributes:null,useComputeBuffer:!1},{painter:h,context:m}=e;h.submitDrawMesh(m,u,h.quadMesh)}}export{s as ComputeChangeTechnique};
5
+ import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{ComputeChangeShader as t}from"../../shaders/raster/processor/ComputeChangeShader.js";class s extends e{constructor(){super(...arguments),this.name="RasterComputeChangeProcessor",this.type=7,this.shaders={computeChange:new t}}_process(e,t){const s=e.rasterFunction.parameters,{rasters:o}=s,n={constantCount:this._getConstantCount(o),imageCount:o.length,method:s.method,isOutputRounded:s.isOutputRounded},r={domainRange:s.domainRange},{twoRasterConfig:a}=this._getMultipleInputConfig(t,o),i=this._getCommonConfig(e,t),u={shader:this.shaders.computeChange,uniforms:{config:i,domainRangeConfig:r,twoRasterConfig:a},defines:n,optionalAttributes:null,useComputeBuffer:!1},{painter:h,context:m}=e;h.submitDrawMesh(m,u,h.quadMesh)}}export{s as ComputeChangeTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{BaseRasterProcessorTechnique as s}from"./BaseRasterProcessorTechnique.js";import{ContrastBrightnessShader as t}from"../../shaders/raster/processor/ContrastBrightnessShader.js";class r extends s{constructor(){super(...arguments),this.name="RasterContrastBrightnessProcessor",this.type=7,this.shaders={contrastBrightness:new t}}_process(s,t){const r=this._getCommonConfig(s,t),e=s.rasterFunction.parameters,o={shader:this.shaders.contrastBrightness,uniforms:{config:r,contrastBrightnessConfig:e},defines:{},optionalAttributes:null,useComputeBuffer:!1},{painter:n,context:a}=s;n.submitDrawMesh(a,o,n.quadMesh)}}export{r as ContrastBrightnessTechnique};
5
+ import{BaseRasterProcessorTechnique as s}from"./BaseRasterProcessorTechnique.js";import{ContrastBrightnessShader as t}from"../../shaders/raster/processor/ContrastBrightnessShader.js";class r extends s{constructor(){super(...arguments),this.name="RasterContrastBrightnessProcessor",this.type=8,this.shaders={contrastBrightness:new t}}_process(s,t){const r=this._getCommonConfig(s,t),e=s.rasterFunction.parameters,o={shader:this.shaders.contrastBrightness,uniforms:{config:r,contrastBrightnessConfig:e},defines:{},optionalAttributes:null,useComputeBuffer:!1},{painter:n,context:a}=s;n.submitDrawMesh(a,o,n.quadMesh)}}export{r as ContrastBrightnessTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{ConvolutionShader as o}from"../../shaders/raster/processor/ConvolutionShader.js";class s extends e{constructor(){super(...arguments),this.name="RasterConvolutionProcessor",this.type=8,this.shaders={convolution:new o}}_process(e,o){const s=e.rasterFunction.parameters,r={rows:s.kernelRows,cols:s.kernelCols},n={kernel:[...s.kernel],clampRange:s.clampRange},t=this._getCommonConfig(e,o),i={shader:this.shaders.convolution,uniforms:{config:t,convolutionConfig:n},defines:r,optionalAttributes:null,useComputeBuffer:!1},{painter:a,context:c}=e;a.submitDrawMesh(c,i,a.quadMesh)}}export{s as ConvolutionTechnique};
5
+ import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{ConvolutionShader as o}from"../../shaders/raster/processor/ConvolutionShader.js";class s extends e{constructor(){super(...arguments),this.name="RasterConvolutionProcessor",this.type=9,this.shaders={convolution:new o}}_process(e,o){const s=e.rasterFunction.parameters,r={rows:s.kernelRows,cols:s.kernelCols},n={kernel:[...s.kernel],clampRange:s.clampRange},t=this._getCommonConfig(e,o),i={shader:this.shaders.convolution,uniforms:{config:t,convolutionConfig:n},defines:r,optionalAttributes:null,useComputeBuffer:!1},{painter:a,context:c}=e;a.submitDrawMesh(c,i,a.quadMesh)}}export{s as ConvolutionTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{BaseRasterProcessorTechnique as r}from"./BaseRasterProcessorTechnique.js";import{CurvatureShader as e}from"../../shaders/raster/processor/CurvatureShader.js";class s extends r{constructor(){super(...arguments),this.name="RasterCurvatureProcessor",this.type=9,this.shaders={curvature:new e}}_process(r,e){const s=r.rasterFunction.parameters,t={curvatureType:s.curvatureType},a=e.getRasterCellSize(),o={zlFactor:200*s.zFactor/a[0]/a[1]},u=this._getCommonConfig(r,e),c={shader:this.shaders.curvature,uniforms:{config:u,curvatureConfig:o},defines:t,optionalAttributes:null,useComputeBuffer:!1},{painter:i,context:n}=r;i.submitDrawMesh(n,c,i.quadMesh)}}export{s as CurvatureTechnique};
5
+ import{BaseRasterProcessorTechnique as r}from"./BaseRasterProcessorTechnique.js";import{CurvatureShader as e}from"../../shaders/raster/processor/CurvatureShader.js";class s extends r{constructor(){super(...arguments),this.name="RasterCurvatureProcessor",this.type=10,this.shaders={curvature:new e}}_process(r,e){const s=r.rasterFunction.parameters,t={curvatureType:s.curvatureType},a=e.getRasterCellSize(),o={zlFactor:200*s.zFactor/a[0]/a[1]},u=this._getCommonConfig(r,e),c={shader:this.shaders.curvature,uniforms:{config:u,curvatureConfig:o},defines:t,optionalAttributes:null,useComputeBuffer:!1},{painter:i,context:n}=r;i.submitDrawMesh(n,c,i.quadMesh)}}export{s as CurvatureTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{ExtractBandShader as s}from"../../shaders/raster/processor/ExtractBandShader.js";class t extends e{constructor(){super(...arguments),this.name="RasterExtractBandProcessor",this.type=10,this.shaders={extractBand:new s}}_process(e,s){const t={bandIndexMat3:e.rasterFunction.parameters.bandIndexMat3},r=this._getCommonConfig(e,s),a={shader:this.shaders.extractBand,uniforms:{config:r,extractBandConfig:t},defines:{},optionalAttributes:null,useComputeBuffer:!1},{painter:n,context:o}=e;n.submitDrawMesh(o,a,n.quadMesh)}}export{t as ExtractBandTechnique};
5
+ import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{ExtractBandShader as s}from"../../shaders/raster/processor/ExtractBandShader.js";class t extends e{constructor(){super(...arguments),this.name="RasterExtractBandProcessor",this.type=11,this.shaders={extractBand:new s}}_process(e,s){const t={bandIndexMat3:e.rasterFunction.parameters.bandIndexMat3},r=this._getCommonConfig(e,s),a={shader:this.shaders.extractBand,uniforms:{config:r,extractBandConfig:t},defines:{},optionalAttributes:null,useComputeBuffer:!1},{painter:n,context:o}=e;n.submitDrawMesh(o,a,n.quadMesh)}}export{t as ExtractBandTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{BaseRasterProcessorTechnique as s}from"./BaseRasterProcessorTechnique.js";import{FocalStatisticsShader as t}from"../../shaders/raster/processor/FocalStatisticsShader.js";class e extends s{constructor(){super(...arguments),this.name="RasterFocalStatisticsProcessor",this.type=20,this.shaders={focalStatistics:new t}}_process(s,t){const e=s.rasterFunction.parameters,a={rows:e.kernelRows,cols:e.kernelCols,statisticsType:e.statisticsType,fill:e.fillNoDataOnly},o={clampRange:e.clampRange},r=this._getCommonConfig(s,t),i={shader:this.shaders.focalStatistics,uniforms:{config:r,focalStatisticsConfig:o},defines:a,optionalAttributes:null,useComputeBuffer:!1},{painter:c,context:n}=s;c.submitDrawMesh(n,i,c.quadMesh)}}export{e as FocalStatisticsTechnique};
5
+ import{BaseRasterProcessorTechnique as s}from"./BaseRasterProcessorTechnique.js";import{FocalStatisticsShader as t}from"../../shaders/raster/processor/FocalStatisticsShader.js";class e extends s{constructor(){super(...arguments),this.name="RasterFocalStatisticsProcessor",this.type=21,this.shaders={focalStatistics:new t}}_process(s,t){const e=s.rasterFunction.parameters,a={rows:e.kernelRows,cols:e.kernelCols,statisticsType:e.statisticsType,fill:e.fillNoDataOnly},o={clampRange:e.clampRange},r=this._getCommonConfig(s,t),i={shader:this.shaders.focalStatistics,uniforms:{config:r,focalStatisticsConfig:o},defines:a,optionalAttributes:null,useComputeBuffer:!1},{painter:c,context:n}=s;c.submitDrawMesh(n,i,c.quadMesh)}}export{e as FocalStatisticsTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{BaseRasterProcessorTechnique as s}from"./BaseRasterProcessorTechnique.js";import{GrayscaleShader as e}from"../../shaders/raster/processor/GrayscaleShader.js";class r extends s{constructor(){super(...arguments),this.name="RasterGrayscaleProcessor",this.type=11,this.shaders={grayscale:new e}}_process(s,e){const r={weights:s.rasterFunction.parameters.weights},t=this._getCommonConfig(s,e),a={shader:this.shaders.grayscale,uniforms:{config:t,grayscaleConfig:r},defines:{},optionalAttributes:null,useComputeBuffer:!1},{painter:o,context:i}=s;o.submitDrawMesh(i,a,o.quadMesh)}}export{r as GrayscaleTechnique};
5
+ import{BaseRasterProcessorTechnique as s}from"./BaseRasterProcessorTechnique.js";import{GrayscaleShader as e}from"../../shaders/raster/processor/GrayscaleShader.js";class r extends s{constructor(){super(...arguments),this.name="RasterGrayscaleProcessor",this.type=12,this.shaders={grayscale:new e}}_process(s,e){const r={weights:s.rasterFunction.parameters.weights},t=this._getCommonConfig(s,e),a={shader:this.shaders.grayscale,uniforms:{config:t,grayscaleConfig:r},defines:{},optionalAttributes:null,useComputeBuffer:!1},{painter:o,context:i}=s;o.submitDrawMesh(i,a,o.quadMesh)}}export{r as GrayscaleTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{computeZFactor as s}from"../../shaders/raster/surface.js";import{HillshadeShader as r}from"../../shaders/raster/processor/HillshadeShader.js";class t extends e{constructor(){super(...arguments),this.name="RasterHillshadeProcessor",this.type=12,this.shaders={hillshade:new r}}_process(e,r){const t=e.rasterFunction.parameters,a={isMultidirectional:t.hillshadeType>0},i=r.getRasterCellSize(),o=s(t,i),h={...t,factor:o,minValue:0,maxValue:8e3},l=this._getCommonConfig(e,r),n={shader:this.shaders.hillshade,uniforms:{config:l,hillshadeConfig:h},defines:a,optionalAttributes:null,useComputeBuffer:!1},{painter:d,context:u}=e;d.submitDrawMesh(u,n,d.quadMesh)}}export{t as HillshadeTechnique};
5
+ import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{computeZFactor as s}from"../../shaders/raster/surface.js";import{HillshadeShader as r}from"../../shaders/raster/processor/HillshadeShader.js";class t extends e{constructor(){super(...arguments),this.name="RasterHillshadeProcessor",this.type=13,this.shaders={hillshade:new r}}_process(e,r){const t=e.rasterFunction.parameters,a={isMultidirectional:t.hillshadeType>0},i=r.getRasterCellSize(),o=s(t,i),h={...t,factor:o,minValue:0,maxValue:8e3},l=this._getCommonConfig(e,r),n={shader:this.shaders.hillshade,uniforms:{config:l,hillshadeConfig:h},defines:a,optionalAttributes:null,useComputeBuffer:!1},{painter:d,context:u}=e;d.submitDrawMesh(u,n,d.quadMesh)}}export{t as HillshadeTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{LocalShader as s}from"../../shaders/raster/processor/LocalShader.js";class t extends e{constructor(){super(...arguments),this.name="RasterLocalProcessor",this.type=13,this.shaders={local:new s}}_process(e,s){const t=e.rasterFunction.parameters,o={constantCount:this._getConstantCount(t.rasters),imageCount:t.imageCount,operationName:t.operationName,isOutputRounded:t.isOutputRounded},a={domainRange:t.domainRange},r="conditional"===t.operationName?t.rasters:t.rasters?.slice(0,2),n=this._getMultipleInputConfig(s,r),i=this._getCommonConfig(e,s),u={shader:this.shaders.local,uniforms:{config:i,domainRangeConfig:a,...n},defines:o,optionalAttributes:null,useComputeBuffer:!1},{painter:c,context:m}=e;c.submitDrawMesh(m,u,c.quadMesh)}}export{t as LocalTechnique};
5
+ import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{LocalShader as s}from"../../shaders/raster/processor/LocalShader.js";class t extends e{constructor(){super(...arguments),this.name="RasterLocalProcessor",this.type=14,this.shaders={local:new s}}_process(e,s){const t=e.rasterFunction.parameters,o={constantCount:this._getConstantCount(t.rasters),imageCount:t.imageCount,operationName:t.operationName,isOutputRounded:t.isOutputRounded},a={domainRange:t.domainRange},r="conditional"===t.operationName?t.rasters:t.rasters?.slice(0,2),n=this._getMultipleInputConfig(s,r),i=this._getCommonConfig(e,s),u={shader:this.shaders.local,uniforms:{config:i,domainRangeConfig:a,...n},defines:o,optionalAttributes:null,useComputeBuffer:!1},{painter:c,context:m}=e;c.submitDrawMesh(m,u,c.quadMesh)}}export{t as LocalTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{BaseRasterProcessorTechnique as s}from"./BaseRasterProcessorTechnique.js";import{MaskShader as e}from"../../shaders/raster/processor/MaskShader.js";class a extends s{constructor(){super(...arguments),this.name="RasterMaskProcessor",this.type=14,this.shaders={mask:new e}}_process(s,e){const a=s.rasterFunction.parameters,r={isMultiband:a.bandCount>1},t={includedRanges:[...a.includedRanges],noDataValues:[...a.noDataValues]},o=this._getCommonConfig(s,e),n={shader:this.shaders.mask,uniforms:{config:o,maskConfig:t},defines:r,optionalAttributes:null,useComputeBuffer:!1},{painter:i,context:u}=s;i.submitDrawMesh(u,n,i.quadMesh)}}export{a as MaskTechnique};
5
+ import{BaseRasterProcessorTechnique as s}from"./BaseRasterProcessorTechnique.js";import{MaskShader as e}from"../../shaders/raster/processor/MaskShader.js";class a extends s{constructor(){super(...arguments),this.name="RasterMaskProcessor",this.type=15,this.shaders={mask:new e}}_process(s,e){const a=s.rasterFunction.parameters,r={isMultiband:a.bandCount>1},t={includedRanges:[...a.includedRanges],noDataValues:[...a.noDataValues]},o=this._getCommonConfig(s,e),n={shader:this.shaders.mask,uniforms:{config:o,maskConfig:t},defines:r,optionalAttributes:null,useComputeBuffer:!1},{painter:i,context:u}=s;i.submitDrawMesh(u,n,i.quadMesh)}}export{a as MaskTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{BaseRasterProcessorTechnique as s}from"./BaseRasterProcessorTechnique.js";import{NDVIShader as e}from"../../shaders/raster/processor/NDVIShader.js";class r extends s{constructor(){super(...arguments),this.name="RasterNDVIProcessor",this.type=15,this.shaders={ndvi:new e}}_process(s,e){const r=s.rasterFunction.parameters,t={scaled:r.scaled},o={bandIndexMat3:r.bandIndexMat3},n=this._getCommonConfig(s,e),a={shader:this.shaders.ndvi,uniforms:{config:n,ndviConfig:o},defines:t,optionalAttributes:null,useComputeBuffer:!1},{painter:i,context:d}=s;i.submitDrawMesh(d,a,i.quadMesh)}}export{r as NDVITechnique};
5
+ import{BaseRasterProcessorTechnique as s}from"./BaseRasterProcessorTechnique.js";import{NDVIShader as e}from"../../shaders/raster/processor/NDVIShader.js";class r extends s{constructor(){super(...arguments),this.name="RasterNDVIProcessor",this.type=16,this.shaders={ndvi:new e}}_process(s,e){const r=s.rasterFunction.parameters,t={scaled:r.scaled},o={bandIndexMat3:r.bandIndexMat3},n=this._getCommonConfig(s,e),a={shader:this.shaders.ndvi,uniforms:{config:n,ndviConfig:o},defines:t,optionalAttributes:null,useComputeBuffer:!1},{painter:i,context:d}=s;i.submitDrawMesh(d,a,i.quadMesh)}}export{r as NDVITechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{RemapShader as a}from"../../shaders/raster/processor/RemapShader.js";class s extends e{constructor(){super(...arguments),this.name="RasterRemapProcessor",this.type=16,this.shaders={remap:new a}}_process(e,a){const s=e.rasterFunction.parameters,r={replaceUnmatched:s.allowUnmatched&&null!=s.replacementValue},t={rangeMaps:[...s.rangeMaps],noDataRanges:[...s.noDataRanges],unmatchMask:s.allowUnmatched?1:0,replacementValue:s.replacementValue??0,clampRange:s.clampRange},n=this._getCommonConfig(e,a),o={shader:this.shaders.remap,uniforms:{config:n,remapConfig:t},defines:r,optionalAttributes:null,useComputeBuffer:!1},{painter:m,context:p}=e;m.submitDrawMesh(p,o,m.quadMesh)}}export{s as RemapTechnique};
5
+ import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{RemapShader as a}from"../../shaders/raster/processor/RemapShader.js";class s extends e{constructor(){super(...arguments),this.name="RasterRemapProcessor",this.type=17,this.shaders={remap:new a}}_process(e,a){const s=e.rasterFunction.parameters,r={replaceUnmatched:s.allowUnmatched&&null!=s.replacementValue},t={rangeMaps:[...s.rangeMaps],noDataRanges:[...s.noDataRanges],unmatchMask:s.allowUnmatched?1:0,replacementValue:s.replacementValue??0,clampRange:s.clampRange},n=this._getCommonConfig(e,a),o={shader:this.shaders.remap,uniforms:{config:n,remapConfig:t},defines:r,optionalAttributes:null,useComputeBuffer:!1},{painter:m,context:p}=e;m.submitDrawMesh(p,o,m.quadMesh)}}export{s as RemapTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{ReprojectShader as t}from"../../shaders/raster/processor/ReprojectShader.js";class r extends e{constructor(){super(...arguments),this.name="RasterReprojectProcessor",this.type=17,this.shaders={reproject:new t}}_process(e,t){const r=e.rasterFunction.parameters,o=this._getInterpolationDefines(t.interpolation,!!r.requireNNEdge),{config:i,projectionConfig:n,projectionDefines:s}=this._getReprojectConfig(t),a={shader:this.shaders.reproject,uniforms:{config:i,projectionConfig:n},defines:{...s,...o,applyPixelMask:!1,applyPixelHighlights:!1},optionalAttributes:null,useComputeBuffer:!1},{interpolation:c}=t;t.interpolation="nearest";const{painter:p,context:u}=e;p.submitDrawMesh(u,a,p.quadMesh),t.interpolation=c,t.projected=!0}_getReprojectConfig(e){const{source:t}=e,{names:r,textures:o}=e.getTextures({forProcessing:!0}),i={texture:{texture:o[r.indexOf("u_image")],unit:0},dvsMat3:new Float32Array([2,0,0,0,2,0,-1,-1,0]),coordScale:[1,1],srcImageSize:[t.width,t.height],opacity:1},n=o[r.indexOf("u_transformGrid")],{transformGrid:s}=e,a=!(!n||!s);return{config:i,projectionConfig:a?{transformTexture:{texture:n,unit:1},targetImageSize:[e.width,e.height],transformSpacing:s.spacing,transformGridSize:s.size}:void 0,projectionDefines:{applyProjection:a,lookupProjection:a&&1===s.spacing[0]}}}_getInterpolationDefines(e,t){const r="bilinear"===e&&t;return{bilinear:r,bicubic:"cubic"===e,nearestOnEdge:r}}}export{r as ReprojectTechnique};
5
+ import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{ReprojectShader as t}from"../../shaders/raster/processor/ReprojectShader.js";class r extends e{constructor(){super(...arguments),this.name="RasterReprojectProcessor",this.type=18,this.shaders={reproject:new t}}_process(e,t){const r=e.rasterFunction.parameters,o=this._getInterpolationDefines(t.interpolation,!!r.requireNNEdge),{config:i,projectionConfig:n,projectionDefines:s}=this._getReprojectConfig(t),a={shader:this.shaders.reproject,uniforms:{config:i,projectionConfig:n},defines:{...s,...o,applyPixelMask:!1,applyPixelHighlights:!1},optionalAttributes:null,useComputeBuffer:!1},{interpolation:c}=t;t.interpolation="nearest";const{painter:p,context:u}=e;p.submitDrawMesh(u,a,p.quadMesh),t.interpolation=c,t.projected=!0}_getReprojectConfig(e){const{source:t}=e,{names:r,textures:o}=e.getTextures({forProcessing:!0}),i={texture:{texture:o[r.indexOf("u_image")],unit:0},dvsMat3:new Float32Array([2,0,0,0,2,0,-1,-1,0]),coordScale:[1,1],srcImageSize:[t.width,t.height],opacity:1},n=o[r.indexOf("u_transformGrid")],{transformGrid:s}=e,a=!(!n||!s);return{config:i,projectionConfig:a?{transformTexture:{texture:n,unit:1},targetImageSize:[e.width,e.height],transformSpacing:s.spacing,transformGridSize:s.size}:void 0,projectionDefines:{applyProjection:a,lookupProjection:a&&1===s.spacing[0]}}}_getInterpolationDefines(e,t){const r="bilinear"===e&&t;return{bilinear:r,bicubic:"cubic"===e,nearestOnEdge:r}}}export{r as ReprojectTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{computeZFactor as s}from"../../shaders/raster/surface.js";import{ShadedReliefShader as r}from"../../shaders/raster/processor/ShadedReliefShader.js";class t extends e{constructor(){super(...arguments),this.name="RasterShadedReliefProcessor",this.type=18,this.shaders={shadedRelief:new r}}_process(e,r,t){const o=e.rasterFunction.parameters,a={isMultidirectional:o.hillshadeType>0},i=r.getRasterCellSize(),n=s(o,i),d={...o,factor:n},h={colormapTexture:{texture:t,unit:1},colormapOffset:o.offset,colormapMaxIndex:o.indexedColormap.length/4-1},l=this._getCommonConfig(e,r),f={shader:this.shaders.shadedRelief,uniforms:{config:l,hillshadeConfig:d,colormapConfig:h},defines:a,optionalAttributes:null,useComputeBuffer:!1},{painter:c,context:m}=e;c.submitDrawMesh(m,f,c.quadMesh)}}export{t as ShadedReliefTechnique};
5
+ import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{computeZFactor as s}from"../../shaders/raster/surface.js";import{ShadedReliefShader as r}from"../../shaders/raster/processor/ShadedReliefShader.js";class t extends e{constructor(){super(...arguments),this.name="RasterShadedReliefProcessor",this.type=19,this.shaders={shadedRelief:new r}}_process(e,r,t){const o=e.rasterFunction.parameters,a={isMultidirectional:o.hillshadeType>0},i=r.getRasterCellSize(),n=s(o,i),d={...o,factor:n},h={colormapTexture:{texture:t,unit:1},colormapOffset:o.offset,colormapMaxIndex:o.indexedColormap.length/4-1},l=this._getCommonConfig(e,r),f={shader:this.shaders.shadedRelief,uniforms:{config:l,hillshadeConfig:d,colormapConfig:h},defines:a,optionalAttributes:null,useComputeBuffer:!1},{painter:c,context:m}=e;c.submitDrawMesh(m,f,c.quadMesh)}}export{t as ShadedReliefTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{SlopeShader as s}from"../../shaders/raster/processor/SlopeShader.js";class r extends e{constructor(){super(...arguments),this.name="RasterSlopeProcessor",this.type=19,this.shaders={slope:new s}}_process(e,s){const r=e.rasterFunction.parameters,t={isOutputRounded:r.isOutputRounded,percentRise:"percent-rise"===r.slopeType},o={cellSize:s.getRasterCellSize(),pixelSizePower:"adjusted"===r.slopeType?r.pixelSizePower:0,pixelSizeFactor:"adjusted"===r.slopeType?r.pixelSizeFactor:0,zFactor:r.zFactor},i=this._getCommonConfig(e,s),p={shader:this.shaders.slope,uniforms:{config:i,slopeConfig:o},defines:t,optionalAttributes:null,useComputeBuffer:!1},{painter:a,context:n}=e;a.submitDrawMesh(n,p,a.quadMesh)}}export{r as SlopeTechnique};
5
+ import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{SlopeShader as s}from"../../shaders/raster/processor/SlopeShader.js";class r extends e{constructor(){super(...arguments),this.name="RasterSlopeProcessor",this.type=20,this.shaders={slope:new s}}_process(e,s){const r=e.rasterFunction.parameters,t={isOutputRounded:r.isOutputRounded,percentRise:"percent-rise"===r.slopeType},o={cellSize:s.getRasterCellSize(),pixelSizePower:"adjusted"===r.slopeType?r.pixelSizePower:0,pixelSizeFactor:"adjusted"===r.slopeType?r.pixelSizeFactor:0,zFactor:r.zFactor},i=this._getCommonConfig(e,s),p={shader:this.shaders.slope,uniforms:{config:i,slopeConfig:o},defines:t,optionalAttributes:null,useComputeBuffer:!1},{painter:a,context:n}=e;a.submitDrawMesh(n,p,a.quadMesh)}}export{r as SlopeTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{BaseRasterProcessorTechnique as s}from"./BaseRasterProcessorTechnique.js";import{StretchShader as e}from"../../shaders/raster/processor/StretchShader.js";class t extends s{constructor(){super(...arguments),this.name="RasterStretchProcessor",this.type=21,this.shaders={stretch:new e}}_process(s,e){const t=s.rasterFunction.parameters,r={isMultiband:t.bandCount>1,isOutputRounded:t.isOutputRounded,useGamma:t.useGamma},o=this._getCommonConfig(s,e),a={shader:this.shaders.stretch,uniforms:{config:o,stretchConfig:t},defines:r,optionalAttributes:null,useComputeBuffer:!1},{painter:n,context:i}=s;n.submitDrawMesh(i,a,n.quadMesh)}}export{t as StretchTechnique};
5
+ import{BaseRasterProcessorTechnique as s}from"./BaseRasterProcessorTechnique.js";import{StretchShader as e}from"../../shaders/raster/processor/StretchShader.js";class t extends s{constructor(){super(...arguments),this.name="RasterStretchProcessor",this.type=22,this.shaders={stretch:new e}}_process(s,e){const t=s.rasterFunction.parameters,r={isMultiband:t.bandCount>1,isOutputRounded:t.isOutputRounded,useGamma:t.useGamma},o=this._getCommonConfig(s,e),a={shader:this.shaders.stretch,uniforms:{config:o,stretchConfig:t},defines:r,optionalAttributes:null,useComputeBuffer:!1},{painter:n,context:i}=s;n.submitDrawMesh(i,a,n.quadMesh)}}export{t as StretchTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{SizedPixelFormat as e,PixelType as r}from"../../../../../../../webgl/enums.js";import{FramebufferObject as t}from"../../../../../../../webgl/FramebufferObject.js";import{Texture as n}from"../../../../../../../webgl/Texture.js";import{TextureDescriptor as o}from"../../../../../../../webgl/TextureDescriptor.js";function m(t,n){const m=new o(t,n);return m.internalFormat=e.RGBA32F,m.samplingMode=9728,m.dataType=r.FLOAT,m.isImmutable=!0,m.wrapMode=33071,m}function s(e,r,t){const o=m(r,t);return new n(e,o)}function u(e,r,n){const o=m(r,n);return new t(e,o)}export{u as createNewFBO,s as createProcessedTexture};
5
+ import{SizedPixelFormat as e,PixelType as t}from"../../../../../../../webgl/enums.js";import{FramebufferObject as r}from"../../../../../../../webgl/FramebufferObject.js";import{Texture as n}from"../../../../../../../webgl/Texture.js";import{TextureDescriptor as o}from"../../../../../../../webgl/TextureDescriptor.js";function i(r,n){const i=new o(r,n);return i.internalFormat=e.RGBA32F,i.samplingMode=9728,i.dataType=t.FLOAT,i.isImmutable=!0,i.wrapMode=33071,i}function u(e,t,r){const o=i(t,r);return new n(e,o)}function s(e,t,n){const o=i(t,n);return new r(e,o)}function a(e){const{symbolizerParameters:t}=e,{type:r}=t,n="lut"===r?"nearest":e.interpolation,o="bilinear"===n&&("lut"!==r&&("stretch"!==r||1===t.bandCount));return{bilinear:o,bicubic:"cubic"===n,nearestOnEdge:o}}export{s as createNewFBO,u as createProcessedTexture,a as getInterpolationDefines};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o,__param as t}from"tslib";import{maxMapSizeGpu as i}from"../../../../../../../../layers/support/rasterFunctions/pixelUtils.js";import{GraphShaderModule as e,FragmentOutput as p,location as r,uniform as s,define as l,option as n,input as a,VertexInput as c,UniformGroup as g,FragmentInput as h}from"../../../GraphShaderModule.js";import{Vec3 as y,Vec4 as d,ifElse as u,texture2D as v,sign as x,mix as m,Vec2 as f,Sampler2D as P,Mat3 as b,Float as j,FixedArray as k}from"../../../graph/glsl.js";import{getPixelLocation as M,isOutside as w,getPixel as C,ProjectionConfig as _}from"./projection.js";import{computeSingleBandRangeFactor as S}from"./processor/math.js";class E extends c{}o([r(0,f)],E.prototype,"position",void 0);class O extends h{}class H extends g{}o([s(P)],H.prototype,"texture",void 0),o([s(b)],H.prototype,"dvsMat3",void 0),o([s(f)],H.prototype,"coordScale",void 0),o([s(f)],H.prototype,"srcImageSize",void 0),o([s(j)],H.prototype,"opacity",void 0);class T extends g{}o([s(P)],T.prototype,"maskTexture",void 0);class z extends g{}o([s(k.ofType(j,2*i))],z.prototype,"ranges",void 0),o([s(b)],z.prototype,"bandSwap",void 0),o([s(d)],z.prototype,"color",void 0);class F extends e{constructor(){super(...arguments),this.applyProjection=!0,this.lookupProjection=!1,this.bilinear=!1,this.bicubic=!1,this.nearestOnEdge=!1,this.applyPixelMask=!1,this.applyPixelHighlights=!1}vertex(o){const t=o.position,{dvsMat3:i,coordScale:e}=this.config,p=i.multiply(new y(t.multiply(e),1));return{uv:t,glPosition:new d(p,1)}}fragment(o){const t=new p,i=M(o.uv,this.applyProjection?this.projectionConfig:void 0,this.lookupProjection);let e=this._colorize(i);this.applyPixelHighlights&&(e=this._highlightPixels(i,e));const r=u(w(i),new d(0),e);let s=r.a.multiply(this.config.opacity);if(this.applyPixelMask){const t=this._getPixelMask(o.uv);s=s.multiply(t)}return t.fragColor=new d(r.rgb,1).multiply(s),t}_getPixel(o){const{config:t,bicubic:i,bilinear:e,nearestOnEdge:p}=this;return C(o,t,{bicubic:i,bilinear:e,nearestOnEdge:p})}_getPixelMask(o){const{maskTexture:t}=this.pixelMaskConfig,i=v(t,o);return x(i.a)}_highlightPixels(o,t){const i=this._getPixel(o),{ranges:e,color:p,bandSwap:r}=this.highlightConfig,s=r.multiply(i.rgb).x,l=S(s,e).multiply(i.a);return m(t,p,l)}}o([l],F.prototype,"applyProjection",void 0),o([l],F.prototype,"lookupProjection",void 0),o([l],F.prototype,"bilinear",void 0),o([l],F.prototype,"bicubic",void 0),o([l],F.prototype,"nearestOnEdge",void 0),o([l],F.prototype,"applyPixelMask",void 0),o([l],F.prototype,"applyPixelHighlights",void 0),o([s(H)],F.prototype,"config",void 0),o([n(_)],F.prototype,"projectionConfig",void 0),o([n(T)],F.prototype,"pixelMaskConfig",void 0),o([n(z)],F.prototype,"highlightConfig",void 0),o([t(0,a(E))],F.prototype,"vertex",null),o([t(0,a(O))],F.prototype,"fragment",null);export{F as BaseRasterColorizerShader,z as HighlightConfig,T as PixelMaskConfig,O as RasterColorizerFragmentInput,H as RasterConfig};
5
+ import{__decorate as t,__param as o}from"tslib";import{GraphShaderModule as i,FragmentOutput as e,location as p,uniform as r,define as s,option as l,input as n,VertexInput as a,UniformGroup as h,FragmentInput as c}from"../../../GraphShaderModule.js";import{Vec3 as g,Vec4 as y,ifElse as d,texture2D as u,sign as v,mix as x,Vec2 as f,Sampler2D as m,Mat3 as P,Float as b}from"../../../graph/glsl.js";import{getPixelLocation as j,isOutside as k,getPixel as M,ProjectionConfig as C}from"./projection.js";class _ extends a{}t([p(0,f)],_.prototype,"position",void 0);class w extends c{}class E extends h{}t([r(m)],E.prototype,"texture",void 0),t([r(P)],E.prototype,"dvsMat3",void 0),t([r(f)],E.prototype,"coordScale",void 0),t([r(f)],E.prototype,"srcImageSize",void 0),t([r(b)],E.prototype,"opacity",void 0);class O extends h{}t([r(m)],O.prototype,"maskTexture",void 0);class S extends h{}t([r(m)],S.prototype,"highlightTexture",void 0);class T extends i{constructor(){super(...arguments),this.applyProjection=!0,this.lookupProjection=!1,this.bilinear=!1,this.bicubic=!1,this.nearestOnEdge=!1,this.applyPixelMask=!1,this.applyPixelHighlights=!1}vertex(t){const o=t.position,{dvsMat3:i,coordScale:e}=this.config,p=i.multiply(new g(o.multiply(e),1));return{uv:o,glPosition:new y(p,1)}}fragment(t){const o=new e,i=j(t.uv,this.applyProjection?this.projectionConfig:void 0,this.lookupProjection);let p=this._colorize(i,t.uv);this.applyPixelHighlights&&(p=this._highlightPixels(t.uv,p));const r=d(k(i),new y(0),p);let s=r.a.multiply(this.config.opacity);if(this.applyPixelMask){const o=this._getPixelMask(t.uv);s=s.multiply(o)}return o.fragColor=new y(r.rgb,1).multiply(s),o}_getPixel(t){const{config:o,bicubic:i,bilinear:e,nearestOnEdge:p}=this;return M(t,o,{bicubic:i,bilinear:e,nearestOnEdge:p})}_getPixelMask(t){const{maskTexture:o}=this.pixelMaskConfig,i=u(o,t);return v(i.a)}_highlightPixels(t,o){const{highlightTexture:i}=this.highlightConfig,e=u(i,t),p=v(e.a);return x(o,e,p)}}t([s],T.prototype,"applyProjection",void 0),t([s],T.prototype,"lookupProjection",void 0),t([s],T.prototype,"bilinear",void 0),t([s],T.prototype,"bicubic",void 0),t([s],T.prototype,"nearestOnEdge",void 0),t([s],T.prototype,"applyPixelMask",void 0),t([s],T.prototype,"applyPixelHighlights",void 0),t([r(E)],T.prototype,"config",void 0),t([l(C)],T.prototype,"projectionConfig",void 0),t([l(O)],T.prototype,"pixelMaskConfig",void 0),t([l(S)],T.prototype,"highlightConfig",void 0),t([o(0,n(_))],T.prototype,"vertex",null),t([o(0,n(w))],T.prototype,"fragment",null);export{T as BaseRasterColorizerShader,S as HighlightConfig,O as PixelMaskConfig,w as RasterColorizerFragmentInput,E as RasterConfig};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t}from"tslib";import{maxMapSizeGpu as i}from"../../../../../../../../layers/support/rasterFunctions/pixelUtils.js";import{uniform as o,define as r,UniformGroup as s}from"../../../GraphShaderModule.js";import{sign as e,mix as h,Vec4 as g,texture2D as p,FixedArray as a,Float as l,Mat3 as n}from"../../../graph/glsl.js";import{BaseRasterColorizerShader as m}from"./BaseRasterColorizerShader.js";import{computeSingleBandRangeFactor as d}from"./processor/math.js";class c extends s{}t([o(a.ofType(l,2*i))],c.prototype,"ranges",void 0),t([o(n)],c.prototype,"bandSwap",void 0),t([o(g)],c.prototype,"color",void 0);class f extends m{constructor(){super(...arguments),this.type="RasterRangeHighlightShader",this.hasExistingHighlights=!1}_colorize(t,i){const o=this._getPixel(t),{ranges:r,color:s,bandSwap:a}=this.rangeHighlightConfig,l=a.multiply(o.rgb).x,n=d(l,r).multiply(e(o.a)),m=h(new g(0),s,n);if(this.hasExistingHighlights){const{highlightTexture:t}=this.highlightConfig,o=p(t,i);return h(o,m,n)}return m}}t([r],f.prototype,"hasExistingHighlights",void 0),t([o(c)],f.prototype,"rangeHighlightConfig",void 0);export{c as RangeHighlightConfig,f as RasterRangeHighlightShader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as i}from"tslib";import t from"../../../Graphic.js";import{isSome as e}from"../../../core/arrayUtils.js";import s from"../../../core/Collection.js";import{makeHandle as r}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import{watch as h,sync as a}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import{ensureClass as l}from"../../../core/accessorSupport/ensureType.js";import{subclass as g}from"../../../core/accessorSupport/decorators/subclass.js";import{GraphicsCollection as n}from"../../../support/GraphicsCollection.js";import p from"../engine/flow/FlowView2D.js";import{LayerView2DMixin as c}from"./LayerView2D.js";import d from"./graphics/GraphicsView2D.js";import w from"./graphics/HighlightGraphicContainer.js";import u from"./imagery/ImageryView2D.js";import m from"./imagery/VectorFieldView2D.js";import y from"../../layers/ImageryLayerView.js";import v from"../../layers/LayerView.js";import{RefreshableLayerView as f}from"../../layers/RefreshableLayerView.js";import{getHighlightName as b}from"../../support/highlightOptionsUtils.js";import _ from"../../support/PixelHighlightOptions.js";let x=class extends(y(f(c(v)))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new n,this._highlightView=void 0,this._pixelHighlightId=0,this.layer=null,this.subview=null}get pixelData(){const{subview:i}=this;return this.updating||!i?null:"getPixelData"in i?i.getPixelData():null}update(i){this.subview?.update(i)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new d({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new w(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([h(()=>this.layer.exportImageServiceParameters.version,i=>{i&&this._exportImageVersion!==i&&(this._exportImageVersion=i,this.requestUpdate())},a),h(()=>this.timeExtent,i=>{const{subview:t}=this;t&&(t.timeExtent=i,"redraw"in t?this.requestUpdate():t.redrawOrRefetch())},a),this.layer.on("redraw",()=>{const{subview:i}=this;i&&("redraw"in i?i.redraw():i.redrawOrRefetch())}),h(()=>this.layer.renderer,()=>this._setSubView())])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}highlight(i,h){if(!((Array.isArray(i)?i[0]:s.isCollection(i)?i.at(0):i)instanceof t))return r();let a=[];Array.isArray(i)||s.isCollection(i)?a=i.map(i=>i.clone()):i instanceof t&&(a=[i.clone()]);const o=a?.filter(e);if(!o?.length)return r();const l=b(h);return this._addHighlightGraphics(a,l),r(()=>!this.destroyed&&this._removeHighlightGraphics(a,l))}highlightPixels(i){this._pixelHighlightOptions=l(_,i);const{subview:t}=this;"imagery"===t?.type&&this._updateHighlightOptions(t),this._pixelHighlightId++;const e=this._pixelHighlightId;return r(()=>{e===this._pixelHighlightId&&(this._pixelHighlightOptions=void 0,"imagery"===this.subview?.type&&this._updateHighlightOptions(this.subview))})}_addHighlightGraphics(i,t){this._highlightGraphics.addMany(i),this._addHighlights(i.map(i=>i.uid),t)}_removeHighlightGraphics(i,t){this._highlightGraphics.removeMany(i),this._removeHighlights(i.map(i=>i.uid),t)}async doRefresh(){this.requestUpdate()}isUpdating(){const i=!this.subview||this.subview.updating||!!this._highlightView?.updating;return has("esri-2d-log-updating")&&console.log(`Updating ImageryLayerView2D (${this.layer.id}): ${i}\n-> subview ${!this.subview||this.subview.updating}\n-> higlightView ${this._highlightView?.updating}\n`),i}_processHighlight(){const i=this._getHighlights();this._highlightView?.setHighlight(i)}_setSubView(){if(!this.view)return;const i=this.layer.renderer?.type;let t="imagery";if("vector-field"===i?t="imageryVF":"flow"===i&&(t="flow"),this.subview){const{type:i}=this.subview;if(i===t)return this._attachSubview(this.subview),void("flow"===i?this.subview.redrawOrRefetch():"imagery"===i&&"lerc"===this.layer.format?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),this.subview?.destroy()}"imagery"===t?(this.subview=new u({layer:this.layer,view:this.view,timeExtent:this.timeExtent}),this.subview.pixelHighlightOptions=this._pixelHighlightOptions):this.subview="imageryVF"===t?new m({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new p({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(i){i&&!i.attached&&(i.attach(),i.attached=!0,this.container.addChildAt(i.container,0))}_detachSubview(i){i?.attached&&(this.container.removeChild(i.container),i.detach(),i.attached=!1)}_updateHighlightOptions(i){"imagery"===i?.type&&(i.pixelHighlightOptions=this._pixelHighlightOptions,i.attached&&("lerc"===this.layer.format?i.redraw():this.requestUpdate()))}};i([o()],x.prototype,"pixelData",null),i([o()],x.prototype,"subview",void 0),x=i([g("esri.views.2d.layers.ImageryLayerView2D")],x);const V=x;export{V as default};
5
+ import{__decorate as i}from"tslib";import t from"../../../Graphic.js";import{isSome as e}from"../../../core/arrayUtils.js";import s from"../../../core/Collection.js";import{makeHandle as r}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import{watch as h,sync as a}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{GraphicsCollection as n}from"../../../support/GraphicsCollection.js";import g from"../engine/flow/FlowView2D.js";import{LayerView2DMixin as p}from"./LayerView2D.js";import c from"./graphics/GraphicsView2D.js";import d from"./graphics/HighlightGraphicContainer.js";import u from"./imagery/ImageryView2D.js";import w from"./imagery/VectorFieldView2D.js";import m from"../../layers/ImageryLayerView.js";import v from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";import{defaultColor as f}from"../../support/HighlightDefaults.js";import{getHighlightName as b}from"../../support/highlightOptionsUtils.js";let _=class extends(m(y(p(v)))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new n,this._highlightView=void 0,this._pixelHighlights=[],this.layer=null,this.subview=null}get pixelData(){const{subview:i}=this;return this.updating||!i?null:"getPixelData"in i?i.getPixelData():null}update(i){this.subview?.update(i)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new c({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new d(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([h(()=>this.layer.exportImageServiceParameters.version,i=>{i&&this._exportImageVersion!==i&&(this._exportImageVersion=i,this.requestUpdate())},a),h(()=>this.timeExtent,i=>{const{subview:t}=this;t&&(t.timeExtent=i,"redraw"in t?this.requestUpdate():t.redrawOrRefetch())},a),this.layer.on("redraw",()=>{const{subview:i}=this;i&&("redraw"in i?i.redraw():i.redrawOrRefetch())}),h(()=>this.layer.renderer,()=>this._setSubView()),h(()=>this.view.highlights.items.map(({name:i,color:t})=>({name:i,color:t})),()=>this._updateHighlightOptions(this.subview))])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}highlight(i,h){if(i&&"ranges"in i&&i.ranges.length)return this._highlightPixels(i,h);if(!((Array.isArray(i)?i[0]:s.isCollection(i)?i.at(0):i)instanceof t))return r();let a=[];Array.isArray(i)||s.isCollection(i)?a=i.map(i=>i.clone()):i instanceof t&&(a=[i.clone()]);const o=a?.filter(e);if(!o?.length)return r();const l=b(h);return this._addHighlightGraphics(a,l),r(()=>!this.destroyed&&this._removeHighlightGraphics(a,l))}_highlightPixels(i,t){const e={target:i,options:t};return this._pixelHighlights.push(e),this._updateHighlightOptions(this.subview),r(()=>{const i=this._pixelHighlights.indexOf(e);i>-1&&(this._pixelHighlights.splice(i,1),this._updateHighlightOptions(this.subview))})}_addHighlightGraphics(i,t){this._highlightGraphics.addMany(i),this._addHighlights(i.map(i=>i.uid),t)}_removeHighlightGraphics(i,t){this._highlightGraphics.removeMany(i),this._removeHighlights(i.map(i=>i.uid),t)}async doRefresh(){this.requestUpdate()}isUpdating(){const i=!this.subview||this.subview.updating||!!this._highlightView?.updating;return has("esri-2d-log-updating")&&console.log(`Updating ImageryLayerView2D (${this.layer.id}): ${i}\n-> subview ${!this.subview||this.subview.updating}\n-> higlightView ${this._highlightView?.updating}\n`),i}_processHighlight(){const i=this._getHighlights();this._highlightView?.setHighlight(i)}_setSubView(){if(!this.view)return;const i=this.layer.renderer?.type;let t="imagery";if("vector-field"===i?t="imageryVF":"flow"===i&&(t="flow"),this.subview){const{type:i}=this.subview;if(i===t)return this._attachSubview(this.subview),void("flow"===i?this.subview.redrawOrRefetch():"imagery"===i&&"lerc"===this.layer.format?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),this.subview?.destroy()}"imagery"===t?(this.subview=new u({layer:this.layer,view:this.view,timeExtent:this.timeExtent}),this._updateHighlightOptions(this.subview)):this.subview="imageryVF"===t?new w({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new g({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(i){i&&!i.attached&&(i.attach(),i.attached=!0,this.container.addChildAt(i.container,0))}_detachSubview(i){i?.attached&&(this.container.removeChild(i.container),i.detach(),i.attached=!1)}_updateHighlightOptions(i){const t=this.view.highlights;this._pixelHighlights.sort((i,e)=>t.findIndex(({name:i})=>i===b(e.options))-t.findIndex(({name:t})=>t===b(i.options)));const e=this._pixelHighlights.map(({target:i,options:e})=>{const s=b(e),r=t.find(i=>i.name===s)?.color??f,{ranges:h,bandId:a}=i;return{ranges:h,bandId:a??0,color:r.toArray()}});"imagery"===i?.type&&(i.pixelHighlights=e,i.attached&&("lerc"===this.layer.format?i.redraw():this.requestUpdate()))}};i([o()],_.prototype,"pixelData",null),i([o()],_.prototype,"subview",void 0),_=i([l("esri.views.2d.layers.ImageryLayerView2D")],_);const x=_;export{x as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s}from"../../../core/promiseUtils.js";import{watch as r,sync as o,initial as h}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{hasExcludedVariableOrDimension as l}from"../../../layers/support/rasterDatasets/multidimensionalUtils.js";import u from"../engine/flow/FlowView2D.js";import{LayerView2DMixin as g}from"./LayerView2D.js";import p from"./imagery/ImageryTileView2D.js";import d from"./imagery/VectorFieldTileView2D.js";import{canUseMajorityInterpolationOnDataSource as c}from"./support/util.js";import m from"../../layers/ImageryTileLayerView.js";import v from"../../layers/LayerView.js";import{RefreshableLayerView as w}from"../../layers/RefreshableLayerView.js";import{defaultHighlightName as b}from"../../support/HighlightDefaults.js";let y=class extends(m(w(g(v)))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this._pixelHighlightId=-1,this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(e){this._useWebGLForProcessing=e,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=e)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(e){this._useProgressiveUpdate=e,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=e)}get displayParameters(){const{layer:e}=this,i=this._get("displayParameters");return e.renderer&&e.visible?{bandIds:e.bandIds,renderer:e.renderer,interpolation:e.interpolation,multidimensionalDefinition:e.multidimensionalDefinition,rasterFunction:"imagery-tile"===e.type?e.rasterFunction:null}:i}update(e){this.subview?.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([r(()=>this.displayParameters,(e,i)=>{const r=e.interpolation!==i?.interpolation&&("majority"===e.interpolation||"majority"===i?.interpolation)&&c(this.layer),o=!!this.layer.serviceRasterInfo?.storageInfo?.isBsqTile&&e.bandIds?.join()!==i?.bandIds?.join(),h=e.renderer!==i?.renderer&&this._getSubviewType(i?.renderer)!==this._getSubviewType(e.renderer);h&&this._updateSubview();const a=e.multidimensionalDefinition!==i?.multidimensionalDefinition,n=e.rasterFunction!==i?.rasterFunction,l=n&&!this._useWebGLForProcessing,u=a||r||h||l||o;this.subview.redrawOrRefetch({refetch:u,reprocess:n}).catch(e=>{s(e)||t.getLogger(this).error(e)}),this.notifyChange("updating")}),r(()=>this.layer.multidimensionalSubset??null,(e,i)=>{const{multidimensionalDefinition:r}=this.layer;null!=r&&l(r,e)!==l(r,i)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{s(e)||t.getLogger(this).error(e)}),this.notifyChange("updating"))},o),r(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{s(e)||t.getLogger(this).error(e)})},h),r(()=>this.view.highlights.items.map(({name:e,color:i})=>({name:e,color:i})),()=>{if("raster"===this.subview?.type&&this._pixelHighlightTarget){const e=this._getHighlightGroupColor();this.subview.updateHighlightOptions(this._pixelHighlightTarget,e)}},h)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}highlight(e,t){if(!e.ranges?.length)return i();this._pixelHighlightTarget=e,this._pixelHighlightOptions=t;const{subview:s}=this;if("raster"===s?.type){const i=this._getHighlightGroupColor();s.updateHighlightOptions(e,i)}this._pixelHighlightId++;const r=this._pixelHighlightId;return i(()=>{r===this._pixelHighlightId&&(this._pixelHighlightTarget=void 0,"raster"===this.subview?.type&&this.subview.updateHighlightOptions(null))})}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const{renderer:e}=this.layer;if(!e)return;const i=this._getSubviewType(e);if(this.subview){if(this.subview.type===i)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:t}=this;let s;if(s="rasterVF"===i?new d({layer:t,layerView:this,scheduler:this.scheduler}):"flow"===i?new u({layer:t,layerView:this,scheduler:this.scheduler}):new p({layer:t,layerView:this,scheduler:this.scheduler}),"useWebGLForProcessing"in s&&(s.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in s&&(s.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in s){const{subview:e}=this;s.previousLOD=e&&"previousLOD"in e?e.previousLOD:null}if(this._attachSubview(s),"raster"===s.type&&this._pixelHighlightTarget){const e=this._getHighlightGroupColor();s.updateHighlightOptions(this._pixelHighlightTarget,e)}this.subview=s,this.requestUpdate()}_getHighlightGroupColor(){const e=this._pixelHighlightOptions?.name??b;return this.view.highlights.find(i=>i.name===e)?.color}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}_getSubviewType(e){const i=e?.type;return"vector-field"===i?"rasterVF":"flow"===i?"flow":"raster"}};e([a()],y.prototype,"subview",void 0),e([a()],y.prototype,"useWebGLForProcessing",null),e([a()],y.prototype,"useProgressiveUpdate",null),e([a({readOnly:!0})],y.prototype,"displayParameters",null),y=e([n("esri.views.2d.layers.ImageryTileLayerView2D")],y);const f=y;export{f as default};
5
+ import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import s from"../../../core/Logger.js";import{isAbortError as t}from"../../../core/promiseUtils.js";import{watch as r,sync as o,initial as a}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{hasExcludedVariableOrDimension as u}from"../../../layers/support/rasterDatasets/multidimensionalUtils.js";import l from"../engine/flow/FlowView2D.js";import{LayerView2DMixin as p}from"./LayerView2D.js";import d from"./imagery/ImageryTileView2D.js";import c from"./imagery/VectorFieldTileView2D.js";import{canUseMajorityInterpolationOnDataSource as g}from"./support/util.js";import m from"../../layers/ImageryTileLayerView.js";import v from"../../layers/LayerView.js";import{RefreshableLayerView as w}from"../../layers/RefreshableLayerView.js";let b=class extends(m(w(p(v)))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this._pixelHighlights=[],this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(e){this._useWebGLForProcessing=e,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=e)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(e){this._useProgressiveUpdate=e,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=e)}get displayParameters(){const{layer:e}=this,i=this._get("displayParameters");return e.renderer&&e.visible?{bandIds:e.bandIds,renderer:e.renderer,interpolation:e.interpolation,multidimensionalDefinition:e.multidimensionalDefinition,rasterFunction:"imagery-tile"===e.type?e.rasterFunction:null}:i}update(e){this.subview?.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([r(()=>this.displayParameters,(e,i)=>{const r=e.interpolation!==i?.interpolation&&("majority"===e.interpolation||"majority"===i?.interpolation)&&g(this.layer),o=!!this.layer.serviceRasterInfo?.storageInfo?.isBsqTile&&e.bandIds?.join()!==i?.bandIds?.join(),a=e.renderer!==i?.renderer&&this._getSubviewType(i?.renderer)!==this._getSubviewType(e.renderer);a&&this._updateSubview();const n=e.multidimensionalDefinition!==i?.multidimensionalDefinition,h=e.rasterFunction!==i?.rasterFunction,u=h&&!this._useWebGLForProcessing,l=n||r||a||u||o;this.subview.redrawOrRefetch({refetch:l,reprocess:h}).catch(e=>{t(e)||s.getLogger(this).error(e)}),this.notifyChange("updating")}),r(()=>this.layer.multidimensionalSubset??null,(e,i)=>{const{multidimensionalDefinition:r}=this.layer;null!=r&&u(r,e)!==u(r,i)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{t(e)||s.getLogger(this).error(e)}),this.notifyChange("updating"))},o),r(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{t(e)||s.getLogger(this).error(e)})},a),r(()=>this.view.highlights.items.map(({name:e,color:i})=>({name:e,color:i})),()=>this._updateHighlightOptions(this.subview),a)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}highlight(e,s){if(!e.ranges?.length)return i();const t={target:{...e},options:{...s}};return this._pixelHighlights.push(t),this._updateHighlightOptions(this.subview),i(()=>{const e=this._pixelHighlights.indexOf(t);-1!==e&&(this._pixelHighlights.splice(e,1),this._updateHighlightOptions(this.subview))})}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const{renderer:e}=this.layer;if(!e)return;const i=this._getSubviewType(e);if(this.subview){if(this.subview.type===i)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:s}=this;let t;if(t="rasterVF"===i?new c({layer:s,layerView:this,scheduler:this.scheduler}):"flow"===i?new l({layer:s,layerView:this,scheduler:this.scheduler}):new d({layer:s,layerView:this,scheduler:this.scheduler}),"useWebGLForProcessing"in t&&(t.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in t&&(t.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in t){const{subview:e}=this;t.previousLOD=e&&"previousLOD"in e?e.previousLOD:null}this._attachSubview(t),this._updateHighlightOptions(t),this.subview=t,this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}_getSubviewType(e){const i=e?.type;return"vector-field"===i?"rasterVF":"flow"===i?"flow":"raster"}_updateHighlightOptions(e){"raster"===e?.type&&e.updateHighlightOptions(this._pixelHighlights)}};e([n()],b.prototype,"subview",void 0),e([n()],b.prototype,"useWebGLForProcessing",null),e([n()],b.prototype,"useProgressiveUpdate",null),e([n({readOnly:!0})],b.prototype,"displayParameters",null),b=e([h("esri.views.2d.layers.ImageryTileLayerView2D")],b);const y=b;export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../Color.js";import has from"../../../../core/has.js";import{numberMaxFloat32 as r}from"../../../../core/mathUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{isFunctionRaster as o}from"../../../../layers/support/rasterDatasets/datasetUtils.js";import{getBytesPerPixel as n}from"../../../../layers/support/rasterFormats/pixelRangeUtils.js";import{convertGeometryToMask as a}from"../../../../layers/support/rasterFunctions/clipUtils.js";import{maxMapSizeGpu as l}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{RasterTileContainer as c}from"../../engine/imagery/RasterTileContainer.js";import{BaseImageryTileSubView2D as p}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as u}from"../support/util.js";import{defaultColor as h}from"../../../support/HighlightDefaults.js";let d=class extends p{constructor(){super(...arguments),this.type="raster"}get canUseWebGLForProcessing(){const{loaded:e,symbolizer:t}=this.layer;if(!e||!t)return!1;const r=t.lookup.colormapLut?.indexedColormap,i=r&&r.length>this._maxIndexedColormapSize,s=n(this.layer.serviceRasterInfo);return!(has("ios")&&s>4)&&this.useWebGLForProcessing&&t.canRenderInWebGL&&!i&&!("majority"===this.layer.interpolation&&u(this.layer))}attach(){super.attach(),this.container=new c(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{raster:e,type:t}=this.layer,{container:r}=this;if("Function"!==e.datasetFormat||"wcs"===t)return r.rasterFunctionChain=null,r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!0,t.processed=!1,t.projected&&(t.invalidateTexture(),t.rasterTexture=null))}),void(this._rasterFunctionState="na");const i=this._rasterFunctionState,{rasterFunction:s,primaryRasters:o}=e,n=s.supportsGPU&&(!o||o.rasters.length<=1),a=n?s.flatWebGLFunctionChain:null,{renderer:l}=this.layer,c=!n||!a?.functions.length||"raster-stretch"===l?.type&&l.dynamicRangeAdjustment||!this.canUseWebGLForProcessing;r.rasterFunctionChain=c?null:this._addProjection(a);const p=null==s?"na":r.rasterFunctionChain?"gpu":"cpu",u=i===p||"na"===i&&"cpu"===p&&0===a?.functions?.length;r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!u,t.processed=!1,t.processedTexture=null)}),this._rasterFunctionState=p}async updateTileSource(e,t){const r=this._getBandIds(),i=this._getLayerInterpolation(),{canUseWebGLForProcessing:s}=this,{source:n,globalSymbolizerParams:l,suspended:c,coords:p,resolution:u}=t,h=this.layerView.hasTilingEffects?l:t.symbolizerParams,{bitmap:d}=e;if([d.x,d.y]=p,d.resolution=u,null!=n?.pixelBlock){const e={extent:n.extent,pixelBlock:n.pixelBlock,srcPixelSize:n.srcTilePixelSize};if(d.rawPixelData=e,s)d.source=n.pixelBlock,d.isRendereredSource=!1;else{const t=await this.layer.applyRenderer(e,"stretch"===l?.type?l:void 0);d.source=t,d.isRendereredSource=!0}d.symbolizerParameters=s?h:null,d.transformGrid=s?n.transformGrid:null}else{const e=this.createEmptyTilePixelBlock();d.source=e,d.symbolizerParameters=s?h:null,d.transformGrid=null}d.bandIds=s?r:null,d.width=this._tileInfoView.tileInfo.size[0],d.height=this._tileInfoView.tileInfo.size[1],d.interpolation=i,d.suspended=c;const{raster:m}=this.layer;if(o(m)){const t=m.getClippingGeometry(this.layerView.view.spatialReference);if(t){const r=m.getTileExtentFromTileInfo(e.key.level,e.key.row,e.key.col,this._tileInfoView.tileInfo);d.mask=a({srcExtent:r,geometry:t,size:[d.width,d.height]})}}d.invalidateTexture()}async updateTileSymbolizerParameters(e,t){const{local:r,global:i}=t,s=this._getBandIds(),o=this._getLayerInterpolation(),{canUseWebGLForProcessing:n}=this,{bitmap:a}=e,{rawPixelData:l}=a;n||null==l?(a.isRendereredSource&&null!=l&&(a.source=l.pixelBlock),a.isRendereredSource=!1):(a.source=await this.layer.applyRenderer(l,"stretch"===i?.type?i:void 0),a.isRendereredSource=!0),a.symbolizerParameters=n?this.layerView.hasTilingEffects?i:r:null,a.bandIds=n?s:null,a.interpolation=o,a.suspended=!1}updateHighlightOptions(e,i){if(e){const{ranges:s}=e,o=Array.from({length:2*l},()=>0);for(let e=0;e<s.length;e++)o[2*e]=s[e][0],o[2*e+1]=s[e][1];for(let e=s.length;e<l;e++)o[2*e]=r,o[2*e+1]=-r;const n=e.bandId??0,a=t.toUnitRGBA(i??h);this.container.pixelHighlightOptions={ranges:o,color:a,bandId:n}}else this.container.pixelHighlightOptions=void 0}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return"raster-colormap"===r||"unique-value"===r?"nearest":"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===e||"cubic"===e?"bilinear":"nearest":e}_addProjection(e){return e?.functions?.length&&!e.hasFocalFunction&&e.functions.unshift({name:"Reproject",parameters:{targetImageSize:this._tileInfoView.tileInfo.size,requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1}),e}};e([i()],d.prototype,"canUseWebGLForProcessing",null),e([i()],d.prototype,"container",void 0),e([i()],d.prototype,"layer",void 0),e([i()],d.prototype,"type",void 0),d=e([s("esri.views.2d.layers.imagery.ImageryTileView2D")],d);export{d as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../../Color.js";import has from"../../../../core/has.js";import{numberMaxFloat32 as r}from"../../../../core/mathUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{isFunctionRaster as o}from"../../../../layers/support/rasterDatasets/datasetUtils.js";import{getBytesPerPixel as n}from"../../../../layers/support/rasterFormats/pixelRangeUtils.js";import{convertGeometryToMask as a}from"../../../../layers/support/rasterFunctions/clipUtils.js";import{maxMapSizeGpu as l}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{RasterTileContainer as c}from"../../engine/imagery/RasterTileContainer.js";import{BaseImageryTileSubView2D as p}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as u}from"../support/util.js";import{defaultColor as h}from"../../../support/HighlightDefaults.js";import{getHighlightName as d}from"../../../support/highlightOptionsUtils.js";let m=class extends p{constructor(){super(...arguments),this.type="raster"}get canUseWebGLForProcessing(){const{loaded:e,symbolizer:t}=this.layer;if(!e||!t)return!1;const r=t.lookup.colormapLut?.indexedColormap,i=r&&r.length>this._maxIndexedColormapSize,s=n(this.layer.serviceRasterInfo);return!(has("ios")&&s>4)&&this.useWebGLForProcessing&&t.canRenderInWebGL&&!i&&!("majority"===this.layer.interpolation&&u(this.layer))}attach(){super.attach(),this.container=new c(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{raster:e,type:t}=this.layer,{container:r}=this;if("Function"!==e.datasetFormat||"wcs"===t)return r.rasterFunctionChain=null,r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!0,t.processed=!1,t.projected&&(t.invalidateTexture(),t.rasterTexture=null))}),void(this._rasterFunctionState="na");const i=this._rasterFunctionState,{rasterFunction:s,primaryRasters:o}=e,n=s.supportsGPU&&(!o||o.rasters.length<=1),a=n?s.flatWebGLFunctionChain:null,{renderer:l}=this.layer,c=!n||!a?.functions.length||"raster-stretch"===l?.type&&l.dynamicRangeAdjustment||!this.canUseWebGLForProcessing;r.rasterFunctionChain=c?null:this._addProjection(a);const p=null==s?"na":r.rasterFunctionChain?"gpu":"cpu",u=i===p||"na"===i&&"cpu"===p&&0===a?.functions?.length;r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!u,t.processed=!1,t.processedTexture=null)}),this._rasterFunctionState=p}async updateTileSource(e,t){const r=this._getBandIds(),i=this._getLayerInterpolation(),{canUseWebGLForProcessing:s}=this,{source:n,globalSymbolizerParams:l,suspended:c,coords:p,resolution:u}=t,h=this.layerView.hasTilingEffects?l:t.symbolizerParams,{bitmap:d}=e;if([d.x,d.y]=p,d.resolution=u,null!=n?.pixelBlock){const e={extent:n.extent,pixelBlock:n.pixelBlock,srcPixelSize:n.srcTilePixelSize};if(d.rawPixelData=e,s)d.source=n.pixelBlock,d.isRendereredSource=!1;else{const t=await this.layer.applyRenderer(e,"stretch"===l?.type?l:void 0);d.source=t,d.isRendereredSource=!0}d.symbolizerParameters=s?h:null,d.transformGrid=s?n.transformGrid:null}else{const e=this.createEmptyTilePixelBlock();d.source=e,d.symbolizerParameters=s?h:null,d.transformGrid=null}d.bandIds=s?r:null,d.width=this._tileInfoView.tileInfo.size[0],d.height=this._tileInfoView.tileInfo.size[1],d.interpolation=i,d.suspended=c;const{raster:m}=this.layer;if(o(m)){const t=m.getClippingGeometry(this.layerView.view.spatialReference);if(t){const r=m.getTileExtentFromTileInfo(e.key.level,e.key.row,e.key.col,this._tileInfoView.tileInfo);d.mask=a({srcExtent:r,geometry:t,size:[d.width,d.height]})}}d.invalidateTexture()}async updateTileSymbolizerParameters(e,t){const{local:r,global:i}=t,s=this._getBandIds(),o=this._getLayerInterpolation(),{canUseWebGLForProcessing:n}=this,{bitmap:a}=e,{rawPixelData:l}=a;n||null==l?(a.isRendereredSource&&null!=l&&(a.source=l.pixelBlock),a.isRendereredSource=!1):(a.source=await this.layer.applyRenderer(l,"stretch"===i?.type?i:void 0),a.isRendereredSource=!0),a.symbolizerParameters=n?this.layerView.hasTilingEffects?i:r:null,a.bandIds=n?s:null,a.interpolation=o,a.suspended=!1}updateHighlightOptions(e){if(!e.length)return void(this.container.pixelHighlights=void 0);const i=[],{highlights:s}=this.layerView.view;e.sort((e,t)=>s.findIndex(({name:e})=>e===d(t.options))-s.findIndex(({name:t})=>t===d(e.options)));for(const{target:o,options:n}of e){const{ranges:e}=o,a=Array.from({length:2*l},()=>0);for(let t=0;t<e.length;t++)a[2*t]=e[t][0],a[2*t+1]=e[t][1];for(let t=e.length;t<l;t++)a[2*t]=r,a[2*t+1]=-r;const c=o.bandId??0,p=d(n),u=s.find(e=>e.name===p)?.color??h,m=t.toUnitRGBA(u);i.push({ranges:a,bandId:c,color:m})}this.container.pixelHighlights=i}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return"raster-colormap"===r||"unique-value"===r?"nearest":"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===e||"cubic"===e?"bilinear":"nearest":e}_addProjection(e){return e?.functions?.length&&!e.hasFocalFunction&&e.functions.unshift({name:"Reproject",parameters:{targetImageSize:this._tileInfoView.tileInfo.size,requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1}),e}};e([i()],m.prototype,"canUseWebGLForProcessing",null),e([i()],m.prototype,"container",void 0),e([i()],m.prototype,"layer",void 0),e([i()],m.prototype,"type",void 0),m=e([s("esri.views.2d.layers.imagery.ImageryTileView2D")],m);export{m as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../../Graphic.js";import i from"../../../../core/Accessor.js";import r from"../../../../core/Logger.js";import{isAbortError as s}from"../../../../core/promiseUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{mosaicPixelData as p}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{BitmapContainer as l}from"../../engine/BitmapContainer.js";import{Container as n}from"../../engine/Container.js";import h from"../../engine/ImageryBitmapSource.js";import g from"../support/ExportStrategy.js";let c=class extends i{constructor(){super(...arguments),this.attached=!1,this.container=new n,this.updateRequested=!1,this.type="imagery",this._bitmapView=new l}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(t){this.strategy.update(t).catch(t=>{s(t)||r.getLogger(this).error(t)})}hitTest(t){return new e({attributes:{},geometry:t.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const t=this.layer.version>=10,e=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,i=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new g({container:this._bitmapView,imageNormalizationSupported:t,imageMaxHeight:e,imageMaxWidth:i,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports(async t=>{const{source:e}=t;if(!e||e instanceof ImageBitmap)return;const i=e.originalPixelBlock??e.pixelBlock,r=await this.layer.applyRenderer({extent:e.extent,pixelBlock:i,isRawData:!!this.pixelHighlightOptions}),s=r.pixelBlock;this.pixelHighlightOptions&&i&&s&&await this.layer.highlightPixels({pixelBlock:i,renderedPixelBlock:s,highlightOptions:this.pixelHighlightOptions}),e.filter=t=>this.layer.pixelFilter?this.layer.applyFilter(t):{...r,extent:e.extent}}).catch(t=>{s(t)||r.getLogger(this).error(t)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const t=this.strategy.bitmaps;if(1===t.length&&t[0].source)return{extent:t[0].source.extent,pixelBlock:t[0].source.originalPixelBlock};if(t.length>1){const e=this.view.extent,i=t.map(t=>t.source).filter(t=>t.extent&&t.extent.intersects(e)).map(t=>({extent:t.extent,pixelBlock:t.originalPixelBlock})),r=p(i,e);return null!=r?{extent:r.extent,pixelBlock:r.pixelBlock}:null}return null}async _fetchImage(t,e,i,r){(r=r||{}).timeExtent=this.timeExtent,r.requestAsImageElement=!this.pixelHighlightOptions,r.returnImageBitmap=!this.pixelHighlightOptions,r.requestRawData=!!this.pixelHighlightOptions;const s=await this.layer.internalFetchImage(t,e,i,r);if(s.imageBitmap)return s.imageBitmap;const a=await this.layer.applyRenderer({...s.pixelData,isRawData:!!this.pixelHighlightOptions},{signal:r.signal}),o=s.pixelData.pixelBlock,p=a.pixelBlock;this.pixelHighlightOptions&&o&&p&&await this.layer.highlightPixels({pixelBlock:o,renderedPixelBlock:p,highlightOptions:this.pixelHighlightOptions});const l=new h(p,a.extent?.clone(),o);return l.filter=t=>this.layer.applyFilter(t),l}};t([a()],c.prototype,"attached",void 0),t([a()],c.prototype,"container",void 0),t([a()],c.prototype,"layer",void 0),t([a()],c.prototype,"strategy",void 0),t([a()],c.prototype,"timeExtent",void 0),t([a()],c.prototype,"view",void 0),t([a()],c.prototype,"updateRequested",void 0),t([a()],c.prototype,"updating",null),t([a()],c.prototype,"pixelHighlightOptions",void 0),t([a()],c.prototype,"type",void 0),c=t([o("esri.views.2d.layers.imagery.ImageryView2D")],c);export{c as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../../Graphic.js";import i from"../../../../core/Accessor.js";import r from"../../../../core/Logger.js";import{isAbortError as s}from"../../../../core/promiseUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{mosaicPixelData as l}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{BitmapContainer as p}from"../../engine/BitmapContainer.js";import{Container as n}from"../../engine/Container.js";import h from"../../engine/ImageryBitmapSource.js";import c from"../support/ExportStrategy.js";let g=class extends i{constructor(){super(...arguments),this.attached=!1,this.container=new n,this.updateRequested=!1,this.pixelHighlights=[],this.type="imagery",this._bitmapView=new p}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(t){this.strategy.update(t).catch(t=>{s(t)||r.getLogger(this).error(t)})}hitTest(t){return new e({attributes:{},geometry:t.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const t=this.layer.version>=10,e=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,i=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new c({container:this._bitmapView,imageNormalizationSupported:t,imageMaxHeight:e,imageMaxWidth:i,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports(async t=>{const{source:e}=t;if(!e||e instanceof ImageBitmap)return;const i=e.originalPixelBlock??e.pixelBlock,{pixelHighlights:r}=this,s=r.length>0,a=await this.layer.applyRenderer({extent:e.extent,pixelBlock:i,isRawData:s}),o=a.pixelBlock;s&&i&&o&&await this.layer.highlightPixels({pixelBlock:i,renderedPixelBlock:o,highlightOptions:r}),e.filter=t=>this.layer.pixelFilter?this.layer.applyFilter(t):{...a,extent:e.extent}}).catch(t=>{s(t)||r.getLogger(this).error(t)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const t=this.strategy.bitmaps;if(1===t.length&&t[0].source)return{extent:t[0].source.extent,pixelBlock:t[0].source.originalPixelBlock};if(t.length>1){const e=this.view.extent,i=t.map(t=>t.source).filter(t=>t.extent&&t.extent.intersects(e)).map(t=>({extent:t.extent,pixelBlock:t.originalPixelBlock})),r=l(i,e);return null!=r?{extent:r.extent,pixelBlock:r.pixelBlock}:null}return null}async _fetchImage(t,e,i,r){(r=r||{}).timeExtent=this.timeExtent;const s=this.pixelHighlights.length>0;r.requestAsImageElement=!s,r.returnImageBitmap=!s,r.requestRawData=s;const a=await this.layer.internalFetchImage(t,e,i,r);if(a.imageBitmap)return a.imageBitmap;const o=await this.layer.applyRenderer({...a.pixelData,isRawData:s},{signal:r.signal}),l=a.pixelData.pixelBlock,p=o.pixelBlock;s&&l&&p&&await this.layer.highlightPixels({pixelBlock:l,renderedPixelBlock:p,highlightOptions:this.pixelHighlights});const n=new h(p,o.extent?.clone(),l);return n.filter=t=>this.layer.applyFilter(t),n}};t([a()],g.prototype,"attached",void 0),t([a()],g.prototype,"container",void 0),t([a()],g.prototype,"layer",void 0),t([a()],g.prototype,"strategy",void 0),t([a()],g.prototype,"timeExtent",void 0),t([a()],g.prototype,"view",void 0),t([a()],g.prototype,"updateRequested",void 0),t([a()],g.prototype,"updating",null),t([a()],g.prototype,"pixelHighlights",void 0),t([a()],g.prototype,"type",void 0),g=t([o("esri.views.2d.layers.imagery.ImageryView2D")],g);export{g as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../Color.js";import s from"../../../../core/Accessor.js";import{watch as i,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{throttle as r}from"../../../../core/throttle.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromValues as n,fromArray as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{OutlineVisualElement as m}from"../../interactive/visualElements/OutlineVisualElement.js";import{getConfig as c}from"../../../analysis/ElevationProfile/constants.js";import{getInputGeometry as f}from"../../../analysis/ElevationProfile/geometryUtils.js";import{createLineGeometry as d}from"../../../analysis/ElevationProfile/visualizationUtils.js";let h=class extends s{constructor(e){super(e),this._visualElements=[],this._updateThrottled=r(e=>this._update(e),c().profileLinesUpdateThrottleMillis)}initialize(){const{analysisViewData:e}=this;this.addHandles([i(()=>({lineInfos:e.results.filter(e=>e.available).map(({computation:e,samples:t})=>{const s=e.profileLine;return{color:s.color,samples:t,visible:s.viewOptions.lineVisible}}),refined:1===e.progress,spatialReference:this.view.spatialReference}),e=>this._updateThrottled(e)),i(()=>f(e.analysis.input),()=>{this._remove()},o),this._updateThrottled])}destroy(){this._destroyVisualElements()}get updating(){return this._updateThrottled.hasPendingUpdates()}_remove(){this._destroyVisualElements()}_update(e){const{lineInfos:s}=e;if(!s||0===s.length)return this._remove();if(!e.refined)return;const i=this._visualElements,o=s.filter(e=>e.visible),r=o.length;for(;i.length>r;)i.pop().destroy();for(;i.length<r;){const e=new m({view:this.view,elevationInfo:{mode:"absolute-height",offset:0},innerWidth:0,innerColor:n(0,0,0,0),width:3,falloff:0,renderOccluded:16,isDecoration:!0});i.push(e)}const{spatialReference:l}=e;for(let a=0;a<r;++a){const e=i[a],s=o[r-1-a];e.geometry=d(s.samples,l),e.color=p(t.toUnitRGBA(s.color))}}_destroyVisualElements(){this._visualElements.forEach(e=>e.destroy()),this._visualElements.length=0}};e([l()],h.prototype,"view",void 0),e([l()],h.prototype,"analysisViewData",void 0),e([l()],h.prototype,"updating",null),h=e([a("esri.views.3d.analysis.ElevationProfile.ProfileLinesVisualization")],h);export{h as ProfileLinesVisualization};
5
+ import{__decorate as e}from"tslib";import t from"../../../../Color.js";import s from"../../../../core/Accessor.js";import{watch as i,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{throttle as r}from"../../../../core/throttle.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromValues as n,fromArray as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{OutlineVisualElement as m}from"../../interactive/visualElements/OutlineVisualElement.js";import{getConfig as c}from"../../../analysis/ElevationProfile/constants.js";import{getInputGeometry as f}from"../../../analysis/ElevationProfile/geometryUtils.js";import{createLineGeometry as d}from"../../../analysis/ElevationProfile/visualizationUtils.js";let h=class extends s{constructor(e){super(e),this._visualElements=[],this._updateThrottled=r(e=>this._update(e),c().profileLinesUpdateThrottleMillis)}initialize(){const{analysisViewData:e}=this;this.addHandles([i(()=>({lineInfos:e.results.filter(e=>e.available).map(({computation:e,samples:t})=>{const s=e.profileLine;return{color:s.color,samples:t,visible:s.viewOptions.lineVisible}}),refined:1===e.progress,spatialReference:this.view.spatialReference}),e=>this._updateThrottled(e),o),i(()=>f(e.analysis.input),()=>this._remove(),o),this._updateThrottled])}destroy(){this._destroyVisualElements()}get updating(){return this._updateThrottled.hasPendingUpdates()}_remove(){this._destroyVisualElements()}_update(e){const{lineInfos:s}=e;if(!s||0===s.length)return this._remove();if(!e.refined)return;const i=this._visualElements,o=s.filter(e=>e.visible),r=o.length;for(;i.length>r;)i.pop().destroy();for(;i.length<r;){const e=new m({view:this.view,elevationInfo:{mode:"absolute-height",offset:0},innerWidth:0,innerColor:n(0,0,0,0),width:3,falloff:0,renderOccluded:16,isDecoration:!0});i.push(e)}const{spatialReference:l}=e;for(let a=0;a<r;++a){const e=i[a],s=o[r-1-a];e.geometry=d(s.samples,l),e.color=p(t.toUnitRGBA(s.color))}}_destroyVisualElements(){this._visualElements.forEach(e=>e.destroy()),this._visualElements.length=0}};e([l()],h.prototype,"view",void 0),e([l()],h.prototype,"analysisViewData",void 0),e([l()],h.prototype,"updating",null),h=e([a("esri.views.3d.analysis.ElevationProfile.ProfileLinesVisualization")],h);export{h as ProfileLinesVisualization};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as e}from"tslib";import{isIterable as t}from"../../../../core/iteratorUtils.js";import{memoize as r}from"../../../../core/memoize.js";import{watch as i}from"../../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as o}from"../../../../core/unitUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{i as l}from"../../../../chunks/vec32.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../../geometry/ellipsoidUtils.js";import{create as p,fromPoints as u}from"../../../../geometry/support/ray.js";import{GeometryDescriptor as m}from"../../../../layers/support/ElevationQuery.js";import{externalToInternalIntersectOptions as d}from"../../support/hitTest.js";import{Intersector as y}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as f}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{getInputGraphic as h}from"../../../analysis/ElevationProfile/geometryUtils.js";import{LineComputation as v}from"../../../analysis/ElevationProfile/LineComputation.js";const _=2e5;let g=class extends v{constructor(){super(...arguments),this.type="scene",this.numSamplesForPreview=50,this.numSamplesPerChunk=25,this._getQueryElevationDependenciesMemoized=r((e,t,r,i,o,n,s)=>({inputGraphicUid:j(e),visibleLayers:t,maxIntersectionDistance:r,intersectOptions:i,view:o,stationary:n,spatialReference:s})),this._vecA=a(),this._vecB=a(),this._ray=p()}get minDemResolution(){const e=this._view;if(!e)return null;const t=e.pointsOfInterest?.focus?.worldUnitsPerContentPixel;return null==t?null:t*o(e.spatialReference)}initialize(){const e=()=>this.onInvalidate(this);return this.addHandles([i(()=>this._queryElevationDependencies,e),this.controller.onElevationChange(e)])}async queryElevation(e,{noDataValue:t,signal:r}){const i=this._queryElevationDependencies;if(null==i)throw new Error(`${this.declaredClass}: no dependencies`);const o=this._intersector;if(null==o)throw new Error(`${this.declaredClass}: no view`);const{intersectOptions:n,view:s,spatialReference:a}=i,c=s.renderCoordsHelper,p=s.sceneIntersectionHelper,d=this._vecA,y=this._vecA,f=this._vecB,h=this._ray;if(!a)return{geometry:e,noDataValue:t};const v=await m.fromGeometry(e).project(a,r);if(!v)return{geometry:e,noDataValue:t};const g=v.coordinates,j=g.length;for(let m=0;m<j;++m){const e=g[m];l(f,e.x,e.y,e.z??0),c.toRenderCoords(f,a,f),c.setAltitude(d,_,f);const r=u(d,f,h);p.computeIntersection(r,o,!0,n);const s=w(i,o.results.all);s?(s.getIntersectionPoint(y),c.fromRenderCoords(y,y,a),e.z=y[2]):e.z=t}return{geometry:v.export(),noDataValue:t}}get _queryElevationDependencies(){const e=this._view;return e?this._getQueryElevationDependenciesMemoized(this.controller?.analysis.input,this._visibleLayers,this._maxIntersectionDistance,this._intersectOptions,e,e.stationary,e.spatialReference):null}get _visibleLayers(){return this._view?.map?.allLayers?.filter(e=>e.visible).toArray()??[]}get _intersectOptions(){const e=this._view;if(!e||e.destroyed)return{};const{include:r,exclude:i}=this.profileLine;return d(e,{include:r,exclude:[...this._pointCloudLayers,...t(i)?i:i?[i]:[]]})}get _pointCloudLayers(){const e=this._view;return e?e.allLayerViews.toArray().filter(e=>"point-cloud"===e.layer?.type).map(e=>e.layer):[]}get _view(){const e=this.controller.view;return"3d"===e.type?e:null}get _maxIntersectionDistance(){const e=this._view;return e?.renderCoordsHelper?c(e.spatialReference).radius/e.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY}get _intersector(){const e=this._view;if(!e)return null;const t=new y(e.state.viewingMode),r=t.options;return r.hud=!1,r.invisibleTerrain=!1,r.backfacesTerrain=!1,r.selectionMode=!1,r.store=2,t}};function w({view:e,inputGraphicUid:t,maxIntersectionDistance:r},i){for(const o of i){if(!o.withinDistance(r))continue;const i=f(o,e);if(null==i||j(i)!==t)return o}return null}function j(e){const t=h(e);if(!t)return null;if(t.layer&&"objectIdField"in t.layer){const e=t.attributes[t.layer.objectIdField];if(e)return`o-${t.layer.id}-${e}`}return`u-${t.uid}`}e([n({readOnly:!0})],g.prototype,"minDemResolution",null),e([n()],g.prototype,"_queryElevationDependencies",null),e([n()],g.prototype,"_visibleLayers",null),e([n()],g.prototype,"_intersectOptions",null),e([n()],g.prototype,"_pointCloudLayers",null),e([n()],g.prototype,"_view",null),e([n()],g.prototype,"_maxIntersectionDistance",null),e([n()],g.prototype,"_intersector",null),g=e([s("esri.views.3d.analysis.ElevationProfile.SceneLineComputation")],g);export{g as SceneLineComputation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as r}from"./AnalysisView3D.js";import{ElevationProfileLineSceneComputation as s}from"./ElevationProfile/ElevationProfileLineSceneComputation.js";import{Visualization as n}from"./ElevationProfile/Visualization.js";import{ElevationProfileController as l}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileLineGroundComputation as a}from"../../analysis/ElevationProfile/ElevationProfileLineGroundComputation.js";import{ElevationProfileLineInputComputation as p}from"../../analysis/ElevationProfile/ElevationProfileLineInputComputation.js";import{ElevationProfileLineQueryComputation as u}from"../../analysis/ElevationProfile/ElevationProfileLineQueryComputation.js";let c=class extends(r(e)){constructor(t){super(t),this.type="elevation-profile-view-3d",this.analysis=null,this.hoveredPosition=null,this.inputIsSketched=!1}initialize(){this._controller=new l({analysis:this.analysis,analysisViewData:this,view:this.view,computationFactory:{create:t=>{switch(t.profileLine.type){case"ground":return new a(t);case"input":return new p(t);case"query":return new u(t);case"scene":return new s(t)}}}}),this._visualizattion=new n({view:this.view,analysisViewData:this})}destroy(){this._controller.destroy(),this._visualizattion.destroy()}get hoveredPoints(){return this._controller.hoveredPoints}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller.progress}get results(){return this._controller.results}get statistics(){return this._controller.statistics}get updating(){return this._controller?.updating||this._visualizattion?.updating}get visible(){return super.visible}set visible(t){super.visible=t}};t([o({readOnly:!0})],c.prototype,"type",void 0),t([o({constructOnly:!0,nonNullable:!0})],c.prototype,"analysis",void 0),t([o()],c.prototype,"hoveredPosition",void 0),t([o()],c.prototype,"hoveredPoints",null),t([o({readOnly:!0})],c.prototype,"progress",null),t([o({readOnly:!0})],c.prototype,"results",null),t([o({readOnly:!0})],c.prototype,"statistics",null),t([o({readOnly:!0})],c.prototype,"updating",null),t([o()],c.prototype,"tool",void 0),t([o()],c.prototype,"inputIsSketched",void 0),t([o()],c.prototype,"_controller",void 0),t([o()],c.prototype,"_visualizattion",void 0),c=t([i("esri.views.3d.analysis.ElevationProfileAnalysisView3D")],c);const v=c;export{v as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as r}from"./AnalysisView3D.js";import{SceneLineComputation as s}from"./ElevationProfile/SceneLineComputation.js";import{Visualization as n}from"./ElevationProfile/Visualization.js";import{Controller as l}from"../../analysis/ElevationProfile/Controller.js";import{GroundLineComputation as a}from"../../analysis/ElevationProfile/GroundLineComputation.js";import{InputLineComputation as p}from"../../analysis/ElevationProfile/InputLineComputation.js";import{QueryLineComputation as u}from"../../analysis/ElevationProfile/QueryLineComputation.js";let c=class extends(r(e)){constructor(t){super(t),this.type="elevation-profile-view-3d",this.analysis=null,this.hoveredPosition=null,this.inputIsSketched=!1}initialize(){this._controller=new l({analysis:this.analysis,analysisViewData:this,view:this.view,computationFactory:{create:t=>{switch(t.profileLine.type){case"ground":return new a(t);case"input":return new p(t);case"query":return new u(t);case"scene":return new s(t)}}}}),this._visualizattion=new n({view:this.view,analysisViewData:this})}destroy(){this._controller.destroy(),this._visualizattion.destroy()}get hoveredPoints(){return this._controller.hoveredPoints}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller.progress}get results(){return this._controller.results}get statistics(){return this._controller.statistics}get updating(){return this._controller?.updating||this._visualizattion?.updating}get visible(){return super.visible}set visible(t){super.visible=t}};t([o({readOnly:!0})],c.prototype,"type",void 0),t([o({constructOnly:!0,nonNullable:!0})],c.prototype,"analysis",void 0),t([o()],c.prototype,"hoveredPosition",void 0),t([o()],c.prototype,"hoveredPoints",null),t([o({readOnly:!0})],c.prototype,"progress",null),t([o({readOnly:!0})],c.prototype,"results",null),t([o({readOnly:!0})],c.prototype,"statistics",null),t([o({readOnly:!0})],c.prototype,"updating",null),t([o()],c.prototype,"tool",void 0),t([o()],c.prototype,"inputIsSketched",void 0),t([o()],c.prototype,"_controller",void 0),t([o()],c.prototype,"_visualizattion",void 0),c=t([i("esri.views.3d.analysis.ElevationProfileAnalysisView3D")],c);const y=c;export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{syncAndInitial as o,watch as n,initial as a}from"../../../../core/reactiveUtils.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import{projectOrLoad as p}from"../../../../geometry/projectionUtils.js";import{projectBoundingRect as m}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as d,fromExtent as u,intersects as c}from"../../../../geometry/support/aaBoundingRect.js";import{logFailedGeometryProjectionError as y}from"../support/projectionUtils.js";import{CutFillVolumeMeasurementComputation as g}from"./CutFillVolumeMeasurementComputation.js";import{getElevationAtPoint as h}from"../../support/ElevationProvider.js";let v=class extends t{constructor(e){super(e),this._updatingHandles=new l,this._computation=null}initialize(){this._updatingHandles.add(()=>({geometry:this.analysis.geometry,projectedGeometry:p(this.analysis.geometry,this.view.spatialReference)}),({geometry:e,projectedGeometry:t})=>{null==t.pending?this._onGeometryChange(e,t.geometry):this._updatingHandles.addPromise(t.pending)},o),this.addHandles([this._createElevationUpdateHandle(),n(()=>[this.analysis.measureType,this.analysisViewData.elevationAlignedGeometry,this.analysisViewData.effectiveTargetElevation],()=>this._updateTargetGeometry()),n(()=>this.analysisViewData.elevationAlignedGeometry?.extent,e=>{e?this._updateComputation(e):this._removeComputation()},a)])}destroy(){this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}_createComputation(e){const{renderCoordsHelper:t}=this.view;this._computation=new g({extent:e,renderCoordsHelper:t})}_updateComputation(e){this._computation?this._computation.extent=e:this._createComputation(e)}_removeComputation(){this._computation=null}_createElevationUpdateHandle(){const e=t=>{const i=this.analysis.geometry;if(null==i)return;const o=p(i,this.view.spatialReference);if(null!=o.pending)return this._updatingHandles.addPromise(o.pending),void o.pending.finally(()=>e(t));const n=o.geometry;null!=n&&null!=n.extent&&(m(t.extent,t.spatialReference,_,this.view.spatialReference),u(n.extent,w),c(_,w)&&this._onGeometryChange(i,n))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_onGeometryChange(e,t){const{elevationProvider:o}=this.view,{valid:n}=this.analysis;if(null==e||!n)return void(this.analysisViewData.elevationAlignedGeometry=null);if(null==t)return y(this.analysis,e.spatialReference,i.getLogger(this)),void(this.analysisViewData.elevationAlignedGeometry=null);const a=t.clone();f(o,a),this.analysisViewData.elevationAlignedGeometry=a}_updateTargetGeometry(){const{measureType:e}=this.analysis,{elevationAlignedGeometry:t,effectiveTargetElevation:i}=this.analysisViewData;if(!t)return void(this.analysisViewData.targetGeometry=null);if("stockpile"===e||null==i)return void(this.analysisViewData.targetGeometry=t);const o=t.clone();o.rings[0].forEach(e=>{e[2]=i}),this.analysisViewData.targetGeometry=o}};function f(e,t){t.rings[0].forEach(t=>{t[2]=h(e,t,"ground")??0})}e([r({constructOnly:!0})],v.prototype,"analysis",void 0),e([r({constructOnly:!0})],v.prototype,"analysisViewData",void 0),e([r({constructOnly:!0})],v.prototype,"view",void 0),e([r()],v.prototype,"updating",null),e([r({readOnly:!0})],v.prototype,"_updatingHandles",void 0),e([r()],v.prototype,"_computation",void 0),v=e([s("esri.views.3d.analysis.VolumeMeasurement.CutFillVolumeMeasurementController")],v);const _=d(),w=d();export{v as CutFillVolumeMeasurementController};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import o from"../../../../core/Logger.js";import{syncAndInitial as i,watch as n,initial as a}from"../../../../core/reactiveUtils.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import{projectOrLoad as p}from"../../../../geometry/projectionUtils.js";import{projectBoundingRect as m}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as d,fromExtent as u,intersects as c}from"../../../../geometry/support/aaBoundingRect.js";import{logFailedGeometryProjectionError as y}from"../support/projectionUtils.js";import{CutFillVolumeMeasurementComputation as g}from"./CutFillVolumeMeasurementComputation.js";import{getElevationAtPoint as h}from"../../support/ElevationProvider.js";let v=class extends t{constructor(e){super(e),this._updatingHandles=new l,this._computation=null}initialize(){this._updatingHandles.add(()=>({geometry:this.analysis.geometry,projectedGeometry:p(this.analysis.geometry,this.view.spatialReference)}),({geometry:e,projectedGeometry:t})=>{null==t.pending?this._onGeometryChange(e,t.geometry):this._updatingHandles.addPromise(t.pending)},i),this.addHandles([this._createElevationUpdateHandle(),n(()=>[this.analysis.measureType,this.analysisViewData.elevationAlignedGeometry,this.analysisViewData.effectiveTargetElevation],()=>this._updateTargetGeometry()),n(()=>this.analysisViewData.elevationAlignedGeometry?.extent,e=>{e?this._updateComputation(e):this._removeComputation()},a)])}destroy(){this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}_createComputation(e){const{renderCoordsHelper:t}=this.view;this._computation=new g({extent:e,renderCoordsHelper:t})}_updateComputation(e){this._computation?this._computation.extent=e:this._createComputation(e)}_removeComputation(){this._computation=null}_createElevationUpdateHandle(){const e=t=>{const o=this.analysis.geometry;if(null==o||"ground"!==t.context)return;const i=p(o,this.view.spatialReference);if(null!=i.pending)return this._updatingHandles.addPromise(i.pending),void i.pending.finally(()=>e(t));const n=i.geometry;null!=n&&null!=n.extent&&(m(t.extent,t.spatialReference,_,this.view.spatialReference),u(n.extent,w),c(_,w)&&this._onGeometryChange(o,n))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_onGeometryChange(e,t){const{elevationProvider:i}=this.view,{valid:n}=this.analysis;if(null==e||!n)return void(this.analysisViewData.elevationAlignedGeometry=null);if(null==t)return y(this.analysis,e.spatialReference,o.getLogger(this)),void(this.analysisViewData.elevationAlignedGeometry=null);const a=t.clone();f(i,a),this.analysisViewData.elevationAlignedGeometry=a}_updateTargetGeometry(){const{measureType:e}=this.analysis,{elevationAlignedGeometry:t,effectiveTargetElevation:o}=this.analysisViewData;if(!t)return void(this.analysisViewData.targetGeometry=null);if("stockpile"===e||null==o)return void(this.analysisViewData.targetGeometry=t);const i=t.clone();i.rings[0].forEach(e=>{e[2]=o}),this.analysisViewData.targetGeometry=i}};function f(e,t){t.rings[0].forEach(t=>{t[2]=h(e,t,"ground")??0})}e([r({constructOnly:!0})],v.prototype,"analysis",void 0),e([r({constructOnly:!0})],v.prototype,"analysisViewData",void 0),e([r({constructOnly:!0})],v.prototype,"view",void 0),e([r()],v.prototype,"updating",null),e([r({readOnly:!0})],v.prototype,"_updatingHandles",void 0),e([r()],v.prototype,"_computation",void 0),v=e([s("esri.views.3d.analysis.VolumeMeasurement.CutFillVolumeMeasurementController")],v);const _=d(),w=d();export{v as CutFillVolumeMeasurementController};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{c as t,i as e,f as r,n,h as o,e as s,g as i,s as f}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import a from"../../../../geometry/Polygon.js";import{a as u}from"../../../../chunks/sphere.js";import{planeFromPoints as c}from"../../support/mathUtils.js";function h(t,n){const o=u(n);e(o,0,0,0);for(let e=0;e<t.length;++e)r(o,o,t[e]);i(o,o,1/t.length);let s=0;for(let e=0;e<t.length;++e)s=Math.max(s,f(o,t[e]));n[3]=Math.sqrt(s)}function g(t,e){if(t.length<3)throw new Error("need at least 3 points to fit a plane");c(t[0],t[1],t[2],e)}function m(t,e){return s(t,e)+t[3]}function p(e,r,n,o,{geodesicArea:s}){const i=x;return t(i.rings[0][0],e),t(i.rings[0][1],r),t(i.rings[0][2],n),t(i.rings[0][3],e),i.spatialReference=o,i.clearCache(),s(i)}function j(i,f=null,l=!0){const a=(t,e)=>{if(0===e[0]&&0===e[1]&&0===e[2])return!1;for(let r=0;r<t.length;++r)if(s(e,t[r])<-1e-6)return!1;return!0};if(0===i.length)return!1;if(1===i.length)return f&&t(f,i[0]),!0;e(y,0,0,0);for(let t=0;t<i.length;++t)r(y,y,i[t]);if(n(y,y),a(i,y))return f&&t(f,y),!0;if(!l)return!1;for(let e=0;e<i.length;++e)for(let r=0;r<i.length;++r)if(e!==r&&(o(y,i[e],i[r]),n(y,y),a(i,y)))return f&&t(f,y),!0;return!1}function w(t){return"mouse"!==t.pointerType||0===t.button}const x=new a({hasM:!1,hasZ:!0,rings:[[l(),l(),l(),l()]],spatialReference:null}),y=l();export{g as bestFitPlane,h as boundingSphere,j as fitHemisphere,w as isPrimaryPointerAction,m as planePointDistance,p as triangleAreaGeodesic};
5
+ import{c as t,i as e,f as r,n,h as o,e as s,g as i,s as f}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import a from"../../../../geometry/Polygon.js";import{e as u}from"../../../../chunks/sphere.js";import{planeFromPoints as c}from"../../support/mathUtils.js";function h(t,n){const o=e(g,0,0,0);for(let e=0;e<t.length;++e)r(o,o,t[e]);i(o,o,1/t.length);let s=0;for(let e=0;e<t.length;++e)s=Math.max(s,f(o,t[e]));u(n,o,Math.sqrt(s))}const g=l();function m(t,e){if(t.length<3)throw new Error("need at least 3 points to fit a plane");c(t[0],t[1],t[2],e)}function p(t,e){return s(t,e)+t[3]}function j(e,r,n,o,{geodesicArea:s}){const i=y;return t(i.rings[0][0],e),t(i.rings[0][1],r),t(i.rings[0][2],n),t(i.rings[0][3],e),i.spatialReference=o,i.clearCache(),s(i)}function w(i,f=null,l=!0){const a=(t,e)=>{if(0===e[0]&&0===e[1]&&0===e[2])return!1;for(let r=0;r<t.length;++r)if(s(e,t[r])<-1e-6)return!1;return!0};if(0===i.length)return!1;if(1===i.length)return f&&t(f,i[0]),!0;e(M,0,0,0);for(let t=0;t<i.length;++t)r(M,M,i[t]);if(n(M,M),a(i,M))return f&&t(f,M),!0;if(!l)return!1;for(let e=0;e<i.length;++e)for(let r=0;r<i.length;++r)if(e!==r&&(o(M,i[e],i[r]),n(M,M),a(i,M)))return f&&t(f,M),!0;return!1}function x(t){return"mouse"!==t.pointerType||0===t.button}const y=new a({hasM:!1,hasZ:!0,rings:[[l(),l(),l(),l()]],spatialReference:null}),M=l();export{m as bestFitPlane,h as boundingSphere,w as fitHemisphere,x as isPrimaryPointerAction,p as planePointDistance,j as triangleAreaGeodesic};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{c as e,d as n,f as r,j as t,E as o}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrap as c}from"../../../../geometry/support/ray.js";import{i as s,l as a}from"../../../../chunks/sphere.js";import{defaultConstraintOptions as f,interactionDirectionTowardsConstraintMinimization as m,adjustRangeForInteraction as u}from"./common.js";function p(e,n,r=f){if(!e.state.isLocal)return 0;const t=e.state.constraints.distance;if(!e.pointsOfInterest.surfaceOrigin.renderLocation||t===1/0)return 0;L.min=0,L.max=t,l(e,r,L);const o=y(e,n),i=L.max-o;return i>=-1e-6?0:i}function d(t,o,i=f){const u=p(t,o,i);if(0===u)return!1;const d=t.pointsOfInterest.surfaceOrigin;if(!d.renderLocation)return!1;const l=y(t,o)+u,L=e(g,o.eye),C=m(o,i.interactionDirection,x(o,d.renderLocation,I),O);if(!s(a(d.renderLocation,l),c(o.eye,C),h))return!1;o.eye=h;const k=n(j,o.eye,L);o.center=r(h,o.center,k);const v=t.renderCoordsHelper.getAltitude(o.center),H=t.renderCoordsHelper.intersectInfiniteManifold(o.ray,v,h);return null!=H&&(o.center=H),!0}function l(e,n,r){const t=n.interactionType;if(0===t)return;const{min:o,max:i}=r,{interactionStartCamera:c,interactionFactor:s}=n;if(!c)return;const a=1===t||4===t,f=p(e,c),m=0===f?0:y(e,c);r.min=o,r.max=i;u(f,m,a,s,.05*m,r)}function y(e,n){const r=e.pointsOfInterest.surfaceOrigin;return r.renderLocation?t(n.eye,r.renderLocation):0}function x(e,n,r){return o(r,e.eye,n)}const L={min:0,max:0},g=i(),j=i(),O=i(),I=i(),h=i();export{d as applyDistanceConstraint,p as getDistanceConstraintError};
5
+ import{c as e,d as r,f as n,j as t,E as o}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrap as c}from"../../../../geometry/support/ray.js";import{i as s,r as a}from"../../../../chunks/sphere.js";import{defaultConstraintOptions as f,interactionDirectionTowardsConstraintMinimization as m,adjustRangeForInteraction as u}from"./common.js";function p(e,r,n=f){if(!e.state.isLocal)return 0;const t=e.state.constraints.distance;if(!e.pointsOfInterest.surfaceOrigin.renderLocation||t===1/0)return 0;L.min=0,L.max=t,y(e,n,L);const o=l(e,r),i=L.max-o;return i>=-1e-6?0:i}function d(t,o,i=f){const u=p(t,o,i);if(0===u)return!1;const d=t.pointsOfInterest.surfaceOrigin;if(!d.renderLocation)return!1;const y=l(t,o)+u,L=e(g,o.eye),C=m(o,i.interactionDirection,x(o,d.renderLocation,I),O);if(!s(a(d.renderLocation,y),c(o.eye,C),h))return!1;o.eye=h;const k=r(j,o.eye,L);o.center=n(h,o.center,k);const v=t.renderCoordsHelper.getAltitude(o.center),H=t.renderCoordsHelper.intersectInfiniteManifold(o.ray,v,h);return null!=H&&(o.center=H),!0}function y(e,r,n){const t=r.interactionType;if(0===t)return;const{min:o,max:i}=n,{interactionStartCamera:c,interactionFactor:s}=r;if(!c)return;const a=1===t||4===t,f=p(e,c),m=0===f?0:l(e,c);n.min=o,n.max=i;u(f,m,a,s,.05*m,n)}function l(e,r){const n=e.pointsOfInterest.surfaceOrigin;return n.renderLocation?t(r.eye,n.renderLocation):0}function x(e,r,n){return o(n,e.eye,r)}const L={min:0,max:0},g=i(),j=i(),O=i(),I=i(),h=i();export{d as applyDistanceConstraint,p as getDistanceConstraintError};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as e}from"../../../../core/compilerUtils.js";import{acosClamped as t,clamp as r,asinClamped as n,deg2rad as i}from"../../../../core/mathUtils.js";import{fromRotation as a}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{d as c,t as o,g as u,f as l,k as m,j as d,e as f,n as h,l as p}from"../../../../chunks/vec32.js";import{create as M}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as y}from"../../../../geometry/ellipsoidUtils.js";import{e as C,b as I,t as x}from"../../../../chunks/sphere.js";import{defaultConstraintOptions as S,hasConstraintType as v,adjustRangeForInteraction as w}from"./common.js";import{viewAngle as A}from"../../state/utils/viewUtils.js";function R(t,r,n,i=!0){Q.eyeCenterDistance=0,Q.requiresTwoSteps=!1;const s=T(t,r,n,S,Q);if(0===s)return!1;switch(a(z,-s,r.viewRight),n.tiltMode){case 1:o(L,r.viewForward,z),u(L,L,Q.eyeCenterDistance),r.center=l(B,r.eye,L);break;case 0:c(L,r.center,r.eye),o(L,L,z),r.eye=c(B,r.center,L);break;default:e(n.tiltMode)}return r.up=o(B,r.up,z),!Q.requiresTwoSteps||!i||R(t,r,n,!1)}function T(e,t,r,n=S,i){if(!e.state.constraints.tilt)return 0;const a=Math.min(t.relativeElevation*J,t.distance),s=e.state.constraints.tilt(a,K);return E(e,r,s),2===n.interactionType&&v(n.selection,2)&&U(e,n.interactionStartCamera,s),1===r.tiltMode||1===n.tiltMode?P(e,t,s,i):j(e,t,s)}function j(e,t,n){const i=A(e.renderCoordsHelper,t.center,t.eye),a=i-r(i,n.min,n.max);return q(a)?a:0}function P(e,t,r,n){switch(n&&(n.requiresTwoSteps=!1),e.viewingMode){case"global":return g(e,t,r,n);case"local":return b(e,t,r,n)}}function b(e,t,n,i){const a=A(e.renderCoordsHelper,t.center,t.eye),s=r(a,n.min,n.max),c=a-s;if(!q(c))return 0;if(i){const r=Math.abs(e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude),n=e.renderCoordsHelper.getAltitude(t.eye)-r,a=Math.max(Math.cos(s),1e-4);Math.abs(a)>1e-4?i.eyeCenterDistance=n/a:i.eyeCenterDistance=t.distance}return c}function g(e,t,n,i){const a=O(e,t,N),s=r(a.tiltAtCenter,n.min,n.max);if(!q(a.tiltAtCenter-s))return 0;let c,o;return a.centerIsOnSurface?(c=H(a),o=k(a,c)):(c=a.constraints.clampTilt(a.distance,a.tiltAtCenter),i&&c<Math.PI/2&&(i.requiresTwoSteps=!0,c=Math.PI/2-1e-5),o=F(a,c)),i&&(i.eyeCenterDistance=D(a,c)),o}function O(e,r,n){const i=e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,a=i+y(e.spatialReference).radius,s=e.renderCoordsHelper.intersectManifold(r.ray,i,B);return n.distance=Math.min(r.relativeElevation*J,r.distance),n.centerIsOnSurface=!1,null!=s?(n.distance=Math.min(r.relativeElevation*J,d(r.eye,s)),n.tiltAtCenter=A(e.renderCoordsHelper,s,r.eye),n.centerIsOnSurface=!0):e.state.isLocal?n.tiltAtCenter=A(e.renderCoordsHelper,r.center,r.eye):(C(I(x,a),r.ray,B),n.distance=Math.min(r.relativeElevation*J,d(r.eye,B)),n.tiltAtCenter=t(-f(r.viewForward,h(B,B)))),n.radius=a,n.eyeRadius=p(r.eye),n.constraints=e.state.constraints,n}function q(e){return Math.abs(e)>1e-9}function H(e){const{constraints:t,distance:r,tiltAtCenter:n}=e;let i=n,a=t.clampTilt(r,n);const s=D(e,a);if(t.clampTilt(s,n)===a)return a;let c=0;for(;c<10&&q(a-i);){const r=(i+a)/2,n=D(e,r);q(t.clampTilt(n,r)-r)?i=r:a=r,c++}return a}function D(e,t){if(!e.centerIsOnSurface)return e.distance;const i=Math.PI-r(t,0,Math.PI),a=n(e.radius/e.eyeRadius*Math.sin(i)),s=Math.PI-i-a,c=Math.sin(s)/Math.sin(i);if(e.eyeRadius<e.radius&&c>1){const t=Math.PI-a,r=Math.PI-i-t;return Math.sin(r)/Math.sin(i)*e.eyeRadius}return c*e.eyeRadius}function k(e,t){const r=n(e.radius/e.eyeRadius*Math.sin(e.tiltAtCenter)),i=n(e.radius/e.eyeRadius*Math.sin(t));return e.eyeRadius>e.radius?r-i:i-r}function F(e,t){return e.tiltAtCenter-Math.PI/2-(t-Math.PI/2)}function E(e,t,r){if(0===t.interactionType)return;const{interactionStartCamera:n,interactionFactor:i}=t;if(!n)return;const{min:a,max:s}=r,c=T(e,n,S,t),o=0===c?0:A(e.renderCoordsHelper,n.center,n.eye);r.min=a,r.max=s,2===t.interactionType?(v(t.selection,2)&&U(e,n,r),w(c,o,!0,i,G,r)):w(c,o,!1,i,G,r)}function U(e,r,n){const i=e.state.constraints;if(e.state.isLocal||!i.altitude||!r)return;const a=m(r.center),s=Math.sqrt(a),c=r.distance,o=y(e.spatialReference).radius,u=i.altitude.min+o,l=i.altitude.max+o,d=(u*u-c*c-a)/(-2*s*c),f=(l*l-c*c-a)/(-2*s*c);n.min=Math.max(n.min,Math.min(Math.PI-t(f),n.max)),n.max=Math.min(n.max,Math.PI-t(d))}const L=M(),z=s(),B=M(),G=i(5),J=30,K={min:0,max:0},N={constraints:null,radius:0,eyeRadius:0,centerIsOnSurface:!0,distance:0,tiltAtCenter:0},Q={eyeCenterDistance:0,requiresTwoSteps:!1};export{R as applyTiltConstraint,T as getTiltConstraintError};
5
+ import{neverReached as e}from"../../../../core/compilerUtils.js";import{acosClamped as t,clamp as r,asinClamped as n,deg2rad as i}from"../../../../core/mathUtils.js";import{fromRotation as a}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{d as c,t as o,g as u,f as l,k as m,j as d,e as f,n as h,l as p}from"../../../../chunks/vec32.js";import{create as M}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as y}from"../../../../geometry/ellipsoidUtils.js";import{h as C,b as I,t as x}from"../../../../chunks/sphere.js";import{defaultConstraintOptions as S,hasConstraintType as v,adjustRangeForInteraction as w}from"./common.js";import{viewAngle as A}from"../../state/utils/viewUtils.js";function R(t,r,n,i=!0){Q.eyeCenterDistance=0,Q.requiresTwoSteps=!1;const s=T(t,r,n,S,Q);if(0===s)return!1;switch(a(z,-s,r.viewRight),n.tiltMode){case 1:o(L,r.viewForward,z),u(L,L,Q.eyeCenterDistance),r.center=l(B,r.eye,L);break;case 0:c(L,r.center,r.eye),o(L,L,z),r.eye=c(B,r.center,L);break;default:e(n.tiltMode)}return r.up=o(B,r.up,z),!Q.requiresTwoSteps||!i||R(t,r,n,!1)}function T(e,t,r,n=S,i){if(!e.state.constraints.tilt)return 0;const a=Math.min(t.relativeElevation*J,t.distance),s=e.state.constraints.tilt(a,K);return E(e,r,s),2===n.interactionType&&v(n.selection,2)&&U(e,n.interactionStartCamera,s),1===r.tiltMode||1===n.tiltMode?P(e,t,s,i):j(e,t,s)}function j(e,t,n){const i=A(e.renderCoordsHelper,t.center,t.eye),a=i-r(i,n.min,n.max);return q(a)?a:0}function P(e,t,r,n){switch(n&&(n.requiresTwoSteps=!1),e.viewingMode){case"global":return g(e,t,r,n);case"local":return b(e,t,r,n)}}function b(e,t,n,i){const a=A(e.renderCoordsHelper,t.center,t.eye),s=r(a,n.min,n.max),c=a-s;if(!q(c))return 0;if(i){const r=Math.abs(e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude),n=e.renderCoordsHelper.getAltitude(t.eye)-r,a=Math.max(Math.cos(s),1e-4);Math.abs(a)>1e-4?i.eyeCenterDistance=n/a:i.eyeCenterDistance=t.distance}return c}function g(e,t,n,i){const a=O(e,t,N),s=r(a.tiltAtCenter,n.min,n.max);if(!q(a.tiltAtCenter-s))return 0;let c,o;return a.centerIsOnSurface?(c=H(a),o=k(a,c)):(c=a.constraints.clampTilt(a.distance,a.tiltAtCenter),i&&c<Math.PI/2&&(i.requiresTwoSteps=!0,c=Math.PI/2-1e-5),o=F(a,c)),i&&(i.eyeCenterDistance=D(a,c)),o}function O(e,r,n){const i=e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,a=i+y(e.spatialReference).radius,s=e.renderCoordsHelper.intersectManifold(r.ray,i,B);return n.distance=Math.min(r.relativeElevation*J,r.distance),n.centerIsOnSurface=!1,null!=s?(n.distance=Math.min(r.relativeElevation*J,d(r.eye,s)),n.tiltAtCenter=A(e.renderCoordsHelper,s,r.eye),n.centerIsOnSurface=!0):e.state.isLocal?n.tiltAtCenter=A(e.renderCoordsHelper,r.center,r.eye):(C(I(x,a),r.ray,B),n.distance=Math.min(r.relativeElevation*J,d(r.eye,B)),n.tiltAtCenter=t(-f(r.viewForward,h(B,B)))),n.radius=a,n.eyeRadius=p(r.eye),n.constraints=e.state.constraints,n}function q(e){return Math.abs(e)>1e-9}function H(e){const{constraints:t,distance:r,tiltAtCenter:n}=e;let i=n,a=t.clampTilt(r,n);const s=D(e,a);if(t.clampTilt(s,n)===a)return a;let c=0;for(;c<10&&q(a-i);){const r=(i+a)/2,n=D(e,r);q(t.clampTilt(n,r)-r)?i=r:a=r,c++}return a}function D(e,t){if(!e.centerIsOnSurface)return e.distance;const i=Math.PI-r(t,0,Math.PI),a=n(e.radius/e.eyeRadius*Math.sin(i)),s=Math.PI-i-a,c=Math.sin(s)/Math.sin(i);if(e.eyeRadius<e.radius&&c>1){const t=Math.PI-a,r=Math.PI-i-t;return Math.sin(r)/Math.sin(i)*e.eyeRadius}return c*e.eyeRadius}function k(e,t){const r=n(e.radius/e.eyeRadius*Math.sin(e.tiltAtCenter)),i=n(e.radius/e.eyeRadius*Math.sin(t));return e.eyeRadius>e.radius?r-i:i-r}function F(e,t){return e.tiltAtCenter-Math.PI/2-(t-Math.PI/2)}function E(e,t,r){if(0===t.interactionType)return;const{interactionStartCamera:n,interactionFactor:i}=t;if(!n)return;const{min:a,max:s}=r,c=T(e,n,S,t),o=0===c?0:A(e.renderCoordsHelper,n.center,n.eye);r.min=a,r.max=s,2===t.interactionType?(v(t.selection,2)&&U(e,n,r),w(c,o,!0,i,G,r)):w(c,o,!1,i,G,r)}function U(e,r,n){const i=e.state.constraints;if(e.state.isLocal||!i.altitude||!r)return;const a=m(r.center),s=Math.sqrt(a),c=r.distance,o=y(e.spatialReference).radius,u=i.altitude.min+o,l=i.altitude.max+o,d=(u*u-c*c-a)/(-2*s*c),f=(l*l-c*c-a)/(-2*s*c);n.min=Math.max(n.min,Math.min(Math.PI-t(f),n.max)),n.max=Math.min(n.max,Math.PI-t(d))}const L=M(),z=s(),B=M(),G=i(5),J=30,K={min:0,max:0},N={constraints:null,radius:0,eyeRadius:0,centerIsOnSurface:!0,distance:0,tiltAtCenter:0},Q={eyeCenterDistance:0,requiresTwoSteps:!1};export{R as applyTiltConstraint,T as getTiltConstraintError};