@arcgis/core 5.0.0-next.13 → 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 e}from"tslib";import"../../../intl.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import s from"../../Widget.js";import{css as o}from"../css.js";import{loadCalciteComponents as i}from"../../support/componentsUtils.js";import{Heading as n,incrementHeadingLevel as a}from"../../support/Heading.js";import{ItemList as c}from"../../support/ItemList.js";import{fetchThumbnail as l}from"../../support/symbolPreviewUtils.js";import"../../support/widgetUtils.js";import{messageBundle as m}from"../../support/decorators/messageBundle.js";import{tsx as p,tsxFragment as d}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as u}from"../../../intl/substitute.js";let h=class extends s{constructor(){super(...arguments),this.workflow=null,this.headingLevel=4,this._iconIntersectionObserver=new IntersectionObserver((e,t)=>{e.forEach(async e=>{if(e.isIntersecting){const r=e.target;if(g(r))return void t.unobserve(r);const s=f(r),{graphic:o}=s,i=o.sourceLayer??this.workflow?.layer;if(!i||!o)return;v(r,!0);const n=s.id?u(this.messages.previewTemplateAriaLabel,{label:s.id}):this.messagesCommon.preview,a=await l(o,i,{ariaLabel:n}).catch(()=>(v(r,!1),null));if(null==a)return;r.appendChild(a)}})}),this.messages=null,this.messagesCommon=null,this._renderItemContentEnd=({graphic:e})=>{const{workflow:t}=this;if(t?.isKeyFeature(e)){const e=this.messages.preserved;return p("calcite-chip",{class:o.mergeFeaturesListItemPreserved,icon:"check",label:e,scale:"s",slot:"content-end"},e)}if(t?.isTemporaryHighlightFeature(e)){const e=this.messages.preserve;return p("calcite-chip",{label:e,scale:"s",slot:"content-end"},e)}},this._renderItemIcon=e=>{if(null!=e?.graphic?.geometry)return p("span",{afterCreate:this._afterItemCreateOrUpdate,afterRemoved:this._afterItemRemoved,afterUpdate:this._afterItemCreateOrUpdate,"data-has-icon":!1,"data-item":e,key:"icon"})},this._afterItemCreateOrUpdate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)}}loadDependencies(){return i({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),list:()=>import("@esri/calcite-components/dist/components/calcite-list")})}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}render(){const{workflow:e}=this;if(!e)return p(d,null,void 0);const t=this.messages,r=e.data.features.map((t,r)=>({disabled:!1,id:`${e.getFeatureTitle(t)??r}`,graphic:t,selected:t===e.data.keyFeature}));return p("div",{class:o.mergeFeaturesList},p(n,{level:a(this.headingLevel)},t.editFeaturesList),p("calcite-list",{label:t.result},c({enableListScroll:!1,filterEnabled:!1,id:"merge-features-pick-list",items:r,messages:{filterPlaceholder:"",noItems:"",noMatches:""},selectionMode:"single",renderIcon:this._renderItemIcon,renderItemLabel:e=>e.id,onItemMouseEnter:t=>{e&&(e.data.temporaryHighlightFeature=t.graphic)},onItemMouseLeave:()=>{e&&(e.data.temporaryHighlightFeature=null)},onItemSelect:e=>{this.workflow?.setKeyFeature(e.graphic)},renderItemContentEnd:this._renderItemContentEnd})))}};function f(e){return e?.["data-item"]}function g(e){return!!e?.["data-has-icon"]}function v(e,t){e&&(e["data-has-icon"]=t)}e([t()],h.prototype,"workflow",void 0),e([t()],h.prototype,"headingLevel",void 0),e([t(),m("esri/widgets/Editor/t9n/Editor")],h.prototype,"messages",void 0),e([t(),m("esri/t9n/common")],h.prototype,"messagesCommon",void 0),h=e([r("esri.widgets.Editor.components.MergeFeaturesList")],h);const I=h;export{I as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t}from"../../../intl.js";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 s}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../Widget.js";import{css as i}from"../css.js";import{loadCalciteComponents as n}from"../../support/componentsUtils.js";import{Heading as a,incrementHeadingLevel as c}from"../../support/Heading.js";import{ItemList as l}from"../../support/ItemList.js";import{fetchThumbnail as m}from"../../support/symbolPreviewUtils.js";import{messageBundle as p,tsx as d,tsxFragment as h}from"../../support/widget.js";let u=class extends o{constructor(){super(...arguments),this.workflow=null,this.headingLevel=4,this._iconIntersectionObserver=new IntersectionObserver((e,r)=>{e.forEach(async e=>{if(e.isIntersecting){const s=e.target;if(g(s))return void r.unobserve(s);const o=f(s),{graphic:i}=o,n=i.sourceLayer??this.workflow?.layer;if(!n||!i)return;v(s,!0);const a=o.id?t(this.messages.previewTemplateAriaLabel,{label:o.id}):this.messagesCommon.preview,c=await m(i,n,{ariaLabel:a}).catch(()=>(v(s,!1),null));if(null==c)return;s.appendChild(c)}})}),this.messages=null,this.messagesCommon=null,this._renderItemContentEnd=({graphic:e})=>{const{workflow:t}=this;if(t?.isKeyFeature(e)){const e=this.messages.preserved;return d("calcite-chip",{class:i.mergeFeaturesListItemPreserved,icon:"check",label:e,scale:"s",slot:"content-end"},e)}if(t?.isTemporaryHighlightFeature(e)){const e=this.messages.preserve;return d("calcite-chip",{label:e,scale:"s",slot:"content-end"},e)}},this._renderItemIcon=e=>{if(null!=e?.graphic?.geometry)return d("span",{afterCreate:this._afterItemCreateOrUpdate,afterRemoved:this._afterItemRemoved,afterUpdate:this._afterItemCreateOrUpdate,"data-has-icon":!1,"data-item":e,key:"icon"})},this._afterItemCreateOrUpdate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)}}loadDependencies(){return n({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),list:()=>import("@esri/calcite-components/dist/components/calcite-list")})}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}render(){const{workflow:e}=this;if(!e)return d(h,null,void 0);const t=this.messages,r=e.data.features.map((t,r)=>({disabled:!1,id:`${e.getFeatureTitle(t)??r}`,graphic:t,selected:t===e.data.keyFeature}));return d("div",{class:i.mergeFeaturesList},d(a,{level:c(this.headingLevel)},t.editFeaturesList),d("calcite-list",{label:t.result},l({enableListScroll:!1,filterEnabled:!1,id:"merge-features-pick-list",items:r,messages:{filterPlaceholder:"",noItems:"",noMatches:""},selectionMode:"single",renderIcon:this._renderItemIcon,renderItemLabel:e=>e.id,onItemMouseEnter:t=>{e&&(e.data.temporaryHighlightFeature=t.graphic)},onItemMouseLeave:()=>{e&&(e.data.temporaryHighlightFeature=null)},onItemSelect:e=>{this.workflow?.setKeyFeature(e.graphic)},renderItemContentEnd:this._renderItemContentEnd})))}};function f(e){return e?.["data-item"]}function g(e){return!!e?.["data-has-icon"]}function v(e,t){e&&(e["data-has-icon"]=t)}e([r()],u.prototype,"workflow",void 0),e([r()],u.prototype,"headingLevel",void 0),e([r(),p("esri/widgets/Editor/t9n/Editor")],u.prototype,"messages",void 0),e([r(),p("esri/t9n/common")],u.prototype,"messagesCommon",void 0),u=e([s("esri.widgets.Editor.components.MergeFeaturesList")],u);const I=u;export{I 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{PanelContentSection as e}from"./PanelContent.js";import{loadCalciteComponents as t}from"../../support/componentsUtils.js";import{iconByKind as o}from"../../support/iconUtils.js";import"../../support/widgetUtils.js";import{tsx as s,tsxFragment as i}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const n={notice:"esri-editor__notice",noticesPanelSection:"esri-editor__notices-panel-section"},r=()=>t({notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")});function c({activeFeatureCount:t,workflow:o,messages:r}){const c=[],l="content-start";if(o?.reliesOnOwnerAdminPrivileges){const e=r.ownerAdminNotice;c.push(s(a,{key:"owner-admin-notice",message:e,slot:l}))}if(o?.hasInvalidFormTemplate){const e=t>1?r.multiFeature.formFieldUpdateError:r.singleFeature.formFieldUpdateError;c.push(s(a,{key:"form-field-error",kind:"warning",message:e,slot:l}))}if("create-features"===o?.type){const e=r.helpMessages3d;switch(o.data.upload?.result?.type){case"georeferenced-reprojected":c.push(s(a,{key:"mesh-reprojected",kind:"warning",message:e.meshReprojected,slot:l}));break;case"georeferenced":c.push(s(a,{key:"mesh-georeferenced",kind:"info",message:e.meshGeoreferenced,slot:l}))}}return 0===c.length?s(i,null,void 0):s(e,{class:n.noticesPanelSection},c)}function a(e){const t=e.kind??"brand";return s("calcite-notice",{class:n.notice,icon:o[t],key:e.key,kind:t,open:!0,scale:"s"},e.title?s("div",{slot:"title"},e.title):null,s("div",{slot:"message"},e.message))}export{a as Notice,c as Notices,n as css,r as loadNoticesComponents};
5
+ import{PanelContentSection as e}from"./PanelContent.js";import{loadCalciteComponents as t}from"../../support/componentsUtils.js";import{iconByKind as o}from"../../support/iconUtils.js";import{tsx as s,tsxFragment as n}from"../../support/widget.js";const i={notice:"esri-editor__notice",noticesPanelSection:"esri-editor__notices-panel-section"},r=()=>t({notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")});function c({activeFeatureCount:t,workflow:o,messages:r}){const c=[],l="content-start";if(o?.reliesOnOwnerAdminPrivileges){const e=r.ownerAdminNotice;c.push(s(a,{key:"owner-admin-notice",message:e,slot:l}))}if(o?.hasInvalidFormTemplate){const e=t>1?r.multiFeature.formFieldUpdateError:r.singleFeature.formFieldUpdateError;c.push(s(a,{key:"form-field-error",kind:"warning",message:e,slot:l}))}if("create-features"===o?.type){const e=r.helpMessages3d;switch(o.data.upload?.result?.type){case"georeferenced-reprojected":c.push(s(a,{key:"mesh-reprojected",kind:"warning",message:e.meshReprojected,slot:l}));break;case"georeferenced":c.push(s(a,{key:"mesh-georeferenced",kind:"info",message:e.meshGeoreferenced,slot:l}))}}return 0===c.length?s(n,null,void 0):s(e,{class:i.noticesPanelSection},c)}function a(e){const t=e.kind??"brand";return s("calcite-notice",{class:i.notice,icon:o[t],key:e.key,kind:t,open:!0,scale:"s"},e.title?s("div",{slot:"title"},e.title):null,s("div",{slot:"message"},e.message))}export{a as Notice,c as Notices,i as css,r as loadNoticesComponents};
@@ -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{loadCalciteComponents as e}from"../../support/componentsUtils.js";import{classes as t}from"../../support/widgetUtils.js";import{tsx as s}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const o="esri-editor__panel-content",n={base:o,message:`${o}__message`,section:`${o}__section`,sectionGroup:`${o}__section__group`,scrimContainer:`${o}__scrim-container`},i=()=>e({scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim")});function c(e,...o){return s("div",{class:t(n.base,e?.showScrimOverlay?n.scrimContainer:void 0),key:e?.key??"panel-content"},...o,e?.showScrimOverlay?s("calcite-scrim",null):void 0)}function r(e,...t){return s("div",{class:n.message,"data-testid":"panel-content-message",key:e?.key??"panel-content-message"},...t)}function a(e,...o){return s("div",{class:t(n.section,e?.class),key:e?.key??"panel-content-section"},...o)}function m(e,...t){return s("div",{class:n.sectionGroup,key:e?.key??"panel-content-section-group"},...t)}export{c as PanelContent,r as PanelContentMessage,a as PanelContentSection,m as PanelContentSectionGroup,n as css,i as loadPanelContentComponents};
5
+ import{loadCalciteComponents as e}from"../../support/componentsUtils.js";import{tsx as n,classes as s}from"../../support/widget.js";const t="esri-editor__panel-content",o={base:t,message:`${t}__message`,section:`${t}__section`,sectionGroup:`${t}__section__group`,scrimContainer:`${t}__scrim-container`},c=()=>e({scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim")});function i(e,...t){return n("div",{class:s(o.base,e?.showScrimOverlay?o.scrimContainer:void 0),key:e?.key??"panel-content"},...t,e?.showScrimOverlay?n("calcite-scrim",null):void 0)}function r(e,...s){return n("div",{class:o.message,"data-testid":"panel-content-message",key:e?.key??"panel-content-message"},...s)}function a(e,...t){return n("div",{class:s(o.section,e?.class),key:e?.key??"panel-content-section"},...t)}function m(e,...s){return n("div",{class:o.sectionGroup,key:e?.key??"panel-content-section-group"},...s)}export{i as PanelContent,r as PanelContentMessage,a as PanelContentSection,m as PanelContentSectionGroup,o as css,c as loadPanelContentComponents};
@@ -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{loadSettingsComponents as e,Settings as o}from"./Settings.js";import{tsx as s}from"../../support/jsxFactory.js";const t={base:"esri-editor__panel-toolbar"},i=()=>e();function r({editorViewModel:e,messagesCommon:i,visibleElements:r}){return s("div",{class:t.base,key:"panel-toolbar"},s(o,{editorViewModel:e,messagesCommon:i,visibleElements:r}))}export{r as PanelToolbar,t as css,i as loadPanelToolbarComponents};
5
+ import{loadSettingsComponents as e,Settings as o}from"./Settings.js";import{tsx as s}from"../../support/widget.js";const t={base:"esri-editor__panel-toolbar"},i=()=>e();function r({editorViewModel:e,messagesCommon:i,visibleElements:r}){return s("div",{class:t.base,key:"panel-toolbar"},s(o,{editorViewModel:e,messagesCommon:i,visibleElements:r}))}export{r as PanelToolbar,t as css,i as loadPanelToolbarComponents};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../../intl.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../Widget.js";import{css as i}from"../css.js";import{isCreateFeaturesWorkflow as s,isSplitFeatureWorkflow as n}from"../workflowUtils.js";import{CreateFeaturesWorkflowPendingFeatureListAdapter as a}from"./workflowAdapters/pendingFeatureList/CreateFeaturesWorkflowPendingFeatureListAdapter.ts.js";import{SplitFeatureWorkflowPendingFeatureListAdapter as c}from"./workflowAdapters/pendingFeatureList/SplitFeatureWorkflowPendingFeatureListAdapter.js";import{loadCalciteComponents as l}from"../../support/componentsUtils.js";import{Heading as d,incrementHeadingLevel as m}from"../../support/Heading.js";import{ItemList as p}from"../../support/ItemList.js";import{fetchThumbnail as u}from"../../support/symbolPreviewUtils.js";import"../../support/widgetUtils.js";import{messageBundle as h}from"../../support/decorators/messageBundle.js";import{tsx as f,tsxFragment as g}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as w}from"../../../intl/substitute.js";let b=class extends o{constructor(){super(...arguments),this.workflow=null,this.workflowAdapter=null,this.headingLevel=4,this._iconIntersectionObserver=new IntersectionObserver((e,t)=>{e.forEach(async e=>{if(e.isIntersecting){const r=e.target;if(I(r))return void t.unobserve(r);const o=v(r),{graphic:i}=o,s=i.sourceLayer??this.workflowAdapter?.layer;if(!s||!i)return;k(r,!0);const n=o.id?w(this.messages.previewTemplateAriaLabel,{label:o.id}):this.messagesCommon.preview,a=await u(i,s,{ariaLabel:n}).catch(()=>(k(r,!1),null));if(null==a)return;r.appendChild(a)}})}),this.messages=null,this.messagesCommon=null,this._renderActionEnd=({graphic:e})=>{const{workflowAdapter:t,messages:r}=this;if(!t)return;const o=e.geometry?f("calcite-action",{appearance:"transparent",icon:"zoom-to-object",onblur:()=>t.clearHighlights(),onclick:()=>t.zoomToFeature(e),onfocus:()=>t.highlightFeature(e),scale:"s",slot:"actions-end",text:this.messages.zoomTo,title:this.messages.zoomTo}):void 0,i=t.allowCancel?f("calcite-action",{appearance:"transparent",icon:"trash",onblur:()=>t.clearHighlights(),onclick:()=>t.cancelFeature(e),onfocus:()=>t.highlightFeature(e),scale:"s",slot:"actions-end",text:r.createFeaturesSelectionList.discard,title:r.createFeaturesSelectionList.discard}):void 0;return f(g,null,o,i)},this._renderItemContentEnd=({graphic:e})=>{const{workflowAdapter:t}=this,r=t?.isSubmittable(e);return[r?void 0:f("calcite-icon",{class:i.pendingFeatureListIcon,icon:"exclamation-mark-triangle",scale:"s",slot:"content-end"})]},this._renderItemIcon=e=>{if(null!=e?.graphic?.geometry)return f("span",{afterCreate:this._afterItemCreateOrUpdate,afterRemoved:this._afterItemRemoved,afterUpdate:this._afterItemCreateOrUpdate,"data-has-icon":!1,"data-item":e,key:"icon"})},this._afterItemCreateOrUpdate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)}}loadDependencies(){return l({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list")})}initialize(){this.workflowAdapter=L(this.workflow)}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}render(){const e=this.workflowAdapter;if(!e)return f(g,null,void 0);const t=this.messages,r=e.features.filter(t=>e.isVisible(t)).map((r,o)=>{const i=e.isSubmittable(r),s=i?t.createFeaturesSelectionList.featureReadyToSubmit:t.createFeaturesSelectionList.featureNotReadyToSubmit;return{disabled:!1,id:`${e.getFeatureTitle(r)??o}`,graphic:r,label:s,submittable:i}});return f("div",null,f(d,{level:m(this.headingLevel)},t.createFeaturesSelectionList.heading),f("calcite-list",{label:t.createFeaturesSelectionList.heading},p({enableListScroll:!1,filterEnabled:!1,filterText:"",id:"update-features-pick-list",items:r,messages:{filterPlaceholder:"",noItems:"",noMatches:""},renderIcon:this._renderItemIcon,renderItemTitle:e=>e.label,renderItemLabel:e=>e.id,onItemMouseEnter:e=>this.workflowAdapter?.highlightFeature(e.graphic),onItemMouseLeave:()=>this.workflowAdapter?.clearHighlights(),onItemSelect:e=>this.workflowAdapter?.onSelectFeature(e.graphic),renderItemContentEnd:this._renderItemContentEnd,renderItemActionEnd:this._renderActionEnd})))}};function v(e){return e?.["data-item"]}function I(e){return!!e?.["data-has-icon"]}function k(e,t){e&&(e["data-has-icon"]=t)}function L(e){return s(e)?new a({workflow:e}):n(e)?new c({workflow:e}):null}e([t()],b.prototype,"workflow",void 0),e([t()],b.prototype,"workflowAdapter",void 0),e([t()],b.prototype,"headingLevel",void 0),e([t(),h("esri/widgets/Editor/t9n/Editor")],b.prototype,"messages",void 0),e([t(),h("esri/t9n/common")],b.prototype,"messagesCommon",void 0),b=e([r("esri.widgets.Editor.components.PendingFeatureList")],b);const F=b;export{F as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t}from"../../../intl.js";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 o}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../Widget.js";import{css as s}from"../css.js";import{isCreateFeaturesWorkflow as n,isSplitFeatureWorkflow as a}from"../workflowUtils.js";import{CreateFeaturesWorkflowPendingFeatureListAdapter as c}from"./workflowAdapters/pendingFeatureList/CreateFeaturesWorkflowPendingFeatureListAdapter.ts.js";import{SplitFeatureWorkflowPendingFeatureListAdapter as l}from"./workflowAdapters/pendingFeatureList/SplitFeatureWorkflowPendingFeatureListAdapter.js";import{loadCalciteComponents as d}from"../../support/componentsUtils.js";import{Heading as m,incrementHeadingLevel as p}from"../../support/Heading.js";import{ItemList as u}from"../../support/ItemList.js";import{fetchThumbnail as h}from"../../support/symbolPreviewUtils.js";import{messageBundle as f,tsx as g,tsxFragment as w}from"../../support/widget.js";let b=class extends i{constructor(){super(...arguments),this.workflow=null,this.workflowAdapter=null,this.headingLevel=4,this._iconIntersectionObserver=new IntersectionObserver((e,r)=>{e.forEach(async e=>{if(e.isIntersecting){const o=e.target;if(I(o))return void r.unobserve(o);const i=v(o),{graphic:s}=i,n=s.sourceLayer??this.workflowAdapter?.layer;if(!n||!s)return;k(o,!0);const a=i.id?t(this.messages.previewTemplateAriaLabel,{label:i.id}):this.messagesCommon.preview,c=await h(s,n,{ariaLabel:a}).catch(()=>(k(o,!1),null));if(null==c)return;o.appendChild(c)}})}),this.messages=null,this.messagesCommon=null,this._renderActionEnd=({graphic:e})=>{const{workflowAdapter:t,messages:r}=this;if(!t)return;const o=e.geometry?g("calcite-action",{appearance:"transparent",icon:"zoom-to-object",onblur:()=>t.clearHighlights(),onclick:()=>t.zoomToFeature(e),onfocus:()=>t.highlightFeature(e),scale:"s",slot:"actions-end",text:this.messages.zoomTo,title:this.messages.zoomTo}):void 0,i=t.allowCancel?g("calcite-action",{appearance:"transparent",icon:"trash",onblur:()=>t.clearHighlights(),onclick:()=>t.cancelFeature(e),onfocus:()=>t.highlightFeature(e),scale:"s",slot:"actions-end",text:r.createFeaturesSelectionList.discard,title:r.createFeaturesSelectionList.discard}):void 0;return g(w,null,o,i)},this._renderItemContentEnd=({graphic:e})=>{const{workflowAdapter:t}=this,r=t?.isSubmittable(e);return[r?void 0:g("calcite-icon",{class:s.pendingFeatureListIcon,icon:"exclamation-mark-triangle",scale:"s",slot:"content-end"})]},this._renderItemIcon=e=>{if(null!=e?.graphic?.geometry)return g("span",{afterCreate:this._afterItemCreateOrUpdate,afterRemoved:this._afterItemRemoved,afterUpdate:this._afterItemCreateOrUpdate,"data-has-icon":!1,"data-item":e,key:"icon"})},this._afterItemCreateOrUpdate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)}}loadDependencies(){return d({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list")})}initialize(){this.workflowAdapter=L(this.workflow)}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}render(){const e=this.workflowAdapter;if(!e)return g(w,null,void 0);const t=this.messages,r=e.features.filter(t=>e.isVisible(t)).map((r,o)=>{const i=e.isSubmittable(r),s=i?t.createFeaturesSelectionList.featureReadyToSubmit:t.createFeaturesSelectionList.featureNotReadyToSubmit;return{disabled:!1,id:`${e.getFeatureTitle(r)??o}`,graphic:r,label:s,submittable:i}});return g("div",null,g(m,{level:p(this.headingLevel)},t.createFeaturesSelectionList.heading),g("calcite-list",{label:t.createFeaturesSelectionList.heading},u({enableListScroll:!1,filterEnabled:!1,filterText:"",id:"update-features-pick-list",items:r,messages:{filterPlaceholder:"",noItems:"",noMatches:""},renderIcon:this._renderItemIcon,renderItemTitle:e=>e.label,renderItemLabel:e=>e.id,onItemMouseEnter:e=>this.workflowAdapter?.highlightFeature(e.graphic),onItemMouseLeave:()=>this.workflowAdapter?.clearHighlights(),onItemSelect:e=>this.workflowAdapter?.onSelectFeature(e.graphic),renderItemContentEnd:this._renderItemContentEnd,renderItemActionEnd:this._renderActionEnd})))}};function v(e){return e?.["data-item"]}function I(e){return!!e?.["data-has-icon"]}function k(e,t){e&&(e["data-has-icon"]=t)}function L(e){return n(e)?new c({workflow:e}):a(e)?new l({workflow:e}):null}e([r()],b.prototype,"workflow",void 0),e([r()],b.prototype,"workflowAdapter",void 0),e([r()],b.prototype,"headingLevel",void 0),e([r(),f("esri/widgets/Editor/t9n/Editor")],b.prototype,"messages",void 0),e([r(),f("esri/t9n/common")],b.prototype,"messagesCommon",void 0),b=e([o("esri.widgets.Editor.components.PendingFeatureList")],b);const F=b;export{F 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{loadCalciteComponents as t}from"../../support/componentsUtils.js";import{Heading as e}from"../../support/Heading.js";import{iconByKind as o}from"../../support/iconUtils.js";import{setFocus as i}from"../../support/widgetUtils.js";import{tsx as a}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const c="esri-editor__prompt",n={base:c,header:`${c}__header`,heading:`${c}__header__heading`,message:`${c}__message`,divider:`${c}__divider`,actions:`${c}__actions`,halfWidthButton:`${c}__half-width-button`},s=()=>t({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")});function r({actions:t,context:c,headingLevel:s,message:r,title:d,...p}){const{primary:m,secondary:u}=t;let b;switch(c){case"danger":b="danger";break;case"info":b="brand";break;default:b="neutral"}const h=a("calcite-button",{afterCreate:t=>i(t),appearance:"solid",classes:{[n.halfWidthButton]:!!u},"data-testid":"primary-prompt-button",key:"prompt-primary-button",kind:b,onclick:m.action,width:"full"},m.label),g=u&&a("calcite-button",{appearance:"outline",class:n.halfWidthButton,"data-testid":"secondary-prompt-button",key:"prompt-secondary-button",kind:b,onclick:u.action,width:"full"},u.label);return a("calcite-scrim",{"data-testid":"prompt",key:"prompt"},a("div",{class:`${n.base}--${c}`},a("div",{class:n.header},a("calcite-icon",{icon:o.warning}),a(e,{class:n.heading,level:s},d)),a("div",{class:n.message},r),l(p)??a("div",{class:n.divider}),a("div",{class:n.actions},g,h)))}function l({radios:t,onRadioSelection:e,defaultRadioSelection:o}){return t?.length?a("calcite-radio-button-group",{name:"PromptChoiceList"},t.map(t=>a("calcite-label",{layout:"inline"},a("calcite-radio-button",{checked:t.value===o,value:t.value,onCalciteRadioButtonChange:()=>e?.(t.value)}),t.label))):void 0}export{r as Prompt,n as css,s as loadPromptComponents};
5
+ import{loadCalciteComponents as t}from"../../support/componentsUtils.js";import{Heading as e}from"../../support/Heading.js";import{iconByKind as i}from"../../support/iconUtils.js";import{tsx as o}from"../../support/widget.js";import{setFocus as a}from"../../support/widgetUtils.js";const c="esri-editor__prompt",n={base:c,header:`${c}__header`,heading:`${c}__header__heading`,message:`${c}__message`,divider:`${c}__divider`,actions:`${c}__actions`,halfWidthButton:`${c}__half-width-button`},s=()=>t({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")});function r({actions:t,context:c,headingLevel:s,message:r,title:d,...p}){const{primary:m,secondary:u}=t;let b;switch(c){case"danger":b="danger";break;case"info":b="brand";break;default:b="neutral"}const h=o("calcite-button",{afterCreate:t=>a(t),appearance:"solid",classes:{[n.halfWidthButton]:!!u},"data-testid":"primary-prompt-button",key:"prompt-primary-button",kind:b,onclick:m.action,width:"full"},m.label),g=u&&o("calcite-button",{appearance:"outline",class:n.halfWidthButton,"data-testid":"secondary-prompt-button",key:"prompt-secondary-button",kind:b,onclick:u.action,width:"full"},u.label);return o("calcite-scrim",{"data-testid":"prompt",key:"prompt"},o("div",{class:`${n.base}--${c}`},o("div",{class:n.header},o("calcite-icon",{icon:i.warning}),o(e,{class:n.heading,level:s},d)),o("div",{class:n.message},r),l(p)??o("div",{class:n.divider}),o("div",{class:n.actions},g,h)))}function l({radios:t,onRadioSelection:e,defaultRadioSelection:i}){return t?.length?o("calcite-radio-button-group",{name:"PromptChoiceList"},t.map(t=>o("calcite-label",{layout:"inline"},o("calcite-radio-button",{checked:t.value===i,value:t.value,onCalciteRadioButtonChange:()=>e?.(t.value)}),t.label))):void 0}export{r as Prompt,n as css,s as loadPromptComponents};
@@ -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{loadCalciteComponents as t}from"../../support/componentsUtils.js";import o from"../../support/SketchTooltipControls.js";import e from"../../support/SnappingControls.js";import"../../support/widgetUtils.js";import{tsx as i}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";import s from"../../support/SketchTooltipControls/VisibleElements.js";import n from"../../support/SnappingControls/VisibleElements.js";const p={settingsContainer:"esri-editor__settings"},r=()=>t({accordion:()=>import("@esri/calcite-components/dist/components/calcite-accordion"),"accordion-item":()=>import("@esri/calcite-components/dist/components/calcite-accordion-item")});function c({editorViewModel:t,messagesCommon:r,visibleElements:c}){const{snappingOptions:a,sketchOptions:l,view:m,snappingManager:g}=t,d=[],u={directionModePicker:c.directionModePicker,labelsToggle:c.labelsToggle,tooltipsToggle:c.tooltipsToggle};return Object.values(u).includes(!0)&&d.push(i(o,{sketchOptions:l,viewType:m?.type,visibleElements:new s(u)})),c.snappingControls&&d.push(i(e,{afterCreate:t=>t.layerListOpen=!1,snappingManager:g,snappingOptions:a,view:m,visibleElements:c.snappingControlsElements??new n})),0===d.length?null:i("calcite-accordion",{appearance:"transparent",class:p.settingsContainer,key:"settings"},i("calcite-accordion-item",{"data-testid":"settings",heading:r.settings,iconStart:"gear"},d))}export{c as Settings,p as css,r as loadSettingsComponents};
5
+ import{loadCalciteComponents as t}from"../../support/componentsUtils.js";import e from"../../support/SketchTooltipControls.js";import o from"../../support/SnappingControls.js";import{tsx as i}from"../../support/widget.js";import s from"../../support/SketchTooltipControls/VisibleElements.js";import n from"../../support/SnappingControls/VisibleElements.js";const p={settingsContainer:"esri-editor__settings"},r=()=>t({accordion:()=>import("@esri/calcite-components/dist/components/calcite-accordion"),"accordion-item":()=>import("@esri/calcite-components/dist/components/calcite-accordion-item")});function c({editorViewModel:t,messagesCommon:r,visibleElements:c}){const{snappingOptions:a,sketchOptions:l,view:m,snappingManager:g}=t,d=[],u={directionModePicker:c.directionModePicker,labelsToggle:c.labelsToggle,tooltipsToggle:c.tooltipsToggle};return Object.values(u).includes(!0)&&d.push(i(e,{sketchOptions:l,viewType:m?.type,visibleElements:new s(u)})),c.snappingControls&&d.push(i(o,{afterCreate:t=>t.layerListOpen=!1,snappingManager:g,snappingOptions:a,view:m,visibleElements:c.snappingControlsElements??new n})),0===d.length?null:i("calcite-accordion",{appearance:"transparent",class:p.settingsContainer,key:"settings"},i("calcite-accordion-item",{"data-testid":"settings",heading:r.settings,iconStart:"gear"},d))}export{c as Settings,p as css,r as loadSettingsComponents};
@@ -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{substitute as e}from"../../../intl/substitute.js";import{css as t}from"../css.js";import{isCreateFeaturesWorkflow as o,isSplitFeatureWorkflow as i,isMergeFeaturesWorkflow as n,isUpdateFeaturesWorkflow as s,isBatchAttributeFormViewModel as a,isUpdateFeatureWorkflow as r}from"../workflowUtils.js";import{loadFooterActionsComponents as l,FooterActions as c}from"./FooterActions.js";import u from"./MergeFeaturesList.js";import{loadNoticesComponents as m,Notices as p}from"./Notices.js";import{loadPanelContentComponents as d,PanelContentSection as f,PanelContentSectionGroup as g,PanelContent as h}from"./PanelContent.js";import k from"./PendingFeatureList.js";import{loadCalciteComponents as w}from"../../support/componentsUtils.js";import{Heading as b,incrementHeadingLevel as v}from"../../support/Heading.js";import{classes as F}from"../../support/widgetUtils.js";import{tsx as y,tsxFragment as j}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const A=()=>Promise.all([w({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),action:()=>import("@esri/calcite-components/dist/components/calcite-action")}),l(),m(),d()]);function C(e){const{editorViewModel:r,headingLevel:l,messages:m,renderAttachments:d,renderFeatureForm:w,renderBatchAttributeForm:F,renderSketchToolbar:A}=e,{activeFeatureCount:C,activeLeafWorkflow:M,activeWorkflow:T,formViewModel:x}=r;if(!M||!T||!x)return null;const z=a(x),B=o(M)&&!M.data.selectedPendingFeature||i(M)&&!M.activeFeature,D=n(M),I="shouldShowAttachments"in M&&M.shouldShowAttachments&&!z&&!x.activeRelationshipInput&&!x.activeAssociationInput,V=z?x.activeForm.inputs:x.inputs,W=o(M)&&V.every(e=>!e.visible)&&!I,H=!B&&!W,P=s(M)?F:w,U=W?y(f,null,y(k,{headingLevel:l,key:"pending-feature-list",workflow:M})):y(j,null,y(p,{activeFeatureCount:C,messages:m,workflow:T}),D?y(f,{class:t.mergeFeaturesListSection,key:"panel-section-merge"},y(u,{headingLevel:l,key:"merge-features-list",workflow:M})):void 0,y(f,{key:"panel-content-section-main"},y(g,null,B?y(k,{headingLevel:l,key:"pending-feature-list",workflow:M}):P(),I?y("div",{key:"attachments"},y(b,{level:v(l)},m.attachments),d()):null)));return y(j,null,H?S(M,e):void 0,W?A?.():void 0,y(h,{key:"attribute-panel-content"},U),y(c,{buttons:L(e)}))}function S(e,o){const i=[];if(o.visibleElements.zoomToButton&&o.editorViewModel.canZoomTo&&i.push(y("calcite-action",{alignment:"center",appearance:"transparent",icon:"zoom-to-object",key:"zoom-to-button",onclick:()=>o.editorViewModel.zoomTo(),scale:"s",text:o.messages.zoomTo,title:o.messages.zoomTo})),r(e)&&e.editorItem.supportsSplitFeatureWorkflow&&o.onSplit){const{onSplit:e,messages:t}=o;i.push(y("calcite-action",{icon:"split-geometry",key:"split-button",onclick:e,scale:"s",text:t.split,title:t.split}))}if(s(e)&&e.supportsMergeFeaturesWorkflow&&o.onMerge){const{onMerge:e,messages:t}=o;i.push(y("calcite-action",{icon:"merge",key:"merge-button",onclick:e,scale:"s",text:t.mergeFeatures,title:t.mergeFeatures}))}return i.length>0?y("calcite-action-bar",{class:F(t.sketchContainer,t.updateActionBar),"data-testid":"update-feature-panel-action-bar",expandDisabled:!0,layout:"horizontal"},i):void 0}function L({editorViewModel:t,messages:o,messagesCommon:i,onDelete:n,onDeleteAssociation:s,onSave:a}){const{activeFeatureCount:r,activeLeafWorkflow:l,syncing:c}=t;if(!l)return[];const{page:u}=t;if("viewing-associated-features"===u||"viewing-associated-layers"===u)return[{appearance:"outline",onClick:()=>{const{featureFormViewModel:e}=t;null!=e?.associationId&&(e.associationId=null)},disabled:c,label:i.cancel,type:"button"}];const m=[],p=r>1?o.multiFeature:o.singleFeature,d=!l.allowSave||c,f=e(M(l,p),{count:r});m.push({appearance:"solid",onClick:a,disabled:d,label:f,type:"button"});const g={appearance:"outline",disabled:c,kind:"danger",label:e(p.delete,{count:r}),type:"button"};return t.shouldShowDeleteButton&&!t.featureFormHasAssociation&&n&&m.push({...g,onClick:n}),t.featureFormHasAssociation&&!t.shouldShowDeleteButton&&s&&m.push({...g,onClick:s,label:o.deleteAssociationTitle}),t.featureFormHasAssociation&&t.shouldShowDeleteButton&&s&&n&&m.push({...g,primaryLabel:i.delete,primaryText:i.delete,onClick:n,dropdownItems:[{onClick:s,label:o.deleteAssociationTitle}],type:"split-button"}),m}function M(e,t){switch(!0){case o(e):return t.create;case r(e):case s(e):return t.update;default:return t.submit}}export{C as UpdateFeaturePanelContent,A as loadUpdateFeaturePanelContentComponents};
5
+ import{substitute as e}from"../../../intl/substitute.js";import{css as t}from"../css.js";import{isCreateFeaturesWorkflow as o,isSplitFeatureWorkflow as i,isMergeFeaturesWorkflow as n,isUpdateFeaturesWorkflow as s,isBatchAttributeFormViewModel as a,isUpdateFeatureWorkflow as r}from"../workflowUtils.js";import{loadFooterActionsComponents as l,FooterActions as c}from"./FooterActions.js";import u from"./MergeFeaturesList.js";import{loadNoticesComponents as p,Notices as m}from"./Notices.js";import{loadPanelContentComponents as d,PanelContentSection as f,PanelContentSectionGroup as g,PanelContent as w}from"./PanelContent.js";import h from"./PendingFeatureList.js";import{loadCalciteComponents as k}from"../../support/componentsUtils.js";import{Heading as b,incrementHeadingLevel as v}from"../../support/Heading.js";import{tsx as F,tsxFragment as y}from"../../support/widget.js";import{classes as A}from"../../support/widgetUtils.js";const j=()=>Promise.all([k({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),action:()=>import("@esri/calcite-components/dist/components/calcite-action")}),l(),p(),d()]);function C(e){const{editorViewModel:r,headingLevel:l,messages:p,renderAttachments:d,renderFeatureForm:k,renderBatchAttributeForm:A,renderSketchToolbar:j}=e,{activeFeatureCount:C,activeLeafWorkflow:L,activeWorkflow:T,formViewModel:V}=r;if(!L||!T||!V)return null;const z=a(V),I=o(L)&&!L.data.selectedPendingFeature||i(L)&&!L.activeFeature,x=n(L),B="shouldShowAttachments"in L&&L.shouldShowAttachments&&!z&&!V.activeRelationshipInput&&!V.activeAssociationInput,D=z?V.activeForm.inputs:V.inputs,W=o(L)&&D.every(e=>!e.visible)&&!B,H=null!=r.featureFormViewModel?.activeAssociationInput,P=!I&&!W&&!H,U=s(L)?A:k,E=W?F(f,null,F(h,{headingLevel:l,key:"pending-feature-list",workflow:L})):F(y,null,F(m,{activeFeatureCount:C,messages:p,workflow:T}),x?F(f,{class:t.mergeFeaturesListSection,key:"panel-section-merge"},F(u,{headingLevel:l,key:"merge-features-list",workflow:L})):void 0,F(f,{key:"panel-content-section-main"},F(g,null,I?F(h,{headingLevel:l,key:"pending-feature-list",workflow:L}):U(),B?F("div",{key:"attachments"},F(b,{level:v(l)},p.attachments),d()):null)));return F(y,null,P?M(L,e):void 0,W?j?.():void 0,F(w,{key:"attribute-panel-content"},E),F(c,{buttons:S(e)}))}function M(e,o){const i=[],n="3d"===o.editorViewModel.view?.type;if(o.visibleElements.zoomToButton&&o.editorViewModel.canZoomTo&&i.push(F("calcite-action",{alignment:"center",appearance:"transparent",icon:"zoom-to-object",key:"zoom-to-button",onclick:()=>o.editorViewModel.zoomTo(),scale:"s",text:o.messages.zoomTo,title:o.messages.zoomTo})),r(e)&&e.editorItem.supportsSplitFeatureWorkflow&&!n&&o.onSplit){const{onSplit:e,messages:t}=o;i.push(F("calcite-action",{icon:"split-geometry",key:"split-button",onclick:e,scale:"s",text:t.split,title:t.split}))}if(s(e)&&e.supportsMergeFeaturesWorkflow&&!n&&o.onMerge){const{onMerge:e,messages:t}=o;i.push(F("calcite-action",{icon:"merge",key:"merge-button",onclick:e,scale:"s",text:t.mergeFeatures,title:t.mergeFeatures}))}return i.length>0?F("calcite-action-bar",{class:A(t.sketchContainer,t.updateActionBar),"data-testid":"update-feature-panel-action-bar",expandDisabled:!0,layout:"horizontal"},i):void 0}function S({editorViewModel:t,messages:o,messagesCommon:i,onDelete:n,onDeleteAssociation:s,onSave:a}){const{activeFeatureCount:r,activeLeafWorkflow:l,syncing:c}=t;if(!l)return[];const{page:u}=t;if("viewing-associated-features"===u||"viewing-associated-layers"===u)return[{appearance:"outline",onClick:()=>{const{featureFormViewModel:e}=t;null!=e?.associationId&&(e.associationId=null)},disabled:c,label:i.cancel,type:"button"}];const p=[],m=r>1?o.multiFeature:o.singleFeature,d=!l.allowSave||c,f=e(m[l.saveActionLabel],{count:r});p.push({appearance:"solid",onClick:a,disabled:d,label:f,type:"button"});const g={appearance:"outline",disabled:c,kind:"danger",label:e(m.delete,{count:r}),type:"button"};return t.shouldShowDeleteButton&&!t.featureFormHasAssociation&&n&&p.push({...g,onClick:n}),t.featureFormHasAssociation&&!t.shouldShowDeleteButton&&s&&p.push({...g,onClick:s,label:o.deleteAssociationTitle}),t.featureFormHasAssociation&&t.shouldShowDeleteButton&&s&&n&&p.push({...g,primaryLabel:i.delete,primaryText:i.delete,onClick:n,dropdownItems:[{onClick:s,label:o.deleteAssociationTitle}],type:"split-button"}),p}export{C as UpdateFeaturePanelContent,j as loadUpdateFeaturePanelContentComponents};
@@ -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 e from"../../../core/Error.js";import{Convert3DFailedError as t,MultipleModelsError as s,NoModelError as o}from"../../../layers/graphics/sources/support/uploadAssetErrors.js";import{loadFooterActionsComponents as r,FooterActions as i}from"./FooterActions.js";import{loadPanelContentComponents as l,PanelContent as n,PanelContentSection as a}from"./PanelContent.js";import{loadCalciteComponents as c}from"../../support/componentsUtils.js";import{classes as p}from"../../support/widgetUtils.js";import{tsx as d,tsxFragment as u}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const m="esri-editor__upload-details",f={base:m,status:`${m}__status`,titleWrapper:`${m}__title-wrapper`,title:`${m}__title`,description:`${m}__description`,loader:`${m}__loader`,iconSuccess:`${m}__icon ${m}__icon--success`,iconError:`${m}__icon ${m}__icon--error`,fileList:`${m}__file-list`,file:`${m}__file`,fileIcon:`${m}__file-icon`,fileName:`${m}__file-name`},_=()=>Promise.all([c({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")}),r(),l()]);function g(e){const{messages:t,key:s,upload:o}=e;return d(u,null,d(n,{key:s??"upload-details"},d(a,null,y(e))),"error"===o.state?d(i,{buttons:[{onClick:()=>o.retry(),label:t.modelUploads.error.uploadNew,iconStart:"upload-to",type:"button"}],key:"upload-details-footer-actions"}):null)}function y(e){const t=k(e);return t?d("div",{class:f.base,"data-testid":"upload-details",key:"upload-details-content"},d("div",{class:f.status,key:"status"},t.iconContent,d("div",{class:f.titleWrapper,key:"text"},d("div",{class:f.title,key:"title"},t.title),d("div",{class:f.description,key:"description"},t.description))),h(e.upload)):null}function k({helpMessage:e,messages:t,upload:s}){switch(s.state){case"pending":{const{title:e,description:o}=t.modelUploads.pending;return{title:e,description:o,iconContent:d("calcite-loader",{"aria-hidden":"true",class:f.loader,label:"",scale:"s",type:"determinate",value:Math.min(Math.round(100*s.progress),1===s.progress?100:99)})}}case"success":{const{title:s}=t.modelUploads.success;return{title:s,description:e||t.helpMessages3d.mesh,iconContent:d("calcite-icon",{class:p(f.iconSuccess),icon:"check",scale:"l"})}}case"error":{const{title:e}=t.modelUploads.error;return{title:e,description:$(s.error,t),iconContent:d("calcite-icon",{class:p(f.iconError),icon:"exclamation-mark-circle",scale:"l"})}}default:return null}}function $(r,i){if(!r)return null;const l=i.modelUploads.error.messages;switch(r.constructor){case o:return l.noModel;case s:return l.multipleModels;case t:return l.conversionFailed;case e:switch(r.name){case"gltf-loader-error":case"gltf-loader-invalid-glb":return l.loadFailed;case"gltf-loader-unsupported-feature":case"mesh-load-external:draco-not-supported":return l.unsupportedFeature;case"gltf-loader-request-error":return l.resourceRequestFailed;default:return l.default}default:return l.default}}function h(e){return d("div",{class:f.fileList,key:"file-list"},e.files.map(e=>d("div",{class:f.file,key:`file-${e.name}`},d("calcite-icon",{class:f.fileIcon,icon:j(e),scale:"s"}),d("span",{class:f.fileName},v(e.name)))))}function v(e){return e.split("/").pop()?.split("\\").pop()??""}function j(e){const t=e.name.split(".").pop()?.toLowerCase();return(t?U[t]:null)??b}const b="file",w="file-shape",C="file-image",U={glb:w,gltf:w,jpeg:C,jpg:C,png:C,svg:C,zip:"file-zip"};export{g as UploadDetails,f as css,_ as loadUploadDetailsComponents};
5
+ import e from"../../../core/Error.js";import{Convert3DFailedError as t,MultipleModelsError as s,NoModelError as o}from"../../../layers/graphics/sources/support/uploadAssetErrors.js";import{loadFooterActionsComponents as r,FooterActions as l}from"./FooterActions.js";import{loadPanelContentComponents as i,PanelContent as n,PanelContentSection as a}from"./PanelContent.js";import{loadCalciteComponents as c}from"../../support/componentsUtils.js";import{tsx as p,tsxFragment as d,classes as u}from"../../support/widget.js";const f="esri-editor__upload-details",m={base:f,status:`${f}__status`,titleWrapper:`${f}__title-wrapper`,title:`${f}__title`,description:`${f}__description`,loader:`${f}__loader`,iconSuccess:`${f}__icon ${f}__icon--success`,iconError:`${f}__icon ${f}__icon--error`,fileList:`${f}__file-list`,file:`${f}__file`,fileIcon:`${f}__file-icon`,fileName:`${f}__file-name`},_=()=>Promise.all([c({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")}),r(),i()]);function g(e){const{messages:t,key:s,upload:o}=e;return p(d,null,p(n,{key:s??"upload-details"},p(a,null,y(e))),"error"===o.state?p(l,{buttons:[{onClick:()=>o.retry(),label:t.modelUploads.error.uploadNew,iconStart:"upload-to",type:"button"}],key:"upload-details-footer-actions"}):null)}function y(e){const t=$(e);return t?p("div",{class:m.base,"data-testid":"upload-details",key:"upload-details-content"},p("div",{class:m.status,key:"status"},t.iconContent,p("div",{class:m.titleWrapper,key:"text"},p("div",{class:m.title,key:"title"},t.title),p("div",{class:m.description,key:"description"},t.description))),k(e.upload)):null}function $({helpMessage:e,messages:t,upload:s}){switch(s.state){case"pending":{const{title:e,description:o}=t.modelUploads.pending;return{title:e,description:o,iconContent:p("calcite-loader",{"aria-hidden":"true",class:m.loader,label:"",scale:"s",type:"determinate",value:Math.min(Math.round(100*s.progress),1===s.progress?100:99)})}}case"success":{const{title:s}=t.modelUploads.success;return{title:s,description:e||t.helpMessages3d.mesh,iconContent:p("calcite-icon",{class:u(m.iconSuccess),icon:"check",scale:"l"})}}case"error":{const{title:e}=t.modelUploads.error;return{title:e,description:h(s.error,t),iconContent:p("calcite-icon",{class:u(m.iconError),icon:"exclamation-mark-circle",scale:"l"})}}default:return null}}function h(r,l){if(!r)return null;const i=l.modelUploads.error.messages;switch(r.constructor){case o:return i.noModel;case s:return i.multipleModels;case t:return i.conversionFailed;case e:switch(r.name){case"gltf-loader-error":case"gltf-loader-invalid-glb":return i.loadFailed;case"gltf-loader-unsupported-feature":case"mesh-load-external:draco-not-supported":return i.unsupportedFeature;case"gltf-loader-request-error":return i.resourceRequestFailed;default:return i.default}default:return i.default}}function k(e){return p("div",{class:m.fileList,key:"file-list"},e.files.map(e=>p("div",{class:m.file,key:`file-${e.name}`},p("calcite-icon",{class:m.fileIcon,icon:b(e),scale:"s"}),p("span",{class:m.fileName},v(e.name)))))}function v(e){return e.split("/").pop()?.split("\\").pop()??""}function b(e){const t=e.name.split(".").pop()?.toLowerCase();return(t?M[t]:null)??j}const j="file",w="file-shape",C="file-image",M={glb:w,gltf:w,jpeg:C,jpg:C,png:C,svg:C,zip:"file-zip"};export{g as UploadDetails,m as css,_ as loadUploadDetailsComponents};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../../../../../core/Accessor.js";import{pushIfSome as t}from"../../../../../core/arrayUtils.js";import o from"../../../../../core/Error.js";import i from"../../../../../core/Logger.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators/subclass.js";const l=()=>i.getLogger("esri.widgets.Editor.components.workflowAdapters.pendingFeatureList.SplitFeatureWorkflowPendingFeatureListAdapter");let n=class extends r{constructor(e){super(),this._workflow=e.workflow}get allowCancel(){return!1}get layer(){return this._workflow.data.editorItem?.layer}get features(){const{existingFeatureEdits:e,newFeatureEdits:r}=this._workflow.data,o=[];return t(o,e?.feature,r?.feature),o}cancelFeature(){l().error(new o("editing:cannot-cancel-feature","Cannot cancel or remove features in a SplitFeatureWorkflow"))}clearHighlights(){this._workflow.clearHighlights()}highlightFeature(e){this._workflow.highlightFeature(e)}getFeatureTitle(e){return this._workflow.data.getEditsForFeature(e)?.displayTitle}isSubmittable(e){return this._workflow.data.getEditsForFeature(e)?.submittable??!0}isVisible(){return!0}onSelectFeature(e){this._workflow.setActiveFeature(e)}zoomToFeature(e){this._workflow.data.viewModel.zoomTo(e)}};e([s()],n.prototype,"_workflow",void 0),n=e([a("esri.widgets.Editor.components.workflowAdapters.pendingFeatureList.SplitFeatureWorkflowPendingFeatureListAdapter")],n);export{n as SplitFeatureWorkflowPendingFeatureListAdapter};
5
+ import{__decorate as e}from"tslib";import r from"../../../../../core/Accessor.js";import{pushIfSome as t}from"../../../../../core/arrayUtils.js";import o from"../../../../../core/Error.js";import a from"../../../../../core/Logger.js";import{property as i}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";const l=()=>a.getLogger("esri.widgets.Editor.components.workflowAdapters.pendingFeatureList.SplitFeatureWorkflowPendingFeatureListAdapter");let u=class extends r{constructor(e){super(),this._workflow=e.workflow}get allowCancel(){return!1}get layer(){return this._workflow.data.editorItem?.layer}get features(){const{existingFeatureEdits:e,newFeatureEdits:r}=this._workflow.data,o=[];return t(o,e?.feature,r?.feature),o}cancelFeature(){l().error(new o("editing:cannot-cancel-feature","Cannot cancel or remove features in a SplitFeatureWorkflow"))}clearHighlights(){this._workflow.data.temporaryHighlightFeature=null}highlightFeature(e){this._workflow.data.temporaryHighlightFeature=e}getFeatureTitle(e){return this._workflow.data.getEditsForFeature(e)?.displayTitle}isSubmittable(e){return this._workflow.data.getEditsForFeature(e)?.submittable??!0}isVisible(){return!0}onSelectFeature(e){this._workflow.setActiveFeature(e)}zoomToFeature(e){this._workflow.data.viewModel.zoomTo(e)}};e([i()],u.prototype,"_workflow",void 0),u=e([s("esri.widgets.Editor.components.workflowAdapters.pendingFeatureList.SplitFeatureWorkflowPendingFeatureListAdapter")],u);export{u as SplitFeatureWorkflowPendingFeatureListAdapter};
@@ -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{unique as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{getGraphicLayer as r}from"../../../graphic/graphicOriginUtils.js";class o extends t{constructor(e=!1){super("editing:fetch-feature",`Failed to fetch the full ${e?"features":"feature"} from the service.`)}}class s extends t{constructor(e){super("editing:not-enough-features",`At least ${e} ${1===e?"feature is":"features are"} required to perform this operation.`)}}class i extends t{constructor(){super("editing:invalid-argument","Key feature must be one of the features being merged")}}class n extends t{constructor(){super("editing:unsupported-workflow","Merge features workflow requires a layer with geometry type 'polygon', 'polyline', or 'multipoint' that allows deleting features and updating their geometries.")}}class a extends t{constructor(){super("editing:multiple-layers-not-supported","Features must belong to the same layer.")}}class u extends t{constructor(){super("editing:layer-required","The feature must be associated with a layer to start a split feature workflow.")}}class l extends t{constructor(){super("editing:unsupported-workflow","Split feature workflow requires a layer with geometry type 'polygon', 'polyline', or 'multipoint' that allows creating features and updating their geometries.")}}function p(t){if(e(t.map(e=>r(e))).length>1)throw new a}function f(e){if(!e.supportsMergeFeaturesWorkflow)throw new n}function c(e,t){if(e.length<t)throw new s(t)}function g(e){if(!e.supportsSplitFeatureWorkflow)throw new l}export{o as FetchFullFeatureError,s as InsufficientFeatureCountError,i as InvalidKeyFeatureError,n as MergeWorkflowNotSupportedError,u as MissingOriginLayerError,a as MultipleSourceLayersError,l as SplitWorkflowNotSupportedError,p as assertFeaturesAreFromSameLayer,f as assertMergeWorkflowCapabilities,c as assertMinimumFeatureCount,g as assertSplitWorkflowCapabilities};
5
+ import{unique as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{getGraphicLayer as r}from"../../../graphic/graphicOriginUtils.js";class o extends t{constructor(e=!1){super("editing:fetch-feature",`Failed to fetch the full ${e?"features":"feature"} from the service.`)}}class s extends t{constructor(e){super("editing:not-enough-features",`At least ${e} ${1===e?"feature is":"features are"} required to perform this operation.`)}}class i extends t{constructor(){super("editing:invalid-argument","Key feature must be one of the features being merged")}}class n extends t{constructor(){super("editing:unsupported-workflow","Merge features workflow requires a layer with geometry type 'polygon', 'polyline', or 'multipoint' that allows deleting features and updating their geometries.")}}class u extends t{constructor(){super("editing:multiple-layers-not-supported","Features must belong to the same layer.")}}class a extends t{constructor(){super("editing:layer-required","The feature must be associated with a layer to start a split feature workflow.")}}class l extends t{constructor(e){super("editing:unsupported-in-3d",`Workflow type ${e} is not supported in 3D.`)}}class p extends t{constructor(){super("editing:unsupported-workflow","Split feature workflow requires a layer with geometry type 'polygon', 'polyline', or 'multipoint' that allows creating features and updating their geometries.")}}function f(t){if(e(t.map(e=>r(e))).length>1)throw new u}function c(e){if(!e.supportsMergeFeaturesWorkflow)throw new n}function d(e,t){if(e.length<t)throw new s(t)}function g(e){if(!e.supportsSplitFeatureWorkflow)throw new p}function w(e,t){if("3d"===e.view?.type)throw new l(t)}export{o as FetchFullFeatureError,s as InsufficientFeatureCountError,i as InvalidKeyFeatureError,n as MergeWorkflowNotSupportedError,a as MissingOriginLayerError,u as MultipleSourceLayersError,l as NotSupportedIn3DError,p as SplitWorkflowNotSupportedError,f as assertFeaturesAreFromSameLayer,c as assertMergeWorkflowCapabilities,d as assertMinimumFeatureCount,g as assertSplitWorkflowCapabilities,w as assertViewNot3D};
package/widgets/Editor.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../intl.js";import{deprecatedFunction as t}from"../core/deprecate.js";import i from"../core/Logger.js";import{destroyMaybe as s,abortMaybe as o,mappedFind as r}from"../core/maybe.js";import{createResolver as a}from"../core/promiseUtils.js";import{watch as n,on as l,when as c,initial as d}from"../core/reactiveUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as p}from"../core/support/UpdatingHandles.js";import u from"../views/interactive/sketch/SketchValueOptions.js";import g from"./Attachments.js";import w from"./BatchAttributeForm.js";import _ from"./FeatureForm.js";import v from"./FeatureTemplates.js";import f from"./Spinner.js";import y from"./Widget.js";import{VisibleElements as b}from"./BatchAttributeForm/VisibleElements.js";import{css as k}from"./Editor/css.js";import F from"./Editor/EditorViewModel.js";import{isModelUpload as A}from"./Editor/modelUploadUtils.js";import M from"./Editor/VisibleElements.js";import{isFeatureFormViewModel as T,isUpdateWorkflow as S,isUpdateFeaturesWorkflow as C,isUpdateRecordWorkflow as L,isBatchAttributeFormViewModel as E}from"./Editor/workflowUtils.js";import{loadCreateFeaturesPanelContentComponents as W,CreateFeaturesPanelContent as P}from"./Editor/components/CreateFeaturesPanelContent.js";import{loadFeatureListComponents as I,FeatureList as j}from"./Editor/components/FeatureList.js";import{loadFooterActionsComponents as U,FooterActions as V}from"./Editor/components/FooterActions.js";import{loadNoticesComponents as x,Notice as D}from"./Editor/components/Notices.js";import{loadPanelContentComponents as B,PanelContent as O,PanelContentSection as N,PanelContentMessage as H}from"./Editor/components/PanelContent.js";import{PanelToolbar as G,loadPanelToolbarComponents as R}from"./Editor/components/PanelToolbar.js";import{loadPromptComponents as z,Prompt as q}from"./Editor/components/Prompt.js";import{loadUpdateFeaturePanelContentComponents as K,UpdateFeaturePanelContent as Z}from"./Editor/components/UpdateFeaturePanelContent.js";import{loadUploadDetailsComponents as $,UploadDetails as J}from"./Editor/components/UploadDetails.js";import{CreateToolVisibilityMap as Q}from"./Sketch/CreateToolVisibilityMap.js";import{SelectionToolVisibilityMap as X}from"./Sketch/SelectionToolVisibilityMap.js";import{VisibleElements as Y}from"./Sketch/VisibleElements.js";import{loadCalciteComponents as ee}from"./support/componentsUtils.js";import{globalCss as te}from"./support/globalCss.js";import{incrementHeadingLevel as ie,Heading as se}from"./support/Heading.js";import{renderItem as oe}from"./support/ItemList.js";import{connectDelayedLoading as re}from"./support/loaderUtils.js";import ae from"./support/SelectionList.js";import ne from"./support/SelectionToolbar.js";import"./support/widgetUtils.js";import{messageBundle as le}from"./support/decorators/messageBundle.js";import{vmEvent as ce}from"./support/decorators/vmEvent.js";import{tsx as de}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import he from"./support/SelectionList/VisibleElements.js";import me from"./support/SelectionToolbar/VisibleElements.js";import{substitute as pe}from"../intl/substitute.js";const ue=Symbol("sketch-setup-handles");let ge=class extends y{constructor(e,t){super(e,t),this._batchAttributeForm=new w({visibleElements:new b({loadingIndicator:!1})}),this._featureForm=new _,this._sketchToolbar=null,this._attachments=new g({visibleElements:{addSubmitButton:!1,cancelAddButton:!1,cancelUpdateButton:!1,deleteButton:!1,errorMessage:!1,progressBar:!1,updateButton:!1}}),this._associationItemList=null,this._associationSettings=null,this._featureTemplates=new v({enableListScroll:!1,renderItemContentEnd:e=>e.supportsUpload?de("calcite-icon",{class:k.templateItemContentEnd,icon:"upload-to",key:"upload-icon"}):null,renderItemLabel:e=>e.label,renderCustomGroupContent:e=>this._renderCustomTemplateGroupContent(e)}),this._filterText="",this._prompt=null,this._spinner=new f,this._loading=!1,this._selectionList=new ae({displayMode:"layer",itemActionConfigs:this._selectionListItemActionConfigs,onListItemSelect:({item:e})=>this._onSelectionListItemSelect(e),visibleElements:new he({header:!1})}),this._selectionToolbar=new ne({visibleElements:new me({chip:!1})}),this._updatingHandles=new p,this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.messagesTemplates=null,this.messagesFeature=null,this.supportingWidgetDefaults=null,this.viewModel=new F,this.visibleElements=new M,this._renderAttachments=()=>this._attachments.render(),this._renderFeatureForm=()=>this._featureForm.render(),this._renderBatchAttributeForm=()=>this._batchAttributeForm.render(),this._renderFeatureTemplates=()=>this._featureTemplates.render(),this._renderSelectionList=()=>this._selectionList.render(),this._renderSelectionToolbar=()=>this._selectionToolbar.render(),this._renderSketch=()=>this._sketchToolbar?de("div",{class:k.sketchContainer,key:"editor-sketch-container"},this._sketchToolbar?.render()):void 0,this._renderSelectIcon=()=>de("calcite-icon",{icon:"cursor",slot:"content-start"}),this.EditorPanel=({heading:e,key:t,selected:i},...s)=>{const{visibleElements:o}=this;return de("calcite-flow-item",{closable:!1,heading:e,headingLevel:this.headingLevel,key:t,loading:this._loading,selected:i,onCalciteFlowItemBack:this._onBack},o.settingsMenu?de(G,{editorViewModel:this.viewModel,messagesCommon:this.messagesCommon,visibleElements:o}):null,...s)},this._showDiscardEditsPrompt=()=>{const{messages:e,activeWorkflow:t}=this,i={title:e.cancelEditTitle,message:e.cancelEditWarningMessage,yesLabel:e.discardEdits,noLabel:e.continueEditing};return"create-features"===t?.type&&A(t.data.creationInfo)?this._showPromptAndWait("success"===t.data.upload?.state?e.modelUploads.cancelPlacementPrompt:e.modelUploads.cancelUploadPrompt):"update"===t?.type&&T(t.formViewModel)&&t.formViewModel.activeAssociation?this._showPromptAndWait({...i,message:e.cancelAssociationEditWarning}):this._showPromptAndWait(i)},this._showGenericCancelPrompt=()=>{const{messages:e,messagesCommon:t}=this;return this._showPromptAndWait({title:e.cancelRequestTitle,message:e.cancelRequestWarningMessage,yesLabel:t.form.yes,noLabel:t.form.no})},this._showPrompt=e=>{this._prompt?.cancel?.(),this._prompt=e},this._clearPrompt=()=>{this._prompt=null},this._onSave=()=>{this.viewModel.saveWorkflow()},this._onMerge=()=>{const{activeWorkflow:e}=this.viewModel;if(S(e)){const t=e.activeWorkflow;C(t)&&e.startMergingFeatures(t.viewGraphics)}},this._onSplit=()=>{const{activeWorkflow:e}=this.viewModel;if(S(e)){const t=e.activeWorkflow;if(L(t)){const i=t.data.edits.feature;i&&e.startSplittingFeature(i)}}},this._onDelete=()=>{const e=this.viewModel.activeFeatureCount,t=e>1?this.messages.multiFeature:this.messages.singleFeature;this._showPrompt({title:t.deleteWarningTitle,message:t.deleteWarningMessage,context:"danger",actions:{primary:{label:pe(t.delete,{count:e}),action:()=>{this.deleteFeatures(),this._clearPrompt()}},secondary:{label:t.keep,action:this._clearPrompt}}})},this._onDeleteAssociation=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAssociationTitle,message:e.deleteAssociationMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{this.deleteAssociationFromWorkflow(),this._clearPrompt()}},secondary:{label:e.keepAssociation,action:this._clearPrompt}}})},this._onToggleUpdateWorkflow=()=>this.viewModel.toggleUpdateWorkflow(),this._onBack=e=>(e?.stopPropagation(),this.viewModel.back()),this._onAttachmentAdd=()=>{const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type||"update"===e.type&&"create-features"===e.activeWorkflow?.type?(this._attachments.addFile(),e.back()):this._attachments.addAttachment().then(()=>e.back()))},this._onAttachmentUpdate=()=>{const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type?(this._attachments.updateFile(),e.back()):this._attachments.updateAttachment().then(()=>e.back()))},this._onAttachmentDelete=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAttachmentWarningTitle,message:e.deleteAttachmentWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:this._onAttachmentDeleteConfirm},secondary:{label:e.keepAttachment,action:this._clearPrompt}}})},this._onAttachmentDeleteConfirm=async()=>{const e=this._attachments,{activeWorkflow:t}=this.viewModel;t&&("create-features"===t.type?e.deleteFile():(await e.deleteAttachment(e.viewModel.activeAttachmentInfo),this._clearPrompt()),await t.back(),this._clearPrompt())},this._onAttachmentsError=e=>{this._showPrompt({title:this.messages.errorWarningTitle,message:e.message,context:"warning",actions:{primary:{label:this.messagesCommon.form.ok,action:this._clearPrompt}}})}}initialize(){this._featureForm.showPrompt=this._showPrompt,this._featureForm.clearPrompt=this._clearPrompt,this.addHandles([n(()=>ie(this.headingLevel),e=>{this._featureForm.headingLevel=e,this._featureTemplates.headingLevel=e},d),l(()=>this.viewModel.activeWorkflow,"cancel-request",({controller:e})=>{(this.viewModel.hasPendingEdits?this._showDiscardEditsPrompt():this._showGenericCancelPrompt()).then(t=>t?e.allow():e.deny())}),c(()=>this.viewModel.formViewModel,e=>{E(e)?this._batchAttributeForm.viewModel=e:this._featureForm.viewModel=e},d),c(()=>this.viewModel.utilityNetworkAssociationAddAssociationViewModel,e=>{this._associationItemList?this._associationItemList.viewModel=e:this._updatingHandles.addPromise(this._initializeAssociationItemList(e))},d),c(()=>this.viewModel.utilityNetworkAssociationAddAssociationViewModel?.association,()=>{this._setUpAssociationSettings()}),n(()=>[this.viewModel,this.viewModel?.attachmentsViewModel,this.viewModel?.featureTemplatesViewModel,this.viewModel?.spinnerViewModel,this.viewModel?.selectionListViewModel,this.viewModel?.selectionToolbarViewModel],([e,t,i,s,o,r])=>{this._attachments.viewModel=t,this._featureTemplates.viewModel=i,this._spinner.viewModel=s,this._selectionList.viewModel=o,this._selectionToolbar.viewModel=r,e.showDiscardEditsPrompt=this._showDiscardEditsPrompt},d),n(()=>this.view,(e,t)=>{const i=`editor-${this.id}-spinner`;t?.ui.remove(this._spinner,i),e?.ui.add(this._spinner,{key:i,position:"manual"}),this._associationItemList&&(this._associationItemList.view=e)},d),n(()=>[this.supportingWidgetDefaults,this.viewModel.sketchViewModel],([e])=>{e&&(this._featureForm.set(e.featureForm),this._attachments.set(e.attachments),this._featureTemplates.set(e.featureTemplates),this.viewModel.sketchViewModel?.set(e.sketch))},d),c(()=>this._attachments?.error,e=>this._onAttachmentsError(e)),c(()=>this._selectionListItemActionConfigs,()=>{this._selectionList.itemActionConfigs=this._selectionListItemActionConfigs}),c(()=>this.viewModel?.failures,e=>{const{messages:t}=this,[{error:i,retry:s,cancel:o}]=e;this._showPrompt({title:t.errorWarningTitle,message:pe(t.errorWarningMessageTemplate,{errorMessage:i.message}),context:"warning",actions:{primary:{label:t.retry,action:()=>{s(),this._clearPrompt()}},secondary:{label:t.ignore,action:()=>{o(),this._clearPrompt()}}}})}),n(()=>this.viewModel?.state,e=>{switch(e){case"awaiting-feature-to-update":case"ready":case"disabled":this._filterText="",this._featureTemplates.filterText=""}}),n(()=>this.viewModel.featureFormDisabled,e=>this._featureForm.disabled=e),n(()=>this.visibleElements.sketch,()=>this._setupSketch(),d),re({getLoading:()=>{const{viewModel:e}=this;return e.syncing||e.updating||this._attachments.submitting||this._updatingHandles.updating},setEffectiveLoading:e=>{this._loading=e}})])}destroy(){this._associationItemList?.destroy(),this._associationSettings?.destroy(),this._selectionList.destroy(),this._selectionToolbar.destroy(),this._attachments.destroy(),this._batchAttributeForm.destroy(),this._featureForm.destroy(),this._featureTemplates.destroy(),this._spinner.destroy(),this._sketchToolbar=s(this._sketchToolbar),this._sketchImportAbortController=o(this._sketchImportAbortController)}loadDependencies(){return Promise.all([ee({flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list")}),W(),I(),U(),x(),B(),R(),z(),K(),$()])}get _hasInvalidBatchSelection(){return this._hasSelectionFromMultipleLayers||this._selectionCountExceedsMaximum||0===this._selectionList.visibleFeatureCount}get _hasSelectionFromMultipleLayers(){return this._selectionList.visibleLayerCount>1}get _deleteButtonCommonInfo(){return{appearance:"outline",kind:"danger"}}get _selectionCountExceedsMaximum(){const e=this._batchAttributeForm.maximumFeatureCount,{activeLayerItem:t,effectiveCount:i,filterText:s,visibleFeatureCount:o}=this._selectionList;return null!=s&&""!==s?o>e:t?t.total>e:i>e}get _selectionListItemActionConfigs(){const{messages:e}=this;return[{label:e?.batchEditing?.editThisFeature,icon:"edit-attributes",type:"feature",callback:({item:e})=>this._onSelectionListMenuItemSelect(e,"update")},{label:e?.batchEditing.editTheseFeatures,icon:"edit-attributes",type:"layer",callback:({item:e})=>this._onSelectionListMenuItemSelect(e,"update")},{label:e?.batchEditing.mergeTheseFeatures,icon:"merge",type:"layer",callback:({item:e})=>this._onSelectionListMenuItemSelect(e,"merge")}]}get _visibleSelectionCount(){const{activeLayerItem:e,effectiveCount:t,filterText:i,visibleFeatureCount:s}=this._selectionList;return null!=i&&""!==i?s:e?e.total:t}get activeWorkflow(){return this.viewModel.activeWorkflow}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get hideTemplatesForInactiveLayers(){return this.viewModel.hideTemplatesForInactiveLayers}set hideTemplatesForInactiveLayers(e){this.viewModel.hideTemplatesForInactiveLayers=e}get icon(){return"pencil"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(e){this.viewModel.labelOptions=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(e){this.viewModel.tooltipOptions=e}get valueOptions(){return this.viewModel.valueOptions}set valueOptions(e){this.viewModel.valueOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.viewModel.startCreateFeaturesWorkflowAtFeatureTypeSelection()}startCreateFeaturesWorkflowAtFeatureCreation(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureCreation(e)}startCreateFeaturesWorkflowAtFeatureEdit(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureEdit(e)}startMergeFeaturesWorkflow(e,t={}){return this.viewModel.startMergeFeaturesWorkflow(e,t)}startSplitFeatureWorkflow(e,t={}){return this.viewModel.startSplitFeatureWorkflow(e,t)}async startUpdateFeaturesWorkflow(e){return this.viewModel.startUpdateFeaturesWorkflow(e)}startUpdateWorkflowAtFeatureSelection(){return this.viewModel.startUpdateWorkflowAtFeatureSelection()}startUpdateWorkflowAtMultipleFeatureSelection(e){return this.viewModel.startUpdateWorkflowAtMultipleFeatureSelection(e)}startUpdateWorkflowAtFeatureEdit(e){return this.viewModel.startUpdateWorkflowAtFeatureEdit(e)}startUpdateWorkflowWithActiveSelection(){return this.viewModel.startUpdateWorkflowWithActiveSelection()}deleteFeatureFromWorkflow(){return t(i.getLogger(this),"Editor.deleteFeatureFromWorkflow is deprecated. Use Editor.deleteFeatures instead.",{version:"4.33",replacement:"Editor.deleteFeatures",warnOnce:!0}),this.deleteFeatures()}async deleteFeatures(){await this.viewModel.deleteFeatures()}deleteAssociationFromWorkflow(){return this.viewModel.deleteAssociationFromWorkflow()}cancelWorkflow(e){return this.viewModel.cancelWorkflow(e)}render(){const{visibleElements:e,viewModel:t}=this,i=this.classes(k.base,te.widget,te.panel);if(!t)return de("div",{class:i,key:"empty"});const{pageStack:s}=t,o=s.length-1,r=s.map((e,t)=>this._renderPage(e,t===o));return de("div",{class:i,key:"base"},e.flow?de("calcite-flow",{inert:!!this._prompt,key:"flow"},r):r,this._prompt?de(q,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderPage(e,t){const i={selected:t};switch(e){case"disabled":break;case"ready":return this._renderReady(i);case"viewing-selection-list":return this._renderSelectionListPage(i);case"awaiting-feature-creation-info":return this._renderAwaitingFeatureCreationInfo(i);case"creating-features-upload-details":return this._renderUploadDetails(i);case"creating-features":return this._renderCreatingFeatures(i);case"editing-existing-feature":case"editing-features":case"editing-attributes":case"choosing-key-feature":return this._renderUpdateFeature(i);case"awaiting-update-feature-candidate":return this._renderFeatureList(i);case"adding-attachment":return this._renderAttachmentAdding(i);case"editing-attachment":return this._renderAttachmentEditing(i);case"viewing-associated-layers":case"viewing-associated-features":return this._renderViewAssociatedLayers(i);case"add-association-select-layer":case"add-association-select-feature":return this._renderSelectFeature(i);case"add-association-create-association":return this._renderAddAssociation(i);case"drawing-splitter-geometry":return this._renderDrawingSplitGeometry(i);case"reviewing-features":return this._renderReviewingSplitFeatures(i)}return de("div",{key:"empty-page"})}_renderAwaitingFeatureCreationInfo(e){const{EditorPanel:t,messages:i}=this;return de(t,{heading:i.selectTemplate,key:"templates-panel",...e},de(O,{key:"feature-templates"},de(N,null,this._renderFeatureTemplates())))}_renderUploadDetails(e){const{EditorPanel:t,activeWorkflow:i,messages:s}=this;if("create-features"!==i?.type)return null;const o=i.data.upload;return o?de(t,{heading:s.createFeatures,key:"upload-details-panel",...e},de(J,{helpMessage:this._helpMessage,messages:s,upload:o})):null}_renderCreatingFeatures(e){const{EditorPanel:t,activeWorkflow:i,messages:s,messagesCommon:o,headingLevel:r,viewModel:a}=this;if(!i)return null;const n="create-features"===i.type&&i.numPendingFeatures>0||"update"===i.type&&"create-features"===i?.activeWorkflow?.type&&i.activeWorkflow?.numPendingFeatures>0;return de(t,{heading:s.createFeatures,key:"create-features-panel",...e},n?de(Z,{editorViewModel:a,headingLevel:r,messages:s,messagesCommon:o,renderAttachments:this._renderAttachments,renderBatchAttributeForm:this._renderBatchAttributeForm,renderFeatureForm:this._renderFeatureForm,renderSketchToolbar:this._renderSketch,visibleElements:this.visibleElements,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}):de(P,{helpMessage:this._helpMessage,renderSketchToolbar:this._renderSketch}))}_renderUpdateFeature(e){const{EditorPanel:t,messages:i,messagesCommon:s,headingLevel:o,viewModel:r}=this,a=r.activeFeatureCount>1?i.multiFeature.editPanelTitle:i.singleFeature.editPanelTitle;return de(t,{heading:a,key:"update-feature-panel",...e},de(Z,{editorViewModel:r,headingLevel:o,messages:i,messagesCommon:s,renderAttachments:this._renderAttachments,renderBatchAttributeForm:this._renderBatchAttributeForm,renderFeatureForm:this._renderFeatureForm,visibleElements:this.visibleElements,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onMerge:this._onMerge,onSave:this._onSave,onSplit:this._onSplit}))}_renderDrawingSplitGeometry(e){const{EditorPanel:t}=this;return de(t,{heading:this.messages.splitFeature,key:"draw-split-geometry-panel",...e},de(P,{helpMessage:this._helpMessage,renderSketchToolbar:this._renderSketch}))}_renderReviewingSplitFeatures(e){const{EditorPanel:t,messages:i,messagesCommon:s,headingLevel:o,viewModel:r}=this;return de(t,{heading:i.splitFeature,key:"review-split-features-panel",...e},de(Z,{editorViewModel:r,headingLevel:o,messages:i,messagesCommon:s,renderAttachments:this._renderAttachments,renderBatchAttributeForm:this._renderBatchAttributeForm,renderFeatureForm:this._renderFeatureForm,visibleElements:this.visibleElements,onSave:this._onSave}))}_getAssociationTypeTitle(e){const{messages:t}=this;if(!e)return t.singleFeature.editPanelTitle;if(e.title)return e.title;const{messagesFeature:i}=this;switch(e.type){case"attachment":return i.associationsAttachments;case"connectivity":return i.associationsConnectivity;case"structure":return i.associationsStructure;case"content":return i.associationsContents;case"container":return i.associationsContainer}}_getAddAssociationTypeTitle(e){const{messages:t}=this;if(!e)return t.singleFeature.editPanelTitle;const i=t.associations;switch(e.type){case"attachment":return i.addAttachment;case"connectivity":return i.addConnectivity;case"structure":return i.addStructure;case"content":return i.addContent;case"container":return i.addContainer}}async _initializeAssociationItemList(e){const t=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js")).default;this._associationItemList=new t({view:this.view,viewModel:e})}async _initializeAssociationSettings(){const e=new(0,(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js")).default);return this._associationSettings=e,e}_renderViewAssociatedLayers(e){const{EditorPanel:t,messages:i,messagesCommon:s,headingLevel:o,viewModel:r}=this,a=r.featureFormViewModel?.activeAssociationInput?.activeAssociationType,n=this._getAssociationTypeTitle(a);return de(t,{heading:n,key:"viewing-associated-layers-panel",...e},de(Z,{editorViewModel:r,headingLevel:o,messages:i,messagesCommon:s,renderAttachments:this._renderAttachments,renderBatchAttributeForm:this._renderBatchAttributeForm,renderFeatureForm:this._renderFeatureForm,renderSketchToolbar:this._renderSketch,visibleElements:this.visibleElements,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}))}_renderSelectFeature(e){const{_associationItemList:t,EditorPanel:i,viewModel:s,messagesCommon:o}=this,r=s.utilityNetworkAssociationAddAssociationViewModel,a=this._getAddAssociationTypeTitle(r?.associationType),n="ready"!==r?.state||this.viewModel.featureFormDisabled;return t?de(i,{heading:a,key:"add-association-select-feature",...e},de(O,{key:"select-feature"},de(N,null,t.render())),de(V,{buttons:[t.filterOptionsVisible?{appearance:"solid",label:o.apply,disabled:n,onClick:()=>t.applyFilterOptions(),type:"button"}:void 0,{appearance:"outline",label:o.cancel,disabled:n,onClick:()=>{"update"===s.activeWorkflow?.type&&(r?.reset(),s.activeWorkflow.cancelActiveWorkflow())},type:"button"}]})):de(i,{heading:a,key:"add-association-select-feature",...e})}async _setUpAssociationSettings(){const{viewModel:e}=this,t=this._associationSettings??await this._updatingHandles.addPromise(this._initializeAssociationSettings()),i=e.utilityNetworkAssociationAddAssociationViewModel,s="update"===e.activeWorkflow?.type?e.activeWorkflow:null,o=s?s.activeWorkflow:null,r="add-association"===o?.type?o.sourceFeatureItem:null,a=i?.selectedFeature,n=i?.association,l=i?.utilityNetwork;r&&a&&n&&l&&(t.sourceFeature=r,t.targetFeature=a,t.association=n,t.utilityNetwork=l)}_renderAddAssociation(e){const{_associationSettings:t,EditorPanel:i,viewModel:s,messagesCommon:o}=this;if(!t)return null;const r=s.utilityNetworkAssociationAddAssociationViewModel,a=this._getAddAssociationTypeTitle(r?.associationType),n="ready"!==r?.state;return de(i,{heading:a,key:"add-association",...e},de(O,{key:"add-association-content"},de(N,null,t.render())),de(V,{buttons:[{label:o.add,disabled:n||!r.canAddAssociation,onClick:()=>this._onSave(),type:"button"},{appearance:"outline",label:o.cancel,disabled:n,onClick:()=>{"update"===s.activeWorkflow?.type&&s.activeWorkflow.cancelActiveWorkflow()},type:"button"}]}))}_renderCustomTemplateGroupContent(e){const{messages:t,viewModel:i}=this,s=r(e.group.items,e=>i.itemHasInvalidFormTemplate(e)?t.formFieldCreateError:void 0);return s?de(D,{kind:"warning",message:s}):null}_renderAttachmentAdding(e){const{EditorPanel:t,_attachments:i,messages:s,messagesCommon:o}=this;return de(t,{heading:s.addAttachment,key:"attachment-adding-panel",...e},de(O,{key:"attachments"},this._renderAttachments()),de(V,{buttons:[{label:i.submitting?o.cancel:o.add,disabled:i.submitting||!i.selectedFile,onClick:this._onAttachmentAdd,type:"button"}]}))}_renderSelectionListPage(e){const{_hasSelectionFromMultipleLayers:t,_hasInvalidBatchSelection:i,_selectionCountExceedsMaximum:s,_selectionList:o,_visibleSelectionCount:r,messages:a,EditorPanel:n}=this,{batchUpdateActions:l}=this.visibleElements,{maxVisibleFeatureCountPerLayer:c}=o;return de(n,{heading:a.widgetLabel,key:"selection-list-panel",...e},this.visibleElements.selectionToolbar&&"3d"!==this.view?.type?de("div",{class:k.selectionToolbarContainer},this._renderSelectionToolbar()):void 0,de(O,{key:"selection-list"},de(N,null,this._renderSelectionList())),de(V,{buttons:[l?{label:pe(a.batchEditing.editCount,{count:r}),disabled:i,onClick:()=>this.startUpdateWorkflowWithActiveSelection(),type:"button"}:void 0],notice:l&&t?{text:a.batchEditing.selectOneLayer,icon:"information"}:l&&s?{text:pe(this.messages.multiFeature.formFailedToLoadTooManyFeatures,{num:c}),icon:"information"}:void 0}))}_renderAttachmentEditing(e){const{EditorPanel:t,_attachments:i,activeWorkflow:s,messages:o,messagesCommon:r}=this;return s?de(t,{heading:o.editAttachment,key:"attachment-editing-panel",...e},de(O,{key:"attachments"},this._renderAttachments()),s.shouldAllowAttachmentEditing?de(V,{buttons:[{label:r.update,disabled:i.submitting||!i.selectedFile,onClick:this._onAttachmentUpdate,type:"button"},{...this._deleteButtonCommonInfo,onClick:this._onAttachmentDelete,disabled:i.submitting,label:r.delete,type:"button"}]}):void 0):null}_renderReady(e){const{EditorPanel:t,messages:i,viewModel:s,visibleElements:o}=this,r=this._helpMessage;return de(t,{heading:i.widgetLabel,key:"landing-panel",...e},de(O,{key:"landing-content"},s.editorItems.length?[o.editFeaturesSection?de(N,{key:"edit-actions"},this._renderUpdateActions()):null,o.createFeaturesSection&&s.canCreateVisible?de(N,{key:"create-actions"},this._renderCreateActions()):null]:de(H,{key:"no-content"},i.noEditableLayers)),r?de("div",{class:k.helpMessage,key:"footer-actions",slot:"footer"},r):void 0)}get _helpMessage(){const{activeWorkflow:e,messages:t,view:i}=this,s=e?.helpMessage;return s?t["3d"===i?.type?"helpMessages3d":"helpMessages2d"]?.[s]:void 0}_renderUpdateActions(){const{messages:e,messagesCommon:t,viewModel:i}=this,s={id:"select",label:t.select};return de("div",{class:k.updateActions,key:"update-actions"},de(se,{level:ie(this.headingLevel)},e.editFeatures),this.visibleElements.selectionToolbar&&"3d"!==this.view?.type?de("div",{class:k.selectionToolbarContainer},this._renderSelectionToolbar()):de("calcite-list",{class:k.updateActionsList,label:e.editFeaturesList,selectionAppearance:"border",selectionMode:"single"},oe({disabled:!i.canUpdateVisible,grouped:!1,item:s,selectedItem:"awaiting-feature-to-update"===i.activeWorkflow?.stepId?s:void 0,renderIcon:this._renderSelectIcon,onItemSelect:this._onToggleUpdateWorkflow})))}_renderCreateActions(){return de("div",{key:"create-actions"},de(se,{level:ie(this.headingLevel)},this.messages.createFeatures),de("div",{class:k.featureTemplatesContainer,key:"templates"},this._renderFeatureTemplates()))}_renderFeatureList(e){const{EditorPanel:t,viewModel:i}=this,{activeWorkflow:s}=i;if("update"!==s?.type)return null;const o=s.data.candidates,r=pe(this.messages.multipleFeaturesTemplate,{total:o.length});return de(t,{heading:r,key:"feature-list",...e},de(j,{editorItems:i.editorItems,editorMessages:this.messages,filterText:this._filterText,id:this.id,messagesTemplates:this.messagesTemplates,workflow:s,onFilterTextChange:e=>this._filterText=e,onSelectFeature:(e,t)=>i.selectFeature(e,t),onZoomTo:e=>i.zoomTo(e)}))}_showPromptAndWait({title:e,message:t,yesLabel:i,noLabel:s}){const o=a(),{view:r}=this,n=r?.focused;return this._showPrompt({title:e,message:t,context:"danger",actions:{primary:{label:i,action:()=>o.resolve(!0)},secondary:{label:s,action:()=>o.resolve(!1)}}}),o.promise.finally(()=>{this._clearPrompt(),n&&r?.focus()})}async _onSelectionListItemSelect(e){await this.viewModel.onSelectionListItemSelect(e)}async _onSelectionListMenuItemSelect(e,t){await this.viewModel.onSelectionListMenuItemSelect(e,t)}async _setupSketch(){if(!!!this.visibleElements.sketch)return this._sketchImportAbortController=o(this._sketchImportAbortController),this._sketchToolbar=s(this._sketchToolbar),void this.removeHandles(ue);if(this._sketchImportAbortController)return;const e=new AbortController;this._sketchImportAbortController=e;const t=await import("./Sketch.js");if(!e.signal.aborted)try{this._sketchToolbar=new t.default({toolbarKind:"docked",contextualToolLocation:"inline-end",scale:"s",visibleElements:new Y({deleteButton:!1,settingsMenu:!1,directionModePicker:!1,selectionCountLabel:!1,duplicateButton:!1,createTools:new Q({freehandPolygon:!0,freehandPolyline:!0}),selectionTools:new X({"lasso-selection":!1,"rectangle-selection":!1})})}),this.addHandles([n(()=>{const e=this.viewModel.activeLeafWorkflow;return e&&"availableCreateTools"in e?e.availableCreateTools:null},e=>{this._sketchToolbar&&(this._sketchToolbar.availableCreateTools=e)},d),n(()=>this.visibleElements.undoRedoButtons,e=>{this._sketchToolbar&&(this._sketchToolbar.visibleElements.undoRedoMenu=e)},d),c(()=>this.viewModel?.sketchViewModel,e=>{this._sketchToolbar&&(this._sketchToolbar.viewModel=e)},d)],ue)}finally{this._sketchImportAbortController=null}}get test(){return{sketch:this._sketchToolbar,showPrompt:this._showPromptAndWait.bind(this)}}};e([h()],ge.prototype,"_batchAttributeForm",void 0),e([h()],ge.prototype,"_featureForm",void 0),e([h()],ge.prototype,"_sketchToolbar",void 0),e([h()],ge.prototype,"_attachments",void 0),e([h()],ge.prototype,"_associationItemList",void 0),e([h()],ge.prototype,"_associationSettings",void 0),e([h()],ge.prototype,"_featureTemplates",void 0),e([h()],ge.prototype,"_filterText",void 0),e([h()],ge.prototype,"_hasInvalidBatchSelection",null),e([h()],ge.prototype,"_hasSelectionFromMultipleLayers",null),e([h()],ge.prototype,"_prompt",void 0),e([h()],ge.prototype,"_spinner",void 0),e([h()],ge.prototype,"_deleteButtonCommonInfo",null),e([h()],ge.prototype,"_loading",void 0),e([h()],ge.prototype,"_selectionCountExceedsMaximum",null),e([h()],ge.prototype,"_selectionList",void 0),e([h()],ge.prototype,"_selectionListItemActionConfigs",null),e([h()],ge.prototype,"_selectionToolbar",void 0),e([h()],ge.prototype,"_visibleSelectionCount",null),e([h({readOnly:!0})],ge.prototype,"activeWorkflow",null),e([h()],ge.prototype,"effectiveSelectionManager",null),e([h()],ge.prototype,"headingLevel",void 0),e([h()],ge.prototype,"hideTemplatesForInactiveLayers",null),e([h()],ge.prototype,"icon",null),e([h()],ge.prototype,"label",null),e([h()],ge.prototype,"labelOptions",null),e([h()],ge.prototype,"layerInfos",null),e([h(),le("esri/widgets/Editor/t9n/Editor")],ge.prototype,"messages",void 0),e([h(),le("esri/t9n/common")],ge.prototype,"messagesCommon",void 0),e([h(),le("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],ge.prototype,"messagesTemplates",void 0),e([h(),le("esri/widgets/Feature/t9n/Feature")],ge.prototype,"messagesFeature",void 0),e([h()],ge.prototype,"snappingOptions",null),e([h()],ge.prototype,"tooltipOptions",null),e([h()],ge.prototype,"supportingWidgetDefaults",void 0),e([h({type:u,nonNullable:!0})],ge.prototype,"valueOptions",null),e([h()],ge.prototype,"view",null),e([h(),ce(["sketch-create","sketch-delete","sketch-update","workflow-cancel","workflow-commit"])],ge.prototype,"viewModel",void 0),e([h({type:M,nonNullable:!0})],ge.prototype,"visibleElements",void 0),e([h()],ge.prototype,"_helpMessage",null),ge=e([m("esri.widgets.Editor")],ge);const we=ge;export{we as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecatedFunction as i}from"../core/deprecate.js";import s from"../core/Logger.js";import{destroyMaybe as o,abortMaybe as r,mappedFind as a}from"../core/maybe.js";import{createResolver as n}from"../core/promiseUtils.js";import{watch as l,on as c,when as d,initial as h}from"../core/reactiveUtils.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as u}from"../core/support/UpdatingHandles.js";import g from"../views/interactive/sketch/SketchValueOptions.js";import w from"./Attachments.js";import _ from"./BatchAttributeForm.js";import v from"./FeatureForm.js";import f from"./FeatureTemplates.js";import y from"./Spinner.js";import b from"./Widget.js";import{VisibleElements as k}from"./BatchAttributeForm/VisibleElements.js";import{css as F}from"./Editor/css.js";import A from"./Editor/EditorViewModel.js";import{isModelUpload as M}from"./Editor/modelUploadUtils.js";import T from"./Editor/VisibleElements.js";import{isFeatureFormViewModel as S,isUpdateWorkflow as C,isUpdateFeaturesWorkflow as L,isUpdateFeatureWorkflow as E,isBatchAttributeFormViewModel as W}from"./Editor/workflowUtils.js";import{loadCreateFeaturesPanelContentComponents as P,CreateFeaturesPanelContent as I}from"./Editor/components/CreateFeaturesPanelContent.js";import{loadFeatureListComponents as j,FeatureList as U}from"./Editor/components/FeatureList.js";import{loadFooterActionsComponents as V,FooterActions as D}from"./Editor/components/FooterActions.js";import{loadNoticesComponents as x,Notice as B}from"./Editor/components/Notices.js";import{loadPanelContentComponents as O,PanelContent as N,PanelContentSection as G,PanelContentMessage as H}from"./Editor/components/PanelContent.js";import{PanelToolbar as R,loadPanelToolbarComponents as z}from"./Editor/components/PanelToolbar.js";import{loadPromptComponents as q,Prompt as K}from"./Editor/components/Prompt.js";import{loadUpdateFeaturePanelContentComponents as Z,UpdateFeaturePanelContent as $}from"./Editor/components/UpdateFeaturePanelContent.js";import{loadUploadDetailsComponents as J,UploadDetails as Q}from"./Editor/components/UploadDetails.js";import{CreateToolVisibilityMap as X}from"./Sketch/CreateToolVisibilityMap.js";import{SelectionToolVisibilityMap as Y}from"./Sketch/SelectionToolVisibilityMap.js";import{VisibleElements as ee}from"./Sketch/VisibleElements.js";import{loadCalciteComponents as te}from"./support/componentsUtils.js";import{globalCss as ie}from"./support/globalCss.js";import{incrementHeadingLevel as se,Heading as oe}from"./support/Heading.js";import{renderItem as re}from"./support/ItemList.js";import{connectDelayedLoading as ae}from"./support/loaderUtils.js";import ne from"./support/SelectionList.js";import le from"./support/SelectionToolbar.js";import{messageBundle as ce,vmEvent as de,tsx as he}from"./support/widget.js";import me from"./support/SelectionList/VisibleElements.js";import pe from"./support/SelectionToolbar/VisibleElements.js";const ue=Symbol("sketch-setup-handles");let ge=class extends b{constructor(e,i){super(e,i),this._batchAttributeForm=new _({visibleElements:new k({loadingIndicator:!1})}),this._featureForm=new v,this._sketchToolbar=null,this._attachments=new w({visibleElements:{addSubmitButton:!1,cancelAddButton:!1,cancelUpdateButton:!1,deleteButton:!1,errorMessage:!1,progressBar:!1,updateButton:!1}}),this._associationItemList=null,this._associationSettings=null,this._featureTemplates=new f({enableListScroll:!1,renderItemContentEnd:e=>e.supportsUpload?he("calcite-icon",{class:F.templateItemContentEnd,icon:"upload-to",key:"upload-icon"}):null,renderItemLabel:e=>e.label,renderCustomGroupContent:e=>this._renderCustomTemplateGroupContent(e)}),this._filterText="",this._prompt=null,this._spinner=new y,this._loading=!1,this._selectionList=new ne({displayMode:"layer",itemActionConfigs:this._selectionListItemActionConfigs,onListItemSelect:({item:e})=>this._onSelectionListItemSelect(e),visibleElements:new me({header:!1})}),this._selectionToolbar=new le({visibleElements:new pe({chip:!1})}),this._updatingHandles=new u,this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.messagesTemplates=null,this.messagesFeature=null,this.supportingWidgetDefaults=null,this.viewModel=new A,this.visibleElements=new T,this._renderAttachments=()=>this._attachments.render(),this._renderFeatureForm=()=>this._featureForm.render(),this._renderBatchAttributeForm=()=>this._batchAttributeForm.render(),this._renderFeatureTemplates=()=>this._featureTemplates.render(),this._renderSelectionList=()=>this._selectionList.render(),this._renderSelectionToolbar=()=>this._selectionToolbar.render(),this._renderSketch=()=>this._sketchToolbar?he("div",{class:F.sketchContainer,key:"editor-sketch-container"},this._sketchToolbar?.render()):void 0,this._renderSelectIcon=()=>he("calcite-icon",{icon:"cursor",slot:"content-start"}),this.EditorPanel=({heading:e,key:t,selected:i},...s)=>{const{visibleElements:o}=this;return he("calcite-flow-item",{closable:!1,heading:e,headingLevel:this.headingLevel,key:t,loading:this._loading,selected:i,onCalciteFlowItemBack:this._onBack},o.settingsMenu?he(R,{editorViewModel:this.viewModel,messagesCommon:this.messagesCommon,visibleElements:o}):null,...s)},this._showDiscardEditsPrompt=()=>{const{messages:e,activeWorkflow:t}=this,i={title:e.cancelEditTitle,message:e.cancelEditWarningMessage,yesLabel:e.discardEdits,noLabel:e.continueEditing};return"create-features"===t?.type&&M(t.data.creationInfo)?this._showPromptAndWait("success"===t.data.upload?.state?e.modelUploads.cancelPlacementPrompt:e.modelUploads.cancelUploadPrompt):"update"===t?.type&&S(t.formViewModel)&&t.formViewModel.activeAssociation?this._showPromptAndWait({...i,message:e.cancelAssociationEditWarning}):this._showPromptAndWait(i)},this._showGenericCancelPrompt=()=>{const{messages:e,messagesCommon:t}=this;return this._showPromptAndWait({title:e.cancelRequestTitle,message:e.cancelRequestWarningMessage,yesLabel:t.form.yes,noLabel:t.form.no})},this._showPrompt=e=>{this._prompt?.cancel?.(),this._prompt=e},this._clearPrompt=()=>{this._prompt=null},this._onSave=()=>{this.viewModel.saveWorkflow()},this._onMerge=()=>{const{activeWorkflow:e}=this.viewModel;if(C(e)){const t=e.activeWorkflow;L(t)&&e.startMergingFeatures(t.viewGraphics)}},this._onSplit=()=>{const{activeWorkflow:e}=this.viewModel;if(C(e)){const t=e.activeWorkflow;if(E(t)){const i=t.viewGraphic;i&&e.startSplittingFeature(i)}}},this._onDelete=()=>{const e=this.viewModel.activeFeatureCount,i=e>1?this.messages.multiFeature:this.messages.singleFeature;this._showPrompt({title:i.deleteWarningTitle,message:i.deleteWarningMessage,context:"danger",actions:{primary:{label:t(i.delete,{count:e}),action:()=>{this.deleteFeatures(),this._clearPrompt()}},secondary:{label:i.keep,action:this._clearPrompt}}})},this._onDeleteAssociation=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAssociationTitle,message:e.deleteAssociationMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{this.deleteAssociationFromWorkflow(),this._clearPrompt()}},secondary:{label:e.keepAssociation,action:this._clearPrompt}}})},this._onToggleUpdateWorkflow=()=>this.viewModel.toggleUpdateWorkflow(),this._onBack=e=>(e?.stopPropagation(),this.viewModel.back()),this._onAttachmentAdd=()=>{const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type||"update"===e.type&&"create-features"===e.activeWorkflow?.type?(this._attachments.addFile(),e.back()):this._attachments.addAttachment().then(()=>e.back()))},this._onAttachmentUpdate=()=>{const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type?(this._attachments.updateFile(),e.back()):this._attachments.updateAttachment().then(()=>e.back()))},this._onAttachmentDelete=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAttachmentWarningTitle,message:e.deleteAttachmentWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:this._onAttachmentDeleteConfirm},secondary:{label:e.keepAttachment,action:this._clearPrompt}}})},this._onAttachmentDeleteConfirm=async()=>{const e=this._attachments,{activeWorkflow:t}=this.viewModel;t&&("create-features"===t.type?e.deleteFile():(await e.deleteAttachment(e.viewModel.activeAttachmentInfo),this._clearPrompt()),await t.back(),this._clearPrompt())},this._onAttachmentsError=e=>{this._showPrompt({title:this.messages.errorWarningTitle,message:e.message,context:"warning",actions:{primary:{label:this.messagesCommon.form.ok,action:this._clearPrompt}}})}}initialize(){this._featureForm.showPrompt=this._showPrompt,this._featureForm.clearPrompt=this._clearPrompt,this.addHandles([l(()=>se(this.headingLevel),e=>{this._featureForm.headingLevel=e,this._featureTemplates.headingLevel=e},h),c(()=>this.viewModel.activeWorkflow,"cancel-request",({controller:e})=>{(this.viewModel.hasPendingEdits?this._showDiscardEditsPrompt():this._showGenericCancelPrompt()).then(t=>t?e.allow():e.deny())}),d(()=>this.viewModel.formViewModel,e=>{W(e)?this._batchAttributeForm.viewModel=e:this._featureForm.viewModel=e},h),d(()=>this.viewModel.utilityNetworkAssociationAddAssociationViewModel,e=>{this._associationItemList?this._associationItemList.viewModel=e:this._updatingHandles.addPromise(this._initializeAssociationItemList(e))},h),d(()=>this.viewModel.utilityNetworkAssociationAddAssociationViewModel?.association,()=>{this._setUpAssociationSettings()}),l(()=>[this.viewModel,this.viewModel?.attachmentsViewModel,this.viewModel?.featureTemplatesViewModel,this.viewModel?.spinnerViewModel,this.viewModel?.selectionListViewModel,this.viewModel?.selectionToolbarViewModel],([e,t,i,s,o,r])=>{this._attachments.viewModel=t,this._featureTemplates.viewModel=i,this._spinner.viewModel=s,this._selectionList.viewModel=o,this._selectionToolbar.viewModel=r,e.showDiscardEditsPrompt=this._showDiscardEditsPrompt},h),l(()=>this.view,(e,t)=>{const i=`editor-${this.id}-spinner`;t?.ui.remove(this._spinner,i),e?.ui.add(this._spinner,{key:i,position:"manual"}),this._associationItemList&&(this._associationItemList.view=e)},h),l(()=>[this.supportingWidgetDefaults,this.viewModel.sketchViewModel],([e])=>{e&&(this._featureForm.set(e.featureForm),this._attachments.set(e.attachments),this._featureTemplates.set(e.featureTemplates),this.viewModel.sketchViewModel?.set(e.sketch))},h),d(()=>this._attachments?.error,e=>this._onAttachmentsError(e)),d(()=>this._selectionListItemActionConfigs,()=>{this._selectionList.itemActionConfigs=this._selectionListItemActionConfigs}),d(()=>this.viewModel?.failures,e=>{const{messages:i}=this,[{error:s,retry:o,cancel:r}]=e;this._showPrompt({title:i.errorWarningTitle,message:t(i.errorWarningMessageTemplate,{errorMessage:s.message}),context:"warning",actions:{primary:{label:i.retry,action:()=>{o(),this._clearPrompt()}},secondary:{label:i.ignore,action:()=>{r(),this._clearPrompt()}}}})}),l(()=>this.viewModel?.state,e=>{switch(e){case"awaiting-feature-to-update":case"ready":case"disabled":this._filterText="",this._featureTemplates.filterText=""}}),l(()=>this.viewModel.featureFormDisabled,e=>this._featureForm.disabled=e),l(()=>this.visibleElements.sketch,()=>this._setupSketch(),h),ae({getLoading:()=>{const{viewModel:e}=this;return e.syncing||e.updating||this._attachments.submitting||this._updatingHandles.updating},setEffectiveLoading:e=>{this._loading=e}})])}destroy(){this._associationItemList?.destroy(),this._associationSettings?.destroy(),this._selectionList.destroy(),this._selectionToolbar.destroy(),this._attachments.destroy(),this._batchAttributeForm.destroy(),this._featureForm.destroy(),this._featureTemplates.destroy(),this._spinner.destroy(),this._sketchToolbar=o(this._sketchToolbar),this._sketchImportAbortController=r(this._sketchImportAbortController)}loadDependencies(){return Promise.all([te({flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list")}),P(),j(),V(),x(),O(),z(),q(),Z(),J()])}get _hasInvalidBatchSelection(){return this._hasSelectionFromMultipleLayers||this._selectionCountExceedsMaximum||0===this._selectionList.visibleFeatureCount}get _hasSelectionFromMultipleLayers(){return this._selectionList.visibleLayerCount>1}get _deleteButtonCommonInfo(){return{appearance:"outline",kind:"danger"}}get _selectionCountExceedsMaximum(){const e=this._batchAttributeForm.maximumFeatureCount,{activeLayerItem:t,effectiveCount:i,filterText:s,visibleFeatureCount:o}=this._selectionList;return null!=s&&""!==s?o>e:t?t.total>e:i>e}get _selectionListItemActionConfigs(){const{messages:e}=this;return[{label:e?.batchEditing?.editThisFeature,icon:"edit-attributes",type:"feature",callback:({item:e})=>this._onSelectionListMenuItemSelect(e,"update")},{label:e?.batchEditing.editTheseFeatures,icon:"edit-attributes",type:"layer",callback:({item:e})=>this._onSelectionListMenuItemSelect(e,"update")},{label:e?.batchEditing.mergeTheseFeatures,icon:"merge",type:"layer",callback:({item:e})=>this._onSelectionListMenuItemSelect(e,"merge")}]}get _visibleSelectionCount(){const{activeLayerItem:e,effectiveCount:t,filterText:i,visibleFeatureCount:s}=this._selectionList;return null!=i&&""!==i?s:e?e.total:t}get activeWorkflow(){return this.viewModel.activeWorkflow}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get hideTemplatesForInactiveLayers(){return this.viewModel.hideTemplatesForInactiveLayers}set hideTemplatesForInactiveLayers(e){this.viewModel.hideTemplatesForInactiveLayers=e}get icon(){return"pencil"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(e){this.viewModel.labelOptions=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(e){this.viewModel.tooltipOptions=e}get valueOptions(){return this.viewModel.valueOptions}set valueOptions(e){this.viewModel.valueOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.viewModel.startCreateFeaturesWorkflowAtFeatureTypeSelection()}startCreateFeaturesWorkflowAtFeatureCreation(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureCreation(e)}startCreateFeaturesWorkflowAtFeatureEdit(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureEdit(e)}startMergeFeaturesWorkflow(e,t={}){return this.viewModel.startMergeFeaturesWorkflow(e,t)}startSplitFeatureWorkflow(e,t={}){return this.viewModel.startSplitFeatureWorkflow(e,t)}async startUpdateFeaturesWorkflow(e){return this.viewModel.startUpdateFeaturesWorkflow(e)}startUpdateWorkflowAtFeatureSelection(){return this.viewModel.startUpdateWorkflowAtFeatureSelection()}startUpdateWorkflowAtMultipleFeatureSelection(e){return this.viewModel.startUpdateWorkflowAtMultipleFeatureSelection(e)}startUpdateWorkflowAtFeatureEdit(e){return this.viewModel.startUpdateWorkflowAtFeatureEdit(e)}startUpdateWorkflowWithActiveSelection(){return this.viewModel.startUpdateWorkflowWithActiveSelection()}deleteFeatureFromWorkflow(){return i(s.getLogger(this),"Editor.deleteFeatureFromWorkflow is deprecated. Use Editor.deleteFeatures instead.",{version:"4.33",replacement:"Editor.deleteFeatures",warnOnce:!0}),this.deleteFeatures()}async deleteFeatures(){await this.viewModel.deleteFeatures()}deleteAssociationFromWorkflow(){return this.viewModel.deleteAssociationFromWorkflow()}cancelWorkflow(e){return this.viewModel.cancelWorkflow(e)}render(){const{visibleElements:e,viewModel:t}=this,i=this.classes(F.base,ie.widget,ie.panel);if(!t)return he("div",{class:i,key:"empty"});const{pageStack:s}=t,o=s.length-1,r=s.map((e,t)=>this._renderPage(e,t===o));return he("div",{class:i,key:"base"},e.flow?he("calcite-flow",{inert:!!this._prompt,key:"flow"},r):r,this._prompt?he(K,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderPage(e,t){const i={selected:t};switch(e){case"disabled":break;case"ready":return this._renderReady(i);case"viewing-selection-list":return this._renderSelectionListPage(i);case"awaiting-feature-creation-info":return this._renderAwaitingFeatureCreationInfo(i);case"creating-features-upload-details":return this._renderUploadDetails(i);case"creating-features":return this._renderCreatingFeatures(i);case"editing-existing-feature":case"editing-features":case"editing-attributes":case"choosing-key-feature":return this._renderUpdateFeature(i);case"awaiting-update-feature-candidate":return this._renderFeatureList(i);case"adding-attachment":return this._renderAttachmentAdding(i);case"editing-attachment":return this._renderAttachmentEditing(i);case"viewing-associated-layers":case"viewing-associated-features":return this._renderViewAssociatedLayers(i);case"add-association-select-layer":case"add-association-select-feature":return this._renderSelectFeature(i);case"add-association-create-association":return this._renderAddAssociation(i);case"drawing-splitter-geometry":return this._renderDrawingSplitGeometry(i);case"reviewing-features":return this._renderReviewingSplitFeatures(i)}return he("div",{key:"empty-page"})}_renderAwaitingFeatureCreationInfo(e){const{EditorPanel:t,messages:i}=this;return he(t,{heading:i.selectTemplate,key:"templates-panel",...e},he(N,{key:"feature-templates"},he(G,null,this._renderFeatureTemplates())))}_renderUploadDetails(e){const{EditorPanel:t,activeWorkflow:i,messages:s}=this;if("create-features"!==i?.type)return null;const o=i.data.upload;return o?he(t,{heading:s.createFeatures,key:"upload-details-panel",...e},he(Q,{helpMessage:this._helpMessage,messages:s,upload:o})):null}_renderCreatingFeatures(e){const{EditorPanel:t,activeWorkflow:i,messages:s,messagesCommon:o,headingLevel:r,viewModel:a}=this;if(!i)return null;const n="create-features"===i.type&&i.numPendingFeatures>0||"update"===i.type&&"create-features"===i?.activeWorkflow?.type&&i.activeWorkflow?.numPendingFeatures>0;return he(t,{heading:s.createFeatures,key:"create-features-panel",...e},n?he($,{editorViewModel:a,headingLevel:r,messages:s,messagesCommon:o,renderAttachments:this._renderAttachments,renderBatchAttributeForm:this._renderBatchAttributeForm,renderFeatureForm:this._renderFeatureForm,renderSketchToolbar:this._renderSketch,visibleElements:this.visibleElements,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}):he(I,{helpMessage:this._helpMessage,renderSketchToolbar:this._renderSketch}))}_renderUpdateFeature(e){const{EditorPanel:t,messages:i,messagesCommon:s,headingLevel:o,viewModel:r}=this,a=r.activeFeatureCount>1?i.multiFeature.editPanelTitle:i.singleFeature.editPanelTitle;return he(t,{heading:a,key:"update-feature-panel",...e},he($,{editorViewModel:r,headingLevel:o,messages:i,messagesCommon:s,renderAttachments:this._renderAttachments,renderBatchAttributeForm:this._renderBatchAttributeForm,renderFeatureForm:this._renderFeatureForm,visibleElements:this.visibleElements,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onMerge:this._onMerge,onSave:this._onSave,onSplit:this._onSplit}))}_renderDrawingSplitGeometry(e){const{EditorPanel:t}=this;return he(t,{heading:this.messages.splitFeature,key:"draw-split-geometry-panel",...e},he(I,{helpMessage:this._helpMessage,renderSketchToolbar:this._renderSketch}))}_renderReviewingSplitFeatures(e){const{EditorPanel:t,messages:i,messagesCommon:s,headingLevel:o,viewModel:r}=this;return he(t,{heading:i.splitFeature,key:"review-split-features-panel",...e},he($,{editorViewModel:r,headingLevel:o,messages:i,messagesCommon:s,renderAttachments:this._renderAttachments,renderBatchAttributeForm:this._renderBatchAttributeForm,renderFeatureForm:this._renderFeatureForm,visibleElements:this.visibleElements,onSave:this._onSave}))}_getAssociationTypeTitle(e){const{messages:t}=this;if(!e)return t.singleFeature.editPanelTitle;if(e.title)return e.title;const{messagesFeature:i}=this;switch(e.type){case"attachment":return i.associationsAttachments;case"connectivity":return i.associationsConnectivity;case"structure":return i.associationsStructure;case"content":return i.associationsContents;case"container":return i.associationsContainer}}_getAddAssociationTypeTitle(e){const{messages:t}=this;if(!e)return t.singleFeature.editPanelTitle;const i=t.associations;switch(e.type){case"attachment":return i.addAttachment;case"connectivity":return i.addConnectivity;case"structure":return i.addStructure;case"content":return i.addContent;case"container":return i.addContainer}}async _initializeAssociationItemList(e){const t=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js")).default;this._associationItemList=new t({view:this.view,viewModel:e})}async _initializeAssociationSettings(){const e=new(0,(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js")).default);return this._associationSettings=e,e}_renderViewAssociatedLayers(e){const{EditorPanel:t,messages:i,messagesCommon:s,headingLevel:o,viewModel:r}=this,a=r.featureFormViewModel?.activeAssociationInput?.activeAssociationType,n=this._getAssociationTypeTitle(a);return he(t,{heading:n,key:"viewing-associated-layers-panel",...e},he($,{editorViewModel:r,headingLevel:o,messages:i,messagesCommon:s,renderAttachments:this._renderAttachments,renderBatchAttributeForm:this._renderBatchAttributeForm,renderFeatureForm:this._renderFeatureForm,renderSketchToolbar:this._renderSketch,visibleElements:this.visibleElements,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}))}_renderSelectFeature(e){const{_associationItemList:t,EditorPanel:i,viewModel:s,messagesCommon:o}=this,r=s.utilityNetworkAssociationAddAssociationViewModel,a=this._getAddAssociationTypeTitle(r?.associationType),n="ready"!==r?.state||this.viewModel.featureFormDisabled;return t?he(i,{heading:a,key:"add-association-select-feature",...e},he(N,{key:"select-feature"},he(G,null,t.render())),he(D,{buttons:[t.filterOptionsVisible?{appearance:"solid",label:o.apply,disabled:n,onClick:()=>t.applyFilterOptions(),type:"button"}:void 0,{appearance:"outline",label:o.cancel,disabled:n,onClick:()=>{"update"===s.activeWorkflow?.type&&(r?.reset(),s.activeWorkflow.cancelActiveWorkflow())},type:"button"}]})):he(i,{heading:a,key:"add-association-select-feature",...e})}async _setUpAssociationSettings(){const{viewModel:e}=this,t=this._associationSettings??await this._updatingHandles.addPromise(this._initializeAssociationSettings()),i=e.utilityNetworkAssociationAddAssociationViewModel,s="update"===e.activeWorkflow?.type?e.activeWorkflow:null,o=s?s.activeWorkflow:null,r="add-association"===o?.type?o.sourceFeatureItem:null,a=i?.selectedFeature,n=i?.association,l=i?.utilityNetwork;r&&a&&n&&l&&(t.sourceFeature=r,t.targetFeature=a,t.association=n,t.utilityNetwork=l)}_renderAddAssociation(e){const{_associationSettings:t,EditorPanel:i,viewModel:s,messagesCommon:o}=this;if(!t)return null;const r=s.utilityNetworkAssociationAddAssociationViewModel,a=this._getAddAssociationTypeTitle(r?.associationType),n="ready"!==r?.state;return he(i,{heading:a,key:"add-association",...e},he(N,{key:"add-association-content"},he(G,null,t.render())),he(D,{buttons:[{label:o.add,disabled:n||!r.canAddAssociation,onClick:()=>this._onSave(),type:"button"},{appearance:"outline",label:o.cancel,disabled:n,onClick:()=>{"update"===s.activeWorkflow?.type&&s.activeWorkflow.cancelActiveWorkflow()},type:"button"}]}))}_renderCustomTemplateGroupContent(e){const{messages:t,viewModel:i}=this,s=a(e.group.items,e=>i.itemHasInvalidFormTemplate(e)?t.formFieldCreateError:void 0);return s?he(B,{kind:"warning",message:s}):null}_renderAttachmentAdding(e){const{EditorPanel:t,_attachments:i,messages:s,messagesCommon:o}=this;return he(t,{heading:s.addAttachment,key:"attachment-adding-panel",...e},he(N,{key:"attachments"},this._renderAttachments()),he(D,{buttons:[{label:i.submitting?o.cancel:o.add,disabled:i.submitting||!i.selectedFile,onClick:this._onAttachmentAdd,type:"button"}]}))}_renderSelectionListPage(e){const{_hasSelectionFromMultipleLayers:i,_hasInvalidBatchSelection:s,_selectionCountExceedsMaximum:o,_selectionList:r,_visibleSelectionCount:a,messages:n,EditorPanel:l}=this,{batchUpdateActions:c}=this.visibleElements,{maxVisibleFeatureCountPerLayer:d}=r;return he(l,{heading:n.widgetLabel,key:"selection-list-panel",...e},this.visibleElements.selectionToolbar&&"3d"!==this.view?.type?he("div",{class:F.selectionToolbarContainer},this._renderSelectionToolbar()):void 0,he(N,{key:"selection-list"},he(G,null,this._renderSelectionList())),he(D,{buttons:[c?{label:t(n.batchEditing.editCount,{count:a}),disabled:s,onClick:()=>this.startUpdateWorkflowWithActiveSelection(),type:"button"}:void 0],notice:c&&i?{text:n.batchEditing.selectOneLayer,icon:"information"}:c&&o?{text:t(this.messages.multiFeature.formFailedToLoadTooManyFeatures,{num:d}),icon:"information"}:void 0}))}_renderAttachmentEditing(e){const{EditorPanel:t,_attachments:i,activeWorkflow:s,messages:o,messagesCommon:r}=this;return s?he(t,{heading:o.editAttachment,key:"attachment-editing-panel",...e},he(N,{key:"attachments"},this._renderAttachments()),s.shouldAllowAttachmentEditing?he(D,{buttons:[{label:r.update,disabled:i.submitting||!i.selectedFile,onClick:this._onAttachmentUpdate,type:"button"},{...this._deleteButtonCommonInfo,onClick:this._onAttachmentDelete,disabled:i.submitting,label:r.delete,type:"button"}]}):void 0):null}_renderReady(e){const{EditorPanel:t,messages:i,viewModel:s,visibleElements:o}=this,r=this._helpMessage;return he(t,{heading:i.widgetLabel,key:"landing-panel",...e},he(N,{key:"landing-content"},s.editorItems.length?[o.editFeaturesSection?he(G,{key:"edit-actions"},this._renderUpdateActions()):null,o.createFeaturesSection&&s.canCreateVisible?he(G,{key:"create-actions"},this._renderCreateActions()):null]:he(H,{key:"no-content"},i.noEditableLayers)),r?he("div",{class:F.helpMessage,key:"footer-actions",slot:"footer"},r):void 0)}get _helpMessage(){const{activeWorkflow:e,messages:t,view:i}=this,s=e?.helpMessage;return s?t["3d"===i?.type?"helpMessages3d":"helpMessages2d"]?.[s]:void 0}_renderUpdateActions(){const{messages:e,messagesCommon:t,viewModel:i}=this,s={id:"select",label:t.select};return he("div",{class:F.updateActions,key:"update-actions"},he(oe,{level:se(this.headingLevel)},e.editFeatures),this.visibleElements.selectionToolbar&&"3d"!==this.view?.type?he("div",{class:F.selectionToolbarContainer},this._renderSelectionToolbar()):he("calcite-list",{class:F.updateActionsList,label:e.editFeaturesList,selectionAppearance:"border",selectionMode:"single"},re({disabled:!i.canUpdateVisible,grouped:!1,item:s,selectedItem:"awaiting-feature-to-update"===i.activeWorkflow?.stepId?s:void 0,renderIcon:this._renderSelectIcon,onItemSelect:this._onToggleUpdateWorkflow})))}_renderCreateActions(){return he("div",{key:"create-actions"},he(oe,{level:se(this.headingLevel)},this.messages.createFeatures),he("div",{class:F.featureTemplatesContainer,key:"templates"},this._renderFeatureTemplates()))}_renderFeatureList(e){const{EditorPanel:i,viewModel:s}=this,{activeWorkflow:o}=s;if("update"!==o?.type)return null;const r=o.data.candidates,a=t(this.messages.multipleFeaturesTemplate,{total:r.length});return he(i,{heading:a,key:"feature-list",...e},he(U,{editorItems:s.editorItems,editorMessages:this.messages,filterText:this._filterText,id:this.id,messagesTemplates:this.messagesTemplates,workflow:o,onFilterTextChange:e=>this._filterText=e,onSelectFeature:(e,t)=>s.selectFeature(e,t),onZoomTo:e=>s.zoomTo(e)}))}_showPromptAndWait({title:e,message:t,yesLabel:i,noLabel:s}){const o=n(),{view:r}=this,a=r?.focused;return this._showPrompt({title:e,message:t,context:"danger",actions:{primary:{label:i,action:()=>o.resolve(!0)},secondary:{label:s,action:()=>o.resolve(!1)}}}),o.promise.finally(()=>{this._clearPrompt(),a&&r?.focus()})}async _onSelectionListItemSelect(e){await this.viewModel.onSelectionListItemSelect(e)}async _onSelectionListMenuItemSelect(e,t){await this.viewModel.onSelectionListMenuItemSelect(e,t)}async _setupSketch(){if(!!!this.visibleElements.sketch)return this._sketchImportAbortController=r(this._sketchImportAbortController),this._sketchToolbar=o(this._sketchToolbar),void this.removeHandles(ue);if(this._sketchImportAbortController)return;const e=new AbortController;this._sketchImportAbortController=e;const t=await import("./Sketch.js");if(!e.signal.aborted)try{this._sketchToolbar=new t.default({toolbarKind:"docked",contextualToolLocation:"inline-end",scale:"s",visibleElements:new ee({deleteButton:!1,settingsMenu:!1,directionModePicker:!1,selectionCountLabel:!1,duplicateButton:!1,createTools:new X({freehandPolygon:!0,freehandPolyline:!0}),selectionTools:new Y({"lasso-selection":!1,"rectangle-selection":!1})})}),this.addHandles([l(()=>{const e=this.viewModel.activeLeafWorkflow;return e&&"availableCreateTools"in e?e.availableCreateTools:null},e=>{this._sketchToolbar&&(this._sketchToolbar.availableCreateTools=e)},h),l(()=>this.visibleElements.undoRedoButtons,e=>{this._sketchToolbar&&(this._sketchToolbar.visibleElements.undoRedoMenu=e)},h),d(()=>this.viewModel?.sketchViewModel,e=>{this._sketchToolbar&&(this._sketchToolbar.viewModel=e)},h)],ue)}finally{this._sketchImportAbortController=null}}get test(){return{sketch:this._sketchToolbar,showPrompt:this._showPromptAndWait.bind(this)}}};e([m()],ge.prototype,"_batchAttributeForm",void 0),e([m()],ge.prototype,"_featureForm",void 0),e([m()],ge.prototype,"_sketchToolbar",void 0),e([m()],ge.prototype,"_attachments",void 0),e([m()],ge.prototype,"_associationItemList",void 0),e([m()],ge.prototype,"_associationSettings",void 0),e([m()],ge.prototype,"_featureTemplates",void 0),e([m()],ge.prototype,"_filterText",void 0),e([m()],ge.prototype,"_hasInvalidBatchSelection",null),e([m()],ge.prototype,"_hasSelectionFromMultipleLayers",null),e([m()],ge.prototype,"_prompt",void 0),e([m()],ge.prototype,"_spinner",void 0),e([m()],ge.prototype,"_deleteButtonCommonInfo",null),e([m()],ge.prototype,"_loading",void 0),e([m()],ge.prototype,"_selectionCountExceedsMaximum",null),e([m()],ge.prototype,"_selectionList",void 0),e([m()],ge.prototype,"_selectionListItemActionConfigs",null),e([m()],ge.prototype,"_selectionToolbar",void 0),e([m()],ge.prototype,"_visibleSelectionCount",null),e([m({readOnly:!0})],ge.prototype,"activeWorkflow",null),e([m()],ge.prototype,"effectiveSelectionManager",null),e([m()],ge.prototype,"headingLevel",void 0),e([m()],ge.prototype,"hideTemplatesForInactiveLayers",null),e([m()],ge.prototype,"icon",null),e([m()],ge.prototype,"label",null),e([m()],ge.prototype,"labelOptions",null),e([m()],ge.prototype,"layerInfos",null),e([m(),ce("esri/widgets/Editor/t9n/Editor")],ge.prototype,"messages",void 0),e([m(),ce("esri/t9n/common")],ge.prototype,"messagesCommon",void 0),e([m(),ce("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],ge.prototype,"messagesTemplates",void 0),e([m(),ce("esri/widgets/Feature/t9n/Feature")],ge.prototype,"messagesFeature",void 0),e([m()],ge.prototype,"snappingOptions",null),e([m()],ge.prototype,"tooltipOptions",null),e([m()],ge.prototype,"supportingWidgetDefaults",void 0),e([m({type:g,nonNullable:!0})],ge.prototype,"valueOptions",null),e([m()],ge.prototype,"view",null),e([m(),de(["sketch-create","sketch-delete","sketch-update","workflow-cancel","workflow-commit"])],ge.prototype,"viewModel",void 0),e([m({type:T,nonNullable:!0})],ge.prototype,"visibleElements",void 0),e([m()],ge.prototype,"_helpMessage",null),ge=e([p("esri.widgets.Editor")],ge);const we=ge;export{we as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{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 t from"../../Widget.js";import{legendCss as r}from"../css.js";import{LegendItem as i}from"./LegendItem.js";import"../../support/widgetUtils.js";import{tsx as p}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";let n=class extends t{constructor(){super(...arguments),this._expandedLine=null}render(){const{profiles:e,messages:o,effectiveUnits:s,_expandedLine:t}=this;return p("div",{class:r.base},e.map(r=>p(i,{checkboxVisible:e.length>1,effectiveUnits:s,expanded:r===t,line:r,messages:o,onExpandedToggle:()=>this._onExpandedToggle(r)})))}_onExpandedToggle(e){this._expandedLine=e===this._expandedLine?null:e}};e([o()],n.prototype,"effectiveUnits",void 0),e([o()],n.prototype,"messages",void 0),e([o()],n.prototype,"profiles",void 0),e([o()],n.prototype,"_expandedLine",void 0),n=e([s("esri.widgets.ElevationProfile.components.Legend")],n);export{n as Legend};
5
+ import{__decorate as e}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 r from"../../Widget.js";import{legendCss as t}from"../css.js";import{LegendItem as i}from"./LegendItem.js";import{tsx as p}from"../../support/widget.js";let n=class extends r{constructor(){super(...arguments),this._expandedLine=null}render(){const{profiles:e,messages:o,effectiveUnits:s,_expandedLine:r}=this;return p("div",{class:t.base},e.map(t=>p(i,{checkboxVisible:e.length>1,effectiveUnits:s,expanded:t===r,line:t,messages:o,onExpandedToggle:()=>this._onExpandedToggle(t)})))}_onExpandedToggle(e){this._expandedLine=e===this._expandedLine?null:e}};e([o()],n.prototype,"effectiveUnits",void 0),e([o()],n.prototype,"messages",void 0),e([o()],n.prototype,"profiles",void 0),e([o()],n.prototype,"_expandedLine",void 0),n=e([s("esri.widgets.ElevationProfile.components.Legend")],n);export{n as Legend};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../../intl.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as s}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import r from"../../Widget.js";import{legendItemCss as l}from"../css.js";import{Statistics as c}from"./Statistics.js";import{getTranslatedLineTitle as n}from"../support/intlUtils.js";import{loadCalciteComponents as a}from"../../support/componentsUtils.js";import"../../support/widgetUtils.js";import{tsx as d}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as p}from"../../../intl/substitute.js";let h=class extends r{constructor(e,t){super(e,t),this.checkboxVisible=!0,this.expanded=!1}loadDependencies(){return a({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),label:()=>import("@esri/calcite-components/dist/components/calcite-label")})}initialize(){this._statistics=new c(this._statisticsProps),this.addHandles(s(()=>this._statisticsProps,e=>this._statistics.set(e)))}destroy(){this._statistics=t(this._statistics)}render(){const e=this.expanded;return d("div",{class:this.classes(l.base,{[l.disabled]:this.disabled,[l.expanded]:e}),key:this},this._renderColorIndicator(),d("div",{class:l.header,key:"header"},this._renderLabelWithCheckbox(),this._renderCollapseToggleButton()),e?d("div",{class:l.content,key:"content"},this._statistics.render()):null)}get disabled(){return!this.line.available}get _statisticsProps(){return{line:this.line,effectiveUnits:this.effectiveUnits}}_renderColorIndicator(){return d("div",{class:l.colorIndicator,key:"color-indicator",styles:{backgroundColor:this.line.color.toCss()}})}_renderCollapseToggleButton(){const{expanded:e,messages:t}=this,s=e?t.hideDetails:t.showDetails;return d("calcite-action",{appearance:"transparent",bind:this,class:l.collapseToggle,"data-testid":"legend-toggle",icon:e?"chevron-up":"chevron-down",key:"collapse-toggle",onclick:this._onCollapseToggleClick,scale:"s",text:s,title:s})}_onCollapseToggleClick(){this.onExpandedToggle()}_renderLabelWithCheckbox(){const{line:e,checkboxVisible:t,disabled:s,messages:o}=this;return d("calcite-label",{class:l.label,disabled:s,key:`label-${e.id}`,layout:"inline"},t?this._renderCheckbox():null,n(e,o))}_renderCheckbox(){const{disabled:e,line:t,messages:s}=this,o=t.visible,i=o?s.hideProfile:s.showProfile,r=p(i,{name:n(t,s)});return d("calcite-checkbox",{checked:o,class:l.checkbox,disabled:e,title:r,onCalciteCheckboxChange:()=>t.toggleVisibility()})}};e([o()],h.prototype,"checkboxVisible",void 0),e([o()],h.prototype,"disabled",null),e([o({nonNullable:!0})],h.prototype,"effectiveUnits",void 0),e([o()],h.prototype,"expanded",void 0),e([o({nonNullable:!0})],h.prototype,"line",void 0),e([o()],h.prototype,"messages",void 0),e([o()],h.prototype,"onExpandedToggle",void 0),e([o()],h.prototype,"_statistics",void 0),h=e([i("esri.widgets.ElevationProfile.components.LegendItem")],h);export{h as LegendItem};
5
+ import{__decorate as e}from"tslib";import{substitute as t}from"../../../intl.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{watch as o}from"../../../core/reactiveUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import l from"../../Widget.js";import{legendItemCss as c}from"../css.js";import{Statistics as n}from"./Statistics.js";import{getTranslatedLineTitle as a}from"../support/intlUtils.js";import{loadCalciteComponents as d}from"../../support/componentsUtils.js";import{tsx as p}from"../../support/widget.js";let h=class extends l{constructor(e,t){super(e,t),this.checkboxVisible=!0,this.expanded=!1}loadDependencies(){return d({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),label:()=>import("@esri/calcite-components/dist/components/calcite-label")})}initialize(){this._statistics=new n(this._statisticsProps),this.addHandles(o(()=>this._statisticsProps,e=>this._statistics.set(e)))}destroy(){this._statistics=s(this._statistics)}render(){const e=this.expanded;return p("div",{class:this.classes(c.base,{[c.disabled]:this.disabled,[c.expanded]:e}),key:this},this._renderColorIndicator(),p("div",{class:c.header,key:"header"},this._renderLabelWithCheckbox(),this._renderCollapseToggleButton()),e?p("div",{class:c.content,key:"content"},this._statistics.render()):null)}get disabled(){return!this.line.available}get _statisticsProps(){return{line:this.line,effectiveUnits:this.effectiveUnits}}_renderColorIndicator(){return p("div",{class:c.colorIndicator,key:"color-indicator",styles:{backgroundColor:this.line.color.toCss()}})}_renderCollapseToggleButton(){const{expanded:e,messages:t}=this,s=e?t.hideDetails:t.showDetails;return p("calcite-action",{appearance:"transparent",bind:this,class:c.collapseToggle,"data-testid":"legend-toggle",icon:e?"chevron-up":"chevron-down",key:"collapse-toggle",onclick:this._onCollapseToggleClick,scale:"s",text:s,title:s})}_onCollapseToggleClick(){this.onExpandedToggle()}_renderLabelWithCheckbox(){const{line:e,checkboxVisible:t,disabled:s,messages:o}=this;return p("calcite-label",{class:c.label,disabled:s,key:`label-${e.id}`,layout:"inline"},t?this._renderCheckbox():null,a(e,o))}_renderCheckbox(){const{disabled:e,line:s,messages:o}=this,i=s.visible,r=i?o.hideProfile:o.showProfile,l=t(r,{name:a(s,o)});return p("calcite-checkbox",{checked:i,class:c.checkbox,disabled:e,title:l,onCalciteCheckboxChange:()=>s.toggleVisibility()})}};e([i()],h.prototype,"checkboxVisible",void 0),e([i()],h.prototype,"disabled",null),e([i({nonNullable:!0})],h.prototype,"effectiveUnits",void 0),e([i()],h.prototype,"expanded",void 0),e([i({nonNullable:!0})],h.prototype,"line",void 0),e([i()],h.prototype,"messages",void 0),e([i()],h.prototype,"onExpandedToggle",void 0),e([i()],h.prototype,"_statistics",void 0),h=e([r("esri.widgets.ElevationProfile.components.LegendItem")],h);export{h as LegendItem};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as t}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 r from"../../Widget.js";import{settingsCss as n}from"../css.js";import{loadCalciteComponents as i}from"../../support/componentsUtils.js";import{UnitSelect as s}from"../../support/UnitSelect.js";import"../../support/widgetUtils.js";import{tsx as c}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";let a=class extends r{constructor(){super(...arguments),this.messages=null,this._popoverIsOpen=!1,this._referenceElement=null,this._onUniformChartScalingChange=e=>{this.onUniformChartScalingChange(e.currentTarget.checked)}}loadDependencies(){return i({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover")})}render(){const{id:e,messages:t,visibleElements:o}=this,{unitSelector:r,uniformChartScalingToggle:i}=o;if(!t||!r&&!i)return c("div",{key:`${e}-empty`});const s=this._popoverIsOpen?t.hideSettings:t.showSettings;return c("div",{class:n.base,key:this},c("calcite-action",{afterCreate:e=>{this._referenceElement=e},appearance:"transparent","data-testid":"settings-button",icon:"gear",scale:"s",text:s,title:s}),this._referenceElement?c("calcite-popover",{autoClose:!0,label:s,placement:"bottom-end",referenceElement:this._referenceElement,onCalcitePopoverClose:()=>{this._popoverIsOpen=!1},onCalcitePopoverOpen:()=>{this._popoverIsOpen=!0}},this._renderPopoverContent()):null)}_renderPopoverContent(){const{unitSelector:e,uniformChartScalingToggle:t}=this.visibleElements;return c("div",{class:n.popoverContent},e?this._renderUnitSelector():null,t?this._renderUniformChartScalingToggle():null)}_renderUnitSelector(){const{messages:e}=this;return c(s,{key:"unit-selector-label",options:this.unitOptions,selectLabel:e?.unitSelectLabel??"",value:this.unit,onChange:this.onUnitChange})}_renderUniformChartScalingToggle(){const{messages:e}=this,t=this.uniformChartScaling,o=e?.[t?"uniformChartScalingDisable":"uniformChartScalingEnable"]??"";return c("calcite-label",{class:n.uniformChartScalingLabel,key:"uniform-chart-scaling-label",layout:"inline"},c("calcite-checkbox",{checked:t,class:n.uniformChartScalingCheckbox,title:o,onCalciteCheckboxChange:this._onUniformChartScalingChange}),e?.uniformChartScalingLabel)}};e([t()],a.prototype,"messages",void 0),e([t()],a.prototype,"onUniformChartScalingChange",void 0),e([t()],a.prototype,"onUnitChange",void 0),e([t()],a.prototype,"uniformChartScaling",void 0),e([t()],a.prototype,"unit",void 0),e([t()],a.prototype,"unitOptions",void 0),e([t()],a.prototype,"visibleElements",void 0),e([t()],a.prototype,"_popoverIsOpen",void 0),e([t()],a.prototype,"_referenceElement",void 0),a=e([o("esri.widgets.ElevationProfile.components.SettingsButton")],a);export{a as SettingsButton};
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 n from"../../Widget.js";import{settingsCss as r}from"../css.js";import{loadCalciteComponents as i}from"../../support/componentsUtils.js";import{UnitSelect as s}from"../../support/UnitSelect.js";import{tsx as c}from"../../support/widget.js";let a=class extends n{constructor(){super(...arguments),this.messages=null,this._popoverIsOpen=!1,this._referenceElement=null,this._onUniformChartScalingChange=e=>{this.onUniformChartScalingChange(e.currentTarget.checked)}}loadDependencies(){return i({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover")})}render(){const{id:e,messages:t,visibleElements:o}=this,{unitSelector:n,uniformChartScalingToggle:i}=o;if(!t||!n&&!i)return c("div",{key:`${e}-empty`});const s=this._popoverIsOpen?t.hideSettings:t.showSettings;return c("div",{class:r.base,key:this},c("calcite-action",{afterCreate:e=>{this._referenceElement=e},appearance:"transparent","data-testid":"settings-button",icon:"gear",scale:"s",text:s,title:s}),this._referenceElement?c("calcite-popover",{autoClose:!0,label:s,placement:"bottom-end",referenceElement:this._referenceElement,onCalcitePopoverClose:()=>{this._popoverIsOpen=!1},onCalcitePopoverOpen:()=>{this._popoverIsOpen=!0}},this._renderPopoverContent()):null)}_renderPopoverContent(){const{unitSelector:e,uniformChartScalingToggle:t}=this.visibleElements;return c("div",{class:r.popoverContent},e?this._renderUnitSelector():null,t?this._renderUniformChartScalingToggle():null)}_renderUnitSelector(){const{messages:e}=this;return c(s,{key:"unit-selector-label",options:this.unitOptions,selectLabel:e?.unitSelectLabel??"",value:this.unit,onChange:this.onUnitChange})}_renderUniformChartScalingToggle(){const{messages:e}=this,t=this.uniformChartScaling,o=e?.[t?"uniformChartScalingDisable":"uniformChartScalingEnable"]??"";return c("calcite-label",{class:r.uniformChartScalingLabel,key:"uniform-chart-scaling-label",layout:"inline"},c("calcite-checkbox",{checked:t,class:r.uniformChartScalingCheckbox,title:o,onCalciteCheckboxChange:this._onUniformChartScalingChange}),e?.uniformChartScalingLabel)}};e([t()],a.prototype,"messages",void 0),e([t()],a.prototype,"onUniformChartScalingChange",void 0),e([t()],a.prototype,"onUnitChange",void 0),e([t()],a.prototype,"uniformChartScaling",void 0),e([t()],a.prototype,"unit",void 0),e([t()],a.prototype,"unitOptions",void 0),e([t()],a.prototype,"visibleElements",void 0),e([t()],a.prototype,"_popoverIsOpen",void 0),e([t()],a.prototype,"_referenceElement",void 0),a=e([o("esri.widgets.ElevationProfile.components.SettingsButton")],a);export{a as SettingsButton};
@@ -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{throttle as e}from"../../../core/throttle.js";import{formatDecimal as i,formatAngleDegrees as s}from"../../../core/unitFormatUtils.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 r}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../../Widget.js";import{statisticsCss as n}from"../css.js";import{getConfig as c,notAvailable as l}from"../support/constants.js";import{loadCalciteComponents as p}from"../../support/componentsUtils.js";import"../../support/widgetUtils.js";import{messageBundle as d}from"../../support/decorators/messageBundle.js";import{tsx as m}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const h=100;let u=class extends a{constructor(t,i){super(t,i),this._updateLayout=t=>{const e=t.parentElement,i=t.style.display;e?.removeChild(t),document.body.appendChild(t),t.style.display="block";let s=80;for(const o of t.childNodes)o instanceof HTMLElement&&(s=Math.max(s,o.offsetWidth));document.body.removeChild(t),e?.appendChild(t),t.style.display=i,t.style.setProperty("--max-width",`${s}px`)},this._updateLayoutThrottled=e(this._updateLayout,h)}loadDependencies(){return p({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}initialize(){this.addHandles(this._updateLayoutThrottled)}render(){return m("div",{afterCreate:this._updateLayout,afterUpdate:this._updateLayoutThrottled,bind:this,class:n.base},this._renderStatistics())}_renderStatistics(){const t=this._messages?.statistics;return t?[this._renderDistanceStatistic("maxDistance",t.maxDistance),this._renderElevationStatistic("elevationGain",t.gain),this._renderElevationStatistic("elevationLoss",t.loss),this._renderElevationStatistic("minElevation",t.minElevation),this._renderElevationStatistic("maxElevation",t.maxElevation),this._renderElevationStatistic("avgElevation",t.avgElevation),this._renderSlopeStatistic("maxPositiveSlope","maxNegativeSlope",t.maxSlope),this._renderSlopeStatistic("avgPositiveSlope","avgNegativeSlope",t.avgSlope)]:[]}_renderDistanceStatistic(t,e){const s=c().formatPrecision,o=this._renderValue(t,t=>{const e=this.effectiveUnits.distance;return i(this._messagesUnits,t,e,s)});return this._renderStatistic(e,o)}_renderElevationStatistic(t,e){const s=c().formatPrecision,o=this._renderValue(t,t=>{const e=this.effectiveUnits.elevation;return i(this._messagesUnits,t,e,s)});return this._renderStatistic(e,o)}_renderSlopeStatistic(t,e,i){const o=c().formatPrecision,r=m("div",{class:n.slopeValue,key:"slope-up"},m("calcite-icon",{icon:"arrow-up",scale:"s"}),this._renderValue(t,t=>s(t,"degrees","geographic","geographic",o)),m("calcite-icon",{icon:"arrow-down",scale:"s"}),this._renderValue(e,t=>s(t,"degrees","geographic","geographic",o)));return this._renderStatistic(i,r)}_renderStatistic(t,e){return m("div",{class:n.statistic},m("label",{class:n.statisticLabel},t),m("div",{class:n.statisticValue},e))}_renderValue(t,e){const i=this.line,s=1===i.progress?i.statistics:null,o=s?.[t];return null!=o?e(o):l}};t([o()],u.prototype,"effectiveUnits",void 0),t([o()],u.prototype,"line",void 0),t([o(),d("esri/widgets/ElevationProfile/t9n/ElevationProfile")],u.prototype,"_messages",void 0),t([o(),d("esri/core/t9n/Units")],u.prototype,"_messagesUnits",void 0),u=t([r("esri.widgets.ElevationProfile.components.Statistics")],u);export{u as Statistics};
5
+ import{__decorate as t}from"tslib";import{throttle as e}from"../../../core/throttle.js";import{formatDecimal as i,formatAngleDegrees as s}from"../../../core/unitFormatUtils.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 r}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../../Widget.js";import{statisticsCss as n}from"../css.js";import{getConfig as c,notAvailable as l}from"../support/constants.js";import{loadCalciteComponents as d}from"../../support/componentsUtils.js";import{messageBundle as p,tsx as m}from"../../support/widget.js";const h=100;let u=class extends a{constructor(t,i){super(t,i),this._updateLayout=t=>{const e=t.parentElement,i=t.style.display;e?.removeChild(t),document.body.appendChild(t),t.style.display="block";let s=80;for(const o of t.childNodes)o instanceof HTMLElement&&(s=Math.max(s,o.offsetWidth));document.body.removeChild(t),e?.appendChild(t),t.style.display=i,t.style.setProperty("--max-width",`${s}px`)},this._updateLayoutThrottled=e(this._updateLayout,h)}loadDependencies(){return d({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}initialize(){this.addHandles(this._updateLayoutThrottled)}render(){return m("div",{afterCreate:this._updateLayout,afterUpdate:this._updateLayoutThrottled,bind:this,class:n.base},this._renderStatistics())}_renderStatistics(){const t=this._messages?.statistics;return t?[this._renderDistanceStatistic("maxDistance",t.maxDistance),this._renderElevationStatistic("elevationGain",t.gain),this._renderElevationStatistic("elevationLoss",t.loss),this._renderElevationStatistic("minElevation",t.minElevation),this._renderElevationStatistic("maxElevation",t.maxElevation),this._renderElevationStatistic("avgElevation",t.avgElevation),this._renderSlopeStatistic("maxPositiveSlope","maxNegativeSlope",t.maxSlope),this._renderSlopeStatistic("avgPositiveSlope","avgNegativeSlope",t.avgSlope)]:[]}_renderDistanceStatistic(t,e){const s=c().formatPrecision,o=this._renderValue(t,t=>{const e=this.effectiveUnits.distance;return i(this._messagesUnits,t,e,s)});return this._renderStatistic(e,o)}_renderElevationStatistic(t,e){const s=c().formatPrecision,o=this._renderValue(t,t=>{const e=this.effectiveUnits.elevation;return i(this._messagesUnits,t,e,s)});return this._renderStatistic(e,o)}_renderSlopeStatistic(t,e,i){const o=c().formatPrecision,r=m("div",{class:n.slopeValue,key:"slope-up"},m("calcite-icon",{icon:"arrow-up",scale:"s"}),this._renderValue(t,t=>s(t,"degrees","geographic","geographic",o)),m("calcite-icon",{icon:"arrow-down",scale:"s"}),this._renderValue(e,t=>s(t,"degrees","geographic","geographic",o)));return this._renderStatistic(i,r)}_renderStatistic(t,e){return m("div",{class:n.statistic},m("label",{class:n.statisticLabel},t),m("div",{class:n.statisticValue},e))}_renderValue(t,e){const i=this.line,s=1===i.progress?i.statistics:null,o=s?.[t];return null!=o?e(o):l}};t([o()],u.prototype,"effectiveUnits",void 0),t([o()],u.prototype,"line",void 0),t([o(),p("esri/widgets/ElevationProfile/t9n/ElevationProfile")],u.prototype,"_messages",void 0),t([o(),p("esri/core/t9n/Units")],u.prototype,"_messagesUnits",void 0),u=t([r("esri.widgets.ElevationProfile.components.Statistics")],u);export{u as Statistics};
@@ -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*as t from"@amcharts/amcharts5/index.js";import{XYChart as i,ValueAxis as e,AxisRendererX as o,AxisRendererY as n,XYCursor as s,LineSeries as a}from"@amcharts/amcharts5/xy.js";import l from"@amcharts/amcharts5/themes/Dark.js";import r from"@amcharts/amcharts5/themes/Responsive.js";import"../../../intl.js";import{handlesGroup as d,makeHandle as c}from"../../../core/handleUtils.js";import"../../../core/has.js";import{throwIfAborted as p}from"../../../core/promiseUtils.js";import{signal as m}from"../../../core/signal.js";import{unitName as u,formatDecimal as x}from"../../../core/unitFormatUtils.js";import{convertUnit as f}from"../../../core/unitUtils.js";import{getEpsilon as g}from"../../../core/libs/gl-matrix-2/math/common.js";import{getConfig as h,notAvailable as A}from"./constants.js";import{getTranslatedLineTitle as v}from"./intlUtils.js";import{niceScale as b}from"./niceScale.js";import{binaryFindClosest as y}from"./profileUtils.js";import{createRoot as T}from"../../support/chartUtilsAm5.js";import{isRTL as L}from"../../support/widgetUtils.js";import{isDarkMode as M}from"../../../support/modeUtils.js";import{formatNumber as F}from"../../../intl/number.js";import{substitute as S}from"../../../intl/substitute.js";const P="#f8f8f8",X="#a9a9a9",Y="#323232",z="line",k="fill",C=15,j=12,w=.001,H=.1,B=.02,U={fontFamily:"Avenir Next",paddingBottom:j/2,paddingLeft:0,paddingRight:0,paddingTop:0,axisGridStroke:"#f4f4f4",axisLabelsFontSize:9,axisLabelsFontWeight:"400",axisLabelsColor:X,axisTooltipFontSize:12,axisTooltipBackgroundColor:Y,axisTooltipLabelColor:P,axisTooltipPaddingTop:Math.round(j/4),axisTooltipPaddingBottom:Math.round(j/4),axisTooltipPaddingHorizontal:Math.round(C/4),xAxisMinGridDistance:50,xAxisLabelsSpacing:Math.round(j/2),xAxisMinLabelPosition:.05,xAxisMaxLabelPosition:.9,yAxisMinGridDistance:30,yAxisLabelSpacing:Math.round(C/4),yAxisMinLabelPosition:0,yAxisMaxLabelPosition:.8,seriesTooltipFontSize:12,seriesTooltipBackgroundColor:P,seriesTooltipLabelColor:Y,seriesFillLighten:.9,seriesTooltipSpacing:j/2,seriesTooltipPaddingVertical:Math.round(C/4),seriesTooltipPaddingHorizontal:Math.round(C/4)},D={...U,axisGridStroke:Y,axisLabelsColor:X,axisTooltipBackgroundColor:Y,axisTooltipLabelColor:P,seriesTooltipBackgroundColor:Y,seriesTooltipLabelColor:P,seriesFillLighten:-.75},R={minX:void 0,maxX:void 0,minY:void 0,maxY:void 0};async function O(t){const s=await T(t.container);p(t.abortOptions);const a=M(t.container),c=a?D:U;s.setThemes(a?[r.new(s),l.new(s)]:[r.new(s)]);const u=L(t.container),x=s.container.children.push(i.new(s,{panX:!0,panY:!0,paddingTop:c.paddingTop,paddingBottom:c.paddingBottom,paddingLeft:u?c.paddingRight:c.paddingLeft,paddingRight:u?c.paddingLeft:c.paddingRight,maxTooltipDistance:-1}));x.zoomOutButton.set("forceHidden",!0);const f=x.xAxes.push(e.new(s,{renderer:o.new(s,{})})),g=x.yAxes.push(e.new(s,{renderer:n.new(s,{})})),h=m(null),A=m("loading"),v={chart:x,xAxis:f,yAxis:g,seriesInfos:new Map,messages:null,theme:c,pointerIsOver:!1,rtl:u,get state(){return A.value},get data(){return h.value},set data(t){h.value=t}};E(v),I(v),G(v);const b=d([et(v,t.onRangeChange),nt(v,t.onCursorPositionChange),gt(s.events.once("frameended",()=>{A.value="ready"})),gt(s)]);let y;return{destroy:()=>{b.remove(),A.value="destroyed"},update:t=>{t.data===v.data&&t.messages===v.messages||W(v)||V(v,t)},zoomOut:()=>$(v),test:y}}function W(t){return"destroyed"===t.state}function G({chart:t,xAxis:i,yAxis:e}){const o=s.new(t.root,{behavior:"none",xAxis:i,yAxis:e,snapToSeriesBy:"y"});o.lineY.set("visible",!1),t.set("cursor",o)}function E(i){const{chart:e,xAxis:o,theme:n}=i;o.setAll({extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:pt(i,"distance"),strictMinMax:!0,strictMinMaxSelection:!0}),o.axisHeader.set("forceHidden",!0);const s=o.get("renderer");s.setAll({inside:!1,minGridDistance:n.xAxisMinGridDistance}),s.labels.template.setAll({centerX:t.p0,centerY:t.p0,fill:t.color(n.axisLabelsColor),fontFamily:n.fontFamily,fontSize:n.axisLabelsFontSize,fontWeight:n.axisLabelsFontWeight,maxPosition:n.xAxisMaxLabelPosition,minPosition:n.xAxisMinLabelPosition,paddingLeft:0,paddingRight:0,paddingTop:n.xAxisLabelsSpacing});const a=o.set("tooltip",t.Tooltip.new(e.root,{paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0}));a.get("background")?.setAll({fill:t.color(n.axisTooltipBackgroundColor),stroke:void 0}),a.label.setAll({fill:t.color(n.axisTooltipLabelColor),fontFamily:n.fontFamily,fontSize:n.axisTooltipFontSize,paddingBottom:n.axisTooltipPaddingBottom,paddingLeft:n.axisTooltipPaddingHorizontal,paddingRight:n.axisTooltipPaddingHorizontal,paddingTop:n.axisTooltipPaddingTop,direction:i.rtl?"rtl":"ltr"}),s.grid.template.setAll({strokeOpacity:1,stroke:t.color(n.axisGridStroke)})}function I(i){const{yAxis:e,theme:o,rtl:n}=i;e.setAll({baseValue:h().noDataValue,extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:pt(i,"elevation"),strictMinMax:!0,strictMinMaxSelection:!0,tooltip:void 0}),e.axisHeader.set("visible",!1);const s=e.get("renderer");s.setAll({minGridDistance:o.yAxisMinGridDistance,opposite:n,inside:!0}),s.labels.template.setAll({centerX:t.p0,centerY:t.p100,fill:t.color(o.axisLabelsColor),fontFamily:o.fontFamily,fontSize:o.axisLabelsFontSize,fontWeight:o.axisLabelsFontWeight,maxPosition:o.yAxisMaxLabelPosition,minPosition:o.yAxisMinLabelPosition,paddingBottom:0,paddingLeft:n?0:o.yAxisLabelSpacing,paddingRight:n?o.yAxisLabelSpacing:0,paddingTop:0,textAlign:"start"}),s.grid.template.setAll({strokeOpacity:1,stroke:t.color(o.axisGridStroke)})}function V(t,i){if(W(t))return;const e=t.data??void 0,o=i.data??void 0;t.chart.get("cursor")?.set("forceHidden",!o?.refined);const n=e!==o,s=e?.effectiveUnits!==o?.effectiveUnits,a=e?.uniformScaling!==o?.uniformScaling;t.data=o,t.messages=i.messages,(n||s)&&(N(t),K(t)),a&&$(t),at(t)}function $(t){W(t)||(t.xAxis.zoom(0,1),t.yAxis.zoom(0,1))}function N(t){const{chart:i,data:e,xAxis:o,yAxis:n}=t,{minX:s,maxX:a,minY:l,maxY:r}=Z({data:e,pixelWidth:o.width(),pixelHeight:n.height()}),d=!!e?.uniformScaling,c=!!e?.refined;i.setAll({panX:!0,panY:d,pinchZoomX:c,pinchZoomY:c&&d,wheelX:"panX",wheelY:c?d?"zoomXY":"zoomX":"none"}),o.setAll({max:a,min:s,panX:!0,panY:!1,zoomX:!0,zoomY:d}),n.setAll({max:r,min:l,panX:!1,panY:d,zoomX:d,zoomY:d})}function Z({data:t,pixelWidth:i,pixelHeight:e}){if(null==t)return R;const o=t.statistics,n=0,s=o?.maxDistance;let a=o?.minElevation,l=o?.maxElevation;if(null==s||null==a||null==l)return R;const r=Math.max(s-n,w);let d=Math.max(l-a,w);const c=t.effectiveUnits;if(t.dynamicElevationRange){const t=f(r,c.distance,c.elevation);d=Math.max(d,t/h().maxChartRatio)}return a-=B*d,l=a+d+H*d,[a,l]=b(a,l,10),d=l-a,t.uniformScaling?q({data:t,bounds:{minX:n,maxX:s,minY:a,maxY:l},pixelWidth:i,pixelHeight:e,centered:!0}):{minX:n,maxX:n+r,minY:a,maxY:a+d}}function q({data:t,bounds:i,pixelWidth:e,pixelHeight:o,centered:n}){if(null==t)return i;let{minX:s,maxX:a,minY:l,maxY:r}=i;if(null==s||null==a||null==l||null==r)return R;const d=a-s,c=r-l,p=t.effectiveUnits,m=f(c,p.elevation,p.distance)/o/(d/e);return m>=1?[s,a]=J([s,a],m):[l,r]=J([l,r],1/m),{minX:s,maxX:a,minY:l,maxY:r}}function J([t,i],e,o){const n=(i-t)*e;{const e=(t+i)/2-n/2;return[e,e+n]}}function K(t){const{chart:i,data:e,seriesInfos:o,xAxis:n,yAxis:s}=t;if(null==e||0===e.lines.length)return void i.series.clear();const a=new Map,l=new Set(i.series.values),r=e.lines.length;for(let d=0;d<r;d++){const n=e.lines[d];let s=o.get(n.id);s?(s.fill&&l.delete(s.fill),l.delete(s.line)):(s=_(t,n),s.fill&&i.series.push(s.fill),i.series.push(s.line)),a.set(s.id,s);const c=r-d-1;s.fill?.set("layer",c),s.line.set("layer",r+c),Q(t,s,n)}t.seriesInfos=a;for(const d of l)i.series.removeValue(d);n.set("layer",r+1),s.set("layer",r+2)}function Q({theme:i},e,o){const n=t.color(o.color.toCss()),s=o.samples??[],a=s.length>0,{line:l,fill:r}=e;l.set("visible",a),l.set("stroke",n),r?.set("visible",a),r?.set("fill",t.Color.lighten(n,i.seriesFillLighten)),l.data.setAll(s),r?.data.setAll(s)}function _(t,i){const{id:e}=i,o=tt(t,`${z}-${e}`),n=it(t);o.setAll({dy:i.chartStrokeOffsetY,tooltip:n}),o.strokes.template.setAll({strokeWidth:i.chartStrokeWidth});let s=null;return i.chartFillEnabled&&(s=tt(t,`${k}-${e}`),s.fills.template.setAll({fillOpacity:1,visible:!0})),{id:e,line:o,fill:s}}function tt(t,i){return a.new(t.chart.root,{connect:!1,excludeFromTotal:!0,fill:void 0,id:i,stroke:void 0,valueXField:"distance",valueYField:"elevation",xAxis:t.xAxis,yAxis:t.yAxis})}function it({theme:i,chart:e,rtl:o}){const n=t.Tooltip.new(e.root,{autoTextColor:!1,forceHidden:!0,getFillFromSprite:!1,getLabelFillFromSprite:!1,pointerOrientation:"vertical",visible:!1}),s=i.seriesTooltipPaddingHorizontal,a=i.seriesTooltipPaddingVertical;return n.label.setAll({fill:t.color(i.seriesTooltipLabelColor),fontFamily:i.fontFamily,fontSize:i.seriesTooltipFontSize,paddingBottom:a,paddingLeft:s,paddingRight:s,paddingTop:a,textAlign:o?"end":"start",direction:"ltr"}),n.get("background")?.setAll({stroke:void 0,fill:t.color(i.seriesTooltipBackgroundColor)}),n.adapters.add("dy",t=>{const e=i.seriesTooltipSpacing,o=n.get("pointTo")?.y??0;return(t??0)+(n.y()>o?e:-e)}),n}function et(t,i){const{xAxis:e,yAxis:o}=t,n=()=>{i(ot(e),ot(o))},s=t=>[t.on("start",n),t.on("end",n)];return ft([...s(e),...s(o)])}function ot(t){const i=Math.abs((t.get("end")??0)-(t.get("start")??0)),e=0!==i?1/i:1;return Math.abs(1-e)<g()?1:e}function nt(t,i){const{chart:e,xAxis:o,yAxis:n}=t,s=e.get("cursor"),a=e.plotContainer.events,l=i=>{t.pointerIsOver=i,at(t)},r=()=>{l(!1),i(null,null)};return ft([s?.events.on("cursormoved",()=>{if(!t.pointerIsOver)return;at(t);let e=s?.getPrivate("positionX")??0,a=s?.getPrivate("positionY")??0;const l=t.data;if(null!=l?.statistics){const{maxDistance:t,minElevation:i,maxElevation:s}=l.statistics;let r,d;if(null!=t){1===ot(o)?(r=0,d=t):(r=ut(o),d=xt(o)),e=st(e,r,d,0,t)}if(null!=i&&null!=s){1===ot(n)?(r=i,d=s):(r=ut(n),d=xt(n)),a=st(a,r,d,i,s)}}i(e,a)}),a.on("pointerover",()=>l(!0)),a.on("pointerout",r),a.on("blur",r)])}function st(t,i,e,o,n){return(i+t*(e-i)-o)/(n-o)}function at(t){const i=lt(t);if(!i)return void t.seriesInfos.forEach(t=>{t.line.get("tooltip")?.set("forceHidden",!0)});t.seriesInfos.forEach(t=>{const e=t.line.get("tooltip");e.set("forceHidden",!1),e.label.set("text",i)});t.xAxis.getTooltip().setAll({tooltipText:ct(t)})}function lt(t){const{data:i}=t,e=i?.lines.map(i=>({line:i,y:mt(t,i)?.elevation})).sort(rt);return e&&0!==e.length&&null!=e[0].y?e.map(({y:i,line:e})=>dt(t,e,i)).join("\n"):null}function rt({y:t},{y:i}){return null==t?1:null==i?-1:i-t}function dt(t,i,e){const{data:o,messages:n}=t;if(null==o||null==n)return"";const s=`[${i.color.toHex()}]●[/]`,a=" ",l=h().formatPrecision,r=S(n.chartTooltip,{name:v(i,n),elevation:null!=e?x(n,e,o.effectiveUnits.elevation,l):A});return t.rtl?r+a+s:s+a+r}function ct(t){const{data:i,messages:e}=t;if(null==i||null==e)return"";const o=i.lines[0],n=o?mt(t,o):null,s=h().formatPrecision;return null!=n?x(e,n.distance,i.effectiveUnits.distance,s):"-"}function pt(i,e){const o=t.NumberFormatter.new(i.chart.root,{});return o.format=(t,o,n)=>{const{data:s,messages:a}=i;if(null==a||null==s||"string"==typeof t)return"";return`${F(t,{maximumFractionDigits:n})} ${u(a,s.effectiveUnits[e],"abbr")}`},o}function mt({chart:t,xAxis:i},e){const o=e.samples??[];if(0===o.length)return null;const n=t.get("cursor"),s=n?.getPrivate("positionX")??0,a=i.toAxisPosition(s),l=i.positionToValue(a);return y(o,l,t=>t.distance)}function ut(t){return t.positionToValue(t.get("start")??0)}function xt(t){return t.positionToValue(t.get("end")??1)}function ft(t){return d(t.map(gt))}function gt(t){return c(()=>{t?.dispose()})}export{O as createChart,Z as getAdjustedBounds};
5
+ import*as t from"@amcharts/amcharts5/index.js";import{XYChart as i,ValueAxis as e,AxisRendererX as o,AxisRendererY as n,XYCursor as s,LineSeries as a}from"@amcharts/amcharts5/xy.js";import l from"@amcharts/amcharts5/themes/Dark.js";import r from"@amcharts/amcharts5/themes/Responsive.js";import{formatNumber as d,substitute as c}from"../../../intl.js";import{handlesGroup as p,makeHandle as m}from"../../../core/handleUtils.js";import"../../../core/has.js";import{throwIfAborted as u}from"../../../core/promiseUtils.js";import{signal as x}from"../../../core/signal.js";import{unitName as f,formatDecimal as g}from"../../../core/unitFormatUtils.js";import{convertUnit as h}from"../../../core/unitUtils.js";import{getEpsilon as A}from"../../../core/libs/gl-matrix-2/math/common.js";import{isDarkMode as v}from"../../../support/modeUtils.js";import{getConfig as b,notAvailable as y}from"./constants.js";import{getTranslatedLineTitle as T}from"./intlUtils.js";import{niceScale as L}from"./niceScale.js";import{binaryFindClosest as M}from"./profileUtils.js";import{createRoot as F}from"../../support/chartUtilsAm5.js";import{isRTL as S}from"../../support/widget.js";const P="#f8f8f8",X="#a9a9a9",Y="#323232",z="line",k="fill",C=15,w=12,j=.001,H=.1,B=.02,U={fontFamily:"Avenir Next",paddingBottom:w/2,paddingLeft:0,paddingRight:0,paddingTop:0,axisGridStroke:"#f4f4f4",axisLabelsFontSize:9,axisLabelsFontWeight:"400",axisLabelsColor:X,axisTooltipFontSize:12,axisTooltipBackgroundColor:Y,axisTooltipLabelColor:P,axisTooltipPaddingTop:Math.round(w/4),axisTooltipPaddingBottom:Math.round(w/4),axisTooltipPaddingHorizontal:Math.round(C/4),xAxisMinGridDistance:50,xAxisLabelsSpacing:Math.round(w/2),xAxisMinLabelPosition:.05,xAxisMaxLabelPosition:.9,yAxisMinGridDistance:30,yAxisLabelSpacing:Math.round(C/4),yAxisMinLabelPosition:0,yAxisMaxLabelPosition:.8,seriesTooltipFontSize:12,seriesTooltipBackgroundColor:P,seriesTooltipLabelColor:Y,seriesFillLighten:.9,seriesTooltipSpacing:w/2,seriesTooltipPaddingVertical:Math.round(C/4),seriesTooltipPaddingHorizontal:Math.round(C/4)},D={...U,axisGridStroke:Y,axisLabelsColor:X,axisTooltipBackgroundColor:Y,axisTooltipLabelColor:P,seriesTooltipBackgroundColor:Y,seriesTooltipLabelColor:P,seriesFillLighten:-.75},R={minX:void 0,maxX:void 0,minY:void 0,maxY:void 0};async function O(t){const s=await F(t.container);u(t.abortOptions);const a=v(t.container),d=a?D:U;s.setThemes(a?[r.new(s),l.new(s)]:[r.new(s)]);const c=S(t.container),m=s.container.children.push(i.new(s,{panX:!0,panY:!0,paddingTop:d.paddingTop,paddingBottom:d.paddingBottom,paddingLeft:c?d.paddingRight:d.paddingLeft,paddingRight:c?d.paddingLeft:d.paddingRight,maxTooltipDistance:-1}));m.zoomOutButton.set("forceHidden",!0);const f=m.xAxes.push(e.new(s,{renderer:o.new(s,{})})),g=m.yAxes.push(e.new(s,{renderer:n.new(s,{})})),h=x(null),A=x("loading"),b={chart:m,xAxis:f,yAxis:g,seriesInfos:new Map,messages:null,theme:d,pointerIsOver:!1,rtl:c,get state(){return A.value},get data(){return h.value},set data(t){h.value=t}};E(b),I(b),G(b);const y=p([et(b,t.onRangeChange),nt(b,t.onCursorPositionChange),gt(s.events.once("frameended",()=>{A.value="ready"})),gt(s)]);let T;return{destroy:()=>{y.remove(),A.value="destroyed"},update:t=>{t.data===b.data&&t.messages===b.messages||W(b)||V(b,t)},zoomOut:()=>$(b),test:T}}function W(t){return"destroyed"===t.state}function G({chart:t,xAxis:i,yAxis:e}){const o=s.new(t.root,{behavior:"none",xAxis:i,yAxis:e,snapToSeriesBy:"y"});o.lineY.set("visible",!1),t.set("cursor",o)}function E(i){const{chart:e,xAxis:o,theme:n}=i;o.setAll({extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:pt(i,"distance"),strictMinMax:!0,strictMinMaxSelection:!0}),o.axisHeader.set("forceHidden",!0);const s=o.get("renderer");s.setAll({inside:!1,minGridDistance:n.xAxisMinGridDistance}),s.labels.template.setAll({centerX:t.p0,centerY:t.p0,fill:t.color(n.axisLabelsColor),fontFamily:n.fontFamily,fontSize:n.axisLabelsFontSize,fontWeight:n.axisLabelsFontWeight,maxPosition:n.xAxisMaxLabelPosition,minPosition:n.xAxisMinLabelPosition,paddingLeft:0,paddingRight:0,paddingTop:n.xAxisLabelsSpacing});const a=o.set("tooltip",t.Tooltip.new(e.root,{paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0}));a.get("background")?.setAll({fill:t.color(n.axisTooltipBackgroundColor),stroke:void 0}),a.label.setAll({fill:t.color(n.axisTooltipLabelColor),fontFamily:n.fontFamily,fontSize:n.axisTooltipFontSize,paddingBottom:n.axisTooltipPaddingBottom,paddingLeft:n.axisTooltipPaddingHorizontal,paddingRight:n.axisTooltipPaddingHorizontal,paddingTop:n.axisTooltipPaddingTop,direction:i.rtl?"rtl":"ltr"}),s.grid.template.setAll({strokeOpacity:1,stroke:t.color(n.axisGridStroke)})}function I(i){const{yAxis:e,theme:o,rtl:n}=i;e.setAll({baseValue:b().noDataValue,extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:pt(i,"elevation"),strictMinMax:!0,strictMinMaxSelection:!0,tooltip:void 0}),e.axisHeader.set("visible",!1);const s=e.get("renderer");s.setAll({minGridDistance:o.yAxisMinGridDistance,opposite:n,inside:!0}),s.labels.template.setAll({centerX:t.p0,centerY:t.p100,fill:t.color(o.axisLabelsColor),fontFamily:o.fontFamily,fontSize:o.axisLabelsFontSize,fontWeight:o.axisLabelsFontWeight,maxPosition:o.yAxisMaxLabelPosition,minPosition:o.yAxisMinLabelPosition,paddingBottom:0,paddingLeft:n?0:o.yAxisLabelSpacing,paddingRight:n?o.yAxisLabelSpacing:0,paddingTop:0,textAlign:"start"}),s.grid.template.setAll({strokeOpacity:1,stroke:t.color(o.axisGridStroke)})}function V(t,i){if(W(t))return;const e=t.data??void 0,o=i.data??void 0;t.chart.get("cursor")?.set("forceHidden",!o?.refined);const n=e!==o,s=e?.effectiveUnits!==o?.effectiveUnits,a=e?.uniformScaling!==o?.uniformScaling;t.data=o,t.messages=i.messages,(n||s)&&(N(t),K(t)),a&&$(t),at(t)}function $(t){W(t)||(t.xAxis.zoom(0,1),t.yAxis.zoom(0,1))}function N(t){const{chart:i,data:e,xAxis:o,yAxis:n}=t,{minX:s,maxX:a,minY:l,maxY:r}=Z({data:e,pixelWidth:o.width(),pixelHeight:n.height()}),d=!!e?.uniformScaling,c=!!e?.refined;i.setAll({panX:!0,panY:d,pinchZoomX:c,pinchZoomY:c&&d,wheelX:"panX",wheelY:c?d?"zoomXY":"zoomX":"none"}),o.setAll({max:a,min:s,panX:!0,panY:!1,zoomX:!0,zoomY:d}),n.setAll({max:r,min:l,panX:!1,panY:d,zoomX:d,zoomY:d})}function Z({data:t,pixelWidth:i,pixelHeight:e}){if(null==t)return R;const o=t.statistics,n=0,s=o?.maxDistance;let a=o?.minElevation,l=o?.maxElevation;if(null==s||null==a||null==l)return R;const r=Math.max(s-n,j);let d=Math.max(l-a,j);const c=t.effectiveUnits;if(t.dynamicElevationRange){const t=h(r,c.distance,c.elevation);d=Math.max(d,t/b().maxChartRatio)}return a-=B*d,l=a+d+H*d,[a,l]=L(a,l,10),d=l-a,t.uniformScaling?q({data:t,bounds:{minX:n,maxX:s,minY:a,maxY:l},pixelWidth:i,pixelHeight:e,centered:!0}):{minX:n,maxX:n+r,minY:a,maxY:a+d}}function q({data:t,bounds:i,pixelWidth:e,pixelHeight:o,centered:n}){if(null==t)return i;let{minX:s,maxX:a,minY:l,maxY:r}=i;if(null==s||null==a||null==l||null==r)return R;const d=a-s,c=r-l,p=t.effectiveUnits,m=h(c,p.elevation,p.distance)/o/(d/e);return m>=1?[s,a]=J([s,a],m):[l,r]=J([l,r],1/m),{minX:s,maxX:a,minY:l,maxY:r}}function J([t,i],e,o){const n=(i-t)*e;{const e=(t+i)/2-n/2;return[e,e+n]}}function K(t){const{chart:i,data:e,seriesInfos:o,xAxis:n,yAxis:s}=t;if(null==e||0===e.lines.length)return void i.series.clear();const a=new Map,l=new Set(i.series.values),r=e.lines.length;for(let d=0;d<r;d++){const n=e.lines[d];let s=o.get(n.id);s?(s.fill&&l.delete(s.fill),l.delete(s.line)):(s=_(t,n),s.fill&&i.series.push(s.fill),i.series.push(s.line)),a.set(s.id,s);const c=r-d-1;s.fill?.set("layer",c),s.line.set("layer",r+c),Q(t,s,n)}t.seriesInfos=a;for(const d of l)i.series.removeValue(d);n.set("layer",r+1),s.set("layer",r+2)}function Q({theme:i},e,o){const n=t.color(o.color.toCss()),s=o.samples??[],a=s.length>0,{line:l,fill:r}=e;l.set("visible",a),l.set("stroke",n),r?.set("visible",a),r?.set("fill",t.Color.lighten(n,i.seriesFillLighten)),l.data.setAll(s),r?.data.setAll(s)}function _(t,i){const{id:e}=i,o=tt(t,`${z}-${e}`),n=it(t);o.setAll({dy:i.chartStrokeOffsetY,tooltip:n}),o.strokes.template.setAll({strokeWidth:i.chartStrokeWidth});let s=null;return i.chartFillEnabled&&(s=tt(t,`${k}-${e}`),s.fills.template.setAll({fillOpacity:1,visible:!0})),{id:e,line:o,fill:s}}function tt(t,i){return a.new(t.chart.root,{connect:!1,excludeFromTotal:!0,fill:void 0,id:i,stroke:void 0,valueXField:"distance",valueYField:"elevation",xAxis:t.xAxis,yAxis:t.yAxis})}function it({theme:i,chart:e,rtl:o}){const n=t.Tooltip.new(e.root,{autoTextColor:!1,forceHidden:!0,getFillFromSprite:!1,getLabelFillFromSprite:!1,pointerOrientation:"vertical",visible:!1}),s=i.seriesTooltipPaddingHorizontal,a=i.seriesTooltipPaddingVertical;return n.label.setAll({fill:t.color(i.seriesTooltipLabelColor),fontFamily:i.fontFamily,fontSize:i.seriesTooltipFontSize,paddingBottom:a,paddingLeft:s,paddingRight:s,paddingTop:a,textAlign:o?"end":"start",direction:"ltr"}),n.get("background")?.setAll({stroke:void 0,fill:t.color(i.seriesTooltipBackgroundColor)}),n.adapters.add("dy",t=>{const e=i.seriesTooltipSpacing,o=n.get("pointTo")?.y??0;return(t??0)+(n.y()>o?e:-e)}),n}function et(t,i){const{xAxis:e,yAxis:o}=t,n=()=>{i(ot(e),ot(o))},s=t=>[t.on("start",n),t.on("end",n)];return ft([...s(e),...s(o)])}function ot(t){const i=Math.abs((t.get("end")??0)-(t.get("start")??0)),e=0!==i?1/i:1;return Math.abs(1-e)<A()?1:e}function nt(t,i){const{chart:e,xAxis:o,yAxis:n}=t,s=e.get("cursor"),a=e.plotContainer.events,l=i=>{t.pointerIsOver=i,at(t)},r=()=>{l(!1),i(null,null)};return ft([s?.events.on("cursormoved",()=>{if(!t.pointerIsOver)return;at(t);let e=s?.getPrivate("positionX")??0,a=s?.getPrivate("positionY")??0;const l=t.data;if(null!=l?.statistics){const{maxDistance:t,minElevation:i,maxElevation:s}=l.statistics;let r,d;if(null!=t){1===ot(o)?(r=0,d=t):(r=ut(o),d=xt(o)),e=st(e,r,d,0,t)}if(null!=i&&null!=s){1===ot(n)?(r=i,d=s):(r=ut(n),d=xt(n)),a=st(a,r,d,i,s)}}i(e,a)}),a.on("pointerover",()=>l(!0)),a.on("pointerout",r),a.on("blur",r)])}function st(t,i,e,o,n){return(i+t*(e-i)-o)/(n-o)}function at(t){const i=lt(t);if(!i)return void t.seriesInfos.forEach(t=>{t.line.get("tooltip")?.set("forceHidden",!0)});t.seriesInfos.forEach(t=>{const e=t.line.get("tooltip");e.set("forceHidden",!1),e.label.set("text",i)});t.xAxis.getTooltip().setAll({tooltipText:ct(t)})}function lt(t){const{data:i}=t,e=i?.lines.map(i=>({line:i,y:mt(t,i)?.elevation})).sort(rt);return e&&0!==e.length&&null!=e[0].y?e.map(({y:i,line:e})=>dt(t,e,i)).join("\n"):null}function rt({y:t},{y:i}){return null==t?1:null==i?-1:i-t}function dt(t,i,e){const{data:o,messages:n}=t;if(null==o||null==n)return"";const s=`[${i.color.toHex()}]●[/]`,a=" ",l=b().formatPrecision,r=c(n.chartTooltip,{name:T(i,n),elevation:null!=e?g(n,e,o.effectiveUnits.elevation,l):y});return t.rtl?r+a+s:s+a+r}function ct(t){const{data:i,messages:e}=t;if(null==i||null==e)return"";const o=i.lines[0],n=o?mt(t,o):null,s=b().formatPrecision;return null!=n?g(e,n.distance,i.effectiveUnits.distance,s):"-"}function pt(i,e){const o=t.NumberFormatter.new(i.chart.root,{});return o.format=(t,o,n)=>{const{data:s,messages:a}=i;if(null==a||null==s||"string"==typeof t)return"";return`${d(t,{maximumFractionDigits:n})} ${f(a,s.effectiveUnits[e],"abbr")}`},o}function mt({chart:t,xAxis:i},e){const o=e.samples??[];if(0===o.length)return null;const n=t.get("cursor"),s=n?.getPrivate("positionX")??0,a=i.toAxisPosition(s),l=i.positionToValue(a);return M(o,l,t=>t.distance)}function ut(t){return t.positionToValue(t.get("start")??0)}function xt(t){return t.positionToValue(t.get("end")??1)}function ft(t){return p(t.map(gt))}function gt(t){return m(()=>{t?.dispose()})}export{O as createChart,Z as getAdjustedBounds};