@arcgis/core 5.0.0-next.14 → 5.0.0-next.15

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 (348) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/applications/Components/QuantityFormatter.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{5299ec59c86022ca37e2.js → 080268f78436a2f0d996.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{a6ee40dfc471d6612f3c.js → 1585298168c200d65c2f.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{34bb4852ebef0f529c96.js → 1a98e35837c6279fd8ee.js} +1 -1
  7. package/assets/esri/core/workers/chunks/5608e1eeec887295dc7c.js +1 -0
  8. package/assets/esri/core/workers/chunks/57262321c51096ef885f.js +1 -0
  9. package/assets/esri/core/workers/chunks/58d891779f04b6d12fc0.js +1 -0
  10. package/assets/esri/core/workers/chunks/{7c14f99e6cfff2a8ef4a.js → 5a7bb13ccb9188f90dfd.js} +1 -1
  11. package/assets/esri/core/workers/chunks/607beb12592f99871bf9.js +1 -0
  12. package/assets/esri/core/workers/chunks/{8be16b03caa947ac7631.js → 79326e3ebd5081046f79.js} +1 -1
  13. package/assets/esri/core/workers/chunks/7c08c0824ad354177787.js +1 -0
  14. package/assets/esri/core/workers/chunks/{54c49a768147720c3c56.js → 8208dfa8f7fae7e616b9.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{d7755c4c8d1d3059efca.js → 847f4fc39100fac1df01.js} +1 -1
  16. package/assets/esri/core/workers/chunks/8b73db0f4d6714396eb0.js +1 -0
  17. package/assets/esri/core/workers/chunks/{9cdd087c43a601ec331d.js → 9a7f7de06dbc37661ffb.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{55adbd7481f8dfb1067e.js → a174c9f6bc687349e563.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{38fa50336983265c73a4.js → bc318b6fef192cee2a72.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{57806a01f33074b601e7.js → cdb4664fd59860ddeb5a.js} +1 -1
  21. package/assets/esri/core/workers/chunks/d98203c932a60f9f809d.js +1 -0
  22. package/assets/esri/core/workers/chunks/{5e08b19e6d7202ea38d7.js → db900e8949cc75e72b18.js} +1 -1
  23. package/assets/esri/core/workers/chunks/de831a9cb542a09db5c3.js +1 -0
  24. package/assets/esri/core/workers/chunks/{2166238a7ad63a2d43c7.js → e05ce6f91ca59e34da7c.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{f28ffda9a95c6568503d.js → e07dda45281439e6582e.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{d888ae5ac1810a486919.js → ff8752dbcb014ea66806.js} +1 -1
  27. package/chunks/GaussianSplat.glsl.js +2 -2
  28. package/config.js +1 -1
  29. package/copyright.txt +0 -60
  30. package/core/SetUtils.js +1 -1
  31. package/core/workers/workerFactory.js +1 -1
  32. package/identity/IdentityModal.js +1 -1
  33. package/interfaces.d.ts +105 -9
  34. package/intl.js +1 -1
  35. package/kernel.js +1 -1
  36. package/layers/ImageryTileLayer.js +1 -1
  37. package/layers/ParquetLayer.js +1 -1
  38. package/layers/graphics/sources/ParquetSource.js +1 -1
  39. package/layers/graphics/sources/support/QueryTask.js +1 -1
  40. package/layers/mixins/ArcGISImageService.js +1 -1
  41. package/layers/mixins/ImageryTileMixin.js +1 -1
  42. package/layers/support/NumberFieldFormat.js +1 -1
  43. package/layers/support/Sublayer.js +1 -1
  44. package/layers/support/SubtypeSublayer.js +1 -1
  45. package/layers/support/featureLayerUtils.js +1 -1
  46. package/layers/support/fieldUtils.js +1 -1
  47. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  48. package/layers/support/rasterFunctionUtils.js +1 -1
  49. package/package.json +1 -1
  50. package/popup/content.js +1 -1
  51. package/portal/schemas/definitions.js +1 -1
  52. package/renderers/support/numberUtils.js +1 -1
  53. package/rest/geometryService.js +1 -1
  54. package/rest/geoprocessor.js +1 -1
  55. package/rest/imageService.js +1 -1
  56. package/rest/locator.js +1 -1
  57. package/rest/query.js +1 -1
  58. package/smartMapping/labels/bins.js +1 -1
  59. package/smartMapping/popup/support/clusterUtils.js +1 -1
  60. package/smartMapping/popup/support/utils.js +1 -1
  61. package/smartMapping/renderers/support/utils.js +1 -1
  62. package/support/BasemapStyle.js +1 -1
  63. package/support/actions/actionUtils.js +1 -1
  64. package/support/revision.js +1 -1
  65. package/symbols/support/svgUtils.js +1 -1
  66. package/tables/elements.js +1 -1
  67. package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
  68. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  69. package/views/2d/layers/graphics/GraphicStore.js +1 -1
  70. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  71. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  72. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  73. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  74. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  75. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  76. package/views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js +1 -1
  77. package/views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js +26 -0
  78. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  79. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  80. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  81. package/views/draw/support/Reshape.js +1 -1
  82. package/views/interactive/SegmentLabels.js +1 -1
  83. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  84. package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
  85. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  86. package/views/interactive/tooltip/components/TooltipField.js +1 -1
  87. package/views/interactive/tooltip/components/ValueByValue.js +1 -1
  88. package/views/interactive/tooltip/content/Fields.js +1 -1
  89. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  90. package/views/interactive/tooltip/content/TooltipContentDrawCircle.js +1 -1
  91. package/views/interactive/tooltip/content/TooltipContentDrawMesh.js +1 -1
  92. package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
  93. package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
  94. package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
  95. package/views/interactive/tooltip/content/TooltipContentDrawRectangle.js +1 -1
  96. package/views/interactive/tooltip/content/TooltipContentElevation.js +1 -1
  97. package/views/interactive/tooltip/content/TooltipContentExtentRotate.js +1 -1
  98. package/views/interactive/tooltip/content/TooltipContentExtentScale.js +1 -1
  99. package/views/interactive/tooltip/content/TooltipContentMovePoint.js +1 -1
  100. package/views/interactive/tooltip/content/TooltipContentReshapeEdgeOffset.js +1 -1
  101. package/views/interactive/tooltip/content/TooltipContentSelectedVertex.js +1 -1
  102. package/views/interactive/tooltip/content/TooltipContentTransformMesh.js +1 -1
  103. package/views/interactive/tooltip/content/TooltipContentTransformPoint.js +1 -1
  104. package/views/interactive/tooltip/content/TooltipContentTranslate.js +1 -1
  105. package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
  106. package/views/interactive/tooltip/content/TooltipContentTranslateXY.js +1 -1
  107. package/views/interactive/tooltip/content/TooltipContentTranslateZ.js +1 -1
  108. package/views/navigation/gamepad/GamepadSettings.js +1 -1
  109. package/views/overlay/BoxOverlayItem.js +1 -1
  110. package/views/overlay/CrosshairOverlayItem.js +1 -1
  111. package/views/overlay/OutlineOverlayItem.js +1 -1
  112. package/views/ui/UI.js +1 -1
  113. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  114. package/widgets/AreaMeasurement2D.js +1 -1
  115. package/widgets/AreaMeasurement3D.js +1 -1
  116. package/widgets/Attachments.js +1 -1
  117. package/widgets/Attribution.js +1 -1
  118. package/widgets/BasemapGallery.js +1 -1
  119. package/widgets/BasemapLayerList.js +1 -1
  120. package/widgets/BasemapToggle.js +1 -1
  121. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  122. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  123. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  124. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  125. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  126. package/widgets/BatchAttributeForm.js +1 -1
  127. package/widgets/Bookmarks.js +1 -1
  128. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  129. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
  130. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  131. package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
  132. package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
  133. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  134. package/widgets/BuildingExplorer.js +1 -1
  135. package/widgets/CatalogLayerList.js +1 -1
  136. package/widgets/Compass.js +1 -1
  137. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  138. package/widgets/CoordinateConversion.js +1 -1
  139. package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
  140. package/widgets/Daylight.js +1 -1
  141. package/widgets/DirectLineMeasurement3D.js +1 -1
  142. package/widgets/DirectionalPad.js +1 -1
  143. package/widgets/Directions.js +1 -1
  144. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  145. package/widgets/DistanceMeasurement2D.js +1 -1
  146. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  147. package/widgets/Editor/EditorViewModel.js +1 -1
  148. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  149. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  150. package/widgets/Editor/SplitFeatureWorkflowData.js +1 -1
  151. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  152. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  153. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  154. package/widgets/Editor/UpdateWorkflow.js +1 -1
  155. package/widgets/Editor/Workflow.js +1 -1
  156. package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
  157. package/widgets/Editor/components/FeatureList.js +1 -1
  158. package/widgets/Editor/components/FooterActions.js +1 -1
  159. package/widgets/Editor/components/MergeFeaturesList.js +1 -1
  160. package/widgets/Editor/components/Notices.js +1 -1
  161. package/widgets/Editor/components/PanelContent.js +1 -1
  162. package/widgets/Editor/components/PanelToolbar.js +1 -1
  163. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  164. package/widgets/Editor/components/Prompt.js +1 -1
  165. package/widgets/Editor/components/Settings.js +1 -1
  166. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  167. package/widgets/Editor/components/UploadDetails.js +1 -1
  168. package/widgets/Editor/components/workflowAdapters/pendingFeatureList/SplitFeatureWorkflowPendingFeatureListAdapter.js +1 -1
  169. package/widgets/Editor/support/errors.js +1 -1
  170. package/widgets/Editor.js +1 -1
  171. package/widgets/ElevationProfile/components/Legend.js +1 -1
  172. package/widgets/ElevationProfile/components/LegendItem.js +1 -1
  173. package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
  174. package/widgets/ElevationProfile/components/Statistics.js +1 -1
  175. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  176. package/widgets/ElevationProfile.js +1 -1
  177. package/widgets/Expand.js +1 -1
  178. package/widgets/Feature/FeatureAttachments.js +1 -1
  179. package/widgets/Feature/FeatureContent.js +1 -1
  180. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  181. package/widgets/Feature/FeatureExpression.js +1 -1
  182. package/widgets/Feature/FeatureFields.js +1 -1
  183. package/widgets/Feature/FeatureMedia.js +1 -1
  184. package/widgets/Feature/FeatureRelationship.js +1 -1
  185. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  186. package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
  187. package/widgets/Feature/support/FeatureContentMixin.js +1 -1
  188. package/widgets/Feature/support/FeatureElementInfo.js +1 -1
  189. package/widgets/Feature.js +1 -1
  190. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/AssociationDetails.js +1 -1
  191. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  192. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  193. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  194. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  195. package/widgets/FeatureForm.js +1 -1
  196. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  197. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  198. package/widgets/FeatureTable.js +1 -1
  199. package/widgets/FeatureTemplates.js +1 -1
  200. package/widgets/Features/FeaturesDrillIn.js +1 -1
  201. package/widgets/Features.js +1 -1
  202. package/widgets/FloorFilter.js +1 -1
  203. package/widgets/FovOverlay.js +1 -1
  204. package/widgets/Fullscreen.js +1 -1
  205. package/widgets/Histogram.js +1 -1
  206. package/widgets/HistogramRangeSlider.js +1 -1
  207. package/widgets/Home.js +1 -1
  208. package/widgets/LayerList/LayerListItem.js +1 -1
  209. package/widgets/LayerList/ListItemPanel.js +1 -1
  210. package/widgets/LayerList.js +1 -1
  211. package/widgets/Legend/LegendViewModel.js +1 -1
  212. package/widgets/Legend/styles/card/CardView.js +1 -1
  213. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  214. package/widgets/Legend/styles/card/LegendElement.js +1 -1
  215. package/widgets/Legend/styles/card/SizeRamp.js +1 -1
  216. package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
  217. package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
  218. package/widgets/Legend/styles/classic/ClassicView.js +1 -1
  219. package/widgets/Legend/styles/classic/ColorRamp.js +1 -1
  220. package/widgets/Legend/styles/classic/LegendElement.js +1 -1
  221. package/widgets/Legend/styles/classic/SizeRamp.js +1 -1
  222. package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
  223. package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
  224. package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
  225. package/widgets/Legend/styles/support/sizeRampUtils.js +1 -1
  226. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  227. package/widgets/Legend/styles/support/utils.js +1 -1
  228. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  229. package/widgets/Legend/support/styleUtils.js +1 -1
  230. package/widgets/Legend/support/utils.js +1 -1
  231. package/widgets/Legend.js +1 -1
  232. package/widgets/LineOfSight.js +1 -1
  233. package/widgets/Locate/LocateViewModel.js +1 -1
  234. package/widgets/Locate.js +1 -1
  235. package/widgets/Measurement.js +1 -1
  236. package/widgets/NavigationToggle.js +1 -1
  237. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  238. package/widgets/OrientedImageryViewer/components/Alert.js +1 -1
  239. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  240. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  241. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  242. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  243. package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
  244. package/widgets/OrientedImageryViewer/components/NavigationSettings.js +1 -1
  245. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  246. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  247. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  248. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
  249. package/widgets/OrientedImageryViewer/mixins/ImageMeasurementMixin.js +1 -1
  250. package/widgets/OrientedImageryViewer/mixins/TriangulatedImageMeasurementMixin.js +1 -1
  251. package/widgets/OrientedImageryViewer.js +1 -1
  252. package/widgets/PanoramicVideoViewer.js +1 -1
  253. package/widgets/PanoramicViewer.js +1 -1
  254. package/widgets/Popup.js +1 -1
  255. package/widgets/Print/FileLink.js +1 -1
  256. package/widgets/Print.js +1 -1
  257. package/widgets/ScaleBar.js +1 -1
  258. package/widgets/ScaleRangeSlider.js +1 -1
  259. package/widgets/Search/SearchResultRenderer.js +1 -1
  260. package/widgets/Search/support/layerSearchUtils.js +1 -1
  261. package/widgets/Search.js +1 -1
  262. package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
  263. package/widgets/ShadowCast/components/DurationConfigurator.js +1 -1
  264. package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
  265. package/widgets/ShadowCast/components/ThresholdConfigurator.js +1 -1
  266. package/widgets/ShadowCast.js +1 -1
  267. package/widgets/Sketch/SketchViewModel.js +1 -1
  268. package/widgets/Sketch/support/ResponsiveToolbar/MeasuredContentGroup.js +1 -1
  269. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  270. package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
  271. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  272. package/widgets/Sketch.js +1 -1
  273. package/widgets/Slice.js +1 -1
  274. package/widgets/Slider.js +1 -1
  275. package/widgets/Spinner.js +1 -1
  276. package/widgets/Swipe.js +1 -1
  277. package/widgets/TableList/ListItemPanel.js +1 -1
  278. package/widgets/TableList.js +1 -1
  279. package/widgets/TimeSlider.js +1 -1
  280. package/widgets/TimeZoneLabel.js +1 -1
  281. package/widgets/Track.js +1 -1
  282. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
  283. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  284. package/widgets/UtilityNetworkAssociations.js +1 -1
  285. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  286. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
  287. package/widgets/UtilityNetworkTrace.js +1 -1
  288. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
  289. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  290. package/widgets/ValuePicker/ValuePickerCollection.js +1 -1
  291. package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
  292. package/widgets/ValuePicker/ValuePickerLabel.js +1 -1
  293. package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
  294. package/widgets/ValuePicker.js +1 -1
  295. package/widgets/VideoPlayer/components/MetadataSection.js +1 -1
  296. package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
  297. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  298. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  299. package/widgets/VideoPlayer.js +1 -1
  300. package/widgets/Weather/LabeledSlider.js +1 -1
  301. package/widgets/Weather.js +1 -1
  302. package/widgets/Widget.js +1 -1
  303. package/widgets/Zoom.js +1 -1
  304. package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
  305. package/widgets/smartMapping/ClassedColorSlider.js +1 -1
  306. package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
  307. package/widgets/smartMapping/ColorSizeSlider.js +1 -1
  308. package/widgets/smartMapping/ColorSlider.js +1 -1
  309. package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.js +1 -1
  310. package/widgets/smartMapping/HeatmapSlider.js +1 -1
  311. package/widgets/smartMapping/OpacitySlider.js +1 -1
  312. package/widgets/smartMapping/SizeSlider.js +1 -1
  313. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  314. package/widgets/support/ColorPicker.js +1 -1
  315. package/widgets/support/FilterBuilder.js +1 -1
  316. package/widgets/support/FilterCondition.js +1 -1
  317. package/widgets/support/GridControls.js +1 -1
  318. package/widgets/support/Heading.js +1 -1
  319. package/widgets/support/ItemList.js +1 -1
  320. package/widgets/support/LabeledSwitch.js +1 -1
  321. package/widgets/support/MeasurementWidgetContent.js +1 -1
  322. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  323. package/widgets/support/SelectionList/LayerItem.js +1 -1
  324. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  325. package/widgets/support/SelectionList/selectionListUtils.js +1 -1
  326. package/widgets/support/SelectionList.js +1 -1
  327. package/widgets/support/SelectionToolbar.js +1 -1
  328. package/widgets/support/SketchTooltipControls.js +1 -1
  329. package/widgets/support/SnappingControls.js +1 -1
  330. package/widgets/support/TimezonePicker.js +1 -1
  331. package/widgets/support/UnitSelect.js +1 -1
  332. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
  333. package/widgets/support/UtilityNetworkAssociations/utils/formatPercentAlong.js +1 -1
  334. package/widgets/support/chartUtilsAm5.js +1 -1
  335. package/widgets/support/dateUtils.js +1 -1
  336. package/widgets/support/iconUtils.js +1 -1
  337. package/widgets/support/widget.js +1 -1
  338. package/assets/esri/core/workers/chunks/3edffdb0e282ed562ac7.js +0 -1
  339. package/assets/esri/core/workers/chunks/8fc82fe1fcbcedf35400.js +0 -1
  340. package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +0 -1
  341. package/assets/esri/core/workers/chunks/bc29c29bfa5be3ebafb1.js +0 -1
  342. package/assets/esri/core/workers/chunks/c4dfd897bcab20dee43b.js +0 -1
  343. package/assets/esri/core/workers/chunks/c68935ed44eb0702a6ba.js +0 -1
  344. package/assets/esri/core/workers/chunks/db54552def7bc6cef9bd.js +0 -1
  345. package/assets/esri/core/workers/chunks/fd88e07cba5964f80e9e.js +0 -1
  346. package/views/interactive/editGeometry/CheckpointingEditGeometryOperations.js +0 -5
  347. package/views/interactive/editGeometry/operations/ReplayableAppendVertex.js +0 -5
  348. package/widgets/support/jsxFactory.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import*as e from"@amcharts/amcharts5/index.js";import{XYChart as i,XYCursor as s,ValueAxis as o,AxisRendererX as n,AxisRendererY as r,LineSeries as a}from"@amcharts/amcharts5/xy.js";import l from"@amcharts/amcharts5/themes/Dark.js";import p from"@amcharts/amcharts5/themes/Responsive.js";import"../../../intl.js";import c from"../../../core/Accessor.js";import{createTask as d}from"../../../core/asyncUtils.js";import{makeHandle as h,handlesGroup as u}from"../../../core/handleUtils.js";import"../../../core/has.js";import{throwIfAborted as m}from"../../../core/promiseUtils.js";import{watch as f}from"../../../core/reactiveUtils.js";import{formatDecimal as g,unitName as x}from"../../../core/unitFormatUtils.js";import{property as _}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as y}from"../../../core/accessorSupport/decorators/subclass.js";import{getEpsilon as v}from"../../../core/libs/gl-matrix-2/math/common.js";import{isDarkMode as A}from"../../../support/modeUtils.js";import{getConfig as T,notAvailable as b}from"./constants.js";import{getAdjustedBounds as P}from"./elevationProfileChartBoundsUtils.js";import{themeLight as S,themeDark as M}from"./elevationProfileChartTheme.js";import{binaryFindClosest as w}from"./elevationProfileGenerationUtils.js";import{createRoot as F}from"../../../widgets/support/chartUtilsAm5.js";import{fetchMessageBundle as L}from"../../../intl/messages.js";import{substitute as C}from"../../../intl/substitute.js";import{formatNumber as j}from"../../../intl/number.js";let z=class extends c{get chartVisible(){const t=this._chartData;if(null==t)return!1;let e=0;for(const{samples:i}of t.lines)e+=i?.length??0;return t.refined||e<=T().largeChartSamples}get spinnerVisible(){return null!=this._chartData&&(this.analysisView?.progress??0)<1}get _updateParameters(){const{messages:t,_unitsMessages:e}=this;if(t&&e)return{data:this._chartData,messages:t,unitsMessages:e}}get _chartData(){const{analysisView:t,uniformScaling:e}=this;if(!this._hasGeometry||!t)return;const{analysis:i,effectiveDisplayUnits:s,progress:o,statistics:n}=t;return{lines:this._lineData,statistics:n,effectiveUnits:s,refined:1===o,uniformScaling:e,dynamicElevationRange:i.profiles.some(t=>"scene"===t.type)}}get _hasGeometry(){return null!=this.analysisView?.analysis.geometry}get _lineData(){const{analysisView:t}=this;if(!t)return[];const{analysis:e,results:i}=t,{profiles:s}=e;if(i.length!==s.length)return[];const o=[];for(let n=0;n<s.length;n++){const t=s.at(n),e=i.at(n);if(!e.available||!e.rawResult?.hasZ||!t.chartOptions.lineVisible)continue;const r="input"!==t.type;o.push({id:t.id,type:t.type,title:t.title,color:t.color,samples:e.samples,fillEnabled:r,strokeOffsetY:r?-1:0,strokeWidth:1.5})}return o}constructor(t){super(t),this.view=null,this.analysisView=null,this.messages=null,this.uniformScaling=!1,this._theme=S,this._data=null,this._seriesInfos=new Map,this._pointerIsOver=!1,this._rtl=!1,this._chartInfo=null,this._unitsMessages=null}initialize(){this.addHandles(d(t=>this._initializeChart(t)))}destroy(){this._chartInfo=null,this._seriesInfos.clear(),this._data=null}zoomOut(){this._chartInfo?.xAxis.zoom(0,1),this._chartInfo?.yAxis.zoom(0,1)}async _initializeChart(t){const[e,o]=await Promise.all([F(this.container),L("esri/core/t9n/Units")]);m(t);const n=R(this.container),r=A(this.container),a=r?M:S;e.setThemes(r?[p.new(e),l.new(e)]:[p.new(e)]),this._rtl=n,this._theme=a,this._unitsMessages=o;const c=e.container.children.push(i.new(e,{panX:!0,panY:!0,paddingTop:a.paddingTop,paddingBottom:a.paddingBottom,paddingLeft:n?a.paddingRight:a.paddingLeft,paddingRight:n?a.paddingLeft:a.paddingRight,maxTooltipDistance:-1}));c.zoomOutButton.set("forceHidden",!0);const d=c.xAxes.push(this._createXAxis(e)),h=c.yAxes.push(this._createYAxis(e));this._chartInfo={chart:c,xAxis:d,yAxis:h};const u=s.new(c.root,{behavior:"none",xAxis:d,yAxis:h,snapToSeriesBy:"y"});u.lineY.set("visible",!1),c.set("cursor",u),this._initializeTest(c),this.addHandles([this._setupZoomHandling(),this._setupCursorHandling(),G(e),f(()=>this._updateParameters,this._update.bind(this))]),this._update(this._updateParameters)}_initializeTest(t){}_update(t){if(!t||this.destroyed)return;const e=this._data,i=t.data;if(i===e&&t.messages===this.messages&&t.unitsMessages===this._unitsMessages)return;const s=e!==i,o=e?.effectiveUnits!==i?.effectiveUnits,n=e?.uniformScaling!==i?.uniformScaling;this._data=i,this._chartInfo?.chart.get("cursor")?.set("forceHidden",!i?.refined),(s||o)&&(this._updateAxes(),this._updateSeries()),n&&this.zoomOut(),this._updateTooltips()}_createXAxis(t){const i=this._theme,s=o.new(t,{renderer:n.new(t,{})});s.setAll({extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:this._makeFormatter(t,"distance"),strictMinMax:!0,strictMinMaxSelection:!0}),s.axisHeader.set("forceHidden",!0);const r=s.get("renderer");r.setAll({inside:!1,minGridDistance:i.xAxisMinGridDistance}),r.labels.template.setAll({centerX:e.p0,centerY:e.p0,fill:e.color(i.axisLabelsColor),fontFamily:i.fontFamily,fontSize:i.axisLabelsFontSize,fontWeight:i.axisLabelsFontWeight,maxPosition:i.xAxisMaxLabelPosition,minPosition:i.xAxisMinLabelPosition,paddingLeft:0,paddingRight:0,paddingTop:i.xAxisLabelsSpacing});const a=s.set("tooltip",e.Tooltip.new(t,{paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0}));return a.get("background")?.setAll({fill:e.color(i.axisTooltipBackgroundColor),stroke:void 0}),a.label.setAll({fill:e.color(i.axisTooltipLabelColor),fontFamily:i.fontFamily,fontSize:i.axisTooltipFontSize,paddingBottom:i.axisTooltipPaddingBottom,paddingLeft:i.axisTooltipPaddingHorizontal,paddingRight:i.axisTooltipPaddingHorizontal,paddingTop:i.axisTooltipPaddingTop,direction:this._rtl?"rtl":"ltr"}),r.grid.template.setAll({strokeOpacity:1,stroke:e.color(i.axisGridStroke)}),s}_createYAxis(t){const i=this._theme,s=this._rtl,n=o.new(t,{renderer:r.new(t,{})});n.setAll({baseValue:T().noDataValue,extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:this._makeFormatter(t,"elevation"),strictMinMax:!0,strictMinMaxSelection:!0,tooltip:void 0}),n.axisHeader.set("visible",!1);const a=n.get("renderer");return a.setAll({minGridDistance:i.yAxisMinGridDistance,opposite:s,inside:!0}),a.labels.template.setAll({centerX:e.p0,centerY:e.p100,fill:e.color(i.axisLabelsColor),fontFamily:i.fontFamily,fontSize:i.axisLabelsFontSize,fontWeight:i.axisLabelsFontWeight,maxPosition:i.yAxisMaxLabelPosition,minPosition:i.yAxisMinLabelPosition,paddingBottom:0,paddingLeft:s?0:i.yAxisLabelSpacing,paddingRight:s?i.yAxisLabelSpacing:0,paddingTop:0,textAlign:"start"}),a.grid.template.setAll({strokeOpacity:1,stroke:e.color(i.axisGridStroke)}),n}_setupZoomHandling(){const t=this._chartInfo;if(!t)return h();const{xAxis:e,yAxis:i}=t,s=()=>{this.onRangeChange?.(H(e),H(i))},o=t=>[t.on("start",s),t.on("end",s)];return B([...o(e),...o(i)])}_setupCursorHandling(){const t=this._chartInfo;if(!t)return h();const{chart:e,xAxis:i,yAxis:s}=t,o=e.get("cursor"),n=e.plotContainer.events,r=t=>{this._pointerIsOver=t,this._updateTooltips()},a=()=>{r(!1),this.onCursorPositionChange?.(null,null)};return B([o?.events.on("cursormoved",()=>{if(!this._pointerIsOver)return;this._updateTooltips();let t=o?.getPrivate("positionX")??0,e=o?.getPrivate("positionY")??0;const n=this._data;if(null!=n?.statistics){const{maxDistance:o,minElevation:r,maxElevation:a}=n.statistics;let l,p;if(null!=o){1===H(i)?(l=0,p=o):(l=V(i),p=U(i)),t=X(t,l,p,0,o)}if(null!=r&&null!=a){1===H(s)?(l=r,p=a):(l=V(s),p=U(s)),e=X(e,l,p,r,a)}}this.onCursorPositionChange?.(t,e)}),n.on("pointerover",()=>r(!0)),n.on("pointerout",a),n.on("blur",a)])}_updateAxes(){const t=this._chartInfo;if(!t)return;const{chart:e,xAxis:i,yAxis:s}=t,o=this._data,{minX:n,maxX:r,minY:a,maxY:l}=P({data:o,pixelWidth:i.width(),pixelHeight:s.height()}),p=!!o?.uniformScaling,c=!!o?.refined;e.setAll({panX:!0,panY:p,pinchZoomX:c,pinchZoomY:c&&p,wheelX:"panX",wheelY:c?p?"zoomXY":"zoomX":"none"}),i.setAll({max:r,min:n,panX:!0,panY:!1,zoomX:!0,zoomY:p}),s.setAll({max:l,min:a,panX:!1,panY:p,zoomX:p,zoomY:p})}_updateSeries(){const t=this._seriesInfos,e=this._chartInfo;if(!e)return;const{chart:i,xAxis:s,yAxis:o}=e,n=this._data;if(!n||0===n.lines.length)return this._seriesInfos.clear(),void i.series.clear();const r=new Map,a=new Set(i.series.values),l=n.lines.length;for(let p=0;p<l;p++){const s=n.lines[p];let o=t.get(s.id);o?(o.fill&&a.delete(o.fill),a.delete(o.line)):(o=I(e,this._theme,this._rtl,s),o.fill&&i.series.push(o.fill),i.series.push(o.line)),r.set(o.id,o);const c=l-p-1;o.fill?.set("layer",c),o.line.set("layer",l+c),this._updateLineSeries(o,s)}this._seriesInfos=r;for(const p of a)i.series.removeValue(p);s.set("layer",l+1),o.set("layer",l+2)}_updateLineSeries(t,i){const s=e.color(i.color.toCss()),o=i.samples??[],n=o.length>0,{line:r,fill:a}=t;r.set("visible",n),r.set("stroke",s),a?.set("visible",n),a?.set("fill",e.Color.lighten(s,this._theme.seriesFillLighten)),r.data.setAll(o),a?.data.setAll(o)}_updateTooltips(){const t=this._getSeriesTooltipText();t?(this._seriesInfos.forEach(e=>{const i=e.line.get("tooltip");i.set("forceHidden",!1),i.label.set("text",t)}),this._chartInfo?.xAxis.getTooltip()?.setAll({tooltipText:this._getAxisTooltipText()})):this._seriesInfos.forEach(t=>{t.line.get("tooltip")?.set("forceHidden",!0)})}_getSeriesTooltipText(){const t=this._data?.lines.map(t=>({line:t,y:this._getPointNearestToCursor(t)?.elevation})).sort(Y);return t&&0!==t.length&&null!=t[0].y?t.map(({y:t,line:e})=>this._getTooltipTextForLine(e,t)).join("\n"):null}_getPointNearestToCursor(t){const e=t.samples??[];if(0===e.length)return null;const i=this._chartInfo;if(!i)return null;const{chart:s,xAxis:o}=i,n=s.get("cursor"),r=n?.getPrivate("positionX")??0,a=o.toAxisPosition(r),l=o.positionToValue(a);return w(e,l,t=>t.distance)}_getTooltipTextForLine(t,e){const i=this._data,s=this.messages,o=this._unitsMessages;if(!i||!s||!o)return"";const n=`[${t.color.toHex()}]●[/]`,r=" ",a=T().formatPrecision,l=C(s.chartTooltip,{name:O(t,s),elevation:null!=e?g(o,e,i.effectiveUnits.elevation,a):b});return this._rtl?l+r+n:n+r+l}_getAxisTooltipText(){const t=this._data,e=this._unitsMessages;if(!t||!e)return"";const i=t.lines[0],s=i?this._getPointNearestToCursor(i):null,o=T().formatPrecision;return null!=s?g(e,s.distance,t.effectiveUnits.distance,o):"-"}_makeFormatter(t,i){const s=e.NumberFormatter.new(t,{});return s.format=(t,e,s)=>{const o=this._data,n=this._unitsMessages;if(!o||!n||"string"==typeof t)return"";return`${j(t,{maximumFractionDigits:s})} ${x(n,o.effectiveUnits[i],"abbr")}`},s}};function I(t,e,i,s){const{id:o}=s,n=k(t,`line-${o}`),r=D(t,e,i);n.setAll({dy:s.strokeOffsetY,tooltip:r}),n.strokes.template.setAll({strokeWidth:s.strokeWidth});let a=null;return s.fillEnabled&&(a=k(t,`fill-${o}`),a.fills.template.setAll({fillOpacity:1,visible:!0})),{id:o,line:n,fill:a}}function k({chart:t,xAxis:e,yAxis:i},s){return a.new(t.root,{connect:!1,excludeFromTotal:!0,fill:void 0,id:s,stroke:void 0,valueXField:"distance",valueYField:"elevation",xAxis:e,yAxis:i})}function D({chart:t},i,s){const o=e.Tooltip.new(t.root,{autoTextColor:!1,forceHidden:!0,getFillFromSprite:!1,getLabelFillFromSprite:!1,pointerOrientation:"vertical",visible:!1}),n=i.seriesTooltipPaddingHorizontal,r=i.seriesTooltipPaddingVertical;return o.label.setAll({fill:e.color(i.seriesTooltipLabelColor),fontFamily:i.fontFamily,fontSize:i.seriesTooltipFontSize,paddingBottom:r,paddingLeft:n,paddingRight:n,paddingTop:r,textAlign:s?"end":"start",direction:"ltr"}),o.get("background")?.setAll({stroke:void 0,fill:e.color(i.seriesTooltipBackgroundColor)}),o.adapters.add("dy",t=>{const e=i.seriesTooltipSpacing,s=o.get("pointTo")?.y??0;return(t??0)+(o.y()>s?e:-e)}),o}function H(t){const e=Math.abs((t.get("end")??0)-(t.get("start")??0)),i=0!==e?1/e:1;return Math.abs(1-i)<v()?1:i}function X(t,e,i,s,o){return(e+t*(i-e)-s)/(o-s)}function Y({y:t},{y:e}){return null==t?1:null==e?-1:e-t}function V(t){return t.positionToValue(t.get("start")??0)}function U(t){return t.positionToValue(t.get("end")??1)}function O(t,e){const i=t.title;if(null!=i)return i;switch(t.type){case"ground":return e.profiles.ground;case"input":return e.profiles.input;case"query":return e.profiles.query;case"scene":return e.profiles.scene;default:return""}}function R(t){const e=t?.closest("[dir]");return null!==e&&e instanceof HTMLElement&&"rtl"===e.dir||"rtl"===document.dir}function B(t){return u(t.map(G))}function G(t){return h(()=>t?.dispose())}t([_()],z.prototype,"view",void 0),t([_()],z.prototype,"analysisView",void 0),t([_()],z.prototype,"container",void 0),t([_()],z.prototype,"messages",void 0),t([_()],z.prototype,"onRangeChange",void 0),t([_()],z.prototype,"onCursorPositionChange",void 0),t([_()],z.prototype,"uniformScaling",void 0),t([_()],z.prototype,"chartVisible",null),t([_()],z.prototype,"spinnerVisible",null),t([_()],z.prototype,"test",void 0),t([_()],z.prototype,"_theme",void 0),t([_()],z.prototype,"_data",void 0),t([_()],z.prototype,"_seriesInfos",void 0),t([_()],z.prototype,"_pointerIsOver",void 0),t([_()],z.prototype,"_rtl",void 0),t([_()],z.prototype,"_chartInfo",void 0),t([_()],z.prototype,"_unitsMessages",void 0),t([_()],z.prototype,"_updateParameters",null),t([_()],z.prototype,"_chartData",null),t([_()],z.prototype,"_hasGeometry",null),t([_()],z.prototype,"_lineData",null),z=t([y("esri.views.analysis.ElevationProfile.ElevationProfileChart")],z);export{z as ElevationProfileChart};
5
+ import{__decorate as t}from"tslib";import*as e from"@amcharts/amcharts5/index.js";import{XYChart as i,XYCursor as s,ValueAxis as o,AxisRendererX as n,AxisRendererY as r,LineSeries as a}from"@amcharts/amcharts5/xy.js";import l from"@amcharts/amcharts5/themes/Dark.js";import p from"@amcharts/amcharts5/themes/Responsive.js";import{fetchMessageBundle as c,substitute as d,formatNumber as h}from"../../../intl.js";import u from"../../../core/Accessor.js";import{createTask as m}from"../../../core/asyncUtils.js";import{makeHandle as f,handlesGroup as g}from"../../../core/handleUtils.js";import"../../../core/has.js";import{throwIfAborted as x}from"../../../core/promiseUtils.js";import{watch as _}from"../../../core/reactiveUtils.js";import{formatDecimal as y,unitName as v}from"../../../core/unitFormatUtils.js";import{property as A}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as T}from"../../../core/accessorSupport/decorators/subclass.js";import{getEpsilon as b}from"../../../core/libs/gl-matrix-2/math/common.js";import{isDarkMode as P}from"../../../support/modeUtils.js";import{getConfig as S,notAvailable as M}from"./constants.js";import{getAdjustedBounds as w}from"./elevationProfileChartBoundsUtils.js";import{themeLight as F,themeDark as L}from"./elevationProfileChartTheme.js";import{binaryFindClosest as C}from"./elevationProfileGenerationUtils.js";import{createRoot as z}from"../../../widgets/support/chartUtilsAm5.js";let I=class extends u{get chartVisible(){const t=this._chartData;if(null==t)return!1;let e=0;for(const{samples:i}of t.lines)e+=i?.length??0;return t.refined||e<=S().largeChartSamples}get spinnerVisible(){return null!=this._chartData&&(this.analysisView?.progress??0)<1}get _updateParameters(){const{messages:t,_unitsMessages:e}=this;if(t&&e)return{data:this._chartData,messages:t,unitsMessages:e}}get _chartData(){const{analysisView:t,uniformScaling:e}=this;if(!this._hasGeometry||!t)return;const{analysis:i,effectiveDisplayUnits:s,progress:o,statistics:n}=t;return{lines:this._lineData,statistics:n,effectiveUnits:s,refined:1===o,uniformScaling:e,dynamicElevationRange:i.profiles.some(t=>"scene"===t.type)}}get _hasGeometry(){return null!=this.analysisView?.analysis.geometry}get _lineData(){const{analysisView:t}=this;if(!t)return[];const{analysis:e,results:i}=t,{profiles:s}=e;if(i.length!==s.length)return[];const o=[];for(let n=0;n<s.length;n++){const t=s.at(n),e=i.at(n);if(!e.available||!e.rawResult?.hasZ||!t.chartOptions.lineVisible)continue;const r="input"!==t.type;o.push({id:t.id,type:t.type,title:t.title,color:t.color,samples:e.samples,fillEnabled:r,strokeOffsetY:r?-1:0,strokeWidth:1.5})}return o}constructor(t){super(t),this.view=null,this.analysisView=null,this.messages=null,this.uniformScaling=!1,this._theme=F,this._data=null,this._seriesInfos=new Map,this._pointerIsOver=!1,this._rtl=!1,this._chartInfo=null,this._unitsMessages=null}initialize(){this.addHandles(m(t=>this._initializeChart(t)))}destroy(){this._chartInfo=null,this._seriesInfos.clear(),this._data=null}zoomOut(){this._chartInfo?.xAxis.zoom(0,1),this._chartInfo?.yAxis.zoom(0,1)}async _initializeChart(t){const[e,o]=await Promise.all([z(this.container),c("esri/core/t9n/Units")]);x(t);const n=R(this.container),r=P(this.container),a=r?L:F;e.setThemes(r?[p.new(e),l.new(e)]:[p.new(e)]),this._rtl=n,this._theme=a,this._unitsMessages=o;const d=e.container.children.push(i.new(e,{panX:!0,panY:!0,paddingTop:a.paddingTop,paddingBottom:a.paddingBottom,paddingLeft:n?a.paddingRight:a.paddingLeft,paddingRight:n?a.paddingLeft:a.paddingRight,maxTooltipDistance:-1}));d.zoomOutButton.set("forceHidden",!0);const h=d.xAxes.push(this._createXAxis(e)),u=d.yAxes.push(this._createYAxis(e));this._chartInfo={chart:d,xAxis:h,yAxis:u};const m=s.new(d.root,{behavior:"none",xAxis:h,yAxis:u,snapToSeriesBy:"y"});m.lineY.set("visible",!1),d.set("cursor",m),this._initializeTest(d),this.addHandles([this._setupZoomHandling(),this._setupCursorHandling(),G(e),_(()=>this._updateParameters,this._update.bind(this))]),this._update(this._updateParameters)}_initializeTest(t){}_update(t){if(!t||this.destroyed)return;const e=this._data,i=t.data;if(i===e&&t.messages===this.messages&&t.unitsMessages===this._unitsMessages)return;const s=e!==i,o=e?.effectiveUnits!==i?.effectiveUnits,n=e?.uniformScaling!==i?.uniformScaling;this._data=i,this._chartInfo?.chart.get("cursor")?.set("forceHidden",!i?.refined),(s||o)&&(this._updateAxes(),this._updateSeries()),n&&this.zoomOut(),this._updateTooltips()}_createXAxis(t){const i=this._theme,s=o.new(t,{renderer:n.new(t,{})});s.setAll({extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:this._makeFormatter(t,"distance"),strictMinMax:!0,strictMinMaxSelection:!0}),s.axisHeader.set("forceHidden",!0);const r=s.get("renderer");r.setAll({inside:!1,minGridDistance:i.xAxisMinGridDistance}),r.labels.template.setAll({centerX:e.p0,centerY:e.p0,fill:e.color(i.axisLabelsColor),fontFamily:i.fontFamily,fontSize:i.axisLabelsFontSize,fontWeight:i.axisLabelsFontWeight,maxPosition:i.xAxisMaxLabelPosition,minPosition:i.xAxisMinLabelPosition,paddingLeft:0,paddingRight:0,paddingTop:i.xAxisLabelsSpacing});const a=s.set("tooltip",e.Tooltip.new(t,{paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0}));return a.get("background")?.setAll({fill:e.color(i.axisTooltipBackgroundColor),stroke:void 0}),a.label.setAll({fill:e.color(i.axisTooltipLabelColor),fontFamily:i.fontFamily,fontSize:i.axisTooltipFontSize,paddingBottom:i.axisTooltipPaddingBottom,paddingLeft:i.axisTooltipPaddingHorizontal,paddingRight:i.axisTooltipPaddingHorizontal,paddingTop:i.axisTooltipPaddingTop,direction:this._rtl?"rtl":"ltr"}),r.grid.template.setAll({strokeOpacity:1,stroke:e.color(i.axisGridStroke)}),s}_createYAxis(t){const i=this._theme,s=this._rtl,n=o.new(t,{renderer:r.new(t,{})});n.setAll({baseValue:S().noDataValue,extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:this._makeFormatter(t,"elevation"),strictMinMax:!0,strictMinMaxSelection:!0,tooltip:void 0}),n.axisHeader.set("visible",!1);const a=n.get("renderer");return a.setAll({minGridDistance:i.yAxisMinGridDistance,opposite:s,inside:!0}),a.labels.template.setAll({centerX:e.p0,centerY:e.p100,fill:e.color(i.axisLabelsColor),fontFamily:i.fontFamily,fontSize:i.axisLabelsFontSize,fontWeight:i.axisLabelsFontWeight,maxPosition:i.yAxisMaxLabelPosition,minPosition:i.yAxisMinLabelPosition,paddingBottom:0,paddingLeft:s?0:i.yAxisLabelSpacing,paddingRight:s?i.yAxisLabelSpacing:0,paddingTop:0,textAlign:"start"}),a.grid.template.setAll({strokeOpacity:1,stroke:e.color(i.axisGridStroke)}),n}_setupZoomHandling(){const t=this._chartInfo;if(!t)return f();const{xAxis:e,yAxis:i}=t,s=()=>{this.onRangeChange?.(H(e),H(i))},o=t=>[t.on("start",s),t.on("end",s)];return B([...o(e),...o(i)])}_setupCursorHandling(){const t=this._chartInfo;if(!t)return f();const{chart:e,xAxis:i,yAxis:s}=t,o=e.get("cursor"),n=e.plotContainer.events,r=t=>{this._pointerIsOver=t,this._updateTooltips()},a=()=>{r(!1),this.onCursorPositionChange?.(null,null)};return B([o?.events.on("cursormoved",()=>{if(!this._pointerIsOver)return;this._updateTooltips();let t=o?.getPrivate("positionX")??0,e=o?.getPrivate("positionY")??0;const n=this._data;if(null!=n?.statistics){const{maxDistance:o,minElevation:r,maxElevation:a}=n.statistics;let l,p;if(null!=o){1===H(i)?(l=0,p=o):(l=V(i),p=U(i)),t=X(t,l,p,0,o)}if(null!=r&&null!=a){1===H(s)?(l=r,p=a):(l=V(s),p=U(s)),e=X(e,l,p,r,a)}}this.onCursorPositionChange?.(t,e)}),n.on("pointerover",()=>r(!0)),n.on("pointerout",a),n.on("blur",a)])}_updateAxes(){const t=this._chartInfo;if(!t)return;const{chart:e,xAxis:i,yAxis:s}=t,o=this._data,{minX:n,maxX:r,minY:a,maxY:l}=w({data:o,pixelWidth:i.width(),pixelHeight:s.height()}),p=!!o?.uniformScaling,c=!!o?.refined;e.setAll({panX:!0,panY:p,pinchZoomX:c,pinchZoomY:c&&p,wheelX:"panX",wheelY:c?p?"zoomXY":"zoomX":"none"}),i.setAll({max:r,min:n,panX:!0,panY:!1,zoomX:!0,zoomY:p}),s.setAll({max:l,min:a,panX:!1,panY:p,zoomX:p,zoomY:p})}_updateSeries(){const t=this._seriesInfos,e=this._chartInfo;if(!e)return;const{chart:i,xAxis:s,yAxis:o}=e,n=this._data;if(!n||0===n.lines.length)return this._seriesInfos.clear(),void i.series.clear();const r=new Map,a=new Set(i.series.values),l=n.lines.length;for(let p=0;p<l;p++){const s=n.lines[p];let o=t.get(s.id);o?(o.fill&&a.delete(o.fill),a.delete(o.line)):(o=j(e,this._theme,this._rtl,s),o.fill&&i.series.push(o.fill),i.series.push(o.line)),r.set(o.id,o);const c=l-p-1;o.fill?.set("layer",c),o.line.set("layer",l+c),this._updateLineSeries(o,s)}this._seriesInfos=r;for(const p of a)i.series.removeValue(p);s.set("layer",l+1),o.set("layer",l+2)}_updateLineSeries(t,i){const s=e.color(i.color.toCss()),o=i.samples??[],n=o.length>0,{line:r,fill:a}=t;r.set("visible",n),r.set("stroke",s),a?.set("visible",n),a?.set("fill",e.Color.lighten(s,this._theme.seriesFillLighten)),r.data.setAll(o),a?.data.setAll(o)}_updateTooltips(){const t=this._getSeriesTooltipText();t?(this._seriesInfos.forEach(e=>{const i=e.line.get("tooltip");i.set("forceHidden",!1),i.label.set("text",t)}),this._chartInfo?.xAxis.getTooltip()?.setAll({tooltipText:this._getAxisTooltipText()})):this._seriesInfos.forEach(t=>{t.line.get("tooltip")?.set("forceHidden",!0)})}_getSeriesTooltipText(){const t=this._data?.lines.map(t=>({line:t,y:this._getPointNearestToCursor(t)?.elevation})).sort(Y);return t&&0!==t.length&&null!=t[0].y?t.map(({y:t,line:e})=>this._getTooltipTextForLine(e,t)).join("\n"):null}_getPointNearestToCursor(t){const e=t.samples??[];if(0===e.length)return null;const i=this._chartInfo;if(!i)return null;const{chart:s,xAxis:o}=i,n=s.get("cursor"),r=n?.getPrivate("positionX")??0,a=o.toAxisPosition(r),l=o.positionToValue(a);return C(e,l,t=>t.distance)}_getTooltipTextForLine(t,e){const i=this._data,s=this.messages,o=this._unitsMessages;if(!i||!s||!o)return"";const n=`[${t.color.toHex()}]●[/]`,r=" ",a=S().formatPrecision,l=d(s.chartTooltip,{name:O(t,s),elevation:null!=e?y(o,e,i.effectiveUnits.elevation,a):M});return this._rtl?l+r+n:n+r+l}_getAxisTooltipText(){const t=this._data,e=this._unitsMessages;if(!t||!e)return"";const i=t.lines[0],s=i?this._getPointNearestToCursor(i):null,o=S().formatPrecision;return null!=s?y(e,s.distance,t.effectiveUnits.distance,o):"-"}_makeFormatter(t,i){const s=e.NumberFormatter.new(t,{});return s.format=(t,e,s)=>{const o=this._data,n=this._unitsMessages;if(!o||!n||"string"==typeof t)return"";return`${h(t,{maximumFractionDigits:s})} ${v(n,o.effectiveUnits[i],"abbr")}`},s}};function j(t,e,i,s){const{id:o}=s,n=k(t,`line-${o}`),r=D(t,e,i);n.setAll({dy:s.strokeOffsetY,tooltip:r}),n.strokes.template.setAll({strokeWidth:s.strokeWidth});let a=null;return s.fillEnabled&&(a=k(t,`fill-${o}`),a.fills.template.setAll({fillOpacity:1,visible:!0})),{id:o,line:n,fill:a}}function k({chart:t,xAxis:e,yAxis:i},s){return a.new(t.root,{connect:!1,excludeFromTotal:!0,fill:void 0,id:s,stroke:void 0,valueXField:"distance",valueYField:"elevation",xAxis:e,yAxis:i})}function D({chart:t},i,s){const o=e.Tooltip.new(t.root,{autoTextColor:!1,forceHidden:!0,getFillFromSprite:!1,getLabelFillFromSprite:!1,pointerOrientation:"vertical",visible:!1}),n=i.seriesTooltipPaddingHorizontal,r=i.seriesTooltipPaddingVertical;return o.label.setAll({fill:e.color(i.seriesTooltipLabelColor),fontFamily:i.fontFamily,fontSize:i.seriesTooltipFontSize,paddingBottom:r,paddingLeft:n,paddingRight:n,paddingTop:r,textAlign:s?"end":"start",direction:"ltr"}),o.get("background")?.setAll({stroke:void 0,fill:e.color(i.seriesTooltipBackgroundColor)}),o.adapters.add("dy",t=>{const e=i.seriesTooltipSpacing,s=o.get("pointTo")?.y??0;return(t??0)+(o.y()>s?e:-e)}),o}function H(t){const e=Math.abs((t.get("end")??0)-(t.get("start")??0)),i=0!==e?1/e:1;return Math.abs(1-i)<b()?1:i}function X(t,e,i,s,o){return(e+t*(i-e)-s)/(o-s)}function Y({y:t},{y:e}){return null==t?1:null==e?-1:e-t}function V(t){return t.positionToValue(t.get("start")??0)}function U(t){return t.positionToValue(t.get("end")??1)}function O(t,e){const i=t.title;if(null!=i)return i;switch(t.type){case"ground":return e.profiles.ground;case"input":return e.profiles.input;case"query":return e.profiles.query;case"scene":return e.profiles.scene;default:return""}}function R(t){const e=t?.closest("[dir]");return null!==e&&e instanceof HTMLElement&&"rtl"===e.dir||"rtl"===document.dir}function B(t){return g(t.map(G))}function G(t){return f(()=>t?.dispose())}t([A()],I.prototype,"view",void 0),t([A()],I.prototype,"analysisView",void 0),t([A()],I.prototype,"container",void 0),t([A()],I.prototype,"messages",void 0),t([A()],I.prototype,"onRangeChange",void 0),t([A()],I.prototype,"onCursorPositionChange",void 0),t([A()],I.prototype,"uniformScaling",void 0),t([A()],I.prototype,"chartVisible",null),t([A()],I.prototype,"spinnerVisible",null),t([A()],I.prototype,"test",void 0),t([A()],I.prototype,"_theme",void 0),t([A()],I.prototype,"_data",void 0),t([A()],I.prototype,"_seriesInfos",void 0),t([A()],I.prototype,"_pointerIsOver",void 0),t([A()],I.prototype,"_rtl",void 0),t([A()],I.prototype,"_chartInfo",void 0),t([A()],I.prototype,"_unitsMessages",void 0),t([A()],I.prototype,"_updateParameters",null),t([A()],I.prototype,"_chartData",null),t([A()],I.prototype,"_hasGeometry",null),t([A()],I.prototype,"_lineData",null),I=t([T("esri.views.analysis.ElevationProfile.ElevationProfileChart")],I);export{I as ElevationProfileChart};
@@ -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 e from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import o from"../../../core/Error.js";import{EventedAccessor as r}from"../../../core/Evented.js";import n from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{destroyMaybe as h,assertIsSome as p,abortMaybe as c}from"../../../core/maybe.js";import{pausable as l,when as d,watch as m,initial as v,sync as u}from"../../../core/reactiveUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import g from"../../../geometry/Point.js";import f from"../../../geometry/Polyline.js";import{fromGeometry as G,toGeometry as x}from"../../../geometry/operators/support/apiConverter.js";import{closeRingsAndFixWinding as M,geometryToCoordinates as b}from"../../../geometry/support/coordsUtils.js";import{isPoint as C}from"../../../geometry/support/typeUtils.js";import{interpolateCircle as S}from"../../../geometry/support/curves/circleUtils.js";import{deriveCircleFromCircularArc as E,toEllipticArc7 as w}from"../../../geometry/support/curves/circularArcUtils.js";import{getEndpoint as O,isCircularArc as V,isEllipticArc4 as I,isBezierCurve as P,isCoordinate as k,isEllipticArc7 as H}from"../../../geometry/support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as R}from"../../../geometry/support/curves/ellipticArc4Utils.js";import{wrapAtan2 as T}from"../../../geometry/support/curves/mathUtils.js";import A from"../../../layers/GraphicsLayer.js";import{SnappingVisualizer2D as j}from"../../2d/interactive/SnappingVisualizer2D.js";import{ConnectedReshapeManager as L}from"./ConnectedReshapeManager.js";import{screenDeltaToMapDelta as U,cloneMove as F}from"./drawUtils.js";import D from"./GraphicMover.js";import z from"./HighlightHelper.js";import{addUniqueLayer as K,isConnectedReshapeSupportedLayer as N}from"./layerUtils.js";import{createTooltipInfos as q,connectTooltip as Z,updateTranslateTooltipInfo as $,updateTranslateVertexTooltipInfo as B}from"./reshapeTooltipUtils.js";import{defaultSymbols as J,createMidpointGraphics as Q,createVertexGraphics as W,createCurveControlPointGraphics as X,createCurveConstructionLineGraphics as Y,attributeKeys as tt,getMidpoint as et,controlPointKinds as it,saveUpdatedCurveOrCoordinate as st,toolIdAttribute as ot,splitCurve as rt,isSingleSegmentCircle as nt,isSingleSegmentEllipse as at}from"./reshapeUtils.js";import{ViewEventPriorities as ht}from"../../input/InputManager.js";import{createCoordinateHelper as pt}from"../../interactive/coordinateHelper.js";import{sketchKeys as ct}from"../../interactive/keybindings.js";import{EditGeometryOperations as lt}from"../../interactive/editGeometry/EditGeometryOperations.js";import dt from"../../interactive/sketch/SketchOptions.js";import{SnappingContext as mt}from"../../interactive/snapping/SnappingContext.js";import{makeTooltip as vt,enterInputModeIfAvailable as ut}from"../../interactive/tooltip/tooltipCommonUtils.js";const yt=Symbol();let _t=class extends r{constructor(t){super(t),this._updateHandlesOnExternalGeometryChange=null,this._activeOperationInfo=null,this._connectedReshapeManager=null,this._editGeometryOperations=null,this._mover=null,this._snappingContext=null,this._snappingGraphicsLayer=null,this._hoverGraphic=null,this._snappingTask=null,this._stagedVertex=null,this.tooltip=null,this.activeTooltipInfo=null,this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.connectedReshapeProviders=null,this.enableMidpoints=!0,this.enableCurveOnMidpoint=!0,this.enableMovement=!0,this.enableVertices=!0,this.graphic=null,this.highlightName=null,this.highlightsEnabled=!0,this.layer=null,this.snappingManager=null,this.symbols=J,this.sketchOptions=new dt,this.type="reshape",this.vertexGraphics=new s,this.curveControlPointGraphics=new s,this.constructionLineGraphics=new s,this.midpointGraphics=new s,this.selectedManipulators=new s,this.view=null}initialize(){const t=this.view;this._highlightHelper=new z({view:t}),this._setup(),this._updateHandlesOnExternalGeometryChange=l(()=>this.graphic?.geometry,t=>{if(!t)return;const e=new Set(this.selectedManipulators.map(wt));this._highlightHelper.removeAll(),this._setUpHighlights(),this._setupGraphics(),this._clearSelection(),this.vertexGraphics.filter(t=>e.has(wt(t))).forEach(t=>this._addToSelection(t));const{enableMovement:i,_mover:s,graphic:o,midpointGraphics:r,vertexGraphics:n,curveControlPointGraphics:a}=this,h=n.concat(r,a).items;i&&h.push(o),s?.set("graphics",h)},u),this.tooltip=vt(()=>({view:t,options:this.sketchOptions.tooltips})),this.tooltipInfos=q(this.sketchOptions),this.addHandles([d(()=>t?.ready,()=>{const{layer:t,view:e}=this;K(e,t),this.addHandles(e.on("key-down",t=>this._keyDownHandler(t),ht.TOOL))},{once:!0,initial:!0}),m(()=>this.graphic,()=>this.refresh()),m(()=>this.layer,(t,e)=>{e&&(this._clearSelection(),this._resetGraphics(e)),this.refresh()}),m(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()}),m(()=>this.enableMidpoints,()=>this.refresh()),Z(this.tooltip,()=>this._tooltipsContext),m(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),v),this._updateHandlesOnExternalGeometryChange]),this._updateTooltip()}destroy(){this._reset(),this._mover?.destroy(),this._mover=null,this._connectedReshapeManager=h(this._connectedReshapeManager),this.tooltip=h(this.tooltip)}get _coordinateHelper(){return this._editGeometryOperations?.data.coordinateHelper??pt(!!this.graphic.geometry?.hasZ,!!this.graphic.geometry?.hasM,this.view.spatialReference)}get _selectedManipulator(){return 1===this.selectedManipulators.length?this.selectedManipulators.at(0):void 0}get _tooltipsContext(){const{automaticAreaMeasurementUtils:t,automaticLengthMeasurementUtils:e,sketchOptions:i,activeTooltipInfo:s,graphic:o}=this;return{sketchOptions:i,activeTooltipInfo:s,graphic:o,selectedVertex:this._selectedManipulator,automaticAreaMeasurementUtils:t,automaticLengthMeasurementUtils:e,updateGeometry:(t,e,i,s,o)=>{this._setUpGeometryHelper();const r=t===this.graphic;r?this._emitMoveStartEvent(0,0):this._emitReshapeStartEvent(t);const n=!0;if(this._syncGeometryAfterVertexMove(t,e,s,o,n),r){const{view:t}=this,s=t.toScreen(i),o=t.toScreen(e),r=(o?.x??0)-(s?.x??0),n=(o?.y??0)-(s?.y??0);this._emitMoveEvent(r,n),this._emitMoveStopEvent(r,n)}else this._emitReshapeEvent(t),this._emitReshapeStopEvent(t);this._editGeometryOperations=h(this._editGeometryOperations)}}}get state(){const t=this.view.ready,e=!(!this.graphic||!this.layer);return t&&e?"active":t?"ready":"disabled"}isUIGraphic(t){return t===this.graphic||this._isMidpoint(t)||this._isCurveControlPoint(t)||this._isVertex(t)||this._isConstructionLine(t)}refresh(){this._reset(),this._setup()}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){const{selectedManipulators:t}=this;t.length&&this._removeVertices(t)}_setup(){const{graphic:t,layer:e}=this;if(!e||null==t?.geometry)return;const i=t.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&M(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._setupConnectedReshapeManager()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper?.add(this.graphic,this.highlightName)}_setUpGeometryHelper(){const t=this.graphic.geometry;null!=t&&"mesh"!==t.type&&"extent"!==t.type?this._editGeometryOperations??=lt.fromGeometry(t,2,{allowCurves:!0}):this._logGeometryTypeError()}_saveSnappingContextForHandle(t,e){this._snappingGraphicsLayer=new A({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer);const i=this._editGeometryOperations;p(i),this._snappingContext=new mt({editGeometryOperations:i,elevationInfo:{mode:"on-the-ground",offset:0},pointer:e.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,feature:this.graphic,visualizer:new j(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(t)})}_reset(){this._clearSelection(),this._highlightHelper?.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._activeOperationInfo=null,this._mover?.destroy(),this._mover=null,this.removeHandles(yt)}_resetSnappingStateVars(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),null!=this._snappingGraphicsLayer&&(this.view?.map&&this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._editGeometryOperations=h(this._editGeometryOperations),this._snappingTask=c(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(t){this._removeMidpointGraphics(t),this._removeVertexGraphics(t),this._removeCurveGraphics(t),this._updateTooltip()}_removeMidpointGraphics(t=this.layer){const{midpointGraphics:e}=this;t?.removeMany(e.items),e.drain(h)}_removeVertexGraphics(t=this.layer){const{vertexGraphics:e}=this;t?.removeMany(e.items),e.drain(h)}_removeCurveGraphics(t=this.layer){const{curveControlPointGraphics:e,constructionLineGraphics:i}=this;t?.removeMany(e.items),t?.removeMany(i.items),e.drain(h),i.drain(h)}_setupGraphics(){const t=this.graphic.geometry;if(null!=t&&("polyline"===t.type||"polygon"===t.type||"multipoint"===t.type)){const e=gt(t);this.enableMidpoints&&"multipoint"!==t.type&&this._setUpMidpointGraphics(e),this.enableVertices&&(this._setUpVertexGraphics(e),this._setupCurveGraphics(e))}}_setUpMidpointGraphics(t){this._removeMidpointGraphics();const e=Q(t,this.symbols,this._coordinateHelper,"polygon"===this.graphic.geometry?.type);this.midpointGraphics.addMany(e),this.layer.addMany(e)}_setUpVertexGraphics(t){this._removeVertexGraphics();const e=W(t,this.symbols,this._coordinateHelper);this.vertexGraphics.addMany(e),this._storeRelatedVertexIndices(),this.layer.addMany(e)}_setupCurveGraphics(t){this._removeCurveGraphics();const e=X(t,this.symbols,this._coordinateHelper),i=Y(t,this.symbols,this._coordinateHelper);this.curveControlPointGraphics.addMany(e),this.constructionLineGraphics.addMany(i),this.layer.addMany(i),this.layer.addMany(e)}_updateSymbolsForTheme(){const t=this.view.effectiveTheme.accentColor;this.symbols={vertices:{...this.symbols.vertices,default:this.symbols.vertices.default.clone().set("color",t),hover:this.symbols.vertices.hover?.clone().set("color",t)},controlPoints:{...this.symbols.controlPoints,default:this.symbols.controlPoints.default.clone().set("color",t),hover:this.symbols.controlPoints.hover?.clone().set("color",t)},midpoints:{...this.symbols.midpoints},constructionLines:this.symbols.constructionLines.clone().set("color",t)};for(const e of this.vertexGraphics)this._isSelected(e)?e.symbol=this.symbols.vertices.selected:this._hoverGraphic===e?e.symbol=this.symbols.vertices.hover:e.symbol=this.symbols.vertices.default;for(const e of this.curveControlPointGraphics)this._isSelected(e)?e.symbol=this.symbols.controlPoints.selected:this._hoverGraphic===e?e.symbol=this.symbols.controlPoints.hover:e.symbol=this.symbols.controlPoints.default;for(const e of this.constructionLineGraphics)e.symbol=this.symbols.constructionLines}_storeRelatedVertexIndices(){const t=this.vertexGraphics.items;if(!t)return;const e=t.map(({geometry:t})=>({x:t.x,y:t.y}));for(let i=0;i<e.length;i++){const s=[];for(let t=0;t<e.length;t++){if(i===t)continue;const o=e[i],r=e[t];o.x===r.x&&o.y===r.y&&s.push(t)}t[i].attributes[tt.relatedGraphicIndices]=s}}_setupMover(){const{enableMovement:t,graphic:e,midpointGraphics:i,vertexGraphics:s,view:o}=this,r=s.concat(i,this.curveControlPointGraphics).items;t&&"multipoint"!==e.geometry?.type&&r.push(e),this._mover=new D({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:r,view:o,callbacks:{onGraphicClick:t=>this._onGraphicClickCallback(t),onGraphicMoveStart:t=>this._onGraphicMoveStartCallback(t),onGraphicMove:t=>this._onGraphicMoveCallback(t),onGraphicMoveStop:t=>this._onGraphicMoveStopCallback(t),onGraphicPointerOver:t=>this._onGraphicPointerOverCallback(t),onGraphicPointerOut:t=>this._onGraphicPointerOutCallback(t)}})}_setupConnectedReshapeManager(){const{connectedReshapeProviders:t}=this;null!=t&&0!==t.length&&(this._connectedReshapeManager=new L({providerFactories:t,view:this.view}))}_onGraphicClickCallback(t){t.viewEvent.stopPropagation();const e=t.graphic,i=this._isCurveControlPoint(e);if(e===this.graphic)this.clearSelection(),this.emit("graphic-click",t),this.callbacks.onGraphicClick?.(t);else if(this._isMidpoint(e)){if(2===t.viewEvent.button)return;const i=this.graphic.clone(),s=this._handleMidpointClickOrStartMove(t);this.refresh(),s.length&&this._emitVertexAddEvent([e],i,s)}else if(this._isVertex(e)||i){if(t.viewEvent.stopPropagation(),2===t.viewEvent.button)return void(i||this._removeVertices(e));t.viewEvent.native.shiftKey||this._clearSelection(),this.selectedManipulators.includes(e)?this._removeFromSelection(e,!0):this._addToSelection(e)}}_setUpOperation(t){const{graphic:e,dx:i,dy:s}=t,o=e===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(e,t),this._activeOperationInfo={target:this.graphic,mover:e,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(t){const{dx:e,dy:i,graphic:s}=t,o=this._connectedReshapeManager,r=o?Vt(this.graphic):null;if(s===this.graphic){const{geometry:n}=s;return this._setUpOperation(t),this._emitMoveStartEvent(e,i),r&&o?.startFeatureMove([r]),void(null!=n&&"point"===n.type&&this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(e,i)}))}const{selectedManipulators:n}=this;if(!n.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const e=this.graphic.clone(),i=this._handleMidpointClickOrStartMove(t);i.length&&(this._emitVertexAddEvent([s],e,i),this._refreshGraphicIndicesAttributes(i[0]))}this._addToSelection(s)}if(this._setUpOperation(t),r){const t=n.filter(t=>this._isVertex(t));o?.startVertexMove(r,It(t))}this._emitReshapeStartEvent(s),this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(s,t.viewEvent),this._emitReshapeEvent(s)})}_onGraphicMoveCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t;e.totalDx+=i,e.totalDy+=s;const{operationType:r}=e,{geometry:n}=o;if(null!=n)if("move"!==r)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(o,t.viewEvent),this._emitReshapeEvent(o)});else if("point"===n.type)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)});else if("polyline"===n.type||"polygon"===n.type){const e=gt(n);this._updateVertexGraphicLocations(e);const{dxMap:o,dyMap:r}=U(i,s,this.view);this._connectedReshapeManager?.translate(o,r,0),this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)}}_onGraphicMoveStopCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t,{operationType:r}=e;e.totalDx+=i,e.totalDy+=s,this._onHandleMove(o,i,s,t,()=>"move"===r?this._emitMoveStopEvent():this._emitReshapeStopEvent(o)),this._isMidpoint(o)||o.getAttribute(tt.curveFromStraightEdgeFlag)?this.refresh():(this._updateTooltip(this._isVertex(o)?o:null),this._resetSnappingStateVars(),this._connectedReshapeManager?.finish(),this._activeOperationInfo=null)}_updateVertexGraphicLocations(t){const{_coordinateHelper:e}=this;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes;i.geometry=e.arrayToPoint(O(t[s][o]))}this._updateMidpointGraphicLocations(t),this._updateCurveGraphicLocations(t)}_updateMidpointGraphicLocations(t){const{_coordinateHelper:e}=this;for(const i of this.midpointGraphics){const{pathIndex:s,pointIndexStart:o,pointIndexEnd:r}=i.attributes,n=t[s];i.geometry=et(n[o],n[r],e)}}_updateCurveGraphicLocations(t){const{spatialReference:e}=this._coordinateHelper,i=new Map;for(const s of this.selectedManipulators){const[t,e]=Et(s);null!=t&&null!=e&&s.getAttribute(tt.controlPointKind)&&a(i,t,()=>new Set)?.add(e)}for(const s of this.curveControlPointGraphics){const[e,o]=Et(s);if(i.get(e)?.has(o))continue;const r=t[e][o];if(V(r)||I(r)){const i=O(t[e][o-1]),n=V(r)?E(i,r):R(i,r),[a,h]=S(n,.25);s.geometry=new g({x:a,y:h,spatialReference:this._coordinateHelper.spatialReference})}else if(P(r)){const t=s.getAttribute(tt.controlPointKind),[e,i]=t===it.bezier.cp1?r.b[1]:r.b[2];s.geometry=new g({x:e,y:i,spatialReference:this._coordinateHelper.spatialReference})}}for(const s of this.constructionLineGraphics){const i=s.getAttribute(tt.controlPointKind),[o,r]=Et(s),n=t[o],a=O(n[r-1]),h=O(n[r]),p=t[o][r];i===it.bezier.line1?s.geometry=new f({paths:[[[a[0],a[1]],[...p.b[1]]]],spatialReference:e}):s.geometry=new f({paths:[[[h[0],h[1]],[...p.b[2]]]],spatialReference:e})}}_refreshGraphicIndicesAttributes(t){const{componentIndex:e,vertexIndex:i}=t,s=t=>{const[s,o]=Et(t);s===e&&o>=i&&t.setAttribute(tt.pointIndex,o+1)};this.vertexGraphics.forEach(s),this.curveControlPointGraphics.forEach(s),this.constructionLineGraphics.forEach(s);for(const o of this.midpointGraphics){if(o.getAttribute(tt.pathIndex)!==e)continue;const t=o.getAttribute(tt.pointIndexStart);t>=i&&(o.setAttribute(tt.pointIndexStart,t+1),o.setAttribute(tt.pointIndexEnd,o.getAttribute(tt.pointIndexEnd)+1))}}_getVertexFromEditGeometry(t){const[e,i]=Et(t);return p(this._editGeometryOperations),this._editGeometryOperations.data.parts[e].vertices[i]}_onHandleMove(t,e,s,o,r){c(this._snappingTask);const n=this._snappingContext;if(!n)return;const a=t.geometry,h="graphic-move-stop"===o.type;if(a&&C(a))if(null!=this.snappingManager&&this.selectedManipulators.length<2&&!h){const o=this.snappingManager;this._stagedVertex=o.update({point:a,context:n}),this._syncGeometryAfterVertexMove(t,new g(this._stagedVertex),e,s,h),r(),this._snappingTask=i(async i=>{const p=await o.snap({point:a,context:n,signal:i});p.valid&&(this._stagedVertex=p.apply(),this._syncGeometryAfterVertexMove(t,new g(this._stagedVertex),e,s,h),r())})}else{const i=null!=this._stagedVertex?new g(this._stagedVertex):a;this._syncGeometryAfterVertexMove(t,i,e,s,h),r()}}_syncGeometryAfterVertexMove(t,e,i,s,o=!1){const r=this._editGeometryOperations?.data.geometry;if(!r)return;const{_coordinateHelper:n}=this,a=n.pointToVector(e),h=this._getVertexFromEditGeometry(t);if(h){const t=n.getZ(a),e=a[0]-h.pos[0],i=a[1]-h.pos[1],s=null!=t?t-h.pos[2]:0;"point"!==r.type&&"mesh"!==r.type||this._editGeometryOperations?.moveVertices([h],e,i,s),this._connectedReshapeManager?.translate(e,i,s)}if("point"===r.type)t.geometry=e;else if("mesh"===r.type)t.geometry=r.centerAt(e);else{if(t!==this.graphic){const o=n.spatialReference,[a,h]=Et(t);let p=ft(r);const c=n.pointToArray(e);this._updateGeometryFromGraphic(t,p,a,h,c,o,"polygon"===r.type),this._isVertex(t)||this._isCurveControlPoint(t)?(p=this._moveRelatedCoordinates(p,t,c),p=this._moveSelectedHandleCoordinates(p,t,i,s,"polygon"===r.type),this._updateMidpointGraphicLocations(p),this._updateCurveGraphicLocations(p)):this._isMidpoint(t)&&this._updateCurveGraphicLocations(p),st(r,p)}this._updateGraphicGeometry(r.clone()),this._editGeometryOperations=lt.fromGeometry(r,2,{allowCurves:!0}),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(t),e):t.geometry=e)}}_moveRelatedCoordinates(t,e,i){const{relatedGraphicIndices:s}=e.attributes,o=this._coordinateHelper.spatialReference;if(!s?.length)return t;for(const r of s){const s=this.vertexGraphics.at(r),[n,a]=Et(s);St(t,n,a,i,o),s.geometry=e.geometry}return t}_moveSelectedHandleCoordinates(t,e,i,s,o){const r=this._coordinateHelper.spatialReference;for(const n of this.selectedManipulators)if(n!==e){const[e,a]=Et(n),h=n.getAttribute(tt.relatedGraphicIndices),p=F(n.geometry,i,s,this.view),c=b(p);if(n.geometry=p,this._updateGeometryFromGraphic(n,t,e,a,c,r,o),h?.length)for(const i of h){const e=this.vertexGraphics.at(i),[s,o]=Et(e);St(t,s,o,c,r),e.geometry=p}}return t}_updateGeometryFromGraphic(t,e,i,s,o,r,n){const a=e[i].length-1;this._isCurveControlPoint(t)?xt(e,i,s,[o[0],o[1]],t.getAttribute(tt.controlPointKind)):(St(e,i,s,o,r),n&&(0===s?St(e,i,a,o,r):s===a&&(e[i][0]=o)))}_onGraphicPointerOverCallback(t){const e=t.graphic;this._hoverGraphic=e;const i=this._isVertex(e);i&&!this._isSelected(e)?e.symbol=this.symbols.vertices.hover:this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.hover),this._updateTooltip(i?e:null),this._updateHoverCursor(e)}_onGraphicPointerOutCallback(t){const e=t.graphic;this._hoverGraphic=null,this._isVertex(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.vertices.default),this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.default),this.removeHandles(yt),this._updateTooltip()}_handleMidpointClickOrStartMove(t){const{graphic:e}=t,i=this.graphic.geometry;if(null==i||"polygon"!==i.type&&"polyline"!==i.type)return[];const s=i.clone(),o=[],{[tt.pathIndex]:r,[tt.pointIndexStart]:n,[tt.pointIndexEnd]:a}=e.attributes,h=b(e.geometry),p=0===a?n+1:a;e.attributes={[tt.tool]:ot,[tt.pathIndex]:r,[tt.pointIndex]:p,[tt.relatedGraphicIndices]:[]};const c=ft(s),l=c[r][a];if(k(l)){if(this.enableCurveOnMidpoint&&t.viewEvent.native.shiftKey){const t=O(c[r][p]);c[r].splice(p,1,{c:[t,[h[0],h[1]]]}),e.setAttribute(tt.controlPointKind,it.circle.interior),e.setAttribute(tt.curveFromStraightEdgeFlag,!0),this.midpointGraphics.remove(e),this.curveControlPointGraphics.push(e),st(s,c)}else c[r].splice(p,0,h),o.push({coordinates:c[r][p],componentIndex:r,vertexIndex:p})}else{const t=O(c[r][n]),e=rt(t,l,.5,this._coordinateHelper);c[r].splice(a,1,...e),o.push({coordinates:O(c[r][p]),componentIndex:r,vertexIndex:p})}return this._updateGraphicGeometry(s),o}_addToSelection(t){const e=Ot(t);for(const i of e)this._isCurveControlPoint(i)?i.symbol=this.symbols.controlPoints.selected:i.symbol=this.symbols.vertices.selected,this.selectedManipulators.add(i),this._updateTooltip(i);this._emitSelectEvent(e)}_removeFromSelection(t,e){if(this._isVertex(t)){const{vertices:i}=this.symbols;t.symbol=e?i.hover:i.default}else if(this._isCurveControlPoint(t)){const{controlPoints:i}=this.symbols;t.symbol=e?i.hover:i.default}this.selectedManipulators.remove(t),this._emitDeselectEvent([t]),this._updateTooltip()}_clearSelection(){const t=this.selectedManipulators.toArray(),{controlPoints:e,vertices:i}=this.symbols;if(t.length>0){for(const s of t)this._isVertex(s)?s.symbol=i.default:this._isCurveControlPoint(s)&&(s.symbol=e.default);this.selectedManipulators.removeAll(),this._emitDeselectEvent(t),this._updateTooltip()}}_keyDownHandler(t){null==this._activeOperationInfo&&ut(t,this.tooltip)||ct.delete.includes(t.key)&&!t.repeat&&this.selectedManipulators.length&&this._removeVertices(this.selectedManipulators)}_removeVertices(t){const e=this.graphic.geometry,i=this.vertexGraphics.length;if(null==e||"polygon"!==e.type&&"polyline"!==e.type&&"multipoint"!==e.type)return;if("polygon"===e.type&&i<4||"multipoint"===e.type&&i<2||"polyline"===e.type&&i<3)return;const s=this.graphic.clone(),o=e.clone();let r=ft(o);const n=[],a=Ot(t);for(const h of a){if(this._isCurveControlPoint(h))continue;const{x:t,y:e}=h.geometry;for(let i=0;i<r.length;i++){const s=r[i];for(let o=0;o<s.length;o++){const[a,h]=O(s[o]);if(t===a&&e===h){n.push({coordinates:O(r[i][o]),componentIndex:i,vertexIndex:o}),r[i].splice(Number(o),1);const t=r[i][o];t&&!k(t)&&(r[i][o]=O(t))}}}}if("polygon"===o.type)r=r.filter(t=>{if(t.length<2)return!1;const[e,i]=O(t[0]),[s,o]=O(t[t.length-1]);return(2!==t.length||e!==s||i!==o)&&(e===s&&i===o||t.push(t[0]),!0)});else if("polyline"===o.type)for(const h of r)1===h.length&&r.splice(r.indexOf(h),1);st(o,r),this._updateGraphicGeometry(o),this.refresh(),this._emitVertexRemoveEvent(a,s,n)}_isVertex(t){return this.vertexGraphics.includes(t)}_isCurveControlPoint(t){return this.curveControlPointGraphics.includes(t)}_isConstructionLine(t){return this.constructionLineGraphics.includes(t)}_isSelected(t){return(this._isVertex(t)||this.curveControlPointGraphics.includes(t))&&this.selectedManipulators.includes(t)}_isMidpoint(t){return this.midpointGraphics.includes(t)}_updateHoverCursor(t){const e=this._isMidpoint(t)?"copy":"move";this.addHandles(this.view.acquireCursor(e,"high"),yt)}_updateTooltip(t,e){let i=null;const{graphic:s,view:o,tooltipInfos:r}=this,n=s?.geometry;"point"===n?.type?i=r.movePoint:this._selectedManipulator?i=r.selectedVertex:t===this.graphic?(i=r.translateGraphic,$(i,o,this._tooltipsContext,e)):t&&this.selectedManipulators.length>1&&(i=r.translateVertices,B(i,o,n,this._tooltipsContext,e)),this.activeTooltipInfo=i}_updateGraphicGeometry(t){this._updateHandlesOnExternalGeometryChange?.pause(),this.graphic.geometry=t,this._updateHandlesOnExternalGeometryChange?.resume()}_emitMoveStartEvent(t,e){const i={type:"move-start",mover:this.graphic,dx:t,dy:e};this.emit("move-start",i),this.callbacks.onMoveStart?.(i)}_emitMoveEvent(t,e){const i={type:"move",mover:this.graphic,dx:t,dy:e};this.emit("move",i),this.callbacks.onMove?.(i)}_emitMoveStopEvent(t,e){if(null==t||null==e){const i=this._activeOperationInfo;if(!i)return;t=i.totalDx,e=i.totalDy}const i={type:"move-stop",mover:this.graphic,dx:t,dy:e};this.emit("move-stop",i),this.callbacks.onMoveStop?.(i)}_emitReshapeStartEvent(t){const e={type:"reshape-start",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-start",e),this.callbacks.onReshapeStart?.(e)}_emitReshapeEvent(t){const e={type:"reshape",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape",e),this.callbacks.onReshape?.(e)}_emitReshapeStopEvent(t){const e={type:"reshape-stop",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-stop",e),this.callbacks.onReshapeStop?.(e)}_emitSelectEvent(t){const e={type:"vertex-select",added:t};this.emit("select",e),this.callbacks.onVertexSelect?.(e)}_emitDeselectEvent(t){const e={type:"vertex-deselect",removed:t};this.emit("deselect",e),this.callbacks.onVertexDeselect?.(e)}_emitVertexAddEvent(t,e,i){const s={type:"vertex-add",added:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-add",s),this.callbacks.onVertexAdd?.(s)}_emitVertexRemoveEvent(t,e,i){const s={type:"vertex-remove",removed:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-remove",s),this.callbacks.onVertexRemove?.(s)}_logGeometryTypeError(){n.getLogger(this).error(new o("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};function gt(t){const e=ft(t.clone());if("polygon"===t.type)for(const i of e){const t=i[i.length-1];if(!k(t))continue;const e=i[0];e[0]===t[0]&&e[1]===t[1]&&i.length>2&&i.pop()}return e}function ft(t){return"polygon"===t.type?t.curveRings?.slice()??t.rings.slice():"polyline"===t.type?t.curvePaths?.slice()??t.paths.slice():t.points.map(t=>[t])}function Gt(t,e,i,s){const o=t[e][i];if(V(o))o.c[1]=s;else if(I(o)){const o=O(t[e][i]);t[e][i]={c:[o,s]}}}function xt(t,e,i,s,o){switch(o){case it.circle.interior:Gt(t,e,i,s);break;case it.bezier.cp1:t[e][i].b[1]=s;break;case it.bezier.cp2:t[e][i].b[2]=s}}function Mt(t,e){return t<1e-8*e}function bt(t,{cx:e,cy:i,isInvalid:s,thetaStart:o,thetaEnd:r},n,a){const[h,p]=t,[c,l]=n,d=c-h,m=l-p;e-=h,i-=p;const v=a?o>r:o<r,[u,y]=s?[e,i]:v?[-i,e]:[i,-e],[_,g]=[d,m],[f,G]=[u,y],x=_*G-g*f,M=(d**2+m**2)/2;if(Mt(Math.abs(x),M))return[(h+c)/2,(p+l)/2];const[b,C]=[G/x*M,-f/x*M],S=b**2+C**2,[E,w]=[d/2-b,m/2-C];if(Mt(E**2+w**2,S)){const[t,e]=v?[-C,b]:[C,-b];return[t+b+h,e+C+p]}const O=Math.sqrt((b**2+C**2)/(E**2+w**2))*Math.sign(d*u+m*y);return[E*O+b+h,w*O+C+p]}function Ct(t,e,i){const s=G(new f({curvePaths:[[t,e]],spatialReference:i})),{curvePaths:o}=x(s,i),r=o[0][1];return H(r)?r:w(t,r)}function St(t,e,i,s,o){const r=t[e][i],n=t[e].at(i+1);if(nt(t,e)){const i=t[e][1];return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0]})}if(at(t,e)){const i=t[e][1],[o,r]=i.a[1],[n,a]=s,h=Math.hypot(n-o,a-r),[p,c]=[n-o,a-r],l=T(c,p);return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0,l,h,i.a[6]]})}const a=O(r);if(k(r))r.splice(0,r.length,...s);else if(P(r))r.b[0].splice(0,r.b[0].length,...s);else if(V(r)||I(r)){const o=O(t[e][i-1]),n=V(r)?E(o,r):R(o,r);t[e].splice(i,1,{c:[[...s],bt(o,n,s,!0)]})}else if(H(r)){r.a[0].splice(0,r.a[0].length,...s);const n=O(t[e][i-1]);r.a=Ct(n,r,o).a}if(n&&!k(n)&&!P(r))if(V(n)||I(n)){const o=O(n),r=V(n)?E(a,n):R(a,n);t[e].splice(i+1,1,{c:[o,bt(o,r,s,!1)]})}else if(H(n)){const t=O(r);n.a=Ct(t,n,o).a}}function Et({attributes:t}){return[t?.[tt.pathIndex]||0,t?.[tt.pointIndex]||0]}function wt({attributes:t}){return`${t?.[tt.pathIndex]}-${t?.[tt.pointIndex]}`}function Ot(t){return t instanceof e?[t]:[...t]}function Vt(t){const e=t.sourceLayer??t.layer;return N(e)?{graphic:t,layer:e}:null}function It(t){return t.toArray().map(({attributes:t})=>({pathIndex:t[tt.pathIndex],vertexIndex:t[tt.pointIndex]}))}t([y()],_t.prototype,"_activeOperationInfo",void 0),t([y()],_t.prototype,"_connectedReshapeManager",void 0),t([y()],_t.prototype,"_coordinateHelper",null),t([y()],_t.prototype,"_editGeometryOperations",void 0),t([y()],_t.prototype,"tooltip",void 0),t([y()],_t.prototype,"tooltipInfos",void 0),t([y()],_t.prototype,"activeTooltipInfo",void 0),t([y({constructOnly:!0})],_t.prototype,"automaticAreaMeasurementUtils",void 0),t([y({constructOnly:!0})],_t.prototype,"automaticLengthMeasurementUtils",void 0),t([y()],_t.prototype,"_selectedManipulator",null),t([y()],_t.prototype,"_tooltipsContext",null),t([y()],_t.prototype,"callbacks",void 0),t([y()],_t.prototype,"connectedReshapeProviders",void 0),t([y()],_t.prototype,"enableMidpoints",void 0),t([y()],_t.prototype,"enableCurveOnMidpoint",void 0),t([y()],_t.prototype,"enableMovement",void 0),t([y()],_t.prototype,"enableVertices",void 0),t([y()],_t.prototype,"graphic",void 0),t([y()],_t.prototype,"highlightName",void 0),t([y()],_t.prototype,"highlightsEnabled",void 0),t([y()],_t.prototype,"layer",void 0),t([y()],_t.prototype,"snappingManager",void 0),t([y({readOnly:!0})],_t.prototype,"state",null),t([y()],_t.prototype,"symbols",void 0),t([y({type:dt})],_t.prototype,"sketchOptions",void 0),t([y({readOnly:!0})],_t.prototype,"type",void 0),t([y({readOnly:!0})],_t.prototype,"vertexGraphics",void 0),t([y({readOnly:!0})],_t.prototype,"curveControlPointGraphics",void 0),t([y({readOnly:!0})],_t.prototype,"constructionLineGraphics",void 0),t([y({readOnly:!0})],_t.prototype,"midpointGraphics",void 0),t([y({readOnly:!0})],_t.prototype,"selectedManipulators",void 0),t([y()],_t.prototype,"view",void 0),_t=t([_("esri.views.draw.support.Reshape")],_t);const Pt=_t;export{Pt as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import o from"../../../core/Error.js";import{EventedAccessor as r}from"../../../core/Evented.js";import n from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{destroyMaybe as h,assertIsSome as p,abortMaybe as c}from"../../../core/maybe.js";import{pausable as l,when as d,watch as m,initial as v,sync as u}from"../../../core/reactiveUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import g from"../../../geometry/Point.js";import f from"../../../geometry/Polyline.js";import{fromGeometry as G,toGeometry as x}from"../../../geometry/operators/support/apiConverter.js";import{closeRingsAndFixWinding as M,geometryToCoordinates as b}from"../../../geometry/support/coordsUtils.js";import{isPoint as C}from"../../../geometry/support/typeUtils.js";import{interpolateCircle as S}from"../../../geometry/support/curves/circleUtils.js";import{deriveCircleFromCircularArc as E,toEllipticArc7 as w}from"../../../geometry/support/curves/circularArcUtils.js";import{getEndpoint as O,isCircularArc as V,isEllipticArc4 as I,isBezierCurve as P,isCoordinate as k,isEllipticArc7 as H}from"../../../geometry/support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as R}from"../../../geometry/support/curves/ellipticArc4Utils.js";import{wrapAtan2 as T}from"../../../geometry/support/curves/mathUtils.js";import A from"../../../layers/GraphicsLayer.js";import{SnappingVisualizer2D as j}from"../../2d/interactive/SnappingVisualizer2D.js";import{ConnectedReshapeManager as L}from"./ConnectedReshapeManager.js";import{screenDeltaToMapDelta as U,cloneMove as F}from"./drawUtils.js";import D from"./GraphicMover.js";import z from"./HighlightHelper.js";import{addUniqueLayer as K,isConnectedReshapeSupportedLayer as N}from"./layerUtils.js";import{createTooltipInfos as q,connectTooltip as Z,updateTranslateTooltipInfo as $,updateTranslateVertexTooltipInfo as B}from"./reshapeTooltipUtils.js";import{defaultSymbols as J,createMidpointGraphics as Q,createVertexGraphics as W,createCurveControlPointGraphics as X,createCurveConstructionLineGraphics as Y,attributeKeys as tt,getMidpoint as et,controlPointKinds as it,saveUpdatedCurveOrCoordinate as st,toolIdAttribute as ot,splitCurve as rt,isSingleSegmentCircle as nt,isSingleSegmentEllipse as at}from"./reshapeUtils.js";import{ViewEventPriorities as ht}from"../../input/InputManager.js";import{createCoordinateHelper as pt}from"../../interactive/coordinateHelper.js";import{sketchKeys as ct}from"../../interactive/keybindings.js";import{EditGeometryOperations as lt}from"../../interactive/editGeometry/EditGeometryOperations.js";import dt from"../../interactive/sketch/SketchOptions.js";import{SnappingContext as mt}from"../../interactive/snapping/SnappingContext.js";import{makeTooltip as vt,enterInputModeIfAvailable as ut}from"../../interactive/tooltip/tooltipCommonUtils.js";const yt=Symbol();let _t=class extends r{constructor(t){super(t),this._updateHandlesOnExternalGeometryChange=null,this._activeOperationInfo=null,this._connectedReshapeManager=null,this._editGeometryOperations=null,this._mover=null,this._snappingContext=null,this._snappingGraphicsLayer=null,this._hoverGraphic=null,this._snappingTask=null,this._stagedVertex=null,this.tooltip=null,this.activeTooltipInfo=null,this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.connectedReshapeProviders=null,this.enableMidpoints=!0,this.enableCurveOnMidpoint=!1,this.enableMovement=!0,this.enableVertices=!0,this.graphic=null,this.highlightName=null,this.highlightsEnabled=!0,this.layer=null,this.snappingManager=null,this.symbols=J,this.sketchOptions=new dt,this.type="reshape",this.vertexGraphics=new s,this.curveControlPointGraphics=new s,this.constructionLineGraphics=new s,this.midpointGraphics=new s,this.selectedManipulators=new s,this.view=null}initialize(){const t=this.view;this._highlightHelper=new z({view:t}),this._setup(),this._updateHandlesOnExternalGeometryChange=l(()=>this.graphic?.geometry,t=>{if(!t)return;const e=new Set(this.selectedManipulators.map(wt));this._highlightHelper.removeAll(),this._setUpHighlights(),this._setupGraphics(),this._clearSelection(),this.vertexGraphics.filter(t=>e.has(wt(t))).forEach(t=>this._addToSelection(t));const{enableMovement:i,_mover:s,graphic:o,midpointGraphics:r,vertexGraphics:n,curveControlPointGraphics:a}=this,h=n.concat(r,a).items;i&&h.push(o),s?.set("graphics",h)},u),this.tooltip=vt(()=>({view:t,options:this.sketchOptions.tooltips})),this.tooltipInfos=q(this.sketchOptions),this.addHandles([d(()=>t?.ready,()=>{const{layer:t,view:e}=this;K(e,t),this.addHandles(e.on("key-down",t=>this._keyDownHandler(t),ht.TOOL))},{once:!0,initial:!0}),m(()=>this.graphic,()=>this.refresh()),m(()=>this.layer,(t,e)=>{e&&(this._clearSelection(),this._resetGraphics(e)),this.refresh()}),m(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()}),m(()=>this.enableMidpoints,()=>this.refresh()),Z(this.tooltip,()=>this._tooltipsContext),m(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),v),this._updateHandlesOnExternalGeometryChange]),this._updateTooltip()}destroy(){this._reset(),this._mover?.destroy(),this._mover=null,this._connectedReshapeManager=h(this._connectedReshapeManager),this.tooltip=h(this.tooltip)}get _coordinateHelper(){return this._editGeometryOperations?.data.coordinateHelper??pt(!!this.graphic.geometry?.hasZ,!!this.graphic.geometry?.hasM,this.view.spatialReference)}get _selectedManipulator(){return 1===this.selectedManipulators.length?this.selectedManipulators.at(0):void 0}get _tooltipsContext(){const{automaticAreaMeasurementUtils:t,automaticLengthMeasurementUtils:e,sketchOptions:i,activeTooltipInfo:s,graphic:o}=this;return{sketchOptions:i,activeTooltipInfo:s,graphic:o,selectedVertex:this._selectedManipulator,automaticAreaMeasurementUtils:t,automaticLengthMeasurementUtils:e,updateGeometry:(t,e,i,s,o)=>{this._setUpGeometryHelper();const r=t===this.graphic;r?this._emitMoveStartEvent(0,0):this._emitReshapeStartEvent(t);const n=!0;if(this._syncGeometryAfterVertexMove(t,e,s,o,n),r){const{view:t}=this,s=t.toScreen(i),o=t.toScreen(e),r=(o?.x??0)-(s?.x??0),n=(o?.y??0)-(s?.y??0);this._emitMoveEvent(r,n),this._emitMoveStopEvent(r,n)}else this._emitReshapeEvent(t),this._emitReshapeStopEvent(t);this._editGeometryOperations=h(this._editGeometryOperations)}}}get state(){const t=this.view.ready,e=!(!this.graphic||!this.layer);return t&&e?"active":t?"ready":"disabled"}isUIGraphic(t){return t===this.graphic||this._isMidpoint(t)||this._isCurveControlPoint(t)||this._isVertex(t)||this._isConstructionLine(t)}refresh(){this._reset(),this._setup()}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){const{selectedManipulators:t}=this;t.length&&this._removeVertices(t)}_setup(){const{graphic:t,layer:e}=this;if(!e||null==t?.geometry)return;const i=t.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&M(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._setupConnectedReshapeManager()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper?.add(this.graphic,this.highlightName)}_setUpGeometryHelper(){const t=this.graphic.geometry;null!=t&&"mesh"!==t.type&&"extent"!==t.type?this._editGeometryOperations??=lt.fromGeometry(t,2,{allowCurves:!0}):this._logGeometryTypeError()}_saveSnappingContextForHandle(t,e){this._snappingGraphicsLayer=new A({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer);const i=this._editGeometryOperations;p(i),this._snappingContext=new mt({editGeometryOperations:i,elevationInfo:{mode:"on-the-ground",offset:0},pointer:e.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,feature:this.graphic,visualizer:new j(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(t)})}_reset(){this._clearSelection(),this._highlightHelper?.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._activeOperationInfo=null,this._mover?.destroy(),this._mover=null,this.removeHandles(yt)}_resetSnappingStateVars(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),null!=this._snappingGraphicsLayer&&(this.view?.map&&this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._editGeometryOperations=h(this._editGeometryOperations),this._snappingTask=c(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(t){this._removeMidpointGraphics(t),this._removeVertexGraphics(t),this._removeCurveGraphics(t),this._updateTooltip()}_removeMidpointGraphics(t=this.layer){const{midpointGraphics:e}=this;t?.removeMany(e.items),e.drain(h)}_removeVertexGraphics(t=this.layer){const{vertexGraphics:e}=this;t?.removeMany(e.items),e.drain(h)}_removeCurveGraphics(t=this.layer){const{curveControlPointGraphics:e,constructionLineGraphics:i}=this;t?.removeMany(e.items),t?.removeMany(i.items),e.drain(h),i.drain(h)}_setupGraphics(){const t=this.graphic.geometry;if(null!=t&&("polyline"===t.type||"polygon"===t.type||"multipoint"===t.type)){const e=gt(t);this.enableMidpoints&&"multipoint"!==t.type&&this._setUpMidpointGraphics(e),this.enableVertices&&(this._setUpVertexGraphics(e),this._setupCurveGraphics(e))}}_setUpMidpointGraphics(t){this._removeMidpointGraphics();const e=Q(t,this.symbols,this._coordinateHelper,"polygon"===this.graphic.geometry?.type);this.midpointGraphics.addMany(e),this.layer.addMany(e)}_setUpVertexGraphics(t){this._removeVertexGraphics();const e=W(t,this.symbols,this._coordinateHelper);this.vertexGraphics.addMany(e),this._storeRelatedVertexIndices(),this.layer.addMany(e)}_setupCurveGraphics(t){this._removeCurveGraphics();const e=X(t,this.symbols,this._coordinateHelper),i=Y(t,this.symbols,this._coordinateHelper);this.curveControlPointGraphics.addMany(e),this.constructionLineGraphics.addMany(i),this.layer.addMany(i),this.layer.addMany(e)}_updateSymbolsForTheme(){const t=this.view.effectiveTheme.accentColor;this.symbols={vertices:{...this.symbols.vertices,default:this.symbols.vertices.default.clone().set("color",t),hover:this.symbols.vertices.hover?.clone().set("color",t)},controlPoints:{...this.symbols.controlPoints,default:this.symbols.controlPoints.default.clone().set("color",t),hover:this.symbols.controlPoints.hover?.clone().set("color",t)},midpoints:{...this.symbols.midpoints},constructionLines:this.symbols.constructionLines.clone().set("color",t)};for(const e of this.vertexGraphics)this._isSelected(e)?e.symbol=this.symbols.vertices.selected:this._hoverGraphic===e?e.symbol=this.symbols.vertices.hover:e.symbol=this.symbols.vertices.default;for(const e of this.curveControlPointGraphics)this._isSelected(e)?e.symbol=this.symbols.controlPoints.selected:this._hoverGraphic===e?e.symbol=this.symbols.controlPoints.hover:e.symbol=this.symbols.controlPoints.default;for(const e of this.constructionLineGraphics)e.symbol=this.symbols.constructionLines}_storeRelatedVertexIndices(){const t=this.vertexGraphics.items;if(!t)return;const e=t.map(({geometry:t})=>({x:t.x,y:t.y}));for(let i=0;i<e.length;i++){const s=[];for(let t=0;t<e.length;t++){if(i===t)continue;const o=e[i],r=e[t];o.x===r.x&&o.y===r.y&&s.push(t)}t[i].attributes[tt.relatedGraphicIndices]=s}}_setupMover(){const{enableMovement:t,graphic:e,midpointGraphics:i,vertexGraphics:s,view:o}=this,r=s.concat(i,this.curveControlPointGraphics).items;t&&"multipoint"!==e.geometry?.type&&r.push(e),this._mover=new D({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:r,view:o,callbacks:{onGraphicClick:t=>this._onGraphicClickCallback(t),onGraphicMoveStart:t=>this._onGraphicMoveStartCallback(t),onGraphicMove:t=>this._onGraphicMoveCallback(t),onGraphicMoveStop:t=>this._onGraphicMoveStopCallback(t),onGraphicPointerOver:t=>this._onGraphicPointerOverCallback(t),onGraphicPointerOut:t=>this._onGraphicPointerOutCallback(t)}})}_setupConnectedReshapeManager(){const{connectedReshapeProviders:t}=this;null!=t&&0!==t.length&&(this._connectedReshapeManager=new L({providerFactories:t,view:this.view}))}_onGraphicClickCallback(t){t.viewEvent.stopPropagation();const e=t.graphic,i=this._isCurveControlPoint(e);if(e===this.graphic)this.clearSelection(),this.emit("graphic-click",t),this.callbacks.onGraphicClick?.(t);else if(this._isMidpoint(e)){if(2===t.viewEvent.button)return;const i=this.graphic.clone(),s=this._handleMidpointClickOrStartMove(t);this.refresh(),s.length&&this._emitVertexAddEvent([e],i,s)}else if(this._isVertex(e)||i){if(t.viewEvent.stopPropagation(),2===t.viewEvent.button)return void(i||this._removeVertices(e));t.viewEvent.native.shiftKey||this._clearSelection(),this.selectedManipulators.includes(e)?this._removeFromSelection(e,!0):this._addToSelection(e)}}_setUpOperation(t){const{graphic:e,dx:i,dy:s}=t,o=e===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(e,t),this._activeOperationInfo={target:this.graphic,mover:e,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(t){const{dx:e,dy:i,graphic:s}=t,o=this._connectedReshapeManager,r=o?Vt(this.graphic):null;if(s===this.graphic){const{geometry:n}=s;return this._setUpOperation(t),this._emitMoveStartEvent(e,i),r&&o?.startFeatureMove([r]),void(null!=n&&"point"===n.type&&this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(e,i)}))}const{selectedManipulators:n}=this;if(!n.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const e=this.graphic.clone(),i=this._handleMidpointClickOrStartMove(t);i.length&&(this._emitVertexAddEvent([s],e,i),this._refreshGraphicIndicesAttributes(i[0]))}this._addToSelection(s)}if(this._setUpOperation(t),r){const t=n.filter(t=>this._isVertex(t));o?.startVertexMove(r,It(t))}this._emitReshapeStartEvent(s),this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(s,t.viewEvent),this._emitReshapeEvent(s)})}_onGraphicMoveCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t;e.totalDx+=i,e.totalDy+=s;const{operationType:r}=e,{geometry:n}=o;if(null!=n)if("move"!==r)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(o,t.viewEvent),this._emitReshapeEvent(o)});else if("point"===n.type)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)});else if("polyline"===n.type||"polygon"===n.type){const e=gt(n);this._updateVertexGraphicLocations(e);const{dxMap:o,dyMap:r}=U(i,s,this.view);this._connectedReshapeManager?.translate(o,r,0),this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)}}_onGraphicMoveStopCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t,{operationType:r}=e;e.totalDx+=i,e.totalDy+=s,this._onHandleMove(o,i,s,t,()=>"move"===r?this._emitMoveStopEvent():this._emitReshapeStopEvent(o)),this._isMidpoint(o)||o.getAttribute(tt.curveFromStraightEdgeFlag)?this.refresh():(this._updateTooltip(this._isVertex(o)?o:null),this._resetSnappingStateVars(),this._connectedReshapeManager?.finish(),this._activeOperationInfo=null)}_updateVertexGraphicLocations(t){const{_coordinateHelper:e}=this;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes;i.geometry=e.arrayToPoint(O(t[s][o]))}this._updateMidpointGraphicLocations(t),this._updateCurveGraphicLocations(t)}_updateMidpointGraphicLocations(t){const{_coordinateHelper:e}=this;for(const i of this.midpointGraphics){const{pathIndex:s,pointIndexStart:o,pointIndexEnd:r}=i.attributes,n=t[s];i.geometry=et(n[o],n[r],e)}}_updateCurveGraphicLocations(t){const{spatialReference:e}=this._coordinateHelper,i=new Map;for(const s of this.selectedManipulators){const[t,e]=Et(s);null!=t&&null!=e&&s.getAttribute(tt.controlPointKind)&&a(i,t,()=>new Set)?.add(e)}for(const s of this.curveControlPointGraphics){const[e,o]=Et(s);if(i.get(e)?.has(o))continue;const r=t[e][o];if(V(r)||I(r)){const i=O(t[e][o-1]),n=V(r)?E(i,r):R(i,r),[a,h]=S(n,.25);s.geometry=new g({x:a,y:h,spatialReference:this._coordinateHelper.spatialReference})}else if(P(r)){const t=s.getAttribute(tt.controlPointKind),[e,i]=t===it.bezier.cp1?r.b[1]:r.b[2];s.geometry=new g({x:e,y:i,spatialReference:this._coordinateHelper.spatialReference})}}for(const s of this.constructionLineGraphics){const i=s.getAttribute(tt.controlPointKind),[o,r]=Et(s),n=t[o],a=O(n[r-1]),h=O(n[r]),p=t[o][r];i===it.bezier.line1?s.geometry=new f({paths:[[[a[0],a[1]],[...p.b[1]]]],spatialReference:e}):s.geometry=new f({paths:[[[h[0],h[1]],[...p.b[2]]]],spatialReference:e})}}_refreshGraphicIndicesAttributes(t){const{componentIndex:e,vertexIndex:i}=t,s=t=>{const[s,o]=Et(t);s===e&&o>=i&&t.setAttribute(tt.pointIndex,o+1)};this.vertexGraphics.forEach(s),this.curveControlPointGraphics.forEach(s),this.constructionLineGraphics.forEach(s);for(const o of this.midpointGraphics){if(o.getAttribute(tt.pathIndex)!==e)continue;const t=o.getAttribute(tt.pointIndexStart);t>=i&&(o.setAttribute(tt.pointIndexStart,t+1),o.setAttribute(tt.pointIndexEnd,o.getAttribute(tt.pointIndexEnd)+1))}}_getVertexFromEditGeometry(t){const[e,i]=Et(t);return p(this._editGeometryOperations),this._editGeometryOperations.data.parts[e].vertices[i]}_onHandleMove(t,e,s,o,r){c(this._snappingTask);const n=this._snappingContext;if(!n)return;const a=t.geometry,h="graphic-move-stop"===o.type;if(a&&C(a))if(null!=this.snappingManager&&this.selectedManipulators.length<2&&!h){const o=this.snappingManager;this._stagedVertex=o.update({point:a,context:n}),this._syncGeometryAfterVertexMove(t,new g(this._stagedVertex),e,s,h),r(),this._snappingTask=i(async i=>{const p=await o.snap({point:a,context:n,signal:i});p.valid&&(this._stagedVertex=p.apply(),this._syncGeometryAfterVertexMove(t,new g(this._stagedVertex),e,s,h),r())})}else{const i=null!=this._stagedVertex?new g(this._stagedVertex):a;this._syncGeometryAfterVertexMove(t,i,e,s,h),r()}}_syncGeometryAfterVertexMove(t,e,i,s,o=!1){const r=this._editGeometryOperations?.data.geometry;if(!r)return;const{_coordinateHelper:n}=this,a=n.pointToVector(e),h=this._getVertexFromEditGeometry(t);if(h){const t=n.getZ(a),e=a[0]-h.pos[0],i=a[1]-h.pos[1],s=null!=t?t-h.pos[2]:0;"point"!==r.type&&"mesh"!==r.type||this._editGeometryOperations?.moveVertices([h],e,i,s),this._connectedReshapeManager?.translate(e,i,s)}if("point"===r.type)t.geometry=e;else if("mesh"===r.type)t.geometry=r.centerAt(e);else{if(t!==this.graphic){const o=n.spatialReference,[a,h]=Et(t);let p=ft(r);const c=n.pointToArray(e);this._updateGeometryFromGraphic(t,p,a,h,c,o,"polygon"===r.type),this._isVertex(t)||this._isCurveControlPoint(t)?(p=this._moveRelatedCoordinates(p,t,c),p=this._moveSelectedHandleCoordinates(p,t,i,s,"polygon"===r.type),this._updateMidpointGraphicLocations(p),this._updateCurveGraphicLocations(p)):this._isMidpoint(t)&&this._updateCurveGraphicLocations(p),st(r,p)}this._updateGraphicGeometry(r.clone()),this._editGeometryOperations=lt.fromGeometry(r,2,{allowCurves:!0}),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(t),e):t.geometry=e)}}_moveRelatedCoordinates(t,e,i){const{relatedGraphicIndices:s}=e.attributes,o=this._coordinateHelper.spatialReference;if(!s?.length)return t;for(const r of s){const s=this.vertexGraphics.at(r),[n,a]=Et(s);St(t,n,a,i,o),s.geometry=e.geometry}return t}_moveSelectedHandleCoordinates(t,e,i,s,o){const r=this._coordinateHelper.spatialReference;for(const n of this.selectedManipulators)if(n!==e){const[e,a]=Et(n),h=n.getAttribute(tt.relatedGraphicIndices),p=F(n.geometry,i,s,this.view),c=b(p);if(n.geometry=p,this._updateGeometryFromGraphic(n,t,e,a,c,r,o),h?.length)for(const i of h){const e=this.vertexGraphics.at(i),[s,o]=Et(e);St(t,s,o,c,r),e.geometry=p}}return t}_updateGeometryFromGraphic(t,e,i,s,o,r,n){const a=e[i].length-1;this._isCurveControlPoint(t)?xt(e,i,s,[o[0],o[1]],t.getAttribute(tt.controlPointKind)):(St(e,i,s,o,r),n&&(0===s?St(e,i,a,o,r):s===a&&(e[i][0]=o)))}_onGraphicPointerOverCallback(t){const e=t.graphic;this._hoverGraphic=e;const i=this._isVertex(e);i&&!this._isSelected(e)?e.symbol=this.symbols.vertices.hover:this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.hover),this._updateTooltip(i?e:null),this._updateHoverCursor(e)}_onGraphicPointerOutCallback(t){const e=t.graphic;this._hoverGraphic=null,this._isVertex(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.vertices.default),this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.default),this.removeHandles(yt),this._updateTooltip()}_handleMidpointClickOrStartMove(t){const{graphic:e}=t,i=this.graphic.geometry;if(null==i||"polygon"!==i.type&&"polyline"!==i.type)return[];const s=i.clone(),o=[],{[tt.pathIndex]:r,[tt.pointIndexStart]:n,[tt.pointIndexEnd]:a}=e.attributes,h=b(e.geometry),p=0===a?n+1:a;e.attributes={[tt.tool]:ot,[tt.pathIndex]:r,[tt.pointIndex]:p,[tt.relatedGraphicIndices]:[]};const c=ft(s),l=c[r][a];if(k(l)){if(this.enableCurveOnMidpoint&&t.viewEvent.native.shiftKey){const t=O(c[r][p]);c[r].splice(p,1,{c:[t,[h[0],h[1]]]}),e.setAttribute(tt.controlPointKind,it.circle.interior),e.setAttribute(tt.curveFromStraightEdgeFlag,!0),this.midpointGraphics.remove(e),this.curveControlPointGraphics.push(e),st(s,c)}else c[r].splice(p,0,h),o.push({coordinates:c[r][p],componentIndex:r,vertexIndex:p})}else{const t=O(c[r][n]),e=rt(t,l,.5,this._coordinateHelper);c[r].splice(a,1,...e),o.push({coordinates:O(c[r][p]),componentIndex:r,vertexIndex:p})}return this._updateGraphicGeometry(s),o}_addToSelection(t){const e=Ot(t);for(const i of e)this._isCurveControlPoint(i)?i.symbol=this.symbols.controlPoints.selected:i.symbol=this.symbols.vertices.selected,this.selectedManipulators.add(i),this._updateTooltip(i);this._emitSelectEvent(e)}_removeFromSelection(t,e){if(this._isVertex(t)){const{vertices:i}=this.symbols;t.symbol=e?i.hover:i.default}else if(this._isCurveControlPoint(t)){const{controlPoints:i}=this.symbols;t.symbol=e?i.hover:i.default}this.selectedManipulators.remove(t),this._emitDeselectEvent([t]),this._updateTooltip()}_clearSelection(){const t=this.selectedManipulators.toArray(),{controlPoints:e,vertices:i}=this.symbols;if(t.length>0){for(const s of t)this._isVertex(s)?s.symbol=i.default:this._isCurveControlPoint(s)&&(s.symbol=e.default);this.selectedManipulators.removeAll(),this._emitDeselectEvent(t),this._updateTooltip()}}_keyDownHandler(t){null==this._activeOperationInfo&&ut(t,this.tooltip)||ct.delete.includes(t.key)&&!t.repeat&&this.selectedManipulators.length&&this._removeVertices(this.selectedManipulators)}_removeVertices(t){const e=this.graphic.geometry,i=this.vertexGraphics.length;if(null==e||"polygon"!==e.type&&"polyline"!==e.type&&"multipoint"!==e.type)return;if("polygon"===e.type&&i<4||"multipoint"===e.type&&i<2||"polyline"===e.type&&i<3)return;const s=this.graphic.clone(),o=e.clone();let r=ft(o);const n=[],a=Ot(t);for(const h of a){if(this._isCurveControlPoint(h))continue;const{x:t,y:e}=h.geometry;for(let i=0;i<r.length;i++){const s=r[i];for(let o=0;o<s.length;o++){const[a,h]=O(s[o]);if(t===a&&e===h){n.push({coordinates:O(r[i][o]),componentIndex:i,vertexIndex:o}),r[i].splice(Number(o),1);const t=r[i][o];t&&!k(t)&&(r[i][o]=O(t))}}}}if("polygon"===o.type)r=r.filter(t=>{if(t.length<2)return!1;const[e,i]=O(t[0]),[s,o]=O(t[t.length-1]);return(2!==t.length||e!==s||i!==o)&&(e===s&&i===o||t.push(t[0]),!0)});else if("polyline"===o.type)for(const h of r)1===h.length&&r.splice(r.indexOf(h),1);st(o,r),this._updateGraphicGeometry(o),this.refresh(),this._emitVertexRemoveEvent(a,s,n)}_isVertex(t){return this.vertexGraphics.includes(t)}_isCurveControlPoint(t){return this.curveControlPointGraphics.includes(t)}_isConstructionLine(t){return this.constructionLineGraphics.includes(t)}_isSelected(t){return(this._isVertex(t)||this.curveControlPointGraphics.includes(t))&&this.selectedManipulators.includes(t)}_isMidpoint(t){return this.midpointGraphics.includes(t)}_updateHoverCursor(t){const e=this._isMidpoint(t)?"copy":"move";this.addHandles(this.view.acquireCursor(e,"high"),yt)}_updateTooltip(t,e){let i=null;const{graphic:s,view:o,tooltipInfos:r}=this,n=s?.geometry;"point"===n?.type?i=r.movePoint:this._selectedManipulator?i=r.selectedVertex:t===this.graphic?(i=r.translateGraphic,$(i,o,this._tooltipsContext,e)):t&&this.selectedManipulators.length>1&&(i=r.translateVertices,B(i,o,n,this._tooltipsContext,e)),this.activeTooltipInfo=i}_updateGraphicGeometry(t){this._updateHandlesOnExternalGeometryChange?.pause(),this.graphic.geometry=t,this._updateHandlesOnExternalGeometryChange?.resume()}_emitMoveStartEvent(t,e){const i={type:"move-start",mover:this.graphic,dx:t,dy:e};this.emit("move-start",i),this.callbacks.onMoveStart?.(i)}_emitMoveEvent(t,e){const i={type:"move",mover:this.graphic,dx:t,dy:e};this.emit("move",i),this.callbacks.onMove?.(i)}_emitMoveStopEvent(t,e){if(null==t||null==e){const i=this._activeOperationInfo;if(!i)return;t=i.totalDx,e=i.totalDy}const i={type:"move-stop",mover:this.graphic,dx:t,dy:e};this.emit("move-stop",i),this.callbacks.onMoveStop?.(i)}_emitReshapeStartEvent(t){const e={type:"reshape-start",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-start",e),this.callbacks.onReshapeStart?.(e)}_emitReshapeEvent(t){const e={type:"reshape",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape",e),this.callbacks.onReshape?.(e)}_emitReshapeStopEvent(t){const e={type:"reshape-stop",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-stop",e),this.callbacks.onReshapeStop?.(e)}_emitSelectEvent(t){const e={type:"vertex-select",added:t};this.emit("select",e),this.callbacks.onVertexSelect?.(e)}_emitDeselectEvent(t){const e={type:"vertex-deselect",removed:t};this.emit("deselect",e),this.callbacks.onVertexDeselect?.(e)}_emitVertexAddEvent(t,e,i){const s={type:"vertex-add",added:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-add",s),this.callbacks.onVertexAdd?.(s)}_emitVertexRemoveEvent(t,e,i){const s={type:"vertex-remove",removed:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-remove",s),this.callbacks.onVertexRemove?.(s)}_logGeometryTypeError(){n.getLogger(this).error(new o("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};function gt(t){const e=ft(t.clone());if("polygon"===t.type)for(const i of e){const t=i[i.length-1];if(!k(t))continue;const e=i[0];e[0]===t[0]&&e[1]===t[1]&&i.length>2&&i.pop()}return e}function ft(t){return"polygon"===t.type?t.curveRings?.slice()??t.rings.slice():"polyline"===t.type?t.curvePaths?.slice()??t.paths.slice():t.points.map(t=>[t])}function Gt(t,e,i,s){const o=t[e][i];if(V(o))o.c[1]=s;else if(I(o)){const o=O(t[e][i]);t[e][i]={c:[o,s]}}}function xt(t,e,i,s,o){switch(o){case it.circle.interior:Gt(t,e,i,s);break;case it.bezier.cp1:t[e][i].b[1]=s;break;case it.bezier.cp2:t[e][i].b[2]=s}}function Mt(t,e){return t<1e-8*e}function bt(t,{cx:e,cy:i,isInvalid:s,thetaStart:o,thetaEnd:r},n,a){const[h,p]=t,[c,l]=n,d=c-h,m=l-p;e-=h,i-=p;const v=a?o>r:o<r,[u,y]=s?[e,i]:v?[-i,e]:[i,-e],[_,g]=[d,m],[f,G]=[u,y],x=_*G-g*f,M=(d**2+m**2)/2;if(Mt(Math.abs(x),M))return[(h+c)/2,(p+l)/2];const[b,C]=[G/x*M,-f/x*M],S=b**2+C**2,[E,w]=[d/2-b,m/2-C];if(Mt(E**2+w**2,S)){const[t,e]=v?[-C,b]:[C,-b];return[t+b+h,e+C+p]}const O=Math.sqrt((b**2+C**2)/(E**2+w**2))*Math.sign(d*u+m*y);return[E*O+b+h,w*O+C+p]}function Ct(t,e,i){const s=G(new f({curvePaths:[[t,e]],spatialReference:i})),{curvePaths:o}=x(s,i),r=o[0][1];return H(r)?r:w(t,r)}function St(t,e,i,s,o){const r=t[e][i],n=t[e].at(i+1);if(nt(t,e)){const i=t[e][1];return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0]})}if(at(t,e)){const i=t[e][1],[o,r]=i.a[1],[n,a]=s,h=Math.hypot(n-o,a-r),[p,c]=[n-o,a-r],l=T(c,p);return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0,l,h,i.a[6]]})}const a=O(r);if(k(r))r.splice(0,r.length,...s);else if(P(r))r.b[0].splice(0,r.b[0].length,...s);else if(V(r)||I(r)){const o=O(t[e][i-1]),n=V(r)?E(o,r):R(o,r);t[e].splice(i,1,{c:[[...s],bt(o,n,s,!0)]})}else if(H(r)){r.a[0].splice(0,r.a[0].length,...s);const n=O(t[e][i-1]);r.a=Ct(n,r,o).a}if(n&&!k(n)&&!P(r))if(V(n)||I(n)){const o=O(n),r=V(n)?E(a,n):R(a,n);t[e].splice(i+1,1,{c:[o,bt(o,r,s,!1)]})}else if(H(n)){const t=O(r);n.a=Ct(t,n,o).a}}function Et({attributes:t}){return[t?.[tt.pathIndex]||0,t?.[tt.pointIndex]||0]}function wt({attributes:t}){return`${t?.[tt.pathIndex]}-${t?.[tt.pointIndex]}`}function Ot(t){return t instanceof e?[t]:[...t]}function Vt(t){const e=t.sourceLayer??t.layer;return N(e)?{graphic:t,layer:e}:null}function It(t){return t.toArray().map(({attributes:t})=>({pathIndex:t[tt.pathIndex],vertexIndex:t[tt.pointIndex]}))}t([y()],_t.prototype,"_activeOperationInfo",void 0),t([y()],_t.prototype,"_connectedReshapeManager",void 0),t([y()],_t.prototype,"_coordinateHelper",null),t([y()],_t.prototype,"_editGeometryOperations",void 0),t([y()],_t.prototype,"tooltip",void 0),t([y()],_t.prototype,"tooltipInfos",void 0),t([y()],_t.prototype,"activeTooltipInfo",void 0),t([y({constructOnly:!0})],_t.prototype,"automaticAreaMeasurementUtils",void 0),t([y({constructOnly:!0})],_t.prototype,"automaticLengthMeasurementUtils",void 0),t([y()],_t.prototype,"_selectedManipulator",null),t([y()],_t.prototype,"_tooltipsContext",null),t([y()],_t.prototype,"callbacks",void 0),t([y()],_t.prototype,"connectedReshapeProviders",void 0),t([y()],_t.prototype,"enableMidpoints",void 0),t([y()],_t.prototype,"enableCurveOnMidpoint",void 0),t([y()],_t.prototype,"enableMovement",void 0),t([y()],_t.prototype,"enableVertices",void 0),t([y()],_t.prototype,"graphic",void 0),t([y()],_t.prototype,"highlightName",void 0),t([y()],_t.prototype,"highlightsEnabled",void 0),t([y()],_t.prototype,"layer",void 0),t([y()],_t.prototype,"snappingManager",void 0),t([y({readOnly:!0})],_t.prototype,"state",null),t([y()],_t.prototype,"symbols",void 0),t([y({type:dt})],_t.prototype,"sketchOptions",void 0),t([y({readOnly:!0})],_t.prototype,"type",void 0),t([y({readOnly:!0})],_t.prototype,"vertexGraphics",void 0),t([y({readOnly:!0})],_t.prototype,"curveControlPointGraphics",void 0),t([y({readOnly:!0})],_t.prototype,"constructionLineGraphics",void 0),t([y({readOnly:!0})],_t.prototype,"midpointGraphics",void 0),t([y({readOnly:!0})],_t.prototype,"selectedManipulators",void 0),t([y()],_t.prototype,"view",void 0),_t=t([_("esri.views.draw.support.Reshape")],_t);const Pt=_t;export{Pt 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 t}from"tslib";import e from"../../Color.js";import"../../intl.js";import s from"../../core/Accessor.js";import{createTask as o}from"../../core/asyncUtils.js";import{multiplyOpacity as r,getContrast as i}from"../../core/colorUtils.js";import{makeHandle as n}from"../../core/handleUtils.js";import"../../core/has.js";import{deg2rad as a}from"../../core/mathUtils.js";import{formatLength as l}from"../../core/quantityFormatUtils.js";import{watch as c,on as h}from"../../core/reactiveUtils.js";import{createScreenPointArray as p}from"../../core/screenUtils.js";import{getMetersPerUnit as m,getMetersPerVerticalUnitForSR as d}from"../../core/unitUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as f}from"../../core/accessorSupport/decorators/subclass.js";import{squaredDistance as g,set as b,normalize as _,scale as x,lerp as y,add as v}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as U}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{G as j}from"../../chunks/vec32.js";import{isClockwise as L}from"../../geometry/support/coordsUtils.js";import{sv3d as I}from"../../geometry/support/vectorStacks.js";import{fetchMessageBundle as C}from"../../intl/messages.js";import{getConvertedElevationFromVector as k,absoluteHeightElevationInfo as D}from"../../support/elevationInfoUtils.js";import{getDefaultUnitForView as S}from"../../support/getDefaultUnitForView.js";import w from"../overlay/TextOverlayItem.js";import{onLocaleChange as M}from"../../intl/locale.js";const T=3025,O={default:15,far:25};let P=class extends s{constructor(t){super(t),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messageUnitsTask=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){this.addHandles([c(()=>[null!=this.context&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits],()=>this._update()),...["vertex-add","vertex-update","vertex-remove"].map(t=>h(()=>this.context?.editGeometryOperations,t,()=>this._update())),c(()=>this._colors,t=>this._updateStyle(t)),M(()=>this._refreshMessages()),n(()=>this._messageUnitsTask?.abort())]),this._refreshMessages()}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return null==this._messagesUnits}get test(){}get _messagesUnits(){return this._messageUnitsTask?.value}get _edgeDistancePixels(){return O[this.edgeDistance]}get _colors(){const t=this.context?.view.effectiveTheme.textColor??e.fromArray([255,255,255]);return{textColor:t,backgroundColor:r(i(t,160),.6)}}_update(){if(this.destroyed)return;this._nextLabelIndex=0;const{context:t,stagedVertex:e}=this;if(!t)return this._destroyUnusedLabels();const{editGeometryOperations:s}=t,{parts:o,geometry:r,coordinateHelper:i}=s.data;if(!r)return this._destroyUnusedLabels();const n=o.length;for(let a=0;a<n;++a){const o=V(r,s,e,i,a);if(o.length<2||!G(o,t.view,t.elevationInfo,i.spatialReference))continue;const l=1===n&&!L(o);let c=z,h=F;this.toScreenPointArray(t,o[0],c);for(let e=1;e<o.length;++e){const s=o[e-1],r=o[e];this.toScreenPointArray(t,r,h),this._addLabel(t,s,c,r,h,l),[c,h]=[h,c]}}this._destroyUnusedLabels()}_updateStyle({textColor:t,backgroundColor:e}){const s=this._nextLabelIndex,o=this._labelInfos;for(let r=0;r<s;++r){const{label:s}=o[r];s.textColor=t,s.backgroundColor=e}}_addLabel(t,e,s,o,r,i){const{label:n}=this._getOrCreateLabel(t);if(!this.visible||g(s,r)<T)return void(n.visible=!1);const{spatialReference:a}=t.editGeometryOperations.data,c=t.automaticLengthMeasurementUtils.autoDistance2D(e,o,a),h=this._messagesUnits,p=S(t.view);n.text=null!=h&&null!=c?l(h,c,p):"",n.visible=!0;const m=r[0]-s[0],d=r[1]-s[1];i?b(R,-d,m):b(R,d,-m),_(R,R),x(R,R,this._edgeDistancePixels),y(q,s,r,.5),v(q,q,R),n.position=[q[0],q[1]],Math.abs(R[0])>Math.abs(R[1])?n.anchor=R[0]>0?"left":"right":n.anchor=-R[1]<0?"top":"bottom"}_getOrCreateLabel(t){const e=this._labelInfos.length>this._nextLabelIndex,{textColor:s,backgroundColor:o}=this._colors;if(e){const t=this._labelInfos[this._nextLabelIndex++],{label:e}=t;return e.textColor=s,e.backgroundColor=o,t}const r=new w({anchor:"center",fontSize:8,textColor:s,backgroundColor:o});t.view.overlay?.items.add(r);const i={label:r};return this._labelInfos.push(i),this._nextLabelIndex=this._labelInfos.length,i}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:t}){this.context?.view.overlay?.items.remove(t),t.destroy()}_refreshMessages(){this._messageUnitsTask?.abort(),this._messageUnitsTask=o(()=>C("esri/core/t9n/Units"))}};function V(t,e,s,o,r){const i=[];for(const l of e.data.parts[r].iterateVertices())i.push(o.toXYZ(l.pos,I.get()));if(0===r&&null!=s&&i.push(o.toXYZ(s,I.get())),i.length<2)return i;const n=i[0],a=i[i.length-1];return"polygon"===t.type&&i.length>2&&!j(n,a)&&i.push(n),i}function G(t,e,s,o){if("2d"===e.type)return!0;const r=m(o)??1,i=d(o),n=t=>k(e,t,o,s,D)??0;for(let a=1;a<t.length;++a){const e=t[a-1],s=t[a],o=(s[0]-e[0])*r,l=(s[1]-e[1])*r,c=(n(s)-n(e))*i;if(Math.abs(c)/Math.sqrt(o*o+l*l)>A)return!1}return!0}t([u()],P.prototype,"context",void 0),t([u()],P.prototype,"stagedVertex",void 0),t([u()],P.prototype,"visible",void 0),t([u()],P.prototype,"edgeDistance",void 0),t([u()],P.prototype,"updating",null),t([u()],P.prototype,"_messageUnitsTask",void 0),t([u()],P.prototype,"_messagesUnits",null),t([u()],P.prototype,"_edgeDistancePixels",null),t([u()],P.prototype,"_colors",null),P=t([f("esri.views.interactive.SegmentLabels")],P);const A=a(5),R=U(),q=U(),z=p(),F=p();export{P as SegmentLabels};
5
+ import{__decorate as t}from"tslib";import e from"../../Color.js";import{onLocaleChange as s}from"../../intl.js";import o from"../../core/Accessor.js";import{createTask as r}from"../../core/asyncUtils.js";import{multiplyOpacity as i,getContrast as n}from"../../core/colorUtils.js";import{makeHandle as a}from"../../core/handleUtils.js";import"../../core/has.js";import{deg2rad as l}from"../../core/mathUtils.js";import{formatLength as c}from"../../core/quantityFormatUtils.js";import{watch as h,on as p}from"../../core/reactiveUtils.js";import{createScreenPointArray as m}from"../../core/screenUtils.js";import{getMetersPerUnit as d,getMetersPerVerticalUnitForSR as u}from"../../core/unitUtils.js";import{property as f}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as g}from"../../core/accessorSupport/decorators/subclass.js";import{squaredDistance as b,set as _,normalize as x,scale as y,lerp as v,add as U}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as j}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{G as L}from"../../chunks/vec32.js";import{isClockwise as I}from"../../geometry/support/coordsUtils.js";import{sv3d as C}from"../../geometry/support/vectorStacks.js";import{fetchMessageBundle as k}from"../../intl/messages.js";import{getConvertedElevationFromVector as D,absoluteHeightElevationInfo as S}from"../../support/elevationInfoUtils.js";import{getDefaultUnitForView as w}from"../../support/getDefaultUnitForView.js";import M from"../overlay/TextOverlayItem.js";const T=3025,O={default:15,far:25};let P=class extends o{constructor(t){super(t),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messageUnitsTask=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){this.addHandles([h(()=>[null!=this.context&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits],()=>this._update()),...["vertex-add","vertex-update","vertex-remove"].map(t=>p(()=>this.context?.editGeometryOperations,t,()=>this._update())),h(()=>this._colors,t=>this._updateStyle(t)),s(()=>this._refreshMessages()),a(()=>this._messageUnitsTask?.abort())]),this._refreshMessages()}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return null==this._messagesUnits}get test(){}get _messagesUnits(){return this._messageUnitsTask?.value}get _edgeDistancePixels(){return O[this.edgeDistance]}get _colors(){const t=this.context?.view.effectiveTheme.textColor??e.fromArray([255,255,255]);return{textColor:t,backgroundColor:i(n(t,160),.6)}}_update(){if(this.destroyed)return;this._nextLabelIndex=0;const{context:t,stagedVertex:e}=this;if(!t)return this._destroyUnusedLabels();const{editGeometryOperations:s}=t,{parts:o,geometry:r,coordinateHelper:i}=s.data;if(!r)return this._destroyUnusedLabels();const n=o.length;for(let a=0;a<n;++a){const o=V(r,s,e,i,a);if(o.length<2||!G(o,t.view,t.elevationInfo,i.spatialReference))continue;const l=1===n&&!I(o);let c=z,h=F;this.toScreenPointArray(t,o[0],c);for(let e=1;e<o.length;++e){const s=o[e-1],r=o[e];this.toScreenPointArray(t,r,h),this._addLabel(t,s,c,r,h,l),[c,h]=[h,c]}}this._destroyUnusedLabels()}_updateStyle({textColor:t,backgroundColor:e}){const s=this._nextLabelIndex,o=this._labelInfos;for(let r=0;r<s;++r){const{label:s}=o[r];s.textColor=t,s.backgroundColor=e}}_addLabel(t,e,s,o,r,i){const{label:n}=this._getOrCreateLabel(t);if(!this.visible||b(s,r)<T)return void(n.visible=!1);const{spatialReference:a}=t.editGeometryOperations.data,l=t.automaticLengthMeasurementUtils.autoDistance2D(e,o,a),h=this._messagesUnits,p=w(t.view);n.text=null!=h&&null!=l?c(h,l,p):"",n.visible=!0;const m=r[0]-s[0],d=r[1]-s[1];i?_(R,-d,m):_(R,d,-m),x(R,R),y(R,R,this._edgeDistancePixels),v(q,s,r,.5),U(q,q,R),n.position=[q[0],q[1]],Math.abs(R[0])>Math.abs(R[1])?n.anchor=R[0]>0?"left":"right":n.anchor=-R[1]<0?"top":"bottom"}_getOrCreateLabel(t){const e=this._labelInfos.length>this._nextLabelIndex,{textColor:s,backgroundColor:o}=this._colors;if(e){const t=this._labelInfos[this._nextLabelIndex++],{label:e}=t;return e.textColor=s,e.backgroundColor=o,t}const r=new M({anchor:"center",fontSize:8,textColor:s,backgroundColor:o});t.view.overlay?.items.add(r);const i={label:r};return this._labelInfos.push(i),this._nextLabelIndex=this._labelInfos.length,i}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:t}){this.context?.view.overlay?.items.remove(t),t.destroy()}_refreshMessages(){this._messageUnitsTask?.abort(),this._messageUnitsTask=r(()=>k("esri/core/t9n/Units"))}};function V(t,e,s,o,r){const i=[];for(const l of e.data.parts[r].iterateVertices())i.push(o.toXYZ(l.pos,C.get()));if(0===r&&null!=s&&i.push(o.toXYZ(s,C.get())),i.length<2)return i;const n=i[0],a=i[i.length-1];return"polygon"===t.type&&i.length>2&&!L(n,a)&&i.push(n),i}function G(t,e,s,o){if("2d"===e.type)return!0;const r=d(o)??1,i=u(o),n=t=>D(e,t,o,s,S)??0;for(let a=1;a<t.length;++a){const e=t[a-1],s=t[a],o=(s[0]-e[0])*r,l=(s[1]-e[1])*r,c=(n(s)-n(e))*i;if(Math.abs(c)/Math.sqrt(o*o+l*l)>A)return!1}return!0}t([f()],P.prototype,"context",void 0),t([f()],P.prototype,"stagedVertex",void 0),t([f()],P.prototype,"visible",void 0),t([f()],P.prototype,"edgeDistance",void 0),t([f()],P.prototype,"updating",null),t([f()],P.prototype,"_messageUnitsTask",void 0),t([f()],P.prototype,"_messagesUnits",null),t([f()],P.prototype,"_edgeDistancePixels",null),t([f()],P.prototype,"_colors",null),P=t([g("esri.views.interactive.SegmentLabels")],P);const A=l(5),R=j(),q=j(),z=m(),F=m();export{P as SegmentLabels};
@@ -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{equals as t,pushIfSome as e}from"../../../core/arrayUtils.js";import{neverReached as r}from"../../../core/compilerUtils.js";import{Evented as i}from"../../../core/Evented.js";import s from"../../../geometry/Multipoint.js";import n from"../../../geometry/Polygon.js";import o from"../../../geometry/Polyline.js";import{getEndpoint as h,isCoordinate as a,isBezierCurve as c,isCircularArc as l,isEllipticArc4 as p}from"../../../geometry/support/curves/curveUtils.js";import{createCoordinateHelper as u}from"../coordinateHelper.js";import{unnormalize as g,getUnnormalizationInfo as f}from"./unnormalizationHelper.js";class m{constructor(t){this.part=t,this.leftSegment=null,this.rightSegment=null,this.type="vertex",this.index=null}get pos(){return this._pos}set pos(t){this._pos=t,this.part.unnormalizeVertexPositions()}}class d{constructor(t,e,r){this.part=t,this.leftVertex=e,this.rightVertex=r,this.type="line",e.rightSegment=this,r.leftSegment=this}toCurveOrCoordinate(){return[...this.rightVertex.pos]}}class v{constructor(t,e,r,i){this.part=t,this.leftVertex=e,this.rightVertex=r,this.curveDefinition=i,this.type="bezier",e.rightSegment=this,r.leftSegment=this}toCurveOrCoordinate(){return{b:[[...this.rightVertex.pos],[...this.curveDefinition.controlPoint1],[...this.curveDefinition.controlPoint2]]}}}class y{constructor(t,e,r,i){this.part=t,this.leftVertex=e,this.rightVertex=r,this.curveDefinition=i,this.type="circular-arc",e.rightSegment=this,r.leftSegment=this}toCurveOrCoordinate(){const t=this.rightVertex.pos,{interiorPoint:e}=this.curveDefinition;return{c:[[...t],[...e]]}}}class x{constructor(t,e,r,i){this.part=t,this.leftVertex=e,this.rightVertex=r,this.curveDefinition=i,this.type="elliptic-arc-4",e.rightSegment=this,r.leftSegment=this}toCurveOrCoordinate(){const t=this.rightVertex.pos,{centerPoint:e,sweep:r,orientation:i}=this.curveDefinition;return{a:[[...t],[...e],r,i]}}}class V{constructor(t,e,r,i){this.part=t,this.leftVertex=e,this.rightVertex=r,this.curveDefinition=i,this.type="elliptic-arc-7",e.rightSegment=this,r.leftSegment=this}toCurveOrCoordinate(){const t=this.rightVertex.pos,{centerPoint:e,sweep:r,orientation:i,rotation:s,semiMajorAxisLength:n,minorMajorAxisRatio:o}=this.curveDefinition;return{a:[[...t],e,r,i,s,n,o]}}}class w{constructor(t,e,r=!1){this._spatialReference=t,this._viewingMode=e,this.autoClose=r,this.vertices=[],this.segments=[],this.index=null}unnormalizeVertexPositions(){this.vertices.length<=1||g(this.vertices,f(this._spatialReference,this._viewingMode))}updateVertexIndex(t,e){const{vertices:r}=this;if(0===r.length)return;const i=r[0];let s=null,n=t,o=e;do{s=n,s.index=o++,n=s.rightSegment?s.rightSegment.rightVertex:null}while(null!=n&&n!==i);s.leftSegment&&s!==r[r.length-1]&&this.swapVertices(r.indexOf(s),r.length-1)}getFirstVertex(){return this.vertices.at(0)}getLastVertex(){return this.vertices.at(-1)}isClosed(){return null!=this.getFirstVertex()?.leftSegment}swapVertices(t,e){const{vertices:r}=this,i=r[t];r[t]=r[e],r[e]=i}*iterateVertices(){const t=this.getFirstVertex();let e=t;if(e)do{yield e,e=e.rightSegment?.rightVertex}while(e!==t&&null!=e)}}class P extends i{constructor(t,e){super(),this.type=t,this.coordinateHelper=e,this._geometry=null,this._dirty=!0,this.parts=[]}get geometry(){if(this._dirty){switch(this.type){case"point":this._geometry=this._toPoint();break;case"multipoint":this._geometry=this._toMultipoint();break;case"polyline":this._geometry=this._toPolyline();break;case"polygon":this._geometry=this._toPolygon();break;case"mesh":break;default:r(this.type)}this._dirty=!1}return this._geometry}get spatialReference(){return this.coordinateHelper.spatialReference}get allVerticesUnordered(){return Array.from(this.iterateVerticesUnordered())}*iterateVerticesUnordered(){for(const t of this.parts)for(const e of t.vertices)yield e}get allVertices(){return Array.from(this.iterateVertices())}*iterateVertices(){for(const t of this.parts)yield*t.iterateVertices()}notifyChanges(t){this._dirty=!0,this.emit("change",t)}getPartialGeometry(t,e,r){const{parts:i,hasCurves:s}=M(this,{startingVertex:t,endingVertexInclusive:e,geometryType:r});return R(i,s,r,this.coordinateHelper)}_toPoint(){const{parts:t,coordinateHelper:e}=this;return t.at(0)?.vertices.length?e.vectorToPoint(t[0].vertices[0].pos):null}_toMultipoint(){const t=[],{coordinateHelper:e,parts:r,spatialReference:i}=this;for(const s of r){const r=s.getFirstVertex();r&&t.push(e.arrayToVector(r.pos))}return new s({hasM:e.hasM(),hasZ:e.hasZ(),spatialReference:i,points:t})}_toPolyline(){const t=[];let e=!1;for(const r of this.parts){if(r.vertices.length<1)continue;const i=r.vertices[0],s=[];s.push(i.pos);let n=i.rightSegment;for(;n;)e||="line"!==n.type,s.push(n.toCurveOrCoordinate()),n=n.rightVertex.rightSegment;t.push(s)}return new o({paths:e?void 0:t,curvePaths:e?t:void 0,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}_toPolygon(){const e=[];let r=!1;for(const i of this.parts){if(i.vertices.length<1)continue;const s=i.vertices[0],n=[];n.push(s.pos);let o=s.rightSegment;for(;o&&(r||="line"!==o.type,n.push(o.toCurveOrCoordinate()),o=o.rightVertex.rightSegment,o?.leftVertex!==s););if(i.autoClose&&n.length>1){const e=n.at(-1),r=h(n[0]),i=h(e);2===n.length&&a(e)||t(r,i)||n.push(r)}e.push(n)}return new n({rings:r?void 0:e,curveRings:r?e:void 0,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}static fromGeometry(t,e,r){const i=t.spatialReference,s=u(t.hasZ,t.hasM,i),n=new P(t.type,s);switch(t.type){case"polygon":S(n,t,e,r?.allowCurves??!1);break;case"polyline":b(n,t,e,r?.allowCurves??!1);break;case"point":H(n,t,e);break;case"multipoint":j(n,t,e);break;case"mesh":H(n,t.origin,e),n._geometry=t,n._dirty=!1}return n}}function _(t,e,r,i){const s=new m(t);t.vertices.push(s);const n=h(i);return s.pos=e.arrayToVector(n),s.index=t.vertices.length-1,r&&t.segments.push(C(t,r,s,i)),s}function C(t,e,r,i){if(a(i))return new d(t,e,r);if(c(i)){const[,s,n]=i.b;return new v(t,e,r,{controlPoint1:[...s],controlPoint2:[...n]})}if(l(i)){const[,s]=i.c;return new y(t,e,r,{interiorPoint:[...s]})}if(p(i)){const[,s,n,o]=i.a;return new x(t,e,r,{centerPoint:[...s],sweep:n,orientation:o})}const[,s,n,o,h,u,g]=i.a;return new V(t,e,r,{centerPoint:[...s],sweep:n,orientation:o,rotation:h,semiMajorAxisLength:u,minorMajorAxisRatio:g})}function R(t,e,r,i){const{spatialReference:a}=i;if("point"===r){const e=t.at(0)?.at(0);return e?i.arrayToPoint(h(e)):null}return"polygon"===r?new n({rings:e?void 0:t,curveRings:e?t:void 0,spatialReference:a,hasZ:i.hasZ(),hasM:i.hasM()}):"multipoint"===r?new s({spatialReference:a,points:t.flatMap(t=>t.map(t=>h(t))),hasM:i.hasM(),hasZ:i.hasZ()}):new o({paths:e?void 0:t,curvePaths:e?t:void 0,spatialReference:a,hasZ:i.hasZ(),hasM:i.hasM()})}function M(r,i){const s="polygon"===(i?.geometryType??r.type),n=[];let o=!1,c=!1,l=!1;for(const p of r.parts){let r=null;if(l)break;if(p.vertices.length<1)continue;if(i?.startingVertex){if(p!==i.startingVertex.part&&!c)continue;c=!0}const u=p===i?.startingVertex?.part?i.startingVertex:p.vertices.at(0),g=[];if(e(g,u?.pos),u===i?.endingVertexInclusive){l=!0,r=u,n.push(g);break}let f=u?.rightSegment;for(;f;){if(o||="line"!==f.type,g.push(f.toCurveOrCoordinate()),r=f.rightVertex,f.rightVertex===i?.endingVertexInclusive){l=!0;break}if(f=f.rightVertex.rightSegment,f?.leftVertex===u)break}const m=g.at(-1),d=p.getFirstVertex(),v=p.getLastVertex();s&&p.autoClose&&m&&r===v&&u===d&&(g.length>2||2===g.length&&!a(m))&&u?.pos&&!t(h(m),u.pos)&&g.push([...u.pos]),n.push(g)}return{parts:n,hasCurves:o}}function S(e,r,i,s){const n=r.spatialReference,o=e.coordinateHelper,{rings:a,curveRings:c}=r,l=c&&s?c:a;for(let p=0;p<l.length;++p){const r=l[p],s=new w(n,i);if(s.index=p,e.parts.push(s),r.length<1)continue;let a=null,c=null;for(let t=0;t<r.length-1;++t)c=_(s,o,c,r[t]),a??=c;r.length>1&&t(h(r[r.length-1]),a?.pos)?c&&a&&s.segments.push(C(s,c,a,r[r.length-1])):c=_(s,o,c,r[r.length-1])}}function b(t,e,r,i){const s=e.spatialReference,n=t.coordinateHelper,{curvePaths:o,paths:h}=e,a=o&&i?o:h;for(let c=0;c<a.length;++c){const e=a[c],i=new w(s,r);if(i.index=c,t.parts.push(i),e.length<1)continue;let o=null;for(let t=0;t<e.length;++t)o=_(i,n,o,e[t])}}function H(t,e,r){const i=e.spatialReference,s=t.coordinateHelper,n=new w(i,r);n.index=0;const o=new m(n);o.index=0,o.pos=s.pointToVector(e),n.vertices.push(o),t.parts.push(n)}function j(t,e,r){const i=e.spatialReference,{coordinateHelper:s,parts:n}=t,o=e.points.map(t=>s.arrayToVector(t));for(let h=0;h<o.length;h++){const t=new w(i,r);t.index=h,n.push(t);const e=new m(t);e.pos=o[h],e.index=0,t.vertices.push(e)}}function k(t){return"mesh"===t.type}export{v as BezierSegment,y as CircularArcSegment,P as EditGeometry,x as EllipticArc4Segment,V as EllipticArc7Segment,d as LineSegment,w as Part,m as Vertex,C as createConnectingSegment,k as isMeshEditGeometry,R as partialCoordsToGeometry,M as toPartialCoords};
5
+ import{equals as t}from"../../../core/arrayUtils.js";import{neverReached as e}from"../../../core/compilerUtils.js";import{Evented as r}from"../../../core/Evented.js";import i from"../../../geometry/Multipoint.js";import s from"../../../geometry/Polygon.js";import n from"../../../geometry/Polyline.js";import{isCoordinate as o,isBezierCurve as h,isCircularArc as c,isEllipticArc4 as a,getEndpoint as l}from"../../../geometry/support/curves/curveUtils.js";import{createCoordinateHelper as p}from"../coordinateHelper.js";import{unnormalize as u,getUnnormalizationInfo as g}from"./unnormalizationHelper.js";class f{constructor(t){this.part=t,this.leftSegment=null,this.rightSegment=null,this.type="vertex",this.index=null}get pos(){return this._pos}set pos(t){this._pos=t,this.part.unnormalizeVertexPositions()}}class m{constructor(t,e,r){this.part=t,this.leftVertex=e,this.rightVertex=r,this.type="line",e.rightSegment=this,r.leftSegment=this}toCurveOrCoordinate(){return[...this.rightVertex.pos]}}class d{constructor(t,e,r,i){this.part=t,this.leftVertex=e,this.rightVertex=r,this.curveDefinition=i,this.type="bezier",e.rightSegment=this,r.leftSegment=this}toCurveOrCoordinate(){return{b:[[...this.rightVertex.pos],[...this.curveDefinition.controlPoint1],[...this.curveDefinition.controlPoint2]]}}}class y{constructor(t,e,r,i){this.part=t,this.leftVertex=e,this.rightVertex=r,this.curveDefinition=i,this.type="circular-arc",e.rightSegment=this,r.leftSegment=this}toCurveOrCoordinate(){const t=this.rightVertex.pos,{interiorPoint:e}=this.curveDefinition;return{c:[[...t],[...e]]}}}class v{constructor(t,e,r,i){this.part=t,this.leftVertex=e,this.rightVertex=r,this.curveDefinition=i,this.type="elliptic-arc-4",e.rightSegment=this,r.leftSegment=this}toCurveOrCoordinate(){const t=this.rightVertex.pos,{centerPoint:e,sweep:r,orientation:i}=this.curveDefinition;return{a:[[...t],[...e],r,i]}}}class x{constructor(t,e,r,i){this.part=t,this.leftVertex=e,this.rightVertex=r,this.curveDefinition=i,this.type="elliptic-arc-7",e.rightSegment=this,r.leftSegment=this}toCurveOrCoordinate(){const t=this.rightVertex.pos,{centerPoint:e,sweep:r,orientation:i,rotation:s,semiMajorAxisLength:n,minorMajorAxisRatio:o}=this.curveDefinition;return{a:[[...t],e,r,i,s,n,o]}}}class V{constructor(t,e){this._spatialReference=t,this._viewingMode=e,this.vertices=[],this.segments=[],this.index=null}unnormalizeVertexPositions(){this.vertices.length<=1||u(this.vertices,g(this._spatialReference,this._viewingMode))}updateVertexIndex(t,e){const{vertices:r}=this;if(0===r.length)return;const i=r[0];let s=null,n=t,o=e;do{s=n,s.index=o++,n=s.rightSegment?s.rightSegment.rightVertex:null}while(null!=n&&n!==i);s.leftSegment&&s!==r[r.length-1]&&this.swapVertices(r.indexOf(s),r.length-1)}getFirstVertex(){return this.vertices.at(0)}getLastVertex(){return this.vertices.at(-1)}isClosed(){return null!==this.getFirstVertex()?.leftSegment}swapVertices(t,e){const{vertices:r}=this,i=r[t];r[t]=r[e],r[e]=i}*iterateVertices(){const t=this.getFirstVertex();let e=t;if(e)do{yield e,e=e.rightSegment?.rightVertex}while(e!==t&&null!=e)}}class w extends r{constructor(t,e){super(),this.type=t,this.coordinateHelper=e,this._geometry=null,this._dirty=!0,this.parts=[]}get geometry(){if(this._dirty){switch(this.type){case"point":this._geometry=this._toPoint();break;case"multipoint":this._geometry=this._toMultipoint();break;case"polyline":this._geometry=this._toPolyline();break;case"polygon":this._geometry=this._toPolygon();break;case"mesh":break;default:e(this.type)}this._dirty=!1}return this._geometry}get spatialReference(){return this.coordinateHelper.spatialReference}get allVerticesUnordered(){return Array.from(this.iterateVerticesUnordered())}*iterateVerticesUnordered(){for(const t of this.parts)for(const e of t.vertices)yield e}get allVertices(){return Array.from(this.iterateVertices())}*iterateVertices(){for(const t of this.parts)yield*t.iterateVertices()}notifyChanges(t){this._dirty=!0,this.emit("change",t)}_toPoint(){const{parts:t,coordinateHelper:e}=this;return t.at(0)?.vertices.length?e.vectorToPoint(t[0].vertices[0].pos):null}_toMultipoint(){const t=[],{coordinateHelper:e,parts:r,spatialReference:s}=this;for(const i of r){const r=i.getFirstVertex();r&&t.push(e.arrayToVector(r.pos))}return new i({hasM:e.hasM(),hasZ:e.hasZ(),spatialReference:s,points:t})}_toPolyline(){const t=[];let e=!1;for(const r of this.parts){if(r.vertices.length<1)continue;const i=r.vertices[0],s=[];s.push(i.pos);let n=i.rightSegment;for(;n;)e||="line"!==n.type,s.push(n.toCurveOrCoordinate()),n=n.rightVertex.rightSegment;t.push(s)}return new n({paths:e?void 0:t,curvePaths:e?t:void 0,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}_toPolygon(){const t=[];let e=!1;for(const r of this.parts){if(r.vertices.length<1)continue;const i=r.vertices[0],s=[];s.push(i.pos);let n=i.rightSegment;for(;n&&(e||="line"!==n.type,s.push(n.toCurveOrCoordinate()),n=n.rightVertex.rightSegment,n?.leftVertex!==i););t.push(s)}return new s({rings:e?void 0:t,curveRings:e?t:void 0,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}static fromGeometry(t,e,r){const i=t.spatialReference,s=p(t.hasZ,t.hasM,i),n=new w(t.type,s);switch(t.type){case"polygon":S(n,t,e,r?.allowCurves??!1);break;case"polyline":R(n,t,e,r?.allowCurves??!1);break;case"point":C(n,t,e);break;case"multipoint":M(n,t,e);break;case"mesh":C(n,t.origin,e),n._geometry=t,n._dirty=!1}return n}}function _(t,e,r,i){const s=new f(t);t.vertices.push(s);const n=l(i);return s.pos=e.arrayToVector(n),s.index=t.vertices.length-1,r&&t.segments.push(P(t,r,s,i)),s}function P(t,e,r,i){if(o(i))return new m(t,e,r);if(h(i)){const[,s,n]=i.b;return new d(t,e,r,{controlPoint1:[...s],controlPoint2:[...n]})}if(c(i)){const[,s]=i.c;return new y(t,e,r,{interiorPoint:[...s]})}if(a(i)){const[,s,n,o]=i.a;return new v(t,e,r,{centerPoint:[...s],sweep:n,orientation:o})}const[,s,n,l,p,u,g]=i.a;return new x(t,e,r,{centerPoint:[...s],sweep:n,orientation:l,rotation:p,semiMajorAxisLength:u,minorMajorAxisRatio:g})}function S(e,r,i,s){const n=r.spatialReference,o=e.coordinateHelper,{rings:h,curveRings:c}=r,a=c&&s?c:h;for(let p=0;p<a.length;++p){const r=a[p],s=new V(n,i);if(s.index=p,e.parts.push(s),r.length<1)continue;let h=null,c=null;for(let t=0;t<r.length-1;++t)c=_(s,o,c,r[t]),h??=c;r.length>1&&t(l(r[r.length-1]),h?.pos)?c&&h&&s.segments.push(P(s,c,h,r[r.length-1])):c=_(s,o,c,r[r.length-1])}}function R(t,e,r,i){const s=e.spatialReference,n=t.coordinateHelper,{curvePaths:o,paths:h}=e,c=o&&i?o:h;for(let a=0;a<c.length;++a){const e=c[a],i=new V(s,r);if(i.index=a,t.parts.push(i),e.length<1)continue;let o=null;for(let t=0;t<e.length;++t)o=_(i,n,o,e[t])}}function C(t,e,r){const i=e.spatialReference,s=t.coordinateHelper,n=new V(i,r);n.index=0;const o=new f(n);o.index=0,o.pos=s.pointToVector(e),n.vertices.push(o),t.parts.push(n)}function M(t,e,r){const i=e.spatialReference,{coordinateHelper:s,parts:n}=t,o=e.points.map(t=>s.arrayToVector(t));for(let h=0;h<o.length;h++){const t=new V(i,r);t.index=h,n.push(t);const e=new f(t);e.pos=o[h],e.index=0,t.vertices.push(e)}}function H(t){return"mesh"===t.type}export{d as BezierSegment,y as CircularArcSegment,w as EditGeometry,v as EllipticArc4Segment,x as EllipticArc7Segment,m as LineSegment,V as Part,f as Vertex,P as createConnectingSegment,H as isMeshEditGeometry};
@@ -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{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{drawContentHeaderActions as i}from"../css.js";import{directionModeIcons as s}from"./directionModeIcons.js";import r from"../../../../widgets/Widget.js";import{loadCalciteComponents as c}from"../../../../widgets/support/componentsUtils.js";import"../../../../widgets/support/widgetUtils.js";import{messageBundle as n}from"../../../../widgets/support/decorators/messageBundle.js";import{tsx as d}from"../../../../widgets/support/jsxFactory.js";import"@arcgis/toolkit/dom";let p=class extends r{constructor(t){super(t),this.visibleElements={}}render(){return d("div",{class:i},this._isElementVisible("direction")?d(l,{messages:this.messages,sketchOptions:this.sketchOptions}):null)}loadDependencies(){return c({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group")})}_isElementVisible(t){return this.visibleElements?.[t]??this.sketchOptions.tooltips.visibleElements[t]}};function l(t){const{directionMode:e}=t.sketchOptions.values,o=t.messages?.sketch,i=o?.directionModeSelect?.title,r="absolute",c="relative";return d("calcite-dropdown",{key:"direction-mode",placement:"bottom-end",scale:"s",widthScale:"s",onCalciteDropdownSelect:e=>{const o=e.currentTarget.selectedItems?.[0]?.getAttribute("data-mode");t.sketchOptions.values.directionMode=o??"absolute"}},d("calcite-button",{alignment:"end",appearance:"transparent",iconStart:s[e],kind:"neutral",label:i,scale:"s",slot:"trigger",title:i}),d("calcite-dropdown-group",{selectionMode:"single"},d("calcite-dropdown-item",{"data-mode":c,"data-testid":"tooltip-direction-mode-relative",iconStart:s.relative,key:"relative",selected:e===c},o?.directionModeSelect?.relative),d("calcite-dropdown-item",{"data-mode":r,"data-testid":"tooltip-direction-mode-absolute",iconStart:s.absolute,key:"absolute",selected:e===r},o?.directionModeSelect?.absolute)))}t([n("esri/views/interactive/tooltip/t9n/Tooltip"),e()],p.prototype,"messages",void 0),t([e()],p.prototype,"sketchOptions",void 0),t([e()],p.prototype,"visibleElements",void 0),p=t([o("esri.views.interactive.tooltip.components.DrawHeaderActions")],p);export{p as DrawHeaderActions};
5
+ import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{drawContentHeaderActions as i}from"../css.js";import{directionModeIcons as s}from"./directionModeIcons.js";import r from"../../../../widgets/Widget.js";import{loadCalciteComponents as c}from"../../../../widgets/support/componentsUtils.js";import{messageBundle as n,tsx as d}from"../../../../widgets/support/widget.js";let l=class extends r{constructor(e){super(e),this.visibleElements={}}render(){return d("div",{class:i},this._isElementVisible("direction")?d(p,{messages:this.messages,sketchOptions:this.sketchOptions}):null)}loadDependencies(){return c({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group")})}_isElementVisible(e){return this.visibleElements?.[e]??this.sketchOptions.tooltips.visibleElements[e]}};function p(e){const{directionMode:t}=e.sketchOptions.values,o=e.messages?.sketch,i=o?.directionModeSelect?.title,r="absolute",c="relative";return d("calcite-dropdown",{key:"direction-mode",placement:"bottom-end",scale:"s",widthScale:"s",onCalciteDropdownSelect:t=>{const o=t.currentTarget.selectedItems?.[0]?.getAttribute("data-mode");e.sketchOptions.values.directionMode=o??"absolute"}},d("calcite-button",{alignment:"end",appearance:"transparent",iconStart:s[t],kind:"neutral",label:i,scale:"s",slot:"trigger",title:i}),d("calcite-dropdown-group",{selectionMode:"single"},d("calcite-dropdown-item",{"data-mode":c,"data-testid":"tooltip-direction-mode-relative",iconStart:s.relative,key:"relative",selected:t===c},o?.directionModeSelect?.relative),d("calcite-dropdown-item",{"data-mode":r,"data-testid":"tooltip-direction-mode-absolute",iconStart:s.absolute,key:"absolute",selected:t===r},o?.directionModeSelect?.absolute)))}e([n("esri/views/interactive/tooltip/t9n/Tooltip"),t()],l.prototype,"messages",void 0),e([t()],l.prototype,"sketchOptions",void 0),e([t()],l.prototype,"visibleElements",void 0),l=e([o("esri.views.interactive.tooltip.components.DrawHeaderActions")],l);export{l as DrawHeaderActions};
@@ -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{watch as e}from"../../../../core/reactiveUtils.js";import{waitAnimationFrame as i}from"../../../../core/scheduling.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{tooltipKeys as s}from"../../keybindings.js";import{base as l}from"../css.js";import r from"../../../../widgets/Widget.js";import{loadCalciteComponents as a}from"../../../../widgets/support/componentsUtils.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as c,tsxFragment as u}from"../../../../widgets/support/jsxFactory.js";import"@arcgis/toolkit/dom";const d=`${l}-editable-field`,p={base:d,inputMode:`${d}--input`,feedbackMode:`${d}--feedback`,readOnly:`${d}--read-only`,locked:`${d}--locked`,title:`${d}__title`,value:`${d}__value`,valueContent:`${d}__value__content`,valueContentReadOnly:`${d}__value__content--read-only`,lockIcon:`${d}__lock-icon`,input:`${d}__input`,inputWrapper:`${d}__input-wrapper`,inputMessage:`${d}__input-message`,inputSuffix:`${d}__input-suffix`,button:`${d}__button`},h={lock:"lock",unlock:"unlock"};let _=class extends r{constructor(){super(...arguments),this._input=null,this._lock=null,this._onLockClick=()=>{this.field.toggleLock(this.context)},this._onLockAfterCreate=t=>{this._lock=t},this._onLockAfterRemoved=()=>{this._lock=null},this._onKeyDown=t=>{t.key===s.discard&&"input"===this.mode&&this._input&&this.context.onDiscard(this._input)},this._onInputKeyDown=t=>{const e=this._input;if(e)switch(t.key){case s.commit:return this.field.onCommit("commit-and-exit",e,this.context);case s.next:{t.preventDefault(),t.stopPropagation();const i=t.shiftKey?"commit-and-previous":"commit-and-next";return this.field.onCommit(i,e,this.context)}}},this._onInput=t=>{this.field.onInput(t.currentTarget.value)},this._onInputBlur=t=>{const e=this._input;e&&t.relatedTarget!==this._lock&&this.field.onCommit("commit-on-blur",e,this.context)},this._selectText=()=>{const t=()=>{this._input===document.activeElement&&this._input?.selectText()};t(),i().then(t)},this._onAfterCreate=t=>{this._input=t,t.addEventListener("paste",this._onPaste),t.addEventListener("beforeinput",this._onBeforeInput)},this._onAfterRemoved=t=>{t.removeEventListener("paste",this._onPaste),t.removeEventListener("beforeinput",this._onBeforeInput)},this._onPaste=t=>{const e=t.clipboardData?.getData("text");if(!e)return;null!=this.field.parse(e,this.context)&&(t.stopPropagation(),this.field.onInput(e))},this._onBeforeInput=t=>{("historyUndo"===t.inputType||"historyRedo"===t.inputType)&&!this.field.dirty&&t.preventDefault()}}initialize(){this.addHandles(e(()=>this._rawDisplayValue,()=>{const{committed:t,inputValue:e}=this.field;t||e||this._input!==document.activeElement||this._selectText()}))}loadDependencies(){return a({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message")})}render(){const{field:t,mode:e}=this,i="input"===e,{locked:o,readOnly:n}=t;return c("div",{class:this.classes({[p.base]:!0,[p.feedbackMode]:"feedback"===e,[p.inputMode]:"input"===e,[p.locked]:o,[p.readOnly]:n})},c("div",{class:p.title,key:"title"},this._title),c("div",{class:p.value,key:"value",onkeydown:this._onKeyDown},i?this._renderValueInputMode():this._renderValueFeedbackMode()))}get _formattedValue(){return this.field.getFormattedValue(this.context)||m}get _rawDisplayValue(){return this.field.getRawDisplayValue(this.context)}get _suffix(){return this.field.getSuffix(this.context)}get _title(){const{title:t}=this.field;return"string"==typeof t?t:t(this.context)}get _messages(){return this.context?.messages.sketch??{}}_renderValueFeedbackMode(){return c(u,null,c("div",{class:p.valueContent,key:"value-feedback"},this._formattedValue),this.field.locked&&"input"!==this.mode?c("calcite-icon",{class:p.lockIcon,icon:h.lock,key:"icon",scale:"s"}):null)}_renderValueInputMode(){return this.field.readOnly?this._renderValueReadOnly():this._renderValueWritable()}_renderValueReadOnly(){return c("div",{class:this.classes(p.valueContent,p.valueContentReadOnly),key:"value-read-only"},this._formattedValue)}_renderValueWritable(){const{field:t}=this,e=this._messages,{name:i,invalid:o}=t;return c(u,null,c("div",{class:p.inputWrapper,key:"value-input"},c("calcite-input",{afterCreate:this._onAfterCreate,afterRemoved:this._onAfterRemoved,class:p.input,"data-field-name":i,"data-testid":`tooltip-field-${i}`,key:"input",onblur:this._onInputBlur,onfocus:this._selectText,onkeydown:this._onInputKeyDown,scale:"s",status:o?"invalid":"idle",type:"text",value:this._rawDisplayValue??m,onCalciteInputInput:this._onInput}),o?c("calcite-input-message",{class:p.inputMessage,scale:"s",status:"invalid"},e.invalidValue):null),c("div",{class:p.inputSuffix,key:"suffix"},this._suffix),this._renderedLockButton)}get _renderedLockButton(){const{disabled:t,locked:e,lockable:i,name:o}=this.field;if(!i)return c("div",{key:"no-lock-button"});const n=this._messages,s=e?n.unlockConstraint:n.lockConstraint;return c("calcite-button",{afterCreate:this._onLockAfterCreate,afterRemoved:this._onLockAfterRemoved,alignment:"center",appearance:"transparent",class:p.button,"data-testid":`tooltip-field-${o}-lock`,disabled:t,iconStart:e?h.lock:h.unlock,key:"lock-button",kind:"neutral",label:s,onclick:this._onLockClick,scale:"s",tabIndex:-1,title:s})}};t([o()],_.prototype,"field",void 0),t([o()],_.prototype,"context",void 0),t([o()],_.prototype,"mode",void 0),t([o()],_.prototype,"_input",void 0),t([o()],_.prototype,"_lock",void 0),t([o()],_.prototype,"_formattedValue",null),t([o()],_.prototype,"_rawDisplayValue",null),t([o()],_.prototype,"_suffix",null),t([o()],_.prototype,"_title",null),t([o()],_.prototype,"_messages",null),t([o()],_.prototype,"_renderedLockButton",null),_=t([n("esri.views.interactive.tooltip.components.TooltipEditableField")],_);const m="—";export{_ as TooltipEditableField};
5
+ import{__decorate as t}from"tslib";import{watch as e}from"../../../../core/reactiveUtils.js";import{waitAnimationFrame as i}from"../../../../core/scheduling.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{tooltipKeys as s}from"../../keybindings.js";import{base as l}from"../css.js";import r from"../../../../widgets/Widget.js";import{loadCalciteComponents as a}from"../../../../widgets/support/componentsUtils.js";import{tsx as c,tsxFragment as u}from"../../../../widgets/support/widget.js";const d=`${l}-editable-field`,p={base:d,inputMode:`${d}--input`,feedbackMode:`${d}--feedback`,readOnly:`${d}--read-only`,locked:`${d}--locked`,title:`${d}__title`,value:`${d}__value`,valueContent:`${d}__value__content`,valueContentReadOnly:`${d}__value__content--read-only`,lockIcon:`${d}__lock-icon`,input:`${d}__input`,inputWrapper:`${d}__input-wrapper`,inputMessage:`${d}__input-message`,inputSuffix:`${d}__input-suffix`,button:`${d}__button`},h={lock:"lock",unlock:"unlock"};let _=class extends r{constructor(){super(...arguments),this._input=null,this._lock=null,this._onLockClick=()=>{this.field.toggleLock(this.context)},this._onLockAfterCreate=t=>{this._lock=t},this._onLockAfterRemoved=()=>{this._lock=null},this._onKeyDown=t=>{t.key===s.discard&&"input"===this.mode&&this._input&&this.context.onDiscard(this._input)},this._onInputKeyDown=t=>{const e=this._input;if(e)switch(t.key){case s.commit:return this.field.onCommit("commit-and-exit",e,this.context);case s.next:{t.preventDefault(),t.stopPropagation();const i=t.shiftKey?"commit-and-previous":"commit-and-next";return this.field.onCommit(i,e,this.context)}}},this._onInput=t=>{this.field.onInput(t.currentTarget.value)},this._onInputBlur=t=>{const e=this._input;e&&t.relatedTarget!==this._lock&&this.field.onCommit("commit-on-blur",e,this.context)},this._selectText=()=>{const t=()=>{this._input===document.activeElement&&this._input?.selectText()};t(),i().then(t)},this._onAfterCreate=t=>{this._input=t,t.addEventListener("paste",this._onPaste),t.addEventListener("beforeinput",this._onBeforeInput)},this._onAfterRemoved=t=>{t.removeEventListener("paste",this._onPaste),t.removeEventListener("beforeinput",this._onBeforeInput)},this._onPaste=t=>{const e=t.clipboardData?.getData("text");if(!e)return;null!=this.field.parse(e,this.context)&&(t.stopPropagation(),this.field.onInput(e))},this._onBeforeInput=t=>{("historyUndo"===t.inputType||"historyRedo"===t.inputType)&&!this.field.dirty&&t.preventDefault()}}initialize(){this.addHandles(e(()=>this._rawDisplayValue,()=>{const{committed:t,inputValue:e}=this.field;t||e||this._input!==document.activeElement||this._selectText()}))}loadDependencies(){return a({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message")})}render(){const{field:t,mode:e}=this,i="input"===e,{locked:o,readOnly:n}=t;return c("div",{class:this.classes({[p.base]:!0,[p.feedbackMode]:"feedback"===e,[p.inputMode]:"input"===e,[p.locked]:o,[p.readOnly]:n})},c("div",{class:p.title,key:"title"},this._title),c("div",{class:p.value,key:"value",onkeydown:this._onKeyDown},i?this._renderValueInputMode():this._renderValueFeedbackMode()))}get _formattedValue(){return this.field.getFormattedValue(this.context)||m}get _rawDisplayValue(){return this.field.getRawDisplayValue(this.context)}get _suffix(){return this.field.getSuffix(this.context)}get _title(){const{title:t}=this.field;return"string"==typeof t?t:t(this.context)}get _messages(){return this.context?.messages.sketch??{}}_renderValueFeedbackMode(){return c(u,null,c("div",{class:p.valueContent,key:"value-feedback"},this._formattedValue),this.field.locked&&"input"!==this.mode?c("calcite-icon",{class:p.lockIcon,icon:h.lock,key:"icon",scale:"s"}):null)}_renderValueInputMode(){return this.field.readOnly?this._renderValueReadOnly():this._renderValueWritable()}_renderValueReadOnly(){return c("div",{class:this.classes(p.valueContent,p.valueContentReadOnly),key:"value-read-only"},this._formattedValue)}_renderValueWritable(){const{field:t}=this,e=this._messages,{name:i,invalid:o}=t;return c(u,null,c("div",{class:p.inputWrapper,key:"value-input"},c("calcite-input",{afterCreate:this._onAfterCreate,afterRemoved:this._onAfterRemoved,class:p.input,"data-field-name":i,"data-testid":`tooltip-field-${i}`,key:"input",onblur:this._onInputBlur,onfocus:this._selectText,onkeydown:this._onInputKeyDown,scale:"s",status:o?"invalid":"idle",type:"text",value:this._rawDisplayValue??m,onCalciteInputInput:this._onInput}),o?c("calcite-input-message",{class:p.inputMessage,scale:"s",status:"invalid"},e.invalidValue):null),c("div",{class:p.inputSuffix,key:"suffix"},this._suffix),this._renderedLockButton)}get _renderedLockButton(){const{disabled:t,locked:e,lockable:i,name:o}=this.field;if(!i)return c("div",{key:"no-lock-button"});const n=this._messages,s=e?n.unlockConstraint:n.lockConstraint;return c("calcite-button",{afterCreate:this._onLockAfterCreate,afterRemoved:this._onLockAfterRemoved,alignment:"center",appearance:"transparent",class:p.button,"data-testid":`tooltip-field-${o}-lock`,disabled:t,iconStart:e?h.lock:h.unlock,key:"lock-button",kind:"neutral",label:s,onclick:this._onLockClick,scale:"s",tabIndex:-1,title:s})}};t([o()],_.prototype,"field",void 0),t([o()],_.prototype,"context",void 0),t([o()],_.prototype,"mode",void 0),t([o()],_.prototype,"_input",void 0),t([o()],_.prototype,"_lock",void 0),t([o()],_.prototype,"_formattedValue",null),t([o()],_.prototype,"_rawDisplayValue",null),t([o()],_.prototype,"_suffix",null),t([o()],_.prototype,"_title",null),t([o()],_.prototype,"_messages",null),t([o()],_.prototype,"_renderedLockButton",null),_=t([n("esri.views.interactive.tooltip.components.TooltipEditableField")],_);const m="—";export{_ as TooltipEditableField};
@@ -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{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{base as s}from"../css.js";import i from"../../../../widgets/Widget.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as r}from"../../../../widgets/support/jsxFactory.js";import"@arcgis/toolkit/dom";const p=`${s}-field`,d={base:p,inputMode:`${p}--input`,title:`${p}__title`,value:`${p}__value`};let a=class extends i{constructor(){super(...arguments),this.hidden=!1,this.mode="feedback"}render(){return r("div",{class:this.classes({[d.base]:!0,[d.inputMode]:"input"===this.mode})},r("div",{class:d.title,key:"title"},this.title),r("div",{class:d.value,key:"value"},this.value))}};t([o()],a.prototype,"hidden",void 0),t([o()],a.prototype,"mode",void 0),t([o()],a.prototype,"title",void 0),t([o()],a.prototype,"value",void 0),a=t([e("esri.views.interactive.tooltip.components.TooltipField")],a);export{a as TooltipField};
5
+ import{__decorate as t}from"tslib";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{base as s}from"../css.js";import i from"../../../../widgets/Widget.js";import{tsx as r}from"../../../../widgets/support/widget.js";const p=`${s}-field`,d={base:p,inputMode:`${p}--input`,title:`${p}__title`,value:`${p}__value`};let a=class extends i{constructor(){super(...arguments),this.hidden=!1,this.mode="feedback"}render(){return r("div",{class:this.classes({[d.base]:!0,[d.inputMode]:"input"===this.mode})},r("div",{class:d.title,key:"title"},this.title),r("div",{class:d.value,key:"value"},this.value))}};t([e()],a.prototype,"hidden",void 0),t([e()],a.prototype,"mode",void 0),t([e()],a.prototype,"title",void 0),t([e()],a.prototype,"value",void 0),a=t([o("esri.views.interactive.tooltip.components.TooltipField")],a);export{a as TooltipField};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{base as s}from"../css.js";import e from"../../../../widgets/Widget.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as i}from"../../../../widgets/support/jsxFactory.js";import"@arcgis/toolkit/dom";const p={base:`${s}-value-by-value`};let a=class extends e{constructor(){super(...arguments),this.divider="×"}render(){return i("div",{class:p.base},i("span",null,this.left),i("span",null,this.divider),i("span",null,this.right))}};o([r()],a.prototype,"left",void 0),o([r()],a.prototype,"divider",void 0),o([r()],a.prototype,"right",void 0),a=o([t("esri.views.interactive.tooltip.components.ValueByValue")],a);export{a as ValueByValue};
5
+ import{__decorate as r}from"tslib";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{base as t}from"../css.js";import e from"../../../../widgets/Widget.js";import{tsx as i}from"../../../../widgets/support/widget.js";const p={base:`${t}-value-by-value`};let a=class extends e{constructor(){super(...arguments),this.divider="×"}render(){return i("div",{class:p.base},i("span",null,this.left),i("span",null,this.divider),i("span",null,this.right))}};r([o()],a.prototype,"left",void 0),r([o()],a.prototype,"divider",void 0),r([o()],a.prototype,"right",void 0),a=r([s("esri.views.interactive.tooltip.components.ValueByValue")],a);export{a as ValueByValue};
@@ -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{TooltipEditableField as t}from"../components/TooltipEditableField.js";import{tsx as o,tsxFragment as e}from"../../../../widgets/support/jsxFactory.js";function i(i){const l=i.fields.filter(t=>!0===t?.visible);return 0===l.length?null:o(e,null,l.map(e=>o(t,{context:i.context,field:e,key:e.id,mode:i.mode})))}export{i as Fields};
5
+ import{TooltipEditableField as t}from"../components/TooltipEditableField.js";import{tsx as e,tsxFragment as o}from"../../../../widgets/support/widget.js";function i(i){const l=i.fields.filter(t=>!0===t?.visible);return 0===l.length?null:e(o,null,l.map(o=>e(t,{context:i.context,field:o,key:o.id,mode:i.mode})))}export{i as Fields};
@@ -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{prefersReducedMotion as e}from"../../../../core/a11yUtils.js";import{on as o}from"../../../../core/events.js";import"../../../../core/has.js";import{memoize as i}from"../../../../core/memoize.js";import{throwIfNotAbortError as s,throwIfAborted as n,after as r}from"../../../../core/promiseUtils.js";import{waitAnimationFrame as a,waitTick as l}from"../../../../core/scheduling.js";import{unitName as c}from"../../../../core/unitFormatUtils.js";import{defaultAreaUnit as p,defaultVerticalLengthUnit as d,defaultLengthUnit as u}from"../../../../core/unitUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{getDefaultUnitForView as f}from"../../../../support/getDefaultUnitForView.js";import{tooltipKeys as g}from"../../keybindings.js";import{table as _,contentHeader as y,contentHeaderSpacer as b,contentHeaderActions as v,contentInputMode as w,content as I,helpMessageText as k,helpMessageIcon as j,helpMessage as A,drawContentHeaderActions as C}from"../css.js";import{getFormatters as U}from"../fields/parsingAndFormattingUtils.js";import M from"../../../../widgets/Widget.js";import{loadCalciteComponents as D}from"../../../../widgets/support/componentsUtils.js";import{classes as F}from"../../../../widgets/support/widgetUtils.js";import{messageBundle as x}from"../../../../widgets/support/decorators/messageBundle.js";import{tsx as T,tsxFragment as H}from"../../../../widgets/support/jsxFactory.js";import"@arcgis/toolkit/dom";const E=Symbol("dragHandles");let S=class extends M{constructor(){super(...arguments),this._focusAbortController=new AbortController,this._transitionInfo=null,this._mode="feedback",this._getFormatters=i(U),this._onHeaderPointerDown=t=>{const e=t.target;e instanceof HTMLElement&&"calcite-button"!==e?.tagName?.toLowerCase()&&(this.removeHandles(E),t.preventDefault(),t.stopPropagation(),e.setPointerCapture(t.pointerId),this.tooltip.onDragStart(t.clientX,t.clientY),this.addHandles([o(e,"pointermove",({clientX:t,clientY:e})=>{this.tooltip.onDrag(t,e)}),o(e,["pointerup","pointercancel"],o=>{this.removeHandles(E),e.releasePointerCapture(t.pointerId),this.tooltip.onDragEnd()}),o(e,"touchstart",t=>t.preventDefault())],E))},this._onDiscard=()=>{this.destroyed||(this.tooltip.emit("discard"),this.info.clearInputValues(),this.exitInputMode())},this._onCommit=(t,e)=>{if(this.destroyed)return;if(this.tooltip.emit("commit",{type:e}),"commit-and-exit"===e)return void this.exitInputMode();if("commit-on-blur"===e)return;const o=this._getFocusableElements(),i=o.length,s=o.indexOf(t);if(-1===s)return void this.exitInputMode();const n=((s+("commit-and-next"===e?1:-1))%i+i)%i;L(o.at(n))},this._onKeyDown=t=>{switch(t.code){case g.next:return this._onNextKey(t);case g.discard:return t.stopPropagation(),this._onDiscard()}}}get mode(){return this._mode}get _displayUnits(){const{displayUnits:t}=this.info.sketchOptions.values,e=f(this.tooltip.view);return{length:t.length??e,verticalLength:t.verticalLength??e,area:t.area??e}}get _inputUnitInfos(){const t=this._messagesUnits,e=e=>({unit:e,abbreviation:c(t,e,"abbr")}),{inputUnits:o}=this.info.sketchOptions.values,i=f(this.tooltip.view),s=o.length??i,n=o.verticalLength??i,r=o.area??i;return{length:e(u(s)),verticalLength:e(d(n)),area:e(p(r)),angle:e("degrees")}}get _formatters(){return this._getFormatters(this._messagesUnits,this._displayUnits)}get fieldContext(){return{formatters:this._formatters,inputUnitInfos:this._inputUnitInfos,messages:this._messagesTooltip,sketchOptions:this.info.sketchOptions,onCommit:this._onCommit,onDiscard:this._onDiscard}}render(){const{visibleElements:t}=this.info.sketchOptions.tooltips,e=this._renderedContent,o=this._renderedActions,i=this._renderedHelpMessage,s=e.length>0,n=s||!!i,r="input"===this.mode;return T("div",{class:F(I,r&&w),onkeydown:this._onKeyDown,tabIndex:-1},r&&n&&t.header?T("div",{class:y,"data-testid":"tooltip-header",key:"header",onpointerdown:this._onHeaderPointerDown},T("calcite-button",{appearance:"transparent","data-testid":"tooltip-back-button",iconFlipRtl:"both",iconStart:"chevron-left",key:"discard-button",kind:"neutral",onclick:this._onDiscard,scale:"s",tabIndex:-1}),o.length>0?T(H,null,T("div",{class:b,key:"spacer"}),T("div",{class:v,key:"actions"},o)):null):null,s?T("div",{class:_,key:"content"},...e):null,i)}destroy(){this._focusAbortController.abort(),this._transitionInfo?.transition.skipTransition()}_renderActions(){return null}loadDependencies(){return D({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input")})}async enterInputMode(t,e){try{await this._transitionTo("input",e),await this._focusField(t)}catch(o){s(o)}}async exitInputMode({focusOnView:t=!0}={}){try{const{container:e,info:o}=this;o.clearInputValues();const i=t?e?.closest(".esri-view")?.querySelector(".esri-view-surface"):null;await this._transitionTo("feedback"),i instanceof HTMLElement&&i.focus()}catch(e){s(e)}}_onNextKey(t){const e=this._getFocusableElements(),o=e.at(0),i=e.at(-1);o&&i&&(t.shiftKey?document.activeElement===o&&(t.preventDefault(),t.stopPropagation(),L(i)):document.activeElement===i&&(t.preventDefault(),t.stopPropagation(),L(o)))}get _renderedContent(){return N(this._renderContent())}get _renderedActions(){return N(this._renderActions())}get _renderedHelpMessage(){const{sketchOptions:t,visibleElements:e}=this.info;if(!e.helpMessage)return null;const o=t.tooltips.helpMessage??this._defaultHelpMessage;if(!o)return null;const i=t.tooltips.helpMessageIcon??"information";return T("div",{class:A,key:"help-message"},i?T("calcite-icon",{class:j,icon:i,scale:"s"}):null,T("div",{class:k},o))}get _defaultHelpMessage(){const{helpMessage:t,viewType:e}=this.info;if(null==t)return null;const o="3d"===e?"helpMessages3d":"helpMessages2d";return this._messagesTooltip?.sketch?.[o]?.[t]}async _focusField(t){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const{signal:e}=this._focusAbortController;await this._waitForInputs(),n(e);const o=this._getFocusableInputs(),i=t?o.find(e=>e.getAttribute("data-field-name")===t):o.at(0);await L(i)}async _transitionTo(t,o){if(this._mode===t&&!this._transitionInfo)return;if(this._transitionInfo?.mode===t)return this._transitionInfo.transition.finished;this._transitionInfo?.transition.skipTransition();const i=async()=>{this.destroyed||(this._mode=t,await l(),this.destroyed||(this.renderNow(),await l(),this.destroyed||o?.()))};if(!this.domNode?.firstChild||!document.startViewTransition||e())return void await i();this.autoRenderingEnabled=!1;const s=this._transitionInfo={transition:document.startViewTransition(async()=>{this.destroyed||s!==this._transitionInfo||(this.autoRenderingEnabled=!0,await i())}),mode:t};try{await s.transition.finished}finally{s===this._transitionInfo&&(this._transitionInfo=null)}}async _waitForInputs(){const t=()=>Array.from(this.domNode?.querySelectorAll("calcite-input")??[]);for(;0===t().length;)await r(O);await a()}_getFocusableInputs(){return Array.from(this.domNode?.querySelectorAll("calcite-input:not([read-only]):not([disabled])")??[])}_getFocusableElements(){const t=this.domNode?.querySelector(`.${C}`);return[...Array.from(t?.querySelectorAll(`.${v} calcite-button:not([disabled])`)??[]),...this._getFocusableInputs()]}};async function L(t){await(t?.setFocus())}function N(t){return(Array.isArray(t)?t:[t]).flat(10).filter(t=>!!t)}t([x("esri/core/t9n/Units"),h()],S.prototype,"_messagesUnits",void 0),t([x("esri/views/interactive/tooltip/t9n/Tooltip"),h()],S.prototype,"_messagesTooltip",void 0),t([h()],S.prototype,"info",void 0),t([h()],S.prototype,"tooltip",void 0),t([h()],S.prototype,"_mode",void 0),t([h()],S.prototype,"mode",null),t([h()],S.prototype,"_displayUnits",null),t([h()],S.prototype,"_inputUnitInfos",null),t([h()],S.prototype,"_formatters",null),t([h()],S.prototype,"fieldContext",null),t([h()],S.prototype,"_renderedContent",null),t([h()],S.prototype,"_renderedActions",null),t([h()],S.prototype,"_renderedHelpMessage",null),t([h()],S.prototype,"_defaultHelpMessage",null),S=t([m("esri.views.interactive.tooltip.content.TooltipContent")],S);const O=20;export{S as TooltipContent};
5
+ import{__decorate as t}from"tslib";import{prefersReducedMotion as e}from"../../../../core/a11yUtils.js";import{on as o}from"../../../../core/events.js";import"../../../../core/has.js";import{memoize as i}from"../../../../core/memoize.js";import{throwIfNotAbortError as s,throwIfAborted as n,after as r}from"../../../../core/promiseUtils.js";import{waitAnimationFrame as a,waitTick as l}from"../../../../core/scheduling.js";import{unitName as c}from"../../../../core/unitFormatUtils.js";import{defaultAreaUnit as p,defaultVerticalLengthUnit as d,defaultLengthUnit as u}from"../../../../core/unitUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{getDefaultUnitForView as f}from"../../../../support/getDefaultUnitForView.js";import{tooltipKeys as g}from"../../keybindings.js";import{table as _,contentHeader as y,contentHeaderSpacer as b,contentHeaderActions as v,contentInputMode as w,content as I,helpMessageText as k,helpMessageIcon as A,helpMessage as C,drawContentHeaderActions as U}from"../css.js";import{getFormatters as j}from"../fields/parsingAndFormattingUtils.js";import M from"../../../../widgets/Widget.js";import{loadCalciteComponents as D}from"../../../../widgets/support/componentsUtils.js";import{messageBundle as F,tsx as x,tsxFragment as T,classes as H}from"../../../../widgets/support/widget.js";const E=Symbol("dragHandles");let S=class extends M{constructor(){super(...arguments),this._focusAbortController=new AbortController,this._transitionInfo=null,this._mode="feedback",this._getFormatters=i(j),this._onHeaderPointerDown=t=>{const e=t.target;e instanceof HTMLElement&&"calcite-button"!==e?.tagName?.toLowerCase()&&(this.removeHandles(E),t.preventDefault(),t.stopPropagation(),e.setPointerCapture(t.pointerId),this.tooltip.onDragStart(t.clientX,t.clientY),this.addHandles([o(e,"pointermove",({clientX:t,clientY:e})=>{this.tooltip.onDrag(t,e)}),o(e,["pointerup","pointercancel"],o=>{this.removeHandles(E),e.releasePointerCapture(t.pointerId),this.tooltip.onDragEnd()}),o(e,"touchstart",t=>t.preventDefault())],E))},this._onDiscard=()=>{this.destroyed||(this.tooltip.emit("discard"),this.info.clearInputValues(),this.exitInputMode())},this._onCommit=(t,e)=>{if(this.destroyed)return;if(this.tooltip.emit("commit",{type:e}),"commit-and-exit"===e)return void this.exitInputMode();if("commit-on-blur"===e)return;const o=this._getFocusableElements(),i=o.length,s=o.indexOf(t);if(-1===s)return void this.exitInputMode();const n=((s+("commit-and-next"===e?1:-1))%i+i)%i;L(o.at(n))},this._onKeyDown=t=>{switch(t.code){case g.next:return this._onNextKey(t);case g.discard:return t.stopPropagation(),this._onDiscard()}}}get mode(){return this._mode}get _displayUnits(){const{displayUnits:t}=this.info.sketchOptions.values,e=f(this.tooltip.view);return{length:t.length??e,verticalLength:t.verticalLength??e,area:t.area??e}}get _inputUnitInfos(){const t=this._messagesUnits,e=e=>({unit:e,abbreviation:c(t,e,"abbr")}),{inputUnits:o}=this.info.sketchOptions.values,i=f(this.tooltip.view),s=o.length??i,n=o.verticalLength??i,r=o.area??i;return{length:e(u(s)),verticalLength:e(d(n)),area:e(p(r)),angle:e("degrees")}}get _formatters(){return this._getFormatters(this._messagesUnits,this._displayUnits)}get fieldContext(){return{formatters:this._formatters,inputUnitInfos:this._inputUnitInfos,messages:this._messagesTooltip,sketchOptions:this.info.sketchOptions,onCommit:this._onCommit,onDiscard:this._onDiscard}}render(){const{visibleElements:t}=this.info.sketchOptions.tooltips,e=this._renderedContent,o=this._renderedActions,i=this._renderedHelpMessage,s=e.length>0,n=s||!!i,r="input"===this.mode;return x("div",{class:H(I,r&&w),onkeydown:this._onKeyDown,tabIndex:-1},r&&n&&t.header?x("div",{class:y,"data-testid":"tooltip-header",key:"header",onpointerdown:this._onHeaderPointerDown},x("calcite-button",{appearance:"transparent","data-testid":"tooltip-back-button",iconFlipRtl:"both",iconStart:"chevron-left",key:"discard-button",kind:"neutral",onclick:this._onDiscard,scale:"s",tabIndex:-1}),o.length>0?x(T,null,x("div",{class:b,key:"spacer"}),x("div",{class:v,key:"actions"},o)):null):null,s?x("div",{class:_,key:"content"},...e):null,i)}destroy(){this._focusAbortController.abort(),this._transitionInfo?.transition.skipTransition()}_renderActions(){return null}loadDependencies(){return D({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input")})}async enterInputMode(t,e){try{await this._transitionTo("input",e),await this._focusField(t)}catch(o){s(o)}}async exitInputMode({focusOnView:t=!0}={}){try{const{container:e,info:o}=this;o.clearInputValues();const i=t?e?.closest(".esri-view")?.querySelector(".esri-view-surface"):null;await this._transitionTo("feedback"),i instanceof HTMLElement&&i.focus()}catch(e){s(e)}}_onNextKey(t){const e=this._getFocusableElements(),o=e.at(0),i=e.at(-1);o&&i&&(t.shiftKey?document.activeElement===o&&(t.preventDefault(),t.stopPropagation(),L(i)):document.activeElement===i&&(t.preventDefault(),t.stopPropagation(),L(o)))}get _renderedContent(){return N(this._renderContent())}get _renderedActions(){return N(this._renderActions())}get _renderedHelpMessage(){const{sketchOptions:t,visibleElements:e}=this.info;if(!e.helpMessage)return null;const o=t.tooltips.helpMessage??this._defaultHelpMessage;if(!o)return null;const i=t.tooltips.helpMessageIcon??"information";return x("div",{class:C,key:"help-message"},i?x("calcite-icon",{class:A,icon:i,scale:"s"}):null,x("div",{class:k},o))}get _defaultHelpMessage(){const{helpMessage:t,viewType:e}=this.info;if(null==t)return null;const o="3d"===e?"helpMessages3d":"helpMessages2d";return this._messagesTooltip?.sketch?.[o]?.[t]}async _focusField(t){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const{signal:e}=this._focusAbortController;await this._waitForInputs(),n(e);const o=this._getFocusableInputs(),i=t?o.find(e=>e.getAttribute("data-field-name")===t):o.at(0);await L(i)}async _transitionTo(t,o){if(this._mode===t&&!this._transitionInfo)return;if(this._transitionInfo?.mode===t)return this._transitionInfo.transition.finished;this._transitionInfo?.transition.skipTransition();const i=async()=>{this.destroyed||(this._mode=t,await l(),this.destroyed||(this.renderNow(),await l(),this.destroyed||o?.()))};if(!this.domNode?.firstChild||!document.startViewTransition||e())return void await i();this.autoRenderingEnabled=!1;const s=this._transitionInfo={transition:document.startViewTransition(async()=>{this.destroyed||s!==this._transitionInfo||(this.autoRenderingEnabled=!0,await i())}),mode:t};try{await s.transition.finished}finally{s===this._transitionInfo&&(this._transitionInfo=null)}}async _waitForInputs(){const t=()=>Array.from(this.domNode?.querySelectorAll("calcite-input")??[]);for(;0===t().length;)await r(O);await a()}_getFocusableInputs(){return Array.from(this.domNode?.querySelectorAll("calcite-input:not([read-only]):not([disabled])")??[])}_getFocusableElements(){const t=this.domNode?.querySelector(`.${U}`);return[...Array.from(t?.querySelectorAll(`.${v} calcite-button:not([disabled])`)??[]),...this._getFocusableInputs()]}};async function L(t){await(t?.setFocus())}function N(t){return(Array.isArray(t)?t:[t]).flat(10).filter(t=>!!t)}t([F("esri/core/t9n/Units"),h()],S.prototype,"_messagesUnits",void 0),t([F("esri/views/interactive/tooltip/t9n/Tooltip"),h()],S.prototype,"_messagesTooltip",void 0),t([h()],S.prototype,"info",void 0),t([h()],S.prototype,"tooltip",void 0),t([h()],S.prototype,"_mode",void 0),t([h()],S.prototype,"mode",null),t([h()],S.prototype,"_displayUnits",null),t([h()],S.prototype,"_inputUnitInfos",null),t([h()],S.prototype,"_formatters",null),t([h()],S.prototype,"fieldContext",null),t([h()],S.prototype,"_renderedContent",null),t([h()],S.prototype,"_renderedActions",null),t([h()],S.prototype,"_renderedHelpMessage",null),t([h()],S.prototype,"_defaultHelpMessage",null),S=t([m("esri.views.interactive.tooltip.content.TooltipContent")],S);const O=20;export{S as TooltipContent};
@@ -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"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{TooltipField as e}from"../components/TooltipField.js";import{ValueByValue as r}from"../components/ValueByValue.js";import{TooltipContent as s}from"./TooltipContent.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as i,tsxFragment as l}from"../../../../widgets/support/jsxFactory.js";import"@arcgis/toolkit/dom";let n=class extends s{_renderContent(){const{area:t,radius:o,xSize:s,ySize:n,visibleElements:a}=this.info,p=this._messagesTooltip.sketch,m=this._formatters;return i(l,null,a.radius&&null!=o?i(e,{title:p.radius,value:m.length(o)}):null,a.size&&null!=s&&null!=n?i(e,{title:p.size,value:i(r,{left:m.length(s),right:m.length(n)})}):null,a.area?i(e,{title:p.area,value:m.area(t)}):null)}};n=t([o("esri.views.interactive.tooltip.content.TooltipContentDrawCircle")],n);export{n as TooltipContentDrawCircle};
5
+ import{__decorate as t}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{TooltipField as o}from"../components/TooltipField.js";import{ValueByValue as r}from"../components/ValueByValue.js";import{TooltipContent as s}from"./TooltipContent.js";import{tsx as i,tsxFragment as l}from"../../../../widgets/support/widget.js";let n=class extends s{_renderContent(){const{area:t,radius:e,xSize:s,ySize:n,visibleElements:a}=this.info,m=this._messagesTooltip.sketch,p=this._formatters;return i(l,null,a.radius&&null!=e?i(o,{title:m.radius,value:p.length(e)}):null,a.size&&null!=s&&null!=n?i(o,{title:m.size,value:i(r,{left:p.length(s),right:p.length(n)})}):null,a.area?i(o,{title:m.area,value:p.area(t)}):null)}};n=t([e("esri.views.interactive.tooltip.content.TooltipContentDrawCircle")],n);export{n as TooltipContentDrawCircle};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{Fields as e}from"./Fields.js";import{TooltipContent as i}from"./TooltipContent.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as r}from"../../../../widgets/support/jsxFactory.js";import"@arcgis/toolkit/dom";let s=class extends i{_renderContent(){const{fieldContext:o,info:t,mode:i}=this,{visibleElements:s}=t;return r(e,{context:o,fields:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0,s.elevation?t.elevation:void 0,s.orientation?t.orientation:void 0,s.scale?t.scale:void 0],mode:i})}};s=o([t("esri.views.interactive.tooltip.content.TooltipContentDrawMesh")],s);export{s as TooltipContentDrawMesh};
5
+ import{__decorate as o}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{Fields as t}from"./Fields.js";import{TooltipContent as i}from"./TooltipContent.js";import{tsx as r}from"../../../../widgets/support/widget.js";let s=class extends i{_renderContent(){const{fieldContext:o,info:e,mode:i}=this,{visibleElements:s}=e;return r(t,{context:o,fields:[s.coordinates?e.effectiveX:void 0,s.coordinates?e.effectiveY:void 0,s.elevation?e.elevation:void 0,s.orientation?e.orientation:void 0,s.scale?e.scale:void 0],mode:i})}};s=o([e("esri.views.interactive.tooltip.content.TooltipContentDrawMesh")],s);export{s as TooltipContentDrawMesh};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{Fields as e}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as i}from"../../../../widgets/support/jsxFactory.js";import"@arcgis/toolkit/dom";let s=class extends r{_renderContent(){const{fieldContext:o,info:t,mode:r}=this,{elevation:s,visibleElements:n}=t;return i(e,{context:o,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?s:void 0],mode:r})}};s=o([t("esri.views.interactive.tooltip.content.TooltipContentDrawPoint")],s);export{s as TooltipContentDrawPoint};
5
+ import{__decorate as o}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{Fields as t}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i}from"../../../../widgets/support/widget.js";let s=class extends r{_renderContent(){const{fieldContext:o,info:e,mode:r}=this,{elevation:s,visibleElements:n}=e;return i(t,{context:o,fields:[n.coordinates?e.effectiveX:void 0,n.coordinates?e.effectiveY:void 0,n.elevation?s:void 0],mode:r})}};s=o([e("esri.views.interactive.tooltip.content.TooltipContentDrawPoint")],s);export{s as TooltipContentDrawPoint};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{DrawHeaderActions as e}from"../components/DrawHeaderActions.js";import{Fields as i}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as s}from"../../../../widgets/support/jsxFactory.js";import"@arcgis/toolkit/dom";let n=class extends r{_renderContent(){const{fieldContext:o,info:t,mode:e}=this,{xyMode:r,visibleElements:n}=t;return s(i,{context:o,fields:[..."direction-distance"===r?[n.direction?t.direction:void 0,n.distance?t.distance:void 0]:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0],n.elevation?t.elevation:void 0,n.area?t.area:void 0],mode:e})}_renderActions(){const{xyMode:o,sketchOptions:t}=this.info;return s(e,{sketchOptions:t,visibleElements:{direction:"direction-distance"===o}})}};n=o([t("esri.views.interactive.tooltip.content.TooltipContentDrawPolygon")],n);export{n as TooltipContentDrawPolygon};
5
+ import{__decorate as o}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{DrawHeaderActions as t}from"../components/DrawHeaderActions.js";import{Fields as i}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as s}from"../../../../widgets/support/widget.js";let n=class extends r{_renderContent(){const{fieldContext:o,info:e,mode:t}=this,{xyMode:r,visibleElements:n}=e;return s(i,{context:o,fields:[..."direction-distance"===r?[n.direction?e.direction:void 0,n.distance?e.distance:void 0]:[n.coordinates?e.effectiveX:void 0,n.coordinates?e.effectiveY:void 0],n.elevation?e.elevation:void 0,n.area?e.area:void 0],mode:t})}_renderActions(){const{xyMode:o,sketchOptions:e}=this.info;return s(t,{sketchOptions:e,visibleElements:{direction:"direction-distance"===o}})}};n=o([e("esri.views.interactive.tooltip.content.TooltipContentDrawPolygon")],n);export{n as TooltipContentDrawPolygon};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{DrawHeaderActions as e}from"../components/DrawHeaderActions.js";import{Fields as i}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as s}from"../../../../widgets/support/jsxFactory.js";import"@arcgis/toolkit/dom";let n=class extends r{_renderContent(){const{fieldContext:o,info:t,mode:e}=this,{xyMode:r,visibleElements:n}=t;return s(i,{context:o,fields:[..."direction-distance"===r?[n.direction?t.direction:void 0,n.distance?t.distance:void 0]:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0],n.elevation?t.elevation:void 0,n.totalLength?t.totalLength:void 0],mode:e})}_renderActions(){const{xyMode:o,sketchOptions:t}=this.info;return s(e,{sketchOptions:t,visibleElements:{direction:"direction-distance"===o}})}};n=o([t("esri.views.interactive.tooltip.content.TooltipContentDrawPolyline")],n);export{n as TooltipContentDrawPolyline};
5
+ import{__decorate as o}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{DrawHeaderActions as e}from"../components/DrawHeaderActions.js";import{Fields as i}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as s}from"../../../../widgets/support/widget.js";let n=class extends r{_renderContent(){const{fieldContext:o,info:t,mode:e}=this,{xyMode:r,visibleElements:n}=t;return s(i,{context:o,fields:[..."direction-distance"===r?[n.direction?t.direction:void 0,n.distance?t.distance:void 0]:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0],n.elevation?t.elevation:void 0,n.totalLength?t.totalLength:void 0],mode:e})}_renderActions(){const{xyMode:o,sketchOptions:t}=this.info;return s(e,{sketchOptions:t,visibleElements:{direction:"direction-distance"===o}})}};n=o([t("esri.views.interactive.tooltip.content.TooltipContentDrawPolyline")],n);export{n as TooltipContentDrawPolyline};
@@ -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"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{TooltipField as e}from"../components/TooltipField.js";import{ValueByValue as r}from"../components/ValueByValue.js";import{TooltipContent as s}from"./TooltipContent.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as i,tsxFragment as l}from"../../../../widgets/support/jsxFactory.js";import"@arcgis/toolkit/dom";let n=class extends s{_renderContent(){const{area:t,xSize:o,ySize:s,visibleElements:n}=this.info,p=this._messagesTooltip.sketch,a=this._formatters;return i(l,null,n.size&&null!=o&&null!=s?i(e,{title:p.size,value:i(r,{left:a.length(o),right:a.length(s)})}):null,n.area?i(e,{title:p.area,value:a.area(t)}):null)}};n=t([o("esri.views.interactive.tooltip.content.TooltipContentDrawRectangle")],n);export{n as TooltipContentDrawRectangle};
5
+ import{__decorate as t}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{TooltipField as o}from"../components/TooltipField.js";import{ValueByValue as r}from"../components/ValueByValue.js";import{TooltipContent as s}from"./TooltipContent.js";import{tsx as i,tsxFragment as l}from"../../../../widgets/support/widget.js";let n=class extends s{_renderContent(){const{area:t,xSize:e,ySize:s,visibleElements:n}=this.info,a=this._messagesTooltip.sketch,m=this._formatters;return i(l,null,n.size&&null!=e&&null!=s?i(o,{title:a.size,value:i(r,{left:m.length(e),right:m.length(s)})}):null,n.area?i(o,{title:a.area,value:m.area(t)}):null)}};n=t([e("esri.views.interactive.tooltip.content.TooltipContentDrawRectangle")],n);export{n as TooltipContentDrawRectangle};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{Fields as e}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as i}from"../../../../widgets/support/jsxFactory.js";import"@arcgis/toolkit/dom";let s=class extends r{_renderContent(){const{fieldContext:o,info:t,mode:r}=this,{visibleElements:s}=t;return i(e,{context:o,fields:[s.elevation?t.elevation:void 0],mode:r})}};s=o([t("esri.views.interactive.tooltip.content.TooltipContentElevation")],s);export{s as TooltipContentElevation};
5
+ import{__decorate as o}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{Fields as e}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i}from"../../../../widgets/support/widget.js";let s=class extends r{_renderContent(){const{fieldContext:o,info:t,mode:r}=this,{visibleElements:s}=t;return i(e,{context:o,fields:[s.elevation?t.elevation:void 0],mode:r})}};s=o([t("esri.views.interactive.tooltip.content.TooltipContentElevation")],s);export{s as TooltipContentElevation};