@arcgis/core 4.34.0-next.53 → 4.34.0-next.55

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 (340) hide show
  1. package/analysis/ElevationProfile/ElevationProfileGroundLine.d.ts +4 -0
  2. package/analysis/ElevationProfile/ElevationProfileGroundLine.js +5 -0
  3. package/analysis/ElevationProfile/ElevationProfileInputLine.d.ts +4 -0
  4. package/analysis/ElevationProfile/ElevationProfileInputLine.js +5 -0
  5. package/analysis/ElevationProfile/ElevationProfileLine.d.ts +4 -0
  6. package/analysis/ElevationProfile/ElevationProfileLine.js +5 -0
  7. package/analysis/ElevationProfile/ElevationProfileLineChartOptions.d.ts +4 -0
  8. package/analysis/ElevationProfile/{LineChartOptions.js → ElevationProfileLineChartOptions.js} +1 -1
  9. package/analysis/ElevationProfile/ElevationProfileLineViewOptions.d.ts +4 -0
  10. package/analysis/ElevationProfile/{LineViewOptions.js → ElevationProfileLineViewOptions.js} +1 -1
  11. package/analysis/ElevationProfile/ElevationProfileQueryLine.d.ts +4 -0
  12. package/analysis/ElevationProfile/ElevationProfileQueryLine.js +5 -0
  13. package/analysis/ElevationProfile/ElevationProfileSceneLine.d.ts +4 -0
  14. package/analysis/ElevationProfile/ElevationProfileSceneLine.js +5 -0
  15. package/analysis/ElevationProfile/ElevationProfileUnits.d.ts +4 -0
  16. package/analysis/ElevationProfile/{Units.js → ElevationProfileUnits.js} +1 -1
  17. package/analysis/ElevationProfile/ElevationProfileViewOptions.d.ts +4 -0
  18. package/analysis/ElevationProfile/{ViewOptions.js → ElevationProfileViewOptions.js} +1 -1
  19. package/analysis/ElevationProfile/elevationProfileLineTypes.js +1 -1
  20. package/analysis/ElevationProfileAnalysis.js +1 -1
  21. package/applications/Components/formatUtils.d.ts +3 -0
  22. package/applications/Components/formatUtils.js +5 -0
  23. package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
  24. package/assets/esri/core/workers/RemoteClient.js +1 -1
  25. package/assets/esri/core/workers/chunks/01e8b9dc77a57d1c2a52.js +1 -0
  26. package/assets/esri/core/workers/chunks/027cfcde29fe87aa2ffe.js +1 -0
  27. package/assets/esri/core/workers/chunks/{e58336aafe8c95bb6831.js → 0eb728cee6e40cb30c01.js} +1 -1
  28. package/assets/esri/core/workers/chunks/18ceea59e469a0f2721b.js +1 -0
  29. package/assets/esri/core/workers/chunks/199a17b0a0f75cbaed16.js +1 -0
  30. package/assets/esri/core/workers/chunks/1eee7cf11df01a52c1bf.js +1 -0
  31. package/assets/esri/core/workers/chunks/{ac41b882f9cbf8d56f0c.js → 222f981e876f60ae282f.js} +1 -1
  32. package/assets/esri/core/workers/chunks/22334a464f798b5279b2.js +1 -0
  33. package/assets/esri/core/workers/chunks/{99b9392946d776a62997.js → 23e600e368ac829680b5.js} +1 -1
  34. package/assets/esri/core/workers/chunks/23f54b49742098def8ae.js +1 -0
  35. package/assets/esri/core/workers/chunks/24ac204d8a045aa821be.js +1 -0
  36. package/assets/esri/core/workers/chunks/252ee00fd6c4ae0ee7fa.js +1 -0
  37. package/assets/esri/core/workers/chunks/27197b0a2ffb2b6104ea.js +1 -0
  38. package/assets/esri/core/workers/chunks/{93af38d29d066f27ed28.js → 2cb14d040e67a261b31c.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{0021118bafefd1e47ff7.js → 31c088966ccfff2ea1db.js} +1 -1
  40. package/assets/esri/core/workers/chunks/3b51b61a7b8a1ef87c9b.js +1 -0
  41. package/assets/esri/core/workers/chunks/3d800fbc449bea18b1cd.js +1 -0
  42. package/assets/esri/core/workers/chunks/435169b455fd2846799b.js +1 -0
  43. package/assets/esri/core/workers/chunks/4874aabdb5c60ca66216.js +1 -0
  44. package/assets/esri/core/workers/chunks/4d2473e680324dc17cfa.js +1 -0
  45. package/assets/esri/core/workers/chunks/{2da12a64d3baef4aaaa1.js → 4f8dab492331c9a2d67a.js} +1 -1
  46. package/assets/esri/core/workers/chunks/527557b603400189d49a.js +1 -0
  47. package/assets/esri/core/workers/chunks/{4bd92232928b832dea76.js → 5900dde7a201a7d47469.js} +1 -1
  48. package/assets/esri/core/workers/chunks/62ade6f18b375795ddfd.js +1 -0
  49. package/assets/esri/core/workers/chunks/63f3e46bfa820436161c.js +1 -0
  50. package/assets/esri/core/workers/chunks/{b0ee061747bef6729bb9.js → 6801b92bce7a918fda6f.js} +1 -1
  51. package/assets/esri/core/workers/chunks/6940bb6524938894a246.js +1 -0
  52. package/assets/esri/core/workers/chunks/69e6000044bfb03776ac.js +1 -0
  53. package/assets/esri/core/workers/chunks/6b11476b2004b4db576e.js +1 -0
  54. package/assets/esri/core/workers/chunks/71cac356874b36f9a383.js +1 -0
  55. package/assets/esri/core/workers/chunks/{69dc5a7abc1fda2474ad.js → 722931d1a60be461e521.js} +1 -1
  56. package/assets/esri/core/workers/chunks/79ab06fb4c91ac8da323.js +1 -0
  57. package/assets/esri/core/workers/chunks/{0a4357af5b8c0532b439.js → 7bdfc7c7ce1d94c00745.js} +1 -1
  58. package/assets/esri/core/workers/chunks/813efde41e90e652b7db.js +1 -0
  59. package/assets/esri/core/workers/chunks/82404ff7c298493ff6f4.js +1 -0
  60. package/assets/esri/core/workers/chunks/{0ce671588de2858516d2.js → 83737d86584bf1b32368.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{98ea12c7a000a30f3dc0.js → 87f68c2b9361bd3f8cac.js} +1 -1
  62. package/assets/esri/core/workers/chunks/97ae2fdb6cb98249f5fa.js +1 -0
  63. package/assets/esri/core/workers/chunks/9a20390602126995f831.js +1 -0
  64. package/assets/esri/core/workers/chunks/9cdeead9d444e8d95477.js +1 -0
  65. package/assets/esri/core/workers/chunks/a778a72456fefdf40115.js +1 -0
  66. package/assets/esri/core/workers/chunks/a999f804fc2f00b2e7ae.js +1 -0
  67. package/assets/esri/core/workers/chunks/ae73ac81bd10614c2b53.js +1 -0
  68. package/assets/esri/core/workers/chunks/c7d4c296011c5393bcaa.js +1 -0
  69. package/assets/esri/core/workers/chunks/c86e339e45900c54c9f5.js +1 -0
  70. package/assets/esri/core/workers/chunks/{a1d3f1c221389eb6090c.js → c95e6bef8c97cf647869.js} +1 -1
  71. package/assets/esri/core/workers/chunks/cbec768cd98caff212f2.js +1 -0
  72. package/assets/esri/core/workers/chunks/d81c4afad4abe2d1d0b9.js +1 -0
  73. package/assets/esri/core/workers/chunks/dd120d562b63618e71c0.js +1 -0
  74. package/assets/esri/core/workers/chunks/dfb12f42b8d319ffa5fc.js +1 -0
  75. package/assets/esri/core/workers/chunks/e04951ee32f041faaeca.js +1 -0
  76. package/assets/esri/core/workers/chunks/e982cf44906eb26164f2.js +1 -0
  77. package/assets/esri/core/workers/chunks/{081b22fa73ef7b696409.js → ead1acf95c3385630da8.js} +2 -2
  78. package/assets/esri/core/workers/chunks/f1c50f37a81c672263a1.js +1 -0
  79. package/assets/esri/core/workers/chunks/fe5c37c69da3ec1e56ac.js +1 -0
  80. package/assets/esri/core/workers/chunks/ff323db554c9e09749e8.js +1 -0
  81. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  82. package/chunks/Laserlines.glsl.js +1 -1
  83. package/chunks/LineSeries.js +1 -1
  84. package/chunks/Theme.js +1 -1
  85. package/chunks/boundedPlane.js +1 -1
  86. package/chunks/bundle.js +1 -1
  87. package/chunks/chartUtilsAm5.js +1 -1
  88. package/chunks/sphere.js +1 -1
  89. package/chunks/vec42.js +1 -1
  90. package/config.js +1 -1
  91. package/core/ArrayPool.js +1 -1
  92. package/core/Collection.js +1 -1
  93. package/core/ObjectPool.js +1 -1
  94. package/core/accessorSupport/Properties.js +1 -1
  95. package/core/accessorSupport/watch.js +1 -1
  96. package/core/arrayUtils.js +1 -1
  97. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  98. package/core/libs/gl-matrix-2/math/vec4.js +1 -1
  99. package/core/pbf.js +1 -1
  100. package/core/typedArrayUtil.js +1 -1
  101. package/geohash/GeohashCell.js +1 -1
  102. package/geohash/GeohashTree.js +1 -1
  103. package/geometry/operators/json/graphicBufferOperator.js +5 -0
  104. package/geometry/support/DoubleArray.js +1 -1
  105. package/geometry/support/boundedPlane.js +1 -1
  106. package/geometry/support/coordinateSystem.js +1 -1
  107. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  108. package/geometry/support/sphere.js +1 -1
  109. package/interfaces.d.ts +232 -322
  110. package/kernel.js +1 -1
  111. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  112. package/layers/graphics/sources/ParquetSource.js +1 -1
  113. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  114. package/networks/support/typeUtils.js +1 -1
  115. package/package.json +1 -1
  116. package/rest/knowledgeGraphService.js +1 -1
  117. package/rest/networks/support/Circuit.js +5 -0
  118. package/rest/networks/support/CircuitSection.js +1 -1
  119. package/rest/networks/support/Subcircuit.js +1 -1
  120. package/rest/print.js +1 -1
  121. package/support/revision.js +1 -1
  122. package/symbols/cim/CIMEffects.js +1 -1
  123. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  124. package/symbols/cim/effects/EffectOffset.js +1 -1
  125. package/views/2d/analysisViewModuleImportUtils.js +5 -0
  126. package/views/2d/engine/Container.js +1 -1
  127. package/views/2d/engine/DisplayObject.js +1 -1
  128. package/views/2d/engine/flow/dataUtils.js +1 -1
  129. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  130. package/views/2d/engine/webgl/DisplayEntity.js +1 -1
  131. package/views/2d/engine/webgl/DisplayRecord.js +1 -1
  132. package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
  133. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  134. package/views/2d/engine/webgl/PooledUint32Array.js +1 -1
  135. package/views/2d/engine/webgl/cpuMapped/Buffer.js +1 -1
  136. package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +1 -1
  137. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  138. package/views/2d/input/MapViewInputManager.js +1 -1
  139. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  140. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  141. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  142. package/views/2d/layers/LayerView2D.js +1 -1
  143. package/views/2d/layers/features/FeatureContainer.js +1 -1
  144. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  145. package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
  146. package/views/2d/layers/features/FeatureSpatialIndex.js +1 -1
  147. package/views/2d/layers/features/Processor.js +1 -1
  148. package/views/2d/layers/features/RenderState.js +1 -1
  149. package/views/2d/layers/features/aggregation/AccumulatedStatistics.js +1 -1
  150. package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
  151. package/views/2d/layers/features/aggregation/GridCell.js +1 -1
  152. package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
  153. package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
  154. package/views/2d/layers/features/schema/processor/LabelMatcherSchema.js +1 -1
  155. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  156. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  157. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  158. package/views/2d/layers/features/sources/strategies/chunks/ASourceChunk.js +1 -1
  159. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  160. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  161. package/views/2d/layers/features/support/DisplayIdGenerator.js +1 -1
  162. package/views/2d/layers/features/support/FeatureSetCache.js +1 -1
  163. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  164. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  165. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  166. package/views/2d/layers/features/support/StaticBitSet.js +1 -1
  167. package/views/2d/tiling/TileCoverage.js +1 -1
  168. package/views/2d/tiling/TileKey.js +1 -1
  169. package/views/3d/FocusAreasView.js +1 -1
  170. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  171. package/views/3d/analysis/ElevationProfile/{HoveredPointVisualization.js → ElevationProfileHoveredPointVisualization.js} +1 -1
  172. package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +5 -0
  173. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization.js +5 -0
  174. package/views/3d/analysis/ElevationProfile/ElevationProfileLinesVisualization.js +5 -0
  175. package/views/3d/analysis/ElevationProfile/ElevationProfileSceneLineComputation.js +5 -0
  176. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization.js +5 -0
  177. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  178. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  179. package/views/3d/analysis/Slice/SliceController.js +1 -1
  180. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  181. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  182. package/views/3d/analysis/Viewshed/FieldOfViewManipulation.js +1 -1
  183. package/views/3d/analysisViewModuleImportUtils.js +5 -0
  184. package/views/3d/camera/constraintUtils/distance.js +1 -1
  185. package/views/3d/input/SceneInputManager.js +1 -1
  186. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  187. package/views/3d/interactive/editingTools/manipulations/MoveManipulation.js +1 -1
  188. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  189. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
  190. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  191. package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
  192. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  193. package/views/3d/layers/I3SMeshView3D.js +1 -1
  194. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  195. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  196. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  197. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  198. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  199. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  200. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  201. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
  202. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  203. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  204. package/views/3d/layers/i3s/I3SNode.js +1 -1
  205. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  206. package/views/3d/state/ViewState.js +1 -1
  207. package/views/3d/state/ViewStateManager.js +1 -1
  208. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  209. package/views/3d/support/ViewSlice.js +1 -1
  210. package/views/3d/support/orientedBoundingBox.js +1 -1
  211. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  212. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  213. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  214. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  215. package/views/3d/terrain/ScaleRangeQueries.js +1 -1
  216. package/views/3d/terrain/SphericalPatch.js +1 -1
  217. package/views/3d/terrain/TerrainRenderer.js +1 -1
  218. package/views/3d/terrain/TerrainSurface.js +1 -1
  219. package/views/3d/terrain/Tile.js +1 -1
  220. package/views/3d/terrain/TilePerLayerInfo.js +1 -1
  221. package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
  222. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  223. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  224. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  225. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  226. package/views/3d/webgl-engine/lib/SliceHelper.js +1 -1
  227. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  228. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  229. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  230. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  231. package/views/3d/webgl-engine/lib/octreeUtils.js +1 -1
  232. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  233. package/views/SceneView.js +1 -1
  234. package/views/ToolViewManager.js +1 -1
  235. package/views/View.js +1 -1
  236. package/views/View2D.js +1 -1
  237. package/views/analysis/ElevationProfile/ElevationProfileController.js +5 -0
  238. package/views/analysis/ElevationProfile/{ProfileGenerationError.js → ElevationProfileGenerationError.js} +1 -1
  239. package/views/analysis/ElevationProfile/ElevationProfileGroundLineComputation.js +5 -0
  240. package/views/analysis/ElevationProfile/ElevationProfileInputLineComputation.js +5 -0
  241. package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +5 -0
  242. package/views/analysis/ElevationProfile/ElevationProfileQueryLineComputation.js +5 -0
  243. package/views/analysis/ElevationProfile/ElevationProfileResult.d.ts +4 -0
  244. package/views/analysis/ElevationProfile/ElevationProfileResult.js +5 -0
  245. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +5 -0
  246. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +5 -0
  247. package/views/draw/DrawGraphicTool.js +1 -1
  248. package/views/draw/DrawOperation.js +1 -1
  249. package/views/draw/LegacyDrawManipulator.js +1 -1
  250. package/views/input/InputManager.js +1 -1
  251. package/views/input/handlers/LatestPointer.js +1 -1
  252. package/views/interactive/InteractiveToolBase.js +1 -1
  253. package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
  254. package/views/interactive/Tooltip.js +1 -1
  255. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  256. package/views/interactive/sketch/constraints.js +1 -1
  257. package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
  258. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  259. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  260. package/views/layers/FeatureLayerView.js +1 -1
  261. package/views/support/AnalysisViewManager.js +5 -0
  262. package/views/support/PropertiesPool.js +1 -1
  263. package/widgets/ElevationProfile/ElevationProfileLine.d.ts +2 -2
  264. package/widgets/Feature/FeatureViewModel.js +1 -1
  265. package/widgets/Sketch/SketchViewModel.js +1 -1
  266. package/analysis/ElevationProfile/GroundLine.d.ts +0 -4
  267. package/analysis/ElevationProfile/GroundLine.js +0 -5
  268. package/analysis/ElevationProfile/InputLine.d.ts +0 -4
  269. package/analysis/ElevationProfile/InputLine.js +0 -5
  270. package/analysis/ElevationProfile/Line.d.ts +0 -4
  271. package/analysis/ElevationProfile/Line.js +0 -5
  272. package/analysis/ElevationProfile/LineChartOptions.d.ts +0 -4
  273. package/analysis/ElevationProfile/LineViewOptions.d.ts +0 -4
  274. package/analysis/ElevationProfile/QueryLine.d.ts +0 -4
  275. package/analysis/ElevationProfile/QueryLine.js +0 -5
  276. package/analysis/ElevationProfile/SceneLine.d.ts +0 -4
  277. package/analysis/ElevationProfile/SceneLine.js +0 -5
  278. package/analysis/ElevationProfile/Units.d.ts +0 -4
  279. package/analysis/ElevationProfile/ViewOptions.d.ts +0 -4
  280. package/assets/esri/core/workers/chunks/14c6ae4feb4859cfa7c5.js +0 -1
  281. package/assets/esri/core/workers/chunks/20a2b3d1f826e9059884.js +0 -1
  282. package/assets/esri/core/workers/chunks/250b1629becca0410f2a.js +0 -1
  283. package/assets/esri/core/workers/chunks/2b75212c31145cc07d16.js +0 -1
  284. package/assets/esri/core/workers/chunks/2efa4d8fe5454f8b2a05.js +0 -1
  285. package/assets/esri/core/workers/chunks/3149a86cd25684dcb0b3.js +0 -1
  286. package/assets/esri/core/workers/chunks/38f84294fb2fb4663ba5.js +0 -1
  287. package/assets/esri/core/workers/chunks/3eb3af0b6cf3c2f28131.js +0 -1
  288. package/assets/esri/core/workers/chunks/43bd338bb0de375b9bb7.js +0 -1
  289. package/assets/esri/core/workers/chunks/4622a3e64d3c4aafa56b.js +0 -1
  290. package/assets/esri/core/workers/chunks/47f2e905ef42e36897aa.js +0 -1
  291. package/assets/esri/core/workers/chunks/4c6862ad3af947c704f7.js +0 -1
  292. package/assets/esri/core/workers/chunks/50e9eafb118d2a221f10.js +0 -1
  293. package/assets/esri/core/workers/chunks/55588e668b6acb6aa390.js +0 -1
  294. package/assets/esri/core/workers/chunks/5b112471dca94b2e8462.js +0 -1
  295. package/assets/esri/core/workers/chunks/5dfe1aed10095385c066.js +0 -1
  296. package/assets/esri/core/workers/chunks/5fc414fc2cfc68828c5b.js +0 -1
  297. package/assets/esri/core/workers/chunks/7389841fabe0f319f1e5.js +0 -1
  298. package/assets/esri/core/workers/chunks/781b59ba0cabe78bc122.js +0 -1
  299. package/assets/esri/core/workers/chunks/8e0559cc6295008fcdf7.js +0 -1
  300. package/assets/esri/core/workers/chunks/944fa8261aad94ae0542.js +0 -1
  301. package/assets/esri/core/workers/chunks/9e479e7e2e51476c3d27.js +0 -1
  302. package/assets/esri/core/workers/chunks/a1e179dd6de9c8769b02.js +0 -1
  303. package/assets/esri/core/workers/chunks/a6493607b98783bf1ef2.js +0 -1
  304. package/assets/esri/core/workers/chunks/a829969ed44cdb814f27.js +0 -1
  305. package/assets/esri/core/workers/chunks/b2a035befeeff1a55ad8.js +0 -1
  306. package/assets/esri/core/workers/chunks/b4251e10621fb3ad03a3.js +0 -1
  307. package/assets/esri/core/workers/chunks/b877142a275188a16e17.js +0 -1
  308. package/assets/esri/core/workers/chunks/b9f5672093727c6f92c9.js +0 -1
  309. package/assets/esri/core/workers/chunks/ba45dccb4dab5a74d224.js +0 -1
  310. package/assets/esri/core/workers/chunks/cc0cb4906e4419f7c4a9.js +0 -1
  311. package/assets/esri/core/workers/chunks/cda27c0fafd687dfa72e.js +0 -1
  312. package/assets/esri/core/workers/chunks/ddd6597a66ec6b972f9c.js +0 -1
  313. package/assets/esri/core/workers/chunks/e28d3ed65c3a76a044c8.js +0 -1
  314. package/assets/esri/core/workers/chunks/e3f68f7b408a08d7cd5d.js +0 -1
  315. package/assets/esri/core/workers/chunks/e9716995ce0c3683eafc.js +0 -1
  316. package/assets/esri/core/workers/chunks/ed25bf087f52e5d3e71b.js +0 -1
  317. package/assets/esri/core/workers/chunks/f75ddd79be506423be09.js +0 -1
  318. package/assets/esri/core/workers/chunks/f8505bf69795f5293a79.js +0 -1
  319. package/assets/esri/core/workers/chunks/f92e608931b1c168cb45.js +0 -1
  320. package/assets/esri/core/workers/chunks/fb4950995f6780f6c22a.js +0 -1
  321. package/views/3d/analysis/AnalysisViewManager3D.js +0 -5
  322. package/views/3d/analysis/ElevationProfile/HoveredPointsVisualization.js +0 -5
  323. package/views/3d/analysis/ElevationProfile/InputVisualization.js +0 -5
  324. package/views/3d/analysis/ElevationProfile/ProfileLinesVisualization.js +0 -5
  325. package/views/3d/analysis/ElevationProfile/SceneLineComputation.js +0 -5
  326. package/views/3d/analysis/ElevationProfile/Visualization.js +0 -5
  327. package/views/analysis/ElevationProfile/Controller.js +0 -5
  328. package/views/analysis/ElevationProfile/GroundLineComputation.js +0 -5
  329. package/views/analysis/ElevationProfile/InputLineComputation.js +0 -5
  330. package/views/analysis/ElevationProfile/LineComputation.js +0 -5
  331. package/views/analysis/ElevationProfile/QueryLineComputation.js +0 -5
  332. package/views/analysis/ElevationProfile/Result.d.ts +0 -4
  333. package/views/analysis/ElevationProfile/Result.js +0 -5
  334. package/views/analysis/ElevationProfile/geometryUtils.js +0 -5
  335. package/views/analysis/ElevationProfile/profileGenerationUtils.js +0 -5
  336. /package/views/analysis/ElevationProfile/{elevationQuerySourceUtils.js → elevationProfileQuerySourceUtils.js} +0 -0
  337. /package/views/analysis/ElevationProfile/{statisticsUtils.js → elevationProfileStatisticsUtils.js} +0 -0
  338. /package/views/analysis/ElevationProfile/{traversalUtils.js → elevationProfileTraversalUtils.js} +0 -0
  339. /package/views/analysis/ElevationProfile/{unitUtils.js → elevationProfileUnitUtils.js} +0 -0
  340. /package/views/analysis/ElevationProfile/{visualizationUtils.js → elevationProfileVisualizationUtils.js} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../Graphic.js";import{UndoRedo as o}from"../../UndoRedo.js";import{createTask as r}from"../../core/asyncUtils.js";import{makeHandle as i}from"../../core/handleUtils.js";import{destroyMaybe as s}from"../../core/maybe.js";import{watch as a,syncAndInitial as n,sync as l}from"../../core/reactiveUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{load as d}from"../../geometry/coordinateFormatter.js";import h from"../../layers/GraphicsLayer.js";import{pointEquals as u}from"../../layers/graphics/dehydratedFeatureComparison.js";import{CreateOperationGeometry as m}from"./support/CreateOperationGeometry.js";import{createCircle as y,createEllipse as g,createSquare as v,createRectangle as f,createPolygon as O,createPolyline as _,createMultipoint as w}from"./support/createUtils.js";import{createViewAlignedCoordinateSystem as C}from"./support/surfaceCoordinateSystems.js";import{createTooltipInfos as G,initializeConstraints as x,updateTooltipInfo as V,getConstraintZ as U,unlockConstraintsOnVertexAddOrRemove as b,lockElevationOnVertexAdd as k,getActiveTooltipInfo as S}from"./support/tooltipUtils.js";import{InteractiveToolBase as T}from"../interactive/InteractiveToolBase.js";import j from"../interactive/sketch/SketchOptions.js";import{makeTooltip as L,pasteLocation as H,enterInputModeIfAvailable as R}from"../interactive/tooltip/tooltipCommonUtils.js";import{autorun as z}from"../../core/accessorSupport/trackingUtils.js";let A=class extends T{constructor(t){super(t),this._graphic=null,this._coordinateFormatterLoadTask=null,this._createOperationGeometry=null,this.defaultZ=0,this.directionOptions=null,this.elevationLockOnVertexAddDisabled=!1,this.geometryType=null,this.hasZ=!0,this.geometryToPlace=null,this.snappingManager=null,this.snapToScene=!1,this.sketchOptions=new j}initialize(){const{view:t}=this;this.internalGraphicsLayer=new h({listMode:"hide",internal:!0,title:"DrawGraphicTool layer"}),this.view.map.layers.add(this.internalGraphicsLayer);const e=this.drawOperation=this.makeDrawOperation();this.tooltipInfos=G(t.type,this.sketchOptions);const o=L(()=>({view:t,options:this.sketchOptions.tooltips}));this.tooltip=o,x(this._tooltipsContext),this._coordinateFormatterLoadTask=r(()=>d()),this.addHandles([e.on("vertex-add",t=>this.onVertexAdd(t)),e.on("vertex-remove",t=>this.onVertexRemove(t)),e.on("vertex-update",t=>this.onVertexUpdate(t)),e.on("cursor-update",t=>this.onCursorUpdate(t)),e.on("cursor-remove",()=>this._updateGraphic()),e.on("complete",t=>this.onComplete(t)),this._coordinateFormatterLoadTask,o.on("paste",t=>H(t,this.activeTooltipInfo)),a(()=>this.cursor,t=>{e.cursor=t},n),z(()=>{const{activeTooltipInfo:t,sketchOptions:e}=this;V(t,this._tooltipsContext),o.info=e.tooltips.effectiveEnabled?t:null}),z(()=>{e.constraintZ=U(this._tooltipsContext)},l)]),this.finishToolCreation()}destroy(){this.drawOperation=s(this.drawOperation),this.tooltip=s(this.tooltip),this._destroyAllVisualizations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=s(this.internalGraphicsLayer),this._set("view",null)}get _drawSpatialReference(){return this.drawOperation.coordinateHelper.spatialReference}get _tooltipsContext(){const{defaultZ:t,directionOptions:e,drawOperation:o,forceUniformSize:r,geometryType:i,graphic:s,sketchOptions:a,tooltipInfos:n,view:l,automaticAreaMeasurementUtils:p,automaticLengthMeasurementUtils:c}=this;return{createOperationGeometry:this._createOperationGeometry,defaultZ:t,directionOptions:e,drawOperation:o,forceUniformSize:r,geometryType:i,graphic:s,sketchOptions:a,tooltipInfos:n,view:l,automaticAreaMeasurementUtils:p,automaticLengthMeasurementUtils:c}}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(t){this._set("centered",t),this._updateGraphic()}get cursor(){return this._get("cursor")}set cursor(t){this._set("cursor",t)}set enabled(t){this.drawOperation.interactive=t,this._set("enabled",t)}set forceUniformSize(t){this._set("forceUniformSize",t),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(t){this._set("graphicSymbol",t),null!=this._graphic&&(this._graphic.symbol=t)}set mode(t){const e=this.drawOperation;e&&(e.drawingMode=t),this._set("mode",t)}get updating(){return this.drawOperation?.updating??!1}get undoRedo(){const{view:{type:t,map:e}}=this;return"2d"===t&&e&&"undoRedo"in e&&e.undoRedo instanceof o?e.undoRedo:null}set undoRedo(t){this._override("undoRedo",t)}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(t){this.destroyed||R(t,this.tooltip)||this.drawOperation.onInputEvent(t)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo(),0===this.drawOperation.numCommittedVertices&&x(this._tooltipsContext)}_destroyAllVisualizations(){this.removeHandles(I.outline),this.removeHandles(I.regularVertices),this.removeHandles(I.activeVertex),this.removeHandles(I.activeEdge),this.removeHandles(E)}_createOrUpdateGraphic(t){if(null!=this._graphic)return this.updateGraphicGeometry(t),this._graphic;const o=new e({...this.graphicProperties,symbol:this.graphicSymbol});return this._graphic=o,this.updateGraphicGeometry(t),this.internalGraphicsLayer.add(o),this.addHandles(this.initializeGraphic(o)),this.notifyChange("graphic"),this.addHandles(i(()=>{this.internalGraphicsLayer.remove(o),this._graphic===o&&(this._graphic=null)}),E),o}updateGraphicGeometry(t){this._graphic.geometry=t}_getCreateOperationGeometry(t={operationComplete:!1}){if(null==this.drawOperation)return;const{coordinateHelper:e,view:o,visualizationCursorVertex:r,lastVertex:i,committedVertices:s,geometryIncludingUncommittedVertices:a,numCommittedVertices:n}=this.drawOperation;if(!(n>0||null!=r))return;const l=t.operationComplete?s:a,p=l.length,c=null!=r?e.pointToArray(r):null,d=this._drawSpatialReference,h="3d"===o.type&&"global"===o.viewingMode,G=new m;G.committedVertices=s,G.cursorVertex=c;const{geometryType:x}=this;switch(x){case"point":case"mesh":G.full=e.arrayToPoint(l[0]);break;case"multipoint":G.full=p>0?w(l,d):null;break;case"polyline":case"polygon":p>0&&(G.full="polygon"===x?O([l],d,h,!0):_([l],d,h),G.cursorEdge=null!=c&&i&&!u(r,i)?_([[c,e.pointToArray(i)]],d,h):null,G.outline=p>1?G.full:null);break;case"circle":case"rectangle":{if(G.committedVertices=G.cursorVertex=null,!p)break;const e=C(o,l[0]),r=l[0],i=e.makeMapPoint(r[0]+D*o.resolution,r[1]);"circle"===x?1===p&&t.operationComplete?G.circle=y([r,i],e,!0):2===p&&(this.forceUniformSize?G.circle=y(l,e,this.centered):G.rectangle=g(l,e,this.centered)):1===p&&t.operationComplete?G.rectangle=v([r,i],e,!0):2===p&&(G.rectangle=this.forceUniformSize?v(l,e,this.centered):f(l,e,this.centered)),G.full=null!=G.circle?G.circle.geometry:G.rectangle?.geometry,G.outline="polygon"===G.full?.type?G.full:null;break}default:return null}return G}initializeGraphic(t){return i()}onComplete(t){if(!this.drawOperation)return;this._updateGraphic();let e=null;if(this.drawOperation.isCompleted){const t=this._getCreateOperationGeometry({operationComplete:!0});null!=t&&(e=this._createOrUpdateGraphic(t.full))}this._createOperationGeometry=null,this.emit("complete",{graphic:e,...t})}onCursorUpdate(t){this._updateGraphic(),this.emit("cursor-update",t)}onDeactivate(){const{drawOperation:t}=this;t&&(t.isCompleted||t.cancel())}onOutlineChanged(t){return i()}onCursorEdgeChanged(t){return i()}onVertexAdd(t){b(this._tooltipsContext),this._updateGraphic(),this.elevationLockOnVertexAddDisabled||k(t.vertices.at(0)?.coordinates,this._tooltipsContext),this.emit("vertex-add",t)}onVertexRemove(t){b(this._tooltipsContext),this._updateGraphic(),this.emit("vertex-remove",t)}onVertexUpdate(t){this._updateGraphic(),this.emit("vertex-update",t)}_updateGraphic(){const t=this._getCreateOperationGeometry();this._createOperationGeometry=t,null!=t?(null!=t.cursorEdge?this.addHandles(this.onCursorEdgeChanged(t.cursorEdge),I.activeEdge):this.removeHandles(I.activeEdge),null!=t.outline?this.addHandles(this.onOutlineChanged(t.outline),I.outline):this.removeHandles(I.outline),null!=t.committedVertices?this.addHandles(this.onRegularVerticesChanged(t.committedVertices),I.regularVertices):this.removeHandles(I.regularVertices),null!=t.cursorVertex?this.addHandles(this.onActiveVertexChanged(t.cursorVertex),I.activeVertex):this.removeHandles(I.activeVertex),null!=t.full?this._createOrUpdateGraphic(t.full):this.removeHandles(E)):this._destroyAllVisualizations()}get activeTooltipInfo(){return this._coordinateFormatterLoadTask?.finished?S(this._tooltipsContext):null}};t([p()],A.prototype,"_coordinateFormatterLoadTask",void 0),t([p()],A.prototype,"_createOperationGeometry",void 0),t([p()],A.prototype,"_tooltipsContext",null),t([p({value:!0})],A.prototype,"centered",null),t([p()],A.prototype,"cursor",null),t([p({nonNullable:!0})],A.prototype,"defaultZ",void 0),t([p({constructOnly:!0})],A.prototype,"directionOptions",void 0),t([p()],A.prototype,"drawOperation",void 0),t([p()],A.prototype,"elevationLockOnVertexAddDisabled",void 0),t([p({value:!0})],A.prototype,"enabled",null),t([p({value:!0})],A.prototype,"forceUniformSize",null),t([p({constructOnly:!0})],A.prototype,"geometryType",void 0),t([p()],A.prototype,"graphic",null),t([p({constructOnly:!0})],A.prototype,"graphicProperties",void 0),t([p()],A.prototype,"graphicSymbol",null),t([p({constructOnly:!0})],A.prototype,"hasZ",void 0),t([p({constructOnly:!0})],A.prototype,"geometryToPlace",void 0),t([p()],A.prototype,"mode",null),t([p()],A.prototype,"snappingManager",void 0),t([p()],A.prototype,"snapToScene",void 0),t([p()],A.prototype,"tooltip",void 0),t([p()],A.prototype,"tooltipInfos",void 0),t([p({constructOnly:!0,type:j})],A.prototype,"sketchOptions",void 0),t([p()],A.prototype,"updating",null),t([p({constructOnly:!0,nonNullable:!0})],A.prototype,"view",void 0),t([p({constructOnly:!0})],A.prototype,"automaticAreaMeasurementUtils",void 0),t([p({constructOnly:!0})],A.prototype,"automaticLengthMeasurementUtils",void 0),t([p({constructOnly:!0})],A.prototype,"undoRedo",null),t([p()],A.prototype,"activeTooltipInfo",null),A=t([c("esri.views.draw.DrawGraphicTool")],A);const E=Symbol("create-operation-graphic"),I={outline:Symbol("outline-visual"),regularVertices:Symbol("regular-vertices-visual"),activeVertex:Symbol("active-vertex-visual"),activeEdge:Symbol("active-edge-visual")};function M(t){switch(t){case"point":case"polyline":case"polygon":case"multipoint":return t;case"circle":case"rectangle":return"segment";case"mesh":return"point"}}const D=48;export{A as DrawGraphicTool,M as geometryTypeToDrawOperationGeometryType};
5
+ import{__decorate as t}from"tslib";import e from"../../Graphic.js";import{UndoRedo as o}from"../../UndoRedo.js";import{createTask as r}from"../../core/asyncUtils.js";import{makeHandle as i}from"../../core/handleUtils.js";import{destroyMaybe as s}from"../../core/maybe.js";import{watch as a,syncAndInitial as n,sync as l}from"../../core/reactiveUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{load as d}from"../../geometry/coordinateFormatter.js";import h from"../../layers/GraphicsLayer.js";import{pointEquals as u}from"../../layers/graphics/dehydratedFeatureComparison.js";import{CreateOperationGeometry as m}from"./support/CreateOperationGeometry.js";import{createCircle as y,createEllipse as g,createSquare as v,createRectangle as f,createPolygon as O,createPolyline as _,createMultipoint as w}from"./support/createUtils.js";import{createViewAlignedCoordinateSystem as C}from"./support/surfaceCoordinateSystems.js";import{createTooltipInfos as G,initializeConstraints as x,updateTooltipInfo as V,getConstraintZ as U,unlockConstraintsOnVertexAddOrRemove as b,lockElevationOnVertexAdd as k,getActiveTooltipInfo as S}from"./support/tooltipUtils.js";import{InteractiveToolBase as T}from"../interactive/InteractiveToolBase.js";import j from"../interactive/sketch/SketchOptions.js";import{makeTooltip as L,pasteLocation as H,enterInputModeIfAvailable as R}from"../interactive/tooltip/tooltipCommonUtils.js";import{autorun as z}from"../../core/accessorSupport/trackingUtils.js";let A=class extends T{constructor(t){super(t),this._graphic=null,this._coordinateFormatterLoadTask=null,this._createOperationGeometry=null,this.defaultZ=0,this.directionOptions=null,this.elevationLockOnVertexAddDisabled=!1,this.geometryType=null,this.hasZ=!0,this.geometryToPlace=null,this.snappingManager=null,this.snapToScene=!1,this.sketchOptions=new j}initialize(){const{view:t}=this;this.internalGraphicsLayer=new h({listMode:"hide",internal:!0,title:"DrawGraphicTool layer"}),this.view.map.layers.add(this.internalGraphicsLayer);const e=this.drawOperation=this.makeDrawOperation();this.tooltipInfos=G(t.type,this.sketchOptions);const o=L(()=>({view:t,options:this.sketchOptions.tooltips}));this.tooltip=o,x(this._tooltipsContext),this._coordinateFormatterLoadTask=r(()=>d()),this.addHandles([e.on("vertex-add",t=>this.onVertexAdd(t)),e.on("vertex-remove",t=>this.onVertexRemove(t)),e.on("vertex-update",t=>this.onVertexUpdate(t)),e.on("cursor-update",t=>this.onCursorUpdate(t)),e.on("cursor-remove",()=>this._updateGraphic()),e.on("complete",t=>this.onComplete(t)),this._coordinateFormatterLoadTask,o.on("paste",t=>H(t,this.activeTooltipInfo)),a(()=>this.cursor,t=>{e.cursor=t},n),z(()=>{const{activeTooltipInfo:t,sketchOptions:e}=this;V(t,this._tooltipsContext),o.info=e.tooltips.effectiveEnabled?t:null}),z(()=>{e.constraintZ=U(this._tooltipsContext)},l)]),this.finishToolCreation(),e.initializePointer()}destroy(){this.drawOperation=s(this.drawOperation),this.tooltip=s(this.tooltip),this._destroyAllVisualizations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=s(this.internalGraphicsLayer),this._set("view",null)}get _drawSpatialReference(){return this.drawOperation.coordinateHelper.spatialReference}get _tooltipsContext(){const{defaultZ:t,directionOptions:e,drawOperation:o,forceUniformSize:r,geometryType:i,graphic:s,sketchOptions:a,tooltipInfos:n,view:l,automaticAreaMeasurementUtils:p,automaticLengthMeasurementUtils:c}=this;return{createOperationGeometry:this._createOperationGeometry,defaultZ:t,directionOptions:e,drawOperation:o,forceUniformSize:r,geometryType:i,graphic:s,sketchOptions:a,tooltipInfos:n,view:l,automaticAreaMeasurementUtils:p,automaticLengthMeasurementUtils:c}}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(t){this._set("centered",t),this._updateGraphic()}get cursor(){return this._get("cursor")}set cursor(t){this._set("cursor",t)}set enabled(t){this.drawOperation.interactive=t,this._set("enabled",t)}set forceUniformSize(t){this._set("forceUniformSize",t),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(t){this._set("graphicSymbol",t),null!=this._graphic&&(this._graphic.symbol=t)}set mode(t){const e=this.drawOperation;e&&(e.drawingMode=t),this._set("mode",t)}get updating(){return this.drawOperation?.updating??!1}get undoRedo(){const{view:{type:t,map:e}}=this;return"2d"===t&&e&&"undoRedo"in e&&e.undoRedo instanceof o?e.undoRedo:null}set undoRedo(t){this._override("undoRedo",t)}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(t){this.destroyed||R(t,this.tooltip)||this.drawOperation.onInputEvent(t)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo(),0===this.drawOperation.numCommittedVertices&&x(this._tooltipsContext)}_destroyAllVisualizations(){this.removeHandles(I.outline),this.removeHandles(I.regularVertices),this.removeHandles(I.activeVertex),this.removeHandles(I.activeEdge),this.removeHandles(E)}_createOrUpdateGraphic(t){if(null!=this._graphic)return this.updateGraphicGeometry(t),this._graphic;const o=new e({...this.graphicProperties,symbol:this.graphicSymbol});return this._graphic=o,this.updateGraphicGeometry(t),this.internalGraphicsLayer.add(o),this.addHandles(this.initializeGraphic(o)),this.notifyChange("graphic"),this.addHandles(i(()=>{this.internalGraphicsLayer.remove(o),this._graphic===o&&(this._graphic=null)}),E),o}updateGraphicGeometry(t){this._graphic.geometry=t}_getCreateOperationGeometry(t={operationComplete:!1}){if(null==this.drawOperation)return;const{coordinateHelper:e,view:o,visualizationCursorVertex:r,lastVertex:i,committedVertices:s,geometryIncludingUncommittedVertices:a,numCommittedVertices:n}=this.drawOperation;if(!(n>0||null!=r))return;const l=t.operationComplete?s:a,p=l.length,c=null!=r?e.pointToArray(r):null,d=this._drawSpatialReference,h="3d"===o.type&&"global"===o.viewingMode,G=new m;G.committedVertices=s,G.cursorVertex=c;const{geometryType:x}=this;switch(x){case"point":case"mesh":G.full=e.arrayToPoint(l[0]);break;case"multipoint":G.full=p>0?w(l,d):null;break;case"polyline":case"polygon":p>0&&(G.full="polygon"===x?O([l],d,h,!0):_([l],d,h),G.cursorEdge=null!=c&&i&&!u(r,i)?_([[c,e.pointToArray(i)]],d,h):null,G.outline=p>1?G.full:null);break;case"circle":case"rectangle":{if(G.committedVertices=G.cursorVertex=null,!p)break;const e=C(o,l[0]),r=l[0],i=e.makeMapPoint(r[0]+D*o.resolution,r[1]);"circle"===x?1===p&&t.operationComplete?G.circle=y([r,i],e,!0):2===p&&(this.forceUniformSize?G.circle=y(l,e,this.centered):G.rectangle=g(l,e,this.centered)):1===p&&t.operationComplete?G.rectangle=v([r,i],e,!0):2===p&&(G.rectangle=this.forceUniformSize?v(l,e,this.centered):f(l,e,this.centered)),G.full=null!=G.circle?G.circle.geometry:G.rectangle?.geometry,G.outline="polygon"===G.full?.type?G.full:null;break}default:return null}return G}initializeGraphic(t){return i()}onComplete(t){if(!this.drawOperation)return;this._updateGraphic();let e=null;if(this.drawOperation.isCompleted){const t=this._getCreateOperationGeometry({operationComplete:!0});null!=t&&(e=this._createOrUpdateGraphic(t.full))}this._createOperationGeometry=null,this.emit("complete",{graphic:e,...t})}onCursorUpdate(t){this._updateGraphic(),this.emit("cursor-update",t)}onDeactivate(){const{drawOperation:t}=this;t&&(t.isCompleted||t.cancel())}onOutlineChanged(t){return i()}onCursorEdgeChanged(t){return i()}onVertexAdd(t){b(this._tooltipsContext),this._updateGraphic(),this.elevationLockOnVertexAddDisabled||k(t.vertices.at(0)?.coordinates,this._tooltipsContext),this.emit("vertex-add",t)}onVertexRemove(t){b(this._tooltipsContext),this._updateGraphic(),this.emit("vertex-remove",t)}onVertexUpdate(t){this._updateGraphic(),this.emit("vertex-update",t)}_updateGraphic(){const t=this._getCreateOperationGeometry();this._createOperationGeometry=t,null!=t?(null!=t.cursorEdge?this.addHandles(this.onCursorEdgeChanged(t.cursorEdge),I.activeEdge):this.removeHandles(I.activeEdge),null!=t.outline?this.addHandles(this.onOutlineChanged(t.outline),I.outline):this.removeHandles(I.outline),null!=t.committedVertices?this.addHandles(this.onRegularVerticesChanged(t.committedVertices),I.regularVertices):this.removeHandles(I.regularVertices),null!=t.cursorVertex?this.addHandles(this.onActiveVertexChanged(t.cursorVertex),I.activeVertex):this.removeHandles(I.activeVertex),null!=t.full?this._createOrUpdateGraphic(t.full):this.removeHandles(E)):this._destroyAllVisualizations()}get activeTooltipInfo(){return this._coordinateFormatterLoadTask?.finished?S(this._tooltipsContext):null}};t([p()],A.prototype,"_coordinateFormatterLoadTask",void 0),t([p()],A.prototype,"_createOperationGeometry",void 0),t([p()],A.prototype,"_tooltipsContext",null),t([p({value:!0})],A.prototype,"centered",null),t([p()],A.prototype,"cursor",null),t([p({nonNullable:!0})],A.prototype,"defaultZ",void 0),t([p({constructOnly:!0})],A.prototype,"directionOptions",void 0),t([p()],A.prototype,"drawOperation",void 0),t([p()],A.prototype,"elevationLockOnVertexAddDisabled",void 0),t([p({value:!0})],A.prototype,"enabled",null),t([p({value:!0})],A.prototype,"forceUniformSize",null),t([p({constructOnly:!0})],A.prototype,"geometryType",void 0),t([p()],A.prototype,"graphic",null),t([p({constructOnly:!0})],A.prototype,"graphicProperties",void 0),t([p()],A.prototype,"graphicSymbol",null),t([p({constructOnly:!0})],A.prototype,"hasZ",void 0),t([p({constructOnly:!0})],A.prototype,"geometryToPlace",void 0),t([p()],A.prototype,"mode",null),t([p()],A.prototype,"snappingManager",void 0),t([p()],A.prototype,"snapToScene",void 0),t([p()],A.prototype,"tooltip",void 0),t([p()],A.prototype,"tooltipInfos",void 0),t([p({constructOnly:!0,type:j})],A.prototype,"sketchOptions",void 0),t([p()],A.prototype,"updating",null),t([p({constructOnly:!0,nonNullable:!0})],A.prototype,"view",void 0),t([p({constructOnly:!0})],A.prototype,"automaticAreaMeasurementUtils",void 0),t([p({constructOnly:!0})],A.prototype,"automaticLengthMeasurementUtils",void 0),t([p({constructOnly:!0})],A.prototype,"undoRedo",null),t([p()],A.prototype,"activeTooltipInfo",null),A=t([c("esri.views.draw.DrawGraphicTool")],A);const E=Symbol("create-operation-graphic"),I={outline:Symbol("outline-visual"),regularVertices:Symbol("regular-vertices-visual"),activeVertex:Symbol("active-vertex-visual"),activeEdge:Symbol("active-edge-visual")};function M(t){switch(t){case"point":case"polyline":case"polygon":case"multipoint":return t;case"circle":case"rectangle":return"segment";case"mesh":return"point"}}const D=48;export{A as DrawGraphicTool,M as geometryTypeToDrawOperationGeometryType};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{EventedAccessor as e}from"../../core/Evented.js";import{clone as i}from"../../core/lang.js";import{equalsMaybe as n,destroyMaybe as r}from"../../core/maybe.js";import{memoize as s}from"../../core/memoize.js";import{ignoreAbortErrors as o}from"../../core/promiseUtils.js";import a from"../../core/ReactiveSet.js";import{watch as p,syncAndInitial as c}from"../../core/reactiveUtils.js";import{createScreenPoint as l}from"../../core/screenUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{diff as u}from"../../core/accessorSupport/diffUtils.js";import{UpdatingHandles as g}from"../../core/support/UpdatingHandles.js";import{pointEquals as m,pointNear as y}from"../../layers/graphics/dehydratedFeatureComparison.js";import{getEffectiveElevationInfo as _}from"../../support/elevationInfoUtils.js";import{defaultDrawingMode as v}from"./DrawingMode.js";import{LegacyDrawManipulator as f}from"./LegacyDrawManipulator.js";import{createCoordinateHelper as x}from"../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as P,sceneSnappingAtLocation as b}from"../interactive/dragEventPipeline.js";import{EditGeometry as T,Part as S}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as C}from"../interactive/editGeometry/EditGeometryOperations.js";import{isPoint as V}from"../interactive/sketch/constraints.js";import{pointToConstraintSpace as w,constraintSpaceToPoint as O,getPointConstraint as M,getPolylineOrPolygonConstraint as D}from"../interactive/sketch/constraintUtils.js";import E from"../interactive/sketch/SketchLabelOptions.js";import{SnappingContext as I}from"../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as H}from"../interactive/snapping/SnappingDragPipelineStep.js";import{SnappingOperation as j}from"../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as G}from"../interactive/snapping/snappingUtils.js";const k="crosshair",Z="progress",L=Symbol(),U=Symbol();let A=class extends e{constructor(t){super(t),this._createOperationCompleted=!1,this._hideDefaultCursor=!1,this._pointerDownStates=new a,this._stagedScreenPoint=null,this._stagedPointerType=null,this._updatingHandles=new g,this._stagedPointerId=null,this.constraintsEnabled=!1,this.constraints=void 0,this._getPointConstraint=s(M),this._getPolylineOrPolygonConstraint=s(D),this.constraintZ=null,this.defaultZ=null,this.isDraped=!0,this.labelOptions=new E,this.cursor=null,this.loading=!1,this.snapToSceneEnabled=null,this.firstVertex=null,this.lastVertex=null,this.secondToLastVertex=null,null==t.elevationInfo&&(this.elevationInfo=_(!!t.hasZ))}initialize(){const{geometryType:t,view:e}=this,i=e.spatialReference,r="viewingMode"in e.state?e.state.viewingMode:2,s="segment"===t||"multipoint"===t?"polyline":t;this.coordinateHelper=x(this.hasZ,this.hasM,i),this._editGeometryOperations=new C(new T(s,this.coordinateHelper),r),this._snappingOperation=new j({view:e}),this.addHandles([p(()=>({stagedPoint:this._snappingOperation.stagedPoint,constraint:this._constraint}),({stagedPoint:t,constraint:e},i)=>{const{snappingOptions:n}=this;n&&(n.forceDisabled=null!=e&&V(e));if(null!=i&&t===i.stagedPoint&&e!==i.constraint)return this._onKeyboardBasedChange();this._processCursor(t??this._screenToMap(this._stagedScreenPoint))},{equals:(t,e)=>t.stagedPoint===e.stagedPoint&&n(t.constraint,e.constraint)}),p(()=>this.view.viewpoint,(t,e)=>{t&&e&&u(t,e)&&this._onKeyboardBasedChange()})]),this._activePart=new S(i,r),this._editGeometryOperations.data.parts.push(this._activePart);const a=this.segmentLabels;null!=a&&(a.context={view:e,editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,labelOptions:this.labelOptions,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils},this.addHandles(p(()=>this.labelOptions.enabled,t=>{a.visible=t},c))),this.addHandles(this._editGeometryOperations.on(["vertex-add","vertex-update","vertex-remove"],t=>{const e=t.vertices.map(t=>({componentIndex:0,vertexIndex:t.index,coordinates:this.coordinateHelper.vectorToArray(t.pos)})),i=e.map(t=>t.coordinates),n=this.coordinateHelper.vectorToDehydratedPoint(this._activePart.getFirstVertex()?.pos)??null;m(n,this.firstVertex)||(this.firstVertex=n);const r=this.coordinateHelper.vectorToDehydratedPoint(this._activePart.getLastVertex()?.pos)??null;m(r,this.lastVertex)||(this.lastVertex=r);const s=this.coordinateHelper.vectorToDehydratedPoint(this._activePart.segments.at(-1)?.leftVertex?.pos)??null;switch(m(s,this.secondToLastVertex)||(this.secondToLastVertex=s),this._processCursor(this.cursorVertex),t.type){case"vertex-add":this.emit(t.type,{...t,added:i,vertices:e});break;case"vertex-update":this.emit(t.type,{...t,updated:i,vertices:e});break;case"vertex-remove":this.emit(t.type,{...t,removed:i,vertices:e})}}));const l=this._manipulator=new f({consumesClicks:!1,grabbableForEvent:t=>"click"!==this.drawingMode||"touch"===t.pointerType&&this._snappingEnabled&&1===this._pointerDownStates.size});this.manipulators.add(l),l.grabbable="point"!==t&&"multipoint"!==t,this.addHandles([l.events.on("immediate-click",t=>this._onImmediateClick(t)),l.events.on("immediate-double-click",t=>this._onImmediateDoubleClick(t)),p(()=>this.drawingMode,()=>{this.removeHandles(L),this.addHandles(this._createManipulatorDragPipeline(l),L)},c),p(()=>({effectiveCursor:this.effectiveCursor}),({effectiveCursor:t})=>{l.cursor=t},c)]),G(this,()=>{const t=this.view.inputManager.latestPointerType??"mouse",e=this._getSnappingContext(t);if(null!=this.snappingManager){const t=this._snappingOperation.snapAgainNearPreviousMapPoint(this.snappingManager,e);this._updatingHandles.addPromise(o(t))}})}destroy(){r(this.segmentLabels),r(this._snappingOperation),this._editGeometryOperations=r(this._editGeometryOperations),this._updatingHandles.destroy()}get _isDragging(){const{_stagedPointerId:t,_manipulator:e}=this;return null!=t&&this._pointerDownStates.has(t)||e.grabbing||!e.interactive}get _snappingEnabled(){return null!=this.snappingManager&&this.snappingManager.options.effectiveEnabled}get _requiresScenePoint(){const t=this._updateAndGetEffectiveDrawSurface();return"3d"===this.view.type&&this.drawSurface!==t}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activePart.vertices.map(t=>this.coordinateHelper.vectorToArray(t.pos))}get _constraint(){const{constraints:t,constraintsEnabled:e}=this;if(t&&e)switch(this.geometryType){case"point":case"multipoint":return this._getPointConstraint(t);case"polygon":case"polyline":return this._getPolylineOrPolygonConstraint(this.lastVertex,this.secondToLastVertex,t)}}set drawingMode(t){this._set("drawingMode",t??v)}get effectiveCursor(){return this.loading?Z:this._hideDefaultCursor?null:this.cursor||k}get interactive(){return this._manipulator.interactive}set interactive(t){this._manipulator.interactive=t}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activePart.vertices.length}get snappingOptions(){return null!=this.snappingManager?this.snappingManager.options:null}get cursorVertex(){return this._get("cursorVertex")}get visualizationCursorVertex(){return"mouse"===this._stagedPointerType?this.cursorVertex:null}get committableVertex(){const{cursorVertex:t,lastVertex:e,firstVertex:i,geometryType:n}=this;return"polygon"===n&&y(t,i)||y(t,e)?null:t}get updating(){return this._updatingHandles.updating}get geometryIncludingUncommittedVertices(){const{committedVertices:t,committableVertex:e,coordinateHelper:i}=this,n=t.slice();return null!=e&&n.push(i.pointToArray(e)),n}cancel(){this.complete({aborted:!0})}commitStagedVertex(){this._snappingOperation.abort();const{committableVertex:t}=this;null!=t&&this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(t))}complete(t){const e=t?.aborted||!1;this._snappingOperation.abort(),this.snappingManager?.doneSnapping();const{geometryType:i,numCommittedVertices:n}=this,r="multipoint"===i&&0===n||"polyline"===i&&n<2||"polygon"===i&&n<3;"segment"!==i&&"point"!==i||this.commitStagedVertex(),this._createOperationCompleted=!r,(this.isCompleted||e)&&(this._stagedScreenPoint=null,this._stagedPointerId=null,this._stagedPointerType=null,this._processCursor(null),this.emit("complete",{vertices:this.committedVertices.map((t,e)=>({componentIndex:0,vertexIndex:e,coordinates:t})),aborted:e,type:"complete"}))}onInputEvent(t){switch(t.type){case"pointer-down":this._pointerDownStates.add(t.pointerId);break;case"pointer-up":this._pointerDownStates.delete(t.pointerId)}switch(t.type){case"pointer-move":return this._onPointerMove(t);case"hold":return this._onHold(t)}}redo(){this._editGeometryOperations.redo()}undo(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_processCursor(t){const e=i(this.cursorVertex),n=i(t),r=n&&(this._updateAndGetEffectiveDrawSurface()?.constrainZ(n)??n),s=this._snapToClosingVertex(r),o=this._applyConstraints(s);y(e,o)||(this._set("cursorVertex",o),this.segmentLabels?.set("stagedVertex",null!=o?this.coordinateHelper.pointToVector(o):null),null==o||"mouse"!==this._stagedPointerType?this.emit("cursor-remove"):this.emit("cursor-update",{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activePart.vertices.length,coordinates:this.coordinateHelper.pointToArray(o)}],operation:"apply",type:"vertex-update"}))}_snapToClosingVertex(t){if(null==t||this._isDragging||"polygon"!==this.geometryType||this.numCommittedVertices<=2)return t;const e=this._mapToScreen(t);if(!e)return t;const i=this._activePart;return this._vertexWithinPointerDistance(i.vertices[0].pos,e)?this.firstVertex:this._vertexWithinPointerDistance(i.vertices.at(-1).pos,e)?this.lastVertex:t}_createManipulatorDragPipeline(t){switch(this.drawingMode){case"click":return this._createManipulatorDragPipelineClick(t);case"freehand":return this._createManipulatorDragPipelineFreehand(t);case"hybrid":return this._createManipulatorDragPipelineHybrid(t)}}_createManipulatorDragPipelineClick(t){return P(t,(t,e,i,n)=>{const r="touch"===n&&this._snappingEnabled;if(this.isCompleted||!r)return;const{snappingStep:s,cancelSnapping:o}=H({predicate:()=>r,snappingManager:this.snappingManager,snappingContext:new I({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,feature:this.graphic,pointer:n,visualizer:this.snappingVisualizer,drawConstraints:this.constraints}),updatingHandles:this._updatingHandles,useZ:!this._requiresScenePoint});i=i.next(t=>(r&&null!=this.snappingManager&&this.snappingManager.doneSnapping(),t)).next(o),e.next(this._screenToMapDragEventStep()).next(t=>("start"===t.action&&(this._processCursor(t.mapStart),("segment"===this.geometryType||r&&!this.numCommittedVertices)&&this.commitStagedVertex()),t)).next(b(this.view,this.elevationInfo)).next(...s).next(t=>(r&&(this._processCursor(t.mapEnd),"end"===t.action&&this.commitStagedVertex()),t)).next(t=>("end"===t.action&&("mouse"!==this._stagedPointerType&&this._snappingOperation.abort(),"segment"!==this.geometryType&&"point"!==this.geometryType||this.complete()),t))})}_createManipulatorDragPipelineFreehand(t){return P(t,(t,e)=>{this.isCompleted||e.next(this._screenToMapDragEventStep()).next(t=>("start"===t.action&&(this._snappingOperation.abort(),null==this.committableVertex&&this._processCursor(t.mapStart),"segment"===this.geometryType&&this.commitStagedVertex()),t)).next(t=>{switch(t.action){case"start":case"update":this._processCursor(t.mapEnd),"polygon"!==this.geometryType&&"polyline"!==this.geometryType||this.commitStagedVertex();break;case"end":this.complete()}return t})})}_createManipulatorDragPipelineHybrid(t){return P(t,(t,e)=>{this.isCompleted||e.next(this._screenToMapDragEventStep()).next(t=>("start"===t.action&&(this._snappingOperation.abort(),this.addHandles(this._editGeometryOperations.createUndoGroup(),U),this._processCursor(t.mapStart),this.commitStagedVertex()),t)).next(t=>{switch(t.action){case"start":case"update":this._processCursor(t.mapEnd),"polygon"!==this.geometryType&&"polyline"!==this.geometryType||this.commitStagedVertex();break;case"end":"mouse"!==this._stagedPointerType&&this._snappingOperation.abort(),this.removeHandles(U),"segment"!==this.geometryType&&"point"!==this.geometryType||this.complete()}return t})})}get _drawAtFixedElevation(){const{constraintsEnabled:t,constraintZ:e,geometryType:i,numCommittedVertices:n}=this;return t?null!=e||"segment"===i&&n>0:("segment"===i||"polygon"===i)&&n>0}_updateAndGetEffectiveDrawSurface(){const{constraintsEnabled:t,coordinateHelper:e,drawSurface:i,elevationDrawSurface:n,snapToSceneEnabled:r}=this;if(null==n)return i;if(!this.hasZ)return n.defaultZ=null,n;const s=this.elevationInfo?.mode;let o=this.defaultZ,a=t||"absolute-height"===s;if(null!=r&&(a=r),"on-the-ground"===s&&(a=!1),this._drawAtFixedElevation){o=(t?this.constraintZ:null)??e.getZ(this._activePart.vertices[0].pos),a=!1}return a?i:(n.defaultZ=o,n)}_mapToScreen(t){return this._updateAndGetEffectiveDrawSurface()?.mapToScreen(t)}_onHold(t){this._snappingOperation.abort(),"click"===this.drawingMode&&"touch"===t.pointerType&&this._snappingEnabled&&this._processCursor(t.mapPoint),t.stopPropagation()}_onImmediateClick(t){if(!("mouse"===t.pointerType&&2===t.button||this._manipulator.dragging))try{const{drawingMode:e,geometryType:i}=this;this._stagedPointerType=t.pointerType,this._stagedScreenPoint=t.screenPoint;const n=this._screenToMap(t.screenPoint);if(null==n)return;if(null==n||"freehand"===e&&"point"!==i&&"multipoint"!==i)return;if(this._snappingEnabled&&null!=this.cursorVertex||this._processCursor(n),null==this.committableVertex)return void this.complete();this.commitStagedVertex(),"mouse"!==t.pointerType&&this._processCursor(null),("freehand"===e&&"multipoint"!==this.geometryType||"point"===i||"segment"===i&&2===this.numCommittedVertices||"segment"===i&&"hybrid"===e&&1===this.numCommittedVertices)&&this.complete()}finally{t.stopPropagation()}}_onImmediateDoubleClick(t){this._manipulator.dragging||"point"===this.geometryType||(this.complete(),t.stopPropagation())}_onPointerMove(t){const e=l(t.x,t.y);this._stagedScreenPoint=e,this._stagedPointerType=t.pointerType,this._stagedPointerId=t.pointerId,this._isDragging?this._snappingOperation.abort():(t.stopPropagation(),this._processCursorMovementRelativeToSurface(e,t.pointerType))}_onKeyboardBasedChange(){"mouse"===this._stagedPointerType&&this._stagedScreenPoint&&null!=this._stagedPointerId&&!this._isDragging?this._processCursorMovementRelativeToSurface(this._stagedScreenPoint,this._stagedPointerType):this._snappingOperation.abort()}_processCursorMovementRelativeToSurface(t,e){const i=this._snappingOperation,n=this._screenToMap(t),r=this._requiresScenePoint?this.drawSurface?.screenToMap(t):null;if(null==n)return this._hideDefaultCursor=!0,this._processCursor(null),void i.abort();this._hideDefaultCursor=!1;const s=this.snappingManager;if(null==s)return this._processCursor(n),void i.abort();const a=this._getSnappingContext(e);this._updatingHandles.addPromise(o(i.snap({point:n,scenePoint:r},s,a)))}_applyConstraints(t){const{_constraint:e,constraints:i}=this;if(!t||!i||!e)return t;const{context:n}=i,r=w(t,n),s=r?e.closestTo(r):void 0;if(!s)return t;const o=O(s,t,n),a="2d"===this.view.type||"absolute-height"!==n.elevationInfo.mode;return null!=o&&a&&null!=this.constraintZ&&this.hasZ&&(o.z=this.constraintZ),o}_screenToMap(t){return t?this._updateAndGetEffectiveDrawSurface()?.screenToMap(t):null}_screenToMapDragEventStep(){let t=null;return e=>{if("start"===e.action&&(t=this._screenToMap(e.screenStart)),null==t)return null;const i=this._screenToMap(e.screenEnd);return null!=i?{...e,mapStart:t,mapEnd:i}:null}}_vertexWithinPointerDistance(t,e){const i=25,n=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(t));return null!=n&&z(n,e,i)}_getSnappingContext(t){const e=this._drawAtFixedElevation?this.elevationDrawSurface?.defaultZ:null;return new I({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:t,feature:this.graphic,visualizer:this.snappingVisualizer,selfSnappingZ:null!=e?{value:e,elevationInfo:this.elevationInfo}:null,drawConstraints:this.constraints})}};function z(t,e,i){const n=t.x-e.x,r=t.y-e.y;return n*n+r*r<=i}t([d()],A.prototype,"_hideDefaultCursor",void 0),t([d()],A.prototype,"_stagedPointerId",void 0),t([d()],A.prototype,"_isDragging",null),t([d()],A.prototype,"_snappingOperation",void 0),t([d()],A.prototype,"_snappingEnabled",null),t([d({constructOnly:!0})],A.prototype,"graphic",void 0),t([d()],A.prototype,"constraintsEnabled",void 0),t([d()],A.prototype,"constraints",void 0),t([d()],A.prototype,"_constraint",null),t([d()],A.prototype,"constraintZ",void 0),t([d()],A.prototype,"defaultZ",void 0),t([d()],A.prototype,"isDraped",void 0),t([d({constructOnly:!0})],A.prototype,"automaticLengthMeasurementUtils",void 0),t([d({value:v})],A.prototype,"drawingMode",null),t([d({constructOnly:!0})],A.prototype,"elevationDrawSurface",void 0),t([d({constructOnly:!0})],A.prototype,"elevationInfo",void 0),t([d({constructOnly:!0,type:E})],A.prototype,"labelOptions",void 0),t([d({constructOnly:!0})],A.prototype,"geometryType",void 0),t([d({constructOnly:!0})],A.prototype,"hasM",void 0),t([d({constructOnly:!0})],A.prototype,"hasZ",void 0),t([d()],A.prototype,"cursor",void 0),t([d()],A.prototype,"effectiveCursor",null),t([d()],A.prototype,"loading",void 0),t([d({constructOnly:!0})],A.prototype,"manipulators",void 0),t([d({constructOnly:!0})],A.prototype,"drawSurface",void 0),t([d({constructOnly:!0})],A.prototype,"segmentLabels",void 0),t([d({constructOnly:!0})],A.prototype,"snappingManager",void 0),t([d({constructOnly:!0})],A.prototype,"snappingVisualizer",void 0),t([d()],A.prototype,"snapToSceneEnabled",void 0),t([d({readOnly:!0})],A.prototype,"cursorVertex",null),t([d({readOnly:!0})],A.prototype,"visualizationCursorVertex",null),t([d()],A.prototype,"committableVertex",null),t([d()],A.prototype,"firstVertex",void 0),t([d()],A.prototype,"lastVertex",void 0),t([d()],A.prototype,"secondToLastVertex",void 0),t([d()],A.prototype,"updating",null),t([d({constructOnly:!0})],A.prototype,"view",void 0),A=t([h("esri.views.draw.DrawOperation")],A);export{A as DrawOperation,k as defaultCursor,Z as defaultLoadingCursor};
5
+ import{__decorate as t}from"tslib";import{EventedAccessor as e}from"../../core/Evented.js";import{clone as i}from"../../core/lang.js";import{equalsMaybe as n,destroyMaybe as r}from"../../core/maybe.js";import{memoize as s}from"../../core/memoize.js";import{ignoreAbortErrors as o}from"../../core/promiseUtils.js";import a from"../../core/ReactiveSet.js";import{watch as p,syncAndInitial as c}from"../../core/reactiveUtils.js";import{createScreenPoint as l}from"../../core/screenUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{diff as u}from"../../core/accessorSupport/diffUtils.js";import{UpdatingHandles as g}from"../../core/support/UpdatingHandles.js";import{pointEquals as m,pointNear as y}from"../../layers/graphics/dehydratedFeatureComparison.js";import{getEffectiveElevationInfo as _}from"../../support/elevationInfoUtils.js";import{defaultDrawingMode as v}from"./DrawingMode.js";import{LegacyDrawManipulator as f}from"./LegacyDrawManipulator.js";import{createCoordinateHelper as x}from"../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as P,sceneSnappingAtLocation as b}from"../interactive/dragEventPipeline.js";import{EditGeometry as T,Part as S}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as C}from"../interactive/editGeometry/EditGeometryOperations.js";import{isPoint as V}from"../interactive/sketch/constraints.js";import{pointToConstraintSpace as w,constraintSpaceToPoint as O,getPointConstraint as M,getPolylineOrPolygonConstraint as D}from"../interactive/sketch/constraintUtils.js";import E from"../interactive/sketch/SketchLabelOptions.js";import{SnappingContext as I}from"../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as H}from"../interactive/snapping/SnappingDragPipelineStep.js";import{SnappingOperation as j}from"../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as G}from"../interactive/snapping/snappingUtils.js";const k="crosshair",Z="progress",L=Symbol(),U=Symbol();let A=class extends e{constructor(t){super(t),this._createOperationCompleted=!1,this._hideDefaultCursor=!1,this._pointerDownStates=new a,this._stagedScreenPoint=null,this._stagedPointerType=null,this._updatingHandles=new g,this._stagedPointerId=null,this.constraintsEnabled=!1,this.constraints=void 0,this._getPointConstraint=s(M),this._getPolylineOrPolygonConstraint=s(D),this.constraintZ=null,this.defaultZ=null,this.isDraped=!0,this.labelOptions=new E,this.cursor=null,this.loading=!1,this.snapToSceneEnabled=null,this.firstVertex=null,this.lastVertex=null,this.secondToLastVertex=null,null==t.elevationInfo&&(this.elevationInfo=_(!!t.hasZ))}initializePointer(){const t=this.view.inputManager?.latestPointerInfo;null!=t&&this._updatePointer(t.location,t.id,t.type)}initialize(){const{geometryType:t,view:e}=this,i=e.spatialReference,r="viewingMode"in e.state?e.state.viewingMode:2,s="segment"===t||"multipoint"===t?"polyline":t;this.coordinateHelper=x(this.hasZ,this.hasM,i),this._editGeometryOperations=new C(new T(s,this.coordinateHelper),r),this._snappingOperation=new j({view:e}),this.addHandles([p(()=>({stagedPoint:this._snappingOperation.stagedPoint,constraint:this._constraint}),({stagedPoint:t,constraint:e},i)=>{const{snappingOptions:n}=this;n&&(n.forceDisabled=null!=e&&V(e));if(null!=i&&t===i.stagedPoint&&e!==i.constraint)return this._onKeyboardBasedChange();this._processCursor(t??this._screenToMap(this._stagedScreenPoint))},{equals:(t,e)=>t.stagedPoint===e.stagedPoint&&n(t.constraint,e.constraint)}),p(()=>this.view.viewpoint,(t,e)=>{t&&e&&u(t,e)&&this._onKeyboardBasedChange()})]),this._activePart=new S(i,r),this._editGeometryOperations.data.parts.push(this._activePart);const a=this.segmentLabels;null!=a&&(a.context={view:e,editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,labelOptions:this.labelOptions,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils},this.addHandles(p(()=>this.labelOptions.enabled,t=>{a.visible=t},c))),this.addHandles(this._editGeometryOperations.on(["vertex-add","vertex-update","vertex-remove"],t=>{const e=t.vertices.map(t=>({componentIndex:0,vertexIndex:t.index,coordinates:this.coordinateHelper.vectorToArray(t.pos)})),i=e.map(t=>t.coordinates),n=this.coordinateHelper.vectorToDehydratedPoint(this._activePart.getFirstVertex()?.pos)??null;m(n,this.firstVertex)||(this.firstVertex=n);const r=this.coordinateHelper.vectorToDehydratedPoint(this._activePart.getLastVertex()?.pos)??null;m(r,this.lastVertex)||(this.lastVertex=r);const s=this.coordinateHelper.vectorToDehydratedPoint(this._activePart.segments.at(-1)?.leftVertex?.pos)??null;switch(m(s,this.secondToLastVertex)||(this.secondToLastVertex=s),this._processCursor(this.cursorVertex),t.type){case"vertex-add":this.emit(t.type,{...t,added:i,vertices:e});break;case"vertex-update":this.emit(t.type,{...t,updated:i,vertices:e});break;case"vertex-remove":this.emit(t.type,{...t,removed:i,vertices:e})}}));const l=this._manipulator=new f({consumesClicks:!1,grabbableForEvent:t=>"click"!==this.drawingMode||"touch"===t.pointerType&&this._snappingEnabled&&1===this._pointerDownStates.size});this.manipulators.add(l),l.grabbable="point"!==t&&"multipoint"!==t,this.addHandles([l.events.on("immediate-click",t=>this._onImmediateClick(t)),l.events.on("immediate-double-click",t=>this._onImmediateDoubleClick(t)),p(()=>this.drawingMode,()=>{this.removeHandles(L),this.addHandles(this._createManipulatorDragPipeline(l),L)},c),p(()=>({effectiveCursor:this.effectiveCursor}),({effectiveCursor:t})=>{l.cursor=t},c)]),G(this,()=>{const t=this.view.inputManager.latestPointerInfo?.type??"mouse",e=this._getSnappingContext(t);if(null!=this.snappingManager){const t=this._snappingOperation.snapAgainNearPreviousMapPoint(this.snappingManager,e);this._updatingHandles.addPromise(o(t))}})}destroy(){r(this.segmentLabels),r(this._snappingOperation),this._editGeometryOperations=r(this._editGeometryOperations),this._updatingHandles.destroy()}get _isDragging(){const{_stagedPointerId:t,_manipulator:e}=this;return null!=t&&this._pointerDownStates.has(t)||e.grabbing||!e.interactive}get _snappingEnabled(){return null!=this.snappingManager&&this.snappingManager.options.effectiveEnabled}get _requiresScenePoint(){const t=this._updateAndGetEffectiveDrawSurface();return"3d"===this.view.type&&this.drawSurface!==t}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activePart.vertices.map(t=>this.coordinateHelper.vectorToArray(t.pos))}get _constraint(){const{constraints:t,constraintsEnabled:e}=this;if(t&&e)switch(this.geometryType){case"point":case"multipoint":return this._getPointConstraint(t);case"polygon":case"polyline":return this._getPolylineOrPolygonConstraint(this.lastVertex,this.secondToLastVertex,t)}}set drawingMode(t){this._set("drawingMode",t??v)}get effectiveCursor(){return this.loading?Z:this._hideDefaultCursor?null:this.cursor||k}get interactive(){return this._manipulator.interactive}set interactive(t){this._manipulator.interactive=t}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activePart.vertices.length}get snappingOptions(){return null!=this.snappingManager?this.snappingManager.options:null}get cursorVertex(){return this._get("cursorVertex")}get visualizationCursorVertex(){return"mouse"===this._stagedPointerType?this.cursorVertex:null}get committableVertex(){const{cursorVertex:t,lastVertex:e,firstVertex:i,geometryType:n}=this;return"polygon"===n&&y(t,i)||y(t,e)?null:t}get updating(){return this._updatingHandles.updating}get geometryIncludingUncommittedVertices(){const{committedVertices:t,committableVertex:e,coordinateHelper:i}=this,n=t.slice();return null!=e&&n.push(i.pointToArray(e)),n}cancel(){this.complete({aborted:!0})}commitStagedVertex(){this._snappingOperation.abort();const{committableVertex:t}=this;null!=t&&this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(t))}complete(t){const e=t?.aborted||!1;this._snappingOperation.abort(),this.snappingManager?.doneSnapping();const{geometryType:i,numCommittedVertices:n}=this,r="multipoint"===i&&0===n||"polyline"===i&&n<2||"polygon"===i&&n<3;"segment"!==i&&"point"!==i||this.commitStagedVertex(),this._createOperationCompleted=!r,(this.isCompleted||e)&&(this._stagedScreenPoint=null,this._stagedPointerId=null,this._stagedPointerType=null,this._processCursor(null),this.emit("complete",{vertices:this.committedVertices.map((t,e)=>({componentIndex:0,vertexIndex:e,coordinates:t})),aborted:e,type:"complete"}))}onInputEvent(t){switch(t.type){case"pointer-down":this._pointerDownStates.add(t.pointerId);break;case"pointer-up":this._pointerDownStates.delete(t.pointerId)}switch(t.type){case"pointer-move":return this._onPointerMove(t);case"hold":return this._onHold(t)}}redo(){this._editGeometryOperations.redo()}undo(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_processCursor(t){const e=i(this.cursorVertex),n=i(t),r=n&&(this._updateAndGetEffectiveDrawSurface()?.constrainZ(n)??n),s=this._snapToClosingVertex(r),o=this._applyConstraints(s);y(e,o)||(this._set("cursorVertex",o),this.segmentLabels?.set("stagedVertex",null!=o?this.coordinateHelper.pointToVector(o):null),null==o||"mouse"!==this._stagedPointerType?this.emit("cursor-remove"):this.emit("cursor-update",{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activePart.vertices.length,coordinates:this.coordinateHelper.pointToArray(o)}],operation:"apply",type:"vertex-update"}))}_snapToClosingVertex(t){if(null==t||this._isDragging||"polygon"!==this.geometryType||this.numCommittedVertices<=2)return t;const e=this._mapToScreen(t);if(!e)return t;const i=this._activePart;return this._vertexWithinPointerDistance(i.vertices[0].pos,e)?this.firstVertex:this._vertexWithinPointerDistance(i.vertices.at(-1).pos,e)?this.lastVertex:t}_createManipulatorDragPipeline(t){switch(this.drawingMode){case"click":return this._createManipulatorDragPipelineClick(t);case"freehand":return this._createManipulatorDragPipelineFreehand(t);case"hybrid":return this._createManipulatorDragPipelineHybrid(t)}}_createManipulatorDragPipelineClick(t){return P(t,(t,e,i,n)=>{const r="touch"===n&&this._snappingEnabled;if(this.isCompleted||!r)return;const{snappingStep:s,cancelSnapping:o}=H({predicate:()=>r,snappingManager:this.snappingManager,snappingContext:new I({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,feature:this.graphic,pointer:n,visualizer:this.snappingVisualizer,drawConstraints:this.constraints}),updatingHandles:this._updatingHandles,useZ:!this._requiresScenePoint});i=i.next(t=>(r&&null!=this.snappingManager&&this.snappingManager.doneSnapping(),t)).next(o),e.next(this._screenToMapDragEventStep()).next(t=>("start"===t.action&&(this._processCursor(t.mapStart),("segment"===this.geometryType||r&&!this.numCommittedVertices)&&this.commitStagedVertex()),t)).next(b(this.view,this.elevationInfo)).next(...s).next(t=>(r&&(this._processCursor(t.mapEnd),"end"===t.action&&this.commitStagedVertex()),t)).next(t=>("end"===t.action&&("mouse"!==this._stagedPointerType&&this._snappingOperation.abort(),"segment"!==this.geometryType&&"point"!==this.geometryType||this.complete()),t))})}_createManipulatorDragPipelineFreehand(t){return P(t,(t,e)=>{this.isCompleted||e.next(this._screenToMapDragEventStep()).next(t=>("start"===t.action&&(this._snappingOperation.abort(),null==this.committableVertex&&this._processCursor(t.mapStart),"segment"===this.geometryType&&this.commitStagedVertex()),t)).next(t=>{switch(t.action){case"start":case"update":this._processCursor(t.mapEnd),"polygon"!==this.geometryType&&"polyline"!==this.geometryType||this.commitStagedVertex();break;case"end":this.complete()}return t})})}_createManipulatorDragPipelineHybrid(t){return P(t,(t,e)=>{this.isCompleted||e.next(this._screenToMapDragEventStep()).next(t=>("start"===t.action&&(this._snappingOperation.abort(),this.addHandles(this._editGeometryOperations.createUndoGroup(),U),this._processCursor(t.mapStart),this.commitStagedVertex()),t)).next(t=>{switch(t.action){case"start":case"update":this._processCursor(t.mapEnd),"polygon"!==this.geometryType&&"polyline"!==this.geometryType||this.commitStagedVertex();break;case"end":"mouse"!==this._stagedPointerType&&this._snappingOperation.abort(),this.removeHandles(U),"segment"!==this.geometryType&&"point"!==this.geometryType||this.complete()}return t})})}get _drawAtFixedElevation(){const{constraintsEnabled:t,constraintZ:e,geometryType:i,numCommittedVertices:n}=this;return t?null!=e||"segment"===i&&n>0:("segment"===i||"polygon"===i)&&n>0}_updateAndGetEffectiveDrawSurface(){const{constraintsEnabled:t,coordinateHelper:e,drawSurface:i,elevationDrawSurface:n,snapToSceneEnabled:r}=this;if(null==n)return i;if(!this.hasZ)return n.defaultZ=null,n;const s=this.elevationInfo?.mode;let o=this.defaultZ,a=t||"absolute-height"===s;if(null!=r&&(a=r),"on-the-ground"===s&&(a=!1),this._drawAtFixedElevation){o=(t?this.constraintZ:null)??e.getZ(this._activePart.vertices[0].pos),a=!1}return a?i:(n.defaultZ=o,n)}_mapToScreen(t){return this._updateAndGetEffectiveDrawSurface()?.mapToScreen(t)}_onHold(t){this._snappingOperation.abort(),"click"===this.drawingMode&&"touch"===t.pointerType&&this._snappingEnabled&&this._processCursor(t.mapPoint),t.stopPropagation()}_onImmediateClick(t){if(!("mouse"===t.pointerType&&2===t.button||this._manipulator.dragging))try{const{drawingMode:e,geometryType:i}=this;this._stagedPointerType=t.pointerType,this._stagedScreenPoint=t.screenPoint;const n=this._screenToMap(t.screenPoint);if(null==n)return;if(null==n||"freehand"===e&&"point"!==i&&"multipoint"!==i)return;if(this._snappingEnabled&&null!=this.cursorVertex||this._processCursor(n),null==this.committableVertex)return void this.complete();this.commitStagedVertex(),"mouse"!==t.pointerType&&this._processCursor(null),("freehand"===e&&"multipoint"!==this.geometryType||"point"===i||"segment"===i&&2===this.numCommittedVertices||"segment"===i&&"hybrid"===e&&1===this.numCommittedVertices)&&this.complete()}finally{t.stopPropagation()}}_onImmediateDoubleClick(t){this._manipulator.dragging||"point"===this.geometryType||(this.complete(),t.stopPropagation())}_onPointerMove(t){const e=l(t.x,t.y);this._updatePointer(e,t.pointerId,t.pointerType)&&t.stopPropagation()}_updatePointer(t,e,i){return this._stagedScreenPoint=t,this._stagedPointerType=i,this._stagedPointerId=e,this._isDragging?(this._snappingOperation.abort(),!1):(this._processCursorMovementRelativeToSurface(t,i),!0)}_onKeyboardBasedChange(){"mouse"===this._stagedPointerType&&this._stagedScreenPoint&&null!=this._stagedPointerId&&!this._isDragging?this._processCursorMovementRelativeToSurface(this._stagedScreenPoint,this._stagedPointerType):this._snappingOperation.abort()}_processCursorMovementRelativeToSurface(t,e){const i=this._snappingOperation,n=this._screenToMap(t),r=this._requiresScenePoint?this.drawSurface?.screenToMap(t):null;if(null==n)return this._hideDefaultCursor=!0,this._processCursor(null),void i.abort();this._hideDefaultCursor=!1;const s=this.snappingManager;if(null==s)return this._processCursor(n),void i.abort();const a=this._getSnappingContext(e);this._updatingHandles.addPromise(o(i.snap({point:n,scenePoint:r},s,a)))}_applyConstraints(t){const{_constraint:e,constraints:i}=this;if(!t||!i||!e)return t;const{context:n}=i,r=w(t,n),s=r?e.closestTo(r):void 0;if(!s)return t;const o=O(s,t,n),a="2d"===this.view.type||"absolute-height"!==n.elevationInfo.mode;return null!=o&&a&&null!=this.constraintZ&&this.hasZ&&(o.z=this.constraintZ),o}_screenToMap(t){return t?this._updateAndGetEffectiveDrawSurface()?.screenToMap(t):null}_screenToMapDragEventStep(){let t=null;return e=>{if("start"===e.action&&(t=this._screenToMap(e.screenStart)),null==t)return null;const i=this._screenToMap(e.screenEnd);return null!=i?{...e,mapStart:t,mapEnd:i}:null}}_vertexWithinPointerDistance(t,e){const i=25,n=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(t));return null!=n&&z(n,e,i)}_getSnappingContext(t){const e=this._drawAtFixedElevation?this.elevationDrawSurface?.defaultZ:null;return new I({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:t,feature:this.graphic,visualizer:this.snappingVisualizer,selfSnappingZ:null!=e?{value:e,elevationInfo:this.elevationInfo}:null,drawConstraints:this.constraints})}};function z(t,e,i){const n=t.x-e.x,r=t.y-e.y;return n*n+r*r<=i}t([d()],A.prototype,"_hideDefaultCursor",void 0),t([d()],A.prototype,"_stagedPointerId",void 0),t([d()],A.prototype,"_isDragging",null),t([d()],A.prototype,"_snappingOperation",void 0),t([d()],A.prototype,"_snappingEnabled",null),t([d({constructOnly:!0})],A.prototype,"graphic",void 0),t([d()],A.prototype,"constraintsEnabled",void 0),t([d()],A.prototype,"constraints",void 0),t([d()],A.prototype,"_constraint",null),t([d()],A.prototype,"constraintZ",void 0),t([d()],A.prototype,"defaultZ",void 0),t([d()],A.prototype,"isDraped",void 0),t([d({constructOnly:!0})],A.prototype,"automaticLengthMeasurementUtils",void 0),t([d({value:v})],A.prototype,"drawingMode",null),t([d({constructOnly:!0})],A.prototype,"elevationDrawSurface",void 0),t([d({constructOnly:!0})],A.prototype,"elevationInfo",void 0),t([d({constructOnly:!0,type:E})],A.prototype,"labelOptions",void 0),t([d({constructOnly:!0})],A.prototype,"geometryType",void 0),t([d({constructOnly:!0})],A.prototype,"hasM",void 0),t([d({constructOnly:!0})],A.prototype,"hasZ",void 0),t([d()],A.prototype,"cursor",void 0),t([d()],A.prototype,"effectiveCursor",null),t([d()],A.prototype,"loading",void 0),t([d({constructOnly:!0})],A.prototype,"manipulators",void 0),t([d({constructOnly:!0})],A.prototype,"drawSurface",void 0),t([d({constructOnly:!0})],A.prototype,"segmentLabels",void 0),t([d({constructOnly:!0})],A.prototype,"snappingManager",void 0),t([d({constructOnly:!0})],A.prototype,"snappingVisualizer",void 0),t([d()],A.prototype,"snapToSceneEnabled",void 0),t([d({readOnly:!0})],A.prototype,"cursorVertex",null),t([d({readOnly:!0})],A.prototype,"visualizationCursorVertex",null),t([d()],A.prototype,"committableVertex",null),t([d()],A.prototype,"firstVertex",void 0),t([d()],A.prototype,"lastVertex",void 0),t([d()],A.prototype,"secondToLastVertex",void 0),t([d()],A.prototype,"updating",null),t([d({constructOnly:!0})],A.prototype,"view",void 0),A=t([h("esri.views.draw.DrawOperation")],A);export{A as DrawOperation,k as defaultCursor,Z as defaultLoadingCursor};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{EventEmitter as e}from"../../core/Evented.js";class t{constructor({consumesClicks:t,grabbableForEvent:s}){this.events=new e,this.interactive=!0,this.selectable=!1,this.cursor=null,this.grabbable=!0,this.consumesClicks=t,this.grabbableForEvent=s}destroy(){}intersectionDistance(e,t){return 0}attach(){}detach(){}onElevationChange(){}onViewChange(){}}export{t as LegacyDrawManipulator};
5
+ import{__decorate as o}from"tslib";import r from"../../core/Accessor.js";import{EventEmitter as e}from"../../core/Evented.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";let i=class extends r{constructor(o){super(o),this.events=new e,this.interactive=!0,this.selectable=!1,this.cursor=null,this.grabbable=!0}intersectionDistance(o,r){return 0}attach(){}detach(){}onElevationChange(){}onViewChange(){}};o([t()],i.prototype,"interactive",void 0),o([t()],i.prototype,"selectable",void 0),o([t()],i.prototype,"cursor",void 0),o([t()],i.prototype,"grabbing",void 0),o([t()],i.prototype,"grabbable",void 0),o([t()],i.prototype,"consumesClicks",void 0),o([t()],i.prototype,"grabbableForEvent",void 0),o([t()],i.prototype,"dragging",void 0),o([t()],i.prototype,"hovering",void 0),o([t()],i.prototype,"selected",void 0),i=o([s("esri.views.draw.LegacyDrawManipulator")],i);export{i as LegacyDrawManipulator};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import"../../core/has.js";import i from"../../core/Logger.js";import r from"../../core/Queue.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{primaryKey as o,isSystemModifier as a}from"./keys.js";import{LatestPointer as l}from"./handlers/LatestPointer.js";import{MultiTouch as h}from"./handlers/MultiTouch.js";import{PropertiesPool as p}from"../support/PropertiesPool.js";let d=class extends t{constructor(e){super(e),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=o,this._latestPointerType="mouse",this._propertiesPool=new p({latestPointerLocation:g},this),this.latestPointerLocation=null,this._paused=!1,this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const e=Object.keys(this._nameToGroup);for(const t of e)this.uninstallHandlers(t);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(e=>e.handler.hasPendingInputs)}get latestPointerType(){return this._latestPointerType}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get updating(){return this.hasPendingInputs||this._paused}installHandlers(e,t,i=c.INTERNAL){if(this._nameToGroup[e])return;if(0===t.length)return;const r={name:e,handlers:t.map(e=>({handler:e,active:!0,removed:!1,priorityIndex:0,groupPriority:i,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[e]=r;for(let n=r.handlers.length-1;n>=0;n--){const e=r.handlers[n];this._handlers.push(e),e.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(t,i,r,n,s)=>{this._emitInputEvent(e.priorityIndex+1,t,i,r,s,n)},setPointerCapture:(t,i)=>{this._setPointerCapture(r,e,t,i)},setEventCallback:t=>{e.eventCallback=t},setUninstallCallback:t=>{e.uninstallCallback=t},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(e){const t=this._nameToGroup[e];t?(t.handlers.forEach(e=>{e.removed=!0,e.uninstallCallback?.()}),delete this._nameToGroup[e],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):i.getLogger(this).error("There is no InputHandler group registered under the name `"+e+"`")}hasHandlers(e){return void 0!==this._nameToGroup[e]}isModifierKeyDown(e){return this._activeKeyModifiers.has(e)}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const e=new Set,t=new Set;this._handlersPriority=[];for(let i=this._handlers.length-1;i>=0;i--){const e=this._handlers[i];e.priorityIndex=i,this._handlersPriority.push(e)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let i=this._handlersPriority.length-1;i>=0;i--){const r=this._handlersPriority[i];r.priorityIndex=i;let n=r.handler.hasSideEffects;if(!n)for(const t of r.handler.outgoingEventTypes)if(e.has(t)){n=!0;break}if(n)for(const i of r.handler.incomingEventMatches){e.add(i.eventType);for(const e of i.keyModifiers)a(e)||t.add(e)}r.active=n}this._sourceEvents=e,this._keyModifiers=t,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(e,t,i){this._latestPointerType=e;const r=this._get("latestPointerLocation");if(null==r||r.x!==t||r.y!==i){const e=this._propertiesPool.get("latestPointerLocation");e.x=t,e.y=i,this._set("latestPointerLocation",e)}}_onEventReceived(e,t){if("pointer-capture-lost"===e){const e=t;this._pointerCaptures.delete(e.native.pointerId)}this._updateKeyModifiers(e,t);const i=null!=this.test.timestamp?this.test.timestamp:t.native?t.native.timestamp:void 0,r=t.native?t.native.cancelable:void 0;this._emitInputEventFromSource(e,t,i,r)}_updateKeyModifiers(e,t){if(!t)return;let i=!1;const r=()=>{i||(this._activeKeyModifiers=new Set(this._activeKeyModifiers),i=!0)},n=(e,t)=>{t&&!this._activeKeyModifiers.has(e)?(r(),this._activeKeyModifiers.add(e)):!t&&this._activeKeyModifiers.has(e)&&(r(),this._activeKeyModifiers.delete(e))};if("key-down"===e||"key-up"===e){const i=t.key;this._keyModifiers.has(i)&&n(i,"key-down"===e)}const s=t.native;n("Alt",!!s?.altKey),n("Control",!!s?.ctrlKey),n("Ctrl",!!s?.ctrlKey),n("Shift",!!s?.shiftKey),n("Meta",!!s?.metaKey),n("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new l((e,t,i)=>this._setLatestPointer(e,t,i)),this._multiTouchHandler=new h,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],c.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,c.INTERNAL)}_setPointerCapture(e,t,i,r){const n=e.name+"-"+t.priorityIndex,s=this._pointerCaptures.get(i.pointerId)||new Set;this._pointerCaptures.set(i.pointerId,s),r?(s.add(n),1===s.size&&this.eventSource&&this.eventSource.setPointerCapture(i,!0)):s.has(n)&&(s.delete(n),0===s.size&&(this._pointerCaptures.delete(i.pointerId),this.eventSource&&this.eventSource.setPointerCapture(i,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(e=>!e.removed),this.updateDependencies()}_emitInputEventFromSource(e,t,i,r){this._emitInputEvent(0,e,t,i,r)}_emitInputEvent(e,t,i,r,n,s){const o=void 0!==r?r:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),a=void 0!==n&&n,l={event:new u(t,i,o,s||this._activeKeyModifiers,a),priorityIndex:e};this._currentPropagation?this._currentPropagation.events.push(l):this._doNewPropagation(l)}_doNewPropagation(e){this._currentPropagation={events:new r,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:e.event.timestamp},this._currentPropagation.events.push(e),this._continuePropagation()}_continuePropagation(){this._paused=!1;const e=this._currentPropagation;if(e){for(;e.events.length>0;){const{event:t,priorityIndex:i}=e.events.pop(),r=t.data?.eventId;if(!(null!=r&&this._stoppedPropagationEventIds.has(r)))for(e.currentHandler=this._handlersPriority[i];e.currentHandler;){if(e.currentHandler.removed)e.needsHandlerGarbageCollect=!0;else{if(e.currentHandler.active&&!t.shouldStopPropagation()&&e.currentHandler.eventCallback?.(t),t.shouldStopPropagation()){null!=r&&this._stoppedPropagationEventIds.add(r);break}if(t.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:t,priorityIndex:e.currentHandler.priorityIndex+1})}e.currentHandler=this._handlersPriority[e.currentHandler.priorityIndex+1]}}e.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(e){const t=new r;t.push(e);const i=this._currentPropagation;if(i){for(;i.events.length;)t.push(i.events.pop());i.events=t,i.currentHandler=null,this._paused=!0}}_compareHandlerPriority(e,t){if(e.handler.hasSideEffects!==t.handler.hasSideEffects)return e.handler.hasSideEffects?1:-1;if(e.groupPriority!==t.groupPriority)return e.groupPriority>t.groupPriority?-1:1;for(const i of e.handler.incomingEventMatches)for(const e of t.handler.incomingEventMatches){if(i.eventType!==e.eventType)continue;const t=i.keyModifiers.filter(t=>e.keyModifiers.includes(t));if(t.length===i.keyModifiers.length!==(t.length===e.keyModifiers.length))return i.keyModifiers.length>e.keyModifiers.length?-1:1}return e.priorityIndex>t.priorityIndex?-1:1}_sortHandlersPriority(e){const t=[];for(const i of e){let e=0;for(;e<t.length&&this._compareHandlerPriority(i,t[e])>=0;)e++;t.splice(e,0,i)}return t}get debug(){const e=e=>{const t=this._setPointerCapture;this._setPointerCapture=()=>{},e(),this._setPointerCapture=t};return{injectEvent:(t,i)=>{e(()=>this._onEventReceived(t,i))},disablePointerCapture:e}}};e([n({readOnly:!0})],d.prototype,"hasPendingInputs",null),e([n({constructOnly:!0})],d.prototype,"eventSource",void 0),e([n({constructOnly:!0})],d.prototype,"recognizers",void 0),e([n()],d.prototype,"_latestPointerType",void 0),e([n()],d.prototype,"latestPointerType",null),e([n()],d.prototype,"multiTouchActive",null),e([n({readOnly:!0})],d.prototype,"latestPointerLocation",void 0),e([n()],d.prototype,"_paused",void 0),e([n({readOnly:!0})],d.prototype,"updating",null),d=e([s("esri.views.input.InputManager")],d);class u{constructor(e,t,i,r,n){this.type=e,this.data=t,this.timestamp=i,this.modifiers=r,this.cancelable=n,this._propagationState=0,this._resumeCallback=null}stopPropagation(){this._propagationState|=1}shouldStopPropagation(){return!!(1&this._propagationState)}defer(e){this._propagationState|=2;const t=(e,t)=>{this._propagationState&=-3;const i=this._resumeCallback;if(this._resumeCallback=null,i&&i(),t)throw e;return e};return("function"==typeof e?e():e).then(e=>t(e,!1),e=>t(e,!0))}shouldPausePropagation(e){return!!(2&this._propagationState)&&(this._resumeCallback=e,!0)}preventDefault(){this.data.native.preventDefault()}}const c={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};class _{}const g=_;export{d as InputManager,c as ViewEventPriorities};
5
+ import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import"../../core/has.js";import r from"../../core/Logger.js";import i from"../../core/Queue.js";import{createScreenPoint as n}from"../../core/screenUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{primaryKey as a,isSystemModifier as l}from"./keys.js";import{LatestPointer as h}from"./handlers/LatestPointer.js";import{MultiTouch as p}from"./handlers/MultiTouch.js";import{PropertiesPool as d}from"../support/PropertiesPool.js";class c{constructor(){this.id=0,this.type="mouse",this.location=n()}}let u=class extends t{constructor(e){super(e),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=a,this._propertiesPool=new d({latestPointerInfo:()=>new c},this),this._latestPointerInfo=void 0,this._paused=!1,this._testTimestamp=void 0}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const e=Object.keys(this._nameToGroup);for(const t of e)this.uninstallHandlers(t);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(e=>e.handler.hasPendingInputs)}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get latestPointerInfo(){return this._latestPointerInfo}get updating(){return this.hasPendingInputs||this._paused}installHandlers(e,t,r=f.INTERNAL){if(this._nameToGroup[e])return;if(0===t.length)return;const i={name:e,handlers:t.map(e=>({handler:e,active:!0,removed:!1,priorityIndex:0,groupPriority:r,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[e]=i;for(let n=i.handlers.length-1;n>=0;n--){const e=i.handlers[n];this._handlers.push(e),e.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(t,r,i,n,s)=>{this._emitInputEvent(e.priorityIndex+1,t,r,i,s,n)},setPointerCapture:(t,r)=>{this._setPointerCapture(i,e,t,r)},setEventCallback:t=>{e.eventCallback=t},setUninstallCallback:t=>{e.uninstallCallback=t},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(e){const t=this._nameToGroup[e];t?(t.handlers.forEach(e=>{e.removed=!0,e.uninstallCallback?.()}),delete this._nameToGroup[e],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):r.getLogger(this).error("There is no InputHandler group registered under the name `"+e+"`")}hasHandlers(e){return void 0!==this._nameToGroup[e]}isModifierKeyDown(e){return this._activeKeyModifiers.has(e)}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const e=new Set,t=new Set;this._handlersPriority=[];for(let r=this._handlers.length-1;r>=0;r--){const e=this._handlers[r];e.priorityIndex=r,this._handlersPriority.push(e)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let r=this._handlersPriority.length-1;r>=0;r--){const i=this._handlersPriority[r];i.priorityIndex=r;let n=i.handler.hasSideEffects;if(!n)for(const t of i.handler.outgoingEventTypes)if(e.has(t)){n=!0;break}if(n)for(const r of i.handler.incomingEventMatches){e.add(r.eventType);for(const e of r.keyModifiers)l(e)||t.add(e)}i.active=n}this._sourceEvents=e,this._keyModifiers=t,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(e,t,r,i){const n=this._latestPointerInfo;if(null==n||n.id!==e||n.type!==t||n.location.x!==r||n.location.y!==i){const n=this._propertiesPool.get("latestPointerInfo");n.id=e,n.type=t,n.location.x=r,n.location.y=i,this._latestPointerInfo=n}}_onEventReceived(e,t){if("pointer-capture-lost"===e){const e=t;this._pointerCaptures.delete(e.native.pointerId)}this._updateKeyModifiers(e,t);const r=this._testTimestamp??t.native?.timestamp,i=t.native?.cancelable;this._emitInputEventFromSource(e,t,r,i)}_updateKeyModifiers(e,t){if(!t)return;let r=!1;const i=()=>{r||(this._activeKeyModifiers=new Set(this._activeKeyModifiers),r=!0)},n=(e,t)=>{t&&!this._activeKeyModifiers.has(e)?(i(),this._activeKeyModifiers.add(e)):!t&&this._activeKeyModifiers.has(e)&&(i(),this._activeKeyModifiers.delete(e))};if("key-down"===e||"key-up"===e){const r=t.key;this._keyModifiers.has(r)&&n(r,"key-down"===e)}const s=t.native;n("Alt",!!s?.altKey),n("Control",!!s?.ctrlKey),n("Ctrl",!!s?.ctrlKey),n("Shift",!!s?.shiftKey),n("Meta",!!s?.metaKey),n("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new h((e,t,r,i)=>this._setLatestPointer(e,t,r,i)),this._multiTouchHandler=new p,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],f.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,f.INTERNAL)}_setPointerCapture(e,t,r,i){const n=e.name+"-"+t.priorityIndex,s=this._pointerCaptures.get(r.pointerId)||new Set;this._pointerCaptures.set(r.pointerId,s),i?(s.add(n),1===s.size&&this.eventSource&&this.eventSource.setPointerCapture(r,!0)):s.has(n)&&(s.delete(n),0===s.size&&(this._pointerCaptures.delete(r.pointerId),this.eventSource&&this.eventSource.setPointerCapture(r,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(e=>!e.removed),this.updateDependencies()}_emitInputEventFromSource(e,t,r,i){this._emitInputEvent(0,e,t,r,i)}_emitInputEvent(e,t,r,i,n,s){const o=i??this._currentPropagation?.timestamp??performance.now(),a=n??!1,l={event:new _(t,r,o,s||this._activeKeyModifiers,a),priorityIndex:e};this._currentPropagation?this._currentPropagation.events.push(l):this._doNewPropagation(l)}_doNewPropagation(e){this._currentPropagation={events:new i,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:e.event.timestamp},this._currentPropagation.events.push(e),this._continuePropagation()}_continuePropagation(){this._paused=!1;const e=this._currentPropagation;if(e){for(;e.events.length>0;){const{event:t,priorityIndex:r}=e.events.pop(),i=t.data?.eventId;if(!(null!=i&&this._stoppedPropagationEventIds.has(i)))for(e.currentHandler=this._handlersPriority[r];e.currentHandler;){if(e.currentHandler.removed)e.needsHandlerGarbageCollect=!0;else{if(e.currentHandler.active&&!t.shouldStopPropagation()&&e.currentHandler.eventCallback?.(t),t.shouldStopPropagation()){null!=i&&this._stoppedPropagationEventIds.add(i);break}if(t.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:t,priorityIndex:e.currentHandler.priorityIndex+1})}e.currentHandler=this._handlersPriority[e.currentHandler.priorityIndex+1]}}e.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(e){const t=new i;t.push(e);const r=this._currentPropagation;if(r){for(;r.events.length;)t.push(r.events.pop());r.events=t,r.currentHandler=null,this._paused=!0}}_compareHandlerPriority(e,t){if(e.handler.hasSideEffects!==t.handler.hasSideEffects)return e.handler.hasSideEffects?1:-1;if(e.groupPriority!==t.groupPriority)return e.groupPriority>t.groupPriority?-1:1;for(const r of e.handler.incomingEventMatches)for(const e of t.handler.incomingEventMatches){if(r.eventType!==e.eventType)continue;const t=r.keyModifiers.filter(t=>e.keyModifiers.includes(t));if(t.length===r.keyModifiers.length!==(t.length===e.keyModifiers.length))return r.keyModifiers.length>e.keyModifiers.length?-1:1}return e.priorityIndex>t.priorityIndex?-1:1}_sortHandlersPriority(e){const t=[];for(const r of e){let e=0;for(;e<t.length&&this._compareHandlerPriority(r,t[e])>=0;)e++;t.splice(e,0,r)}return t}get test(){}};e([s({readOnly:!0})],u.prototype,"hasPendingInputs",null),e([s({constructOnly:!0})],u.prototype,"eventSource",void 0),e([s({constructOnly:!0})],u.prototype,"recognizers",void 0),e([s()],u.prototype,"multiTouchActive",null),e([s()],u.prototype,"_latestPointerInfo",void 0),e([s()],u.prototype,"latestPointerInfo",null),e([s()],u.prototype,"_paused",void 0),e([s({readOnly:!0})],u.prototype,"updating",null),u=e([o("esri.views.input.InputManager")],u);class _{constructor(e,t,r,i,n){this.type=e,this.data=t,this.timestamp=r,this.modifiers=i,this.cancelable=n,this._propagationState=0,this._resumeCallback=null}stopPropagation(){this._propagationState|=1}shouldStopPropagation(){return!!(1&this._propagationState)}defer(e){this._propagationState|=2;const t=(e,t)=>{this._propagationState&=-3;const r=this._resumeCallback;if(this._resumeCallback=null,r&&r(),t)throw e;return e};return("function"==typeof e?e():e).then(e=>t(e,!1),e=>t(e,!0))}shouldPausePropagation(e){return!!(2&this._propagationState)&&(this._resumeCallback=e,!0)}preventDefault(){this.data.native.preventDefault()}}const f={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};export{u as InputManager,c as LatestPointerInfo,f as ViewEventPriorities};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{InputHandler as t}from"../InputHandler.js";class s extends t{constructor(t){super(!0),this._onChange=t,this._value="mouse",this._x=null,this._y=null,this.registerIncoming("pointer-move",t=>this._update(t.data))}_update(t){const s="touch"===t.native.pointerType?"touch":"mouse",{x:e,y:i}=t;s===this._value&&this._x===e&&this._y===i||(this._value=s,this._x=e,this._y=i,this._onChange(s,e,i))}}export{s as LatestPointer};
5
+ import{InputHandler as t}from"../InputHandler.js";class i extends t{constructor(t){super(!0),this._onChange=t,this._value="mouse",this._x=null,this._y=null,this._id=null,this.registerIncoming("pointer-move",t=>this._update(t.data))}_update(t){const i="touch"===t.native.pointerType?"touch":"mouse",{x:s,y:e,native:{pointerId:h}}=t;i===this._value&&this._x===s&&this._y===e&&this._id===h||(this._value=i,this._x=s,this._y=e,this._id=h,this._onChange(h,i,s,e))}}export{i as LatestPointer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{EventedAccessor as e}from"../../core/Evented.js";import"../../core/has.js";import"../../core/Logger.js";import{createResolver as i}from"../../core/promiseUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{ManipulatorCollection as s}from"./ManipulatorCollection.js";let r=class extends e{constructor(t){super(t),this.manipulators=new s,this.automaticManipulatorSelection=!0,this.hasGrabbedManipulators=!1,this.hasHoveredManipulators=!1,this.firstGrabbedManipulator=null,this.created=!1,this.removeIncompleteOnCancel=!0,this._editableFlags=new Map([[1,!0],[0,!0]]),this._creationFinishedResolver=i()}get active(){return null!=this.view&&this.view.activeTool===this}set visible(t){this._get("visible")!==t&&(this._set("visible",t),this._syncVisible())}get editable(){return this.getEditableFlag(0)}set editable(t){this.setEditableFlag(0,t)}get updating(){return!1}get cursor(){return null}get hasFocusedManipulators(){return this.hasGrabbedManipulators||this.hasHoveredManipulators}destroy(){this.manipulators.destroy(),this._set("view",null)}onAdd(){this._syncVisible()}activate(){null!=this.view&&(this.view.focus(),this.onActivate())}deactivate(){this.onDeactivate()}cancel(){this.emit("cancel")}handleInputEvent(t){this.onInputEvent(t)}handleInputEventAfter(t){this.onInputEventAfter(t)}setEditableFlag(t,e){this._editableFlags.set(t,e),this.manipulators.isToolEditable=this.internallyEditable,this._updateManipulatorAttachment(),0===t&&this.notifyChange("editable"),this.onEditableChange(),this.onManipulatorSelectionChanged()}getEditableFlag(t){return this._editableFlags.get(t)??!1}endDrag(){const t=this.view.inputManager.latestPointerLocation;if(!t)return;let e=!1;this.manipulators.forEach(({manipulator:i})=>{i.dragging&&(e=!0,i.events.emit("drag",{action:"end",start:t,screenPoint:t}))}),e&&(this.view.toolViewManager.activeTool=null)}whenCreated(){return this._creationFinishedResolver.promise}onManipulatorSelectionChanged(){}onActivate(){}onDeactivate(){}onShow(){}onHide(){}onEditableChange(){}onInputEvent(t){}onInputEventAfter(t){}get internallyEditable(){return this.getEditableFlag(0)&&this.getEditableFlag(1)}finishToolCreation(){this.created||this._creationFinishedResolver.resolve(this),this._set("created",!0)}_syncVisible(){if(this.initialized)if(this.visible)this._show();else if(this._hide(),this.active)return void(this.view.activeTool=null)}_show(){this._updateManipulatorAttachment(),this.onShow()}_hide(){this._updateManipulatorAttachment(),this.onHide()}_updateManipulatorAttachment(){this.visible?this.manipulators.attach():this.manipulators.detach()}};t([a({constructOnly:!0})],r.prototype,"view",void 0),t([a({readOnly:!0})],r.prototype,"active",null),t([a({value:!0})],r.prototype,"visible",null),t([a({value:!0})],r.prototype,"editable",null),t([a({readOnly:!0})],r.prototype,"manipulators",void 0),t([a({readOnly:!0})],r.prototype,"updating",null),t([a()],r.prototype,"cursor",null),t([a({readOnly:!0})],r.prototype,"automaticManipulatorSelection",void 0),t([a()],r.prototype,"hasFocusedManipulators",null),t([a()],r.prototype,"hasGrabbedManipulators",void 0),t([a()],r.prototype,"hasHoveredManipulators",void 0),t([a()],r.prototype,"firstGrabbedManipulator",void 0),t([a({readOnly:!0})],r.prototype,"created",void 0),t([a({readOnly:!0})],r.prototype,"removeIncompleteOnCancel",void 0),r=t([o("esri.views.interactive.InteractiveToolBase")],r);export{r as InteractiveToolBase};
5
+ import{__decorate as t}from"tslib";import{EventedAccessor as e}from"../../core/Evented.js";import"../../core/has.js";import"../../core/Logger.js";import{createResolver as i}from"../../core/promiseUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{ManipulatorCollection as s}from"./ManipulatorCollection.js";let r=class extends e{constructor(t){super(t),this.manipulators=new s,this.automaticManipulatorSelection=!0,this.hasGrabbedManipulators=!1,this.hasHoveredManipulators=!1,this.firstGrabbedManipulator=null,this.created=!1,this.removeIncompleteOnCancel=!0,this._editableFlags=new Map([[1,!0],[0,!0]]),this._creationFinishedResolver=i()}get active(){return null!=this.view&&this.view.activeTool===this}set visible(t){this._get("visible")!==t&&(this._set("visible",t),this._syncVisible())}get editable(){return this.getEditableFlag(0)}set editable(t){this.setEditableFlag(0,t)}get updating(){return!1}get cursor(){return null}get hasFocusedManipulators(){return this.hasGrabbedManipulators||this.hasHoveredManipulators}destroy(){this.manipulators.destroy(),this._set("view",null)}onAdd(){this._syncVisible()}activate(){null!=this.view&&(this.view.focus(),this.onActivate())}deactivate(){this.onDeactivate()}cancel(){this.emit("cancel")}handleInputEvent(t){this.onInputEvent(t)}handleInputEventAfter(t){this.onInputEventAfter(t)}setEditableFlag(t,e){this._editableFlags.set(t,e),this.manipulators.isToolEditable=this.internallyEditable,this._updateManipulatorAttachment(),0===t&&this.notifyChange("editable"),this.onEditableChange(),this.onManipulatorSelectionChanged()}getEditableFlag(t){return this._editableFlags.get(t)??!1}endDrag(){const t=this.view.inputManager.latestPointerInfo?.location;if(!t)return;let e=!1;this.manipulators.forEach(({manipulator:i})=>{i.dragging&&(e=!0,i.events.emit("drag",{action:"end",start:t,screenPoint:t}))}),e&&(this.view.toolViewManager.activeTool=null)}whenCreated(){return this._creationFinishedResolver.promise}onManipulatorSelectionChanged(){}onActivate(){}onDeactivate(){}onShow(){}onHide(){}onEditableChange(){}onInputEvent(t){}onInputEventAfter(t){}get internallyEditable(){return this.getEditableFlag(0)&&this.getEditableFlag(1)}finishToolCreation(){this.created||this._creationFinishedResolver.resolve(this),this._set("created",!0)}_syncVisible(){if(this.initialized)if(this.visible)this._show();else if(this._hide(),this.active)return void(this.view.activeTool=null)}_show(){this._updateManipulatorAttachment(),this.onShow()}_hide(){this._updateManipulatorAttachment(),this.onHide()}_updateManipulatorAttachment(){this.visible?this.manipulators.attach():this.manipulators.detach()}};t([a({constructOnly:!0})],r.prototype,"view",void 0),t([a({readOnly:!0})],r.prototype,"active",null),t([a({value:!0})],r.prototype,"visible",null),t([a({value:!0})],r.prototype,"editable",null),t([a({readOnly:!0})],r.prototype,"manipulators",void 0),t([a({readOnly:!0})],r.prototype,"updating",null),t([a()],r.prototype,"cursor",null),t([a({readOnly:!0})],r.prototype,"automaticManipulatorSelection",void 0),t([a()],r.prototype,"hasFocusedManipulators",null),t([a()],r.prototype,"hasGrabbedManipulators",void 0),t([a()],r.prototype,"hasHoveredManipulators",void 0),t([a()],r.prototype,"firstGrabbedManipulator",void 0),t([a({readOnly:!0})],r.prototype,"created",void 0),t([a({readOnly:!0})],r.prototype,"removeIncompleteOnCancel",void 0),r=t([o("esri.views.interactive.InteractiveToolBase")],r);export{r as InteractiveToolBase};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{find as e}from"../../core/iteratorUtils.js";import{clamp as t}from"../../core/mathUtils.js";import{createScreenPoint as o}from"../../core/screenUtils.js";import{areToolManipulatorsEditable as a}from"./interactiveToolUtils.js";import{createScreenPointFromEvent as r}from"../support/screenUtils.js";class i{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._externallyDragging=!1,this._revertToNullActiveTool=!1,this._cursor=null}get cursor(){return this._cursor}hasFocusedManipulators(){return this._grabbedManipulators.size>0||this._draggedManipulators.size>0}handleInputEvent(e,o){const a=()=>e.stopPropagation();switch(e.type){case"pointer-move":l(e.pointerType)&&this._pointerLocations.set(e.pointerId,{x:e.x,y:e.y,pointerType:e.pointerType});break;case"drag":this._grabbedManipulators.size>0?this._stopDrag=!0:"start"===e.action?this._externallyDragging=!0:"end"===e.action&&(this._externallyDragging=!1),this._stopDrag&&(a(),"end"===e.action&&(this._stopDrag=!1));break;case"pointer-down":{if(!p(e))break;const t=r(e),i=s(t,e.pointerType,o.forEachTool);if(null==i)break;const n=i.manipulator,l=i.tool;null==n||null==l||!n.interactive||n.grabbable&&n.grabbableForEvent(e)||!n.grabbing||n.dragging||this._releaseManipulatorBeforeDragging(n,e,o),null!=n&&null!=l&&n.interactive&&n.grabbable&&n.grabbableForEvent(e)&&!n.grabbing&&(this._grabbedManipulators.set(e.pointerId,{manipulator:n,tool:l,start:t,pointerType:e.pointerType}),1===this._grabbedManipulators.size&&null==o.activeTool&&(this._revertToNullActiveTool=!0,o.setActiveTool(i.tool)),n.grabbing=!0,n.events.emit("grab-changed",{action:"start",pointerType:e.pointerType,screenPoint:t}),a());break}case"pointer-up":this._draggedManipulators.has(e.pointerId)||this._handlePointerEnd(e,o);break;case"pointer-drag":{if(!p(e))break;const i=this._grabbedManipulators.get(e.pointerId),n=i?.manipulator,s=i?.tool;if(null==n||null==s)break;const l=r(e);l.x=t(l.x,0,o.view.width),l.y=t(l.y,0,o.view.height);const u=i.start,c=this._draggedManipulators.get(e.pointerId);switch(e.action){case"start":case"update":"update"!==e.action&&1!==this._grabbedManipulators.size||(n.dragging=!0,c?n.events.emit("drag",{action:"update",start:u,screenPoint:l}):n.events.emit("drag",{action:"start",start:u,screenPoint:l,pointerType:e.pointerType}),this._draggedManipulators.set(e.pointerId,{tool:s,manipulator:n,start:u}));break;case"end":n.dragging=!1,c&&n.events.emit("drag",{action:"end",start:u,screenPoint:l}),this._draggedManipulators.delete(e.pointerId),this._handlePointerEnd(e,o)}a();break}case"immediate-click":{const t=r(e),i=s(t,e.pointerType,o.forEachTool);if(u(e)||o.forEachTool(e=>{if((null==i||i.tool!==e||e.automaticManipulatorSelection)&&e.manipulators){let t=!1;e.manipulators.forEach(({manipulator:e})=>{e.selected&&(e.selected=!1,t=!0)}),t&&e.onManipulatorSelectionChanged&&e.onManipulatorSelectionChanged()}}),null==i)break;const{manipulator:n,tool:l}=i;if(!n.interactive)break;n.selectable&&l.automaticManipulatorSelection&&(n.selected=!n.selected,l.onManipulatorSelectionChanged&&l.onManipulatorSelectionChanged());const p=e.native.shiftKey;n.events.emit("immediate-click",{screenPoint:t,button:e.button,pointerType:e.pointerType,shiftKey:p,stopPropagation:a}),c(n,a);break}case"click":{const t=r(e),i=s(t,e.pointerType,o.forEachTool),n=i?.manipulator;if(null==n||!n.interactive)break;const l=e.native.shiftKey;n.events.emit(e.type,{screenPoint:t,button:e.button,pointerType:e.pointerType,shiftKey:l}),a();break}case"double-click":{const t=r(e),i=s(t,e.pointerType,o.forEachTool),n=null!=i?i.manipulator:null;if(null==n||!n.interactive)break;const l=e.native.shiftKey;n.events.emit("double-click",{screenPoint:t,button:e.button,pointerType:e.pointerType,shiftKey:l,stopPropagation:a}),c(n,a);break}case"immediate-double-click":{const t=r(e),i=s(t,e.pointerType,o.forEachTool),n=null!=i?i.manipulator:null;if(null==n||!n.interactive)break;const l=e.native.shiftKey;n.events.emit("immediate-double-click",{screenPoint:t,button:e.button,pointerType:e.pointerType,shiftKey:l,stopPropagation:a}),"mouse"===e.pointerType&&c(n,a);break}}this._onFocusChange(o.forEachTool)}_releaseManipulatorBeforeDragging(e,t,o){e.grabbing=!1,e.events.emit("grab-changed",{action:"end",pointerType:t.pointerType,screenPoint:r(t)}),this._grabbedManipulators.forEach(({manipulator:t},o)=>{t===e&&this._grabbedManipulators.delete(o)}),this._afterManipulatorRelease(o.setActiveTool)}_handlePointerEnd(e,t){const o=this._grabbedManipulators.get(e.pointerId)?.manipulator;null!=o&&o.grabbing&&(o.grabbing=!1,o.events.emit("grab-changed",{action:"end",pointerType:e.pointerType,screenPoint:r(e)}),this._grabbedManipulators.delete(e.pointerId),this._afterManipulatorRelease(t.setActiveTool))}_onFocusChange(e){this._updateCursor(),this._updateFocusedManipulatorTools(e)}_updateCursor(){this._grabbedManipulators.size>0?this._cursor=n(this._grabbedManipulators)||"grabbing":this._hoveredManipulators.size>0?this._cursor=n(this._hoveredManipulators)||"pointer":this._cursor=null}_updateFocusedManipulatorTools(t){const o=new Set,a=new Set;this._grabbedManipulators.forEach(({tool:e})=>{o.add(e)}),this._hoveredManipulators.forEach(({tool:e})=>{a.add(e)}),t(t=>{t.hasGrabbedManipulators=o.has(t),t.hasHoveredManipulators=a.has(t);const r=this._grabbedManipulators.values(),i=e(r,({tool:e})=>e===t);t.firstGrabbedManipulator=null!=i?i.manipulator:null})}clearPointers(e,{forEachTool:t,setActiveTool:o},a=!0,r){const i=(t,o)=>t===e&&(null==r||r===o);this._grabbedManipulators.forEach(({tool:e,manipulator:t,pointerType:o},a)=>{i(e,t)&&(this._grabbedManipulators.delete(a),t.grabbing=!1,t.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:o}))}),this._draggedManipulators.forEach(({tool:e,manipulator:t},o)=>{i(e,t)&&(this._draggedManipulators.delete(o),t.dragging=!1,t.events.emit("drag",{action:"cancel"}))}),a&&this._hoveredManipulators.forEach(({tool:e,manipulator:t},o)=>{i(e,t)&&(this._hoveredManipulators.delete(o),t.hovering=!1)}),this._afterManipulatorRelease(o),this._onFocusChange(t)}updateHoveredStateFromKnownPointers(e){this._pointerLocations.forEach((t,a)=>{this._updateHoveredStateForPointerAtScreenPosition(o(t.x,t.y),a,t.pointerType,e)})}handleHoverEvent(e,t){const o=e.type;"pointer-up"!==o&&"immediate-click"!==o&&"pointer-move"!==o||!l(e.pointerType)||("pointer-up"!==o&&this._externallyDragging?this._clearHoveredManipulatorStates(e.pointerId):this._updateHoveredStateForPointerAtScreenPosition(r(e),e.pointerId,e.pointerType,t))}_updateHoveredStateForPointerAtScreenPosition(e,t,o,a){let r=s(e,o,a);const i=this._hoveredManipulators.get(t)?.manipulator;null==r||r.manipulator.interactive||(r=null),null!=r&&i===r.manipulator||(null!=i&&(i.hovering=!1),null!=r?(r.manipulator.hovering=!0,this._hoveredManipulators.set(t,r)):this._hoveredManipulators.delete(t),this._onFocusChange(a))}_afterManipulatorRelease(e){0===this._grabbedManipulators.size&&this._revertToNullActiveTool&&(e(null),this._revertToNullActiveTool=!1)}_clearHoveredManipulatorStates(e){this._hoveredManipulators.forEach(({manipulator:t},o)=>{e===o&&(this._hoveredManipulators.delete(e),t.hovering=!1)})}}function n(e){for(const{manipulator:t}of e.values())if(null!=t&&t.interactive){if(t.grabbing&&t.grabCursor)return t.grabCursor;if(t.cursor)return t.cursor}return null}function s(e,t,o){let r=null;return o(o=>{if(null==o.manipulators||!a(o))return!1;const i=o.manipulators.intersect(e,t);return null!=i&&(r={tool:o,manipulator:i},!0)}),r}function l(e){return"mouse"===e}function p(e){return"mouse"!==e.pointerType||0===e.button}function u(e){return!!e.native.shiftKey}function c(e,t){e?.consumesClicks&&t()}export{i as ToolViewManagerManipulatorState};
5
+ import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{find as o}from"../../core/iteratorUtils.js";import{clamp as r}from"../../core/mathUtils.js";import a from"../../core/ReactiveMap.js";import{createScreenPoint as i}from"../../core/screenUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{areToolManipulatorsEditable as l}from"./interactiveToolUtils.js";import{createScreenPointFromEvent as p}from"../support/screenUtils.js";let u=class extends e{constructor(){super(...arguments),this._pointerLocations=new Map,this._hoveredManipulators=new a,this._grabbedManipulators=new a,this._draggedManipulators=new Map,this._stopDrag=!1,this._externallyDragging=!1,this._revertToNullActiveTool=!1}get cursor(){return this._cursorFromMap(this._grabbedManipulators,"grabbing")??this._cursorFromMap(this._hoveredManipulators,"pointer")}get hasFocusedManipulators(){return this._grabbedManipulators.size>0||this._draggedManipulators.size>0}handleInputEvent(t,e){const o=()=>t.stopPropagation();switch(t.type){case"pointer-move":d(t.pointerType)&&this._pointerLocations.set(t.pointerId,{x:t.x,y:t.y,pointerType:t.pointerType});break;case"drag":this._grabbedManipulators.size>0?this._stopDrag=!0:"start"===t.action?this._externallyDragging=!0:"end"===t.action&&(this._externallyDragging=!1),this._stopDrag&&(o(),"end"===t.action&&(this._stopDrag=!1));break;case"pointer-down":{if(!g(t))break;const r=p(t),a=c(r,t.pointerType,e.tools);if(null==a)break;const i=a.manipulator,n=a.tool;null==i||null==n||!i.interactive||i.grabbable&&i.grabbableForEvent(t)||!i.grabbing||i.dragging||this._releaseManipulatorBeforeDragging(i,t,e),null!=i&&null!=n&&i.interactive&&i.grabbable&&i.grabbableForEvent(t)&&!i.grabbing&&(this._grabbedManipulators.set(t.pointerId,{manipulator:i,tool:n,start:r,pointerType:t.pointerType}),1===this._grabbedManipulators.size&&null==e.activeTool&&(this._revertToNullActiveTool=!0,e.setActiveTool(a.tool)),i.grabbing=!0,i.events.emit("grab-changed",{action:"start",pointerType:t.pointerType,screenPoint:r}),o());break}case"pointer-up":this._draggedManipulators.has(t.pointerId)||this._handlePointerEnd(t,e);break;case"pointer-drag":{if(!g(t))break;const a=this._grabbedManipulators.get(t.pointerId),i=a?.manipulator,n=a?.tool;if(null==i||null==n)break;const s=p(t);s.x=r(s.x,0,e.view.width),s.y=r(s.y,0,e.view.height);const l=a.start,u=this._draggedManipulators.get(t.pointerId);switch(t.action){case"start":case"update":"update"!==t.action&&1!==this._grabbedManipulators.size||(i.dragging=!0,u?i.events.emit("drag",{action:"update",start:l,screenPoint:s}):i.events.emit("drag",{action:"start",start:l,screenPoint:s,pointerType:t.pointerType}),this._draggedManipulators.set(t.pointerId,{tool:n,manipulator:i,start:l}));break;case"end":i.dragging=!1,u&&i.events.emit("drag",{action:"end",start:l,screenPoint:s}),this._draggedManipulators.delete(t.pointerId),this._handlePointerEnd(t,e)}o();break}case"immediate-click":{const r=p(t),a=c(r,t.pointerType,e.tools);if(!h(t))for(const t of e.tools)if((null==a||a.tool!==t||t.automaticManipulatorSelection)&&t.manipulators){let e=!1;t.manipulators.forEach(({manipulator:t})=>{t.selected&&(t.selected=!1,e=!0)}),e&&t.onManipulatorSelectionChanged&&t.onManipulatorSelectionChanged()}if(null==a)break;const{manipulator:i,tool:n}=a;if(!i.interactive)break;i.selectable&&n.automaticManipulatorSelection&&(i.selected=!i.selected,n.onManipulatorSelectionChanged&&n.onManipulatorSelectionChanged());const s=t.native.shiftKey;i.events.emit("immediate-click",{screenPoint:r,button:t.button,pointerType:t.pointerType,shiftKey:s,stopPropagation:o}),b(i,o);break}case"click":{const r=p(t),a=c(r,t.pointerType,e.tools),i=a?.manipulator;if(null==i||!i.interactive)break;const n=t.native.shiftKey;i.events.emit(t.type,{screenPoint:r,button:t.button,pointerType:t.pointerType,shiftKey:n}),o();break}case"double-click":{const r=p(t),a=c(r,t.pointerType,e.tools),i=null!=a?a.manipulator:null;if(null==i||!i.interactive)break;const n=t.native.shiftKey;i.events.emit("double-click",{screenPoint:r,button:t.button,pointerType:t.pointerType,shiftKey:n,stopPropagation:o}),b(i,o);break}case"immediate-double-click":{const r=p(t),a=c(r,t.pointerType,e.tools),i=null!=a?a.manipulator:null;if(null==i||!i.interactive)break;const n=t.native.shiftKey;i.events.emit("immediate-double-click",{screenPoint:r,button:t.button,pointerType:t.pointerType,shiftKey:n,stopPropagation:o}),"mouse"===t.pointerType&&b(i,o);break}}this._onFocusChange(e.tools)}_releaseManipulatorBeforeDragging(t,e,o){t.grabbing=!1,t.events.emit("grab-changed",{action:"end",pointerType:e.pointerType,screenPoint:p(e)}),this._grabbedManipulators.forEach(({manipulator:e},o)=>{e===t&&this._grabbedManipulators.delete(o)}),this._afterManipulatorRelease(o.setActiveTool)}_handlePointerEnd(t,e){const o=this._grabbedManipulators.get(t.pointerId)?.manipulator;null!=o&&o.grabbing&&(o.grabbing=!1,o.events.emit("grab-changed",{action:"end",pointerType:t.pointerType,screenPoint:p(t)}),this._grabbedManipulators.delete(t.pointerId),this._afterManipulatorRelease(e.setActiveTool))}_onFocusChange(t){this._updateFocusedManipulatorTools(t)}_updateFocusedManipulatorTools(t){const e=new Set,r=new Set;this._grabbedManipulators.forEach(({tool:t})=>e.add(t)),this._hoveredManipulators.forEach(({tool:t})=>r.add(t));for(const a of t){a.hasGrabbedManipulators=e.has(a),a.hasHoveredManipulators=r.has(a);const t=this._grabbedManipulators.values(),i=o(t,({tool:t})=>t===a);a.firstGrabbedManipulator=null!=i?i.manipulator:null}}clearPointers(t,{tools:e,setActiveTool:o},r=!0,a){const i=(e,o)=>e===t&&(null==a||a===o);this._grabbedManipulators.forEach(({tool:t,manipulator:e,pointerType:o},r)=>{i(t,e)&&(this._grabbedManipulators.delete(r),e.grabbing=!1,e.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:o}))}),this._draggedManipulators.forEach(({tool:t,manipulator:e},o)=>{i(t,e)&&(this._draggedManipulators.delete(o),e.dragging=!1,e.events.emit("drag",{action:"cancel"}))}),r&&this._hoveredManipulators.forEach(({tool:t,manipulator:e},o)=>{i(t,e)&&(this._hoveredManipulators.delete(o),e.hovering=!1)}),this._afterManipulatorRelease(o),this._onFocusChange(e)}updateHoveredStateFromKnownPointers(t){this._pointerLocations.forEach((e,o)=>{this._updateHoveredStateForPointerAtScreenPosition(i(e.x,e.y),o,e.pointerType,t)})}handleHoverEvent(t,e){const o=t.type;"pointer-up"!==o&&"immediate-click"!==o&&"pointer-move"!==o||!d(t.pointerType)||("pointer-up"!==o&&this._externallyDragging?this._clearHoveredManipulatorStates(t.pointerId):this._updateHoveredStateForPointerAtScreenPosition(p(t),t.pointerId,t.pointerType,e))}_updateHoveredStateForPointerAtScreenPosition(t,e,o,r){let a=c(t,o,r);const i=this._hoveredManipulators.get(e)?.manipulator;null==a||a.manipulator.interactive||(a=null),null!=a&&i===a.manipulator||(null!=i&&(i.hovering=!1),null!=a?(a.manipulator.hovering=!0,this._hoveredManipulators.set(e,a)):this._hoveredManipulators.delete(e),this._onFocusChange(r))}_afterManipulatorRelease(t){0===this._grabbedManipulators.size&&this._revertToNullActiveTool&&(t(null),this._revertToNullActiveTool=!1)}_clearHoveredManipulatorStates(t){this._hoveredManipulators.forEach(({manipulator:e},o)=>{t===o&&(this._hoveredManipulators.delete(t),e.hovering=!1)})}_cursorFromMap(t,e){if(!t?.size)return null;for(const{manipulator:o}of t.values())if(o?.interactive){if(o.grabbing&&o.grabCursor)return o.grabCursor;if(o.cursor)return o.cursor}return e}};function c(t,e,o){for(const r of o){if(null==r.manipulators||!l(r))continue;const o=r.manipulators.intersect(t,e);if(null!=o)return{tool:r,manipulator:o}}return null}function d(t){return"mouse"===t}function g(t){return"mouse"!==t.pointerType||0===t.button}function h(t){return!!t.native.shiftKey}function b(t,e){t?.consumesClicks&&e()}t([n()],u.prototype,"cursor",null),u=t([s("esri.views.interactive.ToolViewManagerManipulatorState")],u);export{u as ToolViewManagerManipulatorState};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{EventedAccessor as e}from"../../core/Evented.js";import{on as o}from"../../core/events.js";import{destroyMaybe as n}from"../../core/maybe.js";import{watch as i,when as s,syncAndInitial as r,initial as l,sync as a}from"../../core/reactiveUtils.js";import{cloneScreenPoint as c,createScreenPoint as p}from"../../core/screenUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../core/support/UpdatingHandles.js";import{setCalciteModeClass as f}from"../../support/modeUtils.js";import{base as m}from"./tooltip/css.js";import{tooltipContentFactory as g}from"./tooltip/content/tooltipContentFactory.js";import{isRTL as y}from"../../widgets/support/widgetUtils.js";const v={base:`${m}`,ltr:`${m}--ltr`,rtl:`${m}--rtl`,debug:`${m}--debug`},_=20,C=16,b="bottom-end";let P=class extends e{constructor(t){super(t),this.info=null,this.options=null,this.position=null,this.content=null,this._focused=!1,this.outerContainer=document.createElement("div"),this.debug=!1,this._updatingHandles=new h,this._lastPosition=null,this._rtl=!1,this._prevXY=[0,0]}initialize(){const{outerContainer:t}=this;this.addHandles([i(()=>this.view.overlay?.surface,e=>{t.remove(),e?.appendChild(t),this._rtl=y(e)},r),i(()=>this.info,(e,o)=>{if(null!=this.content&&null!=e&&null!=o&&e.type===o.type)this.content.info=e;else{n(this.content);const o=g(this,e);o?(this.content=o,o.container&&t.appendChild(o.container),this.exitInputMode()):this.content=null}},r),i(()=>({container:this.outerContainer,style:this._outerContainerStyle}),({container:t,style:e})=>{Object.assign(t.style,e)},l),i(()=>({outerContainer:this.outerContainer,placement:this.effectivePlacement,effectiveOffset:this._effectiveOffset,rtl:this._rtl,debug:this.debug}),({outerContainer:t,placement:e,effectiveOffset:o,rtl:n,debug:i})=>{const{classList:s}=t;s.add(v.base),s.toggle(v.rtl,n),s.toggle(v.ltr,!n),s.toggle(v.debug,i),this.outerContainer.style.setProperty("--offset",`${o}px`),f(t),x(t,e)},l),s(()=>"feedback"===this.mode,()=>{this.position=null,this._clearOverride("effectivePlacement")},a),o(this.outerContainer,"paste",t=>{this.emit("paste",t)}),o(this.outerContainer,["focusin","focusout"],()=>{this._focused=this.content?.container?.contains(document.activeElement)??!1})])}destroy(){this.info=null,this.content=n(this.content),this.outerContainer.remove()}get mode(){return this.content?.mode??"feedback"}get focused(){return this._focused}get visible(){return"none"!==this._outerContainerStyle.display}get contentContainer(){return this.content?.container}get effectivePlacement(){const t=this.options?.placement;return"auto"===t?"bottom-end":t??b}get updating(){return this._updatingHandles.updating}get _screenPoint(){const{inputManager:t}=this.view;return t?.multiTouchActive?null:t?.latestPointerLocation}get _effectiveOffset(){return this.options?.offset??_}get _outerContainerStyle(){const t=this.position??this._screenPoint;if(this._lastPosition=c(t),null!=t&&null!=this.content){return{display:"block",transform:`translate(${Math.round(t.x)}px, ${Math.round(t.y)}px)`}}return{display:"none",transform:"none"}}clear(){this.info=null}async enterInputMode(t){const e=this.position??this._lastPosition??this._screenPoint,o=this.position=c(e),{effectivePlacement:n}=this;this._override("effectivePlacement",n);const i=()=>{o&&(this.position=j(this.contentContainer,o,this._effectiveOffset,this.view),Object.assign(this.outerContainer.style,this._outerContainerStyle))};await this._updatingHandles.addPromise(this.content?.enterInputMode(t,i))}async exitInputMode(t){await this._updatingHandles.addPromise(this.content?.exitInputMode(t))}onDragStart(t,e){this._prevXY=[t,e]}onDrag(t,e){const o=t-this._prevXY[0],n=e-this._prevXY[1];this._prevXY=[t,e];const{position:i}=this;if(i){const{view:s}=this,r=t-s.position[0],l=e-s.position[1];if(r<0||r>s.width||l<0||l>s.height-C)return;this.position=p(i.x+o,i.y+n)}}onDragEnd(){this._prevXY=[0,0]}};function j(t,e,o,n){if(!t||!n.container)return e;const i=t.getBoundingClientRect(),{left:s,top:r}=n.container.getBoundingClientRect();let{x:l,y:a}=e;const c=i.left-s-o;c<0&&(l-=c);const u=i.right-s+o-n.width;u>0&&(l-=u);const d=i.top-r-o;d<0&&(a-=d);const h=i.bottom-r+o-n.height;return h>0&&(a-=h),p(l,a)}t([u({nonNullable:!0})],P.prototype,"view",void 0),t([u()],P.prototype,"info",void 0),t([u()],P.prototype,"options",void 0),t([u()],P.prototype,"position",void 0),t([u()],P.prototype,"content",void 0),t([u({readOnly:!0})],P.prototype,"mode",null),t([u()],P.prototype,"_focused",void 0),t([u({readOnly:!0})],P.prototype,"focused",null),t([u({readOnly:!0})],P.prototype,"outerContainer",void 0),t([u({readOnly:!0})],P.prototype,"contentContainer",null),t([u({readOnly:!0})],P.prototype,"effectivePlacement",null),t([u()],P.prototype,"debug",void 0),t([u()],P.prototype,"updating",null),t([u()],P.prototype,"_lastPosition",void 0),t([u()],P.prototype,"_screenPoint",null),t([u()],P.prototype,"_rtl",void 0),t([u()],P.prototype,"_effectiveOffset",null),t([u()],P.prototype,"_outerContainerStyle",null),P=t([d("esri.views.interactive.Tooltip")],P);const O=["top","bottom","leading","trailing"].flatMap(t=>[w(`${t}-start`),w(t),w(`${t}-end`)]);function w(t){return`${v.base}--${t}`}function x({classList:t},e){O.forEach(e=>t.remove(e)),t.add(w(e))}export{P as default};
5
+ import{__decorate as t}from"tslib";import{EventedAccessor as e}from"../../core/Evented.js";import{on as o}from"../../core/events.js";import{destroyMaybe as n}from"../../core/maybe.js";import{watch as i,when as s,syncAndInitial as r,initial as l,sync as a}from"../../core/reactiveUtils.js";import{cloneScreenPoint as c,createScreenPoint as p}from"../../core/screenUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../core/support/UpdatingHandles.js";import{setCalciteModeClass as f}from"../../support/modeUtils.js";import{base as m}from"./tooltip/css.js";import{tooltipContentFactory as g}from"./tooltip/content/tooltipContentFactory.js";import{isRTL as y}from"../../widgets/support/widgetUtils.js";const v={base:`${m}`,ltr:`${m}--ltr`,rtl:`${m}--rtl`,debug:`${m}--debug`},_=20,C=16,b="bottom-end";let P=class extends e{constructor(t){super(t),this.info=null,this.options=null,this.position=null,this.content=null,this._focused=!1,this.outerContainer=document.createElement("div"),this.debug=!1,this._updatingHandles=new h,this._lastPosition=null,this._rtl=!1,this._prevXY=[0,0]}initialize(){const{outerContainer:t}=this;this.addHandles([i(()=>this.view.overlay?.surface,e=>{t.remove(),e?.appendChild(t),this._rtl=y(e)},r),i(()=>this.info,(e,o)=>{if(null!=this.content&&null!=e&&null!=o&&e.type===o.type)this.content.info=e;else{n(this.content);const o=g(this,e);o?(this.content=o,o.container&&t.appendChild(o.container),this.exitInputMode()):this.content=null}},r),i(()=>({container:this.outerContainer,style:this._outerContainerStyle}),({container:t,style:e})=>{Object.assign(t.style,e)},l),i(()=>({outerContainer:this.outerContainer,placement:this.effectivePlacement,effectiveOffset:this._effectiveOffset,rtl:this._rtl,debug:this.debug}),({outerContainer:t,placement:e,effectiveOffset:o,rtl:n,debug:i})=>{const{classList:s}=t;s.add(v.base),s.toggle(v.rtl,n),s.toggle(v.ltr,!n),s.toggle(v.debug,i),this.outerContainer.style.setProperty("--offset",`${o}px`),f(t),x(t,e)},l),s(()=>"feedback"===this.mode,()=>{this.position=null,this._clearOverride("effectivePlacement")},a),o(this.outerContainer,"paste",t=>{this.emit("paste",t)}),o(this.outerContainer,["focusin","focusout"],()=>{this._focused=this.content?.container?.contains(document.activeElement)??!1})])}destroy(){this.info=null,this.content=n(this.content),this.outerContainer.remove()}get mode(){return this.content?.mode??"feedback"}get focused(){return this._focused}get visible(){return"none"!==this._outerContainerStyle.display}get contentContainer(){return this.content?.container}get effectivePlacement(){const t=this.options?.placement;return"auto"===t?"bottom-end":t??b}get updating(){return this._updatingHandles.updating}get _screenPoint(){const{inputManager:t}=this.view;return t?.multiTouchActive?null:t?.latestPointerInfo?.location}get _effectiveOffset(){return this.options?.offset??_}get _outerContainerStyle(){const t=this.position??this._screenPoint;if(this._lastPosition=c(t),null!=t&&null!=this.content){return{display:"block",transform:`translate(${Math.round(t.x)}px, ${Math.round(t.y)}px)`}}return{display:"none",transform:"none"}}clear(){this.info=null}async enterInputMode(t){const e=this.position??this._lastPosition??this._screenPoint,o=this.position=c(e),{effectivePlacement:n}=this;this._override("effectivePlacement",n);const i=()=>{o&&(this.position=j(this.contentContainer,o,this._effectiveOffset,this.view),Object.assign(this.outerContainer.style,this._outerContainerStyle))};await this._updatingHandles.addPromise(this.content?.enterInputMode(t,i))}async exitInputMode(t){await this._updatingHandles.addPromise(this.content?.exitInputMode(t))}onDragStart(t,e){this._prevXY=[t,e]}onDrag(t,e){const o=t-this._prevXY[0],n=e-this._prevXY[1];this._prevXY=[t,e];const{position:i}=this;if(i){const{view:s}=this,r=t-s.position[0],l=e-s.position[1];if(r<0||r>s.width||l<0||l>s.height-C)return;this.position=p(i.x+o,i.y+n)}}onDragEnd(){this._prevXY=[0,0]}};function j(t,e,o,n){if(!t||!n.container)return e;const i=t.getBoundingClientRect(),{left:s,top:r}=n.container.getBoundingClientRect();let{x:l,y:a}=e;const c=i.left-s-o;c<0&&(l-=c);const u=i.right-s+o-n.width;u>0&&(l-=u);const d=i.top-r-o;d<0&&(a-=d);const h=i.bottom-r+o-n.height;return h>0&&(a-=h),p(l,a)}t([u({nonNullable:!0})],P.prototype,"view",void 0),t([u()],P.prototype,"info",void 0),t([u()],P.prototype,"options",void 0),t([u()],P.prototype,"position",void 0),t([u()],P.prototype,"content",void 0),t([u({readOnly:!0})],P.prototype,"mode",null),t([u()],P.prototype,"_focused",void 0),t([u({readOnly:!0})],P.prototype,"focused",null),t([u({readOnly:!0})],P.prototype,"outerContainer",void 0),t([u({readOnly:!0})],P.prototype,"contentContainer",null),t([u({readOnly:!0})],P.prototype,"effectivePlacement",null),t([u()],P.prototype,"debug",void 0),t([u()],P.prototype,"updating",null),t([u()],P.prototype,"_lastPosition",void 0),t([u()],P.prototype,"_screenPoint",null),t([u()],P.prototype,"_rtl",void 0),t([u()],P.prototype,"_effectiveOffset",null),t([u()],P.prototype,"_outerContainerStyle",null),P=t([d("esri.views.interactive.Tooltip")],P);const O=["top","bottom","leading","trailing"].flatMap(t=>[w(`${t}-start`),w(t),w(`${t}-end`)]);function w(t){return`${v.base}--${t}`}function x({classList:t},e){O.forEach(e=>t.remove(e)),t.add(w(e))}export{P as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{set as o,dot as i,min as r,max as t,subtract as s,add as n,scale as e,projectAndScale as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as c,f,K as m,g}from"../../../../chunks/vec32.js";import{fromValues as p,ZEROS as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as b,u as I}from"../../../../chunks/boundedPlane.js";import{sv2d as N}from"../../../../geometry/support/vectorStacks.js";import{MoveVertex as l}from"../operations/MoveVertex.js";import{RotateVertex as d}from"../operations/RotateVertex.js";import{ScaleVertex as j}from"../operations/ScaleVertex.js";import{UpdateVertices as x}from"../operations/UpdateVertices.js";function V(o,i){return E(o,i,!1)}function T(o,i){return E(o,i,!0)}function E(o,i,r){if(o instanceof x){if(o.operation instanceof l)return h(o.operation,i,r),!0;if(o.operation instanceof d)return v(o.operation,i,r),!0;if(o.operation instanceof j)return F(o.operation,i,r),!0}return!1}function h(o,i,r=!1){const t=r?-1:1,s=p(t*o.dx,t*o.dy,t*o.dz);f(i.origin,i.origin,s),I(i)}function v(o,i,r=!1){const t=r?-o.angle:o.angle;m(i.basis1,i.basis1,u,t),m(i.basis2,i.basis2,u,t),I(i)}function F(o,i,r=!1){const t=r?1/o.factor1:o.factor1,s=r?1/o.factor2:o.factor2;g(i.basis1,i.basis1,t),g(i.basis2,i.basis2,s),a(i.origin,i.origin,o.origin,o.axis1,t),a(i.origin,i.origin,o.origin,o.axis2,s),I(i)}function S(a,m,g,p,u=!1){p||(p=b());const l=o(N.get(),a[1],-a[0]),d=o(N.get(),Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),j=o(N.get(),Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),x=N.get(),V=m.allVerticesUnordered;V.forEach(({pos:s})=>{o(x,i(a,s),i(l,s)),r(d,d,x),t(j,j,x)});const T=1e-6,E=o(N.get(),j[0]-d[0]<T?g/2:0,j[1]-d[1]<T?g/2:0);s(d,d,E),n(j,j,E);const h=u?V.reduce((o,i)=>o+(i.pos[2]??0),0)/V.length:0;return e(p.basis1,a,(j[0]-d[0])/2),e(p.basis2,l,(j[1]-d[1])/2),c(p.origin,d[0]*a[0]+d[1]*l[0],d[0]*a[1]+d[1]*l[1],h),f(p.origin,p.origin,p.basis1),f(p.origin,p.origin,p.basis2),I(p),p}export{V as apply,T as applyInverse,S as calculateOrientedBounds};
5
+ import{set as o,dot as i,min as r,max as t,subtract as s,add as n,scale as e,projectAndScale as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as c,f,K as m,g}from"../../../../chunks/vec32.js";import{fromValues as p,ZEROS as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as b,u as I}from"../../../../chunks/boundedPlane.js";import{sv2d as N}from"../../../../geometry/support/vectorStacks.js";import{MoveVertex as l}from"../operations/MoveVertex.js";import{RotateVertex as d}from"../operations/RotateVertex.js";import{ScaleVertex as j}from"../operations/ScaleVertex.js";import{UpdateVertices as x}from"../operations/UpdateVertices.js";function V(o,i){return E(o,i,!1)}function T(o,i){return E(o,i,!0)}function E(o,i,r){if(o instanceof x){if(o.operation instanceof l)return h(o.operation,i,r),!0;if(o.operation instanceof d)return v(o.operation,i,r),!0;if(o.operation instanceof j)return F(o.operation,i,r),!0}return!1}function h(o,i,r=!1){const t=r?-1:1,s=p(t*o.dx,t*o.dy,t*o.dz);f(i.origin,i.origin,s),I(i)}function v(o,i,r=!1){const t=r?-o.angle:o.angle;m(i.basis1,i.basis1,u,t),m(i.basis2,i.basis2,u,t),I(i)}function F(o,i,r=!1){const t=r?1/o.factor1:o.factor1,s=r?1/o.factor2:o.factor2;g(i.basis1,i.basis1,t),g(i.basis2,i.basis2,s),a(i.origin,i.origin,o.origin,o.axis1,t),a(i.origin,i.origin,o.origin,o.axis2,s),I(i)}function S(a,m,g,p,u=!1){p||(p=b());const l=o(N.get(),a[1],-a[0]),d=o(N.get(),Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),j=o(N.get(),Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),x=N.get(),V=m.allVerticesUnordered;V.forEach(({pos:s})=>{o(x,i(a,s),i(l,s)),r(d,d,x),t(j,j,x)});const T=1e-6,E=o(N.get(),j[0]-d[0]<T?g/2:0,j[1]-d[1]<T?g/2:0);s(d,d,E),n(j,j,E);const h=u?V.reduce((o,i)=>o+(i.pos[2]??0),0)/V.length:0;return e(p.basis1,a,(j[0]-d[0])/2),e(p.basis2,l,(j[1]-d[1])/2),c(p.origin,d[0]*a[0]+d[1]*l[0],d[0]*a[1]+d[1]*l[1],h),f(p.origin,p.origin,p.basis1),f(p.origin,p.origin,p.basis2),I(p),p}export{V as apply,T as applyInverse,S as calculateOrientedBounds};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{asinClamped as s}from"../../../core/mathUtils.js";import{dot as r,subtract as n,squaredDistance as i,exactEquals as o,set as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{q as a,c as h,i as f,d as l,G as d,b as p,s as m,a as g,k as _,e as k,h as L,n as x}from"../../../chunks/vec32.js";import{create as y,fromValues as z,clone as M,UNIT_Z as P}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as T,h as q}from"../../../chunks/vec42.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{toRadians as v}from"../../../geometry/support/geodesicConstants.js";import{directGeodeticSolver as j,inverseGeodeticSolver as D,InverseGeodeticSolverResult as b}from"../../../geometry/support/geodesicUtils.js";import{create as R,fromPoints as A,fromPositionAndNormal as Z,intersectLine as U,signedDistance as G,projectPoint as I,getNormal as S,distance as C}from"../../../geometry/support/plane.js";import{u as O,r as E,v as V,w as B,a as F}from"../../../chunks/sphere.js";import{tangentFrame as H}from"../../3d/support/mathUtils.js";import{clone as J,asVec2 as K,createWritable as N,fromVec3 as Q,fromValues as W,create as X}from"./normalizedPoint.js";import{projectPointToVerticalPlane as Y,isClose as $,projectPointToVerticalCylinder as tt,projectPointToLineLike as et,intersectLineLikes as st,intersectVerticalPlaneAndLineLike as rt,intersectLineLikeAndVerticalCylinder as nt,intersectLineLikeAndCircle as it,intersectVerticalPlanes as ot,intersectVerticalPlaneAndVerticalCylinder as ct,intersectVerticalCylinders as ut,intersectVerticalPlaneAndPoint as at,vectorsHaveCloseZ as ht,isPointInsidePlane as ft,pointsInsidePlane as lt}from"../../support/geometry3dUtils.js";class dt{intersect(t){return Vt(this,t)}closestPoints(t){return[this.closestTo(t)]}}class pt extends dt{constructor(t){super(),this.point=t}equals(t){return this===t||ge(t)&&a(this.point,t.point)}closestTo(){return J(this.point)}}class mt extends dt{constructor(t,e,s){super(),this.start=t,this.end=e,this.lineLike={start:t,end:e,type:s}}equals(t){return this===t||_e(t)&&this.lineLike.type===t.lineLike.type&&a(this.start,t.start)&&a(this.end,t.end)}closestTo(t){const e=N();return et(t,this.lineLike,e),e}}class gt extends mt{constructor(t,e){super(t,e,1)}}class _t extends mt{constructor(t,e){super(t,e,0)}}class kt extends dt{constructor(t){super(),this.constraints=t}equals(t){return this===t||me(t)&&e(this.constraints,t.constraints,(t,e)=>t.equals(e))}closestTo(t){let e,s=1/0;for(const r of this.constraints){const n=r.closestTo(t),i=m(t,n);i<s&&(s=i,e=n)}return J(e??t)}closestPoints(t){return this.constraints.flatMap(e=>e===this?[]:e.closestPoints(t))}}class Lt extends dt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||xe(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const e=N();return tt(t,this.center,this.radius,e),e}}class xt extends dt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||ye(t)&&a(this.center,t.center)&&this.radius===t.radius}closestTo(t){const e=N();return tt(t,this.center,this.radius,e),e[2]=this.center[2],e}asCircle(){return new yt(J(this.center),this.radius,W(0,0,1))}}class yt extends dt{constructor(t,e,s,r=void 0){super(),this.center=t,this.radius=e,this.normal=s,this.slicePlane=r}equals(t){return this===t||ze(t)&&a(this.center,t.center)&&a(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:e,radius:s}=this;I(this.getPlane(Mt),t,zt);const r=g(zt,zt,e),n=_(r);if($(n,0))return J(t);const i=s/Math.sqrt(n),o=N();p(o,e,r,i);const{slicePlane:c}=this;if(c&&!ft(c,o)){const e=Jt(c,this);return e?.closestTo(t)??J(t)}return o}getPlane(t=R()){return Z(this.center,this.normal,t)}}const zt=y(),Mt=R();class Pt extends dt{constructor(t){super(),this.z=t}equals(t){return this===t||ke(t)&&this.z===t.z}closestTo(t){return W(t[0],t[1],this.z)}getPlane(t=R()){return f(Tt,0,0,this.z),Z(Tt,P,t)}}const Tt=y();class qt extends dt{constructor(t,e,s){super(),this.start=t,this.end=e,this.planeLike={start:K(t),end:K(e),type:s}}equals(t){return this===t||Le(t)&&this.planeLike.type===t.planeLike.type&&a(this.start,t.start)&&a(this.end,t.end)}closestTo(t){const e=N();return Y(t,this.planeLike,e),e}closestEndTo(t){const{start:e,end:s}=this.planeLike;return Math.sign(r(n(wt,s,e),n(vt,K(t),e)))>0?this.end:this.start}getPlane(t=R()){const e=h(jt,this.end);return e[2]+=1,A(this.start,this.end,e,t)}getSlicePlane(t=R()){const{start:e,end:s,type:r}=this.planeLike;if(0===r)return;const n=f(jt,e[0],e[1],0),i=f(Dt,s[0],s[1],0),o=l(Dt,i,n);return Z(n,o,t),t}}const wt=u(),vt=u(),jt=y(),Dt=y();class bt extends qt{constructor(t,e){super(t,e,1)}}class Rt extends qt{constructor(t,e){super(t,e,0)}}class At extends dt{constructor(t,e){super(),this.sphere=E(t,e)}equals(t){return this===t||Me(t)&&V(this.sphere,t.sphere)}closestTo(t){const e=N();return B(this.sphere,t,e),e}get center(){return F(this.sphere)}get radius(){return this.sphere[3]}}class Zt extends dt{constructor(t,e,s){super(),this.start=t,this.end=e,this.getZ=s,this.planeLike={start:K(t),end:K(e),type:0}}equals(t){return this===t||Pe(t)&&a(this.start,t.start)&&a(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return Et(this,t)}addIfOnTheGround(t,e){for(const s of e){const e=this.getZ(s[0],s[1])??0;$(s[2],e)&&(s[2]=e,t.push(s))}}}class Ut extends dt{constructor(t,e,s){super(),this._x=t,this._y=e,this._z=s}equals(t){return this===t||qe(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,e,s]){return X(this._x??t,this._y??e,this._z??s)}}class Gt extends dt{constructor(t,e,s,r,n){super(),this._origin=t,this._spatialReference=e,this._distanceMeters=s,this._z=r,this._directionDegrees=n}equals(t){return this===t||Te(t)&&o(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._z===t._z&&this._directionDegrees===t._directionDegrees}closestTo([t,e,s]){return c(It,t,e),o(It,this._origin)||this._applyDirectionAndDistance(It),X(It[0],It[1],this._z??s)}_applyDirectionAndDistance(t){if(null!=this._directionDegrees&&null!=this._distanceMeters)j(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(null!=this._directionDegrees)Ct(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(null!=this._distanceMeters){const{azimuth:e}=D(St,this._origin,t,this._spatialReference);j(t,this._origin,e??0,this._distanceMeters,this._spatialReference)}}}const It=[0,0],St=new b;function Ct(t,e,s,r,n){let{azimuth:i,distance:o}=D(Ot,e,r,n);i??=0;let c=o*Math.cos((i-s)*v);c=Math.max(0,c),j(t,e,s,c,n)}const Ot=new b;function Et(t,e){const s=N();return Y(e,t.planeLike,s),s[2]=t.getZ(s[0],s[1])??we,s}function Vt(t,e){if(me(t)){const s=[];for(const r of t.constraints){const t=r.intersect(e);t&&s.push(t)}return pe(s)}if(me(e))return Vt(e,t);if(Pe(t))return he(t,e);if(Pe(e))return he(e,t);if(ge(t)){const{point:s}=t;if(ge(e))return a(s,e.point)?t:void 0;const r=e.closestTo(s);return d(r,s)?t:void 0}if(_e(t)){if(ge(e))return Vt(e,t);if(_e(e))return le(st(t.lineLike,e.lineLike));if(ke(e))return Bt(t,e);if(Le(e))return le(rt(e.planeLike,t.lineLike));if(xe(e))return le(nt(t.lineLike,e.center,e.radius));if(ze(e))return le(it(t.lineLike,e));if(ye(e))return Ft(t,e);if(Me(e))return Ht(t,e)}else if(ke(t)){if(ge(e)||_e(e))return Vt(e,t);if(ke(e))return Kt(t,e);if(Le(e))return Nt(t,e);if(xe(e))return Qt(t,e);if(ze(e))return Xt(t,e);if(ye(e))return Wt(t,e);if(Me(e))return Yt(t,e)}else if(Le(t)){if(ge(e)||_e(e)||ke(e))return Vt(e,t);if(Le(e))return fe(ot(t.planeLike,e.planeLike));if(xe(e))return fe(ct(t.planeLike,e.center,e.radius));if(ze(e))return te(t,e);if(ye(e))return $t(t,e);if(Me(e))return ee(t,e)}else if(xe(t)){if(ge(e)||_e(e)||ke(e)||Le(e))return Vt(e,t);if(xe(e))return fe(ut(K(t.center),t.radius,K(e.center),e.radius));if(ze(e))return se();if(ye(e))return re(t,e);if(Me(e))return ne()}else if(ze(t)){if(ge(e)||_e(e)||ke(e)||Le(e)||xe(e))return Vt(e,t);if(ze(e))return ie();if(ye(e))return ie(e.asCircle());if(Me(e))return oe()}else if(ye(t)){if(ge(e)||_e(e)||ke(e)||Le(e)||xe(e)||ze(e))return Vt(e,t);if(ye(e))return ce(e,t);if(Me(e))return ue()}else if(Me(t)){if(ge(e)||_e(e)||ke(e)||Le(e)||xe(e)||ye(e))return Vt(e,t);if(Me(e))return ae()}}const Bt=(()=>{const t=R();return(e,s)=>{const{start:r,end:n}=e;if(ht(r,n)&&$(r[2],s.z))return e;const i=N();return U(s.getPlane(t),r,n,i)?new pt(i):void 0}})();function Ft({lineLike:t},{center:e,radius:s}){const r=e[2];return le(nt(t,e,s).filter(t=>$(t[2],r)))}function Ht({lineLike:t},{sphere:e}){return le(O(e,t.start,t.end))}const Jt=(()=>{const t=w(),e=y(),r=y();return(n,i,o)=>{const{normal:c,center:u,radius:a}=i;H(c,e,r);const h=S(n),f=a*k(h,e),l=a*k(h,r);T(t,u[0],u[1],u[2],1);const d=q(n,t),m=Math.hypot(f,l),g=$(m,0);if($(C(n,u),0)){if(g)return i;if($(a,0))return!o||ft(o,u)?new pt(J(u)):void 0;L(e,h,c),x(e,e);const t=new Array,s=M(u);p(s,s,e,a),o&&!ft(o,s)||t.push(s);const r=M(u);return p(r,r,e,-a),o&&!ft(o,r)||t.push(r),le(t)}if(g)return;const _=-d/m;if(Math.abs(_)>1||$(_,1))return;const z=Math.atan(f/l),P=s(_)-z,w=Math.PI-P,v=new Array,j=y();p(j,u,e,a*Math.cos(P)),p(j,j,r,a*Math.sin(P)),v.push(j);const D=y();return p(D,u,e,a*Math.cos(w)),p(D,D,r,a*Math.sin(w)),v.push(D),le(o?lt(o,v):v)}})();function Kt(t,e){return $(t.z,e.z)?t:void 0}function Nt({z:t},{planeLike:e}){const[s,r]=e.start,[n,i]=e.end,o=W(s,r,t),c=W(n,i,t);return 0===e.type?new gt(o,c):new _t(o,c)}function Qt(t,e){const[s,r]=e.center;return new xt(W(s,r,t.z),e.radius)}function Wt(t,e){return $(e.center[2],t.z)?e:void 0}const Xt=(()=>{const t=R();return(e,s)=>Jt(e.getPlane(t),s,s.slicePlane)})();function Yt(t,{center:e,radius:s}){const r=Math.abs(e[2]-t.z);if(r>s&&!$(r,s))return;const n=W(e[0],e[1],t.z),i=Math.sqrt(s**2-r**2);return $(i,0)?void 0:new xt(n,i)}const $t=(()=>{const t=R();return(e,{center:s,radius:r})=>{const n=ct(e.planeLike,s,r),i=s[2];e.getSlicePlane(t);const o=new Array;for(const[c,u]of n){const e=[c,u,i];ft(t,e)&&o.push(e)}return le(o)}})(),te=(()=>{const t=R(),e=R();return(s,r)=>Jt(s.getPlane(t),r,s.getSlicePlane(e))})(),ee=(()=>{const t=R();return(e,{center:s,radius:r})=>{const n=e.getPlane(t),i=G(n,s),o=Math.abs(i);if(o>r&&!$(o,r))return;const c=Math.sqrt(r**2-i**2);if($(c,0)){const t=N();return I(n,s,t),new pt(t)}const u=N(),a=M(S(n));return p(u,s,a,i),new yt(u,c,a,e.getSlicePlane())}})();function se(t,e){}function re(t,e){const s=i(K(t.center),K(e.center));if($(s,0)&&$(t.radius,e.radius))return e;return de(ut(K(t.center),t.radius,K(e.center),e.radius),e.center[2])}function ne(t,e){}function ie(t,e){}function oe(t,e){}function ce(t,e){if(!ht(t.center,e.center))return;const s=i(K(t.center),K(e.center));if($(s,0)&&$(t.radius,e.radius))return t;return de(ut(K(t.center),t.radius,K(e.center),e.radius),t.center[2])}function ue(t,e){}function ae(t,e){}function he(t,e){const{planeLike:s,getZ:r}=t,n=new Array;if(ge(e))t.addIfOnTheGround(n,at(s,e.point));else if(_e(e))t.addIfOnTheGround(n,rt(s,e.lineLike));else if(xe(e))for(const[i,o]of ct(s,e.center,e.radius)){const t=r(i,o);null!=t&&n.push(z(i,o,t))}else if(Le(e)||Pe(e))for(const[i,o]of ot(s,e.planeLike)){const t=r(i,o)??we;n.push(z(i,o,t))}return le(n)}function fe(t){return pe(t.map(([t,e])=>{const s=W(t,e,0),r=W(t,e,1);return new gt(s,r)}))}function le(t){return pe(t.map(t=>t?new pt(Q(t)):void 0))}function de(t,e){return le(t.map(([t,s])=>[t,s,e]))}function pe(e){if(0!==e.length)return 1===e.length?e[0]??void 0:new kt(e.filter(t))}function me(t){return t instanceof kt}function ge(t){return t instanceof pt}function _e(t){return t instanceof mt}function ke(t){return t instanceof Pt}function Le(t){return t instanceof qt}function xe(t){return t instanceof Lt}function ye(t){return t instanceof xt}function ze(t){return t instanceof yt}function Me(t){return t instanceof At}function Pe(t){return t instanceof Zt}function Te(t){return t instanceof Gt}function qe(t){return t instanceof Ut}const we=0;export{yt as CircleConstraint,dt as Constraint,Ut as CoordinateConstraint,Zt as DrapedLineConstraint,Gt as GeodesicConstraint,xt as HorizontalCircleConstraint,Pt as HorizontalPlaneConstraint,gt as LineConstraint,mt as LineLikeConstraint,pt as PointConstraint,_t as RayConstraint,kt as SetConstraint,At as SphereConstraint,Lt as VerticalCylinderConstraint,bt as VerticalHalfPlaneConstraint,Rt as VerticalPlaneConstraint,qt as VerticalPlaneLikeConstraint,pe as constraintOrSet,ge as isPoint};
5
+ import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{asinClamped as s}from"../../../core/mathUtils.js";import{dot as n,subtract as r,squaredDistance as i,exactEquals as o,set as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{q as a,c as h,i as f,d as l,G as d,b as p,s as m,a as _,k as g,e as k,h as x,n as L}from"../../../chunks/vec32.js";import{create as y,fromValues as z,clone as M,UNIT_Z as P}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as T,h as q}from"../../../chunks/vec42.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{toRadians as v}from"../../../geometry/support/geodesicConstants.js";import{directGeodeticSolver as j,inverseGeodeticSolver as D,InverseGeodeticSolverResult as b}from"../../../geometry/support/geodesicUtils.js";import{create as R,fromPoints as A,fromPositionAndNormal as Z,intersectLine as U,signedDistance as G,projectPoint as I,getNormal as S,distance as C}from"../../../geometry/support/plane.js";import{v as O,u as E,w as V,x as B}from"../../../chunks/sphere.js";import{tangentFrame as F}from"../../3d/support/mathUtils.js";import{clone as H,asVec2 as J,createWritable as K,fromVec3 as N,fromValues as Q,create as W}from"./normalizedPoint.js";import{projectPointToVerticalPlane as X,isClose as Y,projectPointToVerticalCylinder as $,projectPointToLineLike as tt,intersectLineLikes as et,intersectVerticalPlaneAndLineLike as st,intersectLineLikeAndVerticalCylinder as nt,intersectLineLikeAndCircle as rt,intersectVerticalPlanes as it,intersectVerticalPlaneAndVerticalCylinder as ot,intersectVerticalCylinders as ct,intersectVerticalPlaneAndPoint as ut,vectorsHaveCloseZ as at,isPointInsidePlane as ht,pointsInsidePlane as ft}from"../../support/geometry3dUtils.js";class lt{intersect(t){return Et(this,t)}closestPoints(t){return[this.closestTo(t)]}}class dt extends lt{constructor(t){super(),this.point=t}equals(t){return this===t||me(t)&&a(this.point,t.point)}closestTo(){return H(this.point)}}class pt extends lt{constructor(t,e,s){super(),this.start=t,this.end=e,this.lineLike={start:t,end:e,type:s}}equals(t){return this===t||_e(t)&&this.lineLike.type===t.lineLike.type&&a(this.start,t.start)&&a(this.end,t.end)}closestTo(t){const e=K();return tt(t,this.lineLike,e),e}}class mt extends pt{constructor(t,e){super(t,e,1)}}class _t extends pt{constructor(t,e){super(t,e,0)}}class gt extends lt{constructor(t){super(),this.constraints=t}equals(t){return this===t||pe(t)&&e(this.constraints,t.constraints,(t,e)=>t.equals(e))}closestTo(t){let e,s=1/0;for(const n of this.constraints){const r=n.closestTo(t),i=m(t,r);i<s&&(s=i,e=r)}return H(e??t)}closestPoints(t){return this.constraints.flatMap(e=>e===this?[]:e.closestPoints(t))}}class kt extends lt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||xe(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const e=K();return $(t,this.center,this.radius,e),e}}class xt extends lt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||Le(t)&&a(this.center,t.center)&&this.radius===t.radius}closestTo(t){const e=K();return $(t,this.center,this.radius,e),e[2]=this.center[2],e}asCircle(){return new Lt(H(this.center),this.radius,Q(0,0,1))}}class Lt extends lt{constructor(t,e,s,n=void 0){super(),this.center=t,this.radius=e,this.normal=s,this.slicePlane=n}equals(t){return this===t||ye(t)&&a(this.center,t.center)&&a(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:e,radius:s}=this;I(this.getPlane(zt),t,yt);const n=_(yt,yt,e),r=g(n);if(Y(r,0))return H(t);const i=s/Math.sqrt(r),o=K();p(o,e,n,i);const{slicePlane:c}=this;if(c&&!ht(c,o)){const e=Ht(c,this);return e?.closestTo(t)??H(t)}return o}getPlane(t=R()){return Z(this.center,this.normal,t)}}const yt=y(),zt=R();class Mt extends lt{constructor(t){super(),this.z=t}equals(t){return this===t||ge(t)&&this.z===t.z}closestTo(t){return Q(t[0],t[1],this.z)}getPlane(t=R()){return f(Pt,0,0,this.z),Z(Pt,P,t)}}const Pt=y();class Tt extends lt{constructor(t,e,s){super(),this.start=t,this.end=e,this.planeLike={start:J(t),end:J(e),type:s}}equals(t){return this===t||ke(t)&&this.planeLike.type===t.planeLike.type&&a(this.start,t.start)&&a(this.end,t.end)}closestTo(t){const e=K();return X(t,this.planeLike,e),e}closestEndTo(t){const{start:e,end:s}=this.planeLike;return Math.sign(n(r(qt,s,e),r(wt,J(t),e)))>0?this.end:this.start}getPlane(t=R()){const e=h(vt,this.end);return e[2]+=1,A(this.start,this.end,e,t)}getSlicePlane(t=R()){const{start:e,end:s,type:n}=this.planeLike;if(0===n)return;const r=f(vt,e[0],e[1],0),i=f(jt,s[0],s[1],0),o=l(jt,i,r);return Z(r,o,t),t}}const qt=u(),wt=u(),vt=y(),jt=y();class Dt extends Tt{constructor(t,e){super(t,e,1)}}class bt extends Tt{constructor(t,e){super(t,e,0)}}class Rt extends lt{constructor(t,e){super(),this.sphere=E(t,e),this._center=M(t)}equals(t){return this===t||ze(t)&&V(this.sphere,t.sphere)}closestTo(t){const e=K();return B(this.sphere,t,e),e}get center(){return this._center}get radius(){return this.sphere[3]}}class At extends lt{constructor(t,e,s){super(),this.start=t,this.end=e,this.getZ=s,this.planeLike={start:J(t),end:J(e),type:0}}equals(t){return this===t||Me(t)&&a(this.start,t.start)&&a(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return Ot(this,t)}addIfOnTheGround(t,e){for(const s of e){const e=this.getZ(s[0],s[1])??0;Y(s[2],e)&&(s[2]=e,t.push(s))}}}class Zt extends lt{constructor(t,e,s){super(),this._x=t,this._y=e,this._z=s}equals(t){return this===t||Te(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,e,s]){return W(this._x??t,this._y??e,this._z??s)}}class Ut extends lt{constructor(t,e,s,n,r){super(),this._origin=t,this._spatialReference=e,this._distanceMeters=s,this._z=n,this._directionDegrees=r}equals(t){return this===t||Pe(t)&&o(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._z===t._z&&this._directionDegrees===t._directionDegrees}closestTo([t,e,s]){return c(Gt,t,e),o(Gt,this._origin)||this._applyDirectionAndDistance(Gt),W(Gt[0],Gt[1],this._z??s)}_applyDirectionAndDistance(t){if(null!=this._directionDegrees&&null!=this._distanceMeters)j(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(null!=this._directionDegrees)St(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(null!=this._distanceMeters){const{azimuth:e}=D(It,this._origin,t,this._spatialReference);j(t,this._origin,e??0,this._distanceMeters,this._spatialReference)}}}const Gt=[0,0],It=new b;function St(t,e,s,n,r){let{azimuth:i,distance:o}=D(Ct,e,n,r);i??=0;let c=o*Math.cos((i-s)*v);c=Math.max(0,c),j(t,e,s,c,r)}const Ct=new b;function Ot(t,e){const s=K();return X(e,t.planeLike,s),s[2]=t.getZ(s[0],s[1])??qe,s}function Et(t,e){if(pe(t)){const s=[];for(const n of t.constraints){const t=n.intersect(e);t&&s.push(t)}return de(s)}if(pe(e))return Et(e,t);if(Me(t))return ae(t,e);if(Me(e))return ae(e,t);if(me(t)){const{point:s}=t;if(me(e))return a(s,e.point)?t:void 0;const n=e.closestTo(s);return d(n,s)?t:void 0}if(_e(t)){if(me(e))return Et(e,t);if(_e(e))return fe(et(t.lineLike,e.lineLike));if(ge(e))return Vt(t,e);if(ke(e))return fe(st(e.planeLike,t.lineLike));if(xe(e))return fe(nt(t.lineLike,e.center,e.radius));if(ye(e))return fe(rt(t.lineLike,e));if(Le(e))return Bt(t,e);if(ze(e))return Ft(t,e)}else if(ge(t)){if(me(e)||_e(e))return Et(e,t);if(ge(e))return Jt(t,e);if(ke(e))return Kt(t,e);if(xe(e))return Nt(t,e);if(ye(e))return Wt(t,e);if(Le(e))return Qt(t,e);if(ze(e))return Xt(t,e)}else if(ke(t)){if(me(e)||_e(e)||ge(e))return Et(e,t);if(ke(e))return he(it(t.planeLike,e.planeLike));if(xe(e))return he(ot(t.planeLike,e.center,e.radius));if(ye(e))return $t(t,e);if(Le(e))return Yt(t,e);if(ze(e))return te(t,e)}else if(xe(t)){if(me(e)||_e(e)||ge(e)||ke(e))return Et(e,t);if(xe(e))return he(ct(J(t.center),t.radius,J(e.center),e.radius));if(ye(e))return ee();if(Le(e))return se(t,e);if(ze(e))return ne()}else if(ye(t)){if(me(e)||_e(e)||ge(e)||ke(e)||xe(e))return Et(e,t);if(ye(e))return re();if(Le(e))return re(e.asCircle());if(ze(e))return ie()}else if(Le(t)){if(me(e)||_e(e)||ge(e)||ke(e)||xe(e)||ye(e))return Et(e,t);if(Le(e))return oe(e,t);if(ze(e))return ce()}else if(ze(t)){if(me(e)||_e(e)||ge(e)||ke(e)||xe(e)||Le(e))return Et(e,t);if(ze(e))return ue()}}const Vt=(()=>{const t=R();return(e,s)=>{const{start:n,end:r}=e;if(at(n,r)&&Y(n[2],s.z))return e;const i=K();return U(s.getPlane(t),n,r,i)?new dt(i):void 0}})();function Bt({lineLike:t},{center:e,radius:s}){const n=e[2];return fe(nt(t,e,s).filter(t=>Y(t[2],n)))}function Ft({lineLike:t},{sphere:e}){return fe(O(e,t.start,t.end))}const Ht=(()=>{const t=w(),e=y(),n=y();return(r,i,o)=>{const{normal:c,center:u,radius:a}=i;F(c,e,n);const h=S(r),f=a*k(h,e),l=a*k(h,n);T(t,u[0],u[1],u[2],1);const d=q(r,t),m=Math.hypot(f,l),_=Y(m,0);if(Y(C(r,u),0)){if(_)return i;if(Y(a,0))return!o||ht(o,u)?new dt(H(u)):void 0;x(e,h,c),L(e,e);const t=new Array,s=M(u);p(s,s,e,a),o&&!ht(o,s)||t.push(s);const n=M(u);return p(n,n,e,-a),o&&!ht(o,n)||t.push(n),fe(t)}if(_)return;const g=-d/m;if(Math.abs(g)>1||Y(g,1))return;const z=Math.atan(f/l),P=s(g)-z,w=Math.PI-P,v=new Array,j=y();p(j,u,e,a*Math.cos(P)),p(j,j,n,a*Math.sin(P)),v.push(j);const D=y();return p(D,u,e,a*Math.cos(w)),p(D,D,n,a*Math.sin(w)),v.push(D),fe(o?ft(o,v):v)}})();function Jt(t,e){return Y(t.z,e.z)?t:void 0}function Kt({z:t},{planeLike:e}){const[s,n]=e.start,[r,i]=e.end,o=Q(s,n,t),c=Q(r,i,t);return 0===e.type?new mt(o,c):new _t(o,c)}function Nt(t,e){const[s,n]=e.center;return new xt(Q(s,n,t.z),e.radius)}function Qt(t,e){return Y(e.center[2],t.z)?e:void 0}const Wt=(()=>{const t=R();return(e,s)=>Ht(e.getPlane(t),s,s.slicePlane)})();function Xt(t,{center:e,radius:s}){const n=Math.abs(e[2]-t.z);if(n>s&&!Y(n,s))return;const r=Q(e[0],e[1],t.z),i=Math.sqrt(s**2-n**2);return Y(i,0)?void 0:new xt(r,i)}const Yt=(()=>{const t=R();return(e,{center:s,radius:n})=>{const r=ot(e.planeLike,s,n),i=s[2];e.getSlicePlane(t);const o=new Array;for(const[c,u]of r){const e=[c,u,i];ht(t,e)&&o.push(e)}return fe(o)}})(),$t=(()=>{const t=R(),e=R();return(s,n)=>Ht(s.getPlane(t),n,s.getSlicePlane(e))})(),te=(()=>{const t=R();return(e,{center:s,radius:n})=>{const r=e.getPlane(t),i=G(r,s),o=Math.abs(i);if(o>n&&!Y(o,n))return;const c=Math.sqrt(n**2-i**2);if(Y(c,0)){const t=K();return I(r,s,t),new dt(t)}const u=K(),a=M(S(r));return p(u,s,a,i),new Lt(u,c,a,e.getSlicePlane())}})();function ee(t,e){}function se(t,e){const s=i(J(t.center),J(e.center));if(Y(s,0)&&Y(t.radius,e.radius))return e;return le(ct(J(t.center),t.radius,J(e.center),e.radius),e.center[2])}function ne(t,e){}function re(t,e){}function ie(t,e){}function oe(t,e){if(!at(t.center,e.center))return;const s=i(J(t.center),J(e.center));if(Y(s,0)&&Y(t.radius,e.radius))return t;return le(ct(J(t.center),t.radius,J(e.center),e.radius),t.center[2])}function ce(t,e){}function ue(t,e){}function ae(t,e){const{planeLike:s,getZ:n}=t,r=new Array;if(me(e))t.addIfOnTheGround(r,ut(s,e.point));else if(_e(e))t.addIfOnTheGround(r,st(s,e.lineLike));else if(xe(e))for(const[i,o]of ot(s,e.center,e.radius)){const t=n(i,o);null!=t&&r.push(z(i,o,t))}else if(ke(e)||Me(e))for(const[i,o]of it(s,e.planeLike)){const t=n(i,o)??qe;r.push(z(i,o,t))}return fe(r)}function he(t){return de(t.map(([t,e])=>{const s=Q(t,e,0),n=Q(t,e,1);return new mt(s,n)}))}function fe(t){return de(t.map(t=>t?new dt(N(t)):void 0))}function le(t,e){return fe(t.map(([t,s])=>[t,s,e]))}function de(e){if(0!==e.length)return 1===e.length?e[0]??void 0:new gt(e.filter(t))}function pe(t){return t instanceof gt}function me(t){return t instanceof dt}function _e(t){return t instanceof pt}function ge(t){return t instanceof Mt}function ke(t){return t instanceof Tt}function xe(t){return t instanceof kt}function Le(t){return t instanceof xt}function ye(t){return t instanceof Lt}function ze(t){return t instanceof Rt}function Me(t){return t instanceof At}function Pe(t){return t instanceof Ut}function Te(t){return t instanceof Zt}const qe=0;export{Lt as CircleConstraint,lt as Constraint,Zt as CoordinateConstraint,At as DrapedLineConstraint,Ut as GeodesicConstraint,xt as HorizontalCircleConstraint,Mt as HorizontalPlaneConstraint,mt as LineConstraint,pt as LineLikeConstraint,dt as PointConstraint,_t as RayConstraint,gt as SetConstraint,Rt as SphereConstraint,kt as VerticalCylinderConstraint,Dt as VerticalHalfPlaneConstraint,bt as VerticalPlaneConstraint,Tt as VerticalPlaneLikeConstraint,de as constraintOrSet,me as isPoint};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{i as r}from"../../../../../chunks/vec32.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{h as e,a as o,j as t}from"../../../../../chunks/boundedPlane.js";function a(s,o){return e(o.extent,c),t(c,r(n,s.x,s.y,0))}const c=o(),n=s();export{a as distanceToTile};
5
+ import{i as r}from"../../../../../chunks/vec32.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{h as e,c as o,j as t}from"../../../../../chunks/boundedPlane.js";function c(s,o){return e(o.extent,a),t(a,r(n,s.x,s.y,0))}const a=o(),n=s();export{c as distanceToTile};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{f as s,j as n}from"../../../../../chunks/vec32.js";import{create as i,clone as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as c,fromPoints as d,projectPoint as a}from"../../../../../geometry/support/lineSegment.js";import{a as p,A as m}from"../../../../../chunks/sphere.js";import{Octree as u}from"../../../../3d/webgl-engine/lib/Octree.js";import{extractComponentsEdgeLocationsLayout as h}from"../../../../3d/webgl-engine/lib/edgeRendering/edgeProcessing.js";import{maxCandidateCount as g,boundsFromEdge as l}from"./sceneLayerSnappingUtils.js";let f=class{constructor(){this._idToComponent=new Map,this._components=new u(e=>e.bounds),this._edges=new u(e=>e.bounds),this._tmpLineSegment=c(),this._tmpP1=i(),this._tmpP2=i(),this._tmpP3=i(),this.remoteClient=null}async fetchCandidates(e,o){await Promise.resolve(),t(o),await this._ensureEdgeLocations(e,o);const s=[];return this._edges.forEachNeighbor(t=>(this._addCandidates(e,t,s),s.length<g),e.bounds),{result:{candidates:s}}}async _ensureEdgeLocations(e,t){const o=[];if(this._components.forEachNeighbor(e=>{if(null==e.info){const{id:t,uid:s}=e;o.push({id:t,uid:s})}return!0},e.bounds),!o.length)return;const s={components:o},n=await this.remoteClient.invoke("fetchAllEdgeLocations",s,t??{});for(const i of n.components)this._setFetchEdgeLocations(i)}async add(e){const t=new j(e.id,e.bounds);return this._idToComponent.set(t.id,t),this._components.add([t]),{result:{}}}async remove(e){const t=this._idToComponent.get(e.id);if(t){const e=[];this._edges.forEachNeighbor(o=>(o.component===t&&e.push(o),!0),t.bounds),this._edges.remove(e),this._components.remove([t]),this._idToComponent.delete(t.id)}return{result:{}}}_setFetchEdgeLocations(e){const t=this._idToComponent.get(e.id);if(null==t||e.uid!==t.uid)return;const o=h.createView(e.locations),s=new Array(o.count),n=i(),r=i();for(let i=0;i<o.count;i++){o.position0.getVec(i,n),o.position1.getVec(i,r);const c=l(n,r,e.origin),d=new w(t,i,c);s[i]=d}this._edges.add(s);const{objectIds:c,origin:d}=e;t.info={locations:o,objectIds:c,origin:d}}_addCandidates(e,t,o){const{info:n}=t.component,{origin:i,objectIds:r}=n,c=n.locations,d=c.position0.getVec(t.index,this._tmpP1),a=c.position1.getVec(t.index,this._tmpP2);s(d,d,i),s(a,a,i);const p=r[c.componentIndex.get(t.index)];this._addEdgeCandidate(e,p,d,a,o),b(e,p,d,o),b(e,p,a,o)}_addEdgeCandidate(e,t,o,s,i){if(!e.returnEdge)return;const c=p(e.bounds),u=d(o,s,this._tmpLineSegment),h=a(u,c,this._tmpP3);m(e.bounds,h)&&i.push({type:"edge",objectId:t,target:r(h),distance:n(c,h),start:r(o),end:r(s)})}};f=e([o("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],f);const _=f;function b(e,t,o,s){if(!e.returnVertex||!m(e.bounds,o))return;const i=p(e.bounds);s.push({type:"vertex",objectId:t,target:r(o),distance:n(i,o)})}class j{constructor(e,t){this.id=e,this.bounds=t,this.info=null,this.uid=++j.uid}static{this.uid=0}}class w{constructor(e,t,o){this.component=e,this.index=t,this.bounds=o}}export{_ as default};
5
+ import{__decorate as e}from"tslib";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{f as s,j as n}from"../../../../../chunks/vec32.js";import{create as i,clone as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as c,fromPoints as d,projectPoint as a}from"../../../../../geometry/support/lineSegment.js";import{k as p,B as m,a as u}from"../../../../../chunks/sphere.js";import{Octree as h}from"../../../../3d/webgl-engine/lib/Octree.js";import{extractComponentsEdgeLocationsLayout as g}from"../../../../3d/webgl-engine/lib/edgeRendering/edgeProcessing.js";import{maxCandidateCount as l,boundsFromEdge as f}from"./sceneLayerSnappingUtils.js";let _=class{constructor(){this._idToComponent=new Map,this._components=new h(e=>e.bounds),this._edges=new h(e=>e.bounds),this._tmpLineSegment=c(),this._tmpP1=i(),this._tmpP2=i(),this._tmpP3=i(),this.remoteClient=null}async fetchCandidates(e,o){await Promise.resolve(),t(o),await this._ensureEdgeLocations(e,o);const s=[];return this._edges.forEachNeighbor(t=>(this._addCandidates(e,t,s),s.length<l),e.bounds),{result:{candidates:s}}}async _ensureEdgeLocations(e,t){const o=[];if(this._components.forEachNeighbor(e=>{if(null==e.info){const{id:t,uid:s}=e;o.push({id:t,uid:s})}return!0},e.bounds),!o.length)return;const s={components:o},n=await this.remoteClient.invoke("fetchAllEdgeLocations",s,t??{});for(const i of n.components)this._setFetchEdgeLocations(i)}async add(e){const t=new w(e.id,e.bounds);return this._idToComponent.set(t.id,t),this._components.add([t]),{result:{}}}async remove(e){const t=this._idToComponent.get(e.id);if(t){const e=[];this._edges.forEachNeighbor(o=>(o.component===t&&e.push(o),!0),t.bounds),this._edges.remove(e),this._components.remove([t]),this._idToComponent.delete(t.id)}return{result:{}}}_setFetchEdgeLocations(e){const t=this._idToComponent.get(e.id);if(null==t||e.uid!==t.uid)return;const o=g.createView(e.locations),s=new Array(o.count),n=i(),r=i();for(let i=0;i<o.count;i++){o.position0.getVec(i,n),o.position1.getVec(i,r);const c=f(n,r,e.origin),d=new C(t,i,c);s[i]=d}this._edges.add(s);const{objectIds:c,origin:d}=e;t.info={locations:o,objectIds:c,origin:d}}_addCandidates(e,t,o){const{info:n}=t.component,{origin:i,objectIds:r}=n,c=n.locations,d=c.position0.getVec(t.index,this._tmpP1),a=c.position1.getVec(t.index,this._tmpP2);s(d,d,i),s(a,a,i);const p=r[c.componentIndex.get(t.index)];this._addEdgeCandidate(e,p,d,a,o),j(e,p,d,o),j(e,p,a,o)}_addEdgeCandidate(e,t,o,s,i){if(!e.returnEdge)return;const c=p(e.bounds,E),u=d(o,s,this._tmpLineSegment),h=a(u,c,this._tmpP3);m(e.bounds,h)&&i.push({type:"edge",objectId:t,target:r(h),distance:n(c,h),start:r(o),end:r(s)})}};_=e([o("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],_);const b=_;function j(e,t,o,s){e.returnVertex&&m(e.bounds,o)&&s.push({type:"vertex",objectId:t,target:r(o),distance:n(u(e.bounds),o)})}class w{constructor(e,t){this.id=e,this.bounds=t,this.info=null,this.uid=++w.uid}static{this.uid=0}}class C{constructor(e,t,o){this.component=e,this.index=t,this.bounds=o}}const E=i();export{b as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{g as s,b as o,j as r,f as t}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{r as e}from"../../../../../chunks/sphere.js";const n=1e3;function a(c,n,a){const i=f;s(i,c,.5),o(i,i,n,.5);const m=r(i,c);return t(i,i,a),e(i,m)}const f=c();export{a as boundsFromEdge,n as maxCandidateCount};
5
+ import{g as s,b as o,j as r,f as t}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{u as e}from"../../../../../chunks/sphere.js";const n=1e3;function a(c,n,a){const i=f;s(i,c,.5),o(i,i,n,.5);const m=r(i,c);return t(i,i,a),e(i,m)}const f=c();export{a as boundsFromEdge,n as maxCandidateCount};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{watch as r,on as l,syncAndInitial as s}from"../../core/reactiveUtils.js";import{sqlOr as o,sqlIn as n,sqlAnd as a}from"../../core/sql.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{getGraphicOriginLayer as p}from"../../graphic/graphicOriginUtils.js";import{getFeatureIdInfoFieldNames as f}from"../../layers/graphics/data/FeatureIdInfo.js";import{systemIsSpatialFieldName as y}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as h}from"../../layers/support/displayFilterUtils.js";import m from"../../layers/support/FeatureEffect.js";import c from"../../layers/support/FeatureFilter.js";import{getSignedInUser as F}from"../../layers/support/featureLayerUtils.js";import{fetchFeaturePopupFeatures as g,loadFeaturePopupArcadeModules as I}from"../../layers/support/featurePopupQueryUtils.js";import{fixFields as b,unpackFieldNames as w,collectLabelingFields as v,collectElevationFields as E,collectFilterFields as x,collectFeatureReductionFields as q,collectOrderByInfos as R,collectFields as j,collectTrackInfoFields as C,collectDisplayFilterFields as _,collectField as O,featureHasFields as k}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as U}from"../../layers/support/floorFilterUtils.js";import{getUtilityNetworkFields as P}from"../../networks/support/networkFieldUtils.js";import T from"../../rest/support/Query.js";import{createFeatureIdInfo as L}from"../2d/layers/features/layerAdapters/featureServiceUtils.js";import{getRequiredFields as S,getFetchPopupTemplate as D}from"./support/popupUtils.js";import{WhereClauseVisitor as N}from"./support/WhereClauseVisitor.js";const Q=Q=>{const G=Q;let A=class extends G{constructor(...e){super(...e),this._updatingRequiredPromise=null,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([r(()=>{const e=this.layer,t=this.view;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,t?.requiredFieldsOptions?.featureTitleFields&&e&&"featureTitleFields"in e&&e.featureTitleFields,t?.requiredFieldsOptions?.utilityNetworkFields&&P(t,e),e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode,"parquet"===e?.type&&e.popupTemplate]},()=>this._handleChange(),s),l(()=>this.view?.floors,"change",()=>this._handleChange()),l(()=>this.layer.displayFilterInfo?.filters,"change",()=>this._handleChange()),l(()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null,"change",()=>this._handleChange())])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:i}=this;return"outFields"in e&&e.outFields?b(t,[...w(t,e.outFields),...i]):b(t,i)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return this.displayFilterEnabled&&e.displayFilterInfo?h(e.displayFilterInfo,this.view):null}get effectiveDisplayFilterClause(){const e=this.effectiveDisplayFilter?.where??null;return e&&this.hasHighlight?o(e,n(this.layer.objectIdField,this.highlightIds)):e}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?F(this.layer.url):Promise.resolve(null)}highlight(e,t){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new T(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=a(t.where,U(this))),this.displayFilterEnabled&&(t.where=a(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new T(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(e,t){const i=await this._createPopupQuery(e.map(e=>p(e.origin)??e.layer),t);return await g(this.layer,e,i,{getPopupTemplate:e=>D(e,{...t,checkPopupEnabled:!0}),hasRequiredFields:(e,t)=>this._popupFeatureHasRequiredFields(e,t),...t})}_handleChange(){const e=Promise.all([this._updateRequiredFields(),this._updateClientWhereClauseRequirements()]).then(()=>{});return this._set("_updatingRequiredPromise",e),e.then(()=>{this._updatingRequiredPromise===e&&this._set("_updatingRequiredPromise",null)}),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,i=new N(e.fieldsIndex);if(i.visitFilter(this.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&i.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&i.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(i.visitFilter(this.featureEffect?.filter),i.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction)),"subtype-group"===e.type)for(const t of e.sublayers)i.visitLabelingInfo(t.labelsVisible,t.labelingInfo);try{const e=await i.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(r){t.getLogger(this).error(r)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:i,layer:{fieldsIndex:r}}=this,l="renderer"in i&&i.renderer,s="orderBy"in i&&i.orderBy,o="featureReduction"in i?i.featureReduction:null,n=new Set,a=[l?l.collectRequiredFields(n,r):null,v(n,i),e&&"elevationInfo"in i?E(n,i):null,null!=this.filter?x(n,i,this.filter):null,e||null==this.featureEffect?null:x(n,i,this.featureEffect.filter),!e&&o?q(n,i,o):null,!e&&s?R(n,i,s):null];if("timeInfo"in i&&i.timeInfo&&this.timeExtent&&j(n,i.fieldsIndex,[i.timeInfo.startField,i.timeInfo.endField]),"timeInfo"in i&&i.timeInfo&&"trackInfo"in i&&i.trackInfo){const{trackInfo:e}=i;j(n,i.fieldsIndex,[i.timeInfo.trackIdField]),"feature"!==i.type&&"startTimeField"!==e.timeField||j(n,i.fieldsIndex,[i.timeInfo.startField]),"endTimeField"===e.timeField&&j(n,i.fieldsIndex,[i.timeInfo.endField]),await C(n,i)}if("floorInfo"in i&&i.floorInfo&&j(n,i.fieldsIndex,[i.floorInfo.floorField]),"featureTitleFields"in i&&this.view?.requiredFieldsOptions?.featureTitleFields&&i.featureTitleFields&&j(n,i.fieldsIndex,i.featureTitleFields),"feature"===i.type&&i.globalIdField&&this.view?.requiredFieldsOptions?.globalIdField&&j(n,i.fieldsIndex,[i.globalIdField]),this.displayFilterEnabled&&a.push(_(n,i,i.displayFilterInfo)),"feature"===i.type&&e&&null!=i.infoFor3D&&(null==i.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),j(n,i.fieldsIndex,[i.globalIdField])),"subtype-group"===i.type){O(n,r,i.subtypeField);const e=i.sublayers.map(e=>Promise.all([e.renderer?.collectRequiredFields(n,r),v(n,e)]));a.push(Promise.all(e))}if("catalog-footprint"===i.type&&i.parent){const e=i.parent;j(n,r,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===i.type&&"link-chart"===i.parentCompositeLayer.type&&O(n,r,y),"parquet"===i.type&&a.push(S(i,i.popupTemplate).then(e=>{for(const t of e)n.add(t)}));const u=await Promise.allSettled(a);if(e)O(n,r,i.objectIdField);else for(const t of f(L(i)))O(n,r,t);e&&"displayField"in i&&i.displayField&&O(n,r,i.displayField);for(const p of u)"rejected"===p.status&&t.getLogger(this).error(p.reason);const d=Array.from(n).sort();this._set("requiredFields",d)}_popupFeatureHasRequiredFields(e,t){return k(e,t)}async _createPopupQuery(e,t){const r=this.layer.createQuery(),l=new Set;let s=!1;const o=e??[this.layer];for(const n of o){const e=D(n,t);if(null==e)continue;const r=await I(e);i(t);const o=r&&r.arcadeUtils.hasGeometryOperations(e);s=!("point"!==this.layer.geometryType&&!o);const a=await S(this.layer,e);i(t);for(const t of a)l.add(t)}return r.returnGeometry=s,r.returnZ=s,r.returnM=s,r.outFields=Array.from(l),r.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo&&(r.where=a(r.where,U(this))),r}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};return e([u()],A.prototype,"_updatingRequiredPromise",void 0),e([u({readOnly:!0})],A.prototype,"availableFields",null),e([u({readOnly:!0})],A.prototype,"displayFilterEnabled",null),e([u({readOnly:!0})],A.prototype,"effectiveDisplayFilter",null),e([u({readOnly:!0})],A.prototype,"effectiveDisplayFilterClause",null),e([u({type:m})],A.prototype,"featureEffect",null),e([u({type:c})],A.prototype,"filter",void 0),e([u()],A.prototype,"layer",void 0),e([u({type:Number})],A.prototype,"maximumNumberOfFeatures",null),e([u({readOnly:!0,type:Boolean})],A.prototype,"maximumNumberOfFeaturesExceeded",null),e([u()],A.prototype,"requiresCurrentUser",void 0),e([u({readOnly:!0})],A.prototype,"requiredFields",void 0),e([u({readOnly:!0})],A.prototype,"signedInUser",null),e([u()],A.prototype,"suspended",void 0),e([u()],A.prototype,"view",void 0),A=e([d("esri.views.layers.FeatureLayerView")],A),A};export{Q as FeatureLayerView};
5
+ import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{watch as r,on as l,syncAndInitial as s}from"../../core/reactiveUtils.js";import{sqlOr as o,sqlIn as n,sqlAnd as a}from"../../core/sql.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{getGraphicOriginLayer as p}from"../../graphic/graphicOriginUtils.js";import{getFeatureIdInfoFieldNames as f}from"../../layers/graphics/data/FeatureIdInfo.js";import{systemIsSpatialFieldName as y}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as h}from"../../layers/support/displayFilterUtils.js";import m from"../../layers/support/FeatureEffect.js";import c from"../../layers/support/FeatureFilter.js";import{getSignedInUser as F}from"../../layers/support/featureLayerUtils.js";import{fetchFeaturePopupFeatures as g,loadFeaturePopupArcadeModules as I}from"../../layers/support/featurePopupQueryUtils.js";import{fixFields as b,unpackFieldNames as w,collectLabelingFields as v,collectElevationFields as E,collectFilterFields as x,collectFeatureReductionFields as q,collectOrderByInfos as R,collectFields as j,collectTrackInfoFields as C,collectDisplayFilterFields as _,collectField as O,featureHasFields as k}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as U}from"../../layers/support/floorFilterUtils.js";import{getUtilityNetworkFields as P}from"../../networks/support/networkFieldUtils.js";import L from"../../rest/support/Query.js";import{createFeatureIdInfo as T}from"../2d/layers/features/layerAdapters/featureServiceUtils.js";import{getFetchPopupTemplate as S,getRequiredFields as D}from"./support/popupUtils.js";import{WhereClauseVisitor as N}from"./support/WhereClauseVisitor.js";const Q=Q=>{const G=Q;let A=class extends G{constructor(...e){super(...e),this._updatingRequiredPromise=null,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([r(()=>{const e=this.layer,t=this.view;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,t?.requiredFieldsOptions?.featureTitleFields&&e&&"featureTitleFields"in e&&e.featureTitleFields,t?.requiredFieldsOptions?.utilityNetworkFields&&P(t,e),e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode]},()=>this._handleChange(),s),l(()=>this.view?.floors,"change",()=>this._handleChange()),l(()=>this.layer.displayFilterInfo?.filters,"change",()=>this._handleChange()),l(()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null,"change",()=>this._handleChange())])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:i}=this;return"outFields"in e&&e.outFields?b(t,[...w(t,e.outFields),...i]):b(t,i)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return this.displayFilterEnabled&&e.displayFilterInfo?h(e.displayFilterInfo,this.view):null}get effectiveDisplayFilterClause(){const e=this.effectiveDisplayFilter?.where??null;return e&&this.hasHighlight?o(e,n(this.layer.objectIdField,this.highlightIds)):e}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?F(this.layer.url):Promise.resolve(null)}highlight(e,t){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new L(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=a(t.where,U(this))),this.displayFilterEnabled&&(t.where=a(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new L(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(e,t){const i=await this._createPopupQuery(e.map(e=>p(e.origin)??e.layer),t);return await g(this.layer,e,i,{getPopupTemplate:e=>S(e,{...t,checkPopupEnabled:!0}),hasRequiredFields:(e,t)=>this._popupFeatureHasRequiredFields(e,t),...t})}_handleChange(){const e=Promise.all([this._updateRequiredFields(),this._updateClientWhereClauseRequirements()]).then(()=>{});return this._set("_updatingRequiredPromise",e),e.then(()=>{this._updatingRequiredPromise===e&&this._set("_updatingRequiredPromise",null)}),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,i=new N(e.fieldsIndex);if(i.visitFilter(this.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&i.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&i.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(i.visitFilter(this.featureEffect?.filter),i.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction)),"subtype-group"===e.type)for(const t of e.sublayers)i.visitLabelingInfo(t.labelsVisible,t.labelingInfo);try{const e=await i.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(r){t.getLogger(this).error(r)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:i,layer:{fieldsIndex:r}}=this,l="renderer"in i&&i.renderer,s="orderBy"in i&&i.orderBy,o="featureReduction"in i?i.featureReduction:null,n=new Set,a=[l?l.collectRequiredFields(n,r):null,v(n,i),e&&"elevationInfo"in i?E(n,i):null,null!=this.filter?x(n,i,this.filter):null,e||null==this.featureEffect?null:x(n,i,this.featureEffect.filter),!e&&o?q(n,i,o):null,!e&&s?R(n,i,s):null];if("timeInfo"in i&&i.timeInfo&&this.timeExtent&&j(n,i.fieldsIndex,[i.timeInfo.startField,i.timeInfo.endField]),"timeInfo"in i&&i.timeInfo&&"trackInfo"in i&&i.trackInfo){const{trackInfo:e}=i;j(n,i.fieldsIndex,[i.timeInfo.trackIdField]),"feature"!==i.type&&"startTimeField"!==e.timeField||j(n,i.fieldsIndex,[i.timeInfo.startField]),"endTimeField"===e.timeField&&j(n,i.fieldsIndex,[i.timeInfo.endField]),await C(n,i)}if("floorInfo"in i&&i.floorInfo&&j(n,i.fieldsIndex,[i.floorInfo.floorField]),"featureTitleFields"in i&&this.view?.requiredFieldsOptions?.featureTitleFields&&i.featureTitleFields&&j(n,i.fieldsIndex,i.featureTitleFields),"feature"===i.type&&i.globalIdField&&this.view?.requiredFieldsOptions?.globalIdField&&j(n,i.fieldsIndex,[i.globalIdField]),this.displayFilterEnabled&&a.push(_(n,i,i.displayFilterInfo)),"feature"===i.type&&e&&null!=i.infoFor3D&&(null==i.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),j(n,i.fieldsIndex,[i.globalIdField])),"subtype-group"===i.type){O(n,r,i.subtypeField);const e=i.sublayers.map(e=>Promise.all([e.renderer?.collectRequiredFields(n,r),v(n,e)]));a.push(Promise.all(e))}if("catalog-footprint"===i.type&&i.parent){const e=i.parent;j(n,r,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===i.type&&"link-chart"===i.parentCompositeLayer.type&&O(n,r,y);const u=await Promise.allSettled(a);if(e)O(n,r,i.objectIdField);else for(const t of f(T(i)))O(n,r,t);e&&"displayField"in i&&i.displayField&&O(n,r,i.displayField);for(const p of u)"rejected"===p.status&&t.getLogger(this).error(p.reason);const d=Array.from(n).sort();this._set("requiredFields",d)}_popupFeatureHasRequiredFields(e,t){return k(e,t)}async _createPopupQuery(e,t){const r=this.layer.createQuery(),l=new Set;let s=!1;const o=e??[this.layer];for(const n of o){const e=S(n,t);if(null==e)continue;const r=await I(e);i(t);const o=r&&r.arcadeUtils.hasGeometryOperations(e);s=!("point"!==this.layer.geometryType&&!o);const a=await D(this.layer,e);i(t);for(const t of a)l.add(t)}return r.returnGeometry=s,r.returnZ=s,r.returnM=s,r.outFields=Array.from(l),r.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo&&(r.where=a(r.where,U(this))),r}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};return e([u()],A.prototype,"_updatingRequiredPromise",void 0),e([u({readOnly:!0})],A.prototype,"availableFields",null),e([u({readOnly:!0})],A.prototype,"displayFilterEnabled",null),e([u({readOnly:!0})],A.prototype,"effectiveDisplayFilter",null),e([u({readOnly:!0})],A.prototype,"effectiveDisplayFilterClause",null),e([u({type:m})],A.prototype,"featureEffect",null),e([u({type:c})],A.prototype,"filter",void 0),e([u()],A.prototype,"layer",void 0),e([u({type:Number})],A.prototype,"maximumNumberOfFeatures",null),e([u({readOnly:!0,type:Boolean})],A.prototype,"maximumNumberOfFeaturesExceeded",null),e([u()],A.prototype,"requiresCurrentUser",void 0),e([u({readOnly:!0})],A.prototype,"requiredFields",void 0),e([u({readOnly:!0})],A.prototype,"signedInUser",null),e([u()],A.prototype,"suspended",void 0),e([u()],A.prototype,"view",void 0),A=e([d("esri.views.layers.FeatureLayerView")],A),A};export{Q as FeatureLayerView};