@arcgis/core 4.32.0-next.20241218 → 4.32.0-next.20241220

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 (277) hide show
  1. package/Basemap.js +1 -1
  2. package/arcade.js +1 -1
  3. package/assets/components/assets/text-area/t9n/messages.en.json +1 -1
  4. package/assets/components/assets/text-area/t9n/messages.json +1 -1
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/{6ceafd4420d21110d820.js → 015285436ca965f94e17.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{57aa1fcef6587305b347.js → 0191142d5f55cc8cf37a.js} +93 -93
  8. package/assets/esri/core/workers/chunks/{7a0ddaf2c279a2d24c86.js → 0837a630e12a21fc2e50.js} +1 -1
  9. package/assets/esri/core/workers/chunks/0b3e1e903120da297641.js +1 -0
  10. package/assets/esri/core/workers/chunks/0f1a7aeec18db5323365.js +1 -0
  11. package/assets/esri/core/workers/chunks/{cca47dab8c1b8ae49fab.js → 11052103efe3d53a784e.js} +1 -1
  12. package/assets/esri/core/workers/chunks/19d72185d50ba1ebff50.js +1 -0
  13. package/assets/esri/core/workers/chunks/{b99de19b6930ba6dad98.js → 1d8609ba413e8a172719.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{d05fab1af651b7e92442.js → 23fe65988dbc9e5d7842.js} +1 -1
  15. package/assets/esri/core/workers/chunks/2427a01678f3d9fbf30b.js +1 -0
  16. package/assets/esri/core/workers/chunks/2c084c0c324e3af56424.js +1 -0
  17. package/assets/esri/core/workers/chunks/3a90163b76b0bc7f21d2.js +1 -0
  18. package/assets/esri/core/workers/chunks/48266c87363e7dcaefb3.js +1 -0
  19. package/assets/esri/core/workers/chunks/{d3790bd1a644eae1005b.js → 48f6eb3b63fec1d3312d.js} +4 -5
  20. package/assets/esri/core/workers/chunks/5a0eb9dfe668cf290462.js +1 -0
  21. package/assets/esri/core/workers/chunks/668679baf519ada9ae28.js +1 -0
  22. package/assets/esri/core/workers/chunks/69efc716991a407c3d23.js +1 -0
  23. package/assets/esri/core/workers/chunks/7156d2ae914e1add0109.js +1 -0
  24. package/assets/esri/core/workers/chunks/737f381f2cfeddb96d15.js +1 -0
  25. package/assets/esri/core/workers/chunks/{b77d294ad7064734d015.js → 741d5dadfab2a7689054.js} +1 -1
  26. package/assets/esri/core/workers/chunks/756c2f7c8659deab6c96.js.LICENSE.txt +1 -1
  27. package/assets/esri/core/workers/chunks/{1cee35ea0a80737730d5.js → 770d233254419b741616.js} +1 -1
  28. package/assets/esri/core/workers/chunks/8249351daa45ca82ca0c.js +1 -0
  29. package/assets/esri/core/workers/chunks/9372d08ba8bf3342c48f.js +1 -0
  30. package/assets/esri/core/workers/chunks/{fb43c44a7d6b61f31e75.js → 94432e04de01ee7adc0e.js} +1 -1
  31. package/assets/esri/core/workers/chunks/95af4dee29eb196b8ada.js +1 -0
  32. package/assets/esri/core/workers/chunks/{80ac74da0b0e45e74beb.js → 9a498f2c007f4d78d4dd.js} +1 -1
  33. package/assets/esri/core/workers/chunks/9cc9bac6e02ab241e852.js +1 -0
  34. package/assets/esri/core/workers/chunks/{d347dd19a37ba2f19970.js → 9fc49968dea8e2b64f3e.js} +1 -1
  35. package/assets/esri/core/workers/chunks/a776f71b4c7b8728a973.js +1 -0
  36. package/assets/esri/core/workers/chunks/a77aa86896bbb0e088df.js +1 -0
  37. package/assets/esri/core/workers/chunks/{7c9e4d479d740723304b.js → b1e4813f0c73fc2a483c.js} +2 -2
  38. package/assets/esri/core/workers/chunks/{7c9e4d479d740723304b.js.LICENSE.txt → b1e4813f0c73fc2a483c.js.LICENSE.txt} +1 -1
  39. package/assets/esri/core/workers/chunks/bd37c9cc720587665fd3.js +1 -0
  40. package/assets/esri/core/workers/chunks/bf0a0ca7fdac98f06a89.js.LICENSE.txt +1 -1
  41. package/assets/esri/core/workers/chunks/{eddab4dc706e75c6637f.js → bff74200a0df0950cf08.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{8f2ffb6944c9028d3bea.js → c08cb75c3eef6c45f604.js} +1 -1
  43. package/assets/esri/core/workers/chunks/cb3af81e1fe6405c4885.js +1 -0
  44. package/assets/esri/core/workers/chunks/cc427e8f1b17744b6ea4.js +1 -0
  45. package/assets/esri/core/workers/chunks/cfe4b8101ea96d6996d3.js +2 -0
  46. package/assets/esri/core/workers/chunks/{f3f5c5138de8428bd30f.js.LICENSE.txt → cfe4b8101ea96d6996d3.js.LICENSE.txt} +1 -1
  47. package/assets/esri/core/workers/chunks/d7b76bc7bff34abc2253.js +1 -0
  48. package/assets/esri/core/workers/chunks/dce55e7f76adecc055c3.js +1 -0
  49. package/assets/esri/core/workers/chunks/dd34df14eb4940e2497b.js +1 -0
  50. package/assets/esri/core/workers/chunks/dfd9432ba01881d0a4d9.js +2 -0
  51. package/assets/esri/core/workers/chunks/{ed2ebe42d6483470939a.js.LICENSE.txt → dfd9432ba01881d0a4d9.js.LICENSE.txt} +1 -1
  52. package/assets/esri/core/workers/chunks/e1913990f30d285b3b15.js +2 -0
  53. package/assets/esri/core/workers/chunks/{aff820b27ca9585e297e.js.LICENSE.txt → e1913990f30d285b3b15.js.LICENSE.txt} +1 -1
  54. package/assets/esri/core/workers/chunks/{e6490fe7c87c1d649ea6.js → e5d55a35dace70239902.js} +1 -1
  55. package/assets/esri/core/workers/chunks/ebf9caf2dc8af89afec2.js +2 -0
  56. package/assets/esri/core/workers/chunks/{2eb36a16de1a823513cd.js.LICENSE.txt → ebf9caf2dc8af89afec2.js.LICENSE.txt} +1 -1
  57. package/assets/esri/core/workers/chunks/f25c04cf1a4bc1d2636a.js +1 -0
  58. package/assets/esri/core/workers/chunks/f2cdb7be3fd65f65c30b.js +1 -0
  59. package/assets/esri/themes/base/widgets/_FeatureTable.scss +3 -3
  60. package/assets/esri/themes/dark/main.css +1 -1
  61. package/assets/esri/themes/light/main.css +1 -1
  62. package/assets/esri/themes/light/view.css +1 -1
  63. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  64. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  65. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  66. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  67. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  68. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  69. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  70. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  71. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  72. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  73. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  74. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  75. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  76. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  77. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  78. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  79. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  80. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  81. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  82. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  83. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  84. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  85. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  86. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  87. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  88. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  89. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  90. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  91. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  92. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  93. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  94. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  95. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  96. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  97. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  98. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  99. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  100. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  101. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  102. package/chunks/HUDMaterial.glsl.js +41 -42
  103. package/chunks/OITBlend.glsl.js +3 -3
  104. package/chunks/OperatorProject.js +1 -1
  105. package/chunks/QuadraticBezier.js +1 -1
  106. package/chunks/chartUtilsAm5.js +1 -1
  107. package/core/number.js +1 -1
  108. package/geometry/operators/affineTransformOperator.js +1 -1
  109. package/geometry/operators/alphaShapeOperator.js +1 -1
  110. package/geometry/operators/areaOperator.js +1 -1
  111. package/geometry/operators/autoCompleteOperator.js +1 -1
  112. package/geometry/operators/boundaryOperator.js +1 -1
  113. package/geometry/operators/bufferOperator.js +1 -1
  114. package/geometry/operators/centroidOperator.js +1 -1
  115. package/geometry/operators/clipOperator.js +1 -1
  116. package/geometry/operators/containsOperator.js +1 -1
  117. package/geometry/operators/convexHullOperator.js +1 -1
  118. package/geometry/operators/crossesOperator.js +1 -1
  119. package/geometry/operators/cutOperator.js +1 -1
  120. package/geometry/operators/densifyOperator.js +1 -1
  121. package/geometry/operators/differenceOperator.js +1 -1
  122. package/geometry/operators/disjointOperator.js +1 -1
  123. package/geometry/operators/distanceOperator.js +1 -1
  124. package/geometry/operators/equalsOperator.js +1 -1
  125. package/geometry/operators/extendOperator.js +1 -1
  126. package/geometry/operators/generalizeOperator.js +1 -1
  127. package/geometry/operators/geodesicBufferOperator.js +1 -1
  128. package/geometry/operators/geodesicProximityOperator.js +1 -1
  129. package/geometry/operators/geodeticAreaOperator.js +1 -1
  130. package/geometry/operators/geodeticDensifyOperator.js +1 -1
  131. package/geometry/operators/geodeticDistanceOperator.js +1 -1
  132. package/geometry/operators/geodeticLengthOperator.js +1 -1
  133. package/geometry/operators/graphicBufferOperator.js +1 -1
  134. package/geometry/operators/gx/operatorOffset.js +1 -1
  135. package/geometry/operators/integrateOperator.js +1 -1
  136. package/geometry/operators/intersectionOperator.js +1 -1
  137. package/geometry/operators/intersectsOperator.js +1 -1
  138. package/geometry/operators/isNearOperator.js +1 -1
  139. package/geometry/operators/labelPointOperator.js +1 -1
  140. package/geometry/operators/lengthOperator.js +1 -1
  141. package/geometry/operators/linesToPolygonsOperator.js +1 -1
  142. package/geometry/operators/locateBetweenOperator.js +1 -1
  143. package/geometry/operators/minimumBoundingCircleOperator.js +1 -1
  144. package/geometry/operators/multiPartToSinglePartOperator.js +1 -1
  145. package/geometry/operators/offsetOperator.js +1 -1
  146. package/geometry/operators/overlapsOperator.js +1 -1
  147. package/geometry/operators/polygonOverlayOperator.js +1 -1
  148. package/geometry/operators/polygonSlicerOperator.js +1 -1
  149. package/geometry/operators/projectOperator.js +1 -1
  150. package/geometry/operators/proximityOperator.js +1 -1
  151. package/geometry/operators/relateOperator.js +1 -1
  152. package/geometry/operators/reshapeOperator.js +1 -1
  153. package/geometry/operators/simplifyOperator.js +1 -1
  154. package/geometry/operators/singlePartToMultiPartOperator.js +1 -1
  155. package/geometry/operators/support/jsonConverter.js +1 -1
  156. package/geometry/operators/symmetricDifferenceOperator.js +1 -1
  157. package/geometry/operators/touchesOperator.js +1 -1
  158. package/geometry/operators/unionOperator.js +1 -1
  159. package/geometry/operators/withinOperator.js +1 -1
  160. package/interfaces.d.ts +1020 -735
  161. package/intl/messages.js +1 -1
  162. package/layers/graphics/OptimizedFeature.js +1 -1
  163. package/layers/graphics/sources/geojson/geojson.js +1 -1
  164. package/layers/support/Sublayer.js +1 -1
  165. package/layers/support/domainUtils.js +1 -1
  166. package/layers/support/fieldUtils.js +1 -1
  167. package/package.json +2 -2
  168. package/renderers/support/RendererLegendOptions.js +1 -1
  169. package/rest/featureService/utils.js +1 -1
  170. package/rest/query/operations/pbfOptimizedFeatureSet.js +1 -1
  171. package/rest/support/AddressToLocationsParameters.js +1 -1
  172. package/rest/support/LocationToAddressParameters.js +1 -1
  173. package/smartMapping/popup/classBreaks.js +1 -1
  174. package/smartMapping/popup/clusters.js +1 -1
  175. package/smartMapping/popup/dotDensity.js +1 -1
  176. package/smartMapping/popup/heatmap.js +1 -1
  177. package/smartMapping/popup/predominance.js +1 -1
  178. package/smartMapping/popup/relationship.js +1 -1
  179. package/smartMapping/popup/simple.js +1 -1
  180. package/smartMapping/popup/support/utils.js +1 -1
  181. package/smartMapping/popup/templates.js +1 -1
  182. package/smartMapping/popup/uniqueValues.js +1 -1
  183. package/smartMapping/raster/renderers/flow.js +1 -1
  184. package/smartMapping/renderers/pieChart.js +1 -1
  185. package/smartMapping/symbology/support/utils.js +1 -1
  186. package/support/BasemapStyle.js +1 -1
  187. package/support/revision.js +1 -1
  188. package/versionManagement/versionAdapters/utils.js +1 -1
  189. package/views/2d/engine/webgl/mesh/factories/ResourceProxy.js +1 -1
  190. package/views/2d/input/MapViewInputManager.js +1 -1
  191. package/views/2d/input/handlers/KeyRotate.js +1 -1
  192. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  193. package/views/2d/layers/features/FeatureContainer.js +1 -1
  194. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  195. package/views/2d/layers/features/Processor.js +1 -1
  196. package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
  197. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  198. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  199. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  200. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  201. package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
  202. package/views/2d/layers/features/sources/strategies/chunks/ASourceChunk.js +1 -1
  203. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +5 -0
  204. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  205. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  206. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  207. package/views/2d/layers/support/DebouncedFeatureOverride.js +5 -0
  208. package/views/2d/layers/support/FeatureCommandQueue.js +1 -1
  209. package/views/3d/input/SceneInputManager.js +1 -1
  210. package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
  211. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  212. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  213. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  214. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  215. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  216. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  217. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  218. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  219. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  220. package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +2 -2
  221. package/views/3d/webgl.js +1 -1
  222. package/views/SelectionManager.js +1 -1
  223. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  224. package/views/layers/FeatureLayerView.js +1 -1
  225. package/widgets/Directions/DirectionsViewModel.js +1 -1
  226. package/widgets/FeatureTable/FieldColumn.js +1 -1
  227. package/widgets/Features/FeaturesViewModel.js +1 -1
  228. package/widgets/Features.js +1 -1
  229. package/widgets/LayerList/LayerListItem.js +1 -1
  230. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  231. package/widgets/OrientedImageryViewer/adapters/sketch/DigitizationAdapter.js +1 -1
  232. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  233. package/widgets/OrientedImageryViewer/digitizationUtils.js +1 -1
  234. package/widgets/OrientedImageryViewer.js +1 -1
  235. package/widgets/Popup.js +1 -1
  236. package/widgets/ShadowCast.js +1 -1
  237. package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
  238. package/widgets/support/forms/formUtils.js +1 -1
  239. package/widgets/support/widget.js +1 -1
  240. package/widgets/support/widgetUtils.js +1 -1
  241. package/applications/Components/CollectionFlattener.d.ts +0 -4
  242. package/applications/Components/CollectionFlattener.js +0 -5
  243. package/assets/esri/core/workers/chunks/062da071fd27022f6cb1.js +0 -1
  244. package/assets/esri/core/workers/chunks/0f0cc8150326ca7bcd6f.js +0 -1
  245. package/assets/esri/core/workers/chunks/1808a2b023fa04c6ee6c.js +0 -1
  246. package/assets/esri/core/workers/chunks/1d31b07805af85a4ba7b.js +0 -1
  247. package/assets/esri/core/workers/chunks/1fb142a533e4ee492a50.js +0 -1
  248. package/assets/esri/core/workers/chunks/28f3e139a4e3b70d84a4.js +0 -1
  249. package/assets/esri/core/workers/chunks/2daf5f46e4b137d33f12.js +0 -1
  250. package/assets/esri/core/workers/chunks/2eb36a16de1a823513cd.js +0 -2
  251. package/assets/esri/core/workers/chunks/382c3da5ce9b3231f57c.js +0 -1
  252. package/assets/esri/core/workers/chunks/433798a25dd688cef327.js +0 -1
  253. package/assets/esri/core/workers/chunks/56a04f5976b926de448e.js +0 -1
  254. package/assets/esri/core/workers/chunks/5786b190ad3e2d933245.js +0 -1
  255. package/assets/esri/core/workers/chunks/6bd6c280c741f8917cc8.js +0 -1
  256. package/assets/esri/core/workers/chunks/70153bb44fd5b7cfecb8.js +0 -1
  257. package/assets/esri/core/workers/chunks/78981dee7b5403c32517.js +0 -1
  258. package/assets/esri/core/workers/chunks/7bb52be0a02fb2a2631c.js +0 -1
  259. package/assets/esri/core/workers/chunks/80f1f967646f7a7d37ec.js +0 -1
  260. package/assets/esri/core/workers/chunks/820bb7ea30ad30ce8f42.js +0 -1
  261. package/assets/esri/core/workers/chunks/8f2f2d497b875e2b4139.js +0 -1
  262. package/assets/esri/core/workers/chunks/95ea191f6a307b73b545.js +0 -1
  263. package/assets/esri/core/workers/chunks/9fab71f1041c40d976af.js +0 -1
  264. package/assets/esri/core/workers/chunks/a0a37c238863ffc1b768.js +0 -1
  265. package/assets/esri/core/workers/chunks/aa31073c7fe3b0e4e499.js +0 -1
  266. package/assets/esri/core/workers/chunks/af5d74311cec22601f73.js +0 -1
  267. package/assets/esri/core/workers/chunks/aff820b27ca9585e297e.js +0 -2
  268. package/assets/esri/core/workers/chunks/bf2d1a700fff4ae0db33.js +0 -1
  269. package/assets/esri/core/workers/chunks/da6c0c894e7e281169fa.js +0 -1
  270. package/assets/esri/core/workers/chunks/ed2ebe42d6483470939a.js +0 -2
  271. package/assets/esri/core/workers/chunks/f3f5c5138de8428bd30f.js +0 -2
  272. package/assets/esri/core/workers/chunks/f429d95eb986f3d215f3.js +0 -1
  273. package/assets/esri/core/workers/chunks/fce1158755f959730602.js +0 -1
  274. package/views/2d/layers/features/sources/strategies/chunks/OverrideChunk.js +0 -5
  275. package/views/3d/input/handlers/SingleKey.js +0 -5
  276. package/views/3d/input/handlers/SingleKeyResetHeading.js +0 -5
  277. package/views/3d/input/handlers/SingleKeyResetTilt.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Error.js";import"../../core/has.js";import r from"../../core/Logger.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{watch as o,syncAndInitial as s,on as n}from"../../core/reactiveUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import u from"../../layers/support/FeatureEffect.js";import p from"../../layers/support/FeatureFilter.js";import{fixFields as d,unpackFieldNames as f,collectLabelingFields as c,collectElevationFields as m,collectFilterFields as y,collectFeatureReductionFields as h,collectOrderByInfos as F,collectFields as g,collectField as w,featureHasFields as E}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as I}from"../../layers/support/floorFilterUtils.js";import b from"../../rest/support/Query.js";import{loadArcade as x}from"../../support/arcadeOnDemand.js";import{getFetchPopupTemplate as v,getRequiredFields as R}from"./support/popupUtils.js";const _=_=>{let q=class extends _{constructor(...e){super(...e),this._updatingRequiredFieldsPromise=null,this.dataUpdating=!1,this.filter=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.addHandles([o((()=>{const e=this.layer;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,this.filter,this.featureEffect,this.timeExtent]}),(()=>this._handleRequiredFieldsChange()),s),n((()=>this.view?.floors),"change",(()=>this._handleRequiredFieldsChange())),n((()=>{const e=this.layer;return e&&"sublayers"in e?e.sublayers:null}),"change",(()=>this._handleRequiredFieldsChange()))])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:r}=this;return"outFields"in e&&e.outFields?d(t,[...f(t,e.outFields),...r]):d(t,r)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){r.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(e){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new b(e);if("floorInfo"in this.layer&&this.layer.floorInfo){const e=I(this);null!=e&&(t.where=t.where?`(${t.where}) AND (${e})`:e)}return null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new b(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(e,t){return this._validateFetchPopupFeatures(e,t),this._fetchPopupFeatures(e,t)}_loadArcadeModules(e){return e.expressionInfos?.length||Array.isArray(e.content)&&e.content.some((e=>"expression"===e.type))?x():Promise.resolve()}_handleRequiredFieldsChange(){const e=this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",e),e.then((()=>{this._updatingRequiredFieldsPromise===e&&this._set("_updatingRequiredFieldsPromise",null)}))}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:t,layer:{fieldsIndex:i,objectIdField:o}}=this,s="renderer"in t&&t.renderer,n="orderBy"in t&&t.orderBy,l="featureReduction"in t?t.featureReduction:null,a=new Set,u=await Promise.allSettled([s?s.collectRequiredFields(a,i):null,c(a,t),e&&"elevationInfo"in t?m(a,t):null,null!=this.filter?y(a,t,this.filter):null,e||null==this.featureEffect?null:y(a,t,this.featureEffect.filter),!e&&l?h(a,t,l):null,!e&&n?F(a,t,n):null]);if("timeInfo"in t&&t.timeInfo&&this.timeExtent&&g(a,t.fieldsIndex,[t.timeInfo.startField,t.timeInfo.endField]),"floorInfo"in t&&t.floorInfo&&g(a,t.fieldsIndex,[t.floorInfo.floorField]),"feature"===t.type&&e&&null!=t.infoFor3D&&(null==t.globalIdField&&r.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),g(a,t.fieldsIndex,[t.globalIdField])),"subtype-group"===t.type){w(a,i,t.subtypeField);const e=t.sublayers.map((e=>Promise.all([e.renderer?.collectRequiredFields(a,i),c(a,e)])));await Promise.allSettled(e)}if("catalog-footprint"===t.type&&t.parent){const e=t.parent;g(a,i,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}for(const d of u)"rejected"===d.status&&r.getLogger(this).error(d.reason);w(a,i,o),e&&"displayField"in t&&t.displayField&&w(a,i,t.displayField);const p=Array.from(a).sort();this._set("requiredFields",p)}_validateFetchPopupFeatures(e,r){if(null!=r)for(const i of e){const e=i.origin&&"layer"in i.origin?i.origin.layer:i.layer;if("popupEnabled"in e&&!e.popupEnabled)throw new t("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:e});if(i.isAggregate){const r="featureReduction"in e?e.featureReduction:null;if(!(r&&"popupTemplate"in r&&r.popupEnabled&&r.popupTemplate))throw new t("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:e})}else if("popupTemplate"in e){if(!v(e,r))throw new t("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:e})}}}_popupFeatureHasRequiredFields(e,t){return E(t,e)}async _fetchPopupFeatures(e,t){const r=new Array(e.length),o=new Map,s=await this._createPopupQuery(e.map((e=>e.origin?.layer??e.layer)),t);for(let n=0;n<e.length;n++){const l=e[n];if(l.isAggregate){r[n]=l;continue}const a=l.origin?.layer??l.layer;if(!a||!("popupEnabled"in a))continue;const u=f(this.layer.fieldsIndex,s.outFields),p=v(a,t);if(null==p)continue;const d=await this._loadArcadeModules(p);i(t);d&&d.arcadeUtils.hasGeometryOperations(p)||!this._popupFeatureHasRequiredFields(l,u)?o.set(l.getObjectId(),{graphic:l,index:n}):r[n]=l}if("stream"===this.layer.type||"parquet"===this.layer.type||0===o.size)return r.filter(Boolean);s.objectIds=Array.from(o.keys());try{const e=await this.layer.queryFeatures(s,t);for(const t of e.features){const{graphic:{geometry:e,origin:i},index:s}=o.get(t.getObjectId());t.geometry||=e,t.origin=i,r[s]=t}}catch{}return r.filter(Boolean)}async _createPopupQuery(e,t){const r=this.layer.createQuery(),o=new Set;let s=!1;const n=e??[this.layer];for(const l of n){if(!("popupEnabled"in l))continue;const e=v(l,t);if(null==e)continue;const r=await this._loadArcadeModules(e);i(t);const n=r&&r.arcadeUtils.hasGeometryOperations(e);s=!("point"!==this.layer.geometryType&&!n);const a=await R(this.layer,e);i(t);for(const t of a)o.add(t)}if(r.returnGeometry=s,r.returnZ=s,r.returnM=s,r.outFields=Array.from(o),r.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo){const e=I(this);null!=e&&(r.where=r.where?`(${r.where}) AND (${e})`:e)}return r}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};return e([l()],q.prototype,"_updatingRequiredFieldsPromise",void 0),e([l({readOnly:!0})],q.prototype,"availableFields",null),e([l({readOnly:!0})],q.prototype,"dataUpdating",void 0),e([l({type:u})],q.prototype,"featureEffect",null),e([l({type:p})],q.prototype,"filter",void 0),e([l()],q.prototype,"layer",void 0),e([l({type:Number})],q.prototype,"maximumNumberOfFeatures",null),e([l({readOnly:!0,type:Boolean})],q.prototype,"maximumNumberOfFeaturesExceeded",null),e([l({readOnly:!0})],q.prototype,"requiredFields",void 0),e([l()],q.prototype,"suspended",void 0),e([l()],q.prototype,"view",void 0),q=e([a("esri.views.layers.FeatureLayerView")],q),q};export{_ as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Error.js";import"../../core/has.js";import r from"../../core/Logger.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{watch as o,syncAndInitial as s,on as n}from"../../core/reactiveUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import u from"../../layers/support/FeatureEffect.js";import p from"../../layers/support/FeatureFilter.js";import{fixFields as d,unpackFieldNames as f,collectLabelingFields as c,collectElevationFields as m,collectFilterFields as y,collectFeatureReductionFields as h,collectOrderByInfos as F,collectFields as g,collectField as w,featureHasFields as E}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as I}from"../../layers/support/floorFilterUtils.js";import b from"../../rest/support/Query.js";import{loadArcade as x}from"../../support/arcadeOnDemand.js";import{getFetchPopupTemplate as v,getRequiredFields as R}from"./support/popupUtils.js";const _=_=>{let q=class extends _{constructor(...e){super(...e),this._updatingRequiredFieldsPromise=null,this.filter=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.addHandles([o((()=>{const e=this.layer;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,this.filter,this.featureEffect,this.timeExtent]}),(()=>this._handleRequiredFieldsChange()),s),n((()=>this.view?.floors),"change",(()=>this._handleRequiredFieldsChange())),n((()=>{const e=this.layer;return e&&"sublayers"in e?e.sublayers:null}),"change",(()=>this._handleRequiredFieldsChange()))])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:r}=this;return"outFields"in e&&e.outFields?d(t,[...f(t,e.outFields),...r]):d(t,r)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){r.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(e){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new b(e);if("floorInfo"in this.layer&&this.layer.floorInfo){const e=I(this);null!=e&&(t.where=t.where?`(${t.where}) AND (${e})`:e)}return null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new b(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(e,t){return this._validateFetchPopupFeatures(e,t),this._fetchPopupFeatures(e,t)}_loadArcadeModules(e){return e.expressionInfos?.length||Array.isArray(e.content)&&e.content.some((e=>"expression"===e.type))?x():Promise.resolve()}_handleRequiredFieldsChange(){const e=this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",e),e.then((()=>{this._updatingRequiredFieldsPromise===e&&this._set("_updatingRequiredFieldsPromise",null)}))}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:t,layer:{fieldsIndex:i,objectIdField:o}}=this,s="renderer"in t&&t.renderer,n="orderBy"in t&&t.orderBy,l="featureReduction"in t?t.featureReduction:null,a=new Set,u=await Promise.allSettled([s?s.collectRequiredFields(a,i):null,c(a,t),e&&"elevationInfo"in t?m(a,t):null,null!=this.filter?y(a,t,this.filter):null,e||null==this.featureEffect?null:y(a,t,this.featureEffect.filter),!e&&l?h(a,t,l):null,!e&&n?F(a,t,n):null]);if("timeInfo"in t&&t.timeInfo&&this.timeExtent&&g(a,t.fieldsIndex,[t.timeInfo.startField,t.timeInfo.endField]),"floorInfo"in t&&t.floorInfo&&g(a,t.fieldsIndex,[t.floorInfo.floorField]),"feature"===t.type&&e&&null!=t.infoFor3D&&(null==t.globalIdField&&r.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),g(a,t.fieldsIndex,[t.globalIdField])),"subtype-group"===t.type){w(a,i,t.subtypeField);const e=t.sublayers.map((e=>Promise.all([e.renderer?.collectRequiredFields(a,i),c(a,e)])));await Promise.allSettled(e)}if("catalog-footprint"===t.type&&t.parent){const e=t.parent;g(a,i,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}for(const d of u)"rejected"===d.status&&r.getLogger(this).error(d.reason);w(a,i,o),e&&"displayField"in t&&t.displayField&&w(a,i,t.displayField);const p=Array.from(a).sort();this._set("requiredFields",p)}_validateFetchPopupFeatures(e,r){if(null!=r)for(const i of e){const e=i.origin&&"layer"in i.origin?i.origin.layer:i.layer;if("popupEnabled"in e&&!e.popupEnabled)throw new t("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:e});if(i.isAggregate){const r="featureReduction"in e?e.featureReduction:null;if(!(r&&"popupTemplate"in r&&r.popupEnabled&&r.popupTemplate))throw new t("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:e})}else if("popupTemplate"in e){if(!v(e,r))throw new t("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:e})}}}_popupFeatureHasRequiredFields(e,t){return E(t,e)}async _fetchPopupFeatures(e,t){const r=new Array(e.length),o=new Map,s=await this._createPopupQuery(e.map((e=>e.origin?.layer??e.layer)),t);for(let n=0;n<e.length;n++){const l=e[n];if(l.isAggregate){r[n]=l;continue}const a=l.origin?.layer??l.layer;if(!a||!("popupEnabled"in a))continue;const u=f(this.layer.fieldsIndex,s.outFields),p=v(a,t);if(null==p)continue;const d=await this._loadArcadeModules(p);i(t);d&&d.arcadeUtils.hasGeometryOperations(p)||!this._popupFeatureHasRequiredFields(l,u)?o.set(l.getObjectId(),{graphic:l,index:n}):r[n]=l}if("stream"===this.layer.type||"parquet"===this.layer.type||0===o.size)return r.filter(Boolean);s.objectIds=Array.from(o.keys());try{const e=await this.layer.queryFeatures(s,t);for(const t of e.features){const{graphic:{geometry:e,origin:i},index:s}=o.get(t.getObjectId());t.geometry||=e,t.origin=i,r[s]=t}}catch{}return r.filter(Boolean)}async _createPopupQuery(e,t){const r=this.layer.createQuery(),o=new Set;let s=!1;const n=e??[this.layer];for(const l of n){if(!("popupEnabled"in l))continue;const e=v(l,t);if(null==e)continue;const r=await this._loadArcadeModules(e);i(t);const n=r&&r.arcadeUtils.hasGeometryOperations(e);s=!("point"!==this.layer.geometryType&&!n);const a=await R(this.layer,e);i(t);for(const t of a)o.add(t)}if(r.returnGeometry=s,r.returnZ=s,r.returnM=s,r.outFields=Array.from(o),r.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo){const e=I(this);null!=e&&(r.where=r.where?`(${r.where}) AND (${e})`:e)}return r}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};return e([l()],q.prototype,"_updatingRequiredFieldsPromise",void 0),e([l({readOnly:!0})],q.prototype,"availableFields",null),e([l({type:u})],q.prototype,"featureEffect",null),e([l({type:p})],q.prototype,"filter",void 0),e([l()],q.prototype,"layer",void 0),e([l({type:Number})],q.prototype,"maximumNumberOfFeatures",null),e([l({readOnly:!0,type:Boolean})],q.prototype,"maximumNumberOfFeaturesExceeded",null),e([l({readOnly:!0})],q.prototype,"requiredFields",void 0),e([l()],q.prototype,"suspended",void 0),e([l()],q.prototype,"view",void 0),q=e([a("esri.views.layers.FeatureLayerView")],q),q};export{_ as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import r from"../../core/Error.js";import i from"../../core/Evented.js";import{isAbortError as s}from"../../core/promiseUtils.js";import{on as o,watch as l,syncAndInitial as a,when as n}from"../../core/reactiveUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{resolveTimeZone as c,convertDateFormatToIntlOptions as h,formatTimestamp as p}from"../../intl/date.js";import{getLocale as m}from"../../intl/locale.js";import{fetchServiceDescription as v}from"../../rest/networkService.js";import f from"../../rest/support/RouteParameters.js";import y from"../../rest/support/Stop.js";import g from"../../rest/support/TravelMode.js";import{defaultDatePattern as T,defaultTimePattern as w}from"../../support/dateUtils.js";import{system as _,shortTimeZoneName as D}from"../../time/timeZoneUtils.js";import{DepartureTimeOption as C}from"./support/directionsUtils.js";import{getDefaultLocaleOptions as S}from"../support/dateUtils.js";import b from"../support/GoTo.js";import{DateTime as I,FixedOffsetZone as M,IANAZone as A}from"luxon";function j(e){return"esri.Graphic"===e?.declaredClass}function P(e){return"esri.rest.support.Stop"===e?.declaredClass}var L;!function(e){e[e.Active=0]="Active",e[e.Complete=1]="Complete",e[e.Failed=2]="Failed",e[e.Idle=3]="Idle",e[e.Suspended=4]="Suspended"}(L||(L={}));let E=class extends(b(i.EventedAccessor)){constructor(e){super(e),this._highlight=null,this._loadPromise=null,this._loadController=null,this._routeController=null,this._serviceDescriptionStatus=L.Idle,this.apiKey=void 0,this.defaultTravelMode=null,this.departureIsoDate=null,this.departureIsoTime=null,this.departureOption=C.NOW,this.departureTime="now",this.lastError=null,this.lastRoute=null,this.layer=null,this.maxStops=50,this.routeParameters=new f({directionsLengthUnits:"kilometers",findBestSequence:!1,returnZ:!0,startTime:null,startTimeIsUTC:!0,useTimeWindows:!1}),this.serviceDescription=null,this.view=null}initialize(){this.addHandles([o((()=>this.layer?.stops),"change",(()=>{this.clearResults()})),l((()=>this.layer),(e=>{if(null!=e){for(;e.stops.length<2;)e.stops.add(new y);this._set("defaultTravelMode",null),this.addHandles(n((()=>null!=this.serviceDescription?e.routeInfo?.analysisSettings?.travelMode:null),(e=>{this.defaultTravelMode=this._resolveDefaultTravelMode(e)}),{once:!0}))}}),a)]);const e=c(this.view?.timeZone??_),t=I.fromMillis(Date.now());this.departureIsoDate=t.toFormat(T,S(e)),this.departureIsoTime=t.toFormat(w,S(e))}get _directionsLanguage(){if(null==this.serviceDescription)return;const e=this.serviceDescription.directionsSupportedLanguages;if(!e)return;const t=(this.routeParameters.directionsLanguage??m()).slice(0,2);return e.find((e=>e.toLowerCase().slice(0,2)===t))}get formattedEta(){const e=this.layer?.routeInfo?.endTime,t=this.layer?.routeInfo?.endTimeOffset;if(this.departureOption===C.UNSPECIFIED||!e||!t)return null;const r=I.fromJSDate(e,{zone:M.instance(t)}),i=I.fromJSDate(e,{zone:A.create(c(this.view?.timeZone??_))}),s=I.fromJSDate(new Date,{zone:A.create(c(this.view?.timeZone??_))}),o=s.year===i.year&&s.month===i.month&&s.day===i.day,l=i.offset===t?void 0:D,a=o?void 0:h("short-date"),n=h("short-time");return p(r.toISO(),{...a,...n,timeZoneName:l})}get impedanceAttribute(){const e=this.routeParameters.travelMode?.impedanceAttributeName??this.routeParameters.impedanceAttribute??this.serviceDescription?.impedance??null;return this.getCostAttribute(e)}get selectedTravelMode(){return null==this.serviceDescription?null:this.defaultTravelMode??this.serviceDescription.defaultTravelMode??this.serviceDescription.supportedTravelModes?.[0]??null}set selectedTravelMode(e){this._override("selectedTravelMode",e)}get state(){if(null!=this._routeController)return"routing";if(null!=this.lastError)return"error";switch(this._serviceDescriptionStatus){case L.Suspended:return"unauthenticated";case L.Idle:return"disabled";case L.Active:return"initializing";case L.Failed:return"error";default:return"ready"}}get timeAttribute(){const e=this.routeParameters.travelMode?.timeAttributeName??this.routeParameters.directionsTimeAttribute??this.serviceDescription?.directionsTimeAttribute??null;return this.getCostAttribute(e)}get travelModes(){const e=this.serviceDescription?.supportedTravelModes?.slice()??[];return null==this.defaultTravelMode||e.includes(this.defaultTravelMode)||e.unshift(this.defaultTravelMode),e}async load(){if(null!=this._loadPromise)return this._loadPromise;this._loadPromise=this._load(),await this._loadPromise,this._loadPromise=null}async highlight(e){if(this.clearHighlights(),!this.view||!this.layer)return;const t=await this.view.whenLayerView(this.layer);this._highlight=t.highlight(e)}clearHighlights(){null!=this._highlight&&(this._highlight.remove(),this._highlight=null)}centerAt(e){if(null==this.view)return;const t=P(e)||j(e)?e.geometry:e;null!=t&&this.callGoTo({target:t})}clearResults(){this._set("lastRoute",null),this.layer?.removeResult()}async getDirections(){const{apiKey:e,layer:t,state:i}=this;if(null==t)throw new r("directions-view-model:missing-route-layer","A route layer must be associated with the view model.");if("unauthenticated"===i||"initializing"===i||"disabled"===i||this._serviceDescriptionStatus===L.Failed)throw new r("directions-view-model:not-loaded","Cannot get directions until view model loads.");this._set("lastError",null),null!=this._routeController&&(this._routeController.abort(),this._routeController=null);const{startTime:o,startTimeIsUTC:l}=this._getStartTimeParameters(),a=this.view?.spatialReference??null,n=this.routeParameters.clone();n.set({startTime:o,startTimeIsUTC:l,directionsLanguage:this._directionsLanguage,apiKey:e,outSpatialReference:a}),null!=this.selectedTravelMode&&(n.travelMode=this.selectedTravelMode);if(t.stops.filter((({geometry:e})=>null!=e)).length<2){const e=new r("directions-view-model:not-enough-stops","Not enough stops for routing");throw this._set("lastError",e),e}this._routeController=new AbortController;const{signal:u}=this._routeController;let d=null;try{d=await t.solve(n,{signal:u})}catch(c){if(!s(c)){const e=new r("directions-view-model:unable-to-route","Unable to route to these addresses",{error:c});throw this._set("lastError",e),this._set("lastRoute",null),e}}finally{this._routeController=null}for(const r of d.stops)null==r.geometry&&(r.name=null);return t.update(d),this._set("lastRoute",d),this.zoomToRoute(),d}getCostAttribute(e){return(this.serviceDescription?.networkDataset?.networkAttributes??[]).find((({name:t,usageType:r})=>t===e&&"cost"===r))??null}reset(){this.clearHighlights(),this.clearResults(),null!=this.layer&&(this.layer.removeAll(),this.layer.stops=new t([new y,new y]))}save(){if(!this.layer)throw new r("directions-view-model:missing-layer","save() requires a layer");return this.layer.save()}saveAs(e,t={}){if(!this.layer)throw new r("directions-view-model:missing-layer","saveAs() requires a layer");return this.layer.saveAs(e,t)}updateDepartureTime(){if(this.departureIsoDate&&this.departureIsoTime)switch(this.departureOption){case C.NOW:this.departureTime="now";break;case C.DEPART_AT:{const e=I.fromISO(`${this.departureIsoDate}T${this.departureIsoTime}`,{zone:M.instance(0)});this.departureTime=e.toJSDate();break}case C.UNSPECIFIED:this.departureTime=null}}zoomToRoute(){const{view:e,layer:t}=this;if(null==e||null==t?.routeInfo)return;const{geometry:r}=t.routeInfo;if(null==r)return;const i=r.extent;if(!i)return;const s=i.width>i.height,o=i.clone().expand(s?2:1);this.callGoTo({target:o})}_getStartTimeParameters(){if("now"===this.departureTime){return{startTime:this.serviceDescription?.capabilities.supportsNow??!1?"now":new Date,startTimeIsUTC:!0}}return null==this.departureTime?{startTime:void 0,startTimeIsUTC:void 0}:{startTime:this.departureTime,startTimeIsUTC:!1}}async _load(){if(null==this.layer)return;null!=this._loadController&&(this._loadController.abort(),this._loadController=null),this._loadController=new AbortController;const{signal:e}=this._loadController;try{this._serviceDescriptionStatus=L.Active;const t=await v(this.layer.url,this.apiKey,{signal:e});this._set("serviceDescription",t),this._serviceDescriptionStatus=L.Complete}catch(t){if(s(t))return void(this._serviceDescriptionStatus=L.Idle);if("identity-manager:user-aborted"===t.name)return void(this._serviceDescriptionStatus=L.Suspended);const e=new r("directions-view-model:service-metadata-unavailable","Cannot load route service metadata",{error:t});throw this._serviceDescriptionStatus=L.Failed,this._set("lastError",e),e}finally{this._loadController=null}}_resolveDefaultTravelMode(e){if(null==this.serviceDescription)return null;const{defaultTravelMode:t,supportedTravelModes:r}=this.serviceDescription,i=/^<(?<name>.*)>$/i.exec(e.name)?.groups?.name;if(i){const s=r?.find((({name:e})=>e.toLocaleLowerCase()===i.trim().toLocaleLowerCase())),o=s??t;return g.fromJSON({...o?.toJSON(),...e.toJSON()})}const s=r?.find((({name:t})=>t.toLocaleLowerCase()===e.name.toLocaleLowerCase()));return s??t}};e([u()],E.prototype,"_directionsLanguage",null),e([u()],E.prototype,"_routeController",void 0),e([u()],E.prototype,"_serviceDescriptionStatus",void 0),e([u()],E.prototype,"apiKey",void 0),e([u()],E.prototype,"defaultTravelMode",void 0),e([u()],E.prototype,"departureTime",void 0),e([u()],E.prototype,"formattedEta",null),e([u({readOnly:!0})],E.prototype,"impedanceAttribute",null),e([u()],E.prototype,"lastError",void 0),e([u({readOnly:!0})],E.prototype,"lastRoute",void 0),e([u()],E.prototype,"layer",void 0),e([u({type:Number,range:{min:2,max:50},nonNullable:!0})],E.prototype,"maxStops",void 0),e([u({type:f,nonNullable:!0})],E.prototype,"routeParameters",void 0),e([u()],E.prototype,"selectedTravelMode",null),e([u({readOnly:!0})],E.prototype,"serviceDescription",void 0),e([u({readOnly:!0})],E.prototype,"state",null),e([u({readOnly:!0})],E.prototype,"timeAttribute",null),e([u()],E.prototype,"travelModes",null),e([u()],E.prototype,"view",void 0),e([u()],E.prototype,"getDirections",null),e([u()],E.prototype,"zoomToRoute",null),E=e([d("esri.widgets.Directions.DirectionsViewModel")],E);const R=E;export{R as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import r from"../../core/Error.js";import i from"../../core/Evented.js";import{isAbortError as o}from"../../core/promiseUtils.js";import{on as s,watch as l,syncAndInitial as a,when as n}from"../../core/reactiveUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{resolveTimeZone as h,convertDateFormatToIntlOptions as c,formatTimestamp as p}from"../../intl/date.js";import{getLocale as m,getLanguage as v}from"../../intl/locale.js";import{fetchServiceDescription as f}from"../../rest/networkService.js";import y from"../../rest/support/RouteParameters.js";import g from"../../rest/support/Stop.js";import T from"../../rest/support/TravelMode.js";import{defaultDatePattern as w,defaultTimePattern as _}from"../../support/dateUtils.js";import{system as D,shortTimeZoneName as C}from"../../time/timeZoneUtils.js";import{DepartureTimeOption as S}from"./support/directionsUtils.js";import{getDefaultLocaleOptions as b}from"../support/dateUtils.js";import I from"../support/GoTo.js";import{DateTime as M,FixedOffsetZone as A,IANAZone as j}from"luxon";function P(e){return"esri.Graphic"===e?.declaredClass}function L(e){return"esri.rest.support.Stop"===e?.declaredClass}var E;!function(e){e[e.Active=0]="Active",e[e.Complete=1]="Complete",e[e.Failed=2]="Failed",e[e.Idle=3]="Idle",e[e.Suspended=4]="Suspended"}(E||(E={}));let R=class extends(I(i.EventedAccessor)){constructor(e){super(e),this._highlight=null,this._loadPromise=null,this._loadController=null,this._routeController=null,this._serviceDescriptionStatus=E.Idle,this.apiKey=void 0,this.defaultTravelMode=null,this.departureIsoDate=null,this.departureIsoTime=null,this.departureOption=S.NOW,this.departureTime="now",this.lastError=null,this.lastRoute=null,this.layer=null,this.maxStops=50,this.routeParameters=new y({directionsLengthUnits:"kilometers",findBestSequence:!1,returnZ:!0,startTime:null,startTimeIsUTC:!0,useTimeWindows:!1}),this.serviceDescription=null,this.view=null}initialize(){this.addHandles([s((()=>this.layer?.stops),"change",(()=>{this.clearResults()})),l((()=>this.layer),(e=>{if(null!=e){for(;e.stops.length<2;)e.stops.add(new g);this._set("defaultTravelMode",null),this.addHandles(n((()=>null!=this.serviceDescription?e.routeInfo?.analysisSettings?.travelMode:null),(e=>{this.defaultTravelMode=this._resolveDefaultTravelMode(e)}),{once:!0}))}}),a)]);const e=h(this.view?.timeZone??D),t=M.fromMillis(Date.now());this.departureIsoDate=t.toFormat(w,b(e)),this.departureIsoTime=t.toFormat(_,b(e))}get _directionsLanguage(){const e=this.serviceDescription?.directionsSupportedLanguages;if(!e)return;const t=this.routeParameters.directionsLanguage??m(),r=v(t);return e.find((e=>{const t=v(e);return"no"===r?t===r||"nb"===t:t===r}))}get formattedEta(){const e=this.layer?.routeInfo?.endTime,t=this.layer?.routeInfo?.endTimeOffset;if(this.departureOption===S.UNSPECIFIED||!e||!t)return null;const r=M.fromJSDate(e,{zone:A.instance(t)}),i=M.fromJSDate(e,{zone:j.create(h(this.view?.timeZone??D))}),o=M.fromJSDate(new Date,{zone:j.create(h(this.view?.timeZone??D))}),s=o.year===i.year&&o.month===i.month&&o.day===i.day,l=i.offset===t?void 0:C,a=s?void 0:c("short-date"),n=c("short-time");return p(r.toISO(),{...a,...n,timeZoneName:l})}get impedanceAttribute(){const e=this.routeParameters.travelMode?.impedanceAttributeName??this.routeParameters.impedanceAttribute??this.serviceDescription?.impedance??null;return this.getCostAttribute(e)}get selectedTravelMode(){return null==this.serviceDescription?null:this.defaultTravelMode??this.serviceDescription.defaultTravelMode??this.serviceDescription.supportedTravelModes?.[0]??null}set selectedTravelMode(e){this._override("selectedTravelMode",e)}get state(){if(null!=this._routeController)return"routing";if(null!=this.lastError)return"error";switch(this._serviceDescriptionStatus){case E.Suspended:return"unauthenticated";case E.Idle:return"disabled";case E.Active:return"initializing";case E.Failed:return"error";default:return"ready"}}get timeAttribute(){const e=this.routeParameters.travelMode?.timeAttributeName??this.routeParameters.directionsTimeAttribute??this.serviceDescription?.directionsTimeAttribute??null;return this.getCostAttribute(e)}get travelModes(){const e=this.serviceDescription?.supportedTravelModes?.slice()??[];return null==this.defaultTravelMode||e.includes(this.defaultTravelMode)||e.unshift(this.defaultTravelMode),e}async load(){if(null!=this._loadPromise)return this._loadPromise;this._loadPromise=this._load(),await this._loadPromise,this._loadPromise=null}async highlight(e){if(this.clearHighlights(),!this.view||!this.layer)return;const t=await this.view.whenLayerView(this.layer);this._highlight=t.highlight(e)}clearHighlights(){null!=this._highlight&&(this._highlight.remove(),this._highlight=null)}centerAt(e){if(null==this.view)return;const t=L(e)||P(e)?e.geometry:e;null!=t&&this.callGoTo({target:t})}clearResults(){this._set("lastRoute",null),this.layer?.removeResult()}async getDirections(){const{apiKey:e,layer:t,state:i}=this;if(null==t)throw new r("directions-view-model:missing-route-layer","A route layer must be associated with the view model.");if("unauthenticated"===i||"initializing"===i||"disabled"===i||this._serviceDescriptionStatus===E.Failed)throw new r("directions-view-model:not-loaded","Cannot get directions until view model loads.");this._set("lastError",null),null!=this._routeController&&(this._routeController.abort(),this._routeController=null);const{startTime:s,startTimeIsUTC:l}=this._getStartTimeParameters(),a=this.view?.spatialReference??null,n=this.routeParameters.clone();n.set({startTime:s,startTimeIsUTC:l,directionsLanguage:this._directionsLanguage,apiKey:e,outSpatialReference:a}),null!=this.selectedTravelMode&&(n.travelMode=this.selectedTravelMode);if(t.stops.filter((({geometry:e})=>null!=e)).length<2){const e=new r("directions-view-model:not-enough-stops","Not enough stops for routing");throw this._set("lastError",e),e}this._routeController=new AbortController;const{signal:u}=this._routeController;let d=null;try{d=await t.solve(n,{signal:u})}catch(h){if(!o(h)){const e=new r("directions-view-model:unable-to-route","Unable to route to these addresses",{error:h});throw this._set("lastError",e),this._set("lastRoute",null),e}}finally{this._routeController=null}for(const r of d.stops)null==r.geometry&&(r.name=null);return t.update(d),this._set("lastRoute",d),this.zoomToRoute(),d}getCostAttribute(e){return(this.serviceDescription?.networkDataset?.networkAttributes??[]).find((({name:t,usageType:r})=>t===e&&"cost"===r))??null}reset(){this.clearHighlights(),this.clearResults(),null!=this.layer&&(this.layer.removeAll(),this.layer.stops=new t([new g,new g]))}save(){if(!this.layer)throw new r("directions-view-model:missing-layer","save() requires a layer");return this.layer.save()}saveAs(e,t={}){if(!this.layer)throw new r("directions-view-model:missing-layer","saveAs() requires a layer");return this.layer.saveAs(e,t)}updateDepartureTime(){if(this.departureIsoDate&&this.departureIsoTime)switch(this.departureOption){case S.NOW:this.departureTime="now";break;case S.DEPART_AT:{const e=M.fromISO(`${this.departureIsoDate}T${this.departureIsoTime}`,{zone:A.instance(0)});this.departureTime=e.toJSDate();break}case S.UNSPECIFIED:this.departureTime=null}}zoomToRoute(){const{view:e,layer:t}=this;if(null==e||null==t?.routeInfo)return;const{geometry:r}=t.routeInfo;if(null==r)return;const i=r.extent;if(!i)return;const o=i.width>i.height,s=i.clone().expand(o?2:1);this.callGoTo({target:s})}_getStartTimeParameters(){if("now"===this.departureTime){return{startTime:this.serviceDescription?.capabilities.supportsNow??!1?"now":new Date,startTimeIsUTC:!0}}return null==this.departureTime?{startTime:void 0,startTimeIsUTC:void 0}:{startTime:this.departureTime,startTimeIsUTC:!1}}async _load(){if(null==this.layer)return;null!=this._loadController&&(this._loadController.abort(),this._loadController=null),this._loadController=new AbortController;const{signal:e}=this._loadController;try{this._serviceDescriptionStatus=E.Active;const t=await f(this.layer.url,this.apiKey,{signal:e});this._set("serviceDescription",t),this._serviceDescriptionStatus=E.Complete}catch(t){if(o(t))return void(this._serviceDescriptionStatus=E.Idle);if("identity-manager:user-aborted"===t.name)return void(this._serviceDescriptionStatus=E.Suspended);const e=new r("directions-view-model:service-metadata-unavailable","Cannot load route service metadata",{error:t});throw this._serviceDescriptionStatus=E.Failed,this._set("lastError",e),e}finally{this._loadController=null}}_resolveDefaultTravelMode(e){if(null==this.serviceDescription)return null;const{defaultTravelMode:t,supportedTravelModes:r}=this.serviceDescription,i=/^<(?<name>.*)>$/i.exec(e.name)?.groups?.name;if(i){const o=r?.find((({name:e})=>e.toLocaleLowerCase()===i.trim().toLocaleLowerCase())),s=o??t;return T.fromJSON({...s?.toJSON(),...e.toJSON()})}const o=r?.find((({name:t})=>t.toLocaleLowerCase()===e.name.toLocaleLowerCase()));return o??t}};e([u()],R.prototype,"_directionsLanguage",null),e([u()],R.prototype,"_routeController",void 0),e([u()],R.prototype,"_serviceDescriptionStatus",void 0),e([u()],R.prototype,"apiKey",void 0),e([u()],R.prototype,"defaultTravelMode",void 0),e([u()],R.prototype,"departureTime",void 0),e([u()],R.prototype,"formattedEta",null),e([u({readOnly:!0})],R.prototype,"impedanceAttribute",null),e([u()],R.prototype,"lastError",void 0),e([u({readOnly:!0})],R.prototype,"lastRoute",void 0),e([u()],R.prototype,"layer",void 0),e([u({type:Number,range:{min:2,max:50},nonNullable:!0})],R.prototype,"maxStops",void 0),e([u({type:y,nonNullable:!0})],R.prototype,"routeParameters",void 0),e([u()],R.prototype,"selectedTravelMode",null),e([u({readOnly:!0})],R.prototype,"serviceDescription",void 0),e([u({readOnly:!0})],R.prototype,"state",null),e([u({readOnly:!0})],R.prototype,"timeAttribute",null),e([u()],R.prototype,"travelModes",null),e([u()],R.prototype,"view",void 0),e([u()],R.prototype,"getDirections",null),e([u()],R.prototype,"zoomToRoute",null),R=e([d("esri.widgets.Directions.DirectionsViewModel")],R);const O=R;export{O as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Logger.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{convertDateFormatToIntlOptions as o}from"../../intl/date.js";import{convertNumberFormatToIntlOptions as l,formatNumber as r}from"../../intl/number.js";import{isEditableLayer as a}from"../../layers/support/editableLayers.js";import{computeDomainFromTypes as s}from"../../layers/support/featureLayerUtils.js";import{validateFieldValue as u,isTimeOnlyField as p,isIntegerField as d,isNumericField as c,isStringField as m,isDateOnlyField as f,isTimestampOffsetField as h}from"../../layers/support/fieldUtils.js";import{isAnyDateField as g}from"../../smartMapping/support/utils.js";import{getTimeZoneFormattingOptions as y,system as v}from"../../time/timeZoneUtils.js";import F from"../FeatureForm/FieldInput.js";import _ from"./Grid/EditorColumn.js";import{isEmptyStringOrWhitespace as C}from"./support/tableUtils.js";import{dateFieldsWithStringFieldValue as b,getLabelForDateFieldValue as D,valueIsInRange as x,dateTimeIsInRange as I,getUnixFieldValueFromDateComponents as E,getISOFieldValueFromDateComponents as w,normalizeTimeOnlyString as T,prepareISOFieldValueForDateComponents as V,prepareUnixFieldValueForDateComponents as L}from"../support/dateUtils.js";import{renderingSanitizer as O,setFocus as Z}from"../support/widgetUtils.js";const R={cancelEdit:"Escape"},j="esri-column",N={input:`${j}__cell-input`,inputContainer:`${j}__cell__input-container`},S=o("short-date-short-time"),A=o("short-date"),U={useGrouping:!0,maximumFractionDigits:20};let q=class extends _{constructor(e){super(e),this._activeFieldInput=null,this.cellValueFormatFunction=({root:e,rowData:t,value:i})=>{const{formatFunction:n}=this;if(n&&t){const{index:o,item:{attachments:l,feature:r,relatedRecords:a}}=t;return n({attachments:l,column:this,feature:r,field:this.field,index:o,relatedRecords:a,value:O.sanitize(i),virtualIndex:this.getVirtualRowIndex(e)})}if(null===i)return"&nbsp;";const{field:o}=this,a=this._getDomainForFeature(t?.item?.feature);if(a){const e=this._getComputedDomain(i,a);if("date"===o.type&&"range"===a.type)return this._formatDateValueForDisplay(o,e);if(this._isNumericField&&"range"===a.type){const e=this.template?.format,t=e?l(e):U;return r(parseFloat(i),t)}return b.has(o.type)?"range"===a.type?O.sanitize(D(o,e)):O.sanitize(e):e}if("date"===o.type||b.has(o.type))return this._formatDateValueForDisplay(o,i);if(this._isNumericField){const e=this.template?.format,t=e?l(e):U;return r(parseFloat(i),t)}return O.sanitize(i)},this.cellValueValidatorFunction=({oldValue:e,value:i})=>{const{_effectiveRange:n,field:o}=this,{max:l,min:r}=n;if(this.effectiveRequired&&(null==i||""===i))return!1;if(this._isNumericField&&(u(o,i)||!x({max:l,min:r,value:i})))return t.getLogger(this).warn("value-exceeds-valid-range","Field value exceeds valid range. Attempted edit was rejected."),!1;if(this._isAnyDateOrTimeField){const e=o.type;if(!I({type:e,range:n,value:i}))return!1}return e!==i},this.field=null,this.formatFunction=null,this.inputRenderFunction=async({root:e,column:i,rowData:n})=>{if(this.editInfo||!this.effectiveEditable)return;const o=this.getCellValue(n),{field:l}=this;if("big-integer"===l.type&&u(l,o))return void t.getLogger(this).warn("value-exceeds-valid-range","Field value is beyond supported limit. Editing is disabled for this field value.");const r=n?.item.feature;if(!r)return;this._activeFieldInput=this._setUpFieldInput(r,o);const a=document.createElement("div");a.classList.add(N.inputContainer);const s=[],p="coded-value"===this._effectiveDomain?.type;if(this._isAnyDateOrTimeField&&!p){const e=document.createElement("div"),t=this._setUpDateComponents(o),i=this._setUpDateActionBar();t.forEach((t=>e.appendChild(t))),a.appendChild(e),a.appendChild(i),s.push(...t)}else{const e=this.createInputElement({value:o});a.appendChild(e),s.push(e)}this._set("editInfo",{column:i,inputs:s,root:e,rowData:n,oldValue:o}),this.removeCellContent(e),e.appendChild(a),this._syncRowEditingState(e,!0),this.grid?.generateCellPartNames();const d=s[0];await Z(d),"selectText"in d&&await d.selectText()},this.layer=null,this.parseInputValueFunction=({inputs:e})=>{const{editInfo:t,field:i,includeTime:n}=this;if(!t||!e.length)return null;const o=e[0];if(this._isAnyDateOrTimeField){const{timeZone:l}=this.effectiveTimeZoneOptions,r=t.oldValue??void 0;if("coded-value"===this._effectiveDomain?.type)return null!=o.value?parseFloat(o.value):null;switch(i.type){case"date-only":{const e=o.value;return""!==e?e:null}case"time-only":{const e=T(o.value);return""!==e?e:null}case"timestamp-offset":{const t=n?e[1]:void 0,i=e.at(-1);return w({oldValue:r,dateComponent:o,timeComponent:t,timeZoneComponent:i,defaultTimeZone:l})}case"date":{const{max:t,min:i}=this._effectiveRange;return E({oldValue:r,dateComponent:o,timeComponent:e[1],timeZone:l,max:t,min:i})}}return null}const l=o.value,{effectiveRequired:r}=this;return r||null!=l&&""!==l?this._isNumericField?parseFloat(l):this._isStringField?l.trim():l:null},this.sortable=!0,this.store=null,this.template=null,this.view=null}get _effectiveDomain(){const e=this._activeFieldInput?.feature;return e?this._getDomainForFeature(e):null}get _effectiveRange(){return this._activeFieldInput?.range??{max:null,min:null}}get _isAnyDateOrTimeField(){const{field:e}=this;return g(e)||p(e)}get _isIntegerField(){return d(this.field)}get _isNumericField(){return c(this.field)}get _isStringField(){return m(this.field)}get _isSubtypeField(){const{layer:e}=this;if(e?.subtypeField){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1}get alias(){return this.field?.alias}get defaultValue(){return this.field?.defaultValue}get effectiveDescription(){const{description:e,field:t}=this,i=t.description,n=C(e)?C(i)?null:i:e;return null==n?null:O.sanitize(n)}get effectiveEditable(){const{editable:e,field:t,layer:i,tableEditingEnabled:n}=this;if(!t||!i)return!1;const o=a(i),l=i.effectiveCapabilities??i.capabilities,r=l?.operations?.supportsUpdate;return!!(t.editable&&o&&r&&"oid"!==t.type&&n)&&e}get effectiveLabel(){return O.sanitize(this.label||this.alias||this.fieldName)}get effectiveRequired(){return!this.nullable||this._isSubtypeField||this._activeFieldInput?.required||this.required}get effectiveTimeZoneOptions(){const{layer:e,field:t}=this;if(!e||"date"!==t?.type&&"timestamp-offset"!==t?.type)return{timeZone:void 0,timeZoneName:void 0};const{tableTimeZone:i,timeZone:n,view:l}=this;return y(e.preferredTimeZone||null,!!e.datesInUnknownTimezone,n??i??l?.timeZone??v,o("short-time"),t.type)}get includeTime(){const{field:e,template:t}=this;return"time-only"===e.type||"date-only"!==e.type&&(!t?.input||"includeTime"in t.input&&!1!==t.input.includeTime)}get loadingMessage(){return this.messages?.loading||"..."}get maxLength(){const{field:e,template:t}=this,i=e?.length??-1,n=t?.input&&"maxLength"in t.input?t.input.maxLength:null;return null!=n&&!isNaN(n)&&n>=-1&&(-1===i||n<=i)?n:i}get minLength(){const{template:e,maxLength:t}=this,i=e?.input&&"minLength"in e.input?e.input.minLength:null;return t&&i<=t?i:null}get name(){return this.field?.name}get nullable(){return!1!==this.field.nullable}get shouldShowPrompt(){return this._isSubtypeField}createInputElement({value:e}){const{_effectiveDomain:t,maxLength:i,minLength:n,effectiveRequired:o}=this;let l;if("coded-value"===t?.type)l=this.createCalciteSelect(e,t.codedValues.map((({code:e,name:t})=>({value:e,name:t})))),l.addEventListener("calciteSelectChange",(()=>this.onInputBlur(l)));else if(this._isNumericField){const{_effectiveRange:{max:t,min:i}}=this;l=document.createElement("calcite-input"),l.type="number",this._isIntegerField&&(l.step=1),null!=t&&(l.max=t),null!=i&&(l.min=i),l.status=x({max:t,min:i,value:e})?"idle":"invalid"}else l=document.createElement("calcite-input"),l.addEventListener("calciteInputChange",(()=>this.onInputBlur(l))),i>-1&&(l.maxLength=i),n>0&&(l.minLength=n);return l.classList.add(N.input),l.required=o,l.value=e,l.onkeydown=e=>{e.key===R.cancelEdit&&this.onInputBlur(l,!0)},l.onblur=()=>this.onInputBlur(l),l}onEditComplete(){const e=this.editInfo?.root;e&&this._syncRowEditingState(e,!1),this._activeFieldInput=null,super.onEditComplete()}_clearActiveEditValues(){this.editInfo?.inputs?.forEach((e=>e.value=""))}_setUpDateActionBar(){const{messagesCommon:e}=this,t=e?.cancel??"",i=e?.clear??"",n=e?.save??"",o=document.createElement("calcite-action-bar");return o.expandDisabled=!0,o.layout="horizontal",o.appendChild(this.createCalciteAction({text:n,icon:"save",onclick:()=>this.submit()})),this.effectiveRequired||o.appendChild(this.createCalciteAction({text:i,icon:"trash",onclick:()=>{this._clearActiveEditValues(),this.submit()}})),o.appendChild(this.createCalciteAction({text:t,icon:"x",onclick:()=>this.cancel()})),o}_formatDateValueForDisplay(e,t){const{timeZone:i,timeZoneName:n}=this.effectiveTimeZoneOptions;return null!=t?D(e,t,{...this._getDateFormatOptions(),timeZone:i,timeZoneName:n}):null}_setUpDateComponents(e){const{_effectiveRange:{max:t,min:i,rawMax:n,rawMin:o},field:l,effectiveRequired:r}=this,a=this._getDateFieldValuesForComponents(l,e),s=[];if(g(l)){const e=this.createDateComponent(),u=f(l)||h(l)?n:t,p=f(l)||h(l)?o:i,d=this._getDateFieldValuesForComponents(l,u??null),c=this._getDateFieldValuesForComponents(l,p??null);e.value=a.date??"",e.max=d.date??"",e.min=c.date??"",e.required=r,e.addEventListener("calciteInputDatePickerOpen",(()=>this._onDateComponentOpen(e))),s.push(e)}if(this.includeTime){const e=this.createTimeComponent();e.value=a.time??"",e.required=r,e.addEventListener("calciteInputTimePickerOpen",(()=>this._onDateComponentOpen(e))),s.push(e)}if("timestamp-offset"===l.type){const e=this.createTimeZoneComponent();e.value=a.timeZoneOffset??"0",e.addEventListener("calciteInputTimeZoneOpen",(()=>this._onDateComponentOpen(e))),s.push(e)}return s}_onDateComponentOpen(e){this.editInfo?.inputs.forEach((t=>{t!==e&&"open"in t&&(t.open=!1)}))}_syncRowEditingState(e,t=!1){const i=this.grid?.getRowContainingNode(e);i&&(t?i.setAttribute("editing","true"):i.removeAttribute("editing"))}_getDateFieldValuesForComponents(e,t){switch(e.type){case"date":return L(t,this.effectiveTimeZoneOptions.timeZone);case"date-only":return{date:t};case"time-only":return{time:t};case"timestamp-offset":return V(t);default:return{}}}_setUpFieldInput(e,t){const{field:i,layer:n,effectiveTimeZoneOptions:{timeZone:o}}=this,l=new F({feature:e,field:i,initialFeature:e.clone(),layer:n,timeZone:o});return l.set("value",t),l}_isDomainCompatible(e){if(!e)return!1;const{_isNumericField:t,_isStringField:i}=this,{type:n}=e;if("coded-value"===n){const n=typeof e.codedValues[0].code;if("string"===n&&i||"number"===n&&t)return!0}return!("range"!==n||!t)}_getDomainForFeature(e){const{fieldName:t,layer:i,template:n}=this;if(!e||!i?.getFieldDomain)return null;if("wfs"===i.type||"geojson"===i.type||"csv"===i.type||"knowledge-graph-sublayer"===i.type)return null;if(n?.domain&&this._isDomainCompatible(n.domain))return n.domain;if("feature"!==i.type&&"subtype-group"!==i.type&&null==i.getField(t)?.domain){const e=s(i,t);if(e)return e}return i.getFieldDomain(t,{feature:e})}_getComputedDomain(e,t){if(!t)return null;if("range"===t.type)return e;if("coded-value"===t.type){const i=t.codedValues.filter((t=>t.hasOwnProperty("code")&&t.code===e));return i&&i.length?i[0].name:e}return null}_getDateFormatOptions(){const{template:e}=this,t=e?.format?.dateFormat;return t?o(t):e?.input&&"includeTime"in e.input&&!1===e.input.includeTime?A:S}};e([i()],q.prototype,"_effectiveDomain",null),e([i()],q.prototype,"_activeFieldInput",void 0),e([i()],q.prototype,"_effectiveRange",null),e([i()],q.prototype,"_isAnyDateOrTimeField",null),e([i()],q.prototype,"_isIntegerField",null),e([i()],q.prototype,"_isNumericField",null),e([i()],q.prototype,"_isStringField",null),e([i()],q.prototype,"_isSubtypeField",null),e([i({readOnly:!0})],q.prototype,"alias",null),e([i()],q.prototype,"cellValueFormatFunction",void 0),e([i()],q.prototype,"cellValueValidatorFunction",void 0),e([i({readOnly:!0})],q.prototype,"defaultValue",null),e([i()],q.prototype,"effectiveDescription",null),e([i()],q.prototype,"effectiveEditable",null),e([i()],q.prototype,"effectiveLabel",null),e([i()],q.prototype,"effectiveRequired",null),e([i()],q.prototype,"effectiveTimeZoneOptions",null),e([i()],q.prototype,"field",void 0),e([i()],q.prototype,"formatFunction",void 0),e([i()],q.prototype,"includeTime",null),e([i()],q.prototype,"inputRenderFunction",void 0),e([i()],q.prototype,"layer",void 0),e([i({readOnly:!0})],q.prototype,"loadingMessage",null),e([i()],q.prototype,"maxLength",null),e([i()],q.prototype,"minLength",null),e([i({readOnly:!0})],q.prototype,"name",null),e([i({readOnly:!0})],q.prototype,"nullable",null),e([i()],q.prototype,"parseInputValueFunction",void 0),e([i()],q.prototype,"shouldShowPrompt",null),e([i()],q.prototype,"sortable",void 0),e([i()],q.prototype,"store",void 0),e([i()],q.prototype,"template",void 0),e([i()],q.prototype,"view",void 0),q=e([n("esri.widgets.FeatureTable.FieldColumn")],q);const k=q;export{k as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Logger.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{convertDateFormatToIntlOptions as o}from"../../intl/date.js";import{convertNumberFormatToIntlOptions as l,formatNumber as r}from"../../intl/number.js";import{isEditableLayer as a}from"../../layers/support/editableLayers.js";import{computeDomainFromTypes as s}from"../../layers/support/featureLayerUtils.js";import{validateFieldValue as u,isTimeOnlyField as p,isIntegerField as d,isNumericField as c,isStringField as m,isDateOnlyField as f,isTimestampOffsetField as h}from"../../layers/support/fieldUtils.js";import{isAnyDateField as g}from"../../smartMapping/support/utils.js";import{getTimeZoneFormattingOptions as y,system as v}from"../../time/timeZoneUtils.js";import F from"../FeatureForm/FieldInput.js";import _ from"./Grid/EditorColumn.js";import{isEmptyStringOrWhitespace as C}from"./support/tableUtils.js";import{dateFieldsWithStringFieldValue as b,getLabelForDateFieldValue as D,valueIsInRange as x,dateTimeIsInRange as I,getUnixFieldValueFromDateComponents as E,getISOFieldValueFromDateComponents as w,normalizeTimeOnlyString as T,prepareISOFieldValueForDateComponents as V,prepareUnixFieldValueForDateComponents as L}from"../support/dateUtils.js";import{renderingSanitizer as O,setFocus as Z}from"../support/widgetUtils.js";const R={cancelEdit:"Escape"},j="esri-column",N={input:`${j}__cell-input`,inputContainer:`${j}__cell__input-container`},S=o("short-date-short-time"),A=o("short-date"),U={useGrouping:!0,maximumFractionDigits:20};let q=class extends _{constructor(e){super(e),this._activeFieldInput=null,this.cellValueFormatFunction=({root:e,rowData:t,value:i})=>{const{formatFunction:n}=this;if(n&&t){const{index:o,item:{attachments:l,feature:r,relatedRecords:a}}=t;return n({attachments:l,column:this,feature:r,field:this.field,index:o,relatedRecords:a,value:O.sanitize(i),virtualIndex:this.getVirtualRowIndex(e)})}if(null===i)return"&nbsp;";const{field:o}=this,a=this._getDomainForFeature(t?.item?.feature);if(a){const e=this._getComputedDomain(i,a);if("date"===o.type&&"range"===a.type)return this._formatDateValueForDisplay(o,e);if(this._isNumericField&&"range"===a.type){const e=this.template?.format,t=e?l(e):U;return r(parseFloat(i),t)}return b.has(o.type)?"range"===a.type?O.sanitize(D(o,e)):O.sanitize(e):e}if("date"===o.type||b.has(o.type))return this._formatDateValueForDisplay(o,i);if(this._isNumericField){const e=this.template?.format,t=e?l(e):U;return r(parseFloat(i),t)}return O.sanitize(i)},this.cellValueValidatorFunction=({oldValue:e,value:i})=>{const{_effectiveRange:n,field:o}=this,{max:l,min:r}=n;if(this.effectiveRequired&&(null==i||""===i))return!1;if(this._isNumericField&&(u(o,i)||!x({max:l,min:r,value:i})))return t.getLogger(this).warn("value-exceeds-valid-range","Field value exceeds valid range. Attempted edit was rejected."),!1;if(this._isAnyDateOrTimeField){const e=o.type;if(!I({type:e,range:n,value:i}))return!1}return e!==i},this.field=null,this.formatFunction=null,this.inputRenderFunction=async({root:e,column:i,rowData:n})=>{if(this.editInfo||!this.effectiveEditable)return;const o=this.getCellValue(n),{field:l}=this;if("big-integer"===l.type&&u(l,o))return void t.getLogger(this).warn("value-exceeds-valid-range","Field value is beyond supported limit. Editing is disabled for this field value.");const r=n?.item.feature;if(!r)return;this._activeFieldInput=this._setUpFieldInput(r,o);const a=document.createElement("div");a.classList.add(N.inputContainer);const s=[],p="coded-value"===this._effectiveDomain?.type;if(this._isAnyDateOrTimeField&&!p){const e=document.createElement("div"),t=this._setUpDateComponents(o),i=this._setUpDateActionBar();t.forEach((t=>e.appendChild(t))),a.appendChild(e),a.appendChild(i),s.push(...t)}else{const e=this.createInputElement({value:o});a.appendChild(e),s.push(e)}this._set("editInfo",{column:i,inputs:s,root:e,rowData:n,oldValue:o}),this.removeCellContent(e),e.appendChild(a),this._syncRowEditingState(e,!0),this.grid?.generateCellPartNames();const d=s[0];await Z(d),"selectText"in d&&await d.selectText()},this.layer=null,this.parseInputValueFunction=({inputs:e})=>{const{editInfo:t,field:i,includeTime:n}=this;if(!t||!e.length)return null;const o=e[0];if(this._isAnyDateOrTimeField){const{timeZone:l}=this.effectiveTimeZoneOptions,r=t.oldValue??void 0;if("coded-value"===this._effectiveDomain?.type)return null!=o.value?parseFloat(o.value):null;switch(i.type){case"date-only":{const e=o.value;return""!==e?e:null}case"time-only":{const e=T(o.value);return""!==e?e:null}case"timestamp-offset":{const t=n?e[1]:void 0,i=e.at(-1);return w({oldValue:r,dateComponent:o,timeComponent:t,timeZoneComponent:i,defaultTimeZone:l})}case"date":{const{max:t,min:i}=this._effectiveRange;return E({oldValue:r,dateComponent:o,timeComponent:e[1],timeZone:l,max:t,min:i})}}return null}const l=o.value,{effectiveRequired:r}=this;return r||null!=l&&""!==l?this._isNumericField?parseFloat(l):this._isStringField?l.trim():l:null},this.sortable=!0,this.store=null,this.template=null,this.view=null}get _effectiveDomain(){const e=this._activeFieldInput?.feature;return e?this._getDomainForFeature(e):null}get _effectiveRange(){return this._activeFieldInput?.range??{max:null,min:null}}get _isAnyDateOrTimeField(){const{field:e}=this;return g(e)||p(e)}get _isIntegerField(){return d(this.field)}get _isNumericField(){return c(this.field)}get _isStringField(){return m(this.field)}get _isSubtypeField(){const{layer:e}=this;if(e?.subtypeField){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1}get alias(){return this.field?.alias}get defaultValue(){return this.field?.defaultValue}get effectiveDescription(){const{description:e,field:t}=this,i=t.description,n=C(e)?C(i)?null:i:e;return null==n?null:O.sanitize(n)}get effectiveEditable(){const{editable:e,field:t,layer:i,tableEditingEnabled:n}=this;if(!t||!i)return!1;const o=a(i),l=i.effectiveCapabilities??i.capabilities,r=l?.operations?.supportsUpdate;return!!(t.editable&&o&&r&&"oid"!==t.type&&n)&&e}get effectiveLabel(){return O.sanitize(this.label||this.alias||this.fieldName)}get effectiveRequired(){return!this.nullable||this._isSubtypeField||this._activeFieldInput?.required||this.required}get effectiveTimeZoneOptions(){const{layer:e,field:t}=this;if(!e||"date"!==t?.type&&"timestamp-offset"!==t?.type)return{timeZone:void 0,timeZoneName:void 0};const{tableTimeZone:i,timeZone:n,view:l}=this;return y(e.preferredTimeZone||null,!!e.datesInUnknownTimezone,n??i??l?.timeZone??v,o("short-time"),t.type)}get includeTime(){const{field:e,template:t}=this;return"time-only"===e.type||"date-only"!==e.type&&(!t?.input||"includeTime"in t.input&&!1!==t.input.includeTime)}get loadingMessage(){return this.messages?.loading||"..."}get maxLength(){const{field:e,template:t}=this,i=e?.length??-1,n=t?.input&&"maxLength"in t.input?t.input.maxLength:null;return null!=n&&!isNaN(n)&&n>=-1&&(-1===i||n<=i)?n:i}get minLength(){const{template:e,maxLength:t}=this,i=e?.input&&"minLength"in e.input?e.input.minLength:null;return t&&i<=t?i:null}get name(){return this.field?.name}get nullable(){return!1!==this.field.nullable}get shouldShowPrompt(){return this._isSubtypeField}createInputElement({value:e}){const{_effectiveDomain:t,maxLength:i,minLength:n,effectiveRequired:o}=this;let l;if("coded-value"===t?.type)l=this.createCalciteSelect(e,t.codedValues.map((({code:e,name:t})=>({value:e,name:t})))),l.addEventListener("calciteSelectChange",(()=>this.onInputBlur(l)));else if(this._isNumericField){const{_effectiveRange:{max:t,min:i}}=this;l=document.createElement("calcite-input"),l.type="number",this._isIntegerField&&(l.step=1),null!=t&&(l.max=t),null!=i&&(l.min=i),l.status=x({max:t,min:i,value:e})?"idle":"invalid"}else l=document.createElement("calcite-input"),l.addEventListener("calciteInputChange",(()=>this.onInputBlur(l))),i>-1&&(l.maxLength=i),n>0&&(l.minLength=n);return l.classList.add(N.input),l.required=o,l.value=null!=e?e.toString():"",l.onkeydown=e=>{e.key===R.cancelEdit&&this.onInputBlur(l,!0)},l.onblur=()=>this.onInputBlur(l),l}onEditComplete(){const e=this.editInfo?.root;e&&this._syncRowEditingState(e,!1),this._activeFieldInput=null,super.onEditComplete()}_clearActiveEditValues(){this.editInfo?.inputs?.forEach((e=>e.value=""))}_setUpDateActionBar(){const{messagesCommon:e}=this,t=e?.cancel??"",i=e?.clear??"",n=e?.save??"",o=document.createElement("calcite-action-bar");return o.expandDisabled=!0,o.layout="horizontal",o.appendChild(this.createCalciteAction({text:n,icon:"save",onclick:()=>this.submit()})),this.effectiveRequired||o.appendChild(this.createCalciteAction({text:i,icon:"trash",onclick:()=>{this._clearActiveEditValues(),this.submit()}})),o.appendChild(this.createCalciteAction({text:t,icon:"x",onclick:()=>this.cancel()})),o}_formatDateValueForDisplay(e,t){const{timeZone:i,timeZoneName:n}=this.effectiveTimeZoneOptions;return null!=t?D(e,t,{...this._getDateFormatOptions(),timeZone:i,timeZoneName:n}):null}_setUpDateComponents(e){const{_effectiveRange:{max:t,min:i,rawMax:n,rawMin:o},field:l,effectiveRequired:r}=this,a=this._getDateFieldValuesForComponents(l,e),s=[];if(g(l)){const e=this.createDateComponent(),u=f(l)||h(l)?n:t,p=f(l)||h(l)?o:i,d=this._getDateFieldValuesForComponents(l,u??null),c=this._getDateFieldValuesForComponents(l,p??null);e.value=a.date??"",e.max=d.date??"",e.min=c.date??"",e.required=r,e.addEventListener("calciteInputDatePickerOpen",(()=>this._onDateComponentOpen(e))),s.push(e)}if(this.includeTime){const e=this.createTimeComponent();e.value=a.time??"",e.required=r,e.addEventListener("calciteInputTimePickerOpen",(()=>this._onDateComponentOpen(e))),s.push(e)}if("timestamp-offset"===l.type){const e=this.createTimeZoneComponent();e.value=a.timeZoneOffset??"0",e.addEventListener("calciteInputTimeZoneOpen",(()=>this._onDateComponentOpen(e))),s.push(e)}return s}_onDateComponentOpen(e){this.editInfo?.inputs.forEach((t=>{t!==e&&"open"in t&&(t.open=!1)}))}_syncRowEditingState(e,t=!1){const i=this.grid?.getRowContainingNode(e);i&&(t?i.setAttribute("editing","true"):i.removeAttribute("editing"))}_getDateFieldValuesForComponents(e,t){switch(e.type){case"date":return L(t,this.effectiveTimeZoneOptions.timeZone);case"date-only":return{date:t};case"time-only":return{time:t};case"timestamp-offset":return V(t);default:return{}}}_setUpFieldInput(e,t){const{field:i,layer:n,effectiveTimeZoneOptions:{timeZone:o}}=this,l=new F({feature:e,field:i,initialFeature:e.clone(),layer:n,timeZone:o});return l.set("value",t),l}_isDomainCompatible(e){if(!e)return!1;const{_isNumericField:t,_isStringField:i}=this,{type:n}=e;if("coded-value"===n){const n=typeof e.codedValues[0].code;if("string"===n&&i||"number"===n&&t)return!0}return!("range"!==n||!t)}_getDomainForFeature(e){const{fieldName:t,layer:i,template:n}=this;if(!e||!i?.getFieldDomain)return null;if("wfs"===i.type||"geojson"===i.type||"csv"===i.type||"knowledge-graph-sublayer"===i.type)return null;if(n?.domain&&this._isDomainCompatible(n.domain))return n.domain;if("feature"!==i.type&&"subtype-group"!==i.type&&null==i.getField(t)?.domain){const e=s(i,t);if(e)return e}return i.getFieldDomain(t,{feature:e})}_getComputedDomain(e,t){if(!t)return null;if("range"===t.type)return e;if("coded-value"===t.type){const i=t.codedValues.filter((t=>t.hasOwnProperty("code")&&t.code===e));return i&&i.length?i[0].name:e}return null}_getDateFormatOptions(){const{template:e}=this,t=e?.format?.dateFormat;return t?o(t):e?.input&&"includeTime"in e.input&&!1===e.input.includeTime?A:S}};e([i()],q.prototype,"_effectiveDomain",null),e([i()],q.prototype,"_activeFieldInput",void 0),e([i()],q.prototype,"_effectiveRange",null),e([i()],q.prototype,"_isAnyDateOrTimeField",null),e([i()],q.prototype,"_isIntegerField",null),e([i()],q.prototype,"_isNumericField",null),e([i()],q.prototype,"_isStringField",null),e([i()],q.prototype,"_isSubtypeField",null),e([i({readOnly:!0})],q.prototype,"alias",null),e([i()],q.prototype,"cellValueFormatFunction",void 0),e([i()],q.prototype,"cellValueValidatorFunction",void 0),e([i({readOnly:!0})],q.prototype,"defaultValue",null),e([i()],q.prototype,"effectiveDescription",null),e([i()],q.prototype,"effectiveEditable",null),e([i()],q.prototype,"effectiveLabel",null),e([i()],q.prototype,"effectiveRequired",null),e([i()],q.prototype,"effectiveTimeZoneOptions",null),e([i()],q.prototype,"field",void 0),e([i()],q.prototype,"formatFunction",void 0),e([i()],q.prototype,"includeTime",null),e([i()],q.prototype,"inputRenderFunction",void 0),e([i()],q.prototype,"layer",void 0),e([i({readOnly:!0})],q.prototype,"loadingMessage",null),e([i()],q.prototype,"maxLength",null),e([i()],q.prototype,"minLength",null),e([i({readOnly:!0})],q.prototype,"name",null),e([i({readOnly:!0})],q.prototype,"nullable",null),e([i()],q.prototype,"parseInputValueFunction",void 0),e([i()],q.prototype,"shouldShowPrompt",null),e([i()],q.prototype,"sortable",void 0),e([i()],q.prototype,"store",void 0),e([i()],q.prototype,"template",void 0),e([i()],q.prototype,"view",void 0),q=e([n("esri.widgets.FeatureTable.FieldColumn")],q);const k=q;export{k as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import t from"../../Graphic.js";import"../../symbols.js";import{isSome as i}from"../../core/arrayUtils.js";import s from"../../core/Error.js";import r from"../../core/Logger.js";import{debounce as o,isAbortError as a}from"../../core/promiseUtils.js";import n from"../../core/ReactiveSet.js";import{watch as l,when as u,sync as h}from"../../core/reactiveUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{initializeProjection as p,project as g}from"../../geometry/projection.js";import{getPointFromGeometry as m}from"../../geometry/support/geometryUtils.js";import{geographicToWebMercator as f}from"../../geometry/support/webMercatorUtils.js";import y from"../../layers/Layer.js";import{fallbackObjectIDAttribute as w}from"../../layers/LayerConstants.js";import{getDisplayedSymbol as F}from"../../symbols/support/symbolUtils.js";import{system as v}from"../../time/timeZoneUtils.js";import{highlightsSupported as _}from"../../views/support/layerViewUtils.js";import b from"../Feature/FeatureViewModel.js";import{ActionsCollection as C,zoomToFeature as P,zoomToClusteredFeatures as E,browseClusteredFeatures as M}from"../Popup/actions.js";import{triggerAction as j,isClusterFeature as A,removeClusteredFeaturesForBrowsing as L,displayClusterExtent as V,browseAggregateFeatures as I,getSelectedTarget as T}from"../Popup/actionUtils.js";import S from"../support/AnchorElementViewModel.js";import O from"../support/GoTo.js";import R from"../../symbols/SimpleFillSymbol.js";import x from"../../geometry/Point.js";const H="location-scale-handle",B=()=>[P.clone()],U=()=>[E.clone(),M.clone()];let G=null;function Z(e,t){return"building-scene"===e||"2d"===t&&("map-image"===e||"tile"===e||"imagery"===e||"imagery-tile"===e)}let z=class extends(O(S)){constructor(e){super(e),this._pendingPromises=new n,this._fetchFeaturesController=null,this._highlightSelectedFeaturePromise=null,this._highlightActiveFeaturePromise=null,this._selectedClusterFeature=null,this.actions=new C,this.activeFeature=null,this.autoCloseEnabled=!1,this.browseClusterEnabled=!1,this.content=null,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureMenuTitle=null,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new t({symbol:new R({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null,this._debouncedLocationUpdate=o((async e=>{const{spatialReference:t}=this,i=this.selectedFeature?.geometry?.type,s=this.location??e;if(i&&"mesh"!==i&&t&&s&&this.selectedFeature)if("point"!==i)try{const e=this.selectedFeature;let i=e.geometry;const r=this._getHighlightLayer(e),o=e.getObjectId();if(!r||!this.view)return;if(o){const e=this.view?.allLayerViews.find((e=>e.layer.uid===r.uid));if(!e||!("queryFeatures"in e))return;const s=e.createQuery();s.outSpatialReference=t,s.objectIds=[o],s.returnGeometry=!0;const{features:a}=await e.queryFeatures(s);i=a[0]?.geometry}if(!i||"mesh"===i.type)return;if(i=g(i,t),G||(G=await import("../../geometry/geometryEngineAsync.js")),!await G.intersects(i,s)){const t=(await G.nearestCoordinate(i,s)).coordinate??s;this.selectedFeature===e&&(this.location=t)}}catch(o){a(o)||r.getLogger(this).error(o)}else this.location=m(this.selectedFeature.geometry)??s}))}initialize(){this.addHandles([this.on("view-change",(()=>this._autoClose())),l((()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view]),(()=>this._highlightSelectedFeature())),l((()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view]),(()=>this._highlightActiveFeature())),l((()=>this.view?.animation?.state),(e=>this._animationStateChange(e))),l((()=>this.location),(e=>this._locationChange(e))),l((()=>this.selectedFeature),(e=>this._selectedFeatureChange(e))),l((()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage]),(()=>this._selectedFeatureIndexChange())),l((()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels]),(()=>this._setGraphicOnFeatureViewModels())),l((()=>this.featureViewModels),(()=>this._featureViewModelsChange())),this.on("trigger-action",(e=>j({event:e,viewModel:this,view:this.view}))),u((()=>!this.waitingForResult),(()=>this._waitingForResultChange()),h),l((()=>[this.features,this.map,this.spatialReference,this.timeZone]),(()=>this._updateFeatureVMs())),l((()=>this.view?.scale),(()=>this._viewScaleChange())),u((()=>!this.visible),(()=>this.browseClusterEnabled=!1)),l((()=>this.browseClusterEnabled),(e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing()))])}destroy(){this._cancelFetchingFeatures(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new C;e.removeAll();const{actions:t,defaultActions:i,defaultPopupTemplateEnabled:s,includeDefaultActions:r,selectedFeature:o}=this,a=r?i.concat(t):t,n=o&&("function"==typeof o.getEffectivePopupTemplate&&o.getEffectivePopupTemplate(s)||o.popupTemplate),l=n?.actions,u=n?.overwriteActions?l:l?.concat(a)??a;return u?.filter(Boolean).forEach((t=>e.add(t))),e}get defaultActions(){const e=this._get("defaultActions")||new C;return e.removeAll(),e.addMany(A(this.selectedFeature)?U():B()),e}get featureCount(){return this.features.length}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:i,promiseCount:s,selectedFeatureIndex:r}=this,o=s&&t.length;o&&i&&-1===r?this.selectedFeatureIndex=0:o&&-1!==r||(this.selectedFeatureIndex=t.length?0:-1)}set location(e){let t=e;const i=this.spatialReference?.isWebMercator,s=e?.spatialReference?.isWGS84;s&&i&&(t=f(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),(e=e.slice()).forEach((e=>this._pendingPromises.add(e))),e.reduce(((e,t)=>e.finally((()=>t.then((e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)})).finally((()=>this._pendingPromises.delete(t))).catch((()=>{}))))),Promise.resolve())):this._set("promises",[])}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;if(-1===t)return null;return e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;e=isNaN(e)||e<-1||!t?-1:(e+t)%t,this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??v}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureViewModels.some((e=>e.waitingForContent))}get waitingForResult(){return!(!(!!this._fetchFeaturesController||this.pendingPromisesCount>0)||0!==this.featureCount)}centerAtLocation(){const{view:e}=this,t=T(this);return t&&e?this.callGoTo({target:{target:t,scale:e.scale}}):Promise.reject(new s("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new s("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return i.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}open(e){const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:i}=t;delete t.fetchFeatures,i&&this._setFetchFeaturesPromises(t.location);const s=["actionsMenuOpen","collapsed"];for(const r of s)delete t[r];this.set(t)}triggerAction(e){const t=this.allActions.at(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex++,this}previous(){return this.selectedFeatureIndex--,this}disableClusterBrowsing(){L(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;"2d"===e?.type?A(t)?(await V(this),await I(this)):r.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):r.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}handleViewClick(e){this._fetchFeaturesAndOpen(e)}_animationStateChange(e){this.zoomToLocation||(P.disabled="waiting-for-target"===e)}_clearBrowsedClusterGraphics(){const e=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(i);this.view?.graphics?.removeMany(e),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(A(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:s}=this;s&&i&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>1?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>1?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:s,featureViewModels:r}=this;if(null===i)return;const o=((i-1)*s+t)%t,a=o+s;r.slice(o,a).forEach(((t,i)=>{t&&(t.graphic??=e[o+i])}))}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:s}=this;if(!e||!s)return;if(this.browseClusterEnabled){if(this._selectedClusterFeature&&(s.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),A(e))return;return e.symbol=await F(e),this._selectedClusterFeature=e,void s.graphics.add(this._selectedClusterFeature)}const r=e.sourceLayer?.type;if("map-image"!==r&&"imagery"!==r&&"imagery-tile"!==r||(e.symbol=await F(e)),!i&&t||!e.geometry){if(i&&!e.geometry){await this.centerAtLocation();const e=s.center?.clone();e&&(this.location=e)}}else this.location=m(e.geometry)}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}async _setFetchFeaturesPromises(e){const{pendingFeatures:t}=await this._fetchFeaturesWithController({mapPoint:e});this.promises=t}_destroyFeatureVMs(){this.featureViewModels.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:i,view:s,spatialReference:r,map:o,timeZone:a,location:n}=this;if(A(e)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t?.length)return;const l=i.slice(),u=[];t.forEach(((t,i)=>{if(!t)return;let h=null;if(l.some(((e,i)=>(e&&e.graphic===t&&(h=e,l.splice(i,1)),!!h))),h)u[i]=h;else{const l=new b({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:r,graphic:t===e?t:null,location:n,map:o,view:s,timeZone:a});u[i]=l}})),l.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("featureViewModels",u)}async _getScreenPoint(e,t){const{spatialReference:i,view:s}=this;if(!s)return null;await(s?.when());const r=e?.spatialReference;return r&&i?(await p(r,i,null,t),s.toScreen(e)):null}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:s}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:s}),{signal:s,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const s=new AbortController,{signal:r}=s;this._fetchFeaturesController=s;const o=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:r,event:i});return o.catch((()=>{})).then((()=>{this._fetchFeaturesController=null})),o}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e,{view:s}=this;this.removeHandles(H),this.addHandles([l((()=>this.view?.scale),(()=>this._debouncedLocationUpdate(t).catch((e=>{a(e)||r.getLogger(this).error(e)})))),u((()=>!this.visible),(()=>{this.removeHandles(H)}),{once:!0})],H);const{pendingFeatures:o}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});s?.popup&&"open"in s.popup&&s.popup.open({location:t??void 0,promises:o})}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const{layer:t,sourceLayer:i}=e;return i&&"layer"in i&&i.layer?i.layer:"map-notes"===i?.type||"subtype-group"===i?.type?i:t}_getHighlightTarget(e,t,i){if(Z(t.type,i))return e;const s=e.getObjectId();if(null!=s)return s;const r="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||w:null,o=e.attributes;return o&&r&&o[r]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightActiveFeature(){const e="highlight-active-feature";this.removeHandles(e);const{highlightEnabled:t,view:i,activeFeature:s,visible:r}=this;if(!(s&&i&&t&&r))return;const o=this._getHighlightLayer(s);if(!(o&&o instanceof y&&this._mapIncludesLayer(o)))return;const a=this._getLayerView(i,o);this._highlightActiveFeaturePromise=a;const n=await a;if(!(n&&_(n)&&this._highlightActiveFeaturePromise===a&&this.activeFeature&&this.highlightEnabled))return;const l=n.highlight(this._getHighlightTarget(s,o,i.type));this.addHandles(l,e)}async _highlightSelectedFeature(){const e="highlight-selected-feature";this.removeHandles(e);const{selectedFeature:t,highlightEnabled:i,view:s,visible:r}=this;if(!(t&&s&&i&&r))return;const o=this._getHighlightLayer(t);if(!(o&&o instanceof y&&this._mapIncludesLayer(o)))return;const a=this._getLayerView(s,o);this._highlightSelectedFeaturePromise=a;const n=await a;if(!(n&&_(n)&&this._highlightSelectedFeaturePromise===a&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const l=n.highlight(this._getHighlightTarget(t,o,s.type));this.addHandles(l,e)}_updateFeatures(e){const{features:t}=this,i=e.filter((e=>!t.includes(e)));i?.length&&(this.features=t.concat(i))}};e([c()],z.prototype,"_fetchFeaturesController",void 0),e([c({type:C})],z.prototype,"actions",void 0),e([c({readOnly:!0})],z.prototype,"active",null),e([c()],z.prototype,"activeFeature",void 0),e([c({readOnly:!0})],z.prototype,"allActions",null),e([c()],z.prototype,"autoCloseEnabled",void 0),e([c()],z.prototype,"browseClusterEnabled",void 0),e([c()],z.prototype,"content",void 0),e([c({type:C,readOnly:!0})],z.prototype,"defaultActions",null),e([c({type:Boolean})],z.prototype,"defaultPopupTemplateEnabled",void 0),e([c({readOnly:!0})],z.prototype,"featureCount",null),e([c()],z.prototype,"featurePage",void 0),e([c({value:[]})],z.prototype,"features",null),e([c()],z.prototype,"featuresPerPage",void 0),e([c()],z.prototype,"featureMenuOpen",void 0),e([c()],z.prototype,"featureMenuTitle",void 0),e([c()],z.prototype,"featureViewModelAbilities",void 0),e([c({readOnly:!0})],z.prototype,"featureViewModels",void 0),e([c()],z.prototype,"highlightEnabled",void 0),e([c()],z.prototype,"includeDefaultActions",void 0),e([c({type:x})],z.prototype,"location",null),e([c()],z.prototype,"map",null),e([c({readOnly:!0})],z.prototype,"pendingPromisesCount",null),e([c({readOnly:!0})],z.prototype,"promiseCount",null),e([c()],z.prototype,"promises",null),e([c({readOnly:!0})],z.prototype,"selectedClusterBoundaryFeature",void 0),e([c({value:null,readOnly:!0})],z.prototype,"selectedFeature",null),e([c({value:-1})],z.prototype,"selectedFeatureIndex",null),e([c({readOnly:!0})],z.prototype,"selectedFeatureViewModel",null),e([c({readOnly:!0})],z.prototype,"state",null),e([c()],z.prototype,"timeZone",null),e([c()],z.prototype,"title",void 0),e([c()],z.prototype,"updateLocationEnabled",void 0),e([c()],z.prototype,"view",void 0),e([c()],z.prototype,"visible",void 0),e([c({readOnly:!0})],z.prototype,"waitingForContents",null),e([c({readOnly:!0})],z.prototype,"waitingForResult",null),e([c()],z.prototype,"zoomFactor",void 0),e([c()],z.prototype,"zoomToLocation",void 0),e([c()],z.prototype,"centerAtLocation",null),z=e([d("esri.widgets.Features.FeaturesViewModel")],z);const W=z;export{W as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import t from"../../Graphic.js";import"../../symbols.js";import{isSome as i}from"../../core/arrayUtils.js";import s from"../../core/Error.js";import r from"../../core/Logger.js";import{debounce as o,isAbortError as a}from"../../core/promiseUtils.js";import n from"../../core/ReactiveSet.js";import{watch as l,when as u,sync as h}from"../../core/reactiveUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{initializeProjection as p,project as g}from"../../geometry/projection.js";import{getPointFromGeometry as m}from"../../geometry/support/geometryUtils.js";import{geographicToWebMercator as f}from"../../geometry/support/webMercatorUtils.js";import y from"../../layers/Layer.js";import{fallbackObjectIDAttribute as w}from"../../layers/LayerConstants.js";import{getDisplayedSymbol as F}from"../../symbols/support/symbolUtils.js";import{system as v}from"../../time/timeZoneUtils.js";import{highlightsSupported as _}from"../../views/support/layerViewUtils.js";import b from"../Feature/FeatureViewModel.js";import{ActionsCollection as C,zoomToFeature as P,zoomToClusteredFeatures as E,browseClusteredFeatures as M}from"../Popup/actions.js";import{triggerAction as j,isClusterFeature as A,removeClusteredFeaturesForBrowsing as L,displayClusterExtent as V,browseAggregateFeatures as I,getSelectedTarget as T}from"../Popup/actionUtils.js";import S from"../support/AnchorElementViewModel.js";import O from"../support/GoTo.js";import R from"../../symbols/SimpleFillSymbol.js";import x from"../../geometry/Point.js";const H="location-scale-handle",B=()=>[P.clone()],U=()=>[E.clone(),M.clone()];let G=null;function Z(e,t){return"building-scene"===e||"2d"===t&&("map-image"===e||"tile"===e||"imagery"===e||"imagery-tile"===e)}let z=class extends(O(S)){constructor(e){super(e),this._pendingPromises=new n,this._fetchFeaturesController=null,this._highlightSelectedFeaturePromise=null,this._highlightActiveFeaturePromise=null,this._selectedClusterFeature=null,this.actions=new C,this.activeFeature=null,this.autoCloseEnabled=!1,this.browseClusterEnabled=!1,this.content=null,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureMenuTitle=null,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new t({symbol:new R({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null,this._debouncedLocationUpdate=o((async e=>{const{spatialReference:t}=this,i=this.selectedFeature?.geometry?.type,s=this.location??e;if(i&&"mesh"!==i&&t&&s&&this.selectedFeature)if("point"!==i)try{const e=this.selectedFeature;let i=e.geometry;const r=this._getHighlightLayer(e),o=e.getObjectId();if(!r||!this.view)return;if(o){const e=this.view?.allLayerViews.find((e=>e.layer.uid===r.uid));if(!e||!("queryFeatures"in e))return;const s=e.createQuery();s.outSpatialReference=t,s.objectIds=[o],s.returnGeometry=!0;const{features:a}=await e.queryFeatures(s);i=a[0]?.geometry}if(!i||"mesh"===i.type)return;if(i=g(i,t),G||(G=await import("../../geometry/geometryEngineAsync.js")),!await G.intersects(i,s)){const t=(await G.nearestCoordinate(i,s)).coordinate??s;this.selectedFeature===e&&(this.location=t)}}catch(o){a(o)||r.getLogger(this).error(o)}else this.location=m(this.selectedFeature.geometry)??s}))}initialize(){this.addHandles([this.on("view-change",(()=>this._autoClose())),l((()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view]),(()=>this._highlightSelectedFeature())),l((()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view]),(()=>this._highlightActiveFeature())),l((()=>this.view?.animation?.state),(e=>this._animationStateChange(e))),l((()=>this.location),(e=>this._locationChange(e))),l((()=>this.selectedFeature),(e=>this._selectedFeatureChange(e))),l((()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage]),(()=>this._selectedFeatureIndexChange())),l((()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels]),(()=>this._setGraphicOnFeatureViewModels())),l((()=>this.featureViewModels),(()=>this._featureViewModelsChange())),this.on("trigger-action",(e=>j({event:e,viewModel:this,view:this.view}))),u((()=>!this.waitingForResult),(()=>this._waitingForResultChange()),h),l((()=>[this.features,this.map,this.spatialReference,this.timeZone]),(()=>this._updateFeatureVMs())),l((()=>this.view?.scale),(()=>this._viewScaleChange())),u((()=>!this.visible),(()=>this.browseClusterEnabled=!1)),l((()=>this.browseClusterEnabled),(e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing()))])}destroy(){this._cancelFetchingFeatures(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new C;e.removeAll();const{actions:t,defaultActions:i,defaultPopupTemplateEnabled:s,includeDefaultActions:r,selectedFeature:o}=this,a=r?i.concat(t):t,n=o&&("function"==typeof o.getEffectivePopupTemplate&&o.getEffectivePopupTemplate(s)||o.popupTemplate),l=n?.actions,u=n?.overwriteActions?l:l?.concat(a)??a;return u?.filter(Boolean).forEach((t=>e.add(t))),e}get defaultActions(){const e=this._get("defaultActions")||new C;return e.removeAll(),e.addMany(A(this.selectedFeature)?U():B()),e}get featureCount(){return this.features.length}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:i,promiseCount:s,selectedFeatureIndex:r}=this,o=s&&t.length;o&&i&&-1===r?this.selectedFeatureIndex=0:o&&-1!==r||(this.selectedFeatureIndex=t.length?0:-1)}set location(e){let t=e;const i=this.spatialReference?.isWebMercator,s=e?.spatialReference?.isWGS84;s&&i&&(t=f(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),(e=e.slice()).forEach((e=>this._pendingPromises.add(e))),e.reduce(((e,t)=>e.finally((()=>t.then((e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)})).finally((()=>this._pendingPromises.delete(t))).catch((()=>{}))))),Promise.resolve())):this._set("promises",[])}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;if(-1===t)return null;return e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;e=isNaN(e)||e<-1||!t?-1:(e+t)%t,this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??v}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureViewModels.some((e=>e.waitingForContent))}get waitingForResult(){return!(!(!!this._fetchFeaturesController||this.pendingPromisesCount>0)||0!==this.featureCount)}centerAtLocation(){const{view:e}=this,t=T(this);return t&&e?this.callGoTo({target:{target:t,scale:e.scale}}):Promise.reject(new s("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new s("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return i.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}open(e){const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:i}=t;delete t.fetchFeatures,i&&this._setFetchFeaturesPromises(t.location);const s=["actionsMenuOpen","collapsed"];for(const r of s)delete t[r];this.set(t)}triggerAction(e){const t=this.allActions.at(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex++,this}previous(){return this.selectedFeatureIndex--,this}disableClusterBrowsing(){L(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;"2d"===e?.type?A(t)?(await V(this),await I(this)):r.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):r.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}handleViewClick(e){this._fetchFeaturesAndOpen(e)}_animationStateChange(e){this.zoomToLocation||(P.disabled="waiting-for-target"===e)}_clearBrowsedClusterGraphics(){const e=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(i);this.view?.graphics?.removeMany(e),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(A(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:s}=this;s&&i&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>1?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>1?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:s,featureViewModels:r}=this;if(null===i)return;const o=((i-1)*s+t)%t,a=o+s;r.slice(o,a).forEach(((t,i)=>{t&&(t.graphic??=e[o+i])}))}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:s}=this;if(!e||!s)return;if(this.browseClusterEnabled){if(this._selectedClusterFeature&&(s.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),A(e))return;return e.symbol=await F(e),this._selectedClusterFeature=e,void s.graphics.add(this._selectedClusterFeature)}const r=e.sourceLayer?.type;if("map-image"!==r&&"imagery"!==r&&"imagery-tile"!==r||(e.symbol=await F(e)),!i&&t||!e.geometry){if(i&&!e.geometry){await this.centerAtLocation();const e=s.center?.clone();e&&(this.location=e)}}else this.location=m(e.geometry)}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}async _setFetchFeaturesPromises(e){const{pendingFeatures:t}=await this._fetchFeaturesWithController({mapPoint:e});this.promises=t}_destroyFeatureVMs(){this.featureViewModels.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:i,view:s,spatialReference:r,map:o,timeZone:a,location:n}=this;if(A(e)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t?.length)return;const l=i.slice(),u=[];t.forEach(((t,i)=>{if(!t)return;let h=null;if(l.some(((e,i)=>(e&&e.graphic===t&&(h=e,l.splice(i,1)),!!h))),h)u[i]=h;else{const l=new b({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:r,graphic:t===e?t:null,location:n,map:o,view:s,timeZone:a});u[i]=l}})),l.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("featureViewModels",u)}async _getScreenPoint(e,t){const{spatialReference:i,view:s}=this;if(!s)return null;await(s?.when());const r=e?.spatialReference;return r&&i?(await p(r,i,null,t),s.toScreen(e)):null}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:s}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:s}),{signal:s,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const s=new AbortController,{signal:r}=s;this._fetchFeaturesController=s;const o=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:r,event:i});return o.catch((()=>{})).then((()=>{this._fetchFeaturesController=null})),o}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e,{view:s}=this;this.removeHandles(H),this.addHandles([l((()=>this.view?.scale),(()=>this._debouncedLocationUpdate(t).catch((e=>{a(e)||r.getLogger(this).error(e)})))),u((()=>!this.visible),(()=>{this.removeHandles(H)}),{once:!0})],H);const{pendingFeatures:o}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});s?.popup&&"open"in s.popup&&s.popup.open({location:t??void 0,promises:o})}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const{layer:t,sourceLayer:i}=e;return i&&"layer"in i&&i.layer?i.layer:"map-notes"===i?.type||"subtype-group"===i?.type?i:t}_getHighlightTarget(e,t,i){if(Z(t.type,i))return e;const s=e.getObjectId();if(null!=s)return s;const r="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||w:null,o=e.attributes;return o&&r&&o[r]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightActiveFeature(){const e="highlight-active-feature";this.removeHandles(e);const{highlightEnabled:t,view:i,activeFeature:s,visible:r}=this;if(!(s&&i&&t&&r))return;const o=this._getHighlightLayer(s);if(!(o&&o instanceof y&&this._mapIncludesLayer(o)))return;const a=this._getLayerView(i,o);this._highlightActiveFeaturePromise=a;const n=await a;if(!(n&&_(n)&&this._highlightActiveFeaturePromise===a&&this.activeFeature&&this.highlightEnabled))return;const l=n.highlight(this._getHighlightTarget(s,o,i.type));this.addHandles(l,e)}async _highlightSelectedFeature(){const e="highlight-selected-feature";this.removeHandles(e);const{selectedFeature:t,highlightEnabled:i,view:s,visible:r}=this;if(!(t&&s&&i&&r))return;const o=this._getHighlightLayer(t);if(!(o&&o instanceof y&&this._mapIncludesLayer(o)))return;const a=this._getLayerView(s,o);this._highlightSelectedFeaturePromise=a;const n=await a;if(!(n&&_(n)&&this._highlightSelectedFeaturePromise===a&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const l=n.highlight(this._getHighlightTarget(t,o,s.type));this.addHandles(l,e)}_updateFeatures(e){const{features:t}=this,i=e.filter((e=>!t.includes(e)));i?.length&&(this.features=t.concat(i))}};e([c()],z.prototype,"_fetchFeaturesController",void 0),e([c({type:C})],z.prototype,"actions",void 0),e([c({readOnly:!0})],z.prototype,"active",null),e([c()],z.prototype,"activeFeature",void 0),e([c({readOnly:!0})],z.prototype,"allActions",null),e([c()],z.prototype,"autoCloseEnabled",void 0),e([c()],z.prototype,"browseClusterEnabled",void 0),e([c()],z.prototype,"content",void 0),e([c({type:C,readOnly:!0})],z.prototype,"defaultActions",null),e([c({type:Boolean})],z.prototype,"defaultPopupTemplateEnabled",void 0),e([c({readOnly:!0})],z.prototype,"featureCount",null),e([c()],z.prototype,"featurePage",void 0),e([c({value:[]})],z.prototype,"features",null),e([c()],z.prototype,"featuresPerPage",void 0),e([c()],z.prototype,"featureMenuOpen",void 0),e([c()],z.prototype,"featureMenuTitle",void 0),e([c()],z.prototype,"featureViewModelAbilities",void 0),e([c({readOnly:!0})],z.prototype,"featureViewModels",void 0),e([c()],z.prototype,"highlightEnabled",void 0),e([c()],z.prototype,"includeDefaultActions",void 0),e([c({type:x})],z.prototype,"location",null),e([c()],z.prototype,"map",null),e([c({readOnly:!0})],z.prototype,"pendingPromisesCount",null),e([c({readOnly:!0})],z.prototype,"promiseCount",null),e([c()],z.prototype,"promises",null),e([c({readOnly:!0})],z.prototype,"selectedClusterBoundaryFeature",void 0),e([c({value:null,readOnly:!0})],z.prototype,"selectedFeature",null),e([c({value:-1})],z.prototype,"selectedFeatureIndex",null),e([c({readOnly:!0})],z.prototype,"selectedFeatureViewModel",null),e([c()],z.prototype,"spatialReference",null),e([c({readOnly:!0})],z.prototype,"state",null),e([c()],z.prototype,"timeZone",null),e([c()],z.prototype,"title",void 0),e([c()],z.prototype,"updateLocationEnabled",void 0),e([c()],z.prototype,"view",void 0),e([c()],z.prototype,"visible",void 0),e([c({readOnly:!0})],z.prototype,"waitingForContents",null),e([c({readOnly:!0})],z.prototype,"waitingForResult",null),e([c()],z.prototype,"zoomFactor",void 0),e([c()],z.prototype,"zoomToLocation",void 0),e([c()],z.prototype,"centerAtLocation",null),z=e([d("esri.widgets.Features.FeaturesViewModel")],z);const W=z;export{W as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import i from"../core/Logger.js";import{ignoreAbortErrors as o}from"../core/promiseUtils.js";import{watch as s,when as n}from"../core/reactiveUtils.js";import{waitAnimationFrame as r}from"../core/scheduling.js";import{throttle as l}from"../core/throttle.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{getPointFromGeometry as c}from"../geometry/support/geometryUtils.js";import{substituteActionImage as u,getActionStyles as h}from"../support/actions/actionUtils.js";import p from"./Feature.js";import m from"./Spinner.js";import v from"./Widget.js";import{css as g}from"./Feature/resources.js";import{FeatureContentMixin as w}from"./Feature/support/FeatureContentMixin.js";import{css as _}from"./Features/css.js";import f from"./Features/FeaturesDrillIn.js";import M from"./Features/FeaturesViewModel.js";import F from"./Features/FeaturesVisibleElements.js";import{ActionsCollection as b}from"./Popup/actions.js";import{zoomToLocation as y}from"./Popup/actionUtils.js";import{loadCalciteComponents as I}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{Heading as A}from"./support/Heading.js";import{setFocus as x}from"./support/widgetUtils.js";import{messageBundle as N}from"./support/decorators/messageBundle.js";import{vmEvent as T}from"./support/decorators/vmEvent.js";import{tsx as O}from"./support/jsxFactory.js";import{substitute as k}from"../intl/substitute.js";import{formatNumber as E}from"../intl/number.js";const j="selected-index",L=0,W="features-spinner";function S(e){return e?.declaredClass.startsWith("esri.layers.")??!1}let B=class extends(w(v)){constructor(e,i){super(e,i),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new t,this._drillInWidget=new f({flowItems:this._drillInFlowItems}),this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new b,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new M,this.visibleElements=new F,this._renderAction=(e,t)=>{const i=this._getActionTitle(e),{type:o,active:s,uid:n,disabled:r,indicator:l}=e;return e.visible?O("calcite-action",{active:"toggle"===o&&e.value,appearance:"solid",bind:this,"data-action-uid":n,disabled:r,icon:this._getActionIcon(e),indicator:l,key:`action-${t}`,loading:s,onclick:this._triggerAction,scale:"s",text:i,textEnabled:!this._hideActionText,title:this._hideActionText?i:void 0},this._getFallbackIcon(e)):null},this._openFeatureMenu=()=>{this.featureMenuOpen=!0,this._focusFlowItemNode("menu-flow-item")},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this.featureMenuOpen&&(this._focusFlowItemNode("root-flow-item"),this.featureMenuOpen=!1)},this._displaySpinnerThrottled=l((()=>this._displaySpinner()),L),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,s((()=>this.viewModel?.active),(()=>this._toggleScreenLocationEnabled())),s((()=>this.viewModel?.active),(e=>this._drillInWidget.closed=!e)),s((()=>this.visibleElements?.closeButton),(e=>this._drillInWidget.closable=e)),s((()=>this.visibleElements?.spinner),(e=>this._spinnerEnabledChange(e))),s((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),s((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e??!1,t??!1))),s((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),s((()=>this.viewModel?.screenLocation),(()=>this._closeOpenActionMenu())),s((()=>this.selectedFeatureWidget),(()=>this._destroyDrillInFlowItemWidgets())),s((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]}),(()=>this._setTitleFromFeatureWidget())),s((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]}),(()=>this._setContentFromFeatureWidget())),s((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop())),this._drillInWidget.on("close",(()=>this.close())),this._drillInWidget.on("exit",(()=>this._destroyDrillInFlowItemWidgets())),this._drillInWidget.on("open-feature",(({feature:e})=>this._openRelatedFeature(e))),this._drillInWidget.on("zoom-to-feature",(({featureWidget:e})=>y(this.viewModel,e)))])}loadDependencies(){return I({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),"list-item-group":()=>import("@esri/calcite-components/dist/components/calcite-list-item-group"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return"xsmall"===e||"small"===e||"medium"===e}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&!!this.title&&!!this.content}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get featureMenuTitle(){return this.viewModel.featureMenuTitle}set featureMenuTitle(e){this.viewModel.featureMenuTitle=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return"feature-association"===t||"feature-relationship"===t?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o,spatialReference:s,map:n}=this,{selectedFeatureViewModel:r}=this.viewModel,l={title:!1};return r?(e?(e.viewModel=r,e.visibleElements=l):this._feature=new p({flowItems:i,headingLevel:t+1,timeZone:o,spatialReference:s,map:n,viewModel:r,visibleElements:l}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():i.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._focusFlowItemNode(this.featureMenuOpen?"menu-flow-item":"root-flow-item"):i.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(j);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(n((()=>!this.viewModel.waitingForResult),(()=>this._addSelectedFeatureIndexHandle()),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return O("div",{bind:this,class:this.classes(_.base,C.widget,C.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this._renderFeatureMenuButton()]}_renderHeader(){return!this.featureMenuOpen&&this.featureNavigationTop&&this._featureNavigationVisible?O("div",{class:_.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return this.featureMenuOpen||this.featureNavigationTop||!this._featureNavigationVisible?null:O("div",{class:_.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation())}_renderFeatureMenuButton(){const{messages:e,viewModel:t}=this,{featureCount:i,selectedFeatureIndex:o,pendingPromisesCount:s}=t;return O("calcite-action",{appearance:"solid",bind:this,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:s>0,onclick:this._openFeatureMenu,scale:"s",text:k(e.pageText,{index:E(o+1),total:E(i)}),textEnabled:!0,title:e.selectFeature})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return O("calcite-action-bar",{class:_.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},O("calcite-action-group",{scale:"s"},O("calcite-action",{appearance:"solid",class:_.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,onclick:this._previousFeature,scale:"s",text:e,title:e}),O("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:t,onclick:this._nextFeature,scale:"s",text:t,title:t})))}_renderFeatureMenuItem(e){const{selectedFeatureViewModel:t,featureViewModels:i}=this.viewModel,o=e===t,s=i.indexOf(e);return O("calcite-list-item",{bind:this,"data-feature-index":s,key:`feature-menu-item-${e.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:o,onCalciteListItemSelect:this._selectFeature},O("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}))}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach((e=>{const i=e?.graphic;if(!i)return;const{layer:o,sourceLayer:s}=i,n=(S(o)?o:null)||(S(s)?s:null),r=t.get(n)??[];t.set(n,[...r,e])})),t}_renderFeatureMenu(){const{messages:e,viewModel:t}=this,i=this._groupResultsByLayer();return t.featureViewModels.length?O("calcite-list",{displayMode:"flat",label:e?.featuresList,selectionAppearance:"icon",selectionMode:"single"},Array.from(i.keys(),(e=>{const t=i.get(e)?.map((e=>this._renderFeatureMenuItem(e))),o=e?e.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&null!==o?O("calcite-list-item-group",{heading:o,key:e?.uid||"map-graphics"},t):t}))):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?O("calcite-action",{active:"toggle"===e.type&&e.value,appearance:"solid",bind:this,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map(((e,t)=>this._renderHeaderAction(e,t))).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:i,_collapseEnabled:o,_drillInFlowItems:s,featureNavigationTop:n,featureMenuOpen:r}=this,{title:l,active:a}=this.viewModel,d=t.heading&&l?l:"";return O("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[_.contentFeature]:!0,[_.flowItemCollapsed]:i}),closable:t.closeButton,closed:!a,collapsed:i,collapseDirection:n?"down":"up",collapsible:o,headingLevel:e,key:"root-flow-item",selected:!r&&0===s.length,onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},d?O(A,{class:this.classes(_.featuresHeading,C.heading),innerHTML:d,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),i?null:O("div",{class:this.classes(_.container,_.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,featureMenuOpen:t,featureMenuTitle:i,messages:o,messagesCommon:s}=this,{active:n,featureViewModels:r,pendingPromisesCount:l}=e,a=i??o.selectFeature;return t?O("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,closable:!1,closed:!n,description:k(o.total,{total:r.length}),heading:a,key:"feature-menu",loading:e.waitingForContents,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleFeatureMenuBack()}},l>0?O("calcite-loader",{class:_.loader,inline:!0,key:"feature-menu-loader",label:s.loading,slot:"header-actions-end"}):null,O("div",{class:_.container},this._renderFeatureMenu()),O("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:_.featureMenuObserver}),O("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},s.back)):null}_renderContentContainer(){const e=[this._renderContentFeature(),this._renderFeatureMenuContainer(),this._drillInWidget.render()];return this.visibleElements.flow?O("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=u({action:e,feature:this.selectedFeature}),s={[_.icon]:!!t,[_.actionImage]:!!o};return t&&(s[t]=!0),o||t?O("span",{"aria-hidden":"true",class:this.classes(_.icon,s),key:"icon",styles:h(o)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?O("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},O("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?O("div",{class:g.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=c(i);this.open({features:[t],location:null!=o?o:void 0})}async _focusFlowItemNode(e){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const t=this._focusAbortController.signal;await o(r(t));const i="menu-flow-item"===e?this._featureMenuViewportNode:this._rootFlowItemNode;x(i)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this._handleFeatureMenuBack()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionIcon(e){return e.icon?e.icon:e.image||e.className?void 0:"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:s}=e,n=i?.attributes,r=e.title??"",l="zoom-to-feature"===s?k(r,{messages:t}):"remove-selected-feature"===s?k(r,{messages:o}):"zoom-to-clustered-features"===s||"browse-clustered-features"===s?k(r,{messages:t}):e.title;return l&&n?k(l,n):l??""}_onMainKeydown(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=s((()=>this.viewModel?.selectedFeatureIndex),((e,t)=>this._selectedFeatureIndexUpdated(e,t)));this.addHandles(e,j)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&-1!==e&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find((({uid:e})=>e===i));o&&!o.disabled&&("toggle"===o?.type&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex((e=>e.uid===i)),n=o.at(s);n&&"toggle"===n.type&&(n.value=!n.value),this.viewModel.triggerAction(s)}_createSpinner(e){e&&(this._spinner=new m({view:e}),e.ui.add(this._spinner,{key:W,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}))}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,W),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([a()],B.prototype,"_drillInFlowItems",void 0),e([a()],B.prototype,"_hideActionText",null),e([a()],B.prototype,"_featureNavigationVisible",null),e([a()],B.prototype,"_isCollapsed",null),e([a()],B.prototype,"_collapseEnabled",null),e([a({readOnly:!0})],B.prototype,"active",null),e([a()],B.prototype,"collapsed",void 0),e([a()],B.prototype,"content",null),e([a()],B.prototype,"icon",null),e([a()],B.prototype,"featureMenuOpen",null),e([a()],B.prototype,"featureMenuTitle",null),e([a()],B.prototype,"featureNavigationTop",void 0),e([a()],B.prototype,"features",null),e([a()],B.prototype,"goToOverride",null),e([a({type:b})],B.prototype,"headerActions",void 0),e([a()],B.prototype,"headingLevel",void 0),e([a()],B.prototype,"location",null),e([a()],B.prototype,"label",null),e([a()],B.prototype,"map",null),e([a(),N("esri/widgets/Features/t9n/Features")],B.prototype,"messages",void 0),e([a(),N("esri/t9n/common")],B.prototype,"messagesCommon",void 0),e([a()],B.prototype,"promises",null),e([a()],B.prototype,"responsiveActionsEnabled",void 0),e([a({readOnly:!0})],B.prototype,"selectedFeature",null),e([a({readOnly:!0})],B.prototype,"selectedDrillInFeature",null),e([a()],B.prototype,"selectedFeatureIndex",null),e([a({readOnly:!0})],B.prototype,"selectedFeatureWidget",null),e([a()],B.prototype,"spatialReference",null),e([a()],B.prototype,"title",null),e([a()],B.prototype,"timeZone",null),e([a()],B.prototype,"updateLocationEnabled",null),e([a()],B.prototype,"view",null),e([a({type:M}),T(["triggerAction","trigger-action"])],B.prototype,"viewModel",void 0),e([a({type:F,nonNullable:!0})],B.prototype,"visibleElements",void 0),e([a()],B.prototype,"visible",null),B=e([d("esri.widgets.Features")],B);const R=B;export{R as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import i from"../core/Logger.js";import{ignoreAbortErrors as o}from"../core/promiseUtils.js";import{watch as s,when as n}from"../core/reactiveUtils.js";import{waitAnimationFrame as r}from"../core/scheduling.js";import{throttle as l}from"../core/throttle.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{getPointFromGeometry as c}from"../geometry/support/geometryUtils.js";import{substituteActionImage as u,getActionStyles as h}from"../support/actions/actionUtils.js";import p from"./Feature.js";import m from"./Spinner.js";import v from"./Widget.js";import{css as g}from"./Feature/resources.js";import{FeatureContentMixin as w}from"./Feature/support/FeatureContentMixin.js";import{css as _}from"./Features/css.js";import f from"./Features/FeaturesDrillIn.js";import M from"./Features/FeaturesViewModel.js";import F from"./Features/FeaturesVisibleElements.js";import{ActionsCollection as b}from"./Popup/actions.js";import{zoomToLocation as y}from"./Popup/actionUtils.js";import{loadCalciteComponents as I}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{Heading as A}from"./support/Heading.js";import{setFocus as x}from"./support/widgetUtils.js";import{messageBundle as N}from"./support/decorators/messageBundle.js";import{vmEvent as T}from"./support/decorators/vmEvent.js";import{tsx as O}from"./support/jsxFactory.js";import{substitute as k}from"../intl/substitute.js";import{formatNumber as E}from"../intl/number.js";const j="selected-index",L=0,W="features-spinner";function S(e){return e?.declaredClass.startsWith("esri.layers.")??!1}let B=class extends(w(v)){constructor(e,i){super(e,i),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new t,this._drillInWidget=new f({flowItems:this._drillInFlowItems}),this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new b,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new M,this.visibleElements=new F,this._renderAction=(e,t)=>{const i=this._getActionTitle(e),{type:o,active:s,uid:n,disabled:r,indicator:l}=e;return e.visible?O("calcite-action",{active:"toggle"===o&&e.value,appearance:"solid",bind:this,"data-action-id":e.id,"data-action-uid":n,disabled:r,icon:this._getActionIcon(e),indicator:l,key:`action-${t}`,loading:s,onclick:this._triggerAction,scale:"s",text:i,textEnabled:!this._hideActionText,title:this._hideActionText?i:void 0},this._getFallbackIcon(e)):null},this._openFeatureMenu=()=>{this.featureMenuOpen=!0,this._focusFlowItemNode("menu-flow-item")},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this.featureMenuOpen&&(this._focusFlowItemNode("root-flow-item"),this.featureMenuOpen=!1)},this._displaySpinnerThrottled=l((()=>this._displaySpinner()),L),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,s((()=>this.viewModel?.active),(()=>this._toggleScreenLocationEnabled())),s((()=>this.viewModel?.active),(e=>this._drillInWidget.closed=!e)),s((()=>this.visibleElements?.closeButton),(e=>this._drillInWidget.closable=e)),s((()=>this.visibleElements?.spinner),(e=>this._spinnerEnabledChange(e))),s((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),s((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e??!1,t??!1))),s((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),s((()=>this.viewModel?.screenLocation),(()=>this._closeOpenActionMenu())),s((()=>this.selectedFeatureWidget),(()=>this._destroyDrillInFlowItemWidgets())),s((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]}),(()=>this._setTitleFromFeatureWidget())),s((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]}),(()=>this._setContentFromFeatureWidget())),s((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop())),this._drillInWidget.on("close",(()=>this.close())),this._drillInWidget.on("exit",(()=>this._destroyDrillInFlowItemWidgets())),this._drillInWidget.on("open-feature",(({feature:e})=>this._openRelatedFeature(e))),this._drillInWidget.on("zoom-to-feature",(({featureWidget:e})=>y(this.viewModel,e)))])}loadDependencies(){return I({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),"list-item-group":()=>import("@esri/calcite-components/dist/components/calcite-list-item-group"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return"xsmall"===e||"small"===e||"medium"===e}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&!!this.title&&!!this.content}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get featureMenuTitle(){return this.viewModel.featureMenuTitle}set featureMenuTitle(e){this.viewModel.featureMenuTitle=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return"feature-association"===t||"feature-relationship"===t?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o,spatialReference:s,map:n}=this,{selectedFeatureViewModel:r}=this.viewModel,l={title:!1};return r?(e?(e.viewModel=r,e.visibleElements=l):this._feature=new p({flowItems:i,headingLevel:t+1,timeZone:o,spatialReference:s,map:n,viewModel:r,visibleElements:l}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():i.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._focusFlowItemNode(this.featureMenuOpen?"menu-flow-item":"root-flow-item"):i.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(j);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(n((()=>!this.viewModel.waitingForResult),(()=>this._addSelectedFeatureIndexHandle()),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return O("div",{bind:this,class:this.classes(_.base,C.widget,C.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this._renderFeatureMenuButton()]}_renderHeader(){return!this.featureMenuOpen&&this.featureNavigationTop&&this._featureNavigationVisible?O("div",{class:_.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return this.featureMenuOpen||this.featureNavigationTop||!this._featureNavigationVisible?null:O("div",{class:_.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation())}_renderFeatureMenuButton(){const{messages:e,viewModel:t}=this,{featureCount:i,selectedFeatureIndex:o,pendingPromisesCount:s}=t;return O("calcite-action",{appearance:"solid",bind:this,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:s>0,onclick:this._openFeatureMenu,scale:"s",text:k(e.pageText,{index:E(o+1),total:E(i)}),textEnabled:!0,title:e.selectFeature})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return O("calcite-action-bar",{class:_.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},O("calcite-action-group",{scale:"s"},O("calcite-action",{appearance:"solid",class:_.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,onclick:this._previousFeature,scale:"s",text:e,title:e}),O("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:t,onclick:this._nextFeature,scale:"s",text:t,title:t})))}_renderFeatureMenuItem(e){const{selectedFeatureViewModel:t,featureViewModels:i}=this.viewModel,o=e===t,s=i.indexOf(e);return O("calcite-list-item",{bind:this,"data-feature-index":s,key:`feature-menu-item-${e.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:o,onCalciteListItemSelect:this._selectFeature},O("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}))}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach((e=>{const i=e?.graphic;if(!i)return;const{layer:o,sourceLayer:s}=i,n=(S(o)?o:null)||(S(s)?s:null),r=t.get(n)??[];t.set(n,[...r,e])})),t}_renderFeatureMenu(){const{messages:e,viewModel:t}=this,i=this._groupResultsByLayer();return t.featureViewModels.length?O("calcite-list",{displayMode:"flat",label:e?.featuresList,selectionAppearance:"icon",selectionMode:"single"},Array.from(i.keys(),(e=>{const t=i.get(e)?.map((e=>this._renderFeatureMenuItem(e))),o=e?e.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&null!==o?O("calcite-list-item-group",{heading:o,key:e?.uid||"map-graphics"},t):t}))):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?O("calcite-action",{active:"toggle"===e.type&&e.value,appearance:"solid",bind:this,"data-action-id":e.id,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map(((e,t)=>this._renderHeaderAction(e,t))).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:i,_collapseEnabled:o,_drillInFlowItems:s,featureNavigationTop:n,featureMenuOpen:r}=this,{title:l,active:a}=this.viewModel,d=t.heading&&l?l:"";return O("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[_.contentFeature]:!0,[_.flowItemCollapsed]:i}),closable:t.closeButton,closed:!a,collapsed:i,collapseDirection:n?"down":"up",collapsible:o,headingLevel:e,key:"root-flow-item",selected:!r&&0===s.length,onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},d?O(A,{class:this.classes(_.featuresHeading,C.heading),innerHTML:d,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),i?null:O("div",{class:this.classes(_.container,_.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,featureMenuOpen:t,featureMenuTitle:i,messages:o,messagesCommon:s}=this,{active:n,featureViewModels:r,pendingPromisesCount:l}=e,a=i??o.selectFeature;return t?O("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,closable:!1,closed:!n,description:k(o.total,{total:r.length}),heading:a,key:"feature-menu",loading:e.waitingForContents,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleFeatureMenuBack()}},l>0?O("calcite-loader",{class:_.loader,inline:!0,key:"feature-menu-loader",label:s.loading,slot:"header-actions-end"}):null,O("div",{class:_.container},this._renderFeatureMenu()),O("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:_.featureMenuObserver}),O("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},s.back)):null}_renderContentContainer(){const e=[this._renderContentFeature(),this._renderFeatureMenuContainer(),this._drillInWidget.render()];return this.visibleElements.flow?O("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=u({action:e,feature:this.selectedFeature}),s={[_.icon]:!!t,[_.actionImage]:!!o};return t&&(s[t]=!0),o||t?O("span",{"aria-hidden":"true",class:this.classes(_.icon,s),key:"icon",styles:h(o)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?O("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},O("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?O("div",{class:g.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=c(i);this.open({features:[t],location:null!=o?o:void 0})}async _focusFlowItemNode(e){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const t=this._focusAbortController.signal;await o(r(t));const i="menu-flow-item"===e?this._featureMenuViewportNode:this._rootFlowItemNode;x(i)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this._handleFeatureMenuBack()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionIcon(e){return e.icon?e.icon:e.image||e.className?void 0:"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:s}=e,n=i?.attributes,r=e.title??"",l="zoom-to-feature"===s?k(r,{messages:t}):"remove-selected-feature"===s?k(r,{messages:o}):"zoom-to-clustered-features"===s||"browse-clustered-features"===s?k(r,{messages:t}):e.title;return l&&n?k(l,n):l??""}_onMainKeydown(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=s((()=>this.viewModel?.selectedFeatureIndex),((e,t)=>this._selectedFeatureIndexUpdated(e,t)));this.addHandles(e,j)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&-1!==e&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find((({uid:e})=>e===i));o&&!o.disabled&&("toggle"===o?.type&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex((e=>e.uid===i)),n=o.at(s);n&&"toggle"===n.type&&(n.value=!n.value),this.viewModel.triggerAction(s)}_createSpinner(e){e&&(this._spinner=new m({view:e}),e.ui.add(this._spinner,{key:W,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}))}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e}=this;e&&(e.view?.ui?.remove(e,W),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([a()],B.prototype,"_drillInFlowItems",void 0),e([a()],B.prototype,"_hideActionText",null),e([a()],B.prototype,"_featureNavigationVisible",null),e([a()],B.prototype,"_isCollapsed",null),e([a()],B.prototype,"_collapseEnabled",null),e([a({readOnly:!0})],B.prototype,"active",null),e([a()],B.prototype,"collapsed",void 0),e([a()],B.prototype,"content",null),e([a()],B.prototype,"icon",null),e([a()],B.prototype,"featureMenuOpen",null),e([a()],B.prototype,"featureMenuTitle",null),e([a()],B.prototype,"featureNavigationTop",void 0),e([a()],B.prototype,"features",null),e([a()],B.prototype,"goToOverride",null),e([a({type:b})],B.prototype,"headerActions",void 0),e([a()],B.prototype,"headingLevel",void 0),e([a()],B.prototype,"location",null),e([a()],B.prototype,"label",null),e([a()],B.prototype,"map",null),e([a(),N("esri/widgets/Features/t9n/Features")],B.prototype,"messages",void 0),e([a(),N("esri/t9n/common")],B.prototype,"messagesCommon",void 0),e([a()],B.prototype,"promises",null),e([a()],B.prototype,"responsiveActionsEnabled",void 0),e([a({readOnly:!0})],B.prototype,"selectedFeature",null),e([a({readOnly:!0})],B.prototype,"selectedDrillInFeature",null),e([a()],B.prototype,"selectedFeatureIndex",null),e([a({readOnly:!0})],B.prototype,"selectedFeatureWidget",null),e([a()],B.prototype,"spatialReference",null),e([a()],B.prototype,"title",null),e([a()],B.prototype,"timeZone",null),e([a()],B.prototype,"updateLocationEnabled",null),e([a()],B.prototype,"view",null),e([a({type:M}),T(["triggerAction","trigger-action"])],B.prototype,"viewModel",void 0),e([a({type:F,nonNullable:!0})],B.prototype,"visibleElements",void 0),e([a()],B.prototype,"visible",null),B=e([d("esri.widgets.Features")],B);const R=B;export{R as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{isLayerFromCatalog as n,isCatalogSublayer as o}from"../../layers/catalog/catalogUtils.js";import{getActionIcon as s,getActionStyles as l}from"../../support/actions/actionUtils.js";import a from"../Widget.js";import{getStatusIcon as r,getVisibilityIcon as c,listItemHasChildren as d,areChildrenHidden as p,canSortSublayers as m,getSingleAction as u,getItem as g}from"./support/layerListUtils.js";import{loadCalciteComponents as y}from"../support/componentsUtils.js";import{tsx as h}from"../support/jsxFactory.js";import{setFocus as b}from"../support/widgetUtils.js";var v;let _=v=class extends a{constructor(e){super(e),this.dragEnabled=!1,this.listModeDisabled=!1,this.parent=null,this.parentTitles=null,this.viewModel=null,this._onActionMenuOpen=e=>{this.item.actionsOpen=e.currentTarget.open},this._setTooltipReference=e=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,e)},this._removeTooltipReference=()=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,null)}}loadDependencies(){return y({"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}render(){const e=this.parentTitles??[],{_title:t,item:i,activeItem:n,selectionMode:o,selectedItems:s,messages:l,parent:a,css:r}=this,c="visibleAtCurrentTimeExtent"in i&&"layerInvisibleAtTime"in l&&!i.visibleAtCurrentTimeExtent?`${t} (${l.layerInvisibleAtTime})`:"visibleAtCurrentScale"in i&&"layerInvisibleAtScale"in l&&!i.visibleAtCurrentScale?`${t} (${l.layerInvisibleAtScale})`:t,d="parent"in i&&"catalog"===i.parent?.layer?.type,{layer:p}=i,m="visibleAtCurrentScale"in i&&!i.visibleAtCurrentScale||"visibleAtCurrentTimeExtent"in i&&!i.visibleAtCurrentTimeExtent;return h("calcite-list-item",{afterCreate:e=>this._focusSelectedDragEl(e,i),afterUpdate:e=>this._focusSelectedDragEl(e,i),class:this.classes(r.item,"itemActive"in r&&{[r.itemActive]:n===i}),"data-item":i,"data-layer-id":p?.id,dragDisabled:!i.sortable||d,id:p?.uid,key:`list-item-${p?.uid}`,label:t,metadata:{parentTitles:e,_title:t},open:"open"in i&&i.open,selected:"none"!==o&&s.includes(i),title:c,unavailable:m,value:p?.uid,onCalciteListItemSelect:e=>"visible"in i&&this._handleCalciteListItemSelect(e,i,a),onCalciteListItemToggle:e=>"open"in i&&this._handleCalciteListItemToggle(e,i)},this._renderedCatalogFootprintIcon,this._renderedCatalogDynamicIcon,this._renderedItemStatus,this._renderedItemToggle,this._renderedCatalogSelectNode,this._renderedItemTemporaryIcon,this._renderedChildList,this._renderedItemMessage,this._renderedPanel,this._renderedPanelAction,this._renderedActions)}get _title(){const{messages:e}=this;return this.item.title||("untitledTable"in e?e.untitledTable:e.untitledLayer)}get _renderedItemStatus(){const{item:e,parent:t,visibleElements:i,css:n}=this;if(!i.statusIndicators)return null;const{publishing:o}=e,s="updating"in e&&e.updating&&!t,l="connectionStatus"in e?e.connectionStatus:void 0,a=!!l;return h("calcite-icon",{class:this.classes(n.statusIndicator,{[n.publishing]:o},"updating"in n&&{[n.updating]:s},"connectionStatus"in n&&{[n.connectionStatus]:a},"connectionStatusConnected"in n&&{[n.connectionStatusConnected]:a&&"connected"===l}),icon:r({connectionStatus:l,publishing:o}),key:"layer-item-status",scale:"s",slot:"content-end"})}get _renderedItemTemporaryIcon(){const{item:e,visibleElements:t,css:i}=this,{layer:o}=e,s="temporaryLayerIndicators"in t&&t.temporaryLayerIndicators,l="temporaryTableIndicators"in t&&t.temporaryTableIndicators,a=o&&"persistenceEnabled"in o&&(n(o)||!o.persistenceEnabled);return(s||l)&&a?h("calcite-icon",{class:i.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"content-start",title:this.messages.temporary}):null}get _renderedItemToggle(){const{item:e,parent:t,messages:i,visibilityAppearance:n,css:o}=this;if(!("visible"in e&&"layerVisibility"in i&&"visibleToggle"in o&&n))return null;const{visible:s}=e,l=t?.visibilityMode;if("inherited"===l)return null;const a=c({visible:s,exclusive:"exclusive"===l,visibilityAppearance:n}),r="checkbox"===n,d=i.layerVisibility;return h("calcite-action",{appearance:"transparent",class:o.visibleToggle,icon:r?a:void 0,key:"visibility-toggle",onclick:()=>this._toggleVisibility(e,t),scale:"s",slot:r?"actions-start":"actions-end",text:d,title:d},r?null:h("calcite-icon",{class:this.classes({[o.visibleIcon]:"exclusive"!==l&&s}),icon:a,scale:"s"}))}get _renderedPanel(){const{panel:e}=this.item;return!e?.open||e.disabled||e.flowEnabled?null:h("div",{class:this.css.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}get _renderedPanelAction(){const{panel:e}=this.item;if(!e?.visible)return null;const{open:t,title:i,disabled:n}=e;return h("calcite-action",{active:t,appearance:"transparent",disabled:n,icon:s(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),scale:"s",slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}get _renderedActions(){switch(this._actionsCount){case 0:return null;case 1:return this._singleAction;default:return this._renderedActionMenu}}get _renderedActionMenu(){const{item:e,messagesCommon:t}=this,i=t.options;return h("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:t.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",slot:"actions-end",onCalciteActionMenuOpen:this._onActionMenuOpen},h("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:"s",slot:"trigger",text:i,title:i}),this._renderedActionMenuContent)}get _renderedActionMenuContent(){return this._filteredSections.toArray().map((e=>h("calcite-action-group",{key:`action-section-${e.uid}`},e.toArray().map((e=>this._renderAction({action:e,textEnabled:!0}))))))}get _renderedCatalogFootprintIcon(){const{css:e}=this,t=this.item.layer,i="catalog-footprint"===t?.type,n="sublayer"===t?.type&&o(t,"footprints");return"itemCatalogIcon"in e&&(i||n)?h("calcite-icon",{class:e.itemCatalogIcon,icon:"footprint",key:"footprint",scale:"s",slot:"content-start"}):null}get _renderedCatalogDynamicIcon(){const{css:e}=this,t=this.item.layer,i="catalog-dynamic-group"===t?.type,n="sublayer"===t?.type&&o(t,"layers-in-view");return"itemCatalogIcon"in e&&(i||n)?h("calcite-icon",{class:e.itemCatalogIcon,icon:"catalog-dataset",key:"catalog-dataset",scale:"s",slot:"content-start"}):null}get _renderedCatalogSelectNode(){const{_title:e,item:t,visibleElements:i}=this;if(!("visible"in t))return;const{layer:n}=t,o="catalog-dynamic-group"===n?.type;return"catalogLayerList"in i&&i.catalogLayerList&&o?h("calcite-action",{appearance:"transparent",disabled:!n.visible,icon:"chevron-right",iconFlipRtl:!0,onclick:()=>this._triggerOnCatalogOpen(t),scale:"s",slot:"actions-end",text:e}):null}get _renderedChildList(){const{dragEnabled:e,item:t,rootGroupUid:i,listModeDisabled:n,selectionMode:o,displayMode:s}=this;if(!("visible"in t))return;const l=[...this.parentTitles??[],t.title],{children:a,layer:r}=t,c="catalog-dynamic-group"!==r?.type&&d(t),u=!n&&p(r);return c||!u&&!c&&e&&"group"===r?.type?h("calcite-list",{canPull:e=>!!this.canMove&&this.canMove(e,"pull"),canPut:e=>!!this.canMove&&this.canMove(e,"put"),"data-item":t,"data-layer-type":i,displayMode:s,dragEnabled:!!e&&(t.childrenSortable&&m(t)),group:`${i}-${r?.uid}`,key:`child-list-${r?.uid}`,label:t.title,selectionAppearance:"border",selectionMode:o},a?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error))).toArray().map((e=>this._renderItem(e,t,l))),this._renderedTablesItem):null}get _hasTables(){const{layerTablesEnabled:e}=this,t=this.item.layer;if(!e||!t)return!1;switch(t.type){case"knowledge-graph":return e.includes(t.type)&&!!t.tables?.length;case"map-image":case"tile":return e.includes(t.type)&&!!t.subtables?.length;default:return!1}}get _renderedTablesItem(){const{item:e,messages:t,css:i}=this,{layer:n}=e;return"itemTableIcon"in i&&"visible"in e&&"tables"in t&&this._hasTables?h("calcite-list-item",{class:i.item,"data-layer-id":n?.id,dragDisabled:!0,key:`list-item-table-list-tables-${n?.uid}`,title:t.tables,onCalciteListItemSelect:()=>this._triggerOnTablesOpen(e)},h("calcite-icon",{class:i.itemTableIcon,icon:"table",scale:"s",slot:"content-start"}),h("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"})):null}get _renderedItemMessage(){const{item:e,messages:t,css:i}=this;return e.error?h("div",{class:i.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},h("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},h("div",{slot:"message"},"tableError"in t?t.tableError:t.layerError))):"incompatible"in e&&e.incompatible&&"layerIncompatible"in t?h("div",{class:i.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},h("calcite-notice",{afterCreate:this._setTooltipReference,afterRemoved:this._removeTooltipReference,bind:this,icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},h("div",{slot:"message"},t.layerIncompatible))):null}get _singleAction(){return this._renderAction({action:u(this._filteredSections),textEnabled:!1})}get _filteredSections(){return this.item.actionsSections.map((e=>e.filter((e=>e.visible))))}get _actionsCount(){return this.item.actionsSections.reduce(((e,t)=>e+t.length),0)}_renderAction(e){const{item:t}=this,{action:i,textEnabled:n}=e;if(!i)return null;const{active:o,disabled:l,title:a,type:r,indicator:c}=i;return h("calcite-action",{active:"toggle"===r&&i.value,appearance:"transparent",disabled:l,icon:s(i),indicator:c,key:`action-${i.uid}`,loading:o,onclick:()=>this._triggerAction(t,i),scale:"s",slot:n?void 0:"actions-end",text:a??"",textEnabled:n,title:a??void 0},this._renderFallbackIcon(i))}_renderFallbackIcon(e){const{css:t}=this,{className:i,icon:n}=e;if(n)return null;const o="image"in e?e.image:void 0,s={[t.itemActionIcon]:!!i,[t.itemActionImage]:!!o};return i&&(s[i]=!0),o||i?h("span",{"aria-hidden":"true",class:this.classes(t.itemActionIcon,s),key:"icon",styles:l(o)}):null}_renderItem(e,t,i=[]){return h(v,{activeItem:this.activeItem,canMove:this.canMove,css:this.css,displayMode:this.displayMode,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this.rootGroupUid,selectedDragItemLayerUid:this.selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this.onAction,onCatalogOpen:this.onCatalogOpen,onPanelOpen:this.onPanelOpen,onSelectedDragItemLayerUidChange:this.onSelectedDragItemLayerUidChange,onTablesOpen:this.onTablesOpen,onTooltipReferenceChange:this.onTooltipReferenceChange})}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.onAction(t,e))}_triggerOnTablesOpen(e){e&&this.onTablesOpen&&this.onTablesOpen(e)}_triggerOnCatalogOpen(e){e&&this.onCatalogOpen?.(e)}_focusSelectedDragEl(e,t){this.selectedDragItemLayerUid===t.layer?.uid&&(b(e),this.onSelectedDragItemLayerUidChange?.(null))}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.open}_handleCalciteListItemSelect(e,t,i){g(e.target)===t&&"none"===this.selectionMode&&"inherited"!==i?.visibilityMode&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&this.onPanelOpen()}_toggleVisibility(e,t){if(!e)return;const i=t?.visibilityMode;"exclusive"===i&&e.visible||(e.visible=!e.visible)}};_.vnodeSelector="calcite-list-item",e([t()],_.prototype,"activeItem",void 0),e([t()],_.prototype,"canMove",void 0),e([t()],_.prototype,"css",void 0),e([t()],_.prototype,"displayMode",void 0),e([t()],_.prototype,"dragEnabled",void 0),e([t()],_.prototype,"item",void 0),e([t()],_.prototype,"layerTablesEnabled",void 0),e([t()],_.prototype,"listModeDisabled",void 0),e([t()],_.prototype,"messages",void 0),e([t()],_.prototype,"messagesCommon",void 0),e([t()],_.prototype,"onAction",void 0),e([t()],_.prototype,"onPanelOpen",void 0),e([t()],_.prototype,"onCatalogOpen",void 0),e([t()],_.prototype,"onTablesOpen",void 0),e([t()],_.prototype,"onSelectedDragItemLayerUidChange",void 0),e([t()],_.prototype,"onTooltipReferenceChange",void 0),e([t()],_.prototype,"parent",void 0),e([t()],_.prototype,"parentTitles",void 0),e([t()],_.prototype,"rootGroupUid",void 0),e([t()],_.prototype,"selectionMode",void 0),e([t()],_.prototype,"selectedItems",void 0),e([t()],_.prototype,"selectedDragItemLayerUid",void 0),e([t()],_.prototype,"visibleElements",void 0),e([t()],_.prototype,"visibilityAppearance",void 0),e([t()],_.prototype,"_title",null),e([t()],_.prototype,"_renderedItemStatus",null),e([t()],_.prototype,"_renderedItemTemporaryIcon",null),e([t()],_.prototype,"_renderedItemToggle",null),e([t()],_.prototype,"_renderedPanel",null),e([t()],_.prototype,"_renderedPanelAction",null),e([t()],_.prototype,"_renderedActions",null),e([t()],_.prototype,"_renderedActionMenu",null),e([t()],_.prototype,"_renderedActionMenuContent",null),e([t()],_.prototype,"_renderedCatalogFootprintIcon",null),e([t()],_.prototype,"_renderedCatalogDynamicIcon",null),e([t()],_.prototype,"_renderedCatalogSelectNode",null),e([t()],_.prototype,"_renderedChildList",null),e([t()],_.prototype,"_hasTables",null),e([t()],_.prototype,"_renderedTablesItem",null),e([t()],_.prototype,"_renderedItemMessage",null),e([t()],_.prototype,"_singleAction",null),e([t()],_.prototype,"_filteredSections",null),e([t()],_.prototype,"_actionsCount",null),_=v=e([i("esri.widgets.LayerList.LayerListItem")],_);const I=_;export{I as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{isLayerFromCatalog as n,isCatalogSublayer as o}from"../../layers/catalog/catalogUtils.js";import{getActionIcon as s,getActionStyles as a}from"../../support/actions/actionUtils.js";import l from"../Widget.js";import{getStatusIcon as r,getVisibilityIcon as c,listItemHasChildren as d,areChildrenHidden as p,canSortSublayers as m,getSingleAction as u,getItem as g}from"./support/layerListUtils.js";import{loadCalciteComponents as y}from"../support/componentsUtils.js";import{tsx as h}from"../support/jsxFactory.js";import{setFocus as b}from"../support/widgetUtils.js";var v;let _=v=class extends l{constructor(e){super(e),this.dragEnabled=!1,this.listModeDisabled=!1,this.parent=null,this.parentTitles=null,this.viewModel=null,this._onActionMenuOpen=e=>{this.item.actionsOpen=e.currentTarget.open},this._setTooltipReference=e=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,e)},this._removeTooltipReference=()=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,null)}}loadDependencies(){return y({"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}render(){const e=this.parentTitles??[],{_title:t,item:i,activeItem:n,selectionMode:o,selectedItems:s,messages:a,parent:l,css:r}=this,c="visibleAtCurrentTimeExtent"in i&&"layerInvisibleAtTime"in a&&!i.visibleAtCurrentTimeExtent?`${t} (${a.layerInvisibleAtTime})`:"visibleAtCurrentScale"in i&&"layerInvisibleAtScale"in a&&!i.visibleAtCurrentScale?`${t} (${a.layerInvisibleAtScale})`:t,d="parent"in i&&"catalog"===i.parent?.layer?.type,{layer:p}=i,m="visibleAtCurrentScale"in i&&!i.visibleAtCurrentScale||"visibleAtCurrentTimeExtent"in i&&!i.visibleAtCurrentTimeExtent;return h("calcite-list-item",{afterCreate:e=>this._focusSelectedDragEl(e,i),afterUpdate:e=>this._focusSelectedDragEl(e,i),class:this.classes(r.item,"itemActive"in r&&{[r.itemActive]:n===i}),"data-item":i,"data-layer-id":p?.id,dragDisabled:!i.sortable||d,id:p?.uid,key:`list-item-${p?.uid}`,label:t,metadata:{parentTitles:e,_title:t},open:"open"in i&&i.open,selected:"none"!==o&&s.includes(i),title:c,unavailable:m,value:p?.uid,onCalciteListItemSelect:e=>"visible"in i&&this._handleCalciteListItemSelect(e,i,l),onCalciteListItemToggle:e=>"open"in i&&this._handleCalciteListItemToggle(e,i)},this._renderedCatalogFootprintIcon,this._renderedCatalogDynamicIcon,this._renderedItemStatus,this._renderedItemToggle,this._renderedCatalogSelectNode,this._renderedItemTemporaryIcon,this._renderedChildList,this._renderedItemMessage,this._renderedPanel,this._renderedPanelAction,this._renderedActions)}get _title(){const{messages:e}=this;return this.item.title||("untitledTable"in e?e.untitledTable:e.untitledLayer)}get _renderedItemStatus(){const{item:e,parent:t,visibleElements:i,css:n}=this;if(!i.statusIndicators)return null;const{publishing:o}=e,s="updating"in e&&e.updating&&!t,a="connectionStatus"in e?e.connectionStatus:void 0,l=!!a;return h("calcite-icon",{class:this.classes(n.statusIndicator,{[n.publishing]:o},"updating"in n&&{[n.updating]:s},"connectionStatus"in n&&{[n.connectionStatus]:l},"connectionStatusConnected"in n&&{[n.connectionStatusConnected]:l&&"connected"===a}),icon:r({connectionStatus:a,publishing:o}),key:"layer-item-status",scale:"s",slot:"content-end"})}get _renderedItemTemporaryIcon(){const{item:e,visibleElements:t,css:i}=this,{layer:o}=e,s="temporaryLayerIndicators"in t&&t.temporaryLayerIndicators,a="temporaryTableIndicators"in t&&t.temporaryTableIndicators,l=o&&"persistenceEnabled"in o&&(n(o)||!o.persistenceEnabled);return(s||a)&&l?h("calcite-icon",{class:i.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"content-start",title:this.messages.temporary}):null}get _renderedItemToggle(){const{item:e,parent:t,messages:i,visibilityAppearance:n,css:o}=this;if(!("visible"in e&&"layerVisibility"in i&&"visibleToggle"in o&&n))return null;const{visible:s}=e,a=t?.visibilityMode;if("inherited"===a)return null;const l=c({visible:s,exclusive:"exclusive"===a,visibilityAppearance:n}),r="checkbox"===n,d=i.layerVisibility;return h("calcite-action",{appearance:"transparent",class:o.visibleToggle,icon:r?l:void 0,key:"visibility-toggle",onclick:()=>this._toggleVisibility(e,t),scale:"s",slot:r?"actions-start":"actions-end",text:d,title:d},r?null:h("calcite-icon",{class:this.classes({[o.visibleIcon]:"exclusive"!==a&&s}),icon:l,scale:"s"}))}get _renderedPanel(){const{panel:e}=this.item;return!e?.open||e.disabled||e.flowEnabled?null:h("div",{class:this.css.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}get _renderedPanelAction(){const{panel:e}=this.item;if(!e?.visible)return null;const{open:t,title:i,disabled:n}=e;return h("calcite-action",{active:t,appearance:"transparent",disabled:n,icon:s(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),scale:"s",slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}get _renderedActions(){switch(this._actionsCount){case 0:return null;case 1:return this._singleAction;default:return this._renderedActionMenu}}get _renderedActionMenu(){const{item:e,messagesCommon:t}=this,i=t.options;return h("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:t.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",slot:"actions-end",onCalciteActionMenuOpen:this._onActionMenuOpen},h("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:"s",slot:"trigger",text:i,title:i}),this._renderedActionMenuContent)}get _renderedActionMenuContent(){return this._filteredSections.toArray().map((e=>h("calcite-action-group",{key:`action-section-${e.uid}`},e.toArray().map((e=>this._renderAction({action:e,textEnabled:!0}))))))}get _renderedCatalogFootprintIcon(){const{css:e}=this,t=this.item.layer,i="catalog-footprint"===t?.type,n="sublayer"===t?.type&&o(t,"footprints");return"itemCatalogIcon"in e&&(i||n)?h("calcite-icon",{class:e.itemCatalogIcon,icon:"footprint",key:"footprint",scale:"s",slot:"content-start"}):null}get _renderedCatalogDynamicIcon(){const{css:e}=this,t=this.item.layer,i="catalog-dynamic-group"===t?.type,n="sublayer"===t?.type&&o(t,"layers-in-view");return"itemCatalogIcon"in e&&(i||n)?h("calcite-icon",{class:e.itemCatalogIcon,icon:"catalog-dataset",key:"catalog-dataset",scale:"s",slot:"content-start"}):null}get _renderedCatalogSelectNode(){const{_title:e,item:t,visibleElements:i}=this;if(!("visible"in t))return;const{layer:n}=t,o="catalog-dynamic-group"===n?.type;return"catalogLayerList"in i&&i.catalogLayerList&&o?h("calcite-action",{appearance:"transparent",disabled:!n.visible,icon:"chevron-right",iconFlipRtl:!0,onclick:()=>this._triggerOnCatalogOpen(t),scale:"s",slot:"actions-end",text:e}):null}get _renderedChildList(){const{dragEnabled:e,item:t,rootGroupUid:i,listModeDisabled:n,selectionMode:o,displayMode:s}=this;if(!("visible"in t))return;const a=[...this.parentTitles??[],t.title],{children:l,layer:r}=t,c="catalog-dynamic-group"!==r?.type&&d(t),u=!n&&p(r);return c||!u&&!c&&e&&"group"===r?.type?h("calcite-list",{canPull:e=>!!this.canMove&&this.canMove(e,"pull"),canPut:e=>!!this.canMove&&this.canMove(e,"put"),"data-item":t,"data-layer-type":i,displayMode:s,dragEnabled:!!e&&(t.childrenSortable&&m(t)),group:`${i}-${r?.uid}`,key:`child-list-${r?.uid}`,label:t.title,selectionAppearance:"border",selectionMode:o},l?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error))).toArray().map((e=>this._renderItem(e,t,a))),this._renderedTablesItem):null}get _hasTables(){const{layerTablesEnabled:e}=this,t=this.item.layer;if(!e||!t)return!1;switch(t.type){case"knowledge-graph":return e.includes(t.type)&&!!t.tables?.length;case"map-image":case"tile":return e.includes(t.type)&&!!t.subtables?.length;default:return!1}}get _renderedTablesItem(){const{item:e,messages:t,css:i}=this,{layer:n}=e;return"itemTableIcon"in i&&"visible"in e&&"tables"in t&&this._hasTables?h("calcite-list-item",{class:i.item,"data-layer-id":n?.id,dragDisabled:!0,key:`list-item-table-list-tables-${n?.uid}`,title:t.tables,onCalciteListItemSelect:()=>this._triggerOnTablesOpen(e)},h("calcite-icon",{class:i.itemTableIcon,icon:"table",scale:"s",slot:"content-start"}),h("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"})):null}get _renderedItemMessage(){const{item:e,messages:t,css:i}=this;return e.error?h("div",{class:i.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},h("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},h("div",{slot:"message"},"tableError"in t?t.tableError:t.layerError))):"incompatible"in e&&e.incompatible&&"layerIncompatible"in t?h("div",{class:i.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},h("calcite-notice",{afterCreate:this._setTooltipReference,afterRemoved:this._removeTooltipReference,bind:this,icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},h("div",{slot:"message"},t.layerIncompatible))):null}get _singleAction(){return this._renderAction({action:u(this._filteredSections),textEnabled:!1})}get _filteredSections(){return this.item.actionsSections.map((e=>e.filter((e=>e.visible))))}get _actionsCount(){return this.item.actionsSections.reduce(((e,t)=>e+t.length),0)}_renderAction(e){const{item:t}=this,{action:i,textEnabled:n}=e;if(!i)return null;const{active:o,disabled:a,title:l,type:r,indicator:c}=i;return h("calcite-action",{active:"toggle"===r&&i.value,appearance:"transparent","data-action-id":i.id,disabled:a,icon:s(i),indicator:c,key:`action-${i.uid}`,loading:o,onclick:()=>this._triggerAction(t,i),scale:"s",slot:n?void 0:"actions-end",text:l??"",textEnabled:n,title:l??void 0},this._renderFallbackIcon(i))}_renderFallbackIcon(e){const{css:t}=this,{className:i,icon:n}=e;if(n)return null;const o="image"in e?e.image:void 0,s={[t.itemActionIcon]:!!i,[t.itemActionImage]:!!o};return i&&(s[i]=!0),o||i?h("span",{"aria-hidden":"true",class:this.classes(t.itemActionIcon,s),key:"icon",styles:a(o)}):null}_renderItem(e,t,i=[]){return h(v,{activeItem:this.activeItem,canMove:this.canMove,css:this.css,displayMode:this.displayMode,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this.rootGroupUid,selectedDragItemLayerUid:this.selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this.onAction,onCatalogOpen:this.onCatalogOpen,onPanelOpen:this.onPanelOpen,onSelectedDragItemLayerUidChange:this.onSelectedDragItemLayerUidChange,onTablesOpen:this.onTablesOpen,onTooltipReferenceChange:this.onTooltipReferenceChange})}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.onAction(t,e))}_triggerOnTablesOpen(e){e&&this.onTablesOpen&&this.onTablesOpen(e)}_triggerOnCatalogOpen(e){e&&this.onCatalogOpen?.(e)}_focusSelectedDragEl(e,t){this.selectedDragItemLayerUid===t.layer?.uid&&(b(e),this.onSelectedDragItemLayerUidChange?.(null))}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.open}_handleCalciteListItemSelect(e,t,i){g(e.target)===t&&"none"===this.selectionMode&&"inherited"!==i?.visibilityMode&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&this.onPanelOpen()}_toggleVisibility(e,t){if(!e)return;const i=t?.visibilityMode;"exclusive"===i&&e.visible||(e.visible=!e.visible)}};_.vnodeSelector="calcite-list-item",e([t()],_.prototype,"activeItem",void 0),e([t()],_.prototype,"canMove",void 0),e([t()],_.prototype,"css",void 0),e([t()],_.prototype,"displayMode",void 0),e([t()],_.prototype,"dragEnabled",void 0),e([t()],_.prototype,"item",void 0),e([t()],_.prototype,"layerTablesEnabled",void 0),e([t()],_.prototype,"listModeDisabled",void 0),e([t()],_.prototype,"messages",void 0),e([t()],_.prototype,"messagesCommon",void 0),e([t()],_.prototype,"onAction",void 0),e([t()],_.prototype,"onPanelOpen",void 0),e([t()],_.prototype,"onCatalogOpen",void 0),e([t()],_.prototype,"onTablesOpen",void 0),e([t()],_.prototype,"onSelectedDragItemLayerUidChange",void 0),e([t()],_.prototype,"onTooltipReferenceChange",void 0),e([t()],_.prototype,"parent",void 0),e([t()],_.prototype,"parentTitles",void 0),e([t()],_.prototype,"rootGroupUid",void 0),e([t()],_.prototype,"selectionMode",void 0),e([t()],_.prototype,"selectedItems",void 0),e([t()],_.prototype,"selectedDragItemLayerUid",void 0),e([t()],_.prototype,"visibleElements",void 0),e([t()],_.prototype,"visibilityAppearance",void 0),e([t()],_.prototype,"_title",null),e([t()],_.prototype,"_renderedItemStatus",null),e([t()],_.prototype,"_renderedItemTemporaryIcon",null),e([t()],_.prototype,"_renderedItemToggle",null),e([t()],_.prototype,"_renderedPanel",null),e([t()],_.prototype,"_renderedPanelAction",null),e([t()],_.prototype,"_renderedActions",null),e([t()],_.prototype,"_renderedActionMenu",null),e([t()],_.prototype,"_renderedActionMenuContent",null),e([t()],_.prototype,"_renderedCatalogFootprintIcon",null),e([t()],_.prototype,"_renderedCatalogDynamicIcon",null),e([t()],_.prototype,"_renderedCatalogSelectNode",null),e([t()],_.prototype,"_renderedChildList",null),e([t()],_.prototype,"_hasTables",null),e([t()],_.prototype,"_renderedTablesItem",null),e([t()],_.prototype,"_renderedItemMessage",null),e([t()],_.prototype,"_singleAction",null),e([t()],_.prototype,"_filteredSections",null),e([t()],_.prototype,"_actionsCount",null),_=v=e([i("esri.widgets.LayerList.LayerListItem")],_);const I=_;export{I as default};