@arcgis/core 5.0.0-next.45 → 5.0.0-next.47

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 (332) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/063045ac5553e91c0c4c.js +1 -0
  3. package/assets/esri/core/workers/chunks/{20ad34f9d45c64392022.js → 08c1ea29678da27136f3.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{5dc2f2e28c30386efadf.js → 10094eb2b94e98dd4a8a.js} +1 -1
  5. package/assets/esri/core/workers/chunks/108675a17e432a02cf66.js +1 -0
  6. package/assets/esri/core/workers/chunks/169be08394c5e7703628.js +1 -0
  7. package/assets/esri/core/workers/chunks/19270a2de33f2662005b.js +1 -0
  8. package/assets/esri/core/workers/chunks/1a6f3531ef3d671e0289.js +1 -0
  9. package/assets/esri/core/workers/chunks/{b809d499ff050976d9ed.js → 1c58064ea80e6a4a4a3b.js} +1 -1
  10. package/assets/esri/core/workers/chunks/1c816aff8613d1e4bf38.js +1 -0
  11. package/assets/esri/core/workers/chunks/{ee67c8a7c1f8b482cd99.js → 1ced78750c61600b2d4e.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{c5d6b416baf24e74b9ba.js → 1dfa949cc4f4c18ed4cf.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{98175b454e807b1a3c5f.js → 1e152a34e368bd810a0f.js} +1 -1
  14. package/assets/esri/core/workers/chunks/1e17ad6cdffa5016a3db.js +1 -0
  15. package/assets/esri/core/workers/chunks/1e2d42e9984ed3437ba2.js +1 -0
  16. package/assets/esri/core/workers/chunks/2008b22f76071a2dde4e.js +1 -0
  17. package/assets/esri/core/workers/chunks/2107c93d1fe87f3b8dfa.js +1 -0
  18. package/assets/esri/core/workers/chunks/2209550b6510e25da375.js +1 -0
  19. package/assets/esri/core/workers/chunks/229e1ed4282005aa0b83.js +1 -0
  20. package/assets/esri/core/workers/chunks/22b8eaa6afab0e5ffc47.js +1 -0
  21. package/assets/esri/core/workers/chunks/{1c0fb4795a52204882a8.js → 2550d2ba935cfdf30236.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{49e6219dd08cb6c27023.js → 273ac1066095d63d6a6f.js} +1 -1
  23. package/assets/esri/core/workers/chunks/2e2867bc66c94aba7dc7.js +1 -0
  24. package/assets/esri/core/workers/chunks/{cda5c95fd49b8901f7d4.js → 3298e96d3f2e49e338d2.js} +1 -1
  25. package/assets/esri/core/workers/chunks/34613b288cf174983f8b.js +1 -0
  26. package/assets/esri/core/workers/chunks/{e5baa30944061418cb13.js → 35f086a2ae0585348ae6.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{f441fc74451330384fb0.js → 37ea150dec5e491f691e.js} +1 -1
  28. package/assets/esri/core/workers/chunks/3c94db7ecdcd38eeb1b1.js +1 -0
  29. package/assets/esri/core/workers/chunks/3f7749f06ae54a4437d9.js +1 -0
  30. package/assets/esri/core/workers/chunks/404229f10aef5ac23c87.js +1 -0
  31. package/assets/esri/core/workers/chunks/40a722933af28823953b.js +1 -0
  32. package/assets/esri/core/workers/chunks/{7aa730e5ac7b268e3c98.js → 424daef7b5dec1b99aba.js} +1 -1
  33. package/assets/esri/core/workers/chunks/456684b1c1417ed0e611.js +1 -0
  34. package/assets/esri/core/workers/chunks/{d14e75b160aa432233c6.js → 461093ce28ceadd7853d.js} +1 -1
  35. package/assets/esri/core/workers/chunks/46b63a65484b102e9ccb.js +1 -0
  36. package/assets/esri/core/workers/chunks/4a48b8ec5f3f2fd139b5.js +1 -0
  37. package/assets/esri/core/workers/chunks/4b084f985bc4100e7aec.js +1 -0
  38. package/assets/esri/core/workers/chunks/4b1de1fcd13677b615a8.js +1 -0
  39. package/assets/esri/core/workers/chunks/{31186e83fe009aa0fd36.js → 4d933de84afb2e3b7d18.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{83aa39fbb1fad3b9d143.js → 4ff771942531fb2755c4.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{e0017c6739d2532793e6.js → 513a4ef960e27500f986.js} +1 -1
  42. package/assets/esri/core/workers/chunks/56b693baa376bb990925.js +1 -0
  43. package/assets/esri/core/workers/chunks/{1d4ea8db272655c0608c.js → 57fd5e1260269002d18a.js} +1 -1
  44. package/assets/esri/core/workers/chunks/5fe40bb0e9ab333f6854.js +1 -0
  45. package/assets/esri/core/workers/chunks/{9f6c63a580b28ab715bd.js → 5ffeb8fb58d59bad68c3.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{b56c07c0b43cb1999070.js → 60362c5651ef41fa7e5f.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{e8a9971c8354569cb81d.js → 609919428305d8c8c243.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{ab88577987cf2fe1cb32.js → 61373d2fa7e7638d3395.js} +1 -1
  49. package/assets/esri/core/workers/chunks/6202922b1c2637e9aaa5.js +1 -0
  50. package/assets/esri/core/workers/chunks/633368ae6fbb46373328.js +1 -0
  51. package/assets/esri/core/workers/chunks/657602e6a84e8b4576fb.js +1 -0
  52. package/assets/esri/core/workers/chunks/6d3ae7969ea86a2e0b13.js +1 -0
  53. package/assets/esri/core/workers/chunks/6d702cb26cef46a76963.js +1 -0
  54. package/assets/esri/core/workers/chunks/{35272810c2ed04eb403d.js → 6f3943bebe2d5f4994f7.js} +1 -1
  55. package/assets/esri/core/workers/chunks/708aba69a1870ea41a61.js +1 -0
  56. package/assets/esri/core/workers/chunks/{7ba13b52fce1060fbb2a.js → 7147fc7502b385b302b2.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{9ba8a2e1c0fb4e1efc7c.js → 7364fb5e99933533890d.js} +1 -1
  58. package/assets/esri/core/workers/chunks/74b1028e95f7cfff387b.js +1 -0
  59. package/assets/esri/core/workers/chunks/75d8244b725a2aee2003.js +1 -0
  60. package/assets/esri/core/workers/chunks/78fccea3445fb2f9120a.js +1 -0
  61. package/assets/esri/core/workers/chunks/7ba31425caa404f86424.js +1 -0
  62. package/assets/esri/core/workers/chunks/{a4f492aa5444e6381063.js → 7d631ebf8f79225cf0f6.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{040f3d8e1099c4843390.js → 81a60dfa600b690098f9.js} +1 -1
  64. package/assets/esri/core/workers/chunks/833fd2bc42c5cb459084.js +1 -0
  65. package/assets/esri/core/workers/chunks/{75643711d9585ee26a15.js → 83c8e5a92d8d6193cb32.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{e537e1d37f3fcb14fce2.js → 870022661376442411e4.js} +1 -1
  67. package/assets/esri/core/workers/chunks/898ab7db220e81e921c6.js +1 -0
  68. package/assets/esri/core/workers/chunks/{31b074ae2162a3508d2a.js → 8b578ffc3a83089aa782.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{48c8ef4170e803a564d6.js → 8b75861196d1ce5cba63.js} +1 -1
  70. package/assets/esri/core/workers/chunks/8be61e13530fd0dc2fd1.js +1 -0
  71. package/assets/esri/core/workers/chunks/90b8ccee883738917a6d.js +1 -0
  72. package/assets/esri/core/workers/chunks/90bc9c299ae0e8b8b5e5.js +1 -0
  73. package/assets/esri/core/workers/chunks/91d9ade78854f40a962d.js +1 -0
  74. package/assets/esri/core/workers/chunks/9319d57494482668ab19.js +1 -0
  75. package/assets/esri/core/workers/chunks/{74881340e040bfd0580f.js → 934bc1028b287f8df4aa.js} +1 -1
  76. package/assets/esri/core/workers/chunks/96055de47831e59a28bf.js +1 -0
  77. package/assets/esri/core/workers/chunks/963ba863e0f87abfca25.js +1 -0
  78. package/assets/esri/core/workers/chunks/9aa8d60483ad905fe13b.js +1 -0
  79. package/assets/esri/core/workers/chunks/9fed9946241bb2a5cfa4.js +1 -0
  80. package/assets/esri/core/workers/chunks/a2662e98857f0abf8e82.js +1 -0
  81. package/assets/esri/core/workers/chunks/a5a9b0a35849b9f2e86d.js +1 -0
  82. package/assets/esri/core/workers/chunks/a60006c9ccf6817fc0d2.js +1 -0
  83. package/assets/esri/core/workers/chunks/a627b7eb94b7fca33210.js +1 -0
  84. package/assets/esri/core/workers/chunks/a651dc3b8f1fc1ab34cc.js +1 -0
  85. package/assets/esri/core/workers/chunks/{bf5f9da0837ed09729c6.js → aab93e885b6c7c6aa76e.js} +1 -1
  86. package/assets/esri/core/workers/chunks/adfe28c1c1619cdd3ca1.js +1019 -0
  87. package/assets/esri/core/workers/chunks/b88dc7d8ae105747e6a4.js +1 -0
  88. package/assets/esri/core/workers/chunks/b90c786dd474ea1a409c.js +1 -0
  89. package/assets/esri/core/workers/chunks/b92e9e5df8154a128982.js +1 -0
  90. package/assets/esri/core/workers/chunks/{9a855a10798348a21bab.js → bff814d34b38ec80c44d.js} +1 -1
  91. package/assets/esri/core/workers/chunks/c36d699a75b6e8fb93eb.js +1 -0
  92. package/assets/esri/core/workers/chunks/c50fdf723f2d4316862e.js +1 -0
  93. package/assets/esri/core/workers/chunks/{9461cc37ab3397265270.js → c5e8ff4721b15ac3c6eb.js} +1 -1
  94. package/assets/esri/core/workers/chunks/{4cda42b94e9cb58dd372.js → ca61077e0a598654f33f.js} +1 -1
  95. package/assets/esri/core/workers/chunks/{61a9ffd4cf07d8bb7a9b.js → ca81be5bdb88ef557bf3.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{ca1c65eb7f5900c60170.js → cd8fec3500e6503ae020.js} +1 -1
  97. package/assets/esri/core/workers/chunks/ce90e8489143228262e7.js +1 -0
  98. package/assets/esri/core/workers/chunks/d0320ca67abca4f8b0d2.js +1 -0
  99. package/assets/esri/core/workers/chunks/{4b6a44c6265c8959abd8.js → d3db7244fac7398cc700.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{19820cddba13a3585c0b.js → d561624ddb9388732b25.js} +1 -1
  101. package/assets/esri/core/workers/chunks/d65ca3b8fccae8c3c3fa.js +1 -0
  102. package/assets/esri/core/workers/chunks/{630eba99f48ea79a9560.js → d705410c369bd03b1875.js} +1 -1
  103. package/assets/esri/core/workers/chunks/{9c7682b300b877f60095.js → d76513a6260d9ec4ea25.js} +1 -1
  104. package/assets/esri/core/workers/chunks/d82e17522ed946c2d809.js +1 -0
  105. package/assets/esri/core/workers/chunks/d8dc130ea559be1f68c6.js +1 -0
  106. package/assets/esri/core/workers/chunks/dae715b2b0094641e42f.js +1 -0
  107. package/assets/esri/core/workers/chunks/{768ae52b4e5c3e571ef5.js → dc29cb16704e2e4d0a46.js} +1 -1
  108. package/assets/esri/core/workers/chunks/e8c2e2fbe9cef4c8a8c6.js +1 -0
  109. package/assets/esri/core/workers/chunks/ecb4c223c0278971cdc9.js +1 -0
  110. package/assets/esri/core/workers/chunks/{3f33708eb39c7169a226.js → f2ba50eb29f93df885d6.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{6e5d41f51572e3e7cf92.js → f7163048146ddaedfc36.js} +1 -1
  112. package/assets/esri/core/workers/chunks/f92a78ce5510e0d0d0f7.js +1 -0
  113. package/assets/esri/core/workers/chunks/fa92a7c11befbad8739f.js +1 -0
  114. package/assets/esri/core/workers/chunks/fdaa10a588db394e2f65.js +1 -0
  115. package/chunks/Laserlines.glsl.js +1 -1
  116. package/chunks/boundedPlane.js +1 -1
  117. package/chunks/cameraUtilsSpherical.js +1 -1
  118. package/chunks/vec32.js +1 -1
  119. package/config.js +1 -1
  120. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  121. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  122. package/geometry/FlatGeometry.js +1 -1
  123. package/geometry/operators/support/apiConverter.js +1 -1
  124. package/geometry/operators/support/jsonConverter.js +1 -1
  125. package/geometry/support/curves/circleUtils.js +1 -1
  126. package/geometry/support/lineSegment.js +1 -1
  127. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  128. package/geometry/support/meshUtils/merge.js +1 -1
  129. package/geometry/support/sphere.js +1 -1
  130. package/interfaces.d.ts +179 -71
  131. package/kernel.js +1 -1
  132. package/layers/ParquetLayer.js +1 -1
  133. package/layers/VoxelWasmPerSceneView.js +1 -1
  134. package/layers/graphics/sources/ParquetSource.js +1 -1
  135. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  136. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  137. package/layers/support/{ParquetEncodingBase.js → ParquetGeometryEncodingBase.js} +1 -1
  138. package/layers/support/ParquetGeometryEncodingLocation.d.ts +4 -0
  139. package/layers/support/ParquetGeometryEncodingLocation.js +5 -0
  140. package/layers/support/ParquetGeometryEncodingWkb.d.ts +4 -0
  141. package/layers/support/ParquetGeometryEncodingWkb.js +5 -0
  142. package/layers/support/parquetEncodingUtils.js +1 -1
  143. package/layers/support/parquetUtils.js +1 -1
  144. package/layers/support/tiles3DUtils.js +1 -1
  145. package/layers/voxel/VoxelVolume.js +1 -1
  146. package/libs/parquet/parquet.js +1 -1
  147. package/package.json +2 -2
  148. package/support/revision.js +1 -1
  149. package/symbols/cim/effects/EffectSuppress.js +1 -1
  150. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  151. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  152. package/views/2d/interactive/SegmentLabels2D.js +1 -1
  153. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  154. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  155. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  156. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  157. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  158. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  159. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  160. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
  161. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  162. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  163. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  164. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  165. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  166. package/views/3d/camera/constraintUtils/distance.js +1 -1
  167. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  168. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  169. package/views/3d/environment/CloudsParameters.js +1 -1
  170. package/views/3d/environment/EnvironmentManager.js +1 -1
  171. package/views/3d/environment/MarsAtmosphere.js +1 -1
  172. package/views/3d/glTF/internal/Resource.js +1 -1
  173. package/views/3d/glTF/loader.js +1 -1
  174. package/views/3d/interactive/SegmentLabels3D.js +1 -1
  175. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  176. package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
  177. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  178. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  179. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  180. package/views/3d/layers/I3SMeshView3D.js +1 -1
  181. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  182. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  183. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  184. package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
  185. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  186. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  187. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  188. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  189. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  190. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  191. package/views/3d/state/Frustum.js +1 -1
  192. package/views/3d/state/controllers/FovController.js +1 -1
  193. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  194. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  195. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  196. package/views/3d/support/cameraUtils.js +1 -1
  197. package/views/3d/support/intersectionUtils.js +1 -1
  198. package/views/3d/support/orientedBoundingBox.js +1 -1
  199. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  200. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  201. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  202. package/views/3d/support/viewpointUtils.js +1 -1
  203. package/views/3d/terrain/OverlayManager.js +1 -1
  204. package/views/3d/terrain/PatchRenderData.js +1 -1
  205. package/views/3d/terrain/SphericalPatch.js +1 -1
  206. package/views/3d/terrain/Tile.js +1 -1
  207. package/views/3d/webgl/RenderCamera.js +1 -1
  208. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  209. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  210. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  211. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  212. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  213. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  214. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  215. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  216. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  217. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  218. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  219. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  220. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  221. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  222. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  223. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  224. package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
  225. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
  226. package/views/SelectionManager.js +1 -1
  227. package/views/draw/support/Reshape.js +1 -1
  228. package/views/interactive/GraphicManipulator.js +1 -1
  229. package/views/interactive/coordinateHelper.js +1 -1
  230. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  231. package/views/interactive/sketch/constraints.js +1 -1
  232. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  233. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  234. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  235. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  236. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  237. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  238. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  239. package/views/support/geometry3dUtils.js +1 -1
  240. package/views/support/selectionUtils.js +1 -1
  241. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  242. package/widgets/BatchAttributeForm/css.js +1 -1
  243. package/widgets/BatchAttributeForm/inputs/SingleFeatureInput.d.ts +4 -0
  244. package/widgets/BatchAttributeForm/inputs/SingleFeatureInput.js +5 -0
  245. package/widgets/BatchAttributeForm/inputs/TextElementInput.d.ts +4 -0
  246. package/widgets/BatchAttributeForm/inputs/TextElementInput.js +5 -0
  247. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  248. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  249. package/widgets/BatchAttributeForm/templates/GroupElementTemplate.js +1 -1
  250. package/widgets/BatchAttributeForm/templates/TextElementTemplate.js +5 -0
  251. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  252. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  253. package/widgets/BatchAttributeForm/templates/support/templateUtils.js +1 -1
  254. package/widgets/BatchAttributeForm.js +1 -1
  255. package/widgets/Editor/support/SketchController.js +1 -1
  256. package/widgets/FeatureForm/TextElementInput.d.ts +2 -2
  257. package/widgets/FeatureForm/TextElementInput.js +1 -1
  258. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  259. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  260. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  261. package/widgets/OrientedImageryViewer.js +1 -1
  262. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  263. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  264. package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
  265. package/widgets/PanoramicViewer/support/PanoramicMedia.js +5 -0
  266. package/widgets/PanoramicViewer/support/PanoramicMediaCollection.js +5 -0
  267. package/widgets/PanoramicViewer/support/PanoramicMediaError.js +5 -0
  268. package/widgets/PanoramicViewer/utils.js +1 -1
  269. package/widgets/PanoramicViewer.js +1 -1
  270. package/widgets/Search/SearchViewModel.js +1 -1
  271. package/widgets/Search.js +1 -1
  272. package/widgets/Sketch.js +1 -1
  273. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  274. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  275. package/assets/esri/core/workers/chunks/024104997daea0d74b38.js +0 -1
  276. package/assets/esri/core/workers/chunks/04a0685ee53ef74883aa.js +0 -1
  277. package/assets/esri/core/workers/chunks/08ef90e3fcfd4eda4301.js +0 -1
  278. package/assets/esri/core/workers/chunks/1e0e7cef7ef947894bbe.js +0 -1019
  279. package/assets/esri/core/workers/chunks/20988e116f3723228f36.js +0 -1
  280. package/assets/esri/core/workers/chunks/2613e482450b57f2d4f5.js +0 -1
  281. package/assets/esri/core/workers/chunks/274f2b5e6dbc58505142.js +0 -1
  282. package/assets/esri/core/workers/chunks/27dfbe3d903b95d4c67a.js +0 -1
  283. package/assets/esri/core/workers/chunks/28a5a7c6b3d6902146f6.js +0 -1
  284. package/assets/esri/core/workers/chunks/2c4218306747f5d15575.js +0 -1
  285. package/assets/esri/core/workers/chunks/2d3ae187f8aa3495d4ae.js +0 -1
  286. package/assets/esri/core/workers/chunks/2db7a7607657f1d669f7.js +0 -1
  287. package/assets/esri/core/workers/chunks/2f8cf7d9ff1f4de19a4c.js +0 -1
  288. package/assets/esri/core/workers/chunks/338570424337be05cef5.js +0 -1
  289. package/assets/esri/core/workers/chunks/36130910ba141f34531b.js +0 -1
  290. package/assets/esri/core/workers/chunks/3767617c0dfc7d801441.js +0 -1
  291. package/assets/esri/core/workers/chunks/44b6b7418cbf7f778bef.js +0 -1
  292. package/assets/esri/core/workers/chunks/4675ed3ca3e0104d00bf.js +0 -1
  293. package/assets/esri/core/workers/chunks/4df7cc3477bc46fc39af.js +0 -1
  294. package/assets/esri/core/workers/chunks/538ddb267aa328814865.js +0 -1
  295. package/assets/esri/core/workers/chunks/555a0ea44ba77819d493.js +0 -1
  296. package/assets/esri/core/workers/chunks/55818fe7a7aa1e5c8bbd.js +0 -1
  297. package/assets/esri/core/workers/chunks/59889855d23baec1adf9.js +0 -1
  298. package/assets/esri/core/workers/chunks/5f781ef46ce7c4048c2f.js +0 -1
  299. package/assets/esri/core/workers/chunks/60f2de8dd8876bfd715a.js +0 -1
  300. package/assets/esri/core/workers/chunks/679088064420a906aa7f.js +0 -1
  301. package/assets/esri/core/workers/chunks/706423d801fa9cbf2e90.js +0 -1
  302. package/assets/esri/core/workers/chunks/71dd80231ea656a6380c.js +0 -1
  303. package/assets/esri/core/workers/chunks/725819839434c59102f3.js +0 -1
  304. package/assets/esri/core/workers/chunks/72cebf18da5ec5eeb666.js +0 -1
  305. package/assets/esri/core/workers/chunks/768d9b6eaba7bfa18dde.js +0 -1
  306. package/assets/esri/core/workers/chunks/77b45957cfe42523c1c8.js +0 -1
  307. package/assets/esri/core/workers/chunks/852de585a72d902344a6.js +0 -1
  308. package/assets/esri/core/workers/chunks/871dd5e1f016a04b8d98.js +0 -1
  309. package/assets/esri/core/workers/chunks/892c417f5130b003889d.js +0 -1
  310. package/assets/esri/core/workers/chunks/8d4cc5f1d07b4aa3aea0.js +0 -1
  311. package/assets/esri/core/workers/chunks/907083c427d7fb4354e9.js +0 -1
  312. package/assets/esri/core/workers/chunks/93c5f097bb7b380bb175.js +0 -1
  313. package/assets/esri/core/workers/chunks/9f0172b83f25ef5f8d40.js +0 -1
  314. package/assets/esri/core/workers/chunks/a00bba1c7cbf8cd7892c.js +0 -1
  315. package/assets/esri/core/workers/chunks/a34a14fd989dbbd3c2d0.js +0 -1
  316. package/assets/esri/core/workers/chunks/ae793d814cf32db9fbde.js +0 -1
  317. package/assets/esri/core/workers/chunks/b21cf62652ca772108c8.js +0 -1
  318. package/assets/esri/core/workers/chunks/c5c02ace54fe4ab9214b.js +0 -1
  319. package/assets/esri/core/workers/chunks/c82a974c8448407885e6.js +0 -1
  320. package/assets/esri/core/workers/chunks/d0014b4a8c013f59b113.js +0 -1
  321. package/assets/esri/core/workers/chunks/d08ee45c501102deea20.js +0 -1
  322. package/assets/esri/core/workers/chunks/d239a4ef60e348cfb05a.js +0 -1
  323. package/assets/esri/core/workers/chunks/da2ba40bc017bff0fe49.js +0 -1
  324. package/assets/esri/core/workers/chunks/dc3a4ad62bc041a4f899.js +0 -1
  325. package/assets/esri/core/workers/chunks/e093e745708f722bc1b9.js +0 -1
  326. package/assets/esri/core/workers/chunks/e501d68a1464805c4b4e.js +0 -1
  327. package/assets/esri/core/workers/chunks/e6784251bbb8b71ead93.js +0 -1
  328. package/assets/esri/core/workers/chunks/f3c232fc56a29d51196a.js +0 -1
  329. package/layers/support/ParquetEncodingLocation.d.ts +0 -4
  330. package/layers/support/ParquetEncodingLocation.js +0 -5
  331. package/layers/support/ParquetEncodingWkb.d.ts +0 -4
  332. package/layers/support/ParquetEncodingWkb.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{prefersReducedMotion as i}from"../core/a11yUtils.js";import{createTask as a}from"../core/asyncUtils.js";import o from"../core/Collection.js";import{deprecatedProperty as s}from"../core/deprecate.js";import n from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as l,initial as d,syncAndInitial as c,whenOnce as g}from"../core/reactiveUtils.js";import{property as h,subclass as m}from"../core/accessorSupport/decorators.js";import{or as u}from"../layers/orientedImagery/transformations/utils.js";import v from"./Expand.js";import p from"./PanoramicVideoViewer.js";import y from"./PanoramicViewer.js";import w from"./Widget.js";import{getAllArcPath as _}from"./OrientedImageryViewer/arcUtils.js";import{getDelegatedEvents as M,defaultImageGeometryField as T,defaultOIObjectIDField as b,segmentArcs as C,featureCircleRadius as A,navigationToolDimensionLength as I,sectorsRadii as f}from"./OrientedImageryViewer/constants.js";import{css as L,navigation as V,navigationToolRotationFrom as k,navigationToolRotationTo as S,root as O}from"./OrientedImageryViewer/css.js";import{loadImageForAttachment as F,getThumbnailPixelBlock as E,isFeatureAttachment as P,renderImageWithRotation as x}from"./OrientedImageryViewer/galleryUtils.js";import H from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import N from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import{loadAlertComponents as j,Alert as D}from"./OrientedImageryViewer/components/Alert.js";import G from"./OrientedImageryViewer/components/ImageLocationWidget.js";import $ from"./OrientedImageryViewer/components/ImageViewer.js";import B from"./OrientedImageryViewer/components/NavigationAction.js";import{loadNavigationActionsComponents as R,NavigationActionsCollection as W,NavigationActions as U}from"./OrientedImageryViewer/components/NavigationActions.js";import{loadVideoEnhancementComponents as z,renderEnhancementSlider as q,VideoEnhancementTools as Z}from"./OrientedImageryViewer/components/VideoEnhancementTools.js";import{NoImageLoadedError as J}from"./OrientedImageryViewer/navigation/errors.js";import{loadCalciteComponents as K}from"./support/componentsUtils.js";import{globalCss as Q}from"./support/globalCss.js";import{vmEvent as X,messageBundle as Y,tsx as ee}from"./support/widget.js";const te={overlayed:"overlayed"};let ie=class extends w{constructor(e,t){super(e,t),this.dataCaptureEnabled=!1,this.galleryOpened=!1,this.imageEnhancementToolActive=!1,this.videoEnhancementToolActive=!1,this.imageOverlaysOpened=!1,this.navigationToolActive=!1,this.viewModel=new H,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters",this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new N,this._imageOverlaysLoaderTask=null,this._imageMeasurementToolsLoaderTask=null,this._navigationSettingsLoaderTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.triangularMeasurementActive=!1,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1,this.triangularMeasurementActive=!1},this._navigationToolExpanded=!1,this._navigationTool=null,this._galleryController=new AbortController,this._galleryObserver=new IntersectionObserver(this._lazyLoadImage.bind(this)),this._overlayedLayers=new o,this._previousAction=null,this._handleDataCaptureLayerChange=async e=>{if(this.dataCaptureLayer&&await this.stopDataCapture(!0),this.dataCaptureLayer=this.dataCaptureLayer===e?null:e,this.dataCaptureLayer)return this.startDataCapture(this.dataCaptureLayer)},this._handleNavigationSettingsInputChange=(e,t)=>{this.set(`${e}Threshold`,t)},this._handleNavigationSettingsToggle=e=>{this.viewModel.preserveAngle=e},this._handleOverlayLayerDeselect=e=>{const t=e.layer;t===this.dataCaptureLayer&&(this.stopDataCapture(),this.dataCaptureLayer=null),this.removeOverlayedGraphicsOnImage(`${t.id}`)},this._handleOverlayLayerSelect=e=>{const t=e.layer;this.viewModel.overlayMapFeatures(t,this.showMapFeatures),this.addHandles(l(()=>t.visible,()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible,this.showMapFeatures)}),`${te.overlayed}-${t.id}`)},this._highlight=e=>{const t=e.target?.dataset.objectid;t&&this.viewModel.highlight(t)},this._onAction=e=>{const{target:t}=e,{dataset:{action:i}}=t,{_previousAction:a}=this,o=a?.dataset.action,s=o?.includes("draw")??!1,n="select-feature"===o,r=o!==i;switch(i){case"draw-point":case"draw-polygon":case"draw-polyline":{a&&u(n,s&&r)&&(a.active=!1),t.active=!t.active;const e=i.replace("draw-","");this.viewModel.digitizeCreate(e),this._previousAction=t.active?t:null;break}case"save":this.viewModel.saveDrawing();break;case"select-feature":s&&(this._previousAction.active=!1),t.active=!t.active,this.viewModel.toggleSelection(t.active),this._previousAction=t.active?t:null;break;case"delete-feature":this.viewModel.digitizeDelete()}},this._onImageOverlayClosed=()=>{this.imageOverlaysOpened=!1},this._onShowCameraLocationsChanged=e=>{this.showCameraLocations=e},this._onShowMapFeaturesChanged=e=>{this.showMapFeatures=e},this._removeHighlight=()=>this.viewModel.removeHighlight(),this._restoreOverlays=async()=>Promise.all(this._overlayedLayers.map(e=>this.viewModel.overlayMapFeatures(e,this.showMapFeatures))),this._scaleNavigationTool=()=>{this._navigationToolExpanded=!this._navigationToolExpanded},this._sketchLoaderTask=null,this._settingsToggle=null,this._toggleImageNavigation=async e=>{const t=this.navigationMode;this._closeAllImageTools(),this.navigationMode=t!==e?e:null;const{activeViewer:i}=this.viewModel;if(!i)return;const{mode:a,preserveAngle:o}=this.viewModel;if("default"===a)if("directional"===this.navigationMode){const e=await this._loadNavigationSettings(),t="heading"===o||"both"===o,i="pitch"===o||"both"===o,{messages:a,messagesCommon:s}=this,n=new e({cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold,uiStrings:{configureNavigation:a.configureNavigation,preserveHeading:a.preserveHeading,preserveHeadingDescription:a.preserveHeadingDescription,preservePitch:a.preservePitch,preservePitchDescription:a.preservePitchDescription,settings:s.settings,thresholdLabel:a.thresholdLabel},onInputChange:this._handleNavigationSettingsInputChange,onToggle:this._handleNavigationSettingsToggle,preserveHeading:t,preservePitch:i});this._settingsToggle=new v({content:n,expandIcon:"configure"}),this.viewModel.activeViewer?.ui.add(this._settingsToggle,{position:"top-left"})}else this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))},this._toggleImageAttributes=()=>{this.viewModel.toggleImageAttributes()},this.navigate=async e=>{let t=null;try{const{currentNode:i}=this.viewModel;if(!i)throw new J;t=await this.viewModel.navigate(i,e)}catch(i){r(i)||n.getLogger(this).error("Error occurred while navigating",i)}return t},this.reset=()=>{this._closeAllImageTools(),this.viewModel.reset()},this._loadImageFromGallery=this._loadImageFromGallery.bind(this),this._registerGalleryItem=this._registerGalleryItem.bind(this),this._unregisterGalleryItem=this._unregisterGalleryItem.bind(this),this.loadImageFromSource=this.loadImageFromSource.bind(this),this.updateSuitabilities=this.updateSuitabilities.bind(this),this._handleVideoBrightnessChange=this._handleVideoBrightnessChange.bind(this),this._handleVideoContrastChange=this._handleVideoContrastChange.bind(this),this._handleBrightnessChange=this._handleBrightnessChange.bind(this),this._handleContrastChange=this._handleContrastChange.bind(this),this._handleSharpnessChange=this._handleSharpnessChange.bind(this),this._resetVideoTools=this._resetVideoTools.bind(this),this._toggleEnhancementToolState=this._toggleEnhancementToolState.bind(this)}initialize(){this.addHandles([l(()=>[this.viewModel?.bestFeatureAngle,this._navigationTool],([e,t])=>{t&&this._updateNavigationTool(t)},d),l(()=>this.currentCoverageVisible,e=>this._onCurrentCoverageVisibilityChange(e)),l(()=>this.isAdditionalCoverageVisible,e=>this._onAdditionalCoverageVisibilityChange(e)),l(()=>this.isAdditionalPointSourcesVisible,e=>this._onAdditionalCameraLocationsVisibility(e)),l(()=>({features:this.currentBestFeature,showCameraLocations:this.showCameraLocations,state:this.viewModel.state}),({showCameraLocations:e,state:t})=>{"image-loaded"===t&&this.viewModel.overlayCameraLocations(e)},c),l(()=>({feature:this.currentBestFeature,showMapFeatures:this.showMapFeatures,state:this.viewModel.state}),async(e,t)=>{if(e.showMapFeatures!==t?.showMapFeatures&&this.viewModel.toggleAllOverlayMapFeatures(e.showMapFeatures),null!=e.feature&&e.feature!==t?.feature){if(this.viewModel.removeAllOverlayMapFeatures(),await g(()=>"image-loaded"===this.viewModel.state),this.dataCaptureLayer&&this.stopDataCapture(),await this._restoreOverlays(),!this.dataCaptureLayer)return;await this.startDataCapture(this.dataCaptureLayer),this._previousAction?.active&&(this._previousAction.active=!1,this._previousAction=null)}},d)])}loadDependencies(){return Promise.all([R(),z(),K({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),shell:()=>import("@esri/calcite-components/dist/components/calcite-shell"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")}),j()])}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect(),this.currentBestFeature=null}get accuracyParametersMissing(){return this.viewModel.accuracyParametersMissing}get activeLayer(){return s(n.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){s(n.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get activeVideoIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?t.videoPaused?"play":"pause":"play"}get activeAudioIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?.videoMuted?"sound-off":"sound"}get cameraHeadingThreshold(){return this.viewModel.cameraHeadingThreshold}set cameraHeadingThreshold(e){this.viewModel.cameraHeadingThreshold=e}get cameraPitchThreshold(){return this.viewModel.cameraPitchThreshold}set cameraPitchThreshold(e){this.viewModel.cameraPitchThreshold=e}get canNavigateSequentially(){const{layer:e}=this;if(!e)return!1;const{fields:t,sequenceOrderField:i}=e;return t.some(({name:e})=>e.toLowerCase()===`${i??"sequenceorder"}`.toLowerCase())}get currentBestFeature(){return this.viewModel.currentBestFeature}set currentBestFeature(e){this.viewModel.currentBestFeature=e}get currentCoverageVisible(){return this.viewModel.currentCoverageVisible}set currentCoverageVisible(e){this.viewModel.currentCoverageVisible=e}get dataCaptureLayer(){return this.viewModel.dataCaptureLayer}set dataCaptureLayer(e){this.viewModel.dataCaptureLayer=e}get depthImageNotSupported(){return this.viewModel.depthImageNotSupported}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get displayMessage(){return this.viewModel.displayMessage}get enhancementToolActive(){return"video"===this.viewModel.mode?this.videoEnhancementToolActive:this.imageEnhancementToolActive}set enhancementToolActive(e){"video"===this.viewModel.mode?this.videoEnhancementToolActive=e:this.imageEnhancementToolActive=e}get features(){return this.viewModel.features}get imagePointsInView(){return this.viewModel.imagePointsInView}get icon(){return"oriented-imagery-widget"}set icon(e){this._overrideIfSome("icon",e)}get imageGalleryEnabled(){return this.viewModel.imageGalleryEnabled}get imageLocationToolActive(){return this.viewModel.imageLocationToolState}set imageLocationToolActive(e){this.viewModel.imageLocationToolState=e}get invalidCameraHeading(){return this.viewModel.invalidCameraHeading}get isAdditionalCoverageVisible(){return this.viewModel.isAdditionalCoverageVisible}set isAdditionalCoverageVisible(e){this.viewModel.isAdditionalCoverageVisible=e}get isAdditionalPointSourcesVisible(){return this.viewModel.isAdditionalPointSourcesVisible}set isAdditionalPointSourcesVisible(e){this.viewModel.isAdditionalPointSourcesVisible=e}get mapImageConversionToolState(){return this.viewModel.mapImageConversionToolState}set mapImageConversionToolState(e){this.viewModel.mapImageConversionToolState=e}get measureType(){return this.viewModel.measureType}set measureType(e){this.viewModel.measureType=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get navigationMode(){return this.viewModel.navigationMode}set navigationMode(e){this.viewModel.navigationMode=e}get popupEnabled(){const{popupEnabled:e,state:t}=this.viewModel;return("image-loaded"===t||this.videoLoaded)&&e}get referencePoint(){return this.viewModel.referencePoint??null}get sketchViewModel(){return this.viewModel.sketch}get triangularMeasurementActive(){return this.viewModel.triangularMeasurementActive}set triangularMeasurementActive(e){this.viewModel.triangularMeasurementActive=e}get videoLoaded(){const{mode:e,videoElement:t,panoramicVideoLoaded:i}=this.viewModel;return("video"===e&&!0===t?.loaded||i)??!1}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set determineWorkflowForFeature(e){this.viewModel.determineWorkflowForFeature=e}get determineWorkflowForFeature(){return this.viewModel.determineWorkflowForFeature}set updateFootprint(e){this.viewModel.updateFootprint=e}get updateFootprint(){return this.viewModel.updateFootprint}_renderActionBar(){return ee("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},ee("calcite-action-group",null,this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle()),ee("calcite-action-group",null,this._directionToolToggle(),this._mapImageConversionToggle(),this._navigationToolToggle(),this._imageEnhancementsToggle(),this._videoEnhancementsToggle()),ee("calcite-action-group",null,this._measurementToolsToggle(),this._imageGalleryToggle(),this._imageOverlaysToggle(),this._openPopupAction()))}get _activeMeasurementIcon(){const{measureType:e,imageLocationToolActive:t,triangularMeasurementActive:i}=this;if(t)return i?"dual-image-location":"pin-tear";if(i)return"area"===e?"dual-image-area":"dual-image-distance";switch(e){case"area":return"measure-area";case"height":return"measure-building-height-top-base";default:return"measure-line"}}get _activeMeasurementHeading(){const{measureType:e,messages:t,triangularMeasurementActive:i}=this,{groundArea:a,heightAboveGround:o,groundDistance:s,triangulatedAreaHeading:n,triangulatedDistanceHeading:r}=t;if(i)return"area"===e?n:r;switch(e){case"area":return a;case"height":return o;default:return s}}_additionalFootprintToggle(){const{isAdditionalCoverageVisible:e,invalidCameraHeading:t,visibleElements:{additionalFootprintToggle:i}}=this;return i?ee("calcite-action",{active:e,bind:this,class:L.addCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleAdditionalCoverage,text:this.messages.additionalFootprints,title:this.messages.additionalFootprints}):null}_additionalPointSourcesToggle(){const{isAdditionalPointSourcesVisible:e,invalidCameraHeading:t,visibleElements:{additionalCameraLocationsToggle:i}}=this;return i?ee("calcite-action",{active:e,bind:this,class:L.addExpPoints,disabled:t,icon:"circle-area",onclick:this._toggleAdditionalCameraLocations,text:this.messages.additionalCameraLocations,title:this.messages.additionalCameraLocations}):null}get _measurementToggle(){const{viewModel:{state:e,measureType:t,currentBestFeatureMeasurementImage:i},triangularMeasurementActive:a,id:o}=this;if("image-loaded"!==e||!t||a&&!i)return;this._imageMeasurementToolsLoaderTask||this._loadImageMeasurementResources();const s=this._imageMeasurementToolsLoaderTask?.value;return s?ee("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:this._activeMeasurementHeading,id:`${o}-${t}-measurement`,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearMeasurements},ee(s,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _renderRoot(){const{viewModel:{state:e},triangularMeasurementActive:t}=this;return ee("calcite-panel",{bind:this,class:t?L.viewerContainerMeasurement:L.viewerContainer,heading:this.visibleElements.title?this.messages.title:void 0,loading:e.includes("loading")&&!t},this.visibleElements.menu?this._renderActionBar():null,ee("calcite-shell",null,ee("calcite-panel",null,this._imageViewer,this._panoramicViewer,this._panoramicVideoViewer,this._videoViewer,this._messageBox,this.invalidCameraHeading?null:[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel()],this._imageEnhancementTools,this._videoEnhancementTools,this._renderSketch()),this._imageViewerTriangular,this._measurementToggle,this._locationToggle,this.invalidCameraHeading?this._renderWarning(this.messages.invalidCameraHeadingWarningTitle,this.messages.invalidCameraHeadingWarningDescription):null,this.depthImageNotSupported?this._renderWarning(this.messages.depthImageNotSupportedTitle,this.messages.depthImageNotSupportedDescription):null))}_currentFootprintToggle(){const{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:i}=this.visibleElements;return i?ee("calcite-action",{active:e,bind:this,class:L.currentCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleCurrentCoverage,text:this.messages.currentFootprint,title:this.messages.currentFootprint}):null}get _imageEnhancementTools(){const{enhancementToolActive:e,viewModel:{brightness:t,contrast:i,sharpness:a,state:o}}=this;return e&&"image-loaded"===o?ee("calcite-panel",{bind:this,class:L.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleEnhancementToolState},ee("div",{class:L.imageEnhancementTools},q({title:this.messages.brightness,value:t,max:10,min:-10,ticks:5,handleChange:this._handleBrightnessChange}),q({title:this.messages.contrast,value:i,max:10,min:-10,ticks:5,handleChange:this._handleContrastChange}),q({title:this.messages.sharpness,value:a,max:1,min:0,ticks:.5,step:.1,handleChange:this._handleSharpnessChange})),ee("calcite-action",{bind:this,icon:"reset",onclick:this._resetImageTools,slot:"header-actions-end",text:this.messagesCommon.reset,title:this.messagesCommon.reset})):null}get _videoEnhancementTools(){const{enhancementToolActive:e,viewModel:{videoViewModel:t,mode:i},messages:{videoEnhancement:a,brightness:o,contrast:s},messagesCommon:{reset:n}}=this;return e&&"video"===i&&t?ee(Z,{brightness:t.videoBrightness,constrast:t.videoContrast,handleBrightnessChange:this._handleVideoBrightnessChange,handleContrastChange:this._handleVideoContrastChange,resetTools:this._resetVideoTools,uiStrings:{videoEnhancement:a,brightness:o,contrast:s,reset:n},videoEnhancementToolActive:e,onClose:this._toggleEnhancementToolState}):null}_imageEnhancementsToggle(){const{state:e,mode:t}=this.viewModel,{imageEnhancement:i}=this.visibleElements;return i&&"video"!==t?ee("calcite-action",{active:this.enhancementToolActive,bind:this,disabled:"default"!==t||"image-loaded"!==e,icon:"sliders-horizontal",onclick:this._toggleEnhancementToolState,text:this.messages.imageEnhancement,title:this.messages.imageEnhancement}):null}_videoEnhancementsToggle(){const{mode:e}=this.viewModel,{videoEnhancement:t}=this.messages;return"video"===e?ee("calcite-action",{active:this.enhancementToolActive,bind:this,disabled:"video"!==e,icon:"sliders-horizontal",onclick:this._toggleEnhancementToolState,text:t,title:t}):null}get _imageGalleryPanel(){const{container:e,galleryOpened:t,imageGalleryEnabled:i}=this;return i&&t&&e?this._imageGalleryContext:null}get _imageGalleryContext(){const{galleryOpened:e,invalidCameraHeading:t}=this;return ee("calcite-panel",{bind:this,class:L.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},ee("div",{class:L.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){const{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:i}}=this;return i?ee("calcite-action",{active:this.galleryOpened,bind:this,disabled:!e||t,icon:"images",onclick:this._toggleImageGallery,text:this.messages.imageGallery,title:this.messages.imageGallery}):null}get _imageOverlaysComponent(){const{_imageOverlayMessages:e,_imageOverlaysLoaderTask:t,_overlayedLayers:i,dataCaptureEnabled:o,dataCaptureLayer:s,imageOverlaysOpened:n,showCameraLocations:r,showMapFeatures:l,view:d,layer:c}=this;if(!c)return null;const g=c.imageGeometryField?.length?c.imageGeometryField:T,h=c.imageReferenceField?.length?c.imageReferenceField:b;t||(this._imageOverlaysLoaderTask=a(async()=>(await import("./OrientedImageryViewer/components/ImageOverlays.js")).default));const m=this._imageOverlaysLoaderTask?.value;return m?ee(m,{closed:!n,dataCaptureEnabled:o,dataCaptureLayer:s,imageGeometryField:g,imageReferenceField:h,messages:e,overlayedLayers:i,showCameraLocations:r,showMapFeatures:l,view:d,onDataCaptureLayerChanged:this._handleDataCaptureLayerChange,onFilterCapturedFeatures:this.viewModel.filterCapturedFeatures,onImageOverlaysClosed:this._onImageOverlayClosed,onLayerDeselected:this._handleOverlayLayerDeselect,onLayerSelected:this._handleOverlayLayerSelect,onShowCameraLocationsChanged:this._onShowCameraLocationsChanged,onShowMapFeaturesChanged:this._onShowMapFeaturesChanged}):null}get _imageOverlayMessages(){return{...this.messages,...this.messagesSketch}}get _imageSketchToolsMessages(){return{...this.messagesSketch,...this.messagesCommon}}_imageOverlaysPanel(){const{imageOverlaysOpened:e,viewModel:{state:t}}=this,i=this.classes({[L.imageOverlaysContainer]:!0,[Q.hidden]:!e||"image-loaded"!==t});return ee("div",{class:i,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){const{viewModel:{state:e},imageOverlaysOpened:t,invalidCameraHeading:i,visibleElements:{imageOverlays:a}}=this;return a?ee("calcite-action",{active:t,bind:this,disabled:"image-loaded"!==e||i,icon:"layers",onclick:this._toggleImageOverlays,text:this.messages.imageOverlays,title:this.messages.imageOverlays}):null}get _imageViewer(){const{displayMessage:e,loadImageViewer:t,mode:i,clickAction:a,state:o}=this.viewModel,s=null!=e||"default"!==i||o.includes("loading"),{messages:{end:n,next:r,previous:l,start:d}}=this;return ee($,{afterCreate:t,clickAction:a,navigationEnabled:!s&&null!==this.navigationMode,navigationViewModel:this.viewModel,uiStrings:{end:n,next:r,previous:l,start:d},visible:!s})}get _imageViewerTriangular(){const{messages:e,triangularMeasurementActive:t}=this,{displayMessage:i,storeImageMeasurementViewer:a,storePanoramicMeasurementViewer:o,mode:s,state:n,clickAction:r}=this.viewModel,l=null!=i||"none"===s||"video"===s,d=this.classes({[L.viewer]:!l,[L.viewerHidden]:l});return t?ee("calcite-panel",{class:L.viewerContainerMeasurement,heading:e.measurementViewerHeading,loading:n.includes("loading")},ee("calcite-panel",{bind:this,class:d},"default"===s?ee($,{afterCreate:a,clickAction:r,uiStrings:e}):ee(y,{afterCreate:o,clickAction:r,uiStrings:e}))):null}get _videoViewer(){const{mode:e,loadVideoViewer:t,videoViewModel:i}=this.viewModel,{control:a,reset:o}=this.messagesCommon,{mute:s,unmute:n}=this.messages,r="video"!==e,l=this.classes({[L.viewer]:!r,[L.viewerHidden]:r}),d="esri-image-viewer";return ee("calcite-panel",{bind:this,class:l},ee("calcite-panel",{afterCreate:t,class:this.classes(Q.widget,d)}),ee("calcite-slider",{bind:this,labelHandles:!0,labelTicks:!0,max:i?.videoDuration,minLabel:"0",value:i?.currentTime??0,onCalciteSliderChange:this._handleVideoSeek}),ee("calcite-action-bar",{expandDisabled:!0,layout:"horizontal"},ee("calcite-action-group",null,ee("calcite-action",{bind:this,icon:this.activeVideoIcon,onclick:()=>i?.playVideoHandler(),text:"Play",title:i?.videoPaused?a.play:a.pause})),ee("calcite-action-group",null,ee("calcite-action",{bind:this,icon:"refresh",onclick:()=>i?.rewindVideoHandler(),text:"Rewind",title:o})),ee("calcite-action-group",null,ee("calcite-action",{bind:this,icon:this.activeAudioIcon,onclick:()=>i?.toggleAudio(),text:"Audio",title:i?.videoMuted?s:n}))))}get _locationToggle(){const{viewModel:{state:e,groundCoordinates:t,groundCoordinatesAccuracy:i,triangulatedPoint:a},imageLocationToolActive:o,triangularMeasurementActive:s,messages:{groundLocation:n,triangulatedLocationHeading:r}}=this;if("image-loaded"!==e||!t||!o)return;let l=t;if(s){if(!a)return;l=a}return ee("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:s?r:n,id:n,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearImageLocation},ee(G,{accuracy:i,groundCoordinates:l,messages:this.messages}))}_mapImageConversionToggle(){const{mapImageConversionToolState:e,viewModel:{state:t,disabled:i},invalidCameraHeading:a,visibleElements:{mapImageConversionTool:o}}=this;return o?ee("calcite-action",{active:e,bind:this,disabled:"image-loaded"!==t||a||i,icon:"image-pin",onclick:this._toggleMapImageConversionToolState,text:this.messages.mapImageConversionTool,title:this.messages.mapImageConversionTool}):null}_measurementToolsToggle(){const{_activeMeasurementIcon:e,measureType:t,viewModel:i,accuracyParametersMissing:a,messages:o,triangularMeasurementActive:s,visibleElements:{measurementTools:n}}=this,{state:r}=i,{measurementTools:l,groundDistance:d,groundArea:c,heightAboveGround:g,groundLocation:h,triangulatedDistanceHeading:m,triangulatedAreaHeading:u,triangulatedLocationHeading:v}=o;return n?ee("calcite-dropdown",{disabled:a,key:"measurement-tools",maxItems:5,title:l,width:"m"},ee("calcite-action",{bind:this,disabled:"image-loaded"!==r||a,icon:e,slot:"trigger",text:l}),ee("calcite-dropdown-group",null,ee("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-line",key:"distance-measurement",onclick:e=>this._toggleMeasurementSketch(e,"distance"),selected:"distance"===t&&!s},d),ee("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-area",key:"area-measurement",onclick:e=>this._toggleMeasurementSketch(e,"area"),selected:"area"===t&&!s},c),ee("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-building-height-top-base",key:"height-dropdown",onclick:e=>this._toggleMeasurementSketch(e,"height"),selected:"height"===t},g),ee("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"pin-tear",key:"surface-location",onclick:this._toggleLocationTool,selected:!!this.imageLocationToolActive&&!s},h),ee("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"dual-image-location",key:"triangular-location",selected:!!s&&this.imageLocationToolActive,onCalciteDropdownItemSelect:this._toggleTriangularLocation},v),ee("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"dual-image-distance",key:"triangular-measurement-distance",selected:!!s&&"distance"===this.measureType,onCalciteDropdownItemSelect:this._toggleTriangularDistanceMeasurements},m),ee("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"dual-image-area",key:"triangular-measurement-area",selected:!!s&&"area"===this.measureType,onCalciteDropdownItemSelect:this._toggleTriangularAreaMeasurements},u))):null}get _messageBox(){const{messages:e,viewModel:{displayMessage:i,mode:a}}=this;if(!i||"video"===a)return null;const{data:o,key:s,map:n}=i,r=`${n?t(e[s],n):e[s]}`;return ee("span",{class:L.messageBox},o?`${r} ${o}`:r)}async _loadNavigationSettings(){return this._navigationSettingsLoaderTask||(this._navigationSettingsLoaderTask=a(async()=>(await import("./OrientedImageryViewer/components/NavigationSettings.js")).default)),await this._navigationSettingsLoaderTask.promise}_navigationToolToggle(){const{state:e}=this.viewModel,{visibleElements:{navigationTool:t},videoLoaded:i}=this;return t?ee("calcite-action",{active:this.navigationToolActive,bind:this,disabled:"image-loaded"!==e&&!i||this.invalidCameraHeading,icon:"explore",onclick:this._toggleNavigationTool,text:this.messages.navigationTool,title:this.messages.navigationTool}):null}_directionToolToggle(){const{state:e}=this.viewModel,{visibleElements:{directionalNavigation:t,sequentialNavigation:i}}=this,a=new W;t&&a.push(new B({active:"directional"===this.navigationMode,disabled:"image-loaded"!==e||this.invalidCameraHeading,icon:"directional-navigation",onclick:()=>{this._toggleImageNavigation("directional")},text:this.messages.directionalNavigation,title:this.messages.directionalNavigationDescription})),i&&a.push(new B({active:"sequential"===this.navigationMode,disabled:"image-loaded"!==e||this.invalidCameraHeading||!this.canNavigateSequentially,icon:"sequential-navigation",onclick:()=>{this._toggleImageNavigation("sequential")},text:this.messages.sequentialNavigation,title:this.messages.sequentialNavigationDescription}));return t||i?ee(U,{actions:a,activeAction:a.items.find(e=>e.active),icon:"absolute-direction",label:this.messages.imageNavigation,scale:"m",title:this.messages.imageNavigation}):null}_openPopupAction(){const{showPopupsAction:e}=this.visibleElements;return e?ee("calcite-action",{bind:this,disabled:!this.popupEnabled,icon:"popup",onclick:this._toggleImageAttributes,text:this.messages.showPopups,title:this.messages.showPopups}):null}get _panoramicVideoViewer(){const{displayMessage:e,loadPanoramicVideoViewer:t,mode:i,clickAction:a,state:o,currentBestFeature:s}=this.viewModel,n=s?.attributes.imagePath,r=null!=e||"panoramic-video"!==i||o.includes("loading")||!n;return ee(p,{afterCreate:t,clickAction:a,oiViewModel:this.viewModel,videoSource:n,visible:!r})}get _panoramicViewer(){const{displayMessage:e,loadPanoramicViewer:t,mode:i,clickAction:a,state:o}=this.viewModel,{messages:{end:s,next:n,previous:r,start:l}}=this,d=null!=e||"panoramic"!==i||o.includes("loading");return ee(y,{afterCreate:t,clickAction:a,navigationEnabled:!d&&null!==this.navigationMode,navigationViewModel:this.viewModel,uiStrings:{end:s,next:n,previous:r,start:l},visible:!d})}_activateTriangulatedImageLocationTool(){this.navigationToolActive=!0,this.imageLocationToolActive=!0}_activateTriangulatedImageLocationWorkflow(e,t){this._closeAllImageTools(),this.imageLocationToolActive=!0,this.triangularMeasurementActive=!e,this.navigationToolActive=!!t||!t}_closeImageToolsAndToggleNavigation(e,t){this._closeAllImageTools(),this.triangularMeasurementActive=!e,this.navigationToolActive=!t}_resetMeasureTypeAndActivateImageLocationTool(){this.measureType=null,this.imageLocationToolActive=!0}_closeAllImageTools(){this.enhancementToolActive=!1,this.navigationToolActive=!1,this.imageOverlaysOpened=!1,this.galleryOpened=!1,this.measureType=null,this.imageLocationToolActive=!1,this.navigationMode=null,this.triangularMeasurementActive=!1,this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))}_handleBrightnessChange(e){this.viewModel.brightness=e.currentTarget.value??0}_handleVideoBrightnessChange(e){this.viewModel.videoViewModel?.handleVideoBrightnessChange(e.target.value)}_handleContrastChange(e){this.viewModel.contrast=e.currentTarget.value??0}_handleVideoContrastChange(e){this.viewModel.videoViewModel?.handleVideoContrastChange(e.target.value)}_handleVideoSeek(e){const t=this.viewModel?.videoElement?.content;t&&(t.currentTime=e.target.value,t.play())}_handleSharpnessChange(e){this.viewModel.sharpness=e.currentTarget.value??0}_lazyLoadImage(e,t){e.forEach(async e=>{if(e.isIntersecting){const a=e.target,o=a.getAttribute("data-src"),s=a.getAttribute("data-rotation"),l=a.getAttribute("data-objectid"),d=s?parseFloat(s)%360:0,{layer:c,_galleryController:{signal:g}}=this;if(!o||!l)return;let h;try{h=P(o)?await F(c,l,{signal:g}):await E(o,{signal:g})}catch(i){r(i)||n.getLogger("esri.widgets.OrientedImageryViewer").error("#lazyLoadImage()",i)}finally{t.unobserve(a)}if(!h)return;x(h,a,d)}})}_loadImageFromGallery(e){const{target:t}=e;if(!t)return;const i=t.getAttribute("data-objectid");i&&this.viewModel.currentBestFeature?.attributes.objectId!==Number(i)&&this.viewModel.selectBestFeature(i)}_loadImageMeasurementResources(){this._imageMeasurementToolsLoaderTask=a(async()=>{const{default:e}=await import("./OrientedImageryViewer/components/ImageMeasurementWidget.js");return e})}_loadSketchResources(){this._sketchLoaderTask=a(async()=>(await import("./OrientedImageryViewer/components/SketchTools.js")).default)}_onAdditionalCoverageVisibilityChange(e){this.viewModel.setAdditionalCoverageVisibility(e)}_onAdditionalCameraLocationsVisibility(e){this.viewModel.setAdditionalCameraLocationsVisibility(e)}_onCurrentCoverageVisibilityChange(e){this.viewModel.setCurrentCoverageVisibility(e)}_registerGalleryItem(e){this._galleryObserver.observe(e)}_renderWarning(e,t){const{viewModel:{state:i}}=this;return"image-loaded"===i?ee(D,{icon:"exclamation-mark-triangle-f",kind:"warning",message:t,open:!0,title:e,tooltip:t}):null}get _renderNavigation(){const{viewModel:{sectorData:e,navigatorCurrentBestFeature:t,currentBestFeature:a,state:o}}=this;if(!this.container||!a)return null;let s,n,r,l,d;if(t){const{x:e,y:i,direction:a}=t,[o,c,g,h]=C[a];s=`M ${e} ${i} L ${o} ${c} A ${f[2]} ${f[2]} 0 0 1 ${g} ${h} Z`,n=e,l=i,r=C[a][4],d=C[a][5]}const c=e=>{const t=e.target.dataset?.sector;t&&this.viewModel.handleSectorClick(+t)},g=e=>{const t=e.target.dataset;if(!t)return;const{featureIndexInSector:i,sector:a}=t;i&&a&&this.viewModel.handleFeatureClick({sector:a,featureIndexInSector:+i})},h=e=>{e.removeEventListener("click",g)},m=a.attributes.objectId,u=e?.map(e=>e?.items).filter(Boolean).flatMap(e=>e?.map(({x:e,y:t,objectID:i,featureIndexInSector:a,sector:o})=>ee("circle",{afterRemoved:h,class:this.classes(L.feature,{selected:m===i}),cx:e,cy:t,"data-feature-index-in-sector":a,"data-sector":o,key:`${L.feature}-${i}`,onclick:g,r:A}))),v=e=>{e.removeEventListener("click",c)},p=this.classes({[L.navigationWrapper]:!0,[L.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&("image-loaded"===o||this.videoLoaded)?ee("div",{bind:this,class:p,key:this.messages.navigationTool},ee("svg",{afterCreate:e=>this._storeNavigationToolReference(e),class:i()?V:L.rotateWithAnimation,focusable:"false",height:I,role:"img",width:I,xmlns:"http://www.w3.org/2000/svg"},ee("defs",null,ee("linearGradient",{gradientUnits:"userSpaceOnUse",id:`${this.id}-coverage-fill`,x1:n,x2:r,y1:l,y2:d},ee("stop",{class:L.navigationPathOffset0,offset:0}),ee("stop",{class:L.navigationPathOffset1,offset:1}))),ee("g",null,ee("circle",{class:this.classes(L.sector,L.outerSector),cx:f[3],cy:f[3],onclick:this._scaleNavigationTool,r:f[3]}),ee("circle",{class:L.sector,cx:f[3],cy:f[3],r:f[2]}),ee("circle",{class:L.sector,cx:f[3],cy:f[3],r:f[1]}),ee("circle",{class:L.sector,cx:f[3],cy:f[3],r:f[0]}),ee("path",{class:L.pointer,d:"M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z",key:`${L.pointer}-west`}),ee("path",{class:this.classes(L.pointer,L.north),d:"M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z",key:`${L.pointer}-north`}),ee("path",{class:L.pointer,d:"M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z",key:`${L.pointer}-east`}),ee("path",{class:L.pointer,d:"M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z",key:`${L.pointer}-south`}),ee("path",{class:this.classes(L.sector,L.sectorSeparator),d:"M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076",key:L.sectorSeparator}),_([f[2],f[1],f[0]],f[3],f[3]).map((t,i)=>ee("path",{afterRemoved:v,class:this.classes(L.sector,e?.[i]?.length?L.sectorEnabled:L.sectorDisabled),d:t,"data-sector":`${i}`,key:`${L.sector}-${i}`,onclick:c})),ee("path",{class:this.classes(L.sector,L.sectorCross),d:"M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53",key:L.sectorCross}),u,a.attributes.cameraPitch>=5&&s?ee("path",{class:L.selectedFeaturePath,d:s,fill:`url(#${this.id}-coverage-fill)`,key:L.selectedFeaturePath}):null))):null}_renderSketch(){const{dataCaptureLayer:e,imageOverlaysOpened:t}=this;if(!e||t)return null;if(this._sketchLoaderTask||this._loadSketchResources(),!this._sketchLoaderTask?.value)return null;const{geometryType:i}=e,a="point"===i?"pin":"polyline"===i?"line":"polygon",o=this._sketchLoaderTask.value;return ee("div",{class:L.sketchTools},ee(o,{icon:a,messages:this._imageSketchToolsMessages,type:i,onAction:this._onAction}))}get _renderThumbnails(){const{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?ee("div",{class:L.carouselContent},t?.items.map(({url:t,objectId:i,rotation:a},o)=>ee("div",{class:`${L.carouselItemWrapper}${e.attributes.objectId===i?"--selected":""}`,key:`${L.carouselItemWrapper}-${o}`},ee("canvas",{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${i}`,class:L.carouselItem,"data-objectid":`${i}`,"data-rotation":`${a}`,"data-src":t,onclick:this._loadImageFromGallery,onmouseenter:this._highlight,onmouseleave:this._removeHighlight})))):null}_resetImageTools(){this.viewModel.sharpness=this.viewModel.brightness=this.viewModel.contrast=0}_resetVideoTools(){this.viewModel.videoViewModel?.resetVideoEnhancementTools()}_storeNavigationToolReference(e){this._navigationTool=e}_toggleAdditionalCameraLocations(){this.isAdditionalPointSourcesVisible=!this.isAdditionalPointSourcesVisible}_toggleAdditionalCoverage(){this.isAdditionalCoverageVisible=!this.isAdditionalCoverageVisible}_toggleCurrentCoverage(){this.currentCoverageVisible=!this.currentCoverageVisible}_toggleEnhancementToolState(e){e.stopPropagation();const t=this.enhancementToolActive;this._closeAllImageTools(),this.enhancementToolActive=!t}_toggleImageOverlays(e){e.stopPropagation();const t=this.imageOverlaysOpened;this._closeAllImageTools(),this.imageOverlaysOpened=!t}_toggleImageGallery(e){e.stopPropagation();const t=this.galleryOpened;this._closeAllImageTools(),this.galleryOpened=!!this.imageGalleryEnabled&&!t}_toggleLocationTool(e){const t=this.imageLocationToolActive,i=this.triangularMeasurementActive&&t;this._closeAllImageTools(),this.imageLocationToolActive=i||!t,e.stopPropagation()}_toggleMeasurementSketch(e,t){e.stopPropagation();const i=this.measureType,a=this.triangularMeasurementActive;this._closeAllImageTools(),this.measureType=i!==t||a?t:null,this.measureType===t&&(this.viewModel.displayNewMeasurementButton=!0)}_toggleNavigationTool(){const e=this.navigationToolActive;this._closeAllImageTools(),this.navigationToolActive=!e}_toggleMapImageConversionToolState(){this.mapImageConversionToolState=!this.mapImageConversionToolState}_toggleTriangularAreaMeasurements(){this._toggleTriangularMeasurements("area")}_toggleTriangularDistanceMeasurements(){this._toggleTriangularMeasurements("distance")}_toggleTriangularLocation(){const e=this.triangularMeasurementActive,t=this.navigationToolActive;e?null===this.measureType?this.imageLocationToolActive?this._closeImageToolsAndToggleNavigation(e,t):this._activateTriangulatedImageLocationTool():this._resetMeasureTypeAndActivateImageLocationTool():this._activateTriangulatedImageLocationWorkflow(e,t)}_toggleTriangularMeasurements(e){const t=this.triangularMeasurementActive,i=this.viewModel.measureType,a=this.navigationToolActive;t?e===i?(this._closeAllImageTools(),this.triangularMeasurementActive=!t,this.navigationToolActive=!a):(this.imageLocationToolActive=!1,this.measureType=e):(this._closeAllImageTools(),this.measureType=e,this.triangularMeasurementActive=!t,this.navigationToolActive=!!a||!a)}_unregisterGalleryItem(e){this._galleryObserver.unobserve(e)}_updateNavigationTool(e){const{previousFeatureAngle:t,bestFeatureAngle:i}=this.viewModel,a=(i-t+540)%360-180;e.style.setProperty(k,`${t}deg`),e.style.setProperty(S,`${t+a}deg`)}async loadBestImage(e){return this.viewModel.loadBestImage(e)}loadImageFromSource(e,t){return this.viewModel.loadImageFromSource(e,t)}async overlayMapFeatures(e,t){return this.removeHandles(`${te.overlayed}-${e.id}`),this.addHandles(l(()=>e.visible,()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible,this.showMapFeatures)}),`${te.overlayed}-${e.id}`),this._overlayedLayers.add(e),this.viewModel.overlayMapFeatures(e,t&&this.showMapFeatures)}async plotMapPoint(e){return this.viewModel.plotMapPoint(e)}plotReferencePointOnGround(e){this.viewModel.plotReferencePointOnGround(e)}plotReferencePointOnImage(e){this.viewModel.plotReferencePointOnImage(e)}removeOverlayedGraphicsOnImage(e){this.removeHandles(`${te.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find(t=>t.id===e)),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return ee("div",{class:this.classes(Q.widget,O)},this._renderRoot)}async showImageByObjectId(e,t){return this.viewModel.showImageByObjectId(e,t)}async startDataCapture(e){return this.viewModel.startDataCapture(e)}async stopDataCapture(e){return this.viewModel.stopDataCapture(e)}updateSuitabilities(e){this.viewModel.updateSuitabilities(e)}};e([h({readOnly:!0})],ie.prototype,"accuracyParametersMissing",null),e([h()],ie.prototype,"activeLayer",null),e([h()],ie.prototype,"activeVideoIcon",null),e([h()],ie.prototype,"activeAudioIcon",null),e([h()],ie.prototype,"cameraHeadingThreshold",null),e([h()],ie.prototype,"cameraPitchThreshold",null),e([h()],ie.prototype,"canNavigateSequentially",null),e([h()],ie.prototype,"currentBestFeature",null),e([h()],ie.prototype,"currentCoverageVisible",null),e([h()],ie.prototype,"dataCaptureEnabled",void 0),e([h()],ie.prototype,"dataCaptureLayer",null),e([h()],ie.prototype,"depthImageNotSupported",null),e([h()],ie.prototype,"disabled",null),e([h()],ie.prototype,"enhancementToolActive",null),e([h()],ie.prototype,"features",null),e([h()],ie.prototype,"imagePointsInView",null),e([h()],ie.prototype,"galleryOpened",void 0),e([h()],ie.prototype,"icon",null),e([h()],ie.prototype,"imageEnhancementToolActive",void 0),e([h()],ie.prototype,"videoEnhancementToolActive",void 0),e([h({readOnly:!0})],ie.prototype,"imageGalleryEnabled",null),e([h()],ie.prototype,"imageLocationToolActive",null),e([h()],ie.prototype,"imageOverlaysOpened",void 0),e([h({readOnly:!0})],ie.prototype,"invalidCameraHeading",null),e([h()],ie.prototype,"isAdditionalCoverageVisible",null),e([h()],ie.prototype,"isAdditionalPointSourcesVisible",null),e([h()],ie.prototype,"mapImageConversionToolState",null),e([h()],ie.prototype,"measureType",null),e([h()],ie.prototype,"layer",null),e([h()],ie.prototype,"navigationToolActive",void 0),e([h()],ie.prototype,"navigationMode",null),e([X(M()),h({type:H})],ie.prototype,"viewModel",void 0),e([h(),Y("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],ie.prototype,"messages",void 0),e([h(),Y("esri/core/t9n/Units")],ie.prototype,"measurementUnitMessages",void 0),e([h(),Y("esri/t9n/common")],ie.prototype,"messagesCommon",void 0),e([h(),Y("esri/widgets/Sketch/t9n/Sketch")],ie.prototype,"messagesSketch",void 0),e([h()],ie.prototype,"pixelMeasurementUnit",void 0),e([h()],ie.prototype,"pixelAreaMeasurementUnit",void 0),e([h({readOnly:!0})],ie.prototype,"popupEnabled",null),e([h()],ie.prototype,"referencePoint",null),e([h()],ie.prototype,"showCameraLocations",void 0),e([h()],ie.prototype,"showMapFeatures",void 0),e([X(["create","delete","redo","undo","update"]),h({readOnly:!0})],ie.prototype,"sketchViewModel",null),e([h()],ie.prototype,"triangularMeasurementActive",null),e([h()],ie.prototype,"videoLoaded",null),e([h()],ie.prototype,"view",null),e([h({type:N,nonNullable:!0})],ie.prototype,"visibleElements",void 0),e([h()],ie.prototype,"determineWorkflowForFeature",null),e([h()],ie.prototype,"updateFootprint",null),e([h()],ie.prototype,"_activeMeasurementIcon",null),e([h()],ie.prototype,"_activeMeasurementHeading",null),e([h()],ie.prototype,"_imageOverlaysLoaderTask",void 0),e([h()],ie.prototype,"_imageMeasurementToolsLoaderTask",void 0),e([h()],ie.prototype,"_navigationSettingsLoaderTask",void 0),e([h()],ie.prototype,"_measurementToggle",null),e([h()],ie.prototype,"_renderRoot",null),e([h()],ie.prototype,"_imageEnhancementTools",null),e([h()],ie.prototype,"_videoEnhancementTools",null),e([h()],ie.prototype,"_imageGalleryPanel",null),e([h()],ie.prototype,"_imageGalleryContext",null),e([h()],ie.prototype,"_imageOverlaysComponent",null),e([h()],ie.prototype,"_imageOverlayMessages",null),e([h()],ie.prototype,"_imageSketchToolsMessages",null),e([h()],ie.prototype,"_imageViewer",null),e([h()],ie.prototype,"_imageViewerTriangular",null),e([h()],ie.prototype,"_videoViewer",null),e([h()],ie.prototype,"_locationToggle",null),e([h()],ie.prototype,"_messageBox",null),e([h()],ie.prototype,"_navigationToolExpanded",void 0),e([h()],ie.prototype,"_navigationTool",void 0),e([h()],ie.prototype,"_panoramicVideoViewer",null),e([h()],ie.prototype,"_panoramicViewer",null),e([h()],ie.prototype,"_renderNavigation",null),e([h()],ie.prototype,"_renderThumbnails",null),e([h()],ie.prototype,"_sketchLoaderTask",void 0),ie=e([m("esri.widgets.OrientedImageryViewer")],ie);const ae=ie;export{ae as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{prefersReducedMotion as i}from"../core/a11yUtils.js";import{createTask as a}from"../core/asyncUtils.js";import o from"../core/Collection.js";import{deprecatedProperty as s}from"../core/deprecate.js";import n from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as l,initial as d,syncAndInitial as c,whenOnce as g}from"../core/reactiveUtils.js";import{property as h,subclass as m}from"../core/accessorSupport/decorators.js";import{or as u}from"../layers/orientedImagery/transformations/utils.js";import v from"./Expand.js";import p from"./PanoramicVideoViewer.js";import y from"./PanoramicViewer.js";import w from"./Widget.js";import{getAllArcPath as _}from"./OrientedImageryViewer/arcUtils.js";import{getDelegatedEvents as M,defaultImageGeometryField as T,defaultOIObjectIDField as b,segmentArcs as C,featureCircleRadius as A,navigationToolDimensionLength as I,sectorsRadii as f}from"./OrientedImageryViewer/constants.js";import{css as L,navigation as V,navigationToolRotationFrom as k,navigationToolRotationTo as S,root as O}from"./OrientedImageryViewer/css.js";import{loadImageForAttachment as F,getThumbnailPixelBlock as E,isFeatureAttachment as P,renderImageWithRotation as x}from"./OrientedImageryViewer/galleryUtils.js";import H from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import N from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import{loadAlertComponents as j,Alert as D}from"./OrientedImageryViewer/components/Alert.js";import G from"./OrientedImageryViewer/components/ImageLocationWidget.js";import $ from"./OrientedImageryViewer/components/ImageViewer.js";import B from"./OrientedImageryViewer/components/NavigationAction.js";import{loadNavigationActionsComponents as R,NavigationActionsCollection as W,NavigationActions as U}from"./OrientedImageryViewer/components/NavigationActions.js";import{loadVideoEnhancementComponents as z,renderEnhancementSlider as q,VideoEnhancementTools as Z}from"./OrientedImageryViewer/components/VideoEnhancementTools.js";import{NoImageLoadedError as J}from"./OrientedImageryViewer/navigation/errors.js";import{loadCalciteComponents as K}from"./support/componentsUtils.js";import{globalCss as Q}from"./support/globalCss.js";import{vmEvent as X,messageBundle as Y,tsx as ee}from"./support/widget.js";const te={overlayed:"overlayed"};let ie=class extends w{constructor(e,t){super(e,t),this.dataCaptureEnabled=!1,this.galleryOpened=!1,this.imageEnhancementToolActive=!1,this.videoEnhancementToolActive=!1,this.imageOverlaysOpened=!1,this.navigationToolActive=!1,this.viewModel=new H,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters",this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new N,this._imageOverlaysLoaderTask=null,this._imageMeasurementToolsLoaderTask=null,this._navigationSettingsLoaderTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.triangularMeasurementActive=!1,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1,this.triangularMeasurementActive=!1},this._navigationToolExpanded=!1,this._navigationTool=null,this._galleryController=new AbortController,this._galleryObserver=new IntersectionObserver(this._lazyLoadImage.bind(this)),this._overlayedLayers=new o,this._previousAction=null,this._handleDataCaptureLayerChange=async e=>{if(this.dataCaptureLayer&&await this.stopDataCapture(!0),this.dataCaptureLayer=this.dataCaptureLayer===e?null:e,this.dataCaptureLayer)return this.startDataCapture(this.dataCaptureLayer)},this._handleNavigationSettingsInputChange=(e,t)=>{this.set(`${e}Threshold`,t)},this._handleNavigationSettingsToggle=e=>{this.viewModel.preserveAngle=e},this._handleOverlayLayerDeselect=e=>{const t=e.layer;t===this.dataCaptureLayer&&(this.stopDataCapture(),this.dataCaptureLayer=null),this.removeOverlayedGraphicsOnImage(`${t.id}`)},this._handleOverlayLayerSelect=e=>{const t=e.layer;this.viewModel.overlayMapFeatures(t,this.showMapFeatures),this.addHandles(l(()=>t.visible,()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible,this.showMapFeatures)}),`${te.overlayed}-${t.id}`)},this._highlight=e=>{const t=e.target?.dataset.objectid;t&&this.viewModel.highlight(t)},this._onAction=e=>{const{target:t}=e,{dataset:{action:i}}=t,{_previousAction:a}=this,o=a?.dataset.action,s=o?.includes("draw")??!1,n="select-feature"===o,r=o!==i;switch(i){case"draw-point":case"draw-polygon":case"draw-polyline":{a&&u(n,s&&r)&&(a.active=!1),t.active=!t.active;const e=i.replace("draw-","");this.viewModel.digitizeCreate(e),this._previousAction=t.active?t:null;break}case"save":this.viewModel.saveDrawing();break;case"select-feature":s&&(this._previousAction.active=!1),t.active=!t.active,this.viewModel.toggleSelection(t.active),this._previousAction=t.active?t:null;break;case"delete-feature":this.viewModel.digitizeDelete()}},this._onImageOverlayClosed=()=>{this.imageOverlaysOpened=!1},this._onShowCameraLocationsChanged=e=>{this.showCameraLocations=e},this._onShowMapFeaturesChanged=e=>{this.showMapFeatures=e},this._removeHighlight=()=>this.viewModel.removeHighlight(),this._restoreOverlays=async()=>Promise.all(this._overlayedLayers.map(e=>this.viewModel.overlayMapFeatures(e,this.showMapFeatures))),this._scaleNavigationTool=()=>{this._navigationToolExpanded=!this._navigationToolExpanded},this._sketchLoaderTask=null,this._settingsToggle=null,this._toggleImageNavigation=async e=>{const t=this.navigationMode;this._closeAllImageTools(),this.navigationMode=t!==e?e:null;const{activeViewer:i}=this.viewModel;if(!i)return;const{mode:a,preserveAngle:o}=this.viewModel;if("default"===a)if("directional"===this.navigationMode){const e=await this._loadNavigationSettings(),t="heading"===o||"both"===o,i="pitch"===o||"both"===o,{messages:a,messagesCommon:s}=this,n=new e({cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold,uiStrings:{configureNavigation:a.configureNavigation,preserveHeading:a.preserveHeading,preserveHeadingDescription:a.preserveHeadingDescription,preservePitch:a.preservePitch,preservePitchDescription:a.preservePitchDescription,settings:s.settings,thresholdLabel:a.thresholdLabel},onInputChange:this._handleNavigationSettingsInputChange,onToggle:this._handleNavigationSettingsToggle,preserveHeading:t,preservePitch:i});this._settingsToggle=new v({content:n,expandIcon:"configure"}),this.viewModel.activeViewer?.ui.add(this._settingsToggle,{position:"top-left"})}else this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))},this._toggleImageAttributes=()=>{this.viewModel.toggleImageAttributes()},this.navigate=async e=>{let t=null;try{const{currentNode:i}=this.viewModel;if(!i)throw new J;t=await this.viewModel.navigate(i,e)}catch(i){r(i)||n.getLogger(this).error("Error occurred while navigating",i)}return t},this.reset=()=>{this._closeAllImageTools(),this.viewModel.reset()},this._loadImageFromGallery=this._loadImageFromGallery.bind(this),this._registerGalleryItem=this._registerGalleryItem.bind(this),this._unregisterGalleryItem=this._unregisterGalleryItem.bind(this),this.loadImageFromSource=this.loadImageFromSource.bind(this),this.updateSuitabilities=this.updateSuitabilities.bind(this),this._handleVideoBrightnessChange=this._handleVideoBrightnessChange.bind(this),this._handleVideoContrastChange=this._handleVideoContrastChange.bind(this),this._handleBrightnessChange=this._handleBrightnessChange.bind(this),this._handleContrastChange=this._handleContrastChange.bind(this),this._handleSharpnessChange=this._handleSharpnessChange.bind(this),this._resetVideoTools=this._resetVideoTools.bind(this),this._toggleEnhancementToolState=this._toggleEnhancementToolState.bind(this)}initialize(){this.addHandles([l(()=>[this.viewModel?.bestFeatureAngle,this._navigationTool],([e,t])=>{t&&this._updateNavigationTool(t)},d),l(()=>this.currentCoverageVisible,e=>this._onCurrentCoverageVisibilityChange(e)),l(()=>this.isAdditionalCoverageVisible,e=>this._onAdditionalCoverageVisibilityChange(e)),l(()=>this.isAdditionalPointSourcesVisible,e=>this._onAdditionalCameraLocationsVisibility(e)),l(()=>({features:this.currentBestFeature,showCameraLocations:this.showCameraLocations,state:this.viewModel.state}),({showCameraLocations:e,state:t})=>{"image-loaded"===t&&this.viewModel.overlayCameraLocations(e)},c),l(()=>({feature:this.currentBestFeature,showMapFeatures:this.showMapFeatures,state:this.viewModel.state}),async(e,t)=>{if(e.showMapFeatures!==t?.showMapFeatures&&await this.viewModel.toggleAllOverlayMapFeatures(e.showMapFeatures),null!=e.feature&&e.feature!==t?.feature){if(this.viewModel.removeAllOverlayMapFeatures(),await g(()=>"image-loaded"===this.viewModel.state),this.dataCaptureLayer&&this.stopDataCapture(),await this._restoreOverlays(),!this.dataCaptureLayer)return;await this.startDataCapture(this.dataCaptureLayer),this._previousAction?.active&&(this._previousAction.active=!1,this._previousAction=null)}},d)])}loadDependencies(){return Promise.all([R(),z(),K({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),shell:()=>import("@esri/calcite-components/dist/components/calcite-shell"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")}),j()])}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect(),this.currentBestFeature=null}get accuracyParametersMissing(){return this.viewModel.accuracyParametersMissing}get activeLayer(){return s(n.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){s(n.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get activeVideoIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?t.videoPaused?"play":"pause":"play"}get activeAudioIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?.videoMuted?"sound-off":"sound"}get cameraHeadingThreshold(){return this.viewModel.cameraHeadingThreshold}set cameraHeadingThreshold(e){this.viewModel.cameraHeadingThreshold=e}get cameraPitchThreshold(){return this.viewModel.cameraPitchThreshold}set cameraPitchThreshold(e){this.viewModel.cameraPitchThreshold=e}get canNavigateSequentially(){const{layer:e}=this;if(!e)return!1;const{fields:t,sequenceOrderField:i}=e;return t.some(({name:e})=>e.toLowerCase()===`${i??"sequenceorder"}`.toLowerCase())}get currentBestFeature(){return this.viewModel.currentBestFeature}set currentBestFeature(e){this.viewModel.currentBestFeature=e}get currentCoverageVisible(){return this.viewModel.currentCoverageVisible}set currentCoverageVisible(e){this.viewModel.currentCoverageVisible=e}get dataCaptureLayer(){return this.viewModel.dataCaptureLayer}set dataCaptureLayer(e){this.viewModel.dataCaptureLayer=e}get depthImageNotSupported(){return this.viewModel.depthImageNotSupported}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get displayMessage(){return this.viewModel.displayMessage}get enhancementToolActive(){return"video"===this.viewModel.mode?this.videoEnhancementToolActive:this.imageEnhancementToolActive}set enhancementToolActive(e){"video"===this.viewModel.mode?this.videoEnhancementToolActive=e:this.imageEnhancementToolActive=e}get features(){return this.viewModel.features}get imagePointsInView(){return this.viewModel.imagePointsInView}get icon(){return"oriented-imagery-widget"}set icon(e){this._overrideIfSome("icon",e)}get imageGalleryEnabled(){return this.viewModel.imageGalleryEnabled}get imageLocationToolActive(){return this.viewModel.imageLocationToolState}set imageLocationToolActive(e){this.viewModel.imageLocationToolState=e}get invalidCameraHeading(){return this.viewModel.invalidCameraHeading}get isAdditionalCoverageVisible(){return this.viewModel.isAdditionalCoverageVisible}set isAdditionalCoverageVisible(e){this.viewModel.isAdditionalCoverageVisible=e}get isAdditionalPointSourcesVisible(){return this.viewModel.isAdditionalPointSourcesVisible}set isAdditionalPointSourcesVisible(e){this.viewModel.isAdditionalPointSourcesVisible=e}get mapImageConversionToolState(){return this.viewModel.mapImageConversionToolState}set mapImageConversionToolState(e){this.viewModel.mapImageConversionToolState=e}get measureType(){return this.viewModel.measureType}set measureType(e){this.viewModel.measureType=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get navigationMode(){return this.viewModel.navigationMode}set navigationMode(e){this.viewModel.navigationMode=e}get popupEnabled(){const{popupEnabled:e,state:t}=this.viewModel;return("image-loaded"===t||this.videoLoaded)&&e}get referencePoint(){return this.viewModel.referencePoint??null}get sketchViewModel(){return this.viewModel.sketch}get triangularMeasurementActive(){return this.viewModel.triangularMeasurementActive}set triangularMeasurementActive(e){this.viewModel.triangularMeasurementActive=e}get videoLoaded(){const{mode:e,videoElement:t,panoramicVideoLoaded:i}=this.viewModel;return("video"===e&&!0===t?.loaded||i)??!1}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set determineWorkflowForFeature(e){this.viewModel.determineWorkflowForFeature=e}get determineWorkflowForFeature(){return this.viewModel.determineWorkflowForFeature}set updateFootprint(e){this.viewModel.updateFootprint=e}get updateFootprint(){return this.viewModel.updateFootprint}_renderActionBar(){return ee("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},ee("calcite-action-group",null,this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle()),ee("calcite-action-group",null,this._directionToolToggle(),this._mapImageConversionToggle(),this._navigationToolToggle(),this._imageEnhancementsToggle(),this._videoEnhancementsToggle()),ee("calcite-action-group",null,this._measurementToolsToggle(),this._imageGalleryToggle(),this._imageOverlaysToggle(),this._openPopupAction()))}get _activeMeasurementIcon(){const{measureType:e,imageLocationToolActive:t,triangularMeasurementActive:i}=this;if(t)return i?"dual-image-location":"pin-tear";if(i)return"area"===e?"dual-image-area":"dual-image-distance";switch(e){case"area":return"measure-area";case"height":return"measure-building-height-top-base";default:return"measure-line"}}get _activeMeasurementHeading(){const{measureType:e,messages:t,triangularMeasurementActive:i}=this,{groundArea:a,heightAboveGround:o,groundDistance:s,triangulatedAreaHeading:n,triangulatedDistanceHeading:r}=t;if(i)return"area"===e?n:r;switch(e){case"area":return a;case"height":return o;default:return s}}_additionalFootprintToggle(){const{isAdditionalCoverageVisible:e,invalidCameraHeading:t,visibleElements:{additionalFootprintToggle:i}}=this;return i?ee("calcite-action",{active:e,bind:this,class:L.addCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleAdditionalCoverage,text:this.messages.additionalFootprints,title:this.messages.additionalFootprints}):null}_additionalPointSourcesToggle(){const{isAdditionalPointSourcesVisible:e,invalidCameraHeading:t,visibleElements:{additionalCameraLocationsToggle:i}}=this;return i?ee("calcite-action",{active:e,bind:this,class:L.addExpPoints,disabled:t,icon:"circle-area",onclick:this._toggleAdditionalCameraLocations,text:this.messages.additionalCameraLocations,title:this.messages.additionalCameraLocations}):null}get _measurementToggle(){const{viewModel:{state:e,measureType:t,currentBestFeatureMeasurementImage:i},triangularMeasurementActive:a,id:o}=this;if("image-loaded"!==e||!t||a&&!i)return;this._imageMeasurementToolsLoaderTask||this._loadImageMeasurementResources();const s=this._imageMeasurementToolsLoaderTask?.value;return s?ee("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:this._activeMeasurementHeading,id:`${o}-${t}-measurement`,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearMeasurements},ee(s,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _renderRoot(){const{viewModel:{state:e},triangularMeasurementActive:t}=this;return ee("calcite-panel",{bind:this,class:t?L.viewerContainerMeasurement:L.viewerContainer,heading:this.visibleElements.title?this.messages.title:void 0,loading:e.includes("loading")&&!t},this.visibleElements.menu?this._renderActionBar():null,ee("calcite-shell",null,ee("calcite-panel",null,this._imageViewer,this._panoramicViewer,this._panoramicVideoViewer,this._videoViewer,this._messageBox,this.invalidCameraHeading?null:[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel()],this._imageEnhancementTools,this._videoEnhancementTools,this._renderSketch()),this._imageViewerTriangular,this._measurementToggle,this._locationToggle,this.invalidCameraHeading?this._renderWarning(this.messages.invalidCameraHeadingWarningTitle,this.messages.invalidCameraHeadingWarningDescription):null,this.depthImageNotSupported?this._renderWarning(this.messages.depthImageNotSupportedTitle,this.messages.depthImageNotSupportedDescription):null))}_currentFootprintToggle(){const{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:i}=this.visibleElements;return i?ee("calcite-action",{active:e,bind:this,class:L.currentCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleCurrentCoverage,text:this.messages.currentFootprint,title:this.messages.currentFootprint}):null}get _imageEnhancementTools(){const{enhancementToolActive:e,viewModel:{brightness:t,contrast:i,sharpness:a,state:o}}=this;return e&&"image-loaded"===o?ee("calcite-panel",{bind:this,class:L.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleEnhancementToolState},ee("div",{class:L.imageEnhancementTools},q({title:this.messages.brightness,value:t,max:10,min:-10,ticks:5,handleChange:this._handleBrightnessChange}),q({title:this.messages.contrast,value:i,max:10,min:-10,ticks:5,handleChange:this._handleContrastChange}),q({title:this.messages.sharpness,value:a,max:1,min:0,ticks:.5,step:.1,handleChange:this._handleSharpnessChange})),ee("calcite-action",{bind:this,icon:"reset",onclick:this._resetImageTools,slot:"header-actions-end",text:this.messagesCommon.reset,title:this.messagesCommon.reset})):null}get _videoEnhancementTools(){const{enhancementToolActive:e,viewModel:{videoViewModel:t,mode:i},messages:{videoEnhancement:a,brightness:o,contrast:s},messagesCommon:{reset:n}}=this;return e&&"video"===i&&t?ee(Z,{brightness:t.videoBrightness,constrast:t.videoContrast,handleBrightnessChange:this._handleVideoBrightnessChange,handleContrastChange:this._handleVideoContrastChange,resetTools:this._resetVideoTools,uiStrings:{videoEnhancement:a,brightness:o,contrast:s,reset:n},videoEnhancementToolActive:e,onClose:this._toggleEnhancementToolState}):null}_imageEnhancementsToggle(){const{state:e,mode:t}=this.viewModel,{imageEnhancement:i}=this.visibleElements;return i&&"video"!==t?ee("calcite-action",{active:this.enhancementToolActive,bind:this,disabled:"default"!==t||"image-loaded"!==e,icon:"sliders-horizontal",onclick:this._toggleEnhancementToolState,text:this.messages.imageEnhancement,title:this.messages.imageEnhancement}):null}_videoEnhancementsToggle(){const{mode:e}=this.viewModel,{videoEnhancement:t}=this.messages;return"video"===e?ee("calcite-action",{active:this.enhancementToolActive,bind:this,disabled:"video"!==e,icon:"sliders-horizontal",onclick:this._toggleEnhancementToolState,text:t,title:t}):null}get _imageGalleryPanel(){const{container:e,galleryOpened:t,imageGalleryEnabled:i}=this;return i&&t&&e?this._imageGalleryContext:null}get _imageGalleryContext(){const{galleryOpened:e,invalidCameraHeading:t}=this;return ee("calcite-panel",{bind:this,class:L.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},ee("div",{class:L.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){const{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:i}}=this;return i?ee("calcite-action",{active:this.galleryOpened,bind:this,disabled:!e||t,icon:"images",onclick:this._toggleImageGallery,text:this.messages.imageGallery,title:this.messages.imageGallery}):null}get _imageOverlaysComponent(){const{_imageOverlayMessages:e,_imageOverlaysLoaderTask:t,_overlayedLayers:i,dataCaptureEnabled:o,dataCaptureLayer:s,imageOverlaysOpened:n,showCameraLocations:r,showMapFeatures:l,view:d,layer:c}=this;if(!c)return null;const g=c.imageGeometryField?.length?c.imageGeometryField:T,h=c.imageReferenceField?.length?c.imageReferenceField:b;t||(this._imageOverlaysLoaderTask=a(async()=>(await import("./OrientedImageryViewer/components/ImageOverlays.js")).default));const m=this._imageOverlaysLoaderTask?.value;return m?ee(m,{closed:!n,dataCaptureEnabled:o,dataCaptureLayer:s,imageGeometryField:g,imageReferenceField:h,messages:e,overlayedLayers:i,showCameraLocations:r,showMapFeatures:l,view:d,onDataCaptureLayerChanged:this._handleDataCaptureLayerChange,onFilterCapturedFeatures:this.viewModel.filterCapturedFeatures,onImageOverlaysClosed:this._onImageOverlayClosed,onLayerDeselected:this._handleOverlayLayerDeselect,onLayerSelected:this._handleOverlayLayerSelect,onShowCameraLocationsChanged:this._onShowCameraLocationsChanged,onShowMapFeaturesChanged:this._onShowMapFeaturesChanged}):null}get _imageOverlayMessages(){return{...this.messages,...this.messagesSketch}}get _imageSketchToolsMessages(){return{...this.messagesSketch,...this.messagesCommon}}_imageOverlaysPanel(){const{imageOverlaysOpened:e,viewModel:{state:t}}=this,i=this.classes({[L.imageOverlaysContainer]:!0,[Q.hidden]:!e||"image-loaded"!==t});return ee("div",{class:i,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){const{viewModel:{state:e},imageOverlaysOpened:t,invalidCameraHeading:i,visibleElements:{imageOverlays:a}}=this;return a?ee("calcite-action",{active:t,bind:this,disabled:"image-loaded"!==e||i,icon:"layers",onclick:this._toggleImageOverlays,text:this.messages.imageOverlays,title:this.messages.imageOverlays}):null}get _imageViewer(){const{displayMessage:e,loadImageViewer:t,mode:i,clickAction:a,state:o}=this.viewModel,s=null!=e||"default"!==i||o.includes("loading"),{messages:{end:n,next:r,previous:l,start:d}}=this;return ee($,{afterCreate:t,clickAction:a,navigationEnabled:!s&&null!==this.navigationMode,navigationViewModel:this.viewModel,uiStrings:{end:n,next:r,previous:l,start:d},visible:!s})}get _imageViewerTriangular(){const{messages:e,triangularMeasurementActive:t}=this,{displayMessage:i,storeImageMeasurementViewer:a,storePanoramicMeasurementViewer:o,mode:s,state:n,clickAction:r}=this.viewModel,l=null!=i||"none"===s||"video"===s,d=this.classes({[L.viewer]:!l,[L.viewerHidden]:l});return t?ee("calcite-panel",{class:L.viewerContainerMeasurement,heading:e.measurementViewerHeading,loading:n.includes("loading")},ee("calcite-panel",{bind:this,class:d},"default"===s?ee($,{afterCreate:a,clickAction:r,uiStrings:e}):ee(y,{afterCreate:o,clickAction:r,uiStrings:e}))):null}get _videoViewer(){const{mode:e,loadVideoViewer:t,videoViewModel:i}=this.viewModel,{control:a,reset:o}=this.messagesCommon,{mute:s,unmute:n}=this.messages,r="video"!==e,l=this.classes({[L.viewer]:!r,[L.viewerHidden]:r}),d="esri-image-viewer";return ee("calcite-panel",{bind:this,class:l},ee("calcite-panel",{afterCreate:t,class:this.classes(Q.widget,d)}),ee("calcite-slider",{bind:this,labelHandles:!0,labelTicks:!0,max:i?.videoDuration,minLabel:"0",value:i?.currentTime??0,onCalciteSliderChange:this._handleVideoSeek}),ee("calcite-action-bar",{expandDisabled:!0,layout:"horizontal"},ee("calcite-action-group",null,ee("calcite-action",{bind:this,icon:this.activeVideoIcon,onclick:()=>i?.playVideoHandler(),text:"Play",title:i?.videoPaused?a.play:a.pause})),ee("calcite-action-group",null,ee("calcite-action",{bind:this,icon:"refresh",onclick:()=>i?.rewindVideoHandler(),text:"Rewind",title:o})),ee("calcite-action-group",null,ee("calcite-action",{bind:this,icon:this.activeAudioIcon,onclick:()=>i?.toggleAudio(),text:"Audio",title:i?.videoMuted?s:n}))))}get _locationToggle(){const{viewModel:{state:e,groundCoordinates:t,groundCoordinatesAccuracy:i,triangulatedPoint:a},imageLocationToolActive:o,triangularMeasurementActive:s,messages:{groundLocation:n,triangulatedLocationHeading:r}}=this;if("image-loaded"!==e||!t||!o)return;let l=t;if(s){if(!a)return;l=a}return ee("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:s?r:n,id:n,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearImageLocation},ee(G,{accuracy:i,groundCoordinates:l,messages:this.messages}))}_mapImageConversionToggle(){const{mapImageConversionToolState:e,viewModel:{state:t,disabled:i},invalidCameraHeading:a,visibleElements:{mapImageConversionTool:o}}=this;return o?ee("calcite-action",{active:e,bind:this,disabled:"image-loaded"!==t||a||i,icon:"image-pin",onclick:this._toggleMapImageConversionToolState,text:this.messages.mapImageConversionTool,title:this.messages.mapImageConversionTool}):null}_measurementToolsToggle(){const{_activeMeasurementIcon:e,measureType:t,viewModel:i,accuracyParametersMissing:a,messages:o,triangularMeasurementActive:s,visibleElements:{measurementTools:n}}=this,{state:r}=i,{measurementTools:l,groundDistance:d,groundArea:c,heightAboveGround:g,groundLocation:h,triangulatedDistanceHeading:m,triangulatedAreaHeading:u,triangulatedLocationHeading:v}=o;return n?ee("calcite-dropdown",{disabled:a,key:"measurement-tools",maxItems:5,title:l,width:"m"},ee("calcite-action",{bind:this,disabled:"image-loaded"!==r||a,icon:e,slot:"trigger",text:l}),ee("calcite-dropdown-group",null,ee("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-line",key:"distance-measurement",onclick:e=>this._toggleMeasurementSketch(e,"distance"),selected:"distance"===t&&!s},d),ee("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-area",key:"area-measurement",onclick:e=>this._toggleMeasurementSketch(e,"area"),selected:"area"===t&&!s},c),ee("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-building-height-top-base",key:"height-dropdown",onclick:e=>this._toggleMeasurementSketch(e,"height"),selected:"height"===t},g),ee("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"pin-tear",key:"surface-location",onclick:this._toggleLocationTool,selected:!!this.imageLocationToolActive&&!s},h),ee("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"dual-image-location",key:"triangular-location",selected:!!s&&this.imageLocationToolActive,onCalciteDropdownItemSelect:this._toggleTriangularLocation},v),ee("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"dual-image-distance",key:"triangular-measurement-distance",selected:!!s&&"distance"===this.measureType,onCalciteDropdownItemSelect:this._toggleTriangularDistanceMeasurements},m),ee("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"dual-image-area",key:"triangular-measurement-area",selected:!!s&&"area"===this.measureType,onCalciteDropdownItemSelect:this._toggleTriangularAreaMeasurements},u))):null}get _messageBox(){const{messages:e,viewModel:{displayMessage:i,mode:a}}=this;if(!i||"video"===a)return null;const{data:o,key:s,map:n}=i,r=`${n?t(e[s],n):e[s]}`;return ee("span",{class:L.messageBox},o?`${r} ${o}`:r)}async _loadNavigationSettings(){return this._navigationSettingsLoaderTask||(this._navigationSettingsLoaderTask=a(async()=>(await import("./OrientedImageryViewer/components/NavigationSettings.js")).default)),await this._navigationSettingsLoaderTask.promise}_navigationToolToggle(){const{state:e}=this.viewModel,{visibleElements:{navigationTool:t},videoLoaded:i}=this;return t?ee("calcite-action",{active:this.navigationToolActive,bind:this,disabled:"image-loaded"!==e&&!i||this.invalidCameraHeading,icon:"explore",onclick:this._toggleNavigationTool,text:this.messages.navigationTool,title:this.messages.navigationTool}):null}_directionToolToggle(){const{state:e}=this.viewModel,{visibleElements:{directionalNavigation:t,sequentialNavigation:i}}=this,a=new W;t&&a.push(new B({active:"directional"===this.navigationMode,disabled:"image-loaded"!==e||this.invalidCameraHeading,icon:"directional-navigation",onclick:()=>{this._toggleImageNavigation("directional")},text:this.messages.directionalNavigation,title:this.messages.directionalNavigationDescription})),i&&a.push(new B({active:"sequential"===this.navigationMode,disabled:"image-loaded"!==e||this.invalidCameraHeading||!this.canNavigateSequentially,icon:"sequential-navigation",onclick:()=>{this._toggleImageNavigation("sequential")},text:this.messages.sequentialNavigation,title:this.messages.sequentialNavigationDescription}));return t||i?ee(U,{actions:a,activeAction:a.items.find(e=>e.active),icon:"absolute-direction",label:this.messages.imageNavigation,scale:"m",title:this.messages.imageNavigation}):null}_openPopupAction(){const{showPopupsAction:e}=this.visibleElements;return e?ee("calcite-action",{bind:this,disabled:!this.popupEnabled,icon:"popup",onclick:this._toggleImageAttributes,text:this.messages.showPopups,title:this.messages.showPopups}):null}get _panoramicVideoViewer(){const{displayMessage:e,loadPanoramicVideoViewer:t,mode:i,clickAction:a,state:o,currentBestFeature:s}=this.viewModel,n=s?.attributes.imagePath,r=null!=e||"panoramic-video"!==i||o.includes("loading")||!n;return ee(p,{afterCreate:t,clickAction:a,oiViewModel:this.viewModel,videoSource:n,visible:!r})}get _panoramicViewer(){const{displayMessage:e,loadPanoramicViewer:t,mode:i,clickAction:a,state:o}=this.viewModel,{messages:{end:s,next:n,previous:r,start:l}}=this,d=null!=e||"panoramic"!==i||o.includes("loading");return ee(y,{afterCreate:t,clickAction:a,navigationEnabled:!d&&null!==this.navigationMode,navigationViewModel:this.viewModel,uiStrings:{end:s,next:n,previous:r,start:l},visible:!d})}_activateTriangulatedImageLocationTool(){this.navigationToolActive=!0,this.imageLocationToolActive=!0}_activateTriangulatedImageLocationWorkflow(e,t){this._closeAllImageTools(),this.imageLocationToolActive=!0,this.triangularMeasurementActive=!e,this.navigationToolActive=!!t||!t}_closeImageToolsAndToggleNavigation(e,t){this._closeAllImageTools(),this.triangularMeasurementActive=!e,this.navigationToolActive=!t}_resetMeasureTypeAndActivateImageLocationTool(){this.measureType=null,this.imageLocationToolActive=!0}_closeAllImageTools(){this.enhancementToolActive=!1,this.navigationToolActive=!1,this.imageOverlaysOpened=!1,this.galleryOpened=!1,this.measureType=null,this.imageLocationToolActive=!1,this.navigationMode=null,this.triangularMeasurementActive=!1,this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))}_handleBrightnessChange(e){this.viewModel.brightness=e.currentTarget.value??0}_handleVideoBrightnessChange(e){this.viewModel.videoViewModel?.handleVideoBrightnessChange(e.target.value)}_handleContrastChange(e){this.viewModel.contrast=e.currentTarget.value??0}_handleVideoContrastChange(e){this.viewModel.videoViewModel?.handleVideoContrastChange(e.target.value)}_handleVideoSeek(e){const t=this.viewModel?.videoElement?.content;t&&(t.currentTime=e.target.value,t.play())}_handleSharpnessChange(e){this.viewModel.sharpness=e.currentTarget.value??0}_lazyLoadImage(e,t){e.forEach(async e=>{if(e.isIntersecting){const a=e.target,o=a.getAttribute("data-src"),s=a.getAttribute("data-rotation"),l=a.getAttribute("data-objectid"),d=s?parseFloat(s)%360:0,{layer:c,_galleryController:{signal:g}}=this;if(!o||!l)return;let h;try{h=P(o)?await F(c,l,{signal:g}):await E(o,{signal:g})}catch(i){r(i)||n.getLogger("esri.widgets.OrientedImageryViewer").error("#lazyLoadImage()",i)}finally{t.unobserve(a)}if(!h)return;x(h,a,d)}})}_loadImageFromGallery(e){const{target:t}=e;if(!t)return;const i=t.getAttribute("data-objectid");i&&this.viewModel.currentBestFeature?.attributes.objectId!==Number(i)&&this.viewModel.selectBestFeature(i)}_loadImageMeasurementResources(){this._imageMeasurementToolsLoaderTask=a(async()=>{const{default:e}=await import("./OrientedImageryViewer/components/ImageMeasurementWidget.js");return e})}_loadSketchResources(){this._sketchLoaderTask=a(async()=>(await import("./OrientedImageryViewer/components/SketchTools.js")).default)}_onAdditionalCoverageVisibilityChange(e){this.viewModel.setAdditionalCoverageVisibility(e)}_onAdditionalCameraLocationsVisibility(e){this.viewModel.setAdditionalCameraLocationsVisibility(e)}_onCurrentCoverageVisibilityChange(e){this.viewModel.setCurrentCoverageVisibility(e)}_registerGalleryItem(e){this._galleryObserver.observe(e)}_renderWarning(e,t){const{viewModel:{state:i}}=this;return"image-loaded"===i?ee(D,{icon:"exclamation-mark-triangle-f",kind:"warning",message:t,open:!0,title:e,tooltip:t}):null}get _renderNavigation(){const{viewModel:{sectorData:e,navigatorCurrentBestFeature:t,currentBestFeature:a,state:o}}=this;if(!this.container||!a)return null;let s,n,r,l,d;if(t){const{x:e,y:i,direction:a}=t,[o,c,g,h]=C[a];s=`M ${e} ${i} L ${o} ${c} A ${f[2]} ${f[2]} 0 0 1 ${g} ${h} Z`,n=e,l=i,r=C[a][4],d=C[a][5]}const c=e=>{const t=e.target.dataset?.sector;t&&this.viewModel.handleSectorClick(+t)},g=e=>{const t=e.target.dataset;if(!t)return;const{featureIndexInSector:i,sector:a}=t;i&&a&&this.viewModel.handleFeatureClick({sector:a,featureIndexInSector:+i})},h=e=>{e.removeEventListener("click",g)},m=a.attributes.objectId,u=e?.map(e=>e?.items).filter(Boolean).flatMap(e=>e?.map(({x:e,y:t,objectID:i,featureIndexInSector:a,sector:o})=>ee("circle",{afterRemoved:h,class:this.classes(L.feature,{selected:m===i}),cx:e,cy:t,"data-feature-index-in-sector":a,"data-sector":o,key:`${L.feature}-${i}`,onclick:g,r:A}))),v=e=>{e.removeEventListener("click",c)},p=this.classes({[L.navigationWrapper]:!0,[L.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&("image-loaded"===o||this.videoLoaded)?ee("div",{bind:this,class:p,key:this.messages.navigationTool},ee("svg",{afterCreate:e=>this._storeNavigationToolReference(e),class:i()?V:L.rotateWithAnimation,focusable:"false",height:I,role:"img",width:I,xmlns:"http://www.w3.org/2000/svg"},ee("defs",null,ee("linearGradient",{gradientUnits:"userSpaceOnUse",id:`${this.id}-coverage-fill`,x1:n,x2:r,y1:l,y2:d},ee("stop",{class:L.navigationPathOffset0,offset:0}),ee("stop",{class:L.navigationPathOffset1,offset:1}))),ee("g",null,ee("circle",{class:this.classes(L.sector,L.outerSector),cx:f[3],cy:f[3],onclick:this._scaleNavigationTool,r:f[3]}),ee("circle",{class:L.sector,cx:f[3],cy:f[3],r:f[2]}),ee("circle",{class:L.sector,cx:f[3],cy:f[3],r:f[1]}),ee("circle",{class:L.sector,cx:f[3],cy:f[3],r:f[0]}),ee("path",{class:L.pointer,d:"M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z",key:`${L.pointer}-west`}),ee("path",{class:this.classes(L.pointer,L.north),d:"M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z",key:`${L.pointer}-north`}),ee("path",{class:L.pointer,d:"M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z",key:`${L.pointer}-east`}),ee("path",{class:L.pointer,d:"M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z",key:`${L.pointer}-south`}),ee("path",{class:this.classes(L.sector,L.sectorSeparator),d:"M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076",key:L.sectorSeparator}),_([f[2],f[1],f[0]],f[3],f[3]).map((t,i)=>ee("path",{afterRemoved:v,class:this.classes(L.sector,e?.[i]?.length?L.sectorEnabled:L.sectorDisabled),d:t,"data-sector":`${i}`,key:`${L.sector}-${i}`,onclick:c})),ee("path",{class:this.classes(L.sector,L.sectorCross),d:"M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53",key:L.sectorCross}),u,a.attributes.cameraPitch>=5&&s?ee("path",{class:L.selectedFeaturePath,d:s,fill:`url(#${this.id}-coverage-fill)`,key:L.selectedFeaturePath}):null))):null}_renderSketch(){const{dataCaptureLayer:e,imageOverlaysOpened:t}=this;if(!e||t)return null;if(this._sketchLoaderTask||this._loadSketchResources(),!this._sketchLoaderTask?.value)return null;const{geometryType:i}=e,a="point"===i?"pin":"polyline"===i?"line":"polygon",o=this._sketchLoaderTask.value;return ee("div",{class:L.sketchTools},ee(o,{icon:a,messages:this._imageSketchToolsMessages,type:i,onAction:this._onAction}))}get _renderThumbnails(){const{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?ee("div",{class:L.carouselContent},t?.items.map(({url:t,objectId:i,rotation:a},o)=>ee("div",{class:`${L.carouselItemWrapper}${e.attributes.objectId===i?"--selected":""}`,key:`${L.carouselItemWrapper}-${o}`},ee("canvas",{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${i}`,class:L.carouselItem,"data-objectid":`${i}`,"data-rotation":`${a}`,"data-src":t,onclick:this._loadImageFromGallery,onmouseenter:this._highlight,onmouseleave:this._removeHighlight})))):null}_resetImageTools(){this.viewModel.sharpness=this.viewModel.brightness=this.viewModel.contrast=0}_resetVideoTools(){this.viewModel.videoViewModel?.resetVideoEnhancementTools()}_storeNavigationToolReference(e){this._navigationTool=e}_toggleAdditionalCameraLocations(){this.isAdditionalPointSourcesVisible=!this.isAdditionalPointSourcesVisible}_toggleAdditionalCoverage(){this.isAdditionalCoverageVisible=!this.isAdditionalCoverageVisible}_toggleCurrentCoverage(){this.currentCoverageVisible=!this.currentCoverageVisible}_toggleEnhancementToolState(e){e.stopPropagation();const t=this.enhancementToolActive;this._closeAllImageTools(),this.enhancementToolActive=!t}_toggleImageOverlays(e){e.stopPropagation();const t=this.imageOverlaysOpened;this._closeAllImageTools(),this.imageOverlaysOpened=!t}_toggleImageGallery(e){e.stopPropagation();const t=this.galleryOpened;this._closeAllImageTools(),this.galleryOpened=!!this.imageGalleryEnabled&&!t}_toggleLocationTool(e){const t=this.imageLocationToolActive,i=this.triangularMeasurementActive&&t;this._closeAllImageTools(),this.imageLocationToolActive=i||!t,e.stopPropagation()}_toggleMeasurementSketch(e,t){e.stopPropagation();const i=this.measureType,a=this.triangularMeasurementActive;this._closeAllImageTools(),this.measureType=i!==t||a?t:null,this.measureType===t&&(this.viewModel.displayNewMeasurementButton=!0)}_toggleNavigationTool(){const e=this.navigationToolActive;this._closeAllImageTools(),this.navigationToolActive=!e}_toggleMapImageConversionToolState(){this.mapImageConversionToolState=!this.mapImageConversionToolState}_toggleTriangularAreaMeasurements(){this._toggleTriangularMeasurements("area")}_toggleTriangularDistanceMeasurements(){this._toggleTriangularMeasurements("distance")}_toggleTriangularLocation(){const e=this.triangularMeasurementActive,t=this.navigationToolActive;e?null===this.measureType?this.imageLocationToolActive?this._closeImageToolsAndToggleNavigation(e,t):this._activateTriangulatedImageLocationTool():this._resetMeasureTypeAndActivateImageLocationTool():this._activateTriangulatedImageLocationWorkflow(e,t)}_toggleTriangularMeasurements(e){const t=this.triangularMeasurementActive,i=this.viewModel.measureType,a=this.navigationToolActive;t?e===i?(this._closeAllImageTools(),this.triangularMeasurementActive=!t,this.navigationToolActive=!a):(this.imageLocationToolActive=!1,this.measureType=e):(this._closeAllImageTools(),this.measureType=e,this.triangularMeasurementActive=!t,this.navigationToolActive=!!a||!a)}_unregisterGalleryItem(e){this._galleryObserver.unobserve(e)}_updateNavigationTool(e){const{previousFeatureAngle:t,bestFeatureAngle:i}=this.viewModel,a=(i-t+540)%360-180;e.style.setProperty(k,`${t}deg`),e.style.setProperty(S,`${t+a}deg`)}async loadBestImage(e){return this.viewModel.loadBestImage(e)}loadImageFromSource(e,t){return this.viewModel.loadImageFromSource(e,t)}async overlayMapFeatures(e,t){return this.removeHandles(`${te.overlayed}-${e.id}`),this.addHandles(l(()=>e.visible,()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible,this.showMapFeatures)}),`${te.overlayed}-${e.id}`),this._overlayedLayers.add(e),this.viewModel.overlayMapFeatures(e,t&&this.showMapFeatures)}async plotMapPoint(e){return this.viewModel.plotMapPoint(e)}plotReferencePointOnGround(e){this.viewModel.plotReferencePointOnGround(e)}plotReferencePointOnImage(e){this.viewModel.plotReferencePointOnImage(e)}removeOverlayedGraphicsOnImage(e){this.removeHandles(`${te.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find(t=>t.id===e)),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return ee("div",{class:this.classes(Q.widget,O)},this._renderRoot)}async showImageByObjectId(e,t){return this.viewModel.showImageByObjectId(e,t)}async startDataCapture(e){return this.viewModel.startDataCapture(e)}async stopDataCapture(e){return this.viewModel.stopDataCapture(e)}updateSuitabilities(e){this.viewModel.updateSuitabilities(e)}};e([h({readOnly:!0})],ie.prototype,"accuracyParametersMissing",null),e([h()],ie.prototype,"activeLayer",null),e([h()],ie.prototype,"activeVideoIcon",null),e([h()],ie.prototype,"activeAudioIcon",null),e([h()],ie.prototype,"cameraHeadingThreshold",null),e([h()],ie.prototype,"cameraPitchThreshold",null),e([h()],ie.prototype,"canNavigateSequentially",null),e([h()],ie.prototype,"currentBestFeature",null),e([h()],ie.prototype,"currentCoverageVisible",null),e([h()],ie.prototype,"dataCaptureEnabled",void 0),e([h()],ie.prototype,"dataCaptureLayer",null),e([h()],ie.prototype,"depthImageNotSupported",null),e([h()],ie.prototype,"disabled",null),e([h()],ie.prototype,"enhancementToolActive",null),e([h()],ie.prototype,"features",null),e([h()],ie.prototype,"imagePointsInView",null),e([h()],ie.prototype,"galleryOpened",void 0),e([h()],ie.prototype,"icon",null),e([h()],ie.prototype,"imageEnhancementToolActive",void 0),e([h()],ie.prototype,"videoEnhancementToolActive",void 0),e([h({readOnly:!0})],ie.prototype,"imageGalleryEnabled",null),e([h()],ie.prototype,"imageLocationToolActive",null),e([h()],ie.prototype,"imageOverlaysOpened",void 0),e([h({readOnly:!0})],ie.prototype,"invalidCameraHeading",null),e([h()],ie.prototype,"isAdditionalCoverageVisible",null),e([h()],ie.prototype,"isAdditionalPointSourcesVisible",null),e([h()],ie.prototype,"mapImageConversionToolState",null),e([h()],ie.prototype,"measureType",null),e([h()],ie.prototype,"layer",null),e([h()],ie.prototype,"navigationToolActive",void 0),e([h()],ie.prototype,"navigationMode",null),e([X(M()),h({type:H})],ie.prototype,"viewModel",void 0),e([h(),Y("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],ie.prototype,"messages",void 0),e([h(),Y("esri/core/t9n/Units")],ie.prototype,"measurementUnitMessages",void 0),e([h(),Y("esri/t9n/common")],ie.prototype,"messagesCommon",void 0),e([h(),Y("esri/widgets/Sketch/t9n/Sketch")],ie.prototype,"messagesSketch",void 0),e([h()],ie.prototype,"pixelMeasurementUnit",void 0),e([h()],ie.prototype,"pixelAreaMeasurementUnit",void 0),e([h({readOnly:!0})],ie.prototype,"popupEnabled",null),e([h()],ie.prototype,"referencePoint",null),e([h()],ie.prototype,"showCameraLocations",void 0),e([h()],ie.prototype,"showMapFeatures",void 0),e([X(["create","delete","redo","undo","update"]),h({readOnly:!0})],ie.prototype,"sketchViewModel",null),e([h()],ie.prototype,"triangularMeasurementActive",null),e([h()],ie.prototype,"videoLoaded",null),e([h()],ie.prototype,"view",null),e([h({type:N,nonNullable:!0})],ie.prototype,"visibleElements",void 0),e([h()],ie.prototype,"determineWorkflowForFeature",null),e([h()],ie.prototype,"updateFootprint",null),e([h()],ie.prototype,"_activeMeasurementIcon",null),e([h()],ie.prototype,"_activeMeasurementHeading",null),e([h()],ie.prototype,"_imageOverlaysLoaderTask",void 0),e([h()],ie.prototype,"_imageMeasurementToolsLoaderTask",void 0),e([h()],ie.prototype,"_navigationSettingsLoaderTask",void 0),e([h()],ie.prototype,"_measurementToggle",null),e([h()],ie.prototype,"_renderRoot",null),e([h()],ie.prototype,"_imageEnhancementTools",null),e([h()],ie.prototype,"_videoEnhancementTools",null),e([h()],ie.prototype,"_imageGalleryPanel",null),e([h()],ie.prototype,"_imageGalleryContext",null),e([h()],ie.prototype,"_imageOverlaysComponent",null),e([h()],ie.prototype,"_imageOverlayMessages",null),e([h()],ie.prototype,"_imageSketchToolsMessages",null),e([h()],ie.prototype,"_imageViewer",null),e([h()],ie.prototype,"_imageViewerTriangular",null),e([h()],ie.prototype,"_videoViewer",null),e([h()],ie.prototype,"_locationToggle",null),e([h()],ie.prototype,"_messageBox",null),e([h()],ie.prototype,"_navigationToolExpanded",void 0),e([h()],ie.prototype,"_navigationTool",void 0),e([h()],ie.prototype,"_panoramicVideoViewer",null),e([h()],ie.prototype,"_panoramicViewer",null),e([h()],ie.prototype,"_renderNavigation",null),e([h()],ie.prototype,"_renderThumbnails",null),e([h()],ie.prototype,"_sketchLoaderTask",void 0),ie=e([m("esri.widgets.OrientedImageryViewer")],ie);const ae=ie;export{ae as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../Camera.js";import i from"../../Ground.js";import o from"../../Map.js";import a from"../../core/Collection.js";import r from"../../core/Error.js";import{EventedAccessor as s}from"../../core/Evented.js";import{JSONMap as n}from"../../core/jsonMap.js";import d from"../../core/Logger.js";import{rad2deg as h,deg2rad as l}from"../../core/mathUtils.js";import{destroyMaybe as m}from"../../core/maybe.js";import{waitTick as c}from"../../core/promiseUtils.js";import{watch as p,syncAndInitial as g,when as u,whenOnce as v}from"../../core/reactiveUtils.js";import{property as _,subclass as y}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import w from"../../geometry/SpatialReference.js";import V from"../../layers/GraphicsLayer.js";import{convertSphereVertexToPixelLocation as M}from"../../layers/orientedImagery/transformations/utils.js";import R from"../../views/SceneView.js";import{fixedImageSize as P}from"../OrientedImageryViewer/constants.js";import{logAndThrow as z,getMissingPropertyErrorName as H,getMissingPropertyErrorMessage as b}from"../OrientedImageryViewer/utils.js";import{defaultImageSphereCenter as F,maxPanoramicViewerHFOV as C,minPanoramicViewerHFOV as S,humanBinocularHFOV as O}from"./constants.js";import j from"./PanoramicZoomConditions.js";import I from"./PanoramicZoomViewModel.js";import{findDiagonalFOV as x,meshToGraphic as L,createImageSphere as k}from"./utils.js";import{enumeration as A}from"../../core/accessorSupport/decorators/enumeration.js";const G={default:"default",navigation:"navigation",fovConstraint:"fov-constraint",clickAction:"image-click-action"};let T=class extends s{constructor(e){super(e),this._startPosition=null,this._targetPosition=null,this._graphics=new V({elevationInfo:{mode:"relative-to-ground"}}),this._imageGraphic=null,this._loadController=null,this._map=new o({ground:new i({opacity:0,navigationConstraint:null}),layers:new a([this._graphics])}),this._zoomViewModel=null,this.autoLoad=!1,this.clickAction="none",this.closestFeature=null,this.currentTime=0,this.imageSize=null,this.oiViewModel=null,this.videoSource=null,this.videoDuration=void 0,this.videoLoaded=!1,this.videoPaused=null,this.videoMuted=null,this.pitch=90,this.state="ready",this.updatingHandles=new f,this.video=null,this.yaw=0,this._addNavigationHandles=()=>{this.imageRenderer.basemapTerrain.suspended=!0,this.imageRenderer.constraints.tilt.max=180,this.removeHandles(G.navigation),this.addHandles([this.imageRenderer.on("mouse-wheel",this._handleWheel),this.imageRenderer.on("double-click",this._handleDoubleClick),this.imageRenderer.on("drag",this._handleDrag),this.imageRenderer.on("key-down",e=>{const t=["+","-","Shift","_","=","ArrowUp","ArrowDown","ArrowRight","ArrowLeft"],i=e.key;t.includes(i)&&e.stopPropagation()})],G.navigation)},this._addHFOVHandles=()=>{this.removeHandles(G.fovConstraint),this.addHandles(p(()=>[this.maxHFOV,this.minHFOV],()=>{this._zoomViewModel&&(this._zoomViewModel.panoramicZoomConditions=new j({view:this.imageRenderer,maxFOV:this.maxHFOV,minFOV:this.minHFOV}))},g),G.fovConstraint)},this._addZoomHandles=()=>{this._zoomViewModel=new I({view:this.imageRenderer,panoramicZoomConditions:new j({maxFOV:this.maxHFOV,minFOV:this.minHFOV})});const e=this.imageRenderer.ui.find("zoom");e&&(e.viewModel=this._zoomViewModel),this._addHFOVHandles()},this._cancelLoadWithController=()=>{this._loadController?.abort(),this._loadController=null},this._handleDoubleClick=e=>{e.stopPropagation(),e.native.ctrlKey?this._zoomOut():this._zoomIn()},this._handleDrag=e=>{e.stopPropagation();const{action:t,x:i,y:o}=e;switch(t){case"start":this._startPosition=this._targetPosition={x:i,y:o};break;case"update":this._targetPosition={x:i,y:o},this._updateCameraHeadingAndTilt()}},this._handleImageClick=e=>{if("image-loaded"===this.state&&this.imageRenderer.ready)switch(this.clickAction){case"emit":e.stopPropagation(),this.emit("click",e);break;case"hittest":e.stopPropagation(),e.defer(async()=>{const t=await this.imageRenderer.hitTest(e.screenPoint,{include:this._graphics});t.results=t.results.filter(e=>"graphic"===e.type&&e.graphic!==this._imageGraphic),this.emit("hittest-response",t)});break;case"pixel-location":{if(e.stopPropagation(),!this.imageSize||!e.mapPoint)return void this.emit("pixel-location",null);const t=M(e.mapPoint,this.imageSize[0],this.imageSize[1]);this.emit("pixel-location",{...t,spatialReference:w.WebMercator});break}}},this._handleWheel=e=>{const t=e.deltaX??e.native.deltaX;e.stopPropagation(),t>0||e.deltaY>0?this._zoomOut():this._zoomIn()},this._loadWithController=()=>{this._cancelLoadWithController(),this._loadController=new AbortController,this.loadVideo(this._loadController)},this._zoomIn=()=>this._zoomViewModel?.zoomIn(),this._zoomOut=()=>this._zoomViewModel?.zoomOut(),this.addGraphic=(e,t)=>"image-loaded"===this.state&&!this._graphics.graphics.includes(e)&&(this._graphics.graphics.add(e,t),!0),this.addManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const t=e.filter(e=>!this._graphics.graphics.includes(e));return this._graphics.graphics.addMany(t),!0},this.clearGraphics=()=>{this._graphics.graphics.removeAll()},this.clearImage=()=>{this.imageSize=null,this._removeImageSphere()},this.enableAudio=()=>{const{video:e}=this;e&&(e.muted=!1,this.videoMuted=!1)},this.removeGraphic=e=>!("image-loaded"!==this.state||!this._graphics.graphics.includes(e))&&(this._graphics.remove(e),!0),this.removeManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const t=e.filter(e=>this._graphics.graphics.includes(e));return this._graphics.removeMany(t),!0},this.togglePanoramicAudio=()=>{if(this.video){const e=this.video.muted;this.video.muted=!e,this.videoMuted=!e}},this._imageRenderer=new R({map:this._map,viewingMode:"local",camera:{position:F},environment:{atmosphereEnabled:!1,starsEnabled:!1,lighting:{type:"virtual"}},popupEnabled:!1,spatialReference:w.WebMercator,attributionVisible:!1,ui:{components:["zoom"]}})}destroy(){this._imageRenderer.destroy()}initialize(){this.state="initialized",this.addHandles([p(()=>this.videoSource,()=>{this.videoSource&&this.autoLoad&&this._loadWithController()},g),p(()=>this.fov,()=>{this._reloadCamera()},g),p(()=>this.yaw,e=>{this.camera&&(this.camera.heading=e,this._reloadCamera())},g),p(()=>this.pitch,e=>{this.camera&&(this.camera.tilt=e,this._reloadCamera())},g),u(()=>this.imageRenderer.ready,()=>{this._addNavigationHandles(),this._addZoomHandles()},g),p(()=>this.clickAction,e=>{this.removeHandles(G.clickAction),"none"!==e&&this.addHandles(this.imageRenderer.on("click",this._handleImageClick))},g),p(()=>this.video,e=>{if(e instanceof HTMLVideoElement){this._startVideo();const t=async()=>{this.currentTime=Number(e.currentTime.toFixed(2)),e.currentTime&&await this._updateVidFootprint(e.currentTime)};e.addEventListener("timeupdate",t),e.addEventListener("play",()=>this._updateVideoIcon(e.paused)),e.addEventListener("pause",()=>this._pauseVideoHandler(e))}},g)],G.default)}get camera(){return this.imageRenderer.destroying||this.imageRenderer.destroyed?null:this.imageRenderer.camera}set camera(e){!e||this.imageRenderer.destroying||this.imageRenderer.destroyed||(this.imageRenderer.camera=e.clone())}get fov(){return this.camera?.fov}set fov(e){Number.isFinite(e)&&this._zoomViewModel?.zoomTo(e)}get hfov(){if(!this.camera||!this.imageRenderer?.ready)return null;const{fov:e}=this.camera,{size:[t,i]}=this.imageRenderer,o=t/i,a=Math.atan(o);return 2*h(Math.atan(Math.tan(l(e/2))*Math.sin(a)))}get imageRenderer(){return this._imageRenderer}get maxHFOV(){const{size:[e,t]}=this.imageRenderer;return this.imageRenderer.ready?x(C,e/t):C}get minHFOV(){const{size:[e,t]}=this.imageRenderer;return this.imageRenderer.ready?x(S,e/t):S}get updating(){return this.updatingHandles.updating}get vfov(){if(!this.camera||!this.imageRenderer?.ready)return null;const{fov:e}=this.camera,{size:[t,i]}=this.imageRenderer,o=t/i,a=Math.atan(o);return 2*h(Math.atan(Math.tan(l(e/2))*Math.cos(a)))}async _loadVideoInternal(e,t){return this.state="image-loading",this.video=document.createElement("video"),this.video.src=e,this.video.addEventListener("loadedmetadata",()=>{this._setVideoDuration(),this.videoLoaded=!0}),this._updateImageSphere(this.video,t)}_pauseVideoHandler(e){this._updateVideoIcon(e.paused)}_setVideoDuration(){const{video:e}=this;e?.duration&&(this.videoDuration=e.duration)}_startVideo(){try{this.enableAudio();const e=this.oiViewModel.currentBestFeature;e&&this.playPanoramicVideoFromSelectedLocation(e)}catch(e){d.getLogger(this).error("oriented-imagery-viewer:video-load",e)}}_reloadCamera(){this.camera=this.camera?.clone()}_removeImageSphere(){this._imageGraphic&&(this._graphics.remove(this._imageGraphic),this._imageGraphic=m(this._imageGraphic)),this.state="ready",this.imageSize=null}_updateCameraHeadingAndTilt(){if(!this._startPosition||!this._targetPosition||!this.camera)return;const e=this.camera.heading+(this._startPosition.x-this._targetPosition.x)/this.imageRenderer.width*this.camera.fov;this.yaw=(e+360)%360;const t=this.camera.tilt-(this._startPosition.y-this._targetPosition.y)/this.imageRenderer.height*this.imageRenderer.camera.tilt;this.pitch=Math.min(179.5,Math.max(.5,t)),this._startPosition=this._targetPosition}async _updateImageSphere(e,t){return await c(t),this._imageGraphic=L(k(e)),this._graphics.add(this._imageGraphic),this.state="image-loaded",v(()=>this.imageRenderer.ready,t).then(()=>{const{size:[e,t]}=this.imageRenderer;this.fov=x(O,e/t)}),this.imageSize=P,this._imageGraphic.geometry}async _updateVidFootprint(e){const t=this.oiViewModel?.featureCache.find(t=>t.attributes.offsetFromStart===Math.floor(e)),{yaw:i,pitch:o,vfov:a,hfov:r}=this,s=!(t?.attributes.offsetFromStart&&a&&r&&i&&o),n=t?.attributes.objectId===this.closestFeature?.attributes.objectId;s||n||(this.closestFeature=t,await this.oiViewModel.updateFootprintPanorama({yaw:i,pitch:o,verticalFieldOfView:a,horizontalFieldOfView:r,feature:t}))}_updateVideoIcon(e){this.videoPaused=!!e}async loadVideo(e){return this._removeImageSphere(),this.videoSource?this._loadVideoInternal(this.videoSource,e):z(this.declaredClass,new r(H("panoramic-viewer"),b("PanoramicViewerViewModel","videoSource")))}playPanoramicVideoHandler(){const{video:e}=this;e&&(e.paused?e.play().catch(e=>{d.getLogger(this).error("error playing video",e)}):e.pause())}playPanoramicVideoFromSelectedLocation(e){const t=e.attributes.offsetFromStart;if(t){const e=this.video;e&&(e.currentTime=t,e.play().catch(e=>{d.getLogger(this).error("error playing video",e)}))}}rewindPanoramicVideoHandler(){const{video:e}=this;e&&(e.currentTime=0,e.play().catch(e=>{d.getLogger(this).error("error playing video",e)}))}};e([_()],T.prototype,"_graphics",void 0),e([_()],T.prototype,"_imageGraphic",void 0),e([_()],T.prototype,"_imageRenderer",void 0),e([_()],T.prototype,"_loadController",void 0),e([_()],T.prototype,"_map",void 0),e([_()],T.prototype,"_zoomViewModel",void 0),e([_({type:Boolean})],T.prototype,"autoLoad",void 0),e([_({type:t})],T.prototype,"camera",null),e([A(new n({emit:"emit",hittest:"hittest",none:"none","pixel-location":"pixel-location"}))],T.prototype,"clickAction",void 0),e([_()],T.prototype,"closestFeature",void 0),e([_()],T.prototype,"currentTime",void 0),e([_({type:Number})],T.prototype,"fov",null),e([_({readOnly:!0})],T.prototype,"hfov",null),e([_({readOnly:!0})],T.prototype,"imageRenderer",null),e([_()],T.prototype,"imageSize",void 0),e([_()],T.prototype,"oiViewModel",void 0),e([_()],T.prototype,"videoSource",void 0),e([_()],T.prototype,"videoDuration",void 0),e([_()],T.prototype,"videoLoaded",void 0),e([_()],T.prototype,"videoPaused",void 0),e([_()],T.prototype,"videoMuted",void 0),e([_({readOnly:!0})],T.prototype,"maxHFOV",null),e([_({readOnly:!0})],T.prototype,"minHFOV",null),e([_({type:Number})],T.prototype,"pitch",void 0),e([_()],T.prototype,"state",void 0),e([_()],T.prototype,"updatingHandles",void 0),e([_()],T.prototype,"updating",null),e([_({readOnly:!0})],T.prototype,"vfov",null),e([_()],T.prototype,"video",void 0),e([_({type:Number})],T.prototype,"yaw",void 0),T=e([y("esri.widgets.PanoramicViewer.PanoramicVideoViewerViewModel")],T);const E=T;export{E as default};
5
+ import{__decorate as e}from"tslib";import t from"../../Camera.js";import i from"../../Ground.js";import o from"../../Map.js";import a from"../../core/Collection.js";import r from"../../core/Error.js";import{EventedAccessor as s}from"../../core/Evented.js";import{JSONMap as n}from"../../core/jsonMap.js";import d from"../../core/Logger.js";import{rad2deg as h,deg2rad as l}from"../../core/mathUtils.js";import{destroyMaybe as m}from"../../core/maybe.js";import{waitTick as c}from"../../core/promiseUtils.js";import{watch as p,syncAndInitial as g,when as u,whenOnce as v}from"../../core/reactiveUtils.js";import{property as _,subclass as y}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import w from"../../geometry/SpatialReference.js";import V from"../../layers/GraphicsLayer.js";import{convertSphereVertexToPixelLocation as M}from"../../layers/orientedImagery/transformations/utils.js";import R from"../../views/SceneView.js";import{fixedImageSize as P}from"../OrientedImageryViewer/constants.js";import{logAndThrow as z,getMissingPropertyErrorName as H,getMissingPropertyErrorMessage as b}from"../OrientedImageryViewer/utils.js";import{defaultImageSphereCenter as F,maxPanoramicViewerHFOV as C,minPanoramicViewerHFOV as S,humanBinocularHFOV as O}from"./constants.js";import j from"./PanoramicZoomConditions.js";import I from"./PanoramicZoomViewModel.js";import{findDiagonalFOV as x,meshToGraphic as L,createImageSphere as k}from"./utils.js";import{enumeration as A}from"../../core/accessorSupport/decorators/enumeration.js";const G={default:"default",navigation:"navigation",fovConstraint:"fov-constraint",clickAction:"image-click-action"};let T=class extends s{constructor(e){super(e),this._startPosition=null,this._targetPosition=null,this._graphics=new V({elevationInfo:{mode:"relative-to-ground"}}),this._imageGraphic=null,this._loadController=null,this._map=new o({ground:new i({opacity:0,navigationConstraint:null}),layers:new a([this._graphics])}),this._zoomViewModel=null,this.autoLoad=!1,this.clickAction="none",this.closestFeature=null,this.currentTime=0,this.imageSize=null,this.oiViewModel=null,this.videoSource=null,this.videoDuration=void 0,this.videoLoaded=!1,this.videoPaused=null,this.videoMuted=null,this.pitch=90,this.state="ready",this.updatingHandles=new f,this.video=null,this.yaw=0,this._addNavigationHandles=()=>{this.imageRenderer.basemapTerrain.suspended=!0,this.imageRenderer.constraints.tilt.max=180,this.removeHandles(G.navigation),this.addHandles([this.imageRenderer.on("mouse-wheel",this._handleWheel),this.imageRenderer.on("double-click",this._handleDoubleClick),this.imageRenderer.on("drag",this._handleDrag),this.imageRenderer.on("key-down",e=>{const t=["+","-","Shift","_","=","ArrowUp","ArrowDown","ArrowRight","ArrowLeft"],i=e.key;t.includes(i)&&e.stopPropagation()})],G.navigation)},this._addHFOVHandles=()=>{this.removeHandles(G.fovConstraint),this.addHandles(p(()=>[this.maxHFOV,this.minHFOV],()=>{this._zoomViewModel&&(this._zoomViewModel.panoramicZoomConditions=new j({view:this.imageRenderer,maxFOV:this.maxHFOV,minFOV:this.minHFOV}))},g),G.fovConstraint)},this._addZoomHandles=()=>{this._zoomViewModel=new I({view:this.imageRenderer,panoramicZoomConditions:new j({maxFOV:this.maxHFOV,minFOV:this.minHFOV})});const e=this.imageRenderer.ui.find("zoom");e&&(e.viewModel=this._zoomViewModel),this._addHFOVHandles()},this._cancelLoadWithController=()=>{this._loadController?.abort(),this._loadController=null},this._handleDoubleClick=e=>{e.stopPropagation(),e.native.ctrlKey?this._zoomOut():this._zoomIn()},this._handleDrag=e=>{e.stopPropagation();const{action:t,x:i,y:o}=e;switch(t){case"start":this._startPosition=this._targetPosition={x:i,y:o};break;case"update":this._targetPosition={x:i,y:o},this._updateCameraHeadingAndTilt()}},this._handleImageClick=e=>{if("image-loaded"===this.state&&this.imageRenderer.ready)switch(this.clickAction){case"emit":e.stopPropagation(),this.emit("click",e);break;case"hittest":e.stopPropagation(),e.defer(async()=>{const t=await this.imageRenderer.hitTest(e.screenPoint,{include:this._graphics});t.results=t.results.filter(e=>"graphic"===e.type&&e.graphic!==this._imageGraphic),this.emit("hittest-response",t)});break;case"pixel-location":{if(e.stopPropagation(),!this.imageSize||!e.mapPoint)return void this.emit("pixel-location",null);const t=M(e.mapPoint,this.imageSize[0],this.imageSize[1]);this.emit("pixel-location",{...t,spatialReference:w.WebMercator});break}}},this._handleWheel=e=>{const t=e.deltaX??e.native.deltaX;e.stopPropagation(),t>0||e.deltaY>0?this._zoomOut():this._zoomIn()},this._loadWithController=()=>{this._cancelLoadWithController(),this._loadController=new AbortController,this.loadVideo(this._loadController)},this._zoomIn=()=>this._zoomViewModel?.zoomIn(),this._zoomOut=()=>this._zoomViewModel?.zoomOut(),this.addGraphic=(e,t)=>"image-loaded"===this.state&&!this._graphics.graphics.includes(e)&&(this._graphics.graphics.add(e,t),!0),this.addManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const t=e.filter(e=>!this._graphics.graphics.includes(e));return this._graphics.graphics.addMany(t),!0},this.clearGraphics=()=>{this._graphics.graphics.removeAll()},this.clearImage=()=>{this.imageSize=null,this._removeImageSphere()},this.enableAudio=()=>{const{video:e}=this;e&&(e.muted=!1,this.videoMuted=!1)},this.removeGraphic=e=>!("image-loaded"!==this.state||!this._graphics.graphics.includes(e))&&(this._graphics.remove(e),!0),this.removeManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const t=e.filter(e=>this._graphics.graphics.includes(e));return this._graphics.removeMany(t),!0},this.togglePanoramicAudio=()=>{if(this.video){const e=this.video.muted;this.video.muted=!e,this.videoMuted=!e}},this._imageRenderer=new R({map:this._map,viewingMode:"local",camera:{position:F},environment:{atmosphereEnabled:!1,starsEnabled:!1,lighting:{type:"virtual"}},popupEnabled:!1,spatialReference:w.WebMercator,attributionVisible:!1,ui:{components:["zoom"]}})}destroy(){this._imageRenderer.destroy()}initialize(){this.state="initialized",this.addHandles([p(()=>this.videoSource,()=>{this.videoSource&&this.autoLoad&&this._loadWithController()},g),p(()=>this.fov,()=>{this._reloadCamera()},g),p(()=>this.yaw,e=>{this.camera&&(this.camera.heading=e,this._reloadCamera())},g),p(()=>this.pitch,e=>{this.camera&&(this.camera.tilt=e,this._reloadCamera())},g),u(()=>this.imageRenderer.ready,()=>{this._addNavigationHandles(),this._addZoomHandles()},g),p(()=>this.clickAction,e=>{this.removeHandles(G.clickAction),"none"!==e&&this.addHandles(this.imageRenderer.on("click",this._handleImageClick))},g),p(()=>this.video,e=>{if(e instanceof HTMLVideoElement){this._startVideo();const t=async()=>{this.currentTime=Number(e.currentTime.toFixed(2)),e.currentTime&&await this._updateVidFootprint(e.currentTime)};e.addEventListener("timeupdate",t),e.addEventListener("play",()=>this._updateVideoIcon(e.paused)),e.addEventListener("pause",()=>this._pauseVideoHandler(e))}},g)],G.default)}get camera(){return this.imageRenderer.destroying||this.imageRenderer.destroyed?null:this.imageRenderer.camera}set camera(e){!e||this.imageRenderer.destroying||this.imageRenderer.destroyed||(this.imageRenderer.camera=e.clone())}get fov(){return this.camera?.fov}set fov(e){Number.isFinite(e)&&this._zoomViewModel?.zoomTo(e)}get hfov(){if(!this.camera||!this.imageRenderer?.ready)return null;const{fov:e}=this.camera,{size:[t,i]}=this.imageRenderer,o=t/i,a=Math.atan(o);return 2*h(Math.atan(Math.tan(l(e/2))*Math.sin(a)))}get imageRenderer(){return this._imageRenderer}get maxHFOV(){const{size:[e,t]}=this.imageRenderer;return this.imageRenderer.ready?x(C,e/t):C}get minHFOV(){const{size:[e,t]}=this.imageRenderer;return this.imageRenderer.ready?x(S,e/t):S}get updating(){return this.updatingHandles.updating}get vfov(){if(!this.camera||!this.imageRenderer?.ready)return null;const{fov:e}=this.camera,{size:[t,i]}=this.imageRenderer,o=t/i,a=Math.atan(o);return 2*h(Math.atan(Math.tan(l(e/2))*Math.cos(a)))}async _loadVideoInternal(e,t){return this.state="image-loading",this.video=document.createElement("video"),this.video.src=e,this.video.addEventListener("loadedmetadata",()=>{this._setVideoDuration(),this.videoLoaded=!0}),this._updateImageSphere(this.video,t)}_pauseVideoHandler(e){this._updateVideoIcon(e.paused)}_setVideoDuration(){const{video:e}=this;e?.duration&&(this.videoDuration=e.duration)}_startVideo(){try{this.enableAudio();const e=this.oiViewModel.currentBestFeature;e&&this.playPanoramicVideoFromSelectedLocation(e)}catch(e){d.getLogger(this).error("oriented-imagery-viewer:video-load",e)}}_reloadCamera(){this.camera=this.camera?.clone()}_removeImageSphere(){this._imageGraphic&&(this._graphics.remove(this._imageGraphic),this._imageGraphic=m(this._imageGraphic)),this.state="ready",this.imageSize=null}_updateCameraHeadingAndTilt(){if(!this._startPosition||!this._targetPosition||!this.camera)return;const e=this.camera.heading+(this._startPosition.x-this._targetPosition.x)/this.imageRenderer.width*this.camera.fov;this.yaw=(e+360)%360;const t=this.camera.tilt-(this._startPosition.y-this._targetPosition.y)/this.imageRenderer.height*this.imageRenderer.camera.tilt;this.pitch=Math.min(179.5,Math.max(.5,t)),this._startPosition=this._targetPosition}async _updateImageSphere(e,t){return await c(t),this._imageGraphic=L(k({data:e})),this._graphics.add(this._imageGraphic),this.state="image-loaded",v(()=>this.imageRenderer.ready,t).then(()=>{const{size:[e,t]}=this.imageRenderer;this.fov=x(O,e/t)}),this.imageSize=P,this._imageGraphic.geometry}async _updateVidFootprint(e){const t=this.oiViewModel?.featureCache.find(t=>t.attributes.offsetFromStart===Math.floor(e)),{yaw:i,pitch:o,vfov:a,hfov:r}=this,s=!(t?.attributes.offsetFromStart&&a&&r&&i&&o),n=t?.attributes.objectId===this.closestFeature?.attributes.objectId;s||n||(this.closestFeature=t,await this.oiViewModel.updateFootprintPanorama({yaw:i,pitch:o,verticalFieldOfView:a,horizontalFieldOfView:r,feature:t}))}_updateVideoIcon(e){this.videoPaused=!!e}async loadVideo(e){return this._removeImageSphere(),this.videoSource?this._loadVideoInternal(this.videoSource,e):z(this.declaredClass,new r(H("panoramic-viewer"),b("PanoramicViewerViewModel","videoSource")))}playPanoramicVideoHandler(){const{video:e}=this;e&&(e.paused?e.play().catch(e=>{d.getLogger(this).error("error playing video",e)}):e.pause())}playPanoramicVideoFromSelectedLocation(e){const t=e.attributes.offsetFromStart;if(t){const e=this.video;e&&(e.currentTime=t,e.play().catch(e=>{d.getLogger(this).error("error playing video",e)}))}}rewindPanoramicVideoHandler(){const{video:e}=this;e&&(e.currentTime=0,e.play().catch(e=>{d.getLogger(this).error("error playing video",e)}))}};e([_()],T.prototype,"_graphics",void 0),e([_()],T.prototype,"_imageGraphic",void 0),e([_()],T.prototype,"_imageRenderer",void 0),e([_()],T.prototype,"_loadController",void 0),e([_()],T.prototype,"_map",void 0),e([_()],T.prototype,"_zoomViewModel",void 0),e([_({type:Boolean})],T.prototype,"autoLoad",void 0),e([_({type:t})],T.prototype,"camera",null),e([A(new n({emit:"emit",hittest:"hittest",none:"none","pixel-location":"pixel-location"}))],T.prototype,"clickAction",void 0),e([_()],T.prototype,"closestFeature",void 0),e([_()],T.prototype,"currentTime",void 0),e([_({type:Number})],T.prototype,"fov",null),e([_({readOnly:!0})],T.prototype,"hfov",null),e([_({readOnly:!0})],T.prototype,"imageRenderer",null),e([_()],T.prototype,"imageSize",void 0),e([_()],T.prototype,"oiViewModel",void 0),e([_()],T.prototype,"videoSource",void 0),e([_()],T.prototype,"videoDuration",void 0),e([_()],T.prototype,"videoLoaded",void 0),e([_()],T.prototype,"videoPaused",void 0),e([_()],T.prototype,"videoMuted",void 0),e([_({readOnly:!0})],T.prototype,"maxHFOV",null),e([_({readOnly:!0})],T.prototype,"minHFOV",null),e([_({type:Number})],T.prototype,"pitch",void 0),e([_()],T.prototype,"state",void 0),e([_()],T.prototype,"updatingHandles",void 0),e([_()],T.prototype,"updating",null),e([_({readOnly:!0})],T.prototype,"vfov",null),e([_()],T.prototype,"video",void 0),e([_({type:Number})],T.prototype,"yaw",void 0),T=e([y("esri.widgets.PanoramicViewer.PanoramicVideoViewerViewModel")],T);const E=T;export{E as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import i from"../../Camera.js";import t from"../../Ground.js";import a from"../../Map.js";import r from"../../request.js";import{createTask as o}from"../../core/asyncUtils.js";import s from"../../core/Collection.js";import n from"../../core/Error.js";import{EventedAccessor as h}from"../../core/Evented.js";import{JSONMap as m}from"../../core/jsonMap.js";import{rad2deg as d,deg2rad as l}from"../../core/mathUtils.js";import{throwIfAborted as c,isAbortError as p,waitTick as g}from"../../core/promiseUtils.js";import{watch as u,syncAndInitial as y,when as _,whenOnce as v}from"../../core/reactiveUtils.js";import{property as f,subclass as w}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as M}from"../../core/support/UpdatingHandles.js";import P from"../../geometry/SpatialReference.js";import R from"../../layers/GraphicsLayer.js";import{convertSphereVertexToPixelLocation as V}from"../../layers/orientedImagery/transformations/utils.js";import{isGraphic as z}from"../../support/guards.js";import C from"../../views/SceneView.js";import{logAndThrow as H,getMissingPropertyErrorName as k,getMissingPropertyErrorMessage as G}from"../OrientedImageryViewer/utils.js";import{defaultImageSphereCenter as S,defaultImageSphereSize as b,maxPanoramicViewerHFOV as I,minPanoramicViewerHFOV as O,humanBinocularHFOV as j}from"./constants.js";import x from"./PanoramicZoomConditions.js";import A from"./PanoramicZoomViewModel.js";import{meshToGraphic as F,findDiagonalFOV as T,loadRaster as L,loadPyramid as N,loadMeshes as E,createImageSphere as W}from"./utils.js";import{enumeration as D}from"../../core/accessorSupport/decorators/enumeration.js";const Z={default:"default",navigation:"navigation",fovConstraint:"fov-constraint",clickAction:"image-click-action"};let U=class extends h{constructor(e){super(e),this._panTask=null,this._startPosition=null,this._targetPosition=null,this.tileCache=[],this._graphics=new R({elevationInfo:{mode:"relative-to-ground"}}),this._imageGraphic=null,this.currentGraphics=new s,this.imagePyramid=null,this.imagePyramidLevel=-1,this._map=new a({ground:new t({opacity:0,navigationConstraint:null}),layers:new s([this._graphics])}),this._imageRenderer=new C({map:this._map,viewingMode:"local",camera:{position:S},environment:{atmosphereEnabled:!1,starsEnabled:!1,lighting:{type:"virtual"}},popupEnabled:!1,spatialReference:P.WebMercator,attributionVisible:!1,ui:{components:["zoom"]}}),this._loadController=null,this.zoomViewModel=new A({panoramicViewerViewModel:this,view:this._imageRenderer,panoramicZoomConditions:new x({})}),this.autoLoad=!1,this.clickAction="none",this.imageMeshDistance=b/2,this.imageSize=null,this.imageSource=null,this.navigationManager=null,this.navigationViewModel=null,this.pitch=90,this.state="ready",this.updatingHandles=new M,this.yaw=0,this._addNavigationHandles=(e=!0)=>{this.imageRenderer.basemapTerrain.suspended=!0,this.removeHandles(Z.navigation);const i=[this.imageRenderer.on("mouse-wheel",this._handleWheel),this.imageRenderer.on("drag",this._handleDrag),this.imageRenderer.on("key-down",e=>{const i=["+","-","Shift","_","=","ArrowUp","ArrowDown","ArrowRight","ArrowLeft"],t=e.key;i.includes(t)&&e.stopPropagation()})];e&&i.push(this.imageRenderer.on("double-click",this._handleDoubleClick)),this.addHandles(i,Z.navigation)},this._addHFOVHandles=()=>{this.removeHandles(Z.fovConstraint),this.addHandles(u(()=>[this.maxHFOV,this.minHFOV],()=>{this.zoomViewModel&&(this.zoomViewModel.panoramicZoomConditions=new x({view:this.imageRenderer,maxFOV:this.maxHFOV,minFOV:this.minHFOV}))},y),Z.fovConstraint)},this._addZoomHandles=()=>{this.zoomViewModel=new A({view:this.imageRenderer,panoramicZoomConditions:new x({maxFOV:this.maxHFOV,minFOV:this.minHFOV}),panoramicViewerViewModel:this});const e=this.imageRenderer.ui.find("zoom");e&&(e.viewModel=this.zoomViewModel),this._addHFOVHandles()},this._cancelLoadWithController=()=>{this._loadController?.abort(),this._loadController=null},this._createPanTask=()=>{this._panTask?.abort(),this._panTask=o(async e=>{if(!this.imagePyramid)return;const{hfov:i,vfov:t,yaw:a,pitch:r}=this,o=this.imagePyramid.getTiles(this.imagePyramidLevel,a,r,i,t).filter(e=>!this.tileCache.includes(`${e.level}/${e.row}/${e.column}`));if(!o?.length)return;const s=await Promise.all(o.map(async i=>await i.loadMesh({signal:e})));c(e);const n=s.map(F);n.forEach((e,i)=>{const t=o[i].key;e.attributes={key:t},this.tileCache.push(t)}),this.addManyGraphics(n),this.currentGraphics.addMany(n),this._panTask=null})},this._handleDoubleClick=e=>{e.stopPropagation(),e.native.ctrlKey?this._zoomOut():this._zoomIn()},this._handleDrag=e=>{e.stopPropagation();const{action:i,x:t,y:a}=e;switch(i){case"start":this._startPosition=this._targetPosition={x:t,y:a};break;case"update":this._targetPosition={x:t,y:a},this._updateCameraHeadingAndTilt()}},this._handleImageClick=e=>{if("image-loaded"===this.state&&this.imageRenderer.ready)switch(this.clickAction){case"emit":e.stopPropagation(),this.emit("click",e);break;case"hittest":e.stopPropagation(),e.defer(async()=>{const i=await this.imageRenderer.hitTest(e.screenPoint,{include:this._graphics}),t=Array.isArray(this._imageGraphic)?this._imageGraphic:[this._imageGraphic].filter(z);i.results=i.results.filter(e=>"graphic"===e.type&&!t.includes(e.graphic)),this.emit("hittest-response",i)});break;case"pixel-location":{if(e.stopPropagation(),!this.imageSize||!e.mapPoint)return void this.emit("pixel-location",null);const i=V(e.mapPoint,this.imageSize[0],this.imageSize[1]);this.emit("pixel-location",{...i,spatialReference:P.WebMercator});break}}},this._handleWheel=e=>{const i=e.deltaX??e.native.deltaX;e.stopPropagation(),i>0||e.deltaY>0?this._zoomOut():this._zoomIn()},this._loadNavigationManager=async()=>{if(!this.navigationManager||this.navigationManager?.destroyed){const e=await import("../OrientedImageryViewer/navigation/NavigationManagerPanoramic.js").then(e=>e.default);this.navigationManager=new e({viewModel:this.navigationViewModel})}return this.navigationManager},this._loadWithController=()=>{this._cancelLoadWithController(),this._loadController=new AbortController,this.loadImage(this._loadController)},this._zoomIn=()=>{this.zoomViewModel?.zoomIn()},this._zoomOut=()=>{this.zoomViewModel?.zoomOut()},this.addGraphic=(e,i)=>"image-loaded"===this.state&&!this._graphics.graphics.includes(e)&&(this._graphics.graphics.add(e,i),!0),this.addManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const i=e.filter(e=>!this._graphics.graphics.includes(e));return this._graphics.graphics.addMany(i),!0},this.clearGraphics=()=>{this._graphics.graphics.removeAll()},this.clearImage=()=>{this.imageSize=null,this._removeImageSphere()},this.navigate=async(e,i)=>this.updatingHandles.addPromise(this.navigateInternal(e,i)),this.navigateInternal=async(e,i)=>{const t=await this._loadNavigationManager();return await t.navigate(e,i)},this.removeGraphic=e=>!("image-loaded"!==this.state||!this._graphics.graphics.includes(e))&&(this._graphics.remove(e),!0),this.removeManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const i=e.filter(e=>this._graphics.graphics.includes(e));return this._graphics.removeMany(i),!0},this.restoreNavigationHandles=()=>{this._addNavigationHandles(!1)}}destroy(){this._imageRenderer.destroy()}initialize(){this.state="initialized",this.addHandles([u(()=>this.imageSource,()=>{this.imageSource&&this.autoLoad&&this._loadWithController()},y),u(()=>this.fov,()=>{this._reloadCamera()},y),u(()=>this.yaw,e=>{this.camera&&(this.camera.heading=e,this._reloadCamera())},y),u(()=>this.pitch,e=>{this.camera&&(this.camera.tilt=e,this._reloadCamera())},y),_(()=>this.imageRenderer.ready,()=>{this._addNavigationHandles(),this._addZoomHandles()},y),u(()=>this.clickAction,e=>{this.removeHandles(Z.clickAction),"none"!==e&&this.addHandles(this.imageRenderer.on("click",this._handleImageClick))},y),u(()=>this.camera,(e,i)=>{this._panTask?.abort(),e?i?.tilt===e.tilt&&i.heading===e.heading||this._createPanTask():this._panTask=null}),this.currentGraphics.on("change",()=>{const e=Array.isArray(this._imageGraphic)?this._imageGraphic:[this._imageGraphic].filter(z),i=this.currentGraphics.map(e=>e.geometry.extent);e.forEach(e=>{e.visible=!0!==i.some(i=>i.intersects(e.geometry.extent))})})],Z.default)}get camera(){return this.imageRenderer.destroying||this.imageRenderer.destroyed?null:this.imageRenderer.camera}set camera(e){!e||this.imageRenderer.destroying||this.imageRenderer.destroyed||(this.imageRenderer.camera=e.clone())}get distanceFactor(){return this.fov?1-5/this.fov:null}get fov(){return this.camera?.fov}set fov(e){Number.isFinite(e)&&this.zoomViewModel?.zoomTo(e)}get hfov(){if(!this.camera||!this.imageRenderer?.ready)return 0;const{fov:e}=this.camera,{size:[i,t]}=this.imageRenderer,a=i/t;return 2*d(Math.atan(Math.tan(l(e/2))*a/Math.sqrt(1+a**2)))}get imageRenderer(){return this._imageRenderer}get maxHFOV(){const{size:[e,i]}=this.imageRenderer;return this.imageRenderer.ready?T(I,e/i):I}get minHFOV(){const{size:[e,i]}=this.imageRenderer;return this.imageRenderer.ready?T(O,e/i):O}get updating(){return this.updatingHandles.updating}get vfov(){if(!this.camera||!this.imageRenderer?.ready)return 0;const{fov:e}=this.camera,{size:[i,t]}=this.imageRenderer,a=i/t;return 2*d(Math.atan(Math.tan(l(e/2))*(1/Math.sqrt(1+a**2))))}_clearImageSphere(){if(!this._imageGraphic)return;const e=Array.isArray(this._imageGraphic)?this._imageGraphic:[this._imageGraphic];this._graphics.removeMany(e),this._imageGraphic=null,e.forEach(e=>e.destroy()),this._graphics.removeMany(this.currentGraphics.toArray()),this.imagePyramid=null,this.imagePyramidLevel=-1,this.tileCache=[]}async _loadImageInternal(e,i){let t;this.state="image-loading";try{t=(await r(e,{responseType:"image",...i})).data}catch(a){throw p(a)?this.state="image-load-aborted":this.state="image-load-error",a}return this._updateImageSphere(t,i)}async loadImageTiled(e,i){this._removeImageSphere(),this.state="image-loading";try{const t=await L(e,i),a=await N(t,i),r=a.getLowResolutionTiles(),o=await E(r,i),{imageSize:s}=a;if(c(i),!r?.length)throw new n("panoramic-viewer:missing-tiles","No tiles were found in the pyramid",{imageSource:e});this.imagePyramid=a,this.imagePyramidLevel=a.maximumPyramidLevel;const h=o.map(F);h.forEach((e,i)=>{const t=r[i].key;e.attributes={key:t},this.tileCache.push(t)}),this._imageGraphic=h,this._graphics.addMany(this._imageGraphic),this.state="image-loaded",v(()=>this.imageRenderer.ready,i).then(()=>{const{size:[e,i]}=this.imageRenderer;this.fov=T(j,e/i)}),this.imageSize=s}catch(t){throw this.state=p(t)?"image-load-aborted":"image-load-error",t}}_reloadCamera(){this.camera=this.camera?.clone()}_removeImageSphere(){this._clearImageSphere(),this.state="ready",this.imageSize=null}_updateCameraHeadingAndTilt(){if(!this._startPosition||!this._targetPosition||!this.camera)return;const e=this.camera.heading+(this._startPosition.x-this._targetPosition.x)/this.imageRenderer.width*this.camera.fov;this.yaw=(e+360)%360;const i=this.camera.tilt-(this._startPosition.y-this._targetPosition.y)/this.imageRenderer.height*this.imageRenderer.camera.tilt;this.pitch=Math.min(179.5,Math.max(.5,i)),this._startPosition=this._targetPosition}async _updateImageSphere(e,i){return await g(i),this._imageGraphic=F(W(e)),this._graphics.add(this._imageGraphic),this.state="image-loaded",v(()=>this.imageRenderer.ready,i).then(()=>{const{size:[e,i]}=this.imageRenderer;this.fov=T(j,e/i)}),this.imageSize=[e.width,e.height],this._imageGraphic.geometry}async loadImage(e){return this._removeImageSphere(),this.imageSource?this._loadImageInternal(this.imageSource,e):H(this.declaredClass,new n(k("panoramic-viewer"),G("PanoramicViewerViewModel","imageSource")))}};e([f()],U.prototype,"_graphics",void 0),e([f()],U.prototype,"_imageGraphic",void 0),e([f({constructOnly:!0})],U.prototype,"currentGraphics",void 0),e([f()],U.prototype,"imagePyramid",void 0),e([f()],U.prototype,"imagePyramidLevel",void 0),e([f()],U.prototype,"_map",void 0),e([f()],U.prototype,"_imageRenderer",void 0),e([f()],U.prototype,"_loadController",void 0),e([f()],U.prototype,"zoomViewModel",void 0),e([f({type:Boolean})],U.prototype,"autoLoad",void 0),e([f({type:i})],U.prototype,"camera",null),e([D(new m({emit:"emit",hittest:"hittest",none:"none","pixel-location":"pixel-location"}))],U.prototype,"clickAction",void 0),e([f()],U.prototype,"distanceFactor",null),e([f({type:Number})],U.prototype,"fov",null),e([f({readOnly:!0})],U.prototype,"hfov",null),e([f()],U.prototype,"imageMeshDistance",void 0),e([f({readOnly:!0})],U.prototype,"imageRenderer",null),e([f()],U.prototype,"imageSize",void 0),e([f()],U.prototype,"imageSource",void 0),e([f({readOnly:!0})],U.prototype,"maxHFOV",null),e([f({readOnly:!0})],U.prototype,"minHFOV",null),e([f()],U.prototype,"navigationViewModel",void 0),e([f({type:Number})],U.prototype,"pitch",void 0),e([f()],U.prototype,"state",void 0),e([f()],U.prototype,"updatingHandles",void 0),e([f()],U.prototype,"updating",null),e([f({readOnly:!0})],U.prototype,"vfov",null),e([f({type:Number})],U.prototype,"yaw",void 0),U=e([w("esri.widgets.PanoramicViewer.PanoramicViewerViewModel")],U);const q=U;export{q as default};
5
+ import{__decorate as e}from"tslib";import i from"../../Camera.js";import t from"../../Ground.js";import a from"../../Map.js";import r from"../../request.js";import{createTask as o}from"../../core/asyncUtils.js";import s from"../../core/Collection.js";import{deprecatedProperty as n,deprecatedFunction as h}from"../../core/deprecate.js";import m from"../../core/Error.js";import{EventedAccessor as d}from"../../core/Evented.js";import{JSONMap as l}from"../../core/jsonMap.js";import c from"../../core/Logger.js";import{rad2deg as g,deg2rad as p}from"../../core/mathUtils.js";import{throwIfAborted as u,isAbortError as y,waitTick as _}from"../../core/promiseUtils.js";import{watch as v,syncAndInitial as f,whenOnce as w,when as M}from"../../core/reactiveUtils.js";import{property as P,subclass as C}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as R}from"../../core/support/UpdatingHandles.js";import V from"../../geometry/SpatialReference.js";import z from"../../layers/GraphicsLayer.js";import{convertSphereVertexToPixelLocation as G}from"../../layers/orientedImagery/transformations/utils.js";import{isGraphic as S}from"../../support/guards.js";import H from"../../views/SceneView.js";import{logAndThrow as k,getMissingPropertyErrorName as O,getMissingPropertyErrorMessage as j}from"../OrientedImageryViewer/utils.js";import{defaultImageSphereCenter as b,defaultImageSphereSize as I,humanBinocularHFOV as x,maxPanoramicViewerHFOV as A,minPanoramicViewerHFOV as F}from"./constants.js";import L from"./PanoramicZoomConditions.js";import T from"./PanoramicZoomViewModel.js";import{meshToGraphic as N,findDiagonalFOV as E,loadRaster as W,loadPyramid as D,loadMeshes as Z,createImageSphere as U}from"./utils.js";import q from"./support/PanoramicMedia.js";import $ from"./support/PanoramicMediaCollection.js";import{enumeration as K}from"../../core/accessorSupport/decorators/enumeration.js";const X={default:"default",navigation:"navigation",fovConstraint:"fov-constraint",clickAction:"image-click-action"};let B=class extends d{constructor(e){super(e),this._panTask=null,this._startPosition=null,this._targetPosition=null,this.tileCache=new Set,this._graphics=new z({elevationInfo:{mode:"relative-to-ground"}}),this._imageGraphic=null,this.currentGraphics=new s,this.imagePyramid=null,this.imagePyramidLevel=-1,this._map=new a({ground:new t({opacity:0,navigationConstraint:null}),layers:new s([this._graphics])}),this._imageRenderer=new H({map:this._map,viewingMode:"local",camera:{position:b},environment:{atmosphereEnabled:!1,starsEnabled:!1,lighting:{type:"virtual"}},popupEnabled:!1,spatialReference:V.WebMercator,attributionVisible:!1,ui:{components:["zoom"]}}),this._loadController=null,this.zoomViewModel=new T({panoramicViewerViewModel:this,view:this._imageRenderer,panoramicZoomConditions:new L({})}),this.autoLoad=!1,this.clickAction="none",this.mediaCollection=new $,this.imageMeshDistance=I/2,this.imageSize=null,this.navigationManager=null,this.navigationViewModel=null,this.pitch=90,this.state="ready",this.updatingHandles=new R,this.yaw=0,this._addNavigationHandles=(e=!0)=>{this.imageRenderer.basemapTerrain.suspended=!0,this.removeHandles(X.navigation);const i=[this.imageRenderer.on("mouse-wheel",this._handleWheel),this.imageRenderer.on("drag",this._handleDrag),this.imageRenderer.on("key-down",e=>{const i=["+","-","Shift","_","=","ArrowUp","ArrowDown","ArrowRight","ArrowLeft"],t=e.key;i.includes(t)&&e.stopPropagation()})];e&&i.push(this.imageRenderer.on("double-click",this._handleDoubleClick)),this.addHandles(i,X.navigation)},this._addHFOVHandles=()=>{this.removeHandles(X.fovConstraint),this.addHandles(v(()=>[this.maxHFOV,this.minHFOV],()=>{this.zoomViewModel&&(this.zoomViewModel.panoramicZoomConditions=new L({view:this.imageRenderer,maxFOV:this.maxHFOV,minFOV:this.minHFOV}))},f),X.fovConstraint)},this._addZoomHandles=()=>{this.zoomViewModel=new T({view:this.imageRenderer,panoramicZoomConditions:new L({maxFOV:this.maxHFOV,minFOV:this.minHFOV}),panoramicViewerViewModel:this});const e=this.imageRenderer.ui.find("zoom");e&&(e.viewModel=this.zoomViewModel),this._addHFOVHandles()},this._cancelLoadWithController=()=>{this._loadController?.abort(),this._loadController=null},this._createPanTask=()=>{this._panTask?.abort(),this._panTask=o(async e=>{if(!this.imagePyramid)return;const{hfov:i,vfov:t,yaw:a,pitch:r}=this,o=this.imagePyramid.getTiles(this.imagePyramidLevel,a,r,i,t).filter(e=>!this.tileCache.has(`${e.level}/${e.row}/${e.column}`));if(!o?.length)return;const s=await Promise.all(o.map(async i=>await i.loadMesh({signal:e})));u(e);const n=s.map(N);n.forEach((e,i)=>{const t=o[i].key;e.attributes={key:t},this.tileCache.add(t)}),this.addManyGraphics(n),this.currentGraphics.addMany(n),this._panTask=null})},this._handleDoubleClick=e=>{e.stopPropagation(),e.native.ctrlKey?this._zoomOut():this._zoomIn()},this._handleDrag=e=>{e.stopPropagation();const{action:i,x:t,y:a}=e;switch(i){case"start":this._startPosition=this._targetPosition={x:t,y:a};break;case"update":this._targetPosition={x:t,y:a},this._updateCameraHeadingAndTilt()}},this._handleImageClick=e=>{if("image-loaded"===this.state&&this.imageRenderer.ready)switch(this.clickAction){case"emit":e.stopPropagation(),this.emit("click",e);break;case"hittest":e.stopPropagation(),e.defer(async()=>{const i=await this.imageRenderer.hitTest(e.screenPoint,{include:this._graphics}),t=Array.isArray(this._imageGraphic)?this._imageGraphic:[this._imageGraphic].filter(S);i.results=i.results.filter(e=>"graphic"===e.type&&!t.includes(e.graphic)),this.emit("hittest-response",i)});break;case"pixel-location":{if(e.stopPropagation(),!this.imageSize||!e.mapPoint)return void this.emit("pixel-location",null);const i=G(e.mapPoint,this.imageSize[0],this.imageSize[1]);this.emit("pixel-location",{...i,spatialReference:V.WebMercator});break}}},this._handleWheel=e=>{const i=e.deltaX??e.native.deltaX;e.stopPropagation(),i>0||e.deltaY>0?this._zoomOut():this._zoomIn()},this._loadNavigationManager=async()=>{if(!this.navigationManager||this.navigationManager?.destroyed){const e=await import("../OrientedImageryViewer/navigation/NavigationManagerPanoramic.js").then(e=>e.default);this.navigationManager=new e({viewModel:this.navigationViewModel})}return this.navigationManager},this._loadWithController=()=>{this._cancelLoadWithController(),this._loadController=new AbortController,this.loadMedia(this.mediaCollection.at(0),this._loadController)},this._zoomIn=()=>{this.zoomViewModel?.zoomIn()},this._zoomOut=()=>{this.zoomViewModel?.zoomOut()},this.addGraphic=(e,i)=>"image-loaded"===this.state&&!this._graphics.graphics.includes(e)&&(this._graphics.graphics.add(e,i),!0),this.addManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const i=e.filter(e=>!this._graphics.graphics.includes(e));return this._graphics.graphics.addMany(i),!0},this.clearGraphics=()=>{this._graphics.graphics.removeAll()},this.clearImage=()=>{this.imageSize=null,this._removeImageSphere()},this.loadMedia=async(e,i)=>{this._removeImageSphere();const{meshOrMeshes:t,size:a,tileKeys:r}=await e.load(i),o=e.imagePyramid;if(u(i),o){const i=t;if(!i?.length)throw new m("panoramic-viewer:missing-tiles","No tiles were found in the pyramid",e.url);const a=i.map(N);a.forEach((e,i)=>{const t=r?.[i];e.attributes={key:t},this.tileCache.add(t)}),this._imageGraphic=a,this._graphics.addMany(this._imageGraphic)}else{const e=t;this._imageGraphic=N(e),this._graphics.add(this._imageGraphic)}this.state="image-loaded",w(()=>this.imageRenderer.ready,i).then(()=>{const{size:[e,i]}=this.imageRenderer;this.fov=E(x,e/i)}),this.imageSize=a},this.navigate=async(e,i)=>this.updatingHandles.addPromise(this.navigateInternal(e,i)),this.navigateInternal=async(e,i)=>{const t=await this._loadNavigationManager();return await t.navigate(e,i)},this.removeGraphic=e=>!("image-loaded"!==this.state||!this._graphics.graphics.includes(e))&&(this._graphics.remove(e),!0),this.removeManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const i=e.filter(e=>this._graphics.graphics.includes(e));return this._graphics.removeMany(i),!0},this.restoreNavigationHandles=()=>{this._addNavigationHandles(!1)}}destroy(){this._imageRenderer.destroy()}initialize(){this.state="initialized",this.addHandles([M(()=>this.mediaCollection.length>0,()=>{this.imageSource&&this.autoLoad&&this._loadWithController()},f),v(()=>this.fov,()=>{this._reloadCamera()},f),v(()=>this.yaw,e=>{this.camera&&(this.camera.heading=e,this._reloadCamera())},f),v(()=>this.pitch,e=>{this.camera&&(this.camera.tilt=e,this._reloadCamera())},f),M(()=>this.imageRenderer.ready,()=>{this._addNavigationHandles(),this._addZoomHandles()},f),v(()=>this.clickAction,e=>{this.removeHandles(X.clickAction),"none"!==e&&this.addHandles(this.imageRenderer.on("click",this._handleImageClick))},f),v(()=>this.camera,(e,i)=>{this._panTask?.abort(),e?i?.tilt===e.tilt&&i.heading===e.heading||this._createPanTask():this._panTask=null}),this.currentGraphics.on("change",()=>{const e=Array.isArray(this._imageGraphic)?this._imageGraphic:[this._imageGraphic].filter(S),i=this.currentGraphics.map(e=>e.geometry.extent);e.forEach(e=>{e.visible=!0!==i.some(i=>i.intersects(e.geometry.extent))})})],X.default)}get camera(){return this.imageRenderer.destroying||this.imageRenderer.destroyed?null:this.imageRenderer.camera}set camera(e){!e||this.imageRenderer.destroying||this.imageRenderer.destroyed||(this.imageRenderer.camera=e.clone())}get distanceFactor(){return this.fov?1-5/this.fov:null}get fov(){return this.camera?.fov}set fov(e){Number.isFinite(e)&&this.zoomViewModel?.zoomTo(e)}get hfov(){if(!this.camera||!this.imageRenderer?.ready)return 0;const{fov:e}=this.camera,{size:[i,t]}=this.imageRenderer,a=i/t;return 2*g(Math.atan(Math.tan(p(e/2))*a/Math.sqrt(1+a**2)))}get imageRenderer(){return this._imageRenderer}set imageSource(e){n(c.getLogger(this),"imageSource",{replacement:"Please use mediaCollection instead",warnOnce:!0,version:"5.0"}),e&&this.mediaCollection.splice(0,0,new q({url:e}))}get imageSource(){return n(c.getLogger(this),"imageSource",{replacement:"Please use mediaCollection instead",warnOnce:!0,version:"5.0"}),0===this.mediaCollection.length?null:this.mediaCollection.at(0)?.url}get maxHFOV(){const{size:[e,i]}=this.imageRenderer;return this.imageRenderer.ready?E(A,e/i):A}get minHFOV(){const{size:[e,i]}=this.imageRenderer;return this.imageRenderer.ready?E(F,e/i):F}get updating(){return this.updatingHandles.updating}get vfov(){if(!this.camera||!this.imageRenderer?.ready)return 0;const{fov:e}=this.camera,{size:[i,t]}=this.imageRenderer,a=i/t;return 2*g(Math.atan(Math.tan(p(e/2))*(1/Math.sqrt(1+a**2))))}_clearImageSphere(){if(!this._imageGraphic)return;const e=Array.isArray(this._imageGraphic)?this._imageGraphic:[this._imageGraphic];this._graphics.removeMany(e),this._imageGraphic=null,e.forEach(e=>e.destroy()),this._graphics.removeMany(this.currentGraphics.toArray()),this.imagePyramid=null,this.imagePyramidLevel=-1,this.tileCache.clear()}async _loadImageInternal(e,i){let t;this.state="image-loading";try{t=(await r(e,{responseType:"image",...i})).data}catch(a){throw y(a)?this.state="image-load-aborted":this.state="image-load-error",a}return this._updateImageSphere(t,i)}async loadImageTiled(e,i){this._removeImageSphere(),this.state="image-loading";try{const t=await W(e,i),a=await D(t,i),r=a.getLowResolutionTiles(),o=await Z(r,i),{imageSize:s}=a;if(u(i),!r?.length)throw new m("panoramic-viewer:missing-tiles","No tiles were found in the pyramid",{imageSource:e});this.imagePyramid=a,this.imagePyramidLevel=a.maximumPyramidLevel;const n=o.map(N);n.forEach((e,i)=>{const t=r[i].key;e.attributes={key:t},this.tileCache.add(t)}),this._imageGraphic=n,this._graphics.addMany(this._imageGraphic),this.state="image-loaded",w(()=>this.imageRenderer.ready,i).then(()=>{const{size:[e,i]}=this.imageRenderer;this.fov=E(x,e/i)}),this.imageSize=s}catch(t){throw this.state=y(t)?"image-load-aborted":"image-load-error",t}}_reloadCamera(){this.camera=this.camera?.clone()}_removeImageSphere(){this._clearImageSphere(),this.state="ready",this.imageSize=null}_updateCameraHeadingAndTilt(){if(!this._startPosition||!this._targetPosition||!this.camera)return;const e=this.camera.heading+(this._startPosition.x-this._targetPosition.x)/this.imageRenderer.width*this.camera.fov;this.yaw=(e+360)%360;const i=this.camera.tilt-(this._startPosition.y-this._targetPosition.y)/this.imageRenderer.height*this.imageRenderer.camera.tilt;this.pitch=Math.min(179.5,Math.max(.5,i)),this._startPosition=this._targetPosition}async _updateImageSphere(e,i){return await _(i),this._imageGraphic=N(U({data:e})),this._graphics.add(this._imageGraphic),this.state="image-loaded",w(()=>this.imageRenderer.ready,i).then(()=>{const{size:[e,i]}=this.imageRenderer;this.fov=E(x,e/i)}),this.imageSize=[e.width,e.height],this._imageGraphic.geometry}async loadImage(e){return h(c.getLogger(this),"loadImage",{replacement:"loadImage is deprecated in favor of loadMedia",warnOnce:!0,version:"5.0"}),this._removeImageSphere(),this.imageSource?this._loadImageInternal(this.imageSource,e):k(this.declaredClass,new m(O("panoramic-viewer"),j("PanoramicViewerViewModel","imageSource")))}};e([P()],B.prototype,"_graphics",void 0),e([P()],B.prototype,"_imageGraphic",void 0),e([P({constructOnly:!0})],B.prototype,"currentGraphics",void 0),e([P()],B.prototype,"imagePyramid",void 0),e([P()],B.prototype,"imagePyramidLevel",void 0),e([P()],B.prototype,"_map",void 0),e([P()],B.prototype,"_imageRenderer",void 0),e([P()],B.prototype,"_loadController",void 0),e([P()],B.prototype,"zoomViewModel",void 0),e([P({type:Boolean})],B.prototype,"autoLoad",void 0),e([P({type:i})],B.prototype,"camera",null),e([K(new l({emit:"emit",hittest:"hittest",none:"none","pixel-location":"pixel-location"}))],B.prototype,"clickAction",void 0),e([P()],B.prototype,"distanceFactor",null),e([P({type:Number})],B.prototype,"fov",null),e([P({readOnly:!0})],B.prototype,"hfov",null),e([P({type:$})],B.prototype,"mediaCollection",void 0),e([P()],B.prototype,"imageMeshDistance",void 0),e([P({readOnly:!0})],B.prototype,"imageRenderer",null),e([P()],B.prototype,"imageSize",void 0),e([P()],B.prototype,"imageSource",null),e([P({readOnly:!0})],B.prototype,"maxHFOV",null),e([P({readOnly:!0})],B.prototype,"minHFOV",null),e([P()],B.prototype,"navigationViewModel",void 0),e([P({type:Number})],B.prototype,"pitch",void 0),e([P()],B.prototype,"state",void 0),e([P()],B.prototype,"updatingHandles",void 0),e([P()],B.prototype,"updating",null),e([P({readOnly:!0})],B.prototype,"vfov",null),e([P({type:Number})],B.prototype,"yaw",void 0),B=e([C("esri.widgets.PanoramicViewer.PanoramicViewerViewModel")],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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import i from"../../core/Accessor.js";import{createTask as e}from"../../core/asyncUtils.js";import{throwIfAborted as t}from"../../core/promiseUtils.js";import{property as s,subclass as a}from"../../core/accessorSupport/decorators.js";import{meshToGraphic as r}from"./utils.js";let m=class extends i{constructor(o){super(o),this._zoomTask=null,this.panoramicZoomViewModel=null,this._updateGraphicsFromTiles=async(o,i,e,s,a)=>{const m=await Promise.all(o.map(async o=>{const i=await o.loadMesh(a);return r(i)}));t(a);const n=s.removeAll();i.splice(0),m.forEach((e,t)=>{const s=o[t].key;e.attributes={key:s},i.push(s)}),s.addMany(m),this.viewModel?.set({imagePyramidLevel:e}),this.viewModel?.addManyGraphics(m),this.viewModel?.removeManyGraphics(n)},this._zoomIn=async o=>{if(t(o),!this.viewModel)return this.panoramicZoomViewModel.zoomInFOV();const{imagePyramid:i,yaw:e,hfov:s,vfov:a,pitch:r,tileCache:m,currentGraphics:n,imageRenderer:{size:l},imagePyramidLevel:c}=this.viewModel;if(!i)return this.panoramicZoomViewModel.zoomInFOV();const h=s/l[0],d=i.getLevelWithPixelAngle(h);if(0===c||c===d)return this.panoramicZoomViewModel.zoomInFOV();const p=i.getTiles(d,e,r,s,a);return p?(await this._updateGraphicsFromTiles(p,m,d,n,{signal:o}),this.panoramicZoomViewModel.zoomInFOV()):this.panoramicZoomViewModel.zoomInFOV()},this._zoomOut=async o=>{if(t(o),!this.viewModel)return this.panoramicZoomViewModel.zoomOutFOV();const{imagePyramid:i,yaw:e,hfov:s,vfov:a,pitch:r,tileCache:m,currentGraphics:n,imagePyramidLevel:l,imageRenderer:{size:c}}=this.viewModel;if(!i)return this.panoramicZoomViewModel.zoomOutFOV();const h=i.maximumPyramidLevel,d=s/c[0],p=i.getLevelWithPixelAngle(d);if(h===l||p===l)return this.panoramicZoomViewModel.zoomOutFOV();const u=i.getTiles(p,e,r,s,a);return u?(await this._updateGraphicsFromTiles(u,m,p,n,{signal:o}),this.panoramicZoomViewModel.zoomOutFOV()):this.panoramicZoomViewModel.zoomOutFOV()},this.zoomIn=o=>{(null==this._zoomTask||this._zoomTask.finished)&&(this._zoomTask=e(this._zoomIn,o))},this.zoomOut=o=>{(null==this._zoomTask||this._zoomTask.finished)&&(this._zoomTask=e(this._zoomOut,o))}}};o([s()],m.prototype,"viewModel",void 0),o([s()],m.prototype,"panoramicZoomViewModel",void 0),m=o([a("esri.widgets.PanoramicViewer.PanoramicZoomManager")],m);export{m as PanoramicZoomManager};
5
+ import{__decorate as o}from"tslib";import i from"../../core/Accessor.js";import{createTask as e}from"../../core/asyncUtils.js";import{throwIfAborted as t}from"../../core/promiseUtils.js";import{property as s,subclass as a}from"../../core/accessorSupport/decorators.js";import{meshToGraphic as r}from"./utils.js";let m=class extends i{constructor(o){super(o),this._zoomTask=null,this.panoramicZoomViewModel=null,this._updateGraphicsFromTiles=async(o,i,e,s,a)=>{const m=await Promise.all(o.map(async o=>{const i=await o.loadMesh(a);return r(i)}));t(a);const n=s.removeAll();i.clear(),m.forEach((e,t)=>{const s=o[t].key;e.attributes={key:s},i.add(s)}),s.addMany(m),this.viewModel?.set({imagePyramidLevel:e}),this.viewModel?.addManyGraphics(m),this.viewModel?.removeManyGraphics(n)},this._zoomIn=async o=>{if(t(o),!this.viewModel)return this.panoramicZoomViewModel.zoomInFOV();const{imagePyramid:i,yaw:e,hfov:s,vfov:a,pitch:r,tileCache:m,currentGraphics:n,imageRenderer:{size:l},imagePyramidLevel:c}=this.viewModel;if(!i)return this.panoramicZoomViewModel.zoomInFOV();const h=s/l[0],d=i.getLevelWithPixelAngle(h);if(0===c||c===d)return this.panoramicZoomViewModel.zoomInFOV();const p=i.getTiles(d,e,r,s,a);return p?(await this._updateGraphicsFromTiles(p,m,d,n,{signal:o}),this.panoramicZoomViewModel.zoomInFOV()):this.panoramicZoomViewModel.zoomInFOV()},this._zoomOut=async o=>{if(t(o),!this.viewModel)return this.panoramicZoomViewModel.zoomOutFOV();const{imagePyramid:i,yaw:e,hfov:s,vfov:a,pitch:r,tileCache:m,currentGraphics:n,imagePyramidLevel:l,imageRenderer:{size:c}}=this.viewModel;if(!i)return this.panoramicZoomViewModel.zoomOutFOV();const h=i.maximumPyramidLevel,d=s/c[0],p=i.getLevelWithPixelAngle(d);if(h===l||p===l)return this.panoramicZoomViewModel.zoomOutFOV();const u=i.getTiles(p,e,r,s,a);return u?(await this._updateGraphicsFromTiles(u,m,p,n,{signal:o}),this.panoramicZoomViewModel.zoomOutFOV()):this.panoramicZoomViewModel.zoomOutFOV()},this.zoomIn=o=>{(null==this._zoomTask||this._zoomTask.finished)&&(this._zoomTask=e(this._zoomIn,o))},this.zoomOut=o=>{(null==this._zoomTask||this._zoomTask.finished)&&(this._zoomTask=e(this._zoomOut,o))}}};o([s()],m.prototype,"viewModel",void 0),o([s()],m.prototype,"panoramicZoomViewModel",void 0),m=o([a("esri.widgets.PanoramicViewer.PanoramicZoomManager")],m);export{m as PanoramicZoomManager};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as i}from"tslib";import{on as o}from"../../../core/events.js";import{rad2deg as t}from"../../../core/mathUtils.js";import{EsriPromise as e}from"../../../core/Promise.js";import{createResolver as s,onAbort as r}from"../../../core/promiseUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{whenVideoPlayable as n}from"../../../layers/support/videoUtils.js";import{fixedImageSize as l}from"../../OrientedImageryViewer/constants.js";import{guessExtensionFromURI as m,loadRaster as d,loadPyramid as c,loadMeshes as p,createImageSphere as u}from"../utils.js";import z from"./PanoramicMediaError.js";const y=0,w=0,g=0,f=new Set(["JPG","JPEG","TIFF","TIF","MRF"]),P=new Set(["MRF","TIFF","TIF"]);let v=class extends e{constructor(i){super(i),this._size=[0,0],this._cache=null,this.autoLoad=!1,this.cameraHeading=null,this.extension=null,this.imagePyramid=null,this.type="image",this.uiStrings={}}destroy(){this._cache=null}get horizonPitch(){const{matrix:i}=this;return i?t(Math.asin(-i[6])):y}get horizonRoll(){const{matrix:i}=this;return i?t(Math.atan(i[7]/i[8])):g}get horizonYaw(){const{matrix:i,cameraHeading:o}=this;return i?t(Math.atan2(i[3],i[0])):o?-o:w}get size(){return this._size}async load(i){if("video"===this.type)return this.loadVideoMesh(i);let o=this.extension;if(o||(o=m(this.url)),!o||!f.has(o))throw new z("unsupported-format",this.uiStrings["unsupported-format"]??"Unsupported image format: {extension}",{extension:o});return P.has(o)?this.loadOptimizedImageMesh(i):this.loadImageMesh(i)}async loadOptimizedImageMesh(i){const o=await d(this.url,i);this.imagePyramid=await c(o,i);const t=this.imagePyramid.getLowResolutionTiles(),e=await p(t,i);return this._size=this.imagePyramid.imageSize,{meshOrMeshes:e,size:this._size,tileKeys:t?.map(i=>i.key)}}async loadVideoMesh(i){if(this._cache){return{meshOrMeshes:await u({data:this._cache,horizonPitch:this.horizonPitch,horizonRoll:this.horizonRoll,horizonYaw:this.horizonYaw}).load(i),size:this._size}}const o=await this._resolveMedia(i);this._cache=o.media,this._size=[...l];return{meshOrMeshes:await u({data:this._cache,horizonPitch:this.horizonPitch,horizonRoll:this.horizonRoll,horizonYaw:this.horizonYaw}).load(i),size:this._size}}async loadImageMesh(i){if(this._cache){return{meshOrMeshes:await u({data:this._cache,horizonPitch:this.horizonPitch,horizonRoll:this.horizonRoll,horizonYaw:this.horizonYaw}).load(i),size:this._size}}const o=await this._resolveMedia(i);this._cache=o.media;const t=o.mesh;return this._size=[o.media.width,o.media.height],{meshOrMeshes:t,size:this._size}}async _resolveMedia(i){const t=s(),e=r(i?.signal,t.resolve),a="video"===this.type?document.createElement("video"):document.createElement("img");a.crossOrigin="anonymous",a.src=this.url;let h=null;const l="video"===this.type?n(a,this.addHandles):await new Promise((i,t)=>{h=[o(a,"error",()=>{t(new z("unknown",this.uiStrings["media-load-failure"]??"Could not load media from URL: {url}",{url:this.url}))}),o(a,"load",i)]}).finally(()=>{h?.forEach(i=>i.remove()),h=null}),m=Promise.race([l,t.promise]);this.addResolvingPromise(m);try{await m}finally{e?.remove()}const d=a;if(!d)throw new z("unknown","Could not load media",{url:this.url});return{media:d,mesh:await u({data:a,horizonPitch:this.horizonPitch,horizonRoll:this.horizonRoll,horizonYaw:this.horizonYaw}).load(i)}}};i([a()],v.prototype,"_size",void 0),i([a()],v.prototype,"autoLoad",void 0),i([a()],v.prototype,"cameraHeading",void 0),i([a()],v.prototype,"extension",void 0),i([a()],v.prototype,"horizonPitch",null),i([a()],v.prototype,"horizonRoll",null),i([a()],v.prototype,"horizonYaw",null),i([a()],v.prototype,"id",void 0),i([a()],v.prototype,"imagePyramid",void 0),i([a()],v.prototype,"matrix",void 0),i([a()],v.prototype,"size",null),i([a()],v.prototype,"type",void 0),i([a()],v.prototype,"uiStrings",void 0),i([a()],v.prototype,"url",void 0),i([a()],v.prototype,"load",null),v=i([h("esri.widgets.PanoramicViewer.support.PanoramicMedia")],v);const _=v;export{_ as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import o from"../../../core/Collection.js";import r from"./PanoramicMedia.js";const e=o.ofType(r);export{e as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import r from"../../../core/Error.js";class s extends r{constructor(r,s,e){super(r,s,e),this.name="unknown",this.name=r}}export{s as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../Graphic.js";import r from"../../core/Collection.js";import e from"../../core/Error.js";import{rad2deg as o,deg2rad as s}from"../../core/mathUtils.js";import{throwIfAborted as n}from"../../core/promiseUtils.js";import i from"../../geometry/Mesh.js";import a from"../../geometry/support/MeshMaterial.js";import m from"../../geometry/support/MeshTexture.js";import u from"../../symbols/FillSymbol3DLayer.js";import c from"../../symbols/MeshSymbol3D.js";import{defaultImageSphereCenter as p,defaultImageSphereSize as l}from"./constants.js";import{loadRasterFactory as f,loadPanoramicTilePyramid as w}from"./support/importUtils.js";function y(t,r=p,e=l){const o=r.clone();o.z=-l/2;const s=i.createSphere(o,{size:e,densificationFactor:2,vertexSpace:"georeferenced",material:new a({colorTexture:new m({data:t})})});if(s.components[0].trustSourceNormals=!0,s.vertexAttributes.uv){const t=s.vertexAttributes.uv.length??0;for(let r=0;r<t;r++)s.vertexAttributes.uv[2*r+0]=1-s.vertexAttributes.uv[2*r+0],s.vertexAttributes.uv[2*r+1]=s.vertexAttributes.uv[2*r+1]}return s.centerAt(o),s}function h(e){return new t({geometry:e,symbol:new c({symbolLayers:new r([new u])})})}function v(t,r){return 2*o(Math.atan(Math.tan(s(t/2))*Math.sqrt((1/r)**2+1)))}async function b(t,r){const e=await f(),o=await e.open({url:t,ioConfig:{skipExtensions:["jgw","aux.xml"],skipMapInfo:!0},...r});return n(r),j(o,{url:t})}const j=(t,r)=>{if(!t)throw new e("panoramic-viewer:missing-raster","Raster data could not be loaded",r);return t};async function x(t,r){const e=await w();return n(r),new e({raster:t})}async function g(t,r){return t?.length?await Promise.all(t.map(t=>t.loadMesh(r))):[]}export{y as createImageSphere,v as findDiagonalFOV,g as loadMeshes,x as loadPyramid,b as loadRaster,h as meshToGraphic};
5
+ import t from"../../Graphic.js";import r from"../../request.js";import e from"../../core/Collection.js";import o from"../../core/Error.js";import{rad2deg as n,deg2rad as s}from"../../core/mathUtils.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import a from"../../geometry/Mesh.js";import m from"../../geometry/support/MeshMaterial.js";import c from"../../geometry/support/MeshTexture.js";import u from"../../symbols/FillSymbol3DLayer.js";import l from"../../symbols/MeshSymbol3D.js";import{defaultImageSphereCenter as p,defaultImageSphereSize as f}from"./constants.js";import{loadRasterFactory as h,loadPanoramicTilePyramid as w}from"./support/importUtils.js";function y({data:t,center:r=p,size:e=f,horizonPitch:o=0,horizonYaw:n=0,horizonRoll:s=0}){const i=r.clone();i.z=-e/2;const u=a.createSphere(i,{size:e,densificationFactor:2,vertexSpace:"georeferenced",material:new m({colorTexture:new c({data:t})})});if(u.components[0].trustSourceNormals=!0,u.vertexAttributes.uv){const t=u.vertexAttributes.uv.length??0;for(let r=0;r<t;r++)u.vertexAttributes.uv[2*r+0]=1-u.vertexAttributes.uv[2*r+0]}return u.rotate(o,s,n,{origin:u.extent.center}),u.centerAt(i),u}function j(r){return new t({geometry:r,symbol:new l({symbolLayers:new e([new u])})})}function g(t,r){return 2*n(Math.atan(Math.tan(s(t/2))*Math.sqrt((1/r)**2+1)))}async function d(t,r){const e=await h(),o=await e.open({url:t,ioConfig:{skipExtensions:["jgw","aux.xml"],skipMapInfo:!0},...r});return i(r),x(o,{url:t})}const x=(t,r)=>{if(!t)throw new o("panoramic-viewer:missing-raster","Raster data could not be loaded",r);return t};async function b(t,r){const e=await w();return i(r),new e({raster:t})}async function v(t,r){return t?.length?await Promise.all(t.map(t=>t.loadMesh(r))):[]}async function M(t,e){try{const o=await r(t,{...e,method:"head"});return i(e),o?.getHeader?.("Content-Type")}catch{return null}}const z=/\.(\w+)$/;function A(t){const r=t.match(z);return!r||r.length<2?null:r[1].toUpperCase()}export{y as createImageSphere,g as findDiagonalFOV,M as getContentType,A as guessExtensionFromURI,v as loadMeshes,b as loadPyramid,d as loadRaster,j as meshToGraphic};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../Camera.js";import{property as i,subclass as o}from"../core/accessorSupport/decorators.js";import r from"./Widget.js";import a from"./OrientedImageryViewer/components/NavigationUI360.js";import{loadSequentialNavigationUIComponents as n,SequentialNavigationUI as s}from"./OrientedImageryViewer/components/SequentialNavigationUI.js";import l from"./PanoramicViewer/PanoramicViewerViewModel.js";import{loadCalciteComponents as d}from"./support/componentsUtils.js";import{globalCss as p}from"./support/globalCss.js";import{tsx as c,vmEvent as u}from"./support/widget.js";const v="esri-panoramic-viewer";let h=class extends r{constructor(e){super(e),this.directionMode="Relative",this.navigationEnabled=!1,this.uiStrings=null,this.viewModel=new l,this._afterContainerCreate=e=>{this.imageRenderer.container=e},this.addGraphic=(e,t)=>{this.viewModel.addGraphic(e,t)},this.addManyGraphics=e=>{this.viewModel.addManyGraphics(e)},this.clearGraphics=()=>{this.viewModel.clearGraphics()},this.clearImage=()=>{this.viewModel.clearImage()},this.loadImage=e=>this.viewModel.loadImage(e),this.loadImageTiled=(e,t)=>this.viewModel.loadImageTiled(e,t),this.navigate=async(e,t)=>await this.viewModel.navigate(e,t),this.removeGraphic=e=>{this.viewModel.removeGraphic(e)},this.removeManyGraphics=e=>{this.viewModel.removeManyGraphics(e)}}loadDependencies(){return Promise.all([d({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")}),n()])}get autoLoad(){return this.viewModel.autoLoad}set autoLoad(e){this.viewModel.autoLoad=e}get camera(){return this.viewModel.camera}set camera(e){e&&(this.viewModel.camera=e)}get clickAction(){return this.viewModel.clickAction}set clickAction(e){this.viewModel.clickAction=e}get currentNode(){return this.navigationViewModel?.currentNode}get currentBestFeature(){return this.navigationViewModel?.currentBestFeature}get fov(){return this.camera?.fov}set fov(e){this.viewModel.fov=e}get hfov(){return this.viewModel.hfov}get icon(){return"i360-view"}set icon(e){this._overrideIfSome("icon",e)}get imageRenderer(){return this.viewModel.imageRenderer}get imageSize(){return this.viewModel.imageSize}get imageSource(){return this.viewModel.imageSource}set imageSource(e){this.viewModel.imageSource=e}get navigationMode(){return this.navigationViewModel?.navigationMode}get navigationNodes(){return this.navigationViewModel?.navigationNodes}get navigationViewModel(){return this.viewModel.navigationViewModel}set navigationViewModel(e){this.viewModel.navigationViewModel=e}get pitch(){return this.viewModel.pitch}set pitch(e){this.viewModel.pitch=e}get state(){return this.viewModel.state}get ui(){return this.imageRenderer.ui}get vfov(){return this.viewModel.vfov}get yaw(){return this.viewModel.yaw}set yaw(e){this.viewModel.yaw=e}get _navigationUI(){return c(a,{currentBestFeature:this.currentBestFeature,currentNode:this.currentNode,directionMode:this.directionMode,navigate:this.navigate,nodes:this.navigationNodes})}get _sequentialNavigationUI(){return c(s,{layout:"horizontal",uiStrings:this.uiStrings,onAction:e=>{this.navigate(this.currentNode,e)}})}_renderNavigationUI(){switch(this.navigationMode){case"directional":return this._navigationUI;case"sequential":return this._sequentialNavigationUI;default:return null}}render(){return c("calcite-panel",{loading:this.viewModel.updating},c("calcite-panel",{afterCreate:this._afterContainerCreate,bind:this,class:this.classes(p.widget,v)}),this.navigationEnabled?this._renderNavigationUI():null)}static{this.vnodeSelector="calcite-panel"}};e([i({type:Boolean})],h.prototype,"autoLoad",null),e([i({type:t})],h.prototype,"camera",null),e([i()],h.prototype,"clickAction",null),e([i()],h.prototype,"currentNode",null),e([i()],h.prototype,"currentBestFeature",null),e([i()],h.prototype,"directionMode",void 0),e([i({type:Number})],h.prototype,"fov",null),e([i({readOnly:!0,type:Number})],h.prototype,"hfov",null),e([i()],h.prototype,"icon",null),e([i({readOnly:!0})],h.prototype,"imageRenderer",null),e([i({readOnly:!0})],h.prototype,"imageSize",null),e([i()],h.prototype,"imageSource",null),e([i({type:Boolean})],h.prototype,"navigationEnabled",void 0),e([i()],h.prototype,"navigationMode",null),e([i()],h.prototype,"navigationNodes",null),e([i()],h.prototype,"navigationViewModel",null),e([i({type:Number})],h.prototype,"pitch",null),e([i({readOnly:!0})],h.prototype,"state",null),e([i()],h.prototype,"ui",null),e([i()],h.prototype,"uiStrings",void 0),e([i({readOnly:!0,type:Number})],h.prototype,"vfov",null),e([u(["click","hittest-response","pixel-location"]),i({type:l})],h.prototype,"viewModel",void 0),e([i({type:Number})],h.prototype,"yaw",null),e([i()],h.prototype,"_navigationUI",null),e([i()],h.prototype,"_sequentialNavigationUI",null),h=e([o("esri.widgets.PanoramicViewer")],h);const g=h;export{g as default};
5
+ import{__decorate as e}from"tslib";import t from"../Camera.js";import{property as i,subclass as o}from"../core/accessorSupport/decorators.js";import r from"./Widget.js";import a from"./OrientedImageryViewer/components/NavigationUI360.js";import{loadSequentialNavigationUIComponents as n,SequentialNavigationUI as l}from"./OrientedImageryViewer/components/SequentialNavigationUI.js";import s from"./PanoramicViewer/PanoramicViewerViewModel.js";import{loadCalciteComponents as d}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import{tsx as p,vmEvent as u}from"./support/widget.js";const v="esri-panoramic-viewer";let h=class extends r{constructor(e){super(e),this.directionMode="Relative",this.navigationEnabled=!1,this.uiStrings=null,this.viewModel=new s,this._afterContainerCreate=e=>{this.imageRenderer.container=e},this.addGraphic=(e,t)=>{this.viewModel.addGraphic(e,t)},this.addManyGraphics=e=>{this.viewModel.addManyGraphics(e)},this.clearGraphics=()=>{this.viewModel.clearGraphics()},this.clearImage=()=>{this.viewModel.clearImage()},this.loadImage=e=>this.viewModel.loadImage(e),this.loadImageTiled=(e,t)=>this.viewModel.loadImageTiled(e,t),this.navigate=async(e,t)=>await this.viewModel.navigate(e,t),this.removeGraphic=e=>{this.viewModel.removeGraphic(e)},this.removeManyGraphics=e=>{this.viewModel.removeManyGraphics(e)}}loadDependencies(){return Promise.all([d({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")}),n()])}get autoLoad(){return this.viewModel.autoLoad}set autoLoad(e){this.viewModel.autoLoad=e}get camera(){return this.viewModel.camera}set camera(e){e&&(this.viewModel.camera=e)}get clickAction(){return this.viewModel.clickAction}set clickAction(e){this.viewModel.clickAction=e}get currentNode(){return this.navigationViewModel?.currentNode}get currentBestFeature(){return this.navigationViewModel?.currentBestFeature}get fov(){return this.camera?.fov}set fov(e){this.viewModel.fov=e}get hfov(){return this.viewModel.hfov}get icon(){return"i360-view"}set icon(e){this._overrideIfSome("icon",e)}get imageRenderer(){return this.viewModel.imageRenderer}get imageSize(){return this.viewModel.imageSize}get mediaCollection(){return this.viewModel.mediaCollection}set mediaCollection(e){this.viewModel.mediaCollection=e}get imageSource(){return this.viewModel.imageSource}set imageSource(e){this.viewModel.imageSource=e}get navigationMode(){return this.navigationViewModel?.navigationMode}get navigationNodes(){return this.navigationViewModel?.navigationNodes}get navigationViewModel(){return this.viewModel.navigationViewModel}set navigationViewModel(e){this.viewModel.navigationViewModel=e}get pitch(){return this.viewModel.pitch}set pitch(e){this.viewModel.pitch=e}get state(){return this.viewModel.state}get ui(){return this.imageRenderer.ui}get vfov(){return this.viewModel.vfov}get yaw(){return this.viewModel.yaw}set yaw(e){this.viewModel.yaw=e}get _navigationUI(){return p(a,{currentBestFeature:this.currentBestFeature,currentNode:this.currentNode,directionMode:this.directionMode,navigate:this.navigate,nodes:this.navigationNodes})}get _sequentialNavigationUI(){return p(l,{layout:"horizontal",uiStrings:this.uiStrings,onAction:e=>{this.navigate(this.currentNode,e)}})}_renderNavigationUI(){switch(this.navigationMode){case"directional":return this._navigationUI;case"sequential":return this._sequentialNavigationUI;default:return null}}render(){return p("calcite-panel",{loading:this.viewModel.updating},p("calcite-panel",{afterCreate:this._afterContainerCreate,bind:this,class:this.classes(c.widget,v)}),this.navigationEnabled?this._renderNavigationUI():null)}static{this.vnodeSelector="calcite-panel"}};e([i({type:Boolean})],h.prototype,"autoLoad",null),e([i({type:t})],h.prototype,"camera",null),e([i()],h.prototype,"clickAction",null),e([i()],h.prototype,"currentNode",null),e([i()],h.prototype,"currentBestFeature",null),e([i()],h.prototype,"directionMode",void 0),e([i({type:Number})],h.prototype,"fov",null),e([i({readOnly:!0,type:Number})],h.prototype,"hfov",null),e([i()],h.prototype,"icon",null),e([i({readOnly:!0})],h.prototype,"imageRenderer",null),e([i({readOnly:!0})],h.prototype,"imageSize",null),e([i()],h.prototype,"mediaCollection",null),e([i()],h.prototype,"imageSource",null),e([i({type:Boolean})],h.prototype,"navigationEnabled",void 0),e([i()],h.prototype,"navigationMode",null),e([i()],h.prototype,"navigationNodes",null),e([i()],h.prototype,"navigationViewModel",null),e([i({type:Number})],h.prototype,"pitch",null),e([i({readOnly:!0})],h.prototype,"state",null),e([i()],h.prototype,"ui",null),e([i()],h.prototype,"uiStrings",void 0),e([i({readOnly:!0,type:Number})],h.prototype,"vfov",null),e([u(["click","hittest-response","pixel-location"]),i({type:s})],h.prototype,"viewModel",void 0),e([i({type:Number})],h.prototype,"yaw",null),e([i()],h.prototype,"_navigationUI",null),e([i()],h.prototype,"_sequentialNavigationUI",null),h=e([o("esri.widgets.PanoramicViewer")],h);const g=h;export{g as default};