@arcgis/core 5.1.0-next.83 → 5.1.0-next.85

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 (296) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{e89dc473f46a5584d2ef.js → 004af103a94d21cb4889.js} +3 -3
  3. package/assets/esri/core/workers/chunks/53d13e13d8729bd4dcf2.js +1 -0
  4. package/assets/esri/core/workers/chunks/{45c83eb7c2a06166e3b0.js → 56717ff315c6ec874142.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{1e2c0c6d724f7639d4c1.js → 713ab619060bd5087479.js} +13 -13
  6. package/assets/esri/core/workers/chunks/{a9b5ce00323cd5574bf7.js → 7160e3e7340beb7fdb42.js} +1 -1
  7. package/assets/esri/core/workers/chunks/79eca9ccd4dc52da1d59.js +1 -0
  8. package/assets/esri/core/workers/chunks/{bd8cb64b6e08839398f3.js → c7da0981822182e15f3a.js} +1 -1
  9. package/assets/esri/core/workers/chunks/f9fe3c9867b0bdb2aec6.js +596 -0
  10. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +6 -0
  11. package/assets/esri/themes/dark/main.css +1 -1
  12. package/assets/esri/themes/light/main.css +1 -1
  13. package/assets/esri/themes/light/view.css +1 -1
  14. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis.json +1 -1
  15. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_en.json +1 -1
  16. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  17. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  18. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  19. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  20. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  21. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  22. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  23. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  24. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  25. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  26. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  27. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  28. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  29. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  30. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  31. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  32. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  33. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  34. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  35. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  36. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  37. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  38. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
  39. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  40. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  41. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  42. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  43. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  44. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  45. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  46. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  47. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  48. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  49. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  50. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  51. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  52. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  53. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  54. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  55. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  56. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  57. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  58. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  59. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  60. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  61. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  62. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  63. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  64. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  65. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  66. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  67. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  68. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  69. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  70. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  71. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  72. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  73. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  74. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  75. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  76. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  77. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  78. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  79. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  80. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  81. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  82. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  83. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  84. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  85. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  86. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  87. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  88. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  89. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  90. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  91. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  92. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  93. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  94. package/chunks/EdgeShader.glsl.js +13 -9
  95. package/chunks/Fog.glsl.js +1 -1
  96. package/chunks/GlowBlur.glsl.js +9 -13
  97. package/chunks/GlowComposition.glsl.js +10 -10
  98. package/chunks/ShadowCastVisualize.glsl.js +10 -10
  99. package/config.js +1 -1
  100. package/core/arrayUtils.js +1 -1
  101. package/core/has.js +1 -1
  102. package/core/screenUtils.js +1 -1
  103. package/form/types.d.ts +1 -1
  104. package/geohash/GeohashCell.js +1 -1
  105. package/geohash/GeohashTree.js +1 -1
  106. package/kernel.js +1 -1
  107. package/layers/scene/ModelFileInfo.js +1 -1
  108. package/layers/scene/modelQuerySupport.js +1 -1
  109. package/package.json +1 -1
  110. package/popup/Features.d.ts +10 -0
  111. package/popup/Features.js +1 -1
  112. package/rest/knowledgeGraph/GraphQueryStreamingResult.d.ts +4 -1
  113. package/support/revision.js +1 -1
  114. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  115. package/views/2d/FrameTask.js +1 -1
  116. package/views/2d/LabelManager.js +1 -1
  117. package/views/2d/engine/DisplayObject.js +1 -1
  118. package/views/2d/engine/Stage.js +1 -1
  119. package/views/2d/engine/flow/FlowContainer.js +1 -1
  120. package/views/2d/engine/flow/FlowView2D.js +1 -1
  121. package/views/2d/engine/flow/styles/AFlowResources.js +1 -1
  122. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  123. package/views/2d/engine/flow/styles/Particles.js +1 -1
  124. package/views/2d/engine/flow/styles/Stack.js +1 -1
  125. package/views/2d/engine/flow/styles/Streamlines.js +1 -1
  126. package/views/2d/engine/transitions/FadeTransition.js +1 -1
  127. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  128. package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
  129. package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
  130. package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
  131. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  132. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  133. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  134. package/views/2d/engine/webgl/ResizableUint32Array.js +2 -0
  135. package/views/2d/engine/webgl/TileCpuState.js +2 -0
  136. package/views/2d/engine/webgl/TileGpuState.js +2 -0
  137. package/views/2d/engine/webgl/cpuMapped/CpuBuffer.js +2 -0
  138. package/views/2d/engine/webgl/cpuMapped/CpuMeshData.js +2 -0
  139. package/views/2d/engine/webgl/cpuMapped/GpuMeshState.js +2 -0
  140. package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
  141. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueDebugContainer.js +1 -1
  142. package/views/2d/engine/webgl/shaderGraph/techniques/TestDisplayObject.js +1 -1
  143. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTechnique.js +1 -1
  144. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  145. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  146. package/views/2d/layers/GeoRSSLayerView2D.js +1 -1
  147. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  148. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  149. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  150. package/views/2d/layers/KMLLayerView2D.js +1 -1
  151. package/views/2d/layers/LayerView2D.js +1 -1
  152. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  153. package/views/2d/layers/MediaLayerView2D.js +1 -1
  154. package/views/2d/layers/RouteLayerView2D.js +1 -1
  155. package/views/2d/layers/TileLayerView2D.js +1 -1
  156. package/views/2d/layers/features/FeatureContainer.js +1 -1
  157. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  158. package/views/2d/layers/features/FeatureTilePresentStrategy.js +2 -0
  159. package/views/2d/layers/features/Processor.js +1 -1
  160. package/views/2d/layers/features/RenderState.js +1 -1
  161. package/views/2d/layers/features/aggregation/AAggregateSpatialIndex.js +1 -1
  162. package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
  163. package/views/2d/layers/features/aggregation/GridCell.js +1 -1
  164. package/views/2d/layers/features/aggregation/GridIndexCell.js +2 -0
  165. package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
  166. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  167. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  168. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  169. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  170. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  171. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  172. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  173. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  174. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  175. package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
  176. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  177. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  178. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  179. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  180. package/views/2d/layers/features/sources/FeatureSourceMessage.js +1 -1
  181. package/views/2d/layers/features/sources/strategies/chunks/ASourceChunk.js +1 -1
  182. package/views/2d/layers/features/support/Hashed.js +2 -0
  183. package/views/2d/layers/graphics/AGraphicContainer.js +1 -1
  184. package/views/2d/layers/graphics/GraphicStore.js +1 -1
  185. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  186. package/views/2d/layers/imagery/ImageryView2D.js +1 -1
  187. package/views/2d/layers/support/vectorTileDebugUtils.js +1 -1
  188. package/views/2d/support/hitTestUtils.js +1 -1
  189. package/views/2d/tiling/FeatureTileSubscriptionManager.js +1 -1
  190. package/views/2d/tiling/TileCombinedCoverage.js +2 -0
  191. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  192. package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +2 -0
  193. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  194. package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
  195. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  196. package/views/3d/analysis/Viewshed/ViewshedEditTool.js +2 -0
  197. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  198. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  199. package/views/3d/analysis/Viewshed/ViewshedTool2.js +2 -0
  200. package/views/3d/analysis/Viewshed/viewshedSubToolUtils.js +2 -0
  201. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  202. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  203. package/views/3d/environment/CloudyWeather.js +1 -1
  204. package/views/3d/environment/FoggyWeather.js +1 -1
  205. package/views/3d/environment/RainyWeather.js +1 -1
  206. package/views/3d/environment/SnowyWeather.js +1 -1
  207. package/views/3d/environment/SunnyWeather.js +1 -1
  208. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  209. package/views/3d/layers/graphics/tessellationUtils.js +1 -1
  210. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  211. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  212. package/views/3d/webgl/ManagedColorAttachment.js +1 -1
  213. package/views/3d/webgl/ManagedDepthAttachment.js +1 -1
  214. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  215. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  216. package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
  217. package/views/3d/webgl-engine/core/FBOCacheUsage.js +1 -1
  218. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  219. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +11 -11
  220. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  221. package/views/3d/webgl-engine/effects/fog/Fog.glsl.js +1 -1
  222. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  223. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  224. package/views/3d/webgl-engine/effects/glow/Glow.js +2 -0
  225. package/views/3d/webgl-engine/effects/glow/GlowBlur.glsl.js +1 -1
  226. package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
  227. package/views/3d/webgl-engine/effects/raymarching/{RayDistanceFalloff.glsl.js → DistanceFalloff.glsl.js} +2 -2
  228. package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
  229. package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
  230. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  231. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  232. package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
  233. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  234. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  235. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  236. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  237. package/views/3d/webgl-engine/lib/StencilUtils.js +1 -1
  238. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  239. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
  240. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  241. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  242. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  243. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  244. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  245. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  246. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  247. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  248. package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
  249. package/views/3d/webgl-engine/shaders/MeasurementArrowTechniqueConfiguration.js +1 -1
  250. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  251. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  252. package/views/3d/webgl-engine/shaders/PointRendererTechnique.js +1 -1
  253. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  254. package/views/3d/webgl-engine/shaders/ScreenSpacePassAtmosphere.glsl.js +1 -7
  255. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
  256. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration.js +1 -1
  257. package/views/VideoView.js +1 -1
  258. package/views/View2D.js +1 -1
  259. package/views/draw/support/GraphicMover.js +1 -1
  260. package/views/support/rasterHitTestUtils.js +1 -1
  261. package/views/support/waitForResources.js +1 -1
  262. package/views/video/VideoOperationalDataView.js +1 -1
  263. package/views/webgl/FramebufferObject.js +1 -1
  264. package/views/webgl/RenderingContext.js +1 -1
  265. package/views/webgl/Texture.js +1 -1
  266. package/views/webgl/textureUtils.js +1 -1
  267. package/widgets/BatchAttributeForm/css.js +1 -1
  268. package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.d.ts +61 -0
  269. package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.js +2 -0
  270. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  271. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  272. package/widgets/BatchAttributeForm/inputs/types.d.ts +9 -4
  273. package/widgets/BatchAttributeForm/templates/UtilityNetworkAssociationsElementTemplate.js +2 -0
  274. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  275. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  276. package/widgets/BatchAttributeForm/templates/support/templateUtils.js +1 -1
  277. package/widgets/BatchAttributeForm.js +1 -1
  278. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  279. package/widgets/FeatureTable/Grid/Column.d.ts +17 -2
  280. package/widgets/FeatureTable/Grid/Column.js +1 -1
  281. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  282. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  283. package/widgets/FeatureTable/Grid/GroupColumn.d.ts +7 -1
  284. package/widgets/FeatureTable/Grid/GroupColumn.js +1 -1
  285. package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +9 -1
  286. package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
  287. package/widgets/FeatureTable/support/types.d.ts +8 -0
  288. package/widgets/FeatureTable.js +1 -1
  289. package/assets/esri/core/workers/chunks/38f1a86b8dd9ee684ee5.js +0 -596
  290. package/assets/esri/core/workers/chunks/8f4cd30ce23e41c1a42c.js +0 -1
  291. package/assets/esri/core/workers/chunks/cbf1a03f54bd8d2a2b47.js +0 -1
  292. package/views/2d/engine/webgl/PooledUint32Array.js +0 -2
  293. package/views/2d/engine/webgl/cpuMapped/Buffer.js +0 -2
  294. package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +0 -2
  295. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +0 -2
  296. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DistanceFalloff.glsl.js +0 -4
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{create as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{clone as o,fromValues as r,create as a}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{ScreenSpacePass as t}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{BlendColorsPremultiplied as l,premultiplyAlpha as s}from"../views/3d/webgl-engine/core/shaderLibrary/util/BlendColorsPremultiplied.glsl.js";import{CameraSpace as i}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{Float2PassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float4PassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{Float4sPassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Float4sPassUniform.js";import{FloatPassUniform as h}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{FloatsPassUniform as p}from"../views/3d/webgl-engine/core/shaderModules/FloatsPassUniform.js";import{glsl as c,If as u}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{IntegerPassUniform as v}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{Texture2DPassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{maxColorRampSize as w}from"../views/3d/webgl-engine/shaders/colorRampParameters.js";import{S as C}from"./ShadowCastAccumulate.glsl.js";import{NoParameters as f}from"../views/webgl/NoParameters.js";import{ShaderBuilder as b}from"../views/webgl/ShaderBuilder.js";class S extends f{constructor(r){super(),this._data=r,this.sampleScale=e(),this.opacityFromElevation=1,this.gradientColorRamp=y,this.thresholdColor=o(M),this.bandedGradientColorRamp=P,this.bandSize=.1,this.threshold=.5}get shadowCastMap(){return this._data.shadowCastTexture}}const R=.7,j=50/255,y=[[0,r(0,0,1,0)],[1,r(0,0,1,R)]],M=r(1,0,0,R),P=[[0,r(j,j,j,0)],[1,r(j,j,j,R)]];function z(e){const o=new b,r=o.fragment;o.include(i),o.include(t);const{visualization:a}=e;r.constants.add("inverseSampleValue","float",C),r.uniforms.add(new g("shadowCastMap",e=>e.shadowCastMap),new n("sampleScale",e=>e.sampleScale),new h("opacityFromElevation",e=>e.opacityFromElevation));const f=2===a,S=3===a,R=1===a;S&&r.include(l);switch(!f&&r.code.add(c`vec4 evaluateColorRamp(float value) {
2
+ import{create as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{clone as o,fromValues as r,create as a}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{ScreenSpacePass as l}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{BlendColorsPremultiplied as t,premultiplyAlpha as s}from"../views/3d/webgl-engine/core/shaderLibrary/util/BlendColorsPremultiplied.glsl.js";import{CameraSpace as n}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{Float2PassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float4PassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{Float4sPassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Float4sPassUniform.js";import{FloatPassUniform as h}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{FloatsPassUniform as p}from"../views/3d/webgl-engine/core/shaderModules/FloatsPassUniform.js";import{glsl as c,If as u}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{IntegerPassUniform as v}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{Texture2DPassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{maxColorRampSize as w}from"../views/3d/webgl-engine/shaders/colorRampParameters.js";import{S as C}from"./ShadowCastAccumulate.glsl.js";import{NoParameters as f}from"../views/webgl/NoParameters.js";import{ShaderBuilder as b}from"../views/webgl/ShaderBuilder.js";class S extends f{constructor(r){super(),this._data=r,this.sampleScale=e(),this.opacityFromElevation=1,this.gradientColorRamp=y,this.thresholdColor=o(M),this.bandedGradientColorRamp=P,this.bandSize=.1,this.threshold=.5}get shadowCastMap(){return this._data.shadowCastTexture}}const R=.7,j=50/255,y=[[0,r(0,0,1,0)],[1,r(0,0,1,R)]],M=r(1,0,0,R),P=[[0,r(j,j,j,0)],[1,r(j,j,j,R)]];function $(e){const o=new b,r=o.fragment;o.include(n),o.include(l);const{visualization:a}=e;r.constants.add("inverseSampleValue","float",C),r.uniforms.add(new g("shadowCastMap",e=>e.shadowCastMap),new i("sampleScale",e=>e.sampleScale),new h("opacityFromElevation",e=>e.opacityFromElevation));const f=2===a,S=3===a,R=1===a;S&&r.include(t);const j=!f;switch(j&&r.code.add(c`vec4 evaluateColorRamp(float value) {
3
3
  if (value <= vvColorValues[0]) {
4
4
  return vvColorColors[0];
5
5
  }
@@ -10,31 +10,31 @@ return mix(vvColorColors[i-1], vvColorColors[i], f);
10
10
  }
11
11
  }
12
12
  return vvColorColors[colorRampSize - 1];
13
- }`),a){case 0:r.uniforms.add(new m("vvColorColors",w,e=>e.gradientColorRamp.flatMap(([e,o])=>s($,o))),new v("colorRampSize",e=>e.gradientColorRamp.length),new p("vvColorValues",w,e=>e.gradientColorRamp.map(([e,o])=>e)));break;case 1:r.uniforms.add(new m("vvColorColors",w,e=>e.bandedGradientColorRamp.flatMap(([e,o])=>s($,o))),new v("colorRampSize",e=>e.bandedGradientColorRamp.length),new p("vvColorValues",w,e=>e.bandedGradientColorRamp.map(([e,o])=>e)),new h("bandSize",e=>e.bandSize));break;case 3:r.uniforms.add(new d("uColor",e=>s($,e.thresholdColor)),new h("threshold",e=>e.threshold),new m("vvColorColors",w,e=>e.gradientColorRamp.flatMap(([e,o])=>s($,o))),new v("colorRampSize",e=>e.gradientColorRamp.length),new p("vvColorValues",w,e=>e.gradientColorRamp.map(([e,o])=>e)));break;case 2:r.uniforms.add(new d("uColor",e=>s($,e.thresholdColor)),new h("threshold",e=>e.threshold))}const{type:j,selector:y,thresholdStrengthSelector:M}=S?{type:"vec2",selector:"rg",thresholdStrengthSelector:"strength.x"}:{type:"float",selector:"r",thresholdStrengthSelector:"strength"};return r.main.add(c`
14
- ${j} numSamples = texture(shadowCastMap, uv).${y} * inverseSampleValue;
13
+ }`),a){case 0:r.uniforms.add(new m("vvColorColors",w,e=>e.gradientColorRamp.flatMap(([e,o])=>s(z,o))),new v("colorRampSize",e=>e.gradientColorRamp.length),new p("vvColorValues",w,e=>e.gradientColorRamp.map(([e,o])=>e)));break;case 1:r.uniforms.add(new m("vvColorColors",w,e=>e.bandedGradientColorRamp.flatMap(([e,o])=>s(z,o))),new v("colorRampSize",e=>e.bandedGradientColorRamp.length),new p("vvColorValues",w,e=>e.bandedGradientColorRamp.map(([e,o])=>e)),new h("bandSize",e=>e.bandSize));break;case 3:r.uniforms.add(new d("uColor",e=>s(z,e.thresholdColor)),new h("threshold",e=>e.threshold),new m("vvColorColors",w,e=>e.gradientColorRamp.flatMap(([e,o])=>s(z,o))),new v("colorRampSize",e=>e.gradientColorRamp.length),new p("vvColorValues",w,e=>e.gradientColorRamp.map(([e,o])=>e)));break;case 2:r.uniforms.add(new d("uColor",e=>s(z,e.thresholdColor)),new h("threshold",e=>e.threshold))}const{type:y,selector:M,thresholdStrengthSelector:P}=S?{type:"vec2",selector:"rg",thresholdStrengthSelector:"strength.x"}:{type:"float",selector:"r",thresholdStrengthSelector:"strength"};return r.main.add(c`
14
+ ${y} numSamples = texture(shadowCastMap, uv).${M} * inverseSampleValue;
15
15
 
16
16
  fragColor = vec4(0.0);
17
17
 
18
- // early out if we do not have any samples in one or more channels
19
- if (dot(numSamples, ${j}(1)) < 1.0) {
18
+ // early out if we do not have any samples in one or more channels and 0 samples would be fully transparent
19
+ if (${u(j,c`vvColorColors[0].a == 0.0 && `,"")}dot(numSamples, ${y}(1)) < 1.0) {
20
20
  return;
21
21
  }
22
22
 
23
23
  // sampleScale is the number of total samples taken, so this brings strength to a 0-1 range.
24
24
  // note that sampleScale is always a vec2 even if we have only the primary channel.
25
- ${j} strength = numSamples * sampleScale.${y};
25
+ ${y} strength = numSamples * sampleScale.${M};
26
26
 
27
27
  // in threshold mode, step the strength to 0 if we are at or below the threshold, 1 otherwise.
28
28
  ${u(f||S,c`
29
- ${M} = 1.0 - step(${M}, threshold);
29
+ ${P} = 1.0 - step(${P}, threshold);
30
30
  `)}
31
31
 
32
32
  // bail out if we are below the threshold
33
- ${u(f,c`if (${M} == 0.0) { return; }`)}
33
+ ${u(f,c`if (${P} == 0.0) { return; }`)}
34
34
 
35
35
  ${u(R,c`strength = ceil(strength / bandSize) * bandSize;`)}
36
36
 
37
- ${j} attenuation = opacityFromElevation * strength;
37
+ ${y} attenuation = opacityFromElevation * strength;
38
38
 
39
39
  ${u(S,c`
40
40
  vec4 thresholdColor = uColor * attenuation.r;
@@ -45,4 +45,4 @@ return vvColorColors[colorRampSize - 1];
45
45
  `,c`
46
46
  fragColor = evaluateColorRamp(attenuation);
47
47
  `))}
48
- `),o}const $=a(),V=Object.freeze(Object.defineProperty({__proto__:null,ShadowCastVisualizePassParameters:S,build:z},Symbol.toStringTag,{value:"Module"}));export{S,V as a,z as b};
48
+ `),o}const z=a(),V=Object.freeze(Object.defineProperty({__proto__:null,ShadowCastVisualizePassParameters:S,build:$},Symbol.toStringTag,{value:"Module"}));export{S,V as a,$ as b};
package/config.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.1.0-next.83";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
2
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.1.0-next.85";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{toConst as n}from"./compilerUtils.js";import t from"./RandomLCG.js";const e=1.5,r=1/e,o=.5;function l(n,t){if(!t)return n;for(const e of t)n.push(e);return n}function u(n){return n}function f(n,t=u){if(!n||0===n.length)return;let e=n[0],r=t(e);for(let o=1;o<n.length;++o){const l=n[o],u=Number(t(l));u>r&&(r=u,e=l)}return e}function i(n,t=u){return f(n,n=>-t(n))}function c(n,t){if(t){const e=[];for(const r of n)e.some(n=>t(n,r))||e.push(r);return e}return Array.from(new Set(n))}function s(n,t,e,r,o,l,u){if(null==n&&null==r)return!0;t=Math.max(0,t),o=Math.max(0,o),e=Math.max(0,e<0?(n?.length??0)+e:e),l=Math.max(0,l<0?(r?.length??0)+l:l);const f=e-t;if(null==n||null==r||f!==l-o)return!1;if(u){for(let i=0;i<f;i++)if(!u(n[t+i],r[o+i]))return!1}else for(let i=0;i<f;i++)if(n[t+i]!==r[o+i])return!1;return!0}function h(n,t,e){return s(n,0,n?.length??0,t,0,t?.length??0,e)}function a(){return(n,t)=>{if(null==n&&null==t)return!0;if(null==n||null==t||n.length!==t.length)return!1;for(let e=0;e<n.length;e++)if(n[e]!==t[e])return!1;return!0}}const g=a();function m(n,t){let e=n.length!==t.length;e&&(n.length=t.length);for(let r=0;r<t.length;++r)n[r]!==t[r]&&(n[r]=t[r],e=!0);return e}function d(n,t,e){let r,o;return e?(r=t.filter(t=>!n.some(n=>e(n,t))),o=n.filter(n=>!t.some(t=>e(t,n)))):(r=t.filter(t=>!n.includes(t)),o=n.filter(n=>!t.includes(n))),{added:r,removed:o}}function p(n,t,e){return n&&t?e?n.filter(n=>t.findIndex(t=>e(n,t))>-1):n.filter(n=>t.includes(n)):[]}function M(n){return n&&"number"==typeof n.length}function x(n,t){const e=n.length;if(0===e)return[];const r=[];for(let o=0;o<e;o+=t)r.push(n.slice(o,o+t));return r}function N(n,t){void 0===t&&(t=n,n=0);const e=new Array(t-n);for(let r=n;r<t;r++)e[r-n]=r;return e}function w(n,t,e){const r=n.length;let o=0,l=r-1;for(;o<l;){const e=o+Math.floor((l-o)/2);t>n[e]?o=e+1:l=e}const u=n[o];return e?t>=n[r-1]?-1:u===t?o:o-1:u===t?o:-1}function y(n,t,e,r){n.length>e&&(n.length=e);const o=n.length;let l=0,u=o;if(o===e){const e=r(n[o-1],t);if(e<=0||Number.isNaN(e))return}for(;l<u;){const e=l+u>>>1,o=r(n[e],t);o<=0||Number.isNaN(o)?l=e+1:u=e}o===e&&n.pop(),n.splice(l,0,t)}class b{constructor(){this.last=0}}const A=new b;function S(n,t,e,r){r=r||A;const o=Math.max(0,r.last-10);for(let u=o;u<e;++u)if(n[u]===t)return r.last=u,u;const l=Math.min(o,e);for(let u=0;u<l;++u)if(n[u]===t)return r.last=u,u;return-1}function j(t,e,r,o){const l=r??t.length,u=S(t,n(e),l,o);if(-1!==u)return t[u]=t[l-1],null==r&&t.pop(),e}const v=new Set;function z(n,t,e=n.length,r=t.length,o,l){if(0===r||0===e)return e;v.clear();for(let f=0;f<r;++f)v.add(t[f]);o=o||A;const u=Math.max(0,o.last-10);for(let f=u;f<e;++f)if(v.has(n[f])&&(l?.push(n[f]),v.delete(n[f]),n[f]=n[e-1],--e,--f,0===v.size||0===e))return v.clear(),e;for(let f=0;f<u;++f)if(v.has(n[f])&&(l?.push(n[f]),v.delete(n[f]),n[f]=n[e-1],--e,--f,0===v.size||0===e))return v.clear(),e;return v.clear(),e}function C(n,t){let e=0;for(let r=0;r<n.length;++r){const o=n[r];t(o,r)&&(n[e]=o,e++)}return n.length=e,n}function F(n,t,e){const r=n.length;if(t>=r)return n.slice();const o=G(e),l=new Set,u=[];for(;u.length<t;){const t=Math.floor(o()*r);l.has(t)||(l.add(t),u.push(n[t]))}return u}function G(n){return n?(I.seed=n,()=>I.getFloat()):Math.random}const I=new t;function L(n,t){if(!n)return n;const e=G(t);for(let r=n.length-1;r>0;r--){const t=Math.floor(e()*(r+1)),o=n[r];n[r]=n[t],n[t]=o}return n}function O(n,t){const e=n.indexOf(t);return-1!==e?(n.splice(e,1),t):null}function R(n,t){return null!=n}function U(n,...t){for(const e of t)null!=e&&n.push(e);return n.length}function k(n,t){return n.reduce((n,e)=>t(e)?n+1:n,0)}function q(n){return Array.isArray(n)}function B(n,t,e){for(t<n.length&&(n.length=t);n.length<t;)n.push(e())}function D(n,t){return n-t}const E=[];export{b as PositionHint,l as addMany,w as binaryIndexOf,k as countIf,d as difference,E as emptyArray,h as equals,C as filterInPlace,G as getRandomNumberGenerator,S as indexOf,y as insertSortedStableTopN,p as intersect,M as isArrayLike,q as isArrayWithReadonly,R as isSome,a as makeArrayEquals,f as max,i as min,g as numbersEquals,D as numericSort,F as pickRandom,U as pushIfSome,N as range,e as reallocGrowthFactor,r as reallocShrinkFactor,o as reallocShrinkThreshold,O as remove,j as removeUnordered,z as removeUnorderedMany,B as resizeFilled,L as shuffle,s as sliceEquals,x as splitIntoChunks,c as unique,m as update};
2
+ import{toConst as n}from"./compilerUtils.js";import t from"./RandomLCG.js";const e=1.5,r=1/e,o=.5;function l(n,t){if(!t)return n;for(const e of t)n.push(e);return n}function u(n){return n}function f(n,t=u){if(!n||0===n.length)return;let e=n[0],r=t(e);for(let o=1;o<n.length;++o){const l=n[o],u=Number(t(l));u>r&&(r=u,e=l)}return e}function c(n,t=u){return f(n,n=>-t(n))}function i(n,t){if(t){const e=[];for(const r of n)e.some(n=>t(n,r))||e.push(r);return e}return Array.from(new Set(n))}function s(n,t,e,r,o,l,u){if(null==n&&null==r)return!0;t=Math.max(0,t),o=Math.max(0,o),e=Math.max(0,e<0?(n?.length??0)+e:e),l=Math.max(0,l<0?(r?.length??0)+l:l);const f=e-t;if(null==n||null==r||f!==l-o)return!1;if(u){for(let c=0;c<f;c++)if(!u(n[t+c],r[o+c]))return!1}else for(let c=0;c<f;c++)if(n[t+c]!==r[o+c])return!1;return!0}function h(n,t,e){return s(n,0,n?.length??0,t,0,t?.length??0,e)}function a(){return(n,t)=>{if(null==n&&null==t)return!0;if(null==n||null==t||n.length!==t.length)return!1;for(let e=0;e<n.length;e++)if(n[e]!==t[e])return!1;return!0}}const g=a();function m(n,t){let e=n.length!==t.length;e&&(n.length=t.length);for(let r=0;r<t.length;++r)n[r]!==t[r]&&(n[r]=t[r],e=!0);return e}function d(n,t,e){let r,o;return e?(r=t.filter(t=>!n.some(n=>e(n,t))),o=n.filter(n=>!t.some(t=>e(t,n)))):(r=t.filter(t=>!n.includes(t)),o=n.filter(n=>!t.includes(n))),{added:r,removed:o}}function p(n,t,e){return n&&t?e?n.filter(n=>t.findIndex(t=>e(n,t))>-1):n.filter(n=>t.includes(n)):[]}function M(n){return n&&"number"==typeof n.length}function x(n,t){const e=n.length;if(0===e)return[];const r=[];for(let o=0;o<e;o+=t)r.push(n.slice(o,o+t));return r}function N(n,t){void 0===t&&(t=n,n=0);const e=new Array(t-n);for(let r=n;r<t;r++)e[r-n]=r;return e}function w(n,t,e){const r=n.length;let o=0,l=r-1;for(;o<l;){const e=o+Math.floor((l-o)/2);t>n[e]?o=e+1:l=e}const u=n[o];return e?t>=n[r-1]?-1:u===t?o:o-1:u===t?o:-1}function y(n,t=1){const e=t/n.reduce((n,t)=>n+t,0);for(let r=0;r<n.length;++r)n[r]*=e}function b(n,t,e,r){n.length>e&&(n.length=e);const o=n.length;let l=0,u=o;if(o===e){const e=r(n[o-1],t);if(e<=0||Number.isNaN(e))return}for(;l<u;){const e=l+u>>>1,o=r(n[e],t);o<=0||Number.isNaN(o)?l=e+1:u=e}o===e&&n.pop(),n.splice(l,0,t)}class A{constructor(){this.last=0}}const S=new A;function j(n,t,e,r){r=r||S;const o=Math.max(0,r.last-10);for(let u=o;u<e;++u)if(n[u]===t)return r.last=u,u;const l=Math.min(o,e);for(let u=0;u<l;++u)if(n[u]===t)return r.last=u,u;return-1}function v(t,e,r,o){const l=r??t.length,u=j(t,n(e),l,o);if(-1!==u)return t[u]=t[l-1],null==r&&t.pop(),e}const z=new Set;function C(n,t,e=n.length,r=t.length,o,l){if(0===r||0===e)return e;z.clear();for(let f=0;f<r;++f)z.add(t[f]);o=o||S;const u=Math.max(0,o.last-10);for(let f=u;f<e;++f)if(z.has(n[f])&&(l?.push(n[f]),z.delete(n[f]),n[f]=n[e-1],--e,--f,0===z.size||0===e))return z.clear(),e;for(let f=0;f<u;++f)if(z.has(n[f])&&(l?.push(n[f]),z.delete(n[f]),n[f]=n[e-1],--e,--f,0===z.size||0===e))return z.clear(),e;return z.clear(),e}function F(n,t){let e=0;for(let r=0;r<n.length;++r){const o=n[r];t(o,r)&&(n[e]=o,e++)}return n.length=e,n}function G(n,t,e){const r=n.length;if(t>=r)return n.slice();const o=I(e),l=new Set,u=[];for(;u.length<t;){const t=Math.floor(o()*r);l.has(t)||(l.add(t),u.push(n[t]))}return u}function I(n){return n?(L.seed=n,()=>L.getFloat()):Math.random}const L=new t;function O(n,t){if(!n)return n;const e=I(t);for(let r=n.length-1;r>0;r--){const t=Math.floor(e()*(r+1)),o=n[r];n[r]=n[t],n[t]=o}return n}function R(n,t){const e=n.indexOf(t);return-1!==e?(n.splice(e,1),t):null}function U(n,t){return null!=n}function k(n,...t){for(const e of t)null!=e&&n.push(e);return n.length}function q(n,t){return n.reduce((n,e)=>t(e)?n+1:n,0)}function B(n){return Array.isArray(n)}function D(n,t,e){for(t<n.length&&(n.length=t);n.length<t;)n.push(e())}function E(n,t){return n-t}const H=[];export{A as PositionHint,l as addMany,w as binaryIndexOf,q as countIf,d as difference,H as emptyArray,h as equals,F as filterInPlace,I as getRandomNumberGenerator,j as indexOf,b as insertSortedStableTopN,p as intersect,M as isArrayLike,B as isArrayWithReadonly,U as isSome,a as makeArrayEquals,f as max,c as min,y as normalize,g as numbersEquals,E as numericSort,G as pickRandom,k as pushIfSome,N as range,e as reallocGrowthFactor,r as reallocShrinkFactor,o as reallocShrinkThreshold,R as remove,v as removeUnordered,C as removeUnorderedMany,D as resizeFilled,O as shuffle,s as sliceEquals,x as splitIntoChunks,i as unique,m as update};
package/core/has.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const e=globalThis,a={...e.esriConfig?.has};function has(d){return"function"==typeof a[d]?a[d]=a[d](e):a[d]}has.add=(e,d,r,t)=>{(t||void 0===a[e])&&(a[e]=d),r&&has(e)},has.cache=a,has.add("big-integer-warning-enabled",!0),has.add("esri-deprecation-warnings",!0),has.add("esri-tests-disable-screenshots",!1),has.add("esri-tests-use-full-window",!1),has.add("esri-tests-post-to-influx",!0),has.add("esri-cim-animations-enable-status","enabled"),has.add("esri-cim-animations-spotlight",!1),has.add("esri-cim-animations-freeze-time",!1),(()=>{has.add("host-webworker",void 0!==e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope);const a="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(has.add("host-browser",a),has.add("host-node",!("object"!=typeof e.process||!e.process.versions?.node||!e.process.versions.v8)),has.add("dom",a),has("host-browser")){const e=navigator,a=e.userAgent,d=e.appVersion,r=parseFloat(d);if(has.add("wp",parseFloat(a.split("Windows Phone")[1])||void 0),has.add("msapp",parseFloat(a.split("MSAppHost/")[1])||void 0),has.add("khtml",d.includes("Konqueror")?r:void 0),has.add("edge",parseFloat(a.split("Edge/")[1])||void 0),has.add("opr",parseFloat(a.split("OPR/")[1])||void 0),has.add("webkit",!has("wp")&&!has("edge")&&parseFloat(a.split("WebKit/")[1])||void 0),has.add("chrome",!has("edge")&&!has("opr")&&parseFloat(a.split("Chrome/")[1])||void 0),has.add("android",!has("wp")&&parseFloat(a.split("Android ")[1])||void 0),has.add("safari",!d.includes("Safari")||has("wp")||has("chrome")||has("android")||has("edge")||has("opr")?void 0:parseFloat(d.split("Version/")[1])),has.add("mac",d.includes("Macintosh")),!has("wp")&&/(iPhone|iPod|iPad)/.test(a)){const e=RegExp.$1.replace(/P/,"p"),d=/OS ([\d_]+)/.test(a)?RegExp.$1:"1",r=parseFloat(d.replace(/_/,".").replaceAll("_",""));has.add(e,r),has.add("ios",r)}has("webkit")||(!a.includes("Gecko")||has("wp")||has("khtml")||has("edge")||has.add("mozilla",r),has("mozilla")&&has.add("ff",parseFloat(a.split("Firefox/")[1]||a.split("Minefield/")[1])||void 0))}})(),(()=>{if(e.navigator){const e=navigator.userAgent,a=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),d=/iPhone/i.test(e);a&&has.add("esri-mobile",a),d&&has.add("esri-iPhone",d),has.add("esri-geolocation",!!navigator.geolocation)}has.add("esri-wasm","WebAssembly"in e),has.add("esri-performance-mode-frames-between-render",20),has.add("esri-force-performance-mode",!1),has.add("esri-shared-array-buffer",()=>{const a="SharedArrayBuffer"in e,d=!1===e.crossOriginIsolated;return a&&!d}),has.add("wasm-simd",()=>{const e=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(e))}),has.add("esri-atomics","Atomics"in e),has.add("esri-workers","Worker"in e),has.add("web-feat:cache","caches"in e),has.add("esri-workers-arraybuffer-transfer",!has("safari")||Number(has("safari"))>=12),has.add("min-workers-pool-size",2),has.add("max-workers-pool-size",has("esri-mobile")?3:8),has.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),has.add("featurelayer-simplify-payload-size-factors",[1,1,4]),has.add("featurelayer-animation-enabled",!0),has.add("featurelayer-snapshot-enabled",!0),has.add("featurelayer-snapshot-initial-tolerance",0),has.add("featurelayer-snapshot-point-min-threshold",8e4),has.add("featurelayer-snapshot-point-max-threshold",4e5),has.add("featurelayer-snapshot-multipoint-min-threshold",2e4),has.add("featurelayer-snapshot-multipoint-max-threshold",1e5),has.add("featurelayer-snapshot-polygon-min-threshold",2e3),has.add("featurelayer-snapshot-polygon-max-threshold",2e3),has.add("featurelayer-snapshot-polyline-min-threshold",2e3),has.add("featurelayer-snapshot-polyline-max-threshold",2e3),has.add("featurelayer-snapshot-max-vertex-count",25e4),has.add("featurelayer-snapshot-non-hosted-exceedslimit-enabled",!0),has.add("featurelayer-snapshot-concurrency",4),has.add("featurelayer-snapshot-allow-editable",!1),has.add("featurelayer-snapshot-coverage",.1),has.add("featurelayer-query-max-depth",4),has.add("featurelayer-query-max-page-size",8e3),has.add("featurelayer-query-pausing-enabled",!1),has.add("featurelayer-query-tile-concurrency",4),has.add("featurelayer-query-tile-max-features",6e5),has.add("featurelayer-advanced-symbols",!1),has.add("featurelayer-pbf",!0),has.add("featurelayer-pbf-statistics",!1),has.add("featurelayer-pbf-true-curves",!0),has.add("feature-layers-workers",!0),has.add("feature-polyline-generalization-factor",1),has.add("featurelayer-relative-time-queries-enabled",!0),has.add("featurelayer-relative-time-queries-bin-window-public",1),has.add("featurelayer-relative-time-queries-bin-window-private",60),has.add("parquetlayer-full-query-feature-count",2e4),has.add("parquetlayer-hittest-max-feature-count",1),has.add("parquetlayer-persistence-enabled",!1),has.add("parquetlayer-cache-enabled",!0),has.add("mapview-transitions-duration",200),has.add("mapview-essential-goto-duration",200),has.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),has.add("mapserver-pbf-version-support",10.81),has.add("mapservice-popup-identify-max-tolerance",20),has.add("request-queue-concurrency-global",50),has.add("request-queue-concurrency-hosted",16),has.add("request-queue-concurrency-non-hosted",10),has.add("curve-densification-coarse-segments",128),has.add("curve-densification-max-segments",2e3),has.add("curve-densification-min-segments",3),has.add("curve-densification-pixel-deviation",.5),has.add("view-readyState-waiting-delay",1e3),has.add("gradient-depth-bias",.01),has.add("gradient-depth-epsilon",1e-8),has.add("enable-feature:esri-compress-textures",!0),has.add("enable-feature:basemap-groundlayers",!0),has.add("enable-feature:im-shading",!0),has.add("enable-feature:im-vertex-normals",!0),!has("host-webworker")&&has("host-browser")&&(has.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),has.add("esri-url-encodes-apostrophe",()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")}))})();export{has as default};
2
+ const e=globalThis,a={...e.esriConfig?.has};function has(d){return"function"==typeof a[d]?a[d]=a[d](e):a[d]}has.add=(e,d,r,t)=>{(t||void 0===a[e])&&(a[e]=d),r&&has(e)},has.cache=a,has.add("big-integer-warning-enabled",!0),has.add("esri-deprecation-warnings",!0),has.add("esri-tests-disable-screenshots",!1),has.add("esri-tests-use-full-window",!1),has.add("esri-tests-post-to-influx",!0),has.add("esri-cim-animations-enable-status","enabled"),has.add("esri-cim-animations-spotlight",!1),has.add("esri-cim-animations-freeze-time",!1),(()=>{has.add("host-webworker",void 0!==e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope);const a="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(has.add("host-browser",a),has.add("host-node",!("object"!=typeof e.process||!e.process.versions?.node||!e.process.versions.v8)),has.add("dom",a),has("host-browser")){const e=navigator,a=e.userAgent,d=e.appVersion,r=parseFloat(d);if(has.add("wp",parseFloat(a.split("Windows Phone")[1])||void 0),has.add("msapp",parseFloat(a.split("MSAppHost/")[1])||void 0),has.add("khtml",d.includes("Konqueror")?r:void 0),has.add("edge",parseFloat(a.split("Edge/")[1])||void 0),has.add("opr",parseFloat(a.split("OPR/")[1])||void 0),has.add("webkit",!has("wp")&&!has("edge")&&parseFloat(a.split("WebKit/")[1])||void 0),has.add("chrome",!has("edge")&&!has("opr")&&parseFloat(a.split("Chrome/")[1])||void 0),has.add("android",!has("wp")&&parseFloat(a.split("Android ")[1])||void 0),has.add("safari",!d.includes("Safari")||has("wp")||has("chrome")||has("android")||has("edge")||has("opr")?void 0:parseFloat(d.split("Version/")[1])),has.add("mac",d.includes("Macintosh")),!has("wp")&&/(iPhone|iPod|iPad)/.test(a)){const e=RegExp.$1.replace(/P/,"p"),d=/OS ([\d_]+)/.test(a)?RegExp.$1:"1",r=parseFloat(d.replace(/_/,".").replaceAll("_",""));has.add(e,r),has.add("ios",r)}has("webkit")||(!a.includes("Gecko")||has("wp")||has("khtml")||has("edge")||has.add("mozilla",r),has("mozilla")&&has.add("ff",parseFloat(a.split("Firefox/")[1]||a.split("Minefield/")[1])||void 0))}})(),(()=>{if(e.navigator){const e=navigator.userAgent,a=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),d=/iPhone/i.test(e);a&&has.add("esri-mobile",a),d&&has.add("esri-iPhone",d),has.add("esri-geolocation",!!navigator.geolocation)}has.add("esri-wasm","WebAssembly"in e),has.add("esri-performance-mode-frames-between-render",20),has.add("esri-force-performance-mode",!1),has.add("esri-shared-array-buffer",()=>{const a="SharedArrayBuffer"in e,d=!1===e.crossOriginIsolated;return a&&!d}),has.add("wasm-simd",()=>{const e=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(e))}),has.add("esri-atomics","Atomics"in e),has.add("esri-workers","Worker"in e),has.add("web-feat:cache","caches"in e),has.add("esri-workers-arraybuffer-transfer",!has("safari")||Number(has("safari"))>=12),has.add("min-workers-pool-size",2),has.add("max-workers-pool-size",has("esri-mobile")?3:8),has.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),has.add("featurelayer-simplify-payload-size-factors",[1,1,4]),has.add("featurelayer-animation-enabled",!0),has.add("featurelayer-snapshot-enabled",!0),has.add("featurelayer-snapshot-initial-tolerance",0),has.add("featurelayer-snapshot-point-min-threshold",8e4),has.add("featurelayer-snapshot-point-max-threshold",4e5),has.add("featurelayer-snapshot-multipoint-min-threshold",2e4),has.add("featurelayer-snapshot-multipoint-max-threshold",1e5),has.add("featurelayer-snapshot-polygon-min-threshold",2e3),has.add("featurelayer-snapshot-polygon-max-threshold",2e3),has.add("featurelayer-snapshot-polyline-min-threshold",2e3),has.add("featurelayer-snapshot-polyline-max-threshold",2e3),has.add("featurelayer-snapshot-max-vertex-count",25e4),has.add("featurelayer-snapshot-non-hosted-exceedslimit-enabled",!0),has.add("featurelayer-snapshot-concurrency",4),has.add("featurelayer-snapshot-allow-editable",!1),has.add("featurelayer-snapshot-coverage",.1),has.add("featurelayer-query-max-depth",4),has.add("featurelayer-query-max-page-size",8e3),has.add("featurelayer-query-pausing-enabled",!1),has.add("featurelayer-query-tile-concurrency",4),has.add("featurelayer-query-tile-max-features",6e5),has.add("featurelayer-advanced-symbols",!1),has.add("featurelayer-pbf",!0),has.add("featurelayer-pbf-statistics",!1),has.add("featurelayer-pbf-true-curves",!0),has.add("feature-layers-workers",!0),has.add("feature-polyline-generalization-factor",1),has.add("featurelayer-relative-time-queries-enabled",!0),has.add("featurelayer-relative-time-queries-bin-window-public",1),has.add("featurelayer-relative-time-queries-bin-window-private",60),has.add("parquetlayer-full-query-feature-count",2e4),has.add("parquetlayer-hittest-max-feature-count",1),has.add("parquetlayer-persistence-enabled",!1),has.add("parquetlayer-cache-enabled",!0),has.add("mapview-transitions-duration",200),has.add("mapview-essential-goto-duration",200),has.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),has.add("mapserver-pbf-version-support",10.81),has.add("mapservice-popup-identify-max-tolerance",20),has.add("request-queue-concurrency-global",50),has.add("request-queue-concurrency-hosted",16),has.add("request-queue-concurrency-non-hosted",10),has.add("curve-densification-coarse-segments",128),has.add("curve-densification-max-segments",2e3),has.add("curve-densification-min-segments",3),has.add("curve-densification-pixel-deviation",.5),has.add("view-readyState-waiting-delay",1e3),has.add("gradient-depth-bias",.01),has.add("gradient-depth-epsilon",1e-8),has.add("enable-feature:analysis-drawtool-line-of-sight",!1),has.add("enable-feature:esri-compress-textures",!0),has.add("enable-feature:analysis-new-viewshed-tool",!1),has.add("enable-feature:basemap-groundlayers",!0),has.add("enable-feature:im-shading",!0),has.add("enable-feature:im-vertex-normals",!0),!has("host-webworker")&&has("host-browser")&&(has.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),has.add("esri-url-encodes-apostrophe",()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")}))})();export{has as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const n=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i,t="screenUtils.toPt: input not recognized!",r=96;function u(n){return n?n/72*r:0}function e(n){return n?72*n/r:0}function o(r){if("string"==typeof r){const u=r.match(n);if(u){const n=Number(u[1]),t=u[3]&&u[3].toLowerCase(),o=r.startsWith("-"),i="px"===t?e(n):n;return o?-i:i}return console.warn(t),null}return r}function i(n=0,t=0){return{x:n,y:t}}function c(n){return n?i(n.x,n.y):null}function f(n=0,t=0){return[n,t]}function x(n=0,t=0){return{x:n,y:t}}function l(n=0,t=0){return y([n,t])}function s(n=0,t=0,r=0){return p([n,t,r])}function y(n){return n}function p(n){return n}function a(n){return n}function d(n,t){return t?(t.x=n[0],t.y=n[1],t):{x:n[0],y:n[1]}}function g(n,t){return t?(t[0]=n.x,t[1]=n.y,t.length>2&&(t[2]=0),t):[n.x,n.y]}function h(n,t){return n===t||null==n&&null==t||n?.x===t?.x&&n?.y===t?.y}export{y as castRenderScreenPointArray,p as castRenderScreenPointArray3,a as castScreenPointArray,c as cloneScreenPoint,x as createRenderScreenPoint,l as createRenderScreenPointArray,s as createRenderScreenPointArray3,i as createScreenPoint,f as createScreenPointArray,u as pt2px,e as px2pt,d as screenPointArrayToObject,h as screenPointEqual,g as screenPointObjectToArray,o as toPt};
2
+ const n=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i,t="screenUtils.toPt: input not recognized!",r=96;function u(n){return n?n/72*r:0}function e(n){return n?72*n/r:0}function o(r){if("string"==typeof r){const u=r.match(n);if(u){const n=Number(u[1]),t=u[3]&&u[3].toLowerCase(),o=r.startsWith("-"),i="px"===t?e(n):n;return o?-i:i}return console.warn(t),null}return r}function i(n=0,t=0){return{x:n,y:t}}function c(n=0,t=0,r=0,u=0){return{x:n,y:t,width:r,height:u}}function f(n){return n?i(n.x,n.y):null}function x(n=0,t=0){return[n,t]}function l(n=0,t=0){return{x:n,y:t}}function s(n=0,t=0){return h([n,t])}function y(n=0,t=0,r=0){return p([n,t,r])}function h(n){return n}function p(n){return n}function a(n){return n}function d(n,t){return t?(t.x=n[0],t.y=n[1],t):{x:n[0],y:n[1]}}function g(n,t){return t?(t[0]=n.x,t[1]=n.y,t.length>2&&(t[2]=0),t):[n.x,n.y]}function w(n,t){return n===t||null==n&&null==t||n?.x===t?.x&&n?.y===t?.y}export{h as castRenderScreenPointArray,p as castRenderScreenPointArray3,a as castScreenPointArray,f as cloneScreenPoint,l as createRenderScreenPoint,s as createRenderScreenPointArray,y as createRenderScreenPointArray3,i as createScreenPoint,x as createScreenPointArray,c as createScreenRect,u as pt2px,e as px2pt,d as screenPointArrayToObject,w as screenPointEqual,g as screenPointObjectToArray,o as toPt};
package/form/types.d.ts CHANGED
@@ -22,4 +22,4 @@ export type FormElementUnion = AttachmentElement | FieldElement | GroupElement |
22
22
  *
23
23
  * @since 5.0
24
24
  */
25
- export type NestableFormElementUnion = Exclude<FormElementUnion, GroupElement | UtilityNetworkAssociationsElement | AttachmentElement>;
25
+ export type NestableFormElementUnion = Exclude<FormElementUnion, GroupElement | AttachmentElement>;
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{baseObjectMemory as t,estimateNumberMemory as e}from"../core/memoryEstimations.js";import{decodeGeohashXY as o}from"./geohashUtils.js";import s from"../geometry/SpatialReference.js";import{convertFromPolygon as i,quantizeOptimizedGeometry as r,convertFromPoint as h}from"../layers/graphics/featureConversionUtils.js";import{project as a}from"../layers/graphics/data/projectionSupport.js";import{AAggregateCell as n}from"../views/2d/layers/features/aggregation/AAggregateCell.js";import{AccumulatedStatistics as l}from"../views/2d/layers/features/aggregation/AccumulatedStatistics.js";const d=32;class c extends n{static create(t,e,o,s){const i=l.create(t),r=new Array(d);for(let h=0;h<r.length;h++)r[h]=null;return new c(i,e,o,s,r)}constructor(t,e,o,s,i){super(t),this.xNode=e,this.yNode=o,this.depth=s,this.children=i,this._objectIds=new Set,this._count=0,this._xWorldTotal=0,this._yWorldTotal=0,this._xGeohashTotal=0,this._yGeohashTotal=0,this.next=null}static get estimatedMemory(){let o=0;return o+=2*t,o+=e*d,o+=l.estimatedMemory,o}get id(){return`${this.xNode}.${this.yNode}`}get containedObjectIds(){return this._objectIds}get count(){return this._count}clone(){const t=new c(this._statistics.clone(),this.xNode,this.yNode,this.depth,this.children);return t._count=this._count,t._xWorldTotal=this._xWorldTotal,t._yWorldTotal=this._yWorldTotal,t._xGeohashTotal=this._xGeohashTotal,t._yGeohashTotal=this._yGeohashTotal,t.next=this.next,t._objectIds=new Set(this._objectIds),t}insert(t,e,o,s,i,r){this._count+=1,this._xWorldTotal+=e,this._yWorldTotal+=o,this._xGeohashTotal+=s,this._yGeohashTotal+=i,this._statistics.insert(t,r),this._objectIds.add(t.getObjectId())}merge(t){if(0!==t._count){this._count+=t._count,this._xWorldTotal+=t._xWorldTotal,this._yWorldTotal+=t._yWorldTotal,this._xGeohashTotal+=t._xWorldTotal,this._yGeohashTotal+=t._yWorldTotal,this._statistics.merge(t._statistics);for(const e of t._objectIds.values())this._objectIds.add(e)}}getCentroid(t){throw new Error("getCentroid not supported for GeohashNode")}getGeometry(t,e){const o=this._getLngLatBounds(),[h,n,l,d]=o,c=a({rings:[[[h,n],[h,d],[l,d],[l,n],[h,n]]]},s.WGS84,t),_=i(c);return null!=e?r(_,"esriGeometryPolygon",e,!1,!1):_}getGeometricCentroid(t,e){const o=this._getLngLatBounds(),[i,n,l,d]=o,c=a({x:(i+l)/2,y:(n+d)/2},s.WGS84,t),_=h(c);return null!=e?r(_,"esriGeometryPoint",e,!1,!1):_}getAttributes(){const t={aggregateId:this.id};for(const e of this._statistics.values())t[e.field.name]=e.value;return t.aggregateCount=this._count,t}find(t,e,o,s,i,r){if(s>=o)return this;const h=1-s%2,a=3*h+2*(1-h),n=2*h+3*(1-h),l=30-i-a,d=30-r-n,c=((t&7*h+3*(1-h)<<l)>>l)+((e&3*h+7*(1-h)<<d)>>d)*(8*h+4*(1-h)),_=this.children[c];return null==_?null:_.find(t,e,o,s+1,i+a,r+n)}_getLngLatBounds(){const t=this.depth,e=Math.ceil(t/2),s=Math.floor(t/2),i=30-(3*e+2*s),r=30-(2*e+3*s),h=this.xNode<<i,a=this.yNode<<r;return o({geohashX:h,geohashY:a},this.depth)}}export{c as GeohashCell};
2
+ import{baseObjectMemory as t,estimateNumberMemory as e}from"../core/memoryEstimations.js";import{getGeohash as o,decodeGeohashXY as s}from"./geohashUtils.js";import r from"../geometry/SpatialReference.js";import{convertFromPolygon as i,quantizeOptimizedGeometry as a,convertFromPoint as h}from"../layers/graphics/featureConversionUtils.js";import{project as n}from"../layers/graphics/data/projectionSupport.js";import{AAggregateCell as l}from"../views/2d/layers/features/aggregation/AAggregateCell.js";import{AccumulatedStatistics as d}from"../views/2d/layers/features/aggregation/AccumulatedStatistics.js";const c=32;class _ extends l{static create(t,e,o,s){const r=d.create(t),i=new Array(c);for(let a=0;a<i.length;a++)i[a]=null;return new _(r,e,o,s,i)}constructor(t,e,o,s,r){super(t),this.xNode=e,this.yNode=o,this.depth=s,this.children=r,this._objectIds=new Set,this._count=0,this._xWorldTotal=0,this._yWorldTotal=0,this._xGeohashTotal=0,this._yGeohashTotal=0,this.next=null}static get estimatedMemory(){let o=0;return o+=2*t,o+=e*c,o+=d.estimatedMemory,o}get id(){return`${this.xNode}.${this.yNode}`}get containedObjectIds(){return this._objectIds}get count(){return this._count}clone(){const t=new _(this._statistics.clone(),this.xNode,this.yNode,this.depth,this.children);return t._count=this._count,t._xWorldTotal=this._xWorldTotal,t._yWorldTotal=this._yWorldTotal,t._xGeohashTotal=this._xGeohashTotal,t._yGeohashTotal=this._yGeohashTotal,t.next=this.next,t._objectIds=new Set(this._objectIds),t}insert(t,e,s,r){let i=0,a=0;if("esriGeometryPoint"===t.geometryType)i=t.readXWorldSpace(),a=t.readYWorldSpace();else{const e=t.readCentroidWorldSpace();if(null==e)return;[i,a]=e.coords}const h=o(i,a,e,s);h&&(this._count+=1,this._xWorldTotal+=i,this._yWorldTotal+=a,this._xGeohashTotal+=h[0],this._yGeohashTotal+=h[1],this._statistics.insert(t,r),this._objectIds.add(t.getObjectId()))}merge(t){if(0!==t._count){this._count+=t._count,this._xWorldTotal+=t._xWorldTotal,this._yWorldTotal+=t._yWorldTotal,this._xGeohashTotal+=t._xWorldTotal,this._yGeohashTotal+=t._yWorldTotal,this._statistics.merge(t._statistics);for(const e of t._objectIds.values())this._objectIds.add(e)}}getCentroid(t){throw new Error("getCentroid not supported for GeohashNode")}getGeometry(t,e){const o=this._getLngLatBounds(),[s,h,l,d]=o,c=n({rings:[[[s,h],[s,d],[l,d],[l,h],[s,h]]]},r.WGS84,t),_=i(c);return null!=e?a(_,"esriGeometryPolygon",e,!1,!1):_}getGeometricCentroid(t,e){const o=this._getLngLatBounds(),[s,i,l,d]=o,c=n({x:(s+l)/2,y:(i+d)/2},r.WGS84,t),_=h(c);return null!=e?a(_,"esriGeometryPoint",e,!1,!1):_}getAttributes(){const t={aggregateId:this.id};for(const e of this._statistics.values())t[e.field.name]=e.value;return t.aggregateCount=this._count,t}find(t,e,o,s,r,i){if(s>=o)return this;const a=1-s%2,h=3*a+2*(1-a),n=2*a+3*(1-a),l=30-r-h,d=30-i-n,c=((t&7*a+3*(1-a)<<l)>>l)+((e&3*a+7*(1-a)<<d)>>d)*(8*a+4*(1-a)),_=this.children[c];return null==_?null:_.find(t,e,o,s+1,r+h,i+n)}_getLngLatBounds(){const t=this.depth,e=Math.ceil(t/2),o=Math.floor(t/2),r=30-(3*e+2*o),i=30-(2*e+3*o),a=this.xNode<<r,h=this.yNode<<i;return s({geohashX:a,geohashY:h},this.depth)}}export{_ as GeohashCell};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{GeohashCell as t}from"./GeohashCell.js";class e{constructor(e){this._fields=e,this._size=0,this._depth=0,this._root=t.create(this._fields,0,0,0)}destroy(){}get size(){return this._size}get depth(){return this._depth}get usedMemory(){return this._size*t.estimatedMemory}find(t,e,s){return this._root.find(t,e,s,0,0,0)}insert(e,s,i,o,n,h,r){let l=this._root,d=0,c=0,a=0;for(;null!==l;){if(l.insert(e,s,i,o,n,r),d>=h)return;const u=Math.ceil((d+1)/2),f=Math.floor((d+1)/2),_=1-d%2,x=30-(3*u+2*f),m=30-(2*u+3*f),M=(o&7*_+3*(1-_)<<x)>>x,p=(n&3*_+7*(1-_)<<m)>>m,g=M+p*(8*_+4*(1-_));c=c<<3*_+2*(1-_)|M,a=a<<2*_+3*(1-_)|p,null==l.children[g]&&(l.children[g]=t.create(this._fields,c,a,d+1),this._depth=Math.max(this._depth,d+1),this._size+=1),d+=1,l=l.children[g]}}putBins(t,e){for(const s of this.getNodes(e)){const e=t.get(s.id);e?e.merge(s):t.set(s.id,s.clone())}}getNodes(t){const e=[],{geohashBounds:s,level:i}=t;let o=this._root;for(;null!==o;){const t=o.depth,n=o.xNode,h=o.yNode;if(t>=i){e.push(o),o=o.next;continue}const r=Math.ceil((t+1)/2),l=Math.floor((t+1)/2),d=1-t%2,c=30-(3*r+2*l),a=30-(2*r+3*l),u=~((1<<c)-1),f=~((1<<a)-1),_=(s.xLL&u)>>c,x=(s.yLL&f)>>a,m=(s.xTR&u)>>c,M=(s.yTR&f)>>a,p=n<<3*d+2*(1-d),g=h<<2*d+3*(1-d),y=p+8*d+4*(1-d),z=g+4*d+8*(1-d),L=Math.max(p,_),N=Math.max(g,x),B=Math.min(y,m),R=Math.min(z,M);let T=null,j=null;for(let e=N;e<=R;e++)for(let t=L;t<=B;t++){const s=t-p+(e-g)*(8*d+4*(1-d)),i=o.children[s];i&&(T||(T=i,T.next=o.next),j&&(j.next=i),j=i,i.next=o.next)}o=T||o.next}return e}}export{e as GeohashTree};
2
+ import{baseObjectMemory as t,estimateNumberMemory as e}from"../core/memoryEstimations.js";const n=32;class i{static create(t,e,s){const r=new Array(n);for(let n=0;n<r.length;n++)r[n]=null;return new i(t,e,s,r)}constructor(t,e,n,i){this.xNode=t,this.yNode=e,this.depth=n,this.children=i,this.indices=[],this.next=null}static get estimatedMemory(){let i=0;return i+=2*t,i+=e*n,i+=4*e,i}get id(){return`${this.xNode}.${this.yNode}`}get count(){return this.indices.length}insert(t){this.indices.push(t)}find(t,e,n,i,s,r){if(i>=n)return this;const h=1-i%2,o=3*h+2*(1-h),l=2*h+3*(1-h),c=30-s-o,d=30-r-l,u=((t&7*h+3*(1-h)<<c)>>c)+((e&3*h+7*(1-h)<<d)>>d)*(8*h+4*(1-h)),a=this.children[u];return null==a?null:a.find(t,e,n,i+1,s+o,r+l)}}class s{constructor(){this._size=0,this._depth=0,this._root=i.create(0,0,0)}destroy(){}get size(){return this._size}get depth(){return this._depth}get usedMemory(){return this._size*i.estimatedMemory}find(t,e,n){return this._root.find(t,e,n,0,0,0)}insert(t,e,n,s){let r=this._root,h=0,o=0,l=0;for(;null!==r;){if(r.insert(t.getIndex()),h>=s)return;const c=Math.ceil((h+1)/2),d=Math.floor((h+1)/2),u=1-h%2,a=30-(3*c+2*d),x=30-(2*c+3*d),f=(e&7*u+3*(1-u)<<a)>>a,m=(n&3*u+7*(1-u)<<x)>>x,M=f+m*(8*u+4*(1-u));o=o<<3*u+2*(1-u)|f,l=l<<2*u+3*(1-u)|m,null==r.children[M]&&(r.children[M]=i.create(o,l,h+1),this._depth=Math.max(this._depth,h+1),this._size+=1),h+=1,r=r.children[M]}}forEachInBounds(t,e){const{geohashBounds:n,level:i}=t;let s=this._root;for(;null!==s;){const t=s.depth,r=s.xNode,h=s.yNode;if(t>=i){e(s),s=s.next;continue}const o=Math.ceil((t+1)/2),l=Math.floor((t+1)/2),c=1-t%2,d=30-(3*o+2*l),u=30-(2*o+3*l),a=~((1<<d)-1),x=~((1<<u)-1),f=(n.xLL&a)>>d,m=(n.yLL&x)>>u,M=(n.xTR&a)>>d,_=(n.yTR&x)>>u,y=r<<3*c+2*(1-c),g=h<<2*c+3*(1-c),p=y+8*c+4*(1-c),N=g+4*c+8*(1-c),z=Math.max(y,f),L=Math.max(g,m),w=Math.min(p,M),B=Math.min(N,_);let E=null,I=null;for(let e=L;e<=B;e++)for(let t=z;t<=w;t++){const n=t-y+(e-g)*(8*c+4*(1-c)),i=s.children[n];i&&(E||(E=i,E.next=s.next),I&&(I.next=i),I=i,i.next=s.next)}s=E||s.next}}}export{s as GeohashTree};
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.1";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.1.0-next.83",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
2
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.1";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.1.0-next.85",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as r}from"tslib";import o from"../../core/Accessor.js";import{property as e,subclass as t}from"../../core/accessorSupport/decorators.js";let s=class extends o{constructor(r){super(r),this.name="",this.size=0}arrayBuffer(r){return this.loadArrayBuffer(r)}};r([e({constructOnly:!0})],s.prototype,"loadArrayBuffer",void 0),r([e({constructOnly:!0})],s.prototype,"name",void 0),r([e({constructOnly:!0})],s.prototype,"size",void 0),s=r([t("esri.layers.scene.ModelFileInfo")],s);export{s as default};
2
+ import{__decorate as r}from"tslib";import o from"../../core/Accessor.js";import{property as t,subclass as e}from"../../core/accessorSupport/decorators.js";let s=class extends o{constructor(r){super(r),this.name="",this.size=0}arrayBuffer(r){return this.loadArrayBuffer(r)}};r([t({constructOnly:!0})],s.prototype,"flags",void 0),r([t({constructOnly:!0})],s.prototype,"loadArrayBuffer",void 0),r([t({constructOnly:!0})],s.prototype,"name",void 0),r([t({constructOnly:!0})],s.prototype,"size",void 0),s=r([e("esri.layers.scene.ModelFileInfo")],s);export{s as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../request.js";import{unique as t}from"../../core/arrayUtils.js";import o from"../../core/Error.js";import{getOrCreateMapValue as r}from"../../core/MapUtils.js";import{join as s}from"../../core/urlUtils.js";import n from"./ModelFileInfo.js";import a from"./ModelInfo.js";import{modelFormatFromFormatId as i,getFormatIdFormat as u,getFormatExtensions as l,formatIdFromModelFormat as c,getAssetMapTable as f}from"../support/infoFor3D.js";import{executeRawQueryJSON as d,executeQueryJSON as m}from"../../rest/query/executeQueryJSON.js";import p from"../../rest/support/Query.js";async function y(e,t,r,s){const n=e.infoFor3D;if(!n)throw new o("scenelayer:query-models-not-available","Model queries are not available without 3D object metadata",{layer:e});const{objectIdField:a,globalIdField:i}=t,{sourceHashField:u}=n;if(!a||!i||!u)throw new o("scenelayer:query-models-not-available","Missing required fields for model queries",{layer:e});const l=I(e,r,a,i,u),c=await t.queryFeatures(l,s);return await h(new H(e,t,w(c,u),n,s))}async function h(e){const{infoFor3D:t,associatedLayer:o,options:r}=e,s=o.globalIdField,n=o.parsedUrl;if(!s||!n)return new Map;const a=await b(e),c=t.sourceHashField,f=new Map,m=await Promise.all(a.map(async({formatId:n,objectIds:a})=>{const f=i(n,t.supportedFormats),m=o.parsedUrl;if(null==f||!m||!a.length)return null;const p=u(n,t.supportedFormats),y=l(p),h=o.createQuery();h.objectIds=a,h.outFields=[s,c],h.formatOf3DObjects=n,h.returnGeometry=!0;return{modelFormat:f,modelFileExtensions:y,featureSetJSON:await d(m.path,h,{query:e.requestQuery,signal:r?.signal},{uniqueIdFields:o.uniqueIdFields})}}));for(const i of m)i&&j(e,i.modelFormat,i.modelFileExtensions,i.featureSetJSON,f);return f}async function F(e,t,o,r){const s=r?.format;return((await y(e,t,{objectIds:[o]},{...r,requestedFormat:s,sourceOnly:null==s})).get(o)??[]).find(e=>s&&e.format===s||!s&&e.isSource)}function w(e,t){const o=new Map;for(const r of e.features){const e=r.getObjectId(),s=r.getGlobalId();null!=e&&null!=s&&o.set(e,{globalId:s,sourceHash:r.getAttribute(t)??null})}return o}async function b(e){const{options:o,infoFor3D:r,featureInfos:s}=e,n=[...s.keys()];if(o?.requestedFormat){const e=c(o.requestedFormat,r.supportedFormats);return e?[{formatId:e,objectIds:n}]:[]}const a=t([...r.queryFormats,...r.editFormats]);return await g(e,a)}async function g({options:e,infoFor3D:o,featureInfos:n,requestQuery:a,associatedLayer:i},u){const l=!!e?.sourceOnly,c=o.assetMapFieldRoles.parentGlobalId,d=o.assetMapFieldRoles.assetHash,y=o.assetMapFieldRoles.assetType,h=l?d:c,F=new Map;for(const[t,r]of n){const e=l?r.sourceHash:r.globalId;e&&F.set(t,e)}const w=t(F.values()),b=f(o);if(!b||!w.length)return[];const g=s(i.parsedUrl?.path??"",`../${b.id}`),I=new p({where:`${h} IN (${w.map(S).join(",")})`,outFields:[h,y],returnDistinctValues:!0,returnGeometry:!1}),q=await m(g,I,{query:a,signal:e?.signal}),j=new Set(u),M=new Map,D=new Set;for(const t of q.features){const e=t.getAttribute(h),o=t.getAttribute(y);o&&j.has(o)&&(e?r(M,e,()=>new Set).add(o):D.add(o))}if(!l&&!M.size&&D.size){const e=[...n.keys()];return u.filter(e=>D.has(e)).map(t=>({formatId:t,objectIds:e}))}const O=new Map;for(const[t,s]of F)for(const e of M.get(s)??[])r(O,e,()=>[]).push(t);return u.map(e=>({formatId:e,objectIds:O.get(e)??[]})).filter(({objectIds:e})=>e.length>0)}function I(e,t,o,r,s){const n=q(e,t);return n.outFields=[o,r,s],n.returnGeometry=!1,n}function q(e,t){const o=p.from(t)?.clone()??e.createQuery();return o.outFields=null,o.formatOf3DObjects=null,o.returnGeometry=!1,o}function j({featureInfos:e,requestQuery:t},o,s,n,i){const u=new Map;for(const a of n.assetMaps??[])r(u,a.parentGlobalId,()=>[]).push(a);for(const[l,c]of e){const e=u.get(c.globalId);if(!e?.length)continue;const n=M(e,t);if(!n.length)continue;const f=n.reduce((e,t)=>e+t.size,0),d=O(n,s),m=null!=c.sourceHash&&e.some(({assetHash:e})=>e===c.sourceHash);r(i,l,()=>[]).push(new a({name:d,size:f,format:o,isSource:m,files:n}))}}function M(e,t){const o=new Map;for(const n of e)r(o,n.assetName,()=>[]).push(n);const s=[];for(const[r,a]of o){a.sort((e,t)=>e.seqNo-t.seqNo);const e=a.reduce((e,t)=>e+t.size,0),o=a.map(({assetURL:e})=>e).filter(e=>!!e);o.length&&s.push(new n({name:r,size:e,loadArrayBuffer:e=>D(o,t,e)}))}return s}async function D(t,o,r){const s=await Promise.all(t.map(t=>e(t,{responseType:"array-buffer",query:o,signal:r?.signal}).then(({data:e})=>e)));return 1===s.length?s[0]:U(s)}function O(e,t){const o=e.find(({name:e})=>t.some(t=>e.toLowerCase().endsWith(`.${t}`)));return o?.name??e[0].name}function S(e){return`'${e.replaceAll("'","''")}'`}function U(e){const t=e.reduce((e,t)=>e+t.byteLength,0),o=new Uint8Array(t);let r=0;for(const s of e)o.set(new Uint8Array(s),r),r+=s.byteLength;return o.buffer}class H{constructor(e,t,o,r,s){this.layer=e,this.associatedLayer=t,this.featureInfos=o,this.infoFor3D=r,this.options=s,this.requestQuery={...t.parsedUrl?.query,...e.customParameters,...e.apiKey?{token:e.apiKey}:{}}}}export{F as queryModel,y as queryModels};
2
+ import e from"../../request.js";import{unique as t}from"../../core/arrayUtils.js";import o from"../../core/Error.js";import{getOrCreateMapValue as r}from"../../core/MapUtils.js";import{join as s}from"../../core/urlUtils.js";import n from"./ModelFileInfo.js";import a from"./ModelInfo.js";import{modelFormatFromFormatId as i,getFormatIdFormat as u,getFormatExtensions as l,formatIdFromModelFormat as f,getAssetMapTable as c}from"../support/infoFor3D.js";import{executeRawQueryJSON as d,executeQueryJSON as m}from"../../rest/query/executeQueryJSON.js";import p from"../../rest/support/Query.js";async function y(e,t,r,s){const n=e.infoFor3D;if(!n)throw new o("scenelayer:query-models-not-available","Model queries are not available without 3D object metadata",{layer:e});const{objectIdField:a,globalIdField:i}=t;if(!a||!i)throw new o("scenelayer:query-models-not-available","Missing required fields for model queries",{layer:e});const u=h(e,r,a,i),l=await t.queryFeatures(u,s);return await g(new S(e,t,w(l),n,s))}async function g(e){const{infoFor3D:t,associatedLayer:o,options:r}=e,s=o.globalIdField,n=o.parsedUrl;if(!s||!n)return new Map;const a=await I(e),f=new Map,c=await Promise.all(a.map(async({formatId:n,objectIds:a})=>{const f=i(n,t.supportedFormats),c=o.parsedUrl;if(null==f||!c||!a.length)return null;const m=u(n,t.supportedFormats),p=l(m),y=o.createQuery();y.objectIds=a,y.outFields=[s],y.formatOf3DObjects=n,y.returnGeometry=!0;return{modelFormat:f,modelFileExtensions:p,featureSetJSON:await d(c.path,y,{query:e.requestQuery,signal:r?.signal},{uniqueIdFields:o.uniqueIdFields})}}));for(const i of c)i&&j(e,i.modelFormat,i.modelFileExtensions,i.featureSetJSON,f);return f}async function F(e,t,o,r){const s=r?.format;return((await y(e,t,{objectIds:[o]},{...r,requestedFormat:s,sourceOnly:null==s})).get(o)??[]).find(e=>s&&e.format===s||!s&&e.isSource)}function w(e){const t=new Map;for(const o of e.features){const e=o.getObjectId(),r=o.getGlobalId();null!=e&&null!=r&&t.set(e,{globalId:r})}return t}async function I(e){const{options:o,infoFor3D:r,featureInfos:s}=e,n=[...s.keys()];if(o?.requestedFormat){const e=f(o.requestedFormat,r.supportedFormats);return e?[{formatId:e,objectIds:n}]:[]}const a=t([...r.queryFormats,...r.editFormats]);return await b(e,a)}async function b({options:e,infoFor3D:o,featureInfos:n,requestQuery:a,associatedLayer:i},u){const l=o.assetMapFieldRoles.parentGlobalId,f=o.assetMapFieldRoles.assetType,d=o.assetMapFieldRoles.flags,y=new Map;for(const[t,{globalId:r}]of n)r&&y.set(t,r);const g=t(y.values()),F=c(o);if(!F||!g.length)return[];const w=s(i.parsedUrl?.path??"",`../${F.id}`),I=!!e?.sourceOnly,b=new p({where:`${l} IN (${g.map(U).join(",")})`,outFields:I?[l,f,d]:[l,f],returnDistinctValues:!0,returnGeometry:!1}),{features:h}=await m(w,b,{query:a,signal:e?.signal}),q=new Set(u),j=new Map;for(const t of h){const e=t.getAttribute(l),o=t.getAttribute(f),s=t.getAttribute(d)??0;o&&q.has(o)&&e&&!(1&s)&&r(j,e,()=>new Set).add(o)}const D=new Map;for(const[t,s]of y)for(const e of j.get(s)??[])r(D,e,()=>[]).push(t);return u.map(e=>({formatId:e,objectIds:D.get(e)??[]})).filter(({objectIds:e})=>e.length>0)}function h(e,t,o,r){const s=q(e,t);return s.outFields=[o,r],s.returnGeometry=!1,s}function q(e,t){const o=p.from(t)?.clone()??e.createQuery();return o.outFields=null,o.formatOf3DObjects=null,o.returnGeometry=!1,o}function j({featureInfos:e,requestQuery:t,infoFor3D:o},s,n,i,u){const l=new Map;for(const a of i.assetMaps??[])r(l,a.parentGlobalId,()=>[]).push(a);for(const[f,c]of e){const e=l.get(c.globalId);if(!e?.length)continue;const i=D(e,t,o);if(!i.length)continue;const d=i.reduce((e,t)=>e+t.size,0),m=O(i,n),p=!m.flags.includes("DERIVED");r(u,f,()=>[]).push(new a({name:m.name,size:d,format:s,isSource:p,files:i}))}}function D(e,t,o){const s=new Map,a=({assetType:e})=>null!=i(e,o.supportedFormats),u=e.some(e=>a(e)&&!e.flags.includes("DERIVED"));for(const n of e)u&&a(n)&&n.flags.includes("DERIVED")||r(s,n.assetName,()=>[]).push(n);const l=[];for(const[r,i]of s){i.sort((e,t)=>e.seqNo-t.seqNo);const e=i.reduce((e,t)=>e+t.size,0),o=i.map(({assetURL:e})=>e).filter(e=>!!e);o.length&&l.push(new n({name:r,size:e,flags:i[0].flags,loadArrayBuffer:e=>M(o,t,e)}))}return l}async function M(t,o,r){const s=await Promise.all(t.map(t=>e(t,{responseType:"array-buffer",query:o,signal:r?.signal}).then(({data:e})=>e)));return 1===s.length?s[0]:E(s)}function O(e,t){return e.find(({name:e})=>t.some(t=>e.toLowerCase().endsWith(`.${t}`)))??e[0]}function U(e){return`'${e.replaceAll("'","''")}'`}function E(e){const t=e.reduce((e,t)=>e+t.byteLength,0),o=new Uint8Array(t);let r=0;for(const s of e)o.set(new Uint8Array(s),r),r+=s.byteLength;return o.buffer}class S{constructor(e,t,o,r,s){this.layer=e,this.associatedLayer=t,this.featureInfos=o,this.infoFor3D=r,this.options=s,this.requestQuery={...t.parsedUrl?.query,...e.customParameters,...e.apiKey?{token:e.apiKey}:{}}}}export{F as queryModel,y as queryModels};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.1.0-next.83",
3
+ "version": "5.1.0-next.85",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -202,6 +202,16 @@ export default class Features extends FeaturesSuperclass {
202
202
  * @default false
203
203
  */
204
204
  accessor defaultPopupTemplateEnabled: boolean;
205
+ /**
206
+ * The heading currently displayed for the selected feature item.
207
+ *
208
+ * This value resolves to the selected feature item's heading when available,
209
+ * otherwise it falls back to [heading](https://developers.arcgis.com/javascript/latest/references/core/popup/Features/#heading).
210
+ *
211
+ * @see [heading](https://developers.arcgis.com/javascript/latest/references/core/popup/Features/#heading)
212
+ * @see [selectedFeatureItem](https://developers.arcgis.com/javascript/latest/references/core/popup/Features/#selectedFeatureItem)
213
+ */
214
+ get effectiveHeading(): string | null | undefined;
205
215
  /**
206
216
  * The number of selected [features](https://developers.arcgis.com/javascript/latest/references/core/popup/Features/#features) available.
207
217
  *
package/popup/Features.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import i from"../core/Error.js";import{EventedAccessor as r}from"../core/Evented.js";import s from"../core/Logger.js";import{abortMaybe as o}from"../core/maybe.js";import{debounce as n,isAbortError as a}from"../core/promiseUtils.js";import l from"../core/ReactiveSet.js";import{watch as h,when as u,sync as c}from"../core/reactiveUtils.js";import{addMany as p}from"../core/SetUtils.js";import{property as d,subclass as g}from"../core/accessorSupport/decorators.js";import m from"../geometry/Point.js";import{initializeProjection as f,project as y}from"../geometry/projectionUtils.js";import _ from"../geometry/SpatialReference.js";import{geographicToWebMercator as F}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as v}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as w}from"../layers/LayerConstants.js";import{ActionsCollection as C,zoomToAggregatedFeatures as b,browseAggregatedFeatures as I,zoomToFeature as P}from"./actions.js";import{getSelectedTarget as A}from"./actionUtils.js";import L from"./Feature.js";import j from"./support/FeatureAbilities.js";import{getDisplayedSymbol as x}from"../symbols/support/symbolUtils.js";import{system as E}from"../time/constants.js";import{highlightsSupported as R}from"../views/support/layerViewUtils.js";import{GoTo as O}from"../widgets/support/GoTo.js";const U="location-scale-handle",S=()=>[P.clone()],T=()=>[b.clone(),I.clone()];let M=null;function H(e,t){switch(e){case"building-scene":case"map-image":case"tile":case"imagery":return!0;case"imagery-tile":return"2d"===t;default:return!1}}let D=class extends(O(r)){constructor(e){super(e),this._pendingPromises=new l,this._fetchFeaturesController=null,this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new j,this.actions=new C,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=n(async e=>{this._cancelLocationUpdate();const t=new AbortController,{signal:i}=t;this._locationUpdateController=t,await this._locationUpdate(e,{signal:i}).catch(()=>{}).finally(()=>{this._locationUpdateController===t&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([h(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),h(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),h(()=>this.location,e=>this._locationChange(e)),h(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),h(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),h(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),h(()=>this.featureItems,()=>this._featureItemsChange()),h(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),u(()=>!this.waitingForResult,()=>this._waitingForResultChange(),c),u(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelFetchingFeatures(),this._cancelCenterAtLocation(),this._pendingPromises.clear(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){const e=this._get("allActions")||new C;e.removeAll();const{actions:i,defaultActions:r,defaultPopupTemplateEnabled:s,includeDefaultActions:o,selectedFeature:n}=this,a=o?r.concat(i):i,l=n&&("function"==typeof n.getEffectivePopupTemplate&&n.getEffectivePopupTemplate(s)||n.popupTemplate),h=l?.actions,u=l?.overwriteActions?h:h?.concat(a)??a;return u?.filter(t).forEach(t=>e.add(t)),e}set content(e){this.promises=[],this._set("content",e)}get defaultActions(){const e=this._get("defaultActions")||new C;return e.removeAll(),e.addMany(this.selectedFeature?.isAggregate?T():S()),e}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t),this._syncSelectedFeatureIndex(t)}get initialDisplayMode(){return this._get("initialDisplayMode")||"feature"}set initialDisplayMode(e){this._set("initialDisplayMode",e),this._syncSelectedFeatureIndex(this.features)}set location(e){let t=e;const i=this.spatialReference?.isWebMercator,r=e?.spatialReference?.isWGS84;r&&i&&(t=F(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._get("promises")!==e&&(this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),e=e.slice(),p(this._pendingPromises,e),e.reduce((e,t)=>e.finally(()=>t.then(e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)}).finally(()=>this._pendingPromises.delete(t)).catch(()=>{})),Promise.resolve())):this._set("promises",[]))}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;if(-1===t)return null;return e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??E}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return(!!this._fetchFeaturesController||this.pendingPromisesCount>0)&&0===this.featureCount}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,heading:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:r}=this;if(!r||!e)throw new i("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:r});return r.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}next(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount),this}previous(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount),this}async handleViewClick(e){return this._fetchFeaturesAndOpen(e)}_syncSelectedFeatureIndex(e){const{pendingPromisesCount:t,promiseCount:i,selectedFeatureIndex:r}=this,s=i&&e.length;"list"!==this.initialDisplayMode?s&&t&&-1===r?this.selectedFeatureIndex=0:s&&-1!==r||(this.selectedFeatureIndex=e.length?0:-1):(!s||s&&t===i)&&(this.selectedFeatureIndex=-1)}_centerAtLocation(){const{view:e}=this,t=A(this);this._cancelCenterAtLocation();const r=new AbortController,{signal:o}=r;return this._centerAtLocationController=r,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:o}}).catch(e=>{a(e)||s.getLogger(this).error(e)}):Promise.reject(new i("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:r}=this;r&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){"list"!==this.initialDisplayMode&&(this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null)}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:r,featureItems:s}=this;if(null==i)return;const o=((i-1)*r+t)%t,n=Math.min(o+r,s.length);for(let a=o;a<n;a++){const t=s[a];t&&(t.graphic??=e[a])}}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;const s=v(e)?.type;if("map-image"!==s&&"imagery"!==s&&"imagery-tile"!==s||(e.symbol=await x(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const t=await import("../geometry/operators/labelPointOperator.js");return void(this.location=t.execute(e.geometry))}if(i&&!e.geometry){await this._centerAtLocation();const e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",[])}_updateFeatureItems(){const e=this.selectedFeature,t=this.features,i=this.featureItems,r=this.view,s=this.spatialReference,o=this.map,n=this.timeZone,a=this.location,l=this.featureItemAbilities??this._defaultFeatureAbilities;if(!t?.length)return void this._destroyFeatureItems();const h=[],u=new Map,c=new Set;i.forEach(e=>{const t=e?.graphic;e&&t&&u.set(t,e)}),t.forEach((t,p)=>{if(!t)return;const d=i[p];if(d&&!c.has(d)&&(null==d.graphic||d.graphic===t))return d.abilities=l,h[p]=d,void c.add(d);const g=u.get(t);if(g&&!c.has(g))return g.abilities=l,h[p]=g,void c.add(g);const m=new L({abilities:l,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:s,graphic:t===e?t:null,location:a,map:o,view:r,timeZone:n});h[p]=m,c.add(m)}),i.forEach(e=>{!e||c.has(e)||e.destroyed||e.destroy()}),this._set("featureItems",h)}async _getScreenPoint(e,t){const{spatialReference:i,view:r}=this;if(!r)return null;await r.when();const s=e?.spatialReference;return s&&i?(await f(s,i,null,t),r.toScreen(e)):null}_cancelCenterAtLocation(){this._centerAtLocationController=o(this._centerAtLocationController)}_cancelFetchingFeatures(){this._fetchFeaturesController=o(this._fetchFeaturesController)}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:r}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:r}),{signal:r,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const r=new AbortController,{signal:s}=r;this._fetchFeaturesController=r;const o=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:s,event:i});return o.catch(()=>{}).finally(()=>{this._fetchFeaturesController===r&&(this._fetchFeaturesController=null)}),o}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e;this.removeHandles(U),this.addHandles([h(()=>this.view?.scale,()=>this._debouncedLocationUpdate(t).catch(e=>{a(e)||s.getLogger(this).error(e)})),u(()=>!this.open,()=>{this.removeHandles(U)},{once:!0})],U);const{pendingFeatures:r}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});return{location:t??void 0,promises:r}}async _locationUpdate(e,t){const{spatialReference:i}=this,r=this.selectedFeature?.geometry?.type,o=this.location??e;if(r&&"mesh"!==r&&i&&o&&this.selectedFeature){if("point"===r){const e=await import("../geometry/operators/labelPointOperator.js");return void(this.location=e.execute(this.selectedFeature.geometry))}try{const e=this.selectedFeature;let r=e.geometry;const s=this._getHighlightLayer(e),n=e.getObjectId();if(!s||!this.view)return;if(n){const e=this.view?.allLayerViews.find(e=>e.layer.uid===s.uid);if(!e||!("queryFeatures"in e))return;const o=e.createQuery();o.outSpatialReference=i,o.objectIds=[n],o.returnGeometry=!0;const{features:a}=await e.queryFeatures(o,t);r=a[0]?.geometry}if(!r||"mesh"===r.type)return;r=y(r,i),M??=await Promise.all([import("../geometry/operators/intersectsOperator.js"),import("../geometry/operators/proximityOperator.js")]);const[a,l]=M;if(!a.execute(r,o)){const t=l.getNearestCoordinate(r,o).coordinate??o;this.selectedFeature===e&&(this.location=t)}}catch(n){a(n)||s.getLogger(this).error(n)}}}_cancelLocationUpdate(){this._locationUpdateController=o(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const t=v(e),{layer:i}=e;return t&&"layer"in t&&t.layer?t.layer:"map-notes"===t?.type||"subtype-group"===t?.type?t:i??t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(H(t.type,i))return e;const r=e.getObjectId();if(null!=r)return r;const s="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||w:null,o=e.attributes;return o&&s&&o[s]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:r,view:s,open:o}=this;if(!s||!r||!o)return;const n=this._getHighlightLayer(i);if(!n)return;const a=this._getHighlightLayerView(s,n);if(!a)return;this._highlightPromises[e]=a;const l=await a;if(!(l&&R(l)&&this._highlightPromises[e]===a&&this[t]&&this.highlightEnabled))return;const h=l.highlight(this._getHighlightTarget(i,n,s.type));this.addHandles(h,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}_updateFeatures(e){const{features:t}=this,i=new Set(t),r=e.filter(e=>!i.has(e));r?.length&&(this.features=t.concat(r))}};e([d()],D.prototype,"_fetchFeaturesController",void 0),e([d({type:C})],D.prototype,"actions",void 0),e([d({readOnly:!0})],D.prototype,"active",null),e([d()],D.prototype,"activeFeature",void 0),e([d({readOnly:!0})],D.prototype,"allActions",null),e([d()],D.prototype,"aggregatedFeaturesEnabled",void 0),e([d({value:null})],D.prototype,"content",null),e([d({type:C,readOnly:!0})],D.prototype,"defaultActions",null),e([d({type:Boolean})],D.prototype,"defaultPopupTemplateEnabled",void 0),e([d({readOnly:!0})],D.prototype,"featureCount",null),e([d()],D.prototype,"featurePage",void 0),e([d({value:[]})],D.prototype,"features",null),e([d()],D.prototype,"featuresPerPage",void 0),e([d()],D.prototype,"featureMenuOpen",void 0),e([d({type:j})],D.prototype,"featureItemAbilities",void 0),e([d({readOnly:!0})],D.prototype,"featureItems",void 0),e([d()],D.prototype,"heading",void 0),e([d()],D.prototype,"highlightEnabled",void 0),e([d()],D.prototype,"includeDefaultActions",void 0),e([d({value:"feature"})],D.prototype,"initialDisplayMode",null),e([d({type:m})],D.prototype,"location",null),e([d()],D.prototype,"map",null),e([d()],D.prototype,"open",void 0),e([d({readOnly:!0})],D.prototype,"pendingPromisesCount",null),e([d({readOnly:!0})],D.prototype,"promiseCount",null),e([d()],D.prototype,"promises",null),e([d({value:null,readOnly:!0})],D.prototype,"selectedFeature",null),e([d({value:-1})],D.prototype,"selectedFeatureIndex",null),e([d({readOnly:!0})],D.prototype,"selectedFeatureItem",null),e([d({type:_})],D.prototype,"spatialReference",null),e([d({readOnly:!0})],D.prototype,"state",null),e([d()],D.prototype,"timeZone",null),e([d()],D.prototype,"updateLocationEnabled",void 0),e([d()],D.prototype,"view",void 0),e([d({readOnly:!0})],D.prototype,"waitingForContents",null),e([d({readOnly:!0})],D.prototype,"waitingForResult",null),e([d()],D.prototype,"zoomFactor",void 0),D=e([g("esri.popup.Features")],D);const V=D;export{V as default};
2
+ import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import i from"../core/Error.js";import{EventedAccessor as r}from"../core/Evented.js";import s from"../core/Logger.js";import{abortMaybe as n}from"../core/maybe.js";import{debounce as o,isAbortError as a}from"../core/promiseUtils.js";import l from"../core/ReactiveSet.js";import{watch as h,when as u,sync as c}from"../core/reactiveUtils.js";import{addMany as p}from"../core/SetUtils.js";import{property as d,subclass as g}from"../core/accessorSupport/decorators.js";import m from"../geometry/Point.js";import{initializeProjection as f,project as y}from"../geometry/projectionUtils.js";import _ from"../geometry/SpatialReference.js";import{geographicToWebMercator as F}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as v}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as w}from"../layers/LayerConstants.js";import{ActionsCollection as C,zoomToAggregatedFeatures as b,browseAggregatedFeatures as I,zoomToFeature as P}from"./actions.js";import{getSelectedTarget as A}from"./actionUtils.js";import L from"./Feature.js";import j from"./support/FeatureAbilities.js";import{getDisplayedSymbol as x}from"../symbols/support/symbolUtils.js";import{system as E}from"../time/constants.js";import{highlightsSupported as R}from"../views/support/layerViewUtils.js";import{GoTo as O}from"../widgets/support/GoTo.js";const U="location-scale-handle",S=()=>[P.clone()],T=()=>[b.clone(),I.clone()];let H=null;function M(e,t){switch(e){case"building-scene":case"map-image":case"tile":case"imagery":return!0;case"imagery-tile":return"2d"===t;default:return!1}}let D=class extends(O(r)){constructor(e){super(e),this._pendingPromises=new l,this._fetchFeaturesController=null,this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new j,this.actions=new C,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=o(async e=>{this._cancelLocationUpdate();const t=new AbortController,{signal:i}=t;this._locationUpdateController=t,await this._locationUpdate(e,{signal:i}).catch(()=>{}).finally(()=>{this._locationUpdateController===t&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([h(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),h(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),h(()=>this.location,e=>this._locationChange(e)),h(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),h(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),h(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),h(()=>this.featureItems,()=>this._featureItemsChange()),h(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),u(()=>!this.waitingForResult,()=>this._waitingForResultChange(),c),u(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelFetchingFeatures(),this._cancelCenterAtLocation(),this._pendingPromises.clear(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){const e=this._get("allActions")||new C;e.removeAll();const{actions:i,defaultActions:r,defaultPopupTemplateEnabled:s,includeDefaultActions:n,selectedFeature:o}=this,a=n?r.concat(i):i,l=o&&("function"==typeof o.getEffectivePopupTemplate&&o.getEffectivePopupTemplate(s)||o.popupTemplate),h=l?.actions,u=l?.overwriteActions?h:h?.concat(a)??a;return u?.filter(t).forEach(t=>e.add(t)),e}set content(e){this.promises=[],this._set("content",e)}get defaultActions(){const e=this._get("defaultActions")||new C;return e.removeAll(),e.addMany(this.selectedFeature?.isAggregate?T():S()),e}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t),this._syncSelectedFeatureIndex(t)}get initialDisplayMode(){return this._get("initialDisplayMode")||"feature"}set initialDisplayMode(e){this._set("initialDisplayMode",e),this._syncSelectedFeatureIndex(this.features)}set location(e){let t=e;const i=this.spatialReference?.isWebMercator,r=e?.spatialReference?.isWGS84;r&&i&&(t=F(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._get("promises")!==e&&(this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),e=e.slice(),p(this._pendingPromises,e),e.reduce((e,t)=>e.finally(()=>t.then(e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)}).finally(()=>this._pendingPromises.delete(t)).catch(()=>{})),Promise.resolve())):this._set("promises",[]))}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;if(-1===t)return null;return e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??E}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return(!!this._fetchFeaturesController||this.pendingPromisesCount>0)&&0===this.featureCount}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,heading:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:r}=this;if(!r||!e)throw new i("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:r});return r.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}next(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount),this}previous(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount),this}async handleViewClick(e){return this._fetchFeaturesAndOpen(e)}_syncSelectedFeatureIndex(e){const{pendingPromisesCount:t,promiseCount:i,selectedFeatureIndex:r}=this,s=i&&e.length;"list"!==this.initialDisplayMode?s&&t&&-1===r?this.selectedFeatureIndex=0:s&&-1!==r||(this.selectedFeatureIndex=e.length?0:-1):(!s||s&&t===i)&&(this.selectedFeatureIndex=-1)}_centerAtLocation(){const{view:e}=this,t=A(this);this._cancelCenterAtLocation();const r=new AbortController,{signal:n}=r;return this._centerAtLocationController=r,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:n}}).catch(e=>{a(e)||s.getLogger(this).error(e)}):Promise.reject(new i("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:r}=this;r&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){"list"!==this.initialDisplayMode&&(this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null)}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:r,featureItems:s}=this;if(null==i)return;const n=((i-1)*r+t)%t,o=Math.min(n+r,s.length);for(let a=n;a<o;a++){const t=s[a];t&&(t.graphic??=e[a])}}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;const s=v(e)?.type;if("map-image"!==s&&"imagery"!==s&&"imagery-tile"!==s||(e.symbol=await x(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const t=await import("../geometry/operators/labelPointOperator.js");return void(this.location=t.execute(e.geometry))}if(i&&!e.geometry){await this._centerAtLocation();const e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",[])}_updateFeatureItems(){const e=this.selectedFeature,t=this.features,i=this.featureItems,r=this.view,s=this.spatialReference,n=this.map,o=this.timeZone,a=this.location,l=this.featureItemAbilities??this._defaultFeatureAbilities;if(!t?.length)return void this._destroyFeatureItems();const h=[],u=new Map,c=new Set;i.forEach(e=>{const t=e?.graphic;e&&t&&u.set(t,e)}),t.forEach((t,p)=>{if(!t)return;const d=i[p];if(d&&!c.has(d)&&(null==d.graphic||d.graphic===t))return d.abilities=l,h[p]=d,void c.add(d);const g=u.get(t);if(g&&!c.has(g))return g.abilities=l,h[p]=g,void c.add(g);const m=new L({abilities:l,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:s,graphic:t===e?t:null,location:a,map:n,view:r,timeZone:o});h[p]=m,c.add(m)}),i.forEach(e=>{!e||c.has(e)||e.destroyed||e.destroy()}),this._set("featureItems",h)}async _getScreenPoint(e,t){const{spatialReference:i,view:r}=this;if(!r)return null;await r.when();const s=e?.spatialReference;return s&&i?(await f(s,i,null,t),r.toScreen(e)):null}_cancelCenterAtLocation(){this._centerAtLocationController=n(this._centerAtLocationController)}_cancelFetchingFeatures(){this._fetchFeaturesController=n(this._fetchFeaturesController)}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:r}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:r}),{signal:r,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const r=new AbortController,{signal:s}=r;this._fetchFeaturesController=r;const n=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:s,event:i});return n.catch(()=>{}).finally(()=>{this._fetchFeaturesController===r&&(this._fetchFeaturesController=null)}),n}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e;this.removeHandles(U),this.addHandles([h(()=>this.view?.scale,()=>this._debouncedLocationUpdate(t).catch(e=>{a(e)||s.getLogger(this).error(e)})),u(()=>!this.open,()=>{this.removeHandles(U)},{once:!0})],U);const{pendingFeatures:r}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});return{location:t??void 0,promises:r}}async _locationUpdate(e,t){const{spatialReference:i}=this,r=this.selectedFeature?.geometry?.type,n=this.location??e;if(r&&"mesh"!==r&&i&&n&&this.selectedFeature){if("point"===r){const e=await import("../geometry/operators/labelPointOperator.js");return void(this.location=e.execute(this.selectedFeature.geometry))}try{const e=this.selectedFeature;let r=e.geometry;const s=this._getHighlightLayer(e),o=e.getObjectId();if(!s||!this.view)return;if(o){const e=this.view?.allLayerViews.find(e=>e.layer.uid===s.uid);if(!e||!("queryFeatures"in e))return;const n=e.createQuery();n.outSpatialReference=i,n.objectIds=[o],n.returnGeometry=!0;const{features:a}=await e.queryFeatures(n,t);r=a[0]?.geometry}if(!r||"mesh"===r.type)return;r=y(r,i),H??=await Promise.all([import("../geometry/operators/intersectsOperator.js"),import("../geometry/operators/proximityOperator.js")]);const[a,l]=H;if(!a.execute(r,n)){const t=l.getNearestCoordinate(r,n).coordinate??n;this.selectedFeature===e&&(this.location=t)}}catch(o){a(o)||s.getLogger(this).error(o)}}}_cancelLocationUpdate(){this._locationUpdateController=n(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const t=v(e),{layer:i}=e;return t&&"layer"in t&&t.layer?t.layer:"map-notes"===t?.type||"subtype-group"===t?.type?t:i??t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(M(t.type,i))return e;const r=e.getObjectId();if(null!=r)return r;const s="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||w:null,n=e.attributes;return n&&s&&n[s]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:r,view:s,open:n}=this;if(!s||!r||!n)return;const o=this._getHighlightLayer(i);if(!o)return;const a=this._getHighlightLayerView(s,o);if(!a)return;this._highlightPromises[e]=a;const l=await a;if(!(l&&R(l)&&this._highlightPromises[e]===a&&this[t]&&this.highlightEnabled))return;const h=l.highlight(this._getHighlightTarget(i,o,s.type));this.addHandles(h,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}_updateFeatures(e){const{features:t}=this,i=new Set(t),r=e.filter(e=>!i.has(e));r?.length&&(this.features=t.concat(r))}};e([d()],D.prototype,"_fetchFeaturesController",void 0),e([d({type:C})],D.prototype,"actions",void 0),e([d({readOnly:!0})],D.prototype,"active",null),e([d()],D.prototype,"activeFeature",void 0),e([d({readOnly:!0})],D.prototype,"allActions",null),e([d()],D.prototype,"aggregatedFeaturesEnabled",void 0),e([d({value:null})],D.prototype,"content",null),e([d({type:C,readOnly:!0})],D.prototype,"defaultActions",null),e([d({type:Boolean})],D.prototype,"defaultPopupTemplateEnabled",void 0),e([d({readOnly:!0})],D.prototype,"effectiveHeading",null),e([d({readOnly:!0})],D.prototype,"featureCount",null),e([d()],D.prototype,"featurePage",void 0),e([d({value:[]})],D.prototype,"features",null),e([d()],D.prototype,"featuresPerPage",void 0),e([d()],D.prototype,"featureMenuOpen",void 0),e([d({type:j})],D.prototype,"featureItemAbilities",void 0),e([d({readOnly:!0})],D.prototype,"featureItems",void 0),e([d()],D.prototype,"heading",void 0),e([d()],D.prototype,"highlightEnabled",void 0),e([d()],D.prototype,"includeDefaultActions",void 0),e([d({value:"feature"})],D.prototype,"initialDisplayMode",null),e([d({type:m})],D.prototype,"location",null),e([d()],D.prototype,"map",null),e([d()],D.prototype,"open",void 0),e([d({readOnly:!0})],D.prototype,"pendingPromisesCount",null),e([d({readOnly:!0})],D.prototype,"promiseCount",null),e([d()],D.prototype,"promises",null),e([d({value:null,readOnly:!0})],D.prototype,"selectedFeature",null),e([d({value:-1})],D.prototype,"selectedFeatureIndex",null),e([d({readOnly:!0})],D.prototype,"selectedFeatureItem",null),e([d({type:_})],D.prototype,"spatialReference",null),e([d({readOnly:!0})],D.prototype,"state",null),e([d()],D.prototype,"timeZone",null),e([d()],D.prototype,"updateLocationEnabled",void 0),e([d()],D.prototype,"view",void 0),e([d({readOnly:!0})],D.prototype,"waitingForContents",null),e([d({readOnly:!0})],D.prototype,"waitingForResult",null),e([d()],D.prototype,"zoomFactor",void 0),D=e([g("esri.popup.Features")],D);const V=D;export{V as default};
@@ -1,6 +1,7 @@
1
1
  import type Accessor from "../../core/Accessor.js";
2
+ import type GraphQueryResultHeader from "./GraphQueryResultHeader.js";
2
3
 
3
- export interface GraphQueryStreamingResultProperties extends Partial<Pick<GraphQueryStreamingResult, "resultRowsStream">> {}
4
+ export interface GraphQueryStreamingResultProperties extends Partial<Pick<GraphQueryStreamingResult, "resultHeader" | "resultRowsStream">> {}
4
5
 
5
6
  /**
6
7
  * The result of a [executeSearchStreaming()](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraphService/#executeSearchStreaming) or
@@ -127,6 +128,8 @@ export interface GraphQueryStreamingResultProperties extends Partial<Pick<GraphQ
127
128
  */
128
129
  export default class GraphQueryStreamingResult extends Accessor {
129
130
  constructor(properties?: GraphQueryStreamingResultProperties);
131
+ /** Metadata about a query result, including the column names of the result, spatial reference information, etc. */
132
+ accessor resultHeader: GraphQueryResultHeader;
130
133
  /**
131
134
  * Readable stream of objects matching [executeSearchStreaming()](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraphService/#executeSearchStreaming)
132
135
  * or [executeQueryStreaming()](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraphService/#executeQueryStreaming) criteria.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const c="20260426",e="723cc90bd65f32ae75bcd17ae3c1514a1333e2cb";export{c as buildDate,e as commitHash};
2
+ const c="20260428",b="252f0c35ccd22bbcd0af84a70d1d63fbb874ea53";export{c as buildDate,b as commitHash};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{defaultFontFamily as t}from"../../core/fontUtils.js";import has from"../../core/has.js";import{clone as e}from"../../core/lang.js";import r from"../../core/Logger.js";import{deg2rad as i}from"../../core/mathUtils.js";import s from"../../core/ObjectPool.js";import{pt2px as o,px2pt as n}from"../../core/screenUtils.js";import{GeometryCursor as a}from"../../geometry/GeometryCursor.js";import{create as l,fromValues as h,empty as c,expandPointInPlace as m,center as f,width as u,height as d,diagonal as p}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as g}from"../../geometry/support/boundsUtils.js";import{polygonCentroid as _}from"../../geometry/support/centroid.js";import{isExtent as y,isPolygon as P,isPolyline as S,isPoint as w,isMultipoint as x}from"../../geometry/support/jsonTypeUtils.js";import{SimpleEffectCursor as M}from"./CIMEffects.js";import b from"./CIMImageColorSubstitutionHelper.js";import{getEffectOperator as k,getPlacementOperator as C}from"./CIMOperators.js";import{Placement as v}from"./CIMPlacements.js";import{defaultCIMValues as I}from"./defaultCIMValues.js";import{getFirstFrame as T}from"./imageUtils.js";import{rotate as R}from"./mathUtils.js";import{addColorStops as z}from"./rasterizingUtils.js";import L from"./Rect.js";import F from"./TextRasterizer.js";import{isMarkerScreenAligned as U,isCIMFill as A,getSize as j,getNumericValue as G,isSVGImage as D,getRelativeGradientSize as H,fromCIMFontDecoration as B,fromCIMFontStyle as E,fromCIMHorizontalAlignment as X,fromCIMVerticalAlignment as J,getFillColor as N,getStrokeColor as O,getStrokeWidth as q,getFontWeight as V,getFontStyle as W}from"./utils.js";import{destroyHiddenSvg as Y,createHiddenSvg as $,createSvgElement as K}from"../../views/2d/engine/svgUtils.js";import{magicLabelLineHeight as Q,glyphSize as Z,hittestToleranceSmallSymbol as tt,hittestSmallSymbolThreshold as et}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as rt}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as it,getLineWidth as st}from"../../views/2d/layers/graphics/graphicsUtils.js";const ot=Math.PI/180,nt=.5,at=()=>r.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class lt{constructor(t){this._t=t}static createIdentity(){return new lt([1,0,0,0,1,0])}clone(){const t=this._t;return new lt(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new lt([t,0,0,0,e,0])}scale(t,e){const r=this._t;return r[0]*=t,r[1]*=t,r[2]*=t,r[3]*=e,r[4]*=e,r[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new lt([0,0,t,0,0,e])}translate(t,e){const r=this._t;return r[2]+=t,r[5]+=e,this}static createRotate(t){const e=Math.cos(t),r=Math.sin(t);return new lt([e,-r,0,r,e,0])}rotate(t){return lt.multiply(this,lt.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],r=Math.sqrt(t*t+e*e);return[t/r,e/r]}static multiply(t,e,r){const i=t._t,s=e._t,o=i[0]*s[0]+i[3]*s[1],n=i[1]*s[0]+i[4]*s[1],a=i[2]*s[0]+i[5]*s[1]+s[2],l=i[0]*s[3]+i[3]*s[4],h=i[1]*s[3]+i[4]*s[4],c=i[2]*s[3]+i[5]*s[4]+s[5],m=r._t;return m[0]=o,m[1]=n,m[2]=a,m[3]=l,m[4]=h,m[5]=c,r}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(0===e)return new lt([0,0,0,0,0,0]);e=1/e;const r=(t[1]*t[5]-t[2]*t[4])*e,i=(t[2]*t[3]-t[0]*t[5])*e,s=t[4]*e,o=-t[1]*e,n=-t[3]*e,a=t[0]*e;return new lt([s,o,r,n,a,i])}}class ht{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new s(()=>new v,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||lt.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||lt.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const r=e?t.scaleRatio():1;lt.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,r){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,r)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const r=t.symbolLayers;if(!r)return;const i=t.effects;if(i&&i.length>0){const t=this.executeEffects(i,e);if(t){let e=t.next();for(;e;)this.drawSymbolLayers(r,e.asJSON()),e=t.next()}}else this.drawSymbolLayers(r,e)}executeEffects(t,e){let r=new M(a.fromJSONCIM(e));for(const i of t){const t=k(i);t&&(r=t.execute(r,i,this.geomUnitsPerPoint(),null))}return r}drawSymbolLayers(t,e){let r=t.length;for(;r--;){const i=t[r];if(!i||!1===i.enable)continue;const s=i.effects;if(s&&s.length>0){const t=this.executeEffects(s,e);if(t){let e=null;for(;(e=t.next())&&(this.drawSymbolLayer(i,e.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(i,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const r=ut(e,t,this.geomUnitsPerPoint());r&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,r),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const r=t.markerPlacement;if(r){const i=C(r);if(i){const s="CIMMarkerPlacementInsidePolygon"===r.type||"CIMMarkerPlacementPolygonCenter"===r.type&&r.clipAtBoundary;s&&this.pushClipPath(e);const o=i.execute(a.fromJSONCIM(e),r,this.geomUnitsPerPoint(),null);if(o){let e=null;for(;(e=o.next())&&(this.drawMarker(t,e),!this._earlyReturn););}s&&this.popClipPath()}}else{const r=this._placementPool.acquire();if(w(e))r.tx=e.x,r.ty=e.y,this.drawMarker(t,r);else if(P(e)){const i=_(e);i&&([r.tx,r.ty]=i,this.drawMarker(t,r))}else if(S(e)){for(const i of e.paths)for(const e of i)if(r.tx=e[0],r.ty=e[1],this.drawMarker(t,r),this._earlyReturn)break}else for(const i of e.points)if(r.tx=i[0],r.ty=i[1],this.drawMarker(t,r),this._earlyReturn)break;this._placementPool.release(r)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const r=this._resourceManager.getResource(t.url),i=G(t.size,I.CIMPictureMarker.size);if(null==r||i<=0)return;const s=r.width,o=r.height;if(!s||!o)return;const n=s/o,a=G(t.scaleX,1),l=lt.createIdentity(),h=t.anchorPoint;if(h){let e=h.x,r=h.y;"Absolute"!==t.anchorPointUnits&&(e*=i*n*a,r*=i),l.translate(-e,-r)}let c=G(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*ot);let m=G(t.offsetX),f=G(t.offsetY);if(m||f){if(this._mapRotation){const t=ot*this._mapRotation,e=Math.cos(t),r=Math.sin(t),i=m*r+f*e;m=m*e-f*r,f=i}l.translate(m,f)}const u=this.geomUnitsPerPoint();1!==u&&l.scale(u,u);const d=e.getAngle();d&&l.rotate(d),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,i),this.pop()}drawVectorMarker(t,e){if(!t)return;const r=t.markerGraphics;if(!r)return;const i=G(t.size,I.CIMVectorMarker.size),s=t.frame,o=s?s.ymax-s.ymin:0,n=i&&o?i/o:1,a=lt.createIdentity();s&&a.translate(.5*-(s.xmax+s.xmin),.5*-(s.ymax+s.ymin));const l=t.anchorPoint;if(l){let e=l.x,r=l.y;"Absolute"!==t.anchorPointUnits?s&&(e*=s.xmax-s.xmin,r*=s.ymax-s.ymin):(e/=n,r/=n),a.translate(-e,-r)}1!==n&&a.scale(n,n);let h=G(t.rotation);t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&a.rotate(h*ot);let c=G(t.offsetX),m=G(t.offsetY);if(c||m){if(this._mapRotation){const t=ot*this._mapRotation,e=Math.cos(t),r=Math.sin(t),i=c*r+m*e;c=c*e-m*r,m=i}a.translate(c,m)}const f=this.geomUnitsPerPoint();1!==f&&a.scale(f,f);const u=e.getAngle();u&&a.rotate(u),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const d of r){d?.symbol&&d.geometry||at().error("Invalid marker graphic",d);let t=d.textString;if("number"==typeof t&&(t=t.toString()),this.drawSymbol(d.symbol,d.geometry,t),this._earlyReturn)break}this.pop()}drawTextSymbol(t,e,r){if(!t)return;if(!w(e))return;if(G(t.height,I.CIMTextSymbol.height)<=0)return;const i=lt.createIdentity();let s=G(t.angle);s=-s,s&&i.rotate(s*ot);const o=G(t.offsetX),n=G(t.offsetY);(o||n)&&i.translate(o,n);const a=this.geomUnitsPerPoint();1!==a&&i.scale(a,a),i.translate(e.x,e.y),this.push(i,!1),this.drawText(t,r),this.pop()}}class ct extends ht{constructor(t,e){super(t,e),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new L(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return h(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if(P(t))this._processPath(t.rings,0);else if(S(t))this._processPath(t.paths,0);else if(y(t)){const e=_t(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,r){if(!t||this._clipCount>0||null==r||r<=0)return;const i=Math.max(.5*this.transformSize(G(r,I.CIMSolidStroke.width)),.5*nt);if(P(t))this._processPath(t.rings,i);else if(S(t))this._processPath(t.paths,i);else if(y(t)){const e=_t(t);e&&this._processPath(e.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){P(e)&&t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:r}=t,i=G(t.scaleX,1);let s=i*e,o=e;const n=this._resourceManager.getResource(r);if(null!=n){const t=n.height/n.width;s=i*(e?t>1?e:e/t:n.width),o=e?t>1?e*t:e:n.height}this._merge(this.transformPt([-s/2,-o/2]),0),this._merge(this.transformPt([-s/2,o/2]),0),this._merge(this.transformPt([s/2,-o/2]),0),this._merge(this.transformPt([s/2,o/2]),0)}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new F);const r=Pt(t);let[i,s]=this._textRasterizer.computeTextSize(e,r);i=n(i),s=n(s);const o=this.transformSize(1)*this.reverseTransformScalar(1);i*=o,s*=o;let a=0;switch(t.horizontalAlignment){case"Left":a=i/2;break;case"Right":a=-i/2}let l=0;switch(t.verticalAlignment){case"Bottom":l=s/2;break;case"Top":l=-s/2;break;case"Baseline":l=s/6}this._merge(this.transformPt([-i/2+a,-s/2+l]),0),this._merge(this.transformPt([-i/2+a,s/2+l]),0),this._merge(this.transformPt([i/2+a,-s/2+l]),0),this._merge(this.transformPt([i/2+a,s/2+l]),0)}_processPath(t,e){if(t)for(const r of t){const t=r?r.length:0;if(t>1){this._merge(this.transformPt(r[0]),e);for(let i=1;i<t;i++)this._merge(this.transformPt(r[i]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class mt extends ht{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=Y(this._svg),this._path=null,this._canvas=null}hitTest(t,e,r,i,s,a){const l=a*o(1);this.setTransform(),this.setGeomUnitsPerPoint(l),this._searchPoint=[(t[0]+t[2])/2,(t[1]+t[3])/2],this._searchDistPoint=(t[2]-t[0])/2/l,this._textInfo=i;const h=e&&("CIMPointSymbol"===e.type&&"Map"!==e.angleAlignment||"CIMTextSymbol"===e.type||e.symbolLayers?.some(t=>U(t)));if(this._mapRotation=h?s:0,!has("esri-mobile")){const t=n(tt*window.devicePixelRatio),r=n(et);!(("CIMLineSymbol"===e?.type||"CIMPolygonSymbol"===e?.type)&&e.symbolLayers?.some(A))&&"CIMMeshSymbol"!==e?.type&&(j(e)??0)<r&&(this._searchDistPoint=t)}return this._earlyReturn=!1,this.drawSymbol(e,r),this._earlyReturn}executeEffects(t,e){return"CIMGeometricEffectDashes"===t.at(-1)?.type&&(t=t.slice(0,-1)),super.executeEffects(t,e)}drawSolidFill(t,e,r){null!=r?this._hittestSvgPath(t,r,!0):this._hitTestFill(t)}drawHatchFill(t,e){this._hitTestFill(t)}drawPictureFill(t,e){this._hitTestFill(t)}drawGradientFill(t,e){this._hitTestFill(t)}drawSolidStroke(t,e,r,i,s,o,n){null!=n?this._hittestSvgPath(t,n,!1,r):this._hitTestStroke(t,r)}drawPictureStroke(t,e){this._hitTestStroke(t,e.width)}drawGradientStroke(t,e){this._hitTestStroke(t,e.width)}drawMarkerLayer(t,e){t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._hitTestFill(e):super.drawMarkerLayer(t,e)}pushClipPath(t){}popClipPath(){}drawImage(t,e){const{url:r}=t,i=G(t.scaleX,1),s=this._resourceManager.getResource(r);if(null==s||0===s.height||0===e)return;const o=e*this.geomUnitsPerPoint(),n=o*i*(s.width/s.height),a=this.reverseTransformPt(this._searchPoint),l=this._searchDistPoint;Math.abs(a[0])<n/2+l&&Math.abs(a[1])<o/2+l&&(this._earlyReturn=!0)}drawText(t,e){const r=this._textInfo;if(!r)return;const i=r.get(t);if(!i)return;if(!i.glyphMosaicItems.glyphs.length)return;const s=it(G(t.height,I.CIMTextSymbol.height)),{lineGapType:o,lineGap:n}=t,a=o?yt(o,G(n),s):0,l="CIMBackgroundCallout"===t.callout?.type,h=rt(i.glyphMosaicItems,{scale:s/Z,angle:0,xOffset:0,yOffset:0,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:st(t.lineWidth),lineHeight:Q*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:l}),c=this.reverseTransformPt(this._searchPoint),m=c[0],f=c[1];for(const u of h.glyphs){const[t,e]=u.offsets.topLeft,[r,i]=u.offsets.bottomRight;if(m>t&&m<r&&f>-i&&f<-e){this._earlyReturn=!0;break}}}_hitTestFill(t){let e=null;if(y(t)){const r=t;e=[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}else if(P(t))e=t.rings;else{if(!S(t))return;e=t.paths}const r=this.reverseTransformPt(this._searchPoint);if(dt(r,e)&&(this._earlyReturn=!0),!this._earlyReturn){pt(r,e,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}_getSvgPath(){return null!=this._svg&&null!=this._path||(this._svg??=$(),this._path??=K("path"),this._svg.appendChild(this._path)),this._path}_getCanvasContext(t,e){return this._canvas??=document.createElement("canvas"),this._canvas.width=t,this._canvas.height=e,this._canvas.getContext("2d",{willReadFrequently:!0})}_hittestSvgPath(t,e,r,i=0){const s=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),o=this.reverseTransformPt(this._searchPoint),n=l();g(n,t);const a={x:n[0],y:n[1],width:n[2]-n[0],height:n[3]-n[1]},h=this._getSvgPath();h.setAttribute("d",e);const c=h.getBBox();let m=Math.max(c.width/a.width,c.height/a.height),f=1;const u=2*s*m;u<1&&(f=2/u,m*=f,c.x*=f,c.y*=f,c.width*=f,c.height*=f);const d=1+i*m/2,p=this._getCanvasContext(c.width+2*d,c.height+2*d);p.setTransform(f,0,0,f,-c.x+d,-c.y+d);const _=new Path2D(e);r?p.fill(_):(p.lineWidth=i*(m/f),p.stroke(_));const y=(a.width*m-c.width)/2,P=(a.height*m-c.height)/2,S=Math.floor((o[0]-a.x-s)*m-y+d),w=Math.floor((a.height-(o[1]-a.y)-s)*m+P+d),x=Math.ceil(2*s*m),M=Math.ceil(2*s*m),b=p.getImageData(S,w,x,M).data;for(let l=3;l<b.length;l+=4)if(b[l]>127.5)return void(this._earlyReturn=!0)}_hitTestStroke(t,e){let r=null;if(y(t)){const e=t;r=[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}else if(P(t))r=t.rings;else{if(!S(t))return;r=t.paths}pt(this.reverseTransformPt(this._searchPoint),r,G(e,I.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}class ft extends ht{constructor(t,e,r,i){super(e,r),this._applyAdditionalRenderProps=i,this._colorSubstitutionHelper=new b,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!0);else if(y(t))this._buildPath(_t(t).rings,!0);else{if(!x(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const r=this._ctx;r.fillStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",r.fill("evenodd")}drawSolidStroke(t,e,r,i,s,o){if(!t||!e||0===r)return;if(P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!1);else{if(!y(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(_t(t).rings,!0)}const n=this._ctx;n.strokeStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",n.lineWidth=Math.max(this.transformSize(r),nt),this._setCapStyle(i),this._setJoinStyle(s),n.miterLimit=o,n.stroke()}pushClipPath(t){if(this._ctx.save(),P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!0);else{if(!y(t))return;this._buildPath(_t(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:r,url:i,tintColor:s}=t,o=G(t.scaleX,1),n=this._resourceManager.getResource(i);if(null==n)return;let a=e*(n.width/n.height),l=e;e||(a=n.width,l=n.height);const h=D(i)||"src"in n&&D(n.src);let c="getFrame"in n?T(n):n;r&&(c=this._colorSubstitutionHelper.applyColorSubstitution(c,r)),this._applyAdditionalRenderProps&&!h&&s&&(c=this._colorSubstitutionHelper.tintImageData(c,s));const m=this.transformPt([0,0]),[f,u]=this.getTransformAngle(),d=this.transformSize(1),p=this._ctx;p.save(),p.setTransform({m11:o*d*f,m12:o*d*u,m21:-d*u,m22:d*f,m41:m[0],m42:m[1]}),p.drawImage(c,-a/2,-l/2,a,l),p.restore()}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new F);const r=Pt(t,this.transformSize(n(1))),i=this._textRasterizer.rasterizeText(e,r);if(!i)return;const{size:s,anchorX:o,anchorY:a,canvas:l}=i,h=s[0]*(o+.5),c=s[1]*(a-.5),m=this._ctx,f=this.transformPt([0,0]),[u,d]=this.getTransformAngle(),p=1;m.save(),m.setTransform({m11:p*u,m12:p*d,m21:-p*d,m22:p*u,m41:f[0]-p*h,m42:f[1]+p*c}),m.drawImage(l,0,0),m.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:r,height:i,offsetX:s,offsetY:o,rotation:n,scaleX:a,tintColor:l,url:h}=e;const c=this._resourceManager.getResource(h);if(null==c)return;if(P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!0);else if(y(t))this._buildPath(_t(t).rings,!0);else{if(!x(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const m=this._ctx,f=D(h)||"src"in c&&D(c.src);let u,d="getFrame"in c?T(c):c;if(r&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,r)),this._applyAdditionalRenderProps){f||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)),u=m.createPattern(d,"repeat");const t=this.transformSize(1);n||(n=0),s?s*=t:s=0,o?o*=t:o=0,i&&(i*=t);const e=i?i/c.height:1,r=a&&i?a*i/c.width:1;if(0!==n||1!==e||1!==r||0!==s||0!==o){const t=new DOMMatrix;t.rotateSelf(0,0,-n).translateSelf(s,o).scaleSelf(r,e,1),u.setTransform(t)}}else u=m.createPattern(d,"repeat");m.save(),m.fillStyle=u,m.fill("evenodd"),m.restore()}drawPictureStroke(t,r){if(!t)return;let{colorSubstitutions:i,capStyle:s,joinStyle:n,miterLimit:a,tintColor:l,url:h,width:c}=r;const m=this._resourceManager.getResource(h);if(null==m)return;let f;if(P(t))f=t.rings;else if(S(t))f=t.paths;else{if(!y(t))return x(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;f=_t(t).rings}c||(c=m.width);const u=D(h)||"src"in m&&D(m.src);let d="getFrame"in m?T(m):m;i&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,i)),this._applyAdditionalRenderProps&&(u||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)));const p=Math.max(this.transformSize(o(c)),.5),g=p/d.width,_=this._ctx,w=_.createPattern(d,"repeat-y");let M,b;_.save(),this._setCapStyle(s),this._setJoinStyle(n),void 0!==a&&(_.miterLimit=a),_.lineWidth=p;for(let o of f)if(o=e(o),wt(o),o&&!(o.length<=1)){M=this.transformPt(o[0]);for(let t=1;t<o.length;t++){b=this.transformPt(o[t]);const e=gt(M,b),r=new DOMMatrix;r.translateSelf(0,M[1]-p/2).scaleSelf(g,g,1).rotateSelf(0,0,90-e),w.setTransform(r),_.strokeStyle=w,_.beginPath(),_.moveTo(M[0],M[1]),_.lineTo(b[0],b[1]),_.stroke(),M=b}}_.restore()}drawGradientFill(t,e){if(!t)return;let r;if(P(t))r=t.rings;else if(S(t))r=t.paths;else{if(!y(t))return void at().error("Unable to draw gradient fill");r=_t(t).rings}this._buildPath(r,!0);const{angle:s,gradientMethod:n,gradientSize:a,gradientSizeUnits:l}=e,h=I.CIMGradientFill,g=e.gradientType??h.gradientType,_=-i(s??0),w=c();for(const i of r){const t=i?i.length:0;if(t>1)for(let e=0;e<t;e++){let t=this.transformPt(i[e]);"Linear"!==n&&"Rectangular"!==n||(t=R(t,-_)),m(w,t)}}const[x,M,b,k]=w,C=this._ctx;switch(C.save(),n){case"Buffered":at().error(`Gradient method "${n}" currently unsupported.`);break;case"Linear":{const t=(M+k)/2,r="Absolute"===l?this.transformSize(o(a)):H(a,h.gradientSize)*(b-x),[i,s]="Discrete"===g?[b,b-r]:[x+r,x],n=R([i,t],_),c=R([s,t],_),m=C.createLinearGradient(n[0],n[1],c[0],c[1]);z(m,e),C.fillStyle=m,C.fill("evenodd");break}case"Circular":{const t=f(w),r=p(w)/2,i="Absolute"===l?this.transformSize(o(a)):H(a,h.gradientSize)*r,[s,n]="Discrete"===g?[r,r-i]:[i,0],c=C.createRadialGradient(t[0],t[1],s,t[0],t[1],n);z(c,e),C.fillStyle=c,C.fill("evenodd");break}case"Rectangular":{const r=f(w),i=r[0],s=r[1],n=R(r,_),c=(r,i,s,o,a,l,h,c)=>{C.save(),this.pushClipPath(t);const m=R([a,l],_),f=R([h,c],_);C.beginPath(),C.moveTo(n[0],n[1]),C.lineTo(m[0],m[1]),C.lineTo(f[0],f[1]),C.lineTo(n[0],n[1]),C.clip();const u=R([r,i],_),d=R([s,o],_),p=C.createLinearGradient(u[0],u[1],d[0],d[1]);z(p,e),C.fillStyle=p,C.fill("evenodd"),C.restore()};let m="Absolute"===l?this.transformSize(o(a)):H(a,h.gradientSize)*(u(w)/2),[p,y]="Discrete"===g?[b,b-m]:[i+m,i];c(p,s,y,s,b,M,b,k),[p,y]="Discrete"===g?[x,x+m]:[i-m,i],c(p,s,y,s,x,k,x,M),m="Absolute"===l?this.transformSize(o(a)):H(a,h.gradientSize)*(d(w)/2);let[P,S]="Discrete"===g?[k,k-m]:[s+m,s];c(i,P,i,S,b,k,x,k),[P,S]="Discrete"===g?[M,M+m]:[s-m,s],c(i,P,i,S,x,M,b,M);break}}C.restore()}drawGradientStroke(t,r){const{capStyle:i,gradientMethod:s,gradientSize:n,gradientSizeUnits:a,joinStyle:l,miterLimit:h,width:c}=r;if(!t||0===c)return;let m;if(P(t))m=t.rings;else if(S(t))m=t.paths;else{if(!y(t))return void at().error("Unable to draw gradient stroke");m=_t(t).rings}const f=r.gradientType??I.CIMGradientStroke.gradientType,u=Math.max(this.transformSize(o(c)),.5),d=this._ctx;let p,g;d.save(),this._setCapStyle(i),this._setJoinStyle(l),void 0!==h&&(d.miterLimit=h),d.lineWidth=u;for(let _ of m){if(_=e(_),wt(_),!_||_.length<=1)continue;let t=0;p=this.transformPt(_[0]);for(let e=1;e<_.length;e++){g=this.transformPt(_[e]);const r=g[0]-p[0],i=g[1]-p[1];t+=Math.sqrt(r*r+i*i),p=g}const i="Absolute"===a?this.transformSize(o(n)):H(n,I.CIMGradientStroke.gradientSize)*("AcrossLine"===s?u:t);let l=0;p=this.transformPt(_[0]);for(let e=1;e<_.length;e++){g=this.transformPt(_[e]);const o=g[0]-p[0],n=g[1]-p[1],a=Math.sqrt(o*o+n*n);let h,c,m,y;switch(s){case"AcrossLine":{const[t,e]=R([o/a,n/a],-Math.PI/2),r=u/2,s="Discrete"===f?r:i-r;h=(p[0]+g[0])/2+t*s,c=(p[1]+g[1])/2+e*s,m=h-t*i,y=c-e*i;break}case"AlongLine":{const e=o/a,r=n/a;"Discrete"===f?(h=p[0]-e*l,c=p[1]-r*l,m=h+e*i,y=c+r*i):(m=p[0]+e*(t-l),y=p[1]+r*(t-l),h=m-e*i,c=y-r*i);break}default:return at().error("Unrecognized gradient method:",s),void d.restore()}const P=d.createLinearGradient(h,c,m,y);z(P,r),d.strokeStyle=P,d.beginPath(),d.moveTo(p[0],p[1]),d.lineTo(g[0],g[1]),d.stroke(),l+=a,p=g}}d.restore()}_buildPath(t,e){const r=this._ctx;if(r.beginPath(),t)for(const i of t){const t=i?i.length:0;if(t>1){let s=this.transformPt(i[0]);r.moveTo(s[0],s[1]);for(let e=1;e<t;e++)s=this.transformPt(i[e]),r.lineTo(s[0],s[1]);e&&r.closePath()}}}_setCapStyle(t){switch(t){case"Butt":this._ctx.lineCap="butt";break;case"Round":this._ctx.lineCap="round";break;case"Square":this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case"Bevel":this._ctx.lineJoin="bevel";break;case"Round":this._ctx.lineJoin="round";break;case"Miter":this._ctx.lineJoin="miter"}}}function ut(t,e,r){let i=G(t.separation,I.CIMHatchFill.separation)*r,s=G(t.rotation);if(0===i)return null;i<0&&(i=-i);let o=0;const n=.5*i;for(;o>n;)o-=i;for(;o<-n;)o+=i;const a=l();g(a,e),a[0]-=n,a[1]-=n,a[2]+=n,a[3]+=n;const h=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;s>180;)s-=180;for(;s<0;)s+=180;const c=Math.cos(s*ot),m=Math.sin(s*ot),f=-i*m,u=i*c;let d,p,_,y;o=G(t.offsetX)*r*m-G(t.offsetY)*r*c,d=_=Number.MAX_VALUE,p=y=-Number.MAX_VALUE;for(const l of h){const t=l[0],e=l[1],r=c*t+m*e,i=-m*t+c*e;d=Math.min(d,r),_=Math.min(_,i),p=Math.max(p,r),y=Math.max(y,i)}_=Math.floor(_/i)*i;let P=c*d-m*_-f*o/i,S=m*d+c*_-u*o/i,w=c*p-m*_-f*o/i,x=m*p+c*_-u*o/i;const M=1+Math.round((y-_)/i),b=[];for(let l=0;l<M;l++)P+=f,S+=u,w+=f,x+=u,b.push([[P,S],[w,x]]);return{paths:b}}function dt(t,e){let r=0;for(const i of e){const e=i.length;for(let s=1;s<e;s++){const e=i[s-1],o=i[s];if(e[1]>t[1]==o[1]>t[1])continue;(o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0])>0?r++:r--}}return 0!==r}function pt(t,e,r){for(const i of e){const e=i.length;for(let s=1;s<e;s++){const e=i[s-1],o=i[s];let n=(o[0]-e[0])*(o[0]-e[0])+(o[1]-e[1])*(o[1]-e[1]);if(0===n)continue;n=Math.sqrt(n);const a=((o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0]))/n;if(Math.abs(a)<r){const i=((o[0]-e[0])*(t[0]-e[0])+(o[1]-e[1])*(t[1]-e[1]))/n;if(i>-r&&i<n+r)return!0}}}return!1}function gt(t,e){const r=e[0]-t[0],i=e[1]-t[1];return 180/Math.PI*Math.atan2(i,r)}const _t=t=>t?{spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:null,yt=(t,e,r)=>{switch(t){case"ExtraLeading":return 1+e/r;case"Multiple":return e;case"Exact":return e/r}};function Pt(e,r=1){const i=B(e),s=E(e.fontStyleName),o=e.fontFamilyName??t,{weight:n,style:a}=s,l=r*(e.height||5),h=X(e.horizontalAlignment),c=J(e.verticalAlignment),m=N(e),f=N(e.haloSymbol),u=null!=f?r*(e.haloSize??0):0,d=O(e.symbol),p=r*(q(e.symbol)||0),g="CIMBackgroundCallout"===e.callout?.type?e.callout.backgroundSymbol:null,_=N(g),y=q(g),P=O(g);return{color:m,size:l,horizontalAlignment:h,verticalAlignment:c,font:{family:o,style:W(a),weight:V(n),decoration:i},outline:{size:p||0,color:d},halo:{size:u||0,color:f,style:a},backgroundColor:_,borderLine:null!=y&&null!=P?{size:y,color:P}:null,pixelRatio:1,premultiplyColors:!0}}const St=1e-4;function wt(t){let e,r,i,s,o,n=t[0],a=1;for(;a<t.length;)e=t[a][0]-n[0],r=t[a][1]-n[1],s=0!==e?r/e:Math.PI/2,void 0!==i&&Math.abs(s-i)<=St?(t.splice(a-1,1),n=o):(o=n,n=t[a],a++),i=s}export{ht as CIMSymbolDrawHelper,ft as CanvasDrawHelper,ct as EnvDrawHelper,mt as HittestDrawHelper,lt as Transformation,ot as cDegToRad,yt as lineGapType2LineHeight};
2
+ import{defaultFontFamily as t}from"../../core/fontUtils.js";import has from"../../core/has.js";import{clone as e}from"../../core/lang.js";import r from"../../core/Logger.js";import{deg2rad as s}from"../../core/mathUtils.js";import i from"../../core/ObjectPool.js";import{pt2px as o,px2pt as n}from"../../core/screenUtils.js";import{GeometryCursor as a}from"../../geometry/GeometryCursor.js";import{create as l,fromValues as h,empty as c,expandPointInPlace as m,center as f,width as u,height as d,diagonal as g}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as p}from"../../geometry/support/boundsUtils.js";import{polygonCentroid as _}from"../../geometry/support/centroid.js";import{segmentIntersects as y}from"../../geometry/support/intersectsBase.js";import{isExtent as P,isPolygon as S,isPolyline as w,isPoint as x,isMultipoint as M}from"../../geometry/support/jsonTypeUtils.js";import{SimpleEffectCursor as b}from"./CIMEffects.js";import k from"./CIMImageColorSubstitutionHelper.js";import{getEffectOperator as T,getPlacementOperator as C}from"./CIMOperators.js";import{Placement as v}from"./CIMPlacements.js";import{defaultCIMValues as I}from"./defaultCIMValues.js";import{getFirstFrame as R}from"./imageUtils.js";import{rotate as z}from"./mathUtils.js";import{addColorStops as L}from"./rasterizingUtils.js";import F from"./Rect.js";import U from"./TextRasterizer.js";import{isMarkerScreenAligned as A,isCIMFill as j,getSize as G,getNumericValue as D,isSVGImage as H,getRelativeGradientSize as E,fromCIMFontDecoration as B,fromCIMFontStyle as X,fromCIMHorizontalAlignment as J,fromCIMVerticalAlignment as N,getFillColor as O,getStrokeColor as q,getStrokeWidth as V,getFontWeight as W,getFontStyle as Y}from"./utils.js";import{destroyHiddenSvg as $,createHiddenSvg as K,createSvgElement as Q}from"../../views/2d/engine/svgUtils.js";import{magicLabelLineHeight as Z,glyphSize as tt,hittestToleranceSmallSymbol as et,hittestSmallSymbolThreshold as rt}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as st}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as it,getLineWidth as ot}from"../../views/2d/layers/graphics/graphicsUtils.js";const nt=Math.PI/180,at=.5,lt=()=>r.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class ht{constructor(t){this._t=t}static createIdentity(){return new ht([1,0,0,0,1,0])}clone(){const t=this._t;return new ht(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new ht([t,0,0,0,e,0])}scale(t,e){const r=this._t;return r[0]*=t,r[1]*=t,r[2]*=t,r[3]*=e,r[4]*=e,r[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new ht([0,0,t,0,0,e])}translate(t,e){const r=this._t;return r[2]+=t,r[5]+=e,this}static createRotate(t){const e=Math.cos(t),r=Math.sin(t);return new ht([e,-r,0,r,e,0])}rotate(t){return ht.multiply(this,ht.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],r=Math.sqrt(t*t+e*e);return[t/r,e/r]}static multiply(t,e,r){const s=t._t,i=e._t,o=s[0]*i[0]+s[3]*i[1],n=s[1]*i[0]+s[4]*i[1],a=s[2]*i[0]+s[5]*i[1]+i[2],l=s[0]*i[3]+s[3]*i[4],h=s[1]*i[3]+s[4]*i[4],c=s[2]*i[3]+s[5]*i[4]+i[5],m=r._t;return m[0]=o,m[1]=n,m[2]=a,m[3]=l,m[4]=h,m[5]=c,r}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(0===e)return new ht([0,0,0,0,0,0]);e=1/e;const r=(t[1]*t[5]-t[2]*t[4])*e,s=(t[2]*t[3]-t[0]*t[5])*e,i=t[4]*e,o=-t[1]*e,n=-t[3]*e,a=t[0]*e;return new ht([i,o,r,n,a,s])}}class ct{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new i(()=>new v,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||ht.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||ht.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const r=e?t.scaleRatio():1;ht.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,r){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,r)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const r=t.symbolLayers;if(!r)return;const s=t.effects;if(s&&s.length>0){const t=this.executeEffects(s,e);if(t){let e=t.next();for(;e;)this.drawSymbolLayers(r,e.asJSON()),e=t.next()}}else this.drawSymbolLayers(r,e)}executeEffects(t,e){let r=new b(a.fromJSONCIM(e));for(const s of t){const t=T(s);t&&(r=t.execute(r,s,this.geomUnitsPerPoint(),null))}return r}drawSymbolLayers(t,e){let r=t.length;for(;r--;){const s=t[r];if(!s||!1===s.enable)continue;const i=s.effects;if(i&&i.length>0){const t=this.executeEffects(i,e);if(t){let e=null;for(;(e=t.next())&&(this.drawSymbolLayer(s,e.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(s,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const r=dt(e,t,this.geomUnitsPerPoint());r&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,r),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const r=t.markerPlacement;if(r){const s=C(r);if(s){const i="CIMMarkerPlacementInsidePolygon"===r.type||"CIMMarkerPlacementPolygonCenter"===r.type&&r.clipAtBoundary;i&&this.pushClipPath(e);const o=s.execute(a.fromJSONCIM(e),r,this.geomUnitsPerPoint(),null);if(o){let e=null;for(;(e=o.next())&&(this.drawMarker(t,e),!this._earlyReturn););}i&&this.popClipPath()}}else{const r=this._placementPool.acquire();if(x(e))r.tx=e.x,r.ty=e.y,this.drawMarker(t,r);else if(S(e)){const s=_(e);s&&([r.tx,r.ty]=s,this.drawMarker(t,r))}else if(w(e)){for(const s of e.paths)for(const e of s)if(r.tx=e[0],r.ty=e[1],this.drawMarker(t,r),this._earlyReturn)break}else for(const s of e.points)if(r.tx=s[0],r.ty=s[1],this.drawMarker(t,r),this._earlyReturn)break;this._placementPool.release(r)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const r=this._resourceManager.getResource(t.url),s=D(t.size,I.CIMPictureMarker.size);if(null==r||s<=0)return;const i=r.width,o=r.height;if(!i||!o)return;const n=i/o,a=D(t.scaleX,1),l=ht.createIdentity(),h=t.anchorPoint;if(h){let e=h.x,r=h.y;"Absolute"!==t.anchorPointUnits&&(e*=s*n*a,r*=s),l.translate(-e,-r)}let c=D(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*nt);let m=D(t.offsetX),f=D(t.offsetY);if(m||f){if(this._mapRotation){const t=nt*this._mapRotation,e=Math.cos(t),r=Math.sin(t),s=m*r+f*e;m=m*e-f*r,f=s}l.translate(m,f)}const u=this.geomUnitsPerPoint();1!==u&&l.scale(u,u);const d=e.getAngle();d&&l.rotate(d),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,s),this.pop()}drawVectorMarker(t,e){if(!t)return;const r=t.markerGraphics;if(!r)return;const s=D(t.size,I.CIMVectorMarker.size),i=t.frame,o=i?i.ymax-i.ymin:0,n=s&&o?s/o:1,a=ht.createIdentity();i&&a.translate(.5*-(i.xmax+i.xmin),.5*-(i.ymax+i.ymin));const l=t.anchorPoint;if(l){let e=l.x,r=l.y;"Absolute"!==t.anchorPointUnits?i&&(e*=i.xmax-i.xmin,r*=i.ymax-i.ymin):(e/=n,r/=n),a.translate(-e,-r)}1!==n&&a.scale(n,n);let h=D(t.rotation);t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&a.rotate(h*nt);let c=D(t.offsetX),m=D(t.offsetY);if(c||m){if(this._mapRotation){const t=nt*this._mapRotation,e=Math.cos(t),r=Math.sin(t),s=c*r+m*e;c=c*e-m*r,m=s}a.translate(c,m)}const f=this.geomUnitsPerPoint();1!==f&&a.scale(f,f);const u=e.getAngle();u&&a.rotate(u),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const d of r){d?.symbol&&d.geometry||lt().error("Invalid marker graphic",d);let t=d.textString;if("number"==typeof t&&(t=t.toString()),this.drawSymbol(d.symbol,d.geometry,t),this._earlyReturn)break}this.pop()}drawTextSymbol(t,e,r){if(!t)return;if(!x(e))return;if(D(t.height,I.CIMTextSymbol.height)<=0)return;const s=ht.createIdentity();let i=D(t.angle);i=-i,i&&s.rotate(i*nt);const o=D(t.offsetX),n=D(t.offsetY);(o||n)&&s.translate(o,n);const a=this.geomUnitsPerPoint();1!==a&&s.scale(a,a),s.translate(e.x,e.y),this.push(s,!1),this.drawText(t,r),this.pop()}}class mt extends ct{constructor(t,e){super(t,e),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new F(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return h(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if(S(t))this._processPath(t.rings,0);else if(w(t))this._processPath(t.paths,0);else if(P(t)){const e=yt(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,r){if(!t||this._clipCount>0||null==r||r<=0)return;const s=Math.max(.5*this.transformSize(D(r,I.CIMSolidStroke.width)),.5*at);if(S(t))this._processPath(t.rings,s);else if(w(t))this._processPath(t.paths,s);else if(P(t)){const e=yt(t);e&&this._processPath(e.rings,s)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){S(e)&&t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:r}=t,s=D(t.scaleX,1);let i=s*e,o=e;const n=this._resourceManager.getResource(r);if(null!=n){const t=n.height/n.width;i=s*(e?t>1?e:e/t:n.width),o=e?t>1?e*t:e:n.height}this._merge(this.transformPt([-i/2,-o/2]),0),this._merge(this.transformPt([-i/2,o/2]),0),this._merge(this.transformPt([i/2,-o/2]),0),this._merge(this.transformPt([i/2,o/2]),0)}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new U);const r=St(t);let[s,i]=this._textRasterizer.computeTextSize(e,r);s=n(s),i=n(i);const o=this.transformSize(1)*this.reverseTransformScalar(1);s*=o,i*=o;let a=0;switch(t.horizontalAlignment){case"Left":a=s/2;break;case"Right":a=-s/2}let l=0;switch(t.verticalAlignment){case"Bottom":l=i/2;break;case"Top":l=-i/2;break;case"Baseline":l=i/6}this._merge(this.transformPt([-s/2+a,-i/2+l]),0),this._merge(this.transformPt([-s/2+a,i/2+l]),0),this._merge(this.transformPt([s/2+a,-i/2+l]),0),this._merge(this.transformPt([s/2+a,i/2+l]),0)}_processPath(t,e){if(t)for(const r of t){const t=r?r.length:0;if(t>1){this._merge(this.transformPt(r[0]),e);for(let s=1;s<t;s++)this._merge(this.transformPt(r[s]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class ft extends ct{constructor(){super(...arguments),this._hittestType="point",this._searchTarget=[],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=$(this._svg),this._path=null,this._canvas=null}hitTest(t,e,r,s,i,a,l,h){this._resetHittest();const c=a*o(1);switch(this.setGeomUnitsPerPoint(c),h){case"point":if(1!==t.length)return lt().error("Unexpected hittest area",t),!1;this._hittestType="point",this._searchDistPoint=l/2/c,this._searchTarget=[[t[0].x,t[0].y]];break;case"rect":if(4!==t.length)return lt().error("Unexpected hittest area",t),!1;this._hittestType="rect",this._searchDistPoint=0,this._searchTarget=t.map(t=>[t.x,t.y])}this._textInfo=s;const m=e&&("CIMPointSymbol"===e.type&&"Map"!==e.angleAlignment||"CIMTextSymbol"===e.type||e.symbolLayers?.some(t=>A(t)));if(this._mapRotation=m?i:0,!has("esri-mobile")){const t=n(et*window.devicePixelRatio),r=n(rt);!(("CIMLineSymbol"===e?.type||"CIMPolygonSymbol"===e?.type)&&e.symbolLayers?.some(j))&&"CIMMeshSymbol"!==e?.type&&(G(e)??0)<r&&(this._searchDistPoint=t)}return this._earlyReturn=!1,this.drawSymbol(e,r),this._earlyReturn}executeEffects(t,e){return"CIMGeometricEffectDashes"===t.at(-1)?.type&&(t=t.slice(0,-1)),super.executeEffects(t,e)}drawSolidFill(t,e,r){null!=r?this._hittestSvgPath(t,r,!0):this._hitTestFill(t)}drawHatchFill(t,e){this._hitTestFill(t)}drawPictureFill(t,e){this._hitTestFill(t)}drawGradientFill(t,e){this._hitTestFill(t)}drawSolidStroke(t,e,r,s,i,o,n){null!=n?this._hittestSvgPath(t,n,!1,r):this._hitTestStroke(t,r)}drawPictureStroke(t,e){this._hitTestStroke(t,e.width)}drawGradientStroke(t,e){this._hitTestStroke(t,e.width)}drawMarkerLayer(t,e){t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._hitTestFill(e):super.drawMarkerLayer(t,e)}pushClipPath(t){}popClipPath(){}drawImage(t,e){const{url:r}=t,s=D(t.scaleX,1),i=this._resourceManager.getResource(r);if(null==i||0===i.height||0===e)return;const o=e*this.geomUnitsPerPoint(),n=o*s*(i.width/i.height);if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]),e=this._searchDistPoint;Math.abs(t[0])<n/2+e&&Math.abs(t[1])<o/2+e&&(this._earlyReturn=!0)}else{const t=n/2,e=o/2,r=[[-t,e],[t,e],[t,-e],[-t,-e],[-t,e]];bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[r])&&(this._earlyReturn=!0)}}drawText(t,e){const r=this._textInfo;if(!r)return;const s=r.get(t);if(!s)return;if(!s.glyphMosaicItems.glyphs.length)return;const i=it(D(t.height,I.CIMTextSymbol.height)),{lineGapType:o,lineGap:n}=t,a=o?Pt(o,D(n),i):0,l="CIMBackgroundCallout"===t.callout?.type,h=st(s.glyphMosaicItems,{scale:i/tt,angle:0,xOffset:0,yOffset:0,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:ot(t.lineWidth),lineHeight:Z*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:l});if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]),e=t[0],r=t[1];for(const s of h.glyphs){const[t,i]=s.offsets.topLeft,[o,n]=s.offsets.bottomRight;if(e>t&&e<o&&r>-n&&r<-i){this._earlyReturn=!0;break}}}else for(const c of h.glyphs){const[t,e]=c.offsets.topLeft,[r,s]=c.offsets.bottomRight,i=[[t,-e],[r,-e],[r,-s],[t,-s],[t,-e]];if(bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[i])){this._earlyReturn=!0;break}}}_hitTestFill(t){let e=null;if(P(t)){const r=t;e=[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}else if(S(t))e=t.rings;else{if(!w(t))return;e=t.paths}if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]);if(gt(t,e)&&(this._earlyReturn=!0),!this._earlyReturn){pt(t,e,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}else{bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,e)&&(this._earlyReturn=!0)}}_getSvgPath(){return null!=this._svg&&null!=this._path||(this._svg??=K(),this._path??=Q("path"),this._svg.appendChild(this._path)),this._path}_getCanvasContext(t,e){return this._canvas??=document.createElement("canvas"),this._canvas.width=t,this._canvas.height=e,this._canvas.getContext("2d",{willReadFrequently:!0})}_hittestSvgPath(t,e,r,s=0){const i=l();p(i,t);const o={x:i[0],y:i[1],width:i[2]-i[0],height:i[3]-i[1]},n=this._getSvgPath();n.setAttribute("d",e);const a=n.getBBox();if("point"===this._hittestType){const t=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),i=this.reverseTransformPt(this._searchTarget[0]);let n=Math.max(a.width/o.width,a.height/o.height),l=1;const h=2*t*n;h<1&&(l=2/h,n*=l,a.x*=l,a.y*=l,a.width*=l,a.height*=l);const c=1+s*n/2,m=this._getCanvasContext(a.width+2*c,a.height+2*c);m.setTransform(l,0,0,l,-a.x+c,-a.y+c);const f=new Path2D(e);r?m.fill(f):(m.lineWidth=s*(n/l),m.stroke(f));const u=(o.width*n-a.width)/2,d=(o.height*n-a.height)/2,g=Math.floor((i[0]-o.x-t)*n-u+c),p=Math.floor((o.height-(i[1]-o.y)-t)*n+d+c),_=Math.ceil(2*t*n),y=Math.ceil(2*t*n),P=m.getImageData(g,p,_,y).data;for(let e=3;e<P.length;e+=4)if(P[e]>127.5)return void(this._earlyReturn=!0)}else{const t=[[o.x,o.y],[o.x,o.y+o.height],[o.x+o.width,o.y+o.height],[o.x+o.width,o.y],[o.x,o.y]];if(bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[t]))return void(this._earlyReturn=!0)}}_hitTestStroke(t,e){let r=null;if(P(t)){const e=t;r=[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}else if(S(t))r=t.rings;else{if(!w(t))return;r=t.paths}if("point"===this._hittestType){pt(this.reverseTransformPt(this._searchTarget[0]),r,D(e,I.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}else{bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,r)&&(this._earlyReturn=!0)}}_resetHittest(){this.setTransform(),this._hittestType="point",this._searchTarget=[],this._searchDistPoint=0,this._textInfo=null}}class ut extends ct{constructor(t,e,r,s){super(e,r),this._applyAdditionalRenderProps=s,this._colorSubstitutionHelper=new k,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(S(t))this._buildPath(t.rings,!0);else if(w(t))this._buildPath(t.paths,!0);else if(P(t))this._buildPath(yt(t).rings,!0);else{if(!M(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const r=this._ctx;r.fillStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",r.fill("evenodd")}drawSolidStroke(t,e,r,s,i,o){if(!t||!e||0===r)return;if(S(t))this._buildPath(t.rings,!0);else if(w(t))this._buildPath(t.paths,!1);else{if(!P(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(yt(t).rings,!0)}const n=this._ctx;n.strokeStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",n.lineWidth=Math.max(this.transformSize(r),at),this._setCapStyle(s),this._setJoinStyle(i),n.miterLimit=o,n.stroke()}pushClipPath(t){if(this._ctx.save(),S(t))this._buildPath(t.rings,!0);else if(w(t))this._buildPath(t.paths,!0);else{if(!P(t))return;this._buildPath(yt(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:r,url:s,tintColor:i}=t,o=D(t.scaleX,1),n=this._resourceManager.getResource(s);if(null==n)return;let a=e*(n.width/n.height),l=e;e||(a=n.width,l=n.height);const h=H(s)||"src"in n&&H(n.src);let c="getFrame"in n?R(n):n;r&&(c=this._colorSubstitutionHelper.applyColorSubstitution(c,r)),this._applyAdditionalRenderProps&&!h&&i&&(c=this._colorSubstitutionHelper.tintImageData(c,i));const m=this.transformPt([0,0]),[f,u]=this.getTransformAngle(),d=this.transformSize(1),g=this._ctx;g.save(),g.setTransform({m11:o*d*f,m12:o*d*u,m21:-d*u,m22:d*f,m41:m[0],m42:m[1]}),g.drawImage(c,-a/2,-l/2,a,l),g.restore()}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new U);const r=St(t,this.transformSize(n(1))),s=this._textRasterizer.rasterizeText(e,r);if(!s)return;const{size:i,anchorX:o,anchorY:a,canvas:l}=s,h=i[0]*(o+.5),c=i[1]*(a-.5),m=this._ctx,f=this.transformPt([0,0]),[u,d]=this.getTransformAngle(),g=1;m.save(),m.setTransform({m11:g*u,m12:g*d,m21:-g*d,m22:g*u,m41:f[0]-g*h,m42:f[1]+g*c}),m.drawImage(l,0,0),m.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:r,height:s,offsetX:i,offsetY:o,rotation:n,scaleX:a,tintColor:l,url:h}=e;const c=this._resourceManager.getResource(h);if(null==c)return;if(S(t))this._buildPath(t.rings,!0);else if(w(t))this._buildPath(t.paths,!0);else if(P(t))this._buildPath(yt(t).rings,!0);else{if(!M(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const m=this._ctx,f=H(h)||"src"in c&&H(c.src);let u,d="getFrame"in c?R(c):c;if(r&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,r)),this._applyAdditionalRenderProps){f||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)),u=m.createPattern(d,"repeat");const t=this.transformSize(1);n||(n=0),i?i*=t:i=0,o?o*=t:o=0,s&&(s*=t);const e=s?s/c.height:1,r=a&&s?a*s/c.width:1;if(0!==n||1!==e||1!==r||0!==i||0!==o){const t=new DOMMatrix;t.rotateSelf(0,0,-n).translateSelf(i,o).scaleSelf(r,e,1),u.setTransform(t)}}else u=m.createPattern(d,"repeat");m.save(),m.fillStyle=u,m.fill("evenodd"),m.restore()}drawPictureStroke(t,r){if(!t)return;let{colorSubstitutions:s,capStyle:i,joinStyle:n,miterLimit:a,tintColor:l,url:h,width:c}=r;const m=this._resourceManager.getResource(h);if(null==m)return;let f;if(S(t))f=t.rings;else if(w(t))f=t.paths;else{if(!P(t))return M(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;f=yt(t).rings}c||(c=m.width);const u=H(h)||"src"in m&&H(m.src);let d="getFrame"in m?R(m):m;s&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,s)),this._applyAdditionalRenderProps&&(u||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)));const g=Math.max(this.transformSize(o(c)),.5),p=g/d.width,_=this._ctx,y=_.createPattern(d,"repeat-y");let x,b;_.save(),this._setCapStyle(i),this._setJoinStyle(n),void 0!==a&&(_.miterLimit=a),_.lineWidth=g;for(let o of f)if(o=e(o),xt(o),o&&!(o.length<=1)){x=this.transformPt(o[0]);for(let t=1;t<o.length;t++){b=this.transformPt(o[t]);const e=_t(x,b),r=new DOMMatrix;r.translateSelf(0,x[1]-g/2).scaleSelf(p,p,1).rotateSelf(0,0,90-e),y.setTransform(r),_.strokeStyle=y,_.beginPath(),_.moveTo(x[0],x[1]),_.lineTo(b[0],b[1]),_.stroke(),x=b}}_.restore()}drawGradientFill(t,e){if(!t)return;let r;if(S(t))r=t.rings;else if(w(t))r=t.paths;else{if(!P(t))return void lt().error("Unable to draw gradient fill");r=yt(t).rings}this._buildPath(r,!0);const{angle:i,gradientMethod:n,gradientSize:a,gradientSizeUnits:l}=e,h=I.CIMGradientFill,p=e.gradientType??h.gradientType,_=-s(i??0),y=c();for(const s of r){const t=s?s.length:0;if(t>1)for(let e=0;e<t;e++){let t=this.transformPt(s[e]);"Linear"!==n&&"Rectangular"!==n||(t=z(t,-_)),m(y,t)}}const[x,M,b,k]=y,T=this._ctx;switch(T.save(),n){case"Buffered":lt().error(`Gradient method "${n}" currently unsupported.`);break;case"Linear":{const t=(M+k)/2,r="Absolute"===l?this.transformSize(o(a)):E(a,h.gradientSize)*(b-x),[s,i]="Discrete"===p?[b,b-r]:[x+r,x],n=z([s,t],_),c=z([i,t],_),m=T.createLinearGradient(n[0],n[1],c[0],c[1]);L(m,e),T.fillStyle=m,T.fill("evenodd");break}case"Circular":{const t=f(y),r=g(y)/2,s="Absolute"===l?this.transformSize(o(a)):E(a,h.gradientSize)*r,[i,n]="Discrete"===p?[r,r-s]:[s,0],c=T.createRadialGradient(t[0],t[1],i,t[0],t[1],n);L(c,e),T.fillStyle=c,T.fill("evenodd");break}case"Rectangular":{const r=f(y),s=r[0],i=r[1],n=z(r,_),c=(r,s,i,o,a,l,h,c)=>{T.save(),this.pushClipPath(t);const m=z([a,l],_),f=z([h,c],_);T.beginPath(),T.moveTo(n[0],n[1]),T.lineTo(m[0],m[1]),T.lineTo(f[0],f[1]),T.lineTo(n[0],n[1]),T.clip();const u=z([r,s],_),d=z([i,o],_),g=T.createLinearGradient(u[0],u[1],d[0],d[1]);L(g,e),T.fillStyle=g,T.fill("evenodd"),T.restore()};let m="Absolute"===l?this.transformSize(o(a)):E(a,h.gradientSize)*(u(y)/2),[g,P]="Discrete"===p?[b,b-m]:[s+m,s];c(g,i,P,i,b,M,b,k),[g,P]="Discrete"===p?[x,x+m]:[s-m,s],c(g,i,P,i,x,k,x,M),m="Absolute"===l?this.transformSize(o(a)):E(a,h.gradientSize)*(d(y)/2);let[S,w]="Discrete"===p?[k,k-m]:[i+m,i];c(s,S,s,w,b,k,x,k),[S,w]="Discrete"===p?[M,M+m]:[i-m,i],c(s,S,s,w,x,M,b,M);break}}T.restore()}drawGradientStroke(t,r){const{capStyle:s,gradientMethod:i,gradientSize:n,gradientSizeUnits:a,joinStyle:l,miterLimit:h,width:c}=r;if(!t||0===c)return;let m;if(S(t))m=t.rings;else if(w(t))m=t.paths;else{if(!P(t))return void lt().error("Unable to draw gradient stroke");m=yt(t).rings}const f=r.gradientType??I.CIMGradientStroke.gradientType,u=Math.max(this.transformSize(o(c)),.5),d=this._ctx;let g,p;d.save(),this._setCapStyle(s),this._setJoinStyle(l),void 0!==h&&(d.miterLimit=h),d.lineWidth=u;for(let _ of m){if(_=e(_),xt(_),!_||_.length<=1)continue;let t=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const r=p[0]-g[0],s=p[1]-g[1];t+=Math.sqrt(r*r+s*s),g=p}const s="Absolute"===a?this.transformSize(o(n)):E(n,I.CIMGradientStroke.gradientSize)*("AcrossLine"===i?u:t);let l=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const o=p[0]-g[0],n=p[1]-g[1],a=Math.sqrt(o*o+n*n);let h,c,m,y;switch(i){case"AcrossLine":{const[t,e]=z([o/a,n/a],-Math.PI/2),r=u/2,i="Discrete"===f?r:s-r;h=(g[0]+p[0])/2+t*i,c=(g[1]+p[1])/2+e*i,m=h-t*s,y=c-e*s;break}case"AlongLine":{const e=o/a,r=n/a;"Discrete"===f?(h=g[0]-e*l,c=g[1]-r*l,m=h+e*s,y=c+r*s):(m=g[0]+e*(t-l),y=g[1]+r*(t-l),h=m-e*s,c=y-r*s);break}default:return lt().error("Unrecognized gradient method:",i),void d.restore()}const P=d.createLinearGradient(h,c,m,y);L(P,r),d.strokeStyle=P,d.beginPath(),d.moveTo(g[0],g[1]),d.lineTo(p[0],p[1]),d.stroke(),l+=a,g=p}}d.restore()}_buildPath(t,e){const r=this._ctx;if(r.beginPath(),t)for(const s of t){const t=s?s.length:0;if(t>1){let i=this.transformPt(s[0]);r.moveTo(i[0],i[1]);for(let e=1;e<t;e++)i=this.transformPt(s[e]),r.lineTo(i[0],i[1]);e&&r.closePath()}}}_setCapStyle(t){switch(t){case"Butt":this._ctx.lineCap="butt";break;case"Round":this._ctx.lineCap="round";break;case"Square":this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case"Bevel":this._ctx.lineJoin="bevel";break;case"Round":this._ctx.lineJoin="round";break;case"Miter":this._ctx.lineJoin="miter"}}}function dt(t,e,r){let s=D(t.separation,I.CIMHatchFill.separation)*r,i=D(t.rotation);if(0===s)return null;s<0&&(s=-s);let o=0;const n=.5*s;for(;o>n;)o-=s;for(;o<-n;)o+=s;const a=l();p(a,e),a[0]-=n,a[1]-=n,a[2]+=n,a[3]+=n;const h=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;i>180;)i-=180;for(;i<0;)i+=180;const c=Math.cos(i*nt),m=Math.sin(i*nt),f=-s*m,u=s*c;let d,g,_,y;o=D(t.offsetX)*r*m-D(t.offsetY)*r*c,d=_=Number.MAX_VALUE,g=y=-Number.MAX_VALUE;for(const l of h){const t=l[0],e=l[1],r=c*t+m*e,s=-m*t+c*e;d=Math.min(d,r),_=Math.min(_,s),g=Math.max(g,r),y=Math.max(y,s)}_=Math.floor(_/s)*s;let P=c*d-m*_-f*o/s,S=m*d+c*_-u*o/s,w=c*g-m*_-f*o/s,x=m*g+c*_-u*o/s;const M=1+Math.round((y-_)/s),b=[];for(let l=0;l<M;l++)P+=f,S+=u,w+=f,x+=u,b.push([[P,S],[w,x]]);return{paths:b}}function gt(t,e){let r=0;for(const s of e){const e=s.length;for(let i=1;i<e;i++){const e=s[i-1],o=s[i];if(e[1]>t[1]==o[1]>t[1])continue;(o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0])>0?r++:r--}}return 0!==r}function pt(t,e,r){for(const s of e){const e=s.length;for(let i=1;i<e;i++){const e=s[i-1],o=s[i];let n=(o[0]-e[0])*(o[0]-e[0])+(o[1]-e[1])*(o[1]-e[1]);if(0===n)continue;n=Math.sqrt(n);const a=((o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0]))/n;if(Math.abs(a)<r){const s=((o[0]-e[0])*(t[0]-e[0])+(o[1]-e[1])*(t[1]-e[1]))/n;if(s>-r&&s<n+r)return!0}}}return!1}function _t(t,e){const r=e[0]-t[0],s=e[1]-t[1];return 180/Math.PI*Math.atan2(s,r)}const yt=t=>t?{spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:null,Pt=(t,e,r)=>{switch(t){case"ExtraLeading":return 1+e/r;case"Multiple":return e;case"Exact":return e/r}};function St(e,r=1){const s=B(e),i=X(e.fontStyleName),o=e.fontFamilyName??t,{weight:n,style:a}=i,l=r*(e.height||5),h=J(e.horizontalAlignment),c=N(e.verticalAlignment),m=O(e),f=O(e.haloSymbol),u=null!=f?r*(e.haloSize??0):0,d=q(e.symbol),g=r*(V(e.symbol)||0),p="CIMBackgroundCallout"===e.callout?.type?e.callout.backgroundSymbol:null,_=O(p),y=V(p),P=q(p);return{color:m,size:l,horizontalAlignment:h,verticalAlignment:c,font:{family:o,style:Y(a),weight:W(n),decoration:s},outline:{size:g||0,color:d},halo:{size:u||0,color:f,style:a},backgroundColor:_,borderLine:null!=y&&null!=P?{size:y,color:P}:null,pixelRatio:1,premultiplyColors:!0}}const wt=1e-4;function xt(t){let e,r,s,i,o,n=t[0],a=1;for(;a<t.length;)e=t[a][0]-n[0],r=t[a][1]-n[1],i=0!==e?r/e:Math.PI/2,void 0!==s&&Math.abs(i-s)<=wt?(t.splice(a-1,1),n=o):(o=n,n=t[a],a++),s=i}function Mt(t){const e=t[0],r=t[t.length-1];return e[0]===r[0]&&e[1]===r[1]}function bt(t,e){t.length>1&&!Mt(t)&&(t=[...t,t[0]]);for(let r=0;r<e.length;r++){const s=e[r],i=s.length;for(const e of s)if(gt(e,[t]))return!0;if(Mt(s))for(const r of t)if(gt(r,e))return!0;for(let e=1;e<i;e++){const r=s[e-1],i=s[e];for(let e=0;e<t.length;e++){const s=t[e],o=t[(e+1)%t.length];if(y(r,i,s,o))return!0}}}return!1}export{ct as CIMSymbolDrawHelper,ut as CanvasDrawHelper,mt as EnvDrawHelper,ft as HittestDrawHelper,ht as Transformation,nt as cDegToRad,Pt as lineGapType2LineHeight};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isPromiseLike as e}from"../../core/promiseUtils.js";import{when as t,watch as a}from"../../core/reactiveUtils.js";import{addFrameTask as s}from"../../core/scheduling.js";import i from"./PaddedViewState.js";import{newScheduler as r}from"../support/Scheduler.js";class d{constructor(a){this.view=a,this._stationaryHandle=null,this._frameTaskHandle=null,this._updateParameters=null,this._updateRequested=!1,this._scheduler=r(),this._schedulerHandle=t(()=>this._scheduler.updating,()=>this.requestFrame()),this.stationary=!0,this.prepare=()=>{this._updateParameters&&(this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions,this._updateParameters.targetState.copy(this.view.state),null==this.view.animation?.target||e(this.view.animation.target)||(this._updateParameters.targetState.viewpoint=this.view.animation.target))},this.update=e=>{if(this._updateRequested=!1,this.view?.destroyed)return;const{allLayerViews:t,graphicsView:a,labelManager:s,state:{id:i}}=this.view;t?.forEach(this._updateLayerView,this),null!=s&&(s.lastUpdateId!==i&&(s.viewChange(),s.lastUpdateId=i),s.updateRequested&&s.processUpdate(this._updateParameters)),null!=a&&(a.lastUpdateId!==i&&(a.viewChange(),a.lastUpdateId=i),a.updateRequested&&a.processUpdate(this._updateParameters)),this.view.graphicsTileStore?.setViewState(this._updateParameters.state),this.view.animation?this._scheduler.state=0:this.view.interacting?this._scheduler.state=1:this._scheduler.state=2;this._scheduler.frame(e)||this._updateRequested||2!==this._scheduler.state||this._frameTaskHandle?.pause()}}destroy(){this.stop(),this._schedulerHandle.remove(),this._scheduler.destroy()}get scheduler(){return this._scheduler}start(){if(this._frameTaskHandle)return;const e=this.view;this.stationary=e.stationary,this._updateParameters={state:e.state,targetState:new i,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:e.renderingOptions},this._stationaryHandle=a(()=>e.stationary,e=>{this.stationary=e,this.requestFrame()}),this._frameTaskHandle=s(this),this.requestUpdate()}stop(){this._frameTaskHandle&&(this._updateRequested=!1,this._stationaryHandle?.remove(),this._frameTaskHandle.remove(),this._updateParameters=this._stationaryHandle=this._frameTaskHandle=null,this.stationary=!0)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(e){if(!e.attached)return void this.requestUpdate();const t=this.view.state,a=e.lastUpdateId;null!=a&&(this.stationary||e.moving)||(e.moving=!0),a!==t.id&&e.viewChange(),this.stationary&&e.moving&&(e.moving=!1,e.moveEnd()),e.lastUpdateId=t.id,e.updateRequested&&e.processUpdate(this._updateParameters),"layerViews"in e&&e.layerViews?.forEach(this._updateLayerView,this)}}export{d as default};
2
+ import{isPromiseLike as t}from"../../core/promiseUtils.js";import{when as e,watch as s}from"../../core/reactiveUtils.js";import{addFrameTask as a}from"../../core/scheduling.js";import i from"./PaddedViewState.js";import{newScheduler as r}from"../support/Scheduler.js";class h{constructor(s){this.view=s,this._stationaryHandle=null,this._frameTaskHandle=null,this._updateParameters=null,this._updateRequested=!1,this._scheduler=r(),this._schedulerHandle=e(()=>this._scheduler.updating,()=>this.requestFrame()),this.stationary=!0,this.prepare=()=>{this._updateParameters&&(this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions,this._updateParameters.targetState.copy(this.view.state),null==this.view.animation?.target||t(this.view.animation.target)||(this._updateParameters.targetState.viewpoint=this.view.animation.target))},this.update=t=>{if(this._updateRequested=!1,this.view?.destroyed)return;const{allLayerViews:e,graphicsView:s,state:{id:a}}=this.view;e?.forEach(this._updateLayerView,this),null!=s&&(s.lastUpdateId!==a&&(s.viewChange(),s.lastUpdateId=a),s.updateRequested&&s.processUpdate(this._updateParameters)),this.view.graphicsTileStore?.setViewState(this._updateParameters.state),this.view.animation?this._scheduler.state=0:this.view.interacting?this._scheduler.state=1:this._scheduler.state=2;this._scheduler.frame(t)||this._updateRequested||2!==this._scheduler.state||this._frameTaskHandle?.pause()}}destroy(){this.stop(),this._schedulerHandle.remove(),this._scheduler.destroy()}get scheduler(){return this._scheduler}start(){if(this._frameTaskHandle)return;const t=this.view;this.stationary=t.stationary,this._updateParameters={state:t.state,targetState:new i,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:t.renderingOptions},this._stationaryHandle=s(()=>t.stationary,t=>{this.stationary=t,this.requestFrame()}),this._frameTaskHandle=a(this),this.requestUpdate()}stop(){this._frameTaskHandle&&(this._updateRequested=!1,this._stationaryHandle?.remove(),this._frameTaskHandle.remove(),this._updateParameters=this._stationaryHandle=this._frameTaskHandle=null,this.stationary=!0)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(t){if(!t.attached)return void this.requestUpdate();const e=this.view.state,s=t.lastUpdateId;null!=s&&(this.stationary||t.moving)||(t.moving=!0),s!==e.id&&t.viewChange(),this.stationary&&t.moving&&(t.moving=!1,t.moveEnd()),t.lastUpdateId=e.id,t.updateRequested&&t.processUpdate(this._updateParameters),"layerViews"in t&&t.layerViews?.forEach(this._updateLayerView,this)}}export{h as default};