@arcgis/core 4.34.0-next.92 → 4.34.0-next.94

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 (348) hide show
  1. package/Color.js +1 -1
  2. package/Ground.js +1 -1
  3. package/WebScene.js +1 -1
  4. package/analysis/ElevationProfile/ElevationProfileDisplayUnits.d.ts +4 -0
  5. package/analysis/ElevationProfile/{ElevationProfileUnits.js → ElevationProfileDisplayUnits.js} +1 -1
  6. package/analysis/ElevationProfile/ElevationProfileUnits.d.ts +1 -1
  7. package/analysis/ElevationProfile/ElevationProfileViewOptions.js +1 -1
  8. package/analysis/ElevationProfileAnalysis.js +1 -1
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/004b13c1db79c9e668b1.js +1 -0
  11. package/assets/esri/core/workers/chunks/{700b5a536f97233bc4af.js → 03b455e9405a8b6fec68.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{a244afea77127e54dd3a.js → 08b0fc6bfe9640ee2525.js} +1 -1
  13. package/assets/esri/core/workers/chunks/0a981061df08da19372c.js +1 -0
  14. package/assets/esri/core/workers/chunks/{db5a985ccc6b7d0ad855.js → 176f56de787bf486be9f.js} +1 -1
  15. package/assets/esri/core/workers/chunks/1fc7df018c8f802565a6.js +1 -0
  16. package/assets/esri/core/workers/chunks/20003728a679479b14dc.js +1 -0
  17. package/assets/esri/core/workers/chunks/20f4c6d8b310ecab97be.js +1 -0
  18. package/assets/esri/core/workers/chunks/25639559336109ff3df1.js +1 -0
  19. package/assets/esri/core/workers/chunks/26081b6486c623735657.js +1 -0
  20. package/assets/esri/core/workers/chunks/2698f656405876f4bd20.js +1 -0
  21. package/assets/esri/core/workers/chunks/{4660798b3b45dcb5cecb.js → 2b9c9a35a6e1f56920b5.js} +2 -2
  22. package/assets/esri/core/workers/chunks/352511dbc67166face40.js +1 -0
  23. package/assets/esri/core/workers/chunks/3acd79a6a0572926a799.js +1 -0
  24. package/assets/esri/core/workers/chunks/3d7923d25734d03a4d27.js +1 -0
  25. package/assets/esri/core/workers/chunks/48133effac2eacc2196e.js +1 -0
  26. package/assets/esri/core/workers/chunks/4dfcd03082be83600f3a.js +1 -0
  27. package/assets/esri/core/workers/chunks/503c81dda242e6077317.js +1 -0
  28. package/assets/esri/core/workers/chunks/{06aed0a5464965be8d52.js → 56b3bb68b61b77138186.js} +1 -1
  29. package/assets/esri/core/workers/chunks/5746c4861af83c1d57a8.js +1 -0
  30. package/assets/esri/core/workers/chunks/5aacd1c6b171c99b41f5.js +1 -0
  31. package/assets/esri/core/workers/chunks/6810ecdeccf4b7eae5e2.js +1 -0
  32. package/assets/esri/core/workers/chunks/6b208f5d423da64c8559.js +1 -0
  33. package/assets/esri/core/workers/chunks/{7a240ab31d9ff2d2c5af.js → 73db6c070b049fe05147.js} +1 -1
  34. package/assets/esri/core/workers/chunks/801451fb572bc5f1f270.js +1 -0
  35. package/assets/esri/core/workers/chunks/82e0d22619dc26920ca9.js +1 -0
  36. package/assets/esri/core/workers/chunks/8f426cb210a4250517d5.js +1 -0
  37. package/assets/esri/core/workers/chunks/94ddf029698991d853b9.js +1 -0
  38. package/assets/esri/core/workers/chunks/97eb2cfc1f036feea9a9.js +1 -0
  39. package/assets/esri/core/workers/chunks/98381404f2d99a1f9341.js +1 -0
  40. package/assets/esri/core/workers/chunks/9adecee0ed2f1df3b0d2.js +1 -0
  41. package/assets/esri/core/workers/chunks/a0fab8cd791c33d3895d.js +1 -0
  42. package/assets/esri/core/workers/chunks/{a85acb948cc7d22be592.js → a410dcf80d17a2383337.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{d9d86cf0500fa29d1d43.js → a98b284b147258629947.js} +1 -1
  44. package/assets/esri/core/workers/chunks/b1ccbc2fef7f7e5e04f7.js +1 -0
  45. package/assets/esri/core/workers/chunks/b5c829e904bc9cb5347d.js +1 -0
  46. package/assets/esri/core/workers/chunks/bec9ddd38c9ab9f2561b.js +1 -0
  47. package/assets/esri/core/workers/chunks/bf9031749d10e7d457b6.js +1 -0
  48. package/assets/esri/core/workers/chunks/bf9d09493fd849ea69fd.js +1 -0
  49. package/assets/esri/core/workers/chunks/c4641c2c130c7b8bcdee.js +1 -0
  50. package/assets/esri/core/workers/chunks/{58e2652810143f509fe1.js → c473b15d4d52f0a63d20.js} +1 -1
  51. package/assets/esri/core/workers/chunks/c8e4fe0e3b109eb80e8e.js +1 -0
  52. package/assets/esri/core/workers/chunks/c9159ebf930af3f336f3.js +1 -0
  53. package/assets/esri/core/workers/chunks/cd0c222a36caa7f80860.js +1 -0
  54. package/assets/esri/core/workers/chunks/ce2fcaa21d6efcdf4da5.js +1 -0
  55. package/assets/esri/core/workers/chunks/d2df6e685d6cffc5f486.js +1 -0
  56. package/assets/esri/core/workers/chunks/{c27783ce7ea51a5e49c5.js → e153b61560a7a869db63.js} +1 -1
  57. package/assets/esri/core/workers/chunks/e2c293331515f3bd0355.js +1 -0
  58. package/assets/esri/core/workers/chunks/{100a0041ee42b0b2fa32.js → e5d974593043d5e2b502.js} +1 -1
  59. package/assets/esri/core/workers/chunks/ec7b156425f25d231078.js +1 -0
  60. package/assets/esri/core/workers/chunks/{1194c2432c31def87db1.js → f71b76c9506178124fa3.js} +1 -1
  61. package/assets/esri/core/workers/chunks/fb456e7425e09df17d8c.js +1 -0
  62. package/assets/esri/core/workers/chunks/{f6806780ca2aa591475a.js → fe1dcf9f81da4adbb1fe.js} +1 -1
  63. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  64. package/assets/esri/themes/base/_core.scss +0 -2
  65. package/assets/esri/themes/base/widgets/_OrientedImageryViewerNavigationUI.scss +10 -7
  66. package/assets/esri/themes/dark/main.css +1 -1
  67. package/assets/esri/themes/light/main.css +1 -1
  68. package/assets/esri/themes/light/view.css +1 -1
  69. package/chunks/CutFillComposition.glsl.js +15 -3
  70. package/chunks/CutFillMask.glsl.js +1 -1
  71. package/chunks/WaterSurface.glsl.js +0 -1
  72. package/chunks/bundle.js +1 -1
  73. package/chunks/languageUtils.js +1 -1
  74. package/colorUtils.js +1 -1
  75. package/config.js +1 -1
  76. package/core/CollectionFlattener.js +1 -1
  77. package/editing/sharedTemplates/executor/support/createPresetServiceEdit.js +1 -1
  78. package/geometry/operators/json/graphicBufferOperator.js +1 -1
  79. package/geometry/support/aaBoundingRect.js +1 -1
  80. package/geometry/support/geometryUtils.js +1 -1
  81. package/geometry/support/meshUtils/elevationSampler.js +1 -1
  82. package/geometry/support/meshUtils.js +1 -1
  83. package/geometry/support/triangle.js +1 -1
  84. package/interfaces.d.ts +262 -339
  85. package/kernel.js +1 -1
  86. package/layers/BaseElevationLayer.js +1 -1
  87. package/layers/BaseTileLayer.js +1 -1
  88. package/layers/ElevationLayer.js +1 -1
  89. package/layers/FeatureLayer.js +1 -1
  90. package/layers/GaussianSplatLayer.js +1 -1
  91. package/layers/ImageryTileLayer.js +1 -1
  92. package/layers/ParquetLayer.js +1 -1
  93. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  94. package/layers/graphics/dehydratedFeatureComparison.js +1 -1
  95. package/layers/graphics/sources/ParquetSource.js +1 -1
  96. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  97. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  98. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  99. package/layers/support/ElevationQuery.js +1 -1
  100. package/layers/support/ElevationQueryContext.js +5 -0
  101. package/layers/support/ElevationSampler.js +1 -1
  102. package/layers/support/ElevationTile.js +1 -1
  103. package/layers/support/GeometryDescriptor.js +1 -1
  104. package/layers/support/ParquetEncodingLocation.js +1 -1
  105. package/layers/support/ParquetEncodingWkb.js +1 -1
  106. package/layers/support/RasterBandInfo.js +1 -1
  107. package/layers/support/TileElevationSampler.js +5 -0
  108. package/layers/support/TileInfo.js +1 -1
  109. package/layers/support/TileKey.js +1 -1
  110. package/layers/support/TilemapCache.js +1 -1
  111. package/layers/support/layerUtils.js +1 -1
  112. package/layers/support/parquetEncodingUtils.js +5 -0
  113. package/layers/support/parquetUtils.js +1 -1
  114. package/layers/support/rasterDatasets/InMemoryRaster.js +1 -1
  115. package/networks/UtilityNetwork.js +1 -1
  116. package/networks/support/NetworkSystemLayers.js +1 -1
  117. package/networks/support/typeUtils.js +1 -1
  118. package/package.json +3 -2
  119. package/popup/FieldInfo.js +1 -1
  120. package/popup/content/AttachmentsContent.js +1 -1
  121. package/portal/schemas/definitions.js +1 -1
  122. package/rest/knowledgeGraphService.js +1 -1
  123. package/rest/networks/support/Association.js +1 -1
  124. package/rest/print.js +1 -1
  125. package/support/revision.js +1 -1
  126. package/symbols/cim/CIMSymbolHelper.js +1 -1
  127. package/symbols/cim/cimAnalyzer.js +1 -1
  128. package/symbols/cim/effects/EffectOffset.js +1 -1
  129. package/views/2d/analysis/ElevationProfile/ElevationProfileInputVisualization2D.js +1 -1
  130. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  131. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  132. package/views/2d/engine/Stage.js +1 -1
  133. package/views/2d/engine/flow/BrushFlow.js +1 -1
  134. package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
  135. package/views/2d/engine/webgl/Overlay.js +1 -1
  136. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  137. package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
  138. package/views/2d/engine/webgl/TextureManager.js +1 -1
  139. package/views/2d/engine/webgl/animatedFormats/AnimatableTextureResource.js +1 -1
  140. package/views/2d/engine/webgl/animatedFormats/utils.js +1 -1
  141. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  142. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  143. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
  144. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
  145. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
  146. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
  147. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
  148. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  149. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  150. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
  151. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
  152. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
  153. package/views/2d/engine/webgl/shaderGraph/utils.js +1 -1
  154. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  155. package/views/2d/layers/VideoLayerView2D.js +1 -1
  156. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  157. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  158. package/views/2d/navigation/actions/Pan.js +1 -1
  159. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization3D.js +1 -1
  160. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  161. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
  162. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
  163. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  164. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  165. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  166. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  167. package/views/3d/layers/FlowSubView3D.js +1 -1
  168. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  169. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  170. package/views/3d/support/GaussianSplatSortWorker.js +1 -1
  171. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  172. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  173. package/views/3d/support/hitTest.js +1 -1
  174. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  175. package/views/3d/support/popupHitTest.js +1 -1
  176. package/views/3d/terrain/ExtentHelper.js +1 -1
  177. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  178. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  179. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  180. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  181. package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
  182. package/views/3d/webgl-engine/shaders/CutFillComposition.glsl.js +1 -1
  183. package/views/3d/webgl-engine/shaders/GaussianSplatDepthCompositionTechnique.js +1 -1
  184. package/views/PopupView.js +1 -1
  185. package/views/SceneView.js +1 -1
  186. package/views/View.js +1 -1
  187. package/views/View2D.js +1 -1
  188. package/views/Viewport2DMixin.js +1 -1
  189. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  190. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  191. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +1 -1
  192. package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +1 -1
  193. package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +1 -1
  194. package/views/analysis/ElevationProfile/ElevationProfileLineQueryComputation.js +1 -1
  195. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  196. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  197. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  198. package/views/analysis/ElevationProfile/elevationProfileInputVisualizationUtils.js +1 -1
  199. package/views/analysis/ExclusiveOperationManager.js +5 -0
  200. package/views/interactive/snapping/LineSnapper.js +1 -1
  201. package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
  202. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  203. package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
  204. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  205. package/views/interactive/snapping/featureSources/WorkerTileTreeDebugger.js +1 -1
  206. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  207. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  208. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  209. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  210. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
  211. package/views/interactive/snapping/featureSources/featureServiceSource/PendingFeatureTile.js +1 -1
  212. package/views/interactive/snapping/featureSources/queryEngineUtils.js +1 -1
  213. package/views/interactive/snapping/snappingUtils.js +1 -1
  214. package/views/navigation/Navigation.js +1 -1
  215. package/views/popupAdapter.js +5 -0
  216. package/views/support/GroundViewElevationSampler.js +1 -1
  217. package/views/video/VideoOperationalDataView.js +1 -1
  218. package/views/webgl/ContextState.js +1 -1
  219. package/views/webgl/RenderingContext.js +1 -1
  220. package/views/webgl/enums.js +1 -1
  221. package/widgets/Attachments/AttachmentsViewModel.js +1 -1
  222. package/widgets/Attachments.js +1 -1
  223. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  224. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  225. package/widgets/Feature/FeatureExpression.js +1 -1
  226. package/widgets/Feature/FeatureMedia/chartCommon.js +1 -1
  227. package/widgets/Feature/FeatureMedia/pieChart.js +1 -1
  228. package/widgets/Feature/FeatureMedia/xyChart.js +1 -1
  229. package/widgets/Feature/FeatureMedia.js +1 -1
  230. package/widgets/Feature/FeatureViewModel.js +1 -1
  231. package/widgets/Feature.js +1 -1
  232. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  233. package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
  234. package/widgets/FeatureTable/support/TableTemplate.js +1 -1
  235. package/widgets/FeatureTable.js +1 -1
  236. package/widgets/Features/FeaturesViewModel.js +1 -1
  237. package/widgets/Legend/LegendViewModel.js +1 -1
  238. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  239. package/widgets/Legend.js +1 -1
  240. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  241. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  242. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  243. package/widgets/OrientedImageryViewer/components/NavigationUIPanoramicViewModel.js +1 -1
  244. package/widgets/OrientedImageryViewer/services/DepthImageService.js +5 -0
  245. package/widgets/PanoramicViewer.js +1 -1
  246. package/widgets/Search/SearchResultRenderer.js +1 -1
  247. package/widgets/Search/SearchViewModel.js +1 -1
  248. package/widgets/Search.js +1 -1
  249. package/widgets/Sketch/SketchViewModel.js +1 -1
  250. package/widgets/support/chartUtilsAm5.js +1 -1
  251. package/assets/esri/core/workers/chunks/08374e5805fcedc1cb57.js +0 -1
  252. package/assets/esri/core/workers/chunks/0b24a6c06d1becbb6815.js +0 -1
  253. package/assets/esri/core/workers/chunks/14114be3afd6d292f89c.js +0 -1
  254. package/assets/esri/core/workers/chunks/19f1bfe815896d4983af.js +0 -1
  255. package/assets/esri/core/workers/chunks/22c3a21bc9f32c429c48.js +0 -1
  256. package/assets/esri/core/workers/chunks/2605062e44f2d4e73f14.js +0 -1
  257. package/assets/esri/core/workers/chunks/282c4f3484c605ce7d5e.js +0 -1
  258. package/assets/esri/core/workers/chunks/2e1cc11462846febb3b2.js +0 -1
  259. package/assets/esri/core/workers/chunks/37b5007660535f1c91c6.js +0 -1
  260. package/assets/esri/core/workers/chunks/393274af1804e5b6046a.js +0 -1
  261. package/assets/esri/core/workers/chunks/3b2ef975831eb75b40fb.js +0 -1
  262. package/assets/esri/core/workers/chunks/3ff3e1507220d3869c76.js +0 -1
  263. package/assets/esri/core/workers/chunks/4133ab8720e7e4afa9a6.js +0 -1
  264. package/assets/esri/core/workers/chunks/4d807bfe75108438db83.js +0 -1
  265. package/assets/esri/core/workers/chunks/5ad1985a9e66fb2232ae.js +0 -1
  266. package/assets/esri/core/workers/chunks/5b7a2ee44883b1fb2a5f.js +0 -1
  267. package/assets/esri/core/workers/chunks/614a00a3179f8fe23f45.js +0 -1
  268. package/assets/esri/core/workers/chunks/6aa349e1adf844df4b5b.js +0 -1
  269. package/assets/esri/core/workers/chunks/83065bef261314f9b2c5.js +0 -1
  270. package/assets/esri/core/workers/chunks/8bdbd94a59269e216fba.js +0 -1
  271. package/assets/esri/core/workers/chunks/8cae725e631d922853c8.js +0 -1
  272. package/assets/esri/core/workers/chunks/8f4cfef97716c3502b0f.js +0 -1
  273. package/assets/esri/core/workers/chunks/8ff2daef892881ff2019.js +0 -1
  274. package/assets/esri/core/workers/chunks/9bb6984f24cd5461a754.js +0 -1
  275. package/assets/esri/core/workers/chunks/9f2a3f37fe9b19ef1209.js +0 -1
  276. package/assets/esri/core/workers/chunks/a1196637268b89281780.js +0 -1
  277. package/assets/esri/core/workers/chunks/a6a2d4602dfeb62e0ecc.js +0 -1
  278. package/assets/esri/core/workers/chunks/b240298b8b643a323d34.js +0 -1
  279. package/assets/esri/core/workers/chunks/b47f26d6aa9a2848a677.js +0 -1
  280. package/assets/esri/core/workers/chunks/b661ea374fe38c8e29ca.js +0 -1
  281. package/assets/esri/core/workers/chunks/b8997ae5893afa0298d1.js +0 -1
  282. package/assets/esri/core/workers/chunks/baa48614d9567d5f240d.js +0 -1
  283. package/assets/esri/core/workers/chunks/c20862fe15295a294bbd.js +0 -1
  284. package/assets/esri/core/workers/chunks/c3020747f9001ca6a6e7.js +0 -1
  285. package/assets/esri/core/workers/chunks/c7c76a8a1c47eb62bef1.js +0 -1
  286. package/assets/esri/core/workers/chunks/c95e6bef8c97cf647869.js +0 -1
  287. package/assets/esri/core/workers/chunks/d71836cf70b9604832f1.js +0 -1
  288. package/assets/esri/core/workers/chunks/e99fc64b67bb0c71dc34.js +0 -1
  289. package/assets/esri/core/workers/chunks/eea9d49d55c2d1355497.js +0 -1
  290. package/assets/esri/core/workers/chunks/fb6ebb780bb59e252887.js +0 -1
  291. package/assets/esri/core/workers/chunks/ff6d189ba78980d40bb5.js +0 -1
  292. package/assets/esri/themes/base/widgets/_ButtonMenu.scss +0 -87
  293. package/chunks/Button.js +0 -5
  294. package/chunks/ColorSet.js +0 -5
  295. package/chunks/DefaultTheme.js +0 -5
  296. package/chunks/LineSeries.js +0 -5
  297. package/chunks/ResponsiveTheme.js +0 -5
  298. package/chunks/Theme.js +0 -5
  299. package/chunks/Tick.js +0 -5
  300. package/chunks/Tooltip.js +0 -5
  301. package/chunks/ar.js +0 -5
  302. package/chunks/bg_BG.js +0 -5
  303. package/chunks/bs_BA.js +0 -5
  304. package/chunks/ca_ES.js +0 -5
  305. package/chunks/chartUtilsAm5.js +0 -5
  306. package/chunks/cs_CZ.js +0 -5
  307. package/chunks/da_DK.js +0 -5
  308. package/chunks/de_CH.js +0 -5
  309. package/chunks/de_DE.js +0 -5
  310. package/chunks/el_GR.js +0 -5
  311. package/chunks/en_CA.js +0 -5
  312. package/chunks/en_US.js +0 -5
  313. package/chunks/es_ES.js +0 -5
  314. package/chunks/et_EE.js +0 -5
  315. package/chunks/fi_FI.js +0 -5
  316. package/chunks/fr_FR.js +0 -5
  317. package/chunks/he_IL.js +0 -5
  318. package/chunks/hr_HR.js +0 -5
  319. package/chunks/hu_HU.js +0 -5
  320. package/chunks/id_ID.js +0 -5
  321. package/chunks/it_IT.js +0 -5
  322. package/chunks/ja_JP.js +0 -5
  323. package/chunks/ko_KR.js +0 -5
  324. package/chunks/lt_LT.js +0 -5
  325. package/chunks/lv_LV.js +0 -5
  326. package/chunks/nb_NO.js +0 -5
  327. package/chunks/nl_NL.js +0 -5
  328. package/chunks/pl_PL.js +0 -5
  329. package/chunks/pt_BR.js +0 -5
  330. package/chunks/pt_PT.js +0 -5
  331. package/chunks/ro_RO.js +0 -5
  332. package/chunks/ru_RU.js +0 -5
  333. package/chunks/sk_SK.js +0 -5
  334. package/chunks/sl_SL.js +0 -5
  335. package/chunks/sr_RS.js +0 -5
  336. package/chunks/sv_SE.js +0 -5
  337. package/chunks/th_TH.js +0 -5
  338. package/chunks/tr_TR.js +0 -5
  339. package/chunks/uk_UA.js +0 -5
  340. package/chunks/vi_VN.js +0 -5
  341. package/chunks/zh_Hans.js +0 -5
  342. package/chunks/zh_Hant.js +0 -5
  343. package/widgets/FeatureTable/Grid/support/ButtonMenu.d.ts +0 -4
  344. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +0 -5
  345. package/widgets/FeatureTable/Grid/support/ButtonMenuItem.d.ts +0 -4
  346. package/widgets/FeatureTable/Grid/support/ButtonMenuItem.js +0 -5
  347. package/widgets/FeatureTable/Grid/support/ButtonMenuViewModel.d.ts +0 -4
  348. package/widgets/FeatureTable/Grid/support/ButtonMenuViewModel.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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__awaiter as e}from"tslib";import{w as t,c as i,S as s,a,T as r}from"../../../chunks/Tick.js";import{w as l,x as n,L as o,l as h,y as c,p as u,P as d,z as g,A as p,e as y,k as b,T as f,a as m,j as _,g as x,i as v,v as w,B as k,D,t as R,u as A,m as P}from"../../../chunks/Theme.js";import{C as T}from"../../../chunks/ColorSet.js";import{s as L}from"../../../chunks/DefaultTheme.js";class N extends l{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeRadialText("",this.textStyle)})}_afterNew(){super._afterNew()}_beforeChanged(){super._beforeChanged(),this._display.clear(),this.isDirty("textType")&&(this._display.textType=this.get("textType"),this.markDirtyBounds()),this.isDirty("radius")&&(this._display.radius=this.get("radius"),this.markDirtyBounds()),this.isDirty("startAngle")&&(this._display.startAngle=(this.get("startAngle",0)+90)*n,this.markDirtyBounds()),this.isDirty("inside")&&(this._display.inside=this.get("inside"),this.markDirtyBounds()),this.isDirty("orientation")&&(this._display.orientation=this.get("orientation"),this.markDirtyBounds()),this.isDirty("kerning")&&(this._display.kerning=this.get("kerning"),this.markDirtyBounds())}}Object.defineProperty(N,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RadialText"}),Object.defineProperty(N,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:l.classNames.concat([N.className])});class C extends o{constructor(){super(...arguments),Object.defineProperty(this,"_flipped",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._textKeys.push("textType","kerning"),super._afterNew()}_makeText(){this._text=this.children.push(N.new(this._root,{}))}baseRadius(){const e=this.getPrivate("radius",0),t=this.getPrivate("innerRadius",0),i=this.get("baseRadius",0);return t+h(i,e-t)}radius(){const e=this.get("inside",!1);return this.baseRadius()+this.get("radius",0)*(e?-1:1)}_updateChildren(){if(super._updateChildren(),this.isDirty("baseRadius")||this.isPrivateDirty("radius")||this.isPrivateDirty("innerRadius")||this.isDirty("labelAngle")||this.isDirty("radius")||this.isDirty("inside")||this.isDirty("orientation")||this.isDirty("textType")){const e=this.get("textType","adjusted"),t=this.get("inside",!1),i=this.get("orientation");let s=c(this.get("labelAngle",0));this._text.set("startAngle",this.get("labelAngle",0)),this._text.set("inside",t);const a=p(s),r=g(s);let l=this.baseRadius(),n=this.radius();if(this._display.angle=0,"circular"==e)this.setAll({paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}),this.setRaw("x",void 0),this.setRaw("y",void 0),this._text.set("orientation",i),this._text.set("radius",n);else{0==l&&(s=0,n=0);let t=n*r,o=n*a;"radial"==e?(this.setRaw("x",t),this.setRaw("y",o),s<90||s>270||"auto"!=i?(this._display.angle=s,this._flipped=!1):(this._display.angle=s+180,this._flipped=!0),this._dirty.rotation=!1):"adjusted"==e?(this.setRaw("centerX",u),this.setRaw("centerY",u),this.setRaw("x",t),this.setRaw("y",o)):"regular"==e&&(this.setRaw("x",t),this.setRaw("y",o))}this.markDirtyPosition(),this.markDirtyBounds()}}_updatePosition(){const e=this.get("textType","regular"),t=this.get("inside",!1);let i=0,s=0,a=this.get("labelAngle",0),r=this.localBounds(),l=r.right-r.left,n=r.bottom-r.top;if("radial"==e){if(this._flipped){let e=this.get("centerX");e instanceof d&&(l*=1-2*e.value),i=l*g(a),s=l*p(a)}}else t||"adjusted"!=e||(i=l/2*g(a),s=n/2*p(a));this.setRaw("dx",i),this.setRaw("dy",s),super._updatePosition()}get text(){return this._text}}Object.defineProperty(C,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RadialLabel"}),Object.defineProperty(C,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:o.classNames.concat([C.className])});const j=Math.abs,S=Math.atan2,O=Math.cos,I=Math.max,M=Math.min,B=Math.sin,F=Math.sqrt,H=1e-12,X=Math.PI,Y=X/2,z=2*X;function V(e){return e>1?0:e<-1?X:Math.acos(e)}function W(e){return e>=1?Y:e<=-1?-Y:Math.asin(e)}function U(e){return e.innerRadius}function K(e){return e.outerRadius}function q(e){return e.startAngle}function E(e){return e.endAngle}function G(e){return e&&e.padAngle}function J(e,t,i,s,a,r,l,n){var o=i-e,h=s-t,c=l-a,u=n-r,d=u*o-c*h;if(!(d*d<H))return[e+(d=(c*(t-r)-u*(e-a))/d)*o,t+d*h]}function Q(e,t,i,s,a,r,l){var n=e-i,o=t-s,h=(l?r:-r)/F(n*n+o*o),c=h*o,u=-h*n,d=e+c,g=t+u,p=i+c,y=s+u,b=(d+p)/2,f=(g+y)/2,m=p-d,_=y-g,x=m*m+_*_,v=a-r,w=d*y-p*g,k=(_<0?-1:1)*F(I(0,v*v*x-w*w)),D=(w*_-m*k)/x,R=(-w*m-_*k)/x,A=(w*_+m*k)/x,P=(-w*m+_*k)/x,T=D-b,L=R-f,N=A-b,C=P-f;return T*T+L*L>N*N+C*C&&(D=A,R=P),{cx:D,cy:R,x01:-c,y01:-u,x11:D*(a/v-1),y11:R*(a/v-1)}}function Z(){var e=U,s=K,a=i(0),r=null,l=q,n=E,o=G,h=null,c=t(u);function u(){var t,i,u=+e.apply(this,arguments),d=+s.apply(this,arguments),g=l.apply(this,arguments)-Y,p=n.apply(this,arguments)-Y,y=j(p-g),b=p>g;if(h||(h=t=c()),d<u&&(i=d,d=u,u=i),d>H)if(y>z-H)h.moveTo(d*O(g),d*B(g)),h.arc(0,0,d,g,p,!b),u>H&&(h.moveTo(u*O(p),u*B(p)),h.arc(0,0,u,p,g,b));else{var f,m,_=g,x=p,v=g,w=p,k=y,D=y,R=o.apply(this,arguments)/2,A=R>H&&(r?+r.apply(this,arguments):F(u*u+d*d)),P=M(j(d-u)/2,+a.apply(this,arguments)),T=P,L=P;if(A>H){var N=W(A/u*B(R)),C=W(A/d*B(R));(k-=2*N)>H?(v+=N*=b?1:-1,w-=N):(k=0,v=w=(g+p)/2),(D-=2*C)>H?(_+=C*=b?1:-1,x-=C):(D=0,_=x=(g+p)/2)}var I=d*O(_),U=d*B(_),K=u*O(w),q=u*B(w);if(P>H){var E,G=d*O(x),Z=d*B(x),$=u*O(v),ee=u*B(v);if(y<X)if(E=J(I,U,$,ee,G,Z,K,q)){var te=I-E[0],ie=U-E[1],se=G-E[0],ae=Z-E[1],re=1/B(V((te*se+ie*ae)/(F(te*te+ie*ie)*F(se*se+ae*ae)))/2),le=F(E[0]*E[0]+E[1]*E[1]);T=M(P,(u-le)/(re-1)),L=M(P,(d-le)/(re+1))}else T=L=0}D>H?L>H?(f=Q($,ee,I,U,d,L,b),m=Q(G,Z,K,q,d,L,b),h.moveTo(f.cx+f.x01,f.cy+f.y01),L<P?h.arc(f.cx,f.cy,L,S(f.y01,f.x01),S(m.y01,m.x01),!b):(h.arc(f.cx,f.cy,L,S(f.y01,f.x01),S(f.y11,f.x11),!b),h.arc(0,0,d,S(f.cy+f.y11,f.cx+f.x11),S(m.cy+m.y11,m.cx+m.x11),!b),h.arc(m.cx,m.cy,L,S(m.y11,m.x11),S(m.y01,m.x01),!b))):(h.moveTo(I,U),h.arc(0,0,d,_,x,!b)):h.moveTo(I,U),u>H&&k>H?T>H?(f=Q(K,q,G,Z,u,-T,b),m=Q(I,U,$,ee,u,-T,b),h.lineTo(f.cx+f.x01,f.cy+f.y01),T<P?h.arc(f.cx,f.cy,T,S(f.y01,f.x01),S(m.y01,m.x01),!b):(h.arc(f.cx,f.cy,T,S(f.y01,f.x01),S(f.y11,f.x11),!b),h.arc(0,0,u,S(f.cy+f.y11,f.cx+f.x11),S(m.cy+m.y11,m.cx+m.x11),b),h.arc(m.cx,m.cy,T,S(m.y11,m.x11),S(m.y01,m.x01),!b))):h.arc(0,0,u,w,v,b):h.lineTo(K,q)}else h.moveTo(0,0);if(h.closePath(),t)return h=null,t+""||null}return u.centroid=function(){var t=(+e.apply(this,arguments)+ +s.apply(this,arguments))/2,i=(+l.apply(this,arguments)+ +n.apply(this,arguments))/2-X/2;return[O(i)*t,B(i)*t]},u.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),u):e},u.outerRadius=function(e){return arguments.length?(s="function"==typeof e?e:i(+e),u):s},u.cornerRadius=function(e){return arguments.length?(a="function"==typeof e?e:i(+e),u):a},u.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:i(+e),u):r},u.startAngle=function(e){return arguments.length?(l="function"==typeof e?e:i(+e),u):l},u.endAngle=function(e){return arguments.length?(n="function"==typeof e?e:i(+e),u):n},u.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:i(+e),u):o},u.context=function(e){return arguments.length?(h=e??null,u):h},u}class $ extends y{constructor(){super(...arguments),Object.defineProperty(this,"ix",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"iy",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_generator",{enumerable:!0,configurable:!0,writable:!0,value:Z()})}_getTooltipPoint(){let e=this.get("tooltipX"),t=this.get("tooltipY"),i=0,s=0;b(e)&&(i=e),b(t)&&(s=t);let a=this.get("radius",0),r=this.get("innerRadius",0);return a+=this.get("dRadius",0),r+=this.get("dInnerRadius",0),r<0&&(r=a+r),e instanceof d&&(i=this.ix*(r+(a-r)*e.value)),t instanceof d&&(s=this.iy*(r+(a-r)*t.value)),this.get("arc")>=360&&0==r&&(i=0,s=0),{x:i,y:s}}_beforeChanged(){super._beforeChanged(),(this.isDirty("radius")||this.isDirty("arc")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("dRadius")||this.isDirty("dInnerRadius")||this.isDirty("cornerRadius")||this.isDirty("shiftRadius"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){let e=this.get("startAngle",0),t=this.get("arc",0);const i=this._generator;t<0&&(e+=t,t*=-1),t>.1&&i.cornerRadius(this.get("cornerRadius",0)),i.context(this._display);let s=this.get("radius",0),a=this.get("innerRadius",0);s+=this.get("dRadius",0),a+=this.get("dInnerRadius",0),a<0&&(a=s+a),i({innerRadius:a,outerRadius:s,startAngle:(e+90)*n,endAngle:(e+t+90)*n});let r=e+t/2;this.ix=g(r),this.iy=p(r);const l=this.get("shiftRadius",0);this.setRaw("dx",this.ix*l),this.setRaw("dy",this.iy*l),this.markDirtyPosition()}}}Object.defineProperty($,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Slice"}),Object.defineProperty($,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:y.classNames.concat([$.className])});class ee extends f{setupDefaultRules(){super.setupDefaultRules();const e=this._root.interfaceColors,t=this.rule.bind(this);t("PercentSeries").setAll({legendLabelText:"{category}",legendValueText:"{valuePercentTotal.formatNumber('0.00p')}",colors:T.new(this._root,{}),width:m,height:m}),t("PieChart").setAll({radius:_(80),startAngle:-90,endAngle:270}),t("PieSeries").setAll({alignLabels:!0,startAngle:-90,endAngle:270}),t("PieSeries").states.create("hidden",{endAngle:-90,opacity:0}),t("Slice",["pie"]).setAll({position:"absolute",isMeasured:!1,x:0,y:0,toggleKey:"active",tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}",strokeWidth:1,strokeOpacity:1,role:"figure",lineJoin:"round"}),t("Slice",["pie"]).states.create("active",{shiftRadius:20,scale:1}),t("Slice",["pie"]).states.create("hoverActive",{scale:1.04}),t("Slice",["pie"]).states.create("hover",{scale:1.04}),t("RadialLabel",["pie"]).setAll({textType:"aligned",radius:10,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",paddingTop:5,paddingBottom:5,populateText:!0}),t("Tick",["pie"]).setAll({location:1}),t("SlicedChart").setAll({paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10}),t("FunnelSeries").setAll({startLocation:0,endLocation:1,orientation:"vertical",alignLabels:!0,sequencedInterpolation:!0}),t("FunnelSlice").setAll({interactive:!0,expandDistance:0}),t("FunnelSlice").states.create("hover",{expandDistance:.15}),t("Label",["funnel"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:u}),t("Label",["funnel","horizontal"]).setAll({centerX:0,centerY:u,rotation:-90}),t("Label",["funnel","vertical"]).setAll({centerY:u,centerX:0}),t("Tick",["funnel"]).setAll({location:1}),t("FunnelSlice",["funnel","link"]).setAll({fillOpacity:.5,strokeOpacity:0,expandDistance:-.1}),t("FunnelSlice",["funnel","link","vertical"]).setAll({height:10}),t("FunnelSlice",["funnel","link","horizontal"]).setAll({width:10}),t("PyramidSeries").setAll({valueIs:"area"}),t("FunnelSlice",["pyramid","link"]).setAll({fillOpacity:.5}),t("FunnelSlice",["pyramid","link","vertical"]).setAll({height:0}),t("FunnelSlice",["pyramid","link","horizontal"]).setAll({width:0}),t("FunnelSlice",["pyramid"]).setAll({interactive:!0,expandDistance:0}),t("FunnelSlice",["pyramid"]).states.create("hover",{expandDistance:.15}),t("Label",["pyramid"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:u}),t("Label",["pyramid","horizontal"]).setAll({centerX:0,centerY:u,rotation:-90}),t("Label",["pyramid","vertical"]).setAll({centerY:u,centerX:0}),t("Tick",["pyramid"]).setAll({location:1}),t("FunnelSlice",["pictorial"]).setAll({interactive:!0,tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}"}),t("Label",["pictorial"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:u}),t("Label",["pictorial","horizontal"]).setAll({centerX:0,centerY:u,rotation:-90}),t("Label",["pictorial","vertical"]).setAll({centerY:u,centerX:0}),t("FunnelSlice",["pictorial","link"]).setAll({fillOpacity:.5,width:0,height:0}),t("Tick",["pictorial"]).setAll({location:.5});{const i=t("Graphics",["pictorial","background"]);i.setAll({fillOpacity:.2}),L(i,"fill",e,"alternativeBackground")}}}class te extends s{_afterNew(){this._defaultThemes.push(ee.new(this._root)),super._afterNew(),this.chartContainer.children.push(this.seriesContainer),this.seriesContainer.children.push(this.bulletsContainer)}_processSeries(e){super._processSeries(e),this.seriesContainer.children.moveValue(this.bulletsContainer,this.seriesContainer.children.length-1)}}Object.defineProperty(te,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentChart"}),Object.defineProperty(te,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:s.classNames.concat([te.className])});class ie extends a{constructor(){super(...arguments),Object.defineProperty(this,"slicesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(x.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"labelsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(x.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"ticksContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(x.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"_lLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_rLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_hLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:this.addDisposer(this._makeSlices())}),Object.defineProperty(this,"labels",{enumerable:!0,configurable:!0,writable:!0,value:this.addDisposer(this._makeLabels())}),Object.defineProperty(this,"ticks",{enumerable:!0,configurable:!0,writable:!0,value:this.addDisposer(this._makeTicks())})}makeSlice(e){const t=this.slicesContainer.children.push(this.slices.make());return t.on("fill",()=>{this.updateLegendMarker(e)}),t.on("fillPattern",()=>{this.updateLegendMarker(e)}),t.on("stroke",()=>{this.updateLegendMarker(e)}),t._setDataItem(e),e.set("slice",t),this.slices.push(t),t}makeLabel(e){const t=this.labelsContainer.children.push(this.labels.make());return t._setDataItem(e),e.set("label",t),this.labels.push(t),t}_shouldMakeBullet(e){return null!=e.get("value")}makeTick(e){const t=this.ticksContainer.children.push(this.ticks.make());return t._setDataItem(e),e.set("tick",t),this.ticks.push(t),t}_afterNew(){this.fields.push("category","fill"),super._afterNew()}_onDataClear(){const e=this.get("colors");e&&e.reset();const t=this.get("patterns");t&&t.reset()}_prepareChildren(){if(super._prepareChildren(),this._lLabels=[],this._rLabels=[],this._hLabels=[],this._valuesDirty){let e=0,t=0,i=0,s=1/0,a=0;v(this._dataItems,i=>{let s=i.get("valueWorking",0);e+=s,t+=Math.abs(s)}),v(this._dataItems,e=>{let r=e.get("valueWorking",0);r>i&&(i=r),r<s&&(s=r),a++;let l=r/t;0==t&&(l=0),e.setRaw("valuePercentTotal",100*l)}),this.setPrivateRaw("valueLow",s),this.setPrivateRaw("valueHigh",i),this.setPrivateRaw("valueSum",e),this.setPrivateRaw("valueAverage",e/a),this.setPrivateRaw("valueAbsoluteSum",t)}}show(t){const i=Object.create(null,{show:{get:()=>super.show}});return e(this,void 0,void 0,function*(){let e=[];e.push(i.show.call(this,t)),e.push(this._sequencedShowHide(!0,t)),yield Promise.all(e)})}hide(t){const i=Object.create(null,{hide:{get:()=>super.hide}});return e(this,void 0,void 0,function*(){let e=[];e.push(i.hide.call(this,t)),e.push(this._sequencedShowHide(!1,t)),yield Promise.all(e)})}_updateChildren(){super._updateChildren(),this._valuesDirty&&v(this._dataItems,e=>{e.get("label").text.markDirtyText()}),(this.isDirty("legendLabelText")||this.isDirty("legendValueText"))&&v(this._dataItems,e=>{this.updateLegendValue(e)}),this._arrange()}_arrange(){this._arrangeDown(this._lLabels),this._arrangeUp(this._lLabels),this._arrangeDown(this._rLabels),this._arrangeUp(this._rLabels),this._arrangeLeft(this._hLabels),this._arrangeRight(this._hLabels),v(this.dataItems,e=>{this._updateTick(e)})}_afterChanged(){super._afterChanged(),this._arrange()}processDataItem(e){if(super.processDataItem(e),null==e.get("fill")){let t=this.get("colors");t&&e.setRaw("fill",t.next())}if(null==e.get("fillPattern")){let t=this.get("patterns");t&&e.setRaw("fillPattern",t.next())}}showDataItem(t,i){const s=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return e(this,void 0,void 0,function*(){const e=[s.showDataItem.call(this,t,i)];b(i)||(i=this.get("stateAnimationDuration",0));const a=this.get("stateAnimationEasing");let r=t.get("value");const l=t.animate({key:"valueWorking",to:r,duration:i,easing:a});l&&e.push(l.waitForStop());const n=t.get("tick");n&&e.push(n.show(i));const o=t.get("label");o&&e.push(o.show(i));const h=t.get("slice");h&&e.push(h.show(i)),h.get("active")&&h.states.applyAnimate("active"),yield Promise.all(e)})}hideDataItem(t,i){const s=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return e(this,void 0,void 0,function*(){const e=[s.hideDataItem.call(this,t,i)],a=this.states.create("hidden",{});b(i)||(i=a.get("stateAnimationDuration",this.get("stateAnimationDuration",0)));const r=a.get("stateAnimationEasing",this.get("stateAnimationEasing")),l=t.animate({key:"valueWorking",to:0,duration:i,easing:r});l&&e.push(l.waitForStop());const n=t.get("tick");n&&e.push(n.hide(i));const o=t.get("label");o&&e.push(o.hide(i));const h=t.get("slice");h.hideTooltip(),h&&e.push(h.hide(i)),yield Promise.all(e)})}disposeDataItem(e){super.disposeDataItem(e);let t=e.get("label");t&&(this.labels.removeValue(t),t.dispose());let i=e.get("tick");i&&(this.ticks.removeValue(i),i.dispose());let s=e.get("slice");s&&(this.slices.removeValue(s),s.dispose())}hoverDataItem(e){const t=e.get("slice");t&&!t.isHidden()&&t.hover()}unhoverDataItem(e){const t=e.get("slice");t&&t.unhover()}updateLegendMarker(e){if(e){const t=e.get("slice");if(t){const i=e.get("legendDataItem");if(i){const e=i.get("markerRectangle");v(w,i=>{null!=t.get(i)&&e.set(i,t.get(i))})}}}}_arrangeDown(e){if(e){let t=this._getNextDown();e.sort((e,t)=>e.y>t.y?1:e.y<t.y?-1:0),v(e,e=>{const i=e.label.adjustedLocalBounds();let s=i.top;e.y+s<t&&(e.y=t-s),e.label.set("y",e.y),t=e.y+i.bottom})}}_getNextUp(){return this.labelsContainer.maxHeight()}_getNextDown(){return 0}_arrangeUp(e){if(e){let t=this._getNextUp();e.sort((e,t)=>e.y<t.y?1:e.y>t.y?-1:0),v(e,e=>{const i=e.label.adjustedLocalBounds();let s=i.bottom;e.y+s>t&&(e.y=t-s),e.label.set("y",e.y),t=e.y+i.top})}}_arrangeRight(e){if(e){let t=0;e.sort((e,t)=>e.y>t.y?1:e.y<t.y?-1:0),v(e,e=>{const i=e.label.adjustedLocalBounds();let s=i.left;e.y+s<t&&(e.y=t-s),e.label.set("x",e.y),t=e.y+i.right})}}_arrangeLeft(e){if(e){let t=this.labelsContainer.maxWidth();e.sort((e,t)=>e.y<t.y?1:e.y>t.y?-1:0),v(e,e=>{const i=e.label.adjustedLocalBounds();let s=i.right;e.y+s>t&&(e.y=t-s),e.label.set("x",e.y),t=e.y+i.left})}}_updateSize(){super._updateSize(),this.markDirty()}_updateTick(e){}_dispose(){super._dispose();const e=this.chart;e&&e.series.removeValue(this)}}Object.defineProperty(ie,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentSeries"}),Object.defineProperty(ie,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:a.classNames.concat([ie.className])});class se extends te{constructor(){super(...arguments),Object.defineProperty(this,"_maxRadius",{enumerable:!0,configurable:!0,writable:!0,value:1})}_afterNew(){super._afterNew(),this.seriesContainer.setAll({x:u,y:u})}_prepareChildren(){super._prepareChildren();const e=this.chartContainer,t=e.innerWidth(),i=e.innerHeight(),s=this.get("startAngle",0),a=this.get("endAngle",0),r=this.get("innerRadius");let l=k(0,0,s,a,1);const n=t/(l.right-l.left),o=i/(l.bottom-l.top);let c={left:0,right:0,top:0,bottom:0};if(r instanceof d){let e=r.value,l=Math.min(n,o);e=Math.max(l*e,l-Math.min(i,t))/l,c=k(0,0,s,a,e),this.setPrivateRaw("irModifyer",e/r.value)}l=D([l,c]);const u=this._maxRadius;this._maxRadius=Math.min(n,o);const g=h(this.get("radius",0),this._maxRadius);this.seriesContainer.setAll({dy:-g*(l.bottom+l.top)/2,dx:-g*(l.right+l.left)/2}),(this.isDirty("startAngle")||this.isDirty("endAngle")||u!=this._maxRadius)&&this.series.each(e=>{e._markDirtyKey("startAngle")}),(this.isDirty("innerRadius")||this.isDirty("radius"))&&this.series.each(e=>{e._markDirtyKey("innerRadius")})}radius(e){let t=h(this.get("radius",0),this._maxRadius),i=h(this.get("innerRadius",0),t);if(e){let s=this.series.indexOf(e),a=this.series.length,r=e.get("radius");return null!=r?i+h(r,t-i):i+(t-i)/a*(s+1)}return t}innerRadius(e){const t=this.radius();let i=h(this.get("innerRadius",0),t);if(i<0&&(i=t+i),e){let s=this.series.indexOf(e),a=this.series.length,r=e.get("innerRadius");return null!=r?i+h(r,t-i):i+(t-i)/a*s}return i}_updateSize(){super._updateSize(),this.markDirtyKey("radius")}}Object.defineProperty(se,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieChart"}),Object.defineProperty(se,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:te.classNames.concat([se.className])});class ae extends ie{_makeSlices(){return new R(A.new({}),()=>$._new(this._root,{themeTags:P(this.slices.template.get("themeTags",[]),["pie","series"])},[this.slices.template]))}_makeLabels(){return new R(A.new({}),()=>C._new(this._root,{themeTags:P(this.labels.template.get("themeTags",[]),["pie","series"])},[this.labels.template]))}_makeTicks(){return new R(A.new({}),()=>r._new(this._root,{themeTags:P(this.ticks.template.get("themeTags",[]),["pie","series"])},[this.ticks.template]))}processDataItem(e){super.processDataItem(e);const t=this.makeSlice(e);t.on("scale",()=>{this._updateTick(e)}),t.on("shiftRadius",()=>{this._updateTick(e)}),t.events.on("positionchanged",()=>{this._updateTick(e)});const i=this.makeLabel(e);i.events.on("positionchanged",()=>{this._updateTick(e)}),this.makeTick(e),t.events.on("positionchanged",()=>{i.markDirty()})}_getNextUp(){const e=this.chart;return e?e._maxRadius:this.labelsContainer.maxHeight()/2}_getNextDown(){const e=this.chart;return e?-e._maxRadius:-this.labelsContainer.maxHeight()/2}_prepareChildren(){super._prepareChildren();const e=this.chart;if(e){if(this.isDirty("alignLabels")){let e=this.labels.template;if(this.get("alignLabels"))e.set("textType","aligned");else{let t=e.get("textType");null!=t&&"aligned"!=t||e.set("textType","adjusted")}}if(this._valuesDirty||this.isDirty("radius")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("endAngle")||this.isDirty("alignLabels")){this.markDirtyBounds();const t=this.get("startAngle",e.get("startAngle",-90)),i=this.get("endAngle",e.get("endAngle",270))-t;let s=t;const a=e.radius(this);this.setPrivateRaw("radius",a);let r=e.innerRadius(this)*e.getPrivate("irModifyer",1);r<0&&(r=a+r),v(this._dataItems,e=>{this.updateLegendValue(e);let t=i*e.get("valuePercentTotal")/100;const l=e.get("slice");if(l){l.set("radius",a),l.set("innerRadius",r),l.set("startAngle",s),l.set("arc",t);const i=e.get("fill");l._setDefault("fill",i),l._setDefault("stroke",i);const n=e.get("fillPattern");l._setDefault("fillPattern",n)}let n=c(s+t/2);const o=e.get("label");if(o&&(o.setPrivate("radius",a),o.setPrivate("innerRadius",r),o.set("labelAngle",n),"aligned"==o.get("textType"))){let e=a+o.get("radius",0),t=a*p(n);n>90&&n<=270?(o.isHidden()||o.isHiding()||this._lLabels.push({label:o,y:t}),e*=-1,e-=this.labelsContainer.get("paddingLeft",0),o.set("centerX",m),o.setPrivateRaw("left",!0)):(o.isHidden()||o.isHiding()||this._rLabels.push({label:o,y:t}),e+=this.labelsContainer.get("paddingRight",0),o.set("centerX",0),o.setPrivateRaw("left",!1)),o.set("x",e),o.set("y",a*p(n))}s+=t,this._updateTick(e)})}}}_updateTick(e){const t=e.get("tick"),i=e.get("label"),s=e.get("slice"),a=t.get("location",1);if(t&&i&&s){const e=(s.get("shiftRadius",0)+s.get("radius",0))*s.get("scale",1)*a,r=i.get("labelAngle",0),l=g(r),n=p(r),o=this.labelsContainer,h=o.get("paddingLeft",0),c=o.get("paddingRight",0);let u=0,d=0;u=i.x(),d=i.y();let y=[];if(0!=u||0!=d){if("circular"==i.get("textType")){const e=i.radius()-i.get("paddingBottom",0),t=i.get("labelAngle",0);u=e*g(t),d=e*p(t)}let t=-c;i.getPrivate("left")&&(t=h),y=[{x:s.x()+e*l,y:s.y()+e*n},{x:u+t,y:d},{x:u,y:d}]}t.set("points",y)}}_positionBullet(e){const t=e.get("sprite");if(t){const i=t.dataItem.get("slice");if(i){const s=i.get("innerRadius",0),a=i.get("radius",0),r=i.get("startAngle",0)+i.get("arc",0)*e.get("locationX",.5),l=s+(a-s)*e.get("locationY",.5);t.setAll({x:g(r)*l,y:p(r)*l})}}}}Object.defineProperty(ae,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieSeries"}),Object.defineProperty(ae,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:ie.classNames.concat([ae.className])});export{se as PieChartAm5,ae as PieSeriesAm5};
5
+ export{PieChart as PieChartAm5,PieSeries as PieSeriesAm5}from"@amcharts/amcharts5/percent.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{c as t,d as e,V as i}from"../../../chunks/LineSeries.js";export{A as AxisRendererXAm5,b as AxisRendererYAm5,L as LineSeriesAm5,X as XYChartAm5,a as XYCursorAm5}from"../../../chunks/LineSeries.js";import{i as s,v as o,P as n,q as r,k as l,m as h,f as g,s as d,t as c,u as m}from"../../../chunks/Theme.js";import{__awaiter as p}from"tslib";import{R as u}from"../../../chunks/Button.js";class x extends t{constructor(){super(...arguments),Object.defineProperty(this,"_ph",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_pw",{enumerable:!0,configurable:!0,writable:!0,value:0})}_makeGraphics(t,e){return this.makeColumn(e,t)}_makeFieldNames(){super._makeFieldNames();const t=this.get("xAxis"),e=this.get("yAxis"),i="CategoryAxis",s="ValueAxis";t.isType(i)&&(this.get("openCategoryXField")||(this._xOpenField=this._xField)),t.isType(s)&&(this.get("openValueXField")||(this._xOpenField=this._xField)),e.isType(i)&&(this.get("openCategoryYField")||(this._yOpenField=this._yField)),e.isType(s)&&(this.get("openValueYField")||(this._yOpenField=this._yField))}_prepareChildren(){super._prepareChildren();const t=this.get("xAxis"),e=this.get("yAxis"),i=this.dataItems.length,s=Math.max(0,this.startIndex()-2),a=Math.min(this.endIndex()+2,i-1);if(t.inited&&e.inited)for(let o=s;o<=a;o++){let t=this.dataItems[o];this._createGraphics(t)}}_updateChildren(){const t=this.chart;t&&(this._ph=t.plotContainer.height(),this._pw=t.plotContainer.width());const e=this.get("xAxis"),i=this.get("yAxis"),a=this.get("baseAxis"),o=this.columns.template;this.isDirty("fill")&&null==o.get("fill")&&o.set("fill",this.get("fill")),this.isDirty("fillPattern")&&null==o.get("fillPattern")&&o.set("fillPattern",this.get("fillPattern")),this.isDirty("stroke")&&null==o.get("stroke")&&o.set("stroke",this.get("stroke"));let n=0,r=0,l=0;s(a.series,t=>{if(t instanceof x){const e=t.get("stacked");e&&0==l&&r++,!e&&t.get("clustered")&&r++}t===this&&(n=r-1),l++}),this.get("clustered")||(n=0,r=1),0===r&&(r=1,n=0);const h=e.get("renderer"),g=i.get("renderer"),d="cellStartLocation",c="cellEndLocation",m=h.get(d,0),p=h.get(c,1),u=g.get(d,0),_=g.get(c,1);if(this._aLocationX0=m+n/r*(p-m),this._aLocationX1=m+(n+1)/r*(p-m),this._aLocationY0=u+n/r*(_-u),this._aLocationY1=u+(n+1)/r*(_-u),e.inited&&i.inited){if(this._axesDirty||this._valuesDirty||this._stackDirty||this.isDirty("vcx")||this.isDirty("vcy")||this._sizeDirty){const t=this.dataItems.length;let e=Math.max(0,this.startIndex()-2),i=Math.min(this.endIndex()+2,t-1);for(let a=0;a<e;a++)this._toggleColumn(this.dataItems[a],!1);let s=this.dataItems[e];for(let a=e;a<=i;a++){let t=this.dataItems[a];if(null!=t.get("valueX")&&null!=t.get("valueY")){if(s=t,a>0&&e>0)for(let t=a-1;t>=0;t--){let e=this.dataItems[t];if(null!=e.get("valueX")&&null!=e.get("valueY")){s=e;break}}break}this._toggleColumn(t,!1)}for(let a=e;a<=i;a++){let t=this.dataItems[a];this._updateGraphics(t,s),null!=t.get("valueX")&&null!=t.get("valueY")&&(s=t)}for(let a=i+1;a<t;a++)this._toggleColumn(this.dataItems[a],!1)}}else this._skipped=!0;this.getPrivate("doNotUpdateLegend")||this.updateLegendMarker(this.get("tooltipDataItem")),super._updateChildren()}_createGraphics(t){let e=t.get("graphics");if(!e){e=this._makeGraphics(this.columns,t),t.set("graphics",e),e._setDataItem(t);const i=t.get("legendDataItem");if(i){const t=i.get("markerRectangle");if(t){const i=t.states.lookup("default");s(o,s=>{const a=e.get(s,this.get(s));t.set(s,a),i.set(s,a)})}}let a=t.get("rangeGraphics");a&&s(a,t=>{t.dispose()}),a=[],t.setRaw("rangeGraphics",a),this.axisRanges.each(e=>{const i=e.container,s=this._makeGraphics(e.columns,t);a&&a.push(s),s.setPrivate("list",e.columns),i.children.push(s)})}}createAxisRange(t){return s(this.dataItems,t=>{const e=t.get("graphics");e&&(e.dispose(),t.set("graphics",void 0))}),super.createAxisRange(t)}_updateGraphics(t,e){let i=t.get("graphics");const a=this._xField,o=this._yField,l=t.get(a),h=t.get(o);if(null!=l&&null!=h){const l=this._xOpenField,h=this._yOpenField,g=this.get("locationX",t.get("locationX",.5)),d=this.get("locationY",t.get("locationY",.5)),c=this.get("openLocationX",t.get("openLocationX",g)),m=this.get("openLocationY",t.get("openLocationY",d)),p=i.get("width"),u=i.get("height"),x=this.get("stacked"),_=this.get("xAxis"),I=this.get("yAxis"),f=this.get("baseAxis"),y=_.get("start"),P=_.get("end"),b=I.get("start"),v=I.get("end");let D,T,C,w,A=this.get("vcy",1),k=this.get("vcx",1),F=!1,M=!1;if(I.isType("CategoryAxis")&&_.isType("CategoryAxis")){let e=this._aLocationX0+c-.5,i=this._aLocationX1+g-.5;if(p instanceof n){let t=(i-e)*(1-p.value)/2;e+=t,i-=t}if(D=_.getDataItemPositionX(t,l,e,k),T=_.getDataItemPositionX(t,a,i,k),e=this._aLocationY0+m-.5,i=this._aLocationY1+d-.5,u instanceof n){let t=(i-e)*(1-u.value)/2;e+=t,i-=t}C=I.getDataItemPositionY(t,h,e,A),w=I.getDataItemPositionY(t,o,i,A),t.setRaw("point",{x:D+(T-D)/2,y:C+(w-C)/2})}else if(_===f){let e=this._aLocationX0+c-.5,i=this._aLocationX1+g-.5;if(p instanceof n){let t=(i-e)*(1-p.value)/2;e+=t,i-=t}if(D=_.getDataItemPositionX(t,l,e,k),T=_.getDataItemPositionX(t,a,i,k),C=I.getDataItemPositionY(t,o,d,A),this._yOpenField!==this._yField)w=I.getDataItemPositionY(t,h,m,A);else if(x){let e=t.get("stackToItemY");w=e?I.getDataItemPositionY(e,o,m,e.component.get("vcy")):I.basePosition()}else w=I.basePosition();t.setRaw("point",{x:D+(T-D)/2,y:C}),M=!0}else if(I===f){let e=this._aLocationY0+m-.5,i=this._aLocationY1+d-.5;if(u instanceof n){let t=(i-e)*(1-u.value)/2;e+=t,i-=t}if(C=I.getDataItemPositionY(t,h,e,A),w=I.getDataItemPositionY(t,o,i,A),T=_.getDataItemPositionX(t,a,g,k),this._xOpenField!==this._xField)D=_.getDataItemPositionX(t,l,c,k);else if(x){let e=t.get("stackToItemX");D=e?_.getDataItemPositionX(e,a,c,e.component.get("vcx")):_.basePosition()}else D=_.basePosition();F=!0,t.setRaw("point",{x:T,y:C+(w-C)/2})}this._updateSeriesGraphics(t,i,D,T,C,w,F,M),D<y&&T<y||D>P&&T>P||C<b&&w<=b||C>=v&&w>v||r(D)||r(C)?this._toggleColumn(t,!1):this._toggleColumn(t,!0);let X=t.get("rangeGraphics");X&&s(X,e=>{this._updateSeriesGraphics(t,e,D,T,C,w,F,M)}),this._applyGraphicsStates(t,e)}else this._toggleColumn(t,!1)}_updateSeriesGraphics(t,e,i,s,a,o,n,r){const h=e.get("width"),g=e.get("height"),d=e.get("maxWidth"),c=e.get("maxHeight"),m=this.getPoint(i,a),p=this.getPoint(s,o),u=t.get("point");if(u){const t=this.getPoint(u.x,u.y);u.x=t.x+this._x,u.y=t.y+this._y}if(i=m.x,s=p.x,a=m.y,o=p.y,l(h)){const t=(s-i-h)/2;i+=t,s-=t}if(l(d)&&d<Math.abs(s-i)){const t=(s-i-d)/2;i+=t,s-=t}if(l(g)){const t=(o-a-g)/2;a+=t,o-=t}if(l(c)&&c<Math.abs(o-a)){const t=(o-a-c)/2;a+=t,o-=t}this.get("adjustBulletPosition")&&(n&&(s=Math.min(Math.max(0,s),this._pw),i=Math.min(Math.max(0,i),this._pw)),r&&(a=Math.min(Math.max(0,a),this._ph),o=Math.min(Math.max(0,o),this._ph))),t.setRaw("left",i),t.setRaw("right",s),t.setRaw("top",a),t.setRaw("bottom",o),e.setPrivate("width",s-i),e.setPrivate("height",o-a),e.set("x",i),e.set("y",o-(o-a))}_handleDataSetChange(){super._handleDataSetChange(),s(this._dataItems,t=>{this._toggleColumn(t,!1)})}_applyGraphicsStates(t,e){const i=t.get("graphics"),s=i.states.lookup("dropFromOpen"),a=i.states.lookup("riseFromOpen"),o=i.states.lookup("dropFromPrevious"),n=i.states.lookup("riseFromPrevious");if(s||o||a||n){const i=this.get("xAxis"),r=this.get("yAxis"),h=this.get("baseAxis");let g,d,c;h===i&&r.isType("ValueAxis")?(g=t.get(this._yOpenField),d=t.get(this._yField),c=e.get(this._yField)):h===r&&i.isType("ValueAxis")&&(g=t.get(this._xOpenField),d=t.get(this._xField),c=e.get(this._xField)),l(g)&&l(d)&&(d<g?s&&s.apply():a&&a.apply(),l(c)&&(d<c?o&&o.apply():n&&n.apply()))}}disposeDataItem(t){super.disposeDataItem(t);const e=t.get("graphics");e&&(this.columns.removeValue(e),e.dispose());const i=t.get("rangeGraphics");i&&s(i,t=>{const e=t.getPrivate("list");e&&e.removeValue(t),t.dispose()})}hideDataItem(t,e){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return p(this,void 0,void 0,function*(){const a=[i.hideDataItem.call(this,t,e)],o=t.get("graphics");o&&a.push(o.hide(e));const n=t.get("rangeGraphics");n&&s(n,t=>{a.push(t.hide(e))}),yield Promise.all(a)})}_toggleColumn(t,e){const i=t.get("graphics");i&&i.setPrivate("visible",e);const a=t.get("rangeGraphics");a&&s(a,t=>{t.setPrivate("visible",e)});const o=t.bullets;o&&s(o,t=>{t.setPrivate("hidden",!e)})}showDataItem(t,e){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return p(this,void 0,void 0,function*(){const a=[i.showDataItem.call(this,t,e)],o=t.get("graphics");o&&a.push(o.show(e));const n=t.get("rangeGraphics");n&&s(n,t=>{a.push(t.show(e))}),yield Promise.all(a)})}updateLegendMarker(t){let e=this.get("legendDataItem");if(this.get("useLastColorForLegendMarker")&&!t){const e=this.dataItems[this.endIndex()-1];e&&(t=e)}if(e){let i=this.columns.template;if(t){let e=t.get("graphics");e&&(i=e)}const a=e.get("markerRectangle");if(a&&!e.get("itemContainer").get("disabled")){const t=a.states.lookup("default");s(o,e=>{const s=i.get(e,this.get(e));a.set(e,s),t.set(e,s)})}}}_getTooltipTarget(t){if("bullet"==this.get("seriesTooltipTarget"))return super._getTooltipTarget(t);let e=t.get("graphics");return e||this}}Object.defineProperty(x,"className",{enumerable:!0,configurable:!0,writable:!0,value:"BaseColumnSeries"}),Object.defineProperty(x,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:t.classNames.concat([x.className])});class _ extends e{constructor(){super(...arguments),Object.defineProperty(this,"_frequency",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_itemMap",{enumerable:!0,configurable:!0,writable:!0,value:{}})}_afterNew(){this._settings.themeTags=h(this._settings.themeTags,["axis"]),this.fields.push("category"),this.setPrivateRaw("name","category"),this.addTag("category"),super._afterNew()}_prepareChildren(){super._prepareChildren();const t=this.dataItems.length;let e=0;this._valuesDirty&&(this._itemMap={},s(this.dataItems,t=>{t.setRaw("index",e),this._itemMap[t.get("category")]=t,e++}),this.setPrivateRaw("maxZoomFactor",t)),this.setPrivateRaw("startIndex",Math.max(Math.round(this.get("start",0)*t),0)),this.setPrivateRaw("endIndex",Math.min(Math.round(this.get("end",1)*t),t)),(this._sizeDirty||this._valuesDirty||this.isDirty("start")||this.isDirty("end")||this.isPrivateDirty("endIndex")||this.isPrivateDirty("startIndex")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&this.dataItems.length>0&&(this._handleRangeChange(),this._prepareAxisItems(),this._updateAxisRanges())}_handleRangeChange(){s(this.series,t=>{let e=this.dataItems[this.startIndex()].get("category"),a=this.dataItems[this.endIndex()-1].get("category"),o=t.get("baseAxis"),n=t.get("xAxis"),r=t.get("yAxis");if(n instanceof _&&r instanceof _)t._markDirtyAxes();else if(o===this){let l,h,g=r;if(n===o?(t.get("categoryXField")&&(l="categoryX"),t.get("openCategoryXField")&&(h="openCategoryX")):r===o&&(t.get("categoryYField")&&(l="categoryY"),t.get("openCategoryYField")&&(h="openCategoryY"),g=n),g instanceof i&&(l||h)){let i,o;for(let s=0,a=t.dataItems.length;s<a;s++){let a=t.dataItems[s];if(l&&a.get(l)===e){i=a;break}if(h&&a.get(h)===e){i=a;break}}for(let e=t.dataItems.length-1;e>=0;e--){let i=t.dataItems[e];if(l&&i.get(l)===a){o=i;break}if(h&&i.get(h)===a){o=i;break}}let n=0,r=t.dataItems.length;i&&(n=t.dataItems.indexOf(i)),o&&(r=t.dataItems.indexOf(o)+1),t.setPrivate("startIndex",n),t.setPrivate("endIndex",r);let g=!1;for(let e=n;e<r;e++){const i=t.dataItems[e];if(s(t.__valueXShowFields,t=>{null!=i.get(t)&&(g=!0)}),s(t.__valueYShowFields,t=>{null!=i.get(t)&&(g=!0)}),g)break}t.setPrivate("outOfSelection",!g)}t._markDirtyAxes()}})}_prepareAxisItems(){var t;const e=this.get("renderer"),i=this.dataItems.length;let s=this.startIndex();s>0&&s--;let a=this.endIndex();a<i&&a++;const o=e.get("minorLabelsEnabled"),n=e.get("minorGridEnabled",o);let r=e.axisLength()/Math.max(e.get("minGridDistance"),1),l=Math.max(1,Math.min(i,Math.ceil((a-s)/r)));s=Math.floor(s/l)*l,this._frequency=l;for(let g=0;g<i;g++)this._toggleDataItem(this.dataItems[g],!1);let h=this.dataItems[s].get("index",0);for(let g=s;g<a;g+=l){let t=this.dataItems[g];this._createAssets(t,[]),this._toggleDataItem(t,!0);let e=l;n&&(e=1),this._prepareDataItem(t,h,e),h++}if(e.get("minorGridEnabled"))for(let g=s;g<a;g++){let e=this.dataItems[g];g%l!=0&&(this._createAssets(e,["minor"],!0),this._toggleDataItem(e,!0),this._prepareDataItem(e,0,1),o||null===(t=e.get("label"))||void 0===t||t.setPrivate("visible",!1))}this._updateGhost()}_prepareDataItem(t,e,i){let s=this.get("renderer"),a=t.get("categoryLocation",0),o=t.get("endCategoryLocation",1),n=t.get("index");l(n)||(n=this.categoryToIndex(t.get("category")));let r,h=this.indexToPosition(n,a),g=t.get("endCategory");g?(r=this.categoryToIndex(g),l(r)||(r=n)):r=n;let d,c,m=this.indexToPosition(r,o);d=t.get("isRange")?r:n+this._frequency-1,c=this.indexToPosition(d,o),s.updateLabel(t.get("label"),h,m,i),s.updateGrid(t.get("grid"),h,m),s.updateTick(t.get("tick"),h,m,i),s.updateFill(t.get("axisFill"),h,c),this._processBullet(t),s.updateBullet(t.get("bullet"),h,m);const p=this.get("fillRule");p&&p(t,e)}startIndex(){let t=this.dataItems.length;return Math.min(Math.max(this.getPrivate("startIndex",0),0),t-1)}endIndex(){let t=this.dataItems.length;return Math.max(1,Math.min(this.getPrivate("endIndex",t),t))}baseValue(){}basePosition(){return 0}getX(t){let e=this._itemMap[t];return e?this._settings.renderer.positionToCoordinate(this.indexToPosition(e.get("index",0))):NaN}getY(t){let e=this._itemMap[t];return e?this._settings.renderer.positionToCoordinate(this.indexToPosition(e.get("index",0))):NaN}getDataItemPositionX(t,e,i,s){const a=t.get(e),o=this._itemMap[a];return o?this.indexToPosition(o.get("index",0),i):NaN}getDataItemCoordinateX(t,e,i,s){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionX(t,e,i,s))}getDataItemPositionY(t,e,i,s){const a=t.get(e),o=this._itemMap[a];return o?this.indexToPosition(o.get("index",0),i):NaN}getDataItemCoordinateY(t,e,i,s){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionY(t,e,i,s))}indexToPosition(t,e){l(e)||(e=.5);let i=this.dataItems.length,s=this.get("startLocation",0);i-=s,i-=1-this.get("endLocation",1);let a=(t+e-s)/i,o=this.dataItems[t];return o&&(a+=o.get("deltaPosition",0)),a}categoryToPosition(t){let e=this._itemMap[t];return e?this.indexToPosition(e.get("index")):NaN}categoryToIndex(t){let e=this._itemMap[t];return e?e.get("index"):NaN}dataItemToPosition(t){return this.indexToPosition(t.get("index"))}roundAxisPosition(t,e){return t+=(.5-e)/this.dataItems.length,this.indexToPosition(this.axisPositionToIndex(t),e)}axisPositionToIndex(t){let e=this.dataItems.length;return g(Math.floor(t*e),0,e-1)}getTooltipText(t,e){const i=this.dataItems[this.axisPositionToIndex(t)];if(i){const t=i.get("label");if(t)return d(t,this.get("tooltipText",""))}}_updateTooltipText(t,e){t._setDataItem(this.dataItems[this.axisPositionToIndex(e)]),t.label.text.markDirtyText()}getSeriesItem(t,e){if(this.dataItems.length>0){let i=this.getPrivate("name")+this.get("renderer").getPrivate("letter"),s=this.axisPositionToIndex(e),a=t.dataItems[s],o=this.dataItems[s],n=o.get("category");if(a&&o&&a.get(i)===n)return a;for(let e=0,r=t.dataItems.length;e<r;e++){let s=t.dataItems[e];if(s.get(i)===n)return s}}}zoomToIndexes(t,e,i){let s=this.dataItems.length;this.zoom(t/s,e/s,i)}zoomToCategories(t,e,i){this.zoomToIndexes(this.categoryToIndex(t),this.categoryToIndex(e)+1,i)}getCellWidthPosition(){return this._frequency/this.dataItems.length/(this.get("end",1)-this.get("start",0))}nextPosition(t){null==t&&(t=1),"Y"==this.get("renderer").getPrivate("letter")&&(t*=-1);const e=this.getPrivate("tooltipPosition",0),i=g(this.axisPositionToIndex(e)+t,0,this.dataItems.length-1);return this.toGlobalPosition(this.indexToPosition(i))}}Object.defineProperty(_,"className",{enumerable:!0,configurable:!0,writable:!0,value:"CategoryAxis"}),Object.defineProperty(_,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:e.classNames.concat([_.className])});class I extends x{constructor(){super(...arguments),Object.defineProperty(this,"columns",{enumerable:!0,configurable:!0,writable:!0,value:this.addDisposer(new c(m.new({}),()=>u._new(this._root,{position:"absolute",themeTags:h(this.columns.template.get("themeTags",[]),["series","column"])},[this.columns.template])))})}makeColumn(t,e){const i=this.mainContainer.children.push(e.make());return i._setDataItem(t),e.push(i),i}_processAxisRange(t){super._processAxisRange(t),t.columns=new c(m.new({}),()=>u._new(this._root,{position:"absolute",themeTags:h(t.columns.template.get("themeTags",[]),["series","column"])},[this.columns.template,t.columns.template]))}}Object.defineProperty(I,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColumnSeries"}),Object.defineProperty(I,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:x.classNames.concat([I.className])});export{_ as CategoryAxisAm5,I as ColumnSeriesAm5,i as ValueAxisAm5};
5
+ export{AxisRendererX as AxisRendererXAm5,AxisRendererY as AxisRendererYAm5,CategoryAxis as CategoryAxisAm5,ColumnSeries as ColumnSeriesAm5,LineSeries as LineSeriesAm5,ValueAxis as ValueAxisAm5,XYChart as XYChartAm5,XYCursor as XYCursorAm5}from"@amcharts/amcharts5/xy.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../intl.js";import{prefersReducedMotion as t}from"../../core/a11yUtils.js";import{watch as i,initial as a}from"../../core/reactiveUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{getColorsFromRenderer as s}from"../../renderers/support/utils.js";import n from"../Widget.js";import l from"./FeatureMedia/FeatureMediaViewModel.js";import d from"./support/FeatureElementInfo.js";import{shouldOpenInNewTab as m}from"./support/featureUtils.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import{isRTL as h}from"../support/widgetUtils.js";import{messageBundle as p}from"../support/decorators/messageBundle.js";import{tsx as u}from"../support/jsxFactory.js";import{isDarkMode as f}from"../../support/modeUtils.js";import{substitute as g}from"../../intl/substitute.js";const M="esri-feature-media",_={base:M,mediaContainer:`${M}__container`,mediaItemContainer:`${M}__item-container`,mediaItem:`${M}__item`,mediaItemText:`${M}__item-text`,mediaItemTitle:`${M}__item-title`,mediaItemCaption:`${M}__item-caption`,mediaNavigation:`${M}__item-navigation`,mediaPagination:`${M}__pagination`,mediaPaginationText:`${M}__pagination-text`,mediaChart:`${M}__chart`,mediaPaginationButton:`${M}__pagination-button`,mediaPaginationIcon:`${M}__pagination-icon`,mediaChartRendered:`${M}__chart--rendered`},v=15,w="category",A="value",I="rgba(50, 50, 50, 1)",C=250,y=500,x=200;let T=class extends n{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new l,this.messages=null,this._disposeChart=e=>{this._chartRootMap.get(e)?.dispose(),this._chartRootMap.delete(e)},this._createChart=async e=>{const{destroyed:t,viewModel:i}=this;if(t||!i||!e)return;const{createRoot:a}=await import("../support/chartUtilsAm5.js"),r=await a(e);this._chartRootMap.set(e,r),await this._renderChart({mediaInfo:i.activeMediaInfo,root:r})}}initialize(){this._featureElementInfo=new d,this.addHandles([i(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),a),i(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),a)])}loadDependencies(){return c({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{bind:this,class:_.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this._renderMediaText();return e?u("div",{class:_.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:_.mediaNavigation},i,e>1?u("div",{class:_.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:_.mediaPaginationText},g(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:_.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,i=e&&e.caption?u("div",{class:_.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||i?u("div",{class:_.mediaItemText,key:"media-text"},t,i):null}_renderImageMediaInfo(e){if(!e.value)return null;const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:a}=this.viewModel,{value:r,refreshInterval:o,altText:s,title:n,type:l}=e,{sourceURL:d,linkURL:c}=r,h=m(c??void 0)?"_blank":"_self",p="_blank"===h?"noreferrer":"",f=o?t:null,g=f?f.timestamp:0,M=f?f.sourceURL:d,_=u("img",{alt:s||n,key:`media-${l}-${i}-${a}-${g}`,src:M??void 0});return(c?u("a",{href:c,rel:p,target:h,title:n},_):null)??_}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:_.mediaChart,key:`media-${e.type}-${t}-${i}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?"image"===e.type?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?u("div",{class:_.mediaItemContainer,key:"media-container"},u("div",{class:_.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t="previous"===e,i=t?this.messages.previous:this.messages.next,a=t?"chevron-left":"chevron-right",r=t?"media-previous":"media-next",o=t?this._previous:this._next;return u("button",{"aria-label":i,bind:this,class:_.mediaPaginationButton,key:r,onclick:o,tabIndex:0,title:i,type:"button"},u("calcite-icon",{class:_.mediaPaginationIcon,icon:a,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await import("./FeatureMedia/chartCommon.js"),i=new Map;return e.forEach(e=>{e.color&&i.set(e,t(e.color.toCss(!0)))}),i}async _getRendererColors(){const{colorAm5:e}=await import("./FeatureMedia/chartCommon.js"),t=new Map,i=this._getRenderer(),a="default";if(!i)return t;const r=await s(i);r.delete(a);return Array.from(r.values()).every(e=>1===e?.length)?(Array.from(r.keys()).forEach(i=>{const a=r.get(i)?.[0]?.toCss(!0);a&&t.set(i,e(a))}),t):t}_handleMediaKeyup(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this.viewModel.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&(!!this.viewModel.abilities.chartAnimation&&!t())}_getChartAnimationMS(){return this._canAnimateChart()?C:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?y:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:a,type:r}=i,{ResponsiveThemeAm5:o,DarkThemeAm5:s,AnimatedThemeAm5:n,ColorSetAm5:l,ThemeAm5:d,esriChartColorSet:m}=await import("./FeatureMedia/chartCommon.js"),c=d.new(t);c.rule("ColorSet").set("colors",m),c.rule("ColorSet").set("reuse",!0);const h=[o.new(t),c];f(this.container)&&h.push(s.new(t)),this._canAnimateChart()&&h.push(n.new(t)),t.setThemes(h);const p=await this._getRendererColors(),u=await this._getSeriesColors(a.series),g=l.new(t,{}),M=u.get(a.series[0]),_=M?{lineSettings:{stroke:M}}:void 0,v=a.series.map((e,t)=>{const i=u.get(e)||p.get(e.fieldName)||g.getIndex(t);return{[w]:e.tooltip,[A]:e.value,columnSettings:{fill:i,stroke:i},..._}}).filter(e=>"pie-chart"!==r||null!=e.value&&e.value>0);await("pie-chart"===r?this._createPieChart(e,v):this._createXYChart(e,v))}_getDirection(){return h(this.container)?"rtl":"ltr"}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await import("./FeatureMedia/chartCommon.js");e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(I)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:x})}async _createPieChart(e,t){const{TooltipAm5:i}=await import("./FeatureMedia/chartCommon.js"),{PieChartAm5:a,PieSeriesAm5:r}=await import("./FeatureMedia/pieChart.js"),{mediaInfo:o,root:s}=e,{title:n}=o,l=5,d=o?.altText||o?.title||"",m=s.container.children.push(a.new(s,{ariaLabel:d,focusable:!0,paddingBottom:l,paddingTop:l,paddingLeft:l,paddingRight:l})),c="{category}: {valuePercentTotal.formatNumber('0.00')}%\n ({value})",h=i.new(s,{labelText:c}),p=m.series.push(r.new(s,{name:n,valueField:A,categoryField:w,tooltip:h}));p.ticks.template.set("forceHidden",!0),p.labels.template.set("forceHidden",!0),p.slices.template.states.create("active",{shiftRadius:l}),await this._customizeChartTooltip(h),p.slices.template.setAll({ariaLabel:c,focusable:!0,templateField:"columnSettings"}),p.data.setAll(t),await p.appear(this._getChartSeriesAnimationMS()),await m.appear(this._getChartAnimationMS()),m.root.dom.classList.toggle(_.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(e=>t=Math.min(e.value,t)),t}async _createColumnChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:p,title:u}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(c,{renderer:s.new(c,{inversed:h(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.yAxes.push(n.new(c,{renderer:l.new(c,{inside:!1}),min:this._getMinSeriesValue(p.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryX}",_=a.new(c,{labelText:M}),I=e.series.push(d.new(c,{name:u,xAxis:f,yAxis:g,valueYField:A,categoryXField:w,tooltip:_}));await this._customizeChartTooltip(_),I.columns.template.setAll({ariaLabel:M,focusable:!0,templateField:"columnSettings"}),p.series.length>v&&e.set("scrollbarX",r.new(c,{orientation:"horizontal"})),f.data.setAll(i),I.data.setAll(i),await I.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:p,title:u}=m;e.setAll({wheelX:"panY",wheelY:"zoomY"});const f=e.yAxes.push(o.new(c,{renderer:l.new(c,{inversed:!0}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.xAxes.push(n.new(c,{renderer:s.new(c,{inside:!1,inversed:h(this.container)}),min:this._getMinSeriesValue(p.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryY}",_=a.new(c,{labelText:M}),I=e.series.push(d.new(c,{name:u,xAxis:g,yAxis:f,valueXField:A,categoryYField:w,tooltip:_}));await this._customizeChartTooltip(_,"vertical"),I.columns.template.setAll({ariaLabel:M,focusable:!0,templateField:"columnSettings"}),p.series.length>v&&e.set("scrollbarY",r.new(c,{orientation:"vertical"})),f.data.setAll(i),I.data.setAll(i),await I.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,LineSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{root:m,mediaInfo:c}=t,{value:p,title:u}=c;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(m,{renderer:s.new(m,{inversed:h(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.yAxes.push(n.new(m,{renderer:l.new(m,{inside:!1}),min:this._getMinSeriesValue(p.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryX}",_=i[0]?.lineSettings?.stroke,I=a.new(m,{getFillFromSprite:!_,labelText:M});_&&I.get("background")?.setAll({fill:_});const C=e.series.push(d.new(m,{name:u,xAxis:f,yAxis:g,valueYField:A,categoryXField:w,tooltip:I}));C.strokes.template.setAll({templateField:"lineSettings"}),await this._customizeChartTooltip(I,"vertical"),p.series.length>v&&e.set("scrollbarX",r.new(m,{orientation:"horizontal"})),f.data.setAll(i),C.data.setAll(i),await C.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:a}=await import("./FeatureMedia/xyChart.js"),{root:r,mediaInfo:o}=e,{type:s}=o,n=o?.altText||o?.title||"",l=r.container.children.push(i.new(r,{ariaLabel:n,focusable:!0,panX:!0,panY:!0}));l.set("cursor",a.new(r,{})),"column-chart"===s&&await this._createColumnChart(l,e,t),"bar-chart"===s&&await this._createBarChart(l,e,t),"line-chart"===s&&await this._createLineChart(l,e,t),l.root.dom.classList.toggle(_.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;"image"===e?.type&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e,a=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const r=setInterval(()=>{this._updateMediaInfoTimestamp(i.sourceURL)},a);this._refreshTimer=r}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[a,r=""]=e.split("#");return`${a}${i}timestamp=${t}${r?"#":""}${r}`}};e([r()],T.prototype,"_refreshIntervalInfo",void 0),e([r()],T.prototype,"attributes",null),e([r()],T.prototype,"activeMediaInfoIndex",null),e([r()],T.prototype,"description",null),e([r()],T.prototype,"fieldInfoMap",null),e([r()],T.prototype,"layer",null),e([r()],T.prototype,"mediaInfos",null),e([r()],T.prototype,"popupTemplate",null),e([r()],T.prototype,"relatedInfos",null),e([r()],T.prototype,"title",null),e([r({type:l})],T.prototype,"viewModel",void 0),e([r(),p("esri/widgets/Feature/t9n/Feature")],T.prototype,"messages",void 0),T=e([o("esri.widgets.Feature.FeatureMedia")],T);export{T as default};
5
+ import{__decorate as e}from"tslib";import"../../intl.js";import{prefersReducedMotion as t}from"../../core/a11yUtils.js";import{watch as i,initial as a}from"../../core/reactiveUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{getColorsFromRenderer as s}from"../../renderers/support/utils.js";import n from"../Widget.js";import l from"./FeatureMedia/FeatureMediaViewModel.js";import d from"./support/FeatureElementInfo.js";import{shouldOpenInNewTab as m}from"./support/featureUtils.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import{isRTL as p}from"../support/widgetUtils.js";import{messageBundle as h}from"../support/decorators/messageBundle.js";import{tsx as u}from"../support/jsxFactory.js";import{isDarkMode as f}from"../../support/modeUtils.js";import{substitute as g}from"../../intl/substitute.js";const M="esri-feature-media",_={base:M,mediaContainer:`${M}__container`,mediaItemContainer:`${M}__item-container`,mediaItem:`${M}__item`,mediaItemText:`${M}__item-text`,mediaItemTitle:`${M}__item-title`,mediaItemCaption:`${M}__item-caption`,mediaNavigation:`${M}__item-navigation`,mediaPagination:`${M}__pagination`,mediaPaginationText:`${M}__pagination-text`,mediaChart:`${M}__chart`,mediaPaginationButton:`${M}__pagination-button`,mediaPaginationIcon:`${M}__pagination-icon`,mediaChartRendered:`${M}__chart--rendered`},v=15,w="category",A="value",I="rgba(50, 50, 50, 1)",y=250,C=500,x=200;let T=class extends n{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.view=null,this.viewModel=new l,this.messages=null,this._disposeChart=e=>{this._chartRootMap.get(e)?.dispose(),this._chartRootMap.delete(e)},this._createChart=async e=>{const{destroyed:t,viewModel:i}=this;if(t||!i||!e)return;const{createRoot:a}=await import("../support/chartUtilsAm5.js"),r=await a(e);this._chartRootMap.set(e,r),await this._renderChart({mediaInfo:i.activeMediaInfo,root:r})}}initialize(){this._featureElementInfo=new d,this.addHandles([i(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),a),i(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),a)])}loadDependencies(){return c({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{bind:this,class:_.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this._renderMediaText();return e?u("div",{class:_.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:_.mediaNavigation},i,e>1?u("div",{class:_.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:_.mediaPaginationText},g(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:_.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,i=e&&e.caption?u("div",{class:_.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||i?u("div",{class:_.mediaItemText,key:"media-text"},t,i):null}_renderImageMediaInfo(e){if(!e.value)return null;const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:a}=this.viewModel,{value:r,refreshInterval:o,altText:s,title:n,type:l}=e,{sourceURL:d,linkURL:c}=r,p=m(c??void 0)?"_blank":"_self",h="_blank"===p?"noreferrer":"",f=o?t:null,g=f?f.timestamp:0,M=f?f.sourceURL:d,_=u("img",{alt:s||n,key:`media-${l}-${i}-${a}-${g}`,src:M??void 0});return(c?u("a",{href:c,rel:h,target:p,title:n},_):null)??_}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:_.mediaChart,key:`media-${e.type}-${t}-${i}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?"image"===e.type?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?u("div",{class:_.mediaItemContainer,key:"media-container"},u("div",{class:_.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t="previous"===e,i=t?this.messages.previous:this.messages.next,a=t?"chevron-left":"chevron-right",r=t?"media-previous":"media-next",o=t?this._previous:this._next;return u("button",{"aria-label":i,bind:this,class:_.mediaPaginationButton,key:r,onclick:o,tabIndex:0,title:i,type:"button"},u("calcite-icon",{class:_.mediaPaginationIcon,icon:a,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await import("./FeatureMedia/chartCommon.js"),i=new Map;return e.forEach(e=>{e.color&&i.set(e,t(e.color.toCss(!0)))}),i}async _getRendererColors(){const{colorAm5:e}=await import("./FeatureMedia/chartCommon.js"),t=new Map,i=this._getRenderer(),a="default";if(!i)return t;const r=await s(i);r.delete(a);return Array.from(r.values()).every(e=>1===e?.length)?(Array.from(r.keys()).forEach(i=>{const a=r.get(i)?.[0]?.toCss(!0);a&&t.set(i,e(a))}),t):t}_handleMediaKeyup(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this.viewModel.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&(!!this.viewModel.abilities.chartAnimation&&!t())}_getChartAnimationMS(){return this._canAnimateChart()?y:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?C:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:a,type:r}=i,{ResponsiveThemeAm5:o,DarkThemeAm5:s,AnimatedThemeAm5:n,ColorSetAm5:l,ThemeAm5:d,esriChartColorSet:m}=await import("./FeatureMedia/chartCommon.js"),c=d.new(t);c.rule("ColorSet").set("colors",m),c.rule("ColorSet").set("reuse",!0);const p=[o.new(t),c];f(this.container)&&p.push(s.new(t)),this._canAnimateChart()&&p.push(n.new(t)),t.setThemes(p);const h=await this._getRendererColors(),u=await this._getSeriesColors(a.series),g=l.new(t,{}),M=u.get(a.series[0]),_=M?{lineSettings:{stroke:M}}:void 0,v=a.series.map((e,t)=>{const i=u.get(e)||h.get(e.fieldName)||g.getIndex(t);return{[w]:e.tooltip,[A]:e.value,columnSettings:{fill:i,stroke:i},..._}}).filter(e=>"pie-chart"!==r||null!=e.value&&e.value>0);await("pie-chart"===r?this._createPieChart(e,v):this._createXYChart(e,v))}_getDirection(){return p(this.container)?"rtl":"ltr"}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await import("./FeatureMedia/chartCommon.js");e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(I)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:x})}async _createPieChart(e,t){const{TooltipAm5:i}=await import("./FeatureMedia/chartCommon.js"),{PieChartAm5:a,PieSeriesAm5:r}=await import("./FeatureMedia/pieChart.js"),{mediaInfo:o,root:s}=e,{title:n}=o,l=5,d=o?.altText||o?.title||"",m=s.container.children.push(a.new(s,{ariaLabel:d,focusable:!0,paddingBottom:l,paddingTop:l,paddingLeft:l,paddingRight:l})),c="{category}: {valuePercentTotal.formatNumber('0.00')}%\n ({value})",p=i.new(s,{labelText:c}),h=m.series.push(r.new(s,{name:n,valueField:A,categoryField:w,tooltip:p}));h.ticks.template.set("forceHidden",!0),h.labels.template.set("forceHidden",!0),h.slices.template.states.create("active",{shiftRadius:l}),await this._customizeChartTooltip(p),h.slices.template.setAll({ariaLabel:c,focusable:!0,templateField:"columnSettings"}),h.data.setAll(t),await h.appear(this._getChartSeriesAnimationMS()),await m.appear(this._getChartAnimationMS()),m.root.dom.classList.toggle(_.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(e=>t=Math.min(e.value,t)),t}async _createColumnChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:h,title:u}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(c,{renderer:s.new(c,{inversed:p(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.yAxes.push(n.new(c,{renderer:l.new(c,{inside:!1}),min:this._getMinSeriesValue(h.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryX}",_=a.new(c,{labelText:M}),I=e.series.push(d.new(c,{name:u,xAxis:f,yAxis:g,valueYField:A,categoryXField:w,tooltip:_}));await this._customizeChartTooltip(_),I.columns.template.setAll({ariaLabel:M,focusable:!0,templateField:"columnSettings"}),h.series.length>v&&e.set("scrollbarX",r.new(c,{orientation:"horizontal"})),f.data.setAll(i),I.data.setAll(i),await I.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:h,title:u}=m;e.setAll({wheelX:"panY",wheelY:"zoomY"});const f=e.yAxes.push(o.new(c,{renderer:l.new(c,{inversed:!0}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.xAxes.push(n.new(c,{renderer:s.new(c,{inside:!1,inversed:p(this.container)}),min:this._getMinSeriesValue(h.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryY}",_=a.new(c,{labelText:M}),I=e.series.push(d.new(c,{name:u,xAxis:g,yAxis:f,valueXField:A,categoryYField:w,tooltip:_}));await this._customizeChartTooltip(_,"vertical"),I.columns.template.setAll({ariaLabel:M,focusable:!0,templateField:"columnSettings"}),h.series.length>v&&e.set("scrollbarY",r.new(c,{orientation:"vertical"})),f.data.setAll(i),I.data.setAll(i),await I.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,LineSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{root:m,mediaInfo:c}=t,{value:h,title:u}=c;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(m,{renderer:s.new(m,{inversed:p(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.yAxes.push(n.new(m,{renderer:l.new(m,{inside:!1}),min:this._getMinSeriesValue(h.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryX}",_=i[0]?.lineSettings?.stroke,I=a.new(m,{getFillFromSprite:!_,labelText:M});_&&I.get("background")?.setAll({fill:_});const y=e.series.push(d.new(m,{name:u,xAxis:f,yAxis:g,valueYField:A,categoryXField:w,tooltip:I}));y.strokes.template.setAll({templateField:"lineSettings"}),await this._customizeChartTooltip(I,"vertical"),h.series.length>v&&e.set("scrollbarX",r.new(m,{orientation:"horizontal"})),f.data.setAll(i),y.data.setAll(i),await y.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:a}=await import("./FeatureMedia/xyChart.js"),{root:r,mediaInfo:o}=e,{type:s}=o,n=o?.altText||o?.title||"",l=r.container.children.push(i.new(r,{ariaLabel:n,focusable:!0,panX:!0,panY:!0}));l.set("cursor",a.new(r,{})),"column-chart"===s&&await this._createColumnChart(l,e,t),"bar-chart"===s&&await this._createBarChart(l,e,t),"line-chart"===s&&await this._createLineChart(l,e,t),l.root.dom.classList.toggle(_.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;"image"===e?.type&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e,a=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const r=setInterval(()=>{this._updateMediaInfoTimestamp(i.sourceURL)},a);this._refreshTimer=r}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[a,r=""]=e.split("#");return`${a}${i}timestamp=${t}${r?"#":""}${r}`}};e([r()],T.prototype,"_refreshIntervalInfo",void 0),e([r()],T.prototype,"attributes",null),e([r()],T.prototype,"activeMediaInfoIndex",null),e([r()],T.prototype,"description",null),e([r()],T.prototype,"fieldInfoMap",null),e([r()],T.prototype,"layer",null),e([r()],T.prototype,"mediaInfos",null),e([r()],T.prototype,"popupTemplate",null),e([r()],T.prototype,"relatedInfos",null),e([r()],T.prototype,"title",null),e([r({type:l})],T.prototype,"view",void 0),e([r({type:l})],T.prototype,"viewModel",void 0),e([r(),h("esri/widgets/Feature/t9n/Feature")],T.prototype,"messages",void 0),T=e([o("esri.widgets.Feature.FeatureMedia")],T);export{T 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{FeatureSetQueryInterceptor as i}from"../../arcade/featureset/support/FeatureSetQueryInterceptor.js";import s from"../../core/Accessor.js";import{isSome as o}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import{IdentifiableMixin as n}from"../../core/Identifiable.js";import l from"../../core/Logger.js";import{abortMaybe as p}from"../../core/maybe.js";import{eachAlways as c,isAbortError as d,throwIfAborted as h}from"../../core/promiseUtils.js";import{watch as u,when as f,initial as m,on as _}from"../../core/reactiveUtils.js";import{throttle as y}from"../../core/throttle.js";import{property as g}from"../../core/accessorSupport/decorators/property.js";import{cast as b}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import{subclass as v}from"../../core/accessorSupport/decorators/subclass.js";import w from"../../geometry/Point.js";import A from"../../geometry/SpatialReference.js";import I from"../../popup/content/TextContent.js";import{system as x}from"../../time/constants.js";import M from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import T from"./FeatureContent/FeatureContentViewModel.js";import F from"./FeatureExpression/FeatureExpressionViewModel.js";import E from"./FeatureFields/FeatureFieldsViewModel.js";import C from"./FeatureMedia/FeatureMediaViewModel.js";import V from"./FeatureRelationship/FeatureRelationshipViewModel.js";import{compileExpressionInfos as j,formatArcadeValue as k}from"./support/arcadeFeatureUtils.js";import{preLayerQueryCallback as P,preRequestCallback as R,createFieldInfoMap as L,getAllFieldInfos as O,getSourceLayer as N,querySourceLayer as U,queryUpdatedFeature as Z,isRelatableFeatureSupportedLayer as S,isAssociatedFeatureSupportedLayer as B,substituteFieldsInLinksAndAttributes as H,isExpressionField as D,isRelatedField as G,formatEditInfo as q,graphicCallback as z,formatAttributes as Q}from"./support/featureUtils.js";import{queryLayerInfos as J,queryRelatedFeatures as K,setRelatedFeatures as W,getRelatedFieldInfo as X,createRelatedInfo as Y,updateRelatedInfo as $}from"./support/relatedFeatureUtils.js";import ee from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";var te;const ie=1,se="content-view-models",oe="relationship-view-models",re="association-view-models",ae={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let ne=class extends(n(s)){static{te=this}constructor(e){super(e),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._associationVMAbortController=null,this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...ae},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._graphicChangedThrottled=y(this._graphicChanged,()=>this.notifyChange("waitingForContent"),ie,this),this._isAllowedContentType=e=>{const{abilities:t}=this;return"attachments"===e.type&&!!t.attachmentsContent||"custom"===e.type&&!!t.customContent||"fields"===e.type&&!!t.fieldsContent||"media"===e.type&&!!t.mediaContent||"text"===e.type&&!!t.textContent||"expression"===e.type&&!!t.expressionContent||"relationship"===e.type&&!!t.relationshipContent||"utility-network-associations"===e.type&&!!t.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=y(this._evaluateExpressionAttributes,()=>this.notifyChange("waitingForContent"),ie,this),this.addHandles([u(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),m),f(()=>{if(!this._graphicChangedTask?.finished||null==this._graphicChangedTask.value)return null;const e=this._graphicChangedTask.value,t=e?.expressionInfos?.dependencies;return[e,t?.has("view-scale")?this.view?.scale:null,t?.has("view-time-extent")?this.view?.timeExtent?.start:null,t?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([e])=>this._evaluateExpressionAttributesThrottled(e))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=p(this._graphicChangedTask),this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}static{this.interceptor=new i(P,R)}get _effectivePopupTemplate(){return null!=this.graphic?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return L(O(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return N(this.graphic)}castAbilities(e){return{...ae,...e}}get isFeatureFromTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get timeZone(){return this.view?.timeZone??x}set timeZone(e){this._overrideIfSome("timeZone",e)}get map(){return this.view?.map||null}set map(e){this._override("map",e)}get waitingForContent(){const{_graphicChangedThrottled:e,_evaluateExpressionAttributesThrottled:t,_graphicChangedTask:i,_evaluateExpressionAttributesTask:s,_associationVMAbortController:o}=this;return e.hasPendingUpdates()||t.hasPendingUpdates()||null!=i&&!i.finished||null!=s&&!s.finished||!!o}setActiveMedia(e,t){const i=this.contentViewModels[e];i instanceof C&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof C&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof C&&t.previous()}async updateGeometry(){const{graphic:e,spatialReference:t,_sourceLayer:i}=this;await(i?.load());const s=i?.objectIdField;if(!s||!e||!i)return;const o=e?.attributes?.[s];if(null==o)return;const r=[o];if(!e.geometry){const s=await U({layer:i,graphic:e,outFields:[],objectIds:r,returnGeometry:!0,spatialReference:t}),o=s?.geometry;o&&(e.geometry=o)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}_graphicChanged(){this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._graphicChangedTask=p(this._graphicChangedTask),this._graphicChangedTask=r(async e=>{this._error=null,this._clear();const{graphic:t}=this;try{if(!t)return null;const{_sourceLayer:i,_effectivePopupTemplate:s}=this,o=this.spatialReference;await Z({graphic:t,popupTemplate:s,layer:i,spatialReference:o},{signal:e});const[{value:r},{value:a}]=await c([this._getContent(),this._getTitle()]),[,{value:n}]=await c([this._checkForRelatedFeatures({signal:e}),j(s?.expressionInfos,t)]);return{expressionInfos:n,content:r,title:a}}catch(i){throw d(i)||(this._error=i,l.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:t,popupTemplate:this._effectivePopupTemplate})),i}})}_compileContentElement(e,t){return"attachments"===e.type?this._compileAttachments(e,t):"custom"===e.type?this._compileCustom(e,t):"fields"===e.type?this._compileFields(e,t):"media"===e.type?this._compileMedia(e,t):"text"===e.type?this._compileText(e,t):"expression"===e.type?this._compileExpression(e,t):"relationship"===e.type?this._compileRelationship(e,t):"utility-network-associations"===e.type?this._compileUtilityNetworkAssociation(e,t):void 0}_compileContent(e){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map((e,t)=>this._compileContentElement(e,t)).filter(o):"string"==typeof e?this._compileText(new I({text:e}),0).text:e}_destroyContentViewModels(){this.removeHandles(oe),this.removeHandles(se),this.contentViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("contentViewModels",[])}_matchesFeature(e,t){const i=e?.graphic?.getObjectId(),s=t?.getObjectId();return null!=i&&null!=s&&i===s}_setRelatedFeaturesViewModels({relatedFeatureViewModels:e,relatedFeatures:t,map:i}){const{view:s,spatialReference:o,timeZone:r}=this;t?.filter(Boolean).forEach(t=>{e.some(e=>this._matchesFeature(e,t))||e.add(new te({abilities:{relationshipContent:!1},map:i,view:s,spatialReference:o,timeZone:r,graphic:t}))}),e.forEach(i=>{const s=t?.find(e=>this._matchesFeature(i,e));s||e.remove(i)})}_setExpressionContentVM(e,t){const i=this.formattedAttributes,{contentElement:s,contentElementViewModel:o}=e,r=s?.type;o&&r&&("fields"===r&&(this._createFieldsFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),o.set(this._createFieldsVMParams(s,t))),"media"===r&&(this._createMediaFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),o.set(this._createMediaVMParams(s,t))),"text"===r&&o.set(this._createTextVMParams(s)))}_compileRelationship(e,t){const{displayCount:i,orderByFields:s,relationshipId:o,title:r,description:a}=e,{_sourceLayer:n,graphic:l,map:p}=this;if(!S(n))return;const c=new V({displayCount:i,graphic:l,orderByFields:s,relationshipId:o,layer:n,map:p,...this._compileTitleAndDesc({title:r,description:a})});return this.contentViewModels[t]=c,this.addHandles(_(()=>c.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(c)),oe),e}_matchesGlobalFeature(e,t){const i=e?.association.globalId,s=t?.association.globalId;return null!=i&&null!=s&&i===s}_setUpUtilityNetworkAssociationsViewModels(e,t,i){const{view:s,spatialReference:o,timeZone:r}=this;e.forEach((i,s)=>{const o=t.get(s);o?i.forEach(t=>{o.find(e=>this._matchesGlobalFeature(t,e))||(i.remove(t),0===i.length&&e.delete(s))}):(i.removeAll(),e.delete(s))}),t.forEach((t,n)=>{const l=e.get(n)||new a;t?.filter(Boolean).forEach((e,t)=>{if(!l.some(t=>this._matchesGlobalFeature(t,e))){const{association:a,feature:n,terminalName:p,title:c}=e;l.add({title:c,association:a,featureViewModel:new te({abilities:{utilityNetworkAssociationsContent:!1},map:i,view:s,spatialReference:o,timeZone:r,graphic:n}),terminalName:p},t)}}),e.set(n,l)})}_compileUtilityNetworkAssociation(e,t){const{displayCount:i,title:s,description:o,associationTypes:r}=e,{_sourceLayer:a,graphic:n,map:l}=this;if(!B(a))return;const p=new ee({graphic:n,displayCount:i,associationTypes:r,layer:a,map:l,...this._compileTitleAndDesc({title:s,description:o})});return this.contentViewModels[t]=p,this.addHandles([u(()=>p.associationFeatures.values(),()=>this._setUpUtilityNetworkAssociationsViewModels(p.associationViewModels,p.associationFeatures,p.map))],re),e}_compileExpression(e,t){const{expressionInfo:i}=e,{graphic:s,map:o,spatialReference:r,view:a,location:n}=this,l=new F({expressionInfo:i,graphic:s,interceptor:te.interceptor,map:o,spatialReference:r,view:a,location:n});return this.contentViewModels[t]=l,this.addHandles(u(()=>l.contentElementViewModel,()=>this._setExpressionContentVM(l,t),m),se),e}_compileAttachments(e,t){const{graphic:i}=this,{description:s,title:o,orderByFields:r}=e;return this.contentViewModels[t]=new M({graphic:i,orderByFields:r,...this._compileTitleAndDesc({title:o,description:s})}),e}_compileCustom(e,t){const{graphic:i}=this,{creator:s,destroyer:o}=e;return this.contentViewModels[t]=new T({graphic:i,creator:s,destroyer:o}),e}_compileTitleAndDesc({title:e,description:t}){const{_fieldInfoMap:i,_sourceLayer:s,graphic:o,formattedAttributes:r}=this,a=o?.attributes,n=this._expressionAttributes,l=r.global;return{title:H({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:s,text:e}),description:H({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:s,text:t})}}_createFieldsVMParams(e,t){const i=this._effectivePopupTemplate,s=this.formattedAttributes,o={...s?.global,...s?.content[t]},r=e?.fieldInfos||i?.fieldInfos,a=r?.filter(({fieldName:e})=>!!e&&(D(e)||G(e)||o.hasOwnProperty(e))),n=i?.expressionInfos,{description:l,title:p}=e;return{attributes:o,expressionInfos:n,fieldInfos:a,...this._compileTitleAndDesc({title:p,description:l})}}_compileFields(e,t){const i=e.clone(),s=new E(this._createFieldsVMParams(e,t));return this.contentViewModels[t]=s,i.fieldInfos=s.formattedFieldInfos.slice(),i}_createMediaVMParams(e,t){const{abilities:i,graphic:s,_fieldInfoMap:o,_effectivePopupTemplate:r,relatedInfos:a,_sourceLayer:n,_expressionAttributes:l}=this,p=this.formattedAttributes,c=s?.attributes??{},{description:d,mediaInfos:h,title:u}=e;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:e.activeMediaInfoIndex||0,attributes:c,isAggregate:s?.isAggregate,layer:n,fieldInfoMap:o,formattedAttributes:{...p?.global,...p?.content[t]},expressionAttributes:l,mediaInfos:h,popupTemplate:r,relatedInfos:a,...this._compileTitleAndDesc({title:u,description:d})}}_compileMedia(e,t){const i=e.clone(),s=new C(this._createMediaVMParams(e,t));return i.mediaInfos=s.formattedMediaInfos.slice(),this.contentViewModels[t]=s,i}_createTextVMParams(e){const{graphic:t,_fieldInfoMap:i,_sourceLayer:s,_expressionAttributes:o}=this;if(e&&e.text){const r=t?.attributes??{},a=this.formattedAttributes?.global??{};e.text=H({attributes:r,fieldInfoMap:i,globalAttributes:a,expressionAttributes:o,layer:s,text:e.text})}return{graphic:t,creator:e.text}}_compileText(e,t){const i=e.clone();return this.contentViewModels[t]=new T(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:e,_sourceLayer:t,graphic:i,timeZone:s}=this;if(!e)return;const{lastEditInfoEnabled:o}=e,r=t?.editFieldsInfo;return o&&r?q(r,i?.attributes,s,t):void 0}_compileTitle(e){const{_fieldInfoMap:t,_sourceLayer:i,graphic:s,_expressionAttributes:o}=this,r=s?.attributes??{},a=this.formattedAttributes?.global??{};return H({attributes:r,fieldInfoMap:t,globalAttributes:a,expressionAttributes:o,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?z({type:"title",value:e?.title,event:{graphic:t}}):null}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?z({type:"content",value:e?.content,event:{graphic:t}}):null}_evaluateExpressionAttributes({title:e,content:t,expressionInfos:i}){this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=r(async s=>{const{graphic:o,map:r,view:a,spatialReference:n,location:p}=this;try{if(!o)return;let l;if(null!=i){const e=[];for(const[t,l]of i.expressions.entries())null!=l?e.push(l.evaluate({graphic:o,interceptor:te.interceptor,location:p,map:r,options:{signal:s},spatialReference:n,view:a}).then(e=>[t,"string"==typeof e?k(e):e]).catch(()=>[t,void 0])):e.push(Promise.resolve([t,void 0]));l=Object.fromEntries(await Promise.all(e)),h(s)}this._expressionAttributes=l,this._graphicExpressionAttributes={...o.attributes,...l},this._set("formattedAttributes",this._createFormattedAttributes(t)),this._set("title",this._compileTitle(e)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(t)||null)}catch(c){d(c)||(this._error=c,l.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:c,graphic:o,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){const{_effectivePopupTemplate:s,graphic:o,relatedInfos:r,_sourceLayer:a,_fieldInfoMap:n,_graphicExpressionAttributes:l,timeZone:p}=this;i.content[t]=Q({fieldInfos:s?.fieldInfos,graphic:o,attributes:{...l,...e.attributes},layer:a,fieldInfoMap:n,relatedInfos:r,timeZone:p})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){if(e.fieldInfos){const{graphic:s,relatedInfos:o,_sourceLayer:r,_fieldInfoMap:a,_graphicExpressionAttributes:n,timeZone:l}=this;i.content[t]=Q({fieldInfos:e.fieldInfos,graphic:s,attributes:{...n,...e.attributes},layer:r,fieldInfoMap:a,relatedInfos:o,timeZone:l})}}_createFormattedAttributes(e){const{_effectivePopupTemplate:t,graphic:i,relatedInfos:s,_sourceLayer:o,_fieldInfoMap:r,_graphicExpressionAttributes:a,timeZone:n}=this,l=t?.fieldInfos,p={global:Q({fieldInfos:l,graphic:i,attributes:a,layer:o,fieldInfoMap:r,relatedInfos:s,timeZone:n}),content:[]};return Array.isArray(e)&&e.forEach((e,t)=>{"fields"===e.type&&this._createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:p}),"media"===e.type&&this._createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:p})}),p}_checkForRelatedFeatures(e){const{graphic:t,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(t,O(i),e)}async _queryRelatedInfos(e,t,i){const{relatedInfos:s,_sourceLayer:o}=this;s.clear();const r=null!=o?.associatedLayer?await(o?.associatedLayer.load(i)):o;if(!r||!e)return;const a=t.filter(e=>!!e.fieldName&&G(e.fieldName));if(!a?.length)return;t.forEach(e=>this._configureRelatedInfo(e,r));const n=await J({relatedInfos:s,layer:r},i);Object.keys(n).forEach(e=>{const t=s.get(e.toString()),i=n[e]?.value;t&&i&&(t.layerInfo=i.data)});const l=await K({graphic:e,relatedInfos:s,layer:r},i);Object.keys(l).forEach(e=>{W(l[e]?.value,s.get(e.toString()))})}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,s=X(e.fieldName||"");if(!s)return;const{layerId:o,fieldName:r}=s;if(!o)return;const a=i.get(o.toString())||Y(o,t);a&&($({relatedInfo:a,fieldName:r,fieldInfo:e}),this.relatedInfos.set(o,a))}};e([g()],ne.prototype,"_error",void 0),e([g()],ne.prototype,"_graphicChangedTask",void 0),e([g()],ne.prototype,"_evaluateExpressionAttributesTask",void 0),e([g()],ne.prototype,"_associationVMAbortController",void 0),e([g({readOnly:!0})],ne.prototype,"_effectivePopupTemplate",null),e([g({readOnly:!0})],ne.prototype,"_fieldInfoMap",null),e([g({readOnly:!0})],ne.prototype,"_sourceLayer",null),e([g()],ne.prototype,"abilities",void 0),e([b("abilities")],ne.prototype,"castAbilities",null),e([g({readOnly:!0})],ne.prototype,"content",void 0),e([g({readOnly:!0})],ne.prototype,"contentViewModels",void 0),e([g()],ne.prototype,"description",void 0),e([g({type:Boolean})],ne.prototype,"defaultPopupTemplateEnabled",void 0),e([g({readOnly:!0})],ne.prototype,"isFeatureFromTable",null),e([g({readOnly:!0})],ne.prototype,"state",null),e([g({readOnly:!0})],ne.prototype,"formattedAttributes",void 0),e([g({type:t})],ne.prototype,"graphic",void 0),e([g({readOnly:!0})],ne.prototype,"lastEditInfo",void 0),e([g({type:w})],ne.prototype,"location",void 0),e([g({readOnly:!0})],ne.prototype,"relatedInfos",void 0),e([g({type:A})],ne.prototype,"spatialReference",null),e([g()],ne.prototype,"timeZone",null),e([g({readOnly:!0})],ne.prototype,"title",void 0),e([g()],ne.prototype,"map",null),e([g({readOnly:!0})],ne.prototype,"waitingForContent",null),e([g()],ne.prototype,"view",void 0),ne=te=e([v("esri.widgets.Feature.FeatureViewModel")],ne);export{ne as default};
5
+ import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{FeatureSetQueryInterceptor as i}from"../../arcade/featureset/support/FeatureSetQueryInterceptor.js";import s from"../../core/Accessor.js";import{isSome as o}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import{IdentifiableMixin as n}from"../../core/Identifiable.js";import l from"../../core/Logger.js";import{abortMaybe as p}from"../../core/maybe.js";import{eachAlways as c,isAbortError as d,throwIfAborted as h}from"../../core/promiseUtils.js";import{watch as u,when as m,initial as f,on as _}from"../../core/reactiveUtils.js";import{throttle as y}from"../../core/throttle.js";import{property as g}from"../../core/accessorSupport/decorators/property.js";import{cast as b}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import{subclass as v}from"../../core/accessorSupport/decorators/subclass.js";import w from"../../geometry/Point.js";import A from"../../geometry/SpatialReference.js";import I from"../../popup/content/TextContent.js";import{system as x}from"../../time/constants.js";import M from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import T from"./FeatureContent/FeatureContentViewModel.js";import F from"./FeatureExpression/FeatureExpressionViewModel.js";import E from"./FeatureFields/FeatureFieldsViewModel.js";import C from"./FeatureMedia/FeatureMediaViewModel.js";import V from"./FeatureRelationship/FeatureRelationshipViewModel.js";import{compileExpressionInfos as j,formatArcadeValue as k}from"./support/arcadeFeatureUtils.js";import{preLayerQueryCallback as P,preRequestCallback as R,createFieldInfoMap as L,getAllFieldInfos as O,getSourceLayer as N,querySourceLayer as U,queryUpdatedFeature as Z,isRelatableFeatureSupportedLayer as S,isAssociatedFeatureSupportedLayer as B,substituteFieldsInLinksAndAttributes as H,isExpressionField as D,isRelatedField as G,formatEditInfo as q,graphicCallback as K,formatAttributes as z}from"./support/featureUtils.js";import{queryLayerInfos as Q,queryRelatedFeatures as J,setRelatedFeatures as W,getRelatedFieldInfo as X,createRelatedInfo as Y,updateRelatedInfo as $}from"./support/relatedFeatureUtils.js";import ee from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";var te;const ie=1,se="content-view-models",oe="relationship-view-models",re="association-view-models",ae={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let ne=class extends(n(s)){static{te=this}constructor(e){super(e),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._associationVMAbortController=null,this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...ae},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._graphicChangedThrottled=y(this._graphicChanged,()=>this.notifyChange("waitingForContent"),ie,this),this._isAllowedContentType=e=>{const{abilities:t}=this;return"attachments"===e.type&&!!t.attachmentsContent||"custom"===e.type&&!!t.customContent||"fields"===e.type&&!!t.fieldsContent||"media"===e.type&&!!t.mediaContent||"text"===e.type&&!!t.textContent||"expression"===e.type&&!!t.expressionContent||"relationship"===e.type&&!!t.relationshipContent||"utility-network-associations"===e.type&&!!t.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=y(this._evaluateExpressionAttributes,()=>this.notifyChange("waitingForContent"),ie,this),this.addHandles([u(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),f),m(()=>{if(!this._graphicChangedTask?.finished||null==this._graphicChangedTask.value)return null;const e=this._graphicChangedTask.value,t=e?.expressionInfos?.dependencies;return[e,t?.has("view-scale")?this.view?.scale:null,t?.has("view-time-extent")?this.view?.timeExtent?.start:null,t?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([e])=>this._evaluateExpressionAttributesThrottled(e))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=p(this._graphicChangedTask),this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}static{this.interceptor=new i(P,R)}get _effectivePopupTemplate(){return null!=this.graphic?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return L(O(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return N(this.graphic)}castAbilities(e){return{...ae,...e}}get isFeatureFromTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get timeZone(){return this.view?.timeZone??x}set timeZone(e){this._overrideIfSome("timeZone",e)}get map(){return this.view?.map||null}set map(e){this._override("map",e)}get waitingForContent(){const{_graphicChangedThrottled:e,_evaluateExpressionAttributesThrottled:t,_graphicChangedTask:i,_evaluateExpressionAttributesTask:s,_associationVMAbortController:o}=this;return e.hasPendingUpdates()||t.hasPendingUpdates()||null!=i&&!i.finished||null!=s&&!s.finished||!!o}setActiveMedia(e,t){const i=this.contentViewModels[e];i instanceof C&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof C&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof C&&t.previous()}async updateGeometry(){const{graphic:e,spatialReference:t,_sourceLayer:i}=this;await(i?.load());const s=i?.objectIdField;if(!s||!e||!i)return;const o=e?.attributes?.[s];if(null==o)return;const r=[o];if(!e.geometry){const s=await U({layer:i,graphic:e,outFields:[],objectIds:r,returnGeometry:!0,spatialReference:t}),o=s?.geometry;o&&(e.geometry=o)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}_graphicChanged(){this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._graphicChangedTask=p(this._graphicChangedTask),this._graphicChangedTask=r(async e=>{this._error=null,this._clear();const{graphic:t}=this;try{if(!t)return null;const{_sourceLayer:i,_effectivePopupTemplate:s}=this,o=this.spatialReference;await Z({graphic:t,popupTemplate:s,layer:i,spatialReference:o},{signal:e});const[{value:r},{value:a}]=await c([this._getContent(),this._getTitle()]),[,{value:n}]=await c([this._checkForRelatedFeatures({signal:e}),j(s?.expressionInfos,t)]);return{expressionInfos:n,content:r,title:a}}catch(i){throw d(i)||(this._error=i,l.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:t,popupTemplate:this._effectivePopupTemplate})),i}})}_compileContentElement(e,t){return"attachments"===e.type?this._compileAttachments(e,t):"custom"===e.type?this._compileCustom(e,t):"fields"===e.type?this._compileFields(e,t):"media"===e.type?this._compileMedia(e,t):"text"===e.type?this._compileText(e,t):"expression"===e.type?this._compileExpression(e,t):"relationship"===e.type?this._compileRelationship(e,t):"utility-network-associations"===e.type?this._compileUtilityNetworkAssociation(e,t):void 0}_compileContent(e){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map((e,t)=>this._compileContentElement(e,t)).filter(o):"string"==typeof e?this._compileText(new I({text:e}),0).text:e}_destroyContentViewModels(){this.removeHandles(oe),this.removeHandles(se),this.contentViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("contentViewModels",[])}_matchesFeature(e,t){const i=e?.graphic?.getObjectId(),s=t?.getObjectId();return null!=i&&null!=s&&i===s}_setRelatedFeaturesViewModels({relatedFeatureViewModels:e,relatedFeatures:t,map:i}){const{view:s,spatialReference:o,timeZone:r}=this;t?.filter(Boolean).forEach(t=>{e.some(e=>this._matchesFeature(e,t))||e.add(new te({abilities:{relationshipContent:!1},map:i,view:s,spatialReference:o,timeZone:r,graphic:t}))}),e.forEach(i=>{const s=t?.find(e=>this._matchesFeature(i,e));s||e.remove(i)})}_setExpressionContentVM(e,t){const i=this.formattedAttributes,{contentElement:s,contentElementViewModel:o}=e,r=s?.type;o&&r&&("fields"===r&&(this._createFieldsFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),o.set(this._createFieldsVMParams(s,t))),"media"===r&&(this._createMediaFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),o.set(this._createMediaVMParams(s,t))),"text"===r&&o.set(this._createTextVMParams(s)))}_compileRelationship(e,t){const{displayCount:i,orderByFields:s,relationshipId:o,title:r,description:a}=e,{_sourceLayer:n,graphic:l,map:p}=this;if(!S(n))return;const c=new V({displayCount:i,graphic:l,orderByFields:s,relationshipId:o,layer:n,map:p,...this._compileTitleAndDesc({title:r,description:a})});return this.contentViewModels[t]=c,this.addHandles(_(()=>c.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(c)),oe),e}_matchesGlobalFeature(e,t){return e.association.equals(t.association)}_setUpUtilityNetworkAssociationsViewModels(e,t,i){const{view:s,spatialReference:o,timeZone:r}=this;e.forEach((i,s)=>{const o=t.get(s);o?i.forEach(t=>{o.find(e=>this._matchesGlobalFeature(t,e))||(i.remove(t),0===i.length&&e.delete(s))}):(i.removeAll(),e.delete(s))}),t.forEach((t,n)=>{const l=e.get(n)||new a;t?.filter(Boolean).forEach((e,t)=>{if(!l.some(t=>this._matchesGlobalFeature(t,e))){const{association:a,feature:n,terminalName:p,title:c}=e;l.add({title:c,association:a,featureViewModel:new te({abilities:{utilityNetworkAssociationsContent:!1},map:i,view:s,spatialReference:o,timeZone:r,graphic:n}),terminalName:p},t)}}),e.set(n,l)})}_compileUtilityNetworkAssociation(e,t){const{displayCount:i,title:s,description:o,associationTypes:r}=e,{_sourceLayer:a,graphic:n,map:l}=this;if(!B(a))return;const p=new ee({graphic:n,displayCount:i,associationTypes:r,layer:a,map:l,...this._compileTitleAndDesc({title:s,description:o})});return this.contentViewModels[t]=p,this.addHandles([u(()=>p.associationFeatures.values(),()=>this._setUpUtilityNetworkAssociationsViewModels(p.associationViewModels,p.associationFeatures,p.map))],re),e}_compileExpression(e,t){const{expressionInfo:i}=e,{graphic:s,map:o,spatialReference:r,view:a,location:n}=this,l=new F({expressionInfo:i,graphic:s,interceptor:te.interceptor,map:o,spatialReference:r,view:a,location:n});return this.contentViewModels[t]=l,this.addHandles(u(()=>l.contentElementViewModel,()=>this._setExpressionContentVM(l,t),f),se),e}_compileAttachments(e,t){const{graphic:i}=this,{description:s,title:o,orderByFields:r,attachmentKeywords:a,attachmentTypes:n}=e;return this.contentViewModels[t]=new M({attachmentKeywords:a,attachmentTypes:n,graphic:i,orderByFields:r,...this._compileTitleAndDesc({title:o,description:s})}),e}_compileCustom(e,t){const{graphic:i}=this,{creator:s,destroyer:o}=e;return this.contentViewModels[t]=new T({graphic:i,creator:s,destroyer:o}),e}_compileTitleAndDesc({title:e,description:t}){const{_fieldInfoMap:i,_sourceLayer:s,graphic:o,formattedAttributes:r}=this,a=o?.attributes,n=this._expressionAttributes,l=r.global;return{title:H({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:s,text:e}),description:H({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:s,text:t})}}_createFieldsVMParams(e,t){const i=this._effectivePopupTemplate,s=this.formattedAttributes,o={...s?.global,...s?.content[t]},r=e?.fieldInfos||i?.fieldInfos,a=r?.filter(({fieldName:e})=>!!e&&(D(e)||G(e)||o.hasOwnProperty(e))),n=i?.expressionInfos,{description:l,title:p}=e;return{attributes:o,expressionInfos:n,fieldInfos:a,...this._compileTitleAndDesc({title:p,description:l})}}_compileFields(e,t){const i=e.clone(),s=new E(this._createFieldsVMParams(e,t));return this.contentViewModels[t]=s,i.fieldInfos=s.formattedFieldInfos.slice(),i}_createMediaVMParams(e,t){const{abilities:i,graphic:s,_fieldInfoMap:o,_effectivePopupTemplate:r,relatedInfos:a,_sourceLayer:n,_expressionAttributes:l}=this,p=this.formattedAttributes,c=s?.attributes??{},{description:d,mediaInfos:h,title:u}=e;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:e.activeMediaInfoIndex||0,attributes:c,isAggregate:s?.isAggregate,layer:n,fieldInfoMap:o,formattedAttributes:{...p?.global,...p?.content[t]},expressionAttributes:l,mediaInfos:h,popupTemplate:r,relatedInfos:a,...this._compileTitleAndDesc({title:u,description:d})}}_compileMedia(e,t){const i=e.clone(),s=new C(this._createMediaVMParams(e,t));return i.mediaInfos=s.formattedMediaInfos.slice(),this.contentViewModels[t]=s,i}_createTextVMParams(e){const{graphic:t,_fieldInfoMap:i,_sourceLayer:s,_expressionAttributes:o}=this;if(e&&e.text){const r=t?.attributes??{},a=this.formattedAttributes?.global??{};e.text=H({attributes:r,fieldInfoMap:i,globalAttributes:a,expressionAttributes:o,layer:s,text:e.text})}return{graphic:t,creator:e.text}}_compileText(e,t){const i=e.clone();return this.contentViewModels[t]=new T(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:e,_sourceLayer:t,graphic:i,timeZone:s}=this;if(!e)return;const{lastEditInfoEnabled:o}=e,r=t?.editFieldsInfo;return o&&r?q(r,i?.attributes,s,t):void 0}_compileTitle(e){const{_fieldInfoMap:t,_sourceLayer:i,graphic:s,_expressionAttributes:o}=this,r=s?.attributes??{},a=this.formattedAttributes?.global??{};return H({attributes:r,fieldInfoMap:t,globalAttributes:a,expressionAttributes:o,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?K({type:"title",value:e?.title,event:{graphic:t}}):null}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?K({type:"content",value:e?.content,event:{graphic:t}}):null}_evaluateExpressionAttributes({title:e,content:t,expressionInfos:i}){this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=r(async s=>{const{graphic:o,map:r,view:a,spatialReference:n,location:p}=this;try{if(!o)return;let l;if(null!=i){const e=[];for(const[t,l]of i.expressions.entries())null!=l?e.push(l.evaluate({graphic:o,interceptor:te.interceptor,location:p,map:r,options:{signal:s},spatialReference:n,view:a}).then(e=>[t,"string"==typeof e?k(e):e]).catch(()=>[t,void 0])):e.push(Promise.resolve([t,void 0]));l=Object.fromEntries(await Promise.all(e)),h(s)}this._expressionAttributes=l,this._graphicExpressionAttributes={...o.attributes,...l},this._set("formattedAttributes",this._createFormattedAttributes(t)),this._set("title",this._compileTitle(e)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(t)||null)}catch(c){d(c)||(this._error=c,l.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:c,graphic:o,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){const{_effectivePopupTemplate:s,graphic:o,relatedInfos:r,_sourceLayer:a,_fieldInfoMap:n,_graphicExpressionAttributes:l,timeZone:p}=this;i.content[t]=z({fieldInfos:s?.fieldInfos,graphic:o,attributes:{...l,...e.attributes},layer:a,fieldInfoMap:n,relatedInfos:r,timeZone:p})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){if(e.fieldInfos){const{graphic:s,relatedInfos:o,_sourceLayer:r,_fieldInfoMap:a,_graphicExpressionAttributes:n,timeZone:l}=this;i.content[t]=z({fieldInfos:e.fieldInfos,graphic:s,attributes:{...n,...e.attributes},layer:r,fieldInfoMap:a,relatedInfos:o,timeZone:l})}}_createFormattedAttributes(e){const{_effectivePopupTemplate:t,graphic:i,relatedInfos:s,_sourceLayer:o,_fieldInfoMap:r,_graphicExpressionAttributes:a,timeZone:n}=this,l=t?.fieldInfos,p={global:z({fieldInfos:l,graphic:i,attributes:a,layer:o,fieldInfoMap:r,relatedInfos:s,timeZone:n}),content:[]};return Array.isArray(e)&&e.forEach((e,t)=>{"fields"===e.type&&this._createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:p}),"media"===e.type&&this._createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:p})}),p}_checkForRelatedFeatures(e){const{graphic:t,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(t,O(i),e)}async _queryRelatedInfos(e,t,i){const{relatedInfos:s,_sourceLayer:o}=this;s.clear();const r=null!=o?.associatedLayer?await(o?.associatedLayer.load(i)):o;if(!r||!e)return;const a=t.filter(e=>!!e.fieldName&&G(e.fieldName));if(!a?.length)return;t.forEach(e=>this._configureRelatedInfo(e,r));const n=await Q({relatedInfos:s,layer:r},i);Object.keys(n).forEach(e=>{const t=s.get(e.toString()),i=n[e]?.value;t&&i&&(t.layerInfo=i.data)});const l=await J({graphic:e,relatedInfos:s,layer:r},i);Object.keys(l).forEach(e=>{W(l[e]?.value,s.get(e.toString()))})}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,s=X(e.fieldName||"");if(!s)return;const{layerId:o,fieldName:r}=s;if(!o)return;const a=i.get(o.toString())||Y(o,t);a&&($({relatedInfo:a,fieldName:r,fieldInfo:e}),this.relatedInfos.set(o,a))}};e([g()],ne.prototype,"_error",void 0),e([g()],ne.prototype,"_graphicChangedTask",void 0),e([g()],ne.prototype,"_evaluateExpressionAttributesTask",void 0),e([g()],ne.prototype,"_associationVMAbortController",void 0),e([g({readOnly:!0})],ne.prototype,"_effectivePopupTemplate",null),e([g({readOnly:!0})],ne.prototype,"_fieldInfoMap",null),e([g({readOnly:!0})],ne.prototype,"_sourceLayer",null),e([g()],ne.prototype,"abilities",void 0),e([b("abilities")],ne.prototype,"castAbilities",null),e([g({readOnly:!0})],ne.prototype,"content",void 0),e([g({readOnly:!0})],ne.prototype,"contentViewModels",void 0),e([g()],ne.prototype,"description",void 0),e([g({type:Boolean})],ne.prototype,"defaultPopupTemplateEnabled",void 0),e([g({readOnly:!0})],ne.prototype,"isFeatureFromTable",null),e([g({readOnly:!0})],ne.prototype,"state",null),e([g({readOnly:!0})],ne.prototype,"formattedAttributes",void 0),e([g({type:t})],ne.prototype,"graphic",void 0),e([g({readOnly:!0})],ne.prototype,"lastEditInfo",void 0),e([g({type:w})],ne.prototype,"location",void 0),e([g({readOnly:!0})],ne.prototype,"relatedInfos",void 0),e([g({type:A})],ne.prototype,"spatialReference",null),e([g()],ne.prototype,"timeZone",null),e([g({readOnly:!0})],ne.prototype,"title",void 0),e([g()],ne.prototype,"map",null),e([g({readOnly:!0})],ne.prototype,"waitingForContent",null),e([g()],ne.prototype,"view",void 0),ne=te=e([v("esri.widgets.Feature.FeatureViewModel")],ne);export{ne 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../intl.js";import{watch as t,initial as s}from"../core/reactiveUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import l from"./Feature/FeatureAttachments.js";import d from"./Feature/FeatureContent.js";import a from"./Feature/FeatureExpression.js";import c from"./Feature/FeatureFields.js";import p from"./Feature/FeatureMedia.js";import u from"./Feature/FeatureRelationship.js";import m from"./Feature/FeatureUtilityNetworkAssociations.js";import h from"./Feature/FeatureViewModel.js";import{css as y}from"./Feature/resources.js";import{FeatureContentMixin as v}from"./Feature/support/FeatureContentMixin.js";import{loadCalciteComponents as w}from"./support/componentsUtils.js";import{globalCss as g}from"./support/globalCss.js";import{Heading as f}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as _}from"./support/decorators/messageBundle.js";import{tsx as M}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as E}from"../intl/substitute.js";const b={title:!0,content:!0,lastEditedInfo:!0};let F=class extends(v(r)){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...b},this.viewModel=new h}initialize(){this.addHandles(t(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),s))}loadDependencies(){return w({notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isFeatureFromTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...b,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=M("div",{class:y.container,key:"container"},this._renderTitle(),"error"===e?this._renderError():"loading"===e?this._renderLoading():this._renderContentContainer());return M("div",{class:this.classes(y.base,g.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:s}=this;return M("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},s.title?M("div",{key:"error-title",slot:"title"},e.errorMessage):null,M("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return M("div",{class:y.loadingSpinnerContainer,key:"loading-container"},M("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?M("div",{class:y.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?M(f,{class:y.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?M("div",{class:y.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if("string"==typeof e){const e=this._contentWidgets[0];return!e||e.destroyed?null:M("div",{class:this.classes(y.contentNode,y.contentNodeText),key:`${t}-content`},e.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){const{visibleElements:s}=this;if("boolean"!=typeof s.content&&!s.content?.[e.type])return null;switch(e.type){case"attachments":return this._renderAttachments(t);case"custom":return this._renderCustom(e,t);case"fields":return this._renderFields(t);case"media":return this._renderMedia(t);case"text":return this._renderText(e,t);case"expression":return this._renderExpression(t);case"relationship":return this._renderRelationship(t);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:s,attachmentInfos:i}=t.viewModel;return"loading"===s||i.length>0?M("div",{class:this.classes(y.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?M("div",{class:y.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?M("div",{class:y.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?M("div",{class:y.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:s}=e,i=this._contentWidgets[t];return!i||i.destroyed?null:s?M("div",{class:y.contentElement,key:this._buildKey("custom-element",t)},i.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:M("div",{class:y.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:M("div",{class:y.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:s}=this.viewModel;if(!s||!e.lastEditedInfo)return null;const{date:i,user:n}=s,o="edit"===s.type?n?t.lastEditedByUser:t.lastEdited:n?t.lastCreatedByUser:t.lastCreated,r=E(o,{date:i,user:n});return M("div",{class:this.classes(y.lastEditedInfo,y.contentElement),key:"edit-info-element"},r)}_renderText(e,t){const s=e.text,i=this._contentWidgets[t];return!i||i.destroyed?null:s?M("div",{class:this.classes(y.contentElement,y.text),key:this._buildKey("text-element",t)},i.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:s,viewModel:i}=this,n=i?.content,{contentViewModels:o}=i;if(Array.isArray(n))n.forEach((n,r)=>{if("attachments"===n.type&&(this._contentWidgets[r]=new l({displayType:n.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:o[r]})),"fields"===n.type&&(this._contentWidgets[r]=new c({viewModel:o[r]})),"media"===n.type&&(this._contentWidgets[r]=new p({viewModel:o[r]})),"text"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"custom"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"expression"===n.type&&(this._contentWidgets[r]=new a({viewModel:o[r]})),"relationship"===n.type){const e=new u({flowItems:s,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=e}if("utility-network-associations"===n.type){const e=async e=>{const{viewModel:n,listType:o,title:r}=e;if(!s)return;n.activeAssociationType=o;const{default:l}=await import("./Feature/FeatureUtilityNetworkAssociationList.js"),d=new l({viewModel:n,parentFeatureViewModel:i,listType:o,title:r,featureVisibleElements:t,description:i.title,flowItems:s});s.push(d)},n=new m({flowItems:s,onSelectAssociationType:e,parentFeatureViewModel:i,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=n}},this);else{const e=o[0];e&&!e.destroyed&&(this._contentWidgets[0]=new d({viewModel:e}))}this.scheduleRender()}};e([i()],F.prototype,"flowType",void 0),e([i()],F.prototype,"graphic",null),e([i()],F.prototype,"defaultPopupTemplateEnabled",null),e([i()],F.prototype,"flowItems",void 0),e([i()],F.prototype,"headingLevel",void 0),e([i({readOnly:!0})],F.prototype,"isTable",null),e([i()],F.prototype,"icon",null),e([i()],F.prototype,"label",null),e([i()],F.prototype,"location",null),e([i(),_("esri/widgets/Feature/t9n/Feature")],F.prototype,"messages",void 0),e([i(),_("esri/t9n/common")],F.prototype,"messagesCommon",void 0),e([i()],F.prototype,"spatialReference",null),e([i()],F.prototype,"timeZone",null),e([i({readOnly:!0})],F.prototype,"title",null),e([i()],F.prototype,"visibleElements",void 0),e([n("visibleElements")],F.prototype,"castVisibleElements",null),e([i()],F.prototype,"map",null),e([i()],F.prototype,"view",null),e([i({type:h})],F.prototype,"viewModel",void 0),F=e([o("esri.widgets.Feature")],F);export{F as default};
5
+ import{__decorate as e}from"tslib";import"../intl.js";import{watch as t,initial as s}from"../core/reactiveUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import l from"./Feature/FeatureAttachments.js";import d from"./Feature/FeatureContent.js";import a from"./Feature/FeatureExpression.js";import c from"./Feature/FeatureFields.js";import p from"./Feature/FeatureMedia.js";import u from"./Feature/FeatureRelationship.js";import m from"./Feature/FeatureUtilityNetworkAssociations.js";import h from"./Feature/FeatureViewModel.js";import{css as y}from"./Feature/resources.js";import{FeatureContentMixin as v}from"./Feature/support/FeatureContentMixin.js";import{loadCalciteComponents as w}from"./support/componentsUtils.js";import{globalCss as g}from"./support/globalCss.js";import{Heading as f}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as _}from"./support/decorators/messageBundle.js";import{tsx as M}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as E}from"../intl/substitute.js";const b={title:!0,content:!0,lastEditedInfo:!0};let F=class extends(v(r)){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...b},this.viewModel=new h}initialize(){this.addHandles(t(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),s))}loadDependencies(){return w({notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isFeatureFromTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...b,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=M("div",{class:y.container,key:"container"},this._renderTitle(),"error"===e?this._renderError():"loading"===e?this._renderLoading():this._renderContentContainer());return M("div",{class:this.classes(y.base,g.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:s}=this;return M("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},s.title?M("div",{key:"error-title",slot:"title"},e.errorMessage):null,M("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return M("div",{class:y.loadingSpinnerContainer,key:"loading-container"},M("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?M("div",{class:y.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?M(f,{class:y.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?M("div",{class:y.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if("string"==typeof e){const e=this._contentWidgets[0];return!e||e.destroyed?null:M("div",{class:this.classes(y.contentNode,y.contentNodeText),key:`${t}-content`},e.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){const{visibleElements:s}=this;if("boolean"!=typeof s.content&&!s.content?.[e.type])return null;switch(e.type){case"attachments":return this._renderAttachments(t);case"custom":return this._renderCustom(e,t);case"fields":return this._renderFields(t);case"media":return this._renderMedia(t);case"text":return this._renderText(e,t);case"expression":return this._renderExpression(t);case"relationship":return this._renderRelationship(t);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:s,attachmentInfos:i}=t.viewModel;return"loading"===s||i.length>0?M("div",{class:this.classes(y.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?M("div",{class:y.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?M("div",{class:y.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?M("div",{class:y.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:s}=e,i=this._contentWidgets[t];return!i||i.destroyed?null:s?M("div",{class:y.contentElement,key:this._buildKey("custom-element",t)},i.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:M("div",{class:y.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:M("div",{class:y.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:s}=this.viewModel;if(!s||!e.lastEditedInfo)return null;const{date:i,user:n}=s,o="edit"===s.type?n?t.lastEditedByUser:t.lastEdited:n?t.lastCreatedByUser:t.lastCreated,r=E(o,{date:i,user:n});return M("div",{class:this.classes(y.lastEditedInfo,y.contentElement),key:"edit-info-element"},r)}_renderText(e,t){const s=e.text,i=this._contentWidgets[t];return!i||i.destroyed?null:s?M("div",{class:this.classes(y.contentElement,y.text),key:this._buildKey("text-element",t)},i.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:s,viewModel:i}=this,n=i?.content,{contentViewModels:o}=i;if(Array.isArray(n))n.forEach((n,r)=>{if("attachments"===n.type&&(this._contentWidgets[r]=new l({displayType:n.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:o[r]})),"fields"===n.type&&(this._contentWidgets[r]=new c({viewModel:o[r]})),"media"===n.type&&(this._contentWidgets[r]=new p({viewModel:o[r],view:this.view})),"text"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"custom"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"expression"===n.type&&(this._contentWidgets[r]=new a({viewModel:o[r]})),"relationship"===n.type){const e=new u({flowItems:s,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=e}if("utility-network-associations"===n.type){const e=async e=>{const{viewModel:n,listType:o,title:r}=e;if(!s)return;n.activeAssociationType=o;const{default:l}=await import("./Feature/FeatureUtilityNetworkAssociationList.js"),d=new l({viewModel:n,parentFeatureViewModel:i,listType:o,title:r,featureVisibleElements:t,description:i.title,flowItems:s});s.push(d)},n=new m({flowItems:s,onSelectAssociationType:e,parentFeatureViewModel:i,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=n}},this);else{const e=o[0];e&&!e.destroyed&&(this._contentWidgets[0]=new d({viewModel:e}))}this.scheduleRender()}};e([i()],F.prototype,"flowType",void 0),e([i()],F.prototype,"graphic",null),e([i()],F.prototype,"defaultPopupTemplateEnabled",null),e([i()],F.prototype,"flowItems",void 0),e([i()],F.prototype,"headingLevel",void 0),e([i({readOnly:!0})],F.prototype,"isTable",null),e([i()],F.prototype,"icon",null),e([i()],F.prototype,"label",null),e([i()],F.prototype,"location",null),e([i(),_("esri/widgets/Feature/t9n/Feature")],F.prototype,"messages",void 0),e([i(),_("esri/t9n/common")],F.prototype,"messagesCommon",void 0),e([i()],F.prototype,"spatialReference",null),e([i()],F.prototype,"timeZone",null),e([i({readOnly:!0})],F.prototype,"title",null),e([i()],F.prototype,"visibleElements",void 0),e([n("visibleElements")],F.prototype,"castVisibleElements",null),e([i()],F.prototype,"map",null),e([i()],F.prototype,"view",null),e([i({type:h})],F.prototype,"viewModel",void 0),F=e([o("esri.widgets.Feature")],F);export{F as default};