@arcgis/core 4.33.0-next.20250131 → 4.33.0-next.20250202

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 (317) hide show
  1. package/WebScene.js +1 -1
  2. package/arcade/featureset/support/shared.js +1 -1
  3. package/arcade/geometry/unitConversion.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{b68bddd0c4ca91493543.js → 06d489a44d88e38fb140.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{4696278d033907a067c7.js → 085462ba3da7849fc296.js} +1 -1
  7. package/assets/esri/core/workers/chunks/0a19e1aec6a5502e391a.js +1 -0
  8. package/assets/esri/core/workers/chunks/{7a273e6e411f6cc31b3f.js → 326a3f50e585e492b673.js} +1 -1
  9. package/assets/esri/core/workers/chunks/4decfae8bc5e80878bdd.js +1 -0
  10. package/assets/esri/core/workers/chunks/{e0de91eacf3a3b7eda55.js → 5b20ee64248f2d5c937f.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{bef27448b341e429eb31.js → 692b3d03346f030aa649.js} +7 -7
  12. package/assets/esri/core/workers/chunks/6ec108bd955e064256b5.js +1 -0
  13. package/assets/esri/core/workers/chunks/c94ec324ecad77c53a87.js +1 -0
  14. package/assets/esri/core/workers/chunks/{ef6afba80fa2086ec104.js → e9f7953938b9bc8e8abe.js} +1 -1
  15. package/assets/esri/core/workers/chunks/fb1a89f753057f889971.js +314 -0
  16. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +4 -1
  17. package/assets/esri/themes/dark/main.css +1 -1
  18. package/assets/esri/themes/light/main.css +1 -1
  19. package/assets/esri/themes/light/view.css +1 -1
  20. package/assets/esri/widgets/Directions/t9n/Directions.json +1 -1
  21. package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
  22. package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
  23. package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
  24. package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
  25. package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
  26. package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
  27. package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
  28. package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
  29. package/assets/esri/widgets/Directions/t9n/Directions_en.json +1 -1
  30. package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
  31. package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
  32. package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
  33. package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
  34. package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
  35. package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
  36. package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
  37. package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
  38. package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
  39. package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
  40. package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
  41. package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
  42. package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
  43. package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
  44. package/assets/esri/widgets/Directions/t9n/Directions_no.json +1 -1
  45. package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
  46. package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
  47. package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
  48. package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
  49. package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
  50. package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
  51. package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
  52. package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
  53. package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
  54. package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
  55. package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
  56. package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
  57. package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
  58. package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
  59. package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
  60. package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
  61. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  62. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  63. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  64. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  65. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  66. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  67. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  68. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  69. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  70. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  71. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  72. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  73. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  74. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  75. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  76. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  77. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  78. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  79. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  80. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  81. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  82. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  83. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  84. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  85. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  86. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  87. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  88. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  89. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  90. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  91. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  92. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  93. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  94. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  95. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  96. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  97. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  98. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  99. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  100. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ar.json +1 -1
  101. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bg.json +1 -1
  102. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bs.json +1 -1
  103. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ca.json +1 -1
  104. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_cs.json +1 -1
  105. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_da.json +1 -1
  106. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_de.json +1 -1
  107. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_el.json +1 -1
  108. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_es.json +1 -1
  109. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_et.json +1 -1
  110. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fi.json +1 -1
  111. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fr.json +1 -1
  112. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_he.json +1 -1
  113. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hr.json +1 -1
  114. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hu.json +1 -1
  115. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_id.json +1 -1
  116. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_it.json +1 -1
  117. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ja.json +1 -1
  118. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ko.json +1 -1
  119. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lt.json +1 -1
  120. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lv.json +1 -1
  121. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_nl.json +1 -1
  122. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_no.json +1 -1
  123. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pl.json +1 -1
  124. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-BR.json +1 -1
  125. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-PT.json +1 -1
  126. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ro.json +1 -1
  127. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ru.json +1 -1
  128. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sk.json +1 -1
  129. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sl.json +1 -1
  130. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sr.json +1 -1
  131. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sv.json +1 -1
  132. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_th.json +1 -1
  133. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_tr.json +1 -1
  134. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_uk.json +1 -1
  135. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_vi.json +1 -1
  136. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-CN.json +1 -1
  137. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-HK.json +1 -1
  138. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-TW.json +1 -1
  139. package/geometry/support/typeUtils.js +1 -1
  140. package/interfaces.d.ts +154 -7
  141. package/layers/FeatureLayer.js +1 -1
  142. package/layers/support/rasterFieldUtils.js +1 -1
  143. package/package.json +1 -1
  144. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  145. package/support/revision.js +1 -1
  146. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  147. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  148. package/views/2d/layers/features/layerAdapters/geometryUtils.js +1 -1
  149. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  150. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  151. package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
  152. package/views/3d/environment/CloudsComposition.js +1 -1
  153. package/views/3d/environment/CloudsCompositionTechnique.js +1 -1
  154. package/views/3d/environment/CloudsRenderer.js +1 -1
  155. package/views/3d/environment/CloudsTechnique.js +1 -1
  156. package/views/3d/environment/Fog.js +1 -1
  157. package/views/3d/environment/FogTechnique.js +1 -1
  158. package/views/3d/environment/LocalAtmosphere.js +1 -1
  159. package/views/3d/environment/MarsAtmosphere.js +1 -1
  160. package/views/3d/environment/NoiseTextureAtlas.js +1 -1
  161. package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
  162. package/views/3d/environment/Precipitation.js +1 -1
  163. package/views/3d/environment/PrecipitationTechnique.js +1 -1
  164. package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
  165. package/views/3d/interactive/editingTools/media/ControlPointOperations.js +1 -1
  166. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  167. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  168. package/views/3d/layers/GraphicsView3D.js +1 -1
  169. package/views/3d/layers/RouteLayerView3D.js +1 -1
  170. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  171. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  172. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  173. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  174. package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
  175. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
  176. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandEncoder.js +1 -1
  177. package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +1 -1
  178. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  179. package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
  180. package/views/3d/layers/support/MediaLayerInteractionOptions.js +1 -1
  181. package/views/3d/support/hitTest.js +1 -1
  182. package/views/3d/terrain/BlendLayersTechnique.js +1 -1
  183. package/views/3d/terrain/OverlayRenderer.js +1 -1
  184. package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
  185. package/views/3d/terrain/TerrainRenderer.js +1 -1
  186. package/views/3d/terrain/TileCompositor.js +1 -1
  187. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  188. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  189. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  190. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  191. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  192. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  193. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  194. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  195. package/views/3d/webgl-engine/effects/bloom/BloomBlurTechnique.js +1 -1
  196. package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechnique.js +1 -1
  197. package/views/3d/webgl-engine/effects/bloom/BloomDepthAdjustTechnique.js +1 -1
  198. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  199. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  200. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
  201. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  202. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +1 -1
  203. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  204. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  205. package/views/3d/webgl-engine/effects/haze/HazeCompositingTechnique.js +1 -1
  206. package/views/3d/webgl-engine/effects/haze/HazeTechnique.js +1 -1
  207. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  208. package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
  209. package/views/3d/webgl-engine/effects/highlight/HighlightDownsampleTechnique.js +1 -1
  210. package/views/3d/webgl-engine/effects/highlight/HighlightToSingleTechnique.js +1 -1
  211. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  212. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
  213. package/views/3d/webgl-engine/effects/highlight/SingleHighlightApplyTechnique.js +1 -1
  214. package/views/3d/webgl-engine/effects/highlight/SingleHighlightBlurTechnique.js +1 -1
  215. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  216. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechnique.js +1 -1
  217. package/views/3d/webgl-engine/effects/laserlines/LaserlineTechnique.js +1 -1
  218. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  219. package/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique.js +1 -1
  220. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  221. package/views/3d/webgl-engine/effects/smaa/SMAABlendWeightsTechnique.js +1 -1
  222. package/views/3d/webgl-engine/effects/smaa/SMAABlurTechnique.js +1 -1
  223. package/views/3d/webgl-engine/effects/smaa/SMAAEdgeDetectTechnique.js +1 -1
  224. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  225. package/views/3d/webgl-engine/effects/ssao/SSAOBlurTechnique.js +1 -1
  226. package/views/3d/webgl-engine/effects/ssao/SSAOTechnique.js +1 -1
  227. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  228. package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
  229. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  230. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  231. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  232. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  233. package/views/3d/webgl-engine/lib/GLMaterial.js +1 -1
  234. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  235. package/views/3d/webgl-engine/lib/IntersectorTarget.js +1 -1
  236. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  237. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  238. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  239. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  240. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  241. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  242. package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
  243. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  244. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  245. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
  246. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  247. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  248. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  249. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  250. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  251. package/views/3d/webgl-engine/materials/DefaultBufferWriter.js +1 -1
  252. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  253. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  254. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  255. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  256. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  257. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  258. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  259. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  260. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  261. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  262. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  263. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  264. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  265. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  266. package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
  267. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  268. package/views/3d/webgl-engine/shaders/AtmosphereCompositingTechnique.js +1 -1
  269. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  270. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  271. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  272. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  273. package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +1 -1
  274. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  275. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  276. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  277. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  278. package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
  279. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  280. package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
  281. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  282. package/views/3d/webgl-engine/shaders/OverlayCompositingTechnique.js +1 -1
  283. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  284. package/views/3d/webgl-engine/shaders/PointRendererTechnique.js +1 -1
  285. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  286. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  287. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  288. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
  289. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
  290. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
  291. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  292. package/views/3d/webgl-engine/shaders/ViewshedTechnique.js +1 -1
  293. package/views/draw/DrawOperation.js +1 -1
  294. package/views/draw/support/helpMessageUtils.js +1 -1
  295. package/views/draw/support/tooltipUtils.js +1 -1
  296. package/views/interactive/keybindings.js +1 -1
  297. package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
  298. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  299. package/views/interactive/snapping/snappingUtils.js +1 -1
  300. package/views/interactive/tooltip/content/tooltipContentFactory.js +1 -1
  301. package/views/interactive/tooltip/infos/DrawCircleTooltipInfo.js +1 -1
  302. package/views/interactive/tooltip/infos/DrawMultipointTooltipInfo.js +5 -0
  303. package/views/interactive/tooltip/infos/DrawRectangleTooltipInfo.js +1 -1
  304. package/views/layers/FeatureLayerView.js +1 -1
  305. package/views/layers/MediaLayerView.js +1 -1
  306. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  307. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  308. package/widgets/BatchAttributeForm.js +1 -1
  309. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  310. package/widgets/LinkChartLayoutSwitcher/LinkChartLayoutSwitcherViewModel.d.ts +4 -0
  311. package/widgets/LinkChartLayoutSwitcher/LinkChartLayoutSwitcherViewModel.js +1 -1
  312. package/widgets/support/widget.d.ts +9 -0
  313. package/assets/esri/core/workers/chunks/0bafa546602b776caf2f.js +0 -1
  314. package/assets/esri/core/workers/chunks/258b46b58a4860942f7c.js +0 -1
  315. package/assets/esri/core/workers/chunks/69ab4b780f7223cfd7dd.js +0 -1
  316. package/assets/esri/core/workers/chunks/83edac97a52b26ead1ea.js +0 -314
  317. package/assets/esri/core/workers/chunks/9ffa27d0517bad84572e.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{zeroMeters as e,zeroSquareMeters as t,zeroDegreesGeographic as o,valueInUnit as n,createLength as i}from"../../../core/quantityUtils.js";import{getMetersPerVerticalUnitForSR as r}from"../../../core/unitUtils.js";import{getConvertedElevationFromXYZ as c,absoluteHeightElevationInfo as l}from"../../../support/elevationInfoUtils.js";import{getDrawHelpMessage as s}from"./helpMessageUtils.js";import{getDrawMeshHelpMessage as a}from"./helpMessageUtils3d.js";import{getConstraintContext as p}from"../../interactive/sketch/constraintUtils.js";import{updateTooltipInfoFromMeshTransform as u}from"../../interactive/tooltip/tooltipCommonUtils.js";import{DrawCircleTooltipInfo as m}from"../../interactive/tooltip/infos/DrawCircleTooltipInfo.js";import{DrawMeshTooltipInfo as d}from"../../interactive/tooltip/infos/DrawMeshTooltipInfo.js";import{DrawPointTooltipInfo as f}from"../../interactive/tooltip/infos/DrawPointTooltipInfo.js";import{DrawPolygonTooltipInfo as y}from"../../interactive/tooltip/infos/DrawPolygonTooltipInfo.js";import{DrawPolylineTooltipInfo as g}from"../../interactive/tooltip/infos/DrawPolylineTooltipInfo.js";import{DrawRectangleTooltipInfo as h}from"../../interactive/tooltip/infos/DrawRectangleTooltipInfo.js";import{directionForVertices as v}from"../../support/angularMeasurementUtils.js";import{autoArea2D as w}from"../../support/automaticAreaMeasurementUtils.js";import{autoLength2D as O,autoDistanceBetweenPoints2D as k}from"../../support/automaticLengthMeasurementUtils.js";import{elevationFromPoint as x,elevationFromZ as j}from"../../support/euclideanLengthMeasurementUtils.js";function M(e,t){return{point:new f({sketchOptions:t,viewType:e}),polyline:new g({sketchOptions:t,viewType:e}),polygon:new y({sketchOptions:t,viewType:e}),mesh:new d({sketchOptions:t,viewType:e}),rectangle:new h({sketchOptions:t}),circle:new m({sketchOptions:t})}}function T(e){const{directionOptions:t,geometryType:o,sketchOptions:n,tooltipInfos:i}=e,r=t=>{const o=J(e).mode,n=i[t].elevation;"relative-to-ground"===o||"relative-to-scene"===o||"on-the-ground"===o?n.lock(N(e)):n.unlock()},c=e=>{if(t){const o=i[e].direction;o.committed=t.angle,o.unlockOnVertexPlacement=!1,n.values.directionMode=t.mode}};switch(o){case"polygon":case"polyline":r(o),c(o);break;case"point":case"mesh":r(o)}}function b(e,t){const{drawOperation:o,view:n}=t,i=I(t),r=J(t);if("2d"===n.type||!e||"absolute-height"!==r.mode||1!==o?.numCommittedVertices||!i||"draw-polyline"!==i.type&&"draw-polygon"!==i.type||i.elevation.locked)return;const[c,l,s]=e,a=B(c,l,s,r,t);null!=a&&i.elevation.lock(a)}function U(e){I(e)?.allFields.forEach((e=>{e.unlockOnVertexPlacement&&e.unlock()}))}function I({geometryType:e,graphic:t,tooltipInfos:o}){return"multipoint"===e||t?.geometry?.type!==V[e]?null:o[e]}const V={point:"point",mesh:"mesh",polyline:"polyline",polygon:"polygon",circle:"polygon",rectangle:"polygon"};function D(e,t){switch(e?.type){case"draw-point":P(e,t);break;case"draw-polyline":z(e,t);break;case"draw-polygon":S(e,t);break;case"draw-rectangle":F(e,t);break;case"draw-circle":A(e,t);break;case"draw-mesh":G(e,t)}}function P(e,t){const o=t.graphic?.geometry;"point"===o?.type&&(L(e,o,t),e.helpMessage=s("point",o))}function G(e,t){const{graphic:o,view:n}=t,i=o?.geometry;"3d"!==n.type||i&&"mesh"!==i.type||(L(e,i?.origin,t),i&&u(e,i),e.helpMessage=a(o,n))}function L(e,t,o){const{drawOperation:n,view:i,sketchOptions:r}=o,{cursorVertex:c}=n;if(e.sketchOptions=r,e.viewType=i.type,e.setLocationFromPoint(t,K(o)),H(e.elevation,o),!c)return void(n.constraints=void 0);const l=c;n.constraints={context:Q(l,o),x:e.x.committed,y:e.y.committed,longitude:e.longitude.committed,latitude:e.latitude.committed,elevation:e.elevation.committed,distance:null,direction:null}}function z(t,o){const{createOperationGeometry:n,drawOperation:i}=o,r=null!=n?n.full:null;r&&"polyline"!==r.type||(Z(t,o),t.totalLength.actual=i.lastVertex?(r?O(r):null)??e:null,t.helpMessage=s("polyline",r))}function S(e,o){const{createOperationGeometry:n,drawOperation:i}=o,r=null!=n?n.full:null;r&&"polygon"!==r.type||(Z(e,o),e.area.actual=i.lastVertex?(r?w(r):null)??t:null,e.helpMessage=s("polygon",r))}function Z(t,n){const{drawOperation:i,sketchOptions:r,view:c}=n,{cursorVertex:l,lastVertex:s,secondToLastVertex:a}=i,p=r.values.effectiveDirectionMode;t.sketchOptions=r,t.viewType=c.type;const u=s&&l?k(s,l)??e:null;if(t.distance.actual=u,t.distance.readOnly=null==s,t.direction.actual=null,t.direction.readOnly=!0,s&&l&&("absolute"===p||a)){const e=v(a,s,l,p);t.direction.actual=e??o,t.direction.readOnly=!1}t.setLocationFromPoint(l,K(n)),H(t.elevation,n);const m=C(s,n);t.xyMode=m,t.direction.visible="direction-distance"===m,t.distance.visible="direction-distance"===m,t.effectiveX.visible="coordinates"===m,t.effectiveY.visible="coordinates"===m;const d=l??s;i.constraints=d?{context:Q(d,n),x:t.x.committed,y:t.y.committed,longitude:t.longitude.committed,latitude:t.latitude.committed,elevation:t.elevation.committed,distance:t.distance.committed,direction:t.direction.committed}:void 0}function C(e,{sketchOptions:t}){const o=t.tooltips.xyMode;return"auto"===o?e?"direction-distance":"coordinates":o}function F(e,t){e.sketchOptions=t.sketchOptions,e.xSize=q(t),e.ySize=E(t),e.area=R(t)}function A(e,t){const{forceUniformSize:o,sketchOptions:n}=t;e.sketchOptions=n,e.radius=o?X(t):null,e.xSize=o?null:q(t),e.ySize=o?null:E(t),e.area=R(t)}function H(e,t){const{drawOperation:o}=t,n=o?.cursorVertex??o?.lastVertex;e.actual=x(n)??N(t),e.visible=o.hasZ,e.readOnly=!1,e.showAsZ=!0}function R(e){const o=e.createOperationGeometry?.full;return"polygon"!==o?.type?t:w(o)??t}function q(t){const o=t.createOperationGeometry?.rectangle?.midpoints;return(null!=o?k(o.left,o.right):null)??e}function E(t){const o=t.createOperationGeometry?.rectangle?.midpoints;return(null!=o?k(o.top,o.bottom):null)??e}function X({createOperationGeometry:t}){return(null!=t?.circle?.center&&null!=t.circle.edge?k(t.circle.center,t.circle.edge):null)??e}function Y(e){const{geometryType:t,tooltipInfos:o}=e;switch(t){case"point":case"mesh":case"polyline":case"polygon":{const i=o[t].elevation.committed;if(!i)return;return n(i,"meters")/r(K(e))}default:return}}function B(e,t,o,n,i){const{view:r,drawOperation:l}=i;if("3d"!==r.type||!l)return;o??=0;const s=K(i),a=J(i),p=c(r,e,t,o,s,a,n);return j(p,s)??N(i)}function J(e){return e.drawOperation.elevationInfo??l}function K(e){return e.drawOperation.coordinateHelper.spatialReference}function N(e){const t=r(K(e));return i(e.defaultZ*t,"meters")}function Q(e,t){return p(e,t.view,K(t),J(t),t.drawOperation.coordinateHelper.hasZ(),t.sketchOptions.values.effectiveDirectionMode)}export{M as createTooltipInfos,I as getActiveTooltipInfo,Y as getConstraintZ,T as initializeConstraints,b as lockElevationOnVertexAdd,U as unlockConstraintsOnVertexAddOrRemove,D as updateTooltipInfo};
5
+ import{zeroMeters as e,zeroSquareMeters as t,zeroDegreesGeographic as o,valueInUnit as n,createLength as i}from"../../../core/quantityUtils.js";import{getMetersPerVerticalUnitForSR as r}from"../../../core/unitUtils.js";import{getConvertedElevationFromXYZ as l,absoluteHeightElevationInfo as c}from"../../../support/elevationInfoUtils.js";import{getDrawHelpMessage as a}from"./helpMessageUtils.js";import{getDrawMeshHelpMessage as s}from"./helpMessageUtils3d.js";import{getConstraintContext as p}from"../../interactive/sketch/constraintUtils.js";import{updateTooltipInfoFromMeshTransform as u}from"../../interactive/tooltip/tooltipCommonUtils.js";import{DrawCircleTooltipInfo as d}from"../../interactive/tooltip/infos/DrawCircleTooltipInfo.js";import{DrawMeshTooltipInfo as m}from"../../interactive/tooltip/infos/DrawMeshTooltipInfo.js";import{DrawMultipointTooltipInfo as f}from"../../interactive/tooltip/infos/DrawMultipointTooltipInfo.js";import{DrawPointTooltipInfo as y}from"../../interactive/tooltip/infos/DrawPointTooltipInfo.js";import{DrawPolygonTooltipInfo as g}from"../../interactive/tooltip/infos/DrawPolygonTooltipInfo.js";import{DrawPolylineTooltipInfo as w}from"../../interactive/tooltip/infos/DrawPolylineTooltipInfo.js";import{DrawRectangleTooltipInfo as h}from"../../interactive/tooltip/infos/DrawRectangleTooltipInfo.js";import{directionForVertices as v}from"../../support/angularMeasurementUtils.js";import{autoArea2D as O}from"../../support/automaticAreaMeasurementUtils.js";import{autoLength2D as k,autoDistanceBetweenPoints2D as M}from"../../support/automaticLengthMeasurementUtils.js";import{elevationFromPoint as x,elevationFromZ as j}from"../../support/euclideanLengthMeasurementUtils.js";function T(e,t){return{point:new y({sketchOptions:t,viewType:e}),multipoint:new f({sketchOptions:t,viewType:e}),polyline:new w({sketchOptions:t,viewType:e}),polygon:new g({sketchOptions:t,viewType:e}),mesh:new m({sketchOptions:t,viewType:e}),rectangle:new h({sketchOptions:t}),circle:new d({sketchOptions:t})}}function b(e){const{directionOptions:t,geometryType:o,sketchOptions:n,tooltipInfos:i}=e,r=t=>{const o=N(e).mode,n=i[t].elevation;"relative-to-ground"===o||"relative-to-scene"===o||"on-the-ground"===o?n.lock(W(e)):n.unlock()},l=e=>{if(t){const o=i[e].direction;o.committed=t.angle,o.unlockOnVertexPlacement=!1,n.values.directionMode=t.mode}};switch(o){case"polygon":case"polyline":r(o),l(o);break;case"point":case"mesh":r(o)}}function I(e,t){const{drawOperation:o,view:n}=t,i=V(t),r=N(t);if("2d"===n.type||!e||"absolute-height"!==r.mode||1!==o?.numCommittedVertices||!i||"draw-polyline"!==i.type&&"draw-polygon"!==i.type||i.elevation.locked)return;const[l,c,a]=e,s=K(l,c,a,r,t);null!=s&&i.elevation.lock(s)}function U(e){V(e)?.allFields.forEach((e=>{e.unlockOnVertexPlacement&&e.unlock()}))}function V({geometryType:e,graphic:t,tooltipInfos:o}){return t?.geometry?.type!==P[e]?"circle"===e||"rectangle"===e?o[e]:null:o[e]}const P={point:"point",multipoint:"multipoint",mesh:"mesh",polyline:"polyline",polygon:"polygon",circle:"polygon",rectangle:"polygon",freehandPolygon:"polygon",freehandPolyline:"polyline"};function D(e,t){switch(e?.type){case"draw-point":G(e,t);break;case"draw-multipoint":L(e,t);break;case"draw-polyline":Z(e,t);break;case"draw-polygon":C(e,t);break;case"draw-rectangle":H(e,t);break;case"draw-circle":R(e,t);break;case"draw-mesh":z(e,t)}}function G(e,t){const o=t.graphic?.geometry;"point"===o?.type&&(S(e,o,t),e.helpMessage=a("point",o,t.drawOperation.drawingMode))}function L(e,t){const o=t.graphic?.geometry;"multipoint"===o?.type&&(S(e,o,t),e.helpMessage=a("multipoint",o,t.drawOperation.drawingMode))}function z(e,t){const{graphic:o,view:n}=t,i=o?.geometry;"3d"!==n.type||i&&"mesh"!==i.type||(S(e,i?.origin,t),i&&u(e,i),e.helpMessage=s(o,n))}function S(e,t,o){const{drawOperation:n,view:i,sketchOptions:r}=o,{cursorVertex:l}=n;e.sketchOptions=r,e.viewType=i.type;const c="multipoint"===t?.type?t.getPoint(t.points.length-1):t;if(e.setLocationFromPoint(c,Q(o)),q(e.elevation,o),!l)return void(n.constraints=void 0);const a=l;n.constraints={context:$(a,o),x:e.x.committed,y:e.y.committed,longitude:e.longitude.committed,latitude:e.latitude.committed,elevation:e.elevation.committed,distance:null,direction:null}}function Z(t,o){const{createOperationGeometry:n,drawOperation:i}=o,r=null!=n?n.full:null;r&&"polyline"!==r.type||(F(t,o),t.totalLength.actual=i.lastVertex?(r?k(r):null)??e:null,t.helpMessage=a("polyline",r,o.drawOperation.drawingMode))}function C(e,o){const{createOperationGeometry:n,drawOperation:i}=o,r=null!=n?n.full:null;r&&"polygon"!==r.type||(F(e,o),e.area.actual=i.lastVertex?(r?O(r):null)??t:null,e.helpMessage=a("polygon",r,o.drawOperation.drawingMode))}function F(t,n){const{drawOperation:i,sketchOptions:r,view:l}=n,{cursorVertex:c,lastVertex:a,secondToLastVertex:s}=i,p=r.values.effectiveDirectionMode;t.sketchOptions=r,t.viewType=l.type;const u=a&&c?M(a,c)??e:null;if(t.distance.actual=u,t.distance.readOnly=null==a,t.direction.actual=null,t.direction.readOnly=!0,a&&c&&("absolute"===p||s)){const e=v(s,a,c,p);t.direction.actual=e??o,t.direction.readOnly=!1}t.setLocationFromPoint(c,Q(n)),q(t.elevation,n);const d=A(a,n);t.xyMode=d,t.direction.visible="direction-distance"===d,t.distance.visible="direction-distance"===d,t.effectiveX.visible="coordinates"===d,t.effectiveY.visible="coordinates"===d;const m=c??a;i.constraints=m?{context:$(m,n),x:t.x.committed,y:t.y.committed,longitude:t.longitude.committed,latitude:t.latitude.committed,elevation:t.elevation.committed,distance:t.distance.committed,direction:t.direction.committed}:void 0}function A(e,{sketchOptions:t}){const o=t.tooltips.xyMode;return"auto"===o?e?"direction-distance":"coordinates":o}function H(e,t){e.sketchOptions=t.sketchOptions,e.xSize=X(t),e.ySize=Y(t),e.area=E(t),e.helpMessage=a("rectangle",t.graphic?.geometry,t.drawOperation.drawingMode)}function R(e,t){const{forceUniformSize:o,sketchOptions:n}=t;e.sketchOptions=n,e.radius=o?B(t):null,e.xSize=o?null:X(t),e.ySize=o?null:Y(t),e.area=E(t),e.helpMessage=a("circle",t.graphic?.geometry,t.drawOperation.drawingMode)}function q(e,t){const{drawOperation:o}=t,n=o?.cursorVertex??o?.lastVertex;e.actual=x(n)??W(t),e.visible=o.hasZ,e.readOnly=!1,e.showAsZ=!0}function E(e){const o=e.createOperationGeometry?.full;return"polygon"!==o?.type?t:O(o)??t}function X(t){const o=t.createOperationGeometry?.rectangle?.midpoints;return(null!=o?M(o.left,o.right):null)??e}function Y(t){const o=t.createOperationGeometry?.rectangle?.midpoints;return(null!=o?M(o.top,o.bottom):null)??e}function B({createOperationGeometry:t}){return(null!=t?.circle?.center&&null!=t.circle.edge?M(t.circle.center,t.circle.edge):null)??e}function J(e){const{geometryType:t,tooltipInfos:o}=e;switch(t){case"point":case"multipoint":case"mesh":case"polyline":case"polygon":{const i=o[t].elevation.committed;if(!i)return;return n(i,"meters")/r(Q(e))}default:return}}function K(e,t,o,n,i){const{view:r,drawOperation:c}=i;if("3d"!==r.type||!c)return;o??=0;const a=Q(i),s=N(i),p=l(r,e,t,o,a,s,n);return j(p,a)??W(i)}function N(e){return e.drawOperation.elevationInfo??c}function Q(e){return e.drawOperation.coordinateHelper.spatialReference}function W(e){const t=r(Q(e));return i(e.defaultZ*t,"meters")}function $(e,t){return p(e,t.view,Q(t),N(t),t.drawOperation.coordinateHelper.hasZ(),t.sketchOptions.values.effectiveDirectionMode)}export{T as createTooltipInfos,V as getActiveTooltipInfo,J as getConstraintZ,b as initializeConstraints,I as lockElevationOnVertexAdd,U as unlockConstraintsOnVertexAddOrRemove,D as updateTooltipInfo};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{remove as e}from"../../core/arrayUtils.js";import{makeHandle as t,handlesGroup as i}from"../../core/handleUtils.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{ViewEventPriorities as r}from"../input/InputManager.js";import{primaryKey as n}from"../input/keys.js";const s="z",a="r",p={redo:a,undo:s,center:"Alt",constraint:"Shift",cancel:"Escape",delete:["Backspace","Delete"],complete:"Enter",vertexAdd:"f",pan:" "},c={toggle:"Control"},f={enterInputMode:"Tab",commit:"Enter",discard:"Escape",next:"Tab"},d={moveUp:{key:"ArrowUp",modifier:"Shift",repeats:!0},moveDown:{key:"ArrowDown",modifier:"Shift",repeats:!0},moveLeft:{key:"ArrowLeft",modifier:"Shift",repeats:!0},moveRight:{key:"ArrowRight",modifier:"Shift",repeats:!0},scaleUp:{key:"+",modifier:"Shift"},scaleDown:{key:"-",modifier:"Shift"},factorModifier:{key:n,continuePropagation:!0},toggleOpacity:"t",preserveAspectRatio:{key:"Shift",continuePropagation:!0},rotateIncrements:{key:"Shift",continuePropagation:!0},modifySourcePoints:{key:"Alt",continuePropagation:!0},undo:s,redo:a};class h{constructor(){this._bindings=new Map}add(e,t){return this.addToggle(e,(e=>{"key-down"===e.type&&t(e)}))}addToggle(i,r){const n=m.fromDefinition(i,r),s=o(this._bindings,n.key,(()=>[]));return s.push(n),t((()=>e(s,n)))}register(e,t=r.WIDGET){return i([e.on("key-down",(t=>this.dispatch(e.inputManager,t)),t),e.on("key-up",(t=>this.dispatch(e.inputManager,t)),t)])}dispatch(e,t){const i=t.key,o=this._bindings.get(i);if(o)for(const r of o)r.process(e,t)}}class m{constructor(e,t,i,o,r){this.key=e,this.modifiers=t,this.repeats=i,this.continuePropagation=o,this.callback=r}process(e,t){if(!(t.key!==this.key||"repeat"in t&&t.repeat&&!this.repeats)){for(const t of this.modifiers)if(!e.isModifierKeyDown(t))return;this.continuePropagation||t.stopPropagation(),this.callback(t)}}static fromDefinition(e,t){if("string"==typeof e)return new m(e,[],!1,!1,t);const{key:i,modifier:o,repeats:r,continuePropagation:n}=e;return new m(i,o?Array.isArray(o)?o:[o]:[],!!r,!!n,t)}}export{h as KeyBindings,d as mediaKeys,p as sketchKeys,c as snappingKeys,f as tooltipKeys};
5
+ import{remove as e}from"../../core/arrayUtils.js";import{makeHandle as t,handlesGroup as i}from"../../core/handleUtils.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{ViewEventPriorities as r}from"../input/InputManager.js";import{primaryKey as n}from"../input/keys.js";const s="z",a="r",p={redo:a,undo:s,center:"Alt",constraint:"Shift",cancel:"Escape",delete:["Backspace","Delete"],complete:"Enter",vertexAdd:"f",pan:" "},c={toggle:"Control"},f={enterInputMode:"Tab",commit:"Enter",discard:"Escape",next:"Tab"},d={moveUp:{key:"ArrowUp",modifier:"Shift",repeats:!0},moveDown:{key:"ArrowDown",modifier:"Shift",repeats:!0},moveLeft:{key:"ArrowLeft",modifier:"Shift",repeats:!0},moveRight:{key:"ArrowRight",modifier:"Shift",repeats:!0},scaleUp:{key:"+",modifier:"Shift"},scaleDown:{key:"-",modifier:"Shift"},factorModifier:{key:n,continuePropagation:!0},toggleOpacity:"t",preserveAspectRatio:{key:"Shift",continuePropagation:!0},rotateIncrements:{key:"Shift",continuePropagation:!0},editSourcePoints:{key:"Alt",continuePropagation:!0},undo:s,redo:a};class h{constructor(){this._bindings=new Map}add(e,t){return this.addToggle(e,(e=>{"key-down"===e.type&&t(e)}))}addToggle(i,r){const n=m.fromDefinition(i,r),s=o(this._bindings,n.key,(()=>[]));return s.push(n),t((()=>e(s,n)))}register(e,t=r.WIDGET){return i([e.on("key-down",(t=>this.dispatch(e.inputManager,t)),t),e.on("key-up",(t=>this.dispatch(e.inputManager,t)),t)])}dispatch(e,t){const i=t.key,o=this._bindings.get(i);if(o)for(const r of o)r.process(e,t)}}class m{constructor(e,t,i,o,r){this.key=e,this.modifiers=t,this.repeats=i,this.continuePropagation=o,this.callback=r}process(e,t){if(!(t.key!==this.key||"repeat"in t&&t.repeat&&!this.repeats)){for(const t of this.modifiers)if(!e.isModifierKeyDown(t))return;this.continuePropagation||t.stopPropagation(),this.callback(t)}}static fromDefinition(e,t){if("string"==typeof e)return new m(e,[],!1,!1,t);const{key:i,modifier:o,repeats:r,continuePropagation:n}=e;return new m(i,o?Array.isArray(o)?o:[o]:[],!!r,!!n,t)}}export{h as KeyBindings,d as mediaKeys,p as sketchKeys,c as snappingKeys,f as tooltipKeys};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{memoize as i}from"../../../../core/memoize.js";import{throwIfAborted as n,whenOrAbort as o}from"../../../../core/promiseUtils.js";import{watch as r,on as a,initial as s}from"../../../../core/reactiveUtils.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{elevationContextAffectsAlignment as y}from"../../../../support/elevationInfoUtils.js";import{makeFilter as c,makeSnappingQuery as u}from"../snappingUtils.js";import{convertSnappingCandidate as g,makeGetGroundElevation as m}from"./queryEngineUtils.js";import{getSnappingCandidateElevationAligner as h}from"./snappingCandidateElevationAlignment.js";import{getSnappingCandidateElevationFilter as d}from"./snappingCandidateElevationFilter.js";import{getSymbologySnappingCandidatesFetcher as v}from"./symbologySnappingCandidates.js";let f=class extends t{get availability(){return 1}get _snappingElevationAligner(){const{view:e}=this,{layer:t}=this.layerSource,i=null!=e&&"3d"===e.type;if(!i||"subtype-group"===t.type)return h();const n=async(i,n)=>(await o(e.whenLayerView(t),n)).elevationAlignPointsInFeatures(i,n);return h(i,{elevationInfo:t.elevationInfo,alignPointsInFeatures:n})}get _snappingElevationFilter(){const{view:e}=this,t=null!=e&&"3d"===e.type&&"subtype-group"!==this.layerSource.layer.type;return d(t)}get _symbologySnappingFetcher(){const{view:e}=this,{layer:t}=this.layerSource;return null!=e&&"3d"===e.type&&"subtype-group"!==t.type?v(this._symbologySnappingSupported,(async(i,o)=>{const r=await e.whenLayerView(t);return n(o),r.queryForSymbologySnapping({candidates:i,spatialReference:e.spatialReference},o)})):v()}get _layerView3D(){const{view:e}=this;if(null==e||"2d"===e.type)return null;const{layer:t}=this.layerSource;return e.allLayerViews.find((e=>e.layer===t))}get _symbologySnappingSupported(){return null!=this._layerView3D&&this._layerView3D.symbologySnappingSupported}initialize(){const{view:e}=this,{layer:t}=this.layerSource;null!=e&&"3d"===e.type&&"subtype-group"!==t.type&&this.addHandles([e.elevationProvider.on("elevation-change",(({context:e})=>{const{elevationInfo:i}=t;y(e,i)&&this._snappingElevationAligner.notifyElevationSourceChange()})),r((()=>t.elevationInfo),(()=>this._snappingElevationAligner.notifyElevationSourceChange()),s),r((()=>null!=this._layerView3D?this._layerView3D.layer?.renderer:null),(()=>this._symbologySnappingFetcher.notifySymbologyChange()),s),a((()=>this._layerView3D?.layer),["edits","apply-edits","graphic-update"],(()=>this._symbologySnappingFetcher.notifySymbologyChange()))])}constructor(e){super(e),this.view=null,this.updating=!1,this._memoizedMakeGetGroundElevation=i(m)}refresh(){}async fetchCandidates(e,t){const{layer:i}=this.layerSource,o=i.source;if(!o?.querySnapping)return[];const r=c(i),a=u(e,this.view?.type??"2d",r),s=await o.querySnapping(a,{signal:t});n(t);const p=e.coordinateHelper.spatialReference,l=await this._snappingElevationAligner.alignCandidates(s.candidates,p,t);n(t);const y=await this._symbologySnappingFetcher.fetch(l,t);n(t);const m=0===y.length?l:[...l,...y],h=this._snappingElevationFilter.filter(a,m),d=this._memoizedMakeGetGroundElevation(this.view,p);return h.map((e=>g(e,d)))}};e([p({constructOnly:!0})],f.prototype,"layerSource",void 0),e([p({constructOnly:!0})],f.prototype,"view",void 0),e([p()],f.prototype,"_snappingElevationAligner",null),e([p()],f.prototype,"_snappingElevationFilter",null),e([p()],f.prototype,"_symbologySnappingFetcher",null),e([p()],f.prototype,"_layerView3D",null),e([p()],f.prototype,"_symbologySnappingSupported",null),f=e([l("esri.views.interactive.snapping.featureSources.FeatureCollectionSnappingSource")],f);export{f as FeatureCollectionSnappingSource};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{memoize as i}from"../../../../core/memoize.js";import{throwIfAborted as r,whenOrAbort as n}from"../../../../core/promiseUtils.js";import{watch as o,on as a,initial as s}from"../../../../core/reactiveUtils.js";import{sqlAnd as l}from"../../../../core/sql.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as y}from"../../../../core/accessorSupport/decorators/subclass.js";import{elevationContextAffectsAlignment as c}from"../../../../support/elevationInfoUtils.js";import{makeSnappingQuery as u}from"../snappingUtils.js";import{convertSnappingCandidate as g,makeGetGroundElevation as h}from"./queryEngineUtils.js";import{getSnappingCandidateElevationAligner as m}from"./snappingCandidateElevationAlignment.js";import{getSnappingCandidateElevationFilter as d}from"./snappingCandidateElevationFilter.js";import{getSymbologySnappingCandidatesFetcher as v}from"./symbologySnappingCandidates.js";let f=class extends t{get availability(){return 1}get _snappingElevationAligner(){const{view:e}=this,{layer:t}=this.layerSource,i=null!=e&&"3d"===e.type;if(!i||"subtype-group"===t.type)return m();const r=async(i,r)=>(await n(e.whenLayerView(t),r)).elevationAlignPointsInFeatures(i,r);return m(i,{elevationInfo:t.elevationInfo,alignPointsInFeatures:r})}get _snappingElevationFilter(){const{view:e}=this,t=null!=e&&"3d"===e.type&&"subtype-group"!==this.layerSource.layer.type;return d(t)}get _symbologySnappingFetcher(){const{view:e}=this,{layer:t}=this.layerSource;return null!=e&&"3d"===e.type&&"subtype-group"!==t.type?v(this._symbologySnappingSupported,(async(i,n)=>{const o=await e.whenLayerView(t);return r(n),o.queryForSymbologySnapping({candidates:i,spatialReference:e.spatialReference},n)})):v()}get _layerView(){const{view:e}=this;if(null==e)return null;const{layer:t}=this.layerSource;return e.allLayerViews.find((e=>e.layer===t))}get _layerView3D(){const{view:e}=this;return null==e||"2d"===e.type?null:this._layerView}get _symbologySnappingSupported(){return null!=this._layerView3D&&this._layerView3D.symbologySnappingSupported}initialize(){const{view:e}=this,{layer:t}=this.layerSource;null!=e&&"3d"===e.type&&"subtype-group"!==t.type&&this.addHandles([e.elevationProvider.on("elevation-change",(({context:e})=>{const{elevationInfo:i}=t;c(e,i)&&this._snappingElevationAligner.notifyElevationSourceChange()})),o((()=>t.elevationInfo),(()=>this._snappingElevationAligner.notifyElevationSourceChange()),s),o((()=>null!=this._layerView3D?this._layerView3D.layer?.renderer:null),(()=>this._symbologySnappingFetcher.notifySymbologyChange()),s),a((()=>this._layerView3D?.layer),["edits","apply-edits","graphic-update"],(()=>this._symbologySnappingFetcher.notifySymbologyChange()))])}constructor(e){super(e),this.view=null,this.updating=!1,this._memoizedMakeGetGroundElevation=i(h)}refresh(){}async fetchCandidates(e,t){const{layer:i}=this.layerSource,n=i.source;if(!n?.querySnapping)return[];const o=i.createQuery();this._layerView&&"effectiveDisplayFilter"in this._layerView&&(o.where=l(o.where,this._layerView.effectiveDisplayFilter?.where));const a=u(e,this.view?.type??"2d",o),s=await n.querySnapping(a,{signal:t});r(t);const p=e.coordinateHelper.spatialReference,y=await this._snappingElevationAligner.alignCandidates(s.candidates,p,t);r(t);const c=await this._symbologySnappingFetcher.fetch(y,t);r(t);const h=0===c.length?y:[...y,...c],m=this._snappingElevationFilter.filter(a,h),d=this._memoizedMakeGetGroundElevation(this.view,p);return m.map((e=>g(e,d)))}};e([p({constructOnly:!0})],f.prototype,"layerSource",void 0),e([p({constructOnly:!0})],f.prototype,"view",void 0),e([p()],f.prototype,"_snappingElevationAligner",null),e([p()],f.prototype,"_snappingElevationFilter",null),e([p()],f.prototype,"_symbologySnappingFetcher",null),e([p()],f.prototype,"_layerView",null),e([p()],f.prototype,"_layerView3D",null),e([p()],f.prototype,"_symbologySnappingSupported",null),f=e([y("esri.views.interactive.snapping.featureSources.FeatureCollectionSnappingSource")],f);export{f as FeatureCollectionSnappingSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{destroyHandle as i}from"../../../../core/handleUtils.js";import{memoize as s}from"../../../../core/memoize.js";import{throwIfAborted as o,ignoreAbortErrors as a}from"../../../../core/promiseUtils.js";import{watch as n,on as l,initial as d,sync as u,syncAndInitial as p}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as f}from"../../../../layers/support/layerUtils.js";import{elevationContextAffectsAlignment as m}from"../../../../support/elevationInfoUtils.js";import{FeatureServiceTiles2D as _}from"../../../2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js";import{FeatureServiceTiles3D as g}from"../../../3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js";import{isUtilityNetworkWebMap as S}from"../snappingUtils.js";import{convertSnappingCandidate as w,makeGetGroundElevation as v}from"./queryEngineUtils.js";import{WorkerTileTreeDebugger as b}from"./WorkerTileTreeDebugger.js";import{FeatureServiceSnappingSourceWorkerHandle as I}from"./featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js";import{FeatureServiceTilesSimple as H}from"./featureServiceSource/FeatureServiceTilesSimple.js";import j from"../../../support/debugFlags.js";let F=class extends t{get _updateTilesParameters(){return{tiles:this._tilesOfInterest.tiles,tileInfo:this._tilesOfInterest.tileInfo,tileSize:this._tilesOfInterest.tileSize}}get _layerView(){return this.view?.allLayerViews.find((e=>e.layer===this._layer))}get _isSuspended(){if(f(this._layer)){if(!this.layerSource.sublayerSources.some((e=>e.enabled&&e.layer.visible)))return!0}return!!this.view&&(!1!==this._layerView?.suspended||!this.layerSource.enabled)}get updating(){return this._workerHandle?.updating||this._updatingHandles.updating}get _outFields(){const{view:e,_layerView:t,layerSource:r}=this,{layer:i}=r,{fieldsIndex:s,timeInfo:o,floorInfo:a,subtypeField:n}=i,l=t&&"filter"in t?t.filter:null,d=l?.where&&"1=1"!==l.where?this._getOrLoadWhereFields(l.where,s):[];if(l?.timeExtent&&o){const{startField:e,endField:t}=o,r=s.get(e)?.name??e,i=s.get(t)?.name??t;r&&d.push(r),i&&d.push(i)}if(e?.map&&S(e.map)&&e.map.utilityNetworks?.find((e=>e.isUtilityLayer(i)))){const e=i.fieldsIndex.get("assetGroup")?.name,t=i.fieldsIndex.get("assetType")?.name;e&&t&&(d.push(e),d.push(t))}if(i&&a?.floorField&&e?.floors?.length){const e=s.get(a.floorField)?.name??a.floorField;e&&d.push(e)}if(n){const e=s.get(n)?.name??n;e&&d.push(e)}return new Set(d)}get configuration(){const{view:e}=this,{apiKey:t,customParameters:r}=this._layer,i=null!=e?e.type:"2d";return{filter:this._layer.createQuery(),customParameters:t?{...r,token:t}:r,viewType:i}}get availability(){return this._workerHandle?.availability??0}get _layer(){return this.layerSource.layer}constructor(e){super(e),this._updatingHandles=new y,this._workerHandle=null,this._debug=null,this._memoizedMakeGetGroundElevation=s(v)}initialize(){let e;const t=this.view;if(null==t||t.destroyed)this._tilesOfInterest=new H({layer:this._layer}),e=this._workerHandle=new I;else switch(t.type){case"2d":this._tilesOfInterest=new _({view:t,layer:this._layer}),e=this._workerHandle=new I;break;case"3d":{const{resourceController:r}=t,i=this._layer;this._tilesOfInterest=new g({view:t}),e=this._workerHandle=new I({schedule:e=>r.immediate.schedule(e),hasZ:this._layer.hasZ&&(this._layer.returnZ??!0),elevationAlignPointsInFeatures:async(e,r)=>{const s=await t.whenLayerView(i);return o(r),s.elevationAlignPointsInFeatures(e,r)},queryForSymbologySnapping:async(e,r)=>{const s=await t.whenLayerView(i);return o(r),s.queryForSymbologySnapping(e,r)}}),this.addHandles([t.elevationProvider.on("elevation-change",(({context:t})=>{const{elevationInfo:r}=i;m(t,r)&&a(e.notifyElevationSourceChange())})),n((()=>i.elevationInfo),(()=>a(e.notifyElevationSourceChange())),d),n((()=>this._layerView?.layer?.renderer),(()=>a(e.notifySymbologyChange())),d),n((()=>this._layerView?.symbologySnappingSupported??!1),(t=>a(e.setSymbologySnappingSupported(t))),d),l((()=>this._layerView?.layer),["edits","apply-edits","graphic-update"],(()=>e.notifySymbologyChange()))]);break}}this.addHandles([i(e)]),a(e.setup({layer:this._layer,spatialReference:this.spatialReference,configuration:this.configuration},null)),this._updatingHandles.add((()=>this._updateTilesParameters),(()=>a(e.updateTiles(this._updateTilesParameters,null))),d),this.addHandles([n((()=>this.configuration),(t=>a(e.configure(t,null))),u),n((()=>this._layer.historicMoment),(t=>a(e.setHistoricMoment(t))),p),n((()=>this._outFields),(t=>a(e.updateOutFields(t))),d),n((()=>this._isSuspended),(t=>a(e.setSuspended(t))),p)]),null!=t&&this.addHandles(n((()=>j.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES),(r=>{r&&!this._debug?(this._debug=new b({view:t,handle:e}),this.addHandles(i(this._debug),"debug")):!r&&this._debug&&this.removeHandles("debug")}),d)),this.addHandles([this.layerSource.layer.on("edits",(t=>a(e.handleEdits(t,null)))),this.layerSource.layer.on("apply-edits",(e=>this._updatingHandles.addPromise(e.result)))])}destroy(){this._updatingHandles.destroy(),this._tilesOfInterest.destroy()}refresh(){this._workerHandle?.refresh(null)}async fetchCandidates(e,t){const{coordinateHelper:r,point:i}=e;this._tilesOfInterest.pointOfInterest=r.arrayToPoint(i);const s=this._memoizedMakeGetGroundElevation(this.view,r.spatialReference);return(await this._workerHandle.fetchCandidates({...e},t)).candidates.map((e=>w(e,s)))}getDebugInfo(e){return this._workerHandle.getDebugInfo(e)}_getOrLoadWhereFields(e,t){const{_whereModule:i}=this;if(!this._loadWhereModuleTask&&!i){const e=r((async()=>{const e=await import("../../../../core/sql/WhereClause.js");return this._whereModule=e.default,this._whereModule}));return this._loadWhereModuleTask=e,this._updatingHandles.addPromise(e.promise),[]}if(!i)return[];try{return i.create(e,{fieldsIndex:t}).fieldNames}catch(s){return[]}}};e([h({constructOnly:!0})],F.prototype,"spatialReference",void 0),e([h({constructOnly:!0})],F.prototype,"layerSource",void 0),e([h({constructOnly:!0})],F.prototype,"view",void 0),e([h()],F.prototype,"_tilesOfInterest",void 0),e([h({readOnly:!0})],F.prototype,"_updateTilesParameters",null),e([h()],F.prototype,"_layerView",null),e([h()],F.prototype,"_isSuspended",null),e([h({readOnly:!0})],F.prototype,"updating",null),e([h()],F.prototype,"_outFields",null),e([h({readOnly:!0})],F.prototype,"configuration",null),e([h({readOnly:!0})],F.prototype,"availability",null),e([h()],F.prototype,"_loadWhereModuleTask",void 0),e([h()],F.prototype,"_whereModule",void 0),F=e([c("esri.views.interactive.snapping.featureSources.FeatureServiceSnappingSource")],F);export{F as FeatureServiceSnappingSource};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{destroyHandle as i}from"../../../../core/handleUtils.js";import{memoize as s}from"../../../../core/memoize.js";import{throwIfAborted as o,ignoreAbortErrors as a}from"../../../../core/promiseUtils.js";import{watch as n,on as l,initial as d,sync as u,syncAndInitial as p}from"../../../../core/reactiveUtils.js";import{sqlAnd as h}from"../../../../core/sql.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as y}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as m}from"../../../../layers/support/layerUtils.js";import{elevationContextAffectsAlignment as _}from"../../../../support/elevationInfoUtils.js";import{FeatureServiceTiles2D as g}from"../../../2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js";import{FeatureServiceTiles3D as w}from"../../../3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js";import{isUtilityNetworkWebMap as S}from"../snappingUtils.js";import{convertSnappingCandidate as v,makeGetGroundElevation as b}from"./queryEngineUtils.js";import{WorkerTileTreeDebugger as I}from"./WorkerTileTreeDebugger.js";import{FeatureServiceSnappingSourceWorkerHandle as H}from"./featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js";import{FeatureServiceTilesSimple as j}from"./featureServiceSource/FeatureServiceTilesSimple.js";import F from"../../../support/debugFlags.js";let O=class extends t{get _updateTilesParameters(){return{tiles:this._tilesOfInterest.tiles,tileInfo:this._tilesOfInterest.tileInfo,tileSize:this._tilesOfInterest.tileSize}}get _layerView(){return this.view?.allLayerViews.find((e=>e.layer===this._layer))}get _isSuspended(){if(m(this._layer)){if(!this.layerSource.sublayerSources.some((e=>e.enabled&&e.layer.visible)))return!0}return!!this.view&&(!1!==this._layerView?.suspended||!this.layerSource.enabled)}get updating(){return this._workerHandle?.updating||this._updatingHandles.updating}get _outFields(){const{view:e,_layerView:t,layerSource:r}=this,{layer:i}=r,{fieldsIndex:s,timeInfo:o,floorInfo:a,subtypeField:n}=i,l=t&&"filter"in t?t.filter:null,d=l?.where&&"1=1"!==l.where?this._getOrLoadWhereFields(l.where,s):[];if(l?.timeExtent&&o){const{startField:e,endField:t}=o,r=s.get(e)?.name??e,i=s.get(t)?.name??t;r&&d.push(r),i&&d.push(i)}if(e?.map&&S(e.map)&&e.map.utilityNetworks?.find((e=>e.isUtilityLayer(i)))){const e=i.fieldsIndex.get("assetGroup")?.name,t=i.fieldsIndex.get("assetType")?.name;e&&t&&(d.push(e),d.push(t))}if(i&&a?.floorField&&e?.floors?.length){const e=s.get(a.floorField)?.name??a.floorField;e&&d.push(e)}if(n){const e=s.get(n)?.name??n;e&&d.push(e)}return new Set(d)}get configuration(){const{view:e}=this,{apiKey:t,customParameters:r}=this._layer,i=null!=e?e.type:"2d",s=this._layer.createQuery();return this._layerView&&"effectiveDisplayFilter"in this._layerView&&(s.where=h(s.where,this._layerView.effectiveDisplayFilter?.where)),{filter:s,customParameters:t?{...r,token:t}:r,viewType:i}}get availability(){return this._workerHandle?.availability??0}get _layer(){return this.layerSource.layer}constructor(e){super(e),this._updatingHandles=new f,this._workerHandle=null,this._debug=null,this._memoizedMakeGetGroundElevation=s(b)}initialize(){let e;const t=this.view;if(null==t||t.destroyed)this._tilesOfInterest=new j({layer:this._layer}),e=this._workerHandle=new H;else switch(t.type){case"2d":this._tilesOfInterest=new g({view:t,layer:this._layer}),e=this._workerHandle=new H;break;case"3d":{const{resourceController:r}=t,i=this._layer;this._tilesOfInterest=new w({view:t}),e=this._workerHandle=new H({schedule:e=>r.immediate.schedule(e),hasZ:this._layer.hasZ&&(this._layer.returnZ??!0),elevationAlignPointsInFeatures:async(e,r)=>{const s=await t.whenLayerView(i);return o(r),s.elevationAlignPointsInFeatures(e,r)},queryForSymbologySnapping:async(e,r)=>{const s=await t.whenLayerView(i);return o(r),s.queryForSymbologySnapping(e,r)}}),this.addHandles([t.elevationProvider.on("elevation-change",(({context:t})=>{const{elevationInfo:r}=i;_(t,r)&&a(e.notifyElevationSourceChange())})),n((()=>i.elevationInfo),(()=>a(e.notifyElevationSourceChange())),d),n((()=>this._layerView?.layer?.renderer),(()=>a(e.notifySymbologyChange())),d),n((()=>this._layerView?.symbologySnappingSupported??!1),(t=>a(e.setSymbologySnappingSupported(t))),d),l((()=>this._layerView?.layer),["edits","apply-edits","graphic-update"],(()=>e.notifySymbologyChange()))]);break}}this.addHandles([i(e)]),a(e.setup({layer:this._layer,spatialReference:this.spatialReference,configuration:this.configuration},null)),this._updatingHandles.add((()=>this._updateTilesParameters),(()=>a(e.updateTiles(this._updateTilesParameters,null))),d),this.addHandles([n((()=>this.configuration),(t=>a(e.configure(t,null))),u),n((()=>this._layer.historicMoment),(t=>a(e.setHistoricMoment(t))),p),n((()=>this._outFields),(t=>a(e.updateOutFields(t))),d),n((()=>this._isSuspended),(t=>a(e.setSuspended(t))),p)]),null!=t&&this.addHandles(n((()=>F.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES),(r=>{r&&!this._debug?(this._debug=new I({view:t,handle:e}),this.addHandles(i(this._debug),"debug")):!r&&this._debug&&this.removeHandles("debug")}),d)),this.addHandles([this.layerSource.layer.on("edits",(t=>a(e.handleEdits(t,null)))),this.layerSource.layer.on("apply-edits",(e=>this._updatingHandles.addPromise(e.result)))])}destroy(){this._updatingHandles.destroy(),this._tilesOfInterest.destroy()}refresh(){this._workerHandle?.refresh(null)}async fetchCandidates(e,t){const{coordinateHelper:r,point:i}=e;this._tilesOfInterest.pointOfInterest=r.arrayToPoint(i);const s=this._memoizedMakeGetGroundElevation(this.view,r.spatialReference);return(await this._workerHandle.fetchCandidates({...e},t)).candidates.map((e=>v(e,s)))}getDebugInfo(e){return this._workerHandle.getDebugInfo(e)}_getOrLoadWhereFields(e,t){const{_whereModule:i}=this;if(!this._loadWhereModuleTask&&!i){const e=r((async()=>{const e=await import("../../../../core/sql/WhereClause.js");return this._whereModule=e.default,this._whereModule}));return this._loadWhereModuleTask=e,this._updatingHandles.addPromise(e.promise),[]}if(!i)return[];try{return i.create(e,{fieldsIndex:t}).fieldNames}catch(s){return[]}}};e([c({constructOnly:!0})],O.prototype,"spatialReference",void 0),e([c({constructOnly:!0})],O.prototype,"layerSource",void 0),e([c({constructOnly:!0})],O.prototype,"view",void 0),e([c()],O.prototype,"_tilesOfInterest",void 0),e([c({readOnly:!0})],O.prototype,"_updateTilesParameters",null),e([c()],O.prototype,"_layerView",null),e([c()],O.prototype,"_isSuspended",null),e([c({readOnly:!0})],O.prototype,"updating",null),e([c()],O.prototype,"_outFields",null),e([c({readOnly:!0})],O.prototype,"configuration",null),e([c({readOnly:!0})],O.prototype,"availability",null),e([c()],O.prototype,"_loadWhereModuleTask",void 0),e([c()],O.prototype,"_whereModule",void 0),O=e([y("esri.views.interactive.snapping.featureSources.FeatureServiceSnappingSource")],O);export{O as FeatureServiceSnappingSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{watch as e,syncAndInitial as t}from"../../../core/reactiveUtils.js";import{intersection as n}from"../../../core/SetUtils.js";import{sqlAnd as r}from"../../../core/sql.js";import{mergeTimeExtents as o}from"../../../core/timeUtils.js";import{s as i}from"../../../chunks/vec32.js";import{makeDehydratedPoint as s}from"../../../layers/graphics/dehydratedPoint.js";import a from"../../../rest/support/Query.js";import{ViewEventPriorities as c}from"../../input/InputManager.js";import{snappingKeys as l}from"../keybindings.js";import{fromAnyMapPoint as p}from"../sketch/normalizedPoint.js";import{isWebMap as u}from"../../../webmap/utils.js";const m=Symbol("grid-placement-graphic");function d(e,t){const n=e.length===t.length&&e[0]===t[0]&&e[1]===t[1];switch(e.length){case 2:return n;case 3:return n&&e[2]===t[2];case 4:return n&&e[2]===t[2]&&e[3]===t[3]}return!1}function g(e,t){const n=e.x-t.x,r=e.y-t.y;return n*n+r*r}function f(e,t){return Math.sqrt(g(e,t))}function E(e,t){t.sort(((t,n)=>i(t.targetPoint,e)-i(n.targetPoint,e)))}var y;function h({point:e,distance:t,returnEdge:n,vertexMode:i,coordinateHelper:{spatialReference:c},filter:l},p,u){return u=null!=u?u.clone():new a({where:"1=1"}),l&&(u.geometry=l.geometry,u.distance=l.distance,u.spatialRelationship=l.spatialRelationship,u.where=r(u.where,l.where),u.timeExtent=o(u.timeExtent,l.timeExtent),u.objectIds=w(u.objectIds,l.objectIds)),{point:s(e[0],e[1],e[2],c.toJSON()),mode:p,distance:t,returnEdge:n,vertexMode:i,query:u.toJSON()}}function w(e,t){return e||t?t?e?Array.from(n(new Set(e),new Set(t))):t:e:null}function j(e,t,n){return{left:p(e.leftVertex.pos,t,n),right:p(e.rightVertex.pos,t,n)}}function R(e){return e.createQuery()}!function(e){e[e.TARGET=0]="TARGET",e[e.REFERENCE=1]="REFERENCE",e[e.REFERENCE_EXTENSION=2]="REFERENCE_EXTENSION"}(y||(y={}));const N=Symbol("snapping-toggle");function b(n,r=()=>{}){const o=e((()=>({view:n.view,snappingOptions:n.snappingOptions})),(({view:e,snappingOptions:t})=>{if(n.removeHandles(N),!e||!t)return;const o=c.TOOL,i=[e.on("key-down",(e=>{e.key!==l.toggle||e.repeat||(t.enabledToggled=!0,r())}),o),e.on("key-up",(e=>{e.key===l.toggle&&(t.enabledToggled=!1,r())}),o),e.on("pointer-move",(e=>{const n=e.native.ctrlKey;t.enabledToggled!==n&&(t.enabledToggled=n,r())}),o)];n.addHandles(i,N)}),t);n.addHandles(o)}function v(e){return u(e)&&"utilityNetworks"in e&&!!e.utilityNetworks?.length}export{y as LineSegmentHintType,j as editEdgeToSnappingEdge,m as gridPlacementGraphicSymbol,v as isUtilityNetworkWebMap,R as makeFilter,h as makeSnappingQuery,d as objectEqual,f as screenDistance,b as setupSnappingToggleHandles,E as sortCandidatesInPlace,g as squaredScreenDistance};
5
+ import{watch as e,syncAndInitial as t}from"../../../core/reactiveUtils.js";import{intersection as n}from"../../../core/SetUtils.js";import{sqlAnd as r}from"../../../core/sql.js";import{mergeTimeExtents as o}from"../../../core/timeUtils.js";import{s as i}from"../../../chunks/vec32.js";import{makeDehydratedPoint as s}from"../../../layers/graphics/dehydratedPoint.js";import a from"../../../rest/support/Query.js";import{ViewEventPriorities as l}from"../../input/InputManager.js";import{snappingKeys as p}from"../keybindings.js";import{fromAnyMapPoint as c}from"../sketch/normalizedPoint.js";import{isWebMap as m}from"../../../webmap/utils.js";const d=Symbol("grid-placement-graphic");function g(e,t){const n=e.length===t.length&&e[0]===t[0]&&e[1]===t[1];switch(e.length){case 2:return n;case 3:return n&&e[2]===t[2];case 4:return n&&e[2]===t[2]&&e[3]===t[3]}return!1}function u(e,t){const n=e.x-t.x,r=e.y-t.y;return n*n+r*r}function f(e,t){return Math.sqrt(u(e,t))}function E(e,t){t.sort(((t,n)=>i(t.targetPoint,e)-i(n.targetPoint,e)))}var h;function y({point:e,distance:t,returnEdge:n,vertexMode:i,coordinateHelper:{spatialReference:l},filter:p},c,m){return m=null!=m?m.clone():new a({where:"1=1"}),p&&(m.geometry=p.geometry,m.distance=p.distance,m.spatialRelationship=p.spatialRelationship,m.where=r(m.where,p.where),m.timeExtent=o(m.timeExtent,p.timeExtent),m.objectIds=w(m.objectIds,p.objectIds)),{point:s(e[0],e[1],e[2],l.toJSON()),mode:c,distance:t,returnEdge:n,vertexMode:i,query:m.toJSON()}}function w(e,t){return e||t?t?e?Array.from(n(new Set(e),new Set(t))):t:e:null}function j(e,t,n){return{left:c(e.leftVertex.pos,t,n),right:c(e.rightVertex.pos,t,n)}}!function(e){e[e.TARGET=0]="TARGET",e[e.REFERENCE=1]="REFERENCE",e[e.REFERENCE_EXTENSION=2]="REFERENCE_EXTENSION"}(h||(h={}));const R=Symbol("snapping-toggle");function N(n,r=()=>{}){const o=e((()=>({view:n.view,snappingOptions:n.snappingOptions})),(({view:e,snappingOptions:t})=>{if(n.removeHandles(R),!e||!t)return;const o=l.TOOL,i=[e.on("key-down",(e=>{e.key!==p.toggle||e.repeat||(t.enabledToggled=!0,r())}),o),e.on("key-up",(e=>{e.key===p.toggle&&(t.enabledToggled=!1,r())}),o),e.on("pointer-move",(e=>{const n=e.native.ctrlKey;t.enabledToggled!==n&&(t.enabledToggled=n,r())}),o)];n.addHandles(i,R)}),t);n.addHandles(o)}function b(e){return m(e)&&"utilityNetworks"in e&&!!e.utilityNetworks?.length}export{h as LineSegmentHintType,j as editEdgeToSnappingEdge,d as gridPlacementGraphicSymbol,b as isUtilityNetworkWebMap,y as makeSnappingQuery,g as objectEqual,f as screenDistance,N as setupSnappingToggleHandles,E as sortCandidatesInPlace,u as squaredScreenDistance};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{TooltipContentDrawCircle as t}from"./TooltipContentDrawCircle.js";import{TooltipContentDrawMesh as o}from"./TooltipContentDrawMesh.js";import{TooltipContentDrawPoint as n}from"./TooltipContentDrawPoint.js";import{TooltipContentDrawPolygon as e}from"./TooltipContentDrawPolygon.js";import{TooltipContentDrawPolyline as r}from"./TooltipContentDrawPolyline.js";import{TooltipContentDrawRectangle as i}from"./TooltipContentDrawRectangle.js";import{TooltipContentExtentRotate as a}from"./TooltipContentExtentRotate.js";import{TooltipContentExtentScale as l}from"./TooltipContentExtentScale.js";import{TooltipContentMovePoint as p}from"./TooltipContentMovePoint.js";import{TooltipContentReshapeEdgeOffset as s}from"./TooltipContentReshapeEdgeOffset.js";import{TooltipContentSelectedVertex as c}from"./TooltipContentSelectedVertex.js";import{TooltipContentTransformMesh as f}from"./TooltipContentTransformMesh.js";import{TooltipContentTransformPoint as m}from"./TooltipContentTransformPoint.js";import{TooltipContentTranslate as w}from"./TooltipContentTranslate.js";import{TooltipContentTranslateVertex as T}from"./TooltipContentTranslateVertex.js";import{TooltipContentTranslateXY as u}from"./TooltipContentTranslateXY.js";import{TooltipContentTranslateZ as C}from"./TooltipContentTranslateZ.js";function j(j,d){if(null==d)return null;const x=document.createElement("div");switch(d.type){case"draw-point":return new n({tooltip:j,info:d,container:x});case"draw-polygon":return new e({tooltip:j,info:d,container:x});case"draw-polyline":return new r({tooltip:j,info:d,container:x});case"draw-mesh":return new o({tooltip:j,info:d,container:x});case"draw-rectangle":return new i({tooltip:j,info:d,container:x});case"draw-circle":return new t({tooltip:j,info:d,container:x});case"extent-rotate":return new a({tooltip:j,info:d,container:x});case"extent-scale":return new l({tooltip:j,info:d,container:x});case"move-point":return new p({tooltip:j,info:d,container:x});case"selected-vertex":return new c({tooltip:j,info:d,container:x});case"transform-point":return new m({tooltip:j,info:d,container:x});case"transform-mesh":return new f({tooltip:j,info:d,container:x});case"translate":return new w({tooltip:j,info:d,container:x});case"translate-vertex":return new T({tooltip:j,info:d,container:x});case"translate-z":return new C({tooltip:j,info:d,container:x});case"translate-xy":return new u({tooltip:j,info:d,container:x});case"reshape-edge-offset":return new s({tooltip:j,info:d,container:x})}}export{j as tooltipContentFactory};
5
+ import{TooltipContentDrawCircle as t}from"./TooltipContentDrawCircle.js";import{TooltipContentDrawMesh as o}from"./TooltipContentDrawMesh.js";import{TooltipContentDrawPoint as n}from"./TooltipContentDrawPoint.js";import{TooltipContentDrawPolygon as e}from"./TooltipContentDrawPolygon.js";import{TooltipContentDrawPolyline as r}from"./TooltipContentDrawPolyline.js";import{TooltipContentDrawRectangle as i}from"./TooltipContentDrawRectangle.js";import{TooltipContentExtentRotate as a}from"./TooltipContentExtentRotate.js";import{TooltipContentExtentScale as l}from"./TooltipContentExtentScale.js";import{TooltipContentMovePoint as p}from"./TooltipContentMovePoint.js";import{TooltipContentReshapeEdgeOffset as s}from"./TooltipContentReshapeEdgeOffset.js";import{TooltipContentSelectedVertex as c}from"./TooltipContentSelectedVertex.js";import{TooltipContentTransformMesh as f}from"./TooltipContentTransformMesh.js";import{TooltipContentTransformPoint as m}from"./TooltipContentTransformPoint.js";import{TooltipContentTranslate as w}from"./TooltipContentTranslate.js";import{TooltipContentTranslateVertex as u}from"./TooltipContentTranslateVertex.js";import{TooltipContentTranslateXY as T}from"./TooltipContentTranslateXY.js";import{TooltipContentTranslateZ as C}from"./TooltipContentTranslateZ.js";function j(j,d){if(null==d)return null;const x=document.createElement("div");switch(d.type){case"draw-point":case"draw-multipoint":return new n({tooltip:j,info:d,container:x});case"draw-polygon":return new e({tooltip:j,info:d,container:x});case"draw-polyline":return new r({tooltip:j,info:d,container:x});case"draw-mesh":return new o({tooltip:j,info:d,container:x});case"draw-rectangle":return new i({tooltip:j,info:d,container:x});case"draw-circle":return new t({tooltip:j,info:d,container:x});case"extent-rotate":return new a({tooltip:j,info:d,container:x});case"extent-scale":return new l({tooltip:j,info:d,container:x});case"move-point":return new p({tooltip:j,info:d,container:x});case"selected-vertex":return new c({tooltip:j,info:d,container:x});case"transform-point":return new m({tooltip:j,info:d,container:x});case"transform-mesh":return new f({tooltip:j,info:d,container:x});case"translate":return new w({tooltip:j,info:d,container:x});case"translate-vertex":return new u({tooltip:j,info:d,container:x});case"translate-z":return new C({tooltip:j,info:d,container:x});case"translate-xy":return new T({tooltip:j,info:d,container:x});case"reshape-edge-offset":return new s({tooltip:j,info:d,container:x})}}export{j as tooltipContentFactory};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../../../chunks/tslib.es6.js";import{zeroSquareMeters as r}from"../../../../core/quantityUtils.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{SketchTooltipInfo as s}from"./SketchTooltipInfo.js";let i=class extends s{constructor(o){super(o),this.type="draw-circle",this.radius=null,this.xSize=null,this.ySize=null,this.area=r}get allFields(){return[]}};o([t()],i.prototype,"type",void 0),o([t()],i.prototype,"radius",void 0),o([t()],i.prototype,"xSize",void 0),o([t()],i.prototype,"ySize",void 0),o([t()],i.prototype,"area",void 0),o([t()],i.prototype,"allFields",null),i=o([e("esri.views.interactive.tooltip.infos.DrawCircleTooltipInfo")],i);export{i as DrawCircleTooltipInfo};
5
+ import{_ as o}from"../../../../chunks/tslib.es6.js";import{zeroSquareMeters as r}from"../../../../core/quantityUtils.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{SketchTooltipInfo as s}from"./SketchTooltipInfo.js";let i=class extends s{constructor(o){super(o),this.type="draw-circle",this.radius=null,this.xSize=null,this.ySize=null,this.area=r}get allFields(){return[]}};o([t()],i.prototype,"type",void 0),o([t()],i.prototype,"radius",void 0),o([t()],i.prototype,"xSize",void 0),o([t()],i.prototype,"ySize",void 0),o([t()],i.prototype,"area",void 0),o([t()],i.prototype,"helpMessage",void 0),o([t()],i.prototype,"allFields",null),i=o([e("esri.views.interactive.tooltip.infos.DrawCircleTooltipInfo")],i);export{i as DrawCircleTooltipInfo};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{_ as o}from"../../../../chunks/tslib.es6.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{SketchTooltipInfo as s}from"./SketchTooltipInfo.js";import{TooltipInfoWithCoordinates as e}from"./TooltipInfoWithCoordinates.js";let i=class extends(e(s)){constructor(o){super(o),this.type="draw-multipoint"}get allFields(){return[this.longitude,this.latitude,this.x,this.y,this.elevation]}};o([t()],i.prototype,"helpMessage",void 0),o([t()],i.prototype,"allFields",null),i=o([r("esri.views.interactive.tooltip.infos.DrawMultipointTooltipInfo")],i);export{i as DrawMultipointTooltipInfo};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../../../chunks/tslib.es6.js";import{zeroMeters as t,zeroSquareMeters as r}from"../../../../core/quantityUtils.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{SketchTooltipInfo as i}from"./SketchTooltipInfo.js";let p=class extends i{constructor(o){super(o),this.type="draw-rectangle",this.xSize=t,this.ySize=t,this.area=r}get allFields(){return[]}};o([e()],p.prototype,"type",void 0),o([e()],p.prototype,"xSize",void 0),o([e()],p.prototype,"ySize",void 0),o([e()],p.prototype,"area",void 0),o([e()],p.prototype,"allFields",null),p=o([s("esri.views.interactive.tooltip.infos.DrawRectangleTooltipInfo")],p);export{p as DrawRectangleTooltipInfo};
5
+ import{_ as o}from"../../../../chunks/tslib.es6.js";import{zeroMeters as t,zeroSquareMeters as r}from"../../../../core/quantityUtils.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{SketchTooltipInfo as i}from"./SketchTooltipInfo.js";let p=class extends i{constructor(o){super(o),this.type="draw-rectangle",this.xSize=t,this.ySize=t,this.area=r}get allFields(){return[]}};o([e()],p.prototype,"type",void 0),o([e()],p.prototype,"xSize",void 0),o([e()],p.prototype,"ySize",void 0),o([e()],p.prototype,"area",void 0),o([e()],p.prototype,"helpMessage",void 0),o([e()],p.prototype,"allFields",null),p=o([s("esri.views.interactive.tooltip.infos.DrawRectangleTooltipInfo")],p);export{p as DrawRectangleTooltipInfo};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../core/has.js";import t from"../../core/Logger.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{watch as i,syncAndInitial as s,on as l}from"../../core/reactiveUtils.js";import{sqlAnd as n}from"../../core/sql.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{systemIsSpatialFieldName as u}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as d}from"../../layers/support/displayFilterUtils.js";import p from"../../layers/support/FeatureEffect.js";import f from"../../layers/support/FeatureFilter.js";import{getSignedInUser as y}from"../../layers/support/featureLayerUtils.js";import{fixFields as h,unpackFieldNames as m,collectLabelingFields as c,collectElevationFields as F,collectFilterFields as g,collectFeatureReductionFields as I,collectOrderByInfos as b,collectFields as w,collectTrackInfoFields as E,collectDisplayFilterFields as v,collectField as x,featureHasFields as R}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as _}from"../../layers/support/floorFilterUtils.js";import q from"../../rest/support/Query.js";import{loadArcade as j}from"../../support/arcadeOnDemand.js";import{getFetchPopupTemplate as C,getRequiredFields as O}from"./support/popupUtils.js";import{WhereClauseVisitor as P}from"./support/WhereClauseVisitor.js";const k=k=>{let U=class extends k{constructor(...e){super(...e),this._updatingRequiredPromise=null,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([i((()=>{const e=this.layer;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode]}),(()=>this._handleChange()),s),l((()=>this.view?.floors),"change",(()=>this._handleChange())),l((()=>this.layer.displayFilterInfo?.filters),"change",(()=>this._handleChange())),l((()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null),"change",(()=>this._handleChange()))])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:r}=this;return"outFields"in e&&e.outFields?h(t,[...m(t,e.outFields),...r]):h(t,r)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return this.displayFilterEnabled&&e.displayFilterInfo?d(e.displayFilterInfo,this.view):null}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?y(this.layer.url):Promise.resolve(null)}highlight(e,t){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new q(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=n(t.where,_(this))),"2d"===this.view.type&&this.displayFilterEnabled&&(t.where=n(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new q(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(e,t){return this._fetchPopupFeatures(e,t)}_loadArcadeModules(e){return e.expressionInfos?.length||Array.isArray(e.content)&&e.content.some((e=>"expression"===e.type))?j():Promise.resolve()}_handleChange(){const e=Promise.all([this._updateRequiredFields(),this._updateClientWhereClauseRequirements()]).then((()=>{}));return this._set("_updatingRequiredPromise",e),e.then((()=>{this._updatingRequiredPromise===e&&this._set("_updatingRequiredPromise",null)})),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,r=new P(e.fieldsIndex);if(r.visitFilter(this.filter),"featureReduction"in e&&r.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&r.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&r.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(r.visitFilter(this.featureEffect?.filter),r.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo),"featureReduction"in e&&r.visitFeatureReduction(e.featureReduction)),"subtype-group"===e.type)for(const t of e.sublayers)r.visitLabelingInfo(t.labelsVisible,t.labelingInfo);try{const e=await r.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(i){t.getLogger(this).error(i)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:r,layer:{fieldsIndex:i,objectIdField:s}}=this,l="renderer"in r&&r.renderer,n="orderBy"in r&&r.orderBy,o="featureReduction"in r?r.featureReduction:null,a=new Set,d=[l?l.collectRequiredFields(a,i):null,c(a,r),e&&"elevationInfo"in r?F(a,r):null,null!=this.filter?g(a,r,this.filter):null,e||null==this.featureEffect?null:g(a,r,this.featureEffect.filter),!e&&o?I(a,r,o):null,!e&&n?b(a,r,n):null];if("timeInfo"in r&&r.timeInfo&&this.timeExtent&&w(a,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),"timeInfo"in r&&r.timeInfo&&"trackInfo"in r&&r.trackInfo){const{trackInfo:e}=r;w(a,r.fieldsIndex,[r.timeInfo.trackIdField]),"feature"!==r.type&&"startTimeField"!==e.timeField||w(a,r.fieldsIndex,[r.timeInfo.startField]),"endTimeField"===e.timeField&&w(a,r.fieldsIndex,[r.timeInfo.endField]),await E(a,r)}if("floorInfo"in r&&r.floorInfo&&w(a,r.fieldsIndex,[r.floorInfo.floorField]),!e&&this.displayFilterEnabled&&d.push(v(a,r,r.displayFilterInfo)),"feature"===r.type&&e&&null!=r.infoFor3D&&(null==r.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),w(a,r.fieldsIndex,[r.globalIdField])),"subtype-group"===r.type){x(a,i,r.subtypeField);const e=r.sublayers.map((e=>Promise.all([e.renderer?.collectRequiredFields(a,i),c(a,e)])));d.push(Promise.all(e))}if("catalog-footprint"===r.type&&r.parent){const e=r.parent;w(a,i,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===r.type&&"link-chart"===r.parentCompositeLayer.type&&x(a,i,u);const p=await Promise.allSettled(d);x(a,i,s),e&&"displayField"in r&&r.displayField&&x(a,i,r.displayField);for(const u of p)"rejected"===u.status&&t.getLogger(this).error(u.reason);const f=Array.from(a).sort();this._set("requiredFields",f)}_popupFeatureHasRequiredFields(e,t){return R(t,e)}async _fetchPopupFeatures(e,t){const i=new Array(e.length),s=new Map,l=await this._createPopupQuery(e.map((e=>e.origin?.layer??e.layer)),t);for(let n=0;n<e.length;n++){const o=e[n];if(o.isAggregate){i[n]=o;continue}const a=o.origin?.layer??o.layer;if(!a||!("popupEnabled"in a)||!a.popupEnabled)continue;const u=m(this.layer.fieldsIndex,l.outFields),d=C(a,t);if(null==d)continue;const p=await this._loadArcadeModules(d);r(t);p&&p.arcadeUtils.hasGeometryOperations(d)||!this._popupFeatureHasRequiredFields(o,u)?s.set(o.getObjectId(),{graphic:o,index:n}):i[n]=o}if("stream"===this.layer.type||"parquet"===this.layer.type||0===s.size)return i.filter(Boolean);l.objectIds=Array.from(s.keys());try{const e=await this.layer.queryFeatures(l,t);for(const t of e.features){const{graphic:{geometry:e,origin:r},index:l}=s.get(t.getObjectId());t.geometry||=e,t.origin=r,i[l]=t}}catch{}return i.filter(Boolean)}async _createPopupQuery(e,t){const i=this.layer.createQuery(),s=new Set;let l=!1;const n=e??[this.layer];for(const o of n){if(!("popupEnabled"in o))continue;const e=C(o,t);if(null==e)continue;const i=await this._loadArcadeModules(e);r(t);const n=i&&i.arcadeUtils.hasGeometryOperations(e);l=!("point"!==this.layer.geometryType&&!n);const a=await O(this.layer,e);r(t);for(const t of a)s.add(t)}if(i.returnGeometry=l,i.returnZ=l,i.returnM=l,i.outFields=Array.from(s),i.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo){const e=_(this);null!=e&&(i.where=i.where?`(${i.where}) AND (${e})`:e)}return i}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};return e([o()],U.prototype,"_updatingRequiredPromise",void 0),e([o({readOnly:!0})],U.prototype,"availableFields",null),e([o({readOnly:!0})],U.prototype,"displayFilterEnabled",null),e([o({readOnly:!0})],U.prototype,"effectiveDisplayFilter",null),e([o({type:p})],U.prototype,"featureEffect",null),e([o({type:f})],U.prototype,"filter",void 0),e([o()],U.prototype,"layer",void 0),e([o({type:Number})],U.prototype,"maximumNumberOfFeatures",null),e([o({readOnly:!0,type:Boolean})],U.prototype,"maximumNumberOfFeaturesExceeded",null),e([o()],U.prototype,"requiresCurrentUser",void 0),e([o({readOnly:!0})],U.prototype,"requiredFields",void 0),e([o({readOnly:!0})],U.prototype,"signedInUser",null),e([o()],U.prototype,"suspended",void 0),e([o()],U.prototype,"view",void 0),U=e([a("esri.views.layers.FeatureLayerView")],U),U};export{k as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../core/has.js";import t from"../../core/Logger.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{watch as i,syncAndInitial as s,on as l}from"../../core/reactiveUtils.js";import{sqlAnd as n}from"../../core/sql.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{systemIsSpatialFieldName as u}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as p}from"../../layers/support/displayFilterUtils.js";import d from"../../layers/support/FeatureEffect.js";import f from"../../layers/support/FeatureFilter.js";import{getSignedInUser as y}from"../../layers/support/featureLayerUtils.js";import{fixFields as h,unpackFieldNames as m,collectLabelingFields as c,collectElevationFields as F,collectFilterFields as g,collectFeatureReductionFields as I,collectOrderByInfos as b,collectFields as w,collectTrackInfoFields as E,collectDisplayFilterFields as v,collectField as x,featureHasFields as q}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as R}from"../../layers/support/floorFilterUtils.js";import _ from"../../rest/support/Query.js";import{loadArcade as j}from"../../support/arcadeOnDemand.js";import{getRequiredFields as C,getFetchPopupTemplate as O}from"./support/popupUtils.js";import{WhereClauseVisitor as P}from"./support/WhereClauseVisitor.js";const k=k=>{let U=class extends k{constructor(...e){super(...e),this._updatingRequiredPromise=null,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([i((()=>{const e=this.layer;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode,"parquet"===e?.type&&e.popupTemplate]}),(()=>this._handleChange()),s),l((()=>this.view?.floors),"change",(()=>this._handleChange())),l((()=>this.layer.displayFilterInfo?.filters),"change",(()=>this._handleChange())),l((()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null),"change",(()=>this._handleChange()))])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:r}=this;return"outFields"in e&&e.outFields?h(t,[...m(t,e.outFields),...r]):h(t,r)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return this.displayFilterEnabled&&e.displayFilterInfo?p(e.displayFilterInfo,this.view):null}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?y(this.layer.url):Promise.resolve(null)}highlight(e,t){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new _(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=n(t.where,R(this))),"2d"===this.view.type&&this.displayFilterEnabled&&(t.where=n(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new _(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(e,t){return this._fetchPopupFeatures(e,t)}_loadArcadeModules(e){return e.expressionInfos?.length||Array.isArray(e.content)&&e.content.some((e=>"expression"===e.type))?j():Promise.resolve()}_handleChange(){const e=Promise.all([this._updateRequiredFields(),this._updateClientWhereClauseRequirements()]).then((()=>{}));return this._set("_updatingRequiredPromise",e),e.then((()=>{this._updatingRequiredPromise===e&&this._set("_updatingRequiredPromise",null)})),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,r=new P(e.fieldsIndex);if(r.visitFilter(this.filter),"featureReduction"in e&&r.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&r.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&r.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(r.visitFilter(this.featureEffect?.filter),r.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo),"featureReduction"in e&&r.visitFeatureReduction(e.featureReduction)),"subtype-group"===e.type)for(const t of e.sublayers)r.visitLabelingInfo(t.labelsVisible,t.labelingInfo);try{const e=await r.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(i){t.getLogger(this).error(i)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:r,layer:{fieldsIndex:i,objectIdField:s}}=this,l="renderer"in r&&r.renderer,n="orderBy"in r&&r.orderBy,o="featureReduction"in r?r.featureReduction:null,a=new Set,p=[l?l.collectRequiredFields(a,i):null,c(a,r),e&&"elevationInfo"in r?F(a,r):null,null!=this.filter?g(a,r,this.filter):null,e||null==this.featureEffect?null:g(a,r,this.featureEffect.filter),!e&&o?I(a,r,o):null,!e&&n?b(a,r,n):null];if("timeInfo"in r&&r.timeInfo&&this.timeExtent&&w(a,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),"timeInfo"in r&&r.timeInfo&&"trackInfo"in r&&r.trackInfo){const{trackInfo:e}=r;w(a,r.fieldsIndex,[r.timeInfo.trackIdField]),"feature"!==r.type&&"startTimeField"!==e.timeField||w(a,r.fieldsIndex,[r.timeInfo.startField]),"endTimeField"===e.timeField&&w(a,r.fieldsIndex,[r.timeInfo.endField]),await E(a,r)}if("floorInfo"in r&&r.floorInfo&&w(a,r.fieldsIndex,[r.floorInfo.floorField]),!e&&this.displayFilterEnabled&&p.push(v(a,r,r.displayFilterInfo)),"feature"===r.type&&e&&null!=r.infoFor3D&&(null==r.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),w(a,r.fieldsIndex,[r.globalIdField])),"subtype-group"===r.type){x(a,i,r.subtypeField);const e=r.sublayers.map((e=>Promise.all([e.renderer?.collectRequiredFields(a,i),c(a,e)])));p.push(Promise.all(e))}if("catalog-footprint"===r.type&&r.parent){const e=r.parent;w(a,i,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===r.type&&"link-chart"===r.parentCompositeLayer.type&&x(a,i,u),"parquet"===r.type&&p.push(C(r,r.popupTemplate).then((e=>{for(const t of e)a.add(t)})));const d=await Promise.allSettled(p);x(a,i,s),e&&"displayField"in r&&r.displayField&&x(a,i,r.displayField);for(const u of d)"rejected"===u.status&&t.getLogger(this).error(u.reason);const f=Array.from(a).sort();this._set("requiredFields",f)}_popupFeatureHasRequiredFields(e,t){return q(t,e)}async _fetchPopupFeatures(e,t){const i=new Array(e.length),s=new Map,l=await this._createPopupQuery(e.map((e=>e.origin?.layer??e.layer)),t);for(let n=0;n<e.length;n++){const o=e[n];if(o.isAggregate){i[n]=o;continue}const a=o.origin?.layer??o.layer;if(!a||!("popupEnabled"in a)||!a.popupEnabled)continue;const u=m(this.layer.fieldsIndex,l.outFields),p=O(a,t);if(null==p)continue;const d=await this._loadArcadeModules(p);r(t);d&&d.arcadeUtils.hasGeometryOperations(p)||!this._popupFeatureHasRequiredFields(o,u)?s.set(o.getObjectId(),{graphic:o,index:n}):i[n]=o}if("stream"===this.layer.type||"parquet"===this.layer.type||0===s.size)return i.filter(Boolean);l.objectIds=Array.from(s.keys());try{const e=await this.layer.queryFeatures(l,t);for(const t of e.features){const{graphic:{geometry:e,origin:r},index:l}=s.get(t.getObjectId());t.geometry||=e,t.origin=r,i[l]=t}}catch{}return i.filter(Boolean)}async _createPopupQuery(e,t){const i=this.layer.createQuery(),s=new Set;let l=!1;const n=e??[this.layer];for(const o of n){if(!("popupEnabled"in o))continue;const e=O(o,t);if(null==e)continue;const i=await this._loadArcadeModules(e);r(t);const n=i&&i.arcadeUtils.hasGeometryOperations(e);l=!("point"!==this.layer.geometryType&&!n);const a=await C(this.layer,e);r(t);for(const t of a)s.add(t)}if(i.returnGeometry=l,i.returnZ=l,i.returnM=l,i.outFields=Array.from(s),i.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo){const e=R(this);null!=e&&(i.where=i.where?`(${i.where}) AND (${e})`:e)}return i}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};return e([o()],U.prototype,"_updatingRequiredPromise",void 0),e([o({readOnly:!0})],U.prototype,"availableFields",null),e([o({readOnly:!0})],U.prototype,"displayFilterEnabled",null),e([o({readOnly:!0})],U.prototype,"effectiveDisplayFilter",null),e([o({type:d})],U.prototype,"featureEffect",null),e([o({type:f})],U.prototype,"filter",void 0),e([o()],U.prototype,"layer",void 0),e([o({type:Number})],U.prototype,"maximumNumberOfFeatures",null),e([o({readOnly:!0,type:Boolean})],U.prototype,"maximumNumberOfFeaturesExceeded",null),e([o()],U.prototype,"requiresCurrentUser",void 0),e([o({readOnly:!0})],U.prototype,"requiredFields",void 0),e([o({readOnly:!0})],U.prototype,"signedInUser",null),e([o()],U.prototype,"suspended",void 0),e([o()],U.prototype,"view",void 0),U=e([a("esri.views.layers.FeatureLayerView")],U),U};export{k as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import{MediaLayerInteractionOptions as o}from"../3d/layers/support/MediaLayerInteractionOptions.js";const s=s=>{let i=class extends s{constructor(...e){super(...e),this.layer=null,this.interactive=!1,this.interactionOptions=new o,this.selectedElement=null}highlight(e,t){throw new Error("missing implementation")}};return e([t()],i.prototype,"layer",void 0),e([t()],i.prototype,"interactive",void 0),e([t()],i.prototype,"interactionOptions",void 0),e([t()],i.prototype,"selectedElement",void 0),i=e([r("esri.views.layers.MediaLayerView")],i),i};export{s as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import{MediaLayerInteractionOptions as o}from"../3d/layers/support/MediaLayerInteractionOptions.js";const s=s=>{let i=class extends s{constructor(...e){super(...e),this.layer=null,this.interactive=!1,this.interactionOptions=new o,this.selectedElement=null}highlight(e,t){throw new Error("missing implementation")}};return e([t()],i.prototype,"layer",void 0),e([t()],i.prototype,"interactive",void 0),e([t({type:o})],i.prototype,"interactionOptions",void 0),e([t()],i.prototype,"selectedElement",void 0),i=e([r("esri.views.layers.MediaLayerView")],i),i};export{s as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../../intl.js";import{neverReached as i}from"../../core/compilerUtils.js";import{DomainValidationError as t}from"../../layers/support/domainUtils.js";import{NumericRangeValidationError as r,TypeValidationError as n}from"../../layers/support/fieldUtils.js";import{ReactiveGraphic as e}from"./ReactiveGraphic.js";import{MultiFeatureError as o,InputVisibilityCode as s}from"./inputs/support/inputUtils.js";import{getIntlOptionsForField as l}from"../support/dateUtils.js";import{InputValidationError as a,getRangeErrorMessage as I,shouldUseScientificNotation as _,scientificNumberFormatOptions as u,numberFormatOptions as E}from"../support/forms/formUtils.js";import{substitute as p}from"../../intl/substitute.js";const m=(i,t)=>null!=i&&i.input?.type===t;function N(i){return new e({original:i})}function O(i,e,s,m){const{dataType:N,minLength:O}=i,c=s?.validationErrors;if(!c||!e)return null;if(e===o.DIFFERENT_ERRORS)return c.invalidBatchFormType;if(e===a.CANNOT_BE_EMPTY)return c.cannotBeNull;if(e===t.VALUE_OUT_OF_RANGE||e===r.OUT_OF_RANGE){const{field:t,range:r}=i,n={type:"date",intlOptions:{timeZone:"date"===t.type&&m?m:void 0,...l(t)}},e=I(r,c);return p(e,r,{format:{max:"date"===N?n:null!=r.max&&_(r.max)?u:E,min:"date"===N?n:null!=r.min&&_(r.min)?u:E}})}return e===t.INVALID_CODED_VALUE?c.invalidCodedValue:e===n.INVALID_TYPE?c.invalidType:e===a.TOO_SHORT?p(c.tooShort,{min:O}):(a.TOO_LONG,null)}function c(t,r){const n=r?.validationErrors;if(!n)return null;let e=null;for(const o of t.invalidHiddenInputs)switch(o.visibilityCode){case s.HIDDEN_VISIBILITY_EXPRESSION_ALL:case s.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL:case s.HIDDEN_FIELD_DEFINITION:return n.nonVisibleError_changeValues;case s.HIDDEN_NO_DOMAIN_IN_COMMON:case s.HIDDEN_VISIBILITY_EXPRESSION_SOME:case s.HIDDEN_GROUP_VISIBILITY_EXPRESSION_SOME:case s.HIDDEN_NOT_IN_ALL_LAYERS:e=n.nonVisibleError_checkIndividualFeatures;break;case s.VISIBLE:continue;default:i(o.visibilityCode)}return e}export{N as createReactiveGraphic,c as getHiddenFieldsValidationErrorMessage,O as getVisibleFieldInputValidationErrorMessage,m as isElementTemplateWithInputType};
5
+ import"../../intl.js";import{neverReached as i}from"../../core/compilerUtils.js";import{DomainValidationError as t}from"../../layers/support/domainUtils.js";import{NumericRangeValidationError as r,TypeValidationError as e}from"../../layers/support/fieldUtils.js";import{ReactiveGraphic as n}from"./ReactiveGraphic.js";import{MultiFeatureError as o,InputVisibilityCode as s}from"./inputs/support/inputUtils.js";import{getIntlOptionsForField as l}from"../support/dateUtils.js";import{InputValidationError as a,getRangeErrorMessage as I,shouldUseScientificNotation as _,scientificNumberFormatOptions as u,numberFormatOptions as E}from"../support/forms/formUtils.js";import{substitute as p}from"../../intl/substitute.js";const m=(i,t)=>null!=i&&i.input?.type===t;function c(i){return new n({original:i})}function f(i,n,s,m){const{dataType:c,minLength:f}=i,N=s?.validationErrors;if(!N||!n)return null;if(n===o.DIFFERENT_ERRORS)return N.invalidBatchFormType;if(n===a.CANNOT_BE_EMPTY)return N.cannotBeNull;if(n===t.VALUE_OUT_OF_RANGE||n===r.OUT_OF_RANGE){const{field:t,range:r}=i,e={type:"date",intlOptions:{timeZone:"date"===t.type&&m?m:void 0,...l(t)}},n=I(r,N);return p(n,r,{format:{max:"date"===c?e:null!=r.max&&_(r.max)?u:E,min:"date"===c?e:null!=r.min&&_(r.min)?u:E}})}return n===t.INVALID_CODED_VALUE?N.invalidCodedValue:n===e.INVALID_TYPE?N.invalidType:n===a.TOO_SHORT?p(N.tooShort,{min:f}):(a.TOO_LONG,null)}function N(t,r,e){const n=e?.validationErrors;if(!n)return null;let o=null;for(const l of t.invalidHiddenInputs)switch(l.effectiveVisibilityCode){case s.HIDDEN_VISIBILITY_EXPRESSION_ALL:case s.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL:case s.HIDDEN_FIELD_DEFINITION:return"single"===r?n.nonVisibleError_changeValues:n.nonVisibleError_checkIndividualFeatures;case s.HIDDEN_NO_DOMAIN_IN_COMMON:case s.HIDDEN_VISIBILITY_EXPRESSION_SOME:case s.HIDDEN_GROUP_VISIBILITY_EXPRESSION_SOME:case s.HIDDEN_NOT_IN_ALL_LAYERS:o=n.nonVisibleError_checkIndividualFeatures;break;case s.VISIBLE:continue;default:i(l.effectiveVisibilityCode)}return o}export{c as createReactiveGraphic,N as getHiddenFieldsValidationErrorMessage,f as getVisibleFieldInputValidationErrorMessage,m as isElementTemplateWithInputType};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import r from"../../../core/Error.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{whenOrAbort as a}from"../../../core/promiseUtils.js";import i from"../../../core/ReactiveMap.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{DateOnly as u}from"../../../core/sql/DateOnly.js";import{TimeOnly as c}from"../../../core/sql/TimeOnly.js";import{makeUseId as p}from"../inputs/support/inputUtils.js";import{isGroupElementTemplate as d,isFieldElementTemplate as f}from"../templates/support/templateUtils.js";let m=null;const h="esri.widgets.BatchAttributeForm.expressions.ExpressionsManager",g=()=>s.getLogger(h);let y=class extends t{constructor(e){super(e),this.calculating=!1,this.arcadeContext=null,this._abortController=new AbortController,this.layerExpressionsModelMap=new Map,this.evaluatedExpressions=new i,this.expressionEvaluationFailed=!1}abort(){this._abortController.abort()}async runAllExpressions(e,t=!1){this.calculating=!0;try{const r=[];for(const s of e){const e=this.layerExpressionsModelMap.get(s.layer);if(!e||0===e.components.length)continue;const o=new Set;r.push(this.evaluateAffectedComponents(e.components,s,e,t,o))}await a(Promise.all(r),this._abortController)}catch(r){g().error(r),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}async valueChanged(e,t,r=!0){try{this.calculating=!0;const s=t.map((t=>this.evaluateValueChangedForFeature(e,t,r)));await Promise.all(s)}catch(s){g().error(s),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}async evaluateValueChangedForFeature(e,t,r){if(this._abortController.signal.aborted)return;const s=this.layerExpressionsModelMap.get(t.layer);if(!s||0===s.components.length)return;const o=new Set,a=new Set([e]),i=new Set;for(;a.size>0;){const[e]=a;if(a.delete(e),o.has(e))continue;o.add(e);const n=s.fieldReferencesMap.get(e.toLowerCase());if(!n)continue;for(const t of n)i.has(t)&&n.delete(t);if(0===n.size)continue;const l=new Set;await this.evaluateAffectedComponents([...n],t,s,r,l);for(const t of n)i.add(t);for(const t of l)o.has(t)||a.add(t)}}async evaluateAffectedComponents(e,t,r,s,o){const a=new Map;for(const n of e)a.has(n)||a.set(n,this.createSccEvaluator(n,t,a,r));if(0===a.size)return;const i=[...a.values()].map((e=>e.evaluate(s,o)));await i}createSccEvaluator(e,t,r,s){const a=new v(e,t,this.arcadeContext,s,this.evaluatedExpressions,this._abortController);for(const i of e.adjacencyList)a.dependentEvaluators.push(o(r,i,(()=>this.createSccEvaluator(i,t,r,s))));return a}};e([n()],y.prototype,"calculating",void 0),e([n({constructOnly:!0})],y.prototype,"arcadeContext",void 0),e([n()],y.prototype,"_abortController",void 0),e([n()],y.prototype,"layerExpressionsModelMap",void 0),e([n()],y.prototype,"evaluatedExpressions",void 0),e([n()],y.prototype,"expressionEvaluationFailed",void 0),y=e([l(h)],y);class v{constructor(e,t,r,s,o,a){this.scc=e,this.feature=t,this.arcadeContextInfo=r,this.expressionsModel=s,this.evaluatedExpressions=o,this._abortController=a,this.dependentEvaluators=[],this._evaluatorPromise=null}get baseContext(){const{editType:e,map:t,spatialReference:r,timeZone:s}=this.arcadeContextInfo,o=this.feature.layer,a="scene"===o?.type&&null!=o.associatedLayer?o.associatedLayer:o;return{variables:{$originalfeature:this.feature.original.clone(),$editcontext:{editType:e},$layer:a,$featureset:a,$datastore:a?.url,$feature:this.feature.plainGraphic.clone(),$map:t},executeContext:{rawOutput:!0,spatialReference:r??void 0,timeZone:s,abortSignal:this._abortController.signal}}}evaluate(e,t){return null==this._evaluatorPromise&&(this._evaluatorPromise=this._evaluate(e,t)),this._evaluatorPromise}async _evaluate(e,t){null===m&&(m=await import("../../../arcade/languageUtils.js"));const s=this.dependentEvaluators.map((r=>r.evaluate(e,t)));await a(Promise.all(s),this._abortController);for(const a of this.scc.executors){const s=this.baseContext;if(this._abortController.signal.aborted)break;const l=this.expressionsModel.arcadeExecutorUses.get(a)??[],u=o(this.evaluatedExpressions,this.feature,(()=>new i));let c=null,m=null;try{c=a.isAsync?await a.executeAsync(s.variables,s.executeContext):a.execute(s.variables,s.executeContext),m={result:c,status:"success"}}catch(n){m={error:n,status:"error"}}for(const r of l){const s=this.expressionsModel.elementTemplateMap.get(r.elementId);switch(r.executorPurpose){case"editable":case"required":u.set(p(r.elementId,r.executorPurpose),m);break;case"value":{if("error"===m?.status)continue;const e=s.getExpressionExecutorsForLayer(this.feature.layer);let r=!0;if(e?.editableExpression&&(r=!1===u.get(p(s.elementId,"editable"))?.result),r){const e=this.feature.getAttribute(s.fieldName)??null,r=x(m.result,this.feature,s.fieldName,this.arcadeContextInfo.timeZone);r!==e&&(this.feature.setAttribute(s.fieldName,r),t.add(s.fieldName))}}break;case"visibility":if(u.set(p(r.elementId,r.executorPurpose),m),!this.expressionsModel.preserveFieldValuesWhenHidden&&!1===m.result&&e)if(d(s)){for(const e of s.elements)if(f(e)){null!==this.feature.getAttribute(e.fieldName)&&t.add(e.fieldName),this.feature.setAttribute(e.fieldName,null)}}else if(f(s)){null!==this.feature.getAttribute(s.fieldName)&&t.add(s.fieldName),this.feature.setAttribute(s.fieldName,null)}}}if("error"===m?.status){const e=new Set;for(const t of l){const r=this.expressionsModel.elementTemplateMap.get(t.elementId);if(r)switch(t.executorPurpose){case"editable":e.add(r.label+" - Editable expression");break;case"required":e.add(r.label+" - Required expression");break;case"value":e.add(r.label+" - Value expression");break;case"visibility":e.add(r.label+" - Visibility expression")}}if(e.size>0)throw new r("expression-evaluation-failed","Arcade evaluation failed ("+[...e].join(",")+")");throw new r("expression-evaluation-failed","Arcade evaluation failed ")}}}}function x(e,t,s,o){if(null===e)return null;const a=t.layer.fieldsIndex.get(s);if(!a)throw new r("field-not-found","Unable set field value as the field cannot be found. ("+s+")");switch(a.type){case"big-integer":case"integer":case"long":case"oid":case"small-integer":case"single":case"double":return m.toNumber(e);case"global-id":case"guid":case"string":return m.toString(e);case"date":{if(m.isDate(e))return e.getTime();const t=m.toDate(e,o);if(!t)throw new r("unsupported-value-type","Arcade return type is not a supported field type. ("+s+")");return t.getTime()}case"date-only":{if(m.isDateOnly(e))return e.toStorageFormat();if(m.isDate(e))return u.fromDateTime(e.toDateTime()).toStorageFormat();const t=u.fromString(m.toString(e));if(!t)throw new r("unsupported-value-type","Arcade return type is not a supported field type.");return t.toStorageFormat()}case"time-only":{if(m.isTime(e))return e.toStorageString();if(m.isDate(e)){return c.fromDateTime(e.toDateTime()).toStorageString()}const t=c.fromString(m.toString(e));if(!t)throw new r("unsupported-value-type","Arcade return type is not a supported field type.");return t.toStorageString()}case"timestamp-offset":{if(m.isDate(e))return e.toISOString(!1);const t=m.toDate(e,o);if(!t)throw new r("unsupported-value-type","Arcade return type is not a supported field type. ("+s+")");return t.toISOString(!1)}}throw new r("unsupported-value-type","Arcade return type is not a supported field type. ("+s+")")}export{y as ExpressionsManager};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import r from"../../../core/Error.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{whenOrAbort as a}from"../../../core/promiseUtils.js";import i from"../../../core/ReactiveMap.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{DateOnly as u}from"../../../core/sql/DateOnly.js";import{TimeOnly as c}from"../../../core/sql/TimeOnly.js";import{makeUseId as p}from"../inputs/support/inputUtils.js";import{isGroupElementTemplate as d,isFieldElementTemplate as f}from"../templates/support/templateUtils.js";let m=null;const h="esri.widgets.BatchAttributeForm.expressions.ExpressionsManager",g=()=>s.getLogger(h);let y=class extends t{constructor(e){super(e),this.calculating=!1,this.arcadeContext=null,this._abortController=new AbortController,this.layerExpressionsModelMap=new Map,this.evaluatedExpressions=new i,this.expressionEvaluationFailed=!1}abort(){this._abortController.abort()}async runAllExpressions(e,t=!1){this.calculating=!0;try{const r=[];for(const s of e){const e=this.layerExpressionsModelMap.get(s.layer);if(!e||0===e.components.length)continue;const o=new Set;r.push(this.evaluateAffectedComponents(e.components,s,e,t,o))}await a(Promise.all(r),this._abortController)}catch(r){g().error(r),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}async valueChanged(e,t,r=!0){try{this.calculating=!0;const s=t.map((t=>this.evaluateValueChangedForFeature(e,t,r)));await Promise.all(s)}catch(s){g().error(s),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}async evaluateValueChangedForFeature(e,t,r){if(this._abortController.signal.aborted)return;const s=this.layerExpressionsModelMap.get(t.layer);if(!s||0===s.components.length)return;const o=new Set,a=new Set([e]),i=new Set;for(;a.size>0;){const[e]=a;if(a.delete(e),o.has(e))continue;o.add(e);const n=s.fieldReferencesMap.get(e.toLowerCase());if(!n)continue;for(const t of n)i.has(t)&&n.delete(t);if(0===n.size)continue;const l=new Set;await this.evaluateAffectedComponents([...n],t,s,r,l);for(const t of n)i.add(t);for(const t of l)o.has(t)||a.add(t)}}async evaluateAffectedComponents(e,t,r,s,o){const a=new Map;for(const n of e)a.has(n)||a.set(n,this.createSccEvaluator(n,t,a,r));if(0===a.size)return;const i=[...a.values()].map((e=>e.evaluate(s,o)));await Promise.all(i)}createSccEvaluator(e,t,r,s){const a=new v(e,t,this.arcadeContext,s,this.evaluatedExpressions,this._abortController);for(const i of e.adjacencyList)a.dependentEvaluators.push(o(r,i,(()=>this.createSccEvaluator(i,t,r,s))));return a}};e([n()],y.prototype,"calculating",void 0),e([n({constructOnly:!0})],y.prototype,"arcadeContext",void 0),e([n()],y.prototype,"_abortController",void 0),e([n()],y.prototype,"layerExpressionsModelMap",void 0),e([n()],y.prototype,"evaluatedExpressions",void 0),e([n()],y.prototype,"expressionEvaluationFailed",void 0),y=e([l(h)],y);class v{constructor(e,t,r,s,o,a){this.scc=e,this.feature=t,this.arcadeContextInfo=r,this.expressionsModel=s,this.evaluatedExpressions=o,this._abortController=a,this.dependentEvaluators=[],this._evaluatorPromise=null}get baseContext(){const{editType:e,map:t,spatialReference:r,timeZone:s}=this.arcadeContextInfo,o=this.feature.layer,a="scene"===o?.type&&null!=o.associatedLayer?o.associatedLayer:o;return{variables:{$originalfeature:this.feature.original.clone(),$editcontext:{editType:e},$layer:a,$featureset:a,$datastore:a?.url,$feature:this.feature.plainGraphic.clone(),$map:t},executeContext:{rawOutput:!0,spatialReference:r??void 0,timeZone:s,abortSignal:this._abortController.signal}}}evaluate(e,t){return null==this._evaluatorPromise&&(this._evaluatorPromise=this._evaluate(e,t)),this._evaluatorPromise}async _evaluate(e,t){null===m&&(m=await import("../../../arcade/languageUtils.js"));const s=this.dependentEvaluators.map((r=>r.evaluate(e,t)));await a(Promise.all(s),this._abortController);for(const a of this.scc.executors){const s=this.baseContext;if(this._abortController.signal.aborted)break;const l=this.expressionsModel.arcadeExecutorUses.get(a)??[],u=o(this.evaluatedExpressions,this.feature,(()=>new i));let c=null,m=null;try{c=a.isAsync?await a.executeAsync(s.variables,s.executeContext):a.execute(s.variables,s.executeContext),m={result:c,status:"success"}}catch(n){m={error:n,status:"error"}}for(const r of l){const s=this.expressionsModel.elementTemplateMap.get(r.elementId);switch(r.executorPurpose){case"editable":case"required":u.set(p(r.elementId,r.executorPurpose),m);break;case"value":{if("error"===m?.status)continue;const e=s.getExpressionExecutorsForLayer(this.feature.layer);let r=!0;if(e?.editableExpression&&(r=!1===u.get(p(s.elementId,"editable"))?.result),r){const e=this.feature.getAttribute(s.fieldName)??null,r=x(m.result,this.feature,s.fieldName,this.arcadeContextInfo.timeZone);r!==e&&(this.feature.setAttribute(s.fieldName,r),t.add(s.fieldName))}}break;case"visibility":if(u.set(p(r.elementId,r.executorPurpose),m),!this.expressionsModel.preserveFieldValuesWhenHidden&&!1===m.result&&e)if(d(s)){for(const e of s.elements)if(f(e)){null!==this.feature.getAttribute(e.fieldName)&&t.add(e.fieldName),this.feature.setAttribute(e.fieldName,null)}}else if(f(s)){null!==this.feature.getAttribute(s.fieldName)&&t.add(s.fieldName),this.feature.setAttribute(s.fieldName,null)}}}if("error"===m?.status){const e=new Set;for(const t of l){const r=this.expressionsModel.elementTemplateMap.get(t.elementId);if(r)switch(t.executorPurpose){case"editable":e.add(r.label+" - Editable expression");break;case"required":e.add(r.label+" - Required expression");break;case"value":e.add(r.label+" - Value expression");break;case"visibility":e.add(r.label+" - Visibility expression")}}if(e.size>0)throw new r("expression-evaluation-failed","Arcade evaluation failed ("+[...e].join(",")+")");throw new r("expression-evaluation-failed","Arcade evaluation failed ")}}}}function x(e,t,s,o){if(null===e)return null;const a=t.layer.fieldsIndex.get(s);if(!a)throw new r("field-not-found","Unable set field value as the field cannot be found. ("+s+")");switch(a.type){case"big-integer":case"integer":case"long":case"oid":case"small-integer":case"single":case"double":return m.toNumber(e);case"global-id":case"guid":case"string":return m.toString(e);case"date":{if(m.isDate(e))return e.getTime();const t=m.toDate(e,o);if(!t)throw new r("unsupported-value-type","Arcade return type is not a supported field type. ("+s+")");return t.getTime()}case"date-only":{if(m.isDateOnly(e))return e.toStorageFormat();if(m.isDate(e))return u.fromDateTime(e.toDateTime()).toStorageFormat();const t=u.fromString(m.toString(e));if(!t)throw new r("unsupported-value-type","Arcade return type is not a supported field type.");return t.toStorageFormat()}case"time-only":{if(m.isTime(e))return e.toStorageString();if(m.isDate(e)){return c.fromDateTime(e.toDateTime()).toStorageString()}const t=c.fromString(m.toString(e));if(!t)throw new r("unsupported-value-type","Arcade return type is not a supported field type.");return t.toStorageString()}case"timestamp-offset":{if(m.isDate(e))return e.toISOString(!1);const t=m.toDate(e,o);if(!t)throw new r("unsupported-value-type","Arcade return type is not a supported field type. ("+s+")");return t.toISOString(!1)}}throw new r("unsupported-value-type","Arcade return type is not a supported field type. ("+s+")")}export{y as ExpressionsManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import"../core/has.js";import{abortHandle as t}from"../core/handleUtils.js";import{getOrCreateMapValue as n}from"../core/MapUtils.js";import{watch as i,whenOnce as o}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import{isString as s}from"../support/guards.js";import l from"./Widget.js";import{getHiddenFieldsValidationErrorMessage as d,getVisibleFieldInputValidationErrorMessage as p,isElementTemplateWithInputType as u}from"./BatchAttributeForm/batchAttributeFormUtils.js";import c from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as m}from"./BatchAttributeForm/css.js";import{VisibleElements as h}from"./BatchAttributeForm/VisibleElements.js";import{isGroupInput as v,isFieldInput as b,differentValuesString as C}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{loadCalciteComponents as f}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as _,prepareISOFieldValueForDateComponents as g,prepareUnixFieldValueForDateComponents as I,normalizeTimeOnlyString as F,getISOFieldValueFromDateComponents as w,getUnixFieldValueFromDateComponents as y}from"./support/dateUtils.js";import{globalCss as k}from"./support/globalCss.js";import{Heading as x}from"./support/Heading.js";import{setFocus as M}from"./support/widgetUtils.js";import{messageBundle as T}from"./support/decorators/messageBundle.js";import{vmEvent as D}from"./support/decorators/vmEvent.js";import{tsx as O}from"./support/jsxFactory.js";import{substitute as S}from"../intl/substitute.js";const V="data-element-id";let U=class extends l{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.readOnly=!1,this.viewModel=new c,this.visibleElements=new h,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._afterDateComponentUpdate=this._afterDateComponentUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([i((()=>this.features),(()=>{this._dateComponentMap.clear();const e=new AbortController;o((()=>!this.viewModel.updating),e.signal).then((()=>{this._attemptFocusOnNextRender=!0})),this.addHandles(t(e))})),i((()=>this.viewModel.activeForm),(()=>{this._batchSwitchInputInitialValues.clear()}))])}loadDependencies(){return f({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"),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 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 spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=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)}render(){const{status:e}=this.viewModel;return"failed"===e?O("div",null,this.messages.formFailedToLoad):this.viewModel.expressionEvaluationFailed?O("div",null,this.messages.expressionEvaluationFailed):O("div",{class:this.classes(m.base,k.widget,k.panel)},"loaded"===e?this._renderForm():"loading"===e?O("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):null)}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:i}=e.dataset,o=this._getCalciteElementFromDateTimeTimeZonePicker(e,t);if(!o)return;const a=n(this._dateComponentMap,`${i}`,(()=>({placeholder:{date:"",time:"",timeZone:""}})));switch(a.placeholder[t]=o.placeholder??"",t){case"date":a.date=e;break;case"time":a.time=e;break;case"timeZone":a.timeZone=e,a.defaultComboboxItemElements=o.selectedItems}"timeZone"===t&&(a.defaultComboboxItemElements=o.selectedItems)}_getCalciteElementFromDateTimeTimeZonePicker(e,t){const n=e.shadowRoot;return n?"timeZone"===t?n.querySelector("calcite-combobox"):n.querySelector("calcite-input-text"):null}_updateDateTimeOrTimeZoneShadowDom(e,t){const{datePart:n,elementId:i}=e.dataset,o=this._dateComponentMap.get(`${i}`);if(!o)return;const a=this._getCalciteElementFromDateTimeTimeZonePicker(e,n);if(a)switch(n){case"date":case"time":a.placeholder=t?this.messages.differentValues:o.placeholder[n];break;case"timeZone":t?(a.value="",a.placeholder=this.messages.differentValues):(!a.selectedItems.length&&o.defaultComboboxItemElements?.length&&(a.selectedItems[0]=o.defaultComboboxItemElements[0]),a.placeholder=o.placeholder[n])}}_renderForm(){return O("form",{onsubmit:this._onFormSubmit},this._renderHeader(),this._renderInvisibleFieldsError(),this._renderContent())}_renderHeader(){const e=this.viewModel.activeForm.title,t=this.viewModel.activeForm.description,n=e?O(x,{key:"title",level:this.headingLevel},e):null,i=t?O("p",{key:"description"},t):null;return e||t?O("div",null,n,i):null}_renderInvisibleFieldsError(){const{hasNonActiveInvalidFeatures:e,activeForm:t}=this.viewModel;let n;return t.invalidHiddenInputs.length>0?n=d(t,this.messages):e&&(n=this.messages.validationErrors.featuresInError),n?O("calcite-notice",{class:m.noticeError,icon:!0,kind:"warning",open:!0},O("div",{slot:"message"},n)):null}_renderContent(){if(!this.viewModel.hasVisibleInputs)return[O("calcite-notice",{class:m.noticeError,icon:!0,kind:"warning",open:!0},O("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 v(e)?this._renderGroupInput(e):b(e)?this._renderLabeledField(e):void 0}_renderGroupInput(e){const{inputs:t,template:n,open:i}=e,o=t.filter((e=>e.visible)),a=n.label??"";return O("calcite-block",{class:this.classes(m.group,m.groupSequential,m.block),collapsible:!0,description:n.description??void 0,disabled:!1,heading:a,headingLevel:this.headingLevel,key:`{${n.elementId}-key}`,label:a,open:i,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},o.map((e=>this._renderInput(e))))}_renderLabeledField(e){const{label:t,elementId:n}=e.template,{required:i,dataType:o}=e,a=i?S(this.messages.requiredFieldLabel,{name:t}):t;return O("calcite-label",{"aria-label":a,class:m.label,key:`field--${n}`},O("div",{class:m.labelTextContent,key:"labelTextContainer"},t,i?O("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==o?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:n}=e;if("date"===n)return this._renderDateComponents(e,t);if("coded-value"===e.domain?.type){const n=e.domain;return this._renderCodedInputs({input:e,domain:n,props:t})}return"number"===n?this._renderNumberComponent(t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{compositeError:t,description:n,submittable:i}=e,o=!i&&t&&(this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId))?p(e,t,this.messages):null;return o?O("calcite-input-message",{icon:!0,status:"invalid"},o):n?O("calcite-input-message",{class:m.description},n):null}_renderCodedInputs({input:e,domain:t,props:n}){const i=e.template.input?.type??null,o=this.viewModel.getCodedValueOptions(t);switch(i){case"switch":return this._renderSwitchField({input:e,props:n,options:o});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:o,props:n});default:return this._renderComboBoxComponent({options:o,props:n})}}_renderSwitchField({input:e,props:t,options:n}){if((this._batchSwitchInputInitialValues.get(e)===C||e.value===C)&&"batch"===this.viewModel.mode){n.unshift({name:this.messages.differentValues,value:C,disabled:!0,selected:!0});const i={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[V]:t[V]},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:n})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return O("calcite-switch",{...t,checked:!!u(e.template,"switch")&&e.value===e.template.input.onValue,class:m.inputSwitch,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInput(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:n}){const{trigger:i,dropdown:o,group:a}=n;return O("calcite-dropdown",{...o,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e)},O("calcite-button",{...i},e===C?this.messages.differentValues:e),O("calcite-dropdown-group",{selectionMode:a.mode},t.map((t=>O("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name)))))}_renderComboBoxComponent({options:e,props:t}){const n=e.map((e=>this.renderComboboxItem({value:`${e.value}`,text:e.name,selected:t.value===e.value})));return O("calcite-combobox",{...t,selectionMode:"single",value:String(t.value),onCalciteComboboxChange:({currentTarget:e})=>{this._saveInput(e)}},n)}renderComboboxItem({text:e,value:t,selected:n}){return O("calcite-combobox-item",{key:t,selected:n,textLabel:e,value:t})}_renderRadioButtonGroupComponent({input:e,options:t,props:n}){const i=t.map((({name:t,value:i})=>this._renderRadioButtons({label:t,value:i,selected:i===e.value,props:n})));return O("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:m.inputRadioGroup,key:`${n.key}-radio-group`,layout:"vertical",name:n.name,required:n.required},n.placeholder===this.messages.differentValues?O("calcite-label",{class:m.placeholderRadio,key:n.label,layout:"inline"},O("calcite-radio-button",{checked:!0,disabled:!0,name:n.placeholder,value:n.placeholder}),n.placeholder):null,i)}_renderRadioButtons({value:e,selected:t,label:n,props:i}){return O("calcite-label",{class:m.inputRadioLabel,key:i.label,layout:"inline"},O("calcite-radio-button",{...i,checked:t,class:m.inputRadio,disabled:i.readOnly,name:i.label,onblur:()=>{this._focusedFieldInput=null},value:e,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),n)}_renderStringComponent(e,t){const{template:n}=e;return n.field.editable?n.input&&"text-area"===n.input.type?O("calcite-text-area",{...t,class:this.classes(m.group,m.groupSequential,m.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):O("calcite-input",{...t,class:this.classes(m.group,m.groupSequential,m.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)}):this._renderReadOnlyComponent(e)}_renderNumberComponent(e){return O("calcite-input-number",{...e,type:"number",value:null==e.value?"":String(e.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const n=this.getCommonInputProps(e);return O("calcite-input",{...n,class:this.classes(m.fieldInput,m.inputDisabled,m.individualElement),readOnly:!0,type:"text",value:String(t??n.value??"")})}_renderDateComponents(e,t){const{type:n}=e.field;switch(n){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,_(e.field,t.value))}}_renderDateOnlyFieldComponent(e,t){const{class:n,key:i}=t,{rawMax:o,rawMin:a}=e.range;return O("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:n,"data-date-part":"date","data-element-id":t[V],key:`${i}-date-input`,max:s(o)?o:void 0,min:s(a)?a:void 0,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",value:e.value===C?"":e.value?String(e.value):"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{class:n,key:i}=t;return O("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:n,"data-date-part":"time","data-element-id":t[V],key:`${i}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",value:e.value===C?"":e.value?String(e.value):"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{class:n,key:i,readOnly:o}=t,{rawMax:a,rawMin:r}=e.range,s=g(a),l=g(r),d=g(e.value===C?"":e.value),p=e.includeTimeOffset,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:o,[V]:t[V],onfocus:this._onComponentFocus};return O("div",{class:m.dateInputContainer,key:`${i}-date-time-container`},O("calcite-input-date-picker",{...u,class:n,"data-date-part":"date",key:`${i}-date-input`,max:s?.date??void 0,min:l?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:d.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),O("calcite-input-time-picker",{...u,class:n,"data-date-part":"time",key:`${i}-time-input`,onblur:()=>{this._focusedFieldInput=null},value:d.time??"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?O("calcite-input-time-zone",{...u,class:n,"data-date-part":"timeZone",key:`${i}-timezone-input`,onblur:()=>{this._focusedFieldInput=null},value:d.timeZoneOffset??"0",onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:n,key:i,readOnly:o,min:a,max:r}=t,s=I(e.value===C?"":e.value),l=I(r),d=I(a),p=e.includeTime,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:o,[V]:t[V],onfocus:this._onComponentFocus};return O("div",{class:m.dateInputContainer,key:`${i}-date-time-container`},O("calcite-input-date-picker",{...u,class:n,"data-date-part":"date",key:`${i}-date-input`,max:l?.date??void 0,min:d?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:s.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?O("calcite-input-time-picker",{...u,"data-date-part":"time",key:`${i}-time-input`,onblur:()=>{this._focusedFieldInput=null},step:1,value:s.time??"",onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}getCommonInputProps(e){const{disabled:t}=this,{template:n,valid:i,value:o,minLength:a,maxLength:r,required:s,fieldName:l,editable:d,userHasChangedValue:p,range:{max:u,min:c}}=e,h=!d||t;let v=n.hint??void 0,b=!1;return o===C&&(v=this.messages.differentValues,b=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":i?"false":"true",class:this.classes(m.fieldInput,h?m.inputDisabled:null),status:p&&!i?"invalid":"idle",maxLength:r&&r>-1?r:void 0,minLength:a&&a>-1?a:void 0,key:n.elementId,label:l,name:l,disabled:this.viewModel.calculating,max:null!=u?u:void 0,min:null!=c?c:void 0,readOnly:h,onblur:this._onComponentBlur,required:s,placeholder:v,value:b?"":o??"",[V]:n.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(V))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,n=e.querySelector("calcite-radio-button"),i=t||n;i&&this._afterComponentCreateOrUpdate(i)}_onComponentFocus(e){const t=e.target,n=this._getFieldInputFromHTMLElement(t);this._touchedInputs.add(n.template.elementId),this._focusedFieldInput=n}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),n=this._focusedFieldInput;this._attemptFocusOnNextRender&&n===t&&(this._attemptFocusOnNextRender=!1,M(e))}_onComponentBlur(){this._focusedFieldInput=null}_parseValue(e,t){if(u(t.template,"switch"))return"calcite-dropdown"===e.localName?e.selectedItems[0].textContent:e.checked?t.template.input.onValue:t.template.input.offValue;const n=e.value;return null==n||""===n?null:"number"===t.dataType?"-0"===n||"-0."===n||"-0,"===n?n:parseFloat(n):"date"===t.field.type?parseFloat(n):n}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:i}=t.template;if(!t)return;const o=t?.value;if(u(t.template,"switch")&&"single"!==this.viewModel.mode){const e=n(this._batchSwitchInputInitialValues,t,(()=>t.value));this._batchSwitchInputInitialValues.set(t,null===e?o:e)}const a=this._parseValue(e,t);a!==o&&this.viewModel.setValue(i,a)}async _afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._setDateTimeTimeZoneMap(e),this._updateDateTimeOrTimeZoneShadowDom(e,t.value===C),this._afterComponentCreateOrUpdate(e)}async _afterDateComponentUpdate(e){const{value:t}=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._updateDateTimeOrTimeZoneShadowDom(e,t===C),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:n}=e.template,i=e.field.type,o=this._dateComponentMap.get(`${n}`);if(!o)return;let a=e.value===C?void 0:e.value,r=null;"date-only"===i?r=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===i?(a=F(a),r=F(t.value)):r="timestamp-offset"===i?null!=t.value?w({dateComponent:o.date,timeComponent:o.time,oldValue:a,timeZoneComponent:o.timeZone}):null:null!=t.value?y({oldValue:a,dateComponent:o.date,timeComponent:o.time?.value===C?void 0:o.time}):null,a!==r&&(null!==r&&t.value?this.viewModel.setValue(`${n}`,r):this.viewModel.setValue(`${n}`,null))}};e([a()],U.prototype,"activeFeatureIndex",null),e([a()],U.prototype,"disabled",null),e([a()],U.prototype,"features",null),e([a()],U.prototype,"map",null),e([a()],U.prototype,"spatialReference",null),e([a()],U.prototype,"timeZone",null),e([a()],U.prototype,"headingLevel",void 0),e([a()],U.prototype,"icon",null),e([a(),T("esri/t9n/common")],U.prototype,"messagesCommon",void 0),e([a(),T("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],U.prototype,"messages",void 0),e([a()],U.prototype,"readOnly",void 0),e([a(),D(["value-change","submit"])],U.prototype,"viewModel",void 0),e([a({type:h,nonNullable:!0})],U.prototype,"visibleElements",void 0),U=e([r("esri.widgets.BatchAttributeForm")],U);const R=U;export{R as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import"../core/has.js";import{abortHandle as t}from"../core/handleUtils.js";import{getOrCreateMapValue as n}from"../core/MapUtils.js";import{watch as i,whenOnce as o}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{isString as r}from"../support/guards.js";import l from"./Widget.js";import{getHiddenFieldsValidationErrorMessage as d,getVisibleFieldInputValidationErrorMessage as p,isElementTemplateWithInputType as u}from"./BatchAttributeForm/batchAttributeFormUtils.js";import c from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as m}from"./BatchAttributeForm/css.js";import{VisibleElements as h}from"./BatchAttributeForm/VisibleElements.js";import{isGroupInput as v,isFieldInput as b,differentValuesString as f}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{loadCalciteComponents as C}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as _,prepareISOFieldValueForDateComponents as g,prepareUnixFieldValueForDateComponents as I,normalizeTimeOnlyString as y,getISOFieldValueFromDateComponents as F,getUnixFieldValueFromDateComponents as w}from"./support/dateUtils.js";import{globalCss as x}from"./support/globalCss.js";import{setFocus as k}from"./support/widgetUtils.js";import{messageBundle as D}from"./support/decorators/messageBundle.js";import{vmEvent as M}from"./support/decorators/vmEvent.js";import{tsx as O}from"./support/jsxFactory.js";import{substitute as T}from"../intl/substitute.js";const S="data-element-id";let V=class extends l{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.readOnly=!1,this.viewModel=new c,this.visibleElements=new h,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._afterDateComponentUpdate=this._afterDateComponentUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([i((()=>this.features),(()=>{this._dateComponentMap.clear();const e=new AbortController;o((()=>!this.viewModel.updating),e.signal).then((()=>{this._attemptFocusOnNextRender=!0})),this.addHandles(t(e))})),i((()=>this.viewModel.activeForm),(()=>{this._batchSwitchInputInitialValues.clear()}))])}loadDependencies(){return C({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"),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 spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=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)}render(){const{status:e}=this.viewModel;return"failed"===e?O("div",null,this.messages.formFailedToLoad):this.viewModel.expressionEvaluationFailed?O("div",null,this.messages.expressionEvaluationFailed):O("div",{class:this.classes(m.base,x.widget,x.panel)},"loaded"===e?this._renderForm():"loading"===e?O("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):null)}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:i}=e.dataset,o=this._getCalciteElementFromDateTimeTimeZonePicker(e,t);if(!o)return;const a=n(this._dateComponentMap,`${i}`,(()=>({placeholder:{date:"",time:"",timeZone:""}})));switch(a.placeholder[t]=o.placeholder??"",t){case"date":a.date=e;break;case"time":a.time=e;break;case"timeZone":a.timeZone=e,a.defaultComboboxItemElements=o.selectedItems}"timeZone"===t&&(a.defaultComboboxItemElements=o.selectedItems)}_getCalciteElementFromDateTimeTimeZonePicker(e,t){const n=e.shadowRoot;return n?"timeZone"===t?n.querySelector("calcite-combobox"):n.querySelector("calcite-input-text"):null}_updateDateTimeOrTimeZoneShadowDom(e,t){const{datePart:n,elementId:i}=e.dataset,o=this._dateComponentMap.get(`${i}`);if(!o)return;const a=this._getCalciteElementFromDateTimeTimeZonePicker(e,n);if(a)switch(n){case"date":case"time":a.placeholder=t?this.messages.differentValues:o.placeholder[n];break;case"timeZone":t?(a.value="",a.placeholder=this.messages.differentValues):(!a.selectedItems.length&&o.defaultComboboxItemElements?.length&&(a.selectedItems[0]=o.defaultComboboxItemElements[0]),a.placeholder=o.placeholder[n])}}_renderForm(){return O("form",{onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderContent())}_renderInvisibleFieldsError(){const{hasNonActiveInvalidFeatures:e,activeForm:t}=this.viewModel;let n;return t.invalidHiddenInputs.length>0?n=d(t,this.viewModel.mode,this.messages):e&&(n=this.messages.validationErrors.featuresInError),n?O("calcite-notice",{class:m.noticeError,icon:!0,kind:"warning",open:!0},O("div",{slot:"message"},n)):null}_renderContent(){if(!this.viewModel.hasVisibleInputs)return[O("calcite-notice",{class:m.noticeError,icon:!0,kind:"warning",open:!0},O("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 v(e)?this._renderGroupInput(e):b(e)?this._renderLabeledField(e):void 0}_renderGroupInput(e){const{inputs:t,template:n,open:i}=e,o=t.filter((e=>e.visible)),a=n.label??"";return O("calcite-block",{class:this.classes(m.group,"sequential"===this.groupDisplay?m.groupSequential:null,this.disabled?m.inputDisabled:null),collapsible:!0,description:n.description??void 0,disabled:this._effectiveDisabled,heading:a,headingLevel:this.headingLevel,key:`{${n.elementId}-key}`,label:a,open:i,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},o.map((e=>this._renderInput(e))))}_renderLabeledField(e){const{label:t,elementId:n}=e.template,{required:i,dataType:o}=e,a=i?T(this.messages.requiredFieldLabel,{name:t}):t;return O("calcite-label",{"aria-label":a,class:m.label,key:`field--${n}`},O("div",{class:m.labelTextContent,key:"labelTextContainer"},t,i?O("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==o?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:n}=e;if("date"===n)return this._renderDateComponents(e,t);if("coded-value"===e.domain?.type){const n=e.domain;return this._renderCodedInputs({input:e,domain:n,props:t})}return"number"===n?this._renderNumberComponent(t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{compositeError:t,description:n,submittable:i}=e,o=!i&&t&&(this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId))?p(e,t,this.messages):null;return o?O("calcite-input-message",{icon:!0,status:"invalid"},o):n?O("calcite-input-message",{class:m.description},n):null}_renderCodedInputs({input:e,domain:t,props:n}){const i=e.template.input?.type??null,o=this.viewModel.getCodedValueOptions(t);switch(i){case"switch":return this._renderSwitchField({input:e,props:n,options:o});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:o,props:n});default:return this._renderComboBoxComponent({options:o,props:n})}}_renderSwitchField({input:e,props:t,options:n}){if((this._batchSwitchInputInitialValues.get(e)===f||e.value===f)&&"batch"===this.viewModel.mode){n.unshift({name:this.messages.differentValues,value:f,disabled:!0,selected:!0});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:n})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return O("calcite-switch",{...t,checked:!!u(e.template,"switch")&&e.value===e.template.input.onValue,class:m.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInput(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:n}){const{trigger:i,dropdown:o,group:a}=n;return O("calcite-dropdown",{...o,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e)},O("calcite-button",{...i},e===f?this.messages.differentValues:e),O("calcite-dropdown-group",{selectionMode:a.mode},t.map((t=>O("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name)))))}_renderComboBoxComponent({options:e,props:t}){const n=e.map((e=>this.renderComboboxItem({value:`${e.value}`,text:e.name,selected:t.value===e.value})));return O("calcite-combobox",{...t,selectionMode:"single",value:String(t.value),onCalciteComboboxChange:({currentTarget:e})=>{this._saveInput(e)}},n)}renderComboboxItem({text:e,value:t,selected:n}){return O("calcite-combobox-item",{key:t,selected:n,textLabel:e,value:t})}_renderRadioButtonGroupComponent({input:e,options:t,props:n}){const i=t.map((({name:t,value:i})=>this._renderRadioButtons({label:t,value:i,selected:i===e.value,props:n})));return O("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:m.inputRadioGroup,disabled:n.readOnly,key:`${n.key}-radio-group`,layout:"vertical",name:n.name,required:n.required},n.placeholder===this.messages.differentValues?O("calcite-label",{class:m.placeholderRadio,key:n.label,layout:"inline"},O("calcite-radio-button",{checked:!0,disabled:!0,name:n.placeholder,value:n.placeholder}),n.placeholder):null,i)}_renderRadioButtons({value:e,selected:t,label:n,props:i}){return O("calcite-label",{class:m.inputRadioLabel,key:i.label,layout:"inline"},O("calcite-radio-button",{...i,checked:t,class:m.inputRadio,disabled:i.readOnly,name:i.label,onblur:()=>{this._focusedFieldInput=null},value:e,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),n)}_renderStringComponent(e,t){const{template:n}=e;return n.field.editable?n.input&&"text-area"===n.input.type?O("calcite-text-area",{...t,class:this.classes(m.group,m.groupSequential,m.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):O("calcite-input",{...t,class:this.classes(m.group,m.groupSequential,m.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)}):this._renderReadOnlyComponent(e)}_renderNumberComponent(e){return O("calcite-input-number",{...e,type:"number",value:null==e.value?"":String(e.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const n=this.getCommonInputProps(e);return O("calcite-input",{...n,class:this.classes(m.fieldInput,m.inputDisabled,m.individualElement),readOnly:!0,type:"text",value:String(t??n.value??"")})}_renderDateComponents(e,t){const{type:n}=e.field;switch(n){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,_(e.field,t.value))}}_renderDateOnlyFieldComponent(e,t){const{class:n,key:i,readOnly:o}=t,{rawMax:a,rawMin:s}=e.range;return O("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:n,"data-date-part":"date","data-element-id":t[S],key:`${i}-date-input`,max:r(a)?a:void 0,min:r(s)?s:void 0,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:o,value:e.value===f?"":e.value?String(e.value):"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{class:n,key:i,readOnly:o}=t;return O("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:n,"data-date-part":"time","data-element-id":t[S],key:`${i}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:o,value:e.value===f?"":e.value?String(e.value):"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{class:n,key:i,readOnly:o}=t,{rawMax:a,rawMin:s}=e.range,r=g(a),l=g(s),d=g(e.value===f?"":e.value),p=e.includeTimeOffset,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:o,[S]:t[S],onfocus:this._onComponentFocus};return O("div",{class:m.dateInputContainer,key:`${i}-date-time-container`},O("calcite-input-date-picker",{...u,class:n,"data-date-part":"date",key:`${i}-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)}),O("calcite-input-time-picker",{...u,class:n,"data-date-part":"time",key:`${i}-time-input`,onblur:()=>{this._focusedFieldInput=null},value:d.time??"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?O("calcite-input-time-zone",{...u,class:n,"data-date-part":"timeZone",key:`${i}-timezone-input`,onblur:()=>{this._focusedFieldInput=null},value:d.timeZoneOffset??"0",onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:n,key:i,readOnly:o,min:a,max:s}=t,r=I(e.value===f?"":e.value),l=I(s),d=I(a),p=e.includeTime,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:o,[S]:t[S],onfocus:this._onComponentFocus};return O("div",{class:m.dateInputContainer,key:`${i}-date-time-container`},O("calcite-input-date-picker",{...u,class:n,"data-date-part":"date",key:`${i}-date-input`,max:l?.date??void 0,min:d?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:r.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?O("calcite-input-time-picker",{...u,"data-date-part":"time",key:`${i}-time-input`,onblur:()=>{this._focusedFieldInput=null},step:1,value:r.time??"",onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}getCommonInputProps(e){const{_effectiveDisabled:t}=this,{template:n,valid:i,value:o,minLength:a,maxLength:s,required:r,fieldName:l,editable:d,userHasChangedValue:p,range:{max:u,min:c}}=e,h=!d||t;let v=n.hint??void 0,b=!1;return o===f&&(v=this.messages.differentValues,b=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":i?"false":"true",class:this.classes(m.fieldInput,h?m.inputDisabled:null),status:p&&!i?"invalid":"idle",maxLength:s&&s>-1?s:void 0,minLength:a&&a>-1?a:void 0,key:n.elementId,label:l,name:l,max:null!=u?u:void 0,min:null!=c?c:void 0,readOnly:h,onblur:this._onComponentBlur,required:r,placeholder:v,value:b?"":o??"",[S]:n.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(S))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,n=e.querySelector("calcite-radio-button"),i=t||n;i&&this._afterComponentCreateOrUpdate(i)}_onComponentFocus(e){const t=e.target,n=this._getFieldInputFromHTMLElement(t);this._touchedInputs.add(n.template.elementId),this._focusedFieldInput=n}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),n=this._focusedFieldInput;this._attemptFocusOnNextRender&&n===t&&(this._attemptFocusOnNextRender=!1,k(e))}_onComponentBlur(){this._focusedFieldInput=null}_parseValue(e,t){if(u(t.template,"switch"))return"calcite-dropdown"===e.localName?e.selectedItems[0].textContent:e.checked?t.template.input.onValue:t.template.input.offValue;const n=e.value;return null==n||""===n?null:"number"===t.dataType?"-0"===n||"-0."===n||"-0,"===n?n:parseFloat(n):"date"===t.field.type?parseFloat(n):n}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:i}=t.template;if(!t)return;const o=t?.value;if(u(t.template,"switch")&&"single"!==this.viewModel.mode){const e=n(this._batchSwitchInputInitialValues,t,(()=>t.value));this._batchSwitchInputInitialValues.set(t,null===e?o:e)}const a=this._parseValue(e,t);a!==o&&this.viewModel.setValue(i,a)}async _afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._setDateTimeTimeZoneMap(e),this._updateDateTimeOrTimeZoneShadowDom(e,t.value===f),this._afterComponentCreateOrUpdate(e)}async _afterDateComponentUpdate(e){const{value:t}=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._updateDateTimeOrTimeZoneShadowDom(e,t===f),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:n}=e.template,i=e.field.type,o=this._dateComponentMap.get(`${n}`);if(!o)return;let a=e.value===f?void 0:e.value,s=null;"date-only"===i?s=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===i?(a=y(a),s=y(t.value)):s="timestamp-offset"===i?null!=t.value?F({dateComponent:o.date,timeComponent:o.time,oldValue:a,timeZoneComponent:o.timeZone}):null:null!=t.value?w({oldValue:a,dateComponent:o.date,timeComponent:o.time?.value===f?void 0:o.time}):null,a!==s&&(null!==s&&t.value?this.viewModel.setValue(`${n}`,s):this.viewModel.setValue(`${n}`,null))}};e([a()],V.prototype,"activeFeatureIndex",null),e([a()],V.prototype,"disabled",null),e([a()],V.prototype,"_effectiveDisabled",null),e([a()],V.prototype,"features",null),e([a()],V.prototype,"map",null),e([a()],V.prototype,"spatialReference",null),e([a()],V.prototype,"timeZone",null),e([a()],V.prototype,"headingLevel",void 0),e([a()],V.prototype,"icon",null),e([a(),D("esri/t9n/common")],V.prototype,"messagesCommon",void 0),e([a(),D("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],V.prototype,"messages",void 0),e([a()],V.prototype,"readOnly",void 0),e([a(),M(["value-change","submit"])],V.prototype,"viewModel",void 0),e([a({type:h,nonNullable:!0})],V.prototype,"visibleElements",void 0),e([a()],V.prototype,"groupDisplay",void 0),V=e([s("esri.widgets.BatchAttributeForm")],V);const U=V;export{U as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import{remove as a}from"../../core/arrayUtils.js";import i from"../../core/Error.js";import{makeHandle as r,handlesGroup as s,abortHandle as n}from"../../core/handleUtils.js";import"../../core/has.js";import{removeMaybe as o,destroyMaybe as l}from"../../core/maybe.js";import{debounce as c}from"../../core/promiseUtils.js";import{watch as d,initial as h,whenOnce as u,syncAndInitial as p}from"../../core/reactiveUtils.js";import{generateBracedUUID as f}from"../../core/uuid.js";import{property as m}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import{subclass as g}from"../../core/accessorSupport/decorators/subclass.js";import{isSharedTemplateOrMetadata as w}from"../../editing/templateUtils.js";import y from"../../layers/GraphicsLayer.js";import{isTable as v}from"../../layers/support/layerUtils.js";import{getDrawHelpMessage as _}from"../../views/draw/support/helpMessageUtils.js";import{ViewEventPriorities as F}from"../../views/input/InputManager.js";import M from"../../views/interactive/sketch/SketchOptions.js";import b from"../../views/interactive/snapping/FeatureSnappingLayerSource.js";import I from"./CreateFeaturesWorkflowData.js";import{isModelUpload as A,handleModelUpload as k}from"./modelUploadUtils.js";import V from"./Workflow.js";import{startCreatingNewFeature as C,findLayerInfo as S,updateGraphicSymbolWhenRequired as H,isTerminalUpdateEventType as j,getVisualVariableAttributes as U,startUpdatingFeature as O,createWorkflowSteps as E,avoidFeatureTemplateSelectionWithOnlyOneItem as D,prepareAttachmentsForCreateFeaturesWorkflow as T,showProgressCursor as P,visualVariableInteractiveUpdate as G}from"./workflowUtils.js";import L from"../FeatureForm/FeatureFormViewModel.js";import W from"../Sketch/SketchViewModel.js";var x;const N=Symbol(),z=Symbol(),R=Symbol(),Z=Symbol();let q=x=class extends V{constructor(e){super(e),this.type="create-features",this.createFeatureState="create-new",this.data=void 0,this.isNested=!1,this._getDrawMeshHelpMessage=void 0,this._featureFormHandle=null,this._visualVariableAttributes={rotation:null,size:null},this._featureFormViewModel=new L,this._sketchViewModel=null,this._attachmentFileInfos=new Map,this._highlightHandles=new Map,this._preventDefaultActionOnCancel=!1,this._lastActiveGraphics=[],this._isActive=!0,this._updateGraphicDebounced=c(((e,t,a)=>H(e,t,a)))}initialize(){this.isNested&&(this._isActive=!1),this._initializeSketchViewModel()}destroy(){this._sketchViewModel.destroy()}get featureFormViewModel(){return this._featureFormViewModel}get hasPendingEdits(){if(this.pendingFeatures.some((e=>!!this.data.getEditsForPendingFeature(e)?.modified)))return!0;const{creationInfo:e,upload:t}=this.data,a=this._sketchViewModel,{activeComponent:i}=a,r=a.createGraphic?.geometry?.type;return!("polyline"!==r&&"polygon"!==r&&"multipoint"!==r||"draw-2d"!==i?.type&&"draw-3d"!==i?.type)&&i.drawOperation.committedVertices.length>0||(!(!t||"pending"!==t.state&&"success"!==t.state)||!!e?.geometryToPlace)}get helpMessage(){const{creationInfo:e,viewModel:t}=this.data;if("creating-features"!==this.stepId||!e)return;const a=e.layer.geometryType,i=this._sketchViewModel.createGraphic;if("mesh"===a){this._getDrawMeshHelpMessage||import("../../views/draw/support/helpMessageUtils3d.js").then((e=>{this._getDrawMeshHelpMessage=e.getDrawMeshHelpMessage}));const{view:e}=t;return"3d"===e?.type?this._getDrawMeshHelpMessage?.(i,e):void 0}return _(a,i?.geometry)}get layer(){return this.data.creationInfo?.layer}get numPendingFeatures(){return this.pendingFeatures.length}get parent(){return this.data.parent}get parentLayer(){return this.parent?.data.editorItem.layer}get pendingFeatures(){return this.data.pendingFeatures}get keyboardCancellationEnabled(){return 0===this.numPendingFeatures}get reliesOnOwnerAdminPrivileges(){return this.data.editorItem?.capabilities.create.reliesOnOwnerAdminPrivileges??!1}get shouldShowAttachments(){return this.data.editorItem?.capabilities.create.attachments.enabled??!1}get shouldAllowAttachmentEditing(){return this.shouldShowAttachments}get sketchViewModel(){return this._sketchViewModel}get test(){}async enter(){this._isActive=!0,"awaiting-feature-creation-info"!==this.stepId&&this._setUpCreatingFeaturesStep()}exit(){this._isActive=!1,this.removeHandles([R])}async updatePendingFeature(e,t){return this._preventDefaultActionOnCancel=!0,this._sketchViewModel.cancel(),a(this._lastActiveGraphics,e),this._startUpdating({feature:e,webStyleCache:t})}async start(){return await super.start(),v(this.data.creationInfo?.layer)?null:{enter:async()=>{},exit:async()=>{},viewModel:this._sketchViewModel}}static create(e){const{addAttachmentsCallback:t,applyEditsCallback:a,isNested:i,creationInfo:r,parent:s,snappingManager:n,startAt:o,viewModel:l}=e,c=e.sketchOptions??new M,d=r?.layer,h=d?l.findEditorItemForLayer(d):void 0,u=new x({data:new I({creationInfo:r,editorItem:h,parent:s,sketchOptions:c,snappingManager:n,viewModel:l}),isNested:i,onCommit:async e=>{const{creationInfo:i}=e;if(!i)return;const r=e.pendingFeatures.toArray(),{layer:s}=i,n=s.capabilities?.editing.supportsGlobalId&&"globalIdField"in s,o=u._attachmentFileInfos;if(n){const e=J(r,s,o);return void await a(s,e,{globalIdUsed:!0})}const l=await a(s,{addFeatures:r});if(o.size>0){const e=l?.addFeatureResults??[];await t(s,B(r,e,s,o))}}});return u._set("steps",this._createWorkflowSteps(u,o)),u}_fadeExistingFeatures(e){if("effect"in e){const t=e.effect;return e.effect="saturate(0.6) opacity(0.8)",r((()=>e.effect=t))}const t=e.opacity;return e.opacity=.7,r((()=>e.opacity=t))}_highlight(e){const t=this.data.viewModel.view;"3d"===t?.type&&this._highlightHandles.set(e,t.highlight(e))}_removeHighlight(e){o(this._highlightHandles.get(e)),this._highlightHandles.delete(e)}async _startCreating(e){this.removeHandles(z);const{creationInfo:t}=this.data;if(!t)return;this.createFeatureState="create-new";const a=await C(this._sketchViewModel,t,e);this.addHandles(a,z)}async _startUpdating({feature:e,webStyleCache:t,initialFeature:a=e}){const{data:i,pendingFeatures:r}=this;r.includes(e)||i.addPendingFeature(e,a);const{_featureFormViewModel:n,_sketchViewModel:l}=this,{creationInfo:c,viewModel:h}=i,{attachmentsViewModel:u,layerInfos:p,view:f}=h;if(!f||!c)return;const m=c.layer,g=S(p,m),w=g?.formTemplate,y=f.spatialReference;n.set({arcadeEditType:"INSERT",feature:e,formTemplate:w,spatialReference:y,map:f.map}),"add"!==u.mode&&"edit"!==u.mode||h.activeWorkflow?.previous(),u.graphic=e,u.fileInfos.removeAll(),u.mode="view";if((this._attachmentFileInfos.get(e)||[]).forEach((({file:e,form:t})=>u.addFile(e,t))),this._removeHighlight(e),await H(e,t,"2d"===f.type?f.scale:null),this.removeHandles(z),o(this._featureFormHandle),"2d"===f.type){const a=d((()=>f.scale),(a=>this._updateGraphicDebounced(e,t,a)));this.addHandles(a,z)}const _=i.getEditsForPendingFeature(e);return this._featureFormHandle=s([n.on("value-change",(async()=>{_?.updateAttributes(n.getValues()),await H(e,t,"2d"===f.type?f.scale:null)})),l.on(["update","undo","redo"],(e=>{("undo"===e.type||"redo"===e.type||"update"===e.type&&null!=e.toolEventInfo&&j(e.toolEventInfo.type))&&n.notifyFeatureGeometryChanged()})),d((()=>n.feature?.sourceLayer),(t=>e.sourceLayer=t))]),this.createFeatureState="update-pending",this._visualVariableAttributes=U(e),v(m)?void 0:O({graphic:e,sketchViewModel:l,sourceLayer:m,visualVariables:this._visualVariableAttributes,webStyleCache:t})}static _createWorkflowSteps(e,t="awaiting-feature-creation-info"){const{data:a}=e,i=E(["awaiting-feature-creation-info","creating-features","adding-attachment","editing-attachment"],t,{"awaiting-feature-creation-info":()=>({id:"awaiting-feature-creation-info",async setUp(){const{creationInfo:t,viewModel:i}=a,{view:r}=i;r&&(A(t)?e.addHandles(await k({view:r,data:a,next:()=>e.next(),cancel:()=>i.cancelWorkflow({warnIfNoWorkflow:!1})}),this.id):(a.parent&&t&&(e.addHandles(i.lockFeatureTemplatesViewModel(),this.id),i.featureTemplatesViewModel.layers=[t.layer]),e.addHandles(i.featureTemplatesViewModel.on("select",(({item:t})=>{t&&(a.creationInfo={...a.creationInfo,layer:t.layer,template:t.template},e.next())})),this.id)))},async tearDown(){e.removeHandles([this.id,z])}}),"creating-features":()=>({id:"creating-features",async setUp(){e._isActive&&await e._setUpCreatingFeaturesStep()},async tearDown(t){const{viewModel:i}=a;t.canceled&&(e.removeHandles([R,N,z,Z]),i.attachmentsViewModel.fileInfos.removeAll(),e._attachmentFileInfos.clear())}}),"adding-attachment":()=>({id:"adding-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}})});return D(a,i)}static _configureSketchViewModel(e,t){const{data:i}=e,{creationInfo:n,viewModel:o}=i,{view:l}=o,c=e._sketchViewModel;let d=null;const h=[];if(!l)return r();"2d"===l.type&&n&&h.push(e._fadeExistingFeatures(n.layer));const p=async a=>{if("cancel"===a.state){if(e._preventDefaultActionOnCancel)return void(e._preventDefaultActionOnCancel=!1);if(null==l.activeTool){if(e._lastActiveGraphics.length<1)return e._startCreating(t);const a=e._lastActiveGraphics.pop();return e._startUpdating({feature:a,webStyleCache:t})}return e._waitForActiveToolCleared().then((()=>e._startCreating(t)))}if("complete"===a.state&&a.graphic){const i=a.graphic.clone();return i.geometry=null,e._startUpdating({feature:a.graphic,webStyleCache:t,initialFeature:i})}},f=async a=>{const{attachmentsViewModel:i}=o,{_featureFormViewModel:r}=e,s=a.graphics[0];if("complete"===a.state){s!==d&&(e._lastActiveGraphics.push(s),e._highlight(s)),d=null;const{hasPendingSubtypeChoice:c,submittable:h}=r;if(e.numPendingFeatures===n?.maxFeatures||c||!h){!h&&r.submit();const a=e._lastActiveGraphics.pop();return null===o.view?.activeTool?e._startUpdating({feature:a,webStyleCache:t}):e._waitForActiveToolCleared().then((()=>e._startUpdating({feature:a,webStyleCache:t})))}if("add"!==i.mode&&"edit"!==i.mode||o.activeWorkflow?.previous(),a.aborted&&e._preventDefaultActionOnCancel)return void(e._preventDefaultActionOnCancel=!1);if(e.addHandles([P(l),l.on("click",(e=>e.preventDefault()))],N),await u((()=>!r.updating)),e.removeHandles(N),null!=o.view?.activeTool)return e._waitForActiveToolCleared().then((()=>{const a=e._lastActiveGraphics.pop();if(a)return e._startUpdating({feature:a,webStyleCache:t})}));e._startCreating(t)}"start"===a.state&&e._removeHighlight(s);const c=e._visualVariableAttributes;await G(l,s,a,c,t);const h=s.attributes,{rotation:p,size:f}=c;if(null!=p){const{field:e}=p;r.setValue(e,h[e])}if(null!=f){const{field:e}=f;r.setValue(e,h[e])}},m=t=>{const r=t.graphics[0];i.removePendingFeature(r),a(e._lastActiveGraphics,r),d=r},g=async a=>{if(A(n))return;const{results:i}=await l.hitTest(a,{include:c.layer}),r=i.find((e=>"graphic"===e.type&&e.graphic.sourceLayer===n?.layer));if(!r)return;const s=r.graphic;if("transform"===c.activeTool||"reshape"===c.activeTool){if(c.updateGraphics.at(0)===s)return;const{submittable:a,hasPendingSubtypeChoice:i}=e._featureFormViewModel;if(!a||i)return;await e.updatePendingFeature(s,t)}};h.push(c.on("create",(t=>e._updatingHandles.addPromise(p(t)))),c.on("update",(t=>e._updatingHandles.addPromise(f(t)))),c.on("delete",(e=>m(e))),l.on("immediate-click",(t=>e._updatingHandles.addPromise(g(t))),F.TOOL),r((()=>{e._preventDefaultActionOnCancel=!0,c.cancel()})),K(c,i));const w=s(h);return c.addHandles(w),w}_initializeSketchViewModel(){const{data:e}=this,{view:t}=e.viewModel,a=new y({elevationInfo:e.creationInfo?.layer.elevationInfo,internal:!0,listMode:"hide"}),i=new W({layer:a,sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,updateOnGraphicClick:!1,view:t});this._sketchViewModel=i,t?.map.add(a),this.addHandles(r((()=>{t?.destroyed||t?.map.remove(a),a.destroy()})))}async _setUpCreatingFeaturesStep(){if(this.hasHandles(R))return;const{data:e}=this,{creationInfo:a,viewModel:n}=e,{attachmentsViewModel:l,view:c}=n;if(!c||!a?.layer)throw new i("missing-parameters","CreateFeaturesWorkflow requires a view and creationInfo.");this._preventDefaultActionOnCancel=!1;const{initialFeature:u,layer:p}=a,f=this._sketchViewModel,m=new Map,g=[];this._lastActiveGraphics=[],this._featureFormHandle=o(this._featureFormHandle),this._visualVariableAttributes={rotation:null,size:null},this.data.editorItem=n.findEditorItemForLayer(a.layer),T(l),g.push(d((()=>l.mode),(e=>{switch(e){case"add":this.go("adding-attachment");break;case"edit":this.go("editing-attachment")}})));const y=P(c);g.push(y);const _=v(a.layer);try{if(_){const{template:e}=a;if(e&&w(e))throw new i("Shared templates are not yet supported");const r=u??new t({attributes:{...e?.prototype.attributes,...a.attributeOverrides},sourceLayer:p});await this._startUpdating({feature:r,webStyleCache:m})}else g.push(x._configureSketchViewModel(this,m)),u?(f.layer.add(u),await this._startUpdating({feature:u,webStyleCache:m})):await this._startCreating(m)}finally{y.remove()}const F=r((()=>{for(const t of e.pendingFeatures)f.layer.remove(t),e.removePendingFeature(t)})),M=d((()=>c?.timeZone),(e=>this._featureFormViewModel.timeZone=e),h),b=r((()=>{A(a)&&n.cancelWorkflow({warnIfNoWorkflow:!1})}));this._featureFormHandle&&g.push(this._featureFormHandle),this.addHandles(g,this._handleKeys.beforeCommit),this.addHandles([r((()=>l.fileInfos.removeAll())),s(g),b,F,M],R)}async _waitForActiveToolCleared(){const e=this.data.viewModel.view;if(null==e?.activeTool)return;const t=new AbortController;this.addHandles(n(t),Z),await u((()=>null==e?.activeTool),t.signal),t.abort()}};function K(e,t){let a=null;const i=()=>e.snappingOptions.featureSources,n=()=>(a=new b({layer:e.layer}),i().add(a),a),o=()=>{null!=a&&(i().remove(a),a=l(a))};return s([d((()=>{const e=t.creationInfo?.layer,a=i().find((t=>t.layer===e));return{hasFeatureLayerSource:!!a,enabled:a?.enabled??!1}}),(({hasFeatureLayerSource:e,enabled:t})=>{if(!e)return o();a??=n(),a.enabled=t}),p),r(o)])}function B(e,t,a,i){const r=[];return t.forEach(((t,s)=>{if(!t.error){const n=e[s],o=i.get(n)||[];n.attributes[a.objectIdField]=t.objectId,o.forEach((({form:e})=>r.push({feature:n,attachment:e})))}})),r}function J(e,t,a){const i=[],r=t.globalIdField;return e.forEach(((t,s)=>{e[s].attributes[r]??=f(),(a?.get(t)||[]).forEach((({file:e})=>i.push({feature:t,attachment:{globalId:f(),data:e}})))})),i.length?{addFeatures:e,addAttachments:i}:{addFeatures:e}}e([m()],q.prototype,"createFeatureState",void 0),e([m()],q.prototype,"data",void 0),e([m({constructOnly:!0})],q.prototype,"isNested",void 0),e([m()],q.prototype,"featureFormViewModel",null),e([m()],q.prototype,"hasPendingEdits",null),e([m()],q.prototype,"_getDrawMeshHelpMessage",void 0),e([m()],q.prototype,"helpMessage",null),e([m()],q.prototype,"layer",null),e([m()],q.prototype,"parent",null),e([m()],q.prototype,"parentLayer",null),e([m()],q.prototype,"keyboardCancellationEnabled",null),e([m()],q.prototype,"reliesOnOwnerAdminPrivileges",null),e([m()],q.prototype,"shouldShowAttachments",null),e([m()],q.prototype,"shouldAllowAttachmentEditing",null),e([m()],q.prototype,"sketchViewModel",null),q=x=e([g("esri.widgets.Editor.CreateFeaturesWorkflow")],q);const Q=q;export{Q as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import{remove as a}from"../../core/arrayUtils.js";import i from"../../core/Error.js";import{makeHandle as r,handlesGroup as s,abortHandle as n}from"../../core/handleUtils.js";import"../../core/has.js";import{removeMaybe as o,destroyMaybe as l}from"../../core/maybe.js";import{debounce as c}from"../../core/promiseUtils.js";import{watch as d,initial as h,whenOnce as u,syncAndInitial as p}from"../../core/reactiveUtils.js";import{generateBracedUUID as f}from"../../core/uuid.js";import{property as m}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import{subclass as g}from"../../core/accessorSupport/decorators/subclass.js";import{isSharedTemplateOrMetadata as w}from"../../editing/templateUtils.js";import y from"../../layers/GraphicsLayer.js";import{isTable as v}from"../../layers/support/layerUtils.js";import{getDrawHelpMessage as _}from"../../views/draw/support/helpMessageUtils.js";import{ViewEventPriorities as F}from"../../views/input/InputManager.js";import M from"../../views/interactive/sketch/SketchOptions.js";import b from"../../views/interactive/snapping/FeatureSnappingLayerSource.js";import I from"./CreateFeaturesWorkflowData.js";import{isModelUpload as A,handleModelUpload as k}from"./modelUploadUtils.js";import V from"./Workflow.js";import{startCreatingNewFeature as C,findLayerInfo as S,updateGraphicSymbolWhenRequired as H,isTerminalUpdateEventType as j,getVisualVariableAttributes as U,startUpdatingFeature as O,createWorkflowSteps as E,avoidFeatureTemplateSelectionWithOnlyOneItem as D,prepareAttachmentsForCreateFeaturesWorkflow as T,showProgressCursor as P,visualVariableInteractiveUpdate as G}from"./workflowUtils.js";import L from"../FeatureForm/FeatureFormViewModel.js";import W from"../Sketch/SketchViewModel.js";var x;const N=Symbol(),z=Symbol(),R=Symbol(),Z=Symbol();let q=x=class extends V{constructor(e){super(e),this.type="create-features",this.createFeatureState="create-new",this.data=void 0,this.isNested=!1,this._getDrawMeshHelpMessage=void 0,this._featureFormHandle=null,this._visualVariableAttributes={rotation:null,size:null},this._featureFormViewModel=new L,this._sketchViewModel=null,this._attachmentFileInfos=new Map,this._highlightHandles=new Map,this._preventDefaultActionOnCancel=!1,this._lastActiveGraphics=[],this._isActive=!0,this._updateGraphicDebounced=c(((e,t,a)=>H(e,t,a)))}initialize(){this.isNested&&(this._isActive=!1),this._initializeSketchViewModel()}destroy(){this._sketchViewModel.destroy()}get featureFormViewModel(){return this._featureFormViewModel}get hasPendingEdits(){if(this.pendingFeatures.some((e=>!!this.data.getEditsForPendingFeature(e)?.modified)))return!0;const{creationInfo:e,upload:t}=this.data,a=this._sketchViewModel,{activeComponent:i}=a,r=a.createGraphic?.geometry?.type;return!("polyline"!==r&&"polygon"!==r&&"multipoint"!==r||"draw-2d"!==i?.type&&"draw-3d"!==i?.type)&&i.drawOperation.committedVertices.length>0||(!(!t||"pending"!==t.state&&"success"!==t.state)||!!e?.geometryToPlace)}get helpMessage(){const{creationInfo:e,viewModel:t}=this.data;if("creating-features"!==this.stepId||!e)return;const a=e.layer.geometryType,i=this._sketchViewModel.createGraphic;if("mesh"===a){this._getDrawMeshHelpMessage||import("../../views/draw/support/helpMessageUtils3d.js").then((e=>{this._getDrawMeshHelpMessage=e.getDrawMeshHelpMessage}));const{view:e}=t;return"3d"===e?.type?this._getDrawMeshHelpMessage?.(i,e):void 0}const r=this._sketchViewModel.activeCreateToolDrawMode;return _(a,i?.geometry,r)}get layer(){return this.data.creationInfo?.layer}get numPendingFeatures(){return this.pendingFeatures.length}get parent(){return this.data.parent}get parentLayer(){return this.parent?.data.editorItem.layer}get pendingFeatures(){return this.data.pendingFeatures}get keyboardCancellationEnabled(){return 0===this.numPendingFeatures}get reliesOnOwnerAdminPrivileges(){return this.data.editorItem?.capabilities.create.reliesOnOwnerAdminPrivileges??!1}get shouldShowAttachments(){return this.data.editorItem?.capabilities.create.attachments.enabled??!1}get shouldAllowAttachmentEditing(){return this.shouldShowAttachments}get sketchViewModel(){return this._sketchViewModel}get test(){}async enter(){this._isActive=!0,"awaiting-feature-creation-info"!==this.stepId&&this._setUpCreatingFeaturesStep()}exit(){this._isActive=!1,this.removeHandles([R])}async updatePendingFeature(e,t){return this._preventDefaultActionOnCancel=!0,this._sketchViewModel.cancel(),a(this._lastActiveGraphics,e),this._startUpdating({feature:e,webStyleCache:t})}async start(){return await super.start(),v(this.data.creationInfo?.layer)?null:{enter:async()=>{},exit:async()=>{},viewModel:this._sketchViewModel}}static create(e){const{addAttachmentsCallback:t,applyEditsCallback:a,isNested:i,creationInfo:r,parent:s,snappingManager:n,startAt:o,viewModel:l}=e,c=e.sketchOptions??new M,d=r?.layer,h=d?l.findEditorItemForLayer(d):void 0,u=new x({data:new I({creationInfo:r,editorItem:h,parent:s,sketchOptions:c,snappingManager:n,viewModel:l}),isNested:i,onCommit:async e=>{const{creationInfo:i}=e;if(!i)return;const r=e.pendingFeatures.toArray(),{layer:s}=i,n=s.capabilities?.editing.supportsGlobalId&&"globalIdField"in s,o=u._attachmentFileInfos;if(n){const e=J(r,s,o);return void await a(s,e,{globalIdUsed:!0})}const l=await a(s,{addFeatures:r});if(o.size>0){const e=l?.addFeatureResults??[];await t(s,B(r,e,s,o))}}});return u._set("steps",this._createWorkflowSteps(u,o)),u}_fadeExistingFeatures(e){if("effect"in e){const t=e.effect;return e.effect="saturate(0.6) opacity(0.8)",r((()=>e.effect=t))}const t=e.opacity;return e.opacity=.7,r((()=>e.opacity=t))}_highlight(e){const t=this.data.viewModel.view;"3d"===t?.type&&this._highlightHandles.set(e,t.highlight(e))}_removeHighlight(e){o(this._highlightHandles.get(e)),this._highlightHandles.delete(e)}async _startCreating(e){this.removeHandles(z);const{creationInfo:t}=this.data;if(!t)return;this.createFeatureState="create-new";const a=await C(this._sketchViewModel,t,e);this.addHandles(a,z)}async _startUpdating({feature:e,webStyleCache:t,initialFeature:a=e}){const{data:i,pendingFeatures:r}=this;r.includes(e)||i.addPendingFeature(e,a);const{_featureFormViewModel:n,_sketchViewModel:l}=this,{creationInfo:c,viewModel:h}=i,{attachmentsViewModel:u,layerInfos:p,view:f}=h;if(!f||!c)return;const m=c.layer,g=S(p,m),w=g?.formTemplate,y=f.spatialReference;n.set({arcadeEditType:"INSERT",feature:e,formTemplate:w,spatialReference:y,map:f.map}),"add"!==u.mode&&"edit"!==u.mode||h.activeWorkflow?.previous(),u.graphic=e,u.fileInfos.removeAll(),u.mode="view";if((this._attachmentFileInfos.get(e)||[]).forEach((({file:e,form:t})=>u.addFile(e,t))),this._removeHighlight(e),await H(e,t,"2d"===f.type?f.scale:null),this.removeHandles(z),o(this._featureFormHandle),"2d"===f.type){const a=d((()=>f.scale),(a=>this._updateGraphicDebounced(e,t,a)));this.addHandles(a,z)}const _=i.getEditsForPendingFeature(e);return this._featureFormHandle=s([n.on("value-change",(async()=>{_?.updateAttributes(n.getValues()),await H(e,t,"2d"===f.type?f.scale:null)})),l.on(["update","undo","redo"],(e=>{("undo"===e.type||"redo"===e.type||"update"===e.type&&null!=e.toolEventInfo&&j(e.toolEventInfo.type))&&n.notifyFeatureGeometryChanged()})),d((()=>n.feature?.sourceLayer),(t=>e.sourceLayer=t))]),this.createFeatureState="update-pending",this._visualVariableAttributes=U(e),v(m)?void 0:O({graphic:e,sketchViewModel:l,sourceLayer:m,visualVariables:this._visualVariableAttributes,webStyleCache:t})}static _createWorkflowSteps(e,t="awaiting-feature-creation-info"){const{data:a}=e,i=E(["awaiting-feature-creation-info","creating-features","adding-attachment","editing-attachment"],t,{"awaiting-feature-creation-info":()=>({id:"awaiting-feature-creation-info",async setUp(){const{creationInfo:t,viewModel:i}=a,{view:r}=i;r&&(A(t)?e.addHandles(await k({view:r,data:a,next:()=>e.next(),cancel:()=>i.cancelWorkflow({warnIfNoWorkflow:!1})}),this.id):(a.parent&&t&&(e.addHandles(i.lockFeatureTemplatesViewModel(),this.id),i.featureTemplatesViewModel.layers=[t.layer]),e.addHandles(i.featureTemplatesViewModel.on("select",(({item:t})=>{t&&(a.creationInfo={...a.creationInfo,layer:t.layer,template:t.template},e.next())})),this.id)))},async tearDown(){e.removeHandles([this.id,z])}}),"creating-features":()=>({id:"creating-features",async setUp(){e._isActive&&await e._setUpCreatingFeaturesStep()},async tearDown(t){const{viewModel:i}=a;t.canceled&&(e.removeHandles([R,N,z,Z]),i.attachmentsViewModel.fileInfos.removeAll(),e._attachmentFileInfos.clear())}}),"adding-attachment":()=>({id:"adding-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}})});return D(a,i)}static _configureSketchViewModel(e,t){const{data:i}=e,{creationInfo:n,viewModel:o}=i,{view:l}=o,c=e._sketchViewModel;let d=null;const h=[];if(!l)return r();"2d"===l.type&&n&&h.push(e._fadeExistingFeatures(n.layer));const p=async a=>{if("cancel"===a.state){if(e._preventDefaultActionOnCancel)return void(e._preventDefaultActionOnCancel=!1);if(null==l.activeTool){if(e._lastActiveGraphics.length<1)return e._startCreating(t);const a=e._lastActiveGraphics.pop();return e._startUpdating({feature:a,webStyleCache:t})}return e._waitForActiveToolCleared().then((()=>e._startCreating(t)))}if("complete"===a.state&&a.graphic){const i=a.graphic.clone();return i.geometry=null,e._startUpdating({feature:a.graphic,webStyleCache:t,initialFeature:i})}},f=async a=>{const{attachmentsViewModel:i}=o,{_featureFormViewModel:r}=e,s=a.graphics[0];if("complete"===a.state){s!==d&&(e._lastActiveGraphics.push(s),e._highlight(s)),d=null;const{hasPendingSubtypeChoice:c,submittable:h}=r;if(e.numPendingFeatures===n?.maxFeatures||c||!h){!h&&r.submit();const a=e._lastActiveGraphics.pop();return null===o.view?.activeTool?e._startUpdating({feature:a,webStyleCache:t}):e._waitForActiveToolCleared().then((()=>e._startUpdating({feature:a,webStyleCache:t})))}if("add"!==i.mode&&"edit"!==i.mode||o.activeWorkflow?.previous(),a.aborted&&e._preventDefaultActionOnCancel)return void(e._preventDefaultActionOnCancel=!1);if(e.addHandles([P(l),l.on("click",(e=>e.preventDefault()))],N),await u((()=>!r.updating)),e.removeHandles(N),null!=o.view?.activeTool)return e._waitForActiveToolCleared().then((()=>{const a=e._lastActiveGraphics.pop();if(a)return e._startUpdating({feature:a,webStyleCache:t})}));e._startCreating(t)}"start"===a.state&&e._removeHighlight(s);const c=e._visualVariableAttributes;await G(l,s,a,c,t);const h=s.attributes,{rotation:p,size:f}=c;if(null!=p){const{field:e}=p;r.setValue(e,h[e])}if(null!=f){const{field:e}=f;r.setValue(e,h[e])}},m=t=>{const r=t.graphics[0];i.removePendingFeature(r),a(e._lastActiveGraphics,r),d=r},g=async a=>{if(A(n))return;const{results:i}=await l.hitTest(a,{include:c.layer}),r=i.find((e=>"graphic"===e.type&&e.graphic.sourceLayer===n?.layer));if(!r)return;const s=r.graphic;if("transform"===c.activeTool||"reshape"===c.activeTool){if(c.updateGraphics.at(0)===s)return;const{submittable:a,hasPendingSubtypeChoice:i}=e._featureFormViewModel;if(!a||i)return;await e.updatePendingFeature(s,t)}};h.push(c.on("create",(t=>e._updatingHandles.addPromise(p(t)))),c.on("update",(t=>e._updatingHandles.addPromise(f(t)))),c.on("delete",(e=>m(e))),l.on("immediate-click",(t=>e._updatingHandles.addPromise(g(t))),F.TOOL),r((()=>{e._preventDefaultActionOnCancel=!0,c.cancel()})),K(c,i));const w=s(h);return c.addHandles(w),w}_initializeSketchViewModel(){const{data:e}=this,{view:t}=e.viewModel,a=new y({elevationInfo:e.creationInfo?.layer.elevationInfo,internal:!0,listMode:"hide"}),i=new W({layer:a,sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,updateOnGraphicClick:!1,view:t});this._sketchViewModel=i,t?.map.add(a),this.addHandles(r((()=>{t?.destroyed||t?.map.remove(a),a.destroy()})))}async _setUpCreatingFeaturesStep(){if(this.hasHandles(R))return;const{data:e}=this,{creationInfo:a,viewModel:n}=e,{attachmentsViewModel:l,view:c}=n;if(!c||!a?.layer)throw new i("missing-parameters","CreateFeaturesWorkflow requires a view and creationInfo.");this._preventDefaultActionOnCancel=!1;const{initialFeature:u,layer:p}=a,f=this._sketchViewModel,m=new Map,g=[];this._lastActiveGraphics=[],this._featureFormHandle=o(this._featureFormHandle),this._visualVariableAttributes={rotation:null,size:null},this.data.editorItem=n.findEditorItemForLayer(a.layer),T(l),g.push(d((()=>l.mode),(e=>{switch(e){case"add":this.go("adding-attachment");break;case"edit":this.go("editing-attachment")}})));const y=P(c);g.push(y);const _=v(a.layer);try{if(_){const{template:e}=a;if(e&&w(e))throw new i("Shared templates are not yet supported");const r=u??new t({attributes:{...e?.prototype.attributes,...a.attributeOverrides},sourceLayer:p});await this._startUpdating({feature:r,webStyleCache:m})}else g.push(x._configureSketchViewModel(this,m)),u?(f.layer.add(u),await this._startUpdating({feature:u,webStyleCache:m})):await this._startCreating(m)}finally{y.remove()}const F=r((()=>{for(const t of e.pendingFeatures)f.layer.remove(t),e.removePendingFeature(t)})),M=d((()=>c?.timeZone),(e=>this._featureFormViewModel.timeZone=e),h),b=r((()=>{A(a)&&n.cancelWorkflow({warnIfNoWorkflow:!1})}));this._featureFormHandle&&g.push(this._featureFormHandle),this.addHandles(g,this._handleKeys.beforeCommit),this.addHandles([r((()=>l.fileInfos.removeAll())),s(g),b,F,M],R)}async _waitForActiveToolCleared(){const e=this.data.viewModel.view;if(null==e?.activeTool)return;const t=new AbortController;this.addHandles(n(t),Z),await u((()=>null==e?.activeTool),t.signal),t.abort()}};function K(e,t){let a=null;const i=()=>e.snappingOptions.featureSources,n=()=>(a=new b({layer:e.layer}),i().add(a),a),o=()=>{null!=a&&(i().remove(a),a=l(a))};return s([d((()=>{const e=t.creationInfo?.layer,a=i().find((t=>t.layer===e));return{hasFeatureLayerSource:!!a,enabled:a?.enabled??!1}}),(({hasFeatureLayerSource:e,enabled:t})=>{if(!e)return o();a??=n(),a.enabled=t}),p),r(o)])}function B(e,t,a,i){const r=[];return t.forEach(((t,s)=>{if(!t.error){const n=e[s],o=i.get(n)||[];n.attributes[a.objectIdField]=t.objectId,o.forEach((({form:e})=>r.push({feature:n,attachment:e})))}})),r}function J(e,t,a){const i=[],r=t.globalIdField;return e.forEach(((t,s)=>{e[s].attributes[r]??=f(),(a?.get(t)||[]).forEach((({file:e})=>i.push({feature:t,attachment:{globalId:f(),data:e}})))})),i.length?{addFeatures:e,addAttachments:i}:{addFeatures:e}}e([m()],q.prototype,"createFeatureState",void 0),e([m()],q.prototype,"data",void 0),e([m({constructOnly:!0})],q.prototype,"isNested",void 0),e([m()],q.prototype,"featureFormViewModel",null),e([m()],q.prototype,"hasPendingEdits",null),e([m()],q.prototype,"_getDrawMeshHelpMessage",void 0),e([m()],q.prototype,"helpMessage",null),e([m()],q.prototype,"layer",null),e([m()],q.prototype,"parent",null),e([m()],q.prototype,"parentLayer",null),e([m()],q.prototype,"keyboardCancellationEnabled",null),e([m()],q.prototype,"reliesOnOwnerAdminPrivileges",null),e([m()],q.prototype,"shouldShowAttachments",null),e([m()],q.prototype,"shouldAllowAttachmentEditing",null),e([m()],q.prototype,"sketchViewModel",null),q=x=e([g("esri.widgets.Editor.CreateFeaturesWorkflow")],q);const Q=q;export{Q as default};
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import LinkChartLayoutSwitcherViewModel = __esri.LinkChartLayoutSwitcherViewModel;
4
+ export default LinkChartLayoutSwitcherViewModel;