@arcgis/core 5.0.0-next.54 → 5.0.0-next.56

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 (530) hide show
  1. package/Color.d.ts +12 -4
  2. package/Ground.d.ts +4 -6
  3. package/Ground.js +1 -1
  4. package/WebScene.js +1 -1
  5. package/applications/Components/SelectionOperation.d.ts +5 -0
  6. package/applications/Components/SketchTooltipControls.d.ts +5 -0
  7. package/applications/Components/actionUtils.d.ts +5 -0
  8. package/applications/Components/analysisUtils.d.ts +5 -0
  9. package/applications/Components/arcadeEditorUtils.d.ts +5 -0
  10. package/applications/Components/arcadeFeatureUtils.d.ts +5 -0
  11. package/applications/Components/basemapUtils.d.ts +5 -0
  12. package/applications/Components/drawUtils.d.ts +13 -1
  13. package/applications/Components/featureUtils.d.ts +5 -0
  14. package/applications/Components/fontUtils.d.ts +5 -0
  15. package/applications/Components/formatUtils.d.ts +5 -0
  16. package/applications/Components/getDefaultUnits.d.ts +5 -0
  17. package/applications/Components/gfxUtils.d.ts +5 -0
  18. package/applications/Components/imageryUtils.d.ts +5 -0
  19. package/applications/Components/layerOriginUtils.d.ts +5 -0
  20. package/applications/Components/layersEffectsJsonUtils.d.ts +5 -0
  21. package/applications/Components/previewSymbol2D.d.ts +5 -0
  22. package/applications/Components/reactiveUtils.d.ts +6 -0
  23. package/applications/Components/sanitizerUtils.d.ts +5 -0
  24. package/applications/Components/stringUtils.d.ts +6 -2
  25. package/applications/Components/styleUtils.d.ts +5 -0
  26. package/applications/Components/svgUtils.d.ts +5 -0
  27. package/applications/Components/testUtils.d.ts +5 -0
  28. package/applications/Components/viewUtils.d.ts +5 -0
  29. package/applications/Components/webStyleSymbolUtils.d.ts +5 -0
  30. package/applications/Excalibur/videoViewUtils.d.ts +5 -0
  31. package/applications/ExperienceBuilder/sketchUtils.d.ts +5 -0
  32. package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +10 -0
  33. package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +10 -0
  34. package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +11 -1
  35. package/applications/KnowledgeStudio/reshape.d.ts +5 -0
  36. package/applications/KnowledgeStudio/resourceSerializationUtils.d.ts +5 -0
  37. package/applications/MapViewer/layerUtils.d.ts +5 -0
  38. package/applications/MapViewer/mediaUtils.d.ts +5 -0
  39. package/applications/MapViewer/templateUtils.d.ts +5 -0
  40. package/applications/PortalApp/layerUtils.d.ts +5 -0
  41. package/applications/SceneViewer/colorUtils.d.ts +5 -0
  42. package/applications/SceneViewer/devEnvironmentUtils.d.ts +5 -0
  43. package/applications/SceneViewer/layerUtils.d.ts +5 -0
  44. package/applications/SceneViewer/sceneViewerUtils.d.ts +6 -2
  45. package/applications/SceneViewer/symbolUtils.d.ts +5 -0
  46. package/applications/Urban/meshUtils.d.ts +5 -0
  47. package/applications/WebEditor/sketchUtils.d.ts +5 -0
  48. package/arcade.d.ts +22 -0
  49. package/assets/esri/core/workers/RemoteClient.js +1 -1
  50. package/assets/esri/core/workers/chunks/{308fb48d080e01499a26.js → 436f206898306df019ac.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{f2e8abb556a380cc2941.js → 492d575894c7905bb70c.js} +1 -1
  52. package/assets/esri/core/workers/chunks/5340887a4a48bde3407a.js +1 -0
  53. package/assets/esri/core/workers/chunks/5873c7b65d0fb04998fb.js +1 -0
  54. package/assets/esri/core/workers/chunks/82ced9254b27707522ef.js +1 -0
  55. package/assets/esri/core/workers/chunks/8628bf45a33af786cd49.js +1 -0
  56. package/assets/esri/core/workers/chunks/{d63cf90d1356d1f10138.js → 8f4c480c418eba299c2b.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{fa92a7c11befbad8739f.js → b4f944ef6c174b20b619.js} +1 -1
  58. package/assets/esri/core/workers/chunks/c531c0e3d420a1be0ad2.js +316 -0
  59. package/assets/esri/core/workers/chunks/d9736c783513e9c9b22f.js +1 -0
  60. package/assets/esri/core/workers/chunks/{18cc131fd63d8c15df54.js → da2c41ac0f82f32013c1.js} +8 -8
  61. package/assets/esri/core/workers/chunks/{cc67f066c3c0c2a1a37c.js → dd99b77a7c0a052507bb.js} +1 -1
  62. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  63. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  64. package/chunks/ChapmanAtmosphere.glsl.js +10 -9
  65. package/chunks/GlowComposition.glsl.js +1 -1
  66. package/chunks/HUDMaterial.glsl.js +1 -1
  67. package/chunks/Haze.glsl.js +4 -4
  68. package/chunks/LineCallout.glsl.js +2 -2
  69. package/chunks/Precipitation.glsl.js +1 -1
  70. package/chunks/RasterColorizer.glsl.js +10 -10
  71. package/chunks/Terrain.glsl.js +1 -1
  72. package/chunks/Viewshed.glsl.js +1 -1
  73. package/chunks/lyr3DMain.js +1 -1
  74. package/chunks/vec32.js +1 -1
  75. package/config.d.ts +19 -1
  76. package/config.js +1 -1
  77. package/core/Error.d.ts +3 -4
  78. package/core/Error.js +1 -1
  79. package/core/Warning.js +1 -1
  80. package/core/accessorSupport/decorators.d.ts +11 -0
  81. package/core/accessorSupport/types.d.ts +2 -0
  82. package/core/has.js +1 -1
  83. package/core/lang.d.ts +6 -0
  84. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  85. package/core/libs/gl-matrix-2/vec3.js +1 -1
  86. package/core/promiseUtils.d.ts +5 -0
  87. package/core/quantity.d.ts +5 -0
  88. package/core/reactiveUtils.d.ts +142 -0
  89. package/core/scheduling.d.ts +26 -5
  90. package/core/scheduling.js +1 -1
  91. package/core/sql/WhereClause.d.ts +2 -13
  92. package/core/sql/{WhereGrammar.d.ts → types.d.ts} +22 -1
  93. package/core/sql.d.ts +8 -0
  94. package/core/string.js +1 -1
  95. package/core/types.d.ts +30 -1
  96. package/core/units.d.ts +8 -0
  97. package/core/urlUtils.d.ts +7 -0
  98. package/core/workers/loaderConfig.js +1 -1
  99. package/core/workers/workerFactory.js +1 -1
  100. package/core/workers.d.ts +26 -0
  101. package/form/elements/inputs.d.ts +55 -0
  102. package/form/elements.d.ts +43 -0
  103. package/geometry/coordinateFormatter.d.ts +33 -0
  104. package/geometry/geometryEngine.d.ts +16 -0
  105. package/geometry/operators/affineTransformOperator.d.ts +5 -0
  106. package/geometry/operators/alphaShapeOperator.d.ts +9 -0
  107. package/geometry/operators/areaOperator.d.ts +7 -0
  108. package/geometry/operators/autoCompleteOperator.d.ts +5 -0
  109. package/geometry/operators/boundaryOperator.d.ts +5 -0
  110. package/geometry/operators/bufferOperator.d.ts +11 -0
  111. package/geometry/operators/centroidOperator.d.ts +14 -0
  112. package/geometry/operators/clipOperator.d.ts +7 -0
  113. package/geometry/operators/containsOperator.d.ts +9 -0
  114. package/geometry/operators/convexHullOperator.d.ts +9 -0
  115. package/geometry/operators/crossesOperator.d.ts +7 -0
  116. package/geometry/operators/cutOperator.d.ts +18 -0
  117. package/geometry/operators/densifyOperator.d.ts +21 -0
  118. package/geometry/operators/differenceOperator.d.ts +7 -0
  119. package/geometry/operators/disjointOperator.d.ts +8 -0
  120. package/geometry/operators/distanceOperator.d.ts +8 -0
  121. package/geometry/operators/equalsOperator.d.ts +5 -0
  122. package/geometry/operators/extendOperator.d.ts +8 -0
  123. package/geometry/operators/generalizeOperator.d.ts +7 -0
  124. package/geometry/operators/geodesicBufferOperator.d.ts +13 -0
  125. package/geometry/operators/geodesicProximityOperator.d.ts +13 -0
  126. package/geometry/operators/geodeticAreaOperator.d.ts +11 -0
  127. package/geometry/operators/geodeticDensifyOperator.d.ts +12 -0
  128. package/geometry/operators/geodeticDistanceOperator.d.ts +14 -0
  129. package/geometry/operators/geodeticLengthOperator.d.ts +11 -0
  130. package/geometry/operators/geodeticUtilsOperator.d.ts +11 -0
  131. package/geometry/operators/graphicBufferOperator.d.ts +7 -0
  132. package/geometry/operators/integrateOperator.d.ts +9 -0
  133. package/geometry/operators/intersectionOperator.d.ts +7 -0
  134. package/geometry/operators/intersectsOperator.d.ts +9 -0
  135. package/geometry/operators/isNearOperator.d.ts +7 -0
  136. package/geometry/operators/labelPointOperator.d.ts +14 -0
  137. package/geometry/operators/lengthOperator.d.ts +7 -0
  138. package/geometry/operators/linesToPolygonsOperator.d.ts +5 -0
  139. package/geometry/operators/locateBetweenOperator.d.ts +10 -0
  140. package/geometry/operators/minimumBoundingCircleOperator.d.ts +13 -0
  141. package/geometry/operators/multiPartToSinglePartOperator.d.ts +7 -0
  142. package/geometry/operators/offsetOperator.d.ts +44 -0
  143. package/geometry/operators/overlapsOperator.d.ts +7 -0
  144. package/geometry/operators/polygonOverlayOperator.d.ts +6 -0
  145. package/geometry/operators/polygonSlicerOperator.d.ts +5 -0
  146. package/geometry/operators/projectOperator.d.ts +41 -0
  147. package/geometry/operators/proximityOperator.d.ts +8 -0
  148. package/geometry/operators/relateOperator.d.ts +7 -0
  149. package/geometry/operators/reshapeOperator.d.ts +5 -0
  150. package/geometry/operators/shapePreservingProjectOperator.d.ts +27 -0
  151. package/geometry/operators/simplifyOGCOperator.d.ts +8 -0
  152. package/geometry/operators/simplifyOperator.d.ts +9 -0
  153. package/geometry/operators/support/geographicTransformationUtils.d.ts +11 -0
  154. package/geometry/operators/symmetricDifferenceOperator.d.ts +12 -0
  155. package/geometry/operators/touchesOperator.d.ts +7 -0
  156. package/geometry/operators/unionOperator.d.ts +7 -0
  157. package/geometry/operators/withinOperator.d.ts +9 -0
  158. package/geometry/projection/projectPointToVector.js +1 -1
  159. package/geometry/support/geodesicUtils.d.ts +8 -0
  160. package/geometry/support/jsonUtils.d.ts +7 -0
  161. package/geometry/support/meshUtils.d.ts +5 -0
  162. package/geometry/support/normalizeUtils.d.ts +7 -0
  163. package/geometry/support/webMercatorUtils.d.ts +12 -0
  164. package/geometry/types.d.ts +10 -1
  165. package/geometry.d.ts +38 -0
  166. package/interfaces.d.ts +52 -58
  167. package/intl.d.ts +111 -0
  168. package/kernel.d.ts +5 -0
  169. package/kernel.js +1 -1
  170. package/layers/BaseDynamicLayer.d.ts +1 -1
  171. package/layers/CSVLayer.d.ts +2 -2
  172. package/layers/CatalogLayer.d.ts +2 -2
  173. package/layers/FeatureLayer.d.ts +8 -4
  174. package/layers/GeoJSONLayer.d.ts +2 -1
  175. package/layers/ILyr3DWasmPerSceneView.js +1 -1
  176. package/layers/Layer.d.ts +1 -1
  177. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  178. package/layers/OGCFeatureLayer.d.ts +1 -1
  179. package/layers/ParquetLayer.d.ts +1 -1
  180. package/layers/RouteLayer.js +1 -1
  181. package/layers/SceneLayer.d.ts +2 -1
  182. package/layers/StreamLayer.d.ts +6 -5
  183. package/layers/SubtypeGroupLayer.d.ts +3 -4
  184. package/layers/VectorTileLayer.d.ts +1 -1
  185. package/layers/WFSLayer.d.ts +2 -1
  186. package/layers/WMSLayer.d.ts +2 -2
  187. package/layers/catalog/catalogUtils.d.ts +6 -0
  188. package/layers/ogc/wcsUtils.d.ts +6 -0
  189. package/layers/ogc/wfsUtils.d.ts +6 -0
  190. package/layers/orientedImagery/transformations/imageToWorld.d.ts +10 -0
  191. package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
  192. package/layers/orientedImagery/transformations/worldToImage.d.ts +10 -0
  193. package/layers/orientedImagery/types.d.ts +1 -1
  194. package/layers/support/SubtypeSublayer.d.ts +13 -0
  195. package/layers/support/arcadeUtils.d.ts +5 -0
  196. package/layers/support/csvUtils.d.ts +6 -0
  197. package/layers/support/fieldUtils.d.ts +9 -0
  198. package/layers/support/parquetUtils.d.ts +6 -0
  199. package/layers/support/rasterFunctionConstants.d.ts +9 -0
  200. package/layers/support/rasterFunctionUtils.d.ts +7 -0
  201. package/package.json +1 -1
  202. package/pointCloudRenderers.d.ts +44 -0
  203. package/popup/content.d.ts +48 -0
  204. package/rasterRenderers.d.ts +46 -0
  205. package/renderers/support/AuthoringInfo.d.ts +1 -1
  206. package/renderers/support/jsonUtils.d.ts +7 -0
  207. package/renderers/support/utils.d.ts +5 -0
  208. package/renderers/visualVariables/SizeVariable.d.ts +0 -3
  209. package/renderers/visualVariables/VisualVariable.d.ts +1 -1
  210. package/renderers/visualVariables/support/VisualVariableLegendOptions.d.ts +1 -1
  211. package/renderers.d.ts +46 -0
  212. package/request.d.ts +17 -0
  213. package/rest/closestFacility.d.ts +21 -0
  214. package/rest/featureService/utils.d.ts +5 -0
  215. package/rest/find.d.ts +21 -0
  216. package/rest/geometryService.d.ts +14 -0
  217. package/rest/geoprocessor.d.ts +16 -0
  218. package/rest/identify.d.ts +19 -0
  219. package/rest/imageService.d.ts +10 -0
  220. package/rest/knowledgeGraphService.d.ts +39 -0
  221. package/rest/lastMileDelivery.d.ts +12 -0
  222. package/rest/locator.d.ts +24 -0
  223. package/rest/networkService.d.ts +5 -0
  224. package/rest/networks/queryAssociations.d.ts +7 -0
  225. package/rest/networks/support/NetworkElement.d.ts +1 -1
  226. package/rest/networks/synthesizeAssociationGeometries.d.ts +7 -0
  227. package/rest/networks/trace.d.ts +6 -0
  228. package/rest/places.d.ts +34 -0
  229. package/rest/print.d.ts +74 -0
  230. package/rest/query.d.ts +33 -0
  231. package/rest/route.d.ts +18 -0
  232. package/rest/serviceArea.d.ts +18 -0
  233. package/rest/support/AreasAndLengthsParameters.d.ts +2 -2
  234. package/rest/support/AttachmentQuery.d.ts +0 -1
  235. package/rest/support/AttributeBinsQuery.d.ts +3 -3
  236. package/rest/support/AutoIntervalBinParameters.d.ts +4 -4
  237. package/rest/support/DateBinParameters.d.ts +2 -2
  238. package/rest/support/DateBinTimeInterval.d.ts +1 -1
  239. package/rest/support/DensifyParameters.d.ts +1 -1
  240. package/rest/support/DirectionsFeature.d.ts +1 -1
  241. package/rest/support/GPMessage.d.ts +1 -1
  242. package/rest/support/LastMileDeliveryParameters.d.ts +1 -1
  243. package/rest/support/QuantizationParameters.d.ts +3 -3
  244. package/rest/support/Query.d.ts +0 -1
  245. package/rest/support/QueryMixin.d.ts +1 -1
  246. package/rest/support/RelationshipQuery.d.ts +0 -1
  247. package/rest/support/interfaces.d.ts +1 -2
  248. package/rest/symbolService.d.ts +9 -0
  249. package/smartMapping/heuristics/binLevel.d.ts +12 -0
  250. package/smartMapping/heuristics/scaleRange.d.ts +15 -0
  251. package/smartMapping/heuristics/sizeRange.d.ts +12 -0
  252. package/smartMapping/labels/bins.d.ts +13 -0
  253. package/smartMapping/labels/clusters.d.ts +17 -1
  254. package/smartMapping/popup/clusters.d.ts +21 -0
  255. package/smartMapping/popup/templates.d.ts +18 -0
  256. package/smartMapping/raster/renderers/classBreaks.d.ts +7 -0
  257. package/smartMapping/raster/renderers/colormap.d.ts +7 -0
  258. package/smartMapping/raster/renderers/flow.d.ts +19 -0
  259. package/smartMapping/raster/renderers/rgb.d.ts +7 -0
  260. package/smartMapping/raster/renderers/shadedRelief.d.ts +7 -0
  261. package/smartMapping/raster/renderers/stretch.d.ts +7 -0
  262. package/smartMapping/raster/renderers/uniqueValue.d.ts +7 -0
  263. package/smartMapping/raster/renderers/vectorField.d.ts +20 -0
  264. package/smartMapping/raster/support/colorRamps.d.ts +7 -0
  265. package/smartMapping/raster/support/utils.d.ts +5 -0
  266. package/smartMapping/renderers/color.d.ts +17 -0
  267. package/smartMapping/renderers/dotDensity.d.ts +21 -0
  268. package/smartMapping/renderers/heatmap.d.ts +17 -0
  269. package/smartMapping/renderers/location.d.ts +10 -0
  270. package/smartMapping/renderers/opacity.d.ts +19 -0
  271. package/smartMapping/renderers/pieChart.d.ts +19 -0
  272. package/smartMapping/renderers/predominance.d.ts +27 -0
  273. package/smartMapping/renderers/relationship.d.ts +48 -0
  274. package/smartMapping/renderers/size.d.ts +18 -0
  275. package/smartMapping/renderers/support/rendererUtils.d.ts +8 -0
  276. package/smartMapping/renderers/support/spikeUtils.d.ts +6 -0
  277. package/smartMapping/renderers/type.d.ts +18 -0
  278. package/smartMapping/renderers/univariateColorSize.d.ts +29 -0
  279. package/smartMapping/statistics/classBreaks.d.ts +14 -0
  280. package/smartMapping/statistics/heatmapStatistics.d.ts +15 -0
  281. package/smartMapping/statistics/histogram.d.ts +17 -0
  282. package/smartMapping/statistics/predominantCategories.d.ts +6 -0
  283. package/smartMapping/statistics/summaryStatistics.d.ts +15 -0
  284. package/smartMapping/statistics/summaryStatisticsForAge.d.ts +8 -1
  285. package/smartMapping/statistics/support/ageUtils.d.ts +8 -0
  286. package/smartMapping/statistics/support/predominanceUtils.d.ts +8 -1
  287. package/smartMapping/statistics/types.d.ts +6 -1
  288. package/smartMapping/statistics/uniqueValues.d.ts +13 -0
  289. package/smartMapping/symbology/color.d.ts +8 -0
  290. package/smartMapping/symbology/dotDensity.d.ts +7 -0
  291. package/smartMapping/symbology/flow.d.ts +8 -0
  292. package/smartMapping/symbology/heatmap.d.ts +8 -0
  293. package/smartMapping/symbology/location.d.ts +8 -0
  294. package/smartMapping/symbology/pieChart.d.ts +7 -0
  295. package/smartMapping/symbology/predominance.d.ts +7 -0
  296. package/smartMapping/symbology/relationship.d.ts +7 -0
  297. package/smartMapping/symbology/size.d.ts +7 -0
  298. package/smartMapping/symbology/support/colorRamps.d.ts +7 -0
  299. package/smartMapping/symbology/type.d.ts +8 -0
  300. package/support/groundUtils.js +1 -1
  301. package/support/popupUtils.d.ts +5 -0
  302. package/support/revision.js +1 -1
  303. package/support/timeUtils.d.ts +9 -0
  304. package/symbols/CIMSymbol.d.ts +1 -1
  305. package/symbols/ExtrudeSymbol3DLayer.d.ts +2 -2
  306. package/symbols/FillSymbol3DLayer.d.ts +1 -1
  307. package/symbols/LineSymbol3DLayer.d.ts +2 -2
  308. package/symbols/ObjectSymbol3DLayer.d.ts +2 -2
  309. package/symbols/PathSymbol3DLayer.d.ts +2 -2
  310. package/symbols/TextSymbol.d.ts +2 -2
  311. package/symbols/support/Symbol3DFillMaterial.d.ts +1 -1
  312. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  313. package/symbols/support/Symbol3DHalo.d.ts +8 -4
  314. package/symbols/support/Symbol3DHalo.js +1 -1
  315. package/symbols/support/cimConversionUtils.d.ts +9 -0
  316. package/symbols/support/cimSymbolUtils.d.ts +10 -0
  317. package/symbols/support/jsonUtils.d.ts +7 -0
  318. package/symbols/support/symbolUtils.d.ts +5 -0
  319. package/symbols.d.ts +59 -0
  320. package/tables/elements.d.ts +41 -0
  321. package/time/TimeExtent.d.ts +1 -1
  322. package/time/TimeInterval.d.ts +1 -1
  323. package/unionTypes.d.ts +5 -0
  324. package/versionManagement/utils.d.ts +5 -0
  325. package/versionManagement/versionAdapters/utils.d.ts +5 -0
  326. package/views/2d/MapViewConstraints.d.ts +18 -10
  327. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  328. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  329. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  330. package/views/2d/layers/RouteLayerView2D.js +1 -1
  331. package/views/2d/layers/TileLayerView2D.js +1 -1
  332. package/views/2d/layers/support/RouteLayerInteraction.js +1 -1
  333. package/views/2d/layers/support/RouteLayerWaypointVisualization.js +5 -0
  334. package/views/2d/layers/types.d.ts +6 -0
  335. package/views/2d/types.d.ts +3 -1
  336. package/views/3d/analysis/DirectLineMeasurement/types.d.ts +5 -0
  337. package/views/3d/analysis/LineOfSight/types.d.ts +5 -0
  338. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementError.d.ts +1 -1
  339. package/views/3d/analysis/VolumeMeasurement/types.d.ts +5 -0
  340. package/views/3d/environment/ChapmanApproximation.glsl.js +9 -10
  341. package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
  342. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  343. package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
  344. package/views/3d/environment/CloudsParameters.js +1 -1
  345. package/views/3d/environment/EnvironmentManager.js +1 -1
  346. package/views/3d/environment/SceneViewEnvironment.d.ts +1 -1
  347. package/views/3d/environment/types.d.ts +13 -0
  348. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  349. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  350. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  351. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  352. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  353. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  354. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  355. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  356. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  357. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  358. package/views/3d/layers/graphics/pipeline/symbolization/IconSymbolLayerRenderer.js +1 -1
  359. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  360. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  361. package/views/3d/terrain/TerrainSurface.js +1 -1
  362. package/views/3d/webgl/ManagedFBO.d.ts +4 -5
  363. package/views/3d/webgl/RenderNode.d.ts +1 -1
  364. package/views/3d/{webgl-engine/lighting/SceneLighting.d.ts → webgl/types.d.ts} +4 -6
  365. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  366. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +2 -2
  367. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +2 -2
  368. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
  369. package/views/3d/webgl-engine/core/shaderLibrary/raster/RasterColorizer.glsl.js +1 -1
  370. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +1 -1
  371. package/views/3d/webgl-engine/core/shaderModules/Float4sPassUniform.js +1 -1
  372. package/views/3d/webgl-engine/core/shaderModules/FloatsPassUniform.js +1 -1
  373. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  374. package/views/3d/webgl-engine/effects/haze/Haze.glsl.js +1 -1
  375. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  376. package/views/3d/webgl-engine/effects/haze/HazeTechnique.js +1 -1
  377. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechnique.js +1 -1
  378. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  379. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  380. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  381. package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
  382. package/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration.js +1 -1
  383. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +8 -8
  384. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +5 -5
  385. package/views/3d/webgl.d.ts +6 -0
  386. package/views/BreakpointsOwner.d.ts +16 -16
  387. package/views/IBreakpointsOwner.d.ts +15 -15
  388. package/views/MapView.d.ts +1 -1
  389. package/views/PopupView.d.ts +2 -2
  390. package/views/SceneView.d.ts +14 -17
  391. package/views/SelectionManager.d.ts +1 -0
  392. package/views/SelectionManager.js +1 -1
  393. package/views/VideoView.d.ts +1 -2
  394. package/views/VideoView.js +1 -1
  395. package/views/View.d.ts +8 -11
  396. package/views/View2D.d.ts +1 -2
  397. package/views/analysis/AreaMeasurement/types.d.ts +6 -0
  398. package/views/analysis/DistanceMeasurement/types.d.ts +5 -0
  399. package/views/analysis/ElevationProfile/ElevationProfileError.d.ts +4 -4
  400. package/views/analysis/ElevationProfile/types.d.ts +6 -0
  401. package/views/analysis/types.d.ts +5 -0
  402. package/views/draw/DrawOperation.js +1 -1
  403. package/views/draw/PolygonDrawAction.d.ts +1 -1
  404. package/views/draw/PolygonDrawAction.js +1 -1
  405. package/views/draw/PolylineDrawAction.d.ts +1 -1
  406. package/views/draw/PolylineDrawAction.js +1 -1
  407. package/views/draw/support/GraphicMover.js +1 -1
  408. package/views/draw/types.d.ts +3 -1
  409. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  410. package/views/interactive/sketch/Units.d.ts +5 -1
  411. package/views/interactive/snapping/GridSnappingEngine.js +1 -1
  412. package/views/layers/BuildingSceneLayerView.d.ts +1 -1
  413. package/views/layers/ImageryLayerViewMixin.d.ts +2 -3
  414. package/views/layers/LayerView.d.ts +1 -1
  415. package/views/layers/support/highlightUtils.js +1 -1
  416. package/views/support/colorUtils.d.ts +5 -0
  417. package/views/support/selectionUtils.js +1 -1
  418. package/views/types.d.ts +69 -1
  419. package/views/ui/types.d.ts +12 -1
  420. package/webscene/Environment.d.ts +2 -2
  421. package/webscene/support/FeatureReference.d.ts +1 -1
  422. package/webscene/types.d.ts +10 -1
  423. package/widgets/BasemapGallery.d.ts +1 -1
  424. package/widgets/BasemapLayerList/BasemapLayerListViewModel.d.ts +1 -1
  425. package/widgets/BasemapLayerList.d.ts +1 -1
  426. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +1 -1
  427. package/widgets/BatchAttributeForm.d.ts +1 -1
  428. package/widgets/Bookmarks.d.ts +1 -2
  429. package/widgets/BuildingExplorer.d.ts +1 -1
  430. package/widgets/CatalogLayerList/CatalogLayerListViewModel.d.ts +1 -1
  431. package/widgets/CatalogLayerList.d.ts +1 -1
  432. package/widgets/Compass.d.ts +1 -1
  433. package/widgets/CoordinateConversion.d.ts +1 -2
  434. package/widgets/Daylight.d.ts +1 -1
  435. package/widgets/DirectionalPad/DirectionalPadViewModel.d.ts +1 -2
  436. package/widgets/DirectionalPad/{utils.d.ts → types.d.ts} +3 -1
  437. package/widgets/Directions.d.ts +1 -2
  438. package/widgets/Editor/EditorViewModel.d.ts +1 -2
  439. package/widgets/Editor/SplitFeatureWorkflow.d.ts +1 -2
  440. package/widgets/Editor/SplitFeatureWorkflowData.d.ts +1 -1
  441. package/widgets/Editor/types.d.ts +8 -1
  442. package/widgets/Editor/workflowUtils.js +1 -1
  443. package/widgets/Editor.d.ts +2 -3
  444. package/widgets/Feature/types.d.ts +5 -1
  445. package/widgets/Feature.d.ts +1 -1
  446. package/widgets/FeatureForm/FeatureFormViewModel.d.ts +2 -2
  447. package/widgets/FeatureForm/FieldInput.d.ts +1 -1
  448. package/widgets/FeatureForm.d.ts +1 -1
  449. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  450. package/widgets/FeatureTemplates.d.ts +1 -1
  451. package/widgets/Features/FeaturesViewModel.d.ts +2 -2
  452. package/widgets/Features.d.ts +1 -2
  453. package/widgets/FloorFilter.d.ts +1 -1
  454. package/widgets/Home/HomeViewModel.d.ts +1 -1
  455. package/widgets/Home.d.ts +1 -1
  456. package/widgets/LayerList/ListItemPanel.d.ts +1 -1
  457. package/widgets/LayerList/types.d.ts +2 -2
  458. package/widgets/LayerList.d.ts +1 -1
  459. package/widgets/Legend.d.ts +1 -1
  460. package/widgets/Locate/LocateViewModel.d.ts +2 -2
  461. package/widgets/Locate.d.ts +1 -1
  462. package/widgets/Popup/types.d.ts +2 -0
  463. package/widgets/Popup.d.ts +1 -2
  464. package/widgets/Print.d.ts +1 -1
  465. package/widgets/Search/types.d.ts +5 -0
  466. package/widgets/Search.d.ts +1 -1
  467. package/widgets/ShadowCast/DurationOptions.d.ts +1 -1
  468. package/widgets/ShadowCast/ShadowCastViewModel.d.ts +1 -1
  469. package/widgets/ShadowCast/{ShadowVisualizationType.d.ts → types.d.ts} +4 -1
  470. package/widgets/ShadowCast.d.ts +1 -1
  471. package/widgets/Sketch/types.d.ts +1 -1
  472. package/widgets/Slice.d.ts +1 -1
  473. package/widgets/TableList.d.ts +1 -1
  474. package/widgets/TimeSlider/TimeSliderViewModel.d.ts +1 -1
  475. package/widgets/Track.d.ts +1 -1
  476. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.d.ts +1 -1
  477. package/widgets/UtilityNetworkTrace/{support/ResultAreaHandler.d.ts → types.d.ts} +2 -2
  478. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  479. package/widgets/Weather/WeatherViewModel.d.ts +2 -2
  480. package/widgets/Weather.d.ts +1 -1
  481. package/widgets/smartMapping/support/utils.d.ts +6 -0
  482. package/widgets/support/GoTo.d.ts +1 -1
  483. package/widgets/support/SelectionList/FeatureItem.js +1 -1
  484. package/widgets/support/SelectionList/LayerItem.js +1 -1
  485. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  486. package/widgets/support/SelectionList.js +1 -1
  487. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  488. package/widgets/support/forms/types.d.ts +2 -0
  489. package/widgets/support/symbolPreviewUtils.js +1 -1
  490. package/widgets/support/{goToUtils.d.ts → types.d.ts} +8 -1
  491. package/widgets/support/widget.d.ts +11 -0
  492. package/assets/esri/core/workers/chunks/0d1e8d5d9abee38e275e.js +0 -316
  493. package/assets/esri/core/workers/chunks/316f3e93aa0db48ef129.js +0 -1
  494. package/assets/esri/core/workers/chunks/73c3ee2697265b0f7208.js +0 -1
  495. package/assets/esri/core/workers/chunks/cd2ea924cb91cdb6dde9.js +0 -1
  496. package/assets/esri/core/workers/chunks/d57577c02fb2932e8305.js +0 -1
  497. package/assets/esri/core/workers/chunks/ec7e6427d99cf3148a61.js +0 -1
  498. package/colorUtils.d.ts +0 -13
  499. package/core/Logger.d.ts +0 -29
  500. package/core/Message.d.ts +0 -2
  501. package/core/Message.js +0 -5
  502. package/core/accessorSupport/PropertyOrigin.d.ts +0 -2
  503. package/core/sql/sql92grammar.d.ts +0 -12
  504. package/core/string.d.ts +0 -3
  505. package/core/time.d.ts +0 -2
  506. package/core/timeUtils.d.ts +0 -2
  507. package/views/2d/ViewStateManager.d.ts +0 -2
  508. package/views/2d/layers/support/clusterUtils.d.ts +0 -6
  509. package/views/3d/environment/lightingUtils.d.ts +0 -4
  510. package/views/3d/environment/weather.d.ts +0 -9
  511. package/views/3d/glTF/internal/resourceUtils.d.ts +0 -10
  512. package/views/3d/interactive/visualElements/DrapedVisualElementResources.d.ts +0 -2
  513. package/views/3d/support/QualityProfile.d.ts +0 -2
  514. package/views/SceneViewHitTestResult.d.ts +0 -64
  515. package/views/ViewingMode.d.ts +0 -2
  516. package/views/draw/DrawingMode.d.ts +0 -2
  517. package/views/draw/support/drawUtils.d.ts +0 -7
  518. package/views/ui/Padding.d.ts +0 -11
  519. package/views/viewType.d.ts +0 -2
  520. package/views/webgl/enums.d.ts +0 -38
  521. package/webscene/support/featureReferenceUtils.d.ts +0 -4
  522. package/widgets/DirectionalPad/constants.d.ts +0 -2
  523. package/widgets/Editor/support/splitFeatureUtils.d.ts +0 -7
  524. package/widgets/Feature/support/arcadeFeatureUtils.d.ts +0 -4
  525. package/widgets/Popup/actions.d.ts +0 -4
  526. package/widgets/ShadowCast/DurationMode.d.ts +0 -3
  527. package/widgets/support/Heading.d.ts +0 -7
  528. package/widgets/support/forms/formUtils.d.ts +0 -2
  529. /package/views/animation/{easing.d.ts → types.d.ts} +0 -0
  530. /package/views/draw/{DrawingMode.js → drawingModes.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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{isSome as t,difference as s}from"../core/arrayUtils.js";import i from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import{deprecatedProperty as n}from"../core/deprecate.js";import{EventedAccessor as r}from"../core/Evented.js";import{makeHandle as l}from"../core/handleUtils.js";import a from"../core/Logger.js";import{getOrCreateMapValue as c}from"../core/MapUtils.js";import{destroyMaybe as h}from"../core/maybe.js";import d from"../core/ReactiveMap.js";import{watch as u,on as p,initial as g}from"../core/reactiveUtils.js";import{symmetricDifference as f}from"../core/SetUtils.js";import{property as y,subclass as _}from"../core/accessorSupport/decorators.js";import{UpdatingHandles as m}from"../core/support/UpdatingHandles.js";import{isSubtypeSublayer as w,isSubtypeGroupLayer as v,isKnowledgeGraphLayer as S,isMapImageLayer as b}from"../layers/support/layerUtils.js";import E from"../rest/support/Query.js";import{isTableLayer as M,isISelectableLayer as j,isISelectableLayerView as H,isISelectableLayerViewWithHighlights as L,isISelectableLayerBaseWithEditing as V}from"./support/selectionUtils.js";let C=class extends r{constructor(e){super(e),this._layerEditHandles=new i,this._selectionMap=new d,this._sources=new i,this._trashCan=[],this._updatingHandles=new m,this._vizTaskId=0,this.highlightEnabled=!0,this.highlightName="default",this.layerViewMap=new WeakMap,this.view=null}initialize(){this.addHandles([u(()=>[this.view,this.highlightEnabled],()=>{this._refreshVisualization()}),u(()=>this.view,e=>{e?.when().then(()=>this.syncSources())},g),p(()=>this.sources,"change",e=>{const t=this._selectionMap,s=[];for(const i of e.removed){const e=t.get(i);e&&(t.delete(i),e.highlightHandle?.remove(),s.push({layer:i,selection:[],added:[],removed:[...e.selection]}))}this._refreshListeners(),s.length&&this._onSelectionChange(s)},{onListenerAdd:()=>this._refreshListeners()})])}destroy(){this.clear(),this._layerEditHandles.destroyAll(),this._updatingHandles.destroy(),h(this._layerEditHandles),h(this._sources)}get count(){let e=0;for(const t of this._selectionMap.values())e+=t.selection.length;return e}get hasSelection(){return this.count>0}get selections(){return Array.from(this._selectionMap.entries()).map(e=>{const[t,s]=e;return{layer:t,selection:[...s.selection]}})}get showHighlight(){return this.highlightEnabled}set showHighlight(e){n(a.getLogger(this),"showHighlight",{replacement:"highlightEnabled"}),this.highlightEnabled=e}get sources(){return this._sources}set sources(e){o(e,this._sources)}get updating(){return this._updatingHandles.updating}clear(){const e=this._selectionMap.values();this._trashCan.push(...e);const t=[];for(const[s,i]of this._selectionMap.entries())t.push({layer:s,added:[],removed:[...i.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(t)}getSelection(e){return this._selectionMap.get(e)?.selection}syncSources(){const e=new Set,t=this.view?.map;if(!t)return;const s=t=>{S(t)?(t.layers?.forEach(s),t.tables?.forEach(s)):b(t)?(t.sublayers?.forEach(s),t.subtables?.forEach(s)):v(t)?t.sublayers?.forEach(s):j(t)&&e.add(t)};t.allLayers.forEach(s),t.allTables.forEach(s),this.sources=[...e]}async getSelectedFeatures(e,s={},i="layerView"){const{view:o,selections:n}=this;if(!o&&"layerView"===i)return a.getLogger(this).warn("Cannot query layer views without a view."),[];const r=(e?.length?n.filter(t=>e.includes(t.layer)):n).map(async e=>{const{layer:t,selection:o}=e;if(o.length){if("layerView"===i&&!M(t)){const e=await this._findLayerView(t);if(e)return I(e,o,s)}return I(t,o,s)}}).filter(t);return(await Promise.all(r)).filter(t)}updateSelection(e){const t=new Map;for(const[s,n]of this._selectionMap)t.set(s,[...n.selection]);let i=!1;const o=e.current.concat(e.added);for(const s of o){const e=s.sourceLayer,o=s.getObjectId();if(this.sources.includes(e)&&(j(e)||w(e))&&null!==o){const s=c(t,e,()=>[]);s.includes(o)||(s.push(o),i=!0)}}for(const s of e.removed){const e=s.sourceLayer,o=s.getObjectId();if(this.sources.includes(e)&&(j(e)||w(e))&&null!==o){const s=t.get(e),n=s?.indexOf(o);void 0!==n&&n>=0&&(s?.splice(n,1),i=!0)}}if(i){const{_selectionMap:e,_trashCan:i}=this,o=[];for(const[n,r]of t){const t=e.get(n);void 0!==t&&i.push(t),e.set(n,{selection:r}),o.push({layer:n,selection:r,...s(void 0!==t?t.selection:[],r)})}this._onSelectionChange(o)}}setSelection(e,t){this._setSelection(e,t)}appendToSelection(e,t){const s=this._selectionMap.get(e),i=void 0!==s?[...s.selection]:[];for(const o of t)i.includes(o)||i.push(o);this._setSelection(e,i)}removeFromSelection(e,t){const s=this._selectionMap.get(e);if(!s)return;const i=[];for(const o of s.selection)t.includes(o)||i.push(o);this._setSelection(e,i)}toggleInSelection(e,t){const s=this._selectionMap.get(e);if(!s||0===s.selection.length)return void this._setSelection(e,t);const i=new Set(s.selection),o=new Set(t),n=f(i,o);this._setSelection(e,Array.from(n))}async _findLayerView(e){const t=this.layerViewMap.get(e);if(t||!this.view)return t;const s=w(e)&&e.parent?e.parent:e,i=await this.view.whenLayerView(s).catch(()=>{});return H(i)?(this.layerViewMap.set(e,i),i.addHandles(l(()=>this.layerViewMap.delete(e))),i):void 0}_onSelectionChange(e){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:e})}async _refreshVisualization(){await this._updatingHandles.addPromise(this._updateVisualization())}async _updateVisualization(){for(this._vizTaskId++;this._trashCan.length>0;){const e=this._trashCan.pop();e?.highlightHandle?.remove()}const{_selectionMap:e,highlightName:t,sources:s}=this,i=this.view&&this.highlightEnabled,o=this._vizTaskId;for(const n of s){const s=e.get(n);if(s?.highlightHandle?.remove(),i&&s?.selection.length&&!M(n)){const e=await this._findLayerView(n);L(e)&&o===this._vizTaskId&&(s.highlightHandle=e.highlight(s.selection,{name:t}))}}}_refreshListeners(){this._layerEditHandles.destroyAll();const e=new Set(this.sources.map(e=>w(e)?e.parent:e));for(const t of e)j(t)&&V(t)&&this._layerEditHandles.push(t.on("edits",e=>this._onLayerEdit(e,t)))}_onLayerEdit(e,t){if(v(t))this._onParentLayerEdit(e,t);else if(e.deletedFeatures.length&&this._selectionMap.has(t)){const s=[];e.deletedFeatures.forEach(({error:e,objectId:t})=>{null!=t&&null==e&&s.push(t)}),this.removeFromSelection(t,s)}}_onParentLayerEdit(e,t){const{deletedFeatures:s,edits:i,updatedFeatures:o}=e;if(i?.updateFeatures?.forEach(e=>{const s=e.getObjectId()??e.attributes[t.objectIdField];if(null==s)return;if(o.find(e=>e.objectId===s)?.error)return;const i=t.findSublayerForFeature(e);if(!j(i))return;const n=t.sublayers.find(e=>!(!j(e)||!this.getSelection(e)?.includes(s)));j(n)&&n!==i&&(this.removeFromSelection(n,[s]),this.appendToSelection(i,[s]))}),s.length){const e=[];s.forEach(({error:t,objectId:s})=>{null!=s&&null==t&&e.push(s)}),t.sublayers.forEach(t=>{j(t)&&this._selectionMap.has(t)&&this.removeFromSelection(t,e)})}}_setSelection(e,t){if(!this.sources.includes(e))throw new Error(`Cannot set selection on layer ${e.title} because it is not in 'sources'`);const i=this._selectionMap.get(e);if(void 0===i||!F(i,{selection:t})){void 0!==i&&this._trashCan.push(i),this._selectionMap.set(e,{selection:[...t]});const o={layer:e,selection:[...t],...s(void 0!==i?i.selection:[],t)};this._onSelectionChange([o])}}};e([y()],C.prototype,"_layerEditHandles",void 0),e([y()],C.prototype,"_selectionMap",void 0),e([y()],C.prototype,"_sources",void 0),e([y()],C.prototype,"_updatingHandles",void 0),e([y({readOnly:!0,nonNullable:!0})],C.prototype,"count",null),e([y({readOnly:!0,nonNullable:!0})],C.prototype,"hasSelection",null),e([y()],C.prototype,"highlightEnabled",void 0),e([y()],C.prototype,"highlightName",void 0),e([y()],C.prototype,"layerViewMap",void 0),e([y({readOnly:!0,nonNullable:!0})],C.prototype,"selections",null),e([y()],C.prototype,"showHighlight",null),e([y()],C.prototype,"sources",null),e([y()],C.prototype,"updating",null),e([y()],C.prototype,"view",void 0),C=e([_("esri.views.SelectionManager")],C);const F=(e,t)=>{if(null==e&&null==t)return!0;if(null!=e&&null==t||null==e&&null!=t)return!1;if(null!=e&&null!=t&&null!=e.selection&&null!=t.selection){const s=[...e.selection],i=[...t.selection];if(s.length!==i.length)return!1;s.sort(),i.sort();for(let e=0;e<s.length;e++)if(s[e]!==i[e])return!1}return!0},I=async(e,t,s={})=>e.queryFeatures(new E({...s,objectIds:t})).then(t=>({data:t,layer:H(e)?e.layer:e})),z=C;export{z as default};
5
+ import{__decorate as e}from"tslib";import{isSome as t,difference as s}from"../core/arrayUtils.js";import i from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import{deprecatedProperty as n,deprecatedFunction as r}from"../core/deprecate.js";import{EventedAccessor as l}from"../core/Evented.js";import{makeHandle as a}from"../core/handleUtils.js";import c from"../core/Logger.js";import{getOrCreateMapValue as h}from"../core/MapUtils.js";import{destroyMaybe as d}from"../core/maybe.js";import p from"../core/ReactiveMap.js";import{watch as g,on as u,initial as f}from"../core/reactiveUtils.js";import{addMany as y,symmetricDifference as m}from"../core/SetUtils.js";import{property as _,subclass as w}from"../core/accessorSupport/decorators.js";import{UpdatingHandles as v}from"../core/support/UpdatingHandles.js";import{getGraphicLayer as S}from"../graphic/graphicOriginUtils.js";import{isSubtypeSublayer as M,isSubtypeGroupLayer as E,isKnowledgeGraphLayer as b,isMapImageLayer as j}from"../layers/support/layerUtils.js";import H from"../rest/support/Query.js";import{isISelectableLayerWithObjectIds as L,isISelectableLayerViewWithObjectIds as V,isISelectableLayer as C,isISelectableLayerView as I,isTableLayer as U,isISelectableLayerViewWithHighlights as F,isISelectableLayerWithGraphics as O,isISelectableLayerBaseWithEditing as z}from"./support/selectionUtils.js";let T=class extends l{constructor(e){super(e),this._layerEditHandles=new i,this._selectionMap=new p,this._sources=new i,this._trashCan=[],this._updatingHandles=new v,this._vizTaskId=0,this.highlightEnabled=!0,this.highlightName="default",this.layerViewMap=new WeakMap,this.view=null}initialize(){this.addHandles([g(()=>[this.view,this.highlightEnabled],()=>{this._refreshVisualization()}),g(()=>this.view,e=>{e?.when().then(()=>this.syncSources())},f),u(()=>this.sources,"change",e=>{const t=this._selectionMap,s=[];for(const i of e.removed){const e=t.get(i);e&&(t.delete(i),e.highlightHandle?.remove(),s.push({layer:i,selection:[],added:[],removed:[...e.selection]}))}this._refreshListeners(),s.length&&this._onSelectionChange(s)},{onListenerAdd:()=>this._refreshListeners()})])}destroy(){this.clear(),this._layerEditHandles.destroyAll(),this._updatingHandles.destroy(),d(this._layerEditHandles),d(this._sources)}get count(){let e=0;for(const t of this._selectionMap.values())e+=t.selection.length;return e}get hasSelection(){return this.count>0}get selections(){return Array.from(this._selectionMap.entries()).map(e=>{const[t,s]=e;return{layer:t,selection:[...s.selection]}})}get showHighlight(){return this.highlightEnabled}set showHighlight(e){n(c.getLogger(this),"showHighlight",{replacement:"highlightEnabled"}),this.highlightEnabled=e}get sources(){return this._sources}set sources(e){o(e,this._sources)}get updating(){return this._updatingHandles.updating}add(e,t){const s=new Set;y(s,this._selectionMap.get(e)?.selection);for(const i of t)s.add(i);this._setSelection(e,Array.from(s))}clear(){const e=this._selectionMap.values();this._trashCan.push(...e);const t=[];for(const[s,i]of this._selectionMap.entries())t.push({layer:s,added:[],removed:[...i.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(t)}getSelection(e){return this._selectionMap.get(e)?.selection}syncSources(){const e=new Set,t=this.view?.map;if(!t)return;const s=t=>{b(t)?(t.layers?.forEach(s),t.tables?.forEach(s)):j(t)?(t.sublayers?.forEach(s),t.subtables?.forEach(s)):E(t)?t.sublayers?.forEach(s):C(t)&&e.add(t)};t.allLayers.forEach(s),t.allTables.forEach(s),this.sources=[...e]}async getSelectedFeatures(e,s={},i="layerView"){const{view:o,selections:n}=this;if(!o&&"layerView"===i)return c.getLogger(this).warn("Cannot query layer views without a view."),[];const r=n.map(async t=>{const{layer:n,selection:r}=t;if(r.length&&L(n)&&(!e||e.includes(n))){if(o&&"layerView"===i&&!n.isTable){const e=await this._findLayerView(n);if(V(e))return N(e,r,s)}return N(n,r,s)}}).filter(t);return(await Promise.all(r)).filter(t)}updateSelection(e){const t=new Map;for(const[s,n]of this._selectionMap)t.set(s,new Set(n.selection));let i=!1;const o=e.current.concat(e.added);for(const s of o){const e=S(s);if(C(e)&&this.sources.includes(e)){const o=h(t,e,()=>new Set),n=L(e)?s.getObjectId():s;null!=n&&(o.add(n),i=!0)}}for(const s of e.removed){const e=S(s);if(C(e)&&this.sources.includes(e)){const o=t.get(e),n=L(e)?s.getObjectId():s;n&&o&&(o.delete(n),i=!0)}}if(i){const{_selectionMap:e,_trashCan:i}=this,o=[];for(const[n,r]of t){const t=e.get(n),l=Array.from(r);void 0!==t&&i.push(t),e.set(n,{selection:l}),o.push({layer:n,selection:l,...s(void 0!==t?t.selection:[],l)})}this._onSelectionChange(o)}}setSelection(e,t){r(c.getLogger(this),"SelectionManager.setSelection is deprecated. Use SelectionManager.replace instead.",{replacement:"SelectionManager.replace",warnOnce:!0}),this.replace(e,t)}appendToSelection(e,t){r(c.getLogger(this),"SelectionManager.appendToSelection is deprecated. Use SelectionManager.add instead.",{replacement:"SelectionManager.add",warnOnce:!0}),this.add(e,t)}remove(e,t){const s=this._selectionMap.get(e);if(!s)return;const i=[];for(const o of s.selection)t.includes(o)||i.push(o);this._setSelection(e,i)}replace(e,t){this._setSelection(e,t)}removeFromSelection(e,t){r(c.getLogger(this),"SelectionManager.removeFromSelection is deprecated. Use SelectionManager.remove instead.",{replacement:"SelectionManager.remove",warnOnce:!0}),this.remove(e,t)}toggle(e,t){const s=this._selectionMap.get(e);if(!s||0===s.selection.length)return void this._setSelection(e,t);const i=new Set(s.selection),o=new Set(t),n=m(i,o);this._setSelection(e,Array.from(n))}toggleInSelection(e,t){r(c.getLogger(this),"SelectionManager.toggleInSelection is deprecated. Use SelectionManager.toggle instead.",{replacement:"SelectionManager.toggle",warnOnce:!0}),this.toggle(e,t)}async _findLayerView(e){const t=this.layerViewMap.get(e);if(t||!this.view)return t;const s=M(e)&&e.parent?e.parent:e,i=await this.view.whenLayerView(s).catch(()=>{});return I(i)?(this.layerViewMap.set(e,i),i.addHandles(a(()=>this.layerViewMap.delete(e))),i):void 0}_onSelectionChange(e){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:e})}async _refreshVisualization(){await this._updatingHandles.addPromise(this._updateVisualization())}async _updateVisualization(){for(this._vizTaskId++;this._trashCan.length>0;){const e=this._trashCan.pop();e?.highlightHandle?.remove()}const{_selectionMap:e,highlightName:t,sources:s}=this,i=this.view&&this.highlightEnabled,o=this._vizTaskId;for(const n of s){const s=e.get(n);if(s?.highlightHandle?.remove(),i&&s?.selection.length&&!U(n)){const e=await this._findLayerView(n);if(F(e)&&o===this._vizTaskId){const i=s.selection;s.highlightHandle=e.highlight(i,{name:t})}}}}_refreshListeners(){this._layerEditHandles.destroyAll();const e=new Set(this.sources.map(e=>M(e)?e.parent:e));for(const t of e)C(t)&&(O(t)?this._layerEditHandles.push(t.graphics.on("change",e=>this._onGraphicsLayerEdit(t,e))):z(t)&&this._layerEditHandles.push(t.on("edits",e=>this._onLayerEdit(t,e))))}_onLayerEdit(e,t){if(E(e))this._onParentLayerEdit(e,t);else if(t.deletedFeatures.length&&this._selectionMap.has(e)){const s=[];t.deletedFeatures.forEach(({error:e,objectId:t})=>{null!=t&&null==e&&s.push(t)}),this.remove(e,s)}}_onGraphicsLayerEdit(e,t){const{removed:s}=t;s.length&&this._selectionMap.has(e)&&this.remove(e,s)}_onParentLayerEdit(e,t){const{deletedFeatures:s,edits:i,updatedFeatures:o}=t;if(i?.updateFeatures?.forEach(t=>{const s=t.getObjectId()??t.attributes[e.objectIdField];if(null==s)return;if(o.find(e=>e.objectId===s)?.error)return;const i=e.findSublayerForFeature(t);if(!C(i))return;const n=e.sublayers.find(e=>!(!C(e)||!this.getSelection(e)?.includes(s)));C(n)&&n!==i&&(this.remove(n,[s]),this.add(i,[s]))}),s.length){const t=[];s.forEach(({error:e,objectId:s})=>{null!=s&&null==e&&t.push(s)}),e.sublayers.forEach(e=>{C(e)&&this._selectionMap.has(e)&&this.remove(e,t)})}}_setSelection(e,t){if(!this.sources.includes(e))throw new Error(`Cannot set selection on layer ${e.title} because it is not in 'sources'`);const i=this._selectionMap.get(e);if(!i||!A(i,{selection:t})){i&&this._trashCan.push(i),this._selectionMap.set(e,{selection:[...t]});const o=i?s(i.selection,t):{};this._onSelectionChange([{layer:e,selection:[...t],...o}])}}};e([_()],T.prototype,"_layerEditHandles",void 0),e([_()],T.prototype,"_selectionMap",void 0),e([_()],T.prototype,"_sources",void 0),e([_()],T.prototype,"_updatingHandles",void 0),e([_({readOnly:!0,nonNullable:!0})],T.prototype,"count",null),e([_({readOnly:!0,nonNullable:!0})],T.prototype,"hasSelection",null),e([_()],T.prototype,"highlightEnabled",void 0),e([_()],T.prototype,"highlightName",void 0),e([_()],T.prototype,"layerViewMap",void 0),e([_({readOnly:!0,nonNullable:!0})],T.prototype,"selections",null),e([_()],T.prototype,"showHighlight",null),e([_()],T.prototype,"sources",null),e([_()],T.prototype,"updating",null),e([_()],T.prototype,"view",void 0),T=e([w("esri.views.SelectionManager")],T);const A=(e,t)=>{if(null==e&&null==t)return!0;if(null!=e&&null==t||null==e&&null!=t)return!1;if(null!=e&&null!=t&&null!=e.selection&&null!=t.selection){const s=[...e.selection],i=[...t.selection];if(s.length!==i.length)return!1;s.sort(),i.sort();for(let e=0;e<s.length;e++)if(s[e]!==i[e])return!1}return!0},N=async(e,t,s={})=>e.queryFeatures(new H({...s,objectIds:t})).then(t=>({data:t,layer:I(e)?e.layer:e})),k=T;export{k as default};
@@ -91,8 +91,7 @@ export default class VideoView extends VideoViewSuperclass {
91
91
  *
92
92
  * - [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-VideoView.html#width)
93
93
  * - [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-VideoView.html#height)
94
- * - {@link views/VideoView#videoWidth}
95
- * - {@link views/VideoView#videoHeight}
94
+ * - [videoSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-VideoView.html#videoSize)
96
95
  * - The [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-VideoView.html#layer) is [ready](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VideoLayer.html#state).
97
96
  *
98
97
  * When a view becomes ready it will resolve itself and invoke
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../Color.js";import i from"../Viewpoint.js";import s from"../core/Accessor.js";import{EventedMixin as r}from"../core/Evented.js";import{destroyMaybe as o}from"../core/maybe.js";import{EsriPromiseMixin as a}from"../core/Promise.js";import{watch as n,initial as l,whenOnce as p,syncAndInitial as m}from"../core/reactiveUtils.js";import{property as h,cast as d,subclass as c}from"../core/accessorSupport/decorators.js";import{ensureClass as g}from"../core/accessorSupport/ensureType.js";import f from"../geometry/Extent.js";import u from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import{load as j,execute as w}from"../geometry/operators/projectOperator.js";import b from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as v}from"../layers/support/MediaElementView.js";import M from"../layers/support/TileInfo.js";import _ from"../layers/support/VideoElement.js";import{DOMContainer as S}from"./DOMContainer.js";import{Viewport2DBaseMixin as C}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as V}from"./Viewport2DMixin.js";import x from"./2d/AnimationManager.js";import P from"./2d/MapViewConstraints.js";import"../core/Error.js";import"../core/has.js";import"../core/scheduling.js";import"../core/RandomLCG.js";import"../core/Logger.js";import"../core/mathUtils.js";import"../config.js";import"../symbols/cim/defaultCIMValues.js";import"../core/floatRGBA.js";import"../symbols/Font.js";import"../core/ObjectPool.js";import"../geometry/support/spatialReferenceUtils.js";import"../symbols/cim/effects/EffectAddControlPoints.js";import"../symbols/cim/effects/EffectArrow.js";import"../symbols/cim/effects/EffectBuffer.js";import"../symbols/cim/effects/EffectControlMeasureLine.js";import"../symbols/cim/effects/EffectCut.js";import"../symbols/cim/effects/EffectDashes.js";import"../symbols/cim/effects/EffectDonut.js";import"../symbols/cim/effects/EffectEnclosingPolygon.js";import"../symbols/cim/effects/EffectJog.js";import"../symbols/cim/effects/EffectMove.js";import"../symbols/cim/effects/EffectOffset.js";import"../symbols/cim/effects/EffectRadial.js";import"../symbols/cim/effects/EffectReverse.js";import"../symbols/cim/effects/EffectRotate.js";import"../symbols/cim/effects/EffectScale.js";import"../symbols/cim/effects/EffectSuppress.js";import"../symbols/cim/effects/EffectTaperedPolygon.js";import"../symbols/cim/effects/EffectWave.js";import"../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../symbols/cim/placements/PlacementAtExtremities.js";import"../symbols/cim/placements/PlacementAtMeasuredUnits.js";import"../symbols/cim/placements/PlacementAtRatioPositions.js";import"../symbols/cim/placements/PlacementInsidePolygon.js";import"../symbols/cim/placements/PlacementOnLine.js";import"../symbols/cim/placements/PlacementOnVertices.js";import"../symbols/cim/placements/PlacementPolygonCenter.js";import"../symbols/cim/constants.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"../geometry/Polygon.js";import"../symbols/support/defaults.js";import"../symbols/cim/OverrideHelper.js";import{Container as G}from"./2d/engine/Container.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"./webgl/enums.js";import"./2d/engine/webgl/shaders/BackgroundPrograms.js";import"./webgl/Program.js";import"./webgl/Util.js";import"./webgl/VertexAttributeLayouts.js";import"./webgl/BufferObject.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/cpuMapped/MappedMesh.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaders/TileInfoPrograms.js";import"./webgl/Texture.js";import"./2d/engine/webgl/shaders/BitBlitPrograms.js";import"../request.js";import"../core/urlUtils.js";import"../core/pbf.js";import"./2d/engine/webgl/shaders/StencilPrograms.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"./2d/engine/webgl/shaders/HighlightPrograms.js";import"./webgl/FramebufferObject.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlitShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlurShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js";import"./2d/engine/webgl/meshing/SimpleMesh.js";import"./webgl/Renderbuffer.js";import"./2d/engine/webgl/PooledUint32Array.js";import"./2d/engine/webgl/Profiler.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"./2d/engine/webgl/shaderGraph/techniques/animated/attributes.js";import"./2d/engine/webgl/mesh/templates/templateUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../geometry/support/aaBoundingBox.js";import"./2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../core/sql/UnknownTimeZone.js";import"luxon";import"../intl/locale.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polyline.js";import"../layers/support/fieldUtils.js";import"../time/constants.js";import"./2d/engine/webgl/animations/instructions.js";import"./2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"./webgl/checkWebGLError.js";import"./webgl/renderState.js";import"./3d/webgl-engine/core/shaderModules/glsl.js";import"./webgl/testSVGPremultipliedAlpha.js";import{ManagedCanvas as E}from"./2d/engine/ManagedCanvas.js";import"./2d/engine/transitions/FadeTransition.js";import"./2d/engine/webgl/meshing/definitions.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import"../chunks/earcut.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtils.js";import"./2d/layers/support/util.js";import D from"./2d/navigation/MapViewNavigation.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/units.js";import"../geometry/ellipsoidUtils.js";import"../geometry/operators/support/GeographicTransformation.js";import"../geometry/projection/projectors.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import"../geometry/support/Ellipsoid.js";import{ViewStateManager as R}from"./2d/ViewStateManager.js";import q from"./2d/engine/webgl/Overlay.js";import z from"./2d/engine/webgl/OverlayContainer.js";import O from"./navigation/Navigation.js";import T from"./ui/DefaultUI.js";import W from"./ui/video/DefaultUIVideo.js";const A=new t("#000");let U;async function k(){const[,{ParentStage:e}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);U=e}const B=.01,F=["feature","geojson","csv","stream","ogc-feature","catalog","wfs","parquet","graphics","group"];let H=class extends(V(C(S(r(a(s)))))){constructor(e){super(e),this._isValid=!1,this._prevZoomEnabled=!1,this._prevRotationEnabled=!1,this.stage=null,this.childStage=null,this._operationalDataView=null,this.operationalDataVisible=!1,this.layer=null,this.map=null,this.navigation=new O,this.ready=!1,this.spatialReference=new y({wkid:0}),this.stateManager=new R({constraints:new P({view:this,minScale:1,maxScale:B})}),this.type="2d",this.ui=new W,this.view2dType="video",this.addHandles([n(()=>this.preconditionsReady,e=>e?this._startup():this._teardown()),n(()=>this.layer,(e,t)=>{t&&(this._teardown(),this._startup()),this.addResolvingPromise(p(()=>this.ready))},l),n(()=>this.videoSize,([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)}),n(()=>this.size,e=>{this._operationalDataView&&this._operationalDataView.stateManager.resize(e[0],e[1])}),n(()=>[this.layer?.frameEffect,this._effectsContainer],()=>{this._effectsContainer&&(this._effectsContainer.effect=this.layer?.frameEffect??null)},m)])}initialize(){this._prevZoomEnabled="zoom"===this.navigation.actionMap.mouseWheel&&this.ui.components.includes("zoom"),this._prevRotationEnabled="rotate"===this.navigation.actionMap.dragSecondary&&this.ui.components.includes("compass"),this.addHandles([n(()=>[this.operationalDataVisible,this.childStage],()=>{this.childStage&&(this.childStage.videoScreenRenderer.visible=this.operationalDataVisible),this.operationalDataVisible&&(this.scale=1,this.rotation=0),this.navigation&&(this._prevZoomEnabled&&(this.navigation.actionMap.mouseWheel=this.operationalDataVisible?"none":"zoom",this.navigation.actionMap.dragPrimary=this.operationalDataVisible?"none":"pan",this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>"zoom"!==e):[...new Set([...this.ui.components,"zoom"])])),this._prevRotationEnabled&&(this.navigation.actionMap.dragSecondary=this.operationalDataVisible?"none":"rotate",this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>"compass"!==e):[...new Set([...this.ui.components,"compass"])])))},m)]),this.addResolvingPromise(k().then(()=>(this._isValid=!0,p(()=>this.ready))))}destroy(){this._teardown(),this.removeAllHandles(),this._set("preconditionsReady",!1),this.frameTask=o(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get preconditionsReady(){return!(!this._isValid||0===this.width||0===this.height||0===this.videoSize[0]||0===this.videoSize[1])}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];const[e,t]=this.size,i=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),s=t*i,r=e/i;return e/t>=1?i>=1?s<=e?[s,t]:[e,r]:r<=t?[e,r]:[s,t]:i>=1?r<=t?[e,r]:[s,t]:s<=e?[s,t]:[e,r]}async hitTest(e,t){return this._operationalDataView&&this._operationalDataView.ready?this._operationalDataView.hitTest(e,t):{screenPoint:e,results:[]}}_startup(){if(!this.layer)return;const e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference);const t={renderingOptions:this.renderingOptions,backgroundColor:A,groundControlPoints:()=>this.layer?.groundControlPoints,getSize:()=>this.videoSize},i=new U(this.surface,t,new E(this.surface));this.stage=i,this._prepareStage(this.stage),this.childStage=i.childStage,this._prepareChildStage(this.childStage);const s=new x({view:this});this._set("animationManager",s);const r=new D({view:this,animationManager:s});this._set("mapViewNavigation",r),this._updateConstraints(),this.frameTask.start(),this._set("ready",!0)}_teardown(){this.stage.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer.removeAllChildren(),this._overlayContainer=null,this.removeHandles("video-view"),this._set("ready",!1),this.stateManager.teardown(),this.frameTask.stop(),this.stationaryManager.clear()}_getViewpoint(){return new i({targetGeometry:new u({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([n(()=>this.stationary,t=>e.stationary=t,m),n(()=>this.state.id,()=>e.state=this.state,m),n(()=>this.renderingOptions,t=>e.renderingOptions=t,m)],"video-view"),this._extent=new f({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new v({element:new _({video:this.layer?.videoElement,georeference:new b({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});const t=new q(this._videoElementView);this._overlayContainer=new z,this._overlayContainer.addChild(t),this._effectsContainer=new G,this._effectsContainer.addChild(this._overlayContainer),this.stage.addChild(this._effectsContainer);const i=document.createElement("div");i.classList.add("esri-video-poster"),this.container?.classList.add("esri-video-view"),this.container?.appendChild(i)}_prepareChildStage(e){this.addHandles([n(()=>this.map,async t=>{if(!t)return;const{default:i}=await import("./video/VideoOperationalDataView.js");this._operationalDataView=new i({stage:e,layerViewFilter:e=>new Set(F).has(e.type),width:this.size[0],height:this.size[1],map:t}),p(()=>this._operationalDataView?.ready).then(()=>{e.videoScreenRenderer.visible=this.operationalDataVisible})},m),n(()=>this.layer?.groundControlPoints,async()=>{if(!this.layer?.groundControlPoints||!e.state)return;const t=this.layer.groundControlPoints,i=t?.length;if(!i)return;await j();const s=new Array(i),r=e.state.spatialReference;for(let e=0;e<i;e++){const{lat:i,lon:o}=t[e];s[e]=w(new u(o,i),r)}let o=1/0,a=1/0,n=-1/0,l=-1/0;for(const e of s)o=Math.min(o,e.x),a=Math.min(a,e.y),n=Math.max(n,e.x),l=Math.max(l,e.y);const p=f.fromJSON({xmin:o,ymin:a,xmax:n,ymax:l,spatialReference:r});await(this._operationalDataView?.goTo(p,{animate:!1}).catch(()=>{}))},m)])}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){const e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),i=[];for(let r=t;r>B;r/=2)i.push(r);i.push(B);const{lods:s}=M.create({scales:i});this.constraints.set({lods:s,minScale:t})}_updatePanConstraints(){const e=e=>{if(!e.targetGeometry)return e;const[t,i]=this.videoSize,s=t*e.scale/2,r=i*e.scale/2,o=e.targetGeometry.clone();return o.x=Math.max(s,Math.min(t-s,o.x)),o.y=Math.max(r,Math.min(i-r,o.y)),e.targetGeometry=o,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}};e([h()],H.prototype,"_overlayContainer",void 0),e([h()],H.prototype,"_isValid",void 0),e([h()],H.prototype,"_effectsContainer",void 0),e([h()],H.prototype,"constraintsInfo",null),e([h()],H.prototype,"operationalDataVisible",void 0),e([h()],H.prototype,"layer",void 0),e([h()],H.prototype,"map",void 0),e([h({type:O,nonNullable:!0})],H.prototype,"navigation",void 0),e([h({readOnly:!0})],H.prototype,"preconditionsReady",null),e([h({readOnly:!0})],H.prototype,"ready",void 0),e([h({readOnly:!0})],H.prototype,"rendering",null),e([h()],H.prototype,"scale",null),e([h()],H.prototype,"spatialReference",void 0),e([h()],H.prototype,"stateManager",void 0),e([h()],H.prototype,"type",void 0),e([h(),d(e=>e instanceof T?e:g(W,e))],H.prototype,"ui",void 0),e([h({readOnly:!0})],H.prototype,"videoSize",null),e([h({readOnly:!0})],H.prototype,"view2dType",void 0),H=e([c("esri.views.VideoView")],H);const L=H;export{L as default};
5
+ import{__decorate as e}from"tslib";import t from"../Color.js";import i from"../Viewpoint.js";import s from"../core/Accessor.js";import{EventedMixin as r}from"../core/Evented.js";import{destroyMaybe as o}from"../core/maybe.js";import{EsriPromiseMixin as a}from"../core/Promise.js";import{watch as n,initial as l,whenOnce as p,syncAndInitial as m}from"../core/reactiveUtils.js";import{property as h,cast as d,subclass as c}from"../core/accessorSupport/decorators.js";import{ensureClass as g}from"../core/accessorSupport/ensureType.js";import f from"../geometry/Extent.js";import u from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import{load as j,execute as w}from"../geometry/operators/projectOperator.js";import b from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as v}from"../layers/support/MediaElementView.js";import M from"../layers/support/TileInfo.js";import _ from"../layers/support/VideoElement.js";import{DOMContainer as S}from"./DOMContainer.js";import{Viewport2DBaseMixin as C}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as V}from"./Viewport2DMixin.js";import x from"./2d/AnimationManager.js";import P from"./2d/MapViewConstraints.js";import"../core/has.js";import"../core/RandomLCG.js";import"../core/Logger.js";import"../core/scheduling.js";import"../core/mathUtils.js";import"../config.js";import"../symbols/cim/defaultCIMValues.js";import"../core/floatRGBA.js";import"../symbols/Font.js";import"../core/ObjectPool.js";import"../geometry/support/spatialReferenceUtils.js";import"../symbols/cim/effects/EffectAddControlPoints.js";import"../symbols/cim/effects/EffectArrow.js";import"../symbols/cim/effects/EffectBuffer.js";import"../symbols/cim/effects/EffectControlMeasureLine.js";import"../symbols/cim/effects/EffectCut.js";import"../symbols/cim/effects/EffectDashes.js";import"../symbols/cim/effects/EffectDonut.js";import"../symbols/cim/effects/EffectEnclosingPolygon.js";import"../symbols/cim/effects/EffectJog.js";import"../symbols/cim/effects/EffectMove.js";import"../symbols/cim/effects/EffectOffset.js";import"../symbols/cim/effects/EffectRadial.js";import"../symbols/cim/effects/EffectReverse.js";import"../symbols/cim/effects/EffectRotate.js";import"../symbols/cim/effects/EffectScale.js";import"../symbols/cim/effects/EffectSuppress.js";import"../symbols/cim/effects/EffectTaperedPolygon.js";import"../symbols/cim/effects/EffectWave.js";import"../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../symbols/cim/placements/PlacementAtExtremities.js";import"../symbols/cim/placements/PlacementAtMeasuredUnits.js";import"../symbols/cim/placements/PlacementAtRatioPositions.js";import"../symbols/cim/placements/PlacementInsidePolygon.js";import"../symbols/cim/placements/PlacementOnLine.js";import"../symbols/cim/placements/PlacementOnVertices.js";import"../symbols/cim/placements/PlacementPolygonCenter.js";import"../symbols/cim/constants.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"../geometry/Polygon.js";import"../symbols/support/defaults.js";import"../symbols/cim/OverrideHelper.js";import{Container as G}from"./2d/engine/Container.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"./webgl/enums.js";import"./2d/engine/webgl/shaders/BackgroundPrograms.js";import"./webgl/Program.js";import"./webgl/Util.js";import"./webgl/VertexAttributeLayouts.js";import"./webgl/BufferObject.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/cpuMapped/MappedMesh.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaders/TileInfoPrograms.js";import"./webgl/Texture.js";import"./2d/engine/webgl/shaders/BitBlitPrograms.js";import"../request.js";import"../core/urlUtils.js";import"../core/pbf.js";import"./2d/engine/webgl/shaders/StencilPrograms.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"./2d/engine/webgl/shaders/HighlightPrograms.js";import"./webgl/FramebufferObject.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlitShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlurShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js";import"./2d/engine/webgl/meshing/SimpleMesh.js";import"./webgl/Renderbuffer.js";import"./2d/engine/webgl/PooledUint32Array.js";import"./2d/engine/webgl/Profiler.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"./2d/engine/webgl/shaderGraph/techniques/animated/attributes.js";import"./2d/engine/webgl/mesh/templates/templateUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../geometry/support/aaBoundingBox.js";import"./2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../core/sql/UnknownTimeZone.js";import"luxon";import"../intl/locale.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polyline.js";import"../layers/support/fieldUtils.js";import"../time/constants.js";import"./2d/engine/webgl/animations/instructions.js";import"./2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"./webgl/checkWebGLError.js";import"./webgl/renderState.js";import"./3d/webgl-engine/core/shaderModules/glsl.js";import"./webgl/testSVGPremultipliedAlpha.js";import{ManagedCanvas as E}from"./2d/engine/ManagedCanvas.js";import"./2d/engine/transitions/FadeTransition.js";import"./2d/engine/webgl/meshing/definitions.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import"../chunks/earcut.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtils.js";import"./2d/layers/support/util.js";import D from"./2d/navigation/MapViewNavigation.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/units.js";import"../geometry/ellipsoidUtils.js";import"../geometry/operators/support/GeographicTransformation.js";import"../geometry/projection/projectors.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import"../geometry/support/Ellipsoid.js";import{ViewStateManager as R}from"./2d/ViewStateManager.js";import q from"./2d/engine/webgl/Overlay.js";import z from"./2d/engine/webgl/OverlayContainer.js";import O from"./navigation/Navigation.js";import T from"./ui/DefaultUI.js";import W from"./ui/video/DefaultUIVideo.js";const A=new t("#000");let U;async function k(){const[,{ParentStage:e}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);U=e}const B=.01,F=["feature","geojson","csv","stream","ogc-feature","catalog","wfs","parquet","graphics","group"];let H=class extends(V(C(S(r(a(s)))))){constructor(e){super(e),this._isValid=!1,this._prevZoomEnabled=!1,this._prevRotationEnabled=!1,this.stage=null,this.childStage=null,this._operationalDataView=null,this.operationalDataVisible=!1,this.layer=null,this.map=null,this.navigation=new O,this.ready=!1,this.spatialReference=new y({wkid:0}),this.stateManager=new R({constraints:new P({view:this,minScale:1,maxScale:B})}),this.type="2d",this.ui=new W,this.view2dType="video",this.addHandles([n(()=>this.preconditionsReady,e=>e?this._startup():this._teardown()),n(()=>this.layer,(e,t)=>{t&&(this._teardown(),this._startup()),this.addResolvingPromise(p(()=>this.ready))},l),n(()=>this.videoSize,([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)}),n(()=>this.size,e=>{this._operationalDataView&&this._operationalDataView.stateManager.resize(e[0],e[1])}),n(()=>[this.layer?.frameEffect,this._effectsContainer],()=>{this._effectsContainer&&(this._effectsContainer.effect=this.layer?.frameEffect??null)},m)])}initialize(){this._prevZoomEnabled="zoom"===this.navigation.actionMap.mouseWheel&&this.ui.components.includes("zoom"),this._prevRotationEnabled="rotate"===this.navigation.actionMap.dragSecondary&&this.ui.components.includes("compass"),this.addHandles([n(()=>[this.operationalDataVisible,this.childStage],()=>{this.childStage&&(this.childStage.videoScreenRenderer.visible=this.operationalDataVisible),this.operationalDataVisible&&(this.scale=1,this.rotation=0),this.navigation&&(this._prevZoomEnabled&&(this.navigation.actionMap.mouseWheel=this.operationalDataVisible?"none":"zoom",this.navigation.actionMap.dragPrimary=this.operationalDataVisible?"none":"pan",this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>"zoom"!==e):[...new Set([...this.ui.components,"zoom"])])),this._prevRotationEnabled&&(this.navigation.actionMap.dragSecondary=this.operationalDataVisible?"none":"rotate",this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>"compass"!==e):[...new Set([...this.ui.components,"compass"])])))},m)]),this.addResolvingPromise(k().then(()=>(this._isValid=!0,p(()=>this.ready))))}destroy(){this._teardown(),this.removeAllHandles(),this._set("preconditionsReady",!1),this.frameTask=o(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get preconditionsReady(){return!(!this._isValid||0===this.width||0===this.height||0===this.videoSize[0]||0===this.videoSize[1])}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];const[e,t]=this.size,i=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),s=t*i,r=e/i;return e/t>=1?i>=1?s<=e?[s,t]:[e,r]:r<=t?[e,r]:[s,t]:i>=1?r<=t?[e,r]:[s,t]:s<=e?[s,t]:[e,r]}async hitTest(e,t){return this._operationalDataView&&this._operationalDataView.ready?this._operationalDataView.hitTest(e,t):{screenPoint:e,results:[]}}_startup(){if(!this.layer)return;const e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference);const t={renderingOptions:this.renderingOptions,backgroundColor:A,groundControlPoints:()=>this.layer?.groundControlPoints,getSize:()=>this.videoSize},i=new U(this.surface,t,new E(this.surface));this.stage=i,this._prepareStage(this.stage),this.childStage=i.childStage,this._prepareChildStage(this.childStage);const s=new x({view:this});this._set("animationManager",s);const r=new D({view:this,animationManager:s});this._set("mapViewNavigation",r),this._updateConstraints(),this.frameTask.start(),this._set("ready",!0)}_teardown(){this.stage.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer.removeAllChildren(),this._overlayContainer=null,this.removeHandles("video-view"),this._set("ready",!1),this.stateManager.teardown(),this.frameTask.stop(),this.stationaryManager.clear()}_getViewpoint(){return new i({targetGeometry:new u({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([n(()=>this.stationary,t=>e.stationary=t,m),n(()=>this.state.id,()=>e.state=this.state,m),n(()=>this.renderingOptions,t=>e.renderingOptions=t,m)],"video-view"),this._extent=new f({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new v({element:new _({video:this.layer?.videoElement,georeference:new b({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});const t=new q(this._videoElementView);this._overlayContainer=new z,this._overlayContainer.addChild(t),this._effectsContainer=new G,this._effectsContainer.addChild(this._overlayContainer),this.stage.addChild(this._effectsContainer);const i=document.createElement("div");i.classList.add("esri-video-poster"),this.container?.classList.add("esri-video-view"),this.container?.appendChild(i)}_prepareChildStage(e){this.addHandles([n(()=>this.map,async t=>{if(!t)return;const{default:i}=await import("./video/VideoOperationalDataView.js");this._operationalDataView=new i({stage:e,layerViewFilter:e=>new Set(F).has(e.type),width:this.size[0],height:this.size[1],map:t}),p(()=>this._operationalDataView?.ready).then(()=>{e.videoScreenRenderer.visible=this.operationalDataVisible})},m),n(()=>this.layer?.groundControlPoints,async()=>{if(!this.layer?.groundControlPoints||!e.state)return;const t=this.layer.groundControlPoints,i=t?.length;if(!i)return;await j();const s=new Array(i),r=e.state.spatialReference;for(let e=0;e<i;e++){const{lat:i,lon:o}=t[e];s[e]=w(new u(o,i),r)}let o=1/0,a=1/0,n=-1/0,l=-1/0;for(const e of s)o=Math.min(o,e.x),a=Math.min(a,e.y),n=Math.max(n,e.x),l=Math.max(l,e.y);const p=f.fromJSON({xmin:o,ymin:a,xmax:n,ymax:l,spatialReference:r});await(this._operationalDataView?.goTo(p,{animate:!1}).catch(()=>{}))},m)])}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){const e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),i=[];for(let r=t;r>B;r/=2)i.push(r);i.push(B);const{lods:s}=M.create({scales:i});this.constraints.set({lods:s,minScale:t})}_updatePanConstraints(){const e=e=>{if(!e.targetGeometry)return e;const[t,i]=this.videoSize,s=t*e.scale/2,r=i*e.scale/2,o=e.targetGeometry.clone();return o.x=Math.max(s,Math.min(t-s,o.x)),o.y=Math.max(r,Math.min(i-r,o.y)),e.targetGeometry=o,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}};e([h()],H.prototype,"_overlayContainer",void 0),e([h()],H.prototype,"_isValid",void 0),e([h()],H.prototype,"_effectsContainer",void 0),e([h()],H.prototype,"constraintsInfo",null),e([h()],H.prototype,"operationalDataVisible",void 0),e([h()],H.prototype,"layer",void 0),e([h()],H.prototype,"map",void 0),e([h({type:O,nonNullable:!0})],H.prototype,"navigation",void 0),e([h({readOnly:!0})],H.prototype,"preconditionsReady",null),e([h({readOnly:!0})],H.prototype,"ready",void 0),e([h({readOnly:!0})],H.prototype,"rendering",null),e([h()],H.prototype,"scale",null),e([h()],H.prototype,"spatialReference",void 0),e([h()],H.prototype,"stateManager",void 0),e([h()],H.prototype,"type",void 0),e([h(),d(e=>e instanceof T?e:g(W,e))],H.prototype,"ui",void 0),e([h({readOnly:!0})],H.prototype,"videoSize",null),e([h({readOnly:!0})],H.prototype,"view2dType",void 0),H=e([c("esri.views.VideoView")],H);const L=H;export{L as default};
package/views/View.d.ts CHANGED
@@ -19,8 +19,7 @@ import type { EventedMixin, EventedMixinProperties } from "../core/Evented.js";
19
19
  import type { EsriPromise, EsriPromiseMixinProperties } from "../core/Promise.js";
20
20
  import type { SpatialReferenceProperties } from "../geometry/SpatialReference.js";
21
21
  import type { SceneViewEventTypes } from "./ISceneView.js";
22
- import type { ViewType } from "./viewType.js";
23
- import type { Padding } from "./ui/Padding.js";
22
+ import type { Padding } from "./ui/types.js";
24
23
  import type { GraphicProperties } from "../Graphic.js";
25
24
  import type { HighlightOptionsProperties } from "./support/HighlightOptions.js";
26
25
  import type { MapProperties } from "../Map.js";
@@ -243,7 +242,7 @@ export type ViewEvents = SceneViewEventTypes;
243
242
  * });
244
243
  * ```
245
244
  *
246
- * In the snippet above, you'll notice a `container` property set on the view. The {@link views/View#container}
245
+ * In the snippet above, you'll notice a `container` property set on the view. The [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#container)
247
246
  * property is the reference to the DOM node that contains the view. This is commonly a `<div>` element. The container
248
247
  * referenced in the example above might look something like:
249
248
  *
@@ -549,17 +548,15 @@ export default abstract class View<TLayerView extends LayerView = LayerView> ext
549
548
  * signaling that the following conditions are met.
550
549
  *
551
550
  * * The view has a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map). If [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map)
552
- * is a [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html)
553
- * or a [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html), then the map or scene
554
- * must be [WebScene#loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loaded).
555
- * * The view has a {@link views/View#container} with a size greater than `0`.
556
- * * The view has a [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference), a {@link views/View#center}, and a {@link views/View#scale}.
557
- * These also can be inferred by setting an {@link views/View#extent}.
551
+ * is a [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html) or a [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html), then the map or scene must be [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loaded).
552
+ * * The view has a [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#container) with a size greater than `0`.
553
+ * * The view has a [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference), a `center`, and a `scale`.
554
+ * These also can be inferred by setting an `extent`.
558
555
  *
559
556
  * When a view becomes ready it will resolve itself and invoke
560
557
  * the callback defined in [when()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#when) where code can execute on a working view. Subsequent
561
558
  * changes to a view's readiness would typically be handled by watching `view.ready` and providing
562
- * logic for cases where the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) or {@link views/View#container} change.
559
+ * logic for cases where the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) or [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#container) change.
563
560
  *
564
561
  * @default false
565
562
  * @see [when()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#when)
@@ -694,7 +691,7 @@ export default abstract class View<TLayerView extends LayerView = LayerView> ext
694
691
  * [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html)) or `3d`
695
692
  * (indicating a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html)).
696
693
  */
697
- get type(): ViewType;
694
+ get type(): "2d" | "3d";
698
695
  /**
699
696
  * Indicates whether the view is being updated by additional data requests to the network,
700
697
  * or by processing received data.
package/views/View2D.d.ts CHANGED
@@ -28,8 +28,7 @@ import type { GoToOptions2D, GoToTarget2D, ToScreenOptions2D } from "./types.js"
28
28
  import type { Viewport2DBaseMixin, Viewport2DBaseMixinProperties } from "./Viewport2DBaseMixin.js";
29
29
  import type { Viewport2DMixin, Viewport2DMixinProperties } from "./Viewport2DMixin.js";
30
30
  import type { MapViewConstraintsProperties } from "./2d/MapViewConstraints.js";
31
- import type { LayerView2DFor } from "./2d/types.js";
32
- import type { ResizeAlign } from "./2d/ViewStateManager.js";
31
+ import type { LayerView2DFor, ResizeAlign } from "./2d/types.js";
33
32
  import type { AnalysisView2DUnion } from "./2d/analysis/types.js";
34
33
  import type { ColorBackgroundProperties } from "../webmap/background/ColorBackground.js";
35
34
  import type { PointProperties } from "../geometry/Point.js";
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Types for the [AreaMeasurementAnalysisView2D](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-analysis-AreaMeasurementAnalysisView2D.html) and
3
+ * [AreaMeasurementAnalysisView3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-analysis-AreaMeasurementAnalysisView3D.html).
4
+ *
5
+ * @since 5.0
6
+ */
1
7
  import type { Area, Length } from "../../../core/quantity.js";
2
8
  import type { MeasurementMode } from "../types.js";
3
9
 
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Types for the [DistanceMeasurementAnalysisView2D](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-analysis-DistanceMeasurementAnalysisView2D.html).
3
+ *
4
+ * @since 5.0
5
+ */
1
6
  import type { Length } from "../../../core/quantity.js";
2
7
  import type { MeasurementMode } from "../types.js";
3
8
 
@@ -4,9 +4,9 @@ import type Error from "../../../core/Error.js";
4
4
  export type ElevationProfileErrorName = "too-complex" | "elevation-query-error" | "unknown";
5
5
 
6
6
  /**
7
- * ElevationProfileError is an error class for reporting errors in an
8
- * {@link views/2d/analysis/ElevationProfileAnalysisView2D#result} or
9
- * {@link views/3d/analysis/ElevationProfileAnalysisView3D#result}.
7
+ * ElevationProfileError is an error class for reporting errors in
8
+ * [ElevationProfileAnalysisView2D#results](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-analysis-ElevationProfileAnalysisView2D.html#results) or
9
+ * [ElevationProfileAnalysisView3D#results](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-analysis-ElevationProfileAnalysisView3D.html#results).
10
10
  *
11
11
  * The following error names are defined:
12
12
  *
@@ -31,5 +31,5 @@ export default class ElevationProfileError<T = any> extends Error {
31
31
  * console.log("Error name: ", error.name);
32
32
  * });
33
33
  */
34
- name: ElevationProfileErrorName;
34
+ readonly name: ElevationProfileErrorName;
35
35
  }
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Types common to the [ElevationProfileAnalysisView2D](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-analysis-ElevationProfileAnalysisView2D.html) and
3
+ * [ElevationProfileAnalysisView3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-analysis-ElevationProfileAnalysisView3D.html).
4
+ *
5
+ * @since 5.0
6
+ */
1
7
  import type Graphic from "../../../Graphic.js";
2
8
  import type { LengthUnit } from "../../../core/units.js";
3
9
 
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Types for the various interactive analyses.
3
+ *
4
+ * @since 5.0
5
+ */
1
6
  import type { AnalysisView2DUnion } from "../2d/analysis/types.js";
2
7
  import type { AnalysisView3DUnion } from "../3d/analysis/types.js";
3
8
 
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as 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 l}from"../../core/reactiveUtils.js";import{createScreenPoint as c}from"../../core/screenUtils.js";import{property as d,subclass as h}from"../../core/accessorSupport/decorators.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{getPointConstraint as w,getPolylineOrPolygonConstraint as O,pointToConstraintSpace as M,constraintSpaceToPoint 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 G}from"../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as j}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(w),this._getPolylineOrPolygonConstraint=s(O),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 G({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},l))),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 c=this._manipulator=new f({consumesClicks:!1,grabbableForEvent:t=>"click"!==this.drawingMode||"touch"===t.pointerType&&this._snappingEnabled&&1===this._pointerDownStates.size});this.manipulators.add(c),c.grabbable="point"!==t&&"multipoint"!==t,this.addHandles([c.events.on("immediate-click",t=>this._onImmediateClick(t)),c.events.on("immediate-double-click",t=>this._onImmediateDoubleClick(t)),p(()=>this.drawingMode,()=>{this.removeHandles(L),this.addHandles(this._createManipulatorDragPipeline(c),L)},l),p(()=>({effectiveCursor:this.effectiveCursor}),({effectiveCursor:t})=>{c.cursor=t},l)]),j(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),this._activePart)}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=c(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=M(t,n),s=r?e.closestTo(r):void 0;if(!s)return t;const o=D(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 l}from"../../core/reactiveUtils.js";import{createScreenPoint as c}from"../../core/screenUtils.js";import{property as d,subclass as h}from"../../core/accessorSupport/decorators.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"./drawingModes.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{getPointConstraint as w,getPolylineOrPolygonConstraint as O,pointToConstraintSpace as M,constraintSpaceToPoint 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 G}from"../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as j}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(w),this._getPolylineOrPolygonConstraint=s(O),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 G({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},l))),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 c=this._manipulator=new f({consumesClicks:!1,grabbableForEvent:t=>"click"!==this.drawingMode||"touch"===t.pointerType&&this._snappingEnabled&&1===this._pointerDownStates.size});this.manipulators.add(c),c.grabbable="point"!==t&&"multipoint"!==t,this.addHandles([c.events.on("immediate-click",t=>this._onImmediateClick(t)),c.events.on("immediate-double-click",t=>this._onImmediateDoubleClick(t)),p(()=>this.drawingMode,()=>{this.removeHandles(L),this.addHandles(this._createManipulatorDragPipeline(c),L)},l),p(()=>({effectiveCursor:this.effectiveCursor}),({effectiveCursor:t})=>{c.cursor=t},l)]),j(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),this._activePart)}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=c(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=M(t,n),s=r?e.closestTo(r):void 0;if(!s)return t;const o=D(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};
@@ -1,5 +1,5 @@
1
1
  import type DrawAction from "./DrawAction.js";
2
- import type { DrawingMode } from "./DrawingMode.js";
2
+ import type { DrawingMode } from "./types.js";
3
3
  import type { CursorUpdateEvent } from "./input/CursorUpdateEvents.js";
4
4
  import type { DrawCompleteEvent } from "./input/DrawCompleteEvent.js";
5
5
  import type { VertexAddEvent } from "./input/VertexAddEvent.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as t,subclass as i}from"../../core/accessorSupport/decorators.js";import o from"../../geometry/Point.js";import r from"./DrawAction.js";import{drawingModes as s,defaultDrawingMode as n}from"./DrawingMode.js";import{CursorUpdateEvent as a}from"./input/CursorUpdateEvents.js";import{DrawCompleteEvent as d}from"./input/DrawCompleteEvent.js";import{VertexAddEvent as h}from"./input/VertexAddEvent.js";import{VertexRemoveEvent as p}from"./input/VertexRemoveEvent.js";import{ViewEventPriorities as l}from"../input/InputManager.js";import{sketchKeys as c}from"../interactive/keybindings.js";import{loadAutomaticLengthMeasurementUtils as _}from"../support/automaticLengthMeasurementUtils.js";import{createScreenPointFromEvent as v}from"../support/screenUtils.js";let u=class extends r{constructor(e){super(e),this._panEnabled=!1,this._popVertexOnPointerMove=!1,this._addVertexOnPointerUp=!1,this._drawTool=null,this.mode=n}initialize(){this._addViewHandles(),"3d"===this.view.type&&this.addResolvingPromise(this._addDrawTool())}destroy(){this._removeDrawTool(),this.emit("destroy")}get _dragEnabled(){return"freehand"===this.mode||"hybrid"===this.mode}get _clickEnabled(){return"click"===this.mode||"hybrid"===this.mode}undo(){this._drawTool?this._drawTool.undo():(super.undo(),this.notifyChange("vertices"))}redo(){this._drawTool?this._drawTool.redo():(super.redo(),this.notifyChange("vertices"))}canUndo(){return this._drawTool?.canUndo()??super.canUndo()}canRedo(){return this._drawTool?.canRedo()??super.canRedo()}complete(){this._completeDrawing()}_getGeometryZValue(){return this.hasZ&&this.vertices.length>0?this.vertices[0][2]:this.defaultZ}_addViewHandles(){this._addViewHandles2DOnly(),this.addHandles(this.view.on("key-down",e=>{const{key:t,repeat:i}=e;t!==c.vertexAdd||i?t!==c.complete||i?t!==c.undo||this.interactiveUndoDisabled||i?t!==c.redo||this.interactiveUndoDisabled||i||(e.stopPropagation(),this.redo()):(e.stopPropagation(),this.undo()):(e.stopPropagation(),this._drawCompleteHandler(e)):(e.stopPropagation(),this._handleVertexAddKey(e))},l.TOOL))}_addViewHandles2DOnly(){"2d"===this.view.type&&(this.addHandles([this.view.on("click",e=>{e.stopPropagation()},l.TOOL),this.view.on("pointer-down",e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._activePointerId=e.pointerId,this._addVertexOnPointerUp=!0,this._cursorScreenPoint=v(e),"touch"===e.pointerType&&this._updateCursor())},l.TOOL),this.view.on("pointer-move",e=>{this._abortSnapping(),this._popVertexOnPointerMove&&(this.undo(),this._popVertexOnPointerMove=!1),this._cursorScreenPoint=v(e),"touch"!==e.pointerType&&this._updateCursor()},l.TOOL),this.view.on("pointer-drag",e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._cursorScreenPoint=v(e),this._dragEnabled&&!this._panEnabled?this._vertexAddHandler(e):this._addVertexOnPointerUp=!1)},l.TOOL),this.view.on("pointer-up",e=>{if(this._shouldHandlePointerEvent(e)){if(this._abortSnapping(),this._activePointerId=null,!this._addVertexOnPointerUp){const t="touch"===e.pointerType;return void this._updateCursor(t)}if(!this._clickEnabled)return 1===this.vertices.length&&this.vertices.pop(),void this._drawCompleteHandler(e);this._vertexAddHandler(e)}},l.TOOL),this.view.on("drag",e=>{this._dragEnabled&&null!=this._activePointerId&&!this._panEnabled&&e.stopPropagation()},l.TOOL),this.view.on("drag",["Shift"],e=>{e.stopPropagation()},l.TOOL),this.view.on("double-click",e=>{e.stopPropagation(),this._drawCompleteHandler(e)},l.TOOL),this.view.on("double-click",["Control"],e=>{e.stopPropagation(),this._drawCompleteHandler(e)},l.TOOL),this.view.on("key-down",e=>{const{key:t,repeat:i}=e;t!==c.pan||i||(e.stopPropagation(),this._panEnabled=!0)},l.TOOL),this.view.on("key-up",e=>{e.key===c.pan&&(e.stopPropagation(),this._panEnabled=!1)},l.TOOL)]),this._addUndoRedoHandles())}_handleVertexAddKey(e){this._drawTool?this._drawTool.drawOperation.commitStagedVertex():this._cursorScreenPoint&&(this._abortSnapping(),this._vertexAddHandler(e))}_addUndoRedoHandles(){this.addHandles([this._editGeometryOperations.on("vertex-remove",e=>{if(this.notifyChange("vertices"),"undo"===e.operation){const t=[...this._committedVertices];null!=this._stagedVertex&&t.push(this._coordinateHelper.pointToArray(this._stagedVertex)),this.emit("undo",new p(this.view,e.vertices[0].index,t))}}),this._editGeometryOperations.on("vertex-add",e=>{if(this.notifyChange("vertices"),"apply"===e.operation){const e=this._committedVertices.length-1,t=new h(this.view,e,this.vertices);this.emit("vertex-add",t),t.defaultPrevented&&(this._popVertexOnPointerMove=!0)}else if("redo"===e.operation){const t=[...this._committedVertices];null!=this._stagedVertex&&t.push(this._coordinateHelper.pointToArray(this._stagedVertex)),this.emit("redo",new h(this.view,e.vertices[0].index,t))}})])}async _addDrawTool(){const[{LegacyDrawTool:e},t]=await Promise.all([import("./LegacyDrawTool.js"),_()]),i=new e({view:this.view,elevationInfo:this.elevationInfo,hasZ:this.hasZ,geometryType:"polygon",mode:this.mode,automaticLengthMeasurementUtils:t});this.destroyed?i.destroy():(this._drawTool=i,this.view.addAndActivateTool(i),i.on("vertex-add",e=>{if(1===e.vertices.length){const{view:t}=this,o=e.vertices[0].vertexIndex,r=i.getVertexCoords();this.emit("vertex-add",new h(t,o,r)),"undo"!==e.operation&&"redo"!==e.operation||this.emit(e.operation,new h(t,o,r))}}),i.on("vertex-remove",e=>{if(1===e.vertices.length){const{view:t}=this,o=e.vertices[0].vertexIndex,r=i.getVertexCoords();this.emit("vertex-remove",new p(t,o,r)),"undo"!==e.operation&&"redo"!==e.operation||this.emit(e.operation,new p(t,o,r))}}),i.on("cursor-update",e=>{1===e.vertices.length&&this.emit("cursor-update",new a(this.view,e.vertices[0].vertexIndex,i.getVertexCoords()))}),i.on("complete",e=>{this.emit("draw-complete",new d(i.getVertexCoords())),this._removeDrawTool(),this.removeAllHandles()}))}_removeDrawTool(){this._drawTool&&(this.view.tools.remove(this._drawTool),this._drawTool=null)}_addVertex(e){const t=this._coordinateHelper.arrayToVector(e);this._isDuplicateOfLastVertex(t)||(this._lastVertexUnsnapped=this._stagedVertexUnsnapped,this._popCursorVertex(),this._editGeometryOperations.appendVertexToFirstPart(t))}_updateCursor(e=!1){if(this._popCursorVertex(),!this._cursorScreenPoint)return;const t=this.getCoordsAndPointFromScreenPoint(this._cursorScreenPoint);null==t||e||this._pushCursorVertex(t.vertex,()=>this.emit("cursor-update",new a(this.view,this._activeComponent.vertices.length,this.vertices,null!=this._stagedVertex?new o(this._stagedVertex):null)))}_completeDrawing(){if(this._drawTool)return void this._drawTool.completeCreateOperation();if(this._activePointerId=null,this._popCursorVertex(),this._committedVertices.length<3)return;this._abortSnapping(),null!=this._snappingManager&&this._snappingManager.doneSnapping();const e=new d(this.vertices);this.emit("draw-complete",e),e.defaultPrevented||this.removeAllHandles()}};e([t()],u.prototype,"_dragEnabled",null),e([t()],u.prototype,"_clickEnabled",null),e([t({type:s})],u.prototype,"mode",void 0),u=e([i("esri.views.draw.PolygonDrawAction")],u);const m=u;export{m as default};
5
+ import{__decorate as e}from"tslib";import{property as t,subclass as i}from"../../core/accessorSupport/decorators.js";import o from"../../geometry/Point.js";import r from"./DrawAction.js";import{drawingModes as s,defaultDrawingMode as n}from"./drawingModes.js";import{CursorUpdateEvent as a}from"./input/CursorUpdateEvents.js";import{DrawCompleteEvent as d}from"./input/DrawCompleteEvent.js";import{VertexAddEvent as h}from"./input/VertexAddEvent.js";import{VertexRemoveEvent as p}from"./input/VertexRemoveEvent.js";import{ViewEventPriorities as l}from"../input/InputManager.js";import{sketchKeys as c}from"../interactive/keybindings.js";import{loadAutomaticLengthMeasurementUtils as _}from"../support/automaticLengthMeasurementUtils.js";import{createScreenPointFromEvent as v}from"../support/screenUtils.js";let u=class extends r{constructor(e){super(e),this._panEnabled=!1,this._popVertexOnPointerMove=!1,this._addVertexOnPointerUp=!1,this._drawTool=null,this.mode=n}initialize(){this._addViewHandles(),"3d"===this.view.type&&this.addResolvingPromise(this._addDrawTool())}destroy(){this._removeDrawTool(),this.emit("destroy")}get _dragEnabled(){return"freehand"===this.mode||"hybrid"===this.mode}get _clickEnabled(){return"click"===this.mode||"hybrid"===this.mode}undo(){this._drawTool?this._drawTool.undo():(super.undo(),this.notifyChange("vertices"))}redo(){this._drawTool?this._drawTool.redo():(super.redo(),this.notifyChange("vertices"))}canUndo(){return this._drawTool?.canUndo()??super.canUndo()}canRedo(){return this._drawTool?.canRedo()??super.canRedo()}complete(){this._completeDrawing()}_getGeometryZValue(){return this.hasZ&&this.vertices.length>0?this.vertices[0][2]:this.defaultZ}_addViewHandles(){this._addViewHandles2DOnly(),this.addHandles(this.view.on("key-down",e=>{const{key:t,repeat:i}=e;t!==c.vertexAdd||i?t!==c.complete||i?t!==c.undo||this.interactiveUndoDisabled||i?t!==c.redo||this.interactiveUndoDisabled||i||(e.stopPropagation(),this.redo()):(e.stopPropagation(),this.undo()):(e.stopPropagation(),this._drawCompleteHandler(e)):(e.stopPropagation(),this._handleVertexAddKey(e))},l.TOOL))}_addViewHandles2DOnly(){"2d"===this.view.type&&(this.addHandles([this.view.on("click",e=>{e.stopPropagation()},l.TOOL),this.view.on("pointer-down",e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._activePointerId=e.pointerId,this._addVertexOnPointerUp=!0,this._cursorScreenPoint=v(e),"touch"===e.pointerType&&this._updateCursor())},l.TOOL),this.view.on("pointer-move",e=>{this._abortSnapping(),this._popVertexOnPointerMove&&(this.undo(),this._popVertexOnPointerMove=!1),this._cursorScreenPoint=v(e),"touch"!==e.pointerType&&this._updateCursor()},l.TOOL),this.view.on("pointer-drag",e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._cursorScreenPoint=v(e),this._dragEnabled&&!this._panEnabled?this._vertexAddHandler(e):this._addVertexOnPointerUp=!1)},l.TOOL),this.view.on("pointer-up",e=>{if(this._shouldHandlePointerEvent(e)){if(this._abortSnapping(),this._activePointerId=null,!this._addVertexOnPointerUp){const t="touch"===e.pointerType;return void this._updateCursor(t)}if(!this._clickEnabled)return 1===this.vertices.length&&this.vertices.pop(),void this._drawCompleteHandler(e);this._vertexAddHandler(e)}},l.TOOL),this.view.on("drag",e=>{this._dragEnabled&&null!=this._activePointerId&&!this._panEnabled&&e.stopPropagation()},l.TOOL),this.view.on("drag",["Shift"],e=>{e.stopPropagation()},l.TOOL),this.view.on("double-click",e=>{e.stopPropagation(),this._drawCompleteHandler(e)},l.TOOL),this.view.on("double-click",["Control"],e=>{e.stopPropagation(),this._drawCompleteHandler(e)},l.TOOL),this.view.on("key-down",e=>{const{key:t,repeat:i}=e;t!==c.pan||i||(e.stopPropagation(),this._panEnabled=!0)},l.TOOL),this.view.on("key-up",e=>{e.key===c.pan&&(e.stopPropagation(),this._panEnabled=!1)},l.TOOL)]),this._addUndoRedoHandles())}_handleVertexAddKey(e){this._drawTool?this._drawTool.drawOperation.commitStagedVertex():this._cursorScreenPoint&&(this._abortSnapping(),this._vertexAddHandler(e))}_addUndoRedoHandles(){this.addHandles([this._editGeometryOperations.on("vertex-remove",e=>{if(this.notifyChange("vertices"),"undo"===e.operation){const t=[...this._committedVertices];null!=this._stagedVertex&&t.push(this._coordinateHelper.pointToArray(this._stagedVertex)),this.emit("undo",new p(this.view,e.vertices[0].index,t))}}),this._editGeometryOperations.on("vertex-add",e=>{if(this.notifyChange("vertices"),"apply"===e.operation){const e=this._committedVertices.length-1,t=new h(this.view,e,this.vertices);this.emit("vertex-add",t),t.defaultPrevented&&(this._popVertexOnPointerMove=!0)}else if("redo"===e.operation){const t=[...this._committedVertices];null!=this._stagedVertex&&t.push(this._coordinateHelper.pointToArray(this._stagedVertex)),this.emit("redo",new h(this.view,e.vertices[0].index,t))}})])}async _addDrawTool(){const[{LegacyDrawTool:e},t]=await Promise.all([import("./LegacyDrawTool.js"),_()]),i=new e({view:this.view,elevationInfo:this.elevationInfo,hasZ:this.hasZ,geometryType:"polygon",mode:this.mode,automaticLengthMeasurementUtils:t});this.destroyed?i.destroy():(this._drawTool=i,this.view.addAndActivateTool(i),i.on("vertex-add",e=>{if(1===e.vertices.length){const{view:t}=this,o=e.vertices[0].vertexIndex,r=i.getVertexCoords();this.emit("vertex-add",new h(t,o,r)),"undo"!==e.operation&&"redo"!==e.operation||this.emit(e.operation,new h(t,o,r))}}),i.on("vertex-remove",e=>{if(1===e.vertices.length){const{view:t}=this,o=e.vertices[0].vertexIndex,r=i.getVertexCoords();this.emit("vertex-remove",new p(t,o,r)),"undo"!==e.operation&&"redo"!==e.operation||this.emit(e.operation,new p(t,o,r))}}),i.on("cursor-update",e=>{1===e.vertices.length&&this.emit("cursor-update",new a(this.view,e.vertices[0].vertexIndex,i.getVertexCoords()))}),i.on("complete",e=>{this.emit("draw-complete",new d(i.getVertexCoords())),this._removeDrawTool(),this.removeAllHandles()}))}_removeDrawTool(){this._drawTool&&(this.view.tools.remove(this._drawTool),this._drawTool=null)}_addVertex(e){const t=this._coordinateHelper.arrayToVector(e);this._isDuplicateOfLastVertex(t)||(this._lastVertexUnsnapped=this._stagedVertexUnsnapped,this._popCursorVertex(),this._editGeometryOperations.appendVertexToFirstPart(t))}_updateCursor(e=!1){if(this._popCursorVertex(),!this._cursorScreenPoint)return;const t=this.getCoordsAndPointFromScreenPoint(this._cursorScreenPoint);null==t||e||this._pushCursorVertex(t.vertex,()=>this.emit("cursor-update",new a(this.view,this._activeComponent.vertices.length,this.vertices,null!=this._stagedVertex?new o(this._stagedVertex):null)))}_completeDrawing(){if(this._drawTool)return void this._drawTool.completeCreateOperation();if(this._activePointerId=null,this._popCursorVertex(),this._committedVertices.length<3)return;this._abortSnapping(),null!=this._snappingManager&&this._snappingManager.doneSnapping();const e=new d(this.vertices);this.emit("draw-complete",e),e.defaultPrevented||this.removeAllHandles()}};e([t()],u.prototype,"_dragEnabled",null),e([t()],u.prototype,"_clickEnabled",null),e([t({type:s})],u.prototype,"mode",void 0),u=e([i("esri.views.draw.PolygonDrawAction")],u);const m=u;export{m as default};
@@ -1,5 +1,5 @@
1
1
  import type DrawAction from "./DrawAction.js";
2
- import type { DrawingMode } from "./DrawingMode.js";
2
+ import type { DrawingMode } from "./types.js";
3
3
  import type { CursorUpdateEvent } from "./input/CursorUpdateEvents.js";
4
4
  import type { DrawCompleteEvent } from "./input/DrawCompleteEvent.js";
5
5
  import type { VertexAddEvent } from "./input/VertexAddEvent.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as t,subclass as i}from"../../core/accessorSupport/decorators.js";import o from"../../geometry/Point.js";import r from"./DrawAction.js";import{drawingModes as s,defaultDrawingMode as n}from"./DrawingMode.js";import{CursorUpdateEvent as a}from"./input/CursorUpdateEvents.js";import{DrawCompleteEvent as d}from"./input/DrawCompleteEvent.js";import{VertexAddEvent as h}from"./input/VertexAddEvent.js";import{VertexRemoveEvent as p}from"./input/VertexRemoveEvent.js";import{ViewEventPriorities as l}from"../input/InputManager.js";import{sketchKeys as c}from"../interactive/keybindings.js";import{loadAutomaticLengthMeasurementUtils as _}from"../support/automaticLengthMeasurementUtils.js";import{createScreenPointFromEvent as v}from"../support/screenUtils.js";let u=class extends r{constructor(e){super(e),this._panEnabled=!1,this._popVertexOnPointerMove=!1,this._addVertexOnPointerUp=!1,this._drawTool=null,this.mode=n}initialize(){this._addViewHandles(),"3d"===this.view.type&&this.addResolvingPromise(this._addDrawTool())}destroy(){this._removeDrawTool(),this.emit("destroy")}get _clickEnabled(){return"click"===this.mode||"hybrid"===this.mode}get _dragEnabled(){return"freehand"===this.mode||"hybrid"===this.mode}undo(){this._drawTool?this._drawTool.undo():(super.undo(),this.notifyChange("vertices"))}redo(){this._drawTool?this._drawTool.redo():(super.redo(),this.notifyChange("vertices"))}canUndo(){return this._drawTool?.canUndo()??super.canUndo()}canRedo(){return this._drawTool?.canRedo()??super.canRedo()}complete(){this._completeDrawing()}_addViewHandles(){this._addViewHandles2DOnly(),this.addHandles([this.view.on("key-down",e=>{const{key:t,repeat:i}=e;t!==c.vertexAdd||i?t!==c.complete||i?t!==c.undo||this.interactiveUndoDisabled||i?t!==c.redo||this.interactiveUndoDisabled||i||(e.stopPropagation(),this.redo()):(e.stopPropagation(),this.undo()):(e.stopPropagation(),this._drawCompleteHandler(e)):(e.stopPropagation(),this._handleVertexAddKey(e))},l.TOOL)])}_addViewHandles2DOnly(){"2d"===this.view.type&&(this.addHandles([this.view.on("click",e=>{e.stopPropagation()},l.TOOL),this.view.on("pointer-down",e=>{this._shouldHandlePointerEvent(e)&&!this._panEnabled&&(this._abortSnapping(),this._activePointerId=e.pointerId,this._addVertexOnPointerUp=!0,this._cursorScreenPoint=v(e),"touch"===e.pointerType&&this._updateCursor())},l.TOOL),this.view.on("pointer-move",e=>{this._popVertexOnPointerMove&&(this.undo(),this._popVertexOnPointerMove=!1),this._abortSnapping(),this._cursorScreenPoint=v(e),"touch"!==e.pointerType&&this._updateCursor()},l.TOOL),this.view.on("pointer-drag",e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._cursorScreenPoint=v(e),this._dragEnabled&&!this._panEnabled?this._vertexAddHandler(e):this._addVertexOnPointerUp=!1)},l.TOOL),this.view.on("pointer-up",e=>{if(this._shouldHandlePointerEvent(e)){if(this._abortSnapping(),this._activePointerId=null,!this._addVertexOnPointerUp){const t="touch"===e.pointerType;return void this._updateCursor(t)}if(!this._clickEnabled)return 1===this.vertices.length&&this.vertices.pop(),void this._drawCompleteHandler(e);this._vertexAddHandler(e)}},l.TOOL),this.view.on("drag",e=>{this._dragEnabled&&null!=this._activePointerId&&!this._panEnabled&&e.stopPropagation()},l.TOOL),this.view.on("drag",["Shift"],e=>{e.stopPropagation()},l.TOOL),this.view.on("double-click",e=>{e.stopPropagation(),this._drawCompleteHandler(e)},l.TOOL),this.view.on("double-click",["Control"],e=>{e.stopPropagation(),this._drawCompleteHandler(e)},l.TOOL),this.view.on("key-down",e=>{const{key:t,repeat:i}=e;t!==c.pan||i||(e.stopPropagation(),this._panEnabled=!0)},l.TOOL),this.view.on("key-up",e=>{e.key===c.pan&&(e.stopPropagation(),this._panEnabled=!1)},l.TOOL)]),this._addUndoRedoHandles())}_handleVertexAddKey(e){this._drawTool?this._drawTool.drawOperation.commitStagedVertex():this._cursorScreenPoint&&(this._abortSnapping(),this._vertexAddHandler(e))}_addUndoRedoHandles(){this.addHandles([this._editGeometryOperations.on("vertex-remove",e=>{if(this.notifyChange("vertices"),"undo"===e.operation){const t=[...this._committedVertices];null!=this._stagedVertex&&t.push(this._coordinateHelper.pointToArray(this._stagedVertex)),this.emit("undo",new p(this.view,e.vertices[0].index,t))}}),this._editGeometryOperations.on("vertex-add",e=>{if(this.notifyChange("vertices"),"apply"===e.operation){const e=this._committedVertices.length-1,t=new h(this.view,e,this.vertices);this.emit("vertex-add",t),t.defaultPrevented&&(this._popVertexOnPointerMove=!0)}else if("redo"===e.operation){const t=[...this._committedVertices];null!=this._stagedVertex&&t.push(this._coordinateHelper.pointToArray(this._stagedVertex)),this.emit("redo",new h(this.view,e.vertices[0].index,t))}})])}async _addDrawTool(){const[{LegacyDrawTool:e},t]=await Promise.all([import("./LegacyDrawTool.js"),_()]),i=new e({view:this.view,elevationInfo:this.elevationInfo,hasZ:this.hasZ,geometryType:"polyline",mode:this.mode,automaticLengthMeasurementUtils:t});this.destroyed?i.destroy():(this._drawTool=i,this.view.addAndActivateTool(i),this.addHandles([i.on("vertex-add",e=>{if(1!==e.vertices.length)return;const{view:t}=this,o=e.vertices[0].vertexIndex,r=i.getVertexCoords();this.emit("vertex-add",new h(t,o,r)),"undo"!==e.operation&&"redo"!==e.operation||this.emit(e.operation,new h(t,o,r))}),i.on("vertex-remove",e=>{if(1!==e.vertices.length)return;const{view:t}=this,o=e.vertices[0].vertexIndex,r=i.getVertexCoords();this.emit("vertex-remove",new p(t,o,r)),"undo"!==e.operation&&"redo"!==e.operation||this.emit(e.operation,new p(t,o,r))}),i.on("cursor-update",e=>{1===e.vertices.length&&this.emit("cursor-update",new a(this.view,e.vertices[0].vertexIndex,i.getVertexCoords()))}),i.on("complete",e=>{this.emit("draw-complete",new d(i.getVertexCoords())),this._removeDrawTool(),this.removeAllHandles()})]))}_removeDrawTool(){this._drawTool&&(this.view.tools.remove(this._drawTool),this._drawTool=null)}_addVertex(e){const t=this._coordinateHelper.arrayToVector(e);this._isDuplicateOfLastVertex(t)||(this._lastVertexUnsnapped=this._stagedVertexUnsnapped,this._popCursorVertex(),this._editGeometryOperations.appendVertexToFirstPart(t))}_updateCursor(e=!1){if(this._popCursorVertex(),!this._cursorScreenPoint)return;const t=this.getCoordsAndPointFromScreenPoint(this._cursorScreenPoint);null==t||e||this._pushCursorVertex(t.vertex,()=>this.emit("cursor-update",new a(this.view,this._activeComponent.vertices.length,this.vertices,null!=this._stagedVertex?new o(this._stagedVertex):null)))}_completeDrawing(){if(this._drawTool)return void this._drawTool.completeCreateOperation();if(this._activePointerId=null,this._popCursorVertex(),this._committedVertices.length<2)return;this._abortSnapping(),null!=this._snappingManager&&this._snappingManager.doneSnapping();const e=new d(this.vertices);this.emit("draw-complete",e),e.defaultPrevented||this.removeAllHandles()}};e([t()],u.prototype,"_clickEnabled",null),e([t()],u.prototype,"_dragEnabled",null),e([t({type:s})],u.prototype,"mode",void 0),u=e([i("esri.views.draw.PolylineDrawAction")],u);const m=u;export{m as default};
5
+ import{__decorate as e}from"tslib";import{property as t,subclass as i}from"../../core/accessorSupport/decorators.js";import o from"../../geometry/Point.js";import r from"./DrawAction.js";import{drawingModes as s,defaultDrawingMode as n}from"./drawingModes.js";import{CursorUpdateEvent as a}from"./input/CursorUpdateEvents.js";import{DrawCompleteEvent as d}from"./input/DrawCompleteEvent.js";import{VertexAddEvent as h}from"./input/VertexAddEvent.js";import{VertexRemoveEvent as p}from"./input/VertexRemoveEvent.js";import{ViewEventPriorities as l}from"../input/InputManager.js";import{sketchKeys as c}from"../interactive/keybindings.js";import{loadAutomaticLengthMeasurementUtils as _}from"../support/automaticLengthMeasurementUtils.js";import{createScreenPointFromEvent as v}from"../support/screenUtils.js";let u=class extends r{constructor(e){super(e),this._panEnabled=!1,this._popVertexOnPointerMove=!1,this._addVertexOnPointerUp=!1,this._drawTool=null,this.mode=n}initialize(){this._addViewHandles(),"3d"===this.view.type&&this.addResolvingPromise(this._addDrawTool())}destroy(){this._removeDrawTool(),this.emit("destroy")}get _clickEnabled(){return"click"===this.mode||"hybrid"===this.mode}get _dragEnabled(){return"freehand"===this.mode||"hybrid"===this.mode}undo(){this._drawTool?this._drawTool.undo():(super.undo(),this.notifyChange("vertices"))}redo(){this._drawTool?this._drawTool.redo():(super.redo(),this.notifyChange("vertices"))}canUndo(){return this._drawTool?.canUndo()??super.canUndo()}canRedo(){return this._drawTool?.canRedo()??super.canRedo()}complete(){this._completeDrawing()}_addViewHandles(){this._addViewHandles2DOnly(),this.addHandles([this.view.on("key-down",e=>{const{key:t,repeat:i}=e;t!==c.vertexAdd||i?t!==c.complete||i?t!==c.undo||this.interactiveUndoDisabled||i?t!==c.redo||this.interactiveUndoDisabled||i||(e.stopPropagation(),this.redo()):(e.stopPropagation(),this.undo()):(e.stopPropagation(),this._drawCompleteHandler(e)):(e.stopPropagation(),this._handleVertexAddKey(e))},l.TOOL)])}_addViewHandles2DOnly(){"2d"===this.view.type&&(this.addHandles([this.view.on("click",e=>{e.stopPropagation()},l.TOOL),this.view.on("pointer-down",e=>{this._shouldHandlePointerEvent(e)&&!this._panEnabled&&(this._abortSnapping(),this._activePointerId=e.pointerId,this._addVertexOnPointerUp=!0,this._cursorScreenPoint=v(e),"touch"===e.pointerType&&this._updateCursor())},l.TOOL),this.view.on("pointer-move",e=>{this._popVertexOnPointerMove&&(this.undo(),this._popVertexOnPointerMove=!1),this._abortSnapping(),this._cursorScreenPoint=v(e),"touch"!==e.pointerType&&this._updateCursor()},l.TOOL),this.view.on("pointer-drag",e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._cursorScreenPoint=v(e),this._dragEnabled&&!this._panEnabled?this._vertexAddHandler(e):this._addVertexOnPointerUp=!1)},l.TOOL),this.view.on("pointer-up",e=>{if(this._shouldHandlePointerEvent(e)){if(this._abortSnapping(),this._activePointerId=null,!this._addVertexOnPointerUp){const t="touch"===e.pointerType;return void this._updateCursor(t)}if(!this._clickEnabled)return 1===this.vertices.length&&this.vertices.pop(),void this._drawCompleteHandler(e);this._vertexAddHandler(e)}},l.TOOL),this.view.on("drag",e=>{this._dragEnabled&&null!=this._activePointerId&&!this._panEnabled&&e.stopPropagation()},l.TOOL),this.view.on("drag",["Shift"],e=>{e.stopPropagation()},l.TOOL),this.view.on("double-click",e=>{e.stopPropagation(),this._drawCompleteHandler(e)},l.TOOL),this.view.on("double-click",["Control"],e=>{e.stopPropagation(),this._drawCompleteHandler(e)},l.TOOL),this.view.on("key-down",e=>{const{key:t,repeat:i}=e;t!==c.pan||i||(e.stopPropagation(),this._panEnabled=!0)},l.TOOL),this.view.on("key-up",e=>{e.key===c.pan&&(e.stopPropagation(),this._panEnabled=!1)},l.TOOL)]),this._addUndoRedoHandles())}_handleVertexAddKey(e){this._drawTool?this._drawTool.drawOperation.commitStagedVertex():this._cursorScreenPoint&&(this._abortSnapping(),this._vertexAddHandler(e))}_addUndoRedoHandles(){this.addHandles([this._editGeometryOperations.on("vertex-remove",e=>{if(this.notifyChange("vertices"),"undo"===e.operation){const t=[...this._committedVertices];null!=this._stagedVertex&&t.push(this._coordinateHelper.pointToArray(this._stagedVertex)),this.emit("undo",new p(this.view,e.vertices[0].index,t))}}),this._editGeometryOperations.on("vertex-add",e=>{if(this.notifyChange("vertices"),"apply"===e.operation){const e=this._committedVertices.length-1,t=new h(this.view,e,this.vertices);this.emit("vertex-add",t),t.defaultPrevented&&(this._popVertexOnPointerMove=!0)}else if("redo"===e.operation){const t=[...this._committedVertices];null!=this._stagedVertex&&t.push(this._coordinateHelper.pointToArray(this._stagedVertex)),this.emit("redo",new h(this.view,e.vertices[0].index,t))}})])}async _addDrawTool(){const[{LegacyDrawTool:e},t]=await Promise.all([import("./LegacyDrawTool.js"),_()]),i=new e({view:this.view,elevationInfo:this.elevationInfo,hasZ:this.hasZ,geometryType:"polyline",mode:this.mode,automaticLengthMeasurementUtils:t});this.destroyed?i.destroy():(this._drawTool=i,this.view.addAndActivateTool(i),this.addHandles([i.on("vertex-add",e=>{if(1!==e.vertices.length)return;const{view:t}=this,o=e.vertices[0].vertexIndex,r=i.getVertexCoords();this.emit("vertex-add",new h(t,o,r)),"undo"!==e.operation&&"redo"!==e.operation||this.emit(e.operation,new h(t,o,r))}),i.on("vertex-remove",e=>{if(1!==e.vertices.length)return;const{view:t}=this,o=e.vertices[0].vertexIndex,r=i.getVertexCoords();this.emit("vertex-remove",new p(t,o,r)),"undo"!==e.operation&&"redo"!==e.operation||this.emit(e.operation,new p(t,o,r))}),i.on("cursor-update",e=>{1===e.vertices.length&&this.emit("cursor-update",new a(this.view,e.vertices[0].vertexIndex,i.getVertexCoords()))}),i.on("complete",e=>{this.emit("draw-complete",new d(i.getVertexCoords())),this._removeDrawTool(),this.removeAllHandles()})]))}_removeDrawTool(){this._drawTool&&(this.view.tools.remove(this._drawTool),this._drawTool=null)}_addVertex(e){const t=this._coordinateHelper.arrayToVector(e);this._isDuplicateOfLastVertex(t)||(this._lastVertexUnsnapped=this._stagedVertexUnsnapped,this._popCursorVertex(),this._editGeometryOperations.appendVertexToFirstPart(t))}_updateCursor(e=!1){if(this._popCursorVertex(),!this._cursorScreenPoint)return;const t=this.getCoordsAndPointFromScreenPoint(this._cursorScreenPoint);null==t||e||this._pushCursorVertex(t.vertex,()=>this.emit("cursor-update",new a(this.view,this._activeComponent.vertices.length,this.vertices,null!=this._stagedVertex?new o(this._stagedVertex):null)))}_completeDrawing(){if(this._drawTool)return void this._drawTool.completeCreateOperation();if(this._activePointerId=null,this._popCursorVertex(),this._committedVertices.length<2)return;this._abortSnapping(),null!=this._snappingManager&&this._snappingManager.doneSnapping();const e=new d(this.vertices);this.emit("draw-complete",e),e.defaultPrevented||this.removeAllHandles()}};e([t()],u.prototype,"_clickEnabled",null),e([t()],u.prototype,"_dragEnabled",null),e([t({type:s})],u.prototype,"mode",void 0),u=e([i("esri.views.draw.PolylineDrawAction")],u);const m=u;export{m as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as i}from"tslib";import{EventedAccessor as t}from"../../../core/Evented.js";import{clone as e}from"../../../core/lang.js";import{watch as s,when as r}from"../../../core/reactiveUtils.js";import{property as h,subclass as a}from"../../../core/accessorSupport/decorators.js";import o from"../../../layers/GraphicsLayer.js";import n from"../../../symbols/SimpleFillSymbol.js";import c from"../../../symbols/SimpleLineSymbol.js";import l from"../../../symbols/SimpleMarkerSymbol.js";import{cloneMove as p}from"./drawUtils.js";import d from"./HighlightHelper.js";import{addUniqueLayer as g,findLayerView as v}from"./layerUtils.js";import{GraphicClickEvent as m,GraphicDoubleClickEvent as _,GraphicPointerDownEvent as y,GraphicPointerUpEvent as f,GraphicPointerOutEvent as u,GraphicPointerOverEvent as w,GraphicMoveStartEvent as G,GraphicMoveEvent as b,GraphicMoveStopEvent as k}from"./input/GraphicMoverEvents.js";import{ViewEventPriorities as O}from"../../input/InputManager.js";import{GraphicManipulator as x}from"../../interactive/GraphicManipulator.js";import{createScreenPointFromEvent as H}from"../../support/screenUtils.js";const M="indicator-symbols";let E=class extends t{constructor(i){super(i),this._activeGraphic=null,this._dragEvent=null,this._hoverGraphic=null,this._indicators=[],this._initialDragGeometry=null,this._manipulators=[],this._layerViews=null,this.type="graphic-mover",this.callbacks={onGraphicClick(){},onGraphicDoubleClick(){},onGraphicMoveStart(){},onGraphicMove(){},onGraphicMoveStop(){},onGraphicPointerOver(){},onGraphicPointerOut(){},onGraphicPointerDown(){},onGraphicPointerUp(){}},this.enableMoveAllGraphics=!1,this.graphics=[],this.highlightName=null,this.highlightsEnabled=!1,this.indicatorsEnabled=!1,this._defaultLayer=new o({listMode:"hide",internal:!0,title:"GraphicMover highlight layer"}),this.layer=this._defaultLayer,this.view=null}initialize(){g(this.view,this.layer),this._highlightHelper=new d({view:this.view}),this.refresh(),this.addHandles([s(()=>this.graphics.length,()=>this.refresh()),r(()=>this.view?.ready,()=>{this.addHandles([this.view.on("immediate-click",i=>this._clickHandler(i),O.TOOL),this.view.on("double-click",i=>this._doubleClickHandler(i),O.TOOL),this.view.on("pointer-down",i=>this._pointerDownHandler(i),O.TOOL),this.view.on("pointer-move",i=>this._pointerMoveHandler(i),O.TOOL),this.view.on("pointer-up",i=>this._pointerUpHandler(i),O.TOOL),this.view.on("drag",i=>this._dragHandler(i),O.TOOL),this.view.on("key-down",i=>this._keyDownHandler(i),O.TOOL)])},{once:!0,initial:!0}),s(()=>this.view,i=>{this._highlightHelper.removeAll(),this._highlightHelper.view=i}),s(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()})])}destroy(){this._removeIndicators(),this.view.map?.remove(this.layer),this._defaultLayer.destroy(),this.reset(),this._manipulators.forEach(i=>i.destroy()),this._manipulators=null}get state(){const i=this.view.ready,t=this.graphics.length>0,e=this._activeGraphic;return i&&t?e?"moving":"active":i?"ready":"disabled"}refresh(){this.reset(),this._setup()}reset(){this._activeGraphic=null,this._hoverGraphic=null,this._dragEvent=null,this._highlightHelper.removeAll()}updateGeometry(i,t){const e=this.graphics[i];e&&(e.set("geometry",t),this._setUpIndicators())}_setup(){this._setUpHighlights(),this._setUpIndicators(),this._setUpManipulators(),this._syncLayerViews()}_clickHandler(i){const t=this._findTargetGraphic(H(i));if(t){const e=new m(t,this.graphics.indexOf(t),i.x,i.y,i);this.emit("graphic-click",e),this.callbacks.onGraphicClick?.(e)}}_doubleClickHandler(i){const t=this._findTargetGraphic(H(i));if(t){const e=new _(t,this.graphics.indexOf(t),i.x,i.y,i);this.emit("graphic-double-click",e),this.callbacks.onGraphicDoubleClick?.(e)}}_pointerDownHandler(i){const t=this._findTargetGraphic(H(i));if(t){this._activeGraphic=t;const{x:e,y:s}=i,r=new y(t,this.graphics.indexOf(t),e,s,i);this.emit("graphic-pointer-down",r),this.callbacks.onGraphicPointerDown?.(r)}else this._activeGraphic=null}_pointerUpHandler(i){if(this._activeGraphic){const{x:t,y:e}=i,s=this.graphics.indexOf(this._activeGraphic),r=new f(this._activeGraphic,s,t,e,i);this.emit("graphic-pointer-up",r),this.callbacks.onGraphicPointerUp?.(r),this._hoverGraphic=this._activeGraphic}}_pointerMoveHandler(i){if(this._dragEvent)return;const t=this._findTargetGraphic(H(i));if(t){const{x:e,y:s}=i;if(this._hoverGraphic){if(this._hoverGraphic===t)return;const r=this.graphics.indexOf(this._hoverGraphic),h=new u(this.graphics[r],r,e,s,i);this._hoverGraphic=null,this.emit("graphic-pointer-out",h),this.callbacks.onGraphicPointerOut?.(h)}const r=this.graphics.indexOf(t),h=new w(t,r,e,s,i);return this._hoverGraphic=t,this.emit("graphic-pointer-over",h),void this.callbacks.onGraphicPointerOver?.(h)}if(this._hoverGraphic){const{x:t,y:e}=i,s=this.graphics.indexOf(this._hoverGraphic),r=new u(this.graphics[s],s,t,e,i);this._hoverGraphic=null,this.emit("graphic-pointer-out",r),this.callbacks.onGraphicPointerOut?.(r)}}_dragHandler(i){if("start"!==i.action&&!this._dragEvent||!this._activeGraphic?.geometry)return;"start"===i.action&&this._removeIndicators(),i.stopPropagation();const{action:t,x:s,y:r}=i,h=this.graphics.indexOf(this._activeGraphic),a=this._dragEvent?s-this._dragEvent.x:0,o=this._dragEvent?r-this._dragEvent.y:0,n=s-i.origin.x,c=r-i.origin.y,l="start"===t?this._activeGraphic.geometry:this._initialDragGeometry,d=p(l,n,c,this.view);if(this._activeGraphic.geometry=d,this.enableMoveAllGraphics&&this.graphics.forEach(i=>{i!==this._activeGraphic&&(i.geometry=p(i.geometry,a,o,this.view))}),this._dragEvent=i,"start"===t){this._initialDragGeometry=e(l);const t=new G(this._activeGraphic,this.graphics,h,s,r,a,o,n,c,i);this.emit("graphic-move-start",t),this.callbacks.onGraphicMoveStart?.(t),t.defaultPrevented&&this._activeGraphic.set("geometry",l)}else if("update"===t){const t=new b(this._activeGraphic,this.graphics,h,s,r,a,o,n,c,i);this.emit("graphic-move",t),this.callbacks.onGraphicMove?.(t),t.defaultPrevented&&(this._activeGraphic.geometry=l)}else{const t=new k(this._activeGraphic,this.graphics,h,s,r,a,o,n,c,i);this._dragEvent=null,this._activeGraphic=null,this._setUpIndicators(),this.emit("graphic-move-stop",t),this.callbacks.onGraphicMoveStop?.(t),t.defaultPrevented&&(this.graphics[h].set("geometry",this._initialDragGeometry),this._setUpIndicators()),this._initialDragGeometry=null}}_keyDownHandler(i){"a"!==i.key&&"d"!==i.key&&"n"!==i.key||"moving"!==this.state||i.stopPropagation()}_findTargetGraphic(i){const t=this.view.toMap(i),e=this.graphics;let s=null,r=Number.MAX_VALUE;this._syncLayerViews();const h=this._layerViews.flatMap(i=>"graphicsViews"in i?Array.from(i.graphicsViews(),i=>i.hitTest(t)).flat():i.graphicsView.hitTest(t)).filter(i=>e.includes(i)).sort((i,t)=>e.indexOf(i)-e.indexOf(t));return h.length?h[0]:(this._manipulators.forEach(t=>{const e=t.intersectionDistance(i);null!=e&&e<r&&(r=e,s=t.graphic)}),s)}_syncLayerViews(){this._layerViews=[];const i=new Set;for(const t of this.graphics){const e=v(this.view,t.layer);e&&i.add(e)}this._layerViews=[...i]}_setUpManipulators(){const{graphics:i,view:t}=this;this._manipulators.forEach(i=>i.destroy()),this._manipulators=i.length?i.map(i=>new x({graphic:i,view:t})):[]}_setUpHighlights(){this.highlightsEnabled&&this.graphics.length&&this._highlightHelper.add(this.graphics,this.highlightName)}_setUpIndicators(){if(this._removeIndicators(),this.indicatorsEnabled){for(const i of this.graphics){const t=i.clone();t.symbol=U(i),this._indicators.push(t),this.addHandles(s(()=>i.symbol,()=>this._setUpIndicators()),M)}this.layer.addMany(this._indicators)}}_removeIndicators(){this.removeHandles(M),this._indicators.length&&(this.layer.removeMany(this._indicators),this._indicators.forEach(i=>i.destroy()),this._indicators=[])}};function U(i){const t=12;if(null==i.symbol)return null;switch(i.symbol.type){case"cim":return new l({style:"circle",size:t,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}});case"picture-marker":{const{xoffset:t,yoffset:e,height:s,width:r}=i.symbol,h=s===r?r:Math.max(s,r);return new l({xoffset:t,yoffset:e,size:h,style:"square",color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}case"simple-marker":{const{xoffset:t,yoffset:e,size:s,style:r}=i.symbol;return new l({xoffset:t,yoffset:e,style:"circle"===r?"circle":"square",size:s+2,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}case"simple-fill":return new n({color:[0,0,0,0],outline:{style:"dash",color:[255,127,0,1],width:1}});case"simple-line":return new c({color:[255,127,0,1],style:"dash",width:1});case"text":{const{xoffset:e,yoffset:s}=i.symbol;return new l({xoffset:e,yoffset:s,size:t,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}default:return null}}i([h()],E.prototype,"_activeGraphic",void 0),i([h({readOnly:!0})],E.prototype,"type",void 0),i([h()],E.prototype,"callbacks",void 0),i([h()],E.prototype,"enableMoveAllGraphics",void 0),i([h()],E.prototype,"graphics",void 0),i([h()],E.prototype,"highlightName",void 0),i([h()],E.prototype,"highlightsEnabled",void 0),i([h()],E.prototype,"indicatorsEnabled",void 0),i([h()],E.prototype,"_defaultLayer",void 0),i([h()],E.prototype,"layer",void 0),i([h({readOnly:!0})],E.prototype,"state",null),i([h()],E.prototype,"view",void 0),E=i([a("esri.views.draw.support.GraphicMover")],E);const L=E;export{L as default};
5
+ import{__decorate as i}from"tslib";import{EventedAccessor as t}from"../../../core/Evented.js";import{clone as e}from"../../../core/lang.js";import{watch as s,when as r}from"../../../core/reactiveUtils.js";import{property as h,subclass as o}from"../../../core/accessorSupport/decorators.js";import a from"../../../layers/GraphicsLayer.js";import n from"../../../symbols/SimpleFillSymbol.js";import c from"../../../symbols/SimpleLineSymbol.js";import l from"../../../symbols/SimpleMarkerSymbol.js";import{cloneMove as p}from"./drawUtils.js";import d from"./HighlightHelper.js";import{addUniqueLayer as g,findLayerView as v}from"./layerUtils.js";import{GraphicClickEvent as y,GraphicDoubleClickEvent as _,GraphicPointerDownEvent as m,GraphicPointerUpEvent as f,GraphicPointerOutEvent as u,GraphicPointerOverEvent as w,GraphicMoveStartEvent as G,GraphicMoveEvent as b,GraphicMoveStopEvent as k}from"./input/GraphicMoverEvents.js";import{ViewEventPriorities as O}from"../../input/InputManager.js";import{createScreenPointFromEvent as x}from"../../support/screenUtils.js";const H="indicator-symbols";let M=class extends t{constructor(i){super(i),this._activeGraphic=null,this._dragEvent=null,this._hoverGraphic=null,this._indicators=[],this._initialDragGeometry=null,this._layerViews=null,this.type="graphic-mover",this.callbacks={onGraphicClick(){},onGraphicDoubleClick(){},onGraphicMoveStart(){},onGraphicMove(){},onGraphicMoveStop(){},onGraphicPointerOver(){},onGraphicPointerOut(){},onGraphicPointerDown(){},onGraphicPointerUp(){}},this.enableMoveAllGraphics=!1,this.graphics=[],this.highlightName=null,this.highlightsEnabled=!1,this.indicatorsEnabled=!1,this._defaultLayer=new a({listMode:"hide",internal:!0,title:"GraphicMover highlight layer"}),this.layer=this._defaultLayer,this.view=null}initialize(){g(this.view,this.layer),this._highlightHelper=new d({view:this.view}),this.refresh(),this.addHandles([s(()=>this.graphics.length,()=>this.refresh()),r(()=>this.view?.ready,()=>{this.addHandles([this.view.on("immediate-click",i=>this._clickHandler(i),O.TOOL),this.view.on("double-click",i=>this._doubleClickHandler(i),O.TOOL),this.view.on("pointer-down",i=>this._pointerDownHandler(i),O.TOOL),this.view.on("pointer-move",i=>this._pointerMoveHandler(i),O.TOOL),this.view.on("pointer-up",i=>this._pointerUpHandler(i),O.TOOL),this.view.on("drag",i=>this._dragHandler(i),O.TOOL),this.view.on("key-down",i=>this._keyDownHandler(i),O.TOOL)])},{once:!0,initial:!0}),s(()=>this.view,i=>{this._highlightHelper.removeAll(),this._highlightHelper.view=i}),s(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()})])}destroy(){this._removeIndicators(),this.view.map?.remove(this.layer),this._defaultLayer.destroy(),this.reset()}get state(){const i=this.view.ready,t=this.graphics.length>0,e=this._activeGraphic;return i&&t?e?"moving":"active":i?"ready":"disabled"}refresh(){this.reset(),this._setup()}reset(){this._activeGraphic=null,this._hoverGraphic=null,this._dragEvent=null,this._highlightHelper.removeAll()}updateGeometry(i,t){const e=this.graphics[i];e&&(e.set("geometry",t),this._setUpIndicators())}_setup(){this._setUpHighlights(),this._setUpIndicators(),this._syncLayerViews()}_clickHandler(i){const t=this._findTargetGraphic(x(i));if(t){const e=new y(t,this.graphics.indexOf(t),i.x,i.y,i);this.emit("graphic-click",e),this.callbacks.onGraphicClick?.(e)}}_doubleClickHandler(i){const t=this._findTargetGraphic(x(i));if(t){const e=new _(t,this.graphics.indexOf(t),i.x,i.y,i);this.emit("graphic-double-click",e),this.callbacks.onGraphicDoubleClick?.(e)}}_pointerDownHandler(i){const t=this._findTargetGraphic(x(i));if(t){this._activeGraphic=t;const{x:e,y:s}=i,r=new m(t,this.graphics.indexOf(t),e,s,i);this.emit("graphic-pointer-down",r),this.callbacks.onGraphicPointerDown?.(r)}else this._activeGraphic=null}_pointerUpHandler(i){if(this._activeGraphic){const{x:t,y:e}=i,s=this.graphics.indexOf(this._activeGraphic),r=new f(this._activeGraphic,s,t,e,i);this.emit("graphic-pointer-up",r),this.callbacks.onGraphicPointerUp?.(r),this._hoverGraphic=this._activeGraphic}}_pointerMoveHandler(i){if(this._dragEvent)return;const t=this._findTargetGraphic(x(i));if(t){const{x:e,y:s}=i;if(this._hoverGraphic){if(this._hoverGraphic===t)return;const r=this.graphics.indexOf(this._hoverGraphic),h=new u(this.graphics[r],r,e,s,i);this._hoverGraphic=null,this.emit("graphic-pointer-out",h),this.callbacks.onGraphicPointerOut?.(h)}const r=this.graphics.indexOf(t),h=new w(t,r,e,s,i);return this._hoverGraphic=t,this.emit("graphic-pointer-over",h),void this.callbacks.onGraphicPointerOver?.(h)}if(this._hoverGraphic){const{x:t,y:e}=i,s=this.graphics.indexOf(this._hoverGraphic),r=new u(this.graphics[s],s,t,e,i);this._hoverGraphic=null,this.emit("graphic-pointer-out",r),this.callbacks.onGraphicPointerOut?.(r)}}_dragHandler(i){if("start"!==i.action&&!this._dragEvent||!this._activeGraphic?.geometry)return;"start"===i.action&&this._removeIndicators(),i.stopPropagation();const{action:t,x:s,y:r}=i,h=this.graphics.indexOf(this._activeGraphic),o=this._dragEvent?s-this._dragEvent.x:0,a=this._dragEvent?r-this._dragEvent.y:0,n=s-i.origin.x,c=r-i.origin.y,l="start"===t?this._activeGraphic.geometry:this._initialDragGeometry,d=p(l,n,c,this.view);if(this._activeGraphic.geometry=d,this.enableMoveAllGraphics&&this.graphics.forEach(i=>{i!==this._activeGraphic&&(i.geometry=p(i.geometry,o,a,this.view))}),this._dragEvent=i,"start"===t){this._initialDragGeometry=e(l);const t=new G(this._activeGraphic,this.graphics,h,s,r,o,a,n,c,i);this.emit("graphic-move-start",t),this.callbacks.onGraphicMoveStart?.(t),t.defaultPrevented&&this._activeGraphic.set("geometry",l)}else if("update"===t){const t=new b(this._activeGraphic,this.graphics,h,s,r,o,a,n,c,i);this.emit("graphic-move",t),this.callbacks.onGraphicMove?.(t),t.defaultPrevented&&(this._activeGraphic.geometry=l)}else{const t=new k(this._activeGraphic,this.graphics,h,s,r,o,a,n,c,i);this._dragEvent=null,this._activeGraphic=null,this._setUpIndicators(),this.emit("graphic-move-stop",t),this.callbacks.onGraphicMoveStop?.(t),t.defaultPrevented&&(this.graphics[h].set("geometry",this._initialDragGeometry),this._setUpIndicators()),this._initialDragGeometry=null}}_keyDownHandler(i){"a"!==i.key&&"d"!==i.key&&"n"!==i.key||"moving"!==this.state||i.stopPropagation()}_findTargetGraphic(i){const t=this.view.toMap(i),e=this.graphics;this._syncLayerViews();const s=this._layerViews.flatMap(i=>"graphicsViews"in i?Array.from(i.graphicsViews(),i=>i.hitTest(t)).flat():i.graphicsView.hitTest(t)).filter(i=>e.includes(i)).sort((i,t)=>e.indexOf(i)-e.indexOf(t));return s.length?s[0]:null}_syncLayerViews(){this._layerViews=[];const i=new Set;for(const t of this.graphics){const e=v(this.view,t.layer);e&&i.add(e)}this._layerViews=[...i]}_setUpHighlights(){this.highlightsEnabled&&this.graphics.length&&this._highlightHelper.add(this.graphics,this.highlightName)}_setUpIndicators(){if(this._removeIndicators(),this.indicatorsEnabled){for(const i of this.graphics){const t=i.clone();t.symbol=E(i),this._indicators.push(t),this.addHandles(s(()=>i.symbol,()=>this._setUpIndicators()),H)}this.layer.addMany(this._indicators)}}_removeIndicators(){this.removeHandles(H),this._indicators.length&&(this.layer.removeMany(this._indicators),this._indicators.forEach(i=>i.destroy()),this._indicators=[])}};function E(i){const t=12;if(null==i.symbol)return null;switch(i.symbol.type){case"cim":return new l({style:"circle",size:t,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}});case"picture-marker":{const{xoffset:t,yoffset:e,height:s,width:r}=i.symbol,h=s===r?r:Math.max(s,r);return new l({xoffset:t,yoffset:e,size:h,style:"square",color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}case"simple-marker":{const{xoffset:t,yoffset:e,size:s,style:r}=i.symbol;return new l({xoffset:t,yoffset:e,style:"circle"===r?"circle":"square",size:s+2,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}case"simple-fill":return new n({color:[0,0,0,0],outline:{style:"dash",color:[255,127,0,1],width:1}});case"simple-line":return new c({color:[255,127,0,1],style:"dash",width:1});case"text":{const{xoffset:e,yoffset:s}=i.symbol;return new l({xoffset:e,yoffset:s,size:t,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}default:return null}}i([h()],M.prototype,"_activeGraphic",void 0),i([h({readOnly:!0})],M.prototype,"type",void 0),i([h()],M.prototype,"callbacks",void 0),i([h()],M.prototype,"enableMoveAllGraphics",void 0),i([h()],M.prototype,"graphics",void 0),i([h()],M.prototype,"highlightName",void 0),i([h()],M.prototype,"highlightsEnabled",void 0),i([h()],M.prototype,"indicatorsEnabled",void 0),i([h()],M.prototype,"_defaultLayer",void 0),i([h()],M.prototype,"layer",void 0),i([h({readOnly:!0})],M.prototype,"state",null),i([h()],M.prototype,"view",void 0),M=i([o("esri.views.draw.support.GraphicMover")],M);const U=M;export{U as default};
@@ -12,4 +12,6 @@ export interface DrawOptions {
12
12
  * click | Vertices are added when the pointer is clicked.
13
13
  */
14
14
  mode?: "hybrid" | "freehand" | "click";
15
- }
15
+ }
16
+
17
+ export type DrawingMode = "click" | "freehand" | "hybrid";