@arcgis/core 5.2.0-next.13 → 5.2.0-next.14

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 (303) hide show
  1. package/arcgisGlobal.d.ts +3 -3
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/03354e9256b2f77fd4f2.js +1 -0
  4. package/assets/esri/core/workers/chunks/0826d36dfbfa28442b70.js +1 -0
  5. package/assets/esri/core/workers/chunks/{87c2d4d58c2487324fb7.js → 0a8ba5cb857f61de40fb.js} +3 -3
  6. package/assets/esri/core/workers/chunks/152f1c08197955224ad3.js +1 -0
  7. package/assets/esri/core/workers/chunks/1a0903b1d2d5101977c6.js +1 -0
  8. package/assets/esri/core/workers/chunks/{de541ad390a8d258d2e6.js → 1d5db8746a4f1ed1d18f.js} +1 -1
  9. package/assets/esri/core/workers/chunks/1effde6a39ef0d4af525.js +1 -0
  10. package/assets/esri/core/workers/chunks/{2a5176533e78a92d8e5b.js → 20c729fca2e4b4c6b28d.js} +1 -1
  11. package/assets/esri/core/workers/chunks/23d50c4478f40a7d62bf.js +1 -0
  12. package/assets/esri/core/workers/chunks/2623cd08487fdc9a94f1.js +1 -0
  13. package/assets/esri/core/workers/chunks/2c3fc2805f6de0963789.js +1 -0
  14. package/assets/esri/core/workers/chunks/2c4f10eaf02ef090ee8f.js +1 -0
  15. package/assets/esri/core/workers/chunks/314bc1b356d43bfa72a8.js +1 -0
  16. package/assets/esri/core/workers/chunks/{34544c79ce568f30a094.js → 31762eb20a9a0ed3f8b0.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{26dca1d387183282276a.js → 318a2702632aaa4d3a63.js} +1 -1
  18. package/assets/esri/core/workers/chunks/3526ab3b1f87c24ae6f8.js +1 -0
  19. package/assets/esri/core/workers/chunks/{81808c3aead7dfac3049.js → 38cfedce779dd75bd217.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{5075e85e1eafd431a8c0.js → 39c994536ce6c1e5c956.js} +1 -1
  21. package/assets/esri/core/workers/chunks/3b74749db78bcba2bc16.js +1 -0
  22. package/assets/esri/core/workers/chunks/3d83ac791212b81c9d11.js +1 -0
  23. package/assets/esri/core/workers/chunks/3ecb906322a6a5c8c93b.js +1 -0
  24. package/assets/esri/core/workers/chunks/3f67162456a1f02190fa.js +1 -0
  25. package/assets/esri/core/workers/chunks/{ef46ef4f0ee9f2aeaa4a.js → 426b8e1e2eef2460851d.js} +1 -1
  26. package/assets/esri/core/workers/chunks/4376bc2934a996d8bc27.js +1 -0
  27. package/assets/esri/core/workers/chunks/44d0ca9d4c5f1722688c.js +1 -0
  28. package/assets/esri/core/workers/chunks/{e25bcfdd8f20f8a08b19.js → 4d57c771af4137f74bfb.js} +1 -1
  29. package/assets/esri/core/workers/chunks/4e4419282c4bf7ee4678.js +1 -0
  30. package/assets/esri/core/workers/chunks/4e788fc6cb2ea936f676.js +1 -0
  31. package/assets/esri/core/workers/chunks/4f51963815b0d53ffbd9.js +1 -0
  32. package/assets/esri/core/workers/chunks/5100b5a6a506c704dfaf.js +1 -0
  33. package/assets/esri/core/workers/chunks/52afd43bbe23e358efb5.js +1 -0
  34. package/assets/esri/core/workers/chunks/5aba23584e0b230c75f5.js +1 -0
  35. package/assets/esri/core/workers/chunks/{d3c760109a70a71448c5.js → 67773a9f031d9f1d672f.js} +1 -1
  36. package/assets/esri/core/workers/chunks/6f7193b9ff5942c0d354.js +1 -0
  37. package/assets/esri/core/workers/chunks/70737052bab29fcaa120.js +1 -0
  38. package/assets/esri/core/workers/chunks/718d2d430c1a5a940b83.js +1 -0
  39. package/assets/esri/core/workers/chunks/71c996e1ae84d9daddf2.js +1 -0
  40. package/assets/esri/core/workers/chunks/753e0b21e57c12c742ee.js +1 -0
  41. package/assets/esri/core/workers/chunks/764c8ba14ab74b66b391.js +1 -0
  42. package/assets/esri/core/workers/chunks/{1996f0a930abdd97b855.js → 7a8ed08cd173963b3112.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{cc697c4d9cdc116373dc.js → 81726d997a2d34449bb2.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{74e1826ad9e2c4fd3b42.js → 81883bca8a79ee2ddb00.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{9fee0110dc7fee4c95e2.js → 854c320af09b6afc4b80.js} +2 -2
  46. package/assets/esri/core/workers/chunks/85505a8b8b0794656d06.js +1 -0
  47. package/assets/esri/core/workers/chunks/859bc873e7af911a518f.js +1 -0
  48. package/assets/esri/core/workers/chunks/{8407c91cce31e087b41b.js → 886ae23a1d8fa21e531f.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{3ff7aa216cd794d951e8.js → 8e99f937fd36cf2cd05f.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{c357c0a08b99c1e7f290.js → 9331969046f2b277d620.js} +1 -1
  51. package/assets/esri/core/workers/chunks/93d08d82ceab19e314f8.js +1 -0
  52. package/assets/esri/core/workers/chunks/97a654e8054302582a3b.js +1 -0
  53. package/assets/esri/core/workers/chunks/97d2bdbea39cbcf8fd0f.js +1 -0
  54. package/assets/esri/core/workers/chunks/a0208e35b217808777c4.js +1 -0
  55. package/assets/esri/core/workers/chunks/{f25bb204cf6727f6fdef.js → a0876a52a3c2ad849370.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{7ad09ac5793e8d47b4b2.js → a4b970a841b3085500fc.js} +1 -1
  57. package/assets/esri/core/workers/chunks/aa5f36d7ed59c625ba78.js +1 -0
  58. package/assets/esri/core/workers/chunks/b045bffb4f2eb9203183.js +1 -0
  59. package/assets/esri/core/workers/chunks/b590402170ae289290d7.js +1 -0
  60. package/assets/esri/core/workers/chunks/b9935cc8e2bd4045058a.js +1 -0
  61. package/assets/esri/core/workers/chunks/{1a527c0740d9f4fa0791.js → bc547cf814d6703cef59.js} +1 -1
  62. package/assets/esri/core/workers/chunks/bcc097271f5cdf0a97a7.js +1 -0
  63. package/assets/esri/core/workers/chunks/bdc66ef2b6ed783047d5.js +1 -0
  64. package/assets/esri/core/workers/chunks/be1d2c3a61e6447fbbc7.js +1 -0
  65. package/assets/esri/core/workers/chunks/bf6ae205fbfbfcd1a0ee.js +1 -0
  66. package/assets/esri/core/workers/chunks/bfd1aef8ac795e1ce227.js +1 -0
  67. package/assets/esri/core/workers/chunks/c148ad0ea9258046ac1f.js +1 -0
  68. package/assets/esri/core/workers/chunks/{0f75c19d8e296a32e329.js → c2cd80b712f29e8cbb8d.js} +1 -1
  69. package/assets/esri/core/workers/chunks/cc0efa716b8414a44398.js +1 -0
  70. package/assets/esri/core/workers/chunks/{8f6833671c071b522923.js → cd66bd30f654fe571e57.js} +1 -1
  71. package/assets/esri/core/workers/chunks/cf41a66fb97c1076fb34.js +1 -0
  72. package/assets/esri/core/workers/chunks/cf8ce21dc649021e97f6.js +1 -0
  73. package/assets/esri/core/workers/chunks/d3be4d914fc99a1d686c.js +1 -0
  74. package/assets/esri/core/workers/chunks/dbd2bfcbf3e0f86f07b8.js +1 -0
  75. package/assets/esri/core/workers/chunks/{6675d56f49d07a97dc40.js → dd0c1cf921369e2bc48b.js} +1 -1
  76. package/assets/esri/core/workers/chunks/df18b0a653b328d8d052.js +1 -0
  77. package/assets/esri/core/workers/chunks/df54e741db40b308c2dd.js +2 -0
  78. package/assets/esri/core/workers/chunks/{89e09276086745aa21fa.js → e4e2f479c0c45ae1b2c3.js} +1 -1
  79. package/assets/esri/core/workers/chunks/e656fd5ecf9ac059a87b.js +1 -0
  80. package/assets/esri/core/workers/chunks/{58a7cdebc3d182c15ec6.js → e77df11aee136d64ff0f.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{7a474ce61cf484df87b4.js → e80376832050a4b6d28a.js} +1 -1
  82. package/assets/esri/core/workers/chunks/f116331c6eca937aac8e.js +1 -0
  83. package/assets/esri/core/workers/chunks/{3b837b512999e6ab24bc.js → f148666308071bdb185a.js} +1 -1
  84. package/assets/esri/core/workers/chunks/f23e995320674b32e142.js +1 -0
  85. package/assets/esri/core/workers/chunks/f334bf192dff5af10a70.js +1 -0
  86. package/assets/esri/core/workers/chunks/f76b1fc36f5606cac2c8.js +1 -0
  87. package/assets/esri/core/workers/chunks/{893c0d28a5bf3f9f29f1.js → f93facf47aba9b128fcc.js} +1 -1
  88. package/assets/esri/core/workers/chunks/fa1336b60278017d2525.js +1 -0
  89. package/assets/esri/core/workers/chunks/{c911f0b5bdd43b66b731.js → fa3faec65882c5b6f1a0.js} +1 -1
  90. package/assets/esri/core/workers/chunks/fccc34b86454c56f27ab.js +1 -0
  91. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  92. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  93. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  94. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +5 -1
  95. package/assets/esri/themes/dark/main.css +1 -1
  96. package/assets/esri/themes/light/main.css +1 -1
  97. package/assets/esri/themes/light/view.css +1 -1
  98. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis.json +1 -1
  99. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_en.json +1 -1
  100. package/chunks/Component.glsl.js +6 -6
  101. package/chunks/GlobalIlluminationBlur.glsl.js +7 -7
  102. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  103. package/chunks/arcgis-knowledge-client-core.js +1 -1
  104. package/chunks/bundle2.js +1 -1
  105. package/config.js +1 -1
  106. package/core/promiseUtils.d.ts +1 -1
  107. package/core/promiseUtils.js +1 -1
  108. package/core/units.js +1 -1
  109. package/form/types.d.ts +1 -1
  110. package/geometry/Mesh.d.ts +220 -95
  111. package/geometry/operators/support/projectionZScaling.js +1 -1
  112. package/geometry/support/MeshGeoreferencedVertexSpace.d.ts +35 -13
  113. package/geometry/support/MeshLocalVertexSpace.d.ts +32 -8
  114. package/geometry/support/MeshVertexAttributes.d.ts +6 -2
  115. package/geometry/support/heightModelInfoUtils.js +1 -1
  116. package/geometry/support/zscale.js +1 -1
  117. package/graphic/{AnnotationGraphicOrigin.d.ts → AnnotationFeatureGraphicOrigin.d.ts} +9 -9
  118. package/graphic/{AnnotationGraphicOrigin.js → AnnotationFeatureGraphicOrigin.js} +1 -1
  119. package/interfaces.d.ts +3 -3
  120. package/kernel.js +1 -1
  121. package/layers/{AnnotationLayer.d.ts → AnnotationFeatureLayer.d.ts} +24 -24
  122. package/layers/AnnotationFeatureLayer.js +2 -0
  123. package/layers/GaussianSplatLayer.d.ts +4 -1
  124. package/layers/graphics/data/QueryEngine.js +1 -1
  125. package/layers/graphics/data/queryUtils.js +1 -1
  126. package/layers/graphics/sources/parquet/ParquetFileStatistics.js +1 -1
  127. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  128. package/layers/graphics/sources/support/parquetIdUtils.js +1 -1
  129. package/layers/save/featureLayerUtils.js +1 -1
  130. package/layers/support/AnnotationSublayer.d.ts +7 -7
  131. package/layers/support/FeatureEffect.d.ts +3 -2
  132. package/layers/support/arcgisLayers.js +1 -1
  133. package/layers/support/fetchService.js +1 -1
  134. package/layers/support/layerUtils.js +1 -1
  135. package/layers/support/layersLoader.js +1 -1
  136. package/layers/support/parquetUtils.js +1 -1
  137. package/layers/support/schemaValidator.js +1 -1
  138. package/layers/types.d.ts +1 -1
  139. package/networks/Network.js +1 -1
  140. package/networks/UtilityNetwork.js +1 -1
  141. package/networks/support/networkFieldUtils.js +1 -1
  142. package/package.json +2 -2
  143. package/portal/schemas/definitions.js +1 -1
  144. package/portal/schemas/gaussianSplatLayerItem.js +2 -0
  145. package/portal/schemas/integratedMesh3DTilesLayerItem.js +1 -1
  146. package/portal/support/loadUtils.js +1 -1
  147. package/renderers/support/types.d.ts +1 -1
  148. package/renderers/visualVariables/RotationVariable.d.ts +1 -16
  149. package/renderers/visualVariables/RotationVariable.js +1 -1
  150. package/rest/knowledgeGraph/ReplicaDefinition.d.ts +0 -2
  151. package/rest/knowledgeGraph/ServiceDefinition.d.ts +1 -1
  152. package/rest/knowledgeGraph/wasmInterface/replicaToWasmEncodedFactories.js +1 -1
  153. package/rest/knowledgeGraph/wasmInterface/wasmToReplicaFactories.js +1 -1
  154. package/rest/knowledgeGraphService.js +1 -1
  155. package/rest/networks/support/QueryAssociationsParameters.d.ts +2 -2
  156. package/rest/networks/support/SynthesizeAssociationGeometriesParameters.d.ts +2 -2
  157. package/rest/networks/support/TraceParameters.d.ts +2 -2
  158. package/rest/support/AttributeBinsQuery.js +1 -1
  159. package/rest/support/Query.js +1 -1
  160. package/rest/support/TopFeaturesQuery.js +1 -1
  161. package/support/revision.js +1 -1
  162. package/views/2d/engine/webgl/TextureManager.js +1 -1
  163. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  164. package/views/2d/engine/webgl/util/createMatcher.js +1 -1
  165. package/views/2d/layerViewModuleImportUtils.js +1 -1
  166. package/views/2d/layers/AnnotationFeatureLayerView2D.js +2 -0
  167. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  168. package/views/2d/layers/TileLayerView2D.js +1 -1
  169. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  170. package/views/2d/layers/support/annodime/annotationSchema.js +1 -1
  171. package/views/2d/types.d.ts +2 -2
  172. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  173. package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
  174. package/views/3d/layerViewModuleImportUtils.js +1 -1
  175. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  176. package/views/3d/support/GaussianSplatSortWorker.js +1 -1
  177. package/views/3d/support/GaussianSplatWorkerHandle.js +1 -1
  178. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  179. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  180. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  181. package/views/3d/terrain/Tile.js +1 -1
  182. package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
  183. package/views/3d/types.d.ts +1 -1
  184. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +7 -7
  185. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +29 -20
  186. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js +6 -8
  187. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TexelFormatInfo.js +2 -0
  188. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
  189. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
  190. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
  191. package/views/layers/{AnnotationLayerView.d.ts → AnnotationFeatureLayerView.d.ts} +6 -6
  192. package/views/layers/FeatureLikeLayerView.d.ts +2 -2
  193. package/views/layers/FeatureLikeLayerView.js +1 -1
  194. package/webdoc/widgets/FloorFilter.d.ts +14 -1
  195. package/webdoc/widgets/FloorFilter.js +1 -1
  196. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  197. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +12 -4
  198. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  199. package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
  200. package/widgets/BatchAttributeForm/ValueChangeTransaction.js +2 -0
  201. package/widgets/BatchAttributeForm/VisibleElements.d.ts +8 -1
  202. package/widgets/BatchAttributeForm/VisibleElements.js +1 -1
  203. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  204. package/widgets/BatchAttributeForm/css.js +1 -1
  205. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  206. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  207. package/widgets/BatchAttributeForm/inputs/BatchFormInputs.d.ts +3 -0
  208. package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
  209. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  210. package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
  211. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  212. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
  213. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  214. package/widgets/BatchAttributeForm/interfaceUtils.js +1 -1
  215. package/widgets/BatchAttributeForm/stringUtils.js +2 -0
  216. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  217. package/widgets/BatchAttributeForm/types.d.ts +19 -3
  218. package/widgets/BatchAttributeForm.js +1 -1
  219. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  220. package/widgets/Editor/AddAssociationWorkflowData.js +1 -1
  221. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  222. package/widgets/Editor/EditorViewModel.d.ts +1 -1
  223. package/widgets/Editor/EditorViewModel.js +1 -1
  224. package/widgets/Editor/MergeFeaturesWorkflow.d.ts +3 -3
  225. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  226. package/widgets/Editor/SplitFeatureWorkflow.d.ts +3 -3
  227. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  228. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  229. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  230. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  231. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  232. package/widgets/Editor/UpdateWorkflow.js +1 -1
  233. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  234. package/widgets/Editor/support/SketchController.js +1 -1
  235. package/widgets/Editor/workflowUtils.js +1 -1
  236. package/widgets/Editor.js +1 -1
  237. package/widgets/FloorFilter/FloorFilterViewModel.d.ts +10 -0
  238. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  239. package/assets/esri/core/workers/chunks/07cc5743cb6a9fd68adb.js +0 -1
  240. package/assets/esri/core/workers/chunks/0bb159ba0226122465cf.js +0 -1
  241. package/assets/esri/core/workers/chunks/160e5b99f1097a473e6b.js +0 -1
  242. package/assets/esri/core/workers/chunks/17e68828ca6ff6912d3e.js +0 -1
  243. package/assets/esri/core/workers/chunks/1e340536d3c5f94920b5.js +0 -1
  244. package/assets/esri/core/workers/chunks/24810c36ae09bb4e83dc.js +0 -1
  245. package/assets/esri/core/workers/chunks/274b82cb183ddd0042f3.js +0 -1
  246. package/assets/esri/core/workers/chunks/297ae764445e6f73a5ea.js +0 -1
  247. package/assets/esri/core/workers/chunks/29aba121db7f00e0cf81.js +0 -1
  248. package/assets/esri/core/workers/chunks/2a3145a595d19391bb8a.js +0 -1
  249. package/assets/esri/core/workers/chunks/3297658ccd8d4b9ce733.js +0 -1
  250. package/assets/esri/core/workers/chunks/38ca59db0e8f45bd7811.js +0 -1
  251. package/assets/esri/core/workers/chunks/3c5534c576528c1921d2.js +0 -1
  252. package/assets/esri/core/workers/chunks/40b3cdf81c79bbc44527.js +0 -2
  253. package/assets/esri/core/workers/chunks/41f12eb7c9b7086528d5.js +0 -1
  254. package/assets/esri/core/workers/chunks/426156137f279d979ddd.js +0 -1
  255. package/assets/esri/core/workers/chunks/4714241189c13d0db897.js +0 -1
  256. package/assets/esri/core/workers/chunks/537c5dd4cd0a067199d1.js +0 -1
  257. package/assets/esri/core/workers/chunks/538537f9bc866d9caa75.js +0 -1
  258. package/assets/esri/core/workers/chunks/5437a1c05c1bd2175981.js +0 -1
  259. package/assets/esri/core/workers/chunks/58ac245ff7fb57c1004f.js +0 -1
  260. package/assets/esri/core/workers/chunks/5c7aff9604b4576a0e1d.js +0 -1
  261. package/assets/esri/core/workers/chunks/5d3ddbf94539cb4f493e.js +0 -1
  262. package/assets/esri/core/workers/chunks/5eb9fdb076488de9cd83.js +0 -1
  263. package/assets/esri/core/workers/chunks/603177137eb680afe371.js +0 -1
  264. package/assets/esri/core/workers/chunks/629099f05ca5c9ca1973.js +0 -1
  265. package/assets/esri/core/workers/chunks/62f78fa455d556008f6a.js +0 -1
  266. package/assets/esri/core/workers/chunks/686c51fd2144e132783e.js +0 -1
  267. package/assets/esri/core/workers/chunks/6f0341cfa4c68e6e60b3.js +0 -1
  268. package/assets/esri/core/workers/chunks/70229007d594536ba6a3.js +0 -1
  269. package/assets/esri/core/workers/chunks/7e89cb9ff615742e0894.js +0 -1
  270. package/assets/esri/core/workers/chunks/890b7a1153b7f65eba9a.js +0 -1
  271. package/assets/esri/core/workers/chunks/9660ae52fb3951a19e9c.js +0 -1
  272. package/assets/esri/core/workers/chunks/a4245bd4e67a428fd835.js +0 -1
  273. package/assets/esri/core/workers/chunks/ac33b10fe65f9e9e824f.js +0 -1
  274. package/assets/esri/core/workers/chunks/b5937ce657c1fff3864f.js +0 -1
  275. package/assets/esri/core/workers/chunks/c3cf9e6e91f71c9cc5f3.js +0 -1
  276. package/assets/esri/core/workers/chunks/c80fc1b3048e8d58a1f8.js +0 -1
  277. package/assets/esri/core/workers/chunks/cc3e895cff019e811c07.js +0 -1
  278. package/assets/esri/core/workers/chunks/d122431f3b0b88dcb488.js +0 -1
  279. package/assets/esri/core/workers/chunks/d24e027bb8b2c09f25c8.js +0 -1
  280. package/assets/esri/core/workers/chunks/d2df8c328054dc6cb7b7.js +0 -1
  281. package/assets/esri/core/workers/chunks/d41caf20c26f80385265.js +0 -1
  282. package/assets/esri/core/workers/chunks/d468994822f9bc3d6279.js +0 -1
  283. package/assets/esri/core/workers/chunks/d63f532dd7d60ee8ef2c.js +0 -1
  284. package/assets/esri/core/workers/chunks/d64613209a9eb1eafb11.js +0 -1
  285. package/assets/esri/core/workers/chunks/d7be278aed1fb37ad5ec.js +0 -1
  286. package/assets/esri/core/workers/chunks/d8ec0afb2b91ccf32e55.js +0 -1
  287. package/assets/esri/core/workers/chunks/da1e8b338ab9fe9e0a8e.js +0 -1
  288. package/assets/esri/core/workers/chunks/dd920a6f6422fa213eba.js +0 -1
  289. package/assets/esri/core/workers/chunks/e279bcbe4f10e87bde6c.js +0 -1
  290. package/assets/esri/core/workers/chunks/e2de13810dce01b98520.js +0 -1
  291. package/assets/esri/core/workers/chunks/e5837e5ac6ef761f26a2.js +0 -1
  292. package/assets/esri/core/workers/chunks/e82488b9b3bb0c1dedb4.js +0 -1
  293. package/assets/esri/core/workers/chunks/f274a8e8c7ca4294e876.js +0 -1
  294. package/assets/esri/core/workers/chunks/f292c2c22a3822343118.js +0 -1
  295. package/assets/esri/core/workers/chunks/f4f642ddd4d5db7cbbb4.js +0 -1
  296. package/assets/esri/core/workers/chunks/f6d047358d14328f3622.js +0 -1
  297. package/assets/esri/core/workers/chunks/fb6605be0c5e36785543.js +0 -1
  298. package/assets/esri/core/workers/chunks/fd70a25ffdf2cc6c5be2.js +0 -1
  299. package/layers/AnnotationLayer.js +0 -2
  300. package/views/2d/layers/AnnotationLayerView2D.js +0 -2
  301. /package/assets/esri/core/workers/chunks/{9fee0110dc7fee4c95e2.js.LICENSE.txt → 854c320af09b6afc4b80.js.LICENSE.txt} +0 -0
  302. /package/assets/esri/core/workers/chunks/{40b3cdf81c79bbc44527.js.LICENSE.txt → df54e741db40b308c2dd.js.LICENSE.txt} +0 -0
  303. /package/views/layers/{AnnotationLayerView.js → AnnotationFeatureLayerView.js} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import i from"../../../core/Collection.js";import{property as s,subclass as r}from"../../../core/accessorSupport/decorators.js";import{unknown as o,utc as l}from"../../../time/constants.js";import{isAttributeFormSupportedLayerUnion as n}from"../batchAttributeFormUtils.js";import{visibilityCodeToBoolean as a,makeUseId as p}from"./support/inputUtils.js";let u=class extends t{constructor(e){super(e),this.existsInAllLayers=!0,this.features=new i}get description(){return this.template.description}get effectiveTimeZone(){const{formTimeZone:e,layerTimeZone:t}=this.template;return e||t?t===o?l:e&&e!==o?e:t??"system":"system"}get featuresHaveSameCalculatedVisibility(){const e=new Set;for(const t of this.features){if(null==this.template.getExpressionExecutorsForLayer(t.layer)?.visibilityExpression){e.add(!0);continue}const i=this._lookupEvaluatedExpression(t,"visibility");if("success"===i?.status){if(e.add(!0===i.result),e.size>1)return!1}else e.add(!1)}return e.size<=1}get label(){return this.template.label}get layers(){return Array.from(new Set(this.features.map(e=>e.layer).filter(n)))}get visibilityCode(){return this._baseVisibilityCode}get visible(){return a(this.visibilityCode)}get _baseVisibilityCode(){return this.existsInAllLayers?this.featuresHaveSameCalculatedVisibility?!1===this._evaluatedVisibilityExpression?"hidden:visibility-expression:all-features":"visible":"hidden:visibility-expression:some-features":"hidden:not-in-all-layers"}get _evaluatedVisibilityExpression(){let e=!0,t=!0;for(const i of this.features){if(null==this.template.getExpressionExecutorsForLayer(i.layer)?.visibilityExpression){e=e&&!0;continue}t=!1;const s=this._lookupEvaluatedExpression(i,"visibility");"success"===s?.status?e=e&&!0===s.result:e=!1}return t?null:e}_lookupEvaluatedExpression(e,t,i){return this.expressionsManager.evaluatedExpressions.get(e)?.get(p({elementId:this.template.elementId,executorPurpose:t,textExpressionIndex:i}))}};e([s({constructOnly:!0})],u.prototype,"expressionsManager",void 0),e([s()],u.prototype,"description",null),e([s()],u.prototype,"effectiveTimeZone",null),e([s()],u.prototype,"existsInAllLayers",void 0),e([s()],u.prototype,"features",void 0),e([s()],u.prototype,"featuresHaveSameCalculatedVisibility",null),e([s()],u.prototype,"label",null),e([s()],u.prototype,"layers",null),e([s({constructOnly:!0})],u.prototype,"template",void 0),e([s()],u.prototype,"visibilityCode",null),e([s()],u.prototype,"visible",null),e([s()],u.prototype,"_baseVisibilityCode",null),e([s()],u.prototype,"_evaluatedVisibilityExpression",null),u=e([r("esri.widgets.BatchAttributeForm.inputs.InputBase")],u);const y=u;export{y as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import i from"../../../core/Collection.js";import{property as s,subclass as r}from"../../../core/accessorSupport/decorators.js";import{getEffectiveTimeZone as o,isAttributeFormSupportedLayerUnion as l}from"../batchAttributeFormUtils.js";import{visibilityCodeToBoolean as a,makeUseId as n}from"./support/inputUtils.js";let p=class extends t{constructor(e){super(e),this.existsInAllLayers=!0,this.features=new i}get description(){return this.template.description}get effectiveTimeZone(){return o(this.template.formTimeZone,this.template.layerTimeZone)}get featuresHaveSameCalculatedVisibility(){const e=new Set;for(const t of this.features){if(null==this.template.getExpressionExecutorsForLayer(t.layer)?.visibilityExpression){e.add(!0);continue}const i=this._lookupEvaluatedExpression(t,"visibility");if("success"===i?.status){if(e.add(!0===i.result),e.size>1)return!1}else e.add(!1)}return e.size<=1}get label(){return this.template.label}get layers(){return Array.from(new Set(this.features.map(e=>e.layer).filter(l)))}get visibilityCode(){return this._baseVisibilityCode}get visible(){return a(this.visibilityCode)}get _baseVisibilityCode(){return this.existsInAllLayers?this.featuresHaveSameCalculatedVisibility?!1===this._evaluatedVisibilityExpression?"hidden:visibility-expression:all-features":"visible":"hidden:visibility-expression:some-features":"hidden:not-in-all-layers"}get _evaluatedVisibilityExpression(){let e=!0,t=!0;for(const i of this.features){if(null==this.template.getExpressionExecutorsForLayer(i.layer)?.visibilityExpression){e=e&&!0;continue}t=!1;const s=this._lookupEvaluatedExpression(i,"visibility");"success"===s?.status?e=e&&!0===s.result:e=!1}return t?null:e}_lookupEvaluatedExpression(e,t,i){return this.expressionsManager.evaluatedExpressions.get(e)?.get(n({elementId:this.template.elementId,executorPurpose:t,textExpressionIndex:i}))}};e([s({constructOnly:!0})],p.prototype,"expressionsManager",void 0),e([s()],p.prototype,"description",null),e([s()],p.prototype,"effectiveTimeZone",null),e([s()],p.prototype,"existsInAllLayers",void 0),e([s()],p.prototype,"features",void 0),e([s()],p.prototype,"featuresHaveSameCalculatedVisibility",null),e([s()],p.prototype,"label",null),e([s()],p.prototype,"layers",null),e([s({constructOnly:!0})],p.prototype,"template",void 0),e([s()],p.prototype,"visibilityCode",null),e([s()],p.prototype,"visible",null),e([s()],p.prototype,"_baseVisibilityCode",null),e([s()],p.prototype,"_evaluatedVisibilityExpression",null),p=e([r("esri.widgets.BatchAttributeForm.inputs.InputBase")],p);const u=p;export{u as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{destroyMaybe as t}from"../../../core/maybe.js";import{on as l}from"../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{isSubtypeGroupLayer as o,getEffectiveLayerCapabilities as s}from"../../../layers/support/layerUtils.js";import{isRelatableFeatureSupportedLayer as a}from"../../../popup/support/featureUtils.js";import n from"./EditableInput.js";import p from"./SingleFeatureInputAdapter.js";import d from"../../Feature/FeatureRelationship/FeatureRelationshipViewModel.js";import{getComputedAttributes as h,parseFormTemplateString as u}from"../../FeatureForm/featureFormUtils.js";let y=class extends n{constructor(e){super(e),this._relationshipVM=new d,this._showAllCategories=!1,this._showAllRelatedRecords=!1,this.group=null,this.map=null,this.single=new p({input:this}),this.type="relationship"}initialize(){this._setRelationshipVMProps(),this.addHandles([l(()=>this.relatedLayer,"edits",()=>this._relationshipVM?.refresh())])}destroy(){t(this._relationshipVM)}get activeCategory(){return this._relationshipVM.activeCategory}get allCategories(){const{relatedLayer:e,_relationshipVM:t}=this;if(!o(e))return;const l=t?.categories,r=(e.subtypes??[]).map(({code:e,name:t})=>{const r=l?.find(e=>e.name===t);return{name:t,count:r?.count??0,value:r?.value??e}});return r.length?r:null}get categories(){return this.showAllEnabled?this.allCategories:this.allCategories?.slice(0,this.displayCount)}get canAddRelatedFeature(){const{editable:e,relatedFeatureCount:t,relationship:l}=this;if(!l||!this.loaded||!this._relatedLayerAllowsAdds)return!1;if(this.allCategories?.length&&!this.activeCategory)return!1;const{cardinality:r,role:i}=l;return!("one-to-one"===r&&t>0)&&("many-to-many"!==r&&(!("one-to-many"===r&&"destination"===i&&t>0)&&e))}get displayCount(){return this.template.displayCount}get displayType(){return this.template.displayType}get editable(){return!!this._relatedLayerAllowsAdds&&(this._evaluatedEditableExpression??!0)}get feature(){return this.single.feature}get relatedFeatureCount(){return this._relationshipVM?.featureCount??0}get label(){return this.activeCategory?.name?this.activeCategory.name:this.template.label}get layer(){return this.single.layer}get loaded(){return"loading"!==this._relationshipVM?.state}get orderByFields(){return this.template.orderByFields}get originHasValidKey(){return!!this.relationship&&null!=this.feature?.getAttribute(this.relationship.keyField)}get relationship(){return this._relationshipVM?.relationship}get relationshipId(){return this.template.relationshipId}get relatedFeatureInfos(){const{_relationshipVM:e,effectiveTimeZone:t}=this;if(!e?.relatedFeatures?.length||!e?.relatedLayer)return[];const{itemDescriptionFieldName:l,relatedFeatures:r,relatedLayer:i}=e,o=i?.formTemplate?.title||void 0;return r.map(e=>{let r;if(l){const o=e.getAttribute(l),s=i.fieldsIndex.get(l);if(s){const e=h({fields:[s],layer:i,values:[o],timeZone:t})[l];null!=e&&(r=e.toString())}}return{feature:e,description:r,title:o?u({attributes:e.attributes,label:o,layer:i,timeZone:t}):void 0}}).toArray()}get relatedLayer(){return this._relationshipVM?.relatedLayer}get relatedLayerIsTable(){return!!this.relatedLayer?.isTable}get showAllEnabled(){return this._relationshipVM.showAllEnabled}get showAllActionVisible(){return!this.showAllEnabled&&this.relatedFeatureCount>0&&this.relatedFeatureCount>this.displayCount}get showAllCategories(){return this._showAllCategories}get showAllCategoriesVisible(){const e=this.allCategories?.length??0;return!this.showAllEnabled&&e>0&&e>this.displayCount}get showAllRelatedRecords(){return this._showAllRelatedRecords}get updating(){return"loading"===this._relationshipVM?.state||"querying"===this._relationshipVM?.state}incrementPage(){this._relationshipVM&&this._relationshipVM.featurePage++}setActiveCategory(e){this._relationshipVM.activeCategory=e,this.setShowAllRelatedRecords(!!e)}setShowAllCategories(e){this._showAllCategories=e,this._showAllRelatedRecords||this._setShowAllEnabled(e)}setShowAllRelatedRecords(e){this._showAllRelatedRecords=e,this._showAllCategories||this._setShowAllEnabled(e)}get _relatedLayerAllowsAdds(){const{relatedLayer:e}=this;if(!e||!this._relatedLayerAllowsEdits)return!1;const t=s(e);return!!t?.operations?.supportsAdd}get _relatedLayerAllowsEdits(){const{relatedLayer:e}=this;if(!e)return!1;const t=s(e);return!!t?.operations?.supportsEditing}_setRelationshipVMProps(){const{displayCount:e,feature:t,layer:l,orderByFields:r,map:i,relationshipId:o,showAllEnabled:s}=this;t&&l&&a(l)&&this._relationshipVM.set({displayCount:e,graphic:t.plainGraphic,layer:l,map:i,orderByFields:r,relationshipId:o,showAllEnabled:s})}_setShowAllEnabled(e){this._relationshipVM.showAllEnabled=e}};e([r()],y.prototype,"_relationshipVM",void 0),e([r()],y.prototype,"_showAllCategories",void 0),e([r()],y.prototype,"_showAllRelatedRecords",void 0),e([r()],y.prototype,"activeCategory",null),e([r()],y.prototype,"allCategories",null),e([r()],y.prototype,"categories",null),e([r()],y.prototype,"canAddRelatedFeature",null),e([r()],y.prototype,"displayCount",null),e([r()],y.prototype,"displayType",null),e([r()],y.prototype,"editable",null),e([r()],y.prototype,"feature",null),e([r()],y.prototype,"group",void 0),e([r()],y.prototype,"label",null),e([r()],y.prototype,"layer",null),e([r()],y.prototype,"loaded",null),e([r()],y.prototype,"map",void 0),e([r()],y.prototype,"orderByFields",null),e([r()],y.prototype,"originHasValidKey",null),e([r()],y.prototype,"relationship",null),e([r()],y.prototype,"relationshipId",null),e([r()],y.prototype,"relatedFeatureInfos",null),e([r()],y.prototype,"relatedLayer",null),e([r()],y.prototype,"relatedLayerIsTable",null),e([r({readOnly:!0})],y.prototype,"single",void 0),e([r()],y.prototype,"showAllEnabled",null),e([r()],y.prototype,"showAllActionVisible",null),e([r()],y.prototype,"showAllCategories",null),e([r()],y.prototype,"showAllCategoriesVisible",null),e([r()],y.prototype,"showAllRelatedRecords",null),e([r({readOnly:!0})],y.prototype,"type",void 0),e([r()],y.prototype,"updating",null),e([r()],y.prototype,"_relatedLayerAllowsAdds",null),e([r()],y.prototype,"_relatedLayerAllowsEdits",null),y=e([i("esri.widgets.BatchAttributeForm.inputs.RelationshipElementInput")],y);const g=y;export{g as default};
2
+ import{__decorate as e}from"tslib";import{destroyMaybe as t}from"../../../core/maybe.js";import{on as l}from"../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{isSubtypeGroupLayer as o,getEffectiveLayerCapabilities as s}from"../../../layers/support/layerUtils.js";import{isRelatableFeatureSupportedLayer as a}from"../../../popup/support/featureUtils.js";import{getComputedAttributes as n,parseFormTemplateString as p}from"../stringUtils.js";import d from"./EditableInput.js";import h from"./SingleFeatureInputAdapter.js";import u from"../../Feature/FeatureRelationship/FeatureRelationshipViewModel.js";let y=class extends d{constructor(e){super(e),this._relationshipVM=new u,this._showAllCategories=!1,this._showAllRelatedRecords=!1,this.group=null,this.map=null,this.single=new h({input:this}),this.type="relationship"}initialize(){this._setRelationshipVMProps(),this.addHandles([l(()=>this.relatedLayer,"edits",()=>this._relationshipVM?.refresh())])}destroy(){t(this._relationshipVM)}get activeCategory(){return this._relationshipVM.activeCategory}get allCategories(){const{relatedLayer:e,_relationshipVM:t}=this;if(!o(e))return;const l=t?.categories,r=(e.subtypes??[]).map(({code:e,name:t})=>{const r=l?.find(e=>e.name===t);return{name:t,count:r?.count??0,value:r?.value??e}});return r.length?r:null}get categories(){return this.showAllEnabled?this.allCategories:this.allCategories?.slice(0,this.displayCount)}get canAddRelatedFeature(){const{editable:e,relatedFeatureCount:t,relationship:l}=this;if(!l||!this.loaded||!this._relatedLayerAllowsAdds)return!1;if(this.allCategories?.length&&!this.activeCategory)return!1;const{cardinality:r,role:i}=l;return!("one-to-one"===r&&t>0)&&("many-to-many"!==r&&(!("one-to-many"===r&&"destination"===i&&t>0)&&e))}get displayCount(){return this.template.displayCount}get displayType(){return this.template.displayType}get editable(){return!!this._relatedLayerAllowsAdds&&(this._evaluatedEditableExpression??!0)}get feature(){return this.single.feature}get relatedFeatureCount(){return this._relationshipVM?.featureCount??0}get label(){return this.activeCategory?.name?this.activeCategory.name:this.template.label}get layer(){return this.single.layer}get loaded(){return"loading"!==this._relationshipVM?.state}get orderByFields(){return this.template.orderByFields}get originHasValidKey(){return!!this.relationship&&null!=this.feature?.getAttribute(this.relationship.keyField)}get relationship(){return this._relationshipVM?.relationship}get relationshipId(){return this.template.relationshipId}get relatedFeatureInfos(){const{_relationshipVM:e,effectiveTimeZone:t}=this;if(!e?.relatedFeatures?.length||!e?.relatedLayer)return[];const{itemDescriptionFieldName:l,relatedFeatures:r,relatedLayer:i}=e,o=i?.formTemplate?.title||void 0;return r.map(e=>{let r;if(l){const o=e.getAttribute(l),s=i.fieldsIndex.get(l);if(s){const e=n({fields:[s],layer:i,values:[o],timeZone:t})[l];null!=e&&(r=e.toString())}}return{feature:e,description:r,title:o?p({attributes:e.attributes,label:o,layer:i,timeZone:t}):void 0}}).toArray()}get relatedLayer(){return this._relationshipVM?.relatedLayer}get relatedLayerIsTable(){return!!this.relatedLayer?.isTable}get showAllEnabled(){return this._relationshipVM.showAllEnabled}get showAllActionVisible(){return!this.showAllEnabled&&this.relatedFeatureCount>0&&this.relatedFeatureCount>this.displayCount}get showAllCategories(){return this._showAllCategories}get showAllCategoriesVisible(){const e=this.allCategories?.length??0;return!this.showAllEnabled&&e>0&&e>this.displayCount}get showAllRelatedRecords(){return this._showAllRelatedRecords}get updating(){return"loading"===this._relationshipVM?.state||"querying"===this._relationshipVM?.state}incrementPage(){this._relationshipVM&&this._relationshipVM.featurePage++}setActiveCategory(e){this._relationshipVM.activeCategory=e,this.setShowAllRelatedRecords(!!e)}setShowAllCategories(e){this._showAllCategories=e,this._showAllRelatedRecords||this._setShowAllEnabled(e)}setShowAllRelatedRecords(e){this._showAllRelatedRecords=e,this._showAllCategories||this._setShowAllEnabled(e)}get _relatedLayerAllowsAdds(){const{relatedLayer:e}=this;if(!e||!this._relatedLayerAllowsEdits)return!1;const t=s(e);return!!t?.operations?.supportsAdd}get _relatedLayerAllowsEdits(){const{relatedLayer:e}=this;if(!e)return!1;const t=s(e);return!!t?.operations?.supportsEditing}_setRelationshipVMProps(){const{displayCount:e,feature:t,layer:l,orderByFields:r,map:i,relationshipId:o,showAllEnabled:s}=this;t&&l&&a(l)&&this._relationshipVM.set({displayCount:e,graphic:t.plainGraphic,layer:l,map:i,orderByFields:r,relationshipId:o,showAllEnabled:s})}_setShowAllEnabled(e){this._relationshipVM.showAllEnabled=e}};e([r()],y.prototype,"_relationshipVM",void 0),e([r()],y.prototype,"_showAllCategories",void 0),e([r()],y.prototype,"_showAllRelatedRecords",void 0),e([r()],y.prototype,"activeCategory",null),e([r()],y.prototype,"allCategories",null),e([r()],y.prototype,"categories",null),e([r()],y.prototype,"canAddRelatedFeature",null),e([r()],y.prototype,"displayCount",null),e([r()],y.prototype,"displayType",null),e([r()],y.prototype,"editable",null),e([r()],y.prototype,"feature",null),e([r()],y.prototype,"group",void 0),e([r()],y.prototype,"label",null),e([r()],y.prototype,"layer",null),e([r()],y.prototype,"loaded",null),e([r()],y.prototype,"map",void 0),e([r()],y.prototype,"orderByFields",null),e([r()],y.prototype,"originHasValidKey",null),e([r()],y.prototype,"relationship",null),e([r()],y.prototype,"relationshipId",null),e([r()],y.prototype,"relatedFeatureInfos",null),e([r()],y.prototype,"relatedLayer",null),e([r()],y.prototype,"relatedLayerIsTable",null),e([r({readOnly:!0})],y.prototype,"single",void 0),e([r()],y.prototype,"showAllEnabled",null),e([r()],y.prototype,"showAllActionVisible",null),e([r()],y.prototype,"showAllCategories",null),e([r()],y.prototype,"showAllCategoriesVisible",null),e([r()],y.prototype,"showAllRelatedRecords",null),e([r({readOnly:!0})],y.prototype,"type",void 0),e([r()],y.prototype,"updating",null),e([r()],y.prototype,"_relatedLayerAllowsAdds",null),e([r()],y.prototype,"_relatedLayerAllowsEdits",null),y=e([i("esri.widgets.BatchAttributeForm.inputs.RelationshipElementInput")],y);const g=y;export{g as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const t="esri_BatchAttributeForm_different_values";function n(t){return"visible"===t}function e(t){return"field"===t.type}function r(t){return e(t)&&"multiple-choice"===t.input?.type}function u(t){return"group"===t.type}function o(t){return"relationship"===t.type}function i(t){return"text"===t.type}function c(t){return"attachment"===t.type}function s(t){return e(t)||c(t)||o(t)||f(t)}function f(t){return"utilityNetworkAssociations"===t.type}function p(t){const n=`${t.elementId}:${t.executorPurpose}`;return null!=t.textExpressionIndex?`${n}:${t.textExpressionIndex}`:n}const l=t=>null!=t&&(a(t,"combo-box")||a(t,"radio-buttons"));function a(t,n){return t?.type===n}function y(t,n,e=[]){for(const r of t)n(r)?e.push(r):u(r)&&y(r.inputs,n,e);return e}async function x(t,n,e,r){const u=[];for(const o of e){const n=r(o);o.getAttribute(t)!==n&&(o.setAttribute(t,n),u.push(o))}return u.length>0&&await n.valueChanged(t,u),u}function d(t,n){return t.layers[0]?.getField(n)?.name??n}export{x as applyFieldValueChanges,y as deepFilterInputs,t as differentValuesString,d as getNormalizedFieldName,c as isAttachmentElementInput,s as isEditableInput,e as isFieldInput,l as isFieldInputWithShowNoValueOptionInput,u as isGroupInput,a as isInputWithInputType,r as isMultipleChoiceFieldInput,o as isRelationshipElementInput,i as isTextElementInput,f as isUtilityNetworkAssociationsElementInput,p as makeUseId,n as visibilityCodeToBoolean};
2
+ const t="esri_BatchAttributeForm_different_values";function n(t){return"visible"===t}function e(t){return"field"===t.type}function r(t){return e(t)&&"multiple-choice"===t.input?.type}function u(t){return"group"===t.type}function o(t){return"relationship"===t.type}function i(t){return"text"===t.type}function c(t){return"attachment"===t.type}function f(t){return e(t)||c(t)||o(t)||l(t)}function s(t){return e(t)||c(t)||o(t)||l(t)||i(t)}function p(t){return s(t)&&null!=t.group}function l(t){return"utilityNetworkAssociations"===t.type}function x(t){const n=`${t.elementId}:${t.executorPurpose}`;return null!=t.textExpressionIndex?`${n}:${t.textExpressionIndex}`:n}const y=t=>null!=t&&(a(t,"combo-box")||a(t,"radio-buttons"));function a(t,n){return t?.type===n}function d(t,n,e=[]){for(const r of t)n(r)?e.push(r):u(r)&&d(r.inputs,n,e);return e}function m(t,n){return t.layers[0]?.getField(n)?.name??n}export{d as deepFilterInputs,t as differentValuesString,m as getNormalizedFieldName,c as isAttachmentElementInput,f as isEditableInput,e as isFieldInput,y as isFieldInputWithShowNoValueOptionInput,u as isGroupInput,s as isGroupableInput,p as isGroupedInput,a as isInputWithInputType,r as isMultipleChoiceFieldInput,o as isRelationshipElementInput,i as isTextElementInput,l as isUtilityNetworkAssociationsElementInput,x as makeUseId,n as visibilityCodeToBoolean};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- function e(e){const{messages:n,onclick:a}=e;return[{appearance:"solid",kind:"brand",label:n.footerButtons.add,purpose:"stage-add-attachment",onclick:a??(()=>{})}]}function n(e){const{callback:n,disabled:a,formId:t,messages:c}=e;return[{appearance:"solid",disabled:a,form:t,kind:"brand",label:c.footerButtons.update,purpose:"submit",onclick:()=>n()}]}function a(e){const{label:n,onclick:a}=e;return[{appearance:"outline",icon:"trash",kind:"danger",label:n,purpose:"discard-attachment-changes",onclick:a??(()=>{})}]}function t(e){const{disabled:n,messages:a,onclick:t}=e;return[{appearance:"solid",disabled:n,kind:"brand",label:a.footerButtons.replace,purpose:"stage-replace-attachment",onclick:t??(()=>{})}]}function c(e){const{messages:n,onclick:a}=e;return[{appearance:"outline",icon:"reset",kind:"brand",label:n.footerButtons.reset,purpose:"discard-attachment-name-changes",onclick:a??(()=>{})}]}function o(e){const{deleteDisabled:n,deleteOnclick:a,doneOnclick:t,messages:c}=e;return[{appearance:"outline",kind:"brand",label:c.done,purpose:"stage-update-attachment",onclick:t??(()=>{})},{appearance:"outline",disabled:n,icon:"attachment",kind:"danger",label:c.delete,purpose:"stage-delete-attachment",onclick:a??(()=>{})}]}function s(e){const{messages:n,purpose:a,onclick:t}=e;return[{appearance:"outline",kind:"brand",label:n.cancel,purpose:a,onclick:t??(()=>{})}]}export{e as makeAddAttachmentFooterButtons,s as makeCancelFooterButton,n as makeDefaultFooterButtons,a as makeDiscardAttachmentFooterButtons,t as makeReplaceAttachmentFooterButtons,c as makeResetAttachmentFooterButtons,o as makeViewingAttachmentFooterButtons};
2
+ function e(e){const{messages:n,onclick:a}=e;return[{appearance:"solid",kind:"brand",label:n.footerButtons.add,purpose:"stage-add-attachment",onclick:a??(()=>{})}]}function n(e){const{callback:n,disabled:a,formId:t,messages:c}=e;return[{appearance:"solid",disabled:a,form:t,kind:"brand",label:c.footerButtons.update,purpose:"submit",onclick:()=>n()}]}function a(e){const{label:n,onclick:a}=e;return[{appearance:"outline",icon:"trash",kind:"danger",label:n,purpose:"discard-attachment-changes",onclick:a??(()=>{})}]}function t(e){const{disabled:n,messages:a,onclick:t}=e;return[{appearance:"solid",disabled:n,kind:"brand",label:a.footerButtons.replace,purpose:"stage-replace-attachment",onclick:t??(()=>{})}]}function c(e){const{messages:n,onclick:a}=e;return[{appearance:"outline",icon:"reset",kind:"brand",label:n.footerButtons.reset,purpose:"discard-attachment-name-changes",onclick:a??(()=>{})}]}function o(e){const{deleteDisabled:n,deleteOnclick:a,doneOnclick:t,messages:c}=e;return[{appearance:"solid",kind:"brand",label:c.done,purpose:"stage-update-attachment",onclick:t??(()=>{})},{appearance:"outline",disabled:n,icon:"attachment",kind:"danger",label:c.delete,purpose:"stage-delete-attachment",onclick:a??(()=>{})}]}function s(e){const{messages:n,purpose:a,onclick:t}=e;return[{appearance:"outline",kind:"brand",label:n.cancel,purpose:a,onclick:t??(()=>{})}]}export{e as makeAddAttachmentFooterButtons,s as makeCancelFooterButton,n as makeDefaultFooterButtons,a as makeDiscardAttachmentFooterButtons,t as makeReplaceAttachmentFooterButtons,c as makeResetAttachmentFooterButtons,o as makeViewingAttachmentFooterButtons};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{isSome as e}from"../../core/arrayUtils.js";import{templateHasKey as t,replace as r}from"../../core/string.js";import{convertDateTimeFieldFormatToIntlOptions as o}from"../../intl/date.js";import{defaultFieldFormat as i}from"../../layers/support/fieldFormatUtils.js";import{isTimeOnlyField as s}from"../../layers/support/fieldUtils.js";import{supportsFieldConfiguration as n}from"../../layers/support/layerUtils.js";import{isAnyDateField as m}from"../../smartMapping/support/utils.js";import{getLabelForDateFieldValue as a,getIntlOptionsForField as l}from"../support/dateUtils.js";function f(r){const{attributes:o,layer:i,label:s,timeZone:n}=r;if(!o||"object"!=typeof o)return s;const m=Object.keys(o).filter(e=>t(s,e)),a=m.map(e=>o[e]),l=m.map(e=>i.fieldsIndex.get(e)).filter(e);return p(s,u({fields:l,layer:i,timeZone:n,values:a}))}function p(e,t){return r(r(e,e=>`{${e.toLowerCase()}}`),Object.fromEntries(Object.entries(t).map(([e,t])=>[e.toLowerCase(),t])))}function u(e){const{layer:t,values:r}=e,o=e.fields??t.fields??[],i=e.timeZone??void 0,n=o.map((e,o)=>{let n=r[o];if("coded-value"===e.domain?.type){const t=e.domain.codedValues.find(e=>e.code===n);t?.name&&(n=t.name)}return(m(e)||s(e))&&(n=a(e,n,{timeZone:i,...d(t,e)})),[e.name,n]});return Object.fromEntries(n)}function d(e,t){if(n(e)){const r=e.getFieldConfiguration(t.name)?.fieldFormat??i(t);if("date-time"===r?.type)return o(r)}return l(t)}export{u as getComputedAttributes,d as getDateTimeFormatOptions,f as parseFormTemplateString,p as substituteFieldTemplatesInString};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{createArcadeProfile as e,createArcadeExecutor as t}from"../../../../arcade.js";import r from"../../../../core/Error.js";import n from"../../../../core/Logger.js";import{getEffectiveFieldAlias as o}from"../../../../editing/fieldUtils.js";import i from"../../../../form/ExpressionInfo.js";import s from"../../../../form/elements/AttachmentElement.js";import{isMultipleChoiceInput as a}from"../../../../form/elements/inputs/inputUtils.js";import{isAttachmentElement as l,isFieldElement as m,isGroupElement as d,isRelationshipElement as p,isTextElement as c,isUtilityNetworkAssociationsElement as f}from"../../../../form/support/formUtils.js";import{getLowerCaseEditTrackingFields as u,isFieldVisibleByDefault as x}from"../../../../layers/support/fieldUtils.js";import{isSubtypeSublayer as y,isSubtypeGroupLayer as w}from"../../../../layers/support/layerUtils.js";import{isNumber as h}from"../../../../support/guards.js";import{unknown as E}from"../../../../time/constants.js";import{layerSupportsQueryAttachments as b}from"../../batchAttributeFormUtils.js";import{makeExpressionInfosMap as v,makeExecutorSetForFormElement as I}from"../../expressions/expressionUtils.js";import{AttachmentElementTemplate as T}from"../AttachmentElementTemplate.js";import j from"../BatchFormTemplate.js";import{FieldElementTemplate as F}from"../FieldElementTemplate.js";import{GroupElementTemplate as g}from"../GroupElementTemplate.js";import{RelationshipElementTemplate as P}from"../RelationshipElementTemplate.js";import{TextElementTemplate as C}from"../TextElementTemplate.js";import{UtilityNetworkAssociationsElementTemplate as A}from"../UtilityNetworkAssociationsElementTemplate.js";import{compileTextElementMarkdownToHTML as L}from"./textElementTemplateUtils.js";const U="expression/dea57012-47ca4b55a000-8df62742ed0c",Z=e("form-attachment-filename-calculation"),N=()=>n.getLogger("esri.widgets.BatchAttributeForm.templates.templateUtils");async function k(e,t,r=e.formTemplate){return await e.load(),r?.elements&&r.elements.length>0?S(r,e,t):B(e,t)}async function B(e,{arcadeExecutorProvider:t,attachmentsEnabled:r,formTimeZone:n}){const o=new Set(u(e)),i={arcadeExecutorProvider:t,formTimeZone:n,layer:e},s=[];for(const l of e.fields)D(l,e,o)&&s.push(q(l,i));const a=await Promise.all(s);return r&&await R(a,{arcadeExecutorProvider:t,expressionInfos:v(void 0),layer:e}),new j({elements:a,preserveFieldValuesWhenHidden:!0})}function H(e,t){for(const r of e??[])if("group"!==r.type){if("field"===r.type){if(!1===r.editable&&!r.editableExpression)return!0;if(t.subtypeField&&(y(t)||w(t))&&r.fieldName?.toLowerCase()===t.subtypeField.toLowerCase())return!0}}else if(H(r.elements??[],t))return!0;return!1}async function R(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:n}){if(!b(n))return;const o=await V(new s({displayFilename:!0}),{arcadeExecutorProvider:t,expressionInfos:r,layer:n});e.push(o)}async function S(e,t,r){let n=null;H(e.elements??[],t)&&(n=new i({title:"",name:U,expression:"false"}));const o=v(n?[...e.expressionInfos??[],n]:e.expressionInfos),s={description:e.description,elements:new Array,title:e.title,preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden,supportsAttachmentElements:e.supportsAttachmentElements},{elements:a}=e;if(!a)return new j(s);let l=!1;const{arcadeExecutorProvider:m,formTimeZone:d}=r;for(const i of a){const e=await W(i,{arcadeExecutorProvider:m,expressionInfos:o,layer:t,formTimeZone:d});e&&(s.elements.push(e),"attachment"===e.type&&(l=!0))}return e.supportsAttachmentElements||!r.attachmentsEnabled||l||await R(s.elements,{arcadeExecutorProvider:m,expressionInfos:o,layer:t}),new j(s)}async function V(e,{arcadeExecutorProvider:r,expressionInfos:n,layer:o}){const i=n.get(e.filenameExpression),s=i?await t(i.expression,Z):null,a=new T({allowUserRename:e.allowUserRename,attachmentKeyword:e.attachmentKeyword,description:e.description,displayFilename:e.displayFilename,filenameExpressionExecutor:s,input:e.input,label:e.label,maxAttachmentCount:e.maxAttachmentCount,minAttachmentCount:e.minAttachmentCount,useOriginalFilename:e.useOriginalFilename}),l=await I({element:e,expressionInfos:n,provider:r});return a.addLayer(o,l),a}async function W(e,t){return l(e)?V(e,{arcadeExecutorProvider:t.arcadeExecutorProvider,expressionInfos:t.expressionInfos,layer:t.layer}):m(e)?z(e,t):d(e)?K(e,t):p(e)?O(e,t):c(e)?G(e,t):f(e)?$(e,t):null}async function z(e,{arcadeExecutorProvider:t,expressionInfos:n,layer:o,formTimeZone:i}){const{fieldsIndex:s}=o,{description:l,domain:m,fieldName:d,hint:p,input:c,label:f}=e;if(null==d||!s.has(d))return N().warn(new r("batch-attribute-form:invalid-form-element-field",`Field element with label '${f}' does not refer to a valid field`)),null;if(!1!==e.editable||e.editableExpression||((e=e.clone()).editableExpression=U),o.subtypeField&&(y(o)||w(o))&&e.fieldName?.toLowerCase()===o.subtypeField.toLowerCase()&&((e=e.clone()).editableExpression=U),c&&a(c)&&c.otherChoice){const e=c.otherChoice.fieldName,t=s.get(e);t&&t.name!==e&&(c.otherChoice=c.otherChoice.clone(),c.otherChoice.fieldName=t.name)}const u=new F({description:l,domain:m,field:s.get(d),hint:p,input:c,formTimeZone:i,layerTimeZone:J(o),label:f}),x=await I({element:e,expressionInfos:n,provider:t});return u.addLayer(o,x),u}async function K(e,t){const{arcadeExecutorProvider:r,expressionInfos:n,layer:o}=t,{description:i,label:s,initialState:a}=e,l=[];for(const p of e.elements){const e=await W(p,t);e&&l.push(e)}const m=new g({description:i,elements:l,label:s,initialState:a??"expanded"}),d=await I({element:e,expressionInfos:n,provider:r});return m.addLayer(o,d),m}async function O(e,t){const{description:r,label:n,displayCount:o,displayType:i,orderByFields:s,relationshipId:a}=e,{arcadeExecutorProvider:l,expressionInfos:m,layer:d}=t,p=new P({description:r,...h(o)&&{displayCount:o},displayType:i,label:n,orderByFields:s,relationshipId:a}),c=await I({element:e,expressionInfos:m,provider:l});return p.addLayer(d,c),p}async function G(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:n}){const{description:o,label:i,text:s,textFormat:a}=e,{fieldsIndex:l}=n,m=s&&"markdown"===a?await L(s):s,d=new C({compiledText:m,description:o,fieldsIndex:l,label:i}),p=await I({element:e,expressionInfos:r,provider:t}),{expressionParts:c}=d;if(c.length){const e=await Promise.all(c.map(e=>{const n=r.get(e)?.expression??e;return t.getArcadeExecutor(n)}));p.textExpressions=e}return d.addLayer(n,p),d}async function $(e,t){const{associationTypes:r,description:n,label:o}=e,{arcadeExecutorProvider:i,expressionInfos:s,layer:a}=t,l=new A({associationTypes:r,description:n,label:o}),m=await I({element:e,expressionInfos:s,provider:i});return l.addLayer(a,m),l}async function q(e,{arcadeExecutorProvider:t,layer:r,formTimeZone:n}){const i=o(e,r)||e.name,s=new F({field:e,label:i,formTimeZone:n,layerTimeZone:J(r)}),a={},l=(w(r)||y(r))&&r.subtypeField&&r.subtypeField.toLowerCase()===e.name.toLowerCase();return!l&&e.editable&&r.userHasUpdateItemPrivileges&&(a.editableExpression=await t.getArcadeExecutor("true")),l&&(a.editableExpression=await t.getArcadeExecutor("false")),s.addLayer(r,a),s}function D(e,t,r){return!r.has(e.name.toLowerCase())&&x(e,t)}function J(e){return y(e)&&e.parent&&(e=e.parent),e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone?E:e&&"preferredTimeZone"in e&&e.preferredTimeZone?e.preferredTimeZone:null}export{k as createBatchFormTemplate,B as createBatchFormTemplateFromFields};
2
+ import{createArcadeProfile as e,createArcadeExecutor as t}from"../../../../arcade.js";import r from"../../../../core/Error.js";import o from"../../../../core/Logger.js";import{getEffectiveFieldAlias as n}from"../../../../editing/fieldUtils.js";import i from"../../../../form/ExpressionInfo.js";import s from"../../../../form/elements/AttachmentElement.js";import{isMultipleChoiceInput as a}from"../../../../form/elements/inputs/inputUtils.js";import{isAttachmentElement as l,isFieldElement as m,isGroupElement as d,isRelationshipElement as p,isTextElement as c,isUtilityNetworkAssociationsElement as f}from"../../../../form/support/formUtils.js";import{getLowerCaseEditTrackingFields as u,isFieldVisibleByDefault as x}from"../../../../layers/support/fieldUtils.js";import{isSubtypeSublayer as y,isSubtypeGroupLayer as w}from"../../../../layers/support/layerUtils.js";import{isNumber as h}from"../../../../support/guards.js";import{layerSupportsQueryAttachments as E,getLayerTimeZone as b}from"../../batchAttributeFormUtils.js";import{makeExpressionInfosMap as v,makeExecutorSetForFormElement as I}from"../../expressions/expressionUtils.js";import{AttachmentElementTemplate as T}from"../AttachmentElementTemplate.js";import j from"../BatchFormTemplate.js";import{FieldElementTemplate as F}from"../FieldElementTemplate.js";import{GroupElementTemplate as g}from"../GroupElementTemplate.js";import{RelationshipElementTemplate as P}from"../RelationshipElementTemplate.js";import{TextElementTemplate as C}from"../TextElementTemplate.js";import{UtilityNetworkAssociationsElementTemplate as A}from"../UtilityNetworkAssociationsElementTemplate.js";import{isGroupElementTemplate as L}from"./templateUtils.js";import{compileTextElementMarkdownToHTML as U}from"./textElementTemplateUtils.js";const Z="expression/dea57012-47ca4b55a000-8df62742ed0c",N=e("form-attachment-filename-calculation"),B=()=>o.getLogger("esri.widgets.BatchAttributeForm.templates.templateUtils");async function H(e,t,r=e.formTemplate){return await e.load(),r?.elements&&r.elements.length>0?W(r,e,t):R(e,t)}async function R(e,{arcadeExecutorProvider:t,attachmentsEnabled:r,formTimeZone:o}){const n=new Set(u(e)),i={arcadeExecutorProvider:t,formTimeZone:o,layer:e},s=[];for(const l of e.fields)J(l,e,n)&&s.push(D(l,i));const a=await Promise.all(s);return r&&await V(a,{arcadeExecutorProvider:t,expressionInfos:v(void 0),layer:e}),new j({elements:a,title:e.formTemplate?.title,preserveFieldValuesWhenHidden:!0})}function S(e,t){for(const r of e??[])if("group"!==r.type){if("field"===r.type){if(!1===r.editable&&!r.editableExpression)return!0;if(t.subtypeField&&(y(t)||w(t))&&r.fieldName?.toLowerCase()===t.subtypeField.toLowerCase())return!0}}else if(S(r.elements??[],t))return!0;return!1}async function V(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:o}){if(!E(o))return;const n=await k(new s({displayFilename:!0}),{arcadeExecutorProvider:t,expressionInfos:r,layer:o});e.push(n)}async function W(e,t,r){let o=null;S(e.elements??[],t)&&(o=new i({title:"",name:Z,expression:"false"}));const n=v(o?[...e.expressionInfos??[],o]:e.expressionInfos),s={description:e.description,elements:new Array,title:e.title,preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden,supportsAttachmentElements:e.supportsAttachmentElements},{elements:a}=e;if(!a)return new j(s);let l=!1;const{arcadeExecutorProvider:m,formTimeZone:d}=r;for(const i of a){const e=await K(i,{arcadeExecutorProvider:m,expressionInfos:n,layer:t,formTimeZone:d});if(e){if(s.elements.push(e),l)continue;"attachment"===e.type&&(l=!0),L(e)&&e.elements.some(e=>("attachment"===e.type&&(l=!0),l))}}return e.supportsAttachmentElements||!r.attachmentsEnabled||l||await V(s.elements,{arcadeExecutorProvider:m,expressionInfos:n,layer:t}),new j(s)}async function k(e,{arcadeExecutorProvider:r,expressionInfos:o,layer:n}){const i=o.get(e.filenameExpression),s=i?await t(i.expression,N):null,a=new T({allowUserRename:e.allowUserRename,attachmentKeyword:e.attachmentKeyword,description:e.description,displayFilename:e.displayFilename,filenameExpressionExecutor:s,input:e.input,label:e.label,maxAttachmentCount:e.maxAttachmentCount,minAttachmentCount:e.minAttachmentCount,useOriginalFilename:e.useOriginalFilename}),l=await I({element:e,expressionInfos:o,provider:r});return a.addLayer(n,l),a}async function K(e,t){return l(e)?k(e,{arcadeExecutorProvider:t.arcadeExecutorProvider,expressionInfos:t.expressionInfos,layer:t.layer}):m(e)?O(e,t):d(e)?G(e,t):p(e)?$(e,t):c(e)?q(e,t):f(e)?z(e,t):null}async function O(e,{arcadeExecutorProvider:t,expressionInfos:o,layer:n,formTimeZone:i}){const{fieldsIndex:s}=n,{description:l,domain:m,fieldName:d,hint:p,input:c,label:f}=e;if(null==d||!s.has(d))return B().warn(new r("batch-attribute-form:invalid-form-element-field",`Field element with label '${f}' does not refer to a valid field`)),null;if(!1!==e.editable||e.editableExpression||((e=e.clone()).editableExpression=Z),n.subtypeField&&(y(n)||w(n))&&e.fieldName?.toLowerCase()===n.subtypeField.toLowerCase()&&((e=e.clone()).editableExpression=Z),c&&a(c)&&c.otherChoice){const e=c.otherChoice.fieldName,t=s.get(e);t&&t.name!==e&&(c.otherChoice=c.otherChoice.clone(),c.otherChoice.fieldName=t.name)}const u=new F({description:l,domain:m,field:s.get(d),hint:p,input:c,formTimeZone:i,layerTimeZone:b(n),label:f}),x=await I({element:e,expressionInfos:o,provider:t});return u.addLayer(n,x),u}async function G(e,t){const{arcadeExecutorProvider:r,expressionInfos:o,layer:n}=t,{description:i,label:s,initialState:a}=e,l=[];for(const p of e.elements){const e=await K(p,t);e&&l.push(e)}const m=new g({description:i,elements:l,label:s,initialState:a??"expanded"}),d=await I({element:e,expressionInfos:o,provider:r});return m.addLayer(n,d),m}async function $(e,t){const{description:r,label:o,displayCount:n,displayType:i,orderByFields:s,relationshipId:a}=e,{arcadeExecutorProvider:l,expressionInfos:m,layer:d}=t,p=new P({description:r,...h(n)&&{displayCount:n},displayType:i,label:o,orderByFields:s,relationshipId:a}),c=await I({element:e,expressionInfos:m,provider:l});return p.addLayer(d,c),p}async function q(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:o}){const{description:n,label:i,text:s,textFormat:a}=e,{fieldsIndex:l}=o,m=s&&"markdown"===a?await U(s):s,d=new C({compiledText:m,description:n,fieldsIndex:l,label:i}),p=await I({element:e,expressionInfos:r,provider:t}),{expressionParts:c}=d;if(c.length){const e=await Promise.all(c.map(e=>{const o=r.get(e)?.expression??e;return t.getArcadeExecutor(o)}));p.textExpressions=e}return d.addLayer(o,p),d}async function z(e,t){const{associationTypes:r,description:o,label:n}=e,{arcadeExecutorProvider:i,expressionInfos:s,layer:a}=t,l=new A({associationTypes:r,description:o,label:n}),m=await I({element:e,expressionInfos:s,provider:i});return l.addLayer(a,m),l}async function D(e,{arcadeExecutorProvider:t,layer:r,formTimeZone:o}){const i=n(e,r)||e.name,s=new F({field:e,label:i,formTimeZone:o,layerTimeZone:b(r)}),a={},l=(w(r)||y(r))&&r.subtypeField&&r.subtypeField.toLowerCase()===e.name.toLowerCase();return!l&&e.editable&&r.userHasUpdateItemPrivileges&&(a.editableExpression=await t.getArcadeExecutor("true")),l&&(a.editableExpression=await t.getArcadeExecutor("false")),s.addLayer(r,a),s}function J(e,t,r){return!r.has(e.name.toLowerCase())&&x(e,t)}export{H as createBatchFormTemplate,R as createBatchFormTemplateFromFields};
@@ -163,6 +163,8 @@ export interface AttachmentsChangeEvent {
163
163
  */
164
164
  export interface SelectedAttachmentIdentifier {}
165
165
 
166
+ export type ValueChangeActor = "user" | "expression";
167
+
166
168
  /** @since 5.0 */
167
169
  export interface ValueChangeEvent {
168
170
  /**
@@ -204,18 +206,32 @@ export interface ValuesChangeEvent {
204
206
  */
205
207
  data: ValuesChangeData[];
206
208
  /**
207
- * The field whose value was interactively changed.
208
- * Additional field changes caused by expressions are included in [ValuesChangeData](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/types/#ValuesChangeData-changes).
209
+ * The field whose value was interactively changed. The
210
+ * [event data](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/types/#ValuesChangeData-changes)
211
+ * may include changes to additional fields that were triggered by
212
+ * expressions.
213
+ *
214
+ * For events where the source is expressions, this field will be undefined,
215
+ * no field is interactively changed in these cases.
209
216
  *
210
217
  * @since 5.1
211
218
  */
212
- fieldName: string;
219
+ fieldName?: string;
213
220
  /**
214
221
  * The name of the event.
215
222
  *
216
223
  * @since 5.1
217
224
  */
218
225
  name: "values-change";
226
+ /**
227
+ * Indicates whether the root cause of the values changing.
228
+ *
229
+ * Value | Description
230
+ * ------| -----------
231
+ * "user" | The value changes originated from a user-initiated change. The event may include expression-driven changes that were triggered as a result of the change the user made.
232
+ * "expression" | All value changes are the result of expressions evaluations, and the expressions were evaluated due to some condition other than a user-intiated value change. For example, the expressions were intially evaluated when the form was loaded.
233
+ */
234
+ source: ValueChangeActor;
219
235
  }
220
236
 
221
237
  /**
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecateWidget as a}from"../core/deprecate.js";import i from"../core/Logger.js";import{getOrCreateMapValue as n}from"../core/MapUtils.js";import{destroyMaybe as s}from"../core/maybe.js";import l from"../core/ReactiveMap.js";import{watch as o,when as r,on as c,sync as d}from"../core/reactiveUtils.js";import{formatFileSize as m}from"../core/unitFormatUtils.js";import{property as h,subclass as u}from"../core/accessorSupport/decorators.js";import{formatDate as p}from"../intl/date.js";import{isIntegerField as g}from"../layers/support/fieldUtils.js";import{isString as v}from"../support/guards.js";import b from"./Widget.js";import{getAttachmentTypeCategory as f,getCalciteIconForAttachment as _}from"./Attachments/support/attachmentUtils.js";import{getAttachmentKey as C,getAttachmentFilenameParts as A,isImageAttachment as y}from"./BatchAttributeForm/attachmentUtils.js";import{getHiddenFieldsValidationErrorMessage as I,getVisibleFieldInputValidationErrorMessage as w,isElementTemplateWithInputType as F}from"./BatchAttributeForm/batchAttributeFormUtils.js";import k from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as M}from"./BatchAttributeForm/css.js";import{makeAddAttachmentFooterButtons as x,makeDiscardAttachmentFooterButtons as D,makeResetAttachmentFooterButtons as E,makeReplaceAttachmentFooterButtons as S,makeViewingAttachmentFooterButtons as L,makeCancelFooterButton as O,makeDefaultFooterButtons as T}from"./BatchAttributeForm/interfaceUtils.js";import V from"./BatchAttributeForm/VisibleElements.js";import{isGroupInput as R,isFieldInput as N,isTextElementInput as U,isRelationshipElementInput as P,isAttachmentElementInput as B,isUtilityNetworkAssociationsElementInput as $,differentValuesString as z,getNormalizedFieldName as j}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{clearMultipleChoiceOtherChoiceStateForViewModel as W,getMultipleChoiceCheckboxState as H,otherChoiceCheckedPlaceholderValue as Z,getUpdatedMultipleChoiceValueForFeature as G,getMultipleChoiceSelectAllState as q,splitMultipleChoiceValue as K,canRestoreMultipleChoiceOtherChoiceDraftValue as X}from"./BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js";import{loadRelationshipDetailsComponents as J,RelationshipDetails as Q}from"./BatchAttributeForm/rendered-content/RelationshipDetails.js";import{downloadAttachmentInfo as Y}from"./FeatureTable/support/exportUtils.js";import{loadCalciteComponents as ee}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as te,getIntlOptionsForField as ae,prepareISOFieldValueForDateComponents as ie,prepareUnixFieldValueForDateComponents as ne,normalizeTimeOnlyString as se,getISOFieldValueFromDateComponents as le,getUnixFieldValueFromDateComponents as oe}from"./support/dateUtils.js";import{globalCss as re}from"./support/globalCss.js";import{calciteListFilterProps as ce}from"./support/listUtils.js";import{messageBundle as de,vmEvent as me,tsx as he}from"./support/widget.js";import{setFocus as ue}from"./support/widgetUtils.js";import{isEmptyValue as pe}from"./support/forms/formUtils.js";const ge="data-element-id",ve="esri_BatchAttributeForm_select_all",be="esri_BatchAttributeForm_other_choice";let fe=class extends b{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.featureTableMessages=null,this.messagesUnits=null,this.viewModel=new k,this.visibleElements=new V,this.groupDisplay="all",this._associationsList=null,this._associationsWidgetsMap=new l,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._batchSwitchInputInitialValues=new Map,this._listObserverNode=null,this._listObserver=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this.viewModel.activeRelationshipInput?.incrementPage()},{root:window.document}),this._attachmentDialogInfo=null,this._attachmentListFilterText="",this._attachmentFileInputMap=new Map,this._selectedAttachmentReplaceFileInput=null,this._afterListObserverCreated=e=>{this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)},this._afterListObserverRemoved=()=>{this._listObserverNode=null},this._maximizeSelectedAttachment=()=>{this._attachmentDialogInfo=this.selectedAttachmentDetails},this._enterAttachmentReplaceView=()=>{const e=this.selectedAttachmentDetails;this._canReplaceSelectedAttachment()&&e&&(e.input.clearValidationCriteriaState(),this.viewModel.setShowingSelectedAttachmentReplacePage(!0))},this._setSelectedAttachmentReplaceFileInput=e=>{this._selectedAttachmentReplaceFileInput=e},this._openSelectedAttachmentReplaceFilePicker=()=>{this._canReplaceSelectedAttachment()&&this._selectedAttachmentReplaceFileInput?.click()},this._resetSelectedAttachmentName=()=>{const e=this.selectedAttachmentDetails,t=e?.attachment.globalId,a=e?e.input.getAttachmentEditState(e.attachment).initialName:null;e&&t&&null!=a&&this.viewModel.stageRenameAttachment(e.input.template.elementId,t,a)},this._resetSelectedAttachmentChanges=()=>{const e=this.selectedAttachmentDetails,t=e?.attachment.globalId;e&&t&&this.viewModel.resetAttachmentChanges(e.input.template.elementId,t)},this._deleteSelectedAttachment=()=>{const e=this.selectedAttachmentDetails,t=e?.attachment.globalId;e&&t&&!this._isSelectedAttachmentDeleteDisabled()&&(this.viewModel.stageDeleteAttachment(e.input.template.elementId,t),this._setSelectedAttachment(null))},this._closeAttachmentDialog=()=>{this.hideAttachmentDialog()},this._saveInput=this._saveInput.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),e?.suppressDeprecationWarning||(this.announceDeprecation=()=>{a(i.getLogger(this),"Editor","arcgis-editor",{version:"5.0"})})}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...a}=e;return a}initialize(){this.addHandles([o(()=>this.features,()=>{this._dateComponentMap.clear(),this._resetTransientFormState(),W(this.viewModel,{includeDraftValues:!0})}),o(()=>this.viewModel.activeForm,()=>{this._batchSwitchInputInitialValues.clear(),this._resetTransientFormState(),W(this.viewModel)}),o(()=>this.viewModel.selectedAttachmentAddElementId,()=>{this.hideAttachmentDialog()}),r(()=>!this.selectedAttachmentDetails,()=>this.hideAttachmentDialog()),o(()=>this.viewModel.selectedAttachmentListElementId,()=>{this._attachmentListFilterText=""}),o(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),c(()=>this.viewModel,"submit",()=>{this.valid||this.goToFirstError()}),o(()=>[this._associationsEnabled,this.viewModel.activeForm.allUtilityNetworkAssociationsElementInputs],()=>this._setUpAssociationsWidgets(),d),o(()=>this.viewModel.activeAssociationsInput,e=>this._onActiveAssociationsInputChange(e))])}loadDependencies(){return Promise.all([ee({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),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"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),"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"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),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")}),J()])}destroy(){this._destroyAssociationsWidgets(),this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get effectiveTitle(){const{features:e,messages:t,page:a}=this;return"replacing-attachment"===a?t.titles.replaceAttachment:"viewing-attachment-details"===a?t.titles.editAttachment:"adding-attachments"===a?t.titles.addAttachments:"viewing-attachments"===a?t.titles.attachments:1===e.length||this.activeFeatureIndex>-1?t.titles.editFeature:e.length>1?t.titles.editFeatures:""}get effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get footerButtonInfos(){if(!this.features.length)return[];const{messages:e,messagesCommon:t,page:a}=this,i=this.readOnly||this.effectiveDisabled,n=this._getSelectedAttachmentEditState(),s=this.viewModel.selectedAttachmentAddElementId;return"adding-attachments"===a&&s?x({messages:e,onclick:()=>this._attachmentFileInputMap.get(s)?.click()}):n?.isReplaced&&"replacing-attachment"!==a?D({label:t.remove,onclick:this._resetSelectedAttachmentChanges}):n?.isRenamed?E({messages:e}):"replacing-attachment"===a?S({disabled:i,messages:e,onclick:this._openSelectedAttachmentReplaceFilePicker}):"viewing-attachment-details"===a?L({deleteDisabled:this._isSelectedAttachmentDeleteDisabled(),deleteOnclick:this._deleteSelectedAttachment,doneOnclick:()=>this._setSelectedAttachment(null),messages:e.footerButtons}):"viewing-associated-features"===a?O({messages:t,purpose:"cancel-viewing-associated-features",onclick:this.goBack}):"viewing-associated-layers"===a?O({messages:t,purpose:"cancel-viewing-associated-layers",onclick:this.goBack}):"viewing-attachments"===a||"viewing-related-records"===a?[]:T({disabled:!this.viewModel.submittable||i,formId:this._formId,messages:e,callback:this.submit})}get footerNoticeInfos(){if(!this.features.length)return[];const{messages:{footerNotices:e}}=this;return this._isSelectedAttachmentDeleteDisabled()?[{icon:"information",message:e.deleteDisabledMinimumAttachments}]:[]}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get maximumFeatureCount(){return this.viewModel.maximumFeatureCount}set maximumFeatureCount(e){this.viewModel.maximumFeatureCount=e}get maximumFeatureCountWithComplexForms(){return this.viewModel.maximumFeatureCountWithComplexForms}set maximumFeatureCountWithComplexForms(e){this.viewModel.maximumFeatureCountWithComplexForms=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}get page(){return this.viewModel.page}get readOnly(){return this.viewModel.readOnly}set readOnly(e){this.viewModel.readOnly=e}get selectedAttachment(){return this.viewModel.selectedAttachment}get selectedAttachmentDetails(){return this.viewModel.selectedAttachmentDetails}get valid(){return this.viewModel.valid}get _associationsEnabled(){const{callbacks:e}=this;return!(!e?.addAssociation&&!e?.editAssociatedFeature)}get _formId(){return`${this.id}-form`}get _relatedRecordsEnabled(){const{callbacks:e}=this;return!(!e||!e.addRelatedRecord&&!e.editRelatedRecord)}async goBack(){return this.viewModel.goBack()}async goHome(){return this.viewModel.goHome()}goToFirstError(){const e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;const{groupInput:t}=e;t&&(t.open||(t.open=!0)),this._focusedFieldInput=e.input,this._attemptFocusOnNextRender=!0,this.scheduleRender()}render(){return he("div",{class:this.classes(M.base,re.widget,re.panel)},this._renderContent(),this._renderAttachmentDialog())}setActiveAssociationsInput(e){this.viewModel.setActiveAssociationsInput(e)}setActiveAssociationsLayer(e){this.viewModel.setActiveAssociationsLayer(e)}setActiveAssociationType(e){this.viewModel.setActiveAssociationType(e)}submit(){return this.viewModel.submit()}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:a}=e.dataset,i=n(this._dateComponentMap,`${a}`,()=>({}));switch(t){case"date":i.date=e;break;case"time":i.time=e;break;case"timeZone":i.timeZone=e}}_renderContent(){const{messages:e,viewModel:a}=this,{status:i}=a;return"failed"===i?a.hasTooManyComplexFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyComplexFeatures,{num:a.maximumFeatureCountWithComplexForms})):a.hasTooManyFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyFeatures,{num:a.maximumFeatureCount})):e.formFailedToLoad:a.expressionEvaluationFailed?this._renderErrorNotice(e.expressionEvaluationFailed):a.hasLayersWithContingentValues&&this.viewModel.features.length>1?this._renderErrorNotice(e.unsupportedContingentValues):"loading"===i&&this.visibleElements.loadingIndicator?he("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):0!==this.features.length?this._renderForm():void 0}_renderErrorNotice(e,t="warning"){return he("calcite-notice",{class:M.noticeError,icon:!0,kind:t,open:!0},he("div",{slot:"message"},e))}_renderForm(){return he("form",{class:M.form,id:this._formId,onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderPage())}_renderPage(){switch(this.page){case"adding-attachments":return this._renderAttachmentAddPage();case"viewing-attachment-details":case"replacing-attachment":return this._renderAttachmentDetailPage();case"viewing-attachments":return this._renderAttachmentListPage();case"viewing-associated-layers":case"viewing-associated-features":return this._renderViewingAssociationsPage();case"viewing-related-categories":case"viewing-related-records":return this._renderRelationshipListPage();default:return this._renderFormContent()}}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:a}=e;let i;if(!e.submitHasBeenAttempted)return null;if(a.invalidHiddenInputs.length>0)if(i=I(a,e.mode,this.messages),"batch"===this.viewModel.mode){const e=a.invalidHiddenInputs.filter(e=>"hidden:group-visibility-expression:all-features"===e.effectiveVisibilityCode||"hidden:visibility-expression:all-features"===e.visibilityCode);e.length>0?i+=` (${e.map(e=>e.label).join(", ")})`:i=null}else i+=` (${a.invalidHiddenInputs.map(e=>e.label).join(", ")})`;else if(t)return null;return i?this._renderErrorNotice(i,"danger"):null}_renderFormContent(){return this.viewModel.hasVisibleInputs?this.viewModel.activeForm.inputs.filter(e=>e.visible).map(e=>this._renderInput(e)):this._renderErrorNotice(this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason])}_renderInput(e){return R(e)?this._renderGroupInput(e):N(e)?this._renderLabeledField(e):U(e)?this._renderTextComponent(e):P(e)?this._renderRelationshipElementInput(e):B(e)?this._renderAttachmentElementInput(e):$(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderGroupInput(e){const{inputs:t,template:a,open:i}=e,n=t.filter(e=>e.visible),s=a.label??"";return he("calcite-block",{class:this.classes(M.group,"sequential"===this.groupDisplay?M.groupSequential:null,this.disabled?M.inputDisabled:null),collapsible:!0,description:a.description??void 0,disabled:this.effectiveDisabled,expanded:i,heading:s,headingLevel:this.headingLevel,key:`{${a.elementId}-key}`,label:s,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},n.map(e=>this._renderInput(e)))}_renderLabeledField(e){const{elementId:a}=e.template,{label:i,required:n,dataType:s}=e,l=n?t(this.messages.requiredFieldLabel,{name:i}):i;return he("calcite-label",{"aria-label":l,class:M.label,key:`field--${a}`},he("div",{class:M.labelTextContent,key:"labelTextContainer"},i,n?he("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==s?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:a}=e;return"date"===a?this._renderDateComponents(e,t):"coded-value"===e.domain?.type?this._renderCodedInputs({input:e,props:t}):null!==e.multipleChoiceChoices?this._renderMultipleChoiceComponent({input:e,props:t}):"number"===a?this._renderNumberComponent(e,t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{description:t}=e,a=this._getErrorToDisplay(e),i=a?w(e,a,this.messages):null;return i?he("calcite-input-message",{icon:!0,status:"invalid"},i):t?he("calcite-input-message",{class:M.description,icon:!1,status:"idle"},t):null}_renderCodedInputs({input:e,props:t}){const a=e.input?.type??null,i=e.codedValueOptions;switch(a){case"switch":return this._renderSwitchField({input:e,props:t});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:i,props:t});default:return this._renderComboBoxComponent({options:i,props:t,input:e})}}_renderMultipleChoiceComponent({input:e,props:t}){const{messages:a}=this,{multipleChoiceChoices:i,multipleChoiceInput:n,multipleChoiceValues:s}=e;if(!n||!i||!s)return null;const l=!0===n.includeSelectAllChoices,o=new Map;let r=s.length>0,c=!1;for(const b of s){const t=H({input:e,choiceValue:b});o.set(b,t),(t.checked||t.indeterminate)&&(c=!0),t.checked||(r=!1)}const d={checked:r,indeterminate:!r&&c},m=d.checked?a.deselectAllLabel:a.selectAllLabel,h=e.getMultipleChoiceOtherChoiceRenderState(this.messages.otherOptionLabel),u=t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:!0})},p=t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t})},g=t=>{const{fieldName:a}=h;a&&this._saveOtherChoiceCheckboxValue({input:e,isChecked:t.checked,otherChoiceFieldName:a})},v=t=>{this._saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:h.fieldName})};return he("div",{class:M.multipleChoiceInput,key:`${t.key}-multiple-choice-group`},l?this._renderMultipleChoiceSelectAllCheckbox({props:t,selectAllState:d,selectAllLabel:m,handleSelectAllCheckboxChange:u}):null,this._renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:o,handleChoiceCheckboxChange:p}),h.shouldShow?this._renderMultipleChoiceOtherChoice({props:t,includeSelectAllChoices:l,otherChoiceRenderState:h,handleOtherChoiceCheckboxChange:g,handleOtherChoiceInputChange:v,differentValuesPlaceholder:a.differentValuesPlaceholder}):null)}_renderMultipleChoiceSelectAllCheckbox({props:e,selectAllState:t,selectAllLabel:a,handleSelectAllCheckboxChange:i}){return he("calcite-checkbox",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],checked:t.checked,class:M.multipleChoiceSelectAll,"data-element-id":e[ge],disabled:e.readOnly,indeterminate:t.indeterminate,key:`${e.key}-select-all`,label:a,labelText:a,value:ve,onblur:e.onblur,onCalciteCheckboxChange:({currentTarget:e})=>i(e),onfocus:e.onfocus})}_renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:a,handleChoiceCheckboxChange:i}){const{multipleChoiceChoices:n}=e;return n?n.map(e=>{const n=a.get(e.value)??{checked:!1,indeterminate:!1};return he("calcite-checkbox",{afterCreate:t.afterCreate,afterUpdate:t.afterUpdate,"aria-invalid":t["aria-invalid"],checked:n.checked,class:t.class,"data-element-id":t[ge],disabled:t.readOnly,indeterminate:n.indeterminate,key:`${t.key}-${e.value}`,label:e.label,labelText:e.label,required:t.required,value:e.value,onblur:t.onblur,onCalciteCheckboxChange:({currentTarget:e})=>i(e),onfocus:t.onfocus})}):[]}_renderMultipleChoiceOtherChoice({props:e,includeSelectAllChoices:t,otherChoiceRenderState:a,handleOtherChoiceCheckboxChange:i,handleOtherChoiceInputChange:n,differentValuesPlaceholder:s}){return he("div",{class:this.classes(M.multipleChoiceOtherChoice,t?M.multipleChoiceOtherChoiceWithSelectAll:null),key:`${e.key}-other-choice`},he("calcite-checkbox",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],checked:a.checkboxState.checked,class:e.class,"data-element-id":e[ge],disabled:e.readOnly,indeterminate:a.checkboxState.indeterminate,key:`${e.key}-other-choice-checkbox`,label:a.label,labelText:a.label,value:be,onblur:e.onblur,onCalciteCheckboxChange:({currentTarget:e})=>i(e),onfocus:e.onfocus}),a.checkboxState.checked?he("calcite-input",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],"aria-label":a.label,class:M.textElementInput,"data-element-id":e[ge],disabled:e.readOnly,key:`${e.key}-other-choice-input`,maxLength:a.maxLength,placeholder:a.value===z?s:a.hint,required:e.required,type:"text",value:a.normalizedValue===z?"":a.normalizedValue?String(a.normalizedValue):"",onblur:e.onblur,onCalciteInputInput:({currentTarget:e})=>n(e),onfocus:e.onfocus}):null)}async _saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:a=!1}){if(this._markFieldInputTouched(e),e.multipleChoiceInput&&!a&&"batch"===this.viewModel.mode)return void await this._saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t});const i=e.value,n=this._parseValue(t,e,a);n!==i&&await this.viewModel.setValue(e.template.elementId,n)}async _saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:a}){if(!a)return;const i=t.value,n=null==i||""===i?null:i;e.initializeExplicitMultipleChoiceOtherChoiceCheckedState(),e.stashMultipleChoiceOtherChoiceDraftValueForFeatures(e.features,n);const s=j(e,a);s&&await this.viewModel.setValueForFieldName(s,n,e.template.elementId,Array.from(e.features,e=>e.source))}async _saveOtherChoiceCheckboxValue({input:e,isChecked:t,otherChoiceFieldName:a}){e.setExplicitMultipleChoiceOtherChoiceCheckedState(t),this._markFieldInputTouched(e),t||e.setMultipleChoiceOtherChoiceDraftValuesFromFeatures(e.features.toArray());const i=j(e,a);if(!i)return;const n=new Map;for(const s of e.features){const i=s.getAttribute(a);if(t){if(!pe(i))continue;const t=e.getMultipleChoiceOtherChoiceDraftValue(s),a=X(t)?t:Z;n.set(s,a);continue}null!=i&&n.set(s,null)}0!==n.size&&await this.viewModel.setValuePerFeatureForFieldName(i,new Map(Array.from(n,([e,t])=>[e.source,t])),e.template.elementId)}async _saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t}){if(!e.multipleChoiceInput||!e.multipleChoiceValues)return;const a=new Map(e.features.map(a=>[a,G({input:e,choiceValue:t.value,currentValue:a.getAttribute(e.fieldName),isChecked:t.checked})]));0!==a.size&&await this.viewModel.setFieldInputValuePerFeature(e,a)}_renderSwitchField({input:e,props:t}){if((this._batchSwitchInputInitialValues.get(e)===z||e.value===z)&&"batch"===this.viewModel.mode){const a={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[ge]:t[ge]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:a,options:[{name:this.messages.differentValuesPlaceholder,value:z,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return he("calcite-switch",{...t,checked:!!F(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:a}){const{trigger:i,dropdown:n,group:s}=a;return he("calcite-dropdown",{...n,topLayerDisabled:this.topLayerDisabled,onblur:()=>{this._focusedFieldInput=null},onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e),onfocus:this._onComponentFocus},he("calcite-button",{...i},e===z?this.messages.differentValuesPlaceholder:e),he("calcite-dropdown-group",{selectionMode:s.mode},t.map(t=>he("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name))))}_renderComboBoxComponent({input:e,options:t,props:a}){const i="INSERT"===this.viewModel.editType,n=this._touchedInputs.has(e?.template?.elementId),s=i&&e.showNoValueOptionEnabled&&!n?()=>{}:a.onblur,l={...a,onblur:s};return he("calcite-combobox",{...l,selectionMode:"single",topLayerDisabled:this.topLayerDisabled,value:a.placeholder===this.messages.differentValuesPlaceholder?z:String(a.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==z&&this._saveInput(e)}},this.renderComboboxOptionsList({input:e,options:t,props:a}))}renderComboboxOptionsList({input:e,options:t,props:a}){const i=e=>e.map(e=>{const{value:t}=e,i=pe(e.value)?this.messages.empty:e.name;return he("calcite-combobox-item",{heading:i,key:`#${t}`,selected:a.value===t,value:`${t}`})});let n=[];const{messages:s}=this;t.other.length>0&&n.push(he("calcite-combobox-item-group",{key:"other",label:s.other},i(t.other))),t.unsupported.length>0&&n.push(he("calcite-combobox-item-group",{key:"unsupported",label:s.unsupported},i(t.unsupported)));const l=i(t.recommended);n.length>0?n.unshift(he("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):n=l;const o=a.placeholder===this.messages.differentValuesPlaceholder,r=!o&&pe(a.value);return e.showNoValueOptionEnabled&&!t.containsEmptyOption&&n.unshift(he("calcite-combobox-item",{heading:e.showNoValueLabel||this.messages.empty,key:"empty-option",selected:r,value:""})),o&&n.unshift(he("calcite-combobox-item",{heading:this.messages.differentValuesPlaceholder,key:z,selected:!0,value:z})),n}_renderRadioButtonGroupComponent({input:e,options:t,props:a}){const i=[...t.recommended,...t.other,...t.unsupported].map(({name:t,value:i})=>this._renderRadioButtons({label:t,value:i,selected:i===e.value,props:a}));if(e.showNoValueOptionEnabled&&!t.containsEmptyOption){const t="",n=e.showNoValueLabel||this.messages.empty,s=pe(e.value);i.unshift(this._renderRadioButtons({label:n,value:t,selected:s,props:a}))}return he("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:M.inputRadioGroup,disabled:a.readOnly,key:`${a.key}-radio-group`,layout:"vertical",name:a.name,required:a.required},i,a.placeholder===this.messages.differentValuesPlaceholder?he("calcite-label",{class:M.placeholderRadio,key:a.label,layout:"inline"},he("calcite-radio-button",{checked:!0,class:M.inputRadio,disabled:!0,name:a.placeholder,value:a.placeholder}),a.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:a,props:i}){return he("calcite-label",{class:M.inputRadioLabel,key:i.label,layout:"inline"},he("calcite-radio-button",{...i,afterCreate:void 0,afterUpdate:void 0,checked:t,class:M.inputRadio,disabled:i.readOnly,name:i.label,value:e,onblur:()=>{this._focusedFieldInput=null},onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),a)}_renderStringComponent(e,t){const{template:a}=e;return!a.field.editable||this.readOnly?this._renderReadOnlyComponent(e):"text-area"===a.input?.type?he("calcite-text-area",{...t,class:this.classes(M.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):he("calcite-input",{...t,class:this.classes(M.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)})}_renderNumberComponent(e,t){const a=g(e.field);return he("calcite-input-number",{...t,integer:a,type:"number",value:a&&""!==t.value?Math.round(parseFloat(String(t.value))).toString():String(t.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const a=this.getCommonInputProps(e);return he("calcite-input",{...a,class:this.classes(M.fieldInput,M.inputDisabled,M.individualElement),readOnly:!0,type:"text",value:String(t??a.value??"")})}_renderDateComponents(e,t){const{field:a}=e;let i;switch(a.type){case"date":i=this._renderDateFieldComponents(e,t);break;case"date-only":i=this._renderDateOnlyFieldComponent(e,t);break;case"time-only":i=this._renderTimeOnlyFieldComponent(e,t);break;case"timestamp-offset":i=this._renderTimestampOffsetFieldComponents(e,t);break;default:i=this._renderReadOnlyComponent(e,te(a,t.value,{timeZone:e.effectiveTimeZone,...ae(e.template.field)}))}return e.value===z?[i,he("calcite-input-message",{icon:"information",key:"diff-values-message",status:"idle"},this.messages.differentValues)]:i}_renderDateOnlyFieldComponent(e,t){const{class:a,key:i,readOnly:n}=t,{rawMax:s,rawMin:l}=e.range;return he("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:a,"data-date-part":"date","data-element-id":t[ge],key:`${i}-date-input`,max:v(s)?s:void 0,min:v(l)?l:void 0,overlayPositioning:"fixed",readOnly:n,topLayerDisabled:this.topLayerDisabled,value:e.value===z?"":e.value?String(e.value):"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget),onfocus:this._onComponentFocus})}_renderTimeOnlyFieldComponent(e,t){const{class:a,key:i,readOnly:n}=t;return he("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:a,"data-date-part":"time","data-element-id":t[ge],key:`${i}-time-input`,overlayPositioning:"fixed",readOnly:n,value:e.value===z?"":e.value?String(e.value):"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget),onfocus:this._onComponentFocus})}_renderTimestampOffsetFieldComponents(e,t){const{class:a,key:i,readOnly:n}=t,{rawMax:s,rawMin:l}=e.range,o=ie(s),r=ie(l),c=ie(e.value===z?"":e.value),d=e.includeTimeOffset,m={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[ge]:t[ge],onfocus:this._onComponentFocus};return he("div",{class:M.dateInputContainer,key:`${i}-date-time-container`},he("calcite-input-date-picker",{...m,class:a,"data-date-part":"date",key:`${i}-date-input`,max:o?.date??void 0,min:r?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:c.date??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),he("calcite-input-time-picker",{...m,class:a,"data-date-part":"time",key:`${i}-time-input`,value:c.time??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),d?he("calcite-input-time-zone",{...m,class:a,clearable:e.value===z||null==e.value,"data-date-part":"timeZone",key:`${i}-timezone-input`,value:c.timeZoneOffset||"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:a,key:i,readOnly:n,min:s,max:l}=t,o=e.effectiveTimeZone,r=ne(e.value===z?"":e.value,o),c=ne(l,o),d=ne(s,o),m=e.includeTime,h={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[ge]:t[ge],onfocus:this._onComponentFocus};return he("div",{class:M.dateInputContainer,key:`${i}-date-time-container`},he("calcite-input-date-picker",{...h,class:a,"data-date-part":"date",key:`${i}-date-input`,max:c?.date??void 0,min:d?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:r.date??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),m?he("calcite-input-time-picker",{...h,"data-date-part":"time",key:`${i}-time-input`,step:1,value:r.time??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}_renderRelationshipElementInput(e){return this._relatedRecordsEnabled?he(Q,{afterObserverCreated:this._afterListObserverCreated,afterObserverRemoved:this._afterListObserverRemoved,input:e,messages:this.messages,messagesCommon:this.messagesCommon,viewModel:this.viewModel}):null}_renderRelationshipListPage(){const{activeRelationshipInput:e}=this.viewModel;if(e)return this._renderRelationshipElementInput(e)}_renderAttachmentElementInput(e){if(!this.attachmentsEnabled)return;const{allAttachmentsVisibleOnDefaultPage:t,attachments:a,defaultPageAttachments:i,template:{description:n,elementId:s,label:l}}=e,o=t?a:i;return he("div",{class:M.attachmentElementInput,"data-testid":`attachment-element-${s}`,key:`attachment-element-${s}`},l?he("div",{class:M.attachmentElementLabel,key:`attachment-element-label-${s}`},l):null,n?he("div",{class:M.description,key:`attachment-element-description-${s}`},n):null,a.length?this._renderAttachmentList(e,o,{label:l||this.messagesCommon.details,viewAllCount:t?null:a.length}):he("div",{class:M.attachmentElementEmptyState,key:`attachment-element-empty-state-${s}`},this.messages.attachments.noAttachments),this._renderAttachmentAddAction(e))}_renderAttachmentListPage(){const e=this.viewModel.selectedAttachmentListInput;if(e)return he("div",{class:M.attachmentElementAllPanel,key:`attachment-element-all-panel-${e.template.elementId}`},this._renderAttachmentList(e,e.attachments,{filterEnabled:!0,label:this.messages.titles.attachments}))}_renderAttachmentList(e,t,a){const{filterEnabled:i,label:n,viewAllCount:s}=a;return he("calcite-list",{class:M.attachmentElementList,filterEnabled:i,filterPlaceholder:i?this.messages.attachments.searchAttachments:void 0,filterProps:i?ce:void 0,filterText:i?this._attachmentListFilterText:void 0,label:n,selectionAppearance:"border",selectionMode:"none",onCalciteListFilter:i?e=>{this._attachmentListFilterText=e.currentTarget.filterText??""}:void 0},this._renderAttachmentListItems(e,t),null!=s?this._renderViewAllAttachmentsItem(e,s):null)}_renderAttachmentListItems(e,t){const{elementId:a}=e.template;return t.map((t,i)=>{const n=this._formatAttachmentSize(t.size),s=this._getAttachmentLabel(t,i,n,e.displayFilename),l=s===n?void 0:n,o=C(t),r=e.isStagedAttachmentAddition(t),c=e.getAttachmentEditState(t),d=c.isDeleted,m=!d&&(r||c.isRenamed||c.isReplaced);return he("calcite-list-item",{class:M.attachmentElementListItem,description:l,key:`attachment-item-${o}`,label:s,onCalciteListItemSelect:r||d?void 0:()=>this._setSelectedAttachment({attachmentKey:o,elementId:a})},he("div",{class:M.attachmentElementListItemStart,slot:"content-start"},this._renderAttachmentPreviewThumbnail(t,s,e)),m?he("span",{class:M.attachmentElementListItemStagedIndicator,slot:"content-end"}):null,r?[he("calcite-action",{disabled:this.effectiveDisabled,icon:"x",scale:"s",slot:"actions-end",text:this.messagesCommon.delete,title:this.messagesCommon.delete,onclick:()=>this.viewModel.stageDeleteAttachment(a,t.globalId)})]:d?he("calcite-chip",{label:this.messages.attachments.deleted,scale:"s",slot:"content-end"},this.messages.attachments.deleted):he("calcite-action",{icon:"chevron-right",scale:"s",slot:"actions-end",text:s,title:s}))})}_renderViewAllAttachmentsItem(e,a){const{elementId:i}=e.template,{viewAll:n}=this.messages.attachments;return he("calcite-list-item",{class:M.attachmentElementListItem,description:t(this.messages.attachments.count,{count:a}),key:`attachment-item-view-all-${i}`,label:n,onCalciteListItemSelect:()=>this._setAttachmentListElementId(i)},he("calcite-action",{icon:"chevron-right",scale:"s",slot:"actions-end",text:n,title:n}))}_renderAttachmentAddAction(e){const{elementId:t}=e.template,a=this.effectiveDisabled||e.addDisabled,i=this._renderAttachmentCountLimitsLabel(e),n=this._getAttachmentNoticeMessage(e),s=e.hasMinimumAttachmentCountNotMet||e.hasExceededAttachmentLimit?"danger":"info",l=e.canUploadFiles,o=e.isCaptureOnly&&!this.effectiveDisabled&&!n;return he("div",{class:M.attachmentElementAddActions,key:`attachment-element-add-actions-${t}`},l?he("calcite-button",{appearance:"outline",disabled:a,iconStart:"attachment",kind:"neutral",round:!0,scale:"s",onclick:()=>this._setAttachmentAddElementId(t)},this.messages.attachments.attach):null,this._renderAttachmentCaptureButton(e),o?this._renderAttachmentCaptureDisabledNotice(t):null,i?he("div",{class:M.attachmentElementEmptyActionHint},i):null,!this.effectiveDisabled&&n?he("calcite-notice",{closable:!1,icon:"danger"===s?"exclamation-mark-circle":"lightbulb",kind:s,open:!0,scale:"s",width:"full"},he("div",{slot:"message"},n)):null)}_renderAttachmentCaptureButton(e){if(!e.hasCaptureInputs)return null;const t=e.captureMediaType;return he("calcite-button",{appearance:"outline",disabled:!0,iconStart:_e(t),kind:"neutral",round:!0,scale:"s"},this._getCaptureButtonLabel(t))}_getAttachmentNoticeMessage(e){const t=this.messages.attachments;return e.hasUnsupportedFileTypeValidationError?this._getUnsupportedFileTypeMessage():e.hasMinimumAttachmentCountNotMet&&this._shouldShowMinimumAttachmentNotice(e)?t.minimumNotMet:e.hasExceededAttachmentLimit?t.attachmentLimitExceeded:e.hasReachedAttachmentLimit?t.attachmentLimitReached:null}_shouldShowMinimumAttachmentNotice(e){return e.hasAttachmentChanges||this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId)}_getCaptureButtonLabel(e){const{capture:t,recordAudio:a,takePhoto:i,takeVideo:n}=this.messages.attachments;switch(e){case"image":return i||t;case"video":return n||t;case"audio":return a||t;default:return t}}_renderAttachmentAddPage(){const e=this.viewModel.selectedAttachmentAddInput;return e?this._renderAttachmentAddPanel(e):null}_renderAttachmentAddPanel(e){const{maxAttachmentCount:t}=e,{elementId:a}=e.template;if(e.isCaptureOnly)return this._renderAttachmentCaptureDisabledNotice(a);const i=null==t||t-e.attachments.length>1,n=this.effectiveDisabled||e.addDisabled,s=this.messages.attachments,l=s.dragAndDropFile,o="upload",r=e=>{this._attachmentFileInputMap.set(a,e)};return he("div",{class:M.attachmentElementAddPanel,key:`attachment-element-add-panel-${a}`},he("input",{accept:e.accept,afterCreate:r,afterRemoved:()=>{this._attachmentFileInputMap.delete(a)},afterUpdate:r,class:M.attachmentElementFileInput,"data-element-id":a,disabled:n,multiple:i,type:"file",onchange:e=>{const t=e.currentTarget,i=t.files?Array.from(t.files):[];this._stageAttachmentFiles(a,i),t.value=""}}),he("div",{class:M.attachmentElementAddDropzone,"data-disabled":n?"true":"false",ondragover:e=>{e.preventDefault()},ondrop:e=>{if(e.preventDefault(),n)return;const t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[];this._stageAttachmentFiles(a,t)}},he("calcite-icon",{class:M.attachmentElementAddDropzoneIcon,icon:o,scale:"l"}),he("div",{class:M.attachmentElementAddDropzoneHeading},s.addFile),he("div",{class:M.attachmentElementAddDropzoneDetail,title:l},l),he("calcite-button",{appearance:"transparent",disabled:n,iconStart:"folder-open",kind:"brand",scale:"s",type:"button",onclick:e=>{e.stopPropagation(),this._openAttachmentFilePicker(a,n)}},s.selectFile)),this._renderAttachmentValidationCriteria(e,{includeCountCriteria:!0}))}_renderAttachmentCaptureDisabledNotice(e){return he("calcite-notice",{class:M.attachmentElementCaptureNotice,icon:!0,key:`attachment-element-capture-disabled-notice-${e}`,kind:"warning",open:!0,scale:"s"},he("div",{slot:"message"},this.messages.attachments.captureMethodNotSupported))}async _stageAttachmentFiles(e,t){if(0===t.length)return;const a=this.viewModel.selectedAttachmentAddInput;let i=!0;try{i=(await this.viewModel.stageAddAttachments(e,t)).length>0&&!a?.hasInvalidValidationCriteria&&!a?.hasUnsupportedFileTypeValidationError}finally{i&&this.viewModel.setSelectedAttachmentAddElementId(null)}}_openAttachmentFilePicker(e,t){t||this._attachmentFileInputMap.get(e)?.click()}_renderAttachmentDetailPage(){const e=this.selectedAttachmentDetails;if(!e)return;if("replacing-attachment"===this.page)return this._renderAttachmentReplacePanel(e);const{attachment:t,input:a}=e,i=C(t),n=!!a.getAttachmentPreviewUrl(t),s=a.getAttachmentEditState(t),{baseName:l,extension:o}=A(t.name),r=!this.readOnly&&!this.effectiveDisabled,c=r&&a.canUploadFiles;return he("div",{class:M.attachmentElementDetail,key:`attachment-detail-panel-${a.template.elementId}-${i}`},he("div",{class:M.attachmentElementDetailPreview},this._renderAttachmentPreviewImageForInput(t,a)),he("div",{class:M.attachmentElementDetailActions},y(t)?he("calcite-button",{appearance:"outline",disabled:!n,iconStart:"expand",kind:"neutral",label:this.messages.attachments.maximize,scale:"m",title:this.messages.attachments.maximize,onclick:this._maximizeSelectedAttachment}):null,he("calcite-button",{appearance:"outline",disabled:!n,iconStart:"download",kind:"neutral",label:this.messages.attachments.download,scale:"m",title:this.messages.attachments.download,onclick:()=>{this._downloadAttachment(t)}}),he("calcite-button",{appearance:"outline",disabled:!c,iconStart:"upload-to",kind:"neutral",label:this.messages.attachments.replace,scale:"m",title:this.messages.attachments.replace,onclick:this._enterAttachmentReplaceView})),he("div",{class:M.attachmentElementDetailMetadata},he("div",{class:M.attachmentElementDetailMetadataGroup},he("span",{class:M.attachmentElementDetailMetadataLabel},this.messages.attachments.fileName),a.allowUserRename?he("div",{class:M.attachmentElementDetailFileNameRow},he("calcite-input",{class:M.attachmentElementDetailFileNameInput,disabled:!r,scale:"m",suffixText:o,value:l,onCalciteInputInput:({currentTarget:e})=>this._renameSelectedAttachment(e.value)}),he("calcite-button",{appearance:"transparent",disabled:!r||null==s.initialName||!s.isRenamed,iconStart:"reset",kind:"neutral",scale:"m",title:this.messages.footerButtons.reset,onclick:this._resetSelectedAttachmentName})):he("span",{class:M.attachmentElementDetailMetadataValue},t.name)),he("div",{class:M.attachmentElementDetailMetadataGroup},he("span",{class:M.attachmentElementDetailMetadataLabel},this.messages.attachments.size),he("span",{class:M.attachmentElementDetailMetadataValue},this._formatAttachmentSize(t.size))),he("div",{class:M.attachmentElementDetailMetadataGroup},he("span",{class:M.attachmentElementDetailMetadataLabel},this.messages.attachments.type),he("span",{class:M.attachmentElementDetailMetadataValue},this._getLabelForAttachmentType(t)))))}_renderAttachmentReplacePanel(e){const{attachment:t,input:a}=e,i=this.readOnly||this.effectiveDisabled||!a.canUploadFiles,n=a.template.elementId;return he("div",{class:M.attachmentElementAddPanel,key:`attachment-replace-panel-${n}-${C(t)}`},he("input",{accept:a.accept,afterCreate:this._setSelectedAttachmentReplaceFileInput,afterRemoved:()=>{this._selectedAttachmentReplaceFileInput=null},afterUpdate:this._setSelectedAttachmentReplaceFileInput,class:M.attachmentElementFileInput,disabled:i,type:"file",onchange:e=>{const t=e.currentTarget,a=t.files?.[0];a&&this._stageSelectedAttachmentReplacement(a),t.value=""}}),he("div",{class:M.attachmentElementAddDropzone,"data-disabled":i?"true":"false",ondragover:e=>{e.preventDefault()},ondrop:e=>{if(e.preventDefault(),i)return;const t=e.dataTransfer?.files?.[0];t&&this._stageSelectedAttachmentReplacement(t)}},he("calcite-icon",{class:M.attachmentElementAddDropzoneIcon,icon:"refresh",scale:"l"}),he("div",{class:M.attachmentElementAddDropzoneHeading},this.messages.attachments.replace),he("div",{class:M.attachmentElementAddDropzoneDetail,title:this.messages.attachments.dragAndDropFile},this.messages.attachments.dragAndDropFile),he("calcite-button",{appearance:"transparent",disabled:i,iconStart:"folder-open",kind:"brand",scale:"s",onclick:e=>{e.stopPropagation(),this._openSelectedAttachmentReplaceFilePicker()}},this.messages.attachments.selectFile)),this._renderAttachmentValidationCriteria(a,{includeCountCriteria:!1}),he("div",{class:M.attachmentElementDetailMetadata},he("div",{class:M.attachmentElementDetailMetadataGroup},he("span",{class:M.attachmentElementDetailMetadataLabel},this.messages.attachments.fileToBeReplaced),he("span",{class:M.attachmentElementDetailMetadataValue},t.name))))}_renderAttachmentDialog(){const e=this._attachmentDialogInfo;if(!e)return null;const{attachment:t,input:a}=e;return he("calcite-dialog",{heading:t.name||this.messagesCommon.details,key:"attachment-preview-dialog",modal:!0,open:!0,placement:"cover",width:"l",onCalciteDialogClose:this._closeAttachmentDialog},he("div",{class:M.attachmentElementDetailPreview},this._renderAttachmentPreviewImageForInput(t,a)))}_setSelectedAttachment(e){e?.elementId&&this._touchedInputs.add(e.elementId),this.viewModel.setSelectedAttachment(e),e||this.hideAttachmentDialog()}_setAttachmentAddElementId(e){e&&this._touchedInputs.add(e),this.viewModel.setSelectedAttachmentAddElementId(e),this.viewModel.selectedAttachmentAddInput?.clearValidationCriteriaState(),this.hideAttachmentDialog()}_setAttachmentListElementId(e){e&&this._touchedInputs.add(e),this.viewModel.setSelectedAttachmentListElementId(e),this.hideAttachmentDialog()}_getAttachmentLabel(e,a,i,n){return!1!==n&&v(e.name)&&e.name.length>0?e.name:i!==this.messagesCommon.notApplicable?i:t(this.messages.attachments.attachmentNumberedLabel,{index:a+1})}_renderAttachmentCountLimitsLabel(e){const t=this.messages.attachments,a=null!=e.minAttachmentCount&&e.minAttachmentCount>0?this._renderAttachmentCountLimitLabel(t.minAttachmentsShort,e.minAttachmentCount,"min"):null,i=null!=e.maxAttachmentCount?this._renderAttachmentCountLimitLabel(t.maxAttachmentsShort,e.maxAttachmentCount,"max"):null;return a||i?[a,a&&i?he("span",{key:"attachment-count-limits-separator"},", "):null,i]:null}_renderAttachmentCountLimitLabel(e,a,i){const n="__count__",[s,l]=t(e,{count:n}).split(n);return he("span",{key:i},s,he("span",{class:M.attachmentElementEmptyActionHintValue},a),l)}_renderAttachmentValidationCriteria(e,{includeCountCriteria:t}){const a=this._getAttachmentValidationCriteria(e,{includeCountCriteria:t}),i=`attachment-validation-criteria-${e.template.elementId}`;return 0===a.length?null:he("div",{class:M.attachmentElementValidationCriteria,key:i},a.map(({key:e,message:t,state:a})=>he("calcite-notice",{appearance:"danger"===a?"outline-fill":"transparent",closable:!1,icon:!0,key:e,kind:a,open:!0,scale:"s",width:"full"},he("div",{slot:"message"},t))))}_getAttachmentValidationCriteria(e,{includeCountCriteria:a}){const i=[],n=e.validationCriterionStates,s=this.messages.attachments,l=this._getNestableAttachmentInputs(e.input);e.hasUnsupportedFileTypeValidationError&&i.push({key:"unsupported-file-type",message:this._getUnsupportedFileTypeMessage(),state:"danger"});for(const o of l)"document"===o.type&&null!=o.maxFileSize&&i.push({key:"maximum-file-size",message:t(s.maximumFileSize,{maxSize:this._formatAttachmentSizeLimitInMegabytes(o.maxFileSize)}),state:n.get("maximum-file-size")??"info"}),"audio"===o.type&&null!=o.maxDuration&&i.push({key:"maximum-audio-length",message:t(s.maximumAudioLength,{maxDuration:this._formatAttachmentDurationLimit(o.maxDuration)}),state:n.get("maximum-audio-length")??"info"}),"video"===o.type&&null!=o.maxDuration&&i.push({key:"maximum-video-length",message:t(s.maximumVideoLength,{maxDuration:this._formatAttachmentDurationLimit(o.maxDuration)}),state:n.get("maximum-video-length")??"info"});return a&&null!=e.minAttachmentCount&&e.minAttachmentCount>0&&i.push({key:"minimum-number-of-files",message:t(s.minimumNumberOfFiles,{count:e.minAttachmentCount}),state:n.get("minimum-number-of-files")??"info"}),a&&null!=e.maxAttachmentCount&&i.push({key:"maximum-number-of-files",message:t(s.maximumNumberOfFiles,{count:e.maxAttachmentCount}),state:n.get("maximum-number-of-files")??"info"}),i}_getNestableAttachmentInputs(e){return null==e?[]:"attachment"===e.type?e.inputTypes?.slice()??[]:[e]}_getUnsupportedFileTypeMessage(){return this.featureTableMessages.errorFileUnsupported}_formatAttachmentSize(e){return null==e||Number.isNaN(e)?this.messagesCommon.notApplicable:m(this.messagesUnits,e)}_formatAttachmentSizeLimitInMegabytes(e){return m(this.messagesUnits,1048576*e)}_formatAttachmentDurationLimit(e){return p(1e3*Math.round(e),{...e>=3600?{hour:"2-digit",hourCycle:"h23"}:{},minute:"2-digit",second:"2-digit",timeZone:"UTC"})}_getLabelForAttachmentType({contentType:e}){if(!e)return this.messagesCommon.notApplicable;const t=this.messages.attachments.attachmentTypes,a=f(e);return t?.[a]||e}_renderAttachmentPreviewThumbnail(e,t,a){const i=a.getAttachmentPreviewUrl(e,64);return i&&y(e)?he("img",{alt:t,class:M.attachmentElementListItemThumb,src:i}):he("calcite-icon",{class:M.attachmentElementListItemIcon,icon:_(e.contentType),scale:"s"})}_renderAttachmentPreviewImageForInput(e,t){const a=t.getAttachmentPreviewUrl(e),i=e.name||this.messagesCommon.details;return a&&y(e)?he("img",{alt:i,class:M.attachmentElementDetailPreviewImage,src:a,title:i}):[he("calcite-icon",{class:M.attachmentElementDetailPreviewIcon,icon:_(e.contentType),scale:"l",textLabel:i,title:i}),this.messages.attachments.noPreviewAvailable]}async _downloadAttachment(e){await Y(e)}_canReplaceSelectedAttachment(){return!this.readOnly&&!this.effectiveDisabled&&!!this.selectedAttachmentDetails?.input.canUploadFiles}_exitAttachmentReplaceView(){this.viewModel.setShowingSelectedAttachmentReplacePage(!1),this._selectedAttachmentReplaceFileInput=null}async _stageSelectedAttachmentReplacement(e){const t=this.selectedAttachmentDetails,a=t?.attachment.globalId;if(!t||!a)return;let i=!1;try{i=await this.viewModel.stageReplaceAttachment(t.input.template.elementId,a,e)}finally{i&&this._exitAttachmentReplaceView()}}_renameSelectedAttachment(e){const t=this.selectedAttachmentDetails,a=t?.attachment.globalId;t&&a&&this.viewModel.stageRenameAttachment(t.input.template.elementId,a,e)}_isSelectedAttachmentDeleteDisabled(){const e=this.selectedAttachmentDetails;if(!e)return!1;if(this.readOnly||this.effectiveDisabled)return!0;const t=e.input.minAttachmentCount;return null!=t&&e.input.attachments.length<=t}hideAttachmentDialog(){this._attachmentDialogInfo=null}_renderTextComponent(e){const{elementId:t}=e.template;return he("div",{class:M.textElementInput,"data-testid":`text-element-${t}`,innerHTML:e.text,key:`text-element-${t}`})}_renderUtilityNetworkAssociationsElementInput(e){if(!this._associationsEnabled)return;const{elementId:t}=e.template;return he("div",{class:M.utilityNetworkAssociationsElementInput,"data-testid":t,key:t},this._associationsWidgetsMap.get(e)?.render())}getCommonInputProps(e){const{template:t,valid:a,value:i,minLength:n,maxLength:s,required:l,fieldName:o,editable:r,userHasChangedValue:c,range:{max:d,min:m}}=e,h=!r||this.readOnly,u=!h&&this.effectiveDisabled;let p=t.hint??void 0,g=!1;return i===z&&(p=this.messages.differentValuesPlaceholder,g=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":a?"false":"true",class:this.classes(M.fieldInput,h?M.inputDisabled:null),status:!c&&!this.viewModel.submitHasBeenAttempted||a?"idle":"invalid",maxLength:s&&s>-1?s:void 0,minLength:n&&n>-1?n:void 0,key:t.elementId,label:o,name:o,max:null!=d?d:void 0,min:null!=m?m:void 0,disabled:u,readOnly:h,onblur:this._onComponentBlur,required:l,placeholder:p,value:g?"":i??"",[ge]:t.elementId,onfocus:this._onComponentFocus}}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(ge))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,a=e.querySelector("calcite-radio-button"),i=t||a;i&&this._afterComponentCreateOrUpdate(i)}_onComponentFocus(e){const t=e.target,a=this._getFieldInputFromHTMLElement(t);this._isMultipleChoiceCheckbox(t,a)||this._markFieldInputTouched(a),this._focusedFieldInput=a}_markFieldInputTouched(e){this._touchedInputs.add(e.template.elementId)}_isMultipleChoiceCheckbox(e,t){return"CALCITE-CHECKBOX"===e.tagName&&null!=t.multipleChoiceInput}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),a=this._focusedFieldInput;this._attemptFocusOnNextRender&&a===t&&(this._attemptFocusOnNextRender=!1,ue(e))}_onComponentBlur(){this._focusedFieldInput=null}_resetTransientFormState(){this._attemptFocusOnNextRender=!1,this._focusedFieldInput=null,this._attachmentDialogInfo=null,this._selectedAttachmentReplaceFileInput=null,this._attachmentListFilterText="",this._attachmentFileInputMap.clear()}_parseValue(e,t,a=!1){const i=t.multipleChoiceInput,n=t.multipleChoiceValues;if(i&&n){const s=i.choiceDelimiter,l=e;if(a){return q({input:t}).checked?null:n.length>0?n.join(s):null}const o=K(t.value,s).filter(e=>e!==z),r=new Set(o);l.checked?r.add(l.value):r.delete(l.value);const c=n.filter(e=>r.has(e));return c.length?c.join(s):null}if(F(t.template,"switch")){if("calcite-dropdown"===e.localName&&t.domain)for(const a of t.domain.codedValues)if(a.name===e.selectedItems[0].textContent)return a.code;return e.checked?t.template.input.onValue:t.template.input.offValue}const s=e.value;return null==s||""===s?null:"number"===t.dataType?"-0"===s||"-0."===s||"-0,"===s?s:parseFloat(s):"date"===t.field.type?parseFloat(s):s}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:a}=t.template;if(!t)return;const i=t?.value;if(F(t.template,"switch")&&"single"!==this.viewModel.mode){const e=n(this._batchSwitchInputInitialValues,t,()=>t.value);this._batchSwitchInputInitialValues.set(t,null===e?i:e)}const s=this._parseValue(e,t);s!==i&&this.viewModel.setValue(a,s)}_afterDateComponentCreate(e){this._setDateTimeTimeZoneMap(e),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:a}=e.template,i=e.field.type,n=this._dateComponentMap.get(`${a}`);if(!n)return;const s=e.effectiveTimeZone;let l=e.value===z?void 0:e.value,o=null;"date-only"===i?o=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===i?(l=se(l),o=se(t.value)):o="timestamp-offset"===i?null!=t.value?le({dateComponent:n.date,timeComponent:n.time,oldValue:l,timeZoneComponent:n.timeZone,defaultTimeZone:s}):null:null!=t.value?oe({oldValue:l,dateComponent:n.date,timeZone:s,timeComponent:n.time?.value===z?void 0:n.time}):null,l!==o&&(null!==o&&t.value?this.viewModel.setValue(`${a}`,o):this.viewModel.setValue(`${a}`,null))}_getErrorToDisplay(e){const t=e.compositeError;return e.valid||!t?null:"contingent-values-validation-error::contingency-violation-error"===t||"contingent-values-validation-error::contingency-violation-warning"===t||this._touchedInputs.has(e.template.elementId)||this.viewModel.submitHasBeenAttempted?t:null}_renderViewingAssociationsPage(){return this._associationsList?.render()}_onActiveAssociationsInputChange(e){const t=this._associationsList;t&&(e?(t.associationInput=e,t.viewModel=e.viewModel):t.associationInput=null)}async _setUpAssociationsWidgets(){this._destroyAssociationsWidgets();const e=this.viewModel.activeForm.allUtilityNetworkAssociationsElementInputs;if(this._associationsEnabled&&0!==e.length){await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.set(t,await this._createAssociationsWidget(t))}}async _setUpUtilityNetworkAssociationList(){if(this._associationsList)return;const e=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js")).default;this._associationsList=new e({onSelectLayer:this._onSelectAssociatedLayer.bind(this),onSelectFeature:this._onEditAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)})}async _createAssociationsWidget(e){return new(0,(await import("./Feature/FeatureUtilityNetworkAssociations.js")).default)({viewModel:e.viewModel,onSelectAssociationType:t=>this._onSelectAssociationType(e,t)})}_destroyAssociationsWidgets(){this._associationsList=s(this._associationsList),this._associationsWidgetsMap.forEach(e=>s(e)),this._associationsWidgetsMap.clear()}_onSelectAssociationType(e,{listType:t}){this.setActiveAssociationsInput(e),this.setActiveAssociationType(t)}_onSelectAssociatedLayer({layer:e}){this.setActiveAssociationsLayer(e)}async _onEditAssociatedFeature(e){const t=this.callbacks?.editAssociatedFeature,a=this.viewModel.activeAssociationsInput;if(!t||!a?.feature)return;const{association:i,feature:n}=e;await t({parentFeature:a.feature.plainGraphic,association:i,feature:n})}_onAddAssociation(e){const t=this.callbacks?.addAssociation,a=this.viewModel.activeAssociationsInput;if(!t||!a?.feature)return;const{associationType:i,utilityNetwork:n}=e;t({feature:a.feature.plainGraphic,associationType:i,utilityNetwork:n})}_getSelectedAttachmentEditState(){const e=this.selectedAttachmentDetails;if(e)return e.input.getAttachmentEditState(e.attachment)}};function _e(e){switch(e){case"audio":return _("audio/mpeg");case"video":return _("video/mp4");case"image":return _("image/png");default:return"camera"}}e([h()],fe.prototype,"activeFeatureIndex",null),e([h()],fe.prototype,"attachmentsEnabled",null),e([h()],fe.prototype,"callbacks",null),e([h()],fe.prototype,"disabled",null),e([h()],fe.prototype,"effectiveTitle",null),e([h()],fe.prototype,"effectiveDisabled",null),e([h()],fe.prototype,"features",null),e([h()],fe.prototype,"footerButtonInfos",null),e([h()],fe.prototype,"footerNoticeInfos",null),e([h()],fe.prototype,"map",null),e([h()],fe.prototype,"maximumFeatureCount",null),e([h()],fe.prototype,"maximumFeatureCountWithComplexForms",null),e([h()],fe.prototype,"spatialReference",null),e([h()],fe.prototype,"layerInfos",null),e([h()],fe.prototype,"timeZone",null),e([h()],fe.prototype,"headingLevel",void 0),e([h()],fe.prototype,"icon",null),e([h(),de("esri/t9n/common")],fe.prototype,"messagesCommon",void 0),e([h(),de("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],fe.prototype,"messages",void 0),e([h(),de("esri/widgets/FeatureTable/t9n/FeatureTable")],fe.prototype,"featureTableMessages",void 0),e([h(),de("esri/core/t9n/Units")],fe.prototype,"messagesUnits",void 0),e([h()],fe.prototype,"page",null),e([h()],fe.prototype,"readOnly",null),e([h()],fe.prototype,"selectedAttachment",null),e([h()],fe.prototype,"selectedAttachmentDetails",null),e([h()],fe.prototype,"valid",null),e([h({type:k}),me(["attachments-change","value-change","values-change","submit"])],fe.prototype,"viewModel",void 0),e([h({type:V,nonNullable:!0})],fe.prototype,"visibleElements",void 0),e([h()],fe.prototype,"groupDisplay",void 0),e([h()],fe.prototype,"_associationsEnabled",null),e([h()],fe.prototype,"_associationsList",void 0),e([h()],fe.prototype,"_attemptFocusOnNextRender",void 0),e([h()],fe.prototype,"_formId",null),e([h()],fe.prototype,"_focusedFieldInput",void 0),e([h()],fe.prototype,"_relatedRecordsEnabled",null),e([h()],fe.prototype,"_listObserverNode",void 0),e([h()],fe.prototype,"_attachmentDialogInfo",void 0),e([h()],fe.prototype,"_attachmentListFilterText",void 0),fe=e([u("esri.widgets.BatchAttributeForm")],fe);const Ce=fe;export{Ce as default};
2
+ import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecateWidget as i}from"../core/deprecate.js";import a from"../core/Logger.js";import{getOrCreateMapValue as n}from"../core/MapUtils.js";import{destroyMaybe as s}from"../core/maybe.js";import l from"../core/ReactiveMap.js";import{watch as o,when as r,on as c,sync as d}from"../core/reactiveUtils.js";import{formatFileSize as m}from"../core/unitFormatUtils.js";import{property as h,subclass as u}from"../core/accessorSupport/decorators.js";import{formatDate as p}from"../intl/date.js";import{isIntegerField as g}from"../layers/support/fieldUtils.js";import{isString as v}from"../support/guards.js";import b from"./Widget.js";import{getAttachmentTypeCategory as f,getCalciteIconForAttachment as _}from"./Attachments/support/attachmentUtils.js";import{getAttachmentKey as C,getAttachmentFilenameParts as A,isImageAttachment as y}from"./BatchAttributeForm/attachmentUtils.js";import{getHiddenFieldsValidationErrorMessage as I,getVisibleFieldInputValidationErrorMessage as w,isElementTemplateWithInputType as F,flattenInputs as k}from"./BatchAttributeForm/batchAttributeFormUtils.js";import M from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as x}from"./BatchAttributeForm/css.js";import{makeAddAttachmentFooterButtons as D,makeDiscardAttachmentFooterButtons as E,makeResetAttachmentFooterButtons as S,makeReplaceAttachmentFooterButtons as L,makeViewingAttachmentFooterButtons as O,makeCancelFooterButton as T,makeDefaultFooterButtons as V}from"./BatchAttributeForm/interfaceUtils.js";import R from"./BatchAttributeForm/VisibleElements.js";import{isGroupInput as N,isFieldInput as U,isTextElementInput as P,isRelationshipElementInput as B,isAttachmentElementInput as $,isUtilityNetworkAssociationsElementInput as z,differentValuesString as j,getNormalizedFieldName as H,isGroupedInput as W}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{clearMultipleChoiceOtherChoiceStateForViewModel as Z,getMultipleChoiceCheckboxState as G,otherChoiceCheckedPlaceholderValue as q,getUpdatedMultipleChoiceValueForFeature as K,getMultipleChoiceSelectAllState as X,splitMultipleChoiceValue as J,canRestoreMultipleChoiceOtherChoiceDraftValue as Q}from"./BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js";import{loadRelationshipDetailsComponents as Y,RelationshipDetails as ee}from"./BatchAttributeForm/rendered-content/RelationshipDetails.js";import{downloadAttachmentInfo as te}from"./FeatureTable/support/exportUtils.js";import{loadCalciteComponents as ie}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as ae,getIntlOptionsForField as ne,prepareISOFieldValueForDateComponents as se,prepareUnixFieldValueForDateComponents as le,normalizeTimeOnlyString as oe,getISOFieldValueFromDateComponents as re,getUnixFieldValueFromDateComponents as ce}from"./support/dateUtils.js";import{globalCss as de}from"./support/globalCss.js";import{Heading as me}from"./support/Heading.js";import{calciteListFilterProps as he}from"./support/listUtils.js";import{messageBundle as ue,vmEvent as pe,tsx as ge}from"./support/widget.js";import{setFocus as ve}from"./support/widgetUtils.js";import{isEmptyValue as be}from"./support/forms/formUtils.js";const fe="data-element-id",_e="data-field-name",Ce="esri_BatchAttributeForm_select_all",Ae="esri_BatchAttributeForm_other_choice";let ye=class extends b{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.featureFormMessages=null,this.featureTableMessages=null,this.messagesUnits=null,this.viewModel=new M,this.visibleElements=new R,this.groupDisplay="all",this._associationsList=null,this._associationsWidgetsMap=new l,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._batchSwitchInputInitialValues=new Map,this._listObserverNode=null,this._listObserver=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this.viewModel.activeRelationshipInput?.incrementPage()},{root:window.document}),this._attachmentDialogInfo=null,this._attachmentListFilterText="",this._attachmentFileInputMap=new Map,this._selectedAttachmentReplaceFileInput=null,this._afterListObserverCreated=e=>{this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)},this._afterListObserverRemoved=()=>{this._listObserverNode=null},this._maximizeSelectedAttachment=()=>{this._attachmentDialogInfo=this.selectedAttachmentDetails},this._enterAttachmentReplaceView=()=>{const e=this.selectedAttachmentDetails;this._canReplaceSelectedAttachment()&&e&&(e.input.clearValidationCriteriaState(),this.viewModel.setShowingSelectedAttachmentReplacePage(!0))},this._setSelectedAttachmentReplaceFileInput=e=>{this._selectedAttachmentReplaceFileInput=e},this._openSelectedAttachmentReplaceFilePicker=()=>{this._canReplaceSelectedAttachment()&&this._selectedAttachmentReplaceFileInput?.click()},this._resetSelectedAttachmentName=()=>{const e=this.selectedAttachmentDetails,t=e?.attachment.globalId,i=e?e.input.getAttachmentEditState(e.attachment).initialName:null;e&&t&&null!=i&&this.viewModel.stageRenameAttachment(e.input.template.elementId,t,i)},this._resetSelectedAttachmentChanges=()=>{const e=this.selectedAttachmentDetails,t=e?.attachment.globalId;e&&t&&this.viewModel.resetAttachmentChanges(e.input.template.elementId,t)},this._deleteSelectedAttachment=()=>{const e=this.selectedAttachmentDetails,t=e?.attachment.globalId;e&&t&&!this._isSelectedAttachmentDeleteDisabled()&&(this.viewModel.stageDeleteAttachment(e.input.template.elementId,t),this._setSelectedAttachment(null))},this._closeAttachmentDialog=()=>{this.hideAttachmentDialog()},this._saveInput=this._saveInput.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),e?.suppressDeprecationWarning||(this.announceDeprecation=()=>{i(a.getLogger(this),"Editor","arcgis-editor",{version:"5.0"})})}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...i}=e;return i}initialize(){this.addHandles([o(()=>this.features,()=>{this._dateComponentMap.clear(),Z(this.viewModel,{includeDraftValues:!0})}),o(()=>this.viewModel.activeForm,()=>{this._batchSwitchInputInitialValues.clear(),this._resetTransientFormState(),Z(this.viewModel),this._setFocusableInput()}),o(()=>this.viewModel.selectedAttachmentAddElementId,()=>{this.hideAttachmentDialog()}),r(()=>!this.selectedAttachmentDetails,()=>this.hideAttachmentDialog()),o(()=>this.viewModel.selectedAttachmentListElementId,()=>{this._attachmentListFilterText=""}),o(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),c(()=>this.viewModel,"submit",()=>{this.valid||this.goToFirstError()}),o(()=>[this._associationsEnabled,this.viewModel.activeForm.allUtilityNetworkAssociationsElementInputs],()=>this._setUpAssociationsWidgets(),d),o(()=>this.viewModel.activeAssociationsInput,e=>this._onActiveAssociationsInputChange(e))])}loadDependencies(){return Promise.all([ie({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),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"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),"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"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),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")}),Y()])}destroy(){this._destroyAssociationsWidgets(),this._associationsList=s(this._associationsList),this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get effectiveTitle(){const{features:e,messages:t,page:i}=this;return t?"replacing-attachment"===i?t.titles.replaceAttachment:"viewing-attachment-details"===i?t.titles.editAttachment:"adding-attachments"===i?t.titles.addAttachments:"viewing-attachments"===i?t.titles.attachments:1===e.length||this.activeFeatureIndex>-1?t.titles.editFeature:e.length>1?t.titles.editFeatures:"":""}get effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get footerButtonInfos(){if(!this.features.length||!this.messages||!this.messagesCommon)return[];const{messages:e,messagesCommon:t,page:i}=this,a=this.readOnly||this.effectiveDisabled,n=this._getSelectedAttachmentEditState(),s=this.viewModel.selectedAttachmentAddElementId;return"adding-attachments"===i&&s?D({messages:e,onclick:()=>this._attachmentFileInputMap.get(s)?.click()}):n?.isReplaced&&"replacing-attachment"!==i?E({label:t.remove,onclick:this._resetSelectedAttachmentChanges}):n?.isRenamed?S({messages:e}):"replacing-attachment"===i?L({disabled:a,messages:e,onclick:this._openSelectedAttachmentReplaceFilePicker}):"viewing-attachment-details"===i?O({deleteDisabled:this._isSelectedAttachmentDeleteDisabled(),deleteOnclick:this._deleteSelectedAttachment,doneOnclick:()=>this._setSelectedAttachment(null),messages:e.footerButtons}):"viewing-associated-features"===i?T({messages:t,purpose:"cancel-viewing-associated-features",onclick:this.goBack}):"viewing-associated-layers"===i?T({messages:t,purpose:"cancel-viewing-associated-layers",onclick:this.goBack}):"viewing-attachments"===i||"viewing-related-records"===i?[]:V({disabled:a||!this.valid,formId:this._formId,messages:e,callback:this.submit})}get footerNoticeInfos(){if(!this.features.length||!this.messages)return[];const{messages:{footerNotices:e}}=this;return this._isSelectedAttachmentDeleteDisabled()?[{icon:"information",message:e.deleteDisabledMinimumAttachments}]:[]}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get maximumFeatureCount(){return this.viewModel.maximumFeatureCount}set maximumFeatureCount(e){this.viewModel.maximumFeatureCount=e}get maximumFeatureCountWithComplexForms(){return this.viewModel.maximumFeatureCountWithComplexForms}set maximumFeatureCountWithComplexForms(e){this.viewModel.maximumFeatureCountWithComplexForms=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}get page(){return this.viewModel.page}get readOnly(){return this.viewModel.readOnly}set readOnly(e){this.viewModel.readOnly=e}get selectedAttachment(){return this.viewModel.selectedAttachment}get selectedAttachmentDetails(){return this.viewModel.selectedAttachmentDetails}get valid(){return this.viewModel.valid}get _formHeaderVisible(){return!("batch"===this.viewModel.mode||!this.viewModel.activeFeature)&&!(!this.viewModel.formDescription&&!this.viewModel.formTitle)}get _associationsEnabled(){const{callbacks:e}=this;return!(!e?.addAssociation&&!e?.editAssociatedFeature)}get _formId(){return`${this.id}-form`}get _relatedRecordsEnabled(){const{callbacks:e}=this;return!(!e||!e.addRelatedRecord&&!e.editRelatedRecord)}async goBack(){return this.viewModel.goBack()}async goHome(){return this.viewModel.goHome()}goToFirstError(){const e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;const{groupInput:t}=e;t&&(t.open||(t.open=!0)),this._setFocusableInput(e.input),this.scheduleRender()}render(){return ge("div",{class:this.classes(x.base,de.widget,de.panel)},this._renderContent(),this._renderAttachmentDialog())}setActiveAssociationsInput(e){this.viewModel.setActiveAssociationsInput(e)}setActiveAssociationsLayer(e){this.viewModel.setActiveAssociationsLayer(e)}setActiveAssociationType(e){this.viewModel.setActiveAssociationType(e)}submit(){return this.viewModel.submit()}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:i}=e.dataset,a=n(this._dateComponentMap,`${i}`,()=>({}));switch(t){case"date":a.date=e;break;case"time":a.time=e;break;case"timeZone":a.timeZone=e}}_renderContent(){const{messages:e,viewModel:i}=this,{status:a}=i;return"failed"===a?i.hasTooManyComplexFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyComplexFeatures,{num:i.maximumFeatureCountWithComplexForms})):i.hasTooManyFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyFeatures,{num:i.maximumFeatureCount})):e.formFailedToLoad:i.expressionEvaluationFailed?this._renderErrorNotice(e.expressionEvaluationFailed):i.hasLayersWithContingentValues&&this.viewModel.features.length>1?this._renderErrorNotice(e.unsupportedContingentValues):"loading"===a&&this.visibleElements.loadingIndicator?ge("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):0!==this.features.length?this._renderForm():void 0}_renderErrorNotice(e,t="warning"){return ge("calcite-notice",{class:x.noticeError,icon:!0,kind:t,open:!0},ge("div",{slot:"message"},e))}_renderForm(){return ge("form",{class:x.form,id:this._formId,onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderPage())}_renderPage(){switch(this.page){case"adding-attachments":return this._renderAttachmentAddPage();case"viewing-attachment-details":case"replacing-attachment":return this._renderAttachmentDetailPage();case"viewing-attachments":return this._renderAttachmentListPage();case"viewing-associated-layers":case"viewing-associated-features":return this._renderViewingAssociationsPage();case"viewing-related-categories":case"viewing-related-records":return this._renderRelationshipListPage();default:return this._renderDefaultPage()}}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:i}=e;let a;if(!e.submitHasBeenAttempted)return null;if(i.invalidHiddenInputs.length>0)if(a=I(i,e.mode,this.messages),"batch"===this.viewModel.mode){const e=i.invalidHiddenInputs.filter(e=>"hidden:group-visibility-expression:all-features"===e.effectiveVisibilityCode||"hidden:visibility-expression:all-features"===e.visibilityCode);e.length>0?a+=` (${e.map(e=>e.label).join(", ")})`:a=null}else a+=` (${i.invalidHiddenInputs.map(e=>e.label).join(", ")})`;else if(t)return null;return a?this._renderErrorNotice(a,"danger"):null}_renderDefaultPage(){return[this._renderReadOnlyNotice(),this._renderFormHeader(),this._renderFormContent()]}_renderReadOnlyNotice(){if((this.disabled||this.readOnly)&&this.visibleElements.readOnlyNotice)return ge("calcite-notice",{class:x.disabledNotice,icon:"read-only-non-editable",kind:"brand",open:!0,scale:"s",width:"full"},ge("div",{slot:"message"},this.featureFormMessages.disabledForm))}_renderFormHeader(){const{formTitle:e,formDescription:t}=this.viewModel;if(!this._formHeaderVisible)return;const i=e?ge(me,{key:"title",level:this.headingLevel},e):void 0,a=t?ge("p",{class:x.description,key:"description"},t):void 0;return ge("div",{class:x.formHeader},i,a)}_renderFormContent(){return this.viewModel.hasVisibleInputs?this.viewModel.activeForm.inputs.filter(e=>e.visible).map(e=>this._renderInput(e)):this._renderErrorNotice(this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason])}_renderInput(e){return N(e)?this._renderGroupInput(e):U(e)?this._renderLabeledField(e):P(e)?this._renderTextComponent(e):B(e)?this._renderRelationshipElementInput(e):$(e)?this._renderAttachmentElementInput(e):z(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderGroupInput(e){const{inputs:t,template:i,open:a}=e,n=t.filter(e=>e.visible),s=i.label??"";return ge("calcite-block",{class:this.classes(x.group,"sequential"===this.groupDisplay?x.groupSequential:null,this.disabled?x.inputDisabled:null),collapsible:!0,description:i.description??void 0,disabled:this.effectiveDisabled,expanded:a,heading:s,headingLevel:this.headingLevel,key:`{${i.elementId}-key}`,label:s,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0},onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},n.map(e=>this._renderInput(e)))}_renderLabeledField(e){const{elementId:i}=e.template,{label:a,required:n,dataType:s}=e,l=n?t(this.messages.requiredFieldLabel,{name:a}):a;return ge("calcite-label",{"aria-label":l,class:x.label,key:`field--${i}`},ge("div",{class:x.labelTextContent,key:"labelTextContainer"},a,n?ge("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==s?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:i}=e;return"date"===i?this._renderDateComponents(e,t):"coded-value"===e.domain?.type?this._renderCodedInputs({input:e,props:t}):null!==e.multipleChoiceChoices?this._renderMultipleChoiceComponent({input:e,props:t}):"number"===i?this._renderNumberComponent(e,t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{description:t}=e,i=this._getErrorToDisplay(e),a=i?w(e,i,this.messages):null;return a?ge("calcite-input-message",{icon:!0,status:"invalid"},a):t?ge("calcite-input-message",{class:x.description,icon:!1,status:"idle"},t):null}_renderCodedInputs({input:e,props:t}){const i=e.input?.type??null,a=e.codedValueOptions;switch(i){case"switch":return this._renderSwitchField({input:e,props:t});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:a,props:t});default:return this._renderComboBoxComponent({options:a,props:t,input:e})}}_renderMultipleChoiceComponent({input:e,props:t}){const{messages:i}=this,{multipleChoiceChoices:a,multipleChoiceInput:n,multipleChoiceValues:s}=e;if(!n||!a||!s)return null;const l=!0===n.includeSelectAllChoices,o=new Map;let r=s.length>0,c=!1;for(const b of s){const t=G({input:e,choiceValue:b});o.set(b,t),(t.checked||t.indeterminate)&&(c=!0),t.checked||(r=!1)}const d={checked:r,indeterminate:!r&&c},m=d.checked?i.deselectAllLabel:i.selectAllLabel,h=e.getMultipleChoiceOtherChoiceRenderState(this.messages.otherOptionLabel),u=t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:!0})},p=t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t})},g=t=>{const{fieldName:i}=h;i&&this._saveOtherChoiceCheckboxValue({input:e,isChecked:t.checked,otherChoiceFieldName:i})},v=t=>{this._saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:h.fieldName})};return ge("div",{class:x.multipleChoiceInput,key:`${t.key}-multiple-choice-group`},l?this._renderMultipleChoiceSelectAllCheckbox({props:t,selectAllState:d,selectAllLabel:m,handleSelectAllCheckboxChange:u}):null,this._renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:o,handleChoiceCheckboxChange:p}),h.shouldShow?this._renderMultipleChoiceOtherChoice({props:t,includeSelectAllChoices:l,otherChoiceRenderState:h,handleOtherChoiceCheckboxChange:g,handleOtherChoiceInputChange:v,differentValuesPlaceholder:i.differentValuesPlaceholder}):null)}_renderMultipleChoiceSelectAllCheckbox({props:e,selectAllState:t,selectAllLabel:i,handleSelectAllCheckboxChange:a}){return ge("calcite-checkbox",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],checked:t.checked,class:x.multipleChoiceSelectAll,"data-element-id":e[fe],disabled:e.readOnly,indeterminate:t.indeterminate,key:`${e.key}-select-all`,label:i,labelText:i,value:Ce,onblur:e.onblur,onCalciteCheckboxChange:({currentTarget:e})=>a(e),onfocus:e.onfocus})}_renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:i,handleChoiceCheckboxChange:a}){const{multipleChoiceChoices:n}=e;return n?n.map(e=>{const n=i.get(e.value)??{checked:!1,indeterminate:!1};return ge("calcite-checkbox",{afterCreate:t.afterCreate,afterUpdate:t.afterUpdate,"aria-invalid":t["aria-invalid"],checked:n.checked,class:t.class,"data-element-id":t[fe],disabled:t.readOnly,indeterminate:n.indeterminate,key:`${t.key}-${e.value}`,label:e.label,labelText:e.label,required:t.required,value:e.value,onblur:t.onblur,onCalciteCheckboxChange:({currentTarget:e})=>a(e),onfocus:t.onfocus})}):[]}_renderMultipleChoiceOtherChoice({props:e,includeSelectAllChoices:t,otherChoiceRenderState:i,handleOtherChoiceCheckboxChange:a,handleOtherChoiceInputChange:n,differentValuesPlaceholder:s}){return ge("div",{class:this.classes(x.multipleChoiceOtherChoice,t?x.multipleChoiceOtherChoiceWithSelectAll:null),key:`${e.key}-other-choice`},ge("calcite-checkbox",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],checked:i.checkboxState.checked,class:e.class,"data-element-id":e[fe],disabled:e.readOnly,indeterminate:i.checkboxState.indeterminate,key:`${e.key}-other-choice-checkbox`,label:i.label,labelText:i.label,value:Ae,onblur:e.onblur,onCalciteCheckboxChange:({currentTarget:e})=>a(e),onfocus:e.onfocus}),i.checkboxState.checked?ge("calcite-input",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],"aria-label":i.label,class:x.textElementInput,"data-element-id":e[fe],disabled:e.readOnly,key:`${e.key}-other-choice-input`,maxLength:i.maxLength,placeholder:i.value===j?s:i.hint,required:e.required,type:"text",value:i.normalizedValue===j?"":i.normalizedValue?String(i.normalizedValue):"",onblur:e.onblur,onCalciteInputInput:({currentTarget:e})=>n(e),onfocus:e.onfocus}):null)}async _saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:i=!1}){if(this._markFieldInputTouched(e),e.multipleChoiceInput&&!i&&"batch"===this.viewModel.mode)return void await this._saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t});const a=e.value,n=this._parseValue(t,e,i);n!==a&&await this.viewModel.setValue(e.template.elementId,n)}async _saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:i}){if(!i)return;const a=t.value,n=null==a||""===a?null:a;e.initializeExplicitMultipleChoiceOtherChoiceCheckedState(),e.stashMultipleChoiceOtherChoiceDraftValueForFeatures(e.features,n);const s=H(e,i);s&&await this.viewModel.setValueForFieldName(s,n,Array.from(e.features,e=>e.source))}async _saveOtherChoiceCheckboxValue({input:e,isChecked:t,otherChoiceFieldName:i}){e.setExplicitMultipleChoiceOtherChoiceCheckedState(t),this._markFieldInputTouched(e),t||e.setMultipleChoiceOtherChoiceDraftValuesFromFeatures(e.features.toArray());const a=H(e,i);if(!a)return;const n=new Map;for(const s of e.features){const a=s.getAttribute(i);if(t){if(!be(a))continue;const t=e.getMultipleChoiceOtherChoiceDraftValue(s),i=Q(t)?t:q;n.set(s,i);continue}null!=a&&n.set(s,null)}0!==n.size&&await this.viewModel.setValuePerFeatureForFieldName(a,new Map(Array.from(n,([e,t])=>[e.source,t])))}async _saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t}){if(!e.multipleChoiceInput||!e.multipleChoiceValues)return;const i=new Map(e.features.map(i=>[i,K({input:e,choiceValue:t.value,currentValue:i.getAttribute(e.fieldName),isChecked:t.checked})]));0!==i.size&&await this.viewModel.setFieldInputValuePerFeature(e,i)}_renderSwitchField({input:e,props:t}){if((this._batchSwitchInputInitialValues.get(e)===j||e.value===j)&&"batch"===this.viewModel.mode){const i={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[fe]:t[fe]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:i,options:[{name:this.messages.differentValuesPlaceholder,value:j,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return ge("calcite-switch",{...t,checked:!!F(e.template,"switch")&&e.value===e.template.input.onValue,class:x.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInput(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:i}){const{trigger:a,dropdown:n,group:s}=i;return ge("calcite-dropdown",{...n,topLayerDisabled:this.topLayerDisabled,onblur:()=>{this._focusedFieldInput=null},onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e),onfocus:this._onComponentFocus},ge("calcite-button",{...a},e===j?this.messages.differentValuesPlaceholder:e),ge("calcite-dropdown-group",{selectionMode:s.mode},t.map(t=>ge("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name))))}_renderComboBoxComponent({input:e,options:t,props:i}){const a="INSERT"===this.viewModel.editType,n=this._touchedInputs.has(e?.template?.elementId),s=a&&e.showNoValueOptionEnabled&&!n?()=>{}:i.onblur,l={...i,onblur:s};return ge("calcite-combobox",{...l,selectionMode:"single",topLayerDisabled:this.topLayerDisabled,value:i.placeholder===this.messages.differentValuesPlaceholder?j:String(i.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==j&&this._saveInput(e)}},this.renderComboboxOptionsList({input:e,options:t,props:i}))}renderComboboxOptionsList({input:e,options:t,props:i}){const a=e=>e.map(e=>{const{value:t}=e,a=be(e.value)?this.messages.empty:e.name;return ge("calcite-combobox-item",{heading:a,key:`#${t}`,selected:i.value===t,value:`${t}`})});let n=[];const{messages:s}=this;t.other.length>0&&n.push(ge("calcite-combobox-item-group",{key:"other",label:s.other},a(t.other))),t.unsupported.length>0&&n.push(ge("calcite-combobox-item-group",{key:"unsupported",label:s.unsupported},a(t.unsupported)));const l=a(t.recommended);n.length>0?n.unshift(ge("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):n=l;const o=i.placeholder===this.messages.differentValuesPlaceholder,r=!o&&be(i.value);return e.showNoValueOptionEnabled&&!t.containsEmptyOption&&n.unshift(ge("calcite-combobox-item",{heading:e.showNoValueLabel||this.messages.empty,key:"empty-option",selected:r,value:""})),o&&n.unshift(ge("calcite-combobox-item",{heading:this.messages.differentValuesPlaceholder,key:j,selected:!0,value:j})),n}_renderRadioButtonGroupComponent({input:e,options:t,props:i}){const a=[...t.recommended,...t.other,...t.unsupported].map(({name:t,value:a})=>this._renderRadioButtons({label:t,value:a,selected:a===e.value,props:i}));if(e.showNoValueOptionEnabled&&!t.containsEmptyOption){const t="",n=e.showNoValueLabel||this.messages.empty,s=be(e.value);a.unshift(this._renderRadioButtons({label:n,value:t,selected:s,props:i}))}return ge("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:x.inputRadioGroup,"data-field-name":i[_e],disabled:i.readOnly||i.disabled,key:`${i.key}-radio-group`,layout:"vertical",name:i.name,required:i.required},a,i.placeholder===this.messages.differentValuesPlaceholder?ge("calcite-label",{class:x.placeholderRadio,key:i.label,layout:"inline"},ge("calcite-radio-button",{checked:!0,class:x.inputRadio,disabled:!0,name:i.placeholder,value:i.placeholder}),i.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:i,props:a}){return ge("calcite-label",{class:x.inputRadioLabel,key:a.label,layout:"inline"},ge("calcite-radio-button",{...a,afterCreate:void 0,afterUpdate:void 0,checked:t,class:x.inputRadio,disabled:a.readOnly||a.disabled,name:a.label,value:e,onblur:()=>{this._focusedFieldInput=null},onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),i)}_renderStringComponent(e,t){const{template:i}=e;return!i.field.editable||this.readOnly?this._renderReadOnlyComponent(e):"text-area"===i.input?.type?ge("calcite-text-area",{...t,class:this.classes(x.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):ge("calcite-input",{...t,class:this.classes(x.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)})}_renderNumberComponent(e,t){const i=g(e.field);return ge("calcite-input-number",{...t,integer:i,type:"number",value:i&&""!==t.value?Math.round(parseFloat(String(t.value))).toString():String(t.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return ge("calcite-input",{...i,class:this.classes(x.fieldInput,x.inputDisabled,x.individualElement),readOnly:!0,type:"text",value:String(t??i.value??"")})}_renderDateComponents(e,t){const{field:i}=e;let a;switch(i.type){case"date":a=this._renderDateFieldComponents(e,t);break;case"date-only":a=this._renderDateOnlyFieldComponent(e,t);break;case"time-only":a=this._renderTimeOnlyFieldComponent(e,t);break;case"timestamp-offset":a=this._renderTimestampOffsetFieldComponents(e,t);break;default:a=this._renderReadOnlyComponent(e,ae(i,t.value,{timeZone:e.effectiveTimeZone,...ne(e.template.field)}))}return e.value===j?[a,ge("calcite-input-message",{icon:"information",key:"diff-values-message",status:"idle"},this.messages.differentValues)]:a}_renderDateOnlyFieldComponent(e,t){const{class:i,disabled:a,key:n,readOnly:s}=t,{rawMax:l,rawMin:o}=e.range;return ge("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:i,"data-date-part":"date","data-element-id":t[fe],"data-field-name":t[_e],key:`${n}-date-input`,max:v(l)?l:void 0,min:v(o)?o:void 0,overlayPositioning:"fixed",readOnly:s||a,topLayerDisabled:this.topLayerDisabled,value:e.value===j?"":e.value?String(e.value):"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget),onfocus:this._onComponentFocus})}_renderTimeOnlyFieldComponent(e,t){const{class:i,disabled:a,key:n,readOnly:s}=t;return ge("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:i,"data-date-part":"time","data-element-id":t[fe],"data-field-name":t[_e],key:`${n}-time-input`,overlayPositioning:"fixed",readOnly:s||a,value:e.value===j?"":e.value?String(e.value):"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget),onfocus:this._onComponentFocus})}_renderTimestampOffsetFieldComponents(e,t){const{class:i,disabled:a,key:n,readOnly:s}=t,{rawMax:l,rawMin:o}=e.range,r=se(l),c=se(o),d=se(e.value===j?"":e.value),m=e.includeTimeOffset,h={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:s||a,[fe]:t[fe],[_e]:t[_e],onfocus:this._onComponentFocus};return ge("div",{class:x.dateInputContainer,key:`${n}-date-time-container`},ge("calcite-input-date-picker",{...h,class:i,"data-date-part":"date",key:`${n}-date-input`,max:r?.date??void 0,min:c?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:d.date??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),ge("calcite-input-time-picker",{...h,class:i,"data-date-part":"time",key:`${n}-time-input`,value:d.time??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),m?ge("calcite-input-time-zone",{...h,class:i,clearable:e.value===j||null==e.value,"data-date-part":"timeZone",key:`${n}-timezone-input`,value:d.timeZoneOffset||"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:i,disabled:a,key:n,readOnly:s,min:l,max:o}=t,r=e.effectiveTimeZone,c=le(e.value===j?"":e.value,r),d=le(o,r),m=le(l,r),h=e.includeTime,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:s||a,[fe]:t[fe],[_e]:t[_e],onfocus:this._onComponentFocus};return ge("div",{class:x.dateInputContainer,key:`${n}-date-time-container`},ge("calcite-input-date-picker",{...u,class:i,"data-date-part":"date",key:`${n}-date-input`,max:d?.date??void 0,min:m?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:c.date??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),h?ge("calcite-input-time-picker",{...u,"data-date-part":"time",key:`${n}-time-input`,step:1,value:c.time??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}_renderRelationshipElementInput(e){return this._relatedRecordsEnabled?ge(ee,{afterObserverCreated:this._afterListObserverCreated,afterObserverRemoved:this._afterListObserverRemoved,input:e,messages:this.messages,messagesCommon:this.messagesCommon,viewModel:this.viewModel}):null}_renderRelationshipListPage(){const{activeRelationshipInput:e}=this.viewModel;if(e)return this._renderRelationshipElementInput(e)}_renderAttachmentElementInput(e){if(!this.attachmentsEnabled)return;const{allAttachmentsVisibleOnDefaultPage:t,attachments:i,defaultPageAttachments:a,template:{description:n,elementId:s,label:l}}=e,o=t?i:a;return ge("div",{class:x.attachmentElementInput,"data-testid":`attachment-element-${s}`,key:`attachment-element-${s}`},l?ge("div",{class:x.attachmentElementLabel,key:`attachment-element-label-${s}`},l):null,n?ge("div",{class:x.description,key:`attachment-element-description-${s}`},n):null,i.length?this._renderAttachmentList(e,o,{label:l||this.messagesCommon.details,viewAllCount:t?null:i.length}):ge("div",{class:x.attachmentElementEmptyState,key:`attachment-element-empty-state-${s}`},this.messages.attachments.noAttachments),this._renderAttachmentAddAction(e))}_renderAttachmentListPage(){const e=this.viewModel.selectedAttachmentListInput;if(e)return ge("div",{class:x.attachmentElementAllPanel,key:`attachment-element-all-panel-${e.template.elementId}`},this._renderAttachmentList(e,e.attachments,{filterEnabled:!0,label:this.messages.titles.attachments}))}_renderAttachmentList(e,t,i){const{filterEnabled:a,label:n,viewAllCount:s}=i;return ge("calcite-list",{class:x.attachmentElementList,filterEnabled:a,filterPlaceholder:a?this.messages.attachments.searchAttachments:void 0,filterProps:a?he:void 0,filterText:a?this._attachmentListFilterText:void 0,label:n,selectionAppearance:"border",selectionMode:"none",onCalciteListFilter:a?e=>{this._attachmentListFilterText=e.currentTarget.filterText??""}:void 0},this._renderAttachmentListItems(e,t),null!=s?this._renderViewAllAttachmentsItem(e,s):null)}_renderAttachmentListItems(e,t){const{elementId:i}=e.template;return t.map((t,a)=>{const n=this._formatAttachmentSize(t.size),s=this._getAttachmentLabel(t,a,n,e.displayFilename),l=s===n?void 0:n,o=C(t),r=e.isStagedAttachmentAddition(t),c=e.getAttachmentEditState(t),d=c.isDeleted,m=!d&&(r||c.isRenamed||c.isReplaced);return ge("calcite-list-item",{class:x.attachmentElementListItem,description:l,key:`attachment-item-${o}`,label:s,onCalciteListItemSelect:r||d?void 0:()=>this._setSelectedAttachment({attachmentKey:o,elementId:i})},ge("div",{class:x.attachmentElementListItemStart,slot:"content-start"},this._renderAttachmentPreviewThumbnail(t,s,e)),m?ge("span",{class:x.attachmentElementListItemStagedIndicator,slot:"content-end"}):null,r?[ge("calcite-action",{disabled:this.effectiveDisabled,icon:"x",scale:"s",slot:"actions-end",text:this.messagesCommon.delete,title:this.messagesCommon.delete,onclick:()=>this.viewModel.stageDeleteAttachment(i,t.globalId)})]:d?ge("calcite-chip",{label:this.messages.attachments.deleted,scale:"s",slot:"content-end"},this.messages.attachments.deleted):ge("calcite-action",{icon:"chevron-right",scale:"s",slot:"actions-end",text:s,title:s}))})}_renderViewAllAttachmentsItem(e,i){const{elementId:a}=e.template,{viewAll:n}=this.messages.attachments;return ge("calcite-list-item",{class:x.attachmentElementListItem,description:t(this.messages.attachments.count,{count:i}),key:`attachment-item-view-all-${a}`,label:n,onCalciteListItemSelect:()=>this._setAttachmentListElementId(a)},ge("calcite-action",{icon:"chevron-right",scale:"s",slot:"actions-end",text:n,title:n}))}_renderAttachmentAddAction(e){const{elementId:t}=e.template,i=this.effectiveDisabled||e.addDisabled,a=this._renderAttachmentCountLimitsLabel(e),n=this._getAttachmentNoticeMessage(e),s=e.hasMinimumAttachmentCountNotMet||e.hasExceededAttachmentLimit?"danger":"info",l=e.canUploadFiles,o=e.isCaptureOnly&&!this.effectiveDisabled&&!n;return ge("div",{class:x.attachmentElementAddActions,key:`attachment-element-add-actions-${t}`},l?ge("calcite-button",{appearance:"outline",disabled:i,iconStart:"attachment",kind:"neutral",round:!0,scale:"s",onclick:()=>this._setAttachmentAddElementId(t)},this.messages.attachments.attach):null,this._renderAttachmentCaptureButton(e),o?this._renderAttachmentCaptureDisabledNotice(t):null,a?ge("div",{class:x.attachmentElementEmptyActionHint},a):null,!this.effectiveDisabled&&n?ge("calcite-notice",{closable:!1,icon:"danger"===s?"exclamation-mark-circle":"lightbulb",kind:s,open:!0,scale:"s",width:"full"},ge("div",{slot:"message"},n)):null)}_renderAttachmentCaptureButton(e){if(!e.hasCaptureInputs)return null;const t=e.captureMediaType;return ge("calcite-button",{appearance:"outline",disabled:!0,iconStart:Ie(t),kind:"neutral",round:!0,scale:"s"},this._getCaptureButtonLabel(t))}_getAttachmentNoticeMessage(e){const t=this.messages.attachments;return e.hasUnsupportedFileTypeValidationError?this._getUnsupportedFileTypeMessage():e.hasMinimumAttachmentCountNotMet&&this._shouldShowMinimumAttachmentNotice(e)?t.minimumNotMet:e.hasExceededAttachmentLimit?t.attachmentLimitExceeded:e.hasReachedAttachmentLimit?t.attachmentLimitReached:null}_shouldShowMinimumAttachmentNotice(e){return e.hasAttachmentChanges||this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId)}_getCaptureButtonLabel(e){const{capture:t,recordAudio:i,takePhoto:a,takeVideo:n}=this.messages.attachments;switch(e){case"image":return a||t;case"video":return n||t;case"audio":return i||t;default:return t}}_renderAttachmentAddPage(){const e=this.viewModel.selectedAttachmentAddInput;return e?this._renderAttachmentAddPanel(e):null}_renderAttachmentAddPanel(e){const{maxAttachmentCount:t}=e,{elementId:i}=e.template;if(e.isCaptureOnly)return this._renderAttachmentCaptureDisabledNotice(i);const a=null==t||t-e.attachments.length>1,n=this.effectiveDisabled||e.addDisabled,s=this.messages.attachments,l=s.dragAndDropFile,o="upload",r=e=>{this._attachmentFileInputMap.set(i,e)};return ge("div",{class:x.attachmentElementAddPanel,key:`attachment-element-add-panel-${i}`},ge("input",{accept:e.accept,afterCreate:r,afterRemoved:()=>{this._attachmentFileInputMap.delete(i)},afterUpdate:r,class:x.attachmentElementFileInput,"data-element-id":i,disabled:n,multiple:a,type:"file",onchange:e=>{const t=e.currentTarget,a=t.files?Array.from(t.files):[];this._stageAttachmentFiles(i,a),t.value=""}}),ge("div",{class:x.attachmentElementAddDropzone,"data-disabled":n?"true":"false",ondragover:e=>{e.preventDefault()},ondrop:e=>{if(e.preventDefault(),n)return;const t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[];this._stageAttachmentFiles(i,t)}},ge("calcite-icon",{class:x.attachmentElementAddDropzoneIcon,icon:o,scale:"l"}),ge("div",{class:x.attachmentElementAddDropzoneHeading},s.addFile),ge("div",{class:x.attachmentElementAddDropzoneDetail,title:l},l),ge("calcite-button",{appearance:"transparent",disabled:n,iconStart:"folder-open",kind:"brand",scale:"s",type:"button",onclick:e=>{e.stopPropagation(),this._openAttachmentFilePicker(i,n)}},s.selectFile)),this._renderAttachmentValidationCriteria(e,{includeCountCriteria:!0}))}_renderAttachmentCaptureDisabledNotice(e){return ge("calcite-notice",{class:x.attachmentElementCaptureNotice,icon:!0,key:`attachment-element-capture-disabled-notice-${e}`,kind:"warning",open:!0,scale:"s"},ge("div",{slot:"message"},this.messages.attachments.captureMethodNotSupported))}async _stageAttachmentFiles(e,t){if(0===t.length)return;const i=this.viewModel.selectedAttachmentAddInput;let a=!0;try{a=(await this.viewModel.stageAddAttachments(e,t)).length>0&&!i?.hasInvalidValidationCriteria&&!i?.hasUnsupportedFileTypeValidationError}finally{a&&this.viewModel.setSelectedAttachmentAddElementId(null)}}_openAttachmentFilePicker(e,t){t||this._attachmentFileInputMap.get(e)?.click()}_renderAttachmentDetailPage(){const e=this.selectedAttachmentDetails;if(!e)return;if("replacing-attachment"===this.page)return this._renderAttachmentReplacePanel(e);const{attachment:t,input:i}=e,a=C(t),n=!!i.getAttachmentPreviewUrl(t),s=i.getAttachmentEditState(t),{baseName:l,extension:o}=A(t.name),r=!this.readOnly&&!this.effectiveDisabled,c=r&&i.canUploadFiles;return ge("div",{class:x.attachmentElementDetail,key:`attachment-detail-panel-${i.template.elementId}-${a}`},ge("div",{class:x.attachmentElementDetailPreview},this._renderAttachmentPreviewImageForInput(t,i)),ge("div",{class:x.attachmentElementDetailActions},y(t)?ge("calcite-button",{appearance:"outline",disabled:!n,iconStart:"expand",kind:"neutral",label:this.messages.attachments.maximize,scale:"m",title:this.messages.attachments.maximize,onclick:this._maximizeSelectedAttachment}):null,ge("calcite-button",{appearance:"outline",disabled:!n,iconStart:"download",kind:"neutral",label:this.messages.attachments.download,scale:"m",title:this.messages.attachments.download,onclick:()=>{this._downloadAttachment(t)}}),ge("calcite-button",{appearance:"outline",disabled:!c,iconStart:"upload-to",kind:"neutral",label:this.messages.attachments.replace,scale:"m",title:this.messages.attachments.replace,onclick:this._enterAttachmentReplaceView})),ge("div",{class:x.attachmentElementDetailMetadata},ge("div",{class:x.attachmentElementDetailMetadataGroup},ge("span",{class:x.attachmentElementDetailMetadataLabel},this.messages.attachments.fileName),i.allowUserRename?ge("div",{class:x.attachmentElementDetailFileNameRow},ge("calcite-input",{class:x.attachmentElementDetailFileNameInput,disabled:!r,scale:"m",suffixText:o,value:l,onCalciteInputInput:({currentTarget:e})=>this._renameSelectedAttachment(e.value)}),ge("calcite-button",{appearance:"transparent",disabled:!r||null==s.initialName||!s.isRenamed,iconStart:"reset",kind:"neutral",scale:"m",title:this.messages.footerButtons.reset,onclick:this._resetSelectedAttachmentName})):ge("span",{class:x.attachmentElementDetailMetadataValue},t.name)),ge("div",{class:x.attachmentElementDetailMetadataGroup},ge("span",{class:x.attachmentElementDetailMetadataLabel},this.messages.attachments.size),ge("span",{class:x.attachmentElementDetailMetadataValue},this._formatAttachmentSize(t.size))),ge("div",{class:x.attachmentElementDetailMetadataGroup},ge("span",{class:x.attachmentElementDetailMetadataLabel},this.messages.attachments.type),ge("span",{class:x.attachmentElementDetailMetadataValue},this._getLabelForAttachmentType(t)))))}_renderAttachmentReplacePanel(e){const{attachment:t,input:i}=e,a=this.readOnly||this.effectiveDisabled||!i.canUploadFiles,n=i.template.elementId;return ge("div",{class:x.attachmentElementAddPanel,key:`attachment-replace-panel-${n}-${C(t)}`},ge("input",{accept:i.accept,afterCreate:this._setSelectedAttachmentReplaceFileInput,afterRemoved:()=>{this._selectedAttachmentReplaceFileInput=null},afterUpdate:this._setSelectedAttachmentReplaceFileInput,class:x.attachmentElementFileInput,disabled:a,type:"file",onchange:e=>{const t=e.currentTarget,i=t.files?.[0];i&&this._stageSelectedAttachmentReplacement(i),t.value=""}}),ge("div",{class:x.attachmentElementAddDropzone,"data-disabled":a?"true":"false",ondragover:e=>{e.preventDefault()},ondrop:e=>{if(e.preventDefault(),a)return;const t=e.dataTransfer?.files?.[0];t&&this._stageSelectedAttachmentReplacement(t)}},ge("calcite-icon",{class:x.attachmentElementAddDropzoneIcon,icon:"refresh",scale:"l"}),ge("div",{class:x.attachmentElementAddDropzoneHeading},this.messages.attachments.replace),ge("div",{class:x.attachmentElementAddDropzoneDetail,title:this.messages.attachments.dragAndDropFile},this.messages.attachments.dragAndDropFile),ge("calcite-button",{appearance:"transparent",disabled:a,iconStart:"folder-open",kind:"brand",scale:"s",onclick:e=>{e.stopPropagation(),this._openSelectedAttachmentReplaceFilePicker()}},this.messages.attachments.selectFile)),this._renderAttachmentValidationCriteria(i,{includeCountCriteria:!1}),ge("div",{class:x.attachmentElementDetailMetadata},ge("div",{class:x.attachmentElementDetailMetadataGroup},ge("span",{class:x.attachmentElementDetailMetadataLabel},this.messages.attachments.fileToBeReplaced),ge("span",{class:x.attachmentElementDetailMetadataValue},t.name))))}_renderAttachmentDialog(){const e=this._attachmentDialogInfo;if(!e)return null;const{attachment:t,input:i}=e;return ge("calcite-dialog",{heading:t.name||this.messagesCommon.details,key:"attachment-preview-dialog",modal:!0,open:!0,placement:"cover",width:"l",onCalciteDialogClose:this._closeAttachmentDialog},ge("div",{class:x.attachmentElementDetailPreview},this._renderAttachmentPreviewImageForInput(t,i)))}_setSelectedAttachment(e){e?.elementId&&this._touchedInputs.add(e.elementId),this.viewModel.setSelectedAttachment(e),e||this.hideAttachmentDialog()}_setAttachmentAddElementId(e){e&&this._touchedInputs.add(e),this.viewModel.setSelectedAttachmentAddElementId(e),this.viewModel.selectedAttachmentAddInput?.clearValidationCriteriaState(),this.hideAttachmentDialog()}_setAttachmentListElementId(e){e&&this._touchedInputs.add(e),this.viewModel.setSelectedAttachmentListElementId(e),this.hideAttachmentDialog()}_getAttachmentLabel(e,i,a,n){return!1!==n&&v(e.name)&&e.name.length>0?e.name:a!==this.messagesCommon.notApplicable?a:t(this.messages.attachments.attachmentNumberedLabel,{index:i+1})}_renderAttachmentCountLimitsLabel(e){const t=this.messages.attachments,i=null!=e.minAttachmentCount&&e.minAttachmentCount>0?this._renderAttachmentCountLimitLabel(t.minAttachmentsShort,e.minAttachmentCount,"min"):null,a=null!=e.maxAttachmentCount?this._renderAttachmentCountLimitLabel(t.maxAttachmentsShort,e.maxAttachmentCount,"max"):null;return i||a?[i,i&&a?ge("span",{key:"attachment-count-limits-separator"},", "):null,a]:null}_renderAttachmentCountLimitLabel(e,i,a){const n="__count__",[s,l]=t(e,{count:n}).split(n);return ge("span",{key:a},s,ge("span",{class:x.attachmentElementEmptyActionHintValue},i),l)}_renderAttachmentValidationCriteria(e,{includeCountCriteria:t}){const i=this._getAttachmentValidationCriteria(e,{includeCountCriteria:t}),a=`attachment-validation-criteria-${e.template.elementId}`;return 0===i.length?null:ge("div",{class:x.attachmentElementValidationCriteria,key:a},i.map(({key:e,message:t,state:i})=>ge("calcite-notice",{appearance:"danger"===i?"outline-fill":"transparent",closable:!1,icon:!0,key:e,kind:i,open:!0,scale:"s",width:"full"},ge("div",{slot:"message"},t))))}_getAttachmentValidationCriteria(e,{includeCountCriteria:i}){const a=[],n=e.validationCriterionStates,s=this.messages.attachments,l=this._getNestableAttachmentInputs(e.input);e.hasUnsupportedFileTypeValidationError&&a.push({key:"unsupported-file-type",message:this._getUnsupportedFileTypeMessage(),state:"danger"});for(const o of l)"document"===o.type&&null!=o.maxFileSize&&a.push({key:"maximum-file-size",message:t(s.maximumFileSize,{maxSize:this._formatAttachmentSizeLimitInMegabytes(o.maxFileSize)}),state:n.get("maximum-file-size")??"info"}),"audio"===o.type&&null!=o.maxDuration&&a.push({key:"maximum-audio-length",message:t(s.maximumAudioLength,{maxDuration:this._formatAttachmentDurationLimit(o.maxDuration)}),state:n.get("maximum-audio-length")??"info"}),"video"===o.type&&null!=o.maxDuration&&a.push({key:"maximum-video-length",message:t(s.maximumVideoLength,{maxDuration:this._formatAttachmentDurationLimit(o.maxDuration)}),state:n.get("maximum-video-length")??"info"});return i&&null!=e.minAttachmentCount&&e.minAttachmentCount>0&&a.push({key:"minimum-number-of-files",message:t(s.minimumNumberOfFiles,{count:e.minAttachmentCount}),state:n.get("minimum-number-of-files")??"info"}),i&&null!=e.maxAttachmentCount&&a.push({key:"maximum-number-of-files",message:t(s.maximumNumberOfFiles,{count:e.maxAttachmentCount}),state:n.get("maximum-number-of-files")??"info"}),a}_getNestableAttachmentInputs(e){return null==e?[]:"attachment"===e.type?e.inputTypes?.slice()??[]:[e]}_getUnsupportedFileTypeMessage(){return this.featureTableMessages.errorFileUnsupported}_formatAttachmentSize(e){return null==e||Number.isNaN(e)?this.messagesCommon.notApplicable:m(this.messagesUnits,e)}_formatAttachmentSizeLimitInMegabytes(e){return m(this.messagesUnits,1048576*e)}_formatAttachmentDurationLimit(e){return p(1e3*Math.round(e),{...e>=3600?{hour:"2-digit",hourCycle:"h23"}:{},minute:"2-digit",second:"2-digit",timeZone:"UTC"})}_getLabelForAttachmentType({contentType:e}){if(!e)return this.messagesCommon.notApplicable;const t=this.messages.attachments.attachmentTypes,i=f(e);return t?.[i]||e}_renderAttachmentPreviewThumbnail(e,t,i){const a=i.getAttachmentPreviewUrl(e,64);return a&&y(e)?ge("img",{alt:t,class:x.attachmentElementListItemThumb,src:a}):ge("calcite-icon",{class:x.attachmentElementListItemIcon,icon:_(e.contentType),scale:"s"})}_renderAttachmentPreviewImageForInput(e,t){const i=t.getAttachmentPreviewUrl(e),a=e.name||this.messagesCommon.details;return i&&y(e)?ge("img",{alt:a,class:x.attachmentElementDetailPreviewImage,src:i,title:a}):[ge("calcite-icon",{class:x.attachmentElementDetailPreviewIcon,icon:_(e.contentType),scale:"l",textLabel:a,title:a}),this.messages.attachments.noPreviewAvailable]}async _downloadAttachment(e){await te(e)}_canReplaceSelectedAttachment(){return!this.readOnly&&!this.effectiveDisabled&&!!this.selectedAttachmentDetails?.input.canUploadFiles}_exitAttachmentReplaceView(){this.viewModel.setShowingSelectedAttachmentReplacePage(!1),this._selectedAttachmentReplaceFileInput=null}async _stageSelectedAttachmentReplacement(e){const t=this.selectedAttachmentDetails,i=t?.attachment.globalId;if(!t||!i)return;let a=!1;try{a=await this.viewModel.stageReplaceAttachment(t.input.template.elementId,i,e)}finally{a&&this._exitAttachmentReplaceView()}}_renameSelectedAttachment(e){const t=this.selectedAttachmentDetails,i=t?.attachment.globalId;t&&i&&this.viewModel.stageRenameAttachment(t.input.template.elementId,i,e)}_isSelectedAttachmentDeleteDisabled(){const e=this.selectedAttachmentDetails;if(!e)return!1;if(this.readOnly||this.effectiveDisabled)return!0;const t=e.input.minAttachmentCount;return null!=t&&e.input.attachments.length<=t}hideAttachmentDialog(){this._attachmentDialogInfo=null}_renderTextComponent(e){const{elementId:t}=e.template;return ge("div",{class:x.textElementInput,"data-testid":`text-element-${t}`,innerHTML:e.text,key:`text-element-${t}`})}_renderUtilityNetworkAssociationsElementInput(e){if(!this._associationsEnabled)return;const{elementId:t}=e.template;return ge("div",{class:x.utilityNetworkAssociationsElementInput,"data-testid":t,key:t},this._associationsWidgetsMap.get(e)?.render())}getCommonInputProps(e){const{template:t,valid:i,value:a,minLength:n,maxLength:s,required:l,fieldName:o,editable:r,userHasChangedValue:c,range:{max:d,min:m}}=e,h=!r||this.readOnly,u=!h&&this.effectiveDisabled;let p=t.hint??void 0,g=!1;return a===j&&(p=this.messages.differentValuesPlaceholder,g=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":i?"false":"true",class:this.classes(x.fieldInput,h?x.inputDisabled:null),status:!c&&!this.viewModel.submitHasBeenAttempted||i?"idle":"invalid",maxLength:s&&s>-1?s:void 0,minLength:n&&n>-1?n:void 0,key:t.elementId,label:o,name:o,max:null!=d?d:void 0,min:null!=m?m:void 0,disabled:u,readOnly:h,onblur:this._onComponentBlur,required:l,placeholder:p,value:g?"":a??"",[fe]:t.elementId,[_e]:o,onfocus:this._onComponentFocus}}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(fe))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),a=t||i;a&&this._afterComponentCreateOrUpdate(a)}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._isMultipleChoiceCheckbox(t,i)||this._markFieldInputTouched(i),this._focusedFieldInput=i}_markFieldInputTouched(e){this._touchedInputs.add(e.template.elementId)}_isMultipleChoiceCheckbox(e,t){return"CALCITE-CHECKBOX"===e.tagName&&null!=t.multipleChoiceInput}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),i=this._focusedFieldInput;this._attemptFocusOnNextRender&&i===t&&(this._attemptFocusOnNextRender=!1,ve(e))}_onComponentBlur(){this._focusedFieldInput=null}_resetTransientFormState(){this._attemptFocusOnNextRender=!1,this._focusedFieldInput=null,this._attachmentDialogInfo=null,this._selectedAttachmentReplaceFileInput=null,this._attachmentListFilterText="",this._attachmentFileInputMap.clear()}_parseValue(e,t,i=!1){const a=t.multipleChoiceInput,n=t.multipleChoiceValues;if(a&&n){const s=a.choiceDelimiter,l=e;if(i){return X({input:t}).checked?null:n.length>0?n.join(s):null}const o=J(t.value,s).filter(e=>e!==j),r=new Set(o);l.checked?r.add(l.value):r.delete(l.value);const c=n.filter(e=>r.has(e));return c.length?c.join(s):null}if(F(t.template,"switch")){if("calcite-dropdown"===e.localName&&t.domain)for(const i of t.domain.codedValues)if(i.name===e.selectedItems[0].textContent)return i.code;return e.checked?t.template.input.onValue:t.template.input.offValue}const s=e.value;return null==s||""===s?null:"number"===t.dataType?"-0"===s||"-0."===s||"-0,"===s?s:parseFloat(s):"date"===t.field.type?parseFloat(s):s}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:i}=t.template;if(!t)return;const a=t?.value;if(F(t.template,"switch")&&"single"!==this.viewModel.mode){const e=n(this._batchSwitchInputInitialValues,t,()=>t.value);this._batchSwitchInputInitialValues.set(t,null===e?a:e)}const s=this._parseValue(e,t);s!==a&&this.viewModel.setValue(i,s)}_afterDateComponentCreate(e){this._setDateTimeTimeZoneMap(e),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:i}=e.template,a=e.field.type,n=this._dateComponentMap.get(`${i}`);if(!n)return;const s=e.effectiveTimeZone;let l=e.value===j?void 0:e.value,o=null;"date-only"===a?o=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===a?(l=oe(l),o=oe(t.value)):o="timestamp-offset"===a?null!=t.value?re({dateComponent:n.date,timeComponent:n.time,oldValue:l,timeZoneComponent:n.timeZone,defaultTimeZone:s}):null:null!=t.value?ce({oldValue:l,dateComponent:n.date,timeZone:s,timeComponent:n.time?.value===j?void 0:n.time}):null,l!==o&&(null!==o&&t.value?this.viewModel.setValue(`${i}`,o):this.viewModel.setValue(`${i}`,null))}_getErrorToDisplay(e){const t=e.compositeError;return e.valid||!t?null:"contingent-values-validation-error::contingency-violation-error"===t||"contingent-values-validation-error::contingency-violation-warning"===t||this._touchedInputs.has(e.template.elementId)||this.viewModel.submitHasBeenAttempted?t:null}_renderViewingAssociationsPage(){return this._associationsList?.render()}_onActiveAssociationsInputChange(e){const t=this._associationsList;t&&(e?(t.associationInput=e,t.viewModel=e.viewModel):t.associationInput=null)}async _setUpAssociationsWidgets(){const e=this.viewModel.activeForm.allUtilityNetworkAssociationsElementInputs;if(this._associationsEnabled&&0!==e.length){await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.set(t,await this._createAssociationsWidget(t))}}async _setUpUtilityNetworkAssociationList(){if(this._associationsList)return;const e=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js")).default;this._associationsList=new e({onSelectLayer:this._onSelectAssociatedLayer.bind(this),onSelectFeature:this._onEditAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)});const t=this.viewModel.activeAssociationsInput;t&&(this._associationsList.associationInput=t,this._associationsList.viewModel=t.viewModel)}async _createAssociationsWidget(e){return new(0,(await import("./Feature/FeatureUtilityNetworkAssociations.js")).default)({viewModel:e.viewModel,onSelectAssociationType:t=>this._onSelectAssociationType(e,t)})}_destroyAssociationsWidgets(){this._associationsWidgetsMap.forEach(e=>s(e)),this._associationsWidgetsMap.clear()}_onSelectAssociationType(e,{listType:t}){this.setActiveAssociationsInput(e),this.setActiveAssociationType(t)}_onSelectAssociatedLayer({layer:e}){this.setActiveAssociationsLayer(e)}async _onEditAssociatedFeature(e){const t=this.callbacks?.editAssociatedFeature,i=this.viewModel.activeAssociationsInput;if(!t||!i?.feature)return;const{association:a,feature:n}=e;await t({parentFeature:i.feature.plainGraphic,association:a,feature:n})}_onAddAssociation(e){const t=this.callbacks?.addAssociation,i=this.viewModel.activeAssociationsInput;if(!t||!i?.feature)return;const{associationType:a,utilityNetwork:n}=e;t({feature:i.feature.plainGraphic,associationType:a,utilityNetwork:n})}_getSelectedAttachmentEditState(){const e=this.selectedAttachmentDetails;if(e)return e.input.getAttachmentEditState(e.attachment)}_setFocusableInput(e){const t=e&&U(e)?e:this._findFocusableInput(e);this._focusedFieldInput=t,this._attemptFocusOnNextRender=!0}_findFocusableInput(e){const t=this.viewModel.activeForm.inputs;if(!t.length)return;const i=k(t);let a;if(e)if(N(e)){const t=e.inputs.find(e=>e.visible);a=t?i.indexOf(t):0}else{let n;if(W(e)&&!e.group.open){n=e.group.inputs.filter(U)[t.length-1]}else n=e;a=i.indexOf(n)+1}else a=0;for(let n=a;n<i.length;n++){const e=i[n];if(e.visible&&U(e))return this.disabled||this.readOnly,e}return null}_onGroupToggle(e,t){e.expanded?(t.open=!0,this._setFocusableInput(t)):t.open=!1,this.scheduleRender()}};function Ie(e){switch(e){case"audio":return _("audio/mpeg");case"video":return _("video/mp4");case"image":return _("image/png");default:return"camera"}}e([h()],ye.prototype,"activeFeatureIndex",null),e([h()],ye.prototype,"attachmentsEnabled",null),e([h()],ye.prototype,"callbacks",null),e([h()],ye.prototype,"disabled",null),e([h()],ye.prototype,"effectiveTitle",null),e([h()],ye.prototype,"effectiveDisabled",null),e([h()],ye.prototype,"features",null),e([h()],ye.prototype,"footerButtonInfos",null),e([h()],ye.prototype,"footerNoticeInfos",null),e([h()],ye.prototype,"map",null),e([h()],ye.prototype,"maximumFeatureCount",null),e([h()],ye.prototype,"maximumFeatureCountWithComplexForms",null),e([h()],ye.prototype,"spatialReference",null),e([h()],ye.prototype,"layerInfos",null),e([h()],ye.prototype,"timeZone",null),e([h()],ye.prototype,"headingLevel",void 0),e([h()],ye.prototype,"icon",null),e([h(),ue("esri/t9n/common")],ye.prototype,"messagesCommon",void 0),e([h(),ue("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],ye.prototype,"messages",void 0),e([h(),ue("esri/widgets/FeatureForm/t9n/FeatureForm")],ye.prototype,"featureFormMessages",void 0),e([h(),ue("esri/widgets/FeatureTable/t9n/FeatureTable")],ye.prototype,"featureTableMessages",void 0),e([h(),ue("esri/core/t9n/Units")],ye.prototype,"messagesUnits",void 0),e([h()],ye.prototype,"page",null),e([h()],ye.prototype,"readOnly",null),e([h()],ye.prototype,"selectedAttachment",null),e([h()],ye.prototype,"selectedAttachmentDetails",null),e([h()],ye.prototype,"valid",null),e([h({type:M}),pe(["attachments-change","value-change","values-change","submit"])],ye.prototype,"viewModel",void 0),e([h({type:R,nonNullable:!0})],ye.prototype,"visibleElements",void 0),e([h()],ye.prototype,"groupDisplay",void 0),e([h()],ye.prototype,"_formHeaderVisible",null),e([h()],ye.prototype,"_associationsEnabled",null),e([h()],ye.prototype,"_associationsList",void 0),e([h()],ye.prototype,"_attemptFocusOnNextRender",void 0),e([h()],ye.prototype,"_formId",null),e([h()],ye.prototype,"_focusedFieldInput",void 0),e([h()],ye.prototype,"_relatedRecordsEnabled",null),e([h()],ye.prototype,"_listObserverNode",void 0),e([h()],ye.prototype,"_attachmentDialogInfo",void 0),e([h()],ye.prototype,"_attachmentListFilterText",void 0),ye=e([u("esri.widgets.BatchAttributeForm")],ye);const we=ye;export{we as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../core/Error.js";import{makeHandle as i,abortHandle as o}from"../../core/handleUtils.js";import{isAborted as s}from"../../core/promiseUtils.js";import{watch as r}from"../../core/reactiveUtils.js";import{property as a,subclass as l}from"../../core/accessorSupport/decorators.js";import{isSubtypeSublayer as n}from"../../layers/support/layerUtils.js";import{createFeatureServices as d}from"../../rest/featureService/utils.js";import c from"../../views/draw/support/HighlightHelper.js";import{temporaryHighlightName as u}from"../../views/support/HighlightDefaults.js";import p from"./AddAssociationWorkflowData.js";import w from"./Workflow.js";import{fetchFullFeatures as h}from"./workflowUtils.js";import y from"../FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js";import{getFeatureTitle as m}from"../support/UtilityNetworkAssociations/utils/getFeatureTitle.js";var A;const f={exit:Symbol()};let g=class extends w{static{A=this}constructor(t){super(t),this._utilityNetworkAssociationAddAssociationViewModel=new y,this._highlightHelper=null,this.sourceFeatureItem=null,this.type="add-association"}initialize(){const{data:t}=this,{view:e}=t.viewModel;e&&(this._highlightHelper=new c({view:e,highlightName:u}),this.addHandles(i(()=>this._highlightHelper?.removeAll())));const s=new AbortController;this.addHandles(o(s)),this._updatingHandles.consumePromise(this._setup(s))}get editorItem(){return this.data.editorItem}get formViewModel(){return this._formViewModel}get utilityNetworkAssociationAddAssociationViewModel(){return this._utilityNetworkAssociationAddAssociationViewModel}get hasPendingEdits(){return!!this._utilityNetworkAssociationAddAssociationViewModel.selectedFeature}get layer(){return this.data.editorItem.layer}get parent(){return this.data.parent}get reliesOnOwnerAdminPrivileges(){return this.editorItem.capabilities.create.reliesOnOwnerAdminPrivileges}async enter(){this._addHandles()}exit(){this.removeHandles(f.exit)}async start(){return await super.start(),null}async _setup(t){const{data:i}=this,{feature:o}=i;try{const[e]=await h([o],o.sourceLayer,i.viewModel.view.spatialReference,t.signal);if(s(t))return;const r=e.sourceLayer&&"getFeatureTitle"in e.sourceLayer&&await e.sourceLayer.getFeatureTitle(e)||m(e);if(s(t))return;this.sourceFeatureItem={feature:o,label:r},this._initializeUtilityNetworkAssociationAddAssociationViewModel()}catch(r){await this.cancel({force:!0,error:new e("editor:failed-to-fetch-full-feature","Failed to retrieve all information for this feature. The update cannot proceed.",{detail:{error:r}})})}}_initializeUtilityNetworkAssociationAddAssociationViewModel(){const{viewModel:{view:t},utilityNetwork:e,associationType:i}=this.data,o=this._utilityNetworkAssociationAddAssociationViewModel;o.graphic=this.sourceFeatureItem.feature,o.map=t?.map,o.utilityNetwork=e,o.layer=this.layer,o.associationType=i,o.highlightHelper=this._highlightHelper,e.networkSystemLayers.loadAssociationsTable()}_addHandles(){const t=this._utilityNetworkAssociationAddAssociationViewModel;this.addHandles([r(()=>t.selectedLayer,t=>{t&&this.go("add-association-select-feature")}),r(()=>t.selectedFeature,t=>{t&&this.go("add-association-create-association")})],f.exit)}static async create(t){const e=new A({data:await p.create(t),onCommit:this._onCommitFactory(t.applyEditsFeatureService)});return e._set("steps",this._createWorkflowSteps(e)),e}static _createWorkflowSteps(t){return[{id:"add-association-select-layer",async setUp(){const{utilityNetworkAssociationAddAssociationViewModel:e}=t.data.viewModel;e&&(e.selectedLayer=null,e.selectedFeature=null,e.association=null)},async tearDown(){}},{id:"add-association-select-feature",async setUp(){const{utilityNetworkAssociationAddAssociationViewModel:e}=t.data.viewModel;e&&(e.selectedFeature=null,e.association=null)},async tearDown(){}},{id:"add-association-create-association",async setUp(){},async tearDown(){}}]}static{this._onCommitFactory=t=>async i=>{const{feature:o,utilityNetwork:s,associationInput:r}=i,{utilityNetworkAssociationAddAssociationViewModel:a}=i.viewModel,{association:l}=a;await s.networkSystemLayers.loadAssociationsTable();const c=s?.generateAddAssociations([l]);if(!c)throw new e("editor:failed-to-add-association","Could not create payload needed to add association");const u=o.sourceLayer,p=n(u)&&u.parent?u.parent:u,w=d([p]),h=w.values().next().value?.featureService;if(!h)throw new e("editor:failed-to-delete-association","Could not retrieve feature service needed to delete association");await(h?.load());const y=s?.gdbVersion??void 0;await t(h,[c],{gdbVersion:y}),await r.refresh()}}};t([a()],g.prototype,"_utilityNetworkAssociationAddAssociationViewModel",void 0),t([a()],g.prototype,"_formViewModel",void 0),t([a()],g.prototype,"editorItem",null),t([a()],g.prototype,"formViewModel",null),t([a()],g.prototype,"utilityNetworkAssociationAddAssociationViewModel",null),t([a()],g.prototype,"sourceFeatureItem",void 0),t([a()],g.prototype,"hasPendingEdits",null),t([a()],g.prototype,"layer",null),t([a()],g.prototype,"parent",null),t([a()],g.prototype,"reliesOnOwnerAdminPrivileges",null),g=A=t([l("esri.widgets.Editor.AddAssociationWorkflow")],g);export{g as AddAssociationWorkflow};
2
+ import{__decorate as t}from"tslib";import e from"../../core/Error.js";import{makeHandle as i,abortHandle as o}from"../../core/handleUtils.js";import{isAborted as s}from"../../core/promiseUtils.js";import{watch as r}from"../../core/reactiveUtils.js";import{property as a,subclass as l}from"../../core/accessorSupport/decorators.js";import{isSubtypeSublayer as n}from"../../layers/support/layerUtils.js";import{createFeatureServices as d}from"../../rest/featureService/utils.js";import c from"../../views/draw/support/HighlightHelper.js";import{temporaryHighlightName as u}from"../../views/support/HighlightDefaults.js";import p from"./AddAssociationWorkflowData.js";import w from"./Workflow.js";import{fetchFullFeatures as h}from"./workflowUtils.js";import y from"../FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js";import{getFeatureTitle as m}from"../support/UtilityNetworkAssociations/utils/getFeatureTitle.js";var A;const f={exit:Symbol()};let g=class extends w{static{A=this}constructor(t){super(t),this._utilityNetworkAssociationAddAssociationViewModel=new y,this._highlightHelper=null,this.sourceFeatureItem=null,this.type="add-association"}initialize(){const{data:t}=this,{view:e}=t.viewModel;e&&(this._highlightHelper=new c({view:e,highlightName:u}),this.addHandles(i(()=>this._highlightHelper?.removeAll())));const s=new AbortController;this.addHandles(o(s)),this._updatingHandles.consumePromise(this._setup(s))}get editorItem(){return this.data.editorItem}get formViewModel(){return this._formViewModel}get utilityNetworkAssociationAddAssociationViewModel(){return this._utilityNetworkAssociationAddAssociationViewModel}get hasPendingEdits(){return!!this._utilityNetworkAssociationAddAssociationViewModel.selectedFeature}get layer(){return this.data.editorItem.layer}get parent(){return this.data.parent}get reliesOnOwnerAdminPrivileges(){return this.editorItem.capabilities.create.reliesOnOwnerAdminPrivileges}async enter(){this._addHandles()}exit(){this.removeHandles(f.exit)}async start(){return await super.start(),null}async _setup(t){const{data:i}=this,{feature:o}=i;try{const[e]=await h([o],o.sourceLayer,i.viewModel.view.spatialReference,t.signal);if(s(t))return;const r=e.sourceLayer&&"getFeatureTitle"in e.sourceLayer&&await e.sourceLayer.getFeatureTitle(e)||m(e);if(s(t))return;this.sourceFeatureItem={feature:o,label:r},this._initializeUtilityNetworkAssociationAddAssociationViewModel()}catch(r){await this.cancel({force:!0,error:new e("editor:failed-to-fetch-full-feature","Failed to retrieve all information for this feature. The update cannot proceed.",{detail:{error:r}})})}}_initializeUtilityNetworkAssociationAddAssociationViewModel(){const{viewModel:{view:t},utilityNetwork:e,associationType:i}=this.data,o=this._utilityNetworkAssociationAddAssociationViewModel;o.graphic=this.sourceFeatureItem.feature,o.map=t?.map,o.utilityNetwork=e,o.layer=this.layer,o.associationType=i,o.highlightHelper=this._highlightHelper,e.networkSystemLayers.loadAssociationsTable()}_addHandles(){const t=this._utilityNetworkAssociationAddAssociationViewModel;this.addHandles([r(()=>t.selectedLayer,t=>{t&&this.go("add-association-select-feature")}),r(()=>t.selectedFeature,t=>{t&&this.go("add-association-create-association")})],f.exit)}static async create(t){const e=new A({data:await p.create(t),onCommit:this._onCommitFactory(t.applyEditsFeatureService)});return e._set("steps",this._createWorkflowSteps(e)),e}static _createWorkflowSteps(t){return[{id:"add-association-select-layer",async setUp(){const{utilityNetworkAssociationAddAssociationViewModel:e}=t.data.viewModel;e&&(e.selectedLayer=null,e.selectedFeature=null,e.association=null)},async tearDown(){}},{id:"add-association-select-feature",async setUp(){const{utilityNetworkAssociationAddAssociationViewModel:e}=t.data.viewModel;e&&(e.selectedFeature=null,e.association=null)},async tearDown(){}},{id:"add-association-create-association",async setUp(){},async tearDown(){}}]}static{this._onCommitFactory=t=>async i=>{const{feature:o,utilityNetwork:s,associationsInput:r}=i,{utilityNetworkAssociationAddAssociationViewModel:a}=i.viewModel,{association:l}=a;await s.networkSystemLayers.loadAssociationsTable();const c=s?.generateAddAssociations([l]);if(!c)throw new e("editor:failed-to-add-association","Could not create payload needed to add association");const u=o.sourceLayer,p=n(u)&&u.parent?u.parent:u,w=d([p]),h=w.values().next().value?.featureService;if(!h)throw new e("editor:failed-to-delete-association","Could not retrieve feature service needed to delete association");await(h?.load());const y=s?.gdbVersion??void 0;await t(h,[c],{gdbVersion:y}),await r.refresh()}}};t([a()],g.prototype,"_utilityNetworkAssociationAddAssociationViewModel",void 0),t([a()],g.prototype,"_formViewModel",void 0),t([a()],g.prototype,"editorItem",null),t([a()],g.prototype,"formViewModel",null),t([a()],g.prototype,"utilityNetworkAssociationAddAssociationViewModel",null),t([a()],g.prototype,"sourceFeatureItem",void 0),t([a()],g.prototype,"hasPendingEdits",null),t([a()],g.prototype,"layer",null),t([a()],g.prototype,"parent",null),t([a()],g.prototype,"reliesOnOwnerAdminPrivileges",null),g=A=t([l("esri.widgets.Editor.AddAssociationWorkflow")],g);export{g as AddAssociationWorkflow};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import o from"../../core/Accessor.js";import{property as e,subclass as i}from"../../core/accessorSupport/decorators.js";import{findEditorItemForLayerOrThrow as r}from"./workflowUtils.js";var s;let a=s=class extends o{constructor(t){super(t),this.editorItem=null,this.feature=null,this.utilityNetwork=null,this.associationType=null,this.parent=null,this.associationInput=null,this.viewModel=null}static async create(t){const{feature:o,parent:e,viewModel:i,utilityNetwork:a,associationType:n,associationInput:p}=t,l=r(i.editorItems,o.sourceLayer);return new s({editorItem:l,feature:o,parent:e,viewModel:i,utilityNetwork:a,associationType:n,associationInput:p})}};t([e({constructOnly:!0})],a.prototype,"editorItem",void 0),t([e()],a.prototype,"feature",void 0),t([e({constructOnly:!0})],a.prototype,"utilityNetwork",void 0),t([e({constructOnly:!0})],a.prototype,"associationType",void 0),t([e()],a.prototype,"parent",void 0),t([e()],a.prototype,"associationInput",void 0),t([e()],a.prototype,"viewModel",void 0),a=s=t([i("esri.widgets.Editor.AddAssociationWorkflowData")],a);export{a as default};
2
+ import{__decorate as t}from"tslib";import o from"../../core/Accessor.js";import{property as e,subclass as i}from"../../core/accessorSupport/decorators.js";import{findEditorItemForLayerOrThrow as r}from"./workflowUtils.js";var s;let a=s=class extends o{constructor(t){super(t),this.editorItem=null,this.feature=null,this.utilityNetwork=null,this.associationType=null,this.parent=null,this.associationsInput=null,this.viewModel=null}static async create(t){const{feature:o,parent:e,viewModel:i,utilityNetwork:a,associationType:n,associationsInput:p}=t,l=r(i.editorItems,o.sourceLayer);return new s({editorItem:l,feature:o,parent:e,viewModel:i,utilityNetwork:a,associationType:n,associationsInput:p})}};t([e({constructOnly:!0})],a.prototype,"editorItem",void 0),t([e()],a.prototype,"feature",void 0),t([e({constructOnly:!0})],a.prototype,"utilityNetwork",void 0),t([e({constructOnly:!0})],a.prototype,"associationType",void 0),t([e()],a.prototype,"parent",void 0),t([e()],a.prototype,"associationsInput",void 0),t([e()],a.prototype,"viewModel",void 0),a=s=t([i("esri.widgets.Editor.AddAssociationWorkflowData")],a);export{a as default};