@arcgis/core 5.0.0-next.42 → 5.0.0-next.44

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 (384) hide show
  1. package/applications/Components/imageryUtils.js +1 -1
  2. package/arcade/featureset/sources/FeatureLayerOGC.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{f97a7cb367634353177d.js → 001a7a4cf6fe74432ed6.js} +1 -1
  5. package/assets/esri/core/workers/chunks/00ff4ca88c9d291d82c3.js +1 -0
  6. package/assets/esri/core/workers/chunks/04a0685ee53ef74883aa.js +1 -0
  7. package/assets/esri/core/workers/chunks/{c320a29df40e85fb4a8e.js → 15a0750c10b510564a42.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{9d95f38da21f97214f83.js → 1e0e7cef7ef947894bbe.js} +10 -10
  9. package/assets/esri/core/workers/chunks/20ad34f9d45c64392022.js +1 -0
  10. package/assets/esri/core/workers/chunks/23396a6318edf9264c1f.js +1 -0
  11. package/assets/esri/core/workers/chunks/{816227de5bd42b437df4.js → 233f9eb617f3d72995b5.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{fb9643b74cf35221ff98.js → 249504f7d356be80d214.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{ad891ac388fa6c1c9b94.js → 2b34a010f76e5f289868.js} +1 -1
  14. package/assets/esri/core/workers/chunks/2ef4c0092c59a98a5532.js +1 -0
  15. package/assets/esri/core/workers/chunks/35272810c2ed04eb403d.js +1 -0
  16. package/assets/esri/core/workers/chunks/{4f4d51181ae7db9fbe6d.js → 4404b6f931f681cca342.js} +1 -1
  17. package/assets/esri/core/workers/chunks/555a0ea44ba77819d493.js +1 -0
  18. package/assets/esri/core/workers/chunks/6e8925412fb90f88d688.js +1 -0
  19. package/assets/esri/core/workers/chunks/{d1f4152b2b8d47cbf586.js → 72fbee59d5d909615408.js} +1 -1
  20. package/assets/esri/core/workers/chunks/75c66e38bdc1c786c599.js +1 -0
  21. package/assets/esri/core/workers/chunks/7d3c2a063598bdd015e2.js +1 -0
  22. package/assets/esri/core/workers/chunks/83da9ee6544ee9d3c124.js +1 -0
  23. package/assets/esri/core/workers/chunks/897ce6fc9cefb1e14a64.js +1 -0
  24. package/assets/esri/core/workers/chunks/{da517b4b07d4d27ce94c.js → 8e26831f71634288f834.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{c367c7e553be3682f2db.js → 93c5f097bb7b380bb175.js} +1 -1
  26. package/assets/esri/core/workers/chunks/992e9bbdf9d3787ddb0e.js +1 -0
  27. package/assets/esri/core/workers/chunks/9c7682b300b877f60095.js +1 -0
  28. package/assets/esri/core/workers/chunks/a2442549c5daf3653eb4.js +1 -0
  29. package/assets/esri/core/workers/chunks/a7cd795042ebb8585906.js +1 -0
  30. package/assets/esri/core/workers/chunks/{f3b3b193959db809c8c6.js → ab520fd1ae917daf07d8.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{2c9865e34f32fb5683e5.js → af8d6e6949930d0e6c7b.js} +1 -1
  32. package/assets/esri/core/workers/chunks/c9942ca57f542582ab4d.js +1 -0
  33. package/assets/esri/core/workers/chunks/ca1c65eb7f5900c60170.js +1 -0
  34. package/assets/esri/core/workers/chunks/cddce67919e13e2f365e.js +1 -0
  35. package/assets/esri/core/workers/chunks/da2ba40bc017bff0fe49.js +1 -0
  36. package/assets/esri/core/workers/chunks/e5a6a646f27715152714.js +1 -0
  37. package/assets/esri/core/workers/chunks/e6784251bbb8b71ead93.js +1 -0
  38. package/assets/esri/core/workers/chunks/e8a9971c8354569cb81d.js +1 -0
  39. package/assets/esri/core/workers/chunks/{96f798ee286b59396131.js → ea3cba01c60d9bc72719.js} +1 -1
  40. package/assets/esri/core/workers/chunks/ed550bf27f2bbf8d30fa.js +1 -0
  41. package/assets/esri/core/workers/chunks/ee186ddbb1eb5144a790.js +1 -0
  42. package/assets/esri/core/workers/chunks/{1357cc637524cd254974.js → ffcdc7ae03b0570e0db8.js} +1 -1
  43. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  44. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  45. package/assets/esri/themes/base/widgets/_Attribution.scss +1 -1
  46. package/assets/esri/themes/dark/main.css +1 -1
  47. package/assets/esri/themes/light/main.css +1 -1
  48. package/assets/esri/themes/light/view.css +1 -1
  49. package/config.js +1 -1
  50. package/core/PooledArray.js +1 -1
  51. package/geometry/FlatGeometry.js +1 -1
  52. package/geometry/support/MeshMaterialMetallicRoughness.js +1 -1
  53. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  54. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  55. package/interfaces.d.ts +109 -37
  56. package/kernel.js +1 -1
  57. package/layers/ImageryTileLayer.js +1 -1
  58. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  59. package/layers/WCSLayer.js +1 -1
  60. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  61. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  62. package/layers/mixins/ArcGISImageService.js +1 -1
  63. package/layers/mixins/ImageryTileMixin.js +1 -1
  64. package/layers/mixins/RasterJobHandlerMixin.js +1 -1
  65. package/layers/ogc/wcsUtils.js +1 -1
  66. package/layers/raster/datasets/BaseRaster.js +5 -0
  67. package/layers/raster/datasets/CovJSONRaster.js +5 -0
  68. package/layers/raster/datasets/FunctionRaster.js +5 -0
  69. package/layers/raster/datasets/ImageAuxRaster.js +5 -0
  70. package/layers/raster/datasets/ImageServerRaster.js +5 -0
  71. package/layers/raster/datasets/InMemoryRaster.js +5 -0
  72. package/layers/raster/datasets/MRFRaster.js +5 -0
  73. package/layers/raster/datasets/RawBlockCache.js +5 -0
  74. package/layers/raster/datasets/TIFFRaster.js +5 -0
  75. package/layers/raster/datasets/WCSRaster.js +5 -0
  76. package/layers/raster/datasets/covJSONParser.js +5 -0
  77. package/layers/raster/datasets/multidimensionalUtils.js +5 -0
  78. package/layers/raster/datasets/pamParser.js +5 -0
  79. package/layers/raster/datasets/pixelReader.js +5 -0
  80. package/layers/raster/datasets/wcsCoverageParser.js +5 -0
  81. package/layers/raster/formats/Lerc.js +5 -0
  82. package/layers/raster/formats/Qb3.js +5 -0
  83. package/layers/raster/formats/RasterCodec.js +5 -0
  84. package/layers/raster/formats/TiffDecoder.js +5 -0
  85. package/layers/raster/functions/ArithmeticFunction.js +5 -0
  86. package/layers/{support/rasterFunctions → raster/functions}/ArithmeticFunctionArguments.js +1 -1
  87. package/layers/{support/rasterFunctions → raster/functions}/AspectFunction.js +1 -1
  88. package/layers/{support/rasterFunctions → raster/functions}/AspectFunctionArguments.js +1 -1
  89. package/layers/raster/functions/BandArithmeticFunction.js +5 -0
  90. package/layers/{support/rasterFunctions → raster/functions}/BandArithmeticFunctionArguments.js +1 -1
  91. package/layers/{support/rasterFunctions → raster/functions}/BaseFunctionArguments.js +1 -1
  92. package/layers/raster/functions/BaseRasterFunction.js +5 -0
  93. package/layers/{support/rasterFunctions → raster/functions}/ClipFunction.js +1 -1
  94. package/layers/{support/rasterFunctions → raster/functions}/ClipFunctionArguments.js +1 -1
  95. package/layers/raster/functions/ColormapFunction.js +5 -0
  96. package/layers/{support/rasterFunctions → raster/functions}/ColormapFunctionArguments.js +1 -1
  97. package/layers/raster/functions/ColormapToRGBFunction.js +5 -0
  98. package/layers/{support/rasterFunctions → raster/functions}/ColormapToRGBFunctionArguments.js +1 -1
  99. package/layers/raster/functions/CompositeBandFunction.js +5 -0
  100. package/layers/raster/functions/CompositeBandFunctionArguments.js +5 -0
  101. package/layers/raster/functions/ComputeChangeFunction.js +5 -0
  102. package/layers/{support/rasterFunctions → raster/functions}/ComputeChangeFunctionArguments.js +1 -1
  103. package/layers/{support/rasterFunctions → raster/functions}/ContrastBrightnessFunction.js +1 -1
  104. package/layers/{support/rasterFunctions → raster/functions}/ContrastBrightnessFunctionArguments.js +1 -1
  105. package/layers/raster/functions/ConvolutionFunction.js +5 -0
  106. package/layers/raster/functions/ConvolutionFunctionArguments.js +5 -0
  107. package/layers/{support/rasterFunctions → raster/functions}/CurvatureFunction.js +1 -1
  108. package/layers/{support/rasterFunctions → raster/functions}/CurvatureFunctionArguments.js +1 -1
  109. package/layers/{support/rasterFunctions → raster/functions}/ExtractBandFunction.js +1 -1
  110. package/layers/{support/rasterFunctions → raster/functions}/ExtractBandFunctionArguments.js +1 -1
  111. package/layers/{support/rasterFunctions → raster/functions}/GrayscaleFunction.js +1 -1
  112. package/layers/{support/rasterFunctions → raster/functions}/GrayscaleFunctionArguments.js +1 -1
  113. package/layers/raster/functions/HillshadeFunction.js +5 -0
  114. package/layers/{support/rasterFunctions → raster/functions}/HillshadeFunctionArguments.js +1 -1
  115. package/layers/raster/functions/LocalFunction.js +5 -0
  116. package/layers/{support/rasterFunctions → raster/functions}/LocalFunctionArguments.js +1 -1
  117. package/layers/{support/rasterFunctions → raster/functions}/MaskFunction.js +1 -1
  118. package/layers/{support/rasterFunctions → raster/functions}/MaskFunctionArguments.js +1 -1
  119. package/layers/{support/rasterFunctions → raster/functions}/NDVIFunction.js +1 -1
  120. package/layers/{support/rasterFunctions → raster/functions}/NDVIFunctionArguments.js +1 -1
  121. package/layers/raster/functions/RemapFunction.js +5 -0
  122. package/layers/{support/rasterFunctions → raster/functions}/RemapFunctionArguments.js +1 -1
  123. package/layers/raster/functions/ShadedReliefFunction.js +5 -0
  124. package/layers/{support/rasterFunctions → raster/functions}/ShadedReliefFunctionArguments.js +1 -1
  125. package/layers/raster/functions/SlopeFunction.js +5 -0
  126. package/layers/{support/rasterFunctions → raster/functions}/SlopeFunctionArguments.js +1 -1
  127. package/layers/raster/functions/StatisticsFunction.js +5 -0
  128. package/layers/{support/rasterFunctions → raster/functions}/StatisticsFunctionArguments.js +1 -1
  129. package/layers/{support/rasterFunctions → raster/functions}/StatisticsHistogramFunction.js +1 -1
  130. package/layers/{support/rasterFunctions → raster/functions}/StatisticsHistogramFunctionArguments.js +1 -1
  131. package/layers/raster/functions/StretchFunction.js +5 -0
  132. package/layers/{support/rasterFunctions → raster/functions}/StretchFunctionArguments.js +1 -1
  133. package/layers/{support/rasterFunctions → raster/functions}/TableFunction.js +1 -1
  134. package/layers/{support/rasterFunctions → raster/functions}/TableFunctionArguments.js +1 -1
  135. package/layers/raster/functions/bandIndexUtils.js +5 -0
  136. package/layers/raster/functions/changeDetectionUtils.js +5 -0
  137. package/layers/raster/functions/clipUtils.js +5 -0
  138. package/layers/raster/functions/conversionUtils.js +5 -0
  139. package/layers/raster/functions/convolutionUtils.js +5 -0
  140. package/layers/raster/functions/creators/createDataManagementFunctions.js +5 -0
  141. package/layers/raster/functions/creators/utils.js +5 -0
  142. package/layers/raster/functions/focalStatUtils.js +5 -0
  143. package/layers/raster/functions/localUtils.js +5 -0
  144. package/layers/raster/functions/pixelTransformUtils.js +5 -0
  145. package/layers/raster/functions/pixelUtils.js +5 -0
  146. package/layers/raster/functions/stretchUtils.js +5 -0
  147. package/layers/raster/functions/surfaceUtils.js +5 -0
  148. package/layers/raster/functions/vectorFieldUtils.js +5 -0
  149. package/layers/raster/transforms/BaseRasterTransform.js +5 -0
  150. package/layers/{support/rasterTransforms → raster/transforms}/GCSShiftTransform.js +1 -1
  151. package/layers/{support/rasterTransforms → raster/transforms}/IdentityTransform.js +1 -1
  152. package/layers/{support/rasterTransforms → raster/transforms}/PolynomialTransform.js +1 -1
  153. package/layers/save/imageryUtils.js +1 -1
  154. package/layers/support/PixelBlock.js +1 -1
  155. package/layers/support/RasterWorker.js +1 -1
  156. package/layers/support/imageryRendererUtils.js +1 -1
  157. package/layers/support/rasterFunctionUtils.js +1 -1
  158. package/package.json +1 -1
  159. package/renderers/VectorFieldRenderer.js +1 -1
  160. package/renderers/support/RasterSymbolizer.js +1 -1
  161. package/renderers/support/rasterRendererHelper.js +1 -1
  162. package/rest/locator/addressToLocations.js +1 -1
  163. package/rest/locator/addressesToLocations.js +1 -1
  164. package/rest/locator/suggestLocations.js +1 -1
  165. package/rest/networks/support/Association.js +1 -1
  166. package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
  167. package/smartMapping/raster/support/adapters/ImageryTileLayerAdapter.js +1 -1
  168. package/support/revision.js +1 -1
  169. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  170. package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +1 -1
  171. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterRangeHighlightShader.js +1 -1
  172. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MaskShader.js +1 -1
  173. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
  174. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
  175. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  176. package/views/2d/engine/webgl/textureUtils.js +1 -1
  177. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  178. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  179. package/views/2d/layers/MediaLayerView2D.js +1 -1
  180. package/views/2d/layers/TileLayerView2D.js +1 -1
  181. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  182. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  183. package/views/2d/layers/imagery/ImageryView2D.js +1 -1
  184. package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
  185. package/views/2d/layers/imagery/VectorFieldView2D.js +1 -1
  186. package/views/3d/glTF/LoaderResult.js +1 -1
  187. package/views/3d/glTF/internal/Resource.js +1 -1
  188. package/views/3d/glTF/loader.js +1 -1
  189. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  190. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  191. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  192. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  193. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  194. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  195. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  196. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  197. package/views/3d/layers/i3s/I3SGraphicsMap.js +1 -1
  198. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  199. package/views/3d/support/buffer/glUtil.js +1 -1
  200. package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
  201. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  202. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  203. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +1 -1
  204. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  205. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  206. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +10 -10
  207. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
  208. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBufferView.js +1 -1
  209. package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
  210. package/views/3d/webgl-engine/lib/edgeRendering/edgeProcessing.js +1 -1
  211. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  212. package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
  213. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  214. package/views/3d/webgl-engine/materials/DrawParameters.js +1 -1
  215. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  216. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  217. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  218. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  219. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  220. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  221. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  222. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  223. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  224. package/views/3d/webgl-engine/materials/renderers/Instance.js +1 -1
  225. package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
  226. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  227. package/views/3d/webgl-engine/materials/renderers/PerOriginData.js +1 -1
  228. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  229. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  230. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  231. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +9 -9
  232. package/views/DOMContainer.js +1 -1
  233. package/views/GroundView.js +1 -1
  234. package/views/VideoView.js +1 -1
  235. package/views/layers/ImageryLayerViewMixin.js +1 -1
  236. package/views/layers/ImageryTileLayerViewMixin.js +1 -1
  237. package/views/support/imageReprojection.js +1 -1
  238. package/views/webgl/ShaderBuilder.js +1 -1
  239. package/views/webgl/Util.js +1 -1
  240. package/views/webgl/VertexElementDescriptor.js +1 -1
  241. package/widgets/BatchAttributeForm.js +1 -1
  242. package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
  243. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  244. package/widgets/CoordinateConversion.js +1 -1
  245. package/widgets/DirectLineMeasurement3D.js +1 -1
  246. package/widgets/DistanceMeasurement2D.js +1 -1
  247. package/widgets/Editor/EditorViewModel.js +1 -1
  248. package/widgets/Editor.js +1 -1
  249. package/widgets/ElevationProfile.js +1 -1
  250. package/widgets/Feature.js +1 -1
  251. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  252. package/widgets/FeatureForm.js +1 -1
  253. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  254. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  255. package/widgets/FeatureTable/support/GroupColumnTemplate.js +1 -1
  256. package/widgets/FeatureTable/support/TableTemplate.js +1 -1
  257. package/widgets/FeatureTable.js +1 -1
  258. package/widgets/FeatureTemplates.js +1 -1
  259. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  260. package/widgets/Legend.js +1 -1
  261. package/widgets/LineOfSight.js +1 -1
  262. package/widgets/Locate.js +1 -1
  263. package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
  264. package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
  265. package/widgets/PanoramicViewer/support/importUtils.js +1 -1
  266. package/widgets/Print.js +1 -1
  267. package/widgets/ScaleBar.js +1 -1
  268. package/widgets/ScaleRangeSlider.js +1 -1
  269. package/widgets/Search/SearchResultRenderer.js +1 -1
  270. package/widgets/Search/SearchViewModel.js +1 -1
  271. package/widgets/Search/types.js +1 -1
  272. package/widgets/Search.js +1 -1
  273. package/widgets/ShadowCast.js +1 -1
  274. package/widgets/Sketch/SketchViewModel.js +1 -1
  275. package/widgets/Sketch.js +1 -1
  276. package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
  277. package/assets/esri/core/workers/chunks/0a5427127634738aa239.js +0 -1
  278. package/assets/esri/core/workers/chunks/110429583b28c28c36ee.js +0 -1
  279. package/assets/esri/core/workers/chunks/145c6a7cdcc9893efb27.js +0 -1
  280. package/assets/esri/core/workers/chunks/1bacdd17e199e22b5cd1.js +0 -1
  281. package/assets/esri/core/workers/chunks/1d566539ff6fb6ac798c.js +0 -1
  282. package/assets/esri/core/workers/chunks/1f6ead46b723630db897.js +0 -1
  283. package/assets/esri/core/workers/chunks/3a16347e17312556e02c.js +0 -1
  284. package/assets/esri/core/workers/chunks/478def691ae6763686f3.js +0 -1
  285. package/assets/esri/core/workers/chunks/4c4a55be41ba105c091c.js +0 -1
  286. package/assets/esri/core/workers/chunks/4cbf5a97b2b3c6553f6f.js +0 -1
  287. package/assets/esri/core/workers/chunks/5dc0d853c21ccb6054c7.js +0 -1
  288. package/assets/esri/core/workers/chunks/613cbac9cb925cd20b48.js +0 -1
  289. package/assets/esri/core/workers/chunks/646f58b69d2354f1ef27.js +0 -1
  290. package/assets/esri/core/workers/chunks/800c91302eaad7f00877.js +0 -1
  291. package/assets/esri/core/workers/chunks/93d11075f65a5b6625ea.js +0 -1
  292. package/assets/esri/core/workers/chunks/9f2a8445a5848502c7e7.js +0 -1
  293. package/assets/esri/core/workers/chunks/a1b08aab73747f4e7e25.js +0 -1
  294. package/assets/esri/core/workers/chunks/ba59568e748f0ba53b78.js +0 -1
  295. package/assets/esri/core/workers/chunks/c4de24582c29fda5a033.js +0 -1
  296. package/assets/esri/core/workers/chunks/d786b17cc9062b1450ac.js +0 -1
  297. package/assets/esri/core/workers/chunks/d9958654c6438f28237b.js +0 -1
  298. package/assets/esri/core/workers/chunks/e6fa6f9c278589c8a713.js +0 -1
  299. package/assets/esri/core/workers/chunks/e7f4d135ef9665de1468.js +0 -1
  300. package/assets/esri/core/workers/chunks/f21cb5b34d4d1e3af1a9.js +0 -1
  301. package/assets/esri/core/workers/chunks/f93f0586ce10cb5d98b3.js +0 -1
  302. package/layers/support/rasterDatasets/BaseRaster.js +0 -5
  303. package/layers/support/rasterDatasets/CovJSONRaster.js +0 -5
  304. package/layers/support/rasterDatasets/FunctionRaster.js +0 -5
  305. package/layers/support/rasterDatasets/ImageAuxRaster.js +0 -5
  306. package/layers/support/rasterDatasets/ImageServerRaster.js +0 -5
  307. package/layers/support/rasterDatasets/InMemoryRaster.js +0 -5
  308. package/layers/support/rasterDatasets/MRFRaster.js +0 -5
  309. package/layers/support/rasterDatasets/RawBlockCache.js +0 -5
  310. package/layers/support/rasterDatasets/TIFFRaster.js +0 -5
  311. package/layers/support/rasterDatasets/WCSRaster.js +0 -5
  312. package/layers/support/rasterDatasets/covJSONParser.js +0 -5
  313. package/layers/support/rasterDatasets/multidimensionalUtils.js +0 -5
  314. package/layers/support/rasterDatasets/pamParser.js +0 -5
  315. package/layers/support/rasterDatasets/pixelReader.js +0 -5
  316. package/layers/support/rasterDatasets/wcsCoverageParser.js +0 -5
  317. package/layers/support/rasterFormats/Lerc.js +0 -5
  318. package/layers/support/rasterFormats/Qb3.js +0 -5
  319. package/layers/support/rasterFormats/RasterCodec.js +0 -5
  320. package/layers/support/rasterFormats/TiffDecoder.js +0 -5
  321. package/layers/support/rasterFunctions/ArithmeticFunction.js +0 -5
  322. package/layers/support/rasterFunctions/BandArithmeticFunction.js +0 -5
  323. package/layers/support/rasterFunctions/BaseRasterFunction.js +0 -5
  324. package/layers/support/rasterFunctions/ColormapFunction.js +0 -5
  325. package/layers/support/rasterFunctions/ColormapToRGBFunction.js +0 -5
  326. package/layers/support/rasterFunctions/CompositeBandFunction.js +0 -5
  327. package/layers/support/rasterFunctions/CompositeBandFunctionArguments.js +0 -5
  328. package/layers/support/rasterFunctions/ComputeChangeFunction.js +0 -5
  329. package/layers/support/rasterFunctions/ConvolutionFunction.js +0 -5
  330. package/layers/support/rasterFunctions/ConvolutionFunctionArguments.js +0 -5
  331. package/layers/support/rasterFunctions/HillshadeFunction.js +0 -5
  332. package/layers/support/rasterFunctions/LocalFunction.js +0 -5
  333. package/layers/support/rasterFunctions/RemapFunction.js +0 -5
  334. package/layers/support/rasterFunctions/ShadedReliefFunction.js +0 -5
  335. package/layers/support/rasterFunctions/SlopeFunction.js +0 -5
  336. package/layers/support/rasterFunctions/StatisticsFunction.js +0 -5
  337. package/layers/support/rasterFunctions/StretchFunction.js +0 -5
  338. package/layers/support/rasterFunctions/bandIndexUtils.js +0 -5
  339. package/layers/support/rasterFunctions/changeDetectionUtils.js +0 -5
  340. package/layers/support/rasterFunctions/clipUtils.js +0 -5
  341. package/layers/support/rasterFunctions/conversionUtils.js +0 -5
  342. package/layers/support/rasterFunctions/convolutionUtils.js +0 -5
  343. package/layers/support/rasterFunctions/creators/createDataManagementFunctions.js +0 -5
  344. package/layers/support/rasterFunctions/creators/utils.js +0 -5
  345. package/layers/support/rasterFunctions/focalStatUtils.js +0 -5
  346. package/layers/support/rasterFunctions/localUtils.js +0 -5
  347. package/layers/support/rasterFunctions/pixelTransformUtils.js +0 -5
  348. package/layers/support/rasterFunctions/pixelUtils.js +0 -5
  349. package/layers/support/rasterFunctions/stretchUtils.js +0 -5
  350. package/layers/support/rasterFunctions/surfaceUtils.js +0 -5
  351. package/layers/support/rasterFunctions/vectorFieldUtils.js +0 -5
  352. package/layers/support/rasterTransforms/BaseRasterTransform.js +0 -5
  353. /package/assets/esri/layers/{support/rasterFormats → raster/formats}/lerc-wasm.wasm +0 -0
  354. /package/assets/esri/layers/{support/rasterFormats → raster/formats}/qb3-wasm.wasm +0 -0
  355. /package/layers/{support/rasterDatasets → raster/datasets}/DBFParser.js +0 -0
  356. /package/layers/{support/rasterDatasets → raster/datasets}/EphemeralBlockCache.js +0 -0
  357. /package/layers/{support/rasterDatasets → raster/datasets}/RasterFactory.js +0 -0
  358. /package/layers/{support/rasterDatasets → raster/datasets}/byteStreamUtils.js +0 -0
  359. /package/layers/{support/rasterDatasets → raster/datasets}/datasetUtils.js +0 -0
  360. /package/layers/{support/rasterDatasets → raster/datasets}/multipartParser.js +0 -0
  361. /package/layers/{support/rasterDatasets → raster/datasets}/wcsCapabilitiesParser.js +0 -0
  362. /package/layers/{support/rasterDatasets → raster/datasets}/xmlUtilities.js +0 -0
  363. /package/layers/{support/rasterFormats → raster/formats}/ImageCanvasDecoder.js +0 -0
  364. /package/layers/{support/rasterFormats → raster/formats}/JpgPlus.js +0 -0
  365. /package/layers/{support/rasterFormats → raster/formats}/Lzw.js +0 -0
  366. /package/layers/{support/rasterFormats → raster/formats}/Raw.js +0 -0
  367. /package/layers/{support/rasterFormats → raster/formats}/pixelRangeUtils.js +0 -0
  368. /package/layers/{support/rasterFormats → raster/formats}/tiffTag.js +0 -0
  369. /package/layers/{support/rasterFormats → raster/formats}/utils.js +0 -0
  370. /package/layers/{support/rasterFunctions → raster/functions}/colormaps.js +0 -0
  371. /package/layers/{support/rasterFunctions → raster/functions}/creators/createAppearenceFunctions.js +0 -0
  372. /package/layers/{support/rasterFunctions → raster/functions}/creators/createBandIndexFunctions.js +0 -0
  373. /package/layers/{support/rasterFunctions → raster/functions}/creators/createChangeFunctions.js +0 -0
  374. /package/layers/{support/rasterFunctions → raster/functions}/creators/createConversionFunctions.js +0 -0
  375. /package/layers/{support/rasterFunctions → raster/functions}/creators/createLocalFunctions.js +0 -0
  376. /package/layers/{support/rasterFunctions → raster/functions}/creators/createMultiRasterAnalysisFunctions.js +0 -0
  377. /package/layers/{support/rasterFunctions → raster/functions}/creators/createStatisticsFunctions.js +0 -0
  378. /package/layers/{support/rasterFunctions → raster/functions}/creators/createSurfaceFunctions.js +0 -0
  379. /package/layers/{support/rasterFunctions → raster/functions}/customBandIndexUtils.js +0 -0
  380. /package/layers/{support/rasterFunctions → raster/functions}/mirror.js +0 -0
  381. /package/layers/{support/rasterFunctions → raster/functions}/rasterFunctionHelper.js +0 -0
  382. /package/layers/{support/rasterFunctions → raster/functions}/rasterFunctionSchema.js +0 -0
  383. /package/layers/{support/rasterFunctions → raster/functions}/rasterProjectionHelper.js +0 -0
  384. /package/layers/{support/rasterTransforms → raster/transforms}/utils.js +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import{webglDebugEnabled as e,getErrorMessage as s}from"./checkWebGLError.js";import{CompressedTextureFormat as c,SizedPixelFormat as a,SizedDepthStencilFormat as r,SizedDepthFormat as t}from"./enums.js";function R(c,a,r,t=0){const R=c.gl;c.bindBuffer(r);for(const n of r.layout){const r=a.get(n.name);if(null==r){console.warn(`There is no location for vertex attribute '${n.name}' defined.`);continue}const _=t*n.stride;if(n.count<=4)R.vertexAttribPointer(r,n.count,n.type,n.normalized,n.stride,n.offset+_),R.enableVertexAttribArray(r),n.divisor>0&&R.vertexAttribDivisor(r,n.divisor);else if(9===n.count)for(let e=0;e<3;e++)R.vertexAttribPointer(r+e,3,n.type,n.normalized,n.stride,n.offset+12*e+_),R.enableVertexAttribArray(r+e),n.divisor>0&&R.vertexAttribDivisor(r+e,n.divisor);else if(16===n.count)for(let e=0;e<4;e++)R.vertexAttribPointer(r+e,4,n.type,n.normalized,n.stride,n.offset+16*e+_),R.enableVertexAttribArray(r+e),n.divisor>0&&R.vertexAttribDivisor(r+e,n.divisor);else console.error("Unsupported vertex attribute element count: "+n.count);if(e()){const e=s(c.gl);e&&console.error(`Unable to bind vertex attribute "${n.name}" with baseInstanceOffset ${_}:`,e,n)}}}function n(e){switch(e){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function _(e){switch(e){case 6406:case 6409:case 6403:case 36244:case a.R8:case a.R8I:case a.R8UI:case a.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case a.RGBA4:case a.R16F:case a.R16I:case a.R16UI:case a.RG8:case a.RG8I:case a.RG8UI:case a.RG8_SNORM:case a.RGB565:case a.RGB5_A1:case t.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case a.RGB8:case a.RGB8I:case a.RGB8UI:case a.RGB8_SNORM:case a.SRGB8:case t.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case a.RGBA8:case a.R32F:case a.R11F_G11F_B10F:case a.RG16F:case a.R32I:case a.R32UI:case a.RG16I:case a.RG16UI:case a.RGBA8I:case a.RGBA8UI:case a.RGBA8_SNORM:case a.SRGB8_ALPHA8:case a.RGB9_E5:case a.RGB10_A2UI:case a.RGB10_A2:case t.DEPTH_COMPONENT32F:case r.DEPTH24_STENCIL8:return 4;case r.DEPTH32F_STENCIL8:return 5;case a.RGB16F:case a.RGB16I:case a.RGB16UI:return 6;case a.RG32F:case a.RG32I:case a.RG32UI:case a.RGBA16F:case a.RGBA16I:case a.RGBA16UI:return 8;case a.RGB32F:case a.RGB32I:case a.RGB32UI:return 12;case a.RGBA32F:case a.RGBA32I:case a.RGBA32UI:return 16;case c.COMPRESSED_RGB_S3TC_DXT1_EXT:case c.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case c.COMPRESSED_RGBA_S3TC_DXT3_EXT:case c.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case c.COMPRESSED_R11_EAC:case c.COMPRESSED_SIGNED_R11_EAC:case c.COMPRESSED_RGB8_ETC2:case c.COMPRESSED_SRGB8_ETC2:case c.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case c.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case c.COMPRESSED_RG11_EAC:case c.COMPRESSED_SIGNED_RG11_EAC:case c.COMPRESSED_RGBA8_ETC2_EAC:case c.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}export{R as bindVertexBufferLayout,_ as getFormatBytesPerElement,n as getFormatComponents};
5
+ import"../../core/has.js";import{webglDebugEnabled as e,getErrorMessage as s}from"./checkWebGLError.js";import{CompressedTextureFormat as c,SizedPixelFormat as a,SizedDepthStencilFormat as r,SizedDepthFormat as t,DataType as R}from"./enums.js";const n=new Set([R.BYTE,R.SHORT,R.INT,R.UNSIGNED_BYTE,R.UNSIGNED_SHORT,R.UNSIGNED_INT]);function i(c,a,r,t=0){const R=c.gl;c.bindBuffer(r);for(const i of r.layout){const r=a.get(i.name);if(null==r){console.warn(`There is no location for vertex attribute '${i.name}' defined.`);continue}const o=t*i.stride;if(i.count<=4)i.integer&&n.has(i.type)?R.vertexAttribIPointer(r,i.count,i.type,i.stride,i.offset+o):R.vertexAttribPointer(r,i.count,i.type,i.normalized,i.stride,i.offset+o),R.enableVertexAttribArray(r),i.divisor>0&&R.vertexAttribDivisor(r,i.divisor);else if(9===i.count)for(let e=0;e<3;e++)R.vertexAttribPointer(r+e,3,i.type,i.normalized,i.stride,i.offset+12*e+o),R.enableVertexAttribArray(r+e),i.divisor>0&&R.vertexAttribDivisor(r+e,i.divisor);else if(16===i.count)for(let e=0;e<4;e++)R.vertexAttribPointer(r+e,4,i.type,i.normalized,i.stride,i.offset+16*e+o),R.enableVertexAttribArray(r+e),i.divisor>0&&R.vertexAttribDivisor(r+e,i.divisor);else console.error("Unsupported vertex attribute element count: "+i.count);if(e()){const e=s(c.gl);e&&console.error(`Unable to bind vertex attribute "${i.name}" with baseInstanceOffset ${o}:`,e,i)}}}function o(e){switch(e){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function _(e){switch(e){case 6406:case 6409:case 6403:case 36244:case a.R8:case a.R8I:case a.R8UI:case a.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case a.RGBA4:case a.R16F:case a.R16I:case a.R16UI:case a.RG8:case a.RG8I:case a.RG8UI:case a.RG8_SNORM:case a.RGB565:case a.RGB5_A1:case t.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case a.RGB8:case a.RGB8I:case a.RGB8UI:case a.RGB8_SNORM:case a.SRGB8:case t.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case a.RGBA8:case a.R32F:case a.R11F_G11F_B10F:case a.RG16F:case a.R32I:case a.R32UI:case a.RG16I:case a.RG16UI:case a.RGBA8I:case a.RGBA8UI:case a.RGBA8_SNORM:case a.SRGB8_ALPHA8:case a.RGB9_E5:case a.RGB10_A2UI:case a.RGB10_A2:case t.DEPTH_COMPONENT32F:case r.DEPTH24_STENCIL8:return 4;case r.DEPTH32F_STENCIL8:return 5;case a.RGB16F:case a.RGB16I:case a.RGB16UI:return 6;case a.RG32F:case a.RG32I:case a.RG32UI:case a.RGBA16F:case a.RGBA16I:case a.RGBA16UI:return 8;case a.RGB32F:case a.RGB32I:case a.RGB32UI:return 12;case a.RGBA32F:case a.RGBA32I:case a.RGBA32UI:return 16;case c.COMPRESSED_RGB_S3TC_DXT1_EXT:case c.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case c.COMPRESSED_RGBA_S3TC_DXT3_EXT:case c.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case c.COMPRESSED_R11_EAC:case c.COMPRESSED_SIGNED_R11_EAC:case c.COMPRESSED_RGB8_ETC2:case c.COMPRESSED_SRGB8_ETC2:case c.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case c.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case c.COMPRESSED_RG11_EAC:case c.COMPRESSED_SIGNED_RG11_EAC:case c.COMPRESSED_RGBA8_ETC2_EAC:case c.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}export{i as bindVertexBufferLayout,_ as getFormatBytesPerElement,o as getFormatComponents};
@@ -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
- class t{constructor(t,s,i,h,o,e=!1,r=0){this.name=t,this.count=s,this.type=i,this.offset=h,this.stride=o,this.normalized=e,this.divisor=r}}export{t as VertexElementDescriptor};
5
+ class t{constructor(t,s,i,e,h,o=!1,r=0,n=!1){this.name=t,this.count=s,this.type=i,this.offset=e,this.stride=h,this.normalized=o,this.divisor=r,this.integer=n}}export{t as VertexElementDescriptor};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import"../core/has.js";import{getOrCreateMapValue as i}from"../core/MapUtils.js";import{watch as o,on as n}from"../core/reactiveUtils.js";import{property as a,subclass as s}from"../core/accessorSupport/decorators.js";import{isIntegerField as r}from"../layers/support/fieldUtils.js";import{isString as l}from"../support/guards.js";import d from"./Widget.js";import{getHiddenFieldsValidationErrorMessage as u,getVisibleFieldInputValidationErrorMessage as p,isElementTemplateWithInputType as m}from"./BatchAttributeForm/batchAttributeFormUtils.js";import c from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as h}from"./BatchAttributeForm/css.js";import{VisibleElements as v}from"./BatchAttributeForm/VisibleElements.js";import{isGroupInput as b,isFieldInput as f,differentValuesString as C}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as _,getIntlOptionsForField as y,prepareISOFieldValueForDateComponents as F,prepareUnixFieldValueForDateComponents as w,normalizeTimeOnlyString as I,getISOFieldValueFromDateComponents as x,getUnixFieldValueFromDateComponents as M}from"./support/dateUtils.js";import{globalCss as k}from"./support/globalCss.js";import{messageBundle as O,vmEvent as T,tsx as V}from"./support/widget.js";import{setFocus as D}from"./support/widgetUtils.js";import{isEmptyValue as U}from"./support/forms/formUtils.js";const S="data-element-id";let E=class extends d{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.featureFormMessages=null,this.viewModel=new c,this.visibleElements=new v,this.groupDisplay="all",this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._batchSwitchInputInitialValues=new Map,this._saveInput=this._saveInput.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([o(()=>this.features,()=>{this._dateComponentMap.clear()}),o(()=>this.viewModel.activeForm,()=>{this._batchSwitchInputInitialValues.clear()}),n(()=>this.viewModel,"submit",()=>{this.valid||this.goToClosestError()})])}loadDependencies(){return g({input:()=>import("@esri/calcite-components/dist/components/calcite-input"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")})}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get _effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get maximumFeatureCount(){return this.viewModel.maximumFeatureCount}set maximumFeatureCount(e){this.viewModel.maximumFeatureCount=e}get maximumFeatureCountWithComplexForms(){return this.viewModel.maximumFeatureCountWithComplexForms}set maximumFeatureCountWithComplexForms(e){this.viewModel.maximumFeatureCountWithComplexForms=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}get readOnly(){return this.viewModel.readOnly}set readOnly(e){this.viewModel.readOnly=e}get valid(){return this.viewModel.valid}goToClosestError(){const e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;const{groupInput:t}=e;t&&(t.open||(t.open=!0)),this._focusedFieldInput=e.input,this._attemptFocusOnNextRender=!0,this.scheduleRender()}render(){const{status:e}=this.viewModel;return"failed"===e?this.viewModel.hasTooManyComplexFeatures?this._renderErrorNotice(t(this.messages.formFailedToLoadTooManyComplexFeatures,{num:this.viewModel.maximumFeatureCountWithComplexForms})):this.viewModel.hasTooManyFeatures?this._renderErrorNotice(t(this.messages.formFailedToLoadTooManyFeatures,{num:this.viewModel.maximumFeatureCount})):this._renderErrorNotice(this.messages.formFailedToLoad):this.viewModel.expressionEvaluationFailed?this._renderErrorNotice(this.messages.expressionEvaluationFailed):this.viewModel.hasLayersWithContingentValues?this._renderErrorNotice(this.messages.unsupportedContingentValues):V("div",{class:this.classes(h.base,k.widget,k.panel)},"loaded"===e?this._renderForm():"loading"===e&&this.visibleElements.loadingIndicator?V("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):null)}submit(){this.viewModel.submit()}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:o}=e.dataset,n=i(this._dateComponentMap,`${o}`,()=>({}));switch(t){case"date":n.date=e;break;case"time":n.time=e;break;case"timeZone":n.timeZone=e}}_renderErrorNotice(e){return V("div",{class:this.classes(h.base,k.widget,k.panel)},V("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},V("div",{slot:"message"},e)))}_renderForm(){return V("form",{onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderContent())}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:i}=e;let o;if(!e.submitHasBeenAttempted)return null;if(i.invalidHiddenInputs.length>0)if(o=u(i,e.mode,this.messages),"batch"===this.viewModel.mode){const e=i.invalidHiddenInputs.filter(e=>"hidden:group-visibility-expression:all-features"===e.effectiveVisibilityCode||"hidden:visibility-expression:all-features"===e.visibilityCode);e.length>0?o+=` (${e.map(e=>e.label).join(", ")})`:o=null}else o+=` (${i.invalidHiddenInputs.map(e=>e.label).join(", ")})`;else if(t)return null;return o?V("calcite-notice",{class:h.noticeError,icon:!0,kind:"danger",open:!0},V("div",{slot:"message"},o)):null}_renderContent(){if(!this.viewModel.hasVisibleInputs)return[V("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},V("div",{slot:"message"},this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason]))];const{inputs:e}=this.viewModel.activeForm;return e.filter(e=>e.visible).map(e=>this._renderInput(e))}_renderInput(e){return b(e)?this._renderGroupInput(e):f(e)?this._renderLabeledField(e):void 0}_renderGroupInput(e){const{inputs:t,template:i,open:o}=e,n=t.filter(e=>e.visible),a=i.label??"";return V("calcite-block",{class:this.classes(h.group,"sequential"===this.groupDisplay?h.groupSequential:null,this.disabled?h.inputDisabled:null),collapsible:!0,description:i.description??void 0,disabled:this._effectiveDisabled,expanded:o,heading:a,headingLevel:this.headingLevel,key:`{${i.elementId}-key}`,label:a,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},n.map(e=>this._renderInput(e)))}_renderLabeledField(e){const{elementId:i}=e.template,{label:o,required:n,dataType:a}=e,s=n?t(this.messages.requiredFieldLabel,{name:o}):o;return V("calcite-label",{"aria-label":s,class:h.label,key:`field--${i}`},V("div",{class:h.labelTextContent,key:"labelTextContainer"},o,n?V("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==a?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:i}=e;return"date"===i?this._renderDateComponents(e,t):"coded-value"===e.domain?.type?this._renderCodedInputs({input:e,props:t}):"number"===i?this._renderNumberComponent(e,t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{compositeError:t,description:i,submittable:o}=e,n=!o&&t&&(this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId))?p(e,t,this.messages):null;return n?V("calcite-input-message",{icon:!0,status:"invalid"},n):i?V("calcite-input-message",{class:h.description,icon:!1,status:"idle"},i):null}_renderCodedInputs({input:e,props:t}){const i=e.template.input?.type??null,o=e.codedValueOptions;switch(i){case"switch":return this._renderSwitchField({input:e,props:t});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:o.flat(),props:t});default:return this._renderComboBoxComponent({options:o,props:t,input:e})}}_renderSwitchField({input:e,props:t}){if((this._batchSwitchInputInitialValues.get(e)===C||e.value===C)&&"batch"===this.viewModel.mode){const i={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[S]:t[S]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:i,options:[{name:this.messages.differentValuesPlaceholder,value:C,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return V("calcite-switch",{...t,checked:!!m(e.template,"switch")&&e.value===e.template.input.onValue,class:h.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInput(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:i}){const{trigger:o,dropdown:n,group:a}=i;return V("calcite-dropdown",{...n,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e)},V("calcite-button",{...o},e===C?this.messages.differentValuesPlaceholder:e),V("calcite-dropdown-group",{selectionMode:a.mode},t.map(t=>V("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name))))}_renderComboBoxComponent({input:e,options:t,props:i}){const o="INSERT"===this.viewModel.editType,n=this._touchedInputs.has(e?.template?.elementId),a=o&&e.showNoValueOptionEnabled&&!n?()=>{}:i.onblur,s={...i,onblur:a};return V("calcite-combobox",{...s,selectionMode:"single",value:i.placeholder===this.messages.differentValuesPlaceholder?C:String(i.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==C&&this._saveInput(e)}},this.renderComboboxOptionsList({input:e,options:t,props:i}))}renderComboboxOptionsList({input:e,options:t,props:i}){const[o,n]=t.map(e=>e.map(({name:e,value:t})=>V("calcite-combobox-item",{key:`#${t}`,selected:i.value===t,textLabel:e,value:`${t}`}))),a=[...o];n.length>0&&a.push(V("calcite-combobox-item-group",{key:"unsupported",label:this.featureFormMessages.subtypes.unsupportedDomainGroupTitle},n));const s=i.placeholder===this.messages.differentValuesPlaceholder,r=!s&&U(i.value);return e.showNoValueOptionEnabled&&a.unshift(V("calcite-combobox-item",{key:"empty-option",selected:r,textLabel:e.showNoValueLabel||this.messages.empty,value:""})),s&&a.unshift(V("calcite-combobox-item",{key:C,selected:!0,textLabel:this.messages.differentValuesPlaceholder,value:C})),a}_renderRadioButtonGroupComponent({input:e,options:t,props:i}){const o=t.map(({name:t,value:o})=>this._renderRadioButtons({label:t,value:o,selected:o===e.value,props:i}));if(e.showNoValueOptionEnabled){const t="",n=e.showNoValueLabel||this.messages.empty,a=U(e.value);o.unshift(this._renderRadioButtons({label:n,value:t,selected:a,props:i}))}return V("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:h.inputRadioGroup,disabled:i.readOnly,key:`${i.key}-radio-group`,layout:"vertical",name:i.name,required:i.required},o,i.placeholder===this.messages.differentValuesPlaceholder?V("calcite-label",{class:h.placeholderRadio,key:i.label,layout:"inline"},V("calcite-radio-button",{checked:!0,class:h.inputRadio,disabled:!0,name:i.placeholder,value:i.placeholder}),i.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:i,props:o}){return V("calcite-label",{class:h.inputRadioLabel,key:o.label,layout:"inline"},V("calcite-radio-button",{...o,afterCreate:void 0,afterUpdate:void 0,checked:t,class:h.inputRadio,disabled:o.readOnly,name:o.label,onblur:()=>{this._focusedFieldInput=null},value:e,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),i)}_renderStringComponent(e,t){const{template:i}=e;return!i.field.editable||this.readOnly?this._renderReadOnlyComponent(e):"text-area"===i.input?.type?V("calcite-text-area",{...t,class:this.classes(h.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):V("calcite-input",{...t,class:this.classes(h.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)})}_renderNumberComponent(e,t){const i=r(e.field);return V("calcite-input-number",{...t,integer:i,type:"number",value:i&&""!==t.value?Math.round(parseFloat(String(t.value))).toString():String(t.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return V("calcite-input",{...i,class:this.classes(h.fieldInput,h.inputDisabled,h.individualElement),readOnly:!0,type:"text",value:String(t??i.value??"")})}_renderDateComponents(e,t){const{field:i}=e;let o;switch(i.type){case"date":o=this._renderDateFieldComponents(e,t);break;case"date-only":o=this._renderDateOnlyFieldComponent(e,t);break;case"time-only":o=this._renderTimeOnlyFieldComponent(e,t);break;case"timestamp-offset":o=this._renderTimestampOffsetFieldComponents(e,t);break;default:o=this._renderReadOnlyComponent(e,_(i,t.value,{timeZone:e.effectiveTimeZone,...y(e.template.field)}))}return e.value===C?[o,V("calcite-input-message",{icon:"information",key:"diff-values-message",status:"idle"},this.messages.differentValues)]:o}_renderDateOnlyFieldComponent(e,t){const{class:i,key:o,readOnly:n}=t,{rawMax:a,rawMin:s}=e.range;return V("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:i,"data-date-part":"date","data-element-id":t[S],key:`${o}-date-input`,max:l(a)?a:void 0,min:l(s)?s:void 0,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:n,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{class:i,key:o,readOnly:n}=t;return V("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:i,"data-date-part":"time","data-element-id":t[S],key:`${o}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:n,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{class:i,key:o,readOnly:n}=t,{rawMax:a,rawMin:s}=e.range,r=F(a),l=F(s),d=F(e.value===C?"":e.value),u=e.includeTimeOffset,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[S]:t[S],onfocus:this._onComponentFocus};return V("div",{class:h.dateInputContainer,key:`${o}-date-time-container`},V("calcite-input-date-picker",{...p,class:i,"data-date-part":"date",key:`${o}-date-input`,max:r?.date??void 0,min:l?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:d.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),V("calcite-input-time-picker",{...p,class:i,"data-date-part":"time",key:`${o}-time-input`,onblur:()=>{this._focusedFieldInput=null},value:d.time??"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),u?V("calcite-input-time-zone",{...p,class:i,clearable:e.value===C||null==e.value,"data-date-part":"timeZone",key:`${o}-timezone-input`,onblur:()=>{this._focusedFieldInput=null},value:d.timeZoneOffset||"",onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:i,key:o,readOnly:n,min:a,max:s}=t,r=e.effectiveTimeZone,l=w(e.value===C?"":e.value,r),d=w(s,r),u=w(a,r),p=e.includeTime,m={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[S]:t[S],onfocus:this._onComponentFocus};return V("div",{class:h.dateInputContainer,key:`${o}-date-time-container`},V("calcite-input-date-picker",{...m,class:i,"data-date-part":"date",key:`${o}-date-input`,max:d?.date??void 0,min:u?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:l.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?V("calcite-input-time-picker",{...m,"data-date-part":"time",key:`${o}-time-input`,onblur:()=>{this._focusedFieldInput=null},step:1,value:l.time??"",onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}getCommonInputProps(e){const{template:t,valid:i,value:o,minLength:n,maxLength:a,required:s,fieldName:r,editable:l,userHasChangedValue:d,range:{max:u,min:p}}=e,m=!l||this.readOnly,c=!m&&this._effectiveDisabled;let v=t.hint??void 0,b=!1;return o===C&&(v=this.messages.differentValuesPlaceholder,b=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":i?"false":"true",class:this.classes(h.fieldInput,m?h.inputDisabled:null),status:!d&&!this.viewModel.submitHasBeenAttempted||i?"idle":"invalid",maxLength:a&&a>-1?a:void 0,minLength:n&&n>-1?n:void 0,key:t.elementId,label:r,name:r,max:null!=u?u:void 0,min:null!=p?p:void 0,disabled:c,readOnly:m,onblur:this._onComponentBlur,required:s,placeholder:v,value:b?"":o??"",[S]:t.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(S))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),o=t||i;o&&this._afterComponentCreateOrUpdate(o)}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._touchedInputs.add(i.template.elementId),this._focusedFieldInput=i}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),i=this._focusedFieldInput;this._attemptFocusOnNextRender&&i===t&&(this._attemptFocusOnNextRender=!1,D(e))}_onComponentBlur(){this._focusedFieldInput=null}_parseValue(e,t){if(m(t.template,"switch")){if("calcite-dropdown"===e.localName&&t.domain)for(const i of t.domain.codedValues)if(i.name===e.selectedItems[0].textContent)return i.code;return e.checked?t.template.input.onValue:t.template.input.offValue}const i=e.value;return null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:o}=t.template;if(!t)return;const n=t?.value;if(m(t.template,"switch")&&"single"!==this.viewModel.mode){const e=i(this._batchSwitchInputInitialValues,t,()=>t.value);this._batchSwitchInputInitialValues.set(t,null===e?n:e)}const a=this._parseValue(e,t);a!==n&&this.viewModel.setValue(o,a)}_afterDateComponentCreate(e){this._setDateTimeTimeZoneMap(e),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:i}=e.template,o=e.field.type,n=this._dateComponentMap.get(`${i}`);if(!n)return;const a=e.effectiveTimeZone;let s=e.value===C?void 0:e.value,r=null;"date-only"===o?r=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===o?(s=I(s),r=I(t.value)):r="timestamp-offset"===o?null!=t.value?x({dateComponent:n.date,timeComponent:n.time,oldValue:s,timeZoneComponent:n.timeZone,defaultTimeZone:a}):null:null!=t.value?M({oldValue:s,dateComponent:n.date,timeZone:a,timeComponent:n.time?.value===C?void 0:n.time}):null,s!==r&&(null!==r&&t.value?this.viewModel.setValue(`${i}`,r):this.viewModel.setValue(`${i}`,null))}};e([a()],E.prototype,"activeFeatureIndex",null),e([a()],E.prototype,"disabled",null),e([a()],E.prototype,"_effectiveDisabled",null),e([a()],E.prototype,"features",null),e([a()],E.prototype,"map",null),e([a()],E.prototype,"maximumFeatureCount",null),e([a()],E.prototype,"maximumFeatureCountWithComplexForms",null),e([a()],E.prototype,"spatialReference",null),e([a()],E.prototype,"layerInfos",null),e([a()],E.prototype,"timeZone",null),e([a()],E.prototype,"headingLevel",void 0),e([a()],E.prototype,"icon",null),e([a(),O("esri/t9n/common")],E.prototype,"messagesCommon",void 0),e([a(),O("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],E.prototype,"messages",void 0),e([a(),O("esri/widgets/FeatureForm/t9n/FeatureForm")],E.prototype,"featureFormMessages",void 0),e([a()],E.prototype,"readOnly",null),e([a()],E.prototype,"valid",null),e([a(),T(["value-change","submit"])],E.prototype,"viewModel",void 0),e([a({type:v,nonNullable:!0})],E.prototype,"visibleElements",void 0),e([a()],E.prototype,"groupDisplay",void 0),E=e([s("esri.widgets.BatchAttributeForm")],E);const R=E;export{R as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import"../core/has.js";import{getOrCreateMapValue as i}from"../core/MapUtils.js";import{watch as o,on as n}from"../core/reactiveUtils.js";import{property as a,subclass as s}from"../core/accessorSupport/decorators.js";import{isIntegerField as r}from"../layers/support/fieldUtils.js";import{isString as l}from"../support/guards.js";import d from"./Widget.js";import{getHiddenFieldsValidationErrorMessage as p,getVisibleFieldInputValidationErrorMessage as u,isElementTemplateWithInputType as m}from"./BatchAttributeForm/batchAttributeFormUtils.js";import c from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as h}from"./BatchAttributeForm/css.js";import{VisibleElements as v}from"./BatchAttributeForm/VisibleElements.js";import{isGroupInput as b,isFieldInput as f,differentValuesString as C}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as _,getIntlOptionsForField as y,prepareISOFieldValueForDateComponents as F,prepareUnixFieldValueForDateComponents as w,normalizeTimeOnlyString as I,getISOFieldValueFromDateComponents as x,getUnixFieldValueFromDateComponents as M}from"./support/dateUtils.js";import{globalCss as k}from"./support/globalCss.js";import{messageBundle as O,vmEvent as T,tsx as V}from"./support/widget.js";import{setFocus as D}from"./support/widgetUtils.js";import{isEmptyValue as U}from"./support/forms/formUtils.js";const S="data-element-id";let E=class extends d{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.featureFormMessages=null,this.viewModel=new c,this.visibleElements=new v,this.groupDisplay="all",this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._batchSwitchInputInitialValues=new Map,this._saveInput=this._saveInput.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([o(()=>this.features,()=>{this._dateComponentMap.clear()}),o(()=>this.viewModel.activeForm,()=>{this._batchSwitchInputInitialValues.clear()}),n(()=>this.viewModel,"submit",()=>{this.valid||this.goToClosestError()})])}loadDependencies(){return g({input:()=>import("@esri/calcite-components/dist/components/calcite-input"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")})}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get _effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get maximumFeatureCount(){return this.viewModel.maximumFeatureCount}set maximumFeatureCount(e){this.viewModel.maximumFeatureCount=e}get maximumFeatureCountWithComplexForms(){return this.viewModel.maximumFeatureCountWithComplexForms}set maximumFeatureCountWithComplexForms(e){this.viewModel.maximumFeatureCountWithComplexForms=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}get readOnly(){return this.viewModel.readOnly}set readOnly(e){this.viewModel.readOnly=e}get valid(){return this.viewModel.valid}goToClosestError(){const e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;const{groupInput:t}=e;t&&(t.open||(t.open=!0)),this._focusedFieldInput=e.input,this._attemptFocusOnNextRender=!0,this.scheduleRender()}render(){const{status:e}=this.viewModel;return"failed"===e?this.viewModel.hasTooManyComplexFeatures?this._renderErrorNotice(t(this.messages.formFailedToLoadTooManyComplexFeatures,{num:this.viewModel.maximumFeatureCountWithComplexForms})):this.viewModel.hasTooManyFeatures?this._renderErrorNotice(t(this.messages.formFailedToLoadTooManyFeatures,{num:this.viewModel.maximumFeatureCount})):this._renderErrorNotice(this.messages.formFailedToLoad):this.viewModel.expressionEvaluationFailed?this._renderErrorNotice(this.messages.expressionEvaluationFailed):this.viewModel.hasLayersWithContingentValues?this._renderErrorNotice(this.messages.unsupportedContingentValues):V("div",{class:this.classes(h.base,k.widget,k.panel)},"loaded"===e?this._renderForm():"loading"===e&&this.visibleElements.loadingIndicator?V("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):null)}submit(){this.viewModel.submit()}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:o}=e.dataset,n=i(this._dateComponentMap,`${o}`,()=>({}));switch(t){case"date":n.date=e;break;case"time":n.time=e;break;case"timeZone":n.timeZone=e}}_renderErrorNotice(e){return V("div",{class:this.classes(h.base,k.widget,k.panel)},V("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},V("div",{slot:"message"},e)))}_renderForm(){return V("form",{onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderContent())}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:i}=e;let o;if(!e.submitHasBeenAttempted)return null;if(i.invalidHiddenInputs.length>0)if(o=p(i,e.mode,this.messages),"batch"===this.viewModel.mode){const e=i.invalidHiddenInputs.filter(e=>"hidden:group-visibility-expression:all-features"===e.effectiveVisibilityCode||"hidden:visibility-expression:all-features"===e.visibilityCode);e.length>0?o+=` (${e.map(e=>e.label).join(", ")})`:o=null}else o+=` (${i.invalidHiddenInputs.map(e=>e.label).join(", ")})`;else if(t)return null;return o?V("calcite-notice",{class:h.noticeError,icon:!0,kind:"danger",open:!0},V("div",{slot:"message"},o)):null}_renderContent(){if(!this.viewModel.hasVisibleInputs)return[V("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},V("div",{slot:"message"},this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason]))];const{inputs:e}=this.viewModel.activeForm;return e.filter(e=>e.visible).map(e=>this._renderInput(e))}_renderInput(e){return b(e)?this._renderGroupInput(e):f(e)?this._renderLabeledField(e):void 0}_renderGroupInput(e){const{inputs:t,template:i,open:o}=e,n=t.filter(e=>e.visible),a=i.label??"";return V("calcite-block",{class:this.classes(h.group,"sequential"===this.groupDisplay?h.groupSequential:null,this.disabled?h.inputDisabled:null),collapsible:!0,description:i.description??void 0,disabled:this._effectiveDisabled,expanded:o,heading:a,headingLevel:this.headingLevel,key:`{${i.elementId}-key}`,label:a,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},n.map(e=>this._renderInput(e)))}_renderLabeledField(e){const{elementId:i}=e.template,{label:o,required:n,dataType:a}=e,s=n?t(this.messages.requiredFieldLabel,{name:o}):o;return V("calcite-label",{"aria-label":s,class:h.label,key:`field--${i}`},V("div",{class:h.labelTextContent,key:"labelTextContainer"},o,n?V("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==a?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:i}=e;return"date"===i?this._renderDateComponents(e,t):"coded-value"===e.domain?.type?this._renderCodedInputs({input:e,props:t}):"number"===i?this._renderNumberComponent(e,t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{compositeError:t,description:i,submittable:o}=e,n=!o&&t&&(this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId))?u(e,t,this.messages):null;return n?V("calcite-input-message",{icon:!0,status:"invalid"},n):i?V("calcite-input-message",{class:h.description,icon:!1,status:"idle"},i):null}_renderCodedInputs({input:e,props:t}){const i=e.template.input?.type??null,o=e.codedValueOptions;switch(i){case"switch":return this._renderSwitchField({input:e,props:t});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:o.flat(),props:t});default:return this._renderComboBoxComponent({options:o,props:t,input:e})}}_renderSwitchField({input:e,props:t}){if((this._batchSwitchInputInitialValues.get(e)===C||e.value===C)&&"batch"===this.viewModel.mode){const i={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[S]:t[S]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:i,options:[{name:this.messages.differentValuesPlaceholder,value:C,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return V("calcite-switch",{...t,checked:!!m(e.template,"switch")&&e.value===e.template.input.onValue,class:h.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInput(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:i}){const{trigger:o,dropdown:n,group:a}=i;return V("calcite-dropdown",{...n,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e)},V("calcite-button",{...o},e===C?this.messages.differentValuesPlaceholder:e),V("calcite-dropdown-group",{selectionMode:a.mode},t.map(t=>V("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name))))}_renderComboBoxComponent({input:e,options:t,props:i}){const o="INSERT"===this.viewModel.editType,n=this._touchedInputs.has(e?.template?.elementId),a=o&&e.showNoValueOptionEnabled&&!n?()=>{}:i.onblur,s={...i,onblur:a};return V("calcite-combobox",{...s,selectionMode:"single",value:i.placeholder===this.messages.differentValuesPlaceholder?C:String(i.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==C&&this._saveInput(e)}},this.renderComboboxOptionsList({input:e,options:t,props:i}))}renderComboboxOptionsList({input:e,options:t,props:i}){const[o,n]=t.map(e=>e.map(({name:e,value:t})=>V("calcite-combobox-item",{key:`#${t}`,selected:i.value===t,textLabel:e,value:`${t}`}))),a=[...o];n.length>0&&a.push(V("calcite-combobox-item-group",{key:"unsupported",label:this.featureFormMessages.subtypes.unsupportedDomainGroupTitle},n));const s=i.placeholder===this.messages.differentValuesPlaceholder,r=!s&&U(i.value);return e.showNoValueOptionEnabled&&a.unshift(V("calcite-combobox-item",{key:"empty-option",selected:r,textLabel:e.showNoValueLabel||this.messages.empty,value:""})),s&&a.unshift(V("calcite-combobox-item",{key:C,selected:!0,textLabel:this.messages.differentValuesPlaceholder,value:C})),a}_renderRadioButtonGroupComponent({input:e,options:t,props:i}){const o=t.map(({name:t,value:o})=>this._renderRadioButtons({label:t,value:o,selected:o===e.value,props:i}));if(e.showNoValueOptionEnabled){const t="",n=e.showNoValueLabel||this.messages.empty,a=U(e.value);o.unshift(this._renderRadioButtons({label:n,value:t,selected:a,props:i}))}return V("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:h.inputRadioGroup,disabled:i.readOnly,key:`${i.key}-radio-group`,layout:"vertical",name:i.name,required:i.required},o,i.placeholder===this.messages.differentValuesPlaceholder?V("calcite-label",{class:h.placeholderRadio,key:i.label,layout:"inline"},V("calcite-radio-button",{checked:!0,class:h.inputRadio,disabled:!0,name:i.placeholder,value:i.placeholder}),i.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:i,props:o}){return V("calcite-label",{class:h.inputRadioLabel,key:o.label,layout:"inline"},V("calcite-radio-button",{...o,afterCreate:void 0,afterUpdate:void 0,checked:t,class:h.inputRadio,disabled:o.readOnly,name:o.label,onblur:()=>{this._focusedFieldInput=null},value:e,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),i)}_renderStringComponent(e,t){const{template:i}=e;return!i.field.editable||this.readOnly?this._renderReadOnlyComponent(e):"text-area"===i.input?.type?V("calcite-text-area",{...t,class:this.classes(h.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):V("calcite-input",{...t,class:this.classes(h.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)})}_renderNumberComponent(e,t){const i=r(e.field);return V("calcite-input-number",{...t,integer:i,type:"number",value:i&&""!==t.value?Math.round(parseFloat(String(t.value))).toString():String(t.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return V("calcite-input",{...i,class:this.classes(h.fieldInput,h.inputDisabled,h.individualElement),readOnly:!0,type:"text",value:String(t??i.value??"")})}_renderDateComponents(e,t){const{field:i}=e;let o;switch(i.type){case"date":o=this._renderDateFieldComponents(e,t);break;case"date-only":o=this._renderDateOnlyFieldComponent(e,t);break;case"time-only":o=this._renderTimeOnlyFieldComponent(e,t);break;case"timestamp-offset":o=this._renderTimestampOffsetFieldComponents(e,t);break;default:o=this._renderReadOnlyComponent(e,_(i,t.value,{timeZone:e.effectiveTimeZone,...y(e.template.field)}))}return e.value===C?[o,V("calcite-input-message",{icon:"information",key:"diff-values-message",status:"idle"},this.messages.differentValues)]:o}_renderDateOnlyFieldComponent(e,t){const{class:i,key:o,readOnly:n}=t,{rawMax:a,rawMin:s}=e.range;return V("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:i,"data-date-part":"date","data-element-id":t[S],key:`${o}-date-input`,max:l(a)?a:void 0,min:l(s)?s:void 0,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:n,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{class:i,key:o,readOnly:n}=t;return V("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:i,"data-date-part":"time","data-element-id":t[S],key:`${o}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:n,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{class:i,key:o,readOnly:n}=t,{rawMax:a,rawMin:s}=e.range,r=F(a),l=F(s),d=F(e.value===C?"":e.value),p=e.includeTimeOffset,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[S]:t[S],onfocus:this._onComponentFocus};return V("div",{class:h.dateInputContainer,key:`${o}-date-time-container`},V("calcite-input-date-picker",{...u,class:i,"data-date-part":"date",key:`${o}-date-input`,max:r?.date??void 0,min:l?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:d.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),V("calcite-input-time-picker",{...u,class:i,"data-date-part":"time",key:`${o}-time-input`,onblur:()=>{this._focusedFieldInput=null},value:d.time??"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?V("calcite-input-time-zone",{...u,class:i,clearable:e.value===C||null==e.value,"data-date-part":"timeZone",key:`${o}-timezone-input`,onblur:()=>{this._focusedFieldInput=null},value:d.timeZoneOffset||"",onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:i,key:o,readOnly:n,min:a,max:s}=t,r=e.effectiveTimeZone,l=w(e.value===C?"":e.value,r),d=w(s,r),p=w(a,r),u=e.includeTime,m={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[S]:t[S],onfocus:this._onComponentFocus};return V("div",{class:h.dateInputContainer,key:`${o}-date-time-container`},V("calcite-input-date-picker",{...m,class:i,"data-date-part":"date",key:`${o}-date-input`,max:d?.date??void 0,min:p?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:l.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),u?V("calcite-input-time-picker",{...m,"data-date-part":"time",key:`${o}-time-input`,onblur:()=>{this._focusedFieldInput=null},step:1,value:l.time??"",onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}getCommonInputProps(e){const{template:t,valid:i,value:o,minLength:n,maxLength:a,required:s,fieldName:r,editable:l,userHasChangedValue:d,range:{max:p,min:u}}=e,m=!l||this.readOnly,c=!m&&this._effectiveDisabled;let v=t.hint??void 0,b=!1;return o===C&&(v=this.messages.differentValuesPlaceholder,b=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":i?"false":"true",class:this.classes(h.fieldInput,m?h.inputDisabled:null),status:!d&&!this.viewModel.submitHasBeenAttempted||i?"idle":"invalid",maxLength:a&&a>-1?a:void 0,minLength:n&&n>-1?n:void 0,key:t.elementId,label:r,name:r,max:null!=p?p:void 0,min:null!=u?u:void 0,disabled:c,readOnly:m,onblur:this._onComponentBlur,required:s,placeholder:v,value:b?"":o??"",[S]:t.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(S))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),o=t||i;o&&this._afterComponentCreateOrUpdate(o)}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._touchedInputs.add(i.template.elementId),this._focusedFieldInput=i}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),i=this._focusedFieldInput;this._attemptFocusOnNextRender&&i===t&&(this._attemptFocusOnNextRender=!1,D(e))}_onComponentBlur(){this._focusedFieldInput=null}_parseValue(e,t){if(m(t.template,"switch")){if("calcite-dropdown"===e.localName&&t.domain)for(const i of t.domain.codedValues)if(i.name===e.selectedItems[0].textContent)return i.code;return e.checked?t.template.input.onValue:t.template.input.offValue}const i=e.value;return null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:o}=t.template;if(!t)return;const n=t?.value;if(m(t.template,"switch")&&"single"!==this.viewModel.mode){const e=i(this._batchSwitchInputInitialValues,t,()=>t.value);this._batchSwitchInputInitialValues.set(t,null===e?n:e)}const a=this._parseValue(e,t);a!==n&&this.viewModel.setValue(o,a)}_afterDateComponentCreate(e){this._setDateTimeTimeZoneMap(e),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:i}=e.template,o=e.field.type,n=this._dateComponentMap.get(`${i}`);if(!n)return;const a=e.effectiveTimeZone;let s=e.value===C?void 0:e.value,r=null;"date-only"===o?r=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===o?(s=I(s),r=I(t.value)):r="timestamp-offset"===o?null!=t.value?x({dateComponent:n.date,timeComponent:n.time,oldValue:s,timeZoneComponent:n.timeZone,defaultTimeZone:a}):null:null!=t.value?M({oldValue:s,dateComponent:n.date,timeZone:a,timeComponent:n.time?.value===C?void 0:n.time}):null,s!==r&&(null!==r&&t.value?this.viewModel.setValue(`${i}`,r):this.viewModel.setValue(`${i}`,null))}};e([a()],E.prototype,"activeFeatureIndex",null),e([a()],E.prototype,"disabled",null),e([a()],E.prototype,"_effectiveDisabled",null),e([a()],E.prototype,"features",null),e([a()],E.prototype,"map",null),e([a()],E.prototype,"maximumFeatureCount",null),e([a()],E.prototype,"maximumFeatureCountWithComplexForms",null),e([a()],E.prototype,"spatialReference",null),e([a()],E.prototype,"layerInfos",null),e([a()],E.prototype,"timeZone",null),e([a()],E.prototype,"headingLevel",void 0),e([a()],E.prototype,"icon",null),e([a(),O("esri/t9n/common")],E.prototype,"messagesCommon",void 0),e([a(),O("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],E.prototype,"messages",void 0),e([a(),O("esri/widgets/FeatureForm/t9n/FeatureForm")],E.prototype,"featureFormMessages",void 0),e([a()],E.prototype,"readOnly",null),e([a()],E.prototype,"valid",null),e([a({type:c}),T(["value-change","submit"])],E.prototype,"viewModel",void 0),e([a({type:v,nonNullable:!0})],E.prototype,"visibleElements",void 0),e([a()],E.prototype,"groupDisplay",void 0),E=e([s("esri.widgets.BatchAttributeForm")],E);const R=E;export{R as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import s from"../../core/Collection.js";import{referenceSetter as i}from"../../core/collectionUtils.js";import{deprecateUnnecessaryViewModel as r}from"../../core/deprecate.js";import l from"../../core/Logger.js";import{isAbortError as o}from"../../core/promiseUtils.js";import{watch as a,whenOnce as n}from"../../core/reactiveUtils.js";import{property as p,subclass as d}from"../../core/accessorSupport/decorators.js";import y from"../../layers/BuildingSceneLayer.js";import h from"../../layers/support/BuildingFilter.js";import c from"./BuildingDisciplinesViewModel.js";import u from"./BuildingLevel.js";import g from"./BuildingPhase.js";import{showFullModel as m}from"./support/buildingLayerUtils.js";import{setFilterOnLayers as f,getFilterBlockSolid as v,getFilterBlockXRay as w,generateFilterId as j}from"./support/filterUtils.js";import{createLoadLayersFunction as _}from"./support/layerUtils.js";let L=class extends t{constructor(e){super(e),this.view=null,this.state="disabled",this.level=new u({isDefaultViewModel:!0}),this.phase=new g({isDefaultViewModel:!0}),this.disciplines=new c,this._loadLayers=_(),e?.isDefaultViewModel||r(l.getLogger(this),"Building Explorer","arcgis-building-explorer",{version:"5.0"}),this.layers=new s}normalizeCtorArgs(e){const{isDefaultViewModel:t,...s}=e??{};return s}initialize(){this.addHandles([this.layers.on("change",()=>this._onLayersChange()),a(()=>({state:this.state,layers:this.layers,filter:this._filter}),({state:e,layers:t,filter:s})=>{"ready"===e&&f(t,s)},{initial:!0})]),this._onLayersChange()}destroy(){this.level.destroyed||this.level.destroy(),this.phase.destroyed||this.phase.destroy(),this.disciplines.destroyed||this.disciplines.destroy()}get isSupported(){return"3d"===this.view?.type}get layers(){return this._get("layers")}set layers(e){const t=e.filter(e=>e instanceof y);t.length!==e.length&&l.getLogger(this).error("Some layers are not BuildingSceneLayers but only BuildingSceneLayers can be passed to the widget."),this._set("layers",i(t,this._get("layers")))}get _filter(){const e=this.level.filterExpressions,t=this.phase.filterExpressions,s=[],i=v([e.solid,t.solid]);null!=i&&s.push(i);const r=w([e.xRay,t.xRay]);return null!=r&&s.push(r),0===s.length?null:new h({id:j(),name:"Building Explorer Filter",filterBlocks:s})}async _onLayersChange(){const e=this.layers;if(this.level.layers=e,this.phase.layers=e,this.disciplines.layers=e,0!==e.length){this._set("state","loading");try{await this._loadLayers(e),await Promise.all([n(()=>"ready"===this.level.state),n(()=>"ready"===this.phase.state),n(()=>"ready"===this.disciplines.state)]),e.forEach(m),this._set("state","ready")}catch(t){o(t)||this._set("state","failed")}}else this._set("state","disabled")}};e([p({value:null})],L.prototype,"view",void 0),e([p()],L.prototype,"isSupported",null),e([p({type:s,nonNullable:!0})],L.prototype,"layers",null),e([p({readOnly:!0})],L.prototype,"state",void 0),e([p({readOnly:!0,type:u})],L.prototype,"level",void 0),e([p({readOnly:!0,type:g})],L.prototype,"phase",void 0),e([p({readOnly:!0,type:c})],L.prototype,"disciplines",void 0),e([p()],L.prototype,"_filter",null),L=e([d("esri.widgets.BuildingExplorer.BuildingExplorerViewModel")],L);const B=L;export{B as default};
5
+ import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import s from"../../core/Collection.js";import{referenceSetter as i}from"../../core/collectionUtils.js";import{deprecateUnnecessaryViewModel as r}from"../../core/deprecate.js";import l from"../../core/Logger.js";import{isAbortError as o}from"../../core/promiseUtils.js";import{watch as a,whenOnce as n}from"../../core/reactiveUtils.js";import{property as p,subclass as d}from"../../core/accessorSupport/decorators.js";import y from"../../layers/BuildingSceneLayer.js";import h from"../../layers/support/BuildingFilter.js";import c from"./BuildingDisciplinesViewModel.js";import u from"./BuildingLevel.js";import g from"./BuildingPhase.js";import{showFullModel as m}from"./support/buildingLayerUtils.js";import{setFilterOnLayers as f,getFilterBlockSolid as v,getFilterBlockXRay as w,generateFilterId as j}from"./support/filterUtils.js";import{createLoadLayersFunction as _}from"./support/layerUtils.js";let L=class extends t{constructor(e){super(e),this.view=null,this.state="disabled",this.level=new u({isDefaultViewModel:!0}),this.phase=new g({isDefaultViewModel:!0}),this.disciplines=new c,this._loadLayers=_(),e?.isDefaultViewModel||r(l.getLogger(this),"Building Explorer","arcgis-building-explorer",{version:"5.0"}),this.layers=new s}normalizeCtorArgs(e){const{isDefaultViewModel:t,...s}=e??{};return s}initialize(){this.addHandles([this.layers.on("change",()=>this._onLayersChange()),a(()=>({state:this.state,layers:this.layers,filter:this._filter}),({state:e,layers:t,filter:s})=>{"ready"===e&&f(t,s)},{initial:!0})]),this._onLayersChange()}destroy(){this.level.destroyed||this.level.destroy(),this.phase.destroyed||this.phase.destroy(),this.disciplines.destroyed||this.disciplines.destroy()}get isSupported(){return"3d"===this.view?.type}get layers(){return this._get("layers")}set layers(e){const t=e.filter(e=>e instanceof y);t.length!==e.length&&l.getLogger(this).error("Some layers are not BuildingSceneLayers but only BuildingSceneLayers can be passed to the widget."),this._set("layers",i(t,this._get("layers")))}get _filter(){const e=this.level.filterExpressions,t=this.phase.filterExpressions,s=[],i=v([e.solid,t.solid]);null!=i&&s.push(i);const r=w([e.xRay,t.xRay]);return null!=r&&s.push(r),0===s.length?null:new h({id:j(),name:"Building Explorer Filter",filterBlocks:s})}async _onLayersChange(){const e=this.layers;if(this.level.layers=e,this.phase.layers=e,this.disciplines.layers=e,0!==e.length){this._set("state","loading");try{await this._loadLayers(e),await Promise.all([n(()=>"ready"===this.level.state),n(()=>"ready"===this.phase.state),n(()=>"ready"===this.disciplines.state)]),e.forEach(m),this._set("state","ready")}catch(t){o(t)||this._set("state","failed")}}else this._set("state","disabled")}};e([p({value:null})],L.prototype,"view",void 0),e([p()],L.prototype,"isSupported",null),e([p({type:s.ofType(y),nonNullable:!0})],L.prototype,"layers",null),e([p({readOnly:!0})],L.prototype,"state",void 0),e([p({readOnly:!0,type:u})],L.prototype,"level",void 0),e([p({readOnly:!0,type:g})],L.prototype,"phase",void 0),e([p({readOnly:!0,type:c})],L.prototype,"disciplines",void 0),e([p()],L.prototype,"_filter",null),L=e([d("esri.widgets.BuildingExplorer.BuildingExplorerViewModel")],L);const B=L;export{B as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{getAssetUrl as e}from"../../assets.js";import o from"../../Graphic.js";import{fetchMessageBundle as i,onLocaleChange as s,getLocale as n}from"../../intl.js";import r from"../../core/Collection.js";import a from"../../core/Error.js";import{EventedAccessor as h}from"../../core/Evented.js";import c from"../../core/Logger.js";import{watch as d,initial as l,when as m}from"../../core/reactiveUtils.js";import{property as v,cast as p,subclass as u}from"../../core/accessorSupport/decorators.js";import f from"../../geometry/Point.js";import{load as g}from"../../geometry/projectionUtils.js";import w from"../../symbols/PictureMarkerSymbol.js";import{pointSymbolTypes as _}from"../../symbols/support/typeUtils.js";import y from"./support/Conversion.js";import{isValidPoint as C,isSupportedNotation as b}from"./support/coordinateConversionUtils.js";import L from"./support/Format.js";import{generateDefaultFormats as M,setDefaultPatterns as P}from"./support/formatUtils.js";import{GoTo as S}from"../support/GoTo.js";const j=new f([0,0,500]),H="xy",F=["mgrs","utm","usng","dd","dms","ddm"],G="esri__coordinateConversionWidgetState",x={conversions:"conversions",formats:"formats",view:"view",viewChange:"view-change",cursor:"cursor"},E="esri/images/search/search-symbol-32.png";let T=class extends(S(h)){constructor(t){super(t),this._conversionPromise=null,this._locationGraphic=null,this._pointerCount=0,this.conversions=new r,this.formats=new r,this.formatterAvailable=!1,this.messages=null,this.filteredFormats=new r,this.locationSymbol=new w({url:e(E),width:24,height:24}),this.storageEnabled=!0,this.storageType="session",this.view=null,this._saveWidgetState=this._saveWidgetState.bind(this),this._handleFormatChange=this._handleFormatChange.bind(this),this._handleConversionChange=this._handleConversionChange.bind(this),this._handleViewChange=this._handleViewChange.bind(this),this._onClick=this._onClick.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerUp=this._onPointerUp.bind(this)}initialize(){const t=async()=>this.messages=await i("esri/widgets/CoordinateConversion/t9n/CoordinateConversion");this.formats.addMany(M()),t().then(()=>{if(!this.destroyed&&(P(this.messages,this.formats),this.storageEnabled&&this._loadWidgetState(),this.formats.forEach(t=>{t.viewModel=this,this.addHandles(d(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format")}),this.addHandles(this.conversions.on("change",this._handleConversionChange),x.conversions),this.addHandles(this.formats.on("change",this._handleFormatChange),x.formats),this.addHandles(s(()=>{t().then(()=>{P(this.messages,this.formats)})})),g().then(()=>{this.formatterAvailable=!0}).catch(t=>{c.getLogger(this).error(new a("coordinate-conversion:projection-load-failed","Failed to load the projection module.",{error:t})),this.formatterAvailable=!1,this._filterFormatsAndConversions()}).then(()=>this.addHandles(d(()=>this.view,this._handleViewChange,l),x.viewChange)),0===this.conversions.length)){const t=this.formats.find(t=>t.name===H)||this.formats.at(0);this.conversions.add(new y({format:t}))}})}destroy(){this.removeHandles(),this._cleanUpView(this.view),this.view=null}castConversions(t){return this._castToConversions(t)}set currentLocation(t){this._set("currentLocation",t),this._updateConversions()}get currentLocation(){return this._get("currentLocation")||null}set mode(t){switch(t){case"capture":this.currentLocation=null,this._startCaptureMode(),this._set("mode",t);break;case"live":this._startLiveMode(),this._set("mode",t)}}get mode(){return this._get("mode")||"live"}get state(){const{messages:t,view:e}=this,o=e?.ready;return t?o?"ready":e?"loading":"disabled":"disabled"}get storage(){const{storageType:t}=this;return"session"===t?sessionStorage:localStorage}get waitingForConversions(){return null!=this._conversionPromise}setLocation(t){if(this._locationGraphic&&this.view?.graphics.remove(this._locationGraphic),!t)return;const e=t.clone();e.hasZ&&(e.z=void 0),this._locationGraphic=new o({geometry:e,symbol:this.locationSymbol}),this.view?.graphics.add(this._locationGraphic)}async convert(t,e){if(!C(e))throw new a("coordinate-conversion:invalid-point","Invalid point cannot be converted.",{point:e});return Promise.resolve().then(()=>t.convert(e))}async goToLocation(t){const{view:e}=this;if(!e)throw new a("coordinate-conversion:go-to-failed","no view");const o="3d"===e.type?e.clippingArea:null,i=e.map?.basemap?.baseLayers;if(o||(i?.length??0)>0){const e=o??i?.at(0)?.fullExtent;if(null!=e&&!e.contains(t))throw new a("coordinate-conversion:go-to-failed","Point outside basemap extent.",{point:t})}return this.callGoTo({target:t})}pause(){this.currentLocation=null,this.removeHandles(x.view),this.view&&(this.removeHandles(x.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic))}async previewConversion(t,e=this.currentLocation||j){return(await W(t,e)).displayCoordinate}resume(){"capture"===this.mode?this._startCaptureMode():this._startLiveMode()}reverseConvert(t,e){return e.reverseConvert(t)}async updateConversions(t,e){if("point"!==e?.type)throw this._clearConversions(this.conversions),new a("coordinate-conversion:invalid-input-point","Point is invalid, conversions cannot be updated.",{point:e});return this._convertMany(t,e)}_castToConversions(t){const e=new r;return t.forEach(t=>{let o=null;if(t instanceof y)o=t;else if("string"==typeof t){const e=this.formats.find(e=>e.name===t);e&&(o=new y({format:e}))}o&&e.add(o)}),e}_cleanUpView(t){t&&(this._locationGraphic&&t.graphics.remove(this._locationGraphic),this.removeHandles(x.view),this.removeHandles(x.cursor))}_clearConversions(t){t.forEach(t=>{t.position={location:null,coordinate:null}})}async _convertMany(t,e){return Promise.all(t.map(t=>W(t,e)))}_handleConversionChange(t){for(const e of t.added){const{format:t}=e;t&&(t.viewModel=this,this.currentLocation&&(this._set("waitingForConversions",!0),this.convert(t,this.currentLocation).then(t=>{e.position=t,this._set("waitingForConversions",!1)})))}this._saveWidgetState()}_handleFormatChange(t){t.added.forEach(t=>{this.addHandles(d(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format"),t.viewModel=this}),t.removed.forEach(t=>{t.viewModel=null;const e=this.conversions.filter(e=>e.format===t);this.conversions.removeMany(e),t.name&&this.removeHandles(t.name)})}_loadWidgetState(){try{const t=JSON.parse(this.storage.getItem(G));t&&this._setWidgetState(t)}catch(t){c.getLogger(this).error(new a("coordinate-conversion:invalid-session-storage-json","Could not read from storage.",{error:t}))}}_startCaptureMode(){this.removeHandles(x.view),this.view&&(this.currentLocation&&this.setLocation(this.currentLocation),this.removeHandles(x.cursor),this.addHandles(this.view.acquireCursor("crosshair","high"),x.cursor),this.addHandles(this.view.on("click",this._onClick),x.view))}_startLiveMode(){this._pointerCount=0,this.removeHandles(x.view),this.view&&(this.removeHandles(x.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic),this.addHandles([this.view.on("pointer-down",this._onPointerDown),this.view.on("pointer-up",this._onPointerUp),this.view.on("pointer-move",this._onPointerMove)],x.view))}_handleViewChange(t,e){e&&e!==t&&this._cleanUpView(e),t&&("capture"===this.mode?this._startCaptureMode():this._startLiveMode(),e&&this._filterFormatsAndConversions())}_onClick(t){if(0===t.button){const e=this.view?.toMap(t),o=e?.normalize();this.setLocation(o),this.currentLocation=o}}_onPointerDown(t){const{pointerType:e}=t;if(this._pointerCount++,("touch"===e||"pen"===e)&&1===this._pointerCount){const e=this.view?.toMap(t);this.currentLocation=e?.normalize()}}_onPointerMove(t){const{pointerType:e}=t;if("mouse"===e||1===this._pointerCount){const e=this.view?.toMap(t);this.currentLocation=e?.normalize()}}_onPointerUp(){this._pointerCount--}_setWidgetState(t){try{t.formats.forEach(e=>{const o=this.formats.find(t=>t.name===e.name);o&&t.locale===n()&&e.currentPattern&&(o.currentPattern=e.currentPattern),o&&e.index>=0&&this.conversions.add(new y({format:o}))})}catch(e){c.getLogger(this).warn(new a("coordinate-conversion:session-storage-read-error","Could not get state from stored JSON.",{error:e}))}}_saveWidgetState(){if(!this.storageEnabled)return;const t=this._toJSON();try{this.storage.setItem(G,JSON.stringify({formats:t,locale:n()}))}catch(e){c.getLogger(this).error(new a("coordinate-conversion:local-storage-write-error","Could not write to localStorage.",{error:e}))}}async _updateConversions(){try{await this.updateConversions(this.conversions.toArray(),this.currentLocation)}catch{}}_toJSON(){return this.formats.filter(t=>{const e=t.name;return"xy"===e||"basemap"===e||b(e)}).map(t=>({name:t.name,currentPattern:t.currentPattern,defaultPattern:t.defaultPattern,index:this.conversions.findIndex(e=>e.format===t)})).sort((t,e)=>t.index-e.index).toArray()}_filterFormatsAndConversions(){const{formatterAvailable:t,conversions:e,formats:o}=this;t||this.addHandles(m(()=>this.view?.spatialReference,t=>{const i=t.isWebMercator||t.isWGS84,s=o.filter(t=>{const{name:e}=t;return!!U(e)||"xy"===e&&!i}),n=this.filteredFormats.filter(t=>"xy"===t.name&&i&&!this.formats.includes(t)),r=e.filter(t=>s.includes(t.format));o.removeMany(s),e.removeMany(r),this.filteredFormats.addMany(s.filter(t=>!this.filteredFormats.includes(t))),o.addMany(n)},{once:!0,initial:!0}),x.view)}};async function W(t,e){try{t.position=await(t.format?.convert(e))}catch(o){t.position=null}return t}function U(t){return F.includes(t)}t([v({type:r.ofType(y)})],T.prototype,"conversions",void 0),t([p("conversions")],T.prototype,"castConversions",null),t([v({type:f})],T.prototype,"currentLocation",null),t([v({type:r.ofType(L)})],T.prototype,"formats",void 0),t([v()],T.prototype,"messages",void 0),t([v()],T.prototype,"mode",null),t([v()],T.prototype,"filteredFormats",void 0),t([v({readOnly:!0})],T.prototype,"state",null),t([v({types:_})],T.prototype,"locationSymbol",void 0),t([v({readOnly:!0,dependsOn:["storageType"]})],T.prototype,"storage",null),t([v()],T.prototype,"storageEnabled",void 0),t([v()],T.prototype,"storageType",void 0),t([v({readOnly:!0})],T.prototype,"waitingForConversions",null),t([v()],T.prototype,"view",void 0),T=t([u("esri.widgets.CoordinateConversion.CoordinateConversionViewModel")],T);const A=T;export{A as default};
5
+ import{__decorate as t}from"tslib";import{getAssetUrl as e}from"../../assets.js";import o from"../../Graphic.js";import{fetchMessageBundle as i,onLocaleChange as s,getLocale as r}from"../../intl.js";import n from"../../core/Collection.js";import a from"../../core/Error.js";import{EventedAccessor as h}from"../../core/Evented.js";import c from"../../core/Logger.js";import{watch as d,initial as l,when as m}from"../../core/reactiveUtils.js";import{property as v,subclass as p}from"../../core/accessorSupport/decorators.js";import{ensureType as u}from"../../core/accessorSupport/ensureType.js";import g from"../../geometry/Point.js";import{load as f}from"../../geometry/projectionUtils.js";import w from"../../symbols/PictureMarkerSymbol.js";import{pointSymbolTypes as _}from"../../symbols/support/typeUtils.js";import y from"./support/Conversion.js";import{isValidPoint as C,isSupportedNotation as b}from"./support/coordinateConversionUtils.js";import L from"./support/Format.js";import{generateDefaultFormats as M,setDefaultPatterns as P}from"./support/formatUtils.js";import{GoTo as S}from"../support/GoTo.js";const j=new g([0,0,500]),H="xy",F=["mgrs","utm","usng","dd","dms","ddm"],G="esri__coordinateConversionWidgetState",x={conversions:"conversions",formats:"formats",view:"view",viewChange:"view-change",cursor:"cursor"},E="esri/images/search/search-symbol-32.png";let W=class extends(S(h)){constructor(t){super(t),this._conversionPromise=null,this._locationGraphic=null,this._pointerCount=0,this.formats=new n,this.formatterAvailable=!1,this.messages=null,this.filteredFormats=new n,this.locationSymbol=new w({url:e(E),width:24,height:24}),this.storageEnabled=!0,this.storageType="session",this.view=null,this._saveWidgetState=this._saveWidgetState.bind(this),this._handleFormatChange=this._handleFormatChange.bind(this),this._handleConversionChange=this._handleConversionChange.bind(this),this._handleViewChange=this._handleViewChange.bind(this),this._onClick=this._onClick.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this.conversions=new n}initialize(){const t=async()=>this.messages=await i("esri/widgets/CoordinateConversion/t9n/CoordinateConversion");this.formats.addMany(M()),t().then(()=>{if(!this.destroyed&&(P(this.messages,this.formats),this.storageEnabled&&this._loadWidgetState(),this.formats.forEach(t=>{t.viewModel=this,this.addHandles(d(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format")}),this.addHandles(this.conversions.on("change",this._handleConversionChange),x.conversions),this.addHandles(this.formats.on("change",this._handleFormatChange),x.formats),this.addHandles(s(()=>{t().then(()=>{P(this.messages,this.formats)})})),f().then(()=>{this.formatterAvailable=!0}).catch(t=>{c.getLogger(this).error(new a("coordinate-conversion:projection-load-failed","Failed to load the projection module.",{error:t})),this.formatterAvailable=!1,this._filterFormatsAndConversions()}).then(()=>this.addHandles(d(()=>this.view,this._handleViewChange,l),x.viewChange)),0===this.conversions.length)){const t=this.formats.find(t=>t.name===H)||this.formats.at(0);this.conversions.add(new y({format:t}))}})}destroy(){this.removeHandles(),this._cleanUpView(this.view),this.view=null}get conversions(){return this._get("conversions")}set conversions(t){const e=new n;t.forEach(t=>{let o=null;if("string"==typeof t){const e=this.formats.find(e=>e.name===t);e&&(o=new y({format:e}))}else o=u(y,t);o&&e.add(o)}),this._set("conversions",e)}set currentLocation(t){this._set("currentLocation",t),this._updateConversions()}get currentLocation(){return this._get("currentLocation")||null}set mode(t){switch(t){case"capture":this.currentLocation=null,this._startCaptureMode(),this._set("mode",t);break;case"live":this._startLiveMode(),this._set("mode",t)}}get mode(){return this._get("mode")||"live"}get state(){const{messages:t,view:e}=this,o=e?.ready;return t?o?"ready":e?"loading":"disabled":"disabled"}get storage(){const{storageType:t}=this;return"session"===t?sessionStorage:localStorage}get waitingForConversions(){return null!=this._conversionPromise}setLocation(t){if(this._locationGraphic&&this.view?.graphics.remove(this._locationGraphic),!t)return;const e=t.clone();e.hasZ&&(e.z=void 0),this._locationGraphic=new o({geometry:e,symbol:this.locationSymbol}),this.view?.graphics.add(this._locationGraphic)}async convert(t,e){if(!C(e))throw new a("coordinate-conversion:invalid-point","Invalid point cannot be converted.",{point:e});return Promise.resolve().then(()=>t.convert(e))}async goToLocation(t){const{view:e}=this;if(!e)throw new a("coordinate-conversion:go-to-failed","no view");const o="3d"===e.type?e.clippingArea:null,i=e.map?.basemap?.baseLayers;if(o||(i?.length??0)>0){const e=o??i?.at(0)?.fullExtent;if(null!=e&&!e.contains(t))throw new a("coordinate-conversion:go-to-failed","Point outside basemap extent.",{point:t})}return this.callGoTo({target:t})}pause(){this.currentLocation=null,this.removeHandles(x.view),this.view&&(this.removeHandles(x.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic))}async previewConversion(t,e=this.currentLocation||j){return(await U(t,e)).displayCoordinate}resume(){"capture"===this.mode?this._startCaptureMode():this._startLiveMode()}reverseConvert(t,e){return e.reverseConvert(t)}async updateConversions(t,e){if("point"!==e?.type)throw this._clearConversions(this.conversions),new a("coordinate-conversion:invalid-input-point","Point is invalid, conversions cannot be updated.",{point:e});return this._convertMany(t,e)}_cleanUpView(t){t&&(this._locationGraphic&&t.graphics.remove(this._locationGraphic),this.removeHandles(x.view),this.removeHandles(x.cursor))}_clearConversions(t){t.forEach(t=>{t.position={location:null,coordinate:null}})}async _convertMany(t,e){return Promise.all(t.map(t=>U(t,e)))}_handleConversionChange(t){for(const e of t.added){const{format:t}=e;t&&(t.viewModel=this,this.currentLocation&&(this._set("waitingForConversions",!0),this.convert(t,this.currentLocation).then(t=>{e.position=t,this._set("waitingForConversions",!1)})))}this._saveWidgetState()}_handleFormatChange(t){t.added.forEach(t=>{this.addHandles(d(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format"),t.viewModel=this}),t.removed.forEach(t=>{t.viewModel=null;const e=this.conversions.filter(e=>e.format===t);this.conversions.removeMany(e),t.name&&this.removeHandles(t.name)})}_loadWidgetState(){try{const t=JSON.parse(this.storage.getItem(G));t&&this._setWidgetState(t)}catch(t){c.getLogger(this).error(new a("coordinate-conversion:invalid-session-storage-json","Could not read from storage.",{error:t}))}}_startCaptureMode(){this.removeHandles(x.view),this.view&&(this.currentLocation&&this.setLocation(this.currentLocation),this.removeHandles(x.cursor),this.addHandles(this.view.acquireCursor("crosshair","high"),x.cursor),this.addHandles(this.view.on("click",this._onClick),x.view))}_startLiveMode(){this._pointerCount=0,this.removeHandles(x.view),this.view&&(this.removeHandles(x.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic),this.addHandles([this.view.on("pointer-down",this._onPointerDown),this.view.on("pointer-up",this._onPointerUp),this.view.on("pointer-move",this._onPointerMove)],x.view))}_handleViewChange(t,e){e&&e!==t&&this._cleanUpView(e),t&&("capture"===this.mode?this._startCaptureMode():this._startLiveMode(),e&&this._filterFormatsAndConversions())}_onClick(t){if(0===t.button){const e=this.view?.toMap(t),o=e?.normalize();this.setLocation(o),this.currentLocation=o}}_onPointerDown(t){const{pointerType:e}=t;if(this._pointerCount++,("touch"===e||"pen"===e)&&1===this._pointerCount){const e=this.view?.toMap(t);this.currentLocation=e?.normalize()}}_onPointerMove(t){const{pointerType:e}=t;if("mouse"===e||1===this._pointerCount){const e=this.view?.toMap(t);this.currentLocation=e?.normalize()}}_onPointerUp(){this._pointerCount--}_setWidgetState(t){try{t.formats.forEach(e=>{const o=this.formats.find(t=>t.name===e.name);o&&t.locale===r()&&e.currentPattern&&(o.currentPattern=e.currentPattern),o&&e.index>=0&&this.conversions.add(new y({format:o}))})}catch(e){c.getLogger(this).warn(new a("coordinate-conversion:session-storage-read-error","Could not get state from stored JSON.",{error:e}))}}_saveWidgetState(){if(!this.storageEnabled)return;const t=this._toJSON();try{this.storage.setItem(G,JSON.stringify({formats:t,locale:r()}))}catch(e){c.getLogger(this).error(new a("coordinate-conversion:local-storage-write-error","Could not write to localStorage.",{error:e}))}}async _updateConversions(){try{await this.updateConversions(this.conversions.toArray(),this.currentLocation)}catch{}}_toJSON(){return this.formats.filter(t=>{const e=t.name;return"xy"===e||"basemap"===e||b(e)}).map(t=>({name:t.name,currentPattern:t.currentPattern,defaultPattern:t.defaultPattern,index:this.conversions.findIndex(e=>e.format===t)})).sort((t,e)=>t.index-e.index).toArray()}_filterFormatsAndConversions(){const{formatterAvailable:t,conversions:e,formats:o}=this;t||this.addHandles(m(()=>this.view?.spatialReference,t=>{const i=t.isWebMercator||t.isWGS84,s=o.filter(t=>{const{name:e}=t;return!!T(e)||"xy"===e&&!i}),r=this.filteredFormats.filter(t=>"xy"===t.name&&i&&!this.formats.includes(t)),n=e.filter(t=>s.includes(t.format));o.removeMany(s),e.removeMany(n),this.filteredFormats.addMany(s.filter(t=>!this.filteredFormats.includes(t))),o.addMany(r)},{once:!0,initial:!0}),x.view)}};async function U(t,e){try{t.position=await(t.format?.convert(e))}catch(o){t.position=null}return t}function T(t){return F.includes(t)}t([v()],W.prototype,"conversions",null),t([v({type:g})],W.prototype,"currentLocation",null),t([v({type:n.ofType(L)})],W.prototype,"formats",void 0),t([v()],W.prototype,"messages",void 0),t([v()],W.prototype,"mode",null),t([v()],W.prototype,"filteredFormats",void 0),t([v({readOnly:!0})],W.prototype,"state",null),t([v({types:_})],W.prototype,"locationSymbol",void 0),t([v({readOnly:!0,dependsOn:["storageType"]})],W.prototype,"storage",null),t([v()],W.prototype,"storageEnabled",void 0),t([v()],W.prototype,"storageType",void 0),t([v({readOnly:!0})],W.prototype,"waitingForConversions",null),t([v()],W.prototype,"view",void 0),W=t([p("esri.widgets.CoordinateConversion.CoordinateConversionViewModel")],W);const A=W;export{A 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{deprecateWidget as t}from"../core/deprecate.js";import o from"../core/Logger.js";import{maybeProperty as i}from"../core/maybe.js";import{property as s,cast as n,subclass as r}from"../core/accessorSupport/decorators.js";import a from"./Widget.js";import l from"./CoordinateConversion/CoordinateConversionViewModel.js";import p from"./CoordinateConversion/support/Conversion.js";import{loadCalciteComponents as c}from"./support/componentsUtils.js";import{globalCss as d}from"./support/globalCss.js";import{Heading as u}from"./support/Heading.js";import{legacyIcon as h}from"./support/legacyIcon.js";import{messageBundle as _,accessibleHandler as m,tsx as v,isRTL as g}from"./support/widget.js";import{storeNode as b}from"./support/widgetUtils.js";const y="esri-coordinate-conversion",C={base:y,captureMode:`${y}--capture-mode`,noBasemap:`${y}--no-basemap`,popup:`${y}__popup`,clipboardPopup:`${y}__clipboard-popup`,conversionList:`${y}__conversion-list`,conversionRow:`${y}__row`,coordDisplay:`${y}__display`,expandButton:`${y}__expand-button`,expanded:`${y}__conversions-view--expanded`,expandDown:`${y}__conversions-view--expand-down`,expandUp:`${y}__conversions-view--expand-up`,conversionsView:`${y}__conversions-view`,rowSelect:`${y}__select-row`,toolDisplay:`${y}__tools`,modeToggle:`${y}__mode-toggle`,rowButton:`${y}__row-button`,coordinateInput:`${y}__input-coordinate`,inputForm:`${y}__input-form`,inputFormGroup:`${y}__input-group`,inputSelect:`${y}__input-select`,sectionHeading:`${y}__heading`,patternInput:`${y}__pattern-input`,settings:`${y}__settings`,settingsFormGroup:`${y}__settings-group`,settingsFormGroupHorizontal:`${y}__settings-group-horizontal`,previewCoordinate:`${y}__preview-coordinate`},w={settingsButton:!0,inputButton:!0,captureButton:!0,expandButton:!0},f=750,T=2500;let I=class extends a{constructor(e,i){super(e,i),this._popupMessage=null,this._popupTimeoutId=void 0,this._clipboardPopupTimeoutId=void 0,this._coordinateInput=null,this._badInput=!1,this._goToEnabled=!1,this._conversionFormat=null,this._settingsFormat=null,this._previewConversion=null,this._expanded=!1,this._clipboardPopupVisible=!1,this._popupVisible=!1,this._settingsVisible=!1,this._inputVisible=!1,this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.orientation="auto",this.viewModel=new l,this.visibleElements={...w},t(o.getLogger(this),"CoordinateConversion","arcgis-coordinate-conversion",{version:"4.34"})}loadDependencies(){return c({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),select:()=>import("@esri/calcite-components/dist/components/calcite-select")})}get conversions(){return this.viewModel.conversions}set conversions(e){this.viewModel.conversions=e}get currentLocation(){return this.viewModel.currentLocation}set currentLocation(e){this.viewModel.currentLocation=e}get formats(){return this.viewModel.formats}set formats(e){this.viewModel.formats=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"coordinate-system"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get mode(){return this.viewModel.mode}set mode(e){this.viewModel.mode=e}set multipleConversions(e){!1===e&&(this._expanded=!1,this.conversions.splice(1,this.conversions.length-1)),this._set("multipleConversions",e)}get multipleConversions(){const e=this._get("multipleConversions");return"boolean"!=typeof e||e}get locationSymbol(){return this.viewModel.locationSymbol}set locationSymbol(e){this.viewModel.locationSymbol=e}get storageEnabled(){return this.viewModel.storageEnabled}set storageEnabled(e){this.viewModel.storageEnabled=e}get storageType(){return this.viewModel.storageType}set storageType(e){this.viewModel.storageType=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}castVisibleElements(e){return{...w,...e}}reverseConvert(e,t){return this.viewModel.reverseConvert(e,t)}render(){const e=this.viewModel?.state,t="disabled"===e?v("div",{key:"esri-coordinate__no-basemap"},this.messages?.noBasemap):null,o=!t&&this._inputVisible?this._renderInputForm():null,i=!t&&this._settingsVisible?this._renderSettings():null,s=t||o||i?null:this._renderConversionsView(),n=this._popupVisible?this._renderPopup():null,r={[C.captureMode]:"capture"===this.mode,[d.disabled]:"loading"===e,[C.noBasemap]:"disabled"===e};return v("div",{class:this.classes(C.base,d.widget,r)},n,t,s,i,o)}_addConversion(e){const t=e.target,o=t.selectedOption.value,i=P(t);if(null==o||null==i)return;const s=new p({format:o});t.value="default",i>=0?(this.conversions.removeAt(i),this.conversions.add(s,i)):this.conversions.add(s)}_findSettingsFormat(){return this._settingsFormat||this.conversions.reduceRight((e,t)=>{const o=t.format;return o?.hasDisplayProperties?o:e},null)||this.formats.find(e=>e.hasDisplayProperties)}_hidePopup(){this._popupTimeoutId&&(clearTimeout(this._popupTimeoutId),this._popupTimeoutId=void 0),this._popupVisible=!1,this._popupMessage=null,this.scheduleRender()}_hideClipboardPopup(){this._clipboardPopupTimeoutId&&(clearTimeout(this._clipboardPopupTimeoutId),this._clipboardPopupTimeoutId=void 0),this._clipboardPopupVisible=!1,this.scheduleRender()}_onConvertComplete(){this._inputVisible=!1,this._coordinateInput.value=""}_onCopy(e){const t=M(e.currentTarget)?.displayCoordinate;null!=t&&(e.clipboardData?.setData("text/plain",t),this._showClipboardPopup(),e.preventDefault())}_processUserInput(e){const t=i(e,"key"),s=this.viewModel;if("Enter"!==t&&t)this._badInput&&(this._badInput=!1);else{const e=this._conversionFormat||this.conversions.at(0).format;if(!e)return;const t=this._coordinateInput.value;this._reverseConvert(t,e).then(e=>{"capture"===this.mode?s.resume():this.mode="capture",this.currentLocation=e,s.setLocation(e),this._onConvertComplete()}).catch(e=>{o.getLogger(this).error(e),this._showPopup(this.messages?.invalidCoordinate),this._badInput=!0})}}async _reverseConvert(e,t){const i=this.viewModel,s=await t.reverseConvert(e);return this._goToEnabled&&s&&i.goToLocation(s).catch(e=>{o.getLogger(this).warn(e),this._showPopup(this.messages?.locationOffBasemap)}),s}_setInputFormat(e){const t=e.target.selectedOption.value;null!=t&&(this._conversionFormat=t)}_setPreviewConversion(){const e=this._findSettingsFormat(),t=this.viewModel;if(e){const o=this.conversions.find(t=>t.format===e);this._previewConversion=new p({format:e,position:{location:this.currentLocation,coordinate:o?.position?.coordinate}}),this._previewConversion.position?.coordinate||t.previewConversion(this._previewConversion)}}_setSettingsFormat(e){const t=e.target.selectedOption.value;null!=t&&(this._settingsFormat=t,this._setPreviewConversion())}_showClipboardPopup(){this._clipboardPopupVisible?clearTimeout(this._clipboardPopupTimeoutId):this._clipboardPopupVisible=!0,this.scheduleRender(),this._popupTimeoutId=setTimeout(()=>{this._popupTimeoutId=void 0,this._hideClipboardPopup()},f)}_showPopup(e,t=T){this._popupMessage=e,this._popupVisible?clearTimeout(this._popupTimeoutId):this._popupVisible=!0,this.scheduleRender(),this._popupTimeoutId=setTimeout(()=>{this._popupTimeoutId=void 0,this._hidePopup()},t)}_toggleGoTo(){this._goToEnabled=!this._goToEnabled}_updateCurrentPattern(e){e.stopPropagation();const t=e.target,o=this._findSettingsFormat();o&&(o.currentPattern=t.value)}_renderConversion(e,t){const{messages:o}=this;if(!o)return v("li",null);const{format:i}=e,s=i?.label??"",n=`${this.id}__list-item-${t}`,r=`${s} ${o.conversionOutputSuffix}`,a=0===t,l=a||this._expanded,p=a?this._renderFirstConversion(e):this._renderTools(t,e,n),c=a&&!e.displayCoordinate?o.noLocation:e.displayCoordinate,d=v("div",{"aria-label":c,class:C.coordDisplay,"data-conversion":e,role:"listitem",tabIndex:0,title:c??""},c),u=this._renderOptions(this.formats.filter(e=>e!==i));return l?v("li",{"aria-label":r,class:C.conversionRow,id:n,key:e,role:"group",tabIndex:0,title:r},v("calcite-select",{"aria-controls":n,bind:this,class:C.rowSelect,"data-index":t,label:o.selectFormat,scale:"s",onCalciteSelectChange:this._addConversion},v("calcite-option",{label:s.toUpperCase(),selected:!0},s.toUpperCase()),u),d,p):null}_renderCopyButton(e){const t=this._clipboardPopupVisible&&this._renderClipboardPopup(),{messagesCommon:o}=this;return o?v("li",{"aria-label":o.copy,bind:this,class:this.classes(d.widgetButton,C.rowButton),"data-conversion":e,onclick:this._copyCoordinateOutput,oncopy:this._onCopy,onkeydown:this._copyCoordinateOutput,role:"button",tabIndex:0,title:o.copy},t,v("span",{"aria-hidden":"true",class:h.duplicate})):v("li",null)}_renderFirstConversion(e){const t=this.id,{messages:o,messagesCommon:i,multipleConversions:s,visibleElements:n}=this;if(!i||!o)return v("ul",null);const r="live"===this.mode?o.captureMode:o.liveMode,a=this._expanded?i.collapse:i.expand,l=e.displayCoordinate&&"capture"===this.mode?this._renderCopyButton(e):null,p=s&&n.expandButton&&this._renderIconButton({iconType:this._expanded?"chevron-down":"chevron-up",clickFunction:this._toggleExpand,classes:[C.expandButton],attributes:{"aria-controls":`${t}__${C.conversionList}`,label:a}}),c=!s&&n.captureButton&&this._renderIconButton({iconType:"live"===this.mode?"pin-tear":"pin-tear-f",clickFunction:this._toggleMode,classes:[C.modeToggle],attributes:{label:r}});return v("ul",{class:C.toolDisplay},l,p,c)}_renderInputForm(){const e=this._conversionFormat||this.conversions.at(0).format,t=this.formats.findIndex(t=>t.name===e?.name),o=this.id,i=`${o}__${C.coordinateInput}`,s=`${o}__${C.coordinateInput}__header`,n=this._renderOptions(this.formats,!0,t),{messages:r,messagesCommon:a,headingLevel:l}=this;if(!a||!r)return v("div",null);const p=this._renderIconButton({iconType:g(this.container)?"arrow-right":"arrow-left",clickFunction:this._toggleInputVisibility,attributes:{label:a.back}});return v("div",{"aria-labelledby":s,class:C.inputForm,key:"esri-coordinate-conversion__input-form",role:"search"},v("div",{class:C.sectionHeading},p,v(u,{class:d.heading,id:s,level:l},r.inputCoordTitle)),v("div",{class:C.inputFormGroup},v("calcite-select",{"aria-controls":i,bind:this,class:C.inputSelect,label:r.selectFormat,scale:"s",onCalciteSelectChange:this._setInputFormat},n),v("calcite-input",{afterCreate:b,"aria-labelledby":s,bind:this,class:C.coordinateInput,"data-format":e,"data-node-ref":"_coordinateInput",id:i,onkeydown:this._processUserInput,placeholder:r.inputCoordTitle,required:!0,scale:"s",spellcheck:!1,status:this._badInput?"invalid":"idle"})),v("div",{class:C.inputFormGroup},v("calcite-label",{layout:"inline",scale:"s"},v("calcite-checkbox",{bind:this,checked:this._goToEnabled,onCalciteCheckboxChange:this._toggleGoTo}),r.goTo),v("calcite-button",{appearance:"outline",bind:this,kind:"neutral",onclick:this._processUserInput,type:"button",width:"auto"},r.convert)))}_renderConversionsView(){const{messages:e}=this;if(!e)return v("div",null);const t=`${this.id}__${C.conversionList}`,o=this._renderPrimaryTools(),i=this._renderOptions(this.formats),s=this.conversions.map((e,t)=>this._renderConversion(e,t)).toArray(),n=this._expanded?v("div",{class:C.conversionRow},v("calcite-select",{"aria-controls":t,bind:this,"data-index":-1,label:e.addConversion,scale:"s",onCalciteSelectChange:this._addConversion},v("calcite-option",{disabled:!0,selected:!0,value:"default"},e.addConversion),i),o):null,r={[C.expanded]:this._expanded,[C.expandUp]:"expand-up"===this.orientation,[C.expandDown]:"expand-down"===this.orientation};return v("div",{class:this.classes(C.conversionsView,r),key:"esri-coordinate-conversion__main-view"},v("ul",{"aria-expanded":this._expanded?"true":"false",class:C.conversionList,id:t},s),n)}_renderOptions(e,t,o){const i=this.conversions.at(0),s=i.format?.name;return e.map((e,n)=>{const r=!(t||!i)&&(s===e.name||this.conversions.map(e=>e.format?.name).includes(e.name));return v("calcite-option",{disabled:r,key:e.name??"unnamed-format",label:e.label.toUpperCase(),selected:n===o,value:e},e.label)}).toArray()}_renderPopup(){return v("div",{class:C.popup,role:"alert"},this._popupMessage)}_renderClipboardPopup(){const{messages:e}=this;return e?v("div",{class:this.classes(C.popup,C.clipboardPopup),role:"alert"},e.copySuccessMessage):v("div",null)}_renderPrimaryTools(){const{messages:e,visibleElements:t}=this;if(!e)return v("ul",null);const o="live"===this.mode?e.captureMode:e.liveMode,i=t.inputButton&&this._renderIconButton({iconType:"pencil",clickFunction:this._toggleInputVisibility,attributes:{label:e.inputCoordTitle}}),s=t.captureButton&&this._renderIconButton({iconType:"live"===this.mode?"pin-tear":"pin-tear-f",clickFunction:this._toggleMode,classes:[C.modeToggle],attributes:{label:o}}),n=t.settingsButton&&this._renderIconButton({iconType:"gear",clickFunction:this._toggleSettingsVisibility,attributes:{label:e.settingsTitle}});return v("ul",{class:C.toolDisplay},i,s,n)}_renderSettings(){const e=this.id,t=`${e}__${C.patternInput}`,o=`${e}__${C.patternInput}__header`,i=`${e}__${C.previewCoordinate}`,s=this.formats.filter(e=>e.hasDisplayProperties),n=this._findSettingsFormat(),r=n?s.indexOf(n):-1,a=this._renderOptions(s,!0,r),l=n?.currentPattern,{messages:p,messagesCommon:c,headingLevel:h}=this;if(!c||!p)return v("div",null);const _=this._renderIconButton({iconType:g(this.container)?"arrow-right":"arrow-left",clickFunction:this._toggleSettingsVisibility,attributes:{label:c.back}}),m=this._renderIconButton({iconType:"reset",clickFunction:this._setDefaultPattern,attributes:{label:p.defaultPattern}});return v("div",{"aria-labelledby":o,class:C.settings,key:C.settings},v("div",{class:C.sectionHeading},_,v(u,{class:d.heading,id:o,level:h},p.settingsTitle)),v("div",{class:C.settingsFormGroup},v("label",{for:t},p.changeCoordinateDisplay),v("calcite-select",{bind:this,label:p.selectFormat,width:"full",onCalciteSelectChange:this._setSettingsFormat},a),v("div",{class:C.settingsFormGroupHorizontal},v("calcite-input",{"aria-controls":i,bind:this,class:C.patternInput,id:t,spellcheck:!1,type:"text",value:l,onCalciteInputInput:this._updateCurrentPattern}),m)),v("div",{class:C.settingsFormGroup},v("label",null,c.preview,v("div",{class:C.previewCoordinate,id:i,tabIndex:0},this._previewConversion?.displayCoordinate))))}_renderIconButton(e){const{iconType:t,clickFunction:o,classes:i,attributes:s}=e;return v("calcite-button",{appearance:"transparent",bind:this,class:this.classes(i),iconStart:t,kind:"neutral",onclick:o,onkeydown:o,...s})}_renderTools(e,t,o){const i=t.displayCoordinate&&"capture"===this.mode?this._renderCopyButton(t):null,{messages:s}=this;if(!s)return v("ul",null);const n=this._renderIconButton({iconType:"x",clickFunction:this._removeConversion,attributes:{"aria-controls":o,label:s.removeConversion,"data-index":e}});return v("ul",{class:C.toolDisplay,role:"listitem"},i,v("li",{class:this.classes(C.rowButton)},n))}_copyCoordinateOutput(e){const t=e.target;if(!("createTextRange"in document.body)){const e=window.getSelection(),o=document.createRange();o.selectNodeContents(t),e?.removeAllRanges(),e?.addRange(o)}document.execCommand("copy")}_removeConversion(e){const t=P(e.currentTarget);null!=t&&this.conversions.removeAt(t)}_setDefaultPattern(e){e.stopPropagation();const t=this._findSettingsFormat();t&&(t.currentPattern=t.defaultPattern)}_toggleExpand(){this._expanded=!this._expanded}_toggleInputVisibility(){this._inputVisible=!this._inputVisible,this._popupVisible&&this._hidePopup(),this._inputVisible?this.viewModel.pause():this.viewModel.resume()}_toggleMode(){this.mode="live"===this.mode?"capture":"live"}_toggleSettingsVisibility(){this._settingsVisible=!this._settingsVisible,this._popupVisible&&this._hidePopup(),this._settingsVisible?(this._setPreviewConversion(),this.viewModel.pause()):this.viewModel.resume()}};e([s()],I.prototype,"conversions",null),e([s()],I.prototype,"currentLocation",null),e([s()],I.prototype,"formats",null),e([s()],I.prototype,"goToOverride",null),e([s()],I.prototype,"headingLevel",void 0),e([s()],I.prototype,"icon",null),e([s()],I.prototype,"label",null),e([s(),_("esri/widgets/CoordinateConversion/t9n/CoordinateConversion")],I.prototype,"messages",void 0),e([s(),_("esri/t9n/common")],I.prototype,"messagesCommon",void 0),e([s()],I.prototype,"mode",null),e([s()],I.prototype,"orientation",void 0),e([s()],I.prototype,"multipleConversions",null),e([s()],I.prototype,"locationSymbol",null),e([s()],I.prototype,"storageEnabled",null),e([s()],I.prototype,"storageType",null),e([s()],I.prototype,"view",null),e([s({type:l})],I.prototype,"viewModel",void 0),e([s()],I.prototype,"visibleElements",void 0),e([n("visibleElements")],I.prototype,"castVisibleElements",null),e([m()],I.prototype,"_copyCoordinateOutput",null),e([m()],I.prototype,"_removeConversion",null),e([m()],I.prototype,"_setDefaultPattern",null),e([m()],I.prototype,"_toggleExpand",null),e([m()],I.prototype,"_toggleInputVisibility",null),e([m()],I.prototype,"_toggleMode",null),e([m()],I.prototype,"_toggleSettingsVisibility",null),I=e([r("esri.widgets.CoordinateConversion")],I);const x=I;function P(e){return e["data-index"]}function M(e){return e["data-conversion"]}export{x as default};
5
+ import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{deprecateWidget as o}from"../core/deprecate.js";import i from"../core/Logger.js";import{maybeProperty as s}from"../core/maybe.js";import{property as n,cast as r,subclass as l}from"../core/accessorSupport/decorators.js";import{pointSymbolTypes as a}from"../symbols/support/typeUtils.js";import p from"./Widget.js";import c from"./CoordinateConversion/CoordinateConversionViewModel.js";import d from"./CoordinateConversion/support/Conversion.js";import u from"./CoordinateConversion/support/Format.js";import{loadCalciteComponents as h}from"./support/componentsUtils.js";import{globalCss as _}from"./support/globalCss.js";import{Heading as m}from"./support/Heading.js";import{legacyIcon as v}from"./support/legacyIcon.js";import{messageBundle as g,accessibleHandler as b,tsx as y,isRTL as C}from"./support/widget.js";import{storeNode as w}from"./support/widgetUtils.js";const f="esri-coordinate-conversion",T={base:f,captureMode:`${f}--capture-mode`,noBasemap:`${f}--no-basemap`,popup:`${f}__popup`,clipboardPopup:`${f}__clipboard-popup`,conversionList:`${f}__conversion-list`,conversionRow:`${f}__row`,coordDisplay:`${f}__display`,expandButton:`${f}__expand-button`,expanded:`${f}__conversions-view--expanded`,expandDown:`${f}__conversions-view--expand-down`,expandUp:`${f}__conversions-view--expand-up`,conversionsView:`${f}__conversions-view`,rowSelect:`${f}__select-row`,toolDisplay:`${f}__tools`,modeToggle:`${f}__mode-toggle`,rowButton:`${f}__row-button`,coordinateInput:`${f}__input-coordinate`,inputForm:`${f}__input-form`,inputFormGroup:`${f}__input-group`,inputSelect:`${f}__input-select`,sectionHeading:`${f}__heading`,patternInput:`${f}__pattern-input`,settings:`${f}__settings`,settingsFormGroup:`${f}__settings-group`,settingsFormGroupHorizontal:`${f}__settings-group-horizontal`,previewCoordinate:`${f}__preview-coordinate`},I={settingsButton:!0,inputButton:!0,captureButton:!0,expandButton:!0},x=750,P=2500;let M=class extends p{constructor(e,t){super(e,t),this._popupMessage=null,this._popupTimeoutId=void 0,this._clipboardPopupTimeoutId=void 0,this._coordinateInput=null,this._badInput=!1,this._goToEnabled=!1,this._conversionFormat=null,this._settingsFormat=null,this._previewConversion=null,this._expanded=!1,this._clipboardPopupVisible=!1,this._popupVisible=!1,this._settingsVisible=!1,this._inputVisible=!1,this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.orientation="auto",this.viewModel=new c,this.visibleElements={...I},o(i.getLogger(this),"CoordinateConversion","arcgis-coordinate-conversion",{version:"4.34"})}loadDependencies(){return h({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),select:()=>import("@esri/calcite-components/dist/components/calcite-select")})}get conversions(){return this.viewModel.conversions}set conversions(e){this.viewModel.conversions=e}get currentLocation(){return this.viewModel.currentLocation}set currentLocation(e){this.viewModel.currentLocation=e}get formats(){return this.viewModel.formats}set formats(e){this.viewModel.formats=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"coordinate-system"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get mode(){return this.viewModel.mode}set mode(e){this.viewModel.mode=e}set multipleConversions(e){!1===e&&(this._expanded=!1,this.conversions.splice(1,this.conversions.length-1)),this._set("multipleConversions",e)}get multipleConversions(){const e=this._get("multipleConversions");return"boolean"!=typeof e||e}get locationSymbol(){return this.viewModel.locationSymbol}set locationSymbol(e){this.viewModel.locationSymbol=e}get storageEnabled(){return this.viewModel.storageEnabled}set storageEnabled(e){this.viewModel.storageEnabled=e}get storageType(){return this.viewModel.storageType}set storageType(e){this.viewModel.storageType=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}castVisibleElements(e){return{...I,...e}}reverseConvert(e,t){return this.viewModel.reverseConvert(e,t)}render(){const e=this.viewModel?.state,t="disabled"===e?y("div",{key:"esri-coordinate__no-basemap"},this.messages?.noBasemap):null,o=!t&&this._inputVisible?this._renderInputForm():null,i=!t&&this._settingsVisible?this._renderSettings():null,s=t||o||i?null:this._renderConversionsView(),n=this._popupVisible?this._renderPopup():null,r={[T.captureMode]:"capture"===this.mode,[_.disabled]:"loading"===e,[T.noBasemap]:"disabled"===e};return y("div",{class:this.classes(T.base,_.widget,r)},n,t,s,i,o)}_addConversion(e){const t=e.target,o=t.selectedOption.value,i=$(t);if(null==o||null==i)return;const s=new d({format:o});t.value="default",i>=0?(this.conversions.removeAt(i),this.conversions.add(s,i)):this.conversions.add(s)}_findSettingsFormat(){return this._settingsFormat||this.conversions.reduceRight((e,t)=>{const o=t.format;return o?.hasDisplayProperties?o:e},null)||this.formats.find(e=>e.hasDisplayProperties)}_hidePopup(){this._popupTimeoutId&&(clearTimeout(this._popupTimeoutId),this._popupTimeoutId=void 0),this._popupVisible=!1,this._popupMessage=null,this.scheduleRender()}_hideClipboardPopup(){this._clipboardPopupTimeoutId&&(clearTimeout(this._clipboardPopupTimeoutId),this._clipboardPopupTimeoutId=void 0),this._clipboardPopupVisible=!1,this.scheduleRender()}_onConvertComplete(){this._inputVisible=!1,this._coordinateInput.value=""}_onCopy(e){const t=V(e.currentTarget)?.displayCoordinate;null!=t&&(e.clipboardData?.setData("text/plain",t),this._showClipboardPopup(),e.preventDefault())}_processUserInput(e){const t=s(e,"key"),o=this.viewModel;if("Enter"!==t&&t)this._badInput&&(this._badInput=!1);else{const e=this._conversionFormat||this.conversions.at(0).format;if(!e)return;const t=this._coordinateInput.value;this._reverseConvert(t,e).then(e=>{"capture"===this.mode?o.resume():this.mode="capture",this.currentLocation=e,o.setLocation(e),this._onConvertComplete()}).catch(e=>{i.getLogger(this).error(e),this._showPopup(this.messages?.invalidCoordinate),this._badInput=!0})}}async _reverseConvert(e,t){const o=this.viewModel,s=await t.reverseConvert(e);return this._goToEnabled&&s&&o.goToLocation(s).catch(e=>{i.getLogger(this).warn(e),this._showPopup(this.messages?.locationOffBasemap)}),s}_setInputFormat(e){const t=e.target.selectedOption.value;null!=t&&(this._conversionFormat=t)}_setPreviewConversion(){const e=this._findSettingsFormat(),t=this.viewModel;if(e){const o=this.conversions.find(t=>t.format===e);this._previewConversion=new d({format:e,position:{location:this.currentLocation,coordinate:o?.position?.coordinate}}),this._previewConversion.position?.coordinate||t.previewConversion(this._previewConversion)}}_setSettingsFormat(e){const t=e.target.selectedOption.value;null!=t&&(this._settingsFormat=t,this._setPreviewConversion())}_showClipboardPopup(){this._clipboardPopupVisible?clearTimeout(this._clipboardPopupTimeoutId):this._clipboardPopupVisible=!0,this.scheduleRender(),this._popupTimeoutId=setTimeout(()=>{this._popupTimeoutId=void 0,this._hideClipboardPopup()},x)}_showPopup(e,t=P){this._popupMessage=e,this._popupVisible?clearTimeout(this._popupTimeoutId):this._popupVisible=!0,this.scheduleRender(),this._popupTimeoutId=setTimeout(()=>{this._popupTimeoutId=void 0,this._hidePopup()},t)}_toggleGoTo(){this._goToEnabled=!this._goToEnabled}_updateCurrentPattern(e){e.stopPropagation();const t=e.target,o=this._findSettingsFormat();o&&(o.currentPattern=t.value)}_renderConversion(e,t){const{messages:o}=this;if(!o)return y("li",null);const{format:i}=e,s=i?.label??"",n=`${this.id}__list-item-${t}`,r=`${s} ${o.conversionOutputSuffix}`,l=0===t,a=l||this._expanded,p=l?this._renderFirstConversion(e):this._renderTools(t,e,n),c=l&&!e.displayCoordinate?o.noLocation:e.displayCoordinate,d=y("div",{"aria-label":c,class:T.coordDisplay,"data-conversion":e,role:"listitem",tabIndex:0,title:c??""},c),u=this._renderOptions(this.formats.filter(e=>e!==i));return a?y("li",{"aria-label":r,class:T.conversionRow,id:n,key:e,role:"group",tabIndex:0,title:r},y("calcite-select",{"aria-controls":n,bind:this,class:T.rowSelect,"data-index":t,label:o.selectFormat,scale:"s",onCalciteSelectChange:this._addConversion},y("calcite-option",{label:s.toUpperCase(),selected:!0},s.toUpperCase()),u),d,p):null}_renderCopyButton(e){const t=this._clipboardPopupVisible&&this._renderClipboardPopup(),{messagesCommon:o}=this;return o?y("li",{"aria-label":o.copy,bind:this,class:this.classes(_.widgetButton,T.rowButton),"data-conversion":e,onclick:this._copyCoordinateOutput,oncopy:this._onCopy,onkeydown:this._copyCoordinateOutput,role:"button",tabIndex:0,title:o.copy},t,y("span",{"aria-hidden":"true",class:v.duplicate})):y("li",null)}_renderFirstConversion(e){const t=this.id,{messages:o,messagesCommon:i,multipleConversions:s,visibleElements:n}=this;if(!i||!o)return y("ul",null);const r="live"===this.mode?o.captureMode:o.liveMode,l=this._expanded?i.collapse:i.expand,a=e.displayCoordinate&&"capture"===this.mode?this._renderCopyButton(e):null,p=s&&n.expandButton&&this._renderIconButton({iconType:this._expanded?"chevron-down":"chevron-up",clickFunction:this._toggleExpand,classes:[T.expandButton],attributes:{"aria-controls":`${t}__${T.conversionList}`,label:l}}),c=!s&&n.captureButton&&this._renderIconButton({iconType:"live"===this.mode?"pin-tear":"pin-tear-f",clickFunction:this._toggleMode,classes:[T.modeToggle],attributes:{label:r}});return y("ul",{class:T.toolDisplay},a,p,c)}_renderInputForm(){const e=this._conversionFormat||this.conversions.at(0).format,t=this.formats.findIndex(t=>t.name===e?.name),o=this.id,i=`${o}__${T.coordinateInput}`,s=`${o}__${T.coordinateInput}__header`,n=this._renderOptions(this.formats,!0,t),{messages:r,messagesCommon:l,headingLevel:a}=this;if(!l||!r)return y("div",null);const p=this._renderIconButton({iconType:C(this.container)?"arrow-right":"arrow-left",clickFunction:this._toggleInputVisibility,attributes:{label:l.back}});return y("div",{"aria-labelledby":s,class:T.inputForm,key:"esri-coordinate-conversion__input-form",role:"search"},y("div",{class:T.sectionHeading},p,y(m,{class:_.heading,id:s,level:a},r.inputCoordTitle)),y("div",{class:T.inputFormGroup},y("calcite-select",{"aria-controls":i,bind:this,class:T.inputSelect,label:r.selectFormat,scale:"s",onCalciteSelectChange:this._setInputFormat},n),y("calcite-input",{afterCreate:w,"aria-labelledby":s,bind:this,class:T.coordinateInput,"data-format":e,"data-node-ref":"_coordinateInput",id:i,onkeydown:this._processUserInput,placeholder:r.inputCoordTitle,required:!0,scale:"s",spellcheck:!1,status:this._badInput?"invalid":"idle"})),y("div",{class:T.inputFormGroup},y("calcite-label",{layout:"inline",scale:"s"},y("calcite-checkbox",{bind:this,checked:this._goToEnabled,onCalciteCheckboxChange:this._toggleGoTo}),r.goTo),y("calcite-button",{appearance:"outline",bind:this,kind:"neutral",onclick:this._processUserInput,type:"button",width:"auto"},r.convert)))}_renderConversionsView(){const{messages:e}=this;if(!e)return y("div",null);const t=`${this.id}__${T.conversionList}`,o=this._renderPrimaryTools(),i=this._renderOptions(this.formats),s=this.conversions.map((e,t)=>this._renderConversion(e,t)).toArray(),n=this._expanded?y("div",{class:T.conversionRow},y("calcite-select",{"aria-controls":t,bind:this,"data-index":-1,label:e.addConversion,scale:"s",onCalciteSelectChange:this._addConversion},y("calcite-option",{disabled:!0,selected:!0,value:"default"},e.addConversion),i),o):null,r={[T.expanded]:this._expanded,[T.expandUp]:"expand-up"===this.orientation,[T.expandDown]:"expand-down"===this.orientation};return y("div",{class:this.classes(T.conversionsView,r),key:"esri-coordinate-conversion__main-view"},y("ul",{"aria-expanded":this._expanded?"true":"false",class:T.conversionList,id:t},s),n)}_renderOptions(e,t,o){const i=this.conversions.at(0),s=i.format?.name;return e.map((e,n)=>{const r=!(t||!i)&&(s===e.name||this.conversions.map(e=>e.format?.name).includes(e.name));return y("calcite-option",{disabled:r,key:e.name??"unnamed-format",label:e.label.toUpperCase(),selected:n===o,value:e},e.label)}).toArray()}_renderPopup(){return y("div",{class:T.popup,role:"alert"},this._popupMessage)}_renderClipboardPopup(){const{messages:e}=this;return e?y("div",{class:this.classes(T.popup,T.clipboardPopup),role:"alert"},e.copySuccessMessage):y("div",null)}_renderPrimaryTools(){const{messages:e,visibleElements:t}=this;if(!e)return y("ul",null);const o="live"===this.mode?e.captureMode:e.liveMode,i=t.inputButton&&this._renderIconButton({iconType:"pencil",clickFunction:this._toggleInputVisibility,attributes:{label:e.inputCoordTitle}}),s=t.captureButton&&this._renderIconButton({iconType:"live"===this.mode?"pin-tear":"pin-tear-f",clickFunction:this._toggleMode,classes:[T.modeToggle],attributes:{label:o}}),n=t.settingsButton&&this._renderIconButton({iconType:"gear",clickFunction:this._toggleSettingsVisibility,attributes:{label:e.settingsTitle}});return y("ul",{class:T.toolDisplay},i,s,n)}_renderSettings(){const e=this.id,t=`${e}__${T.patternInput}`,o=`${e}__${T.patternInput}__header`,i=`${e}__${T.previewCoordinate}`,s=this.formats.filter(e=>e.hasDisplayProperties),n=this._findSettingsFormat(),r=n?s.indexOf(n):-1,l=this._renderOptions(s,!0,r),a=n?.currentPattern,{messages:p,messagesCommon:c,headingLevel:d}=this;if(!c||!p)return y("div",null);const u=this._renderIconButton({iconType:C(this.container)?"arrow-right":"arrow-left",clickFunction:this._toggleSettingsVisibility,attributes:{label:c.back}}),h=this._renderIconButton({iconType:"reset",clickFunction:this._setDefaultPattern,attributes:{label:p.defaultPattern}});return y("div",{"aria-labelledby":o,class:T.settings,key:T.settings},y("div",{class:T.sectionHeading},u,y(m,{class:_.heading,id:o,level:d},p.settingsTitle)),y("div",{class:T.settingsFormGroup},y("label",{for:t},p.changeCoordinateDisplay),y("calcite-select",{bind:this,label:p.selectFormat,width:"full",onCalciteSelectChange:this._setSettingsFormat},l),y("div",{class:T.settingsFormGroupHorizontal},y("calcite-input",{"aria-controls":i,bind:this,class:T.patternInput,id:t,spellcheck:!1,type:"text",value:a,onCalciteInputInput:this._updateCurrentPattern}),h)),y("div",{class:T.settingsFormGroup},y("label",null,c.preview,y("div",{class:T.previewCoordinate,id:i,tabIndex:0},this._previewConversion?.displayCoordinate))))}_renderIconButton(e){const{iconType:t,clickFunction:o,classes:i,attributes:s}=e;return y("calcite-button",{appearance:"transparent",bind:this,class:this.classes(i),iconStart:t,kind:"neutral",onclick:o,onkeydown:o,...s})}_renderTools(e,t,o){const i=t.displayCoordinate&&"capture"===this.mode?this._renderCopyButton(t):null,{messages:s}=this;if(!s)return y("ul",null);const n=this._renderIconButton({iconType:"x",clickFunction:this._removeConversion,attributes:{"aria-controls":o,label:s.removeConversion,"data-index":e}});return y("ul",{class:T.toolDisplay,role:"listitem"},i,y("li",{class:this.classes(T.rowButton)},n))}_copyCoordinateOutput(e){const t=e.target;if(!("createTextRange"in document.body)){const e=window.getSelection(),o=document.createRange();o.selectNodeContents(t),e?.removeAllRanges(),e?.addRange(o)}document.execCommand("copy")}_removeConversion(e){const t=$(e.currentTarget);null!=t&&this.conversions.removeAt(t)}_setDefaultPattern(e){e.stopPropagation();const t=this._findSettingsFormat();t&&(t.currentPattern=t.defaultPattern)}_toggleExpand(){this._expanded=!this._expanded}_toggleInputVisibility(){this._inputVisible=!this._inputVisible,this._popupVisible&&this._hidePopup(),this._inputVisible?this.viewModel.pause():this.viewModel.resume()}_toggleMode(){this.mode="live"===this.mode?"capture":"live"}_toggleSettingsVisibility(){this._settingsVisible=!this._settingsVisible,this._popupVisible&&this._hidePopup(),this._settingsVisible?(this._setPreviewConversion(),this.viewModel.pause()):this.viewModel.resume()}};e([n()],M.prototype,"conversions",null),e([n()],M.prototype,"currentLocation",null),e([n({type:t.ofType(u)})],M.prototype,"formats",null),e([n()],M.prototype,"goToOverride",null),e([n()],M.prototype,"headingLevel",void 0),e([n()],M.prototype,"icon",null),e([n()],M.prototype,"label",null),e([n(),g("esri/widgets/CoordinateConversion/t9n/CoordinateConversion")],M.prototype,"messages",void 0),e([n(),g("esri/t9n/common")],M.prototype,"messagesCommon",void 0),e([n()],M.prototype,"mode",null),e([n()],M.prototype,"orientation",void 0),e([n()],M.prototype,"multipleConversions",null),e([n({types:a})],M.prototype,"locationSymbol",null),e([n()],M.prototype,"storageEnabled",null),e([n()],M.prototype,"storageType",null),e([n()],M.prototype,"view",null),e([n({type:c})],M.prototype,"viewModel",void 0),e([n()],M.prototype,"visibleElements",void 0),e([r("visibleElements")],M.prototype,"castVisibleElements",null),e([b()],M.prototype,"_copyCoordinateOutput",null),e([b()],M.prototype,"_removeConversion",null),e([b()],M.prototype,"_setDefaultPattern",null),e([b()],M.prototype,"_toggleExpand",null),e([b()],M.prototype,"_toggleInputVisibility",null),e([b()],M.prototype,"_toggleMode",null),e([b()],M.prototype,"_toggleSettingsVisibility",null),M=e([l("esri.widgets.CoordinateConversion")],M);const F=M;function $(e){return e["data-index"]}function V(e){return e["data-conversion"]}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{__decorate as e}from"tslib";import{deprecateWidget as t}from"../core/deprecate.js";import i from"../core/Logger.js";import{ignoreAbortErrors as s}from"../core/promiseUtils.js";import{property as o,subclass as r}from"../core/accessorSupport/decorators.js";import n from"./Widget.js";import l from"./DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js";import{globalCss as a}from"./support/globalCss.js";import{MeasurementWidgetContent as u}from"./support/MeasurementWidgetContent.js";import{messageBundle as p,tsx as m}from"./support/widget.js";const c="esri-direct-line-measurement-3d",d={base:c,newMeasurementButton:`${c}__clear-button`};let v=class extends n{constructor(e,s){super(e,s),this.messages=null,this.messagesCommon=null,this.viewModel=new l({isDefaultViewModel:!0}),t(i.getLogger(this),"Direct Line Measurement 3D","arcgis-direct-line-measurement-3d",{version:"4.33"})}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get icon(){return"measure-line"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(e){this.viewModel.unitOptions=e}get unit(){return this.viewModel.unit}set unit(e){this.viewModel.unit=e}render(){const{messages:e,messagesCommon:t,unit:i,unitOptions:o,viewModel:r}=this,{active:n,measurement:l,state:p,supported:c}=r;return m("div",{"aria-label":this.messages.widgetLabel,class:this.classes(d.base,a.widget,a.panel),key:this,role:"presentation"},this.visible?m(u,{active:n,measurementItems:[{key:"direct",title:e.direct,value:g(l?.directDistance)},{key:"horizontal",title:e.horizontal,value:g(l?.horizontalDistance)},{key:"vertical",title:e.vertical,value:g(l?.verticalDistance)}],messages:{...e,notApplicable:t?.notApplicable},newMeasurementButtonClass:d.newMeasurementButton,state:p,supported:c,unit:i,unitOptions:o,onNewMeasurementClick:()=>{s(this.viewModel.start())},onUnitChange:e=>{this.unit=e}}):null)}};function g(e){return"available"===e?.state?e.text:null}e([o()],v.prototype,"view",null),e([o()],v.prototype,"visible",null),e([o()],v.prototype,"active",null),e([o({nonNullable:!0})],v.prototype,"analysis",null),e([o()],v.prototype,"icon",null),e([o()],v.prototype,"label",null),e([o(),p("esri/widgets/DirectLineMeasurement3D/t9n/DirectLineMeasurement3D")],v.prototype,"messages",void 0),e([o(),p("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([o()],v.prototype,"uiStrings",void 0),e([o({type:l})],v.prototype,"viewModel",void 0),e([o()],v.prototype,"unitOptions",null),e([o()],v.prototype,"unit",null),v=e([r("esri.widgets.DirectLineMeasurement3D")],v);const w=v;export{w as default};
5
+ import{__decorate as e}from"tslib";import t from"../analysis/DirectLineMeasurementAnalysis.js";import{deprecateWidget as i}from"../core/deprecate.js";import s from"../core/Logger.js";import{ignoreAbortErrors as o}from"../core/promiseUtils.js";import{property as r,subclass as n}from"../core/accessorSupport/decorators.js";import l from"./Widget.js";import a from"./DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js";import{globalCss as u}from"./support/globalCss.js";import{MeasurementWidgetContent as p}from"./support/MeasurementWidgetContent.js";import{messageBundle as m,tsx as c}from"./support/widget.js";const d="esri-direct-line-measurement-3d",v={base:d,newMeasurementButton:`${d}__clear-button`};let g=class extends l{constructor(e,t){super(e,t),this.messages=null,this.messagesCommon=null,this.viewModel=new a({isDefaultViewModel:!0}),i(s.getLogger(this),"Direct Line Measurement 3D","arcgis-direct-line-measurement-3d",{version:"4.33"})}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get icon(){return"measure-line"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(e){this.viewModel.unitOptions=e}get unit(){return this.viewModel.unit}set unit(e){this.viewModel.unit=e}render(){const{messages:e,messagesCommon:t,unit:i,unitOptions:s,viewModel:r}=this,{active:n,measurement:l,state:a,supported:m}=r;return c("div",{"aria-label":this.messages.widgetLabel,class:this.classes(v.base,u.widget,u.panel),key:this,role:"presentation"},this.visible?c(p,{active:n,measurementItems:[{key:"direct",title:e.direct,value:w(l?.directDistance)},{key:"horizontal",title:e.horizontal,value:w(l?.horizontalDistance)},{key:"vertical",title:e.vertical,value:w(l?.verticalDistance)}],messages:{...e,notApplicable:t?.notApplicable},newMeasurementButtonClass:v.newMeasurementButton,state:a,supported:m,unit:i,unitOptions:s,onNewMeasurementClick:()=>{o(this.viewModel.start())},onUnitChange:e=>{this.unit=e}}):null)}};function w(e){return"available"===e?.state?e.text:null}e([r()],g.prototype,"view",null),e([r()],g.prototype,"visible",null),e([r()],g.prototype,"active",null),e([r({type:t,nonNullable:!0})],g.prototype,"analysis",null),e([r()],g.prototype,"icon",null),e([r()],g.prototype,"label",null),e([r(),m("esri/widgets/DirectLineMeasurement3D/t9n/DirectLineMeasurement3D")],g.prototype,"messages",void 0),e([r(),m("esri/t9n/common")],g.prototype,"messagesCommon",void 0),e([r()],g.prototype,"uiStrings",void 0),e([r({type:a})],g.prototype,"viewModel",void 0),e([r()],g.prototype,"unitOptions",null),e([r()],g.prototype,"unit",null),g=e([n("esri.widgets.DirectLineMeasurement3D")],g);const h=g;export{h 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{ignoreAbortErrors as t}from"../core/promiseUtils.js";import{property as s,subclass as i}from"../core/accessorSupport/decorators.js";import o from"./Widget.js";import n from"./DistanceMeasurement2D/DistanceMeasurement2DViewModel.js";import{globalCss as r}from"./support/globalCss.js";import{MeasurementWidgetContent as l}from"./support/MeasurementWidgetContent.js";import{messageBundle as p,tsx as a}from"./support/widget.js";const u="esri-distance-measurement-2d",m={base:u,newMeasurementButton:`${u}__clear-button`};let d=class extends o{constructor(e,t){super(e,t),this.messages=null,this.messagesCommon=null,this.viewModel=new n}get active(){return this.viewModel.active}get icon(){return"measure-line"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get unit(){return this.viewModel.unit}set unit(e){this.viewModel.unit=e}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(e){this.viewModel.unitOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}render(){const{messages:e,messagesCommon:s,unit:i,unitOptions:o,viewModel:n}=this,{active:p,measurementLabel:u,state:d,supported:v}=n;return a("div",{"aria-label":this.messages.widgetLabel,class:this.classes(m.base,r.widget,r.panel),key:this,role:"presentation"},this.visible?a(l,{active:p,measurementItems:[{key:"distance",title:e.distance,value:u}],messages:{...e,notApplicable:s.notApplicable},newMeasurementButtonClass:m.newMeasurementButton,state:d,supported:v,unit:i,unitOptions:o,onNewMeasurementClick:()=>{t(this.viewModel.start())},onUnitChange:e=>{this.unit=e}}):null)}};e([s({readOnly:!0})],d.prototype,"active",null),e([s()],d.prototype,"icon",null),e([s()],d.prototype,"label",null),e([s(),p("esri/widgets/DistanceMeasurement2D/t9n/DistanceMeasurement2D")],d.prototype,"messages",void 0),e([s(),p("esri/t9n/common")],d.prototype,"messagesCommon",void 0),e([s()],d.prototype,"snappingOptions",null),e([s()],d.prototype,"uiStrings",void 0),e([s()],d.prototype,"unit",null),e([s()],d.prototype,"unitOptions",null),e([s()],d.prototype,"view",null),e([s({type:n})],d.prototype,"viewModel",void 0),e([s({type:Boolean})],d.prototype,"visible",null),d=e([i("esri.widgets.DistanceMeasurement2D")],d);const v=d;export{v as default};
5
+ import{__decorate as e}from"tslib";import{ignoreAbortErrors as t}from"../core/promiseUtils.js";import{property as s,subclass as i}from"../core/accessorSupport/decorators.js";import n from"../views/interactive/snapping/SnappingOptions.js";import o from"./Widget.js";import r from"./DistanceMeasurement2D/DistanceMeasurement2DViewModel.js";import{globalCss as p}from"./support/globalCss.js";import{MeasurementWidgetContent as l}from"./support/MeasurementWidgetContent.js";import{messageBundle as a,tsx as u}from"./support/widget.js";const m="esri-distance-measurement-2d",d={base:m,newMeasurementButton:`${m}__clear-button`};let v=class extends o{constructor(e,t){super(e,t),this.messages=null,this.messagesCommon=null,this.viewModel=new r}get active(){return this.viewModel.active}get icon(){return"measure-line"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get unit(){return this.viewModel.unit}set unit(e){this.viewModel.unit=e}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(e){this.viewModel.unitOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}render(){const{messages:e,messagesCommon:s,unit:i,unitOptions:n,viewModel:o}=this,{active:r,measurementLabel:a,state:m,supported:v}=o;return u("div",{"aria-label":this.messages.widgetLabel,class:this.classes(d.base,p.widget,p.panel),key:this,role:"presentation"},this.visible?u(l,{active:r,measurementItems:[{key:"distance",title:e.distance,value:a}],messages:{...e,notApplicable:s.notApplicable},newMeasurementButtonClass:d.newMeasurementButton,state:m,supported:v,unit:i,unitOptions:n,onNewMeasurementClick:()=>{t(this.viewModel.start())},onUnitChange:e=>{this.unit=e}}):null)}};e([s({readOnly:!0})],v.prototype,"active",null),e([s()],v.prototype,"icon",null),e([s()],v.prototype,"label",null),e([s(),a("esri/widgets/DistanceMeasurement2D/t9n/DistanceMeasurement2D")],v.prototype,"messages",void 0),e([s(),a("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([s({type:n})],v.prototype,"snappingOptions",null),e([s()],v.prototype,"uiStrings",void 0),e([s()],v.prototype,"unit",null),e([s()],v.prototype,"unitOptions",null),e([s()],v.prototype,"view",null),e([s({type:r})],v.prototype,"viewModel",void 0),e([s({type:Boolean})],v.prototype,"visible",null),v=e([i("esri.widgets.DistanceMeasurement2D")],v);const c=v;export{c 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{isSome as t}from"../../core/arrayUtils.js";import{createTask as i}from"../../core/asyncUtils.js";import r from"../../core/Collection.js";import{deprecatedFunction as o}from"../../core/deprecate.js";import a from"../../core/Error.js";import{EventedAccessor as s}from"../../core/Evented.js";import{abortHandle as n,makeHandle as l}from"../../core/handleUtils.js";import"../../core/has.js";import d from"../../core/Logger.js";import{destroyMaybe as c,abortMaybe as p,removeMaybe as h}from"../../core/maybe.js";import{throwIfAborted as u,createResolver as w}from"../../core/promiseUtils.js";import{watch as f,on as m,when as y,syncAndInitial as g,initial as k,sync as v,whenOnce as _}from"../../core/reactiveUtils.js";import{property as W,subclass as M}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as b}from"../../core/support/UpdatingHandles.js";import{getTemplatesForLayers as F}from"../../editing/templateUtils.js";import{getGraphicLayer as T}from"../../graphic/graphicOriginUtils.js";import V from"../../layers/GraphicsLayer.js";import{isEditableLayer as I}from"../../layers/support/editableLayers.js";import{isFeatureLayer as E,isSubtypeGroupLayer as S,getOwningPortalUrl as A}from"../../layers/support/layerUtils.js";import{parseKnownArcGISOnlineDomain as L}from"../../portal/support/urlUtils.js";import U from"../../views/SelectionManager.js";import C from"../../views/interactive/sketch/SketchOptions.js";import{SnappingManager as O}from"../../views/interactive/snapping/SnappingManager.js";import j from"../../views/interactive/snapping/SnappingOptions.js";import{isISelectableLayer as R}from"../../views/support/selectionUtils.js";import P from"../Attachments/AttachmentsViewModel.js";import H from"./CreateFeaturesWorkflow.js";import q from"./UpdateWorkflow.js";import{getLayersFromWorkflow as x,isCreateFeaturesWorkflow as G,isUpdateRecordWorkflow as D,isUpdateFeaturesWorkflow as B,isMergeFeaturesWorkflow as N,isSplitFeatureWorkflow as Q,isUpdateWorkflow as z,isFeatureFormViewModel as Z,findEditorItemForLayerOrThrow as $,toFeatureInfos as J,fetchFullFeaturesByObjectId as K,fetchFullFeatures as X,findEditorItemForLayer as Y,whenEditorLayerView as ee}from"./workflowUtils.js";import te from"./support/EditorItem.js";import{assertViewNot3D as ie,MultipleSourceLayersError as re,InsufficientFeatureCountError as oe,MissingOriginLayerError as ae,assertMergeWorkflowCapabilities as se,FetchFullFeatureError as ne,assertSplitWorkflowCapabilities as le}from"./support/errors.js";import{makeTemplateGroupInfoForLayer as de}from"../FeatureTemplates/featureTemplatesUtils.js";import ce from"../FeatureTemplates/FeatureTemplatesViewModel.js";import pe from"../Sketch/SketchViewModel.js";import he from"../Spinner/SpinnerViewModel.js";import{goTo as ue}from"../support/goToUtils.js";import{isFeatureItem as we,isLayerItem as fe}from"../support/SelectionList/selectionListUtils.js";import me from"../support/SelectionList/SelectionListViewModel.js";import ye from"../support/SelectionToolbar/SelectionToolbarViewModel.js";function ge(e,t){return e?.find(e=>e.layer===t)}let ke=class extends s{constructor(e){super(e),this._queuedSelectionTool=null,this._sketchEventListenerHandle=null,this._sketchGraphicsLayer=new V({listMode:"hide",internal:!0,title:"Editor sketch layer"}),this._snappingManager=null,this._templatesByLayer=new Map,this._updateItemsTask=null,this._updateTemplatesTask=null,this._updatingHandles=new b,this._featureTemplatesViewModelIsRestricted=!1,this.activeWorkflow=null,this._activityQueue=new r,this.editorItems=new r,this.failures=[],this.hideTemplatesForInactiveLayers=!1,this.attachmentsViewModel=new P({capabilities:{editing:!0}}),this.featureTemplatesViewModel=new ce({disabledItemFunction:({layer:e})=>this._itemIsSuspended(e)}),this.layerInfos=null,this.ownSketchViewModel=new pe({layer:this._sketchGraphicsLayer}),this.selectionListViewModel=new me,this.selectionManager=new U,this.selectionToolbarViewModel=new ye({continuousSelectionEnabled:!0,defaultOperationType:"replace",persistSelection:!1,returnGeometry:!1}),this.sketchOptions=new C,this.snappingOptions=new j({attributeRulesEnabled:!0}),this.spinnerViewModel=new he,this.pageStack=[],this.showDiscardEditsPrompt=()=>Promise.resolve(!0),this._candidateCommitted=!1,this.back=async()=>{if("viewing-selection-list"===this.state)return this.selectionListViewModel.filterText=void 0,void this.effectiveSelectionManager.clear();this.canGoBack&&(this.activeWorkflow?.hasPreviousStep?await this.activeWorkflow.back(this.showDiscardEditsPrompt):await this._cancelWorkflow({force:!this.hasPendingEdits}))},this.saveWorkflow=async()=>await(this.activeWorkflow?.save()),this.selectFeature=(e,t=!1)=>{const i=this.activeWorkflow;if(this._candidateCommitted||"update"!==i?.type)return;const{rootFeatures:r}=i.data;r.removeAll(),e&&r.add(e),t&&(i.next(),this._candidateCommitted=!0)}}initialize(){this.addHandles([f(()=>{const e=this.view,t=e?.map?.editableLayers.toArray(),i=e?.allLayerViews,r=i?.filter(e=>!!t?.includes(e.layer));return[t,r,this.layerInfos]},()=>this._updateEditorItems(),g),f(()=>this.hideTemplatesForInactiveLayers,()=>this.syncFeatureTemplates()),f(()=>this._selectionSources,()=>this._syncSelectionSources(),k),m(()=>this.activeWorkflow,"cancel",()=>this.emit("workflow-cancel")),m(()=>this.activeWorkflow,"commit",()=>this.emit("workflow-commit")),m(()=>this.activeWorkflow,"complete",()=>{this.emit("workflow-commit"),this._set("activeWorkflow",null)}),y(()=>!this.activeWorkflow&&this._queuedSelectionTool,()=>this._queuedSelectionTool&&this.selectionToolbarViewModel.activateTool(this._queuedSelectionTool)),f(()=>this.activeWorkflow,e=>this.selectionManager.highlightEnabled=!e),y(()=>this.view?.map,e=>e.add(this._sketchGraphicsLayer),k),m(()=>this.editorItems,"change",()=>this._afterEditorItemsChange()),f(()=>[this.canCreate,this.canUpdateVisible],()=>this._afterEditorItemsChange()),f(()=>this.page,(e,t)=>{const i=[...this.pageStack];if(-1===i.indexOf(e))i.push(e);else for(;i.length&&i.at(-1)!==e;)i.pop();this.pageStack=i},g),y(()=>"awaiting-update-feature-candidate"===this.state,()=>this._candidateCommitted=!1),m(()=>this.featureTemplatesViewModel,"select",async({item:e,oldItem:t})=>{const{activeWorkflow:i}=this;if(i){if("update"===i.type&&"awaiting-feature-creation-info"===i.activeWorkflow?.stepId)return;try{await this.cancelWorkflow({force:!this.hasPendingEdits})}catch{return void this.featureTemplatesViewModel.select(t,{emit:!1})}}if(!e)return;const r={layer:e.layer,template:e.template};if(e.supportsUpload)return this.featureTemplatesViewModel.select(t,{emit:!1}),this.startCreateFeaturesWorkflow(r);await this.startCreateFeaturesWorkflowAtFeatureCreation(r)}),f(()=>[this.view,this.featureTemplatesViewModel],([e,t])=>{t.view=e},g),m(()=>this.view,"key-down",e=>{"Escape"===e.key&&this.activeWorkflow?.keyboardCancellationEnabled&&(e.stopPropagation(),this.back())}),m(()=>this.sketchViewModel,["create","delete","update"],e=>{const{activeWorkflow:t}=this,i=x(t),r=`sketch-${e.type}`;this.emit(r,{type:r,detail:e,layer:i[0],layers:i})},v),f(()=>this.view,e=>{if(this._snappingManager=c(this._snappingManager),!e)return;const t=this.snappingOptions;this._snappingManager=new O({view:e,options:t}),this.ownSketchViewModel.snappingManager=this._snappingManager},g),f(()=>this.snappingOptions,e=>{this._snappingManager&&(this._snappingManager.options=e)},g),m(()=>this.selectionToolbarViewModel,"complete",e=>this._onSelectionComplete(e)),f(()=>({view:this.view,selectionManager:this.effectiveSelectionManager,selectionListViewModel:this.selectionListViewModel,selectionToolbarViewModel:this.selectionToolbarViewModel}),({view:e,selectionManager:t,selectionListViewModel:i,selectionToolbarViewModel:r})=>{t.view=e,i.view=e,r.view=e},g),f(()=>this.effectiveSelectionManager,e=>{this.selectionListViewModel.selectionManager=e,this.selectionToolbarViewModel.selectionManager=e},g)])}destroy(){this._cancelWorkflow({warnIfNoWorkflow:!1}).then(()=>{this.view?.map?.remove(this._sketchGraphicsLayer),this.view=null}),this._updateItemsTask=p(this._updateItemsTask),this._updatingHandles.destroy(),this._sketchEventListenerHandle=h(this._sketchEventListenerHandle),this.selectionListViewModel?.destroy(),this.selectionToolbarViewModel?.destroy(),this.selectionManager.destroy()}get _featureTemplatesLayersAndTables(){const e=new r;for(const t of this.editorItems){const i=this.hideTemplatesForInactiveLayers&&!t.visible;t.supportsCreateFeaturesWorkflow&&!i&&e.push(t.layer)}return e}get _selectionSources(){const e=new r;for(const t of this.editorItems)R(t.layer)&&t.supportsUpdateWorkflow&&t.visible&&e.push(t.layer);return e}get activeFeatureCount(){const e=this.activeLeafWorkflow;return G(e)?e.pendingFeatures.length:D(e)&&e.data.edits.feature?1:B(e)?e.data.fullFeatures.length:N(e)?e.data.features.length:Q(e)?2:0}get activeLeafWorkflow(){const e=this.activeWorkflow;return e&&z(e)?e.activeWorkflow??e:e}get canCreate(){return this.editorItems.some(e=>e.supportsCreateFeaturesWorkflow)}get canCreateVisible(){return!!this.featureTemplatesLayers.length}get canUpdate(){return this.editorItems.some(e=>e.supportsUpdateWorkflow)}get canUpdateVisible(){return this.editorItems.some(e=>e.supportsUpdateWorkflow&&e.visible)}get featureTemplatesLayers(){return this._featureTemplatesLayersAndTables.filter(e=>"scene"===e.type||!e.isTable)}get effectiveSelectionManager(){return this.selectionManager}get featureFormViewModel(){const e=this.activeWorkflow?.formViewModel;return Z(e)?e:null}get formViewModel(){return this.activeWorkflow?.formViewModel}get utilityNetworkAssociationAddAssociationViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeUtilityNetworkAssociationAddAssociationViewModel:null}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get sketchViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeSketchViewModel:"create-features"===e?.type?e.sketchViewModel:this.ownSketchViewModel}get state(){if(!this.view?.ready)return"disabled";const e=this.attachmentsViewModel.mode;if("add"===e)return"adding-attachment";if("edit"===e)return"editing-attachment";const{activeWorkflow:t}=this,i=!t?.stepId;return this.effectiveSelectionManager.count&&i?"viewing-selection-list":i?"ready":"update"===t.type&&t.activeWorkflow?.stepId?t.activeWorkflow.stepId:t.stepId}get syncing(){return this._activityQueue.length>0}get updating(){return this._updatingHandles.updating||!0===this.activeWorkflow?.updating}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}set view(e){this.ownSketchViewModel.view=e,this.spinnerViewModel.view=e,this._set("view",e)}get canZoomTo(){const e=this.sketchViewModel,t=e?.createGraphic?.geometry?.type;return!(!e?.updateGraphics?.length&&"multipoint"!==t)}get page(){const{activeWorkflow:e,state:t}=this;if("update"===e?.type&&Z(e.formViewModel)){const{associatedLayer:t,associationId:i}=e.formViewModel;if(t||null!=i)return"viewing-associated-features"}if("update"===e?.type&&"awaiting-feature-to-update"===e.stepId)return"ready";if("create-features"===e?.type&&0===e.numPendingFeatures){const t=e.data.upload;if(t)return"default"===t.state?"ready":"creating-features-upload-details"}return t??"disabled"}get featureFormDisabled(){const{activeLeafWorkflow:e}=this;if(D(e))return!1===e.data.editorItem?.capabilities.update.attributes||!0===e.formViewModel.disabled;if(B(e)){const{formViewModel:t}=e;return t.disabled||t.readOnly}return!1}get featureFormHasAssociation(){return!!this.featureFormViewModel?.activeAssociation}get canGoBack(){return null!=this.activeWorkflow&&!this.syncing}get shouldShowDeleteButton(){const{activeLeafWorkflow:e}=this;if(D(e)){const{data:t}=e;return t.editorItem?.capabilities.delete.enabled&&!t.readOnly}return!!B(e)&&e.data.editorItems.every(e=>e.capabilities.delete.enabled)}get hasPendingEdits(){return this.activeWorkflow?.hasPendingEdits??!1}get snappingManager(){return this._snappingManager}getTemplatesForLayer(e){return this._templatesByLayer.get(e)??[]}async startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.startCreateFeaturesWorkflow()}async startCreateFeaturesWorkflowAtFeatureCreation(e){return this.startCreateFeaturesWorkflow(e,"creating-features")}async startCreateFeaturesWorkflow(e,t="awaiting-feature-creation-info"){if(await _(()=>!this.updating),!this.canCreate)throw new a("editing:unsupported-workflow","Creating features is unsupported or disabled.");const i=this._createUpdatingResolver();try{await this._cancelWorkflow();const i=this._createCreateFeaturesWorkflow(e,t);this._set("activeWorkflow",i),await i.start()}catch(r){this._logErrorAndCancelWorkflow(r)}finally{i.resolve()}}async startCreateFeaturesWorkflowAtFeatureEdit(e){await _(()=>!this.updating);const t=this._createUpdatingResolver();try{const{initialFeature:t}=e,i=t.sourceLayer=t.layer,r=i?$(this.editorItems,i):void 0;if(!r?.supportsCreateFeaturesWorkflow)throw new a("editing:unsupported-workflow","Creating features is unsupported or disabled for this layer.");await this._cancelWorkflow();const o=this._createCreateFeaturesWorkflow({initialFeature:t,layer:r.layer,maxFeatures:1},"creating-features");this._set("activeWorkflow",o),await o.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startMergeFeaturesWorkflow(e,t={}){await _(()=>!this.updating),ie(this,"merge-features");const i=Array.isArray(e)?J(e):[e];if(i.length>1)throw new re;if(0===i.length||i[0].objectIds.length<2)throw new oe(2);const o=i[0],a=o.layer;if(!a)throw new ae;const s=$(this.editorItems,a);se(s);const l=this._createUpdatingResolver(),d=new AbortController;this.addHandles(n(d));try{await this._cancelWorkflow(),this.selectionToolbarViewModel.cancel();const e=await K(o.objectIds,a,this.view?.spatialReference,d.signal);if(e.length!==o.objectIds.length)throw new ne;let i;if(t.keyFeature){const r=t.keyFeature.getObjectId();i=e.find(e=>e.getObjectId()===r)??t.keyFeature}const s=this._createUpdateWorkflow("editing-existing-feature",{rootFeatures:new r(e),rootWorkflowOptions:{type:"merge",props:{...t,keyFeature:i}}});this._set("activeWorkflow",s),this.addHandles(this._destroyWorkflowOnCommit(s)),await s.start()}catch(c){this._logErrorAndCancelWorkflow(c)}finally{l.resolve()}}async startSplitFeatureWorkflow(e,t={}){await _(()=>!this.updating),ie(this,"split-feature");const i=T(e);if(!i)throw new ae;const o=$(this.editorItems,i);le(o);const a=this._createUpdatingResolver(),s=new AbortController;this.addHandles(n(s));try{await this._cancelWorkflow();const o=await X([e],i,this.view?.spatialReference,s.signal);if(1!==o.length)throw new ne;const a=this._createUpdateWorkflow("editing-existing-feature",{rootFeatures:new r(o),rootWorkflowOptions:{type:"split",props:t}});this._set("activeWorkflow",a),this.addHandles(this._destroyWorkflowOnCommit(a)),await a.start()}catch(l){this._logErrorAndCancelWorkflow(l)}finally{a.resolve()}}async startUpdateFeaturesWorkflow(e){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update features workflow is unsupported or disabled.");const t=Array.isArray(e)?J(e):[e];if(t.length>1)throw new re;const i=this._createUpdatingResolver();try{await this._cancelWorkflow();const e=this._createUpdateWorkflow("editing-existing-feature",{rootFeatureInfos:t,rootWorkflowOptions:{type:"update-multiple"}});e.addHandles(this._destroyWorkflowOnCommit(e)),this._set("activeWorkflow",e),await e.start()}catch(r){this._logErrorAndCancelWorkflow(r)}finally{i.resolve()}}async startUpdateWorkflowAtFeatureSelection(){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const e=this._createUpdatingResolver();try{await this._cancelWorkflow();const e=this._createUpdateWorkflow();this._set("activeWorkflow",e),await e.start()}catch(t){this._logErrorAndCancelWorkflow(t)}finally{e.resolve()}}async startUpdateWorkflowAtMultipleFeatureSelection(e){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateWorkflow("awaiting-update-feature-candidate");t.data.candidates=e,this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowAtFeatureEdit(e){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow(),this.selectionToolbarViewModel.cancel();const t=this._createUpdateWorkflow("editing-existing-feature",{rootFeatures:new r([e])});t.addHandles(this._destroyWorkflowOnCommit(t)),this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowWithActiveSelection(){const{selectionListViewModel:e}=this;if(!e.visibleFeatureCount||!e.visibleLayerCount)throw new a("editing:missing-selection","Unable to determine visible selection.");if(e.visibleLayerCount>1)throw new a("editing:features-different-layers","Cannot start workflow with features from different layers.");const t=e.layerItems.find(e=>e.visible);t&&await this._startUpdateWorkflowWithLayerItem(t,"update")}async deleteFeatureFromWorkflow(){o(d.getLogger(this),"EditorViewModel.deleteFeatureFromWorkflow is deprecated. Use EditorViewModel.deleteFeatures instead.",{version:"4.33",replacement:"EditorViewModel.deleteFeatures",warnOnce:!0}),await this.deleteFeatures()}async deleteFeatures(){const e=this.activeWorkflow;if(z(e))return e.deleteActiveFeatures();this._logError("editing:unsupported-workflow","Deleting features requires an active update workflow.")}async deleteAssociationFromWorkflow(){const{activeWorkflow:e}=this;e&&"update"===e.type?await e.deleteActiveAssociation():this._logError("editing:unsupported-workflow","Deleting an association requires an active update workflow.")}async cancelWorkflow(e){return this._cancelWorkflow({warnIfNoWorkflow:!0,...e})}itemHasInvalidFormTemplate(e){return null!=e&&!0===Y(this.editorItems,e.layer)?.hasInvalidFormTemplate}syncFeatureTemplates(){this._featureTemplatesViewModelIsRestricted||this._updateTemplates()}zoomTo(e){const{view:i,sketchViewModel:r}=this;if(!i)return;const o=void 0,a=e??r?.createGraphic;if(a)"mesh"===a.geometry?.type?ue(i,a.geometry,o):ue(i,a,o);else{const e=r?.updateGraphics?.toArray();"3d"===i.type&&e?.some(e=>"mesh"===e.geometry?.type)?ue(i,e.map(e=>e.geometry).filter(t),o):e&&ue(i,e,o)}}async toggleUpdateWorkflow(){this.canUpdate&&(this.hasPendingEdits&&!await this.showDiscardEditsPrompt()||(this.activeWorkflow&&"awaiting-feature-to-update"===this.state?await this.cancelWorkflow({force:!0}):await this.startUpdateWorkflowAtFeatureSelection()))}async onSelectionListItemSelect(e){we(e)&&await this.startUpdateWorkflowAtFeatureEdit(e.graphic)}async onSelectionListMenuItemSelect(e,t){we(e)?await this.startUpdateWorkflowAtFeatureEdit(e.graphic):fe(e)&&await this._startUpdateWorkflowWithLayerItem(e,t)}restrictFeatureTemplatesViewModelToLayer(e){return this._featureTemplatesViewModelIsRestricted=!0,this._setFeatureTemplatesViewModelLayers([e]),l(()=>{this._featureTemplatesViewModelIsRestricted=!1,this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)})}async _getEditorItemCandidates(e){const{view:t}=this;if(!t?.map)return[];const{map:i}=t,r=i.editableLayers.toArray(),o=i.allTables.toArray().filter(e=>E(e)||S(e));return await Promise.allSettled([...r.flatMap(e=>this._getLayerLoadPromise(e)),...o.flatMap(e=>this._getLayerLoadPromise(e))]),u(e),[...r.reverse(),...o.reverse()].filter(e=>I(e)&&("mesh"!==e.geometryType||"3d"===t.type)).flatMap(e=>"subtype-group"===e.type?e.sublayers.toArray():e)}_getLayerLoadPromise(e){return S(e)?e.loadAll():e.load()}_drainEditorItems(){this.editorItems.drain(e=>e.destroy())}_updateEditorItems(){p(this._updateItemsTask);const{view:e}=this,t=i(async t=>{if(!e?.map||!e?.allLayerViews)return;const i=await this._getEditorItemCandidates(t);if(!i.length)return void this._drainEditorItems();const r=[],o=[],a=[],{layerInfos:s}=this;for(const l of i){const t=ge(s,l),i=await ee(e,l).catch(()=>null);(t?r:i?o:a).push(new te({layer:l,layerInfo:t,layerView:i}))}s?.length&&r.sort((e,t)=>s.findIndex(({layer:t})=>t===e.layer)-s.findIndex(({layer:e})=>e===t.layer));const n=[...r,...o,...a];t.aborted||(this._drainEditorItems(),this.editorItems.addMany(n))});this._updatingHandles.addPromise(t.promise),this._updateItemsTask=t}_updateTemplates(){p(this._updateTemplatesTask);const e=i(async e=>{const t=this._templatesByLayer,i=this._featureTemplatesLayersAndTables.filter(e=>!t.has(e));if(i.length>0){const r=await F({layers:i.toArray(),view:this.view,signal:e,queryOptions:{returnVisibleTemplatesOnly:!0}});for(const{layer:e,templates:i}of r)t.set(e,i)}this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)});this._updatingHandles.addPromise(e.promise),this._updateTemplatesTask=e}_setFeatureTemplatesViewModelLayers(e){const t=this._templatesByLayer,i=[];for(const r of e){const e=t.get(r);e&&e.length>0&&i.push(de(r,e))}this.featureTemplatesViewModel.templateInfos=i}_afterEditorItemsChange(){const{activeWorkflow:e}=this;if(this.syncFeatureTemplates(),!e)return;const{stepId:t}=e;"create-features"!==e.type?"update"===e.type&&("awaiting-feature-to-update"===t&&!this.canUpdateVisible||"awaiting-update-feature-candidate"===t&&!e.hasUpdatableCandidates)&&this._cancelWorkflow():"awaiting-feature-creation-info"!==t||this.canCreate||this._cancelWorkflow()}async _cancelWorkflow(e){const t=this.activeWorkflow;if(!t)return void(e?.warnIfNoWorkflow&&this._logError("editing:no-active-workflow","There is no active workflow to cancel."));if(!e||!1!==e.force){this.emit("workflow-cancel"),this._set("activeWorkflow",null);try{await t.cancel(e)}finally{t.destroy()}}else try{await t.cancel(e),this._set("activeWorkflow",null),t.destroy()}catch(i){}}_createCreateFeaturesWorkflow(e,t){return H.create({viewModel:this,creationInfo:e,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:t,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)})}_createUpdateWorkflow(e,t){const i=q.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:e,...t,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)});return i}_addAttachments(e,t){const i=t.map(t=>this._addAttachment(e,t.feature,t.attachment))??[];return Promise.all(i)}async _addAttachment(e,t,i){let r=null;if(!("addAttachment"in e)||null==e.capabilities?.attachment)throw new a("editor:attachments-not-supported","Adding attachments is not supported for this layer type");return await this._queueOperation(async()=>(r=await(e.addAttachment?.(t,i).catch(e=>{throw e?.error||e}))??null,r)),r}async _applyEdits(e,t,i){let r=null;const o=e.url?await A(e.url):null,a={returnServiceEditsOption:(!o||!L(o))&&!/\/hosted\//i.test(e.url)?"original-and-current-features":void 0,...i};return await this._queueOperation(async()=>{const{view:i}=this;if(!i)return null;const o=await ee(i,e).catch(()=>null);return r=await e.applyEdits(t,a),o&&await _(()=>!o.updating),r}),r}async _applyEditsFeatureService(e,t,i){let r=null;return await this._queueOperation(async()=>r=await e.applyEdits(t,i)),r}_destroyWorkflowOnCommit(e){return m(()=>e,"commit",()=>{e.destroy(),this.activeWorkflow===e&&this._set("activeWorkflow",null)})}_queueOperation(e){this._activityQueue.push(e);const t=(e,t)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)};return e().then(e=>(Array.isArray(e)?e.forEach(e=>this._handleEditsResultError(e)):this._handleEditsResultError(e),e)).catch(i=>{this._logError("editing:operation-error","An error occurred.",{error:i});const r={error:i,retry:()=>(t(r,this.failures),this._queueOperation(e)),cancel:()=>{t(r,this.failures)}};this._set("failures",[...this.failures,r])}).then(()=>{t(e,this._activityQueue)})}_handleEditsResultError(e){if(null!=e&&"error"in e&&null!=e.error)throw e.error;if(null!=e&&"addFeatureResults"in e){const{addFeatureResults:t,deleteFeatureResults:i,updateFeatureResults:r}=e,o=t.find(e=>!!e.error)||r.find(e=>!!e.error)||i.find(e=>!!e.error);if(o)throw o.error}}_createUpdatingResolver(){const e=w();return this._updatingHandles.addPromise(e.promise),e}_logErrorAndCancelWorkflow(e){const{name:t,message:i,details:r}=e;this._logError(t??"editing:workflow-start-failed",i??void 0,r??e),this._cancelWorkflow({force:!0})}_itemIsSuspended(e){const t=$(this.editorItems,e);return null!=t&&(!t.visible||t.disabled)}_logError(e,t,i){d.getLogger(this).error(new a(e,t,i))}_syncSelectionSources(){this.selectionManager.sources.items=this._selectionSources.toArray()}async _onSelectionComplete(e){if(e.aborted)return;const{operationType:t,selection:i}=e,{effectiveSelectionManager:r}=this,o="ready"===this.state,a=1===i.length;if(this._queuedSelectionTool=void 0,o&&a&&"replace"===t)return this._queuedSelectionTool=e.toolName,this.startUpdateWorkflowAtFeatureEdit(i[0]);switch(t){case"remove":r.updateSelection({current:[],added:[],removed:i});break;case"replace":r.clear(),r.updateSelection({current:i,added:[],removed:[]});break;case"add":r.updateSelection({current:i,added:[],removed:[]})}}async _startUpdateWorkflowWithLayerItem(e,t){if(!e.objectIds?.length)return;const i=e.featureItems.filter(e=>e.visible).map(e=>e.graphic),r=this.selectionListViewModel.filterText;if(1===i.length)return await this.startUpdateWorkflowAtFeatureEdit(i[0]);let o;if(null!=r&&""!==r){const e=J(i);if(e.length>1)throw new re;if(o=e[0],!o)throw new oe("merge"===t?2:1)}else o={layer:e.layer,objectIds:e.objectIds};"update"===t?await this.startUpdateFeaturesWorkflow(o):"merge"===t&&await this.startMergeFeaturesWorkflow(o)}};e([W()],ke.prototype,"_featureTemplatesLayersAndTables",null),e([W()],ke.prototype,"_queuedSelectionTool",void 0),e([W()],ke.prototype,"_snappingManager",void 0),e([W()],ke.prototype,"_selectionSources",null),e([W()],ke.prototype,"activeFeatureCount",null),e([W({readOnly:!0})],ke.prototype,"activeWorkflow",void 0),e([W()],ke.prototype,"activeLeafWorkflow",null),e([W({readOnly:!0})],ke.prototype,"_activityQueue",void 0),e([W({readOnly:!0})],ke.prototype,"canCreate",null),e([W()],ke.prototype,"canCreateVisible",null),e([W({readOnly:!0})],ke.prototype,"canUpdate",null),e([W()],ke.prototype,"canUpdateVisible",null),e([W()],ke.prototype,"featureTemplatesLayers",null),e([W()],ke.prototype,"editorItems",void 0),e([W()],ke.prototype,"effectiveSelectionManager",null),e([W({readOnly:!0})],ke.prototype,"failures",void 0),e([W()],ke.prototype,"hideTemplatesForInactiveLayers",void 0),e([W({type:P})],ke.prototype,"attachmentsViewModel",void 0),e([W()],ke.prototype,"featureFormViewModel",null),e([W()],ke.prototype,"formViewModel",null),e([W()],ke.prototype,"utilityNetworkAssociationAddAssociationViewModel",null),e([W({type:ce})],ke.prototype,"featureTemplatesViewModel",void 0),e([W()],ke.prototype,"labelOptions",null),e([W()],ke.prototype,"layerInfos",void 0),e([W()],ke.prototype,"ownSketchViewModel",void 0),e([W()],ke.prototype,"selectionListViewModel",void 0),e([W()],ke.prototype,"selectionManager",void 0),e([W()],ke.prototype,"selectionToolbarViewModel",void 0),e([W()],ke.prototype,"sketchOptions",void 0),e([W()],ke.prototype,"sketchViewModel",null),e([W({type:j,nonNullable:!0})],ke.prototype,"snappingOptions",void 0),e([W()],ke.prototype,"spinnerViewModel",void 0),e([W()],ke.prototype,"state",null),e([W({readOnly:!0})],ke.prototype,"syncing",null),e([W()],ke.prototype,"updating",null),e([W()],ke.prototype,"tooltipOptions",null),e([W()],ke.prototype,"valueOptions",null),e([W()],ke.prototype,"view",null),e([W()],ke.prototype,"canZoomTo",null),e([W()],ke.prototype,"pageStack",void 0),e([W()],ke.prototype,"showDiscardEditsPrompt",void 0),e([W()],ke.prototype,"_candidateCommitted",void 0),e([W()],ke.prototype,"page",null),e([W()],ke.prototype,"featureFormDisabled",null),e([W()],ke.prototype,"featureFormHasAssociation",null),e([W()],ke.prototype,"canGoBack",null),e([W()],ke.prototype,"shouldShowDeleteButton",null),e([W()],ke.prototype,"hasPendingEdits",null),e([W()],ke.prototype,"snappingManager",null),ke=e([M("esri.widgets.Editor.EditorViewModel")],ke);const ve=ke;export{ve as default};
5
+ import{__decorate as e}from"tslib";import{isSome as t}from"../../core/arrayUtils.js";import{createTask as i}from"../../core/asyncUtils.js";import r from"../../core/Collection.js";import{deprecatedFunction as o}from"../../core/deprecate.js";import a from"../../core/Error.js";import{EventedAccessor as s}from"../../core/Evented.js";import{abortHandle as n,makeHandle as l}from"../../core/handleUtils.js";import"../../core/has.js";import c from"../../core/Logger.js";import{destroyMaybe as d,abortMaybe as p,removeMaybe as h}from"../../core/maybe.js";import{throwIfAborted as u,createResolver as w}from"../../core/promiseUtils.js";import{watch as f,on as m,when as y,syncAndInitial as g,initial as k,sync as v,whenOnce as _}from"../../core/reactiveUtils.js";import{property as W,subclass as M}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as b}from"../../core/support/UpdatingHandles.js";import{getTemplatesForLayers as F}from"../../editing/templateUtils.js";import{getGraphicLayer as T}from"../../graphic/graphicOriginUtils.js";import V from"../../layers/GraphicsLayer.js";import{isEditableLayer as I}from"../../layers/support/editableLayers.js";import{isFeatureLayer as E,isSubtypeGroupLayer as S,getOwningPortalUrl as A}from"../../layers/support/layerUtils.js";import{parseKnownArcGISOnlineDomain as L}from"../../portal/support/urlUtils.js";import U from"../../views/SelectionManager.js";import C from"../../views/interactive/sketch/SketchLabelOptions.js";import O from"../../views/interactive/sketch/SketchOptions.js";import j from"../../views/interactive/sketch/SketchTooltipOptions.js";import R from"../../views/interactive/sketch/SketchValueOptions.js";import{SnappingManager as P}from"../../views/interactive/snapping/SnappingManager.js";import H from"../../views/interactive/snapping/SnappingOptions.js";import{isISelectableLayer as q}from"../../views/support/selectionUtils.js";import x from"../Attachments/AttachmentsViewModel.js";import G from"./CreateFeaturesWorkflow.js";import D from"./UpdateWorkflow.js";import{getLayersFromWorkflow as B,isCreateFeaturesWorkflow as N,isUpdateRecordWorkflow as Q,isUpdateFeaturesWorkflow as z,isMergeFeaturesWorkflow as Z,isSplitFeatureWorkflow as $,isUpdateWorkflow as J,isFeatureFormViewModel as K,findEditorItemForLayerOrThrow as X,toFeatureInfos as Y,fetchFullFeaturesByObjectId as ee,fetchFullFeatures as te,findEditorItemForLayer as ie,whenEditorLayerView as re}from"./workflowUtils.js";import oe from"./support/EditorItem.js";import{assertViewNot3D as ae,MultipleSourceLayersError as se,InsufficientFeatureCountError as ne,MissingOriginLayerError as le,assertMergeWorkflowCapabilities as ce,FetchFullFeatureError as de,assertSplitWorkflowCapabilities as pe}from"./support/errors.js";import{makeTemplateGroupInfoForLayer as he}from"../FeatureTemplates/featureTemplatesUtils.js";import ue from"../FeatureTemplates/FeatureTemplatesViewModel.js";import we from"../Sketch/SketchViewModel.js";import fe from"../Spinner/SpinnerViewModel.js";import{goTo as me}from"../support/goToUtils.js";import{isFeatureItem as ye,isLayerItem as ge}from"../support/SelectionList/selectionListUtils.js";import ke from"../support/SelectionList/SelectionListViewModel.js";import ve from"../support/SelectionToolbar/SelectionToolbarViewModel.js";function _e(e,t){return e?.find(e=>e.layer===t)}let We=class extends s{constructor(e){super(e),this._queuedSelectionTool=null,this._sketchEventListenerHandle=null,this._sketchGraphicsLayer=new V({listMode:"hide",internal:!0,title:"Editor sketch layer"}),this._snappingManager=null,this._templatesByLayer=new Map,this._updateItemsTask=null,this._updateTemplatesTask=null,this._updatingHandles=new b,this._featureTemplatesViewModelIsRestricted=!1,this.activeWorkflow=null,this._activityQueue=new r,this.editorItems=new r,this.failures=[],this.hideTemplatesForInactiveLayers=!1,this.attachmentsViewModel=new x({capabilities:{editing:!0}}),this.featureTemplatesViewModel=new ue({disabledItemFunction:({layer:e})=>this._itemIsSuspended(e)}),this.layerInfos=null,this.ownSketchViewModel=new we({layer:this._sketchGraphicsLayer}),this.selectionListViewModel=new ke,this.selectionManager=new U,this.selectionToolbarViewModel=new ve({continuousSelectionEnabled:!0,defaultOperationType:"replace",persistSelection:!1,returnGeometry:!1}),this.sketchOptions=new O,this.snappingOptions=new H({attributeRulesEnabled:!0}),this.spinnerViewModel=new fe,this.pageStack=[],this.showDiscardEditsPrompt=()=>Promise.resolve(!0),this._candidateCommitted=!1,this.back=async()=>{if("viewing-selection-list"===this.state)return this.selectionListViewModel.filterText=void 0,void this.effectiveSelectionManager.clear();this.canGoBack&&(this.activeWorkflow?.hasPreviousStep?await this.activeWorkflow.back(this.showDiscardEditsPrompt):await this._cancelWorkflow({force:!this.hasPendingEdits}))},this.saveWorkflow=async()=>await(this.activeWorkflow?.save()),this.selectFeature=(e,t=!1)=>{const i=this.activeWorkflow;if(this._candidateCommitted||"update"!==i?.type)return;const{rootFeatures:r}=i.data;r.removeAll(),e&&r.add(e),t&&(i.next(),this._candidateCommitted=!0)}}initialize(){this.addHandles([f(()=>{const e=this.view,t=e?.map?.editableLayers.toArray(),i=e?.allLayerViews,r=i?.filter(e=>!!t?.includes(e.layer));return[t,r,this.layerInfos]},()=>this._updateEditorItems(),g),f(()=>this.hideTemplatesForInactiveLayers,()=>this.syncFeatureTemplates()),f(()=>this._selectionSources,()=>this._syncSelectionSources(),k),m(()=>this.activeWorkflow,"cancel",()=>this.emit("workflow-cancel")),m(()=>this.activeWorkflow,"commit",()=>this.emit("workflow-commit")),m(()=>this.activeWorkflow,"complete",()=>{this.emit("workflow-commit"),this._set("activeWorkflow",null)}),y(()=>!this.activeWorkflow&&this._queuedSelectionTool,()=>this._queuedSelectionTool&&this.selectionToolbarViewModel.activateTool(this._queuedSelectionTool)),f(()=>this.activeWorkflow,e=>this.selectionManager.highlightEnabled=!e),y(()=>this.view?.map,e=>e.add(this._sketchGraphicsLayer),k),m(()=>this.editorItems,"change",()=>this._afterEditorItemsChange()),f(()=>[this.canCreate,this.canUpdateVisible],()=>this._afterEditorItemsChange()),f(()=>this.page,(e,t)=>{const i=[...this.pageStack];if(-1===i.indexOf(e))i.push(e);else for(;i.length&&i.at(-1)!==e;)i.pop();this.pageStack=i},g),y(()=>"awaiting-update-feature-candidate"===this.state,()=>this._candidateCommitted=!1),m(()=>this.featureTemplatesViewModel,"select",async({item:e,oldItem:t})=>{const{activeWorkflow:i}=this;if(i){if("update"===i.type&&"awaiting-feature-creation-info"===i.activeWorkflow?.stepId)return;try{await this.cancelWorkflow({force:!this.hasPendingEdits})}catch{return void this.featureTemplatesViewModel.select(t,{emit:!1})}}if(!e)return;const r={layer:e.layer,template:e.template};if(e.supportsUpload)return this.featureTemplatesViewModel.select(t,{emit:!1}),this.startCreateFeaturesWorkflow(r);await this.startCreateFeaturesWorkflowAtFeatureCreation(r)}),f(()=>[this.view,this.featureTemplatesViewModel],([e,t])=>{t.view=e},g),m(()=>this.view,"key-down",e=>{"Escape"===e.key&&this.activeWorkflow?.keyboardCancellationEnabled&&(e.stopPropagation(),this.back())}),m(()=>this.sketchViewModel,["create","delete","update"],e=>{const{activeWorkflow:t}=this,i=B(t),r=`sketch-${e.type}`;this.emit(r,{type:r,detail:e,layer:i[0],layers:i})},v),f(()=>this.view,e=>{if(this._snappingManager=d(this._snappingManager),!e)return;const t=this.snappingOptions;this._snappingManager=new P({view:e,options:t}),this.ownSketchViewModel.snappingManager=this._snappingManager},g),f(()=>this.snappingOptions,e=>{this._snappingManager&&(this._snappingManager.options=e)},g),m(()=>this.selectionToolbarViewModel,"complete",e=>this._onSelectionComplete(e)),f(()=>({view:this.view,selectionManager:this.effectiveSelectionManager,selectionListViewModel:this.selectionListViewModel,selectionToolbarViewModel:this.selectionToolbarViewModel}),({view:e,selectionManager:t,selectionListViewModel:i,selectionToolbarViewModel:r})=>{t.view=e,i.view=e,r.view=e},g),f(()=>this.effectiveSelectionManager,e=>{this.selectionListViewModel.selectionManager=e,this.selectionToolbarViewModel.selectionManager=e},g)])}destroy(){this._cancelWorkflow({warnIfNoWorkflow:!1}).then(()=>{this.view?.map?.remove(this._sketchGraphicsLayer),this.view=null}),this._updateItemsTask=p(this._updateItemsTask),this._updatingHandles.destroy(),this._sketchEventListenerHandle=h(this._sketchEventListenerHandle),this.selectionListViewModel?.destroy(),this.selectionToolbarViewModel?.destroy(),this.selectionManager.destroy()}get _featureTemplatesLayersAndTables(){const e=new r;for(const t of this.editorItems){const i=this.hideTemplatesForInactiveLayers&&!t.visible;t.supportsCreateFeaturesWorkflow&&!i&&e.push(t.layer)}return e}get _selectionSources(){const e=new r;for(const t of this.editorItems)q(t.layer)&&t.supportsUpdateWorkflow&&t.visible&&e.push(t.layer);return e}get activeFeatureCount(){const e=this.activeLeafWorkflow;return N(e)?e.pendingFeatures.length:Q(e)&&e.data.edits.feature?1:z(e)?e.data.fullFeatures.length:Z(e)?e.data.features.length:$(e)?2:0}get activeLeafWorkflow(){const e=this.activeWorkflow;return e&&J(e)?e.activeWorkflow??e:e}get canCreate(){return this.editorItems.some(e=>e.supportsCreateFeaturesWorkflow)}get canCreateVisible(){return!!this.featureTemplatesLayers.length}get canUpdate(){return this.editorItems.some(e=>e.supportsUpdateWorkflow)}get canUpdateVisible(){return this.editorItems.some(e=>e.supportsUpdateWorkflow&&e.visible)}get featureTemplatesLayers(){return this._featureTemplatesLayersAndTables.filter(e=>"scene"===e.type||!e.isTable)}get effectiveSelectionManager(){return this.selectionManager}get featureFormViewModel(){const e=this.activeWorkflow?.formViewModel;return K(e)?e:null}get formViewModel(){return this.activeWorkflow?.formViewModel}get utilityNetworkAssociationAddAssociationViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeUtilityNetworkAssociationAddAssociationViewModel:null}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get sketchViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeSketchViewModel:"create-features"===e?.type?e.sketchViewModel:this.ownSketchViewModel}get state(){if(!this.view?.ready)return"disabled";const e=this.attachmentsViewModel.mode;if("add"===e)return"adding-attachment";if("edit"===e)return"editing-attachment";const{activeWorkflow:t}=this,i=!t?.stepId;return this.effectiveSelectionManager.count&&i?"viewing-selection-list":i?"ready":"update"===t.type&&t.activeWorkflow?.stepId?t.activeWorkflow.stepId:t.stepId}get syncing(){return this._activityQueue.length>0}get updating(){return this._updatingHandles.updating||!0===this.activeWorkflow?.updating}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}set view(e){this.ownSketchViewModel.view=e,this.spinnerViewModel.view=e,this._set("view",e)}get canZoomTo(){const e=this.sketchViewModel,t=e?.createGraphic?.geometry?.type;return!(!e?.updateGraphics?.length&&"multipoint"!==t)}get page(){const{activeWorkflow:e,state:t}=this;if("update"===e?.type&&K(e.formViewModel)){const{associatedLayer:t,associationId:i}=e.formViewModel;if(t||null!=i)return"viewing-associated-features"}if("update"===e?.type&&"awaiting-feature-to-update"===e.stepId)return"ready";if("create-features"===e?.type&&0===e.numPendingFeatures){const t=e.data.upload;if(t)return"default"===t.state?"ready":"creating-features-upload-details"}return t??"disabled"}get featureFormDisabled(){const{activeLeafWorkflow:e}=this;if(Q(e))return!1===e.data.editorItem?.capabilities.update.attributes||!0===e.formViewModel.disabled;if(z(e)){const{formViewModel:t}=e;return t.disabled||t.readOnly}return!1}get featureFormHasAssociation(){return!!this.featureFormViewModel?.activeAssociation}get canGoBack(){return null!=this.activeWorkflow&&!this.syncing}get shouldShowDeleteButton(){const{activeLeafWorkflow:e}=this;if(Q(e)){const{data:t}=e;return t.editorItem?.capabilities.delete.enabled&&!t.readOnly}return!!z(e)&&e.data.editorItems.every(e=>e.capabilities.delete.enabled)}get hasPendingEdits(){return this.activeWorkflow?.hasPendingEdits??!1}get snappingManager(){return this._snappingManager}getTemplatesForLayer(e){return this._templatesByLayer.get(e)??[]}async startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.startCreateFeaturesWorkflow()}async startCreateFeaturesWorkflowAtFeatureCreation(e){return this.startCreateFeaturesWorkflow(e,"creating-features")}async startCreateFeaturesWorkflow(e,t="awaiting-feature-creation-info"){if(await _(()=>!this.updating),!this.canCreate)throw new a("editing:unsupported-workflow","Creating features is unsupported or disabled.");const i=this._createUpdatingResolver();try{await this._cancelWorkflow();const i=this._createCreateFeaturesWorkflow(e,t);this._set("activeWorkflow",i),await i.start()}catch(r){this._logErrorAndCancelWorkflow(r)}finally{i.resolve()}}async startCreateFeaturesWorkflowAtFeatureEdit(e){await _(()=>!this.updating);const t=this._createUpdatingResolver();try{const{initialFeature:t}=e,i=t.sourceLayer=t.layer,r=i?X(this.editorItems,i):void 0;if(!r?.supportsCreateFeaturesWorkflow)throw new a("editing:unsupported-workflow","Creating features is unsupported or disabled for this layer.");await this._cancelWorkflow();const o=this._createCreateFeaturesWorkflow({initialFeature:t,layer:r.layer,maxFeatures:1},"creating-features");this._set("activeWorkflow",o),await o.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startMergeFeaturesWorkflow(e,t={}){await _(()=>!this.updating),ae(this,"merge-features");const i=Array.isArray(e)?Y(e):[e];if(i.length>1)throw new se;if(0===i.length||i[0].objectIds.length<2)throw new ne(2);const o=i[0],a=o.layer;if(!a)throw new le;const s=X(this.editorItems,a);ce(s);const l=this._createUpdatingResolver(),c=new AbortController;this.addHandles(n(c));try{await this._cancelWorkflow(),this.selectionToolbarViewModel.cancel();const e=await ee(o.objectIds,a,this.view?.spatialReference,c.signal);if(e.length!==o.objectIds.length)throw new de;let i;if(t.keyFeature){const r=t.keyFeature.getObjectId();i=e.find(e=>e.getObjectId()===r)??t.keyFeature}const s=this._createUpdateWorkflow("editing-existing-feature",{rootFeatures:new r(e),rootWorkflowOptions:{type:"merge",props:{...t,keyFeature:i}}});this._set("activeWorkflow",s),this.addHandles(this._destroyWorkflowOnCommit(s)),await s.start()}catch(d){this._logErrorAndCancelWorkflow(d)}finally{l.resolve()}}async startSplitFeatureWorkflow(e,t={}){await _(()=>!this.updating),ae(this,"split-feature");const i=T(e);if(!i)throw new le;const o=X(this.editorItems,i);pe(o);const a=this._createUpdatingResolver(),s=new AbortController;this.addHandles(n(s));try{await this._cancelWorkflow();const o=await te([e],i,this.view?.spatialReference,s.signal);if(1!==o.length)throw new de;const a=this._createUpdateWorkflow("editing-existing-feature",{rootFeatures:new r(o),rootWorkflowOptions:{type:"split",props:t}});this._set("activeWorkflow",a),this.addHandles(this._destroyWorkflowOnCommit(a)),await a.start()}catch(l){this._logErrorAndCancelWorkflow(l)}finally{a.resolve()}}async startUpdateFeaturesWorkflow(e){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update features workflow is unsupported or disabled.");const t=Array.isArray(e)?Y(e):[e];if(t.length>1)throw new se;const i=this._createUpdatingResolver();try{await this._cancelWorkflow();const e=this._createUpdateWorkflow("editing-existing-feature",{rootFeatureInfos:t,rootWorkflowOptions:{type:"update-multiple"}});e.addHandles(this._destroyWorkflowOnCommit(e)),this._set("activeWorkflow",e),await e.start()}catch(r){this._logErrorAndCancelWorkflow(r)}finally{i.resolve()}}async startUpdateWorkflowAtFeatureSelection(){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const e=this._createUpdatingResolver();try{await this._cancelWorkflow();const e=this._createUpdateWorkflow();this._set("activeWorkflow",e),await e.start()}catch(t){this._logErrorAndCancelWorkflow(t)}finally{e.resolve()}}async startUpdateWorkflowAtMultipleFeatureSelection(e){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateWorkflow("awaiting-update-feature-candidate");t.data.candidates=e,this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowAtFeatureEdit(e){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow(),this.selectionToolbarViewModel.cancel();const t=this._createUpdateWorkflow("editing-existing-feature",{rootFeatures:new r([e])});t.addHandles(this._destroyWorkflowOnCommit(t)),this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowWithActiveSelection(){const{selectionListViewModel:e}=this;if(!e.visibleFeatureCount||!e.visibleLayerCount)throw new a("editing:missing-selection","Unable to determine visible selection.");if(e.visibleLayerCount>1)throw new a("editing:features-different-layers","Cannot start workflow with features from different layers.");const t=e.layerItems.find(e=>e.visible);t&&await this._startUpdateWorkflowWithLayerItem(t,"update")}async deleteFeatureFromWorkflow(){o(c.getLogger(this),"EditorViewModel.deleteFeatureFromWorkflow is deprecated. Use EditorViewModel.deleteFeatures instead.",{version:"4.33",replacement:"EditorViewModel.deleteFeatures",warnOnce:!0}),await this.deleteFeatures()}async deleteFeatures(){const e=this.activeWorkflow;if(J(e))return e.deleteActiveFeatures();this._logError("editing:unsupported-workflow","Deleting features requires an active update workflow.")}async deleteAssociationFromWorkflow(){const{activeWorkflow:e}=this;e&&"update"===e.type?await e.deleteActiveAssociation():this._logError("editing:unsupported-workflow","Deleting an association requires an active update workflow.")}async cancelWorkflow(e){return this._cancelWorkflow({warnIfNoWorkflow:!0,...e})}itemHasInvalidFormTemplate(e){return null!=e&&!0===ie(this.editorItems,e.layer)?.hasInvalidFormTemplate}syncFeatureTemplates(){this._featureTemplatesViewModelIsRestricted||this._updateTemplates()}zoomTo(e){const{view:i,sketchViewModel:r}=this;if(!i)return;const o=void 0,a=e??r?.createGraphic;if(a)"mesh"===a.geometry?.type?me(i,a.geometry,o):me(i,a,o);else{const e=r?.updateGraphics?.toArray();"3d"===i.type&&e?.some(e=>"mesh"===e.geometry?.type)?me(i,e.map(e=>e.geometry).filter(t),o):e&&me(i,e,o)}}async toggleUpdateWorkflow(){this.canUpdate&&(this.hasPendingEdits&&!await this.showDiscardEditsPrompt()||(this.activeWorkflow&&"awaiting-feature-to-update"===this.state?await this.cancelWorkflow({force:!0}):await this.startUpdateWorkflowAtFeatureSelection()))}async onSelectionListItemSelect(e){ye(e)&&await this.startUpdateWorkflowAtFeatureEdit(e.graphic)}async onSelectionListMenuItemSelect(e,t){ye(e)?await this.startUpdateWorkflowAtFeatureEdit(e.graphic):ge(e)&&await this._startUpdateWorkflowWithLayerItem(e,t)}restrictFeatureTemplatesViewModelToLayer(e){return this._featureTemplatesViewModelIsRestricted=!0,this._setFeatureTemplatesViewModelLayers([e]),l(()=>{this._featureTemplatesViewModelIsRestricted=!1,this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)})}async _getEditorItemCandidates(e){const{view:t}=this;if(!t?.map)return[];const{map:i}=t,r=i.editableLayers.toArray(),o=i.allTables.toArray().filter(e=>E(e)||S(e));return await Promise.allSettled([...r.flatMap(e=>this._getLayerLoadPromise(e)),...o.flatMap(e=>this._getLayerLoadPromise(e))]),u(e),[...r.reverse(),...o.reverse()].filter(e=>I(e)&&("mesh"!==e.geometryType||"3d"===t.type)).flatMap(e=>"subtype-group"===e.type?e.sublayers.toArray():e)}_getLayerLoadPromise(e){return S(e)?e.loadAll():e.load()}_drainEditorItems(){this.editorItems.drain(e=>e.destroy())}_updateEditorItems(){p(this._updateItemsTask);const{view:e}=this,t=i(async t=>{if(!e?.map||!e?.allLayerViews)return;const i=await this._getEditorItemCandidates(t);if(!i.length)return void this._drainEditorItems();const r=[],o=[],a=[],{layerInfos:s}=this;for(const l of i){const t=_e(s,l),i=await re(e,l).catch(()=>null);(t?r:i?o:a).push(new oe({layer:l,layerInfo:t,layerView:i}))}s?.length&&r.sort((e,t)=>s.findIndex(({layer:t})=>t===e.layer)-s.findIndex(({layer:e})=>e===t.layer));const n=[...r,...o,...a];t.aborted||(this._drainEditorItems(),this.editorItems.addMany(n))});this._updatingHandles.addPromise(t.promise),this._updateItemsTask=t}_updateTemplates(){p(this._updateTemplatesTask);const e=i(async e=>{const t=this._templatesByLayer,i=this._featureTemplatesLayersAndTables.filter(e=>!t.has(e));if(i.length>0){const r=await F({layers:i.toArray(),view:this.view,signal:e,queryOptions:{returnVisibleTemplatesOnly:!0}});for(const{layer:e,templates:i}of r)t.set(e,i)}this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)});this._updatingHandles.addPromise(e.promise),this._updateTemplatesTask=e}_setFeatureTemplatesViewModelLayers(e){const t=this._templatesByLayer,i=[];for(const r of e){const e=t.get(r);e&&e.length>0&&i.push(he(r,e))}this.featureTemplatesViewModel.templateInfos=i}_afterEditorItemsChange(){const{activeWorkflow:e}=this;if(this.syncFeatureTemplates(),!e)return;const{stepId:t}=e;"create-features"!==e.type?"update"===e.type&&("awaiting-feature-to-update"===t&&!this.canUpdateVisible||"awaiting-update-feature-candidate"===t&&!e.hasUpdatableCandidates)&&this._cancelWorkflow():"awaiting-feature-creation-info"!==t||this.canCreate||this._cancelWorkflow()}async _cancelWorkflow(e){const t=this.activeWorkflow;if(!t)return void(e?.warnIfNoWorkflow&&this._logError("editing:no-active-workflow","There is no active workflow to cancel."));if(!e||!1!==e.force){this.emit("workflow-cancel"),this._set("activeWorkflow",null);try{await t.cancel(e)}finally{t.destroy()}}else try{await t.cancel(e),this._set("activeWorkflow",null),t.destroy()}catch(i){}}_createCreateFeaturesWorkflow(e,t){return G.create({viewModel:this,creationInfo:e,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:t,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)})}_createUpdateWorkflow(e,t){const i=D.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:e,...t,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)});return i}_addAttachments(e,t){const i=t.map(t=>this._addAttachment(e,t.feature,t.attachment))??[];return Promise.all(i)}async _addAttachment(e,t,i){let r=null;if(!("addAttachment"in e)||null==e.capabilities?.attachment)throw new a("editor:attachments-not-supported","Adding attachments is not supported for this layer type");return await this._queueOperation(async()=>(r=await(e.addAttachment?.(t,i).catch(e=>{throw e?.error||e}))??null,r)),r}async _applyEdits(e,t,i){let r=null;const o=e.url?await A(e.url):null,a={returnServiceEditsOption:(!o||!L(o))&&!/\/hosted\//i.test(e.url)?"original-and-current-features":void 0,...i};return await this._queueOperation(async()=>{const{view:i}=this;if(!i)return null;const o=await re(i,e).catch(()=>null);return r=await e.applyEdits(t,a),o&&await _(()=>!o.updating),r}),r}async _applyEditsFeatureService(e,t,i){let r=null;return await this._queueOperation(async()=>r=await e.applyEdits(t,i)),r}_destroyWorkflowOnCommit(e){return m(()=>e,"commit",()=>{e.destroy(),this.activeWorkflow===e&&this._set("activeWorkflow",null)})}_queueOperation(e){this._activityQueue.push(e);const t=(e,t)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)};return e().then(e=>(Array.isArray(e)?e.forEach(e=>this._handleEditsResultError(e)):this._handleEditsResultError(e),e)).catch(i=>{this._logError("editing:operation-error","An error occurred.",{error:i});const r={error:i,retry:()=>(t(r,this.failures),this._queueOperation(e)),cancel:()=>{t(r,this.failures)}};this._set("failures",[...this.failures,r])}).then(()=>{t(e,this._activityQueue)})}_handleEditsResultError(e){if(null!=e&&"error"in e&&null!=e.error)throw e.error;if(null!=e&&"addFeatureResults"in e){const{addFeatureResults:t,deleteFeatureResults:i,updateFeatureResults:r}=e,o=t.find(e=>!!e.error)||r.find(e=>!!e.error)||i.find(e=>!!e.error);if(o)throw o.error}}_createUpdatingResolver(){const e=w();return this._updatingHandles.addPromise(e.promise),e}_logErrorAndCancelWorkflow(e){const{name:t,message:i,details:r}=e;this._logError(t??"editing:workflow-start-failed",i??void 0,r??e),this._cancelWorkflow({force:!0})}_itemIsSuspended(e){const t=X(this.editorItems,e);return null!=t&&(!t.visible||t.disabled)}_logError(e,t,i){c.getLogger(this).error(new a(e,t,i))}_syncSelectionSources(){this.selectionManager.sources.items=this._selectionSources.toArray()}async _onSelectionComplete(e){if(e.aborted)return;const{operationType:t,selection:i}=e,{effectiveSelectionManager:r}=this,o="ready"===this.state,a=1===i.length;if(this._queuedSelectionTool=void 0,o&&a&&"replace"===t)return this._queuedSelectionTool=e.toolName,this.startUpdateWorkflowAtFeatureEdit(i[0]);switch(t){case"remove":r.updateSelection({current:[],added:[],removed:i});break;case"replace":r.clear(),r.updateSelection({current:i,added:[],removed:[]});break;case"add":r.updateSelection({current:i,added:[],removed:[]})}}async _startUpdateWorkflowWithLayerItem(e,t){if(!e.objectIds?.length)return;const i=e.featureItems.filter(e=>e.visible).map(e=>e.graphic),r=this.selectionListViewModel.filterText;if(1===i.length)return await this.startUpdateWorkflowAtFeatureEdit(i[0]);let o;if(null!=r&&""!==r){const e=Y(i);if(e.length>1)throw new se;if(o=e[0],!o)throw new ne("merge"===t?2:1)}else o={layer:e.layer,objectIds:e.objectIds};"update"===t?await this.startUpdateFeaturesWorkflow(o):"merge"===t&&await this.startMergeFeaturesWorkflow(o)}};e([W()],We.prototype,"_featureTemplatesLayersAndTables",null),e([W()],We.prototype,"_queuedSelectionTool",void 0),e([W()],We.prototype,"_snappingManager",void 0),e([W()],We.prototype,"_selectionSources",null),e([W()],We.prototype,"activeFeatureCount",null),e([W({readOnly:!0})],We.prototype,"activeWorkflow",void 0),e([W()],We.prototype,"activeLeafWorkflow",null),e([W({readOnly:!0})],We.prototype,"_activityQueue",void 0),e([W({readOnly:!0})],We.prototype,"canCreate",null),e([W()],We.prototype,"canCreateVisible",null),e([W({readOnly:!0})],We.prototype,"canUpdate",null),e([W()],We.prototype,"canUpdateVisible",null),e([W()],We.prototype,"featureTemplatesLayers",null),e([W()],We.prototype,"editorItems",void 0),e([W()],We.prototype,"effectiveSelectionManager",null),e([W({readOnly:!0})],We.prototype,"failures",void 0),e([W()],We.prototype,"hideTemplatesForInactiveLayers",void 0),e([W({type:x})],We.prototype,"attachmentsViewModel",void 0),e([W()],We.prototype,"featureFormViewModel",null),e([W()],We.prototype,"formViewModel",null),e([W()],We.prototype,"utilityNetworkAssociationAddAssociationViewModel",null),e([W({type:ue})],We.prototype,"featureTemplatesViewModel",void 0),e([W({type:C})],We.prototype,"labelOptions",null),e([W()],We.prototype,"layerInfos",void 0),e([W()],We.prototype,"ownSketchViewModel",void 0),e([W()],We.prototype,"selectionListViewModel",void 0),e([W()],We.prototype,"selectionManager",void 0),e([W()],We.prototype,"selectionToolbarViewModel",void 0),e([W()],We.prototype,"sketchOptions",void 0),e([W()],We.prototype,"sketchViewModel",null),e([W({type:H,nonNullable:!0})],We.prototype,"snappingOptions",void 0),e([W()],We.prototype,"spinnerViewModel",void 0),e([W()],We.prototype,"state",null),e([W({readOnly:!0})],We.prototype,"syncing",null),e([W()],We.prototype,"updating",null),e([W({type:j})],We.prototype,"tooltipOptions",null),e([W({type:R})],We.prototype,"valueOptions",null),e([W()],We.prototype,"view",null),e([W()],We.prototype,"canZoomTo",null),e([W()],We.prototype,"pageStack",void 0),e([W()],We.prototype,"showDiscardEditsPrompt",void 0),e([W()],We.prototype,"_candidateCommitted",void 0),e([W()],We.prototype,"page",null),e([W()],We.prototype,"featureFormDisabled",null),e([W()],We.prototype,"featureFormHasAssociation",null),e([W()],We.prototype,"canGoBack",null),e([W()],We.prototype,"shouldShowDeleteButton",null),e([W()],We.prototype,"hasPendingEdits",null),e([W()],We.prototype,"snappingManager",null),We=e([M("esri.widgets.Editor.EditorViewModel")],We);const Me=We;export{Me as default};