@arcgis/core 5.0.0-next.66 → 5.0.0-next.68

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 (595) hide show
  1. package/Ground.d.ts +4 -4
  2. package/Map.d.ts +1 -1
  3. package/WebDocument2D.d.ts +2 -3
  4. package/WebScene.d.ts +2 -3
  5. package/analysis/ElevationProfile/ElevationProfileLineViewOptions.d.ts +9 -6
  6. package/analysis/ElevationProfile/ElevationProfileLineViewOptions.js +1 -1
  7. package/applications/Components/QuantityFormatter.d.ts +14 -1
  8. package/applications/Components/SelectionOperation.d.ts +45 -9
  9. package/applications/Components/SketchTooltipControls.d.ts +31 -6
  10. package/applications/Components/actionUtils.d.ts +1 -0
  11. package/applications/Components/analysisUtils.d.ts +98 -26
  12. package/applications/Components/arcadeEditorUtils.d.ts +3 -0
  13. package/applications/Components/arcadeFeatureUtils.d.ts +34 -6
  14. package/applications/Components/baUtils.d.ts +8 -8
  15. package/applications/Components/basemapUtils.d.ts +2 -0
  16. package/applications/Components/drawUtils.d.ts +6 -1
  17. package/applications/Components/featureUtils.d.ts +9 -0
  18. package/applications/Components/fontUtils.d.ts +2 -0
  19. package/applications/Components/formatUtils.d.ts +2 -0
  20. package/applications/Components/getDefaultUnits.d.ts +2 -0
  21. package/applications/Components/imageryUtils.d.ts +135 -27
  22. package/applications/Components/layerOriginUtils.d.ts +5 -0
  23. package/applications/Components/layersEffectsJsonUtils.d.ts +2 -0
  24. package/applications/Components/previewSymbol2D.d.ts +2 -0
  25. package/applications/Components/reactiveUtils.d.ts +13 -9
  26. package/applications/Components/sanitizerUtils.d.ts +2 -0
  27. package/applications/Components/stringUtils.d.ts +5 -0
  28. package/applications/Components/styleUtils.d.ts +2 -0
  29. package/applications/Components/svgUtils.d.ts +4 -0
  30. package/applications/Components/testUtils.d.ts +3 -0
  31. package/applications/Components/viewUtils.d.ts +2 -0
  32. package/applications/Components/webStyleSymbolUtils.d.ts +2 -0
  33. package/applications/Excalibur/videoViewUtils.d.ts +19 -3
  34. package/applications/ExperienceBuilder/sketchUtils.d.ts +10 -1
  35. package/applications/KnowledgeStudio/dataModelVisualization.d.ts +2 -0
  36. package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +33 -4
  37. package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +73 -10
  38. package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +12 -1
  39. package/applications/KnowledgeStudio/reshape.d.ts +144 -28
  40. package/applications/KnowledgeStudio/resourceSerializationUtils.d.ts +17 -3
  41. package/applications/MapViewer/layerUtils.d.ts +2 -0
  42. package/applications/MapViewer/mediaUtils.d.ts +42 -8
  43. package/applications/MapViewer/templateUtils.d.ts +78 -16
  44. package/applications/PortalApp/layerUtils.d.ts +2 -0
  45. package/applications/SceneViewer/colorUtils.d.ts +2 -0
  46. package/applications/SceneViewer/devEnvironmentUtils.d.ts +3 -0
  47. package/applications/SceneViewer/layerUtils.d.ts +5 -3
  48. package/applications/SceneViewer/sceneViewerUtils.d.ts +52 -5
  49. package/applications/SceneViewer/symbolUtils.d.ts +2 -0
  50. package/applications/Urban/LineImagePattern3D.d.ts +8 -2
  51. package/applications/Urban/imagePatternUtils.d.ts +10 -2
  52. package/applications/Urban/meshUtils.d.ts +2 -0
  53. package/applications/WebEditor/sketchUtils.d.ts +24 -4
  54. package/arcade/arcadeAsyncRuntime.js +1 -1
  55. package/arcade/arcadeCompiler.js +1 -1
  56. package/arcade/arcadeRuntime.js +1 -1
  57. package/arcade/batchExec.js +1 -1
  58. package/arcade/compilerUtils.js +1 -1
  59. package/arcade/featureset/actions/SpatialFilter.js +1 -1
  60. package/arcade/geometry/unitConversion.js +1 -1
  61. package/arcade/treeAnalysis.js +1 -1
  62. package/arcade.js +1 -1
  63. package/assets/components/assets/icon/fileEsl16.json +1 -0
  64. package/assets/components/assets/icon/fileEsl24.json +1 -0
  65. package/assets/components/assets/icon/fileEsl32.json +1 -0
  66. package/assets/esri/core/workers/RemoteClient.js +1 -1
  67. package/assets/esri/core/workers/chunks/{251eb6e00f99a816d55c.js → 0326314947734b8e640a.js} +1 -1
  68. package/assets/esri/core/workers/chunks/04176244b0a3539c9681.js +1 -0
  69. package/assets/esri/core/workers/chunks/04958494022f82dca473.js +1 -0
  70. package/assets/esri/core/workers/chunks/0b7bbdc0d71ee6721751.js +2 -0
  71. package/assets/esri/core/workers/chunks/{5909a0e763fddc3542e7.js.LICENSE.txt → 0b7bbdc0d71ee6721751.js.LICENSE.txt} +1 -1
  72. package/assets/esri/core/workers/chunks/0f8149fdcf0adeca268e.js +1 -0
  73. package/assets/esri/core/workers/chunks/{aa7a1705266eec353cb6.js → 0fc22ad791d3ec0a9c5e.js} +1 -1
  74. package/assets/esri/core/workers/chunks/10e474d664b20adcd917.js +1 -0
  75. package/assets/esri/core/workers/chunks/12f9a55253084a910b2e.js +1 -0
  76. package/assets/esri/core/workers/chunks/14dedd80fb797303f91f.js +1 -0
  77. package/assets/esri/core/workers/chunks/1a6d2f525dd30d08cf9b.js +1 -0
  78. package/assets/esri/core/workers/chunks/{81d89107ff82604a3ea0.js → 1b445981fbc8373f4dd8.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{6ba3c2b9f699d94d62b8.js → 1ec1a1997b5577619040.js} +1 -1
  80. package/assets/esri/core/workers/chunks/204d738c8b651314ae64.js +1 -0
  81. package/assets/esri/core/workers/chunks/2085084324cd5a81783f.js +1 -0
  82. package/assets/esri/core/workers/chunks/{e95821a199e10b389e29.js → 25f3ee666f545a7a7993.js} +2 -2
  83. package/assets/esri/core/workers/chunks/{e95821a199e10b389e29.js.LICENSE.txt → 25f3ee666f545a7a7993.js.LICENSE.txt} +1 -1
  84. package/assets/esri/core/workers/chunks/2c2c0f66cffc521df736.js +1 -0
  85. package/assets/esri/core/workers/chunks/2dd347aa2a061d536e69.js +1 -0
  86. package/assets/esri/core/workers/chunks/2dfa7abf2d39fa5a3874.js +1 -0
  87. package/assets/esri/core/workers/chunks/322085d63719da6e443c.js +1 -0
  88. package/assets/esri/core/workers/chunks/{76086517591d0eb35156.js → 34a2e0462eb05986cdd1.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{a6dcd13c792b6538ac50.js → 35593a9790818b689455.js} +1 -1
  90. package/assets/esri/core/workers/chunks/36ecf951c0c7dad84b69.js +1 -0
  91. package/assets/esri/core/workers/chunks/37002a46f03a9fc5f644.js.LICENSE.txt +1 -1
  92. package/assets/esri/core/workers/chunks/3a04153ca9d8e4f01185.js +1 -0
  93. package/assets/esri/core/workers/chunks/{4e9a8fce55cad841c731.js → 3b25f5d9c8f78bb6e011.js} +1 -1
  94. package/assets/esri/core/workers/chunks/3e7ea06b342e33bc48a5.js +1 -0
  95. package/assets/esri/core/workers/chunks/3ed317900f0edf635508.js +1 -0
  96. package/assets/esri/core/workers/chunks/401ce5cb98fa14c1a725.js +1 -0
  97. package/assets/esri/core/workers/chunks/4319b89cfa02894a8cae.js +1 -0
  98. package/assets/esri/core/workers/chunks/43e2c1d72cd9c8beed2f.js.LICENSE.txt +1 -1
  99. package/assets/esri/core/workers/chunks/45a9cd722e98dd1548ae.js +1 -0
  100. package/assets/esri/core/workers/chunks/4a060147d25929680ec8.js +1 -0
  101. package/assets/esri/core/workers/chunks/4bcd74951477e8977ba1.js +1 -0
  102. package/assets/esri/core/workers/chunks/4d0eaeb4cd6cd55e25fd.js +1 -0
  103. package/assets/esri/core/workers/chunks/{687d2b761dc5b5cf0c31.js → 4d4d71d24c1a9cb342b8.js} +1 -1
  104. package/assets/esri/core/workers/chunks/4fa230dc6e5e87b0dec1.js +1 -0
  105. package/assets/esri/core/workers/chunks/50f03813fba4b752ca9f.js +1 -0
  106. package/assets/esri/core/workers/chunks/{abc236e99b52be1c83b9.js → 52a14266fe239b95c5ce.js} +1 -1
  107. package/assets/esri/core/workers/chunks/53b5c77832df7df4d4e3.js +1 -0
  108. package/assets/esri/core/workers/chunks/{34178ace79e8dea3567d.js → 562cddaf63985e53ee6e.js} +1 -1
  109. package/assets/esri/core/workers/chunks/59a45533e96cedf1c480.js +1 -0
  110. package/assets/esri/core/workers/chunks/{c2aeecd27e004c6cd7e1.js → 5b9f2aa3ba1bf12c3240.js} +2 -2
  111. package/assets/esri/core/workers/chunks/{c2aeecd27e004c6cd7e1.js.LICENSE.txt → 5b9f2aa3ba1bf12c3240.js.LICENSE.txt} +1 -1
  112. package/assets/esri/core/workers/chunks/{6599cc702a46f81a5634.js → 5dd5be91038df8902dc4.js} +1 -1
  113. package/assets/esri/core/workers/chunks/{49a1b7f700b8a42de817.js → 60c7f896f2246a8aa6d7.js} +19 -19
  114. package/assets/esri/core/workers/chunks/60f363ee2add089e8f0b.js +1 -0
  115. package/assets/esri/core/workers/chunks/61801bb8c7be8fe77086.js +1 -0
  116. package/assets/esri/core/workers/chunks/679cd6424e0e2d7f372b.js +1 -0
  117. package/assets/esri/core/workers/chunks/68074a484d7f9bc713c0.js +1 -0
  118. package/assets/esri/core/workers/chunks/6acfa51b81e6f4255118.js +1 -0
  119. package/assets/esri/core/workers/chunks/{3fe7be535affae31de7e.js → 6b85a8776ec2beff63cb.js} +1 -1
  120. package/assets/esri/core/workers/chunks/6be530ab81291745485b.js.LICENSE.txt +1 -1
  121. package/assets/esri/core/workers/chunks/6df484faf54e90a6cc77.js +1 -0
  122. package/assets/esri/core/workers/chunks/6ea6ad894ac634aa4391.js +1 -0
  123. package/assets/esri/core/workers/chunks/6f8098f9fe233833245a.js +1 -0
  124. package/assets/esri/core/workers/chunks/73c416ae0ec5a1815591.js.LICENSE.txt +1 -1
  125. package/assets/esri/core/workers/chunks/75fd2ef1236a9364ca7f.js +1 -0
  126. package/assets/esri/core/workers/chunks/{23b623637126f8411a30.js → 7aec07f2482934259d12.js} +1 -1
  127. package/assets/esri/core/workers/chunks/7be9bbae23895d1cfa92.js +1 -0
  128. package/assets/esri/core/workers/chunks/{741d170187e58e81584d.js → 7d744554d14057d9b2b1.js} +1 -1
  129. package/assets/esri/core/workers/chunks/7ea48661f1087d06aa41.js +1 -0
  130. package/assets/esri/core/workers/chunks/{47e5149765beee46f208.js → 7ee68f67f9cc48a328f0.js} +1 -1
  131. package/assets/esri/core/workers/chunks/866477acdf03b8a40bc9.js +1 -0
  132. package/assets/esri/core/workers/chunks/8e83c133b201b9b61e70.js +1 -0
  133. package/assets/esri/core/workers/chunks/9086a4933d3d3d9ffa72.js +1 -0
  134. package/assets/esri/core/workers/chunks/94174d40de39dbe7d0bf.js +1 -0
  135. package/assets/esri/core/workers/chunks/98f4b44eca91c42ca08e.js +1 -0
  136. package/assets/esri/core/workers/chunks/9ccabf8142fb5de4d3e2.js.LICENSE.txt +1 -1
  137. package/assets/esri/core/workers/chunks/{dd99b77a7c0a052507bb.js → 9d88b4ba8e511da64583.js} +3 -3
  138. package/assets/esri/core/workers/chunks/a808be466812db51813d.js +1 -0
  139. package/assets/esri/core/workers/chunks/{6b4a24248182245167ca.js → a931515a2569713e743b.js} +1 -1
  140. package/assets/esri/core/workers/chunks/a95e28ade258b144cbb5.js +1 -0
  141. package/assets/esri/core/workers/chunks/adc68e2c6d2698a52bfe.js +1 -0
  142. package/assets/esri/core/workers/chunks/aeb524eded012217a865.js +1 -0
  143. package/assets/esri/core/workers/chunks/b2a1e5e9182b643909eb.js +316 -0
  144. package/assets/esri/core/workers/chunks/{ac6f002cfad42e60de8f.js → b48033645091c91e0d88.js} +1 -1
  145. package/assets/esri/core/workers/chunks/b8988771bfa4e785ebd6.js +1 -0
  146. package/assets/esri/core/workers/chunks/bb4574a87ca21e719f0d.js +1 -0
  147. package/assets/esri/core/workers/chunks/{07639f406b71bb49ffd6.js → bdbb5b33f0f49661bf6d.js} +1 -1
  148. package/assets/esri/core/workers/chunks/c042269586921e337be9.js +1 -0
  149. package/assets/esri/core/workers/chunks/c623918e289a09905cd1.js +1 -0
  150. package/assets/esri/core/workers/chunks/c7391b0b5a9c916a53f7.js +1 -0
  151. package/assets/esri/core/workers/chunks/{ac83c2999a3d2ffb4356.js → c7838ac0db8570a2d2c1.js} +1 -1
  152. package/assets/esri/core/workers/chunks/c91ef3814e7f024043cf.js +1 -0
  153. package/assets/esri/core/workers/chunks/{43d28c6509c21b8917a8.js → ca7523c14d81c470e92e.js} +1 -1
  154. package/assets/esri/core/workers/chunks/cd2708fb7636b3ace229.js +1 -0
  155. package/assets/esri/core/workers/chunks/{310f3268582e61cd86da.js → d21480925a8bc9c7de96.js} +1 -1
  156. package/assets/esri/core/workers/chunks/d445e9399fe4ca3d2a50.js +1 -0
  157. package/assets/esri/core/workers/chunks/d7683a95775c9f401a7e.js +1 -0
  158. package/assets/esri/core/workers/chunks/{9d6945cda99d14af83ac.js → d7d9656b990ce8be2152.js} +1 -1
  159. package/assets/esri/core/workers/chunks/d9ca754f51b9812bb179.js +1 -0
  160. package/assets/esri/core/workers/chunks/d9ef0b3341e2744d8f2f.js +1 -0
  161. package/assets/esri/core/workers/chunks/df4a0af329ce94a47a7b.js +1 -0
  162. package/assets/esri/core/workers/chunks/e10d6e511921394474ca.js +1 -0
  163. package/assets/esri/core/workers/chunks/e4b6aa8f67c2bd285020.js +1 -0
  164. package/assets/esri/core/workers/chunks/e5aac523c37d906eece6.js +1 -0
  165. package/assets/esri/core/workers/chunks/e6ca02f98f855024f74b.js +1 -0
  166. package/assets/esri/core/workers/chunks/{892157696e8f9e38c472.js → e6e837e43b9348050832.js} +1 -1
  167. package/assets/esri/core/workers/chunks/{d3325ed8d224e2350db7.js → e8a3ad00936f2ccaf362.js} +1 -1
  168. package/assets/esri/core/workers/chunks/{f351007cdcd0938d3b6c.js → eeb24a4ab4993f1f4e8e.js} +1 -1
  169. package/assets/esri/core/workers/chunks/ef7063ee790d2d64d4b2.js +1 -0
  170. package/assets/esri/core/workers/chunks/{b65fcfde62d49de1fa54.js → ef977be20a647aeded0a.js} +1 -1
  171. package/assets/esri/core/workers/chunks/efb631371b6bb3f043bb.js +1 -0
  172. package/assets/esri/core/workers/chunks/{0f5693541111fcae0c2f.js → f0914715e90e43466f8c.js} +1 -1
  173. package/assets/esri/core/workers/chunks/f25bebd2b6eb0d0f6626.js.LICENSE.txt +1 -1
  174. package/assets/esri/core/workers/chunks/f95e488d2b86e320624f.js +1 -0
  175. package/assets/esri/core/workers/chunks/{bfc063d4431bfa162160.js → fd09f38fb4d99bf34988.js} +1 -1
  176. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  177. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  178. package/assets/esri/libs/text/pkg/bundle_bg.wasm +0 -0
  179. package/chunks/boundedPlane.js +1 -1
  180. package/chunks/bundle2.js +5 -0
  181. package/config.js +1 -1
  182. package/copyright.txt +70 -1
  183. package/core/BidiText.js +1 -1
  184. package/core/accessorSupport/ensureType.js +1 -1
  185. package/core/compilerUtils.js +1 -1
  186. package/core/typedArrayUtil.js +1 -1
  187. package/core/units.js +1 -1
  188. package/core/workers/loaderConfig.js +1 -1
  189. package/editing/sharedTemplates/SharedTemplate.js +1 -1
  190. package/geometry/support/FloatArray.js +1 -1
  191. package/geometry/support/Indices.js +1 -1
  192. package/geometry/support/MeshTexture.js +1 -1
  193. package/geometry/support/aaBoundingRect.js +1 -1
  194. package/geometry/support/boundedPlane.js +1 -1
  195. package/geometry/support/heightModelInfoUtils.js +1 -1
  196. package/geometry/support/meshUtils/External.js +1 -1
  197. package/geometry/support/meshUtils/exporters/gltf/imageutils.js +1 -1
  198. package/geometry/support/meshUtils/loadExternal.js +1 -1
  199. package/geometry/support/rotate.js +1 -1
  200. package/interfaces.d.ts +23 -24
  201. package/kernel.js +1 -1
  202. package/layers/BingMapsLayer.d.ts +2 -3
  203. package/layers/BuildingSceneLayer.d.ts +3 -5
  204. package/layers/CatalogLayer.d.ts +2 -4
  205. package/layers/DimensionLayer.d.ts +2 -3
  206. package/layers/ElevationLayer.d.ts +2 -4
  207. package/layers/FeatureLayer.d.ts +2 -4
  208. package/layers/GaussianSplatLayer.d.ts +1 -3
  209. package/layers/GeoJSONLayer.d.ts +2 -3
  210. package/layers/GeoRSSLayer.d.ts +2 -3
  211. package/layers/GroupLayer.d.ts +2 -3
  212. package/layers/ImageryLayer.d.ts +2 -5
  213. package/layers/ImageryTileLayer.d.ts +3 -7
  214. package/layers/IntegratedMesh3DTilesLayer.d.ts +2 -4
  215. package/layers/IntegratedMeshLayer.d.ts +2 -4
  216. package/layers/KMLLayer.d.ts +2 -3
  217. package/layers/KnowledgeGraphLayer.d.ts +2 -4
  218. package/layers/LineOfSightLayer.d.ts +2 -3
  219. package/layers/LinkChartLayer.d.ts +2 -3
  220. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  221. package/layers/MapImageLayer.d.ts +2 -4
  222. package/layers/MapNotesLayer.d.ts +2 -3
  223. package/layers/MediaLayer.d.ts +3 -4
  224. package/layers/OGCFeatureLayer.d.ts +2 -3
  225. package/layers/ParquetLayer.d.ts +2 -3
  226. package/layers/PointCloudLayer.d.ts +2 -4
  227. package/layers/RouteLayer.d.ts +2 -3
  228. package/layers/SceneLayer.d.ts +2 -4
  229. package/layers/StreamLayer.d.ts +2 -4
  230. package/layers/SubtypeGroupLayer.d.ts +2 -4
  231. package/layers/TileLayer.d.ts +2 -4
  232. package/layers/UnknownLayer.d.ts +2 -3
  233. package/layers/UnsupportedLayer.d.ts +2 -3
  234. package/layers/VectorTileLayer.d.ts +2 -4
  235. package/layers/VideoLayer.d.ts +8 -9
  236. package/layers/ViewshedLayer.d.ts +2 -3
  237. package/layers/VoxelLayer.d.ts +2 -4
  238. package/layers/WCSLayer.d.ts +2 -4
  239. package/layers/WFSLayer.d.ts +2 -3
  240. package/layers/WMSLayer.d.ts +5 -6
  241. package/layers/WMTSLayer.d.ts +4 -5
  242. package/layers/WebTileLayer.d.ts +2 -3
  243. package/layers/buildingSublayers/BuildingGroupSublayer.d.ts +1 -1
  244. package/layers/buildingSublayers/BuildingSublayer.d.ts +3 -3
  245. package/layers/buildingSublayers/BuildingSublayer.js +1 -1
  246. package/layers/catalog/CatalogDynamicGroupLayer.d.ts +2 -3
  247. package/layers/catalog/CatalogFootprintLayer.d.ts +2 -3
  248. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  249. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  250. package/layers/graphics/data/QueryEngineResult.js +1 -1
  251. package/layers/graphics/dehydratedFeatureComparison.js +1 -1
  252. package/layers/graphics/dehydratedFeatures.js +1 -1
  253. package/layers/graphics/hydratedFeatures.js +1 -1
  254. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +4 -6
  255. package/layers/{support/media.d.ts → media/types.d.ts} +9 -9
  256. package/layers/mixins/ArcGISImageService.d.ts +1 -1
  257. package/layers/mixins/ImageryTileMixin.d.ts +1 -1
  258. package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
  259. package/layers/raster/datasets/wcsCoverageParser.d.ts +1 -1
  260. package/layers/raster/functions/changeDetectionUtils.js +1 -1
  261. package/layers/raster/functions/creators/createLocalFunctions.d.ts +1 -1
  262. package/layers/raster/functions/customBandIndexUtils.js +1 -1
  263. package/layers/raster/functions/focalStatUtils.js +1 -1
  264. package/layers/raster/functions/pixelTransformUtils.js +1 -1
  265. package/layers/raster/functions/types.d.ts +1 -1
  266. package/layers/{support/RasterTypes.d.ts → raster/types.d.ts} +2 -2
  267. package/layers/save/featureLayerUtils.js +1 -1
  268. package/layers/support/ElevationQuery.d.ts +2 -2
  269. package/layers/support/ElevationSampler.js +1 -1
  270. package/layers/support/FeatureType.d.ts +2 -2
  271. package/layers/support/Field.d.ts +2 -3
  272. package/layers/support/FieldConfiguration.d.ts +1 -1
  273. package/layers/support/ImageElement.d.ts +3 -3
  274. package/layers/support/LocalMediaElementSource.d.ts +1 -1
  275. package/layers/support/MediaElementBase.d.ts +4 -7
  276. package/layers/support/PixelBlock.d.ts +1 -1
  277. package/layers/support/RasterFunction.d.ts +1 -1
  278. package/layers/support/RasterInfo.d.ts +1 -1
  279. package/layers/support/Sublayer.d.ts +2 -3
  280. package/layers/support/Subtype.d.ts +2 -2
  281. package/layers/support/SubtypeSublayer.d.ts +2 -3
  282. package/layers/support/SubtypeSublayer.js +1 -1
  283. package/layers/support/VideoElement.d.ts +2 -2
  284. package/layers/support/WMSSublayer.d.ts +6 -6
  285. package/layers/support/WMSSublayer.js +1 -1
  286. package/layers/support/domains.js +1 -1
  287. package/layers/support/rasterFunctionUtils.d.ts +1 -1
  288. package/layers/support/tiles3DUtils.js +1 -1
  289. package/layers/support/types.d.ts +33 -1
  290. package/layers/types.d.ts +17 -2
  291. package/layers/wmts/types.d.ts +2 -0
  292. package/libs/text/loadTextModule.js +5 -0
  293. package/linkChart/LinkChartProperties.d.ts +4 -6
  294. package/linkChart/LinkChartProperties.js +1 -1
  295. package/networks/Network.d.ts +2 -4
  296. package/networks/support/NamedTraceConfiguration.d.ts +3 -3
  297. package/networks/support/NamedTraceConfiguration.js +1 -1
  298. package/networks/support/TopologyValidationJobInfo.js +1 -1
  299. package/networks/support/TraceJobInfo.js +1 -1
  300. package/package.json +3 -3
  301. package/popup/FieldInfo.d.ts +1 -1
  302. package/renderers/support/RasterSymbolizer.js +1 -1
  303. package/renderers/support/rendererConversion.js +1 -1
  304. package/renderers/visualVariables/support/visualVariableUtils.js +1 -1
  305. package/request/process.js +1 -1
  306. package/rest/geometryService/types.d.ts +59 -0
  307. package/rest/geometryService.d.ts +3 -5
  308. package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
  309. package/rest/query/operations/query.js +1 -1
  310. package/rest/query/support/AttachmentInfo.d.ts +2 -2
  311. package/rest/support/AlgorithmicColorRamp.d.ts +2 -2
  312. package/rest/support/BinParametersBase.d.ts +2 -2
  313. package/rest/support/BinParametersBase.js +1 -1
  314. package/rest/support/DateBinTimeInterval.d.ts +1 -1
  315. package/rest/support/GeneralizeParameters.d.ts +1 -1
  316. package/rest/support/ImageSampleParameters.d.ts +1 -1
  317. package/rest/support/JobInfo.js +1 -1
  318. package/rest/support/PrintTemplate.d.ts +4 -6
  319. package/rest/support/ServiceAreaParameters.js +1 -1
  320. package/rest/support/types.d.ts +17 -1
  321. package/smartMapping/heuristics/sizeRange.js +1 -1
  322. package/smartMapping/renderers/support/utils.js +1 -1
  323. package/smartMapping/statistics/support/statsWorker.js +1 -1
  324. package/smartMapping/statistics/support/utils.js +1 -1
  325. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  326. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  327. package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
  328. package/smartMapping/support/adapters/support/utils.js +1 -1
  329. package/smartMapping/support/utils.js +1 -1
  330. package/support/revision.js +1 -1
  331. package/symbols/WebStyleSymbol.d.ts +0 -24
  332. package/symbols/WebStyleSymbol.js +1 -1
  333. package/symbols/support/ElevationInfo.d.ts +2 -2
  334. package/symbols/support/IconSymbol3DLayerResource.d.ts +1 -1
  335. package/symbols/support/defaults.js +1 -1
  336. package/symbols/support/defaults3D.js +1 -1
  337. package/symbols/support/previewSymbol3D.js +1 -1
  338. package/symbols/support/symbolLayerUtils3D.js +1 -1
  339. package/symbols/support/symbolUtils.js +1 -1
  340. package/symbols/support/utils.js +1 -1
  341. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  342. package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +16 -11
  343. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  344. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  345. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  346. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  347. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  348. package/views/2d/engine/webgl/GlyphSDFCreator.js +5 -0
  349. package/views/2d/engine/webgl/GlyphSource.js +1 -1
  350. package/views/2d/engine/webgl/TextureManager.js +1 -1
  351. package/views/2d/engine/webgl/TextureUploadManager.js +1 -1
  352. package/views/2d/engine/webgl/definitions.js +1 -1
  353. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  354. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  355. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
  356. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  357. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  358. package/views/2d/input/handlers/DoubleTapDragZoom.js +1 -1
  359. package/views/2d/input/handlers/KeyZoom.js +1 -1
  360. package/views/2d/layers/BaseLayerView2D.d.ts +3 -6
  361. package/views/2d/layers/BaseLayerViewGL2D.d.ts +3 -6
  362. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  363. package/views/2d/layers/TileLayerView2D.js +1 -1
  364. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  365. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  366. package/views/3d/analysis/AreaMeasurement/support/utils.js +1 -1
  367. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  368. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
  369. package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +16 -11
  370. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  371. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  372. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  373. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  374. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  375. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  376. package/views/3d/environment/CloudsParameters.js +1 -1
  377. package/views/3d/environment/CloudsRenderer.js +1 -1
  378. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  379. package/views/3d/glTF/internal/Resource.js +1 -1
  380. package/views/3d/glTF/internal/fillDefaults.js +1 -1
  381. package/views/3d/interactive/Manipulator3D.js +1 -1
  382. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  383. package/views/3d/interactive/editingTools/isSupportedObjectUtils.js +1 -1
  384. package/views/3d/interactive/editingTools/move/isSupportedObject.js +1 -1
  385. package/views/3d/interactive/editingTools/transform/isSupportedGraphic.js +1 -1
  386. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  387. package/views/3d/layers/I3SMeshView3D.js +1 -1
  388. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  389. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  390. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  391. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  392. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  393. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  394. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  395. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  396. package/views/3d/layers/graphics/LabelInfo.js +1 -1
  397. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  398. package/views/3d/layers/graphics/lineUtils.js +1 -1
  399. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  400. package/views/3d/layers/graphics/pipeline/symbolization/primitiveObjectUtils.js +1 -1
  401. package/views/3d/layers/graphics/primitiveObjectSymbolUtils.js +1 -1
  402. package/views/3d/layers/i3s/BuildingFilterUtil.js +1 -1
  403. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  404. package/views/3d/layers/i3s/I3SNode.js +1 -1
  405. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  406. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  407. package/views/3d/layers/i3s/SphereCone.js +5 -0
  408. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  409. package/views/3d/layers/support/edgeUtils.js +1 -1
  410. package/views/3d/layers/support/featureReference.js +1 -1
  411. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  412. package/views/3d/layers/support/patternUtils.js +1 -1
  413. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  414. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  415. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  416. package/views/3d/support/buffer/glUtil.js +1 -1
  417. package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
  418. package/views/3d/support/viewpointUtils.js +1 -1
  419. package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
  420. package/views/3d/webgl/RenderNode.js +1 -1
  421. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  422. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  423. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +8 -8
  424. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  425. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +3 -3
  426. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
  427. package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +2 -2
  428. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +2 -2
  429. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js +6 -6
  430. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +1 -1
  431. package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +5 -5
  432. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +3 -3
  433. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendModes.glsl.js +1 -1
  434. package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
  435. package/views/3d/webgl-engine/lib/edgeRendering/EdgeProcessingWorker.js +1 -1
  436. package/views/3d/webgl-engine/lib/edgeRendering/EdgeWorkerHandle.js +1 -1
  437. package/views/3d/webgl-engine/materials/lineStippleUtils.js +1 -1
  438. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  439. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  440. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js +4 -4
  441. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +8 -8
  442. package/views/VideoView.d.ts +2 -3
  443. package/views/VideoView.js +1 -1
  444. package/views/View2D.d.ts +2 -3
  445. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  446. package/views/analysis/ElevationProfile/ElevationProfileIndicatorPointVisualization.js +5 -0
  447. package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +1 -1
  448. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  449. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  450. package/views/analysis/ElevationProfile/constants.js +1 -1
  451. package/views/draw/Draw.js +1 -1
  452. package/views/input/ViewEvents.js +1 -1
  453. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  454. package/views/interactive/snapping/featureSources/snappingCandidateElevationAlignment.js +1 -1
  455. package/views/interactive/snapping/featureSources/snappingCandidateElevationFilter.js +1 -1
  456. package/views/interactive/snapping/featureSources/symbologySnappingCandidates.js +1 -1
  457. package/views/layers/MediaLayerViewMixin.d.ts +1 -1
  458. package/views/support/PromiseQueue.js +1 -1
  459. package/views/support/screenUtils.js +1 -1
  460. package/views/support/screenshotUtils.js +1 -1
  461. package/views/types.d.ts +1 -1
  462. package/views/webgl/FramebufferObject.js +1 -1
  463. package/views/webgl/Uniform.js +1 -1
  464. package/views/webgl/Util.js +1 -1
  465. package/webdoc/applicationProperties/SearchLayerField.d.ts +1 -1
  466. package/webdoc/applicationProperties/SearchTableField.d.ts +1 -1
  467. package/webscene/Slide.d.ts +2 -2
  468. package/webscene/spec-certification/api.js +1 -1
  469. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  470. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +1 -1
  471. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  472. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  473. package/widgets/BatchAttributeForm.js +1 -1
  474. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  475. package/widgets/Editor/components/workflowAdapters/pendingFeatureList/{CreateFeaturesWorkflowPendingFeatureListAdapter.ts.js → CreateFeaturesWorkflowPendingFeatureListAdapter.js} +1 -1
  476. package/widgets/Editor/types.d.ts +1 -1
  477. package/widgets/Editor/workflowUtils.js +1 -1
  478. package/widgets/Feature.d.ts +3 -5
  479. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  480. package/widgets/FeatureForm/FieldInput.d.ts +2 -2
  481. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  482. package/widgets/FeatureForm.js +1 -1
  483. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.d.ts +1 -1
  484. package/widgets/FeatureTemplates/TemplateItem.d.ts +1 -1
  485. package/widgets/FeatureTemplates/types.d.ts +1 -1
  486. package/widgets/Features.d.ts +3 -5
  487. package/widgets/Print/CustomTemplate.d.ts +3 -4
  488. package/widgets/Print/TemplateOptions.d.ts +3 -4
  489. package/widgets/Print/types.d.ts +3 -4
  490. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  491. package/widgets/Sketch/support/OperationHandle.js +1 -1
  492. package/widgets/TimeSlider.js +1 -1
  493. package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +1 -1
  494. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  495. package/widgets/support/dateUtils.js +1 -1
  496. package/assets/esri/core/workers/chunks/0099f4729c94c779ba35.js +0 -1
  497. package/assets/esri/core/workers/chunks/058fb2cd6387acfd458c.js +0 -1
  498. package/assets/esri/core/workers/chunks/0ae018098906d6a88904.js +0 -1
  499. package/assets/esri/core/workers/chunks/0dc3a04ce717b7ddd957.js +0 -1
  500. package/assets/esri/core/workers/chunks/0e5cd0cf6ab7cb37d723.js +0 -1
  501. package/assets/esri/core/workers/chunks/0ee407b8db5c07a00d82.js +0 -1
  502. package/assets/esri/core/workers/chunks/10373885604655f673df.js +0 -1
  503. package/assets/esri/core/workers/chunks/13d61d34e55c80e4ecdf.js +0 -1
  504. package/assets/esri/core/workers/chunks/17dea03fc4eb414f0022.js +0 -1
  505. package/assets/esri/core/workers/chunks/1967239713b58dccfd81.js +0 -1
  506. package/assets/esri/core/workers/chunks/1ab98591d2f2bc604505.js +0 -1
  507. package/assets/esri/core/workers/chunks/1b838638e66e82d76cf3.js +0 -1
  508. package/assets/esri/core/workers/chunks/1c350a2c4014146dbcd9.js +0 -1
  509. package/assets/esri/core/workers/chunks/2266a8f2c2ec37c19bb4.js +0 -1
  510. package/assets/esri/core/workers/chunks/226acd251ad7d7ee3b57.js +0 -1
  511. package/assets/esri/core/workers/chunks/22b07c54a5fcc27771b0.js +0 -1
  512. package/assets/esri/core/workers/chunks/22ca80f491e070b2a5e7.js +0 -1
  513. package/assets/esri/core/workers/chunks/22dd5cecc7e2d4d0baf8.js +0 -316
  514. package/assets/esri/core/workers/chunks/2402d305a77fef4694a0.js +0 -1
  515. package/assets/esri/core/workers/chunks/27f096c434f049b8df01.js +0 -1
  516. package/assets/esri/core/workers/chunks/2a6231db5ee6cbfd59a5.js +0 -1
  517. package/assets/esri/core/workers/chunks/3371935a4fd6346d3a17.js +0 -1
  518. package/assets/esri/core/workers/chunks/3c4f8597f602779174f1.js +0 -1
  519. package/assets/esri/core/workers/chunks/3da53c017f9c5d2d778a.js +0 -1
  520. package/assets/esri/core/workers/chunks/45b898367b6224dda46f.js +0 -1
  521. package/assets/esri/core/workers/chunks/4785cd108e2dec6e1697.js +0 -1
  522. package/assets/esri/core/workers/chunks/4d6d962d25aa836f53ee.js +0 -1
  523. package/assets/esri/core/workers/chunks/4f33a2ecb154a2c2449c.js +0 -1
  524. package/assets/esri/core/workers/chunks/52726458f590e726d52c.js +0 -1
  525. package/assets/esri/core/workers/chunks/536c492fdda30f2f1288.js +0 -1
  526. package/assets/esri/core/workers/chunks/5909a0e763fddc3542e7.js +0 -2
  527. package/assets/esri/core/workers/chunks/5cee6c3ff23fb93f857a.js +0 -1
  528. package/assets/esri/core/workers/chunks/600e2e6b51e2fb9c598c.js +0 -1
  529. package/assets/esri/core/workers/chunks/6035daa65fc3ebf86515.js +0 -1
  530. package/assets/esri/core/workers/chunks/63b8cd7d5cafbaeed894.js +0 -1
  531. package/assets/esri/core/workers/chunks/6cb44cd319cb6c2539c8.js +0 -1
  532. package/assets/esri/core/workers/chunks/7033fa18b7dd7bd3e49c.js +0 -1
  533. package/assets/esri/core/workers/chunks/7306b5b66e738a281d83.js +0 -1
  534. package/assets/esri/core/workers/chunks/7694abe44d55dae8872d.js +0 -1
  535. package/assets/esri/core/workers/chunks/7f4fa2f2e85863d3cfb9.js +0 -1
  536. package/assets/esri/core/workers/chunks/8f4c480c418eba299c2b.js +0 -1
  537. package/assets/esri/core/workers/chunks/964de713042f52d71e42.js +0 -1
  538. package/assets/esri/core/workers/chunks/a3836f6a93924ee4816e.js +0 -1
  539. package/assets/esri/core/workers/chunks/ab520fd1ae917daf07d8.js +0 -1
  540. package/assets/esri/core/workers/chunks/acc7ff44bfcb5c195114.js +0 -1
  541. package/assets/esri/core/workers/chunks/ad92427bf597a6e0a299.js +0 -1
  542. package/assets/esri/core/workers/chunks/b25a131c04092c3ab75d.js +0 -1
  543. package/assets/esri/core/workers/chunks/b285de471ca90f38ec25.js +0 -1
  544. package/assets/esri/core/workers/chunks/b8f83a272fc41765031d.js +0 -1
  545. package/assets/esri/core/workers/chunks/b9909264cfea68d5f2a1.js +0 -1
  546. package/assets/esri/core/workers/chunks/bb08359610a41e304b55.js +0 -1
  547. package/assets/esri/core/workers/chunks/bcf612eabe7577540953.js +0 -1
  548. package/assets/esri/core/workers/chunks/bfbbcaa1fb04f17fc869.js +0 -1
  549. package/assets/esri/core/workers/chunks/c02b09f16241db233103.js +0 -1
  550. package/assets/esri/core/workers/chunks/c3007b916ba933137709.js +0 -1
  551. package/assets/esri/core/workers/chunks/cc5c1887e6d7079e5fe3.js +0 -1
  552. package/assets/esri/core/workers/chunks/ce8f075c814a8378c00c.js +0 -1
  553. package/assets/esri/core/workers/chunks/cfe1506a443fc84a0b91.js +0 -1
  554. package/assets/esri/core/workers/chunks/d30cfc5fa302cc08d862.js +0 -1
  555. package/assets/esri/core/workers/chunks/d723619579cc8f5ef2cd.js +0 -1
  556. package/assets/esri/core/workers/chunks/da99fd0d3106dd357743.js +0 -1
  557. package/assets/esri/core/workers/chunks/de71db3b0fb947b13c97.js +0 -1
  558. package/assets/esri/core/workers/chunks/dfbbead4c24d13682891.js +0 -1
  559. package/assets/esri/core/workers/chunks/e69255e38ff200dda14b.js +0 -1
  560. package/assets/esri/core/workers/chunks/e705d041f6c1632bfbcc.js +0 -1
  561. package/assets/esri/core/workers/chunks/e85da52d9cc7d9396872.js +0 -1
  562. package/assets/esri/core/workers/chunks/ee186ddbb1eb5144a790.js +0 -1
  563. package/assets/esri/core/workers/chunks/f9370830051865a3435b.js +0 -1
  564. package/core/MultiOriginJSONSupport.d.ts +0 -13
  565. package/core/NumericIdentifiable.d.ts +0 -6
  566. package/core/ReadOnlyMultiOriginJSONSupport.d.ts +0 -6
  567. package/core/WriteableMultiOriginJSONMixin.d.ts +0 -6
  568. package/layers/knowledgeGraph/KnowledgeGraphSublayerBase.d.ts +0 -6
  569. package/layers/mixins/ArcGISService.d.ts +0 -6
  570. package/layers/mixins/RasterJobHandlerMixin.d.ts +0 -6
  571. package/layers/support/RasterFunctionProperties.d.ts +0 -2
  572. package/layers/support/domains.d.ts +0 -5
  573. package/layers/support/editableLayers.d.ts +0 -11
  574. package/layers/support/exifUtils.d.ts +0 -21
  575. package/layers/support/fieldFormatUtils.d.ts +0 -4
  576. package/layers/support/fieldType.d.ts +0 -2
  577. package/layers/support/layerUtils.d.ts +0 -4
  578. package/layers/support/wmtsUtils.d.ts +0 -2
  579. package/layers/video/videoUtils.d.ts +0 -5
  580. package/rest/geometryService/cut.d.ts +0 -7
  581. package/rest/geometryService/fromGeoCoordinateString.d.ts +0 -28
  582. package/rest/geometryService/toGeoCoordinateString.d.ts +0 -25
  583. package/rest/operations/generalize.d.ts +0 -3
  584. package/rest/support/DateBinUtils.d.ts +0 -2
  585. package/rest/support/colorRamps.d.ts +0 -6
  586. package/rest/support/fileFormat.d.ts +0 -4
  587. package/rest/support/layoutTemplate.d.ts +0 -2
  588. package/rest/support/reportTemplate.d.ts +0 -2
  589. package/views/2d/layers/LayerView2D.d.ts +0 -6
  590. package/views/Viewport2DBaseMixin.d.ts +0 -6
  591. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +0 -5
  592. package/views/layers/RefreshableLayerView.d.ts +0 -6
  593. package/widgets/Feature/support/FeatureContentMixin.d.ts +0 -6
  594. /package/layers/video/{IVideoController.d.ts → types.d.ts} +0 -0
  595. /package/layers/{support/wmsUtils.d.ts → wms/types.d.ts} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{neverReached as n}from"../../core/compilerUtils.js";import{EventedAccessor as s}from"../../core/Evented.js";import i from"../../core/Logger.js";import{destroyMaybe as o}from"../../core/maybe.js";import{EsriPromiseMixin as r}from"../../core/Promise.js";import{debounce as a}from"../../core/promiseUtils.js";import{watch as l,syncAndInitial as u,whenOnce as p,on as c}from"../../core/reactiveUtils.js";import{templateHasKey as h}from"../../core/string.js";import{property as d,subclass as f}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as m}from"../../core/support/UpdatingHandles.js";import y from"../../form/FormTemplate.js";import{isUtilityNetworkAssociationsElement as g,isGroupElement as _,isFieldElement as v,isRelationshipElement as I,isTextElement as x}from"../../form/support/formUtils.js";import E from"../../layers/support/ContingentValue.js";import{isEditableLayer as C}from"../../layers/support/editableLayers.js";import F from"../../layers/support/LayerContingentValuesCache.js";import b from"../../rest/networks/support/Association.js";import{utc as V,unknown as w,system as A}from"../../time/constants.js";import{flattenAssociationInputs as j,flattenFieldInputs as T,isGroupInput as M,flattenRelationshipInputs as k,parseFormTemplateString as N,isRelationshipInput as S,isFieldInput as L,isTextElementInput as R,getNormalizedFeatureTypeInfo as U,valueIsValidContingentValue as Z}from"./featureFormUtils.js";import H from"./FieldInput.js";import{FormExpressionsManager as P}from"./FormExpressionsManager.js";import O from"./GroupInput.js";import W from"./RelationshipInput.js";import G from"./TextElementInput.js";import{createFormExpressionArcadeExecutor as $}from"../support/forms/expressions/FormExpressionArcadeExecutor.js";const D=new t({attributes:{}}),z={field:["editableExpression","requiredExpression","valueExpression","visibilityExpression"],group:["visibilityExpression"],relationship:["editableExpression","visibilityExpression"],text:["visibilityExpression"],utilityNetworkAssociations:["editableExpression","visibilityExpression"]},J="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",B="#JSAPI_CONTINGENT_VALUE_ANY_HASH",K="#JSAPI_CONTINGENT_VALUE_NULL_HASH";let Y=class extends(r(s)){constructor(e){super(e),this._expressionExecutorsInUse=new Set,this._expressionExecutorLookup=new Map,this._expressionsManager=null,this._contingentValuesCache=null,this._featureClone=D.clone(),this._initialFeature=D.clone(),this._timeZone=null,this._updatingHandles=new m,this.activeAssociation=null,this.editType="NA",this.contingencyConstraintViolations=new Map,this.disabled=!1,this.highlightHelper=null,this.inputs=[],this.map=null,this.callbacks=null,this.strict=!1,this.pendingSubtypeChoice=null,this._updateInputs=a(async()=>{this._stopExpressions();const{_featureClone:e,_initialFeature:t,editType:n,formTemplate:s,inputs:i,layer:o,timeZone:r}=this;if(!o)return;const a={editType:n,feature:e,initialFeature:t,layer:o,timeZone:r},l=i.slice(),u=s?.elements&&s.elements.length>0?await this._updateInputsUsingFormElements(l,s.elements,a):this._updateInputsUsingLayerFields(l,o?.fields,a);this.inputs=u,this._startExpressions()})}initialize(){const e=l(()=>[this.layer,!!this.layer?.loaded,this.formTemplate,this._initialFeature,this.timeZone,this.editType],([e,t])=>{null!=e&&(t?this._updatingHandles.addPromise(this._updateInputs()):e.load().catch(()=>{}))},u),t=l(()=>this._arcadeContextInfo,e=>{null!=this._expressionsManager&&(this._expressionsManager.arcadeContextInfo=e,this._evaluateExpressions(e=>e.evaluateAll()))}),n=l(()=>this.layer,e=>{const t="subtype-sublayer"===e?.type?e.parent:"feature"===e?.type?e:null;t&&this.addResolvingPromise(F.createLoadedLayerContingentValuesCache(t).then(e=>{this._contingentValuesCache=e,this.notifyChange("fieldsWithContingentValues")}))},{initial:!0});this.addHandles([e,t,n])}destroy(){this.feature=null,this.layer=null,this._contingentValuesCache=o(this._contingentValuesCache),this.highlightHelper?.removeAll(),this._updatingHandles.destroy()}get _expressionInfosLookup(){return new Map(this.formTemplate?.expressionInfos?.map(e=>[e.name,e]))}get activeAssociationInput(){return this.allAssociationInputs.find(e=>e.uid===this.associationId)}get activeRelationshipInput(){return this.allRelationshipInputs.find(e=>e.relationshipId===this.relationshipId||e.activeCategory||e.showAllEnabled)}get _arcadeContextInfo(){const{_initialFeature:e,editType:t,layer:n,map:s,spatialReference:i,timeZone:o}=this;return{layer:C(n)?n:null,originalFeature:e,editType:t,map:s,spatialReference:i,timeZone:o}}get associationId(){return this._get("associationId")}set associationId(e){null==e&&this.activeAssociationInput?.viewModel&&(this.activeAssociationInput.associatedLayer=null,this.activeAssociationInput.viewModel.activeAssociationType=null),this._set("associationId",e)}get associatedLayer(){return this.activeAssociationInput?.associatedLayer}set associatedLayer(e){this.activeAssociationInput&&(this.activeAssociationInput.associatedLayer=e)}get allAssociationInputs(){return j(this.inputs)}get allFieldInputs(){return T(this.inputs)}get allGroupInputs(){return this.inputs.filter(M)}get allRelationshipInputs(){return k(this.inputs)}get _layerFieldsByName(){return new Map(this.layer?.fields.map(e=>[e.name,e]))}get feature(){return this._get("feature")}set feature(e){const t=this._get("feature");e!==t&&(this._featureClone=e?.clone()??D.clone(),this._expressionsManager&&(this._expressionsManager.feature=this._featureClone),e?(this._resetFieldInputValues(this._featureClone),this.allRelationshipInputs.forEach(t=>t.feature=e)):(this.inputs.forEach(e=>e.destroy()),this.inputs.length=0),t!==e&&(this.pendingSubtypeChoice=null),this.contingencyConstraintViolations.clear(),this._set("feature",e),this._initialFeature=this._featureClone.clone())}get fieldsWithContingentValues(){if(null==this._contingentValuesCache)return new Set;const e=this._contingentValuesCache.fieldGroups.flatMap(e=>e.fields);return new Set(e)}get formTemplate(){return this.layer&&"formTemplate"in this.layer?this.layer.formTemplate:null}set formTemplate(e){this._overrideIfSome("formTemplate",e)}get formDescription(){const{formTemplate:e,layer:t}=this;return e?.description&&t?N({attributes:this.getValues(),label:e.description,layer:t,timeZone:this.timeZone}):null}get formTitle(){const{formTemplate:e,layer:t}=this;return e?.title&&t?N({attributes:this.getValues(),label:e.title,layer:t,timeZone:this.timeZone}):null}get formHeaderVisible(){const{activeRelationshipInput:e,activeAssociationInput:t,formDescription:n,formTitle:s}=this;return!(e||t||!n&&!s)}get joinedContingentValues(){return this._joinContingentValues()}get layer(){const e=this._initialFeature;return e?.sourceLayer&&"applyEdits"in e.sourceLayer?e.sourceLayer:null}set layer(e){this._override("layer",e)}get relationshipId(){return this._get("relationshipId")}set relationshipId(e){const t=this.allRelationshipInputs;if(null!=e&&e===this.relationshipId||t.forEach(e=>{e.showAllEnabled=!1,e.activeCategory=null}),null!=e){const n=t.find(t=>t.relationshipId===e);n&&(n.showAllEnabled=!0)}this._set("relationshipId",e)}get spatialReference(){return this.layer?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.layer?.loaded?"ready":"disabled"}get submittable(){return!!this.valid||this.allFieldInputs.filter(e=>!e.valid).every(({submittable:e})=>e)}get timeZone(){const{layer:e}=this;if(e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone)return V;const t=e&&"preferredTimeZone"in e&&e.preferredTimeZone;return this._timeZone===w?t||V:this._timeZone||A}set timeZone(e){this._timeZone=e}get updating(){return this._updatingHandles.updating}get valid(){const e=this.allFieldInputs;return e.length>0&&e.every(({valid:e})=>e)}findField(e){return this.allFieldInputs.find(t=>t.name===e)}findGroup(e){return this.allGroupInputs.find(t=>t.id===e)}getFieldValueOptionsForField(e,t){const n=this.findField(e);if(!n)return[[],[],[]];const s="coded-value"===n.domain?.type?n.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[],i=null==n.value||s.some(e=>e.value===n.value)?[]:[{name:`${n.value}`,value:n.value}],o=this.fieldsWithContingentValues.has(e)?this._getContingentValueOptionsForField(e,t):[];if(o.length>0){const e=new Set(o.map(e=>e.value));return[o,s.filter(t=>!e.has(t.value)),i]}return[s,[],i]}getValue(e){const t=this.layer?.getField(e);if(null!=t)return this._featureClone.getAttribute(t.name)??null}setValue(e,t){const{_featureClone:n,strict:s}=this,i=this.findField(e);t=""===t?null:t,i&&n.getAttribute(e)!==t&&(i.value=t,s&&!i.valid||(this._afterValueChange(i),this._evaluateExpressions(t=>t.evaluateInvalidated([e]))))}getValues(){return{...this._featureClone.attributes}}overrideInitialFeature(e){this._initialFeature=e}submit(){const e=this.allFieldInputs,t=new Set(e.filter(e=>e.valid).map(({name:e})=>e)),n=e.filter(e=>!e.valid).map(({name:e})=>e),s=this.getValues();if(this.validateContingencyConstraints(s,{includeIncompleteViolations:!0}).length>0)for(const[i,o]of this.contingencyConstraintViolations.entries())"error"===o.type&&(t.delete(i),n.push(i));this.notifyChange("submittable"),this.notifyChange("valid"),this.emit("submit",{valid:[...t],invalid:n,values:s})}validateContingencyConstraints(e,t){const{_contingentValuesCache:n}=this,s=new Map;if(this.contingencyConstraintViolations=s,null==n)return[];const{invalid:i,incomplete:o}=n.validateContingencyConstraints(e),r=[...i,...t?.includeIncompleteViolations?o:[]];for(const a of r)for(const e of a.fieldGroup.fields)s.set(e,a);return r}notifyFeatureGeometryChanged(){const{feature:e,_featureClone:t}=this;e&&(t.geometry=e.geometry,this._evaluateExpressions(e=>e.evaluateInvalidatedByGeometry()))}applySubtypeDefaults(e){const{defaultValues:t}=e,{allFieldInputs:n}=this;for(const{name:s}of n){const e=t[s];null!=e&&this.setValue(s,e)}}_emitChangeEvent({name:e,valid:t,value:n}){this.emit("value-change",{layer:this.layer,feature:this.feature,fieldName:e,value:n,valid:t})}_evaluateExpressions(e){const t=this._expressionsManager;null!=t&&this._updatingHandles.addPromise(e(t).finally(()=>this._afterExpressionsEvaluated()))}async _updateInputsUsingFormElements(e,t,n){const s=new Map;for(const r of e)if(M(r)){s.set(r.element,r);for(const e of r.inputs)e.element&&s.set(e.element,e)}else r.element&&s.set(r.element,r);const i=new Map,o=await this._updateInputsUsingFormElementsRecursive({existingInputsByElement:s,updatedElements:t.filter(e=>this._isSupportedElement(e)),sharedInitializationProperties:n,group:null,newExpressionExecutorPromises:i});for(const[r,a]of s.entries())s.delete(r),a.destroy();return await Promise.all(Array.from(i.values())),o}async _updateInputsUsingFormElementsRecursive(e){const{existingInputsByElement:t,updatedElements:n,sharedInitializationProperties:s,group:i,newExpressionExecutorPromises:o}=e,r=[];for(const a of n){const e=t.has(a),n=e?t.get(a):g(a)?await this._makeUtilityNetworkAssociationInputFromElement(a,s,i):this._makeInputFromElement(a,s,i);if(n){if(r.push(n),await p(()=>!n.updating),this._assignExpressionExecutors(n,a,o),e)if(t.delete(a),M(n)){const{feature:e,timeZone:t}=s;n.set({feature:e,timeZone:t})}else if(S(n)){const e=this.relationshipId===a.relationshipId;n.set(s),n.set({map:this.map,showAllEnabled:e})}else g(n)?(n.set(s),n.set({map:this.map})):n.set(s);if(_(a)){const e=a.elements.filter(e=>this._isSupportedElement(e));n.inputs=await this._updateInputsUsingFormElementsRecursive({existingInputsByElement:t,updatedElements:e,sharedInitializationProperties:s,group:n,newExpressionExecutorPromises:o})}}}return r}_updateInputsUsingLayerFields(e,t,n){if(!Array.isArray(t))return i.getLogger(this).warn(this.declaredClass,"No attribute fields found."),[];const s=new Map;for(const i of e)if(M(i)){for(const e of i.inputs)e.destroy();i.inputs.length=0,i.destroy()}else S(i)?i.destroy():L(i)&&(null!==i.element?i.destroy():s.set(i.field,i));const o=[];for(const i of t){const e=n.feature?.getAttribute(i.name)??null,t=s.get(i)??new H({field:i,preservesValueWhenHidden:this.formTemplate?.preserveFieldValuesWhenHidden});o.push(t.set({...n,value:e})),s.delete(i)}for(const[i,r]of s.entries())s.delete(i),r.destroy();return o}_resetFieldInputValues(e){for(const t of this.allFieldInputs)t.value=e.getAttribute(t.name)??null}_makeInputFromElement(e,t,s){return _(e)?q(e,t):v(e)?this._makeFieldInputFromElement(e,t,s):I(e)?this._makeRelationshipInputFromElement(e,t,s):g(e)?this._makeUtilityNetworkAssociationInputFromElement(e,t,s):x(e)?Q(e,t):g(e)?this._makeUtilityNetworkAssociationInputFromElement(e,t,s):n()}_makeFieldInputFromElement(e,t,n){const{editType:s,feature:i,initialFeature:o,layer:r,timeZone:a}=t,{fieldName:l}=e,u=l&&this._layerFieldsByName.get(l);return u?new H({editType:s,element:e,field:u,value:i?.getAttribute(e.fieldName)??null,feature:i,initialFeature:o,layer:r,group:n,preservesValueWhenHidden:this.formTemplate?.preserveFieldValuesWhenHidden,timeZone:a}):null}_makeRelationshipInputFromElement(e,t,n=null){const{map:s}=this,{feature:i,layer:o,timeZone:r}=t,a=new W({element:e,feature:i,group:n,layer:o,map:s,timeZone:r});return a.addHandles(c(()=>a.relatedLayer,"edits",()=>this._evaluateExpressions(e=>e.evaluateAsyncExpressions()))),a}async _makeUtilityNetworkAssociationInputFromElement(e,t,n=null){const{map:s}=this,{feature:i,layer:o,timeZone:r}=t;return new(0,(await import("./UtilityNetworkAssociationInput.js")).default)({element:e,feature:i,group:n,layer:o,map:s,timeZone:r})}_assignExpressionExecutors(e,t,n){const s=z[t.type],i=[];for(const o of s){const s=`${o}Executor`;if(e[s]){this._useExecutor(e[s]);continue}const r=t[o];if(null!=r&&""!==r){const t=this._expressionInfosLookup.get(r)?.expression??r;i.push(this._getOrCreateExecutorForExpression(t,n).then(t=>{e[s]=this._useExecutor(t)}))}}return R(e)&&i.push(...this._assignTextElementExpressionExecutors(e,n)),i}_assignTextElementExpressionExecutors(e,t){const{_expressionInfosLookup:n}=this,s=[];for(const o of e.expressionsUsed){const r=n.get(o);null!=r?s.push(this._getOrCreateExecutorForExpression(r.expression,t).then(t=>e.setExpressionExecutor(o,this._useExecutor(t)))):i.getLogger(this).error("feature-form:expression-not-found",`Could not find expressionInfo object with name '${o}'`)}for(const i of e.fieldsUsed){const n=`return $feature['${i}'];`;s.push(this._getOrCreateExecutorForExpression(n,t).then(t=>e.setFieldExecutor(i,this._useExecutor(t))))}return s}async _getOrCreateExecutorForExpression(e,t){const{_expressionExecutorLookup:n}=this;if(n.has(e))return n.get(e);if(t.has(e))return t.get(e);const s=$(e,this.layer);t.set(e,s);const i=await s;return n.set(e,i),i}_createExpressionsManager(e){const{_arcadeContextInfo:t,_featureClone:n,allFieldInputs:s,formTemplate:i}=this;this._expressionsManager=new P({executors:e,feature:n,arcadeContextInfo:t,fieldInputs:s,preserveFieldValuesWhenHidden:!0===i?.preserveFieldValuesWhenHidden})}_startExpressions(){if(0===this._expressionExecutorsInUse.size)return;const e=Array.from(this._expressionExecutorsInUse);this._createExpressionsManager(e),this._evaluateExpressions(e=>e.evaluateAll())}_stopExpressions(){this._expressionsManager=o(this._expressionsManager),this._expressionExecutorsInUse.clear()}_useExecutor(e){return this._expressionExecutorsInUse.add(e),e}_afterValueChange(e){const{name:t,value:n}=e,{_featureClone:s,formTemplate:i,layer:o}=this;if(!o)return;const r=s.getAttribute(t);s.setAttribute(t,n);const{typeFieldName:a,types:l}=U(o);if((e.isSubtypeField||t===a)&&n!==r){if("subtype-sublayer"===o.type){const e=o.parent?.findSublayerForFeature(s);e&&(this.feature&&(this.feature.sourceLayer=e),s.sourceLayer=e,this._initialFeature.sourceLayer=e)}const e=new Set;for(const t of l)if(t.domains&&"object"==typeof t.domains)for(const n of Object.keys(t.domains))e.add(n);for(const t of e){const e=this.findField(t);e&&e.notifyChange("domain")}this.notifyChange("joinedContingentValues")}if(null!=i){const{description:e,title:n}=i;n&&h(n,t)&&this.notifyChange("formTitle"),e&&h(e,t)&&this.notifyChange("formDescription")}this._emitChangeEvent(e)}_afterExpressionsEvaluated(){const{_featureClone:e}=this;for(const t of this.allFieldInputs)t.value!==e.getAttribute(t.name)&&this._afterValueChange(t)}_joinContingentValues(){const e=this._contingentValuesCache;if(null==e)return[];const{typeFieldName:t}=U(this.layer),n=t?this.getValue(t):null,s=[];for(const r of e.fieldGroups){const{contingencies:e,fields:t,name:i}=r,o=[];for(const s of e)s.isRetired||null!=s.subtype&&s.subtype.code!==n||o.push({values:s.values});o.length>0&&s.push({name:i,fields:t,contingencies:o})}const[i,o]=this._generateJoinPlan(s);return[...i.flatMap(e=>this._joinFieldGroupContingencies(e)),...o.flatMap(e=>e.contingencies)]}_generateJoinPlan(e){const t=new Map,n=[],s=new Set;for(const l of e)for(const e of l.fields)if(t.has(e)){const i=t.get(e),o=l,r=[i.name,o.name].sort().join("|");if(s.has(r))continue;n.push([i,o]),s.add(r),t.set(e,o)}else t.set(e,l);const i=new Set(n.flat()),o=new Set(e);for(const l of i)o.delete(l);const r=new Map,a=new Map;for(const l of new Set(n.flat())){const e=Symbol(l.name);r.set(e,new Set([l])),a.set(l,e)}for(const[l,u]of n){const e=a.get(l),t=a.get(u);if(e===t)continue;const n=r.get(e),s=r.get(t);for(const i of s)n.add(i),a.set(i,e);r.delete(t)}return[[...r.values()].map(e=>[...e]),[...o]]}_joinFieldGroupContingencies(e){const t=e.slice(),n=t.shift();let s=t.shift(),i=this._generateJoinKey(n.fields,s.fields),o=new Set([...n.fields,...s.fields]),r=new Map;for(const l of n.contingencies){const[e]=this._hashContingency(l,i.codedValueFields,!0);r.has(e)?r.get(e)?.push(l):r.set(e,[l])}for(;t.length>0;){const e=new Map,n=t.shift(),a=this._generateJoinKey(o,n.fields);for(const t of s.contingencies){const[n,s]=this._hashContingency(t,i.codedValueFields),o=s?this._findMatchingContingenciesWithAnyHashMask(r,n):r.get(n);if(r.has(B)&&o?.push(...this._findMatchingContingenciesContainingAny(t,r.get(B),i.codedValueFields)),null!=o)for(const r of o){const n=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(r,t,i.rangeFields):this._joinContingencies(r,t);if(null==n)break;const[s]=this._hashContingency(n,a.codedValueFields,!0);e.has(s)?e.get(s)?.push(n):e.set(s,[n])}}r=e,s=n,i=a,o=new Set([...o,...s.fields])}const a=[];for(const l of s.contingencies){const[e,t]=this._hashContingency(l,i.codedValueFields),n=t?this._findMatchingContingenciesWithAnyHashMask(r,e):r.get(e);if(r.has(B)&&n.push(...this._findMatchingContingenciesContainingAny(l,r.get(B),i.codedValueFields)),null!=n)for(const s of n){const e=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(s,l,i.rangeFields):this._joinContingencies(s,l);null!=e&&a.push(e)}}return a}_joinContingencies(e,t){const n={values:{...e.values,...t.values}};for(const[s,i]of Object.entries(n.values))"any"===i.objectType&&null!=e.values[s]&&(n.values[s]=e.values[s]);return n}_joinContingenciesWithRangeDomains(e,t,n){const s=this._joinContingencies(e,t);for(const i of n){const n=e.values[i],o=t.values[i],{leftIsNull:r,rightIsNull:a,bothAreNull:l,leftIsAny:u,rightIsAny:p,bothAreAny:c,leftIsRange:h,rightIsRange:d}=this._compareObjectTypes(n.objectType,o.objectType);if(l||c)continue;if(r&&p||a&&u){s.values[i]=new E({objectType:"null"});continue}if(r&&d||a&&h)return null;u?(n.minValue=-1/0,n.maxValue=1/0):p&&(o.minValue=-1/0,o.maxValue=1/0);const f=Math.max(n.minValue,o.minValue),m=Math.min(n.maxValue,o.maxValue);if(f>m)return null;s.values[i]=new E({objectType:"range",minValue:f,maxValue:m})}return s}_findMatchingContingenciesContainingAny(e,t,n){return t.filter(t=>n.every(n=>{const s=t.values[n],i=e.values[n];return"any"===s.objectType||"any"===i.objectType||s.codedValue?.code===i.codedValue?.code}))}_findMatchingContingenciesWithAnyHashMask(e,t){const n=new RegExp(`${t}$`),s=[];for(const[i,o]of e){if(i===B)break;n.test(i)&&s.push(...o)}return s}_generateJoinKey(e,t){const n=Array.isArray(e)?new Set(e):e,s=Array.isArray(t)?new Set(t):t,i=n.size<s.size?n:s,o=i===n?s:n,{feature:r}=this,a=new Set,l=new Set;for(const u of i)if(o.has(u)){const e=this.layer?.getFieldDomain(u,{feature:r??void 0,excludeImpliedDomains:!0});if(null==e)continue;switch(e.type){case"coded-value":a.add(u);break;case"range":l.add(u)}}return{codedValueFields:[...a],rangeFields:[...l]}}_contingencyIsValid(e,t){const n={};for(const{name:s,value:i}of this.allFieldInputs)this.fieldsWithContingentValues.has(s)&&null!=i&&s!==e&&(n[s]=i);return Object.entries(n).every(([e,n])=>!t.values.hasOwnProperty(e)||Z(n,t.values[e]))}_getContingentValueOptionsForField(e,t){const n=this.joinedContingentValues.slice(),s=new Map,i={code:"",name:t??"No value"};for(const o of n){const t=o.values[e];if("code"===t?.objectType||"null"===t?.objectType){const{code:n,name:r}=t.codedValue&&"null"!==t.objectType?t.codedValue:i;!s.has(n)&&this._contingencyIsValid(e,o)&&s.set(n,{name:r,value:n})}}return[...s.values()]}_hashContingency(e,t,n=!1){if(t.length<1)return[J,!1];const s=[];let i=!1;for(const o of t){const t=e.values[o];if("any"===t.objectType){if(n)return[B,!0];i=!0,s.push(`${o}:.*`)}else"null"===t.objectType?s.push(`${o}:${K}`):s.push(`${o}:${t.codedValue?.code}`)}return[s.sort().join("&"),i]}_compareObjectTypes(e,t){return{leftIsNull:"null"===e,rightIsNull:"null"===t,bothAreNull:"null"===e&&"null"===t,leftIsAny:"any"===e,rightIsAny:"any"===t,bothAreAny:"any"===e&&"any"===t,leftIsRange:"range"===e,rightIsRange:"range"===t}}_isSupportedElement(e){return"field"===e.type||"group"===e.type||"relationship"===e.type||"text"===e.type||"utilityNetworkAssociations"===e.type||(i.getLogger(this).warn("form-info::unsupported-element-type","Only element types 'field', 'group' and 'relationship' are supported",`Element ${e.label} has unsupported type '${e.type}'`),!1)}get test(){return{featureClone:this._featureClone}}};function q(e,t){const{feature:n,layer:s}=t;return new O({element:e,inputs:[],feature:n,layer:s})}function Q(e,t,n=null){const{feature:s,layer:i,timeZone:o}=t;return new G({element:e,feature:s,group:n,layer:i,timeZone:o})}e([d()],Y.prototype,"_expressionInfosLookup",null),e([d()],Y.prototype,"_featureClone",void 0),e([d()],Y.prototype,"_initialFeature",void 0),e([d()],Y.prototype,"_timeZone",void 0),e([d({type:b})],Y.prototype,"activeAssociation",void 0),e([d()],Y.prototype,"activeAssociationInput",null),e([d()],Y.prototype,"activeRelationshipInput",null),e([d()],Y.prototype,"_arcadeContextInfo",null),e([d()],Y.prototype,"associationId",null),e([d()],Y.prototype,"associatedLayer",null),e([d()],Y.prototype,"allAssociationInputs",null),e([d()],Y.prototype,"allFieldInputs",null),e([d()],Y.prototype,"allGroupInputs",null),e([d()],Y.prototype,"allRelationshipInputs",null),e([d()],Y.prototype,"_layerFieldsByName",null),e([d()],Y.prototype,"editType",void 0),e([d()],Y.prototype,"contingencyConstraintViolations",void 0),e([d()],Y.prototype,"disabled",void 0),e([d()],Y.prototype,"feature",null),e([d()],Y.prototype,"fieldsWithContingentValues",null),e([d({type:y})],Y.prototype,"formTemplate",null),e([d()],Y.prototype,"formDescription",null),e([d()],Y.prototype,"formTitle",null),e([d()],Y.prototype,"formHeaderVisible",null),e([d()],Y.prototype,"highlightHelper",void 0),e([d()],Y.prototype,"inputs",void 0),e([d()],Y.prototype,"joinedContingentValues",null),e([d()],Y.prototype,"layer",null),e([d()],Y.prototype,"map",void 0),e([d()],Y.prototype,"callbacks",void 0),e([d()],Y.prototype,"relationshipId",null),e([d()],Y.prototype,"spatialReference",null),e([d()],Y.prototype,"state",null),e([d()],Y.prototype,"strict",void 0),e([d()],Y.prototype,"submittable",null),e([d()],Y.prototype,"timeZone",null),e([d()],Y.prototype,"updating",null),e([d()],Y.prototype,"valid",null),e([d()],Y.prototype,"pendingSubtypeChoice",void 0),e([d()],Y.prototype,"getValues",null),e([d()],Y.prototype,"submit",null),e([d()],Y.prototype,"test",null),Y=e([f("esri.widgets.FeatureForm.FeatureFormViewModel")],Y);const X=Y;export{X as default};
5
+ import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{EventedAccessor as n}from"../../core/Evented.js";import s from"../../core/Logger.js";import{destroyMaybe as i}from"../../core/maybe.js";import{EsriPromiseMixin as o}from"../../core/Promise.js";import{debounce as r}from"../../core/promiseUtils.js";import{watch as a,syncAndInitial as l,whenOnce as u,on as p}from"../../core/reactiveUtils.js";import{templateHasKey as c}from"../../core/string.js";import{property as h,subclass as d}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import m from"../../form/FormTemplate.js";import{isUtilityNetworkAssociationsElement as y,isGroupElement as g,isFieldElement as _,isRelationshipElement as v,isTextElement as I}from"../../form/support/formUtils.js";import x from"../../layers/support/ContingentValue.js";import{isEditableLayer as E}from"../../layers/support/editableLayers.js";import C from"../../layers/support/LayerContingentValuesCache.js";import F from"../../rest/networks/support/Association.js";import{utc as b,unknown as V,system as w}from"../../time/constants.js";import{flattenAssociationInputs as A,flattenFieldInputs as j,isGroupInput as T,flattenRelationshipInputs as M,parseFormTemplateString as k,isRelationshipInput as N,isFieldInput as S,isTextElementInput as L,getNormalizedFeatureTypeInfo as R,valueIsValidContingentValue as U}from"./featureFormUtils.js";import Z from"./FieldInput.js";import{FormExpressionsManager as H}from"./FormExpressionsManager.js";import P from"./GroupInput.js";import O from"./RelationshipInput.js";import W from"./TextElementInput.js";import{createFormExpressionArcadeExecutor as G}from"../support/forms/expressions/FormExpressionArcadeExecutor.js";const $=new t({attributes:{}}),D={field:["editableExpression","requiredExpression","valueExpression","visibilityExpression"],group:["visibilityExpression"],relationship:["editableExpression","visibilityExpression"],text:["visibilityExpression"],utilityNetworkAssociations:["editableExpression","visibilityExpression"]},z="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",J="#JSAPI_CONTINGENT_VALUE_ANY_HASH",B="#JSAPI_CONTINGENT_VALUE_NULL_HASH";let K=class extends(o(n)){constructor(e){super(e),this._expressionExecutorsInUse=new Set,this._expressionExecutorLookup=new Map,this._expressionsManager=null,this._contingentValuesCache=null,this._featureClone=$.clone(),this._initialFeature=$.clone(),this._timeZone=null,this._updatingHandles=new f,this.activeAssociation=null,this.editType="NA",this.contingencyConstraintViolations=new Map,this.disabled=!1,this.highlightHelper=null,this.inputs=[],this.map=null,this.callbacks=null,this.strict=!1,this.pendingSubtypeChoice=null,this._updateInputs=r(async()=>{this._stopExpressions();const{_featureClone:e,_initialFeature:t,editType:n,formTemplate:s,inputs:i,layer:o,timeZone:r}=this;if(!o)return;const a={editType:n,feature:e,initialFeature:t,layer:o,timeZone:r},l=i.slice(),u=s?.elements&&s.elements.length>0?await this._updateInputsUsingFormElements(l,s.elements,a):this._updateInputsUsingLayerFields(l,o?.fields,a);this.inputs=u,this._startExpressions()})}initialize(){const e=a(()=>[this.layer,!!this.layer?.loaded,this.formTemplate,this._initialFeature,this.timeZone,this.editType],([e,t])=>{null!=e&&(t?this._updatingHandles.addPromise(this._updateInputs()):e.load().catch(()=>{}))},l),t=a(()=>this._arcadeContextInfo,e=>{null!=this._expressionsManager&&(this._expressionsManager.arcadeContextInfo=e,this._evaluateExpressions(e=>e.evaluateAll()))}),n=a(()=>this.layer,e=>{const t="subtype-sublayer"===e?.type?e.parent:"feature"===e?.type?e:null;t&&this.addResolvingPromise(C.createLoadedLayerContingentValuesCache(t).then(e=>{this._contingentValuesCache=e,this.notifyChange("fieldsWithContingentValues")}))},{initial:!0});this.addHandles([e,t,n])}destroy(){this.feature=null,this.layer=null,this._contingentValuesCache=i(this._contingentValuesCache),this.highlightHelper?.removeAll(),this._updatingHandles.destroy()}get _expressionInfosLookup(){return new Map(this.formTemplate?.expressionInfos?.map(e=>[e.name,e]))}get activeAssociationInput(){return this.allAssociationInputs.find(e=>e.uid===this.associationId)}get activeRelationshipInput(){return this.allRelationshipInputs.find(e=>e.relationshipId===this.relationshipId||e.activeCategory||e.showAllEnabled)}get _arcadeContextInfo(){const{_initialFeature:e,editType:t,layer:n,map:s,spatialReference:i,timeZone:o}=this;return{layer:E(n)?n:null,originalFeature:e,editType:t,map:s,spatialReference:i,timeZone:o}}get associationId(){return this._get("associationId")}set associationId(e){null==e&&this.activeAssociationInput?.viewModel&&(this.activeAssociationInput.associatedLayer=null,this.activeAssociationInput.viewModel.activeAssociationType=null),this._set("associationId",e)}get associatedLayer(){return this.activeAssociationInput?.associatedLayer}set associatedLayer(e){this.activeAssociationInput&&(this.activeAssociationInput.associatedLayer=e)}get allAssociationInputs(){return A(this.inputs)}get allFieldInputs(){return j(this.inputs)}get allGroupInputs(){return this.inputs.filter(T)}get allRelationshipInputs(){return M(this.inputs)}get _layerFieldsByName(){return new Map(this.layer?.fields.map(e=>[e.name,e]))}get feature(){return this._get("feature")}set feature(e){const t=this._get("feature");e!==t&&(this._featureClone=e?.clone()??$.clone(),this._expressionsManager&&(this._expressionsManager.feature=this._featureClone),e?(this._resetFieldInputValues(this._featureClone),this.allRelationshipInputs.forEach(t=>t.feature=e)):(this.inputs.forEach(e=>e.destroy()),this.inputs.length=0),t!==e&&(this.pendingSubtypeChoice=null),this.contingencyConstraintViolations.clear(),this._set("feature",e),this._initialFeature=this._featureClone.clone())}get fieldsWithContingentValues(){if(null==this._contingentValuesCache)return new Set;const e=this._contingentValuesCache.fieldGroups.flatMap(e=>e.fields);return new Set(e)}get formTemplate(){return this.layer&&"formTemplate"in this.layer?this.layer.formTemplate:null}set formTemplate(e){this._overrideIfSome("formTemplate",e)}get formDescription(){const{formTemplate:e,layer:t}=this;return e?.description&&t?k({attributes:this.getValues(),label:e.description,layer:t,timeZone:this.timeZone}):null}get formTitle(){const{formTemplate:e,layer:t}=this;return e?.title&&t?k({attributes:this.getValues(),label:e.title,layer:t,timeZone:this.timeZone}):null}get formHeaderVisible(){const{activeRelationshipInput:e,activeAssociationInput:t,formDescription:n,formTitle:s}=this;return!(e||t||!n&&!s)}get joinedContingentValues(){return this._joinContingentValues()}get layer(){const e=this._initialFeature;return e?.sourceLayer&&"applyEdits"in e.sourceLayer?e.sourceLayer:null}set layer(e){this._override("layer",e)}get relationshipId(){return this._get("relationshipId")}set relationshipId(e){const t=this.allRelationshipInputs;if(null!=e&&e===this.relationshipId||t.forEach(e=>{e.showAllEnabled=!1,e.activeCategory=null}),null!=e){const n=t.find(t=>t.relationshipId===e);n&&(n.showAllEnabled=!0)}this._set("relationshipId",e)}get spatialReference(){return this.layer?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.layer?.loaded?"ready":"disabled"}get submittable(){return!!this.valid||this.allFieldInputs.filter(e=>!e.valid).every(({submittable:e})=>e)}get timeZone(){const{layer:e}=this;if(e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone)return b;const t=e&&"preferredTimeZone"in e&&e.preferredTimeZone;return this._timeZone===V?t||b:this._timeZone||w}set timeZone(e){this._timeZone=e}get updating(){return this._updatingHandles.updating}get valid(){const e=this.allFieldInputs;return e.length>0&&e.every(({valid:e})=>e)}findField(e){return this.allFieldInputs.find(t=>t.name===e)}findGroup(e){return this.allGroupInputs.find(t=>t.id===e)}getFieldValueOptionsForField(e,t){const n=this.findField(e);if(!n)return[[],[],[]];const s="coded-value"===n.domain?.type?n.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[],i=null==n.value||s.some(e=>e.value===n.value)?[]:[{name:`${n.value}`,value:n.value}],o=this.fieldsWithContingentValues.has(e)?this._getContingentValueOptionsForField(e,t):[];if(o.length>0){const e=new Set(o.map(e=>e.value));return[o,s.filter(t=>!e.has(t.value)),i]}return[s,[],i]}getValue(e){const t=this.layer?.getField(e);if(null!=t)return this._featureClone.getAttribute(t.name)??null}setValue(e,t){const{_featureClone:n,strict:s}=this,i=this.findField(e);t=""===t?null:t,i&&n.getAttribute(e)!==t&&(i.value=t,s&&!i.valid||(this._afterValueChange(i),this._evaluateExpressions(t=>t.evaluateInvalidated([e]))))}getValues(){return{...this._featureClone.attributes}}overrideInitialFeature(e){this._initialFeature=e}submit(){const e=this.allFieldInputs,t=new Set(e.filter(e=>e.valid).map(({name:e})=>e)),n=e.filter(e=>!e.valid).map(({name:e})=>e),s=this.getValues();if(this.validateContingencyConstraints(s,{includeIncompleteViolations:!0}).length>0)for(const[i,o]of this.contingencyConstraintViolations.entries())"error"===o.type&&(t.delete(i),n.push(i));this.notifyChange("submittable"),this.notifyChange("valid"),this.emit("submit",{valid:[...t],invalid:n,values:s})}validateContingencyConstraints(e,t){const{_contingentValuesCache:n}=this,s=new Map;if(this.contingencyConstraintViolations=s,null==n)return[];const{invalid:i,incomplete:o}=n.validateContingencyConstraints(e),r=[...i,...t?.includeIncompleteViolations?o:[]];for(const a of r)for(const e of a.fieldGroup.fields)s.set(e,a);return r}notifyFeatureGeometryChanged(){const{feature:e,_featureClone:t}=this;e&&(t.geometry=e.geometry,this._evaluateExpressions(e=>e.evaluateInvalidatedByGeometry()))}applySubtypeDefaults(e){const{defaultValues:t}=e,{allFieldInputs:n}=this;for(const{name:s}of n){const e=t[s];null!=e&&this.setValue(s,e)}}_emitChangeEvent({name:e,valid:t,value:n}){this.emit("value-change",{layer:this.layer,feature:this.feature,fieldName:e,value:n,valid:t})}_evaluateExpressions(e){const t=this._expressionsManager;null!=t&&this._updatingHandles.addPromise(e(t).finally(()=>this._afterExpressionsEvaluated()))}async _updateInputsUsingFormElements(e,t,n){const s=new Map;for(const r of e)if(T(r)){s.set(r.element,r);for(const e of r.inputs)e.element&&s.set(e.element,e)}else r.element&&s.set(r.element,r);const i=new Map,o=await this._updateInputsUsingFormElementsRecursive({existingInputsByElement:s,updatedElements:t.filter(e=>this._isSupportedElement(e)),sharedInitializationProperties:n,group:null,newExpressionExecutorPromises:i});for(const[r,a]of s.entries())s.delete(r),a.destroy();return await Promise.all(Array.from(i.values())),o}async _updateInputsUsingFormElementsRecursive(e){const{existingInputsByElement:t,updatedElements:n,sharedInitializationProperties:s,group:i,newExpressionExecutorPromises:o}=e,r=[];for(const a of n){const e=t.has(a),n=e?t.get(a):y(a)?await this._makeUtilityNetworkAssociationInputFromElement(a,s,i):this._makeInputFromElement(a,s,i);if(n){if(r.push(n),await u(()=>!n.updating),this._assignExpressionExecutors(n,a,o),e)if(t.delete(a),T(n)){const{feature:e,timeZone:t}=s;n.set({feature:e,timeZone:t})}else if(N(n)){const e=this.relationshipId===a.relationshipId;n.set(s),n.set({map:this.map,showAllEnabled:e})}else y(n)?(n.set(s),n.set({map:this.map})):n.set(s);if(g(a)){const e=a.elements.filter(e=>this._isSupportedElement(e));n.inputs=await this._updateInputsUsingFormElementsRecursive({existingInputsByElement:t,updatedElements:e,sharedInitializationProperties:s,group:n,newExpressionExecutorPromises:o})}}}return r}_updateInputsUsingLayerFields(e,t,n){if(!Array.isArray(t))return s.getLogger(this).warn(this.declaredClass,"No attribute fields found."),[];const i=new Map;for(const s of e)if(T(s)){for(const e of s.inputs)e.destroy();s.inputs.length=0,s.destroy()}else N(s)?s.destroy():S(s)&&(null!==s.element?s.destroy():i.set(s.field,s));const o=[];for(const s of t){const e=n.feature?.getAttribute(s.name)??null,t=i.get(s)??new Z({field:s,preservesValueWhenHidden:this.formTemplate?.preserveFieldValuesWhenHidden});o.push(t.set({...n,value:e})),i.delete(s)}for(const[s,r]of i.entries())i.delete(s),r.destroy();return o}_resetFieldInputValues(e){for(const t of this.allFieldInputs)t.value=e.getAttribute(t.name)??null}_makeInputFromElement(e,t,n){return g(e)?Y(e,t):_(e)?this._makeFieldInputFromElement(e,t,n):v(e)?this._makeRelationshipInputFromElement(e,t,n):y(e)?this._makeUtilityNetworkAssociationInputFromElement(e,t,n):I(e)?q(e,t):y(e)?this._makeUtilityNetworkAssociationInputFromElement(e,t,n):e}_makeFieldInputFromElement(e,t,n){const{editType:s,feature:i,initialFeature:o,layer:r,timeZone:a}=t,{fieldName:l}=e,u=l&&this._layerFieldsByName.get(l);return u?new Z({editType:s,element:e,field:u,value:i?.getAttribute(e.fieldName)??null,feature:i,initialFeature:o,layer:r,group:n,preservesValueWhenHidden:this.formTemplate?.preserveFieldValuesWhenHidden,timeZone:a}):null}_makeRelationshipInputFromElement(e,t,n=null){const{map:s}=this,{feature:i,layer:o,timeZone:r}=t,a=new O({element:e,feature:i,group:n,layer:o,map:s,timeZone:r});return a.addHandles(p(()=>a.relatedLayer,"edits",()=>this._evaluateExpressions(e=>e.evaluateAsyncExpressions()))),a}async _makeUtilityNetworkAssociationInputFromElement(e,t,n=null){const{map:s}=this,{feature:i,layer:o,timeZone:r}=t;return new(0,(await import("./UtilityNetworkAssociationInput.js")).default)({element:e,feature:i,group:n,layer:o,map:s,timeZone:r})}_assignExpressionExecutors(e,t,n){const s=D[t.type],i=[];for(const o of s){const s=`${o}Executor`;if(e[s]){this._useExecutor(e[s]);continue}const r=t[o];if(null!=r&&""!==r){const t=this._expressionInfosLookup.get(r)?.expression??r;i.push(this._getOrCreateExecutorForExpression(t,n).then(t=>{e[s]=this._useExecutor(t)}))}}return L(e)&&i.push(...this._assignTextElementExpressionExecutors(e,n)),i}_assignTextElementExpressionExecutors(e,t){const{_expressionInfosLookup:n}=this,i=[];for(const o of e.expressionsUsed){const r=n.get(o);null!=r?i.push(this._getOrCreateExecutorForExpression(r.expression,t).then(t=>e.setExpressionExecutor(o,this._useExecutor(t)))):s.getLogger(this).error("feature-form:expression-not-found",`Could not find expressionInfo object with name '${o}'`)}for(const s of e.fieldsUsed){const n=`return $feature['${s}'];`;i.push(this._getOrCreateExecutorForExpression(n,t).then(t=>e.setFieldExecutor(s,this._useExecutor(t))))}return i}async _getOrCreateExecutorForExpression(e,t){const{_expressionExecutorLookup:n}=this;if(n.has(e))return n.get(e);if(t.has(e))return t.get(e);const s=G(e,this.layer);t.set(e,s);const i=await s;return n.set(e,i),i}_createExpressionsManager(e){const{_arcadeContextInfo:t,_featureClone:n,allFieldInputs:s,formTemplate:i}=this;this._expressionsManager=new H({executors:e,feature:n,arcadeContextInfo:t,fieldInputs:s,preserveFieldValuesWhenHidden:!0===i?.preserveFieldValuesWhenHidden})}_startExpressions(){if(0===this._expressionExecutorsInUse.size)return;const e=Array.from(this._expressionExecutorsInUse);this._createExpressionsManager(e),this._evaluateExpressions(e=>e.evaluateAll())}_stopExpressions(){this._expressionsManager=i(this._expressionsManager),this._expressionExecutorsInUse.clear()}_useExecutor(e){return this._expressionExecutorsInUse.add(e),e}_afterValueChange(e){const{name:t,value:n}=e,{_featureClone:s,formTemplate:i,layer:o}=this;if(!o)return;const r=s.getAttribute(t);s.setAttribute(t,n);const{typeFieldName:a,types:l}=R(o);if((e.isSubtypeField||t===a)&&n!==r){if("subtype-sublayer"===o.type){const e=o.parent?.findSublayerForFeature(s);e&&(this.feature&&(this.feature.sourceLayer=e),s.sourceLayer=e,this._initialFeature.sourceLayer=e)}const e=new Set;for(const t of l)if(t.domains&&"object"==typeof t.domains)for(const n of Object.keys(t.domains))e.add(n);for(const t of e){const e=this.findField(t);e&&e.notifyChange("domain")}this.notifyChange("joinedContingentValues")}if(null!=i){const{description:e,title:n}=i;n&&c(n,t)&&this.notifyChange("formTitle"),e&&c(e,t)&&this.notifyChange("formDescription")}this._emitChangeEvent(e)}_afterExpressionsEvaluated(){const{_featureClone:e}=this;for(const t of this.allFieldInputs)t.value!==e.getAttribute(t.name)&&this._afterValueChange(t)}_joinContingentValues(){const e=this._contingentValuesCache;if(null==e)return[];const{typeFieldName:t}=R(this.layer),n=t?this.getValue(t):null,s=[];for(const r of e.fieldGroups){const{contingencies:e,fields:t,name:i}=r,o=[];for(const s of e)s.isRetired||null!=s.subtype&&s.subtype.code!==n||o.push({values:s.values});o.length>0&&s.push({name:i,fields:t,contingencies:o})}const[i,o]=this._generateJoinPlan(s);return[...i.flatMap(e=>this._joinFieldGroupContingencies(e)),...o.flatMap(e=>e.contingencies)]}_generateJoinPlan(e){const t=new Map,n=[],s=new Set;for(const l of e)for(const e of l.fields)if(t.has(e)){const i=t.get(e),o=l,r=[i.name,o.name].sort().join("|");if(s.has(r))continue;n.push([i,o]),s.add(r),t.set(e,o)}else t.set(e,l);const i=new Set(n.flat()),o=new Set(e);for(const l of i)o.delete(l);const r=new Map,a=new Map;for(const l of new Set(n.flat())){const e=Symbol(l.name);r.set(e,new Set([l])),a.set(l,e)}for(const[l,u]of n){const e=a.get(l),t=a.get(u);if(e===t)continue;const n=r.get(e),s=r.get(t);for(const i of s)n.add(i),a.set(i,e);r.delete(t)}return[[...r.values()].map(e=>[...e]),[...o]]}_joinFieldGroupContingencies(e){const t=e.slice(),n=t.shift();let s=t.shift(),i=this._generateJoinKey(n.fields,s.fields),o=new Set([...n.fields,...s.fields]),r=new Map;for(const l of n.contingencies){const[e]=this._hashContingency(l,i.codedValueFields,!0);r.has(e)?r.get(e)?.push(l):r.set(e,[l])}for(;t.length>0;){const e=new Map,n=t.shift(),a=this._generateJoinKey(o,n.fields);for(const t of s.contingencies){const[n,s]=this._hashContingency(t,i.codedValueFields),o=s?this._findMatchingContingenciesWithAnyHashMask(r,n):r.get(n);if(r.has(J)&&o?.push(...this._findMatchingContingenciesContainingAny(t,r.get(J),i.codedValueFields)),null!=o)for(const r of o){const n=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(r,t,i.rangeFields):this._joinContingencies(r,t);if(null==n)break;const[s]=this._hashContingency(n,a.codedValueFields,!0);e.has(s)?e.get(s)?.push(n):e.set(s,[n])}}r=e,s=n,i=a,o=new Set([...o,...s.fields])}const a=[];for(const l of s.contingencies){const[e,t]=this._hashContingency(l,i.codedValueFields),n=t?this._findMatchingContingenciesWithAnyHashMask(r,e):r.get(e);if(r.has(J)&&n.push(...this._findMatchingContingenciesContainingAny(l,r.get(J),i.codedValueFields)),null!=n)for(const s of n){const e=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(s,l,i.rangeFields):this._joinContingencies(s,l);null!=e&&a.push(e)}}return a}_joinContingencies(e,t){const n={values:{...e.values,...t.values}};for(const[s,i]of Object.entries(n.values))"any"===i.objectType&&null!=e.values[s]&&(n.values[s]=e.values[s]);return n}_joinContingenciesWithRangeDomains(e,t,n){const s=this._joinContingencies(e,t);for(const i of n){const n=e.values[i],o=t.values[i],{leftIsNull:r,rightIsNull:a,bothAreNull:l,leftIsAny:u,rightIsAny:p,bothAreAny:c,leftIsRange:h,rightIsRange:d}=this._compareObjectTypes(n.objectType,o.objectType);if(l||c)continue;if(r&&p||a&&u){s.values[i]=new x({objectType:"null"});continue}if(r&&d||a&&h)return null;u?(n.minValue=-1/0,n.maxValue=1/0):p&&(o.minValue=-1/0,o.maxValue=1/0);const f=Math.max(n.minValue,o.minValue),m=Math.min(n.maxValue,o.maxValue);if(f>m)return null;s.values[i]=new x({objectType:"range",minValue:f,maxValue:m})}return s}_findMatchingContingenciesContainingAny(e,t,n){return t.filter(t=>n.every(n=>{const s=t.values[n],i=e.values[n];return"any"===s.objectType||"any"===i.objectType||s.codedValue?.code===i.codedValue?.code}))}_findMatchingContingenciesWithAnyHashMask(e,t){const n=new RegExp(`${t}$`),s=[];for(const[i,o]of e){if(i===J)break;n.test(i)&&s.push(...o)}return s}_generateJoinKey(e,t){const n=Array.isArray(e)?new Set(e):e,s=Array.isArray(t)?new Set(t):t,i=n.size<s.size?n:s,o=i===n?s:n,{feature:r}=this,a=new Set,l=new Set;for(const u of i)if(o.has(u)){const e=this.layer?.getFieldDomain(u,{feature:r??void 0,excludeImpliedDomains:!0});if(null==e)continue;switch(e.type){case"coded-value":a.add(u);break;case"range":l.add(u)}}return{codedValueFields:[...a],rangeFields:[...l]}}_contingencyIsValid(e,t){const n={};for(const{name:s,value:i}of this.allFieldInputs)this.fieldsWithContingentValues.has(s)&&null!=i&&s!==e&&(n[s]=i);return Object.entries(n).every(([e,n])=>!t.values.hasOwnProperty(e)||U(n,t.values[e]))}_getContingentValueOptionsForField(e,t){const n=this.joinedContingentValues.slice(),s=new Map,i={code:"",name:t??"No value"};for(const o of n){const t=o.values[e];if("code"===t?.objectType||"null"===t?.objectType){const{code:n,name:r}=t.codedValue&&"null"!==t.objectType?t.codedValue:i;!s.has(n)&&this._contingencyIsValid(e,o)&&s.set(n,{name:r,value:n})}}return[...s.values()]}_hashContingency(e,t,n=!1){if(t.length<1)return[z,!1];const s=[];let i=!1;for(const o of t){const t=e.values[o];if("any"===t.objectType){if(n)return[J,!0];i=!0,s.push(`${o}:.*`)}else"null"===t.objectType?s.push(`${o}:${B}`):s.push(`${o}:${t.codedValue?.code}`)}return[s.sort().join("&"),i]}_compareObjectTypes(e,t){return{leftIsNull:"null"===e,rightIsNull:"null"===t,bothAreNull:"null"===e&&"null"===t,leftIsAny:"any"===e,rightIsAny:"any"===t,bothAreAny:"any"===e&&"any"===t,leftIsRange:"range"===e,rightIsRange:"range"===t}}_isSupportedElement(e){return"field"===e.type||"group"===e.type||"relationship"===e.type||"text"===e.type||"utilityNetworkAssociations"===e.type||(s.getLogger(this).warn("form-info::unsupported-element-type","Only element types 'field', 'group' and 'relationship' are supported",`Element ${e.label} has unsupported type '${e.type}'`),!1)}get test(){return{featureClone:this._featureClone}}};function Y(e,t){const{feature:n,layer:s}=t;return new P({element:e,inputs:[],feature:n,layer:s})}function q(e,t,n=null){const{feature:s,layer:i,timeZone:o}=t;return new W({element:e,feature:s,group:n,layer:i,timeZone:o})}e([h()],K.prototype,"_expressionInfosLookup",null),e([h()],K.prototype,"_featureClone",void 0),e([h()],K.prototype,"_initialFeature",void 0),e([h()],K.prototype,"_timeZone",void 0),e([h({type:F})],K.prototype,"activeAssociation",void 0),e([h()],K.prototype,"activeAssociationInput",null),e([h()],K.prototype,"activeRelationshipInput",null),e([h()],K.prototype,"_arcadeContextInfo",null),e([h()],K.prototype,"associationId",null),e([h()],K.prototype,"associatedLayer",null),e([h()],K.prototype,"allAssociationInputs",null),e([h()],K.prototype,"allFieldInputs",null),e([h()],K.prototype,"allGroupInputs",null),e([h()],K.prototype,"allRelationshipInputs",null),e([h()],K.prototype,"_layerFieldsByName",null),e([h()],K.prototype,"editType",void 0),e([h()],K.prototype,"contingencyConstraintViolations",void 0),e([h()],K.prototype,"disabled",void 0),e([h()],K.prototype,"feature",null),e([h()],K.prototype,"fieldsWithContingentValues",null),e([h({type:m})],K.prototype,"formTemplate",null),e([h()],K.prototype,"formDescription",null),e([h()],K.prototype,"formTitle",null),e([h()],K.prototype,"formHeaderVisible",null),e([h()],K.prototype,"highlightHelper",void 0),e([h()],K.prototype,"inputs",void 0),e([h()],K.prototype,"joinedContingentValues",null),e([h()],K.prototype,"layer",null),e([h()],K.prototype,"map",void 0),e([h()],K.prototype,"callbacks",void 0),e([h()],K.prototype,"relationshipId",null),e([h()],K.prototype,"spatialReference",null),e([h()],K.prototype,"state",null),e([h()],K.prototype,"strict",void 0),e([h()],K.prototype,"submittable",null),e([h()],K.prototype,"timeZone",null),e([h()],K.prototype,"updating",null),e([h()],K.prototype,"valid",null),e([h()],K.prototype,"pendingSubtypeChoice",void 0),e([h()],K.prototype,"getValues",null),e([h()],K.prototype,"submit",null),e([h()],K.prototype,"test",null),K=e([d("esri.widgets.FeatureForm.FeatureFormViewModel")],K);const Q=K;export{Q as default};
@@ -3,8 +3,8 @@ import type Field from "../../layers/support/Field.js";
3
3
  import type EditableInput from "./EditableInput.js";
4
4
  import type GroupInput from "./GroupInput.js";
5
5
  import type { InputType } from "../../form/elements/inputs/Input.js";
6
- import type { Domain } from "../../layers/support/domains.js";
7
6
  import type { FieldValue } from "../../layers/support/fieldUtils.js";
7
+ import type { DomainUnion } from "../../layers/support/types.js";
8
8
  import type { EditableInputProperties } from "./EditableInput.js";
9
9
  import type { FieldInputDataTypes } from "../support/forms/types.js";
10
10
 
@@ -39,7 +39,7 @@ export default class FieldInput extends EditableInput<FieldElement | null | unde
39
39
  */
40
40
  get dataType(): FieldInputDataTypes;
41
41
  /** The input value's domain. This is used to constrain the allowable values of the layer. */
42
- get domain(): Domain | null | undefined;
42
+ get domain(): DomainUnion | null | undefined;
43
43
  /** Indicates if the field is editable. */
44
44
  get editable(): boolean;
45
45
  /** If the input field's value is invalid, this property returns a validation error code. Otherwise, it is `null`. */
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{substitute as e}from"../../intl.js";import{isSome as t}from"../../core/arrayUtils.js";import{neverReached as r}from"../../core/compilerUtils.js";import{equalsShallow as n}from"../../core/lang.js";import o from"../../core/Logger.js";import{templateHasKey as i,replace as l}from"../../core/string.js";import{isFieldElement as a}from"../../form/support/formUtils.js";import{convertDateTimeFieldFormatToIntlOptions as s}from"../../intl/date.js";import{defaultFieldFormat as u}from"../../layers/support/fieldFormatUtils.js";import{isTimeOnlyField as m}from"../../layers/support/fieldUtils.js";import{isSubtypeSublayer as p,supportsFieldConfiguration as d,getSubtypesFromLayer as f}from"../../layers/support/layerUtils.js";import{isAnyDateField as c}from"../../smartMapping/support/utils.js";import{getLabelForDateFieldValue as y,getIntlOptionsForField as g}from"../support/dateUtils.js";import{getRangeErrorMessage as b,shouldUseScientificNotation as v,scientificNumberFormatOptions as j,numberFormatOptions as x}from"../support/forms/formUtils.js";const F=e=>"field"===e?.type,h=e=>"group"===e?.type,N=e=>"relationship"===e?.type,T=e=>"text"===e.type,V=e=>"utilityNetworkAssociations"===e.type,U=e=>!h(e)&&null!=e.group,$=(e,t)=>U(e)&&e.group===t,O=e=>e.reduce((e,t)=>h(t)?[...e,...t.inputs]:[...e,t],[]),w=e=>O(e).filter(F),E=e=>O(e).filter(N),L=e=>O(e).filter(V),Z=e=>null!=e&&(C(e,"combo-box")||C(e,"radio-buttons")),C=(e,t)=>null!=e&&e.input?.type===t,I=({domain:e,inputType:t="text-box",dataType:r})=>"number"===r&&"text-box"===t&&(!e||"coded-value"!==e.type);function k(e){const{attributes:r,layer:n,label:o,timeZone:l}=e;if(!r||"object"!=typeof r)return o;const a=Object.keys(r).filter(e=>i(o,e)),s=a.map(e=>r[e]),u=a.map(e=>n.fieldsIndex.get(e)).filter(t);return J(o,G({fields:u,layer:n,timeZone:l,values:s}))}const S="expression/",W="expr/",A="field/";function B(e){const[t,r]=e.split(S);return""===t&&r?r:(o.getLogger("esri.widgets.FeatureForm/featureFormUtils").error("extractExpressionNameFromString:invalid-input",`The string ${e} is not a valid expression reference of the form '${S}/expressionName'`),"")}function M(e){return`${S}${e}`}function q(e){return`${A}${e}`}function z(e){return e.startsWith(S)}function D(e){return e.startsWith(W)}function G(e){const{layer:t,values:r}=e,n=e.fields??t.fields??[],o=e.timeZone??void 0,i=n.map((e,n)=>{let i=r[n];if("coded-value"===e.domain?.type){const t=e.domain.codedValues.find(e=>e.code===i);t?.name&&(i=t.name)}return(c(e)||m(e))&&(i=y(e,i,{timeZone:o,...H(t,e)})),[e.name,i]});return Object.fromEntries(i)}function H(e,t){if(d(e)){const r=e.getFieldConfiguration(t.name)?.fieldFormat??u(t);if("date-time"===r?.type)return s(r)}return g(t)}function J(e,t){return l(l(e,e=>`{${e.toLowerCase()}}`),Object.fromEntries(Object.entries(t).map(([e,t])=>[e.toLowerCase(),t])))}const K=e=>{const t={typeFieldName:null,types:[]};return e?(p(e)?(t.typeFieldName=e.parent?.subtypeField,t.types=e.parent?.subtypes??[]):"subtype-group"===e.type||"feature"===e.type&&e.subtypes?.length?(t.typeFieldName=e.subtypeField,t.types=e.subtypes??[]):"types"in e&&e.types&&(t.typeFieldName=e.typeIdField,t.types=e.types.map(({id:e,name:t,domains:r})=>({code:e,name:t,domains:r}))),null!=t.typeFieldName&&(t.typeFieldName=e.getField(t.typeFieldName)?.name??t.typeFieldName),t):t},P=(t,r,n)=>{const{dataType:o,error:i,minLength:l}=t,a=r?.validationErrors;if(!a||!i)return null;if("input-validation-error::cannot-be-empty"===i)return a.cannotBeNull;if("domain-validation-error::value-out-of-range"===i||"numeric-range-validation-error::out-of-range"===i){const{field:r,range:i}=t,l={type:"date",intlOptions:{timeZone:"date"===r.type&&n?n:void 0,...g(r)}},s=b(i,a);return e(s,i,{format:{max:"date"===o?l:null!=i.max&&v(i.max)?j:x,min:"date"===o?l:null!=i.min&&v(i.min)?j:x}})}return"domain-validation-error::invalid-coded-value"===i?a.invalidCodedValue:"type-validation-error::invalid-type"===i?a.invalidType:"length-validation-error::too-short"===i?e(a.tooShort,{min:l}):null},Q=e=>{if(!e)return;const t=e.layer,r=t&&"geometryType"in t?t.geometryType:void 0,n=e.geometry?.type;return"polyline"===n||"polyline"===r?"line":"mesh"===n||"mesh"===r||"multipatch"===r?"cube":"multipoint"===n||"multipoint"===r?"point":n||r||"table"},R=e=>{const t=[];if(e.formTemplate){const{description:r,title:n}=e.formTemplate;e.fields?.forEach(e=>{const o=n&&i(n,e.name),l=r&&i(r,e.name);(o||l)&&t.push(e.name)})}return t};function X(e,t){const r=t??("formTemplate"in e&&e.formTemplate);if(r){return(r.elements?.filter(a)??[]).some(({fieldName:t})=>!e.fieldsIndex.get(t))}return!1}function Y(e,t){return null==e||t.onValue!==e&&t.offValue!==e}function _(e,t){switch(t.objectType){case"any":return!0;case"null":return null==e;case"code":return e===t.codedValue?.code;case"range":return null!=e&&null!=t.minValue&&null!=t.maxValue&&+e>=t.minValue&&+e<=t.maxValue;default:return r(t.objectType),!1}}function ee(e,t,r){const o=f(e),i=o?.find(e=>e.code===r);if(!i)return!1;const l=o?.find(e=>e.code===t);return!n(i.defaultValues,l?.defaultValues)&&Object.values(i.defaultValues).some(e=>null!=e)}export{B as extractExpressionNameFromString,L as flattenAssociationInputs,w as flattenFieldInputs,O as flattenInputs,E as flattenRelationshipInputs,X as formTemplateHasInvalidFields,G as getComputedAttributes,H as getDateTimeFormatOptions,P as getErrorMessageForFieldInput,R as getFieldsInTitleAndDesc,Q as getIconForFeature,K as getNormalizedFeatureTypeInfo,z as isExpressionReference,C as isFieldElementWithInputType,Z as isFieldElementWithShowNoValueOptionInput,F as isFieldInput,h as isGroupInput,U as isInputInGroupInput,$ as isInputInThisGroupInput,D as isLegacyFieldMapsExpressionReference,I as isNumberFieldInput,N as isRelationshipInput,T as isTextElementInput,V as isUtilityNetworkAssociationInput,k as parseFormTemplateString,M as prependExpressionPrefix,q as prependFieldPrefix,J as substituteFieldTemplatesInString,ee as subtypeChangeShouldPrompt,Y as valueIsInvalidSwitchValue,_ as valueIsValidContingentValue};
5
+ import{substitute as e}from"../../intl.js";import{isSome as t}from"../../core/arrayUtils.js";import{equalsShallow as r}from"../../core/lang.js";import n from"../../core/Logger.js";import{templateHasKey as o,replace as i}from"../../core/string.js";import{isFieldElement as l}from"../../form/support/formUtils.js";import{convertDateTimeFieldFormatToIntlOptions as a}from"../../intl/date.js";import{defaultFieldFormat as s}from"../../layers/support/fieldFormatUtils.js";import{isTimeOnlyField as u}from"../../layers/support/fieldUtils.js";import{isSubtypeSublayer as m,supportsFieldConfiguration as p,getSubtypesFromLayer as d}from"../../layers/support/layerUtils.js";import{isAnyDateField as f}from"../../smartMapping/support/utils.js";import{getLabelForDateFieldValue as c,getIntlOptionsForField as y}from"../support/dateUtils.js";import{getRangeErrorMessage as g,shouldUseScientificNotation as b,scientificNumberFormatOptions as v,numberFormatOptions as j}from"../support/forms/formUtils.js";const x=e=>"field"===e?.type,F=e=>"group"===e?.type,h=e=>"relationship"===e?.type,N=e=>"text"===e.type,T=e=>"utilityNetworkAssociations"===e.type,V=e=>!F(e)&&null!=e.group,U=(e,t)=>V(e)&&e.group===t,$=e=>e.reduce((e,t)=>F(t)?[...e,...t.inputs]:[...e,t],[]),O=e=>$(e).filter(x),w=e=>$(e).filter(h),E=e=>$(e).filter(T),L=e=>null!=e&&(Z(e,"combo-box")||Z(e,"radio-buttons")),Z=(e,t)=>null!=e&&e.input?.type===t,C=({domain:e,inputType:t="text-box",dataType:r})=>"number"===r&&"text-box"===t&&(!e||"coded-value"!==e.type);function I(e){const{attributes:r,layer:n,label:i,timeZone:l}=e;if(!r||"object"!=typeof r)return i;const a=Object.keys(r).filter(e=>o(i,e)),s=a.map(e=>r[e]),u=a.map(e=>n.fieldsIndex.get(e)).filter(t);return H(i,D({fields:u,layer:n,timeZone:l,values:s}))}const k="expression/",S="expr/",W="field/";function A(e){const[t,r]=e.split(k);return""===t&&r?r:(n.getLogger("esri.widgets.FeatureForm/featureFormUtils").error("extractExpressionNameFromString:invalid-input",`The string ${e} is not a valid expression reference of the form '${k}/expressionName'`),"")}function B(e){return`${k}${e}`}function M(e){return`${W}${e}`}function q(e){return e.startsWith(k)}function z(e){return e.startsWith(S)}function D(e){const{layer:t,values:r}=e,n=e.fields??t.fields??[],o=e.timeZone??void 0,i=n.map((e,n)=>{let i=r[n];if("coded-value"===e.domain?.type){const t=e.domain.codedValues.find(e=>e.code===i);t?.name&&(i=t.name)}return(f(e)||u(e))&&(i=c(e,i,{timeZone:o,...G(t,e)})),[e.name,i]});return Object.fromEntries(i)}function G(e,t){if(p(e)){const r=e.getFieldConfiguration(t.name)?.fieldFormat??s(t);if("date-time"===r?.type)return a(r)}return y(t)}function H(e,t){return i(i(e,e=>`{${e.toLowerCase()}}`),Object.fromEntries(Object.entries(t).map(([e,t])=>[e.toLowerCase(),t])))}const J=e=>{const t={typeFieldName:null,types:[]};return e?(m(e)?(t.typeFieldName=e.parent?.subtypeField,t.types=e.parent?.subtypes??[]):"subtype-group"===e.type||"feature"===e.type&&e.subtypes?.length?(t.typeFieldName=e.subtypeField,t.types=e.subtypes??[]):"types"in e&&e.types&&(t.typeFieldName=e.typeIdField,t.types=e.types.map(({id:e,name:t,domains:r})=>({code:e,name:t,domains:r}))),null!=t.typeFieldName&&(t.typeFieldName=e.getField(t.typeFieldName)?.name??t.typeFieldName),t):t},K=(t,r,n)=>{const{dataType:o,error:i,minLength:l}=t,a=r?.validationErrors;if(!a||!i)return null;if("input-validation-error::cannot-be-empty"===i)return a.cannotBeNull;if("domain-validation-error::value-out-of-range"===i||"numeric-range-validation-error::out-of-range"===i){const{field:r,range:i}=t,l={type:"date",intlOptions:{timeZone:"date"===r.type&&n?n:void 0,...y(r)}},s=g(i,a);return e(s,i,{format:{max:"date"===o?l:null!=i.max&&b(i.max)?v:j,min:"date"===o?l:null!=i.min&&b(i.min)?v:j}})}return"domain-validation-error::invalid-coded-value"===i?a.invalidCodedValue:"type-validation-error::invalid-type"===i?a.invalidType:"length-validation-error::too-short"===i?e(a.tooShort,{min:l}):null},P=e=>{if(!e)return;const t=e.layer,r=t&&"geometryType"in t?t.geometryType:void 0,n=e.geometry?.type;return"polyline"===n||"polyline"===r?"line":"mesh"===n||"mesh"===r||"multipatch"===r?"cube":"multipoint"===n||"multipoint"===r?"point":n||r||"table"},Q=e=>{const t=[];if(e.formTemplate){const{description:r,title:n}=e.formTemplate;e.fields?.forEach(e=>{const i=n&&o(n,e.name),l=r&&o(r,e.name);(i||l)&&t.push(e.name)})}return t};function R(e,t){const r=t??("formTemplate"in e&&e.formTemplate);if(r){return(r.elements?.filter(l)??[]).some(({fieldName:t})=>!e.fieldsIndex.get(t))}return!1}function X(e,t){return null==e||t.onValue!==e&&t.offValue!==e}function Y(e,t){switch(t.objectType){case"any":return!0;case"null":return null==e;case"code":return e===t.codedValue?.code;case"range":return null!=e&&null!=t.minValue&&null!=t.maxValue&&+e>=t.minValue&&+e<=t.maxValue;default:return t.objectType,!1}}function _(e,t,n){const o=d(e),i=o?.find(e=>e.code===n);if(!i)return!1;const l=o?.find(e=>e.code===t);return!r(i.defaultValues,l?.defaultValues)&&Object.values(i.defaultValues).some(e=>null!=e)}export{A as extractExpressionNameFromString,E as flattenAssociationInputs,O as flattenFieldInputs,$ as flattenInputs,w as flattenRelationshipInputs,R as formTemplateHasInvalidFields,D as getComputedAttributes,G as getDateTimeFormatOptions,K as getErrorMessageForFieldInput,Q as getFieldsInTitleAndDesc,P as getIconForFeature,J as getNormalizedFeatureTypeInfo,q as isExpressionReference,Z as isFieldElementWithInputType,L as isFieldElementWithShowNoValueOptionInput,x as isFieldInput,F as isGroupInput,V as isInputInGroupInput,U as isInputInThisGroupInput,z as isLegacyFieldMapsExpressionReference,C as isNumberFieldInput,h as isRelationshipInput,N as isTextElementInput,T as isUtilityNetworkAssociationInput,I as parseFormTemplateString,B as prependExpressionPrefix,M as prependFieldPrefix,H as substituteFieldTemplatesInString,_ as subtypeChangeShouldPrompt,X as valueIsInvalidSwitchValue,Y as valueIsValidContingentValue};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{substitute as t,formatNumber as i}from"../intl.js";import{isSome as o}from"../core/arrayUtils.js";import"../core/has.js";import s from"../core/Logger.js";import{createResolver as n}from"../core/promiseUtils.js";import a from"../core/ReactiveMap.js";import{watch as r,whenOnce as l,initial as d}from"../core/reactiveUtils.js";import{property as c,subclass as u}from"../core/accessorSupport/decorators.js";import{isIntegerField as p}from"../layers/support/fieldUtils.js";import{isSubtypeGroupLayer as m,getSubtypesFromLayer as h}from"../layers/support/layerUtils.js";import{isString as v}from"../support/guards.js";import _ from"./Widget.js";import{Prompt as g}from"./Editor/components/Prompt.js";import{isRelatableFeatureSupportedLayer as b}from"./Feature/support/featureUtils.js";import{css as f}from"./FeatureForm/css.js";import{isUtilityNetworkAssociationInput as y,isGroupInput as C,isFieldInput as F,isRelationshipInput as w,isTextElementInput as R,flattenInputs as k,isInputInGroupInput as O,isFieldElementWithInputType as I,getErrorMessageForFieldInput as N,getIconForFeature as M,isNumberFieldInput as L,isInputInThisGroupInput as T,subtypeChangeShouldPrompt as A}from"./FeatureForm/featureFormUtils.js";import x from"./FeatureForm/FeatureFormViewModel.js";import D from"./FeatureForm/VisibleElements.js";import{loadCalciteComponents as V}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as S,getIntlOptionsForField as U,numberingSystem as E,prepareISOFieldValueForDateComponents as $,prepareUnixFieldValueForDateComponents as j,normalizeTimeOnlyString as P,getISOFieldValueFromDateComponents as G,getUnixFieldValueFromDateComponents as H}from"./support/dateUtils.js";import{globalCss as W}from"./support/globalCss.js";import{Heading as Z,incrementHeadingLevel as B}from"./support/Heading.js";import{messageBundle as K,vmEvent as q,tsx as z}from"./support/widget.js";import{setFocus as J}from"./support/widgetUtils.js";const Q="data-field-name";let X=class extends _{constructor(e,t){super(e,t),this._associationsWidgetsMap=new a,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._inputsWithChanges=new Set,this._focusedFieldName=null,this._pendingSubtypeChoice=null,this._listObserverNode=null,this._listObserver=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()},{root:window.document}),this._prompt=null,this._featureFormUNAssociationList=null,this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new x,this.visibleElements=new D,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,callbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t,i)=>{const{feature:o,callbacks:s}=this;let n=i;if(o&&s?.addRelatedRecord){if(m(i)&&e.activeCategory){const t=e.activeCategory.value,o=i.findSublayerForSubtypeCode(t);o&&b(o)&&(n=o)}s.addRelatedRecord({parentFeature:o,relatedLayer:n,relationshipId:t})}},this._onFormKeyDown=this._onFormKeyDown.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onGroupToggle=this._onGroupToggle.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentKeyDown=this._onComponentKeyDown.bind(this),this._afterComponentCreate=this._afterComponentCreate.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),this._afterGroupCreate=this._afterGroupCreate.bind(this)}initialize(){this.addHandles([r(()=>this.feature,()=>{this._inputsWithChanges.clear(),this._dateComponentMap.clear(),l(()=>!this.viewModel.updating).then(()=>{const e=this._getFocusableInput("forward");this._syncGroupInputStates(),this._focusedFieldName=e?.name||null,this._attemptFocusOnNextRender=!0})}),r(()=>[this._featureFormUNAssociationList,this.visibleElements.associationDetails],([e,t])=>{e&&(e.visibleElements.associationDetails=t)},d),r(()=>this.groupDisplay,()=>this._syncGroupInputStates()),this.on("submit",e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach(e=>this._inputsWithChanges.add(e)),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}}),r(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),r(()=>this.viewModel.activeAssociationInput,e=>{e&&this._featureFormUNAssociationList&&(this._featureFormUNAssociationList.associationInput=e,this._featureFormUNAssociationList.viewModel=e.viewModel)}),r(()=>this.viewModel.inputs.filter(y),async e=>{this._featureFormUNAssociationList||await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.has(t)||this._associationsWidgetsMap.set(t,await this._makeAssociationsWidget(t))})])}loadDependencies(){return V({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),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"),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"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area")})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){const{callbacks:e}=this;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get _utilityNetworkAssociationsEnabled(){const{callbacks:e}=this;return!(!e?.viewAssociatedLayers||!e.viewAssociatedFeatures)}get _subtypes(){return h(this.layer)}get associationId(){return this.viewModel.associationId}set associationId(e){this.viewModel.associationId=e}get associatedLayer(){return this.viewModel.associatedLayer}set associatedLayer(e){this.viewModel.associatedLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get icon(){return"form-field"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return z("div",{class:this.classes(f.base,W.widget,W.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return z("div",null,z("form",{class:f.form,inert:!!this._prompt,novalidate:!0,onkeydown:this._onFormKeyDown,onsubmit:this._onFormSubmit},this._renderReadOnlyNotice(),this._renderHeader(),this._renderContent()),this._prompt?z(g,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderReadOnlyNotice(){const{disabled:e,messages:t}=this;if(e&&this.visibleElements.readOnlyNotice)return z("calcite-notice",{class:f.disabledNotice,icon:"read-only-non-editable",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},t.disabledForm))}_renderHeader(){const e=this.viewModel,{formTitle:t,formDescription:i}=e;if(!e.formHeaderVisible)return;const o=null!=t&&z(Z,{key:"title",level:this.headingLevel},t),s=null!=i&&z("p",{class:f.description,key:"description"},i);return z("div",{class:f.formHeader},o,s)}_renderContent(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderRelationshipInput(e.activeRelationshipInput):e.activeAssociationInput?this._renderFeatureFormUtilityNetworkAssociationList():e.inputs.filter(o).filter(e=>e.visible).map(e=>this._renderInput(e))}_renderInput(e){return C(e)?this._renderGroup(e):F(e)?this._renderLabeledField(e):w(e)?this._renderRelationshipInput(e):R(e)?this._renderTextElementInput(e):y(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderFeatureFormUtilityNetworkAssociationList(){return this._featureFormUNAssociationList?.render()}_selectAssociatedLayer(e){const{feature:t,callbacks:i}=this;t&&i?.viewAssociatedFeatures&&i.viewAssociatedFeatures({associatedLayer:e.layer})}async _selectAssociatedFeature(e){const{feature:t,callbacks:i}=this;t&&i?.selectAssociatedFeature&&await i.selectAssociatedFeature({parentFeature:t,...e})}_onAddAssociation(e){const{feature:t,callbacks:i}=this;t&&i?.addAssociation&&i.addAssociation(e)}async _setUpUtilityNetworkAssociationList(){if(!this._featureFormUNAssociationList){const e=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js")).default;this._featureFormUNAssociationList=new e({onSelectLayer:this._selectAssociatedLayer.bind(this),onSelectFeature:this._selectAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)})}}async _makeAssociationsWidget(e){return new(0,(await import("./Feature/FeatureUtilityNetworkAssociations.js")).default)({onSelectAssociationType:({viewModel:t,listType:i})=>{t.activeAssociationType=i;const{feature:o,callbacks:s}=this;o&&s?.viewAssociatedLayers&&s.viewAssociatedLayers({associationId:e.uid})},viewModel:e.associationsViewModel})}_renderUtilityNetworkAssociationsElementInput(e){if(this._utilityNetworkAssociationsEnabled)return this._associationsWidgetsMap.get(e)?.render()}_renderDescriptionOrEmpty(e,t){return null==e?null:z("div",{class:this.classes(f.description),id:t},e)}_renderGroup(e){const{formTemplate:t,headingLevel:i}=this,{description:o,id:s,inputs:n,label:a,open:r}=e,l=n.filter(e=>e.visible),d=this.viewModel.findField(this._focusedFieldName),c=d?.group===e,u="sequential"===this.groupDisplay;return z("calcite-block",{afterCreate:this._afterGroupCreate,class:this.classes(f.group,u?f.groupSequential:null,c?f.groupActive:null),collapsible:!0,"data-group":e,description:o||void 0,expanded:r,heading:a??"",headingLevel:t?.title?B(i):i,id:s,key:s,onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},l.map(e=>this._renderInput(e)))}_getFocusableInput(e,t){const i=k(this.viewModel.inputs);let o;if("backward"===e&&i.reverse(),t)if(C(t)){const e=t.inputs.find(e=>e.visible);o=e?i.indexOf(e):0}else{let s;if(O(t)&&!t.group.open){const i=t.group.inputs.filter(F);s="forward"===e?i[i.length-1]:i[0]}else s=t;o=i.indexOf(s)+1}else o=0;for(let s=o;s<i.length;s++){const e=i[s];if(e.visible&&F(e)){if(this.disabled&&e.inputType&&("switch"===e.inputType||"radio-buttons"===e.inputType))continue;return e}}return null}_renderLabeledField(e){const{dataType:i,feature:o,label:s,layer:n,required:a}=e,r={"aria-label":a?t(this.messages.requiredFieldLabel,{name:s}):s,class:f.label,key:`${n.id}-${o.uid}-${e.name}`},l=[z("div",{class:f.labelTextContent,key:"labelTextContainer"},s,a?z("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==i?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e)];return"date"===i&&"coded-value"!==e.domain?.type?z("label",{...r},l):z("calcite-label",{...r},l)}_renderFieldInput(e){const{dataType:t,domain:i,inputType:o,name:s}=e,n=this.getCommonInputProps(e);if("coded-value"===i?.type){const t=this.viewModel.getFieldValueOptionsForField(s,this.messages.empty);return"switch"!==o||e.hasInvalidSwitchValue?"radio-buttons"===o?this._renderRadioButtonComponents(e,t.flat(),n):this._renderComboBoxComponent(e,t,n):this._renderSwitchComponent(e,n)}return"datetime-picker"===o||"date"===t?this._renderDateComponents(e,n):"number"===t?this._renderNumberComponent(e,n):this._renderStringComponent(e,n)}_renderStringComponent(e,t){return"text-area"===e.inputType?t.readOnly?z("calcite-text-area",{...t,onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):z("calcite-text-area",{...t,resize:"vertical",onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):z("calcite-input",{...t,loading:e.updating,type:"text",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderNumberComponent(e,t){const i=p(e.field),o=i&&""!==t.value?Math.round(parseFloat(t.value)).toString():t.value;return z("calcite-input-number",{...t,integer:i,loading:e.updating,type:"number",value:o,onCalciteInputNumberInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderDateComponents(e,t){const{field:i}=e;switch(i.type){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,S(i,t.value,{timeZone:this.timeZone,...U(i)}))}}_renderDateOnlyFieldComponent(e,t){const{range:i,valid:o,value:s}=e,{class:n,key:a,readOnly:r}=t,{rawMax:l,rawMin:d}=i;return z("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!o,class:n,"data-date-part":"date","data-field-name":t[Q],key:`${a}-date-input`,max:v(l)?l:void 0,min:v(d)?d:void 0,numberingSystem:E,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:r,value:null!=s?`${s}`:void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{valid:i,value:o}=e,{class:s,key:n,readOnly:a}=t;return z("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!i,class:s,"data-date-part":"time","data-field-name":t[Q],key:`${n}-time-input`,numberingSystem:E,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:a,step:e.timeStep,value:null!=o?`${o}`:void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{name:i,range:o,timeZone:s,valid:n,value:a}=e,{class:r,key:l,readOnly:d}=t,{rawMax:c,rawMin:u}=o,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!n,numberingSystem:E,overlayPositioning:"fixed",readOnly:d,[Q]:i,onfocus:this._onComponentFocus},m=$(c,s),h=$(u,s),v=$(a,s);return z("div",{class:f.dateInputContainer,key:`${l}-date-time-container`},z("calcite-input-date-picker",{...p,class:r,"data-date-part":"date",key:`${l}-date-input`,max:m?.date??void 0,min:h?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),z("calcite-input-time-picker",{...p,class:r,"data-date-part":"time",key:`${l}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:e.timeStep,value:v.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),e.includeTimeOffset?z("calcite-input-time-zone",{...p,class:r,"data-date-part":"timeZone",disabled:d,key:`${l}-timezone-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.timeZoneOffset??"0",onCalciteInputTimeZoneChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderDateFieldComponents(e,t){const{includeTime:i,name:o,valid:s,value:n}=e,{class:a,key:r,max:l,min:d,readOnly:c}=t,{timeZone:u}=this,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!s,numberingSystem:E,overlayPositioning:"fixed",readOnly:c,[Q]:o,onfocus:this._onComponentFocus},m=j(n,u),h=j(l,u),v=j(d,u);return z("div",{class:f.dateInputContainer,key:`${r}-date-time-container`},z("calcite-input-date-picker",{...p,class:a,"data-date-part":"date",key:`${r}-date-input`,max:h?.date??void 0,min:v?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:m.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),i?z("calcite-input-time-picker",{...p,class:a,"data-date-part":"time",key:`${r}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:1,value:m.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return z("calcite-input",{...i,class:this.classes(f.fieldInput,f.inputDisabled),readOnly:!0,type:"text",value:null!=t?`${t}`:i.value})}_renderComboBoxComponent(e,t,i){const{value:o,name:s}=e,{viewModel:n,_inputsWithChanges:a}=this,r="INSERT"===n.editType,l=a.has(s),d=null==o&&(!r||l),c=r&&e.showNoValueOptionEnabled&&!l?()=>{}:i.onblur;return z("calcite-combobox",{...i,allowCustomValues:!1,clearDisabled:!0,onblur:c,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{d&&0===t.selectedItems.length?this._ignoreDeselectionOfNoValueOption(t):e.isSubtypeField&&0===t.selectedItems.length?t.value=`${e.value}`:this._saveValueFromComponent(t)}},this.renderComboboxOptionsList(e,t))}renderComboboxOptionsList(e,t){const{value:i,name:o}=e,{messages:s,messagesTemplates:n,viewModel:a,_inputsWithChanges:r}=this,[l,d,c]=t.map(e=>e.map(({name:e,value:t})=>z("calcite-combobox-item",{heading:e,key:`#${t}`,selected:i===t,value:`${t}`}))),u=[];d.length>0&&u.push(z("calcite-combobox-item-group",{key:"other",label:n.other},d)),c.length>0&&u.push(z("calcite-combobox-item-group",{key:"unsupported",label:s.subtypes.unsupportedDomainGroupTitle},c)),u.length>0?u.unshift(z("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):u.push(...l);const p="INSERT"===a.editType,m=r.has(o),h=null==i&&(!p||m);return e.showNoValueOptionEnabled&&u.unshift(z("calcite-combobox-item",{heading:e.showNoValueLabel||s.empty,key:"empty-option",selected:h,value:""})),u}_renderRadioButtonComponents(e,t,i){const{name:o,value:s}=e,n=t.map(({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,name:o,value:t,selected:t===s,props:i}));if(e.showNoValueOptionEnabled){const t="",a=e.showNoValueLabel||this.messages.empty,r=s===t||null===s;n.unshift(this._renderRadioButtonComponent({key:"empty-option",label:a,name:o,value:t,selected:r,props:i}))}return z("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:f.inputRadioGroup,"data-field-name":i[Q],key:`${i.key}-radio-group`,layout:"vertical",name:i.key,required:i.required},n)}_renderSwitchComponent(e,t){const{value:i}=e,o=!!I(e.element,"switch")&&i===e.element.input.onValue;return z("calcite-switch",{...t,checked:o,class:f.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldName=null},onCalciteSwitchChange:e=>this._saveValueFromComponent(e.currentTarget)})}_renderRadioButtonComponent({key:e,name:t,value:i,selected:o,label:s,props:n}){return z("calcite-label",{class:f.inputRadioLabel,key:e,layout:"inline"},z("calcite-radio-button",{...n,afterCreate:void 0,afterUpdate:void 0,checked:o,class:f.inputRadio,disabled:n.readOnly,name:t,onblur:()=>{this._focusedFieldName=null},value:i,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveValueFromComponent(e)}}),s)}_renderAuxiliaryText(e){const t=e.name,i=this._inputsWithChanges.has(t)&&!e.submittable?N(e,this.messages,this.timeZone):null!=this.viewModel.contingencyConstraintViolations.get(t)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=i?z("calcite-input-message",{icon:!0,status:"invalid"},i):this._inputsWithChanges.has(t)&&e.valueIsOutOfDomain?z("calcite-input-message",{icon:!0,status:"idle"},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){if(!e.showAllActionVisible||!this.callbacks?.showAllRelatedRecords)return;const i=this.messages;return z("calcite-list-item",{description:t(i.totalCount,{count:e.featureCount}),key:"show-all-related-features",label:i.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(e.relationshipId)},z("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderAddRelatedRecordButton(e){const{canAddRelatedFeature:t,relationshipId:i,relatedLayer:o,editable:s}=e,{messages:n,callbacks:a,disabled:r}=this,l=!s||r;if(t&&a?.addRelatedRecord&&o&&!l)return z("calcite-button",{alignment:"center",appearance:"outline-fill",class:f.centeredButton,disabled:e.updating||!e.originHasValidKey,iconStart:"plus",key:`${i}-add-button`,onclick:()=>{!e.updating&&e.originHasValidKey&&this._onAddRelatedRecordsClick(e,i,o)},round:!0,scale:"s",width:"full"},e.relatedLayerIsTable?n.addRecord:n.addFeature)}_renderRelatedRecordListItem(e,t,i){const{feature:o,description:s,title:n}=e,{feature:a,callbacks:r}=this,{highlightHelper:l}=this.viewModel,d=()=>{l?.removeAll(),r?.editRelatedRecord&&a&&r.editRelatedRecord({parentFeature:a,relationshipId:t,relatedFeature:o,readOnly:i})},c=l?()=>l.add(o):void 0,u=l?()=>l.remove(o):void 0;return z("calcite-list-item",{bind:this,description:s,key:`${t}-${o.uid}`,label:n,onmouseenter:c,onmouseleave:u,value:n,onCalciteListItemSelect:d},z("calcite-icon",{icon:M(o),slot:"content-start"}),z("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled)return;const{relationshipId:t,activeCategory:i}=e,o=i?null:this._renderDescriptionOrEmpty(e.description);return z("calcite-label",{class:this.classes(f.label,f.relatedRecordsLabel),key:`relationship-${t}-container`},z("div",null,this._renderRelatedRecordsHeaderContainer(e),o,this._renderRelationshipInputContent(e)),this._renderAddRelatedRecordButton(e))}_renderRelationshipInputContent(e){return e.featureCount>0?this._renderRelatedRecordsList(e):e.activeCategory&&0===e.featureCount?this._renderNoRelatedRecordsNotice():e.allCategories?.length?this._renderCategoryList(e):e.loaded?e.originHasValidKey?this._renderNoRelatedRecordsNotice():this._renderNoValidOriginKeyNotice(e):void 0}_renderCategoryList(e){return z("calcite-list",{displayMode:"flat",label:this.messages.relatedRecordsList,loading:e.updating},e.categories?.map(t=>this._renderCategory(e,t)),this._renderShowAllCategoriesListItem(e))}_renderCategory(e,t){const{count:o,name:s,value:n}=t,a=i(o);return z("calcite-list-item",{key:`${s}-${n}`,label:s,onCalciteListItemSelect:()=>this._selectCategory(e,t)},z("calcite-chip",{label:a,scale:"s",slot:"content-end"},a),z("calcite-icon",{flipRtl:!0,icon:"chevron-left",scale:"s",slot:"content-end"}))}_selectCategory(e,t){this.relationshipId=e.relationshipId,e.activeCategory=t}_renderShowAllCategoriesListItem(e){if(!e.showAllCategoriesVisible)return;const i=this.messages;return z("calcite-list-item",{description:t(i.totalCount,{count:e.allCategories?.length??0}),key:"show-all-categories",label:i.showAll,value:!0,onCalciteListItemSelect:()=>e.showAllEnabled=!0},z("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderRelatedRecordsHeaderContainer(e){const t=e.updating||!e.loaded;return z("div",{class:f.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},z("span",null,e.label),t?z("calcite-loader",{inline:!0,key:"loader",label:this.messagesCommon?.loading,scale:"s",type:"indeterminate"}):void 0)}_renderRelatedRecordsList(e){const{relationshipId:t,editable:i}=e,{disabled:o}=this,s=!i||o;return z("calcite-list",{class:f.relatedRecordsList,label:this.messages?.relatedRecordsList},e.relatedFeatureInfos.map(e=>this._renderRelatedRecordListItem(e,t,s)),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoValidOriginKeyNotice(e){const{messages:i}=this,o=e.relatedLayerIsTable?i.noOriginKeyRecord:i.noOriginKeyFeature,s=e.relationship?.keyField,n=this.viewModel.findField(s),a=e.layer?.fieldsIndex.get(s),r=n?.label||a?.alias||s,l=t(o,{relatedLayerName:e.relatedLayer?.title,originKeyField:r});return z("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},l))}_renderNoRelatedRecordsNotice(){return z("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return z("div",{afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved,bind:this,class:f.listObserver,key:"feature-observer"})}_renderTextElementInput(e){return z("div",{class:f.textElement,"data-testid":`text-element-${e.label}`,innerHTML:e.text,key:e.id})}getCommonInputProps(e){const{disabled:t}=this,{editable:i,hint:o,label:s,maxLength:n,minLength:a,name:r,range:{max:l,min:d},required:c,valid:u,value:p}=e,m=this._inputsWithChanges.has(r),h=!i||t;return{afterCreate:this._afterComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":u?"false":"true",class:this.classes(f.fieldInput,h?f.inputDisabled:null),status:m&&!u?"invalid":"idle",key:r,label:s,max:null!=l?l:void 0,min:null!=d?d:void 0,maxLength:n>-1?n:void 0,minLength:a>-1?a:void 0,placeholder:o??void 0,readOnly:h,required:c,value:null==p?"":`${p}`,onblur:this._onComponentBlur,onfocus:this._onComponentFocus,onkeydown:this._onComponentKeyDown,[Q]:r}}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(Q))}_afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e),i=e.dataset.datePart,o=this._dateComponentMap.get(t.name);if("valueAsDate"in e&&null!=e.value&&null!=t.value){const i=new ResizeObserver(()=>{switch(e.value=void 0,t.field.type){case"date":e.value=j(t.value,this.timeZone).date??"";break;case"timestamp-offset":e.value=$(t.value,this.timeZone).date??"";break;default:e.value=`${t.value}`}i.unobserve(e)});i.observe(e)}if(null!=o)switch(i){case"date":o.date=e;break;case"time":o.time=e;break;case"timeZone":o.timeZone=e}else this._dateComponentMap.set(t.name,{[i]:e});this._afterDateComponentCreateOrUpdate(e)}_afterDateComponentCreateOrUpdate(e){this._afterComponentCreateOrUpdate(e)}_afterComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);L(t)&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"}),this._afterComponentCreateOrUpdate(e)}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),o=t||i;o&&this._afterComponentCreateOrUpdate(o)}_afterComponentCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),o=t.findField(this._focusedFieldName);this._attemptFocusOnNextRender&&o===i&&(this._attemptFocusOnNextRender=!1,O(i)&&(i.group.open=!0),J(e))}async _afterGroupCreate(e){const t=this.viewModel.findGroup(e.id),i=this.viewModel.findField(this._focusedFieldName);i&&t&&T(i,t)&&(!i.editable||this.disabled)&&(await e.componentOnReady(),this._attemptFocusOnNextRender=!0,this.scheduleRender())}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=i.name}_onComponentBlur(e){const t=e.target;this._focusedFieldName=null;"readOnly"in t&&t.readOnly||this._saveValueFromComponent(t)}_saveValueFromDateComponent(e){const{timeZone:t}=this,i=this._getFieldInputFromHTMLElement(e),o=i.field.type,{name:s,range:n}=i,a=this._dateComponentMap.get(s);if(!a)return;let r=this.viewModel.getValue(s),l=null;"date-only"===o?l=Array.isArray(e.value)?e.value[0]:e.value:"time-only"===o?(r=P(r),l=P(e.value)):l="timestamp-offset"===o?null!=e.value?G({dateComponent:a.date,timeComponent:a.time,timeZoneComponent:a.timeZone,oldValue:r,defaultTimeZone:t}):null:null!=e.value?H({oldValue:r,dateComponent:a.date,timeComponent:a.time,timeZone:t,max:n.max,min:n.min}):null,null!==l&&e.value?r!==l&&this._updateFieldValue(s,l):this._updateFieldValue(s,null)}_saveValueFromComponent(e){const t=this._getFieldInputFromHTMLElement(e),i=this._parseValue(e),o=t.value;t.isSubtypeField&&A(this.layer,o,i)?this._pendingSubtypeChoice||i===o||(this._pendingSubtypeChoice=this._handleSubtypeChoice(t,i)):this._updateFieldValue(t.name,i)}async _handleSubtypeChoice(e,i){const{value:o,name:s}=e,{messages:a,viewModel:r,messagesCommon:l,_subtypes:d}=this;if(this._updateFieldValue(s,i),!d?.length)return;const c=d.find(e=>e.code===i),u=d.find(e=>e.code===o)?.name??`${o}`;if(!c)return;const p=n();r.pendingSubtypeChoice=p;let m="update-fields";const h=[{label:a.subtypes.useDefaultValuesOption,value:"update-fields"},{label:a.subtypes.keepCurrentValuesOption,value:"keep-existing"}],v={context:"info",title:a.subtypes.changeWarningTitle,message:t(a.subtypes.changeWarning,{originalType:u,newType:c.name}),radios:h,defaultRadioSelection:"update-fields",onRadioSelection:e=>m=e,actions:{primary:{label:l.apply,action:()=>p.resolve(m),type:"positive"},secondary:{label:l.cancel,type:"neutral",action:()=>p.resolve("undo")}},cancel:()=>p.reject()};try{this.showPrompt(v);switch(await p.promise){case"update-fields":r.applySubtypeDefaults(c),this._validateContingenciesForNonNullFields();break;case"keep-existing":this._validateContingenciesForNonNullFields();break;case"undo":this._updateFieldValue(e.name,o)}}finally{r.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_onComponentKeyDown({key:e,target:t}){const i=this._getFieldInputFromHTMLElement(t);"Enter"===e&&O(i)&&!i.group.open&&(i.group.open=!0)}_updateFieldValue(e,t){const i=this.viewModel.getValue(e);this.viewModel.setValue(e,t),this._inputsWithChanges.add(e);i!==t&&this.viewModel.fieldsWithContingentValues.has(e)&&this._validateContingenciesForNonNullFields()}_validateContingenciesForNonNullFields(){const e=Object.fromEntries(Object.entries(this.getValues()).filter(([e,t])=>null!=t));this.viewModel.validateContingencyConstraints(e)}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;return I(t.element,"switch")?e.checked?t.element.input.onValue:t.element.input.offValue:null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_ignoreDeselectionOfNoValueOption(e){const{firstChild:t,selectedItems:i}=e;0===i.length&&t&&"selected"in t?t.selected=!0:s.getLogger(this).warnOnce("Failed to override user attempt to deselect 'No value' option.")}_onGroupToggle(e,t){e.expanded?(t.open=!0,this._focusedFieldName=this._getFocusableInput("forward",t)?.name||null,this._attemptFocusOnNextRender=!0,"sequential"===this.groupDisplay&&this.viewModel.allGroupInputs.forEach(e=>{e!==t&&(e.open=!1)})):t.open=!1,this.scheduleRender()}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}_syncGroupInputStates(){if("sequential"!==this.groupDisplay)return;const e=this.viewModel.allGroupInputs;if(!e.length)return;const t=e.filter(e=>e.open);0===t.length?e[0].open=!0:t.length>1&&t.slice(1).forEach(e=>e.open=!1)}get test(){return{inputsWithChanges:this._inputsWithChanges,updateValue:this._saveValueFromComponent.bind(this)}}};e([c()],X.prototype,"_listObserverNode",void 0),e([c()],X.prototype,"_relatedRecordsEnabled",null),e([c()],X.prototype,"_utilityNetworkAssociationsEnabled",null),e([c()],X.prototype,"_prompt",void 0),e([c()],X.prototype,"_subtypes",null),e([c()],X.prototype,"associationId",null),e([c()],X.prototype,"associatedLayer",null),e([c()],X.prototype,"disabled",null),e([c()],X.prototype,"feature",null),e([c()],X.prototype,"_featureFormUNAssociationList",void 0),e([c()],X.prototype,"formTemplate",null),e([c()],X.prototype,"groupDisplay",void 0),e([c()],X.prototype,"headingLevel",void 0),e([c()],X.prototype,"icon",null),e([c()],X.prototype,"label",null),e([c()],X.prototype,"layer",null),e([c()],X.prototype,"map",null),e([c(),K("esri/widgets/FeatureForm/t9n/FeatureForm")],X.prototype,"messages",void 0),e([c(),K("esri/t9n/common")],X.prototype,"messagesCommon",void 0),e([c(),K("esri/widgets/Feature/t9n/Feature")],X.prototype,"messagesFeature",void 0),e([c(),K("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],X.prototype,"messagesTemplates",void 0),e([c()],X.prototype,"callbacks",null),e([c()],X.prototype,"relationshipId",null),e([c()],X.prototype,"spatialReference",null),e([c()],X.prototype,"strict",null),e([c()],X.prototype,"timeZone",null),e([c()],X.prototype,"showPrompt",null),e([c()],X.prototype,"clearPrompt",null),e([c({type:x}),q(["value-change","submit"])],X.prototype,"viewModel",void 0),e([c({type:D,nonNullable:!0})],X.prototype,"visibleElements",void 0),e([c()],X.prototype,"test",null),X=e([u("esri.widgets.FeatureForm")],X);const Y=X;export{Y as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t,formatNumber as i}from"../intl.js";import{isSome as o}from"../core/arrayUtils.js";import s from"../core/Logger.js";import{createResolver as n}from"../core/promiseUtils.js";import a from"../core/ReactiveMap.js";import{watch as r,whenOnce as l,initial as d}from"../core/reactiveUtils.js";import{property as c,subclass as u}from"../core/accessorSupport/decorators.js";import{isIntegerField as p}from"../layers/support/fieldUtils.js";import{isSubtypeGroupLayer as m,getSubtypesFromLayer as h}from"../layers/support/layerUtils.js";import{isString as v}from"../support/guards.js";import _ from"./Widget.js";import{Prompt as g}from"./Editor/components/Prompt.js";import{isRelatableFeatureSupportedLayer as b}from"./Feature/support/featureUtils.js";import{css as f}from"./FeatureForm/css.js";import{isUtilityNetworkAssociationInput as y,isGroupInput as C,isFieldInput as F,isRelationshipInput as w,isTextElementInput as R,flattenInputs as k,isInputInGroupInput as O,isFieldElementWithInputType as I,getErrorMessageForFieldInput as N,getIconForFeature as M,isNumberFieldInput as L,isInputInThisGroupInput as T,subtypeChangeShouldPrompt as A}from"./FeatureForm/featureFormUtils.js";import x from"./FeatureForm/FeatureFormViewModel.js";import D from"./FeatureForm/VisibleElements.js";import{loadCalciteComponents as V}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as S,getIntlOptionsForField as U,numberingSystem as E,prepareISOFieldValueForDateComponents as $,prepareUnixFieldValueForDateComponents as P,normalizeTimeOnlyString as j,getISOFieldValueFromDateComponents as G,getUnixFieldValueFromDateComponents as H}from"./support/dateUtils.js";import{globalCss as W}from"./support/globalCss.js";import{Heading as Z,incrementHeadingLevel as B}from"./support/Heading.js";import{messageBundle as K,vmEvent as q,tsx as z}from"./support/widget.js";import{setFocus as J}from"./support/widgetUtils.js";const Q="data-field-name";let X=class extends _{constructor(e,t){super(e,t),this._associationsWidgetsMap=new a,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._inputsWithChanges=new Set,this._focusedFieldName=null,this._pendingSubtypeChoice=null,this._listObserverNode=null,this._listObserver=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()},{root:window.document}),this._prompt=null,this._featureFormUNAssociationList=null,this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new x,this.visibleElements=new D,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,callbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t,i)=>{const{feature:o,callbacks:s}=this;let n=i;if(o&&s?.addRelatedRecord){if(m(i)&&e.activeCategory){const t=e.activeCategory.value,o=i.findSublayerForSubtypeCode(t);o&&b(o)&&(n=o)}s.addRelatedRecord({parentFeature:o,relatedLayer:n,relationshipId:t})}},this._onFormKeyDown=this._onFormKeyDown.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onGroupToggle=this._onGroupToggle.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentKeyDown=this._onComponentKeyDown.bind(this),this._afterComponentCreate=this._afterComponentCreate.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),this._afterGroupCreate=this._afterGroupCreate.bind(this)}initialize(){this.addHandles([r(()=>this.feature,()=>{this._inputsWithChanges.clear(),this._dateComponentMap.clear(),l(()=>!this.viewModel.updating).then(()=>{const e=this._getFocusableInput("forward");this._syncGroupInputStates(),this._focusedFieldName=e?.name||null,this._attemptFocusOnNextRender=!0})}),r(()=>[this._featureFormUNAssociationList,this.visibleElements.associationDetails],([e,t])=>{e&&(e.visibleElements.associationDetails=t)},d),r(()=>this.groupDisplay,()=>this._syncGroupInputStates()),this.on("submit",e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach(e=>this._inputsWithChanges.add(e)),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}}),r(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),r(()=>this.viewModel.activeAssociationInput,e=>{e&&this._featureFormUNAssociationList&&(this._featureFormUNAssociationList.associationInput=e,this._featureFormUNAssociationList.viewModel=e.viewModel)}),r(()=>this.viewModel.inputs.filter(y),async e=>{this._featureFormUNAssociationList||await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.has(t)||this._associationsWidgetsMap.set(t,await this._makeAssociationsWidget(t))})])}loadDependencies(){return V({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),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"),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"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area")})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){const{callbacks:e}=this;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get _utilityNetworkAssociationsEnabled(){const{callbacks:e}=this;return!(!e?.viewAssociatedLayers||!e.viewAssociatedFeatures)}get _subtypes(){return h(this.layer)}get associationId(){return this.viewModel.associationId}set associationId(e){this.viewModel.associationId=e}get associatedLayer(){return this.viewModel.associatedLayer}set associatedLayer(e){this.viewModel.associatedLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get icon(){return"form-field"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return z("div",{class:this.classes(f.base,W.widget,W.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return z("div",null,z("form",{class:f.form,inert:!!this._prompt,novalidate:!0,onkeydown:this._onFormKeyDown,onsubmit:this._onFormSubmit},this._renderReadOnlyNotice(),this._renderHeader(),this._renderContent()),this._prompt?z(g,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderReadOnlyNotice(){const{disabled:e,messages:t}=this;if(e&&this.visibleElements.readOnlyNotice)return z("calcite-notice",{class:f.disabledNotice,icon:"read-only-non-editable",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},t.disabledForm))}_renderHeader(){const e=this.viewModel,{formTitle:t,formDescription:i}=e;if(!e.formHeaderVisible)return;const o=null!=t&&z(Z,{key:"title",level:this.headingLevel},t),s=null!=i&&z("p",{class:f.description,key:"description"},i);return z("div",{class:f.formHeader},o,s)}_renderContent(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderRelationshipInput(e.activeRelationshipInput):e.activeAssociationInput?this._renderFeatureFormUtilityNetworkAssociationList():e.inputs.filter(o).filter(e=>e.visible).map(e=>this._renderInput(e))}_renderInput(e){return C(e)?this._renderGroup(e):F(e)?this._renderLabeledField(e):w(e)?this._renderRelationshipInput(e):R(e)?this._renderTextElementInput(e):y(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderFeatureFormUtilityNetworkAssociationList(){return this._featureFormUNAssociationList?.render()}_selectAssociatedLayer(e){const{feature:t,callbacks:i}=this;t&&i?.viewAssociatedFeatures&&i.viewAssociatedFeatures({associatedLayer:e.layer})}async _selectAssociatedFeature(e){const{feature:t,callbacks:i}=this;t&&i?.selectAssociatedFeature&&await i.selectAssociatedFeature({parentFeature:t,...e})}_onAddAssociation(e){const{feature:t,callbacks:i}=this;t&&i?.addAssociation&&i.addAssociation(e)}async _setUpUtilityNetworkAssociationList(){if(!this._featureFormUNAssociationList){const e=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js")).default;this._featureFormUNAssociationList=new e({onSelectLayer:this._selectAssociatedLayer.bind(this),onSelectFeature:this._selectAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)})}}async _makeAssociationsWidget(e){return new(0,(await import("./Feature/FeatureUtilityNetworkAssociations.js")).default)({onSelectAssociationType:({viewModel:t,listType:i})=>{t.activeAssociationType=i;const{feature:o,callbacks:s}=this;o&&s?.viewAssociatedLayers&&s.viewAssociatedLayers({associationId:e.uid})},viewModel:e.associationsViewModel})}_renderUtilityNetworkAssociationsElementInput(e){if(this._utilityNetworkAssociationsEnabled)return this._associationsWidgetsMap.get(e)?.render()}_renderDescriptionOrEmpty(e,t){return null==e?null:z("div",{class:this.classes(f.description),id:t},e)}_renderGroup(e){const{formTemplate:t,headingLevel:i}=this,{description:o,id:s,inputs:n,label:a,open:r}=e,l=n.filter(e=>e.visible),d=this.viewModel.findField(this._focusedFieldName),c=d?.group===e,u="sequential"===this.groupDisplay;return z("calcite-block",{afterCreate:this._afterGroupCreate,class:this.classes(f.group,u?f.groupSequential:null,c?f.groupActive:null),collapsible:!0,"data-group":e,description:o||void 0,expanded:r,heading:a??"",headingLevel:t?.title?B(i):i,id:s,key:s,onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},l.map(e=>this._renderInput(e)))}_getFocusableInput(e,t){const i=k(this.viewModel.inputs);let o;if("backward"===e&&i.reverse(),t)if(C(t)){const e=t.inputs.find(e=>e.visible);o=e?i.indexOf(e):0}else{let s;if(O(t)&&!t.group.open){const i=t.group.inputs.filter(F);s="forward"===e?i[i.length-1]:i[0]}else s=t;o=i.indexOf(s)+1}else o=0;for(let s=o;s<i.length;s++){const e=i[s];if(e.visible&&F(e)){if(this.disabled&&e.inputType&&("switch"===e.inputType||"radio-buttons"===e.inputType))continue;return e}}return null}_renderLabeledField(e){const{dataType:i,feature:o,label:s,layer:n,required:a}=e,r={"aria-label":a?t(this.messages.requiredFieldLabel,{name:s}):s,class:f.label,key:`${n.id}-${o.uid}-${e.name}`},l=[z("div",{class:f.labelTextContent,key:"labelTextContainer"},s,a?z("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==i?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e)];return"date"===i&&"coded-value"!==e.domain?.type?z("label",{...r},l):z("calcite-label",{...r},l)}_renderFieldInput(e){const{dataType:t,domain:i,inputType:o,name:s}=e,n=this.getCommonInputProps(e);if("coded-value"===i?.type){const t=this.viewModel.getFieldValueOptionsForField(s,this.messages.empty);return"switch"!==o||e.hasInvalidSwitchValue?"radio-buttons"===o?this._renderRadioButtonComponents(e,t.flat(),n):this._renderComboBoxComponent(e,t,n):this._renderSwitchComponent(e,n)}return"datetime-picker"===o||"date"===t?this._renderDateComponents(e,n):"number"===t?this._renderNumberComponent(e,n):this._renderStringComponent(e,n)}_renderStringComponent(e,t){return"text-area"===e.inputType?t.readOnly?z("calcite-text-area",{...t,onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):z("calcite-text-area",{...t,resize:"vertical",onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):z("calcite-input",{...t,loading:e.updating,type:"text",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderNumberComponent(e,t){const i=p(e.field),o=i&&""!==t.value?Math.round(parseFloat(t.value)).toString():t.value;return z("calcite-input-number",{...t,integer:i,loading:e.updating,type:"number",value:o,onCalciteInputNumberInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderDateComponents(e,t){const{field:i}=e;switch(i.type){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,S(i,t.value,{timeZone:this.timeZone,...U(i)}))}}_renderDateOnlyFieldComponent(e,t){const{range:i,valid:o,value:s}=e,{class:n,key:a,readOnly:r}=t,{rawMax:l,rawMin:d}=i;return z("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!o,class:n,"data-date-part":"date","data-field-name":t[Q],key:`${a}-date-input`,max:v(l)?l:void 0,min:v(d)?d:void 0,numberingSystem:E,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:r,value:null!=s?`${s}`:void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{valid:i,value:o}=e,{class:s,key:n,readOnly:a}=t;return z("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!i,class:s,"data-date-part":"time","data-field-name":t[Q],key:`${n}-time-input`,numberingSystem:E,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:a,step:e.timeStep,value:null!=o?`${o}`:void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{name:i,range:o,timeZone:s,valid:n,value:a}=e,{class:r,key:l,readOnly:d}=t,{rawMax:c,rawMin:u}=o,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!n,numberingSystem:E,overlayPositioning:"fixed",readOnly:d,[Q]:i,onfocus:this._onComponentFocus},m=$(c,s),h=$(u,s),v=$(a,s);return z("div",{class:f.dateInputContainer,key:`${l}-date-time-container`},z("calcite-input-date-picker",{...p,class:r,"data-date-part":"date",key:`${l}-date-input`,max:m?.date??void 0,min:h?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),z("calcite-input-time-picker",{...p,class:r,"data-date-part":"time",key:`${l}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:e.timeStep,value:v.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),e.includeTimeOffset?z("calcite-input-time-zone",{...p,class:r,"data-date-part":"timeZone",disabled:d,key:`${l}-timezone-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.timeZoneOffset??"0",onCalciteInputTimeZoneChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderDateFieldComponents(e,t){const{includeTime:i,name:o,valid:s,value:n}=e,{class:a,key:r,max:l,min:d,readOnly:c}=t,{timeZone:u}=this,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!s,numberingSystem:E,overlayPositioning:"fixed",readOnly:c,[Q]:o,onfocus:this._onComponentFocus},m=P(n,u),h=P(l,u),v=P(d,u);return z("div",{class:f.dateInputContainer,key:`${r}-date-time-container`},z("calcite-input-date-picker",{...p,class:a,"data-date-part":"date",key:`${r}-date-input`,max:h?.date??void 0,min:v?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:m.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),i?z("calcite-input-time-picker",{...p,class:a,"data-date-part":"time",key:`${r}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:1,value:m.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return z("calcite-input",{...i,class:this.classes(f.fieldInput,f.inputDisabled),readOnly:!0,type:"text",value:null!=t?`${t}`:i.value})}_renderComboBoxComponent(e,t,i){const{value:o,name:s}=e,{viewModel:n,_inputsWithChanges:a}=this,r="INSERT"===n.editType,l=a.has(s),d=null==o&&(!r||l),c=r&&e.showNoValueOptionEnabled&&!l?()=>{}:i.onblur;return z("calcite-combobox",{...i,allowCustomValues:!1,clearDisabled:!0,onblur:c,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{d&&0===t.selectedItems.length?this._ignoreDeselectionOfNoValueOption(t):e.isSubtypeField&&0===t.selectedItems.length?t.value=`${e.value}`:this._saveValueFromComponent(t)}},this.renderComboboxOptionsList(e,t))}renderComboboxOptionsList(e,t){const{value:i,name:o}=e,{messages:s,messagesTemplates:n,viewModel:a,_inputsWithChanges:r}=this,[l,d,c]=t.map(e=>e.map(({name:e,value:t})=>z("calcite-combobox-item",{heading:e,key:`#${t}`,selected:i===t,value:`${t}`}))),u=[];d.length>0&&u.push(z("calcite-combobox-item-group",{key:"other",label:n.other},d)),c.length>0&&u.push(z("calcite-combobox-item-group",{key:"unsupported",label:s.subtypes.unsupportedDomainGroupTitle},c)),u.length>0?u.unshift(z("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):u.push(...l);const p="INSERT"===a.editType,m=r.has(o),h=null==i&&(!p||m);return e.showNoValueOptionEnabled&&u.unshift(z("calcite-combobox-item",{heading:e.showNoValueLabel||s.empty,key:"empty-option",selected:h,value:""})),u}_renderRadioButtonComponents(e,t,i){const{name:o,value:s}=e,n=t.map(({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,name:o,value:t,selected:t===s,props:i}));if(e.showNoValueOptionEnabled){const t="",a=e.showNoValueLabel||this.messages.empty,r=s===t||null===s;n.unshift(this._renderRadioButtonComponent({key:"empty-option",label:a,name:o,value:t,selected:r,props:i}))}return z("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:f.inputRadioGroup,"data-field-name":i[Q],key:`${i.key}-radio-group`,layout:"vertical",name:i.key,required:i.required},n)}_renderSwitchComponent(e,t){const{value:i}=e,o=!!I(e.element,"switch")&&i===e.element.input.onValue;return z("calcite-switch",{...t,checked:o,class:f.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldName=null},onCalciteSwitchChange:e=>this._saveValueFromComponent(e.currentTarget)})}_renderRadioButtonComponent({key:e,name:t,value:i,selected:o,label:s,props:n}){return z("calcite-label",{class:f.inputRadioLabel,key:e,layout:"inline"},z("calcite-radio-button",{...n,afterCreate:void 0,afterUpdate:void 0,checked:o,class:f.inputRadio,disabled:n.readOnly,name:t,onblur:()=>{this._focusedFieldName=null},value:i,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveValueFromComponent(e)}}),s)}_renderAuxiliaryText(e){const t=e.name,i=this._inputsWithChanges.has(t)&&!e.submittable?N(e,this.messages,this.timeZone):null!=this.viewModel.contingencyConstraintViolations.get(t)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=i?z("calcite-input-message",{icon:!0,status:"invalid"},i):this._inputsWithChanges.has(t)&&e.valueIsOutOfDomain?z("calcite-input-message",{icon:!0,status:"idle"},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){if(!e.showAllActionVisible||!this.callbacks?.showAllRelatedRecords)return;const i=this.messages;return z("calcite-list-item",{description:t(i.totalCount,{count:e.featureCount}),key:"show-all-related-features",label:i.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(e.relationshipId)},z("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderAddRelatedRecordButton(e){const{canAddRelatedFeature:t,relationshipId:i,relatedLayer:o,editable:s}=e,{messages:n,callbacks:a,disabled:r}=this,l=!s||r;if(t&&a?.addRelatedRecord&&o&&!l)return z("calcite-button",{alignment:"center",appearance:"outline-fill",class:f.centeredButton,disabled:e.updating||!e.originHasValidKey,iconStart:"plus",key:`${i}-add-button`,onclick:()=>{!e.updating&&e.originHasValidKey&&this._onAddRelatedRecordsClick(e,i,o)},round:!0,scale:"s",width:"full"},e.relatedLayerIsTable?n.addRecord:n.addFeature)}_renderRelatedRecordListItem(e,t,i){const{feature:o,description:s,title:n}=e,{feature:a,callbacks:r}=this,{highlightHelper:l}=this.viewModel,d=()=>{l?.removeAll(),r?.editRelatedRecord&&a&&r.editRelatedRecord({parentFeature:a,relationshipId:t,relatedFeature:o,readOnly:i})},c=l?()=>l.add(o):void 0,u=l?()=>l.remove(o):void 0;return z("calcite-list-item",{bind:this,description:s,key:`${t}-${o.uid}`,label:n,onmouseenter:c,onmouseleave:u,value:n,onCalciteListItemSelect:d},z("calcite-icon",{icon:M(o),slot:"content-start"}),z("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled)return;const{relationshipId:t,activeCategory:i}=e,o=i?null:this._renderDescriptionOrEmpty(e.description);return z("calcite-label",{class:this.classes(f.label,f.relatedRecordsLabel),key:`relationship-${t}-container`},z("div",null,this._renderRelatedRecordsHeaderContainer(e),o,this._renderRelationshipInputContent(e)),this._renderAddRelatedRecordButton(e))}_renderRelationshipInputContent(e){return e.featureCount>0?this._renderRelatedRecordsList(e):e.activeCategory&&0===e.featureCount?this._renderNoRelatedRecordsNotice():e.allCategories?.length?this._renderCategoryList(e):e.loaded?e.originHasValidKey?this._renderNoRelatedRecordsNotice():this._renderNoValidOriginKeyNotice(e):void 0}_renderCategoryList(e){return z("calcite-list",{displayMode:"flat",label:this.messages.relatedRecordsList,loading:e.updating},e.categories?.map(t=>this._renderCategory(e,t)),this._renderShowAllCategoriesListItem(e))}_renderCategory(e,t){const{count:o,name:s,value:n}=t,a=i(o);return z("calcite-list-item",{key:`${s}-${n}`,label:s,onCalciteListItemSelect:()=>this._selectCategory(e,t)},z("calcite-chip",{label:a,scale:"s",slot:"content-end"},a),z("calcite-icon",{flipRtl:!0,icon:"chevron-left",scale:"s",slot:"content-end"}))}_selectCategory(e,t){this.relationshipId=e.relationshipId,e.activeCategory=t}_renderShowAllCategoriesListItem(e){if(!e.showAllCategoriesVisible)return;const i=this.messages;return z("calcite-list-item",{description:t(i.totalCount,{count:e.allCategories?.length??0}),key:"show-all-categories",label:i.showAll,value:!0,onCalciteListItemSelect:()=>e.showAllEnabled=!0},z("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderRelatedRecordsHeaderContainer(e){const t=e.updating||!e.loaded;return z("div",{class:f.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},z("span",null,e.label),t?z("calcite-loader",{inline:!0,key:"loader",label:this.messagesCommon?.loading,scale:"s",type:"indeterminate"}):void 0)}_renderRelatedRecordsList(e){const{relationshipId:t,editable:i}=e,{disabled:o}=this,s=!i||o;return z("calcite-list",{class:f.relatedRecordsList,label:this.messages?.relatedRecordsList},e.relatedFeatureInfos.map(e=>this._renderRelatedRecordListItem(e,t,s)),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoValidOriginKeyNotice(e){const{messages:i}=this,o=e.relatedLayerIsTable?i.noOriginKeyRecord:i.noOriginKeyFeature,s=e.relationship?.keyField,n=this.viewModel.findField(s),a=e.layer?.fieldsIndex.get(s),r=n?.label||a?.alias||s,l=t(o,{relatedLayerName:e.relatedLayer?.title,originKeyField:r});return z("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},l))}_renderNoRelatedRecordsNotice(){return z("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return z("div",{afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved,bind:this,class:f.listObserver,key:"feature-observer"})}_renderTextElementInput(e){return z("div",{class:f.textElement,"data-testid":`text-element-${e.label}`,innerHTML:e.text,key:e.id})}getCommonInputProps(e){const{disabled:t}=this,{editable:i,hint:o,label:s,maxLength:n,minLength:a,name:r,range:{max:l,min:d},required:c,valid:u,value:p}=e,m=this._inputsWithChanges.has(r),h=!i||t;return{afterCreate:this._afterComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":u?"false":"true",class:this.classes(f.fieldInput,h?f.inputDisabled:null),status:m&&!u?"invalid":"idle",key:r,label:s,max:null!=l?l:void 0,min:null!=d?d:void 0,maxLength:n>-1?n:void 0,minLength:a>-1?a:void 0,placeholder:o??void 0,readOnly:h,required:c,value:null==p?"":`${p}`,onblur:this._onComponentBlur,onfocus:this._onComponentFocus,onkeydown:this._onComponentKeyDown,[Q]:r}}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(Q))}_afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e),i=e.dataset.datePart,o=this._dateComponentMap.get(t.name);if("valueAsDate"in e&&null!=e.value&&null!=t.value){const i=new ResizeObserver(()=>{switch(e.value=void 0,t.field.type){case"date":e.value=P(t.value,this.timeZone).date??"";break;case"timestamp-offset":e.value=$(t.value,this.timeZone).date??"";break;default:e.value=`${t.value}`}i.unobserve(e)});i.observe(e)}if(null!=o)switch(i){case"date":o.date=e;break;case"time":o.time=e;break;case"timeZone":o.timeZone=e}else this._dateComponentMap.set(t.name,{[i]:e});this._afterDateComponentCreateOrUpdate(e)}_afterDateComponentCreateOrUpdate(e){this._afterComponentCreateOrUpdate(e)}_afterComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);L(t)&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"}),this._afterComponentCreateOrUpdate(e)}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),o=t||i;o&&this._afterComponentCreateOrUpdate(o)}_afterComponentCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),o=t.findField(this._focusedFieldName);this._attemptFocusOnNextRender&&o===i&&(this._attemptFocusOnNextRender=!1,O(i)&&(i.group.open=!0),J(e))}async _afterGroupCreate(e){const t=this.viewModel.findGroup(e.id),i=this.viewModel.findField(this._focusedFieldName);i&&t&&T(i,t)&&(!i.editable||this.disabled)&&(await e.componentOnReady(),this._attemptFocusOnNextRender=!0,this.scheduleRender())}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=i.name}_onComponentBlur(e){const t=e.target;this._focusedFieldName=null;"readOnly"in t&&t.readOnly||this._saveValueFromComponent(t)}_saveValueFromDateComponent(e){const{timeZone:t}=this,i=this._getFieldInputFromHTMLElement(e),o=i.field.type,{name:s,range:n}=i,a=this._dateComponentMap.get(s);if(!a)return;let r=this.viewModel.getValue(s),l=null;"date-only"===o?l=Array.isArray(e.value)?e.value[0]:e.value:"time-only"===o?(r=j(r),l=j(e.value)):l="timestamp-offset"===o?null!=e.value?G({dateComponent:a.date,timeComponent:a.time,timeZoneComponent:a.timeZone,oldValue:r,defaultTimeZone:t}):null:null!=e.value?H({oldValue:r,dateComponent:a.date,timeComponent:a.time,timeZone:t,max:n.max,min:n.min}):null,null!==l&&e.value?r!==l&&this._updateFieldValue(s,l):this._updateFieldValue(s,null)}_saveValueFromComponent(e){const t=this._getFieldInputFromHTMLElement(e),i=this._parseValue(e),o=t.value;t.isSubtypeField&&A(this.layer,o,i)?this._pendingSubtypeChoice||i===o||(this._pendingSubtypeChoice=this._handleSubtypeChoice(t,i)):this._updateFieldValue(t.name,i)}async _handleSubtypeChoice(e,i){const{value:o,name:s}=e,{messages:a,viewModel:r,messagesCommon:l,_subtypes:d}=this;if(this._updateFieldValue(s,i),!d?.length)return;const c=d.find(e=>e.code===i),u=d.find(e=>e.code===o)?.name??`${o}`;if(!c)return;const p=n();r.pendingSubtypeChoice=p;let m="update-fields";const h=[{label:a.subtypes.useDefaultValuesOption,value:"update-fields"},{label:a.subtypes.keepCurrentValuesOption,value:"keep-existing"}],v={context:"info",title:a.subtypes.changeWarningTitle,message:t(a.subtypes.changeWarning,{originalType:u,newType:c.name}),radios:h,defaultRadioSelection:"update-fields",onRadioSelection:e=>m=e,actions:{primary:{label:l.apply,action:()=>p.resolve(m),type:"positive"},secondary:{label:l.cancel,type:"neutral",action:()=>p.resolve("undo")}},cancel:()=>p.reject()};try{this.showPrompt(v);switch(await p.promise){case"update-fields":r.applySubtypeDefaults(c),this._validateContingenciesForNonNullFields();break;case"keep-existing":this._validateContingenciesForNonNullFields();break;case"undo":this._updateFieldValue(e.name,o)}}finally{r.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_onComponentKeyDown({key:e,target:t}){const i=this._getFieldInputFromHTMLElement(t);"Enter"===e&&O(i)&&!i.group.open&&(i.group.open=!0)}_updateFieldValue(e,t){const i=this.viewModel.getValue(e);this.viewModel.setValue(e,t),this._inputsWithChanges.add(e);i!==t&&this.viewModel.fieldsWithContingentValues.has(e)&&this._validateContingenciesForNonNullFields()}_validateContingenciesForNonNullFields(){const e=Object.fromEntries(Object.entries(this.getValues()).filter(([e,t])=>null!=t));this.viewModel.validateContingencyConstraints(e)}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;return I(t.element,"switch")?e.checked?t.element.input.onValue:t.element.input.offValue:null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_ignoreDeselectionOfNoValueOption(e){const{firstChild:t,selectedItems:i}=e;0===i.length&&t&&"selected"in t?t.selected=!0:s.getLogger(this).warnOnce("Failed to override user attempt to deselect 'No value' option.")}_onGroupToggle(e,t){e.expanded?(t.open=!0,this._focusedFieldName=this._getFocusableInput("forward",t)?.name||null,this._attemptFocusOnNextRender=!0,"sequential"===this.groupDisplay&&this.viewModel.allGroupInputs.forEach(e=>{e!==t&&(e.open=!1)})):t.open=!1,this.scheduleRender()}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}_syncGroupInputStates(){if("sequential"!==this.groupDisplay)return;const e=this.viewModel.allGroupInputs;if(!e.length)return;const t=e.filter(e=>e.open);0===t.length?e[0].open=!0:t.length>1&&t.slice(1).forEach(e=>e.open=!1)}get test(){return{inputsWithChanges:this._inputsWithChanges,updateValue:this._saveValueFromComponent.bind(this)}}};e([c()],X.prototype,"_listObserverNode",void 0),e([c()],X.prototype,"_relatedRecordsEnabled",null),e([c()],X.prototype,"_utilityNetworkAssociationsEnabled",null),e([c()],X.prototype,"_prompt",void 0),e([c()],X.prototype,"_subtypes",null),e([c()],X.prototype,"associationId",null),e([c()],X.prototype,"associatedLayer",null),e([c()],X.prototype,"disabled",null),e([c()],X.prototype,"feature",null),e([c()],X.prototype,"_featureFormUNAssociationList",void 0),e([c()],X.prototype,"formTemplate",null),e([c()],X.prototype,"groupDisplay",void 0),e([c()],X.prototype,"headingLevel",void 0),e([c()],X.prototype,"icon",null),e([c()],X.prototype,"label",null),e([c()],X.prototype,"layer",null),e([c()],X.prototype,"map",null),e([c(),K("esri/widgets/FeatureForm/t9n/FeatureForm")],X.prototype,"messages",void 0),e([c(),K("esri/t9n/common")],X.prototype,"messagesCommon",void 0),e([c(),K("esri/widgets/Feature/t9n/Feature")],X.prototype,"messagesFeature",void 0),e([c(),K("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],X.prototype,"messagesTemplates",void 0),e([c()],X.prototype,"callbacks",null),e([c()],X.prototype,"relationshipId",null),e([c()],X.prototype,"spatialReference",null),e([c()],X.prototype,"strict",null),e([c()],X.prototype,"timeZone",null),e([c()],X.prototype,"showPrompt",null),e([c()],X.prototype,"clearPrompt",null),e([c({type:x}),q(["value-change","submit"])],X.prototype,"viewModel",void 0),e([c({type:D,nonNullable:!0})],X.prototype,"visibleElements",void 0),e([c()],X.prototype,"test",null),X=e([u("esri.widgets.FeatureForm")],X);const Y=X;export{Y as default};
@@ -3,7 +3,7 @@ import type TemplateItem from "./TemplateItem.js";
3
3
  import type TemplateItemGroup from "./TemplateItemGroup.js";
4
4
  import type { EventedAccessor, EventedMixinProperties } from "../../core/Evented.js";
5
5
  import type { AnyEditingTemplateInfo } from "../../editing/types.js";
6
- import type { LayerWithFeatureTemplatesUnion } from "../../layers/support/editableLayers.js";
6
+ import type { LayerWithFeatureTemplatesUnion } from "../../layers/types.js";
7
7
  import type { Filter, GroupByType } from "./types.js";
8
8
 
9
9
  export interface FeatureTemplatesViewModelProperties extends EventedMixinProperties, Partial<Pick<FeatureTemplatesViewModel, "disabled" | "filterFunction" | "groupBy" | "layers">> {}
@@ -1,6 +1,6 @@
1
1
  import type Accessor from "../../core/Accessor.js";
2
2
  import type { AnyEditingTemplateInfo } from "../../editing/types.js";
3
- import type { LayerWithFeatureTemplatesUnion } from "../../layers/support/editableLayers.js";
3
+ import type { LayerWithFeatureTemplatesUnion } from "../../layers/types.js";
4
4
 
5
5
  export interface TemplateItemProperties extends Partial<Pick<TemplateItem, "description" | "label" | "layer" | "template" | "thumbnail">> {}
6
6
 
@@ -1,5 +1,5 @@
1
1
  import type { AnyEditingTemplateInfo } from "../../editing/types.js";
2
- import type { LayerWithFeatureTemplatesUnion } from "../../layers/support/editableLayers.js";
2
+ import type { LayerWithFeatureTemplatesUnion } from "../../layers/types.js";
3
3
 
4
4
  /**
5
5
  * The function used when setting the [FeatureTemplates#groupBy](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#groupBy) property. It is
@@ -13,7 +13,6 @@ import type { TimeZone } from "../time/types.js";
13
13
  import type { MapViewOrSceneView } from "../views/MapViewOrSceneView.js";
14
14
  import type { FetchPopupFeaturesResult } from "../views/types.js";
15
15
  import type { WidgetProperties } from "./Widget.js";
16
- import type { FeatureContentMixin, FeatureContentMixinProperties } from "./Feature/support/FeatureContentMixin.js";
17
16
  import type { FeaturesViewModelEvents, FeaturesViewModelProperties } from "./Features/FeaturesViewModel.js";
18
17
  import type { PopupOpenOptions, FetchFeaturesOptions, InitialDisplayOptions } from "./Popup/types.js";
19
18
  import type { HeadingLevel, GoToOverride } from "./support/types.js";
@@ -21,7 +20,7 @@ import type { ActionBaseProperties } from "../support/actions/ActionBase.js";
21
20
  import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
22
21
  import type { FeaturesVisibleElementsProperties } from "./Features/FeaturesVisibleElements.js";
23
22
 
24
- export interface FeaturesProperties extends WidgetProperties, FeatureContentMixinProperties, Partial<Pick<Features, "collapsed" | "content" | "featureNavigationTop" | "features" | "goToOverride" | "headingLevel" | "initialDisplayMode" | "map" | "promises" | "selectedFeatureIndex" | "timeZone" | "title" | "view">> {
23
+ export interface FeaturesProperties extends WidgetProperties, Partial<Pick<Features, "collapsed" | "content" | "featureNavigationTop" | "features" | "goToOverride" | "headingLevel" | "initialDisplayMode" | "map" | "promises" | "selectedFeatureIndex" | "timeZone" | "title" | "view">> {
25
24
  /**
26
25
  * The actions that are displayed in the header of the widget.
27
26
  *
@@ -133,7 +132,7 @@ export interface FeaturesEvents extends FeaturesViewModelEvents {}
133
132
  * })
134
133
  * });
135
134
  */
136
- export default class Features extends FeaturesSuperclass {
135
+ export default class Features extends Widget {
137
136
  /**
138
137
  * @deprecated
139
138
  * Do not directly reference this property.
@@ -497,5 +496,4 @@ export default class Features extends FeaturesSuperclass {
497
496
  * @param actionIndex - The index of the [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Features-FeaturesViewModel.html#actions) to execute.
498
497
  */
499
498
  triggerAction(actionIndex: number): void;
500
- }
501
- declare const FeaturesSuperclass: typeof Widget & typeof FeatureContentMixin
499
+ }
@@ -1,8 +1,7 @@
1
1
  import type PortalItem from "../../portal/PortalItem.js";
2
2
  import type { JSONSupport, JSONSupportMixinProperties } from "../../core/JSONSupport.js";
3
3
  import type { Unit } from "../../core/units.js";
4
- import type { FileFormat } from "../../rest/support/fileFormat.js";
5
- import type { LayoutTemplate } from "../../rest/support/layoutTemplate.js";
4
+ import type { PrintLayoutTemplate, PrintFileFormat } from "../../rest/support/types.js";
6
5
  import type { LayoutTemplateInfo, MapSurroundInfo } from "./types.js";
7
6
 
8
7
  export interface CustomTemplateProperties extends JSONSupportMixinProperties, Partial<Pick<CustomTemplate, "format">> {}
@@ -44,7 +43,7 @@ export default class CustomTemplate extends JSONSupport {
44
43
  /** The template's description. */
45
44
  get description(): string | null | undefined;
46
45
  /** The output format for the printed map. */
47
- format?: FileFormat | null;
46
+ format?: PrintFileFormat | null;
48
47
  /**
49
48
  * Unique id for the template.
50
49
  *
@@ -74,7 +73,7 @@ export default class CustomTemplate extends JSONSupport {
74
73
  * tabloid-ansi-b-landscape| Tabloid ANSI B Landscape
75
74
  * tabloid-ansi-b-portrait | Tabloid ANSI B Portrait
76
75
  */
77
- get layout(): LayoutTemplate | null | undefined;
76
+ get layout(): PrintLayoutTemplate | null | undefined;
78
77
  /** The portal item associated with layout (if any). */
79
78
  get layoutItem(): PortalItem | null | undefined;
80
79
  /** Defines the layout elements. It's an object with the following property: */
@@ -1,7 +1,6 @@
1
1
  import type Accessor from "../../core/Accessor.js";
2
2
  import type PortalItem from "../../portal/PortalItem.js";
3
- import type { FileFormat } from "../../rest/support/fileFormat.js";
4
- import type { LayoutTemplate } from "../../rest/support/layoutTemplate.js";
3
+ import type { PrintFileFormat, PrintLayoutTemplate } from "../../rest/support/types.js";
5
4
  import type { PortalItemProperties } from "../../portal/PortalItem.js";
6
5
 
7
6
  export interface TemplateOptionsProperties extends Partial<Pick<TemplateOptions, "attributionEnabled" | "author" | "copyright" | "customTextElements" | "dpi" | "fileName" | "forceFeatureAttributes" | "format" | "height" | "includeTables" | "layout" | "legendEnabled" | "northArrowEnabled" | "scale" | "scaleBarEnabled" | "scaleBarUnit" | "scaleEnabled" | "title" | "width">> {
@@ -98,7 +97,7 @@ export default class TemplateOptions extends Accessor {
98
97
  *
99
98
  * @default "pdf"
100
99
  */
101
- accessor format: FileFormat;
100
+ accessor format: PrintFileFormat;
102
101
  /**
103
102
  * Map height.
104
103
  * This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`.
@@ -143,7 +142,7 @@ export default class TemplateOptions extends Accessor {
143
142
  *
144
143
  * @default "letter-ansi-a-landscape"
145
144
  */
146
- accessor layout: LayoutTemplate | null | undefined;
145
+ accessor layout: PrintLayoutTemplate | null | undefined;
147
146
  /**
148
147
  * A custom layout hosted as a [portal item](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html). To use this property, the print service
149
148
  * must be hosted on an ArcGIS Server that is federated with the same portal as the portal item.
@@ -1,5 +1,4 @@
1
- import type { FileFormat } from "../../rest/support/fileFormat.js";
2
- import type { LayoutTemplate } from "../../rest/support/layoutTemplate.js";
1
+ import type { PrintLayoutTemplate, PrintFileFormat } from "../../rest/support/types.js";
3
2
 
4
3
  export interface TemplateInfo<ValueType> {
5
4
  /** A list of supported layouts. */
@@ -10,9 +9,9 @@ export interface TemplateInfo<ValueType> {
10
9
 
11
10
  export interface TemplatesInfo {
12
11
  /** Metadata about the available output formats. */
13
- format: TemplateInfo<FileFormat>;
12
+ format: TemplateInfo<PrintFileFormat>;
14
13
  /** Metadata about the available page layouts. */
15
- layout: TemplateInfo<LayoutTemplate>;
14
+ layout: TemplateInfo<PrintLayoutTemplate>;
16
15
  }
17
16
 
18
17
  export type Layout = string;
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{isSome as i}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import"../../core/has.js";import{deprecateUnnecessaryViewModel as s}from"../../core/deprecate.js";import o from"../../core/Logger.js";import{abortMaybe as n,destroyMaybe as a}from"../../core/maybe.js";import{after as l,throwIfAborted as u}from"../../core/promiseUtils.js";import{watch as d,syncAndInitial as p}from"../../core/reactiveUtils.js";import{createScreenPointArray as h,createRenderScreenPointArray as c}from"../../core/screenUtils.js";import{convertTime as m,offsetDateUTC as f}from"../../core/timeUtils.js";import{property as _,subclass as g}from"../../core/accessorSupport/decorators.js";import{create as v}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{longitudeToTimezone as y}from"../../views/3d/support/earthUtils.js";import{computeDirectionsOverTime as w}from"../../views/3d/support/sunUtils.js";import D from"./DiscreteOptions.js";import T from"./DurationOptions.js";import{ShadowTooltipViewModel as O}from"./ShadowTooltipViewModel.js";import P from"./ThresholdOptions.js";import{breadthFirstBinaryPartitioning as C}from"../support/traversalUtils.js";const b=[],z=v(),V=[],U=255,j=m(1,"hours","milliseconds"),x=500;let E=class extends e{constructor(t){super(t),this.view=null,this.tooltip=new O({getDuration:t=>this.getDuration(t)}),this.startTimeOfDay=m(10,"hours","milliseconds"),this.endTimeOfDay=m(16,"hours","milliseconds"),this.visualizationType="threshold",this.thresholdOptions=new P({isDefaultViewModel:!0}),this.durationOptions=new T({isDefaultViewModel:!0}),this.discreteOptions=new D({isDefaultViewModel:!0}),this._running=!0,this._stopPreviewingTask=null,this._forcePreview=!1,this._autoRestoreForcePreviewEnabled=!0,this._utcOffset=null,t?.isDefaultViewModel||s(o.getLogger(this),"Shadow Cast","arcgis-shadow-cast",{version:"5.0"}),this.date=new Date}normalizeCtorArgs(t){const{isDefaultViewModel:e,...i}=t??{};return i}initialize(){this.addHandles([d(()=>({view:this.view,tooltipEnabled:this._tooltipEnabled}),({view:t,tooltipEnabled:e})=>{this.tooltip.view=t,this.tooltip.enabled=e},p),d(()=>this._forcePreviewDependencies,()=>{n(this._stopPreviewingTask),this._forcePreview=!0,this._autoRestoreForcePreviewEnabled&&(this._stopPreviewingTask=r(async t=>{await l(x,t),u(t),this._forcePreview=!1}))},p),d(()=>({renderer:this.renderer,parameters:this._visualizationParameters}),t=>A(t.renderer,t.parameters),p),d(()=>({renderer:this.renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext}),t=>A(t.renderer,{lightDirections:t.lightDirections,lightDirectionsContext:t.lightDirectionsContext}),p),d(()=>({renderer:this.renderer,parameters:{enabled:this._running}}),t=>A(t.renderer,t.parameters),p),d(()=>({renderer:this.renderer,parameters:{previewing:this._previewing}}),t=>A(t.renderer,t.parameters),p)])}destroy(){this.stop(),A(this.renderer,{enabled:!1}),a(this.tooltip)}get state(){return null!=this.view&&this.view.ready&&null!=this._referencePosition?"ready":"disabled"}set date(t){const e=new Date(t);e.setHours(0,0,0,0),this._set("date",e)}get utcOffset(){return this._utcOffset??this._utcOffsetAuto}set utcOffset(t){this._utcOffset=t}get testData(){}get _previewing(){const{view:t}=this;if(null==t?.allLayerViews)return!0;const{stationary:e,allLayerViews:i,graphicsView:r}=t;return this._forcePreview||!e||i.some(t=>S(t)&&t.updating)||!r?.suspended&&!!r?.updating}get _utcOffsetAuto(){const t=this._referencePosition;return null!=t?y(t[0],!1):0}get _dateUTCOffset(){let t=this.date;return t=f(t,-t.getTimezoneOffset(),"minutes"),t=f(t,-this.utcOffset,"hours"),t}get _startDateTimeUTC(){return f(this._dateUTCOffset,this.startTimeOfDay)}get _endDateTimeUTC(){return f(this._dateUTCOffset,this.endTimeOfDay)}get _referencePosition(){return this.view?.environmentManager?.referencePositionGeographic}get _durationInterval(){return this._duration>0?Math.floor(this._duration/(U-1)):U}get _interval(){const t=this._durationInterval;switch(this.visualizationType){case"threshold":case"duration":return t;case"discrete":return this.discreteOptions.interval||t}}get _intervalContext(){const{contextEnabled:t,contextOptions:{interval:e}}=this.thresholdOptions;return"threshold"===this.visualizationType&&t?e||this._durationInterval:-1}get _durationSampleCount(){return this._lightDirections.length}get _duration(){return this.endTimeOfDay-this.startTimeOfDay}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(t){const{view:e}=this;if(null==e||t<=0)return b;const i="global"===e.viewingMode?z:this._referencePosition;if(null==i)return b;const r=w(this._startDateTimeUTC,this._endDateTimeUTC,t,i,e.state.viewingMode,U),s=r.length;V.length=0;const o=C(0,s,V),n=new Array(s);for(let a=0;a<s;++a)n[a]=r[o[a]];return n}get _tooltipEnabled(){return"ready"===this.state&&"discrete"!==this.visualizationType&&this._running&&!this._previewing}get _visualizationParameters(){if(!this._running)return null;switch(this.visualizationType){case"threshold":return this._thresholdVisualizationParameters;case"duration":return this._durationVisualizationParameters;case"discrete":return this._discreteVisualizationParameters}}get _thresholdVisualizationParameters(){const{value:t,color:e}=this.thresholdOptions,i=this._duration;return{visualization:2,thresholdColor:e.toUnitRGBA(),threshold:i>0?t/this._duration:0,...this._thresholdDiscreteVisualizationParameters}}get _thresholdDiscreteVisualizationParameters(){const{contextOptions:{color:t},contextEnabled:e}=this.thresholdOptions;return e?{visualization:3,gradientColor:t.toUnitRGBA()}:{}}get _durationVisualizationParameters(){const{color:t,mode:e}=this.durationOptions,i=this._duration,r=i>0&&"hourly"===e?j/i:0,s=t.toUnitRGBA();return 0===r?{...this._discreteVisualizationParameters,gradientColor:s}:{bandedGradientColor:s,visualization:1,bandSize:r}}get _discreteVisualizationParameters(){return{gradientColor:this.discreteOptions.color.toUnitRGBA(),visualization:0}}get _forcePreviewDependencies(){const{view:t}=this;if(null==t)return null;const e=t.slice.plane,r=t.allLayerViews.toArray().filter(S),s=r.map(t=>t.layer).filter(i),o=r.map(t=>t.suspended),n=s.map(t=>t.visible),a=s.map(t=>t.opacity),l=!!t.graphicsView?.suspended,u=s.filter(t=>"definitionExpression"in t).map(t=>t.definitionExpression),d=r.filter(t=>"filter"in t).map(t=>t.filter);return{slicePlane:e,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:o,graphicsViewSuspended:l,layerVisibilities:n,layerOpacities:a,filters:d,definitionExpressions:u}}get renderer(){const{view:t}=this;if(null==t)return null;const e=t.stage;return null==e?null:e.renderer}start(){this.setRunning(!0)}stop(){this.setRunning(!1)}setRunning(t){this._running=t}async getDuration(t){const{view:e,renderer:i,_durationSampleCount:r}=this;if(null==e||null==i||0===r)return 0;const s=e.state.camera.screenToRender(h(t.x,t.y),c());return i.readAccumulatedShadow(s)*this._duration}};function A(t,e){null!=t&&null!=e&&t.setParameters({shadowCast:e})}function S(t){if(t.suspended)return!1;switch(t.type){case"building-scene-3d":case"csv-3d":case"elevation-3d":case"feature-3d":case"geojson-3d":case"graphics-3d":case"integrated-mesh-3d":case"integrated-mesh-3dtiles":case"ogc-feature-3d":case"route-3d":case"scene-layer-3d":case"scene-layer-graphics-3d":case"stream-3d":case"wms-3d":case"catalog-footprint-3d":return!0;default:return!1}}t([_()],E.prototype,"state",null),t([_()],E.prototype,"view",void 0),t([_()],E.prototype,"tooltip",void 0),t([_({type:Date,nonNullable:!0})],E.prototype,"date",null),t([_({type:Number,nonNullable:!0})],E.prototype,"utcOffset",null),t([_({type:Number,nonNullable:!0})],E.prototype,"startTimeOfDay",void 0),t([_({type:Number,nonNullable:!0})],E.prototype,"endTimeOfDay",void 0),t([_({type:["threshold","duration","discrete"],nonNullable:!0})],E.prototype,"visualizationType",void 0),t([_({type:P,nonNullable:!0})],E.prototype,"thresholdOptions",void 0),t([_({type:T,nonNullable:!0})],E.prototype,"durationOptions",void 0),t([_({type:D,nonNullable:!0})],E.prototype,"discreteOptions",void 0),t([_()],E.prototype,"_running",void 0),t([_()],E.prototype,"_stopPreviewingTask",void 0),t([_()],E.prototype,"_forcePreview",void 0),t([_()],E.prototype,"_autoRestoreForcePreviewEnabled",void 0),t([_()],E.prototype,"_previewing",null),t([_()],E.prototype,"_utcOffset",void 0),t([_()],E.prototype,"_utcOffsetAuto",null),t([_()],E.prototype,"_dateUTCOffset",null),t([_()],E.prototype,"_startDateTimeUTC",null),t([_()],E.prototype,"_endDateTimeUTC",null),t([_()],E.prototype,"_referencePosition",null),t([_()],E.prototype,"_interval",null),t([_()],E.prototype,"_intervalContext",null),t([_()],E.prototype,"_durationSampleCount",null),t([_()],E.prototype,"_duration",null),t([_()],E.prototype,"_lightDirections",null),t([_()],E.prototype,"_lightDirectionsContext",null),t([_()],E.prototype,"_tooltipEnabled",null),t([_()],E.prototype,"_visualizationParameters",null),t([_()],E.prototype,"_thresholdVisualizationParameters",null),t([_()],E.prototype,"_thresholdDiscreteVisualizationParameters",null),t([_()],E.prototype,"_durationVisualizationParameters",null),t([_()],E.prototype,"_discreteVisualizationParameters",null),t([_()],E.prototype,"_forcePreviewDependencies",null),t([_()],E.prototype,"renderer",null),E=t([g("esri.widgets.ShadowCast.ShadowCastViewModel")],E);const M=E;export{M as default};
5
+ import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{isSome as i}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import{deprecateUnnecessaryViewModel as s}from"../../core/deprecate.js";import"../../core/has.js";import o from"../../core/Logger.js";import{abortMaybe as n,destroyMaybe as a}from"../../core/maybe.js";import{after as l,throwIfAborted as u}from"../../core/promiseUtils.js";import{watch as d,syncAndInitial as p}from"../../core/reactiveUtils.js";import{createScreenPointArray as h,createRenderScreenPointArray as c}from"../../core/screenUtils.js";import{convertTime as m,offsetDateUTC as f}from"../../core/timeUtils.js";import{property as _,subclass as g}from"../../core/accessorSupport/decorators.js";import{create as v}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{longitudeToTimezone as y}from"../../views/3d/support/earthUtils.js";import{computeDirectionsOverTime as w}from"../../views/3d/support/sunUtils.js";import D from"./DiscreteOptions.js";import T from"./DurationOptions.js";import{ShadowTooltipViewModel as O}from"./ShadowTooltipViewModel.js";import P from"./ThresholdOptions.js";import{breadthFirstBinaryPartitioning as C}from"../support/traversalUtils.js";const b=[],z=v(),V=[],U=255,j=m(1,"hours","milliseconds"),x=500;let E=class extends e{constructor(t){super(t),this.view=null,this.tooltip=new O({getDuration:t=>this.getDuration(t)}),this.startTimeOfDay=m(10,"hours","milliseconds"),this.endTimeOfDay=m(16,"hours","milliseconds"),this.visualizationType="threshold",this.thresholdOptions=new P({isDefaultViewModel:!0}),this.durationOptions=new T({isDefaultViewModel:!0}),this.discreteOptions=new D({isDefaultViewModel:!0}),this._running=!0,this._stopPreviewingTask=null,this._forcePreview=!1,this._autoRestoreForcePreviewEnabled=!0,this._utcOffset=null,t?.isDefaultViewModel||s(o.getLogger(this),"Shadow Cast","arcgis-shadow-cast",{version:"5.0"}),this.date=new Date}normalizeCtorArgs(t){const{isDefaultViewModel:e,...i}=t??{};return i}initialize(){this.addHandles([d(()=>({view:this.view,tooltipEnabled:this._tooltipEnabled}),({view:t,tooltipEnabled:e})=>{this.tooltip.view=t,this.tooltip.enabled=e},p),d(()=>this._forcePreviewDependencies,()=>{n(this._stopPreviewingTask),this._forcePreview=!0,this._autoRestoreForcePreviewEnabled&&(this._stopPreviewingTask=r(async t=>{await l(x,t),u(t),this._forcePreview=!1}))},p),d(()=>({renderer:this.renderer,parameters:this._visualizationParameters}),t=>A(t.renderer,t.parameters),p),d(()=>({renderer:this.renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext}),t=>A(t.renderer,{lightDirections:t.lightDirections,lightDirectionsContext:t.lightDirectionsContext}),p),d(()=>({renderer:this.renderer,parameters:{enabled:this._running}}),t=>A(t.renderer,t.parameters),p),d(()=>({renderer:this.renderer,parameters:{previewing:this._previewing}}),t=>A(t.renderer,t.parameters),p)])}destroy(){this.stop(),A(this.renderer,{enabled:!1}),a(this.tooltip)}get state(){return null!=this.view&&this.view.ready&&null!=this._referencePosition?"ready":"disabled"}set date(t){const e=new Date(t);e.setHours(0,0,0,0),this._set("date",e)}get utcOffset(){return this._utcOffset??this._utcOffsetAuto}set utcOffset(t){this._utcOffset=t}get testData(){}get _previewing(){const{view:t}=this;if(null==t?.allLayerViews)return!0;const{stationary:e,allLayerViews:i,graphicsView:r}=t;return this._forcePreview||!e||i.some(t=>S(t)&&t.updating)||!r?.suspended&&!!r?.updating}get _utcOffsetAuto(){const t=this._referencePosition;return null!=t?y(t[0],!1):0}get _dateUTCOffset(){let t=this.date;return t=f(t,-t.getTimezoneOffset(),"minutes"),t=f(t,-this.utcOffset,"hours"),t}get _startDateTimeUTC(){return f(this._dateUTCOffset,this.startTimeOfDay)}get _endDateTimeUTC(){return f(this._dateUTCOffset,this.endTimeOfDay)}get _referencePosition(){return this.view?.environmentManager?.referencePositionGeographic}get _durationInterval(){return this._duration>0?Math.floor(this._duration/(U-1)):U}get _interval(){const t=this._durationInterval;switch(this.visualizationType){case"threshold":case"duration":return t;case"discrete":return this.discreteOptions.interval||t}}get _intervalContext(){const{contextEnabled:t,contextOptions:{interval:e}}=this.thresholdOptions;return"threshold"===this.visualizationType&&t?e||this._durationInterval:-1}get _durationSampleCount(){return this._lightDirections.length}get _duration(){return this.endTimeOfDay-this.startTimeOfDay}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(t){const{view:e}=this;if(null==e||t<=0)return b;const i="global"===e.viewingMode?z:this._referencePosition;if(null==i)return b;const r=w(this._startDateTimeUTC,this._endDateTimeUTC,t,i,e.state.viewingMode,U),s=r.length;V.length=0;const o=C(0,s,V),n=new Array(s);for(let a=0;a<s;++a)n[a]=r[o[a]];return n}get _tooltipEnabled(){return"ready"===this.state&&"discrete"!==this.visualizationType&&this._running&&!this._previewing}get _visualizationParameters(){if(!this._running)return null;switch(this.visualizationType){case"threshold":return this._thresholdVisualizationParameters;case"duration":return this._durationVisualizationParameters;case"discrete":return this._discreteVisualizationParameters}}get _thresholdVisualizationParameters(){const{value:t,color:e}=this.thresholdOptions,i=this._duration;return{visualization:2,thresholdColor:e.toUnitRGBA(),threshold:i>0?t/this._duration:0,...this._thresholdDiscreteVisualizationParameters}}get _thresholdDiscreteVisualizationParameters(){const{contextOptions:{color:t},contextEnabled:e}=this.thresholdOptions;return e?{visualization:3,gradientColor:t.toUnitRGBA()}:{}}get _durationVisualizationParameters(){const{color:t,mode:e}=this.durationOptions,i=this._duration,r=i>0&&"hourly"===e?j/i:0,s=t.toUnitRGBA();return 0===r?{...this._discreteVisualizationParameters,gradientColor:s}:{bandedGradientColor:s,visualization:1,bandSize:r}}get _discreteVisualizationParameters(){return{gradientColor:this.discreteOptions.color.toUnitRGBA(),visualization:0}}get _forcePreviewDependencies(){const{view:t}=this;if(null==t)return null;const e=t.slice.plane,r=t.allLayerViews.toArray().filter(S),s=r.map(t=>t.layer).filter(i),o=r.map(t=>t.suspended),n=s.map(t=>t.visible),a=s.map(t=>t.opacity),l=!!t.graphicsView?.suspended,u=s.filter(t=>"definitionExpression"in t).map(t=>t.definitionExpression),d=r.filter(t=>"filter"in t).map(t=>t.filter);return{slicePlane:e,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:o,graphicsViewSuspended:l,layerVisibilities:n,layerOpacities:a,filters:d,definitionExpressions:u}}get renderer(){const{view:t}=this;if(null==t)return null;const e=t.stage;return null==e?null:e.renderer}start(){this.setRunning(!0)}stop(){this.setRunning(!1)}setRunning(t){this._running=t}async getDuration(t){const{view:e,renderer:i,_durationSampleCount:r}=this;if(null==e||null==i||0===r)return 0;const s=e.state.camera.screenToRender(h(t.x,t.y),c());return i.readAccumulatedShadow(s)*this._duration}};function A(t,e){null!=t&&null!=e&&t.setParameters({shadowCast:e})}function S(t){if(t.suspended)return!1;switch(t.type){case"building-scene-3d":case"csv-3d":case"elevation-3d":case"feature-3d":case"geojson-3d":case"graphics-3d":case"integrated-mesh-3d":case"integrated-mesh-3dtiles":case"ogc-feature-3d":case"route-3d":case"scene-layer-3d":case"scene-layer-graphics-3d":case"stream-3d":case"wms-3d":case"catalog-footprint-3d":return!0;default:return!1}}t([_()],E.prototype,"state",null),t([_()],E.prototype,"view",void 0),t([_()],E.prototype,"tooltip",void 0),t([_({type:Date,nonNullable:!0})],E.prototype,"date",null),t([_({type:Number,nonNullable:!0})],E.prototype,"utcOffset",null),t([_({type:Number,nonNullable:!0})],E.prototype,"startTimeOfDay",void 0),t([_({type:Number,nonNullable:!0})],E.prototype,"endTimeOfDay",void 0),t([_({type:["threshold","duration","discrete"],nonNullable:!0})],E.prototype,"visualizationType",void 0),t([_({type:P,nonNullable:!0})],E.prototype,"thresholdOptions",void 0),t([_({type:T,nonNullable:!0})],E.prototype,"durationOptions",void 0),t([_({type:D,nonNullable:!0})],E.prototype,"discreteOptions",void 0),t([_()],E.prototype,"_running",void 0),t([_()],E.prototype,"_stopPreviewingTask",void 0),t([_()],E.prototype,"_forcePreview",void 0),t([_()],E.prototype,"_autoRestoreForcePreviewEnabled",void 0),t([_()],E.prototype,"_previewing",null),t([_()],E.prototype,"_utcOffset",void 0),t([_()],E.prototype,"_utcOffsetAuto",null),t([_()],E.prototype,"_dateUTCOffset",null),t([_()],E.prototype,"_startDateTimeUTC",null),t([_()],E.prototype,"_endDateTimeUTC",null),t([_()],E.prototype,"_referencePosition",null),t([_()],E.prototype,"_interval",null),t([_()],E.prototype,"_intervalContext",null),t([_()],E.prototype,"_durationSampleCount",null),t([_()],E.prototype,"_duration",null),t([_()],E.prototype,"_lightDirections",null),t([_()],E.prototype,"_lightDirectionsContext",null),t([_()],E.prototype,"_tooltipEnabled",null),t([_()],E.prototype,"_visualizationParameters",null),t([_()],E.prototype,"_thresholdVisualizationParameters",null),t([_()],E.prototype,"_thresholdDiscreteVisualizationParameters",null),t([_()],E.prototype,"_durationVisualizationParameters",null),t([_()],E.prototype,"_discreteVisualizationParameters",null),t([_()],E.prototype,"_forcePreviewDependencies",null),t([_()],E.prototype,"renderer",null),E=t([g("esri.widgets.ShadowCast.ShadowCastViewModel")],E);const M=E;export{M as default};