@arcgis/core 4.26.0-next.20221221 → 4.26.0-next.20221223

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 (264) hide show
  1. package/WebScene.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{2163b9ee4d639d5ed6f3.js → 05bba3ba2f9ee02f52b5.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{bbccf69f4aa1b1761265.js → 0b8dc54801a7aa5e6be3.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{6dbd3aabfe4d5d593205.js → 0b9c53e01d6ac1e7d5ca.js} +29 -29
  6. package/assets/esri/core/workers/chunks/1039cd48a12e88baa97a.js +1 -0
  7. package/assets/esri/core/workers/chunks/{634e7957696f72c8b8b1.js → 3fb4ae8d6e8563a1c255.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{b61ce04af4e57b1856cb.js → d447ebc944a9867f5a99.js} +1 -1
  9. package/assets/esri/core/workers/chunks/e3ba96417fd75a5d2feb.js +1 -0
  10. package/assets/esri/core/workers/chunks/{099765dff2b7e6958d3d.js → efc9030af5aac27055a1.js} +1 -1
  11. package/assets/esri/themes/base/widgets/_UtilityNetworkTrace.scss +1 -1
  12. package/assets/esri/themes/dark/main.css +1 -1
  13. package/assets/esri/themes/light/main.css +1 -1
  14. package/assets/esri/themes/light/view.css +1 -1
  15. package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
  16. package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
  17. package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
  18. package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
  19. package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
  20. package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
  21. package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
  22. package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
  23. package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
  24. package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
  25. package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
  26. package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
  27. package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
  28. package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
  29. package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
  30. package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
  31. package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
  32. package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
  33. package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
  34. package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
  35. package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
  36. package/assets/esri/widgets/Directions/t9n/Directions_nb.json +1 -1
  37. package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
  38. package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
  39. package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
  40. package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
  41. package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
  42. package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
  43. package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
  44. package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
  45. package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
  46. package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
  47. package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
  48. package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
  49. package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
  50. package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
  51. package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
  52. package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
  53. package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
  54. package/assets/esri/widgets/Feature/t9n/Feature_he.json +1 -1
  55. package/assets/esri/widgets/Popup/t9n/Popup_ar.json +1 -1
  56. package/assets/esri/widgets/Popup/t9n/Popup_bg.json +1 -1
  57. package/assets/esri/widgets/Popup/t9n/Popup_bs.json +1 -1
  58. package/assets/esri/widgets/Popup/t9n/Popup_ca.json +1 -1
  59. package/assets/esri/widgets/Popup/t9n/Popup_cs.json +1 -1
  60. package/assets/esri/widgets/Popup/t9n/Popup_da.json +1 -1
  61. package/assets/esri/widgets/Popup/t9n/Popup_de.json +1 -1
  62. package/assets/esri/widgets/Popup/t9n/Popup_el.json +1 -1
  63. package/assets/esri/widgets/Popup/t9n/Popup_es.json +1 -1
  64. package/assets/esri/widgets/Popup/t9n/Popup_et.json +1 -1
  65. package/assets/esri/widgets/Popup/t9n/Popup_fi.json +1 -1
  66. package/assets/esri/widgets/Popup/t9n/Popup_fr.json +1 -1
  67. package/assets/esri/widgets/Popup/t9n/Popup_he.json +1 -1
  68. package/assets/esri/widgets/Popup/t9n/Popup_hr.json +1 -1
  69. package/assets/esri/widgets/Popup/t9n/Popup_hu.json +1 -1
  70. package/assets/esri/widgets/Popup/t9n/Popup_id.json +1 -1
  71. package/assets/esri/widgets/Popup/t9n/Popup_it.json +1 -1
  72. package/assets/esri/widgets/Popup/t9n/Popup_ja.json +1 -1
  73. package/assets/esri/widgets/Popup/t9n/Popup_ko.json +1 -1
  74. package/assets/esri/widgets/Popup/t9n/Popup_lt.json +1 -1
  75. package/assets/esri/widgets/Popup/t9n/Popup_lv.json +1 -1
  76. package/assets/esri/widgets/Popup/t9n/Popup_nb.json +1 -1
  77. package/assets/esri/widgets/Popup/t9n/Popup_nl.json +1 -1
  78. package/assets/esri/widgets/Popup/t9n/Popup_pl.json +1 -1
  79. package/assets/esri/widgets/Popup/t9n/Popup_pt-BR.json +1 -1
  80. package/assets/esri/widgets/Popup/t9n/Popup_pt-PT.json +1 -1
  81. package/assets/esri/widgets/Popup/t9n/Popup_ro.json +1 -1
  82. package/assets/esri/widgets/Popup/t9n/Popup_ru.json +1 -1
  83. package/assets/esri/widgets/Popup/t9n/Popup_sk.json +1 -1
  84. package/assets/esri/widgets/Popup/t9n/Popup_sl.json +1 -1
  85. package/assets/esri/widgets/Popup/t9n/Popup_sr.json +1 -1
  86. package/assets/esri/widgets/Popup/t9n/Popup_sv.json +1 -1
  87. package/assets/esri/widgets/Popup/t9n/Popup_th.json +1 -1
  88. package/assets/esri/widgets/Popup/t9n/Popup_tr.json +1 -1
  89. package/assets/esri/widgets/Popup/t9n/Popup_uk.json +1 -1
  90. package/assets/esri/widgets/Popup/t9n/Popup_vi.json +1 -1
  91. package/assets/esri/widgets/Popup/t9n/Popup_zh-CN.json +1 -1
  92. package/assets/esri/widgets/Popup/t9n/Popup_zh-HK.json +1 -1
  93. package/assets/esri/widgets/Popup/t9n/Popup_zh-TW.json +1 -1
  94. package/assets/esri/widgets/Slice/t9n/Slice_ar.json +1 -1
  95. package/assets/esri/widgets/Slice/t9n/Slice_bg.json +1 -1
  96. package/assets/esri/widgets/Slice/t9n/Slice_bs.json +1 -1
  97. package/assets/esri/widgets/Slice/t9n/Slice_ca.json +1 -1
  98. package/assets/esri/widgets/Slice/t9n/Slice_cs.json +1 -1
  99. package/assets/esri/widgets/Slice/t9n/Slice_da.json +1 -1
  100. package/assets/esri/widgets/Slice/t9n/Slice_de.json +1 -1
  101. package/assets/esri/widgets/Slice/t9n/Slice_el.json +1 -1
  102. package/assets/esri/widgets/Slice/t9n/Slice_es.json +1 -1
  103. package/assets/esri/widgets/Slice/t9n/Slice_et.json +1 -1
  104. package/assets/esri/widgets/Slice/t9n/Slice_fi.json +1 -1
  105. package/assets/esri/widgets/Slice/t9n/Slice_fr.json +1 -1
  106. package/assets/esri/widgets/Slice/t9n/Slice_he.json +1 -1
  107. package/assets/esri/widgets/Slice/t9n/Slice_hr.json +1 -1
  108. package/assets/esri/widgets/Slice/t9n/Slice_hu.json +1 -1
  109. package/assets/esri/widgets/Slice/t9n/Slice_id.json +1 -1
  110. package/assets/esri/widgets/Slice/t9n/Slice_it.json +1 -1
  111. package/assets/esri/widgets/Slice/t9n/Slice_ja.json +1 -1
  112. package/assets/esri/widgets/Slice/t9n/Slice_ko.json +1 -1
  113. package/assets/esri/widgets/Slice/t9n/Slice_lt.json +1 -1
  114. package/assets/esri/widgets/Slice/t9n/Slice_lv.json +1 -1
  115. package/assets/esri/widgets/Slice/t9n/Slice_nb.json +1 -1
  116. package/assets/esri/widgets/Slice/t9n/Slice_nl.json +1 -1
  117. package/assets/esri/widgets/Slice/t9n/Slice_pl.json +1 -1
  118. package/assets/esri/widgets/Slice/t9n/Slice_pt-BR.json +1 -1
  119. package/assets/esri/widgets/Slice/t9n/Slice_pt-PT.json +1 -1
  120. package/assets/esri/widgets/Slice/t9n/Slice_ro.json +1 -1
  121. package/assets/esri/widgets/Slice/t9n/Slice_ru.json +1 -1
  122. package/assets/esri/widgets/Slice/t9n/Slice_sk.json +1 -1
  123. package/assets/esri/widgets/Slice/t9n/Slice_sl.json +1 -1
  124. package/assets/esri/widgets/Slice/t9n/Slice_sr.json +1 -1
  125. package/assets/esri/widgets/Slice/t9n/Slice_sv.json +1 -1
  126. package/assets/esri/widgets/Slice/t9n/Slice_th.json +1 -1
  127. package/assets/esri/widgets/Slice/t9n/Slice_tr.json +1 -1
  128. package/assets/esri/widgets/Slice/t9n/Slice_uk.json +1 -1
  129. package/assets/esri/widgets/Slice/t9n/Slice_vi.json +1 -1
  130. package/assets/esri/widgets/Slice/t9n/Slice_zh-CN.json +1 -1
  131. package/assets/esri/widgets/Slice/t9n/Slice_zh-HK.json +1 -1
  132. package/assets/esri/widgets/Slice/t9n/Slice_zh-TW.json +1 -1
  133. package/core/workers/workers.js +1 -1
  134. package/geometry/support/intersects.js +1 -1
  135. package/geometry/support/meshUtils/elevation.js +1 -1
  136. package/geometry/support/meshUtils/exporters/gltf/index.js +1 -1
  137. package/geometry.js +1 -1
  138. package/interfaces.d.ts +868 -0
  139. package/intl.js +1 -1
  140. package/layers/support/ImageParameters.js +1 -1
  141. package/layers/support/VoxelVariable.js +1 -1
  142. package/layers/support/VoxelVolumeStyle.js +1 -1
  143. package/layers/support/domains.js +1 -1
  144. package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
  145. package/libs/maquette/projection.js +1 -1
  146. package/package.json +1 -1
  147. package/pointCloudRenderers.js +1 -1
  148. package/popup/content.js +1 -1
  149. package/rasterRenderers.js +1 -1
  150. package/renderers.js +1 -1
  151. package/rest/locator/addressesToLocations.js +1 -1
  152. package/support/arcadeUtils.js +1 -1
  153. package/support/revision.js +1 -1
  154. package/symbols/support/unitConversionUtils.js +1 -1
  155. package/symbols.js +1 -1
  156. package/views/2d/engine/FeatureContainer.js +1 -1
  157. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  158. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  159. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  160. package/views/2d/layers/KMLLayerView2D.js +1 -1
  161. package/views/2d/layers/LayerView2D.js +1 -1
  162. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  163. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  164. package/views/2d/layers/RouteLayerView2D.js +1 -1
  165. package/views/2d/layers/StreamLayerView2D.js +1 -1
  166. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  167. package/views/2d/layers/WMSLayerView2D.js +1 -1
  168. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  169. package/views/2d/layers/features/FeatureStore2D.js +1 -1
  170. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  171. package/views/2d/layers/features/processors/HeatmapProcessor.js +1 -1
  172. package/views/2d/layers/features/processors/SymbolProcessor.js +1 -1
  173. package/views/2d/layers/features/schemaUtils.js +1 -1
  174. package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
  175. package/views/2d/layers/features/sources/DataTileSource.js +1 -1
  176. package/views/2d/layers/features/sources/DataTileSubscription.js +1 -1
  177. package/views/2d/layers/features/sources/GeoEventSource.js +1 -1
  178. package/views/2d/layers/features/sources/SnapshotFeatureSource.js +1 -1
  179. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  180. package/views/2d/layers/features/support/rendererUtils.js +1 -1
  181. package/views/2d/layers/features/tileRenderers/SymbolTileRenderer.js +1 -1
  182. package/views/2d/layers/features/tileRenderers/support/HeatmapSource.js +1 -1
  183. package/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js +1 -1
  184. package/views/2d/layers/features/tileRenderers/support/visualVariablesUtils.js +1 -1
  185. package/views/2d/layers/graphics/BaseGraphicContainer.js +1 -1
  186. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  187. package/views/2d/layers/graphics/graphicsUtils.js +1 -1
  188. package/views/2d/layers/imagery/ImageryView2D.js +1 -1
  189. package/views/2d/layers/support/DebugOverlay.js +1 -1
  190. package/views/2d/layers/support/ExportStrategy.js +1 -1
  191. package/views/2d/layers/support/FeatureLayerProxy.js +1 -1
  192. package/views/2d/magnifier/MagnifierView2D.js +1 -1
  193. package/views/2d/navigation/MapViewNavigation.js +1 -1
  194. package/views/2d/navigation/ZoomBox.js +1 -1
  195. package/views/2d/navigation/actions/Pan.js +1 -1
  196. package/views/2d/navigation/actions/Pinch.js +1 -1
  197. package/views/2d/tiling/TileManager.js +1 -1
  198. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  199. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  200. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  201. package/views/3d/layers/GraphicsView3D.js +1 -1
  202. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  203. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  204. package/views/3d/layers/TiledLayerView3D.js +1 -1
  205. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  206. package/views/3d/layers/WMTSLayerView3D.js +1 -1
  207. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  208. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  209. package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
  210. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  211. package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
  212. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  213. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  214. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  215. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  216. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  217. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  218. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  219. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  220. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  221. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  222. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  223. package/views/3d/layers/graphics/QueryEngine.js +1 -1
  224. package/views/3d/layers/graphics/SpatialIndex2D.js +1 -1
  225. package/views/3d/layers/graphics/elevationAlignmentUtils.js +1 -1
  226. package/views/3d/layers/graphics/featureExpressionInfoUtils.js +1 -1
  227. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  228. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  229. package/views/3d/layers/graphics/queryForSymbologySnapping.js +1 -1
  230. package/views/3d/layers/graphics/symbolComplexity.js +1 -1
  231. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  232. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  233. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  234. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  235. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  236. package/views/3d/layers/i3s/attributeEditing.js +1 -1
  237. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  238. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  239. package/views/3d/layers/support/FeatureTileFetcher3DDebugger.js +1 -1
  240. package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
  241. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  242. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  243. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  244. package/views/3d/layers/support/projectExtentUtils.js +1 -1
  245. package/views/3d/support/PBFDecoderWorker.js +1 -1
  246. package/views/3d/support/SharedSymbolResources.js +1 -1
  247. package/views/3d/terrain/PatchRenderData.js +1 -1
  248. package/views/support/geometry3dUtils.js +1 -1
  249. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  250. package/widgets/Daylight.js +1 -1
  251. package/widgets/Directions/components/SaveLayer.js +1 -1
  252. package/widgets/Directions.js +1 -1
  253. package/widgets/Editor.js +1 -1
  254. package/widgets/FeatureForm.js +1 -1
  255. package/widgets/FeatureTemplates/ItemList.js +1 -1
  256. package/widgets/Popup.js +1 -1
  257. package/widgets/ShadowCast/components/Label.js +1 -1
  258. package/widgets/Slice/SlicePlane.js +1 -1
  259. package/widgets/Slice.js +1 -1
  260. package/widgets/UtilityNetworkTrace.js +1 -1
  261. package/widgets/Weather.js +1 -1
  262. package/widgets/support/SnappingControls.js +1 -1
  263. package/assets/esri/core/workers/chunks/7ce1b3056f392cd10031.js +0 -1
  264. package/assets/esri/core/workers/chunks/fc197a387187daab1df3.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import t from"../../../../core/Logger.js";import{isSome as r,unwrap as i,isNone as n,unwrapOr as s}from"../../../../core/maybe.js";import{pt2px as l}from"../../../../core/screenUtils.js";import{sqlAnd as o}from"../../../../core/sql.js";import{diff as a}from"../../../../core/accessorSupport/diffUtils.js";import{validateLabelingInfo as u}from"../../../../layers/support/labelingInfo.js";import{WGLSymbologyType as d}from"../../engine/webgl/enums.js";import{getVVType as f}from"../../engine/webgl/Utils.js";import{getTechniqueFromRenderer as p}from"../../engine/webgl/techniques/utils.js";import{getVVFlags as c}from"../../engine/webgl/util/vvFlagUtils.js";import{createSymbolSchema as y}from"./createSymbolSchema.js";export{createSymbolSchema}from"./createSymbolSchema.js";import{getPtMaxVVSize as m}from"./support/pixelBuffering.js";import{getSupportedHeatmapRenderer as g,simplifyVisualVariables as b}from"./support/rendererUtils.js";import{injectDynamicLevelDependentSizeVisualVariable as x,createClusterRenderer as h}from"../support/clusterUtils.js";import{toJSONGeometryType as v}from"../support/util.js";const T=t.getLogger("esri.views.2d.layers.features.schemaUtils"),S="ValidationError";function E(e){return e}function w(e,t){let i=0,n=0,s=d.DEFAULT;if(r(e)){if(n=m(e,t),"visualVariables"in e&&(i=c(e.visualVariables||[]),"dot-density"===e.type&&(s=d.DOT_DENSITY)),"heatmap"===e.type&&(s=d.HEATMAP),"dictionary"===e.type)return{maxVVSize:n,vvFlags:i,symbologyType:d.DEFAULT};if("pie-chart"===e.type)return{maxVVSize:n,vvFlags:i,symbologyType:d.PIE_CHART};if(s!==d.DOT_DENSITY&&s!==d.HEATMAP){const t=e.getSymbols();"backgroundFillSymbol"in e&&e.backgroundFillSymbol&&t.push(e.backgroundFillSymbol);let r=!0,i=!0;for(const e of t)if("cim"===e.type&&(i=!1),"simple-fill"===e.type||"picture-fill"===e.type){const t=e.outline,n=t&&"none"!==t.style&&"solid"!==t.style,s="simple-fill"===e.type&&"none"!==e.style&&"solid"!==e.style;n&&(r=!1),("picture-fill"===e.type||s||n)&&(i=!1)}r?s=i?d.OUTLINE_FILL_SIMPLE:d.OUTLINE_FILL:i&&(s=d.SIMPLE)}}return{vvFlags:i,maxVVSize:n,symbologyType:s}}let I=null;function F(e){if(has("esri-2d-update-debug")){const t=V(e,!0);console.debug("Created new schema",t),console.debug("Schema diff",a(I,t)),I=t}return V(e)}function V(e,t=!1){try{const i=D(e,t),n=C(e),s={};i.map((t=>O(s,e,t)));const l=r(e.subtypeCode)?`${e.subtypeField} = ${e.subtypeCode}`:null,a=o(e.definitionExpression,l);return{source:{definitionExpression:a,fields:e.fields.map((e=>e.toJSON())),gdbVersion:e.gdbVersion,historicMoment:e.historicMoment?.getTime(),outFields:e.availableFields,pixelBuffer:e.pixelBuffer,spatialReference:e.spatialReference.toJSON(),timeExtent:e.timeExtent?.toJSON(),customParameters:e.customParameters},attributes:{fields:{},indexCount:0},processors:i,tileRenderer:n,targets:s}}catch(i){if(i.fieldName===S)return T.error(i),null;throw i}}function O(t,r,i){switch(i.target){case"feature":return void M(t,N(r),i);case"aggregate":{if(!("featureReduction"in r))return;const n=r.featureReduction;switch(n.type){case"selection":throw new e(S,"Mapview does not support `selection` reduction type",n);case"binning":return M(t,N(r),i),void L(t,n,r.fields.map((e=>e.toJSON())),i);case"cluster":return M(t,N(r),i),void R(t,n,r.fields.map((e=>e.toJSON())),i)}}}}function z(e,t){for(const r in t){const i=t[r];if(i.target!==e.name)continue;const n=e.attributes[r];n?(n.context.mesh=n.context.mesh||i.context.mesh,n.context.storage=n.context.storage||i.context.storage):e.attributes[r]=i}return e}function N(e){return[i(e.filter)?.toJSON()??null,i(i(e.featureEffect)?.filter)?.toJSON()??null]}function M(e,t,r){return e.feature||(e.feature={name:"feature",input:"source",filters:t,attributes:{}}),z(e.feature,r.attributes.fields),e}function j(t,r){const{onStatisticExpression:i,onStatisticField:n,statisticType:s}=t;switch(s){case"min":case"max":case"avg":case"avg_angle":case"sum":case"count":return"esriFieldTypeDouble";case"mode":{if(i){const{returnType:r}=i;return r?"string"===r?"esriFieldTypeString":"esriFieldTypeDouble":(T.error(new e(S,"Unable to infer type of aggregateField with onStatisticExpression. ReturnType is not defined",t)),"esriFieldTypeString")}const s=r.find((e=>e.name===n));return s?s.type:(T.error(new e(S,"Unable to infer type of aggregateField with onStatisticExpression. ReturnType is not defined",t)),"esriFieldTypeString")}}}function L(e,t,r,i){return e.aggregate||(e.aggregate={name:"aggregate",type:"bin",filters:null,input:"feature",params:{fixedBinLevel:t.fixedBinLevel,fields:(t.fields??[]).map((e=>({...e.toJSON(),type:j(e,r)})))},attributes:{}}),z(e.aggregate,i.attributes.fields),e}function R(e,t,r,i){return e.aggregate||(e.aggregate={name:"aggregate",type:"cluster",input:"feature",filters:null,attributes:{},params:{clusterRadius:l(t.clusterRadius/2),clusterPixelBuffer:64*Math.ceil(l(t.clusterMaxSize)/64),fields:(t.fields??[])?.map((e=>({...e.toJSON(),type:j(e,r)})))}}),z(e.aggregate,i.attributes.fields),e}function U(e,t){return t.field?B(e,{...t,type:"field",field:t.field}):t.valueExpression?B(e,{...t,type:"expression",valueExpression:t.valueExpression}):{field:null,fieldIndex:null}}function B(e,t){switch(t.type){case"expression":{const r=E(t.valueExpression);if(!e.fields[r]){const i=e.indexCount++;e.fields[r]={...t,name:r,fieldIndex:i}}return{fieldIndex:e.fields[r].fieldIndex}}case"label-expression":{const r=E(JSON.stringify(t.label));if(!e.fields[r]){const i=e.indexCount++;e.fields[r]={...t,name:r,fieldIndex:i}}return{fieldIndex:e.fields[r].fieldIndex}}case"field":{const r=t.field;return"aggregate"===t.target&&e.fields[r]||(e.fields[r]={...t,name:r}),{field:r}}case"statistic":return e.fields[t.name]={...t},{field:t.name}}}function D(e,t=!1){const r=new Array;let i=0;return r.push(A(e,i++,t)),r}function P(e,t,r,i,n,s=!1){const l=B(e,{type:"label-expression",target:r,context:{mesh:!0},resultType:"string",label:{labelExpression:t.labelExpression,labelExpressionInfo:t.labelExpressionInfo?{expression:t.labelExpressionInfo.expression}:null,symbol:!!t.symbol,where:t.where}}),{fieldIndex:o}=l;return{...y(t,n,s),fieldIndex:o,target:r,index:i}}function k(t,r,i){const n="featureReduction"in r&&r.featureReduction;if(!n)return{fields:[],labels:[],matcher:null,rendererOverride:null};const s="aggregate",l=[];let o=null,a=v(r.geometryType),d=[],f=null;if(n)switch(n.type){case"selection":return T.error(new e(S,"Mapview does not support `selection` reduction type",n)),{fields:[],labels:[],matcher:null,rendererOverride:null};case"cluster":case"binning":if(l.push(...n.fields??[]),"cluster"===n.type?a="esriGeometryPoint":"binning"===n.type&&(a="esriGeometryPolygon"),n.renderer&&!n.renderer.authoringInfo?.isAutoGenerated){if("cluster"===n.type){const{renderer:e}=x(n.renderer,n,null);f=e}else f=n.renderer;const e=w(n.renderer,n);o=$(null,s,n.renderer,e,i),d=n&&n.labelsVisible&&n.labelingInfo||[]}else if("cluster"===n.type){if(f=h(l,r.renderer,n,null,!0),n.symbol){const e=w(f,n);o={type:"simple",symbol:y(n.symbol,e,i),symbologyType:e.symbologyType}}d=n&&n.labelsVisible&&n.labelingInfo||[]}}_(t,l);return{labels:u(d,"binning"===n.type?"esriGeometryPolygon":a),matcher:o,fields:l,rendererOverride:f}}function A(t,i,n=!1){const s={indexCount:0,fields:{}},l="featureReduction"in t&&t.featureReduction,o=l?"aggregate":"feature";if("sublayers"in t){const i={type:"subtype",subtypeField:t.subtypeField,renderers:{},symbologyType:d.DEFAULT},l={type:"subtype",mapping:{},target:"feature"},a={type:"subtype",classes:{}},u={type:"symbol",target:"feature",aggregateFields:[],attributes:s,storage:l,mesh:{matcher:i,aggregateMatcher:null,labels:a,sortKey:null}},f=new Set;let p=0;for(const{renderer:c,subtypeCode:y,labelingInfo:m,labelsVisible:g}of t.sublayers){const t={symbologyType:d.DEFAULT,vvFlags:0,maxVVSize:0},u=$(s,o,c,t,n),b=q(s,o,c),x=g&&m;if("visualVariables"in c&&c.visualVariables&&c.visualVariables.length)throw new e(S,"Visual variables are currently not supported for subtype layers");if("dictionary"===u.type)throw new e(S,"Dictionary renderer is not supported in subtype layers");if("subtype"===u.type)throw new e(S,"Nested subtype renderers is not supported");if(r(b)&&"subtype"===b.type)throw new e(S,"Nested subtype storage is not supported");if(r(b)&&r(b.attributeMapping))throw new e(S,"Non-visual-variable attributes are not supported in subtype layers");if("heatmap"===u.type)throw new e(S,"Heatmaps are not supported in subtype layers");if("pie-chart"===u.type)throw new e(S,"Pie-charts are not supported in subtype layers");if(f.has(y))throw new e(S,"Subtype codes for sublayers must be unique");f.add(y),i.renderers[y]=u,l.mapping[y]=b,x&&(a.classes[y]=x.map((e=>P(s,e,"feature",p++,t,n))))}return u}if("heatmap"===t.renderer.type&&"raster"===g()){const{radius:e,fieldOffset:r,field:i}=t.renderer;return{type:"heatmap",aggregateFields:[],attributes:s,target:o,storage:null,mesh:{radius:e,fieldOffset:r,field:U(s,{target:o,field:i,resultType:"numeric"}).field}}}const a=k(s,t,n),f=v(t.geometryType),p=a.rendererOverride??t.renderer,c=w(p,l),y=$(s,o,p,c,n),m=q(s,o,p),b=J(s,t.orderBy,l),x=t.labelsVisible&&t.labelingInfo||[],h=u(x,f);let T=0;const E=[...h.map((e=>P(s,e,"feature",T++,c,n))),...a.labels.map((e=>P(s,e,"aggregate",T++,c,n)))];return{type:"symbol",target:o,attributes:s,aggregateFields:a.fields,storage:m,mesh:{matcher:y,labels:{type:"simple",classes:E},aggregateMatcher:a.matcher,sortKey:b}}}function C(e){return"heatmap"===e.renderer?.type&&"raster"===g()?{type:"heatmap"}:{type:"symbol"}}function J(t,i,s){if(r(s)||n(i)||!i.length)return null;i.length>1&&T.warn(`Layer rendering currently only supports ordering by 1 orderByInfo, but found ${i.length}. All but the first will be discarded`);const l=i[0],o="ascending"===l.order?"asc":"desc";if(l.field)return{field:l.field,order:o};if(l.valueExpression){return{fieldIndex:B(t,{type:"expression",target:"feature",valueExpression:l.valueExpression,resultType:"numeric"}).fieldIndex,order:o}}return T.error(new e(S,"Expected to find a field or valueExpression for OrderByInfo",l)),null}function _(e,t){const r={mesh:!0,storage:!0};for(const i of t){const{name:t,onStatisticField:n,onStatisticExpression:s,statisticType:l}=i;let o=null,a=null;const u="numeric",d="feature";if(s){a=B(e,{type:"expression",target:d,valueExpression:s.expression,resultType:u}).fieldIndex}else{o=B(e,{type:"field",target:d,field:n,resultType:u}).field}B(e,{type:"statistic",target:"aggregate",name:t,context:r,inField:o,inFieldIndex:a,statisticType:l})}}function q(e,t,r){let i;switch(r.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":i={visualVariables:!0,attributes:null};break;default:i=p(r).getStorageSpec(r)}return G(e,t,i,r)}function G(e,t,i,s){if(n(i))return null;const{visualVariables:l,attributes:o}=i;let a=null;l&&"visualVariables"in s&&(a=H(e,t,s.visualVariables));const u=r(a)?4:0;let d=null;return r(o)&&(d=o.map(((r,i)=>{const{field:n,fieldIndex:s}=U(e,{valueExpression:r.valueExpression,field:r.field,resultType:"numeric",target:t});return{binding:i+u,field:n,fieldIndex:s}}))),{type:"simple",target:t,attributeMapping:d,vvMapping:a}}function H(e,t,r){if(!r||!r.length)return[];const i={storage:!0},n="numeric";return b(r).map((r=>{const s=f(r.type),{field:l,fieldIndex:o}=U(e,{target:t,valueExpression:r.valueExpression,field:r.field,context:i,resultType:n});switch(r.type){case"size":return"$view.scale"===r.valueExpression?null:{type:"size",binding:s,field:l,fieldIndex:o,normalizationField:U(e,{target:t,field:r.normalizationField,context:i,resultType:n}).field,valueRepresentation:r.valueRepresentation??null};case"color":return{type:"color",binding:s,field:l,fieldIndex:o,normalizationField:U(e,{target:t,field:r.normalizationField,context:i,resultType:n}).field};case"opacity":return{type:"opacity",binding:s,field:l,fieldIndex:o,normalizationField:U(e,{target:t,field:r.normalizationField,context:i,resultType:n}).field};case"rotation":return{type:"rotation",binding:s,field:l,fieldIndex:o}}})).filter((e=>e))}function $(e,t,r,i,n=!1){const l=s(e,{indexCount:0,fields:{}});switch(r.type){case"simple":case"dot-density":return K(l,r,i,n);case"class-breaks":return Q(l,t,r,i,n);case"unique-value":return W(l,t,r,i,n);case"dictionary":return X(l,r,i,n);case"heatmap":return Z(l,r,i,n);case"pie-chart":return Y(l,r,i,n)}}function K(e,t,r,i=!1){const n=t.getSymbols(),s=n.length?n[0]:null;return{type:"simple",symbol:y(s,r,i),symbologyType:r.symbologyType}}function Y(e,t,r,i=!1){const n=t.getSymbols(),s=n[0],l=n.length>1?n[1]:null;return{type:"pie-chart",markerSymbol:y(s,r,i),fillSymbol:y(l,r,i),symbologyType:r.symbologyType}}function Q(e,t,r,i,n=!1){const s={mesh:!0,use:"renderer.field"},l=r.backgroundFillSymbol,{field:o,fieldIndex:a}=U(e,{target:t,field:r.field,valueExpression:r.valueExpression,resultType:"numeric",context:s}),u=r.normalizationType,d="log"===u?"esriNormalizeByLog":"percent-of-total"===u?"esriNormalizeByPercentOfTotal":"field"===u?"esriNormalizeByField":null,f=r.classBreakInfos.map((e=>({symbol:y(e.symbol,i,n),min:e.minValue,max:e.maxValue}))).sort(((e,t)=>e.min-t.min));return{type:"interval",attributes:e.fields,field:o,fieldIndex:a,backgroundFillSymbol:y(l,i,n),defaultSymbol:y(r.defaultSymbol,i,n),intervals:f,normalizationField:r.normalizationField,normalizationTotal:r.normalizationTotal,normalizationType:d,isMaxInclusive:r.isMaxInclusive,symbologyType:i.symbologyType}}function W(t,r,i,n,s=!1){const l=[],o=i.backgroundFillSymbol,a={target:r,context:{mesh:!0},resultType:"string"};if(i.field&&"string"!=typeof i.field)throw new e(S,"Expected renderer.field to be a string",i);const{field:u,fieldIndex:d}=U(t,{...a,field:i.field,valueExpression:i.valueExpression});for(const e of i.uniqueValueInfos)l.push({value:""+e.value,symbol:y(e.symbol,n,s)});return{type:"map",attributes:t.fields,field:u,fieldIndex:d,field2:U(t,{...a,field:i.field2}).field,field3:U(t,{...a,field:i.field3}).field,fieldDelimiter:i.fieldDelimiter,backgroundFillSymbol:y(o,n),defaultSymbol:y(i.defaultSymbol,n),map:l,symbologyType:n.symbologyType}}function X(e,t,r,i=!1){return{type:"dictionary",config:t.config,fieldMap:t.fieldMap,scaleExpression:t.scaleExpression,url:t.url,symbolOptions:r,symbologyType:r.symbologyType}}function Z(e,t,r,i=!1){const n=t.getSymbols(),s=n.length?n[0]:null;return{type:"heatmap",symbol:y(s,r,i),symbologyType:r.symbologyType}}export{_ as addAggregateFields,$ as createMatcherSchema,U as createRendererAttributeSchema,F as createSchema,w as createSymbolSchemaOptions};
5
+ import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import t from"../../../../core/Logger.js";import{isSome as r,unwrap as i,isNone as n,unwrapOr as s}from"../../../../core/maybe.js";import{pt2px as l}from"../../../../core/screenUtils.js";import{sqlAnd as o}from"../../../../core/sql.js";import{diff as a}from"../../../../core/accessorSupport/diffUtils.js";import{validateLabelingInfo as u}from"../../../../layers/support/labelingInfo.js";import{WGLSymbologyType as d}from"../../engine/webgl/enums.js";import{getVVType as f}from"../../engine/webgl/Utils.js";import{getTechniqueFromRenderer as p}from"../../engine/webgl/techniques/utils.js";import{getVVFlags as c}from"../../engine/webgl/util/vvFlagUtils.js";import{createSymbolSchema as y}from"./createSymbolSchema.js";import{getPtMaxVVSize as m}from"./support/pixelBuffering.js";import{getSupportedHeatmapRenderer as g,simplifyVisualVariables as b}from"./support/rendererUtils.js";import{injectDynamicLevelDependentSizeVisualVariable as x,createClusterRenderer as h}from"../support/clusterUtils.js";import{toJSONGeometryType as v}from"../support/util.js";const T=t.getLogger("esri.views.2d.layers.features.schemaUtils"),S="ValidationError";function E(e){return e}function w(e,t){let i=0,n=0,s=d.DEFAULT;if(r(e)){if(n=m(e,t),"visualVariables"in e&&(i=c(e.visualVariables||[]),"dot-density"===e.type&&(s=d.DOT_DENSITY)),"heatmap"===e.type&&(s=d.HEATMAP),"dictionary"===e.type)return{maxVVSize:n,vvFlags:i,symbologyType:d.DEFAULT};if("pie-chart"===e.type)return{maxVVSize:n,vvFlags:i,symbologyType:d.PIE_CHART};if(s!==d.DOT_DENSITY&&s!==d.HEATMAP){const t=e.getSymbols();"backgroundFillSymbol"in e&&e.backgroundFillSymbol&&t.push(e.backgroundFillSymbol);let r=!0,i=!0;for(const e of t)if("cim"===e.type&&(i=!1),"simple-fill"===e.type||"picture-fill"===e.type){const t=e.outline,n=t&&"none"!==t.style&&"solid"!==t.style,s="simple-fill"===e.type&&"none"!==e.style&&"solid"!==e.style;n&&(r=!1),("picture-fill"===e.type||s||n)&&(i=!1)}r?s=i?d.OUTLINE_FILL_SIMPLE:d.OUTLINE_FILL:i&&(s=d.SIMPLE)}}return{vvFlags:i,maxVVSize:n,symbologyType:s}}let I=null;function F(e){if(has("esri-2d-update-debug")){const t=V(e,!0);console.debug("Created new schema",t),console.debug("Schema diff",a(I,t)),I=t}return V(e)}function V(e,t=!1){try{const n=D(e,t),s=C(e),l={};n.map((t=>O(l,e,t)));const a=r(e.subtypeCode)?`${e.subtypeField} = ${e.subtypeCode}`:null,u=i(o(e.definitionExpression,a));return{source:{definitionExpression:u,fields:e.fields.map((e=>e.toJSON())),gdbVersion:e.gdbVersion,historicMoment:e.historicMoment?.getTime(),outFields:e.availableFields,pixelBuffer:e.pixelBuffer,spatialReference:e.spatialReference.toJSON(),timeExtent:e.timeExtent?.toJSON(),customParameters:e.customParameters},attributes:{fields:{},indexCount:0},processors:n,tileRenderer:s,targets:l}}catch(n){if(n.fieldName===S)return T.error(n),null;throw n}}function O(t,r,i){switch(i.target){case"feature":return void M(t,N(r),i);case"aggregate":{if(!("featureReduction"in r))return;const n=r.featureReduction;switch(n?.type){case"selection":throw new e(S,"Mapview does not support `selection` reduction type",n);case"binning":return M(t,N(r),i),void j(t,n,r.fields.map((e=>e.toJSON())),i);case"cluster":return M(t,N(r),i),void R(t,n,r.fields.map((e=>e.toJSON())),i)}}}}function z(e,t){for(const r in t){const i=t[r];if(i.target!==e.name)continue;const n=e.attributes[r];if(n?.context){const e=n.context;e.mesh=e.mesh||i.context?.mesh,e.storage=e.storage||i.context?.storage}else e.attributes[r]=i}return e}function N(e){return[i(e.filter)?.toJSON()??null,i(i(e.featureEffect)?.filter)?.toJSON()??null]}function M(e,t,r){return e.feature||(e.feature={name:"feature",input:"source",filters:t,attributes:{}}),z(e.feature,r.attributes.fields),e}function L(t,r){const{onStatisticExpression:i,onStatisticField:n,statisticType:s}=t;switch(s){case"min":case"max":case"avg":case"avg_angle":case"sum":case"count":return"esriFieldTypeDouble";case"mode":{if(i){const{returnType:r}=i;return r?"string"===r?"esriFieldTypeString":"esriFieldTypeDouble":(T.error(new e(S,"Unable to infer type of aggregateField with onStatisticExpression. ReturnType is not defined",t)),"esriFieldTypeString")}const s=r.find((e=>e.name===n));return s?s.type:(T.error(new e(S,"Unable to infer type of aggregateField with onStatisticExpression. ReturnType is not defined",t)),"esriFieldTypeString")}}}function j(e,t,r,i){return e.aggregate||(e.aggregate={name:"aggregate",type:"bin",filters:null,input:"feature",params:{fixedBinLevel:t.fixedBinLevel,fields:(t.fields??[]).map((e=>({...e.toJSON(),type:L(e,r)})))},attributes:{}}),z(e.aggregate,i.attributes.fields),e}function R(e,t,r,i){return e.aggregate||(e.aggregate={name:"aggregate",type:"cluster",input:"feature",filters:null,attributes:{},params:{clusterRadius:l(t.clusterRadius/2),clusterPixelBuffer:64*Math.ceil(l(t.clusterMaxSize)/64),fields:(t.fields??[])?.map((e=>({...e.toJSON(),type:L(e,r)})))}}),z(e.aggregate,i.attributes.fields),e}function U(e,t){return t.field?B(e,{...t,type:"field",field:t.field}):t.valueExpression?B(e,{...t,type:"expression",valueExpression:t.valueExpression}):{field:void 0,fieldIndex:void 0}}function B(e,t){switch(t.type){case"expression":{const r=E(t.valueExpression);if(!e.fields[r]){const i=e.indexCount++;e.fields[r]={...t,name:r,fieldIndex:i}}return{fieldIndex:e.fields[r].fieldIndex}}case"label-expression":{const r=E(JSON.stringify(t.label));if(!e.fields[r]){const i=e.indexCount++;e.fields[r]={...t,name:r,fieldIndex:i}}return{fieldIndex:e.fields[r].fieldIndex}}case"field":{const r=t.field;return"aggregate"===t.target&&e.fields[r]||(e.fields[r]={...t,name:r}),{field:r}}case"statistic":return e.fields[t.name]={...t},{field:t.name}}}function D(e,t=!1){const r=new Array;let i=0;return r.push(A(e,i++,t)),r}function P(e,t,r,i,n,s=!1){const l=B(e,{type:"label-expression",target:r,context:{mesh:!0},resultType:"string",label:{labelExpression:t.labelExpression,labelExpressionInfo:t.labelExpressionInfo?{expression:t.labelExpressionInfo.expression}:null,symbol:!!t.symbol,where:t.where}}),{fieldIndex:o}=l;return{...y(t,n,s),fieldIndex:o,target:r,index:i}}function k(t,r,i){const n="featureReduction"in r&&r.featureReduction;if(!n)return{fields:[],labels:[],matcher:void 0,rendererOverride:void 0};const s="aggregate",l=[];let o=null,a=v(r.geometryType),d=[],f=null;if(n)switch(n.type){case"selection":return T.error(new e(S,"Mapview does not support `selection` reduction type",n)),{fields:[],labels:[],matcher:void 0,rendererOverride:void 0};case"cluster":case"binning":if(l.push(...n.fields??[]),"cluster"===n.type?a="esriGeometryPoint":"binning"===n.type&&(a="esriGeometryPolygon"),n.renderer&&!n.renderer.authoringInfo?.isAutoGenerated){if("cluster"===n.type){const{renderer:e}=x(n.renderer,n,null);f=e}else f=n.renderer;const e=w(n.renderer,n);o=$(null,s,n.renderer,e,i),d=n&&n.labelsVisible&&n.labelingInfo||[]}else if("cluster"===n.type){if(f=h(l,r.renderer,n,null,!0),n.symbol){const e=w(f,n);o={type:"simple",symbol:y(n.symbol,e,i),symbologyType:e.symbologyType}}d=n&&n.labelsVisible&&n.labelingInfo||[]}}_(t,l);return{labels:u(d,"binning"===n.type?"esriGeometryPolygon":a),matcher:o,fields:l,rendererOverride:f}}function A(t,i,n=!1){const s={indexCount:0,fields:{}},l="featureReduction"in t?t.featureReduction??void 0:void 0,o=l?"aggregate":"feature";if("sublayers"in t){const i={type:"subtype",subtypeField:t.subtypeField,renderers:{},symbologyType:d.DEFAULT},l={type:"subtype",mapping:{},target:"feature"},a={type:"subtype",classes:{}},u={type:"symbol",target:"feature",aggregateFields:[],attributes:s,storage:l,mesh:{matcher:i,aggregateMatcher:null,labels:a,sortKey:null}},f=new Set;let p=0;for(const{renderer:c,subtypeCode:y,labelingInfo:m,labelsVisible:g}of t.sublayers){const t={symbologyType:d.DEFAULT,vvFlags:0,maxVVSize:0},u=$(s,o,c,t,n),b=q(s,o,c),x=g&&m;if("visualVariables"in c&&c.visualVariables&&c.visualVariables.length)throw new e(S,"Visual variables are currently not supported for subtype layers");if("dictionary"===u.type)throw new e(S,"Dictionary renderer is not supported in subtype layers");if("subtype"===u.type)throw new e(S,"Nested subtype renderers is not supported");if(r(b)&&"subtype"===b.type)throw new e(S,"Nested subtype storage is not supported");if(r(b)&&r(b.attributeMapping))throw new e(S,"Non-visual-variable attributes are not supported in subtype layers");if("heatmap"===u.type)throw new e(S,"Heatmaps are not supported in subtype layers");if("pie-chart"===u.type)throw new e(S,"Pie-charts are not supported in subtype layers");if(f.has(y))throw new e(S,"Subtype codes for sublayers must be unique");f.add(y),i.renderers[y]=u,l.mapping[y]=b,x&&(a.classes[y]=x.map((e=>P(s,e,"feature",p++,t,n))))}return u}if("heatmap"===t.renderer?.type&&"raster"===g()){const{radius:e,fieldOffset:r,field:i}=t.renderer;return{type:"heatmap",aggregateFields:[],attributes:s,target:o,storage:null,mesh:{radius:e,fieldOffset:r,field:U(s,{target:o,field:i,resultType:"numeric"}).field}}}const a=k(s,t,n),f=v(t.geometryType),p=a.rendererOverride??t.renderer,c=w(p,l),y=$(s,o,p,c,n),m=q(s,o,p),b=J(s,t.orderBy,l),x=t.labelsVisible&&t.labelingInfo||[],h=u(x,f);let T=0;const E=[...h.map((e=>P(s,e,"feature",T++,c,n))),...a.labels.map((e=>P(s,e,"aggregate",T++,c,n)))];return{type:"symbol",target:o,attributes:s,aggregateFields:a.fields,storage:m,mesh:{matcher:y,labels:{type:"simple",classes:E},aggregateMatcher:a.matcher,sortKey:b}}}function C(e){return"heatmap"===e.renderer?.type&&"raster"===g()?{type:"heatmap"}:{type:"symbol"}}function J(t,i,s){if(r(s)||n(i)||!i.length)return null;i.length>1&&T.warn(`Layer rendering currently only supports ordering by 1 orderByInfo, but found ${i.length}. All but the first will be discarded`);const l=i[0],o="ascending"===l.order?"asc":"desc";if(l.field)return{field:l.field,order:o};if(l.valueExpression){return{fieldIndex:B(t,{type:"expression",target:"feature",valueExpression:l.valueExpression,resultType:"numeric"}).fieldIndex,order:o}}return T.error(new e(S,"Expected to find a field or valueExpression for OrderByInfo",l)),null}function _(e,t){const r={mesh:!0,storage:!0};for(const i of t){const{name:t,onStatisticField:n,onStatisticExpression:s,statisticType:l}=i;let o,a;const u="numeric",d="feature";if(s){a=B(e,{type:"expression",target:d,valueExpression:s.expression,resultType:u}).fieldIndex}else{o=B(e,{type:"field",target:d,field:n,resultType:u}).field}B(e,{type:"statistic",target:"aggregate",name:t,context:r,inField:o,inFieldIndex:a,statisticType:l})}}function q(e,t,r){let i;switch(r.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":i={visualVariables:!0,attributes:null};break;default:i=p(r).getStorageSpec(r)}return G(e,t,i,r)}function G(e,t,i,s){if(n(i))return null;const{visualVariables:l,attributes:o}=i;let a=null;l&&"visualVariables"in s&&(a=H(e,t,s.visualVariables));const u=r(a)?4:0;let d=null;return r(o)&&(d=o.map(((r,i)=>{const{field:n,fieldIndex:s}=U(e,{valueExpression:r.valueExpression,field:r.field,resultType:"numeric",target:t});return{binding:i+u,field:n,fieldIndex:s}}))),{type:"simple",target:t,attributeMapping:d,vvMapping:a}}function H(e,t,i){if(!i||!i.length)return[];const n={storage:!0},s="numeric";return b(i).map((r=>{const i=f(r.type),{field:l,fieldIndex:o}=U(e,{target:t,valueExpression:r.valueExpression,field:r.field,context:n,resultType:s});switch(r.type){case"size":return"$view.scale"===r.valueExpression?null:{type:"size",binding:i,field:l,fieldIndex:o,normalizationField:U(e,{target:t,field:r.normalizationField,context:n,resultType:s}).field,valueRepresentation:r.valueRepresentation??null};case"color":return{type:"color",binding:i,field:l,fieldIndex:o,normalizationField:U(e,{target:t,field:r.normalizationField,context:n,resultType:s}).field};case"opacity":return{type:"opacity",binding:i,field:l,fieldIndex:o,normalizationField:U(e,{target:t,field:r.normalizationField,context:n,resultType:s}).field};case"rotation":return{type:"rotation",binding:i,field:l,fieldIndex:o}}})).filter(r)}function $(e,t,r,i,n=!1){const l=s(e,{indexCount:0,fields:{}});switch(r.type){case"simple":case"dot-density":return K(l,r,i,n);case"class-breaks":return Q(l,t,r,i,n);case"unique-value":return W(l,t,r,i,n);case"dictionary":return X(l,r,i,n);case"heatmap":return Z(l,r,i,n);case"pie-chart":return Y(l,r,i,n)}}function K(e,t,r,i=!1){const n=t.getSymbols(),s=n.length?n[0]:null;return{type:"simple",symbol:y(s,r,i),symbologyType:r.symbologyType}}function Y(e,t,r,i=!1){const n=t.getSymbols(),s=n[0],l=n.length>1?n[1]:null;return{type:"pie-chart",markerSymbol:y(s,r,i),fillSymbol:y(l,r,i),symbologyType:r.symbologyType}}function Q(e,t,r,i,n=!1){const s={mesh:!0,use:"renderer.field"},l=r.backgroundFillSymbol,{field:o,fieldIndex:a}=U(e,{target:t,field:r.field,valueExpression:r.valueExpression,resultType:"numeric",context:s}),u=r.normalizationType,d="log"===u?"esriNormalizeByLog":"percent-of-total"===u?"esriNormalizeByPercentOfTotal":"field"===u?"esriNormalizeByField":null,f=r.classBreakInfos.map((e=>({symbol:y(e.symbol,i,n),min:e.minValue,max:e.maxValue}))).sort(((e,t)=>e.min-t.min));return{type:"interval",attributes:e.fields,field:o,fieldIndex:a,backgroundFillSymbol:y(l,i,n),defaultSymbol:y(r.defaultSymbol,i,n),intervals:f,normalizationField:r.normalizationField,normalizationTotal:r.normalizationTotal,normalizationType:d,isMaxInclusive:r.isMaxInclusive,symbologyType:i.symbologyType}}function W(t,r,i,n,s=!1){const l=[],o=i.backgroundFillSymbol,a={target:r,context:{mesh:!0},resultType:"string"};if(i.field&&"string"!=typeof i.field)throw new e(S,"Expected renderer.field to be a string",i);const{field:u,fieldIndex:d}=U(t,{...a,field:i.field,valueExpression:i.valueExpression});for(const e of i.uniqueValueInfos??[])l.push({value:""+e.value,symbol:y(e.symbol,n,s)});return{type:"map",attributes:t.fields,field:u,fieldIndex:d,field2:U(t,{...a,field:i.field2}).field,field3:U(t,{...a,field:i.field3}).field,fieldDelimiter:i.fieldDelimiter??void 0,backgroundFillSymbol:y(o,n),defaultSymbol:y(i.defaultSymbol,n),map:l,symbologyType:n.symbologyType}}function X(e,t,r,i=!1){return{type:"dictionary",config:t.config,fieldMap:t.fieldMap,scaleExpression:t.scaleExpression,url:t.url,symbolOptions:r,symbologyType:r.symbologyType}}function Z(e,t,r,i=!1){const n=t.getSymbols(),s=n.length?n[0]:null;return{type:"heatmap",symbol:y(s,r,i),symbologyType:r.symbologyType}}export{_ as addAggregateFields,$ as createMatcherSchema,U as createRendererAttributeSchema,F as createSchema,y as createSymbolSchema,w as createSymbolSchemaOptions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../request.js";import t from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import r from"../../../../../core/Logger.js";import{isSome as s,unwrapOr as i,isNone as a}from"../../../../../core/maybe.js";import{throwIfAborted as o,isAbortError as n}from"../../../../../core/promiseUtils.js";import{createSourceAdapter as u}from"../controllers/support/sourceAdapters.js";import{DataTileSource as c}from"./DataTileSource.js";import{QueueProcessor as l}from"../../../../support/QueueProcessor.js";const p=4;class d extends c{constructor(e){super(e),this.type="feature",this.mode="on-demand",this._adapter=u(e.serviceInfo),this._queue=new l({concurrency:8,process:async e=>{if(o(e),s(e.tile)){const t=e.tile.key.id,{signal:r}=e,s=has("esri-tiles-debug")?{tile:t.replace(/\//g,"."),depth:e.depth}:void 0,i=await this._adapter.executeQuery(e.query,{signal:r,query:{...s,...this._schema.customParameters}});return i.level=e.tile.key.level,i}return this._adapter.executeQuery(e.query,{...e,query:this._schema.customParameters})}}),this._patchQueue=new l({concurrency:8,process:async e=>{if(o(e),s(e.tile)){const t=e.tile.key.id,{signal:r}=e,s=has("esri-tiles-debug")?{tile:t.replace(/\//g,"."),depth:e.depth}:void 0,i=await this._adapter.executeQuery(e.query,{signal:r,query:{...s,...this._schema.customParameters}});return i.level=e.tile.key.level,i}return this._adapter.executeQuery(e.query,{...e,query:this._schema.customParameters})}})}destroy(){super.destroy(),this._adapter.destroy(),this._queue.destroy(),this._patchQueue.destroy()}get updating(){return!!this._queue.length||Array.from(this._subscriptions.values()).some((e=>!e.done))}get maxRecordCountFactor(){const{query:e}=this._serviceInfo.capabilities;return e.supportsMaxRecordCountFactor?p:null}get maxPageSize(){const{query:e}=this._serviceInfo.capabilities;return(e.maxRecordCount??8e3)*i(this.maxRecordCountFactor,1)}get pageSize(){return Math.min(8e3,this.maxPageSize)}enableEvent(e,t){}subscribe(e,s){super.subscribe(e,s);const i=this._subscriptions.get(e.id);this._fetchDataTile(e).catch((s=>{n(s)||r.getLogger("esri.views.2d.layers.features.sources.BaseFeatureSource").error(new t("mapview-query-error","Encountered error when fetching tile",{tile:e,error:s}))})).then((()=>i.end()))}unsubscribe(e){super.unsubscribe(e)}readers(e){return this._subscriptions.get(e).readers()}async query(e){return this._adapter.executeQuery(e,{query:this._schema.customParameters})}async queryLastEditDate(){const t=this._serviceInfo.source,r={...t.query,f:"json"};return(await e(t.path,{query:r,responseType:"json"})).data.editingInfo.lastEditDate}createTileQuery(e,t={}){const r=this._serviceInfo.geometryType,s=this.createQuery(t);s.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),s.resultType="tile",s.geometry=e.extent,this._serviceInfo.capabilities.query.supportsQuantization?"esriGeometryPolyline"===r&&(s.maxAllowableOffset=e.resolution*has("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==r&&"esriGeometryPolygon"!==r||(s.maxAllowableOffset=e.resolution,"esriGeometryPolyline"===r&&(s.maxAllowableOffset*=has("feature-polyline-generalization-factor")));const i=this._serviceInfo.capabilities.query;return s.defaultSpatialReferenceEnabled=i.supportsDefaultSpatialReference,s.compactGeometryEnabled=i.supportsCompactGeometry,s}async _executePatchQuery(e,t,r,i){const a=t.clone();a.outFields=[this._serviceInfo.objectIdField,...r],a.returnCentroid=!1,a.returnGeometry=!1;const o=s(a.start)?a.start/8e3:0,n=i.signal;return this._patchQueue.push({tile:e,query:a,signal:n,depth:o})}async _resend(e,t){const{query:r,message:i}=e,n=s(r.outFields)?r.outFields:[],u=this._queryInfo.outFields,c=u.filter((e=>!n.includes(e)));if(a(i.addOrUpdate))this._onMessage({...i,type:"append"});else if(c.length)try{const e=this._subscriptions.get(i.id).tile,s=await this._executePatchQuery(e,r,c,t);o(t),r.outFields=u,i.addOrUpdate.joinAttributes(s),this._onMessage({...i,end:i.end,type:"append"})}catch(l){}else this._onMessage({...i,type:"append"})}async _resendSubscription(e){if(has("esri-2d-update-debug")&&console.debug(e.tile.id,"Resend Subscription"),e.empty)return this._onMessage({id:e.tile.id,addOrUpdate:null,end:!1,type:"append"});const t=e.signal;for(const r of e.requests.done)await this._resend(r,{signal:t});return s(e.edits)?this._onMessage(e.edits):void 0}async resend(){const e=Array.from(this._subscriptions.values());await Promise.all(e.map((e=>this._resendSubscription(e))))}}export{d as BaseFeatureSource};
5
+ import e from"../../../../../request.js";import t from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import r from"../../../../../core/Logger.js";import{isSome as s,unwrapOr as i,isNone as a}from"../../../../../core/maybe.js";import{throwIfAborted as o,isAbortError as n}from"../../../../../core/promiseUtils.js";import{createSourceAdapter as u}from"../controllers/support/sourceAdapters.js";import{DataTileSource as c}from"./DataTileSource.js";import{QueueProcessor as l}from"../../../../support/QueueProcessor.js";const p=4;class d extends c{constructor(e){super(e),this.type="feature",this.mode="on-demand",this._adapter=u(e.serviceInfo),this._queue=new l({concurrency:8,process:async e=>{if(o(e),s(e.tile)){const t=e.tile.key.id,{signal:r}=e,s=has("esri-tiles-debug")?{tile:t.replace(/\//g,"."),depth:e.depth}:void 0,i=await this._adapter.executeQuery(e.query,{signal:r,query:{...s,...this._schema?.customParameters}});return i.level=e.tile.key.level,i}return this._adapter.executeQuery(e.query,{...e,query:this._schema?.customParameters})}}),this._patchQueue=new l({concurrency:8,process:async e=>{if(o(e),s(e.tile)){const t=e.tile.key.id,{signal:r}=e,s=has("esri-tiles-debug")?{tile:t.replace(/\//g,"."),depth:e.depth}:void 0,i=await this._adapter.executeQuery(e.query,{signal:r,query:{...s,...this._schema?.customParameters}});return i.level=e.tile.key.level,i}return this._adapter.executeQuery(e.query,{...e,query:this._schema?.customParameters})}})}destroy(){super.destroy(),this._adapter.destroy(),this._queue.destroy(),this._patchQueue.destroy()}get updating(){return!!this._queue.length||Array.from(this._subscriptions.values()).some((e=>!e.done))}get maxRecordCountFactor(){const{query:e}=this._serviceInfo.capabilities;return e.supportsMaxRecordCountFactor?p:null}get maxPageSize(){const{query:e}=this._serviceInfo.capabilities;return(e.maxRecordCount??8e3)*i(this.maxRecordCountFactor,1)}get pageSize(){return Math.min(8e3,this.maxPageSize)}enableEvent(e,t){}subscribe(e,s){super.subscribe(e,s);const i=this._subscriptions.get(e.id);this._fetchDataTile(e).catch((s=>{n(s)||r.getLogger("esri.views.2d.layers.features.sources.BaseFeatureSource").error(new t("mapview-query-error","Encountered error when fetching tile",{tile:e,error:s}))})).then((()=>i.end()))}unsubscribe(e){super.unsubscribe(e)}readers(e){return this._subscriptions.get(e).readers()}async query(e){return this._adapter.executeQuery(e,{query:this._schema?.customParameters})}async queryLastEditDate(){const t=this._serviceInfo.source,r={...t.query,f:"json"};return(await e(t.path,{query:r,responseType:"json"})).data.editingInfo.lastEditDate}createTileQuery(e,t={}){const r=this._serviceInfo.geometryType,s=this.createQuery(t);s.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),s.resultType="tile",s.geometry=e.extent,this._serviceInfo.capabilities.query.supportsQuantization?"esriGeometryPolyline"===r&&(s.maxAllowableOffset=e.resolution*has("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==r&&"esriGeometryPolygon"!==r||(s.maxAllowableOffset=e.resolution,"esriGeometryPolyline"===r&&(s.maxAllowableOffset*=has("feature-polyline-generalization-factor")));const i=this._serviceInfo.capabilities.query;return s.defaultSpatialReferenceEnabled=i.supportsDefaultSpatialReference,s.compactGeometryEnabled=i.supportsCompactGeometry,s}async _executePatchQuery(e,t,r,i){const a=t.clone();a.outFields=[this._serviceInfo.objectIdField,...r],a.returnCentroid=!1,a.returnGeometry=!1;const o=s(a.start)?a.start/8e3:0,n=i.signal;return this._patchQueue.push({tile:e,query:a,signal:n,depth:o})}async _resend(e,t){const{query:r,message:i}=e,n=s(r.outFields)?r.outFields:[],u=this._queryInfo.outFields,c=u.filter((e=>!n.includes(e)));if(a(i.addOrUpdate))this._onMessage({...i,type:"append"});else if(c.length)try{const e=this._subscriptions.get(i.id).tile,s=await this._executePatchQuery(e,r,c,t);o(t),r.outFields=u,i.addOrUpdate.joinAttributes(s),this._onMessage({...i,end:i.end,type:"append"})}catch(l){}else this._onMessage({...i,type:"append"})}async _resendSubscription(e){if(has("esri-2d-update-debug")&&console.debug(e.tile.id,"Resend Subscription"),e.empty)return this._onMessage({id:e.tile.id,addOrUpdate:null,end:!1,type:"append"});const t=e.signal;for(const r of e.requests.done)await this._resend(r,{signal:t});return s(e.edits)?this._onMessage(e.edits):void 0}async resend(){const e=Array.from(this._subscriptions.values());await Promise.all(e.map((e=>this._resendSubscription(e))))}}export{d as BaseFeatureSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../TimeExtent.js";import s from"../../../../../core/Evented.js";import has from"../../../../../core/has.js";import{isSome as t}from"../../../../../core/maybe.js";import{createResolver as r,ignoreAbortErrors as i,eachAlwaysValues as o,eachAlways as n}from"../../../../../core/promiseUtils.js";import{diff as c,hasDiff as u,hasDiffAny as h}from"../../../../../core/accessorSupport/diffUtils.js";import a from"../../../../../rest/support/Query.js";import{DataTileSubscription as d}from"./DataTileSubscription.js";import{UpdateToken as p}from"../support/UpdateToken.js";function l(e,s){const t=new Set;return e&&e.forEach((e=>t.add(e))),s&&s.forEach((e=>t.add(e))),t.has("*")?["*"]:Array.from(t)}class m{constructor(e){this.events=new s,this._resolver=r(),this._didEdit=!1,this._subscriptions=new Map,this._outSR=e.outSR,this._serviceInfo=e.serviceInfo,this._onTileUpdateMessage=e.onMessage}destroy(){}async _onMessage(e){const s=this._subscriptions.get(e.id);if(!s)return;const t={...e,remove:e.remove??[],status:e.status??p.empty()};return i(this._onTileUpdateMessage(t,s.options))}update(s,t){const r=t.fields.length;t.outFields=l(this._schema?.outFields,t.outFields),t.outFields=t.outFields.length>=.75*r?["*"]:t.outFields,t.outFields.sort();const i=c(this._schema,t);if(!i)return;has("esri-2d-update-debug")&&console.debug("Applying Update - Source:",i);const o="orderByFields"in this._serviceInfo&&this._serviceInfo.orderByFields?this._serviceInfo.orderByFields:this._serviceInfo.objectIdField+" ASC",n={returnCentroid:"esriGeometryPolygon"===this._serviceInfo.geometryType,returnGeometry:!0,timeReferenceUnknownClient:"stream"!==this._serviceInfo.type&&this._serviceInfo.timeReferenceUnknownClient,outFields:t.outFields,outSpatialReference:this._outSR,orderByFields:[o],where:t.definitionExpression||"1=1",gdbVersion:t.gdbVersion,historicMoment:t.historicMoment,timeExtent:e.fromJSON(t.timeExtent)},a=this._schema&&u(i,"outFields");this._schema&&h(i,["timeExtent","definitionExpression","gdbVersion","historicMoment","customParameters"])&&(s.why.mesh.push("Layer filter and/or custom parameters changed"),s.why.source.push("Layer filter and/or custom parameters changed"),s.mesh=!0,s.source=!0,s.queryFilter=!0),a&&(s.why.source.push("Layer required fields changed"),s.source=!0),c(n,this._queryInfo)&&(this._queryInfo=n),this._schema=t,this._resolver.resolve()}whenInitialized(){return this._resolver.promise}async applyUpdate(e){if(e.queryFilter||e.source&&this._didEdit)return this.refresh(e.version),void(this._didEdit=!1);this._subscriptions.forEach((s=>s.applyUpdate(e))),await this.resend()}refresh(e,s){for(const t of this._tiles())this.unsubscribe(t),this.subscribe(t,e)}subscribe(e,s){const t=new d(e,s);this._subscriptions.set(e.id,t)}unsubscribe(e){const s=this.get(e.id);t(s)&&s.abort(),this._subscriptions.delete(e.id)}createQuery(e={}){const s=this._queryInfo.historicMoment?new Date(this._queryInfo.historicMoment):null;return new a({...this._queryInfo,historicMoment:s,...e})}get(e){return this._subscriptions.has(e)?this._subscriptions.get(e):null}async queryLastEditDate(){throw new Error("Service does not support query type")}async query(e){throw new Error("Service does not support query")}*_tiles(){const e=Array.from(this._subscriptions.values());for(const s of e)yield s.tile}async edit(e,s){const t=Array.from(this._subscriptions.values()),r=t.map((({tile:e})=>e));for(const i of t)i.removeIds(s);if(e.length){const t=r.map((s=>{const t=this.createTileQuery(s);return t.objectIds=e,{tile:s,query:t}})).map((async({tile:e,query:s})=>({tile:e,result:await this.query(s),query:s}))),i=(await o(t)).map((async({tile:t,result:r})=>{if(!r.hasFeatures&&!s.length&&!e.length)return;const i=this._subscriptions.get(t.key.id);i&&i.edit(r,e)}));await n(i)}this._didEdit=!0}}export{m as DataTileSource};
5
+ import e from"../../../../../TimeExtent.js";import t from"../../../../../core/Evented.js";import has from"../../../../../core/has.js";import{isSome as s}from"../../../../../core/maybe.js";import{createResolver as i,ignoreAbortErrors as r,eachAlwaysValues as o,eachAlways as n}from"../../../../../core/promiseUtils.js";import{diff as c,hasDiff as u,hasDiffAny as h}from"../../../../../core/accessorSupport/diffUtils.js";import a from"../../../../../rest/support/Query.js";import{DataTileSubscription as d}from"./DataTileSubscription.js";import{UpdateToken as l}from"../support/UpdateToken.js";function p(e,t){const s=new Set;return e&&e.forEach((e=>s.add(e))),t&&t.forEach((e=>s.add(e))),s.has("*")?["*"]:Array.from(s)}class m{constructor(e){this.events=new t,this._resolver=i(),this._didEdit=!1,this._subscriptions=new Map,this._outSR=e.outSR,this._serviceInfo=e.serviceInfo,this._onTileUpdateMessage=e.onMessage}destroy(){}async _onMessage(e){const t=this._subscriptions.get(e.id);if(!t)return;const s={...e,remove:e.remove??[],status:e.status??l.empty()};return r(this._onTileUpdateMessage(s,t.options))}update(t,s){const i=s.fields.length;s.outFields=p(this._schema?.outFields,s.outFields),s.outFields=s.outFields.length>=.75*i?["*"]:s.outFields,s.outFields.sort();const r=c(this._schema,s);if(!r)return;has("esri-2d-update-debug")&&console.debug("Applying Update - Source:",r);const o="orderByFields"in this._serviceInfo&&this._serviceInfo.orderByFields?this._serviceInfo.orderByFields:this._serviceInfo.objectIdField+" ASC",n={returnCentroid:"esriGeometryPolygon"===this._serviceInfo.geometryType,returnGeometry:!0,timeReferenceUnknownClient:"stream"!==this._serviceInfo.type&&this._serviceInfo.timeReferenceUnknownClient,outFields:s.outFields,outSpatialReference:this._outSR,orderByFields:[o],where:s.definitionExpression||"1=1",gdbVersion:s.gdbVersion,historicMoment:s.historicMoment,timeExtent:s.timeExtent?e.fromJSON(s.timeExtent):null},a=this._schema&&u(r,"outFields");this._schema&&h(r,["timeExtent","definitionExpression","gdbVersion","historicMoment","customParameters"])&&(t.why.mesh.push("Layer filter and/or custom parameters changed"),t.why.source.push("Layer filter and/or custom parameters changed"),t.mesh=!0,t.source=!0,t.queryFilter=!0),a&&(t.why.source.push("Layer required fields changed"),t.source=!0),c(n,this._queryInfo)&&(this._queryInfo=n),this._schema=s,this._resolver.resolve()}whenInitialized(){return this._resolver.promise}async applyUpdate(e){if(e.queryFilter||e.source&&this._didEdit)return this.refresh(e.version),void(this._didEdit=!1);this._subscriptions.forEach((t=>t.applyUpdate(e))),await this.resend()}refresh(e,t){for(const s of this._tiles())this.unsubscribe(s),this.subscribe(s,e)}subscribe(e,t){const s=new d(e,t);this._subscriptions.set(e.id,s)}unsubscribe(e){const t=this.get(e.id);s(t)&&t.abort(),this._subscriptions.delete(e.id)}createQuery(e={}){const t=this._queryInfo.historicMoment?new Date(this._queryInfo.historicMoment):null;return new a({...this._queryInfo,historicMoment:t,...e})}get(e){return this._subscriptions.has(e)?this._subscriptions.get(e):null}async queryLastEditDate(){throw new Error("Service does not support query type")}async query(e){throw new Error("Service does not support query")}*_tiles(){const e=Array.from(this._subscriptions.values());for(const t of e)yield t.tile}async edit(e,t){const s=Array.from(this._subscriptions.values()),i=s.map((({tile:e})=>e));for(const r of s)r.removeIds(t);if(e.length){const s=i.map((t=>{const s=this.createTileQuery(t);return s.objectIds=e,{tile:t,query:s}})).map((async({tile:e,query:t})=>({tile:e,result:await this.query(t),query:t}))),r=(await o(s)).map((async({tile:s,result:i})=>{if(!i.hasFeatures&&!t.length&&!e.length)return;const r=this._subscriptions.get(s.key.id);r&&r.edit(i,e)}));await n(r)}this._didEdit=!0}}export{m as DataTileSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/CircularArray.js";import has from"../../../../../core/has.js";import{isSome as s,isNone as t,unwrap as r}from"../../../../../core/maybe.js";import{FeatureSetReaderJSON as i}from"../support/FeatureSetReaderJSON.js";import{UpdateToken as d}from"../support/UpdateToken.js";class a{constructor(s,t){this.requests={done:new Array,stream:new e(10)},this._edits=null,this._abortController=new AbortController,this._version=0,this._done=!1,this.didSend=!1,this.tile=s,this._version=t}get signal(){return this._abortController.signal}get options(){return{signal:this._abortController.signal}}get empty(){return!this.requests.done.length}get edits(){return this._edits}get done(){return this._done}end(){this._done=!0}clear(){this.requests.done=[]}applyUpdate(e){this.requests.done.forEach((s=>s.message.status.unset(e))),this._version=e.version,s(this._edits)&&this._edits.status.unset(e)}add(e){e.message.status=e.message.status??d.empty(),e.message.status.version=this._version,has("esri-2d-update-debug")&&console.debug(this.tile.id,"DataTileSubscription:add",this._version),e.message.end&&this.requests.done.forEach((e=>{s(e.message)&&e.message.end&&(e.message.end=!1)})),this.requests.done.push(e)}edit(e,s){const a=e.getQuantizationTransform(),o=e.fullSchema(),n=Array.from(e.features()),h=[...s,...n.map((e=>e.objectId))];if(this.removeIds(h),this._invalidate(),t(this._edits))return void(this._edits={type:"append",addOrUpdate:i.fromOptimizedFeatures(n,o,r(a)),id:this.tile.id,status:d.empty(),end:!0});this.requests.done.forEach((e=>e.message.end=!1));r(this._edits.addOrUpdate).append(e.features())}*readers(){for(const{message:e}of this.requests.done)s(e.addOrUpdate)&&(yield e.addOrUpdate);s(this._edits)&&s(this._edits.addOrUpdate)&&(yield this._edits.addOrUpdate)}_invalidate(){for(const e of this.requests.done)e.message.status=d.empty();s(this._edits)&&(this._edits.status=d.empty())}removeIds(e){this._invalidate();for(const{message:t}of this.requests.done){const r=t.addOrUpdate;s(r)&&(r.removeIds(e),r.isEmpty&&(t.addOrUpdate=null))}s(this._edits)&&s(this._edits.addOrUpdate)&&this._edits.addOrUpdate.removeIds(e),this.requests.done=this.requests.done.filter((e=>e.message.addOrUpdate||e.message.end))}abort(){this._abortController.abort()}}export{a as DataTileSubscription};
5
+ import e from"../../../../../core/CircularArray.js";import has from"../../../../../core/has.js";import{isSome as s,isNone as t,unwrap as r}from"../../../../../core/maybe.js";import{FeatureSetReaderJSON as i}from"../support/FeatureSetReaderJSON.js";import{UpdateToken as d}from"../support/UpdateToken.js";class a{constructor(s,t){this.requests={done:new Array,stream:new e(10)},this._edits=null,this._abortController=new AbortController,this._version=0,this._done=!1,this.didSend=!1,this.tile=s,this._version=t}get signal(){return this._abortController.signal}get options(){return{signal:this._abortController.signal}}get empty(){return!this.requests.done.length}get edits(){return this._edits}get done(){return this._done}end(){this._done=!0}clear(){this.requests.done=[]}applyUpdate(e){this.requests.done.forEach((s=>s.message.status.unset(e))),this._version=e.version,s(this._edits)&&this._edits.status.unset(e)}add(e){e.message.status=e.message.status??d.empty(),e.message.status.version=this._version,has("esri-2d-update-debug")&&console.debug(this.tile.id,"DataTileSubscription:add",this._version),e.message.end&&this.requests.done.forEach((e=>{s(e.message)&&e.message.end&&(e.message.end=!1)})),this.requests.done.push(e)}edit(e,a){const o=e.getQuantizationTransform(),n=e.fullSchema(),h=Array.from(e.features()).filter(s),u=[...a,...h.map((e=>e.objectId))];if(this.removeIds(u),this._invalidate(),t(this._edits))return void(this._edits={type:"append",addOrUpdate:i.fromOptimizedFeatures(h,n,r(o)),id:this.tile.id,status:d.empty(),end:!0});this.requests.done.forEach((e=>e.message.end=!1));r(this._edits.addOrUpdate).append(e.features())}*readers(){for(const{message:e}of this.requests.done)s(e.addOrUpdate)&&(yield e.addOrUpdate);s(this._edits)&&s(this._edits.addOrUpdate)&&(yield this._edits.addOrUpdate)}_invalidate(){for(const e of this.requests.done)e.message.status=d.empty();s(this._edits)&&(this._edits.status=d.empty())}removeIds(e){this._invalidate();for(const{message:t}of this.requests.done){const r=t.addOrUpdate;s(r)&&(r.removeIds(e),r.isEmpty&&(t.addOrUpdate=null))}s(this._edits)&&s(this._edits.addOrUpdate)&&this._edits.addOrUpdate.removeIds(e),this.requests.done=this.requests.done.filter((e=>e.message.addOrUpdate||e.message.end))}abort(){this._abortController.abort()}}export{a as DataTileSubscription};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../core/has.js";import{isSome as e}from"../../../../../core/maybe.js";import{watch as t}from"../../../../../core/reactiveUtils.js";import{r as s}from"../../../../../chunks/rbush.js";import{convertFromFeature as r,quantizeOptimizedGeometry as i,quantizeX as n,quantizeY as o}from"../../../../../layers/graphics/featureConversionUtils.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{StreamFeatureManager as d}from"../../../../../layers/graphics/data/StreamFeatureManager.js";import{createConnection as c}from"../../../../../layers/graphics/sources/connections/createConnection.js";import{DataTileSource as h}from"./DataTileSource.js";import{FeatureSetReaderJSON as u}from"../support/FeatureSetReaderJSON.js";import{UpdateToken as p}from"../support/UpdateToken.js";const l=2500;function m(t,s){const r=t.weakClone();if(e(t.geometry)){const e=n(s,t.geometry.coords[0]),i=o(s,t.geometry.coords[1]);r.geometry=new a([],[e,i])}return r}function _(e){return"esriGeometryPoint"===e?m:(t,s)=>{const r=t.weakClone(),n=new a,o=!1,d=!1,c=i(n,t.geometry,o,d,e,s,!1,!1);return r.geometry=c,r}}function f(t){return"esriGeometryPoint"===t?t=>e(t.geometry)?{minX:t.geometry.coords[0],minY:t.geometry.coords[1],maxX:t.geometry.coords[0],maxY:t.geometry.coords[1]}:{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}:t=>{let s=1/0,r=1/0,i=-1/0,n=-1/0;return e(t.geometry)&&t.geometry.forEachVertex(((e,t)=>{s=Math.min(s,e),r=Math.min(r,t),i=Math.max(i,e),n=Math.max(n,t)})),{minX:s,minY:r,maxX:i,maxY:n}}}function v(e,t){const r=s(9,f(t));return r.load(e),r}function g(e,t){return e.search({minX:t.bounds[0],minY:t.bounds[1],maxX:t.bounds[2],maxY:t.bounds[3]})}class y{constructor(e,t){this.onUpdate=e,this._geometryType=t,this._objectIdToFeature=new Map}get _features(){const e=[];return this._objectIdToFeature.forEach((t=>e.push(t))),e}add(e){this._objectIdToFeature.set(e.objectId,e),this._index=null}get(e){return this._objectIdToFeature.has(e)?this._objectIdToFeature.get(e):null}forEach(e){this._objectIdToFeature.forEach(e)}search(e){return this._index||(this._index=v(this._features,this._geometryType)),g(this._index,e)}removeById(e){const t=this._objectIdToFeature.get(e);return t?(this._objectIdToFeature.delete(e),this._index=null,t):null}update(e,t){this.onUpdate(e,t)}get size(){return this._objectIdToFeature.size}}class b extends h{constructor(e){super(e),this.type="geoevent",this._dataReceiveEventEnabled=!1,this._level=0,this._updateInfo={websocket:0,client:0},this._inUpdate=!1;const{outSR:s}=e,{geometryType:r,objectIdField:i,timeInfo:n,purgeOptions:o,source:a,spatialReference:h,serviceFilter:u,maxReconnectionAttempts:p,maxReconnectionInterval:m,updateInterval:f,enableDataReceived:v,customParameters:g}=e.serviceInfo,b=new y(this._onUpdate.bind(this),r),I=new d(b,i,n,o),U=c(a,h,s,r,u,p,m,g);this._store=b,this._manager=I,this._connection=U,this._quantize=_(r),this._dataReceiveEventEnabled=v,this._handles=[this._connection.on("data-received",(e=>this._onFeature(e))),t((()=>U.connectionStatus),(e=>this.events.emit("connectionStatus",e))),t((()=>U.errorString),(e=>this.events.emit("errorString",e)))],this._initUpdateInterval=()=>{let t=performance.now();this._updateIntervalId=setInterval((()=>{const s=performance.now(),r=s-t;if(r>l){t=s;const e=Math.round(this._updateInfo.client/(r/1e3)),i=Math.round(this._updateInfo.websocket/(r/1e3));this._updateInfo.client=0,this._updateInfo.websocket=0,this.events.emit("updateRate",{client:e,websocket:i})}e.canAcceptRequest()&&!this._inUpdate&&this._manager.checkForUpdates()}),f)},this._initUpdateInterval()}destroy(){super.destroy(),this._clearUpdateInterval(),this._handles.forEach((e=>e.remove())),this._connection.destroy()}_fetchDataTile(){}pauseStream(){this._clearUpdateInterval()}resumeStream(){this._initUpdateInterval()}enableEvent(e,t){"data-received"===e&&(this._dataReceiveEventEnabled=t)}get updating(){return!1}subscribe(e,t){super.subscribe(e,t);const s=this._subscriptions.get(e.id);this._level=e.level;const r=this._getTileFeatures(e);this._onMessage({type:"append",id:e.key.id,addOrUpdate:r,end:!0}),s.didSend=!0}unsubscribe(e){super.unsubscribe(e)}*readers(t){const s=this._subscriptions.get(t),{tile:r}=s;yield this._getTileFeatures(r);for(const i of s.requests.stream.entries)e(i)&&e(i.addOrUpdate)&&(yield i.addOrUpdate)}createTileQuery(e){throw new Error("Service does not support tile queries")}async resend(){this._subscriptions.forEach((e=>{const{tile:t}=e,s={type:"append",id:t.id,addOrUpdate:this._getTileFeatures(t),end:!0};this._onMessage(s)}))}_getTileFeatures(e){const t=this._store.search(e).map((t=>this._quantize(t,e.transform)));return u.fromOptimizedFeatures(t,this._serviceInfo,e.transform)}_onFeature(e){this._updateInfo.websocket++;try{this._dataReceiveEventEnabled&&this.events.emit("data-received",e);const t=r(e,this._serviceInfo.geometryType,!1,!1,this._serviceInfo.objectIdField);this._manager.add(t)}catch(t){}}_clearUpdateInterval(){clearInterval(this._updateIntervalId),this._updateIntervalId=0}async _onUpdate(t,s){this._inUpdate=!0;try{e(t)&&(this._updateInfo.client+=t.length),this._subscriptions.forEach(((e,t)=>{e.didSend&&e.tile.level===this._level&&this._onMessage({type:"append",id:t,addOrUpdate:null,clear:!0,end:!1})}));const s=[];this._subscriptions.forEach(((e,t)=>{if(!e.didSend||e.tile.level!==this._level)return;const r=e.tile,i={type:"append",id:t,addOrUpdate:this._getTileFeatures(r),remove:[],end:!1,status:p.empty()};e.requests.stream.enqueue(i),s.push(this._onMessage(i))})),await Promise.all(s),this._subscriptions.forEach(((e,t)=>{e.didSend&&e.tile.level===this._level&&this._onMessage({type:"append",id:t,addOrUpdate:null,end:!0})}))}catch{}this._inUpdate=!1}}export{b as GeoEventSource};
5
+ import"../../../../../core/has.js";import{isSome as e}from"../../../../../core/maybe.js";import{watch as t}from"../../../../../core/reactiveUtils.js";import{r as s}from"../../../../../chunks/rbush.js";import{convertFromFeature as r,quantizeOptimizedGeometry as i,quantizeX as n,quantizeY as a}from"../../../../../layers/graphics/featureConversionUtils.js";import o from"../../../../../layers/graphics/OptimizedGeometry.js";import{StreamFeatureManager as d}from"../../../../../layers/graphics/data/StreamFeatureManager.js";import{createConnection as c}from"../../../../../layers/graphics/sources/connections/createConnection.js";import{DataTileSource as h}from"./DataTileSource.js";import{FeatureSetReaderJSON as u}from"../support/FeatureSetReaderJSON.js";import{UpdateToken as p}from"../support/UpdateToken.js";const l=2500;function m(t,s){const r=t.weakClone();if(e(t.geometry)){const e=n(s,t.geometry.coords[0]),i=a(s,t.geometry.coords[1]);r.geometry=new o([],[e,i])}return r}function _(e){return"esriGeometryPoint"===e?m:(t,s)=>{const r=t.weakClone(),n=new o,a=!1,d=!1,c=i(n,t.geometry,a,d,e,s,!1,!1);return r.geometry=c,r}}function v(t){return"esriGeometryPoint"===t?t=>e(t.geometry)?{minX:t.geometry.coords[0],minY:t.geometry.coords[1],maxX:t.geometry.coords[0],maxY:t.geometry.coords[1]}:{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}:t=>{let s=1/0,r=1/0,i=-1/0,n=-1/0;return e(t.geometry)&&t.geometry.forEachVertex(((e,t)=>{s=Math.min(s,e),r=Math.min(r,t),i=Math.max(i,e),n=Math.max(n,t)})),{minX:s,minY:r,maxX:i,maxY:n}}}function f(e,t){const r=s(9,v(t));return r.load(e),r}function g(e,t){return e.search({minX:t.bounds[0],minY:t.bounds[1],maxX:t.bounds[2],maxY:t.bounds[3]})}class y{constructor(e,t){this.onUpdate=e,this._geometryType=t,this._objectIdToFeature=new Map,this._index=null}get _features(){const e=[];return this._objectIdToFeature.forEach((t=>e.push(t))),e}add(e){this._objectIdToFeature.set(e.objectId,e),this._index=null}get(e){return this._objectIdToFeature.has(e)?this._objectIdToFeature.get(e):null}forEach(e){this._objectIdToFeature.forEach(e)}search(e){return this._index||(this._index=f(this._features,this._geometryType)),g(this._index,e)}removeById(e){const t=this._objectIdToFeature.get(e);return t?(this._objectIdToFeature.delete(e),this._index=null,t):null}update(e,t){this.onUpdate(e,t)}get size(){return this._objectIdToFeature.size}}class b extends h{constructor(e){super(e),this.type="geoevent",this._updateIntervalId=0,this._dataReceiveEventEnabled=!1,this._level=0,this._updateInfo={websocket:0,client:0},this._inUpdate=!1;const{outSR:s}=e,{geometryType:r,objectIdField:i,timeInfo:n,purgeOptions:a,source:o,spatialReference:h,serviceFilter:u,maxReconnectionAttempts:p,maxReconnectionInterval:m,updateInterval:v,enableDataReceived:f,customParameters:g}=e.serviceInfo,b=new y(this._onUpdate.bind(this),r),I=new d(b,i,n,a),U=c(o,h,s,r,u,p,m,g??{});this._store=b,this._manager=I,this._connection=U,this._quantize=_(r),this._dataReceiveEventEnabled=f,this._handles=[this._connection.on("data-received",(e=>this._onFeature(e))),t((()=>U.connectionStatus),(e=>this.events.emit("connectionStatus",e))),t((()=>U.errorString),(e=>this.events.emit("errorString",e)))],this._initUpdateInterval=()=>{let t=performance.now();this._updateIntervalId=setInterval((()=>{const s=performance.now(),r=s-t;if(r>l){t=s;const e=Math.round(this._updateInfo.client/(r/1e3)),i=Math.round(this._updateInfo.websocket/(r/1e3));this._updateInfo.client=0,this._updateInfo.websocket=0,this.events.emit("updateRate",{client:e,websocket:i})}e.canAcceptRequest()&&!this._inUpdate&&this._manager.checkForUpdates()}),v)},this._initUpdateInterval()}destroy(){super.destroy(),this._clearUpdateInterval(),this._handles.forEach((e=>e.remove())),this._connection.destroy()}_fetchDataTile(){}pauseStream(){this._clearUpdateInterval()}resumeStream(){this._initUpdateInterval()}enableEvent(e,t){"data-received"===e&&(this._dataReceiveEventEnabled=t)}get updating(){return!1}subscribe(e,t){super.subscribe(e,t);const s=this._subscriptions.get(e.id);this._level=e.level;const r=this._getTileFeatures(e);this._onMessage({type:"append",id:e.key.id,addOrUpdate:r,end:!0}),s.didSend=!0}unsubscribe(e){super.unsubscribe(e)}*readers(t){const s=this._subscriptions.get(t),{tile:r}=s;yield this._getTileFeatures(r);for(const i of s.requests.stream.entries)e(i)&&e(i.addOrUpdate)&&(yield i.addOrUpdate)}createTileQuery(e){throw new Error("Service does not support tile queries")}async resend(){this._subscriptions.forEach((e=>{const{tile:t}=e,s={type:"append",id:t.id,addOrUpdate:this._getTileFeatures(t),end:!0};this._onMessage(s)}))}_getTileFeatures(e){const t=this._store.search(e).map((t=>this._quantize(t,e.transform)));return u.fromOptimizedFeatures(t,this._serviceInfo,e.transform)}_onFeature(e){this._updateInfo.websocket++;try{this._dataReceiveEventEnabled&&this.events.emit("data-received",e);const t=r(e,this._serviceInfo.geometryType,!1,!1,this._serviceInfo.objectIdField);this._manager.add(t)}catch(t){}}_clearUpdateInterval(){clearInterval(this._updateIntervalId),this._updateIntervalId=0}async _onUpdate(t,s){this._inUpdate=!0;try{e(t)&&(this._updateInfo.client+=t.length),this._subscriptions.forEach(((e,t)=>{e.didSend&&e.tile.level===this._level&&this._onMessage({type:"append",id:t,addOrUpdate:null,clear:!0,end:!1})}));const s=[];this._subscriptions.forEach(((e,t)=>{if(!e.didSend||e.tile.level!==this._level)return;const r=e.tile,i={type:"append",id:t,addOrUpdate:this._getTileFeatures(r),remove:[],end:!1,status:p.empty()};e.requests.stream.enqueue(i),s.push(this._onMessage(i))})),await Promise.all(s),this._subscriptions.forEach(((e,t)=>{e.didSend&&e.tile.level===this._level&&this._onMessage({type:"append",id:t,addOrUpdate:null,end:!0})}))}catch{}this._inUpdate=!1}}export{b as GeoEventSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{isSome as e,unwrapOrThrow as s,isNone as r}from"../../../../../core/maybe.js";import{throwIfAborted as o,after as a}from"../../../../../core/promiseUtils.js";import n from"../../../../../core/RandomLCG.js";import{BaseFeatureSource as i}from"./BaseFeatureSource.js";import{FeatureSetReaderIndirect as d}from"../support/FeatureSetReaderPBFIndirect.js";import{UpdateToken as u}from"../support/UpdateToken.js";function h(t,e,s){const r=t.getXHydrated(),o=t.getYHydrated(),a=e.getColumnForX(r),n=Math.floor(e.normalizeCol(a));return`${s}/${Math.floor(e.getRowForY(o))}/${n}`}function l(t,e){if(r(t))return null;const s=e.transform,o=t.getQuantizationTransform();if(r(o)){const[e,r]=s.scale,[o,a]=s.translate,n=-o/e,i=1/e,d=a/r,u=1/-r;return t.transform(n,d,i,u)}const[a,n]=o.scale,[i,d]=o.translate,[u,h]=s.scale,[l,c]=s.translate,g=a/u,_=(i-l)/u,p=n/h,f=(-d+c)/h;return t.transform(_,f,g,p)}class c extends i{constructor(t){super(t),this.mode="snapshot",this._loading=!0,this._controller=new AbortController,this._downloadPromise=null,this._didSendEnd=!1,this._queries=new Array,this._invalidated=!1,this._hasAggregates=!1,this._random=new n(1e3),this._store=t.store,this._markedIdsBufId=this._store.storage.createBitset()}destroy(){super.destroy(),this._controller.abort()}get loading(){return this._loading}get _signal(){return this._controller.signal}update(t,s){super.update(t,s),null==this._featureCount&&(this._featureCount=s.initialFeatureCount),e(s.changedFeatureCount)&&(this._featureCount=s.changedFeatureCount),this._hasAggregates=t.targets.aggregate}async resend(t=!1){if(await this._downloadPromise,this._invalidated||t){const t=s(this._featureCount,"Expected featureCount to be defined");return this._invalidated=!1,this._subscriptions.forEach((t=>t.clear())),this._downloadPromise=this._download(t),void await this._downloadPromise}const e=this._queries.map((({query:t,reader:e})=>this._sendPatchQuery(t,e)));await Promise.all(e),this._subscriptions.forEach((t=>{t.requests.done.forEach((t=>this._onMessage(t.message)))}))}async refresh(t,e){e&&(this._featureCount=e.featureCount),await this.resend(!0)}async _sendPatchQuery(t,s){const r=e(t.outFields)?t.outFields:[],a=this._queryInfo.outFields,n=a.filter((t=>!r.includes(t)));if(!n.length)return;const i=t.clone(),d=this._signal;i.returnGeometry=!1,i.returnCentroid=!1,i.outFields=n,t.outFields=a;const u=await this._queue.push({query:i,depth:0,signal:d});o({signal:d}),s.joinAttributes(u)}async _fetchDataTile(t){if(!this._downloadPromise){const t=s(this._featureCount,"Expected featureCount to be defined");this._downloadPromise=this._download(t)}const e=this._store.search(t),r=this._subscriptions.get(t.key.id),o=e.length-1;for(let s=0;s<o;s++){const o=l(e[s],t),n={type:"append",id:t.id,addOrUpdate:o,end:!1,status:u.empty()};r.add({query:null,message:n}),this._hasAggregates||await a(1),this._onMessage(n)}const n=l(o>=0?e[o]:null,t),i=this._didSendEnd,d={type:"append",id:t.id,addOrUpdate:n,end:i,status:u.empty()};r.add({query:null,message:d}),this._onMessage(d)}async _download(e){try{await this.whenInitialized();const t=this._store.storage.getBitset(this._markedIdsBufId),s=new Set;t.clear();const r=Math.ceil(e/this.pageSize),o=Array.from({length:r},((t,e)=>e)).sort(((t,e)=>this._random.getInt()-this._random.getInt())).map((e=>this._downloadPage(e,t,s)));await Promise.all(o),this._store.sweepFeatures(t,this._store.storage),this._store.sweepFeatureSets(s)}catch(s){t.getLogger("esri.views.2d.layers.features.sources.SnapshotFeatureSource").error("mapview-snapshot-source","Encountered and error when downloading feature snapshot",s)}this._sendEnd(),this._loading=!1}async _downloadPage(t,s,r){const a=this.pageSize,n={start:t*a,num:a,cacheHint:!0};e(this.maxRecordCountFactor)&&(n.maxRecordCountFactor=this.maxRecordCountFactor);const i=this.createQuery(n),d=this._signal,u=await this._queue.push({query:i,depth:t,signal:d});o({signal:d}),this._queries.push({query:i,reader:u}),this._store.insert(u),r.add(u.instance);const h=u.getCursor();for(;h.next();)s.set(h.getDisplayId());this._send(u)}_send(t){if(!this._subscriptions.size)return;let s=null;const o=new Map,a=new Set,n=new Map;this._subscriptions.forEach((t=>{const e=t.tile;o.set(e.key.id,null),s=e.tileInfoView,a.add(e.level);const{row:r,col:i}=e.key,d=`${e.level}/${r}/${i}`,u=n.get(d)??[];u.push(t),n.set(d,u)}));for(const e of a){const a=s.getLODInfoAt(e),i=t.getCursor();for(;i.next();){const t=h(i,a,e),s=i.getIndex();if(n.has(t))for(const e of n.get(t)){const t=e.tile.id;let a=o.get(t);r(a)&&(a=[],o.set(t,a)),a.push(s)}}}o.forEach(((s,r)=>{if(e(s)){const e=this._subscriptions.get(r),o={type:"append",id:r,addOrUpdate:l(d.from(t,s),e.tile),end:!1,status:u.empty()};e.add({query:null,message:o}),this._onMessage(o)}}))}_sendEnd(){this._subscriptions.forEach((t=>{const e={type:"append",id:t.tile.id,addOrUpdate:null,end:!0,status:u.empty()};t.add({query:null,message:e}),this._onMessage(e)})),this._didSendEnd=!0}}export{c as SnapshotFeatureSource};
5
+ import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{isSome as e,unwrapOrThrow as s,isNone as r}from"../../../../../core/maybe.js";import{throwIfAborted as o,after as a}from"../../../../../core/promiseUtils.js";import n from"../../../../../core/RandomLCG.js";import{BaseFeatureSource as i}from"./BaseFeatureSource.js";import{FeatureSetReaderIndirect as d}from"../support/FeatureSetReaderPBFIndirect.js";import{UpdateToken as u}from"../support/UpdateToken.js";function h(t,e,s){const r=t.getXHydrated(),o=t.getYHydrated(),a=e.getColumnForX(r),n=Math.floor(e.normalizeCol(a));return`${s}/${Math.floor(e.getRowForY(o))}/${n}`}function l(t,e){if(r(t))return null;const s=e.transform,o=t.getQuantizationTransform();if(r(o)){const[e,r]=s.scale,[o,a]=s.translate,n=-o/e,i=1/e,d=a/r,u=1/-r;return t.transform(n,d,i,u)}const[a,n]=o.scale,[i,d]=o.translate,[u,h]=s.scale,[l,c]=s.translate,g=a/u,_=(i-l)/u,p=n/h,f=(-d+c)/h;return t.transform(_,f,g,p)}class c extends i{constructor(t){super(t),this.mode="snapshot",this._loading=!0,this._controller=new AbortController,this._downloadPromise=null,this._didSendEnd=!1,this._queries=new Array,this._invalidated=!1,this._hasAggregates=!1,this._random=new n(1e3),this._store=t.store,this._markedIdsBufId=this._store.storage.createBitset()}destroy(){super.destroy(),this._controller.abort()}get loading(){return this._loading}get _signal(){return this._controller.signal}update(t,s){super.update(t,s),null==this._featureCount&&(this._featureCount=s.initialFeatureCount),e(s.changedFeatureCount)&&(this._featureCount=s.changedFeatureCount),this._hasAggregates=!!t.targets?.aggregate}async resend(t=!1){if(await this._downloadPromise,this._invalidated||t){const t=s(this._featureCount,"Expected featureCount to be defined");return this._invalidated=!1,this._subscriptions.forEach((t=>t.clear())),this._downloadPromise=this._download(t),void await this._downloadPromise}const e=this._queries.map((({query:t,reader:e})=>this._sendPatchQuery(t,e)));await Promise.all(e),this._subscriptions.forEach((t=>{t.requests.done.forEach((t=>this._onMessage(t.message)))}))}async refresh(t,e){e&&(this._featureCount=e.featureCount),await this.resend(!0)}async _sendPatchQuery(t,s){const r=e(t.outFields)?t.outFields:[],a=this._queryInfo.outFields,n=a.filter((t=>!r.includes(t)));if(!n.length)return;const i=t.clone(),d=this._signal;i.returnGeometry=!1,i.returnCentroid=!1,i.outFields=n,t.outFields=a;const u=await this._queue.push({query:i,depth:0,signal:d});o({signal:d}),s.joinAttributes(u)}async _fetchDataTile(t){if(!this._downloadPromise){const t=s(this._featureCount,"Expected featureCount to be defined");this._downloadPromise=this._download(t)}const e=this._store.search(t),r=this._subscriptions.get(t.key.id),o=e.length-1;for(let s=0;s<o;s++){const o=l(e[s],t),n={type:"append",id:t.id,addOrUpdate:o,end:!1,status:u.empty()};r.add({query:null,message:n}),this._hasAggregates||await a(1),this._onMessage(n)}const n=l(o>=0?e[o]:null,t),i=this._didSendEnd,d={type:"append",id:t.id,addOrUpdate:n,end:i,status:u.empty()};r.add({query:null,message:d}),this._onMessage(d)}async _download(e){try{await this.whenInitialized();const t=this._store.storage.getBitset(this._markedIdsBufId),s=new Set;t.clear();const r=Math.ceil(e/this.pageSize),o=Array.from({length:r},((t,e)=>e)).sort(((t,e)=>this._random.getInt()-this._random.getInt())).map((e=>this._downloadPage(e,t,s)));await Promise.all(o),this._store.sweepFeatures(t,this._store.storage),this._store.sweepFeatureSets(s)}catch(s){t.getLogger("esri.views.2d.layers.features.sources.SnapshotFeatureSource").error("mapview-snapshot-source","Encountered and error when downloading feature snapshot",s)}this._sendEnd(),this._loading=!1}async _downloadPage(t,s,r){const a=this.pageSize,n={start:t*a,num:a,cacheHint:!0};e(this.maxRecordCountFactor)&&(n.maxRecordCountFactor=this.maxRecordCountFactor);const i=this.createQuery(n),d=this._signal,u=await this._queue.push({query:i,depth:t,signal:d});o({signal:d}),this._queries.push({query:i,reader:u}),this._store.insert(u),r.add(u.instance);const h=u.getCursor();for(;h.next();)s.set(h.getDisplayId());this._send(u)}_send(t){if(!this._subscriptions.size)return;let s=null;const o=new Map,a=new Set,n=new Map;this._subscriptions.forEach((t=>{const e=t.tile;o.set(e.key.id,null),s=e.tileInfoView,a.add(e.level);const{row:r,col:i}=e.key,d=`${e.level}/${r}/${i}`,u=n.get(d)??[];u.push(t),n.set(d,u)}));for(const e of a){const a=s.getLODInfoAt(e),i=t.getCursor();for(;i.next();){const t=h(i,a,e),s=i.getIndex();if(n.has(t))for(const e of n.get(t)){const t=e.tile.id;let a=o.get(t);r(a)&&(a=[],o.set(t,a)),a.push(s)}}}o.forEach(((s,r)=>{if(e(s)){const e=this._subscriptions.get(r),o={type:"append",id:r,addOrUpdate:l(d.from(t,s),e.tile),end:!1,status:u.empty()};e.add({query:null,message:o}),this._onMessage(o)}}))}_sendEnd(){this._subscriptions.forEach((t=>{const e={type:"append",id:t.tile.id,addOrUpdate:null,end:!0,status:u.empty()};t.add({query:null,message:e}),this._onMessage(e)})),this._didSendEnd=!0}}export{c as SnapshotFeatureSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{isNone as s,isSome as r,mapMany as a,forEachSome as o,applySome as n,unwrap as h}from"../../../../../core/maybe.js";import{createResolver as l,isAbortError as u}from"../../../../../core/promiseUtils.js";import{diff as c}from"../../../../../core/accessorSupport/diffUtils.js";import d from"../../../../../layers/support/FieldsIndex.js";import{MAX_FILTERS as p,HIGHLIGHT_FLAG as g,ATTRIBUTE_DATA_VV as _,NAN_MAGIC_NUMBER as f,ATTRIBUTE_DATA_ANIMATION as y,ATTRIBUTE_DATA_GPGPU as m}from"../../../engine/webgl/definitions.js";import{DISPLAY_ID_TYPE_AGGREGATE as b,DISPLAY_ID_TYPE_FEATURE as x,getDisplayIdTexel as T,getDisplayIdType as S,getDisplayIdFilterMask as z}from"../../../engine/webgl/DisplayId.js";import{getPixelArrayCtor as A}from"../../../engine/webgl/Utils.js";import{createDebugLogger as E,DEBUG_ATTR_UPDATES as U}from"../../../engine/webgl/util/debug.js";import{getVisualVariableSizeValueRepresentationRatio as w}from"../tileRenderers/support/visualVariablesUtils.js";import{PixelType as D}from"../../../../webgl/enums.js";const k=e.getLogger("esri.views.layers.2d.features.support.AttributeStore"),F=E(U,k),M={sharedArrayBuffer:has("esri-shared-array-buffer"),atomics:has("esri-atomics")};function B(t,e){return i=>e(t(i))}class C{constructor(t,e,i,s){this.size=0,this.texelSize=4;const{pixelType:r,layout:a,textureOnly:o}=s;this.textureOnly=o||!1,this.pixelType=r,this._ctype=e,this.layout=a,this._resetRange(),this._shared=t,this.size=i,o||(this.data=this._initData(r,i,t,e))}get buffer(){return n(this.data,(t=>t.buffer))}unsetComponentAllTexels(t,e){const i=h(this.data);for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]&=~e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(t,e){const i=h(this.data);for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]|=255&e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(t,e,i){const s=h(this.data);for(const r of i)s[r*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(t,e,i){h(this.data)[i*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}unsetComponentTexel(t,e,i){h(this.data)[i*this.texelSize+t]&=~e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}getData(t,e){const i=T(t);return h(this.data)[i*this.texelSize+e]}setData(t,e,i){const s=T(t),r=1<<e;0!=(this.layout&r)?(this.data[s*this.texelSize+e]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)):k.error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}lock(){this.pixelType===D.UNSIGNED_BYTE&&this._shared&&M.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,1)}unlock(){this.pixelType===D.UNSIGNED_BYTE&&this._shared&&M.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,0)}expand(t){if(this.size=t,!this.textureOnly){const e=this._initData(this.pixelType,t,this._shared,this._ctype),i=h(this.data);e.set(i),this.data=e}}toMessage(){const t=this.dirtyStart,e=this.dirtyEnd,i=this.texelSize;if(t>e)return null;this._resetRange();const s=!(this._shared||"local"===this._ctype),r=this.pixelType,a=this.layout,o=h(this.data);return{start:t,end:e,data:s&&o.slice(t*i,(e+1)*i)||null,pixelType:r,layout:a}}_initData(t,e,i,s){const r=i&&"local"!==s?SharedArrayBuffer:ArrayBuffer,a=A(t),o=new a(new r(e*e*4*a.BYTES_PER_ELEMENT));for(let n=0;n<o.length;n+=4)o[n+1]=255;return o}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class v{constructor(t,e,i=(()=>{})){this._client=t,this.config=e,this._notifyChange=i,this._attributeComputeMap=new Map,this._blocks=new Array,this._filters=new Array(p),this._targetType=0,this._abortController=new AbortController,this._hasScaleExpr=!1,this._size=32,this._idsToHighlight=new Set;const s=e.supportsTextureFloat?D.FLOAT:D.UNSIGNED_BYTE;F(`Creating AttributeStore ${M.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:D.UNSIGNED_BYTE,layout:1},{pixelType:D.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:D.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:s,layout:15},{pixelType:s,layout:15},{pixelType:s,layout:15},{pixelType:s,layout:15}],this._blocks=this._blockDescriptors.map((()=>null))}destroy(){this._abortController.abort()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}isUpdating(){return!!this._currUpdate||!!this._nextUpdate}update(t,e){this.config=e;const i=e.schema.processors[0].storage,a=c(this._schema,i);if((t.targets.feature||t.targets.aggregate)&&(t.storage.data=!0),a&&(has("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",a),t.storage.data=!0,this._schema=i,this._attributeComputeMap.clear(),!s(i))){switch(i.target){case"feature":this._targetType=x;break;case"aggregate":this._targetType=b}if("subtype"===i.type)for(const t in i.mapping){const e=i.mapping[t];if(r(e)&&r(e.vvMapping))for(const t of e.vvMapping)this._bindAttribute(t)}else{if(r(i.vvMapping))for(const t of i.vvMapping)this._bindAttribute(t);if(r(i.attributeMapping))for(const t of i.attributeMapping)this._bindAttribute(t)}}}onTileData(t,e){if(s(e.addOrUpdate))return;const i=e.addOrUpdate.getCursor();for(;i.next();){const t=i.getDisplayId();this.setAttributeData(t,i)}}async setHighlight(t,e){const i=1,s=this._getBlock(0),r=e.map((t=>T(t)));s.lock(),s.unsetComponentAllTexels(0,i),s.setComponent(0,i,r),s.unlock(),this._idsToHighlight.clear();for(const a of t)this._idsToHighlight.add(a);await this.sendUpdates()}async updateFilters(t,e,i){const{service:s,spatialReference:r}=i,{filters:a}=e,o=a.map(((t,e)=>this._updateFilter(t,e,s,r)));(await Promise.all(o)).some((t=>t))&&(t.storage.filters=!0,has("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(t,e,i,s){const r=T(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,i,s)}getData(t,e,i){return this._getBlock(e).getData(t,i)}getHighlightFlag(t){return this._idsToHighlight.has(t)?g:0}unsetAttributeData(t){const e=T(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e){const s=T(t);if(this._ensureSizeForTexel(s),this._getBlock(0).setData(s,0,this.getFilterFlags(e)),this._targetType!==S(t))return;const r=this._attributeComputeMap,a=this.config.supportsTextureFloat?1:2,o=4;r.size&&r.forEach(((t,r)=>{const n=r*a%o,h=Math.floor(r*a/o),l=this._getBlock(h+_),u=t(e);if(this.config.supportsTextureFloat)l.setData(s,n,u);else if(u===f)l.setData(s,n,255),l.setData(s,n+1,255);else{const t=i(Math.round(u),-32767,32766)+32768,e=255&t,r=(65280&t)>>8;l.setData(s,n,e),l.setData(s,n+1,r)}}))}sendUpdates(){if(has("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate"),this._notifyChange(),this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=l(),this._nextUpdate.promise;const e={blocks:this._blocks.map((t=>r(t)?t.toMessage():null))};return this._currUpdate=this._createResources().then((()=>{const t=()=>{if(this._currUpdate=null,this._nextUpdate){const t=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then((()=>t.resolve()))}else has("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::No additional updates queued");this._notifyChange()};has("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::client.update");const i=this._client.update(e,this._signal).then(t).catch(t);return this._client.render(this._signal),i})).catch((e=>{if(u(e))return this._createResourcesPromise=null,this._createResources();this._notifyChange(),k.error(new t("mapview-attribute-store","Encountered an error during client update",e))})),this._currUpdate}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}_bindAttribute(t){function e(){return t.normalizationField?e=>{const i=e.readAttribute(t.normalizationField);if(!i)return null;return e.readAttribute(t.field)/i}:e=>e.readAttribute(t.field)}function i(){return t.normalizationField&&k.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),e=>e.getComputedNumericAtIndex(t.fieldIndex)}let s;if(null!=t.fieldIndex)s=i();else{if(!t.field)return;s=e()}if(t.valueRepresentation){s=B(s,(e=>w(e,t.valueRepresentation)))}const r=t=>null===t||isNaN(t)||t===1/0||t===-1/0?f:t;this._attributeComputeMap.set(t.binding,B(s,r))}_createResources(){if(r(this._createResourcesPromise))return this._createResourcesPromise;this._getBlock(y),this._getBlock(m),F("Initializing AttributeStore");const e={shared:M.sharedArrayBuffer&&!("local"===this._client.type),size:this._size,blocks:a(this._blocks,(t=>({textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType})))},i=this._client.initialize(e,this._signal).catch((e=>{u(e)?this._createResourcesPromise=null:k.error(new t("mapview-attribute-store","Encountered an error during client initialization",e))}));return this._createResourcesPromise=i,i.then((()=>s(this._createResourcesPromise)?this._createResources():void 0)),i}_getBlock(t){const e=this._blocks[t];if(r(e))return e;F(`Initializing AttributeBlock at index ${t}`);const i=M.sharedArrayBuffer,s=this._client.type,a=new C(i,s,this._size,this._blockDescriptors[t]);return this._blocks[t]=a,this._createResourcesPromise=null,a}_expand(){if(this._size<this.config.maxTextureSize){const t=this._size<<=1;return F("Expanding block size to",t,this._blocks),o(this._blocks,(e=>e.expand(t))),this._createResourcesPromise=null,this._size=t,0}return k.error(new t("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(t,e,i,a){const o=this._filters[e],n=r(o)&&o.hash;if(!o&&!t)return!1;if(n===JSON.stringify(t))return!1;if(s(t)){if(!o)return!1;const t=1<<e+1,i=this._getBlock(0);return this._filters[e]=null,i.setComponentAllTexels(0,t),this.sendUpdates(),!0}const h=await this._getFilter(e,i);return await h.update(t,a),!0}async _getFilter(t,e){const i=this._filters[t];if(r(i))return i;const{default:s}=await import("./FeatureFilter.js"),a=new s({geometryType:e.geometryType,hasM:!1,hasZ:!1,timeInfo:e.timeInfo,fieldsIndex:new d(e.fields)});return this._filters[t]=a,a}isVisible(t){return!!(2&this._getBlock(0).getData(t,0))}getFilterFlags(t){let e=0;const i=z(t.getDisplayId());for(let a=0;a<this._filters.length;a++){const r=!!(i&1<<a),o=this._filters[a];e|=(!r||s(o)||o.check(t)?1:0)<<a}let r=0;if(this._idsToHighlight.size){const e=t.getObjectId();r=this.getHighlightFlag(e)}return e<<1|r}}export{v as default};
5
+ import t from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{isNone as s,isSome as r,mapMany as a,forEachSome as o,applySome as n,unwrap as h}from"../../../../../core/maybe.js";import{createResolver as l,isAbortError as u}from"../../../../../core/promiseUtils.js";import{diff as d}from"../../../../../core/accessorSupport/diffUtils.js";import c from"../../../../../layers/support/FieldsIndex.js";import{MAX_FILTERS as p,HIGHLIGHT_FLAG as g,ATTRIBUTE_DATA_VV as _,NAN_MAGIC_NUMBER as f,ATTRIBUTE_DATA_ANIMATION as y,ATTRIBUTE_DATA_GPGPU as m}from"../../../engine/webgl/definitions.js";import{DISPLAY_ID_TYPE_AGGREGATE as b,DISPLAY_ID_TYPE_FEATURE as x,getDisplayIdTexel as T,getDisplayIdType as S,getDisplayIdFilterMask as z}from"../../../engine/webgl/DisplayId.js";import{getPixelArrayCtor as A}from"../../../engine/webgl/Utils.js";import{createDebugLogger as E,DEBUG_ATTR_UPDATES as U}from"../../../engine/webgl/util/debug.js";import{getVisualVariableSizeValueRepresentationRatio as w}from"../tileRenderers/support/visualVariablesUtils.js";import{PixelType as D}from"../../../../webgl/enums.js";const k=e.getLogger("esri.views.layers.2d.features.support.AttributeStore"),M=E(U,k),B={sharedArrayBuffer:has("esri-shared-array-buffer"),atomics:has("esri-atomics")};function F(t,e){return i=>e(t(i))}class C{constructor(t,e,i,s){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:r,layout:a,textureOnly:o}=s;this.textureOnly=o||!1,this.pixelType=r,this._ctype=e,this.layout=a,this._resetRange(),this._shared=t,this.size=i,o||(this.data=this._initData(r,i,t,e))}get buffer(){return n(this.data,(t=>t.buffer))}unsetComponentAllTexels(t,e){const i=h(this.data);for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]&=~e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(t,e){const i=h(this.data);for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]|=255&e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(t,e,i){const s=h(this.data);for(const r of i)s[r*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(t,e,i){h(this.data)[i*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}unsetComponentTexel(t,e,i){h(this.data)[i*this.texelSize+t]&=~e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}getData(t,e){const i=T(t);return h(this.data)[i*this.texelSize+e]}setData(t,e,i){const r=T(t),a=1<<e;0!=(this.layout&a)?s(this.data)||(this.data[r*this.texelSize+e]=i,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)):k.error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}lock(){this.pixelType===D.UNSIGNED_BYTE&&this._shared&&B.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,1)}unlock(){this.pixelType===D.UNSIGNED_BYTE&&this._shared&&B.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,0)}expand(t){if(this.size=t,!this.textureOnly){const e=this._initData(this.pixelType,t,this._shared,this._ctype),i=h(this.data);e.set(i),this.data=e}}toMessage(){const t=this.dirtyStart,e=this.dirtyEnd,i=this.texelSize;if(t>e)return null;this._resetRange();const s=!(this._shared||"local"===this._ctype),r=this.pixelType,a=this.layout,o=h(this.data);return{start:t,end:e,data:s&&o.slice(t*i,(e+1)*i)||null,pixelType:r,layout:a}}_initData(t,e,i,s){const r=i&&"local"!==s?SharedArrayBuffer:ArrayBuffer,a=A(t),o=new a(new r(e*e*4*a.BYTES_PER_ELEMENT));for(let n=0;n<o.length;n+=4)o[n+1]=255;return o}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class v{constructor(t,e,i=(()=>{})){this._client=t,this.config=e,this._notifyChange=i,this._attributeComputeMap=new Map,this._blocks=new Array,this._filters=new Array(p),this._targetType=0,this._abortController=new AbortController,this._hasScaleExpr=!1,this._size=32,this._nextUpdate=null,this._currUpdate=null,this._idsToHighlight=new Set;const s=e.supportsTextureFloat?D.FLOAT:D.UNSIGNED_BYTE;M(`Creating AttributeStore ${B.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:D.UNSIGNED_BYTE,layout:1},{pixelType:D.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:D.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:s,layout:15},{pixelType:s,layout:15},{pixelType:s,layout:15},{pixelType:s,layout:15}],this._blocks=this._blockDescriptors.map((()=>null))}destroy(){this._abortController.abort()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}isUpdating(){return!!this._currUpdate||!!this._nextUpdate}update(t,e){this.config=e;const i=e.schema.processors[0].storage,a=d(this._schema,i);if((t.targets.feature||t.targets.aggregate)&&(t.storage.data=!0),a&&(has("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",a),t.storage.data=!0,this._schema=i,this._attributeComputeMap.clear(),!s(i))){switch(i.target){case"feature":this._targetType=x;break;case"aggregate":this._targetType=b}if("subtype"===i.type)for(const t in i.mapping){const e=i.mapping[t];if(r(e)&&r(e.vvMapping))for(const t of e.vvMapping)this._bindAttribute(t)}else{if(r(i.vvMapping))for(const t of i.vvMapping)this._bindAttribute(t);if(r(i.attributeMapping))for(const t of i.attributeMapping)this._bindAttribute(t)}}}onTileData(t,e){if(s(e.addOrUpdate))return;const i=e.addOrUpdate.getCursor();for(;i.next();){const t=i.getDisplayId();this.setAttributeData(t,i)}}async setHighlight(t,e){const i=1,s=this._getBlock(0),r=e.map((t=>T(t)));s.lock(),s.unsetComponentAllTexels(0,i),s.setComponent(0,i,r),s.unlock(),this._idsToHighlight.clear();for(const a of t)this._idsToHighlight.add(a);await this.sendUpdates()}async updateFilters(t,e,i){const{service:s,spatialReference:r}=i,{filters:a}=e,o=a.map(((t,e)=>this._updateFilter(t,e,s,r)));(await Promise.all(o)).some((t=>t))&&(t.storage.filters=!0,has("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(t,e,i,s){const r=T(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,i,s)}getData(t,e,i){return this._getBlock(e).getData(t,i)}getHighlightFlag(t){return this._idsToHighlight.has(t)?g:0}unsetAttributeData(t){const e=T(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e){const s=T(t);if(this._ensureSizeForTexel(s),this._getBlock(0).setData(s,0,this.getFilterFlags(e)),this._targetType!==S(t))return;const r=this._attributeComputeMap,a=this.config.supportsTextureFloat?1:2,o=4;r.size&&r.forEach(((t,r)=>{const n=r*a%o,h=Math.floor(r*a/o),l=this._getBlock(h+_),u=t(e);if(this.config.supportsTextureFloat)l.setData(s,n,u);else if(u===f)l.setData(s,n,255),l.setData(s,n+1,255);else{const t=i(Math.round(u),-32767,32766)+32768,e=255&t,r=(65280&t)>>8;l.setData(s,n,e),l.setData(s,n+1,r)}}))}sendUpdates(){if(has("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate"),this._notifyChange(),this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=l(),this._nextUpdate.promise;const e={blocks:this._blocks.map((t=>r(t)?t.toMessage():null))};return this._currUpdate=this._createResources().then((()=>{const t=()=>{if(this._currUpdate=null,this._nextUpdate){const t=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then((()=>t.resolve()))}else has("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::No additional updates queued");this._notifyChange()};has("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::client.update");const i=this._client.update(e,this._signal).then(t).catch(t);return this._client.render(this._signal),i})).catch((e=>{if(u(e))return this._createResourcesPromise=null,this._createResources();this._notifyChange(),k.error(new t("mapview-attribute-store","Encountered an error during client update",e))})),this._currUpdate}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}_bindAttribute(t){function e(){const{normalizationField:e}=t;return e?i=>{const s=i.readAttribute(e);if(!s)return null;return i.readAttribute(t.field)/s}:e=>e.readAttribute(t.field)}function i(){return t.normalizationField&&k.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),e=>e.getComputedNumericAtIndex(t.fieldIndex)}let s;if(null!=t.fieldIndex)s=i();else{if(!t.field)return;s=e()}const{valueRepresentation:r}=t;if(r){s=F(s,(t=>w(t,r)))}const a=t=>null===t||isNaN(t)||t===1/0||t===-1/0?f:t;this._attributeComputeMap.set(t.binding,F(s,a))}_createResources(){if(r(this._createResourcesPromise))return this._createResourcesPromise;this._getBlock(y),this._getBlock(m),M("Initializing AttributeStore");const e={shared:B.sharedArrayBuffer&&!("local"===this._client.type),size:this._size,blocks:a(this._blocks,(t=>({textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType})))},i=this._client.initialize(e,this._signal).catch((e=>{u(e)?this._createResourcesPromise=null:k.error(new t("mapview-attribute-store","Encountered an error during client initialization",e))}));return this._createResourcesPromise=i,i.then((()=>s(this._createResourcesPromise)?this._createResources():void 0)),i}_getBlock(t){const e=this._blocks[t];if(r(e))return e;M(`Initializing AttributeBlock at index ${t}`);const i=B.sharedArrayBuffer,s=this._client.type,a=new C(i,s,this._size,this._blockDescriptors[t]);return this._blocks[t]=a,this._createResourcesPromise=null,a}_expand(){if(this._size<this.config.maxTextureSize){const t=this._size<<=1;return M("Expanding block size to",t,this._blocks),o(this._blocks,(e=>e.expand(t))),this._createResourcesPromise=null,this._size=t,0}return k.error(new t("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(t,e,i,a){const o=this._filters[e],n=r(o)&&o.hash;if(!o&&!t)return!1;if(n===JSON.stringify(t))return!1;if(s(t)){if(!o)return!1;const t=1<<e+1,i=this._getBlock(0);return this._filters[e]=null,i.setComponentAllTexels(0,t),this.sendUpdates(),!0}const h=await this._getFilter(e,i);return await h.update(t,a),!0}async _getFilter(t,e){const i=this._filters[t];if(r(i))return i;const{default:s}=await import("./FeatureFilter.js"),a=new s({geometryType:e.geometryType,hasM:!1,hasZ:!1,timeInfo:e.timeInfo,fieldsIndex:new c(e.fields)});return this._filters[t]=a,a}isVisible(t){return!!(2&this._getBlock(0).getData(t,0))}getFilterFlags(t){let e=0;const i=z(t.getDisplayId());for(let a=0;a<this._filters.length;a++){const r=!!(i&1<<a),o=this._filters[a];e|=(!r||s(o)||o.check(t)?1:0)<<a}let r=0;if(this._idsToHighlight.size){const e=t.getObjectId();r=this.getHighlightFlag(e)}return e<<1|r}}export{v as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import r from"../../../../../core/Logger.js";import{toPt as t}from"../../../../../core/screenUtils.js";import{getWebGLCapabilities as o}from"../../../../webgl/capabilities.js";const s=8,l=s-2,a=r.getLogger("esri.views.2d.layers.features.support.rendererUtils"),n=e=>{if(!("visualVariables"in e)||!e.visualVariables||!e.visualVariables.length)return e;const r=e.clone(),t=r.visualVariables.map((e=>u(e)?p(e):e));return r.visualVariables=t,r};function i(e){return e.map((e=>u(e)?p(e.clone()):e))}function u(e){return("size"===e.type||"color"===e.type||"opacity"===e.type)&&null!=e.stops}function p(e){return e.stops=m(e.type,e.stops),e}function c(e,r,t){return(1-t)*e+t*r}function f(e,r){const[o,...s]=r,a=s.pop(),n=s[0].value,i=s[s.length-1].value,u=(i-n)/l,p=[];for(let l=n;l<i;l+=u){let o=0;for(;l>=s[o].value;)o++;const a=s[o],n=r[o-1],i=l-n.value,u=a.value===n.value?1:i/(a.value-n.value);if("color"===e){const e=s[o],t=r[o-1],a=e.color.clone();a.r=c(t.color.r,a.r,u),a.g=c(t.color.g,a.g,u),a.b=c(t.color.b,a.b,u),a.a=c(t.color.a,a.a,u),p.push({value:l,color:a,label:e.label})}else if("size"===e){const e=s[o],a=r[o-1],n=t(e.size),i=c(t(a.size),n,u);p.push({value:l,size:i,label:e.label})}else{const e=s[o],t=c(r[o-1].opacity,e.opacity,u);p.push({value:l,opacity:t,label:e.label})}}return[o,...p,a]}function b(e){const[r,...t]=e,o=t.pop();for(;t.length>l;){let e=0,r=0;for(let o=1;o<t.length;o++){const s=t[o-1],l=t[o],a=Math.abs(l.value-s.value);a>r&&(r=a,e=o)}t.splice(e,1)}return[r,...t,o]}function m(e,r){return r.length<=s?r:(a.warn(`Found ${r.length} Visual Variable stops, but MapView only supports ${s}. Displayed stops will be simplified.`),r.length>2*s?f(e,r):b(r))}function g(){if(has("heatmap-force-raster"))return"raster";const{supportsTextureFloat:e,supportsTextureHalfFloat:r,supportsColorBufferFloat:t,supportsColorBufferFloatBlend:s,supportsColorBufferHalfFloat:l}=o("2d");return e&&t&&s||r&&l?"symbol":has("heatmap-allow-raster-fallback")?"raster":"none"}function h(r){if(!r)return!0;switch(r.type){case"dot-density":if(!o("2d").supportsTextureFloat)return a.error(new e("webgl-missing-extension","Missing WebGL extension OES_Texture_Float which is required for DotDensity")),!1;break;case"heatmap":{const r=g();if("none"===r||"raster"===r&&!has("heatmap-force-raster")){const t=o("2d"),s=["supportsTextureFloat","supportsTextureHalfFloat","supportsColorBufferFloat","supportsColorBufferFloatBlend","supportsColorBufferHalfFloat"].filter((e=>!t[e])).join(", ");if("none"===r)return a.errorOnce(new e("webgl-missing-extension",`Missing WebGL${t.type} requirements for Heatmap: ${s}`)),!1;"raster"===r&&a.warnOnce(`Missing WebGL${t.type} requirements for accelerated Heatmap: ${s}. Feature support may be limited.`)}break}}return!0}export{g as getSupportedHeatmapRenderer,h as isRendererSupported,n as simplifyVVRenderer,i as simplifyVisualVariables};
5
+ import e from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import r from"../../../../../core/Logger.js";import{toPt as t}from"../../../../../core/screenUtils.js";import{getWebGLCapabilities as o}from"../../../../webgl/capabilities.js";const s=8,l=s-2,a=r.getLogger("esri.views.2d.layers.features.support.rendererUtils"),n=e=>{if(!("visualVariables"in e)||!e.visualVariables||!e.visualVariables.length)return e;const r=e.clone(),t=r.visualVariables.map((e=>u(e)?p(e):e));return r.visualVariables=t,r};function i(e){return e.map((e=>u(e)?p(e.clone()):e))}function u(e){return("size"===e.type||"color"===e.type||"opacity"===e.type)&&null!=e.stops}function p(e){return e.stops=m(e.type,e.stops??[]),e}function c(e,r,t){return(1-t)*e+t*r}function f(e,r){const[o,...s]=r,a=s.pop(),n=s[0].value,i=s[s.length-1].value,u=(i-n)/l,p=[];for(let l=n;l<i;l+=u){let o=0;for(;l>=s[o].value;)o++;const a=s[o],n=r[o-1],i=l-n.value,u=a.value===n.value?1:i/(a.value-n.value);if("color"===e){const e=s[o],t=r[o-1],a=e.color.clone();a.r=c(t.color.r,a.r,u),a.g=c(t.color.g,a.g,u),a.b=c(t.color.b,a.b,u),a.a=c(t.color.a,a.a,u),p.push({value:l,color:a,label:e.label})}else if("size"===e){const e=s[o],a=r[o-1],n=t(e.size),i=c(t(a.size),n,u);p.push({value:l,size:i,label:e.label})}else{const e=s[o],t=c(r[o-1].opacity,e.opacity,u);p.push({value:l,opacity:t,label:e.label})}}return[o,...p,a]}function b(e){const[r,...t]=e,o=t.pop();for(;t.length>l;){let e=0,r=0;for(let o=1;o<t.length;o++){const s=t[o-1],l=t[o],a=Math.abs(l.value-s.value);a>r&&(r=a,e=o)}t.splice(e,1)}return[r,...t,o]}function m(e,r){return r.length<=s?r:(a.warn(`Found ${r.length} Visual Variable stops, but MapView only supports ${s}. Displayed stops will be simplified.`),r.length>2*s?f(e,r):b(r))}function g(){if(has("heatmap-force-raster"))return"raster";const{supportsTextureFloat:e,supportsTextureHalfFloat:r,supportsColorBufferFloat:t,supportsColorBufferFloatBlend:s,supportsColorBufferHalfFloat:l}=o("2d");return e&&t&&s||r&&l?"symbol":has("heatmap-allow-raster-fallback")?"raster":"none"}function h(r){if(!r)return!0;switch(r.type){case"dot-density":if(!o("2d").supportsTextureFloat)return a.error(new e("webgl-missing-extension","Missing WebGL extension OES_Texture_Float which is required for DotDensity")),!1;break;case"heatmap":{const r=g();if("none"===r||"raster"===r&&!has("heatmap-force-raster")){const t=o("2d"),s=["supportsTextureFloat","supportsTextureHalfFloat","supportsColorBufferFloat","supportsColorBufferFloatBlend","supportsColorBufferHalfFloat"].filter((e=>!t[e])).join(", ");if("none"===r)return a.errorOnce(new e("webgl-missing-extension",`Missing WebGL${t.type} requirements for Heatmap: ${s}`)),!1;"raster"===r&&a.warnOnce(`Missing WebGL${t.type} requirements for accelerated Heatmap: ${s}. Feature support may be limited.`)}break}}return!0}export{g as getSupportedHeatmapRenderer,h as isRendererSupported,n as simplifyVVRenderer,i as simplifyVisualVariables};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import has from"../../../../../core/has.js";import{isAbortError as t}from"../../../../../core/promiseUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/Error.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators/subclass.js";import{create as s}from"../../../../../geometry/support/aaBoundingRect.js";import{FeatureTile as r}from"../../../engine/webgl/FeatureTile.js";import{simplifyVVRenderer as a}from"../support/rendererUtils.js";import o from"./BaseTileRenderer.js";import{convertVisualVariables as l}from"./support/visualVariablesUtils.js";import{WGLFeatureView as n}from"./support/WGLFeatureView.js";let u=class extends o{constructor(){super(...arguments),this.type="symbol"}install(e){const t=()=>this.notifyChange("updating"),i=new n(this.tileInfoView,this.layerView,this.layer,t);this.featuresView=i,e.addChild(i)}uninstall(e){e.removeChild(this.featuresView),this.featuresView.destroy(),this.featuresView=null}fetchResource(e,i){const{url:s}=e,r=this.featuresView.stage;try{return r.resourceManager.fetchResource(s,{signal:i.signal})}catch(a){return t(a)?Promise.resolve({width:0,height:0}):Promise.reject(a)}}isUpdating(){const e=super.isUpdating(),t=!this.featuresView||this.featuresView.isUpdating(),i=this.featuresView?.hasEmptyAttributeView(),s=e||t||e&&i;return has("esri-2d-log-updating")&&console.log(`Updating SymbolTileRenderer ${s}\n -> updatingTiles ${e}\n -> hasFeaturesView ${!!this.featuresView}\n -> updatingFeaturesView ${t}`),s}hitTest(e){return this.featuresView.hitTest(e)}supportsRenderer(e){return null!=e&&["simple","class-breaks","unique-value","dot-density","dictionary","heatmap","pie-chart"].includes(e.type)}onConfigUpdate(e){let t=null;if(e&&"visualVariables"in e){const i=(a(e).visualVariables||[]).map((e=>{const t=e.clone();return"normalizationField"in e&&(t.normalizationField=null),e.valueExpression&&"$view.scale"!==e.valueExpression&&(t.valueExpression=null,t.field="nop"),t}));t=l(i)}this.featuresView.setRendererInfo(e,t,this.layerView.featureEffect)}onTileData(e){const t=this.tiles.get(e.tileKey);t&&e.data&&this.featuresView.onTileData(t,e.data),this.layerView.view.labelManager.requestUpdate()}onTileError(e){const t=this.tiles.get(e.tileKey);t&&this.featuresView.onTileError(t)}forceAttributeTextureUpload(){this.featuresView.attributeView.forceTextureUpload()}lockGPUUploads(){this.featuresView.attributeView.lockTextureUpload(),this.tiles.forEach((e=>e.lock()))}unlockGPUUploads(){this.featuresView.attributeView.unlockTextureUpload(),this.tiles.forEach((e=>e.unlock()))}async getMaterialItems(e){return this.featuresView.getMaterialItems(e)}invalidateLabels(){this.featuresView.hasLabels&&this.layerView.view.labelManager.requestUpdate()}createTile(e){const t=this.tileInfoView.getTileBounds(s(),e),i=()=>this.layerView.view.labelManager.requestUpdate(),a=this.tileInfoView.getTileResolution(e.level),o=this.featuresView.attributeView;return new r(e,a,t[0],t[3],o,i)}disposeTile(e){this.featuresView.removeChild(e),e.destroy(),this.layerView.view.labelManager.requestUpdate()}};u=e([i("esri.views.2d.layers.features.tileRenderers.SymbolTileRenderer")],u);const p=u;export{p as default};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import has from"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{isAbortError as i}from"../../../../../core/promiseUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/Error.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{create as r}from"../../../../../geometry/support/aaBoundingRect.js";import{FeatureTile as a}from"../../../engine/webgl/FeatureTile.js";import{simplifyVVRenderer as o}from"../support/rendererUtils.js";import l from"./BaseTileRenderer.js";import{convertVisualVariables as n}from"./support/visualVariablesUtils.js";import{WGLFeatureView as u}from"./support/WGLFeatureView.js";let p=class extends l{constructor(){super(...arguments),this.type="symbol"}install(e){const t=()=>this.notifyChange("updating"),i=new u(this.tileInfoView,this.layerView,this.layer,t);this.featuresView=i,e.addChild(i)}uninstall(e){e.removeChild(this.featuresView),this.featuresView=t(this.featuresView)}fetchResource(e,t){const{url:s}=e,r=this.featuresView.stage;try{return r.resourceManager.fetchResource(s,{signal:t.signal})}catch(a){return i(a)?Promise.resolve({width:0,height:0}):Promise.reject(a)}}isUpdating(){const e=super.isUpdating(),t=!this.featuresView||this.featuresView.isUpdating(),i=this.featuresView?.hasEmptyAttributeView(),s=e||t||e&&i;return has("esri-2d-log-updating")&&console.log(`Updating SymbolTileRenderer ${s}\n -> updatingTiles ${e}\n -> hasFeaturesView ${!!this.featuresView}\n -> updatingFeaturesView ${t}`),s}hitTest(e){return this.featuresView.hitTest(e)}supportsRenderer(e){return null!=e&&["simple","class-breaks","unique-value","dot-density","dictionary","heatmap","pie-chart"].includes(e.type)}onConfigUpdate(e){let t=null;if(e&&"visualVariables"in e){const i=(o(e).visualVariables||[]).map((e=>{const t=e.clone();return"normalizationField"in e&&(t.normalizationField=null),e.valueExpression&&"$view.scale"!==e.valueExpression&&(t.valueExpression=null,t.field="nop"),t}));t=n(i)}this.featuresView.setRendererInfo(e,t,this.layerView.featureEffect)}onTileData(e){const t=this.tiles.get(e.tileKey);t&&e.data&&this.featuresView.onTileData(t,e.data),this.layerView.view.labelManager.requestUpdate()}onTileError(e){const t=this.tiles.get(e.tileKey);t&&this.featuresView.onTileError(t)}forceAttributeTextureUpload(){this.featuresView.attributeView.forceTextureUpload()}lockGPUUploads(){this.featuresView.attributeView.lockTextureUpload(),this.tiles.forEach((e=>e.lock()))}unlockGPUUploads(){this.featuresView.attributeView.unlockTextureUpload(),this.tiles.forEach((e=>e.unlock()))}async getMaterialItems(e){return this.featuresView.getMaterialItems(e)}invalidateLabels(){this.featuresView.hasLabels&&this.layerView.view.labelManager.requestUpdate()}createTile(e){const t=this.tileInfoView.getTileBounds(r(),e),i=()=>this.layerView.view.labelManager.requestUpdate(),s=this.tileInfoView.getTileResolution(e.level),o=this.featuresView.attributeView;return new a(e,s,t[0],t[3],o,i)}disposeTile(e){this.featuresView.removeChild(e),e.destroy(),this.layerView.view.labelManager.requestUpdate()}};p=e([s("esri.views.2d.layers.features.tileRenderers.SymbolTileRenderer")],p);const h=p;export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{drawHeatmap as t}from"../../../../../../renderers/support/heatmapUtils.js";class i{constructor(){this.gradient=null,this.height=512,this.width=512}render(i){t(i,512,this.intensities,this.gradient,this.minDensity,this.maxDensity)}}export{i as HeatmapSource};
5
+ import{drawHeatmap as t}from"../../../../../../renderers/support/heatmapUtils.js";class i{constructor(){this.gradient=null,this.height=512,this.intensities=null,this.width=512}render(i){t(i,512,this.intensities,this.gradient,this.minDensity,this.maxDensity)}}export{i as HeatmapSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../../../core/has.js";import{createResolver as e}from"../../../../../../core/promiseUtils.js";import{brushes as t}from"../../../../engine/brushes.js";import{FeatureContainer as s}from"../../../../engine/FeatureContainer.js";import{WGLDrawPhase as i}from"../../../../engine/webgl/enums.js";const r=has("featurelayer-order-by-server-enabled");class a extends s{constructor(e,t,s,i){super(e),this._hitTestsRequests=[],this._layer=s,this._layerView=t,this._onUpdate=i}renderChildren(e){if(this.attributeView.update(),this.hasAnimation){e.painter.effects.integrate.draw(e,e.attributeView)}super.renderChildren(e)}hasEmptyAttributeView(){return this.attributeView.isEmpty()}isUpdating(){return this.attributeView.isUpdating()}hitTest(t){let s=this._hitTestsRequests.find((({x:e,y:s})=>e===t.x&&s===t.y));const i=e();return s?s.resolvers.push(i):(s={x:t.x,y:t.y,resolvers:[i]},this._hitTestsRequests.push(s)),this.requestRender(),i.promise}onTileData(e,t){const s=r&&"orderBy"in this._layer&&this._layer.orderBy,i=s?.length&&!s[0].valueExpression&&s[0].field,a=s&&this._layerView.orderByFields===i;e.patch(t,a),this.contains(e)||this.addChild(e),this.requestRender()}onTileError(e){this.contains(e)||this.addChild(e)}updateTransitionProperties(e,t){super.updateTransitionProperties(e,t),this._layerView.featureEffectView.transitionStep(e,t),this._layerView.featureEffectView.transitioning&&this.requestRender()}doRender(e){const{minScale:t,maxScale:s}=this._layer,i=e.state.scale;i<=(t||1/0)&&i>=s&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}onAttributeStoreUpdate(){this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this._onUpdate()}get hasAnimation(){return this.hasLabels}setStencilReference(e){const{rendererSchema:t}=e.rendererInfo;if("dot-density"===t?.type&&t?.dotSize>1||"heatmap"===t?.type){const e=1;for(const t of this.children)t.stencilRef=t.key.level+e}else super.setStencilReference(e)}get hasLabels(){if("sublayers"in this._layer)return this._layer.sublayers.some((e=>e.labelingInfo&&e.labelingInfo.length&&e.labelsVisible));const e=this._layer.featureReduction,t=e&&"labelingInfo"in e&&e.labelsVisible&&e.labelingInfo&&e.labelingInfo.length;return this._layer.labelingInfo&&this._layer.labelingInfo.length&&this._layer.labelsVisible||!!t}prepareRenderPasses(e){const s=e.registerRenderPass({name:"label",brushes:[t.label],target:()=>this.hasLabels?this.children:null,drawPhase:i.LABEL|i.LABEL_ALPHA}),r=e.registerRenderPass({name:"geometry",brushes:[t.fill,t.dotDensity,t.line,t.marker,t.heatmap,t.pieChart,t.text],target:()=>this.children,enableDefaultDraw:()=>!this._layerView.featureEffectView.hasEffects,effects:[{apply:e.effects.outsideEffect,enable:()=>this._layerView.featureEffectView.hasEffects,args:()=>this._layerView.featureEffectView.excludedEffects},{apply:e.effects.insideEffect,enable:()=>this._layerView.featureEffectView.hasEffects,args:()=>this._layerView.featureEffectView.includedEffects},{apply:e.effects.hittest,enable:()=>!!this._hitTestsRequests.length,args:()=>this._hitTestsRequests}]}),a=e.registerRenderPass({name:"highlight",brushes:[t.fill,t.dotDensity,t.line,t.marker,t.pieChart,t.text],target:()=>this.children,drawPhase:i.HIGHLIGHT,enableDefaultDraw:()=>!1,effects:[{apply:e.effects.highlight,enable:()=>!!this._layerView.hasHighlight()}]});return[...super.prepareRenderPasses(e),r,a,s]}}export{a as WGLFeatureView};
5
+ import has from"../../../../../../core/has.js";import{createResolver as e}from"../../../../../../core/promiseUtils.js";import{brushes as t}from"../../../../engine/brushes.js";import{FeatureContainer as s}from"../../../../engine/FeatureContainer.js";import{WGLDrawPhase as i}from"../../../../engine/webgl/enums.js";const r=has("featurelayer-order-by-server-enabled");class a extends s{constructor(e,t,s,i){super(e),this._hitTestsRequests=[],this._layer=s,this._layerView=t,this._onUpdate=i}renderChildren(e){if(this.attributeView.update(),this.hasAnimation){e.painter.effects.integrate.draw(e,e.attributeView)}super.renderChildren(e)}hasEmptyAttributeView(){return this.attributeView.isEmpty()}isUpdating(){return this.attributeView.isUpdating()}hitTest(t){let s=this._hitTestsRequests.find((({x:e,y:s})=>e===t.x&&s===t.y));const i=e();return s?s.resolvers.push(i):(s={x:t.x,y:t.y,resolvers:[i]},this._hitTestsRequests.push(s)),this.requestRender(),i.promise}onTileData(e,t){const s=r&&"orderBy"in this._layer&&this._layer.orderBy,i=s&&s?.length&&!s[0].valueExpression&&s[0].field,a=!!s&&this._layerView.orderByFields===i;e.patch(t,a),this.contains(e)||this.addChild(e),this.requestRender()}onTileError(e){this.contains(e)||this.addChild(e)}updateTransitionProperties(e,t){super.updateTransitionProperties(e,t),this._layerView.featureEffectView.transitionStep(e,t),this._layerView.featureEffectView.transitioning&&this.requestRender()}doRender(e){const{minScale:t,maxScale:s}=this._layer,i=e.state.scale;i<=(t||1/0)&&i>=s&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}onAttributeStoreUpdate(){this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this._onUpdate()}get hasAnimation(){return this.hasLabels}setStencilReference(e){const{rendererSchema:t}=e.rendererInfo;if("dot-density"===t?.type&&t?.dotSize>1||"heatmap"===t?.type){const e=1;for(const t of this.children)t.stencilRef=t.key.level+e}else super.setStencilReference(e)}get hasLabels(){if("sublayers"in this._layer)return this._layer.sublayers.some((e=>!!e.labelingInfo?.length&&e.labelsVisible));const e=this._layer.featureReduction,t=e&&"labelingInfo"in e&&e.labelsVisible&&e.labelingInfo&&e.labelingInfo.length;return this._layer.labelingInfo&&this._layer.labelingInfo.length&&this._layer.labelsVisible||!!t}prepareRenderPasses(e){const s=e.registerRenderPass({name:"label",brushes:[t.label],target:()=>this.hasLabels?this.children:null,drawPhase:i.LABEL|i.LABEL_ALPHA}),r=e.registerRenderPass({name:"geometry",brushes:[t.fill,t.dotDensity,t.line,t.marker,t.heatmap,t.pieChart,t.text],target:()=>this.children,enableDefaultDraw:()=>!this._layerView.featureEffectView.hasEffects,effects:[{apply:e.effects.outsideEffect,enable:()=>this._layerView.featureEffectView.hasEffects,args:()=>this._layerView.featureEffectView.excludedEffects},{apply:e.effects.insideEffect,enable:()=>this._layerView.featureEffectView.hasEffects,args:()=>this._layerView.featureEffectView.includedEffects},{apply:e.effects.hittest,enable:()=>!!this._hitTestsRequests.length,args:()=>this._hitTestsRequests}]}),a=e.registerRenderPass({name:"highlight",brushes:[t.fill,t.dotDensity,t.line,t.marker,t.pieChart,t.text],target:()=>this.children,drawPhase:i.HIGHLIGHT,enableDefaultDraw:()=>!1,effects:[{apply:e.effects.highlight,enable:()=>!!this._layerView.hasHighlight()}]});return[...super.prepareRenderPasses(e),r,a,s]}}export{a as WGLFeatureView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{isNone as e}from"../../../../../../core/maybe.js";import{toPt as t,pt2px as s}from"../../../../../../core/screenUtils.js";import{premultiplyAlpha as n}from"../../../../engine/webgl/color.js";import{NAN_MAGIC_NUMBER as o}from"../../../../engine/webgl/definitions.js";import{WGLVVFlag as i}from"../../../../engine/webgl/enums.js";import{getTypeOfSizeVisualVariable as l}from"../../../../engine/webgl/visualVariablesUtils.js";function r(e,t){if(!e||!t)return e;switch(t){case"radius":case"distance":return 2*e;case"diameter":case"width":return e;case"area":return Math.sqrt(e)}return e}function a(e){return{value:e.value,size:t(e.size)}}function u(e){return e.map((e=>a(e)))}function p(e){if("string"==typeof e||"number"==typeof e)return t(e);const s=e;return{type:"size",expression:s.expression,stops:u(s.stops)}}const c=e=>{const t=[],n=[],i=u(e),l=i.length;for(let r=0;r<6;r++){const e=i[Math.min(r,l-1)];t.push(e.value),n.push(null==e.size?o:s(e.size))}return{values:new Float32Array(t),sizes:new Float32Array(n)}};function f(e){const t=e&&e.length>0?{}:null,s=t?{}:null;if(!t)return{vvFields:t,vvRanges:s};for(const n of e)if(n.field&&(t[n.type]=n.field),"size"===n.type){s.size||(s.size={});const e=n;switch(l(e)){case i.SIZE_MINMAX_VALUE:s.size.minMaxValue={minDataValue:e.minDataValue,maxDataValue:e.maxDataValue,minSize:p(e.minSize),maxSize:p(e.maxSize)};break;case i.SIZE_SCALE_STOPS:s.size.scaleStops={stops:u(e.stops)};break;case i.SIZE_FIELD_STOPS:if(e.levels){const t={};for(const s in e.levels)t[s]=c(e.levels[s]);s.size.fieldStops={type:"level-dependent",levels:t}}else s.size.fieldStops={type:"static",...c(e.stops)};break;case i.SIZE_UNIT_VALUE:s.size.unitValue={unit:e.valueUnit,valueRepresentation:e.valueRepresentation}}}else if("color"===n.type)s.color=g(n);else if("opacity"===n.type)s.opacity=m(n);else if("rotation"===n.type){const e=n;s.rotation={type:e.rotationType}}return{vvFields:t,vvRanges:s}}function m(e){const t={values:[0,0,0,0,0,0,0,0],opacities:[0,0,0,0,0,0,0,0]};if("string"==typeof e.field){if(!e.stops)return null;{if(e.stops.length>8)return null;const s=e.stops;for(let e=0;e<8;++e){const n=s[Math.min(e,s.length-1)];t.values[e]=n.value,t.opacities[e]=n.opacity}}}else{if(!(e.stops&&e.stops.length>=0))return null;{const s=e.stops&&e.stops.length>=0&&e.stops[0].opacity;for(let e=0;e<8;e++)t.values[e]=1/0,t.opacities[e]=s}}return t}function v(e,t,s){e[4*t+0]=s.r/255,e[4*t+1]=s.g/255,e[4*t+2]=s.b/255,e[4*t+3]=s.a}function g(t){if(e(t))return null;if(t.normalizationField)return null;const s={field:null,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};if("string"==typeof t.field){if(!t.stops)return null;{if(t.stops.length>8)return null;s.field=t.field;const e=t.stops;for(let t=0;t<8;++t){const n=e[Math.min(t,e.length-1)];s.values[t]=n.value,v(s.colors,t,n.color)}}}else{if(!(t.stops&&t.stops.length>=0))return null;{const e=t.stops&&t.stops.length>=0&&t.stops[0].color;for(let t=0;t<8;t++)s.values[t]=1/0,v(s.colors,t,e)}}for(let e=0;e<32;e+=4)n(s.colors,e,!0);return s}export{g as convertColorVariable,f as convertVisualVariables,r as getVisualVariableSizeValueRepresentationRatio,p as normalizeSizeElement,u as normalizeSizeStops,a as stopToSizeStop};
5
+ import{isNone as e}from"../../../../../../core/maybe.js";import{toPt as t,pt2px as s}from"../../../../../../core/screenUtils.js";import{premultiplyAlpha as n}from"../../../../engine/webgl/color.js";import{NAN_MAGIC_NUMBER as o}from"../../../../engine/webgl/definitions.js";import{WGLVVFlag as i}from"../../../../engine/webgl/enums.js";import{getTypeOfSizeVisualVariable as l}from"../../../../engine/webgl/visualVariablesUtils.js";function r(e,t){if(!e||!t)return e;switch(t){case"radius":case"distance":return 2*e;case"diameter":case"width":return e;case"area":return Math.sqrt(e)}return e}function a(e){return{value:e.value,size:t(e.size)}}function u(e){return(e??[]).map((e=>a(e)))}function p(e){if("string"==typeof e||"number"==typeof e)return t(e);const s=e;return{type:"size",expression:s.expression,stops:u(s.stops)}}const c=e=>{const t=[],n=[],i=u(e),l=i.length;for(let r=0;r<6;r++){const e=i[Math.min(r,l-1)];t.push(e.value),n.push(null==e.size?o:s(e.size))}return{values:new Float32Array(t),sizes:new Float32Array(n)}};function f(e){const t=e&&e.length>0?{}:null,s=t?{}:null;if(!t||!s)return{vvFields:t,vvRanges:s};for(const n of e)if(n.field&&(t[n.type]=n.field),"size"===n.type){s.size||(s.size={});const e=n;switch(l(e)){case i.SIZE_MINMAX_VALUE:s.size.minMaxValue={minDataValue:e.minDataValue,maxDataValue:e.maxDataValue,minSize:p(e.minSize),maxSize:p(e.maxSize)};break;case i.SIZE_SCALE_STOPS:s.size.scaleStops={stops:u(e.stops)};break;case i.SIZE_FIELD_STOPS:if(e.levels){const t={};for(const s in e.levels)t[s]=c(e.levels[s]);s.size.fieldStops={type:"level-dependent",levels:t}}else s.size.fieldStops={type:"static",...c(e.stops)};break;case i.SIZE_UNIT_VALUE:s.size.unitValue={unit:e.valueUnit,valueRepresentation:e.valueRepresentation??void 0}}}else if("color"===n.type)s.color=g(n);else if("opacity"===n.type)s.opacity=m(n);else if("rotation"===n.type){const e=n;s.rotation={type:e.rotationType}}return{vvFields:t,vvRanges:s}}function m(e){const t={values:[0,0,0,0,0,0,0,0],opacities:[0,0,0,0,0,0,0,0]};if("string"==typeof e.field){if(!e.stops)return null;{if(e.stops.length>8)return null;const s=e.stops;for(let e=0;e<8;++e){const n=s[Math.min(e,s.length-1)];t.values[e]=n.value,t.opacities[e]=n.opacity}}}else{if(!(e.stops&&e.stops.length>=0))return null;{const s=e.stops&&e.stops.length>=0?e.stops[0].opacity:0;for(let e=0;e<8;e++)t.values[e]=1/0,t.opacities[e]=s}}return t}function v(e,t,s){e[4*t+0]=s.r/255,e[4*t+1]=s.g/255,e[4*t+2]=s.b/255,e[4*t+3]=s.a}function g(t){if(e(t))return null;if(t.normalizationField)return null;const s={field:null,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};if("string"==typeof t.field){if(!t.stops)return null;{if(t.stops.length>8)return null;s.field=t.field;const e=t.stops;for(let t=0;t<8;++t){const n=e[Math.min(t,e.length-1)];s.values[t]=n.value,v(s.colors,t,n.color)}}}else{if(!(t.stops&&t.stops.length>=0))return null;{const e=t.stops&&t.stops.length>=0&&t.stops[0].color;for(let t=0;t<8;t++)s.values[t]=1/0,v(s.colors,t,e)}}for(let e=0;e<32;e+=4)n(s.colors,e,!0);return s}export{g as convertColorVariable,f as convertVisualVariables,r as getVisualVariableSizeValueRepresentationRatio,p as normalizeSizeElement,u as normalizeSizeStops,a as stopToSizeStop};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureContainer as e}from"../../engine/FeatureContainer.js";import s from"./GraphicBoundsRenderer.js";import{CompareFunction as t}from"../../../webgl/enums.js";let r=class extends e{constructor(e){super(e),this.hasHighlight=()=>!0}destroy(){super.destroy(),this._boundsRenderer&&(this._boundsRenderer.destroy(),this._boundsRenderer=null)}enableRenderingBounds(e){this._boundsRenderer=new s(e),this.requestRender()}get hasLabels(){return!1}onTileData(e,s){e.patch(s),this.contains(e)||this.addChild(e),this.requestRender()}onTileError(e){e.clear(),this.contains(e)||this.addChild(e)}_renderChildren(e,s){for(const r of this.children)r.isReady&&r.hasData&&(r.commit(e),e.context.setStencilFunction(t.EQUAL,r.stencilRef,255),r._displayList.replay(e,r,s))}};export{r as default};
5
+ import{destroyMaybe as e}from"../../../../core/maybe.js";import{FeatureContainer as t}from"../../engine/FeatureContainer.js";import r from"./GraphicBoundsRenderer.js";import{CompareFunction as s}from"../../../webgl/enums.js";let n=class extends t{constructor(e){super(e),this.hasHighlight=()=>!0}destroy(){super.destroy(),this._boundsRenderer=e(this._boundsRenderer)}enableRenderingBounds(e){this._boundsRenderer=new r(e),this.requestRender()}get hasLabels(){return!1}onTileData(e,t){e.patch(t),this.contains(e)||this.addChild(e),this.requestRender()}onTileError(e){e.clear(),this.contains(e)||this.addChild(e)}_renderChildren(e,t){for(const r of this.children)r.isReady&&r.hasData&&(r.commit(e),e.context.setStencilFunction(s.EQUAL,r.stencilRef,255),r.getDisplayList().replay(e,r,t))}};export{n as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{g as t,m as e,h as s,d as r,r as i}from"../../../../chunks/mat3.js";import{c as o}from"../../../../chunks/mat3f32.js";import{f as a}from"../../../../chunks/vec2f32.js";import{f as n}from"../../../../chunks/vec3f32.js";import{normalizeMapX as f}from"../../../../geometry/support/normalizeUtils.js";import{DisplayObject as l}from"../../engine/DisplayObject.js";import{createProgramDescriptor as u}from"../../engine/webgl/Utils.js";import{BufferObject as c}from"../../../webgl/BufferObject.js";import{BlendFactor as _,PrimitiveType as h,DataType as m,Usage as d}from"../../../webgl/enums.js";import{VertexArrayObject as p}from"../../../webgl/VertexArrayObject.js";const g=Math.PI/180,v=4;class x extends l{constructor(t){super(),this._dvsMat3=o(),this._localOrigin={x:0,y:0},this._getBounds=t}destroy(){this._vao&&(this._vao.dispose(!0),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program&&(this._program.dispose(),this._program=null)}doRender(t){const{context:e}=t,s=this._getBounds();if(s.length<1)return;this._createShaderProgram(e),this._updateMatricesAndLocalOrigin(t),this._updateBufferData(e,s),e.setBlendingEnabled(!0),e.setDepthTestEnabled(!1),e.setStencilWriteMask(0),e.setStencilTestEnabled(!1),e.setBlendFunction(_.ONE,_.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0);const r=this._program;e.bindVAO(this._vao),e.useProgram(r),r.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),e.gl.lineWidth(1),e.drawElements(h.LINES,8*s.length,m.UNSIGNED_INT,0),e.bindVAO()}_createTransforms(){return{dvs:o()}}_createShaderProgram(t){if(this._program)return;const e="precision highp float;\n uniform mat3 u_dvsMat3;\n\n attribute vec2 a_position;\n\n void main() {\n mediump vec3 pos = u_dvsMat3 * vec3(a_position, 1.0);\n gl_Position = vec4(pos.xy, 0.0, 1.0);\n }",s="precision mediump float;\n void main() {\n gl_FragColor = vec4(0.75, 0.0, 0.0, 0.75);\n }";this._program=t.programCache.acquire(e,s,b().attributes)}_updateMatricesAndLocalOrigin(o){const{state:l}=o,{displayMat3:u,size:c,resolution:_,pixelRatio:h,rotation:m,viewpoint:d}=l,p=g*m,{x:v,y:x}=d.targetGeometry,b=f(v,l.spatialReference);this._localOrigin.x=b,this._localOrigin.y=x;const y=h*c[0],B=h*c[1],M=_*y,A=_*B,O=t(this._dvsMat3);e(O,O,u),s(O,O,a(y/2,B/2)),r(O,O,n(c[0]/M,-B/A,1)),i(O,O,-p)}_updateBufferData(t,e){const{x:s,y:r}=this._localOrigin,i=2*v*e.length,o=new Float32Array(i),a=new Uint32Array(8*e.length);let n=0,f=0;for(const l of e)l&&(o[2*n+0]=l[0]-s,o[2*n+1]=l[1]-r,o[2*n+2]=l[0]-s,o[2*n+3]=l[3]-r,o[2*n+4]=l[2]-s,o[2*n+5]=l[3]-r,o[2*n+6]=l[2]-s,o[2*n+7]=l[1]-r,a[f+0]=n+0,a[f+1]=n+3,a[f+2]=n+3,a[f+3]=n+2,a[f+4]=n+2,a[f+5]=n+1,a[f+6]=n+1,a[f+7]=n+0,n+=4,f+=8);if(this._vertexBuffer?this._vertexBuffer.setData(o.buffer):this._vertexBuffer=c.createVertex(t,d.DYNAMIC_DRAW,o.buffer),this._indexBuffer?this._indexBuffer.setData(a):this._indexBuffer=c.createIndex(t,d.DYNAMIC_DRAW,a),!this._vao){const e=b();this._vao=new p(t,e.attributes,e.bufferLayouts,{geometry:this._vertexBuffer},this._indexBuffer)}}}const b=()=>u("bounds",{geometry:[{location:0,name:"a_position",count:2,type:m.FLOAT}]});export{x as default};
5
+ import{disposeMaybe as t}from"../../../../core/maybe.js";import{g as e,m as r,h as s,d as i,r as o}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f32.js";import{f as n}from"../../../../chunks/vec2f32.js";import{f}from"../../../../chunks/vec3f32.js";import{normalizeMapX as l}from"../../../../geometry/support/normalizeUtils.js";import{DisplayObject as u}from"../../engine/DisplayObject.js";import{createProgramDescriptor as _}from"../../engine/webgl/Utils.js";import{BufferObject as c}from"../../../webgl/BufferObject.js";import{BlendFactor as h,PrimitiveType as m,DataType as d,Usage as p}from"../../../webgl/enums.js";import{VertexArrayObject as g}from"../../../webgl/VertexArrayObject.js";const v=Math.PI/180,x=4;class b extends u{constructor(t){super(),this._program=null,this._vao=null,this._vertexBuffer=null,this._indexBuffer=null,this._dvsMat3=a(),this._localOrigin={x:0,y:0},this._getBounds=t}destroy(){this._vao&&(this._vao.dispose(!0),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program=t(this._program)}doRender(t){const{context:e}=t,r=this._getBounds();if(r.length<1)return;this._createShaderProgram(e),this._updateMatricesAndLocalOrigin(t),this._updateBufferData(e,r),e.setBlendingEnabled(!0),e.setDepthTestEnabled(!1),e.setStencilWriteMask(0),e.setStencilTestEnabled(!1),e.setBlendFunction(h.ONE,h.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0);const s=this._program;e.bindVAO(this._vao),e.useProgram(s),s.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),e.gl.lineWidth(1),e.drawElements(m.LINES,8*r.length,d.UNSIGNED_INT,0),e.bindVAO()}_createTransforms(){return{dvs:a()}}_createShaderProgram(t){if(this._program)return;const e="precision highp float;\n uniform mat3 u_dvsMat3;\n\n attribute vec2 a_position;\n\n void main() {\n mediump vec3 pos = u_dvsMat3 * vec3(a_position, 1.0);\n gl_Position = vec4(pos.xy, 0.0, 1.0);\n }",r="precision mediump float;\n void main() {\n gl_FragColor = vec4(0.75, 0.0, 0.0, 0.75);\n }";this._program=t.programCache.acquire(e,r,y().attributes)}_updateMatricesAndLocalOrigin(t){const{state:a}=t,{displayMat3:u,size:_,resolution:c,pixelRatio:h,rotation:m,viewpoint:d}=a,p=v*m,{x:g,y:x}=d.targetGeometry,b=l(g,a.spatialReference);this._localOrigin.x=b,this._localOrigin.y=x;const y=h*_[0],B=h*_[1],M=c*y,j=c*B,A=e(this._dvsMat3);r(A,A,u),s(A,A,n(y/2,B/2)),i(A,A,f(_[0]/M,-B/j,1)),o(A,A,-p)}_updateBufferData(t,e){const{x:r,y:s}=this._localOrigin,i=2*x*e.length,o=new Float32Array(i),a=new Uint32Array(8*e.length);let n=0,f=0;for(const l of e)l&&(o[2*n+0]=l[0]-r,o[2*n+1]=l[1]-s,o[2*n+2]=l[0]-r,o[2*n+3]=l[3]-s,o[2*n+4]=l[2]-r,o[2*n+5]=l[3]-s,o[2*n+6]=l[2]-r,o[2*n+7]=l[1]-s,a[f+0]=n+0,a[f+1]=n+3,a[f+2]=n+3,a[f+3]=n+2,a[f+4]=n+2,a[f+5]=n+1,a[f+6]=n+1,a[f+7]=n+0,n+=4,f+=8);if(this._vertexBuffer?this._vertexBuffer.setData(o.buffer):this._vertexBuffer=c.createVertex(t,p.DYNAMIC_DRAW,o.buffer),this._indexBuffer?this._indexBuffer.setData(a):this._indexBuffer=c.createIndex(t,p.DYNAMIC_DRAW,a),!this._vao){const e=y();this._vao=new g(t,e.attributes,e.bufferLayouts,{geometry:this._vertexBuffer},this._indexBuffer)}}}const y=()=>_("bounds",{geometry:[{location:0,name:"a_position",count:2,type:d.FLOAT}]});export{b as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{bidiText as e}from"../../../../core/BidiText.js";import{unwrap as t}from"../../../../core/maybe.js";import{pt2px as n}from"../../../../core/screenUtils.js";import i from"../../../../geometry/Polygon.js";import{create as r}from"../../../../geometry/support/aaBoundingRect.js";import{getInfo as o}from"../../../../geometry/support/spatialReferenceUtils.js";import{getXAnchorDirection as s,getYAnchorDirection as a}from"../../engine/webgl/alignmentUtils.js";import{GLYPH_SIZE as l,MAGIC_LABEL_LINE_HEIGHT as m}from"../../engine/webgl/definitions.js";import{shapeGlyphs as c}from"../../engine/webgl/mesh/templates/shapingUtils.js";const f=512,g=50;function u(e,t){const n=o(t);if(!n)return null;const[i,s]=n.valid;return e[2]>s?[r([e[0],e[1],s,e[3]]),r([i,e[1],i+e[2]-s,e[3]])]:e[0]<i?[r([i,e[1],e[2],e[3]]),r([s-(i-e[0]),e[1],s,e[3]])]:null}function p(e){return"text"===e||"esriTS"===e}function h(e){return"simple-marker"===e||"picture-marker"===e||"esriSMS"===e||"esriPMS"===e}function y(e){switch(t(e.geometry).type){case"point":case"multipoint":return 0;case"polyline":return 1;case"polygon":case"extent":return 2}return 0}function d(t,i,r){if(!r||0===r.glyphMosaicItems.length)return t;const o=e(i.text)[1],f=r.glyphMosaicItems,g=c(f,o,{scale:n(i.font.size)/l,angle:i.angle??0,xOffset:i.xoffset??0,yOffset:i.yoffset??0,hAlign:s(i.horizontalAlignment||"center"),vAlign:a(i.verticalAlignment||"baseline"),maxLineWidth:Math.max(32,Math.min(i.lineWidth||512,512)),lineHeight:m*Math.max(.25,Math.min(i.lineHeight||1,4)),decoration:i.font.decoration||"none",isCIM:!1,hasBackground:!!i.backgroundColor,borderLineSize:i.borderLineSize}).bounds;return t[0]=n(g.x-g.halfWidth),t[1]=n(g.y-g.halfHeight),t[2]=n(g.width),t[3]=n(g.height),t}function x(e){if(!e)return null;const{xmin:t,ymin:n,xmax:r,ymax:o,spatialReference:s}=e;return new i({rings:[[[t,n],[t,o],[r,o],[r,n],[t,n]]],spatialReference:s})}export{g as PIXEL_BUFFER,f as TILE_SIZE,d as getTextSymbolSize,y as graphicGeometryToNumber,u as intersectingInternationalDateline,h as isMarkerSymbol,p as isTextSymbol,x as polygonFromExtent};
5
+ import{bidiText as e}from"../../../../core/BidiText.js";import{unwrap as t}from"../../../../core/maybe.js";import{pt2px as n}from"../../../../core/screenUtils.js";import i from"../../../../geometry/Polygon.js";import{create as r}from"../../../../geometry/support/aaBoundingRect.js";import{getInfo as o}from"../../../../geometry/support/spatialReferenceUtils.js";import{getXAnchorDirection as s,getYAnchorDirection as a}from"../../engine/webgl/alignmentUtils.js";import{GLYPH_SIZE as l,MAGIC_LABEL_LINE_HEIGHT as m}from"../../engine/webgl/definitions.js";import{shapeGlyphs as c}from"../../engine/webgl/mesh/templates/shapingUtils.js";const f=512,g=50;function u(e,t){const n=o(t);if(!n)return null;const[i,s]=n.valid;return e[2]>s?[r([e[0],e[1],s,e[3]]),r([i,e[1],i+e[2]-s,e[3]])]:e[0]<i?[r([i,e[1],e[2],e[3]]),r([s-(i-e[0]),e[1],s,e[3]])]:null}function p(e){return"text"===e||"esriTS"===e}function h(e){return"simple-marker"===e||"picture-marker"===e||"esriSMS"===e||"esriPMS"===e}function y(e){switch(t(e.geometry).type){case"point":case"multipoint":return 0;case"polyline":return 1;case"polygon":case"extent":return 2}return 0}function d(t,i,r){if(!r?.glyphMosaicItems?.length)return t;const o=e(i.text)[1],f=r.glyphMosaicItems,g=c(f,o,{scale:n(i.font.size)/l,angle:i.angle??0,xOffset:i.xoffset??0,yOffset:i.yoffset??0,hAlign:s(i.horizontalAlignment||"center"),vAlign:a(i.verticalAlignment||"baseline"),maxLineWidth:Math.max(32,Math.min(i.lineWidth||512,512)),lineHeight:m*Math.max(.25,Math.min(i.lineHeight||1,4)),decoration:i.font.decoration||"none",isCIM:!1,hasBackground:!!i.backgroundColor,borderLineSize:i.borderLineSize}).bounds;return t[0]=n(g.x-g.halfWidth),t[1]=n(g.y-g.halfHeight),t[2]=n(g.width),t[3]=n(g.height),t}function x(e){if(!e)return null;const{xmin:t,ymin:n,xmax:r,ymax:o,spatialReference:s}=e;return new i({rings:[[[t,n],[t,o],[r,o],[r,n],[t,n]]],spatialReference:s})}export{g as PIXEL_BUFFER,f as TILE_SIZE,d as getTextSymbolSize,y as graphicGeometryToNumber,u as intersectingInternationalDateline,h as isMarkerSymbol,p as isTextSymbol,x as polygonFromExtent};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import r from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{isSome as s}from"../../../../core/maybe.js";import{isAbortError as a}from"../../../../core/promiseUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{mosaicPixelData as n}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{BitmapContainer as l}from"../../engine/BitmapContainer.js";import{Container as c}from"../../engine/Container.js";import h from"../../engine/ImageryBitmapSource.js";import m from"../support/ExportStrategy.js";let d=class extends r{constructor(){super(...arguments),this.attached=!1,this.container=new c,this.updateRequested=!1,this.type="imagery",this._bitmapView=new l}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(e){this.strategy.update(e).catch((e=>{a(e)||i.getLogger(this.declaredClass).error(e)}))}hitTest(e){return new t({attributes:{},geometry:e.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const e=this.layer.version>=10,t=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,r=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new m({container:this._bitmapView,imageNormalizationSupported:e,imageMaxHeight:t,imageMaxWidth:r,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports((async e=>{if(e.source instanceof HTMLImageElement)return;const t=await this.layer.applyRenderer({extent:e.source.extent,pixelBlock:e.source.originalPixelBlock??e.source.pixelBlock}),r=e.source;r.filter=e=>this.layer.pixelFilter?this.layer.applyFilter(e):{...t,extent:r.extent}})).catch((e=>{a(e)||i.getLogger(this.declaredClass).error(e)}))}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const e=this.strategy.bitmaps;if(1===e.length&&e[0].source)return{extent:e[0].source.extent,pixelBlock:e[0].source.originalPixelBlock};if(e.length>1){const t=this.view.extent,r=e.map((e=>e.source)).filter((e=>e.extent&&e.extent.intersects(t))).map((e=>({extent:e.extent,pixelBlock:e.originalPixelBlock}))),i=n(r,t);return s(i)?{extent:i.extent,pixelBlock:i.pixelBlock}:null}return null}_fetchImage(e,t,r,i){return(i=i||{}).timeExtent=this.timeExtent,i.requestAsImageElement=!0,this.layer.fetchImage(e,t,r,i).then((e=>e.imageOrCanvasElement?e.imageOrCanvasElement:this.layer.applyRenderer(e.pixelData,{signal:i.signal}).then((t=>{const r=new h(t.pixelBlock,t.extent?.clone(),e.pixelData.pixelBlock);return r.filter=e=>this.layer.applyFilter(e),r}))))}};e([o()],d.prototype,"attached",void 0),e([o()],d.prototype,"container",void 0),e([o()],d.prototype,"layer",void 0),e([o()],d.prototype,"strategy",void 0),e([o()],d.prototype,"timeExtent",void 0),e([o()],d.prototype,"view",void 0),e([o()],d.prototype,"updateRequested",void 0),e([o()],d.prototype,"updating",null),e([o()],d.prototype,"type",void 0),d=e([p("esri.views.2d.layers.imagery.ImageryView2D")],d);const u=d;export{u as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import r from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{isSome as s}from"../../../../core/maybe.js";import{isAbortError as a}from"../../../../core/promiseUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{mosaicPixelData as p}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{BitmapContainer as l}from"../../engine/BitmapContainer.js";import{Container as c}from"../../engine/Container.js";import h from"../../engine/ImageryBitmapSource.js";import m from"../support/ExportStrategy.js";let d=class extends r{constructor(){super(...arguments),this.attached=!1,this.container=new c,this.updateRequested=!1,this.type="imagery",this._bitmapView=new l}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(e){this.strategy.update(e).catch((e=>{a(e)||i.getLogger(this.declaredClass).error(e)}))}hitTest(e){return new t({attributes:{},geometry:e.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const e=this.layer.version>=10,t=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,r=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new m({container:this._bitmapView,imageNormalizationSupported:e,imageMaxHeight:t,imageMaxWidth:r,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports((async e=>{const{source:t}=e;if(!t||t instanceof HTMLImageElement)return;const r=await this.layer.applyRenderer({extent:t.extent,pixelBlock:t.originalPixelBlock??t.pixelBlock});t.filter=e=>this.layer.pixelFilter?this.layer.applyFilter(e):{...r,extent:t.extent}})).catch((e=>{a(e)||i.getLogger(this.declaredClass).error(e)}))}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const e=this.strategy.bitmaps;if(1===e.length&&e[0].source)return{extent:e[0].source.extent,pixelBlock:e[0].source.originalPixelBlock};if(e.length>1){const t=this.view.extent,r=e.map((e=>e.source)).filter((e=>e.extent&&e.extent.intersects(t))).map((e=>({extent:e.extent,pixelBlock:e.originalPixelBlock}))),i=p(r,t);return s(i)?{extent:i.extent,pixelBlock:i.pixelBlock}:null}return null}_fetchImage(e,t,r,i){return(i=i||{}).timeExtent=this.timeExtent,i.requestAsImageElement=!0,this.layer.fetchImage(e,t,r,i).then((e=>e.imageOrCanvasElement?e.imageOrCanvasElement:this.layer.applyRenderer(e.pixelData,{signal:i.signal}).then((t=>{const r=new h(t.pixelBlock,t.extent?.clone(),e.pixelData.pixelBlock);return r.filter=e=>this.layer.applyFilter(e),r}))))}};e([o()],d.prototype,"attached",void 0),e([o()],d.prototype,"container",void 0),e([o()],d.prototype,"layer",void 0),e([o()],d.prototype,"strategy",void 0),e([o()],d.prototype,"timeExtent",void 0),e([o()],d.prototype,"view",void 0),e([o()],d.prototype,"updateRequested",void 0),e([o()],d.prototype,"updating",null),e([o()],d.prototype,"type",void 0),d=e([n("esri.views.2d.layers.imagery.ImageryView2D")],d);const u=d;export{u as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{g as e,h as t,d as r}from"../../../../chunks/mat3.js";import{c as s}from"../../../../chunks/mat3f32.js";import{BufferObject as a}from"../../../webgl/BufferObject.js";import"../../../webgl/FramebufferObject.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/scheduling.js";import"../../../webgl/checkWebGLError.js";import"../../../webgl/context-util.js";import{DataType as i,BlendFactor as o,PrimitiveType as n,Usage as m}from"../../../webgl/enums.js";import"../../../../chunks/builtins.js";import"../../../webgl/Texture.js";import{VertexArrayObject as f}from"../../../webgl/VertexArrayObject.js";import{DisplayObject as h}from"../../engine/DisplayObject.js";import{VertexElementDescriptor as c}from"../../../webgl/VertexElementDescriptor.js";const _={geometry:[new c("a_PositionAndFlags",3,i.SHORT,0,6)]},u=new Map;u.set("a_PositionAndFlags",0);const l={vsPath:"debug/overlay",fsPath:"debug/overlay",attributes:u};class d extends h{constructor(e){super(),this._conf=e}static makeFlags(e,t){return e|t<<2}_createTransforms(){return{dvs:s()}}doRender(e){this._updateTransforms(e),this._ensureResources(e);const{context:t}=e;t.useProgram(this._program),this._program.setUniformMatrix3fv("u_dvsMat3",this.transforms.dvs),this._program.setUniform4fv("u_colors",this._conf.getColors(e)),this._program.setUniform1fv("u_opacities",this._conf.getOpacities(e));const{vertexData:r,indexData:s}=this._conf.getMesh(e);this._vertexBuffer.setData(r),this._indexBuffer.setData(s),t.bindVAO(this._vertexArray),t.setBlendingEnabled(!0),t.setBlendFunction(o.ONE,o.ONE_MINUS_SRC_ALPHA),t.setDepthTestEnabled(!1),t.setStencilTestEnabled(!1),t.setColorMask(!0,!0,!0,!0),t.drawElements(n.TRIANGLES,s.length,i.UNSIGNED_INT,0)}onDetach(){this._vertexArray&&(this._vertexArray.dispose(),this._vertexArray=null)}_updateTransforms(s){e(this.transforms.dvs),t(this.transforms.dvs,this.transforms.dvs,[-1,1]),r(this.transforms.dvs,this.transforms.dvs,[2/s.state.size[0],-2/s.state.size[1],1])}_ensureResources(e){const{context:t}=e;this._program||(this._program=e.painter.materialManager.getProgram(l)),this._vertexBuffer||(this._vertexBuffer=a.createVertex(t,m.STREAM_DRAW)),this._indexBuffer||(this._indexBuffer=a.createIndex(t,m.STREAM_DRAW)),this._vertexArray||(this._vertexArray=new f(t,u,_,{geometry:this._vertexBuffer},this._indexBuffer))}}export{d as default};
5
+ import{disposeMaybe as e}from"../../../../core/maybe.js";import{g as t,h as r,d as s}from"../../../../chunks/mat3.js";import{c as o}from"../../../../chunks/mat3f32.js";import{BufferObject as a}from"../../../webgl/BufferObject.js";import"../../../webgl/FramebufferObject.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/scheduling.js";import"../../../webgl/checkWebGLError.js";import"../../../webgl/context-util.js";import{DataType as i,BlendFactor as n,PrimitiveType as m,Usage as f}from"../../../webgl/enums.js";import"../../../../chunks/builtins.js";import"../../../webgl/Texture.js";import{VertexArrayObject as c}from"../../../webgl/VertexArrayObject.js";import{DisplayObject as h}from"../../engine/DisplayObject.js";import{VertexElementDescriptor as _}from"../../../webgl/VertexElementDescriptor.js";const u={geometry:[new _("a_PositionAndFlags",3,i.SHORT,0,6)]},d=new Map;d.set("a_PositionAndFlags",0);const g={vsPath:"debug/overlay",fsPath:"debug/overlay",attributes:d};class l extends h{constructor(e){super(),this._conf=e}static makeFlags(e,t){return e|t<<2}_createTransforms(){return{dvs:o()}}doRender(e){this._updateTransforms(e),this._ensureResources(e);const{context:t}=e;t.useProgram(this._program),this._program.setUniformMatrix3fv("u_dvsMat3",this.transforms.dvs),this._program.setUniform4fv("u_colors",this._conf.getColors(e)),this._program.setUniform1fv("u_opacities",this._conf.getOpacities(e));const{vertexData:r,indexData:s}=this._conf.getMesh(e);this._vertexBuffer.setData(r),this._indexBuffer.setData(s),t.bindVAO(this._vertexArray),t.setBlendingEnabled(!0),t.setBlendFunction(n.ONE,n.ONE_MINUS_SRC_ALPHA),t.setDepthTestEnabled(!1),t.setStencilTestEnabled(!1),t.setColorMask(!0,!0,!0,!0),t.drawElements(m.TRIANGLES,s.length,i.UNSIGNED_INT,0)}onDetach(){this._vertexArray=e(this._vertexArray)}_updateTransforms(e){t(this.transforms.dvs),r(this.transforms.dvs,this.transforms.dvs,[-1,1]),s(this.transforms.dvs,this.transforms.dvs,[2/e.state.size[0],-2/e.state.size[1],1])}_ensureResources(e){const{context:t}=e;this._program||(this._program=e.painter.materialManager.getProgram(g)),this._vertexBuffer||(this._vertexBuffer=a.createVertex(t,f.STREAM_DRAW)),this._indexBuffer||(this._indexBuffer=a.createIndex(t,f.STREAM_DRAW)),this._vertexArray||(this._vertexArray=new c(t,d,u,{geometry:this._vertexBuffer},this._indexBuffer))}}export{l as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Accessor.js";import"../../../../core/has.js";import{debounce as i,throwIfAborted as o,throwIfAbortError as r,eachAlways as s}from"../../../../core/promiseUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as p,toExtent as m}from"../../../../geometry/support/aaBoundingRect.js";import{getInfo as l}from"../../../../geometry/support/spatialReferenceUtils.js";import h from"../../../../layers/support/TileInfo.js";import{getOuterSize as d,getBBox as c}from"../../viewStateUtils.js";import{Bitmap as u}from"../../engine/Bitmap.js";import g from"../../tiling/TileInfoView.js";import f from"../../tiling/TileKey.js";const y=p(),x=[0,0],S=new f(0,0,0,0),_={container:null,fetchSource:null,requestUpdate:null,imageMaxWidth:2048,imageMaxHeight:2048,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1};let w=class extends e{constructor(t){super(t),this._imagePromise=null,this.bitmaps=[],this.hidpi=_.hidpi,this.imageMaxWidth=_.imageMaxWidth,this.imageMaxHeight=_.imageMaxHeight,this.imageRotationSupported=_.imageRotationSupported,this.imageNormalizationSupported=_.imageNormalizationSupported,this.update=i((async(t,e)=>{if(o(e),!t.stationary||this.destroyed)return;const i=t.state,s=l(i.spatialReference),a=this.hidpi?t.pixelRatio:1,n=this.imageNormalizationSupported&&i.worldScreenWidth&&i.worldScreenWidth<i.size[0];n?(x[0]=i.worldScreenWidth,x[1]=i.size[1]):this.imageRotationSupported?(x[0]=i.size[0],x[1]=i.size[1]):d(x,i);const p=Math.floor(x[0]*a)>this.imageMaxWidth||Math.floor(x[1]*a)>this.imageMaxHeight,m=s&&(i.extent.xmin<s.valid[0]||i.extent.xmax>s.valid[1]),h=!this.imageNormalizationSupported&&m,c=!p&&!h,u=this.imageRotationSupported?i.rotation:0,g=this.container.children.slice();if(c){const t=n?i.paddedViewState.center:i.center;this._imagePromise&&console.error("Image promise was not defined!"),this._imagePromise=this._singleExport(i,x,t,i.resolution,u,a,e)}else{let t=Math.min(this.imageMaxWidth,this.imageMaxHeight);h&&(t=Math.min(i.worldScreenWidth,t)),this._imagePromise=this._tiledExport(i,t,a,e)}try{const t=await this._imagePromise;o(e);const i=[];if(this._imagePromise=null,this.destroyed)return;this.bitmaps=t??[];for(const e of g)t.includes(e)||i.push(e.fadeOut().then((()=>{e.remove(),e.destroy()})));for(const e of t)i.push(e.fadeIn());await Promise.all(i)}catch(f){this._imagePromise=null,r(f)}}),5e3),this.updateExports=i((async t=>{const e=[];for(const i of this.container.children){if(!i.visible||!i.stage)return;e.push(t(i).then((()=>{i.invalidateTexture(),i.requestRender()})))}this._imagePromise=s(e).then((()=>this._imagePromise=null)),await this._imagePromise}))}destroy(){this.bitmaps.forEach((t=>t.destroy())),this.bitmaps=[]}get updating(){return!this.destroyed&&null!==this._imagePromise}async _export(t,e,i,r,s,a){const n=await this.fetchSource(t,Math.floor(e*s),Math.floor(i*s),{rotation:r,pixelRatio:s,signal:a});o(a);const p=new u(null,{immutable:!0,requestRenderOnSourceChangedEnabled:!0});return p.x=t.xmin,p.y=t.ymax,p.resolution=t.width/e,p.rotation=r,p.pixelRatio=s,p.opacity=0,this.container.addChild(p),await p.setSourceAsync(n,a),o(a),p}async _singleExport(t,e,i,o,r,s,a){c(y,i,o,e);const n=m(y,t.spatialReference);return[await this._export(n,e[0],e[1],r,s,a)]}_tiledExport(t,e,i,o){const r=h.create({size:e,spatialReference:t.spatialReference,scales:[t.scale]}),s=new g(r),a=s.getTileCoverage(t);if(!a)return null;const n=[];return a.forEach(((r,a,p,l)=>{S.set(r,a,p,0),s.getTileBounds(y,S);const h=m(y,t.spatialReference);n.push(this._export(h,e,e,0,i,o).then((t=>(0!==l&&(S.set(r,a,p,l),s.getTileBounds(y,S),t.x=y[0],t.y=y[3]),t))))})),Promise.all(n)}};t([a()],w.prototype,"_imagePromise",void 0),t([a()],w.prototype,"bitmaps",void 0),t([a()],w.prototype,"container",void 0),t([a()],w.prototype,"fetchSource",void 0),t([a()],w.prototype,"hidpi",void 0),t([a()],w.prototype,"imageMaxWidth",void 0),t([a()],w.prototype,"imageMaxHeight",void 0),t([a()],w.prototype,"imageRotationSupported",void 0),t([a()],w.prototype,"imageNormalizationSupported",void 0),t([a()],w.prototype,"requestUpdate",void 0),t([a()],w.prototype,"updating",null),w=t([n("esri.views.2d.layers.support.ExportStrategy")],w);const v=w;export{v as default};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Accessor.js";import"../../../../core/has.js";import{debounce as i,throwIfAborted as o,throwIfAbortError as r,eachAlways as s}from"../../../../core/promiseUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as p,toExtent as m}from"../../../../geometry/support/aaBoundingRect.js";import{getInfo as l}from"../../../../geometry/support/spatialReferenceUtils.js";import d from"../../../../layers/support/TileInfo.js";import{getOuterSize as h,getBBox as c}from"../../viewStateUtils.js";import{Bitmap as u}from"../../engine/Bitmap.js";import g from"../../tiling/TileInfoView.js";import f from"../../tiling/TileKey.js";const y=p(),x=[0,0],S=new f(0,0,0,0),_={container:null,fetchSource:null,requestUpdate:null,imageMaxWidth:2048,imageMaxHeight:2048,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1};let w=class extends e{constructor(t){super(t),this._imagePromise=null,this.bitmaps=[],this.hidpi=_.hidpi,this.imageMaxWidth=_.imageMaxWidth,this.imageMaxHeight=_.imageMaxHeight,this.imageRotationSupported=_.imageRotationSupported,this.imageNormalizationSupported=_.imageNormalizationSupported,this.update=i((async(t,e)=>{if(o(e),!t.stationary||this.destroyed)return;const i=t.state,s=l(i.spatialReference),a=this.hidpi?t.pixelRatio:1,n=this.imageNormalizationSupported&&i.worldScreenWidth&&i.worldScreenWidth<i.size[0],p=this.imageMaxWidth??0,m=this.imageMaxHeight??0;n?(x[0]=i.worldScreenWidth,x[1]=i.size[1]):this.imageRotationSupported?(x[0]=i.size[0],x[1]=i.size[1]):h(x,i);const d=Math.floor(x[0]*a)>p||Math.floor(x[1]*a)>m,c=s&&(i.extent.xmin<s.valid[0]||i.extent.xmax>s.valid[1]),u=!this.imageNormalizationSupported&&c,g=!d&&!u,f=this.imageRotationSupported?i.rotation:0,y=this.container.children.slice();if(g){const t=n?i.paddedViewState.center:i.center;this._imagePromise&&console.error("Image promise was not defined!"),this._imagePromise=this._singleExport(i,x,t,i.resolution,f,a,e)}else{let t=Math.min(p,m);u&&(t=Math.min(i.worldScreenWidth,t)),this._imagePromise=this._tiledExport(i,t,a,e)}try{const t=await this._imagePromise??[];o(e);const i=[];if(this._imagePromise=null,this.destroyed)return;this.bitmaps=t;for(const e of y)t.includes(e)||i.push(e.fadeOut().then((()=>{e.remove(),e.destroy()})));for(const e of t)i.push(e.fadeIn());await Promise.all(i)}catch(S){this._imagePromise=null,r(S)}}),5e3),this.updateExports=i((async t=>{const e=[];for(const i of this.container.children){if(!i.visible||!i.stage)return;e.push(t(i).then((()=>{i.invalidateTexture(),i.requestRender()})))}this._imagePromise=s(e).then((()=>this._imagePromise=null)),await this._imagePromise}))}destroy(){this.bitmaps.forEach((t=>t.destroy())),this.bitmaps=[]}get updating(){return!this.destroyed&&null!==this._imagePromise}async _export(t,e,i,r,s,a){const n=await this.fetchSource(t,Math.floor(e*s),Math.floor(i*s),{rotation:r,pixelRatio:s,signal:a});o(a);const p=new u(null,{immutable:!0,requestRenderOnSourceChangedEnabled:!0});return p.x=t.xmin,p.y=t.ymax,p.resolution=t.width/e,p.rotation=r,p.pixelRatio=s,p.opacity=0,this.container.addChild(p),await p.setSourceAsync(n,a),o(a),p}async _singleExport(t,e,i,o,r,s,a){c(y,i,o,e);const n=m(y,t.spatialReference);return[await this._export(n,e[0],e[1],r,s,a)]}_tiledExport(t,e,i,o){const r=d.create({size:e,spatialReference:t.spatialReference,scales:[t.scale]}),s=new g(r),a=s.getTileCoverage(t);if(!a)return null;const n=[];return a.forEach(((r,a,p,l)=>{S.set(r,a,p,0),s.getTileBounds(y,S);const d=m(y,t.spatialReference);n.push(this._export(d,e,e,0,i,o).then((t=>(0!==l&&(S.set(r,a,p,l),s.getTileBounds(y,S),t.x=y[0],t.y=y[3]),t))))})),Promise.all(n)}};t([a()],w.prototype,"_imagePromise",void 0),t([a()],w.prototype,"bitmaps",void 0),t([a()],w.prototype,"container",void 0),t([a()],w.prototype,"fetchSource",void 0),t([a()],w.prototype,"hidpi",void 0),t([a()],w.prototype,"imageMaxWidth",void 0),t([a()],w.prototype,"imageMaxHeight",void 0),t([a()],w.prototype,"imageRotationSupported",void 0),t([a()],w.prototype,"imageNormalizationSupported",void 0),t([a()],w.prototype,"requestUpdate",void 0),t([a()],w.prototype,"updating",null),w=t([n("esri.views.2d.layers.support.ExportStrategy")],w);const v=w;export{v as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{EsriPromise as t}from"../../../../core/Promise.js";import{createResolver as r,ignoreAbortErrors as s,throwIfNotAbortError as o}from"../../../../core/promiseUtils.js";import{open as i}from"../../../../core/workers/workers.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";function c(e){return Array.isArray(e)}let u=class extends t{constructor(e){super(e),this._startupResolver=r(),this.isReady=!1}initialize(){this._controller=new AbortController,this.addResolvingPromise(this._startWorker(this._controller.signal))}destroy(){this._controller.abort(),this._connection&&this._connection.close()}set tileRenderer(e){this.client.tileRenderer=e}get closed(){return this._connection.closed}async startup(e,t,r,s){await this.when();const o=this._controller.signal,i=c(r.source)?{transferList:r.source,signal:o}:void 0,n={service:r,config:t,tileInfo:e.tileInfo.toJSON(),tiles:s};await this._connection.invoke("startup",n,i),this._startupResolver.resolve(),this._set("isReady",!0)}async updateTiles(e){return await this._startupResolver.promise,s(this._connection.invoke("updateTiles",e))}async update(e){const t={config:e};return await this._startupResolver.promise,this._connection.invoke("update",t)}async applyUpdate(e){return await this._startupResolver.promise,this._connection.invoke("applyUpdate",e)}async setHighlight(e){return await this._startupResolver.promise,s(this._connection.invoke("controller.setHighlight",e))}async stop(){if(await this._startupResolver.promise,!this.closed)return s(this._connection.invoke("stop"))}async refresh(e){return await this._startupResolver.promise,s(this._connection.invoke("controller.refresh",e))}async querySummaryStatistics(e,t,r){return await this._startupResolver.promise,this._connection.invoke("controller.querySummaryStatistics",{query:e.toJSON(),params:t},r)}async queryAggregateSummaryStatistics(e,t,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateSummaryStatistics",{query:e.toJSON(),params:t},r)}async queryUniqueValues(e,t,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryUniqueValues",{query:e.toJSON(),params:t},r)}async queryAggregateUniqueValues(e,t,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateUniqueValues",{query:e.toJSON(),params:t},r)}async queryClassBreaks(e,t,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryClassBreaks",{query:e.toJSON(),params:t},r)}async queryAggregateClassBreaks(e,t,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateClassBreaks",{query:e.toJSON(),params:t},r)}async queryHistogram(e,t,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryHistogram",{query:e.toJSON(),params:t},r)}async queryAggregateHistogram(e,t,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateHistogram",{query:e.toJSON(),params:t},r)}async queryFeatures(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryFeatures",e.toJSON(),t)}async queryVisibleFeatures(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryVisibleFeatures",e.toJSON(),t)}async queryObjectIds(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryObjectIds",e.toJSON(),t)}async queryFeatureCount(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryFeatureCount",e.toJSON(),t)}async queryExtent(e,t){return this._connection.invoke("controller.queryExtent",e.toJSON(),t)}async queryLatestObservations(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryLatestObservations",e.toJSON(),t)}async queryStatistics(e){return await this._startupResolver.promise,this._connection.invoke("controller.queryStatistics",e)}async queryAggregates(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregates",e.toJSON(),t)}async queryAggregateCount(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateCount",e.toJSON(),t)}async queryAggregateIds(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateIds",e.toJSON(),t)}async getObjectId(e){return await this._startupResolver.promise,this._connection.invoke("controller.getObjectId",e)}async getDisplayId(e){return await this._startupResolver.promise,this._connection.invoke("controller.getDisplayId",e)}async getFeatures(e){return await this._startupResolver.promise,this._connection.invoke("controller.getFeatures",e)}async getAggregates(){return await this._startupResolver.promise,this._connection.invoke("controller.getAggregates")}async getAggregateValueRanges(){return await this._startupResolver.promise,this._connection.invoke("controller.getAggregateValueRanges")}async mapValidDisplayIds(e){return await this._startupResolver.promise,this._connection.invoke("controller.mapValidDisplayIds",e)}async onEdits(e){return await this._startupResolver.promise,s(this._connection.invoke("controller.onEdits",e))}async enableEvent(e,t){return await this._startupResolver.promise,s(this._connection.invoke("controller.enableEvent",{name:e,value:t}))}pauseStream(){return s(this._connection.invoke("controller.pauseStream"))}resumeStream(){return s(this._connection.invoke("controller.resumeStream"))}async _startWorker(e){try{this._connection=await i("Pipeline",{client:this.client,strategy:"dedicated",signal:e})}catch(t){o(t)}}};e([n()],u.prototype,"isReady",void 0),e([n({constructOnly:!0})],u.prototype,"client",void 0),e([n()],u.prototype,"tileRenderer",null),u=e([a("esri.views.2d.layers.support.FeatureLayerProxy")],u);const l=u;export{l as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{EsriPromise as t}from"../../../../core/Promise.js";import{createResolver as r,ignoreAbortErrors as s,throwIfNotAbortError as o}from"../../../../core/promiseUtils.js";import{open as i}from"../../../../core/workers/workers.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";function c(e){return Array.isArray(e)}let u=class extends t{constructor(e){super(e),this._startupResolver=r(),this.isReady=!1}initialize(){this._controller=new AbortController,this.addResolvingPromise(this._startWorker(this._controller.signal))}destroy(){this._controller.abort(),this._connection&&this._connection.close()}set tileRenderer(e){this.client.tileRenderer=e}get closed(){return this._connection.closed}async startup(e,t,r,s){await this.when();const o=this._controller.signal,i=c(r.source)?{transferList:r.source,signal:o}:void 0,n={service:r,config:t,tileInfo:e.tileInfo.toJSON(),tiles:s};await this._connection.invoke("startup",n,i),this._startupResolver.resolve(),this._set("isReady",!0)}async updateTiles(e){return await this._startupResolver.promise,s(this._connection.invoke("updateTiles",e))}async update(e){const t={config:e};return await this._startupResolver.promise,this._connection.invoke("update",t)}async applyUpdate(e){return await this._startupResolver.promise,this._connection.invoke("applyUpdate",e)}async setHighlight(e){return await this._startupResolver.promise,s(this._connection.invoke("controller.setHighlight",e))}async stop(){if(await this._startupResolver.promise,!this.closed)return s(this._connection.invoke("stop"))}async refresh(e){return await this._startupResolver.promise,s(this._connection.invoke("controller.refresh",e))}async querySummaryStatistics(e,t,r){return await this._startupResolver.promise,this._connection.invoke("controller.querySummaryStatistics",{query:e.toJSON(),params:t},r)}async queryAggregateSummaryStatistics(e,t,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateSummaryStatistics",{query:e.toJSON(),params:t},r)}async queryUniqueValues(e,t,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryUniqueValues",{query:e.toJSON(),params:t},r)}async queryAggregateUniqueValues(e,t,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateUniqueValues",{query:e.toJSON(),params:t},r)}async queryClassBreaks(e,t,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryClassBreaks",{query:e.toJSON(),params:t},r)}async queryAggregateClassBreaks(e,t,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateClassBreaks",{query:e.toJSON(),params:t},r)}async queryHistogram(e,t,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryHistogram",{query:e.toJSON(),params:t},r)}async queryAggregateHistogram(e,t,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateHistogram",{query:e.toJSON(),params:t},r)}async queryFeatures(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryFeatures",e?.toJSON(),t)}async queryVisibleFeatures(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryVisibleFeatures",e?.toJSON(),t)}async queryObjectIds(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryObjectIds",e?.toJSON(),t)}async queryFeatureCount(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryFeatureCount",e?.toJSON(),t)}async queryExtent(e,t){return this._connection.invoke("controller.queryExtent",e.toJSON(),t)}async queryLatestObservations(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryLatestObservations",e.toJSON(),t)}async queryStatistics(e){return await this._startupResolver.promise,this._connection.invoke("controller.queryStatistics",e)}async queryAggregates(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregates",e?.toJSON(),t)}async queryAggregateCount(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateCount",e?.toJSON(),t)}async queryAggregateIds(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateIds",e?.toJSON(),t)}async getObjectId(e){return await this._startupResolver.promise,this._connection.invoke("controller.getObjectId",e)}async getDisplayId(e){return await this._startupResolver.promise,this._connection.invoke("controller.getDisplayId",e)}async getFeatures(e){return await this._startupResolver.promise,this._connection.invoke("controller.getFeatures",e)}async getAggregates(){return await this._startupResolver.promise,this._connection.invoke("controller.getAggregates")}async getAggregateValueRanges(){return await this._startupResolver.promise,this._connection.invoke("controller.getAggregateValueRanges")}async mapValidDisplayIds(e){return await this._startupResolver.promise,this._connection.invoke("controller.mapValidDisplayIds",e)}async onEdits(e){return await this._startupResolver.promise,s(this._connection.invoke("controller.onEdits",e))}async enableEvent(e,t){return await this._startupResolver.promise,s(this._connection.invoke("controller.enableEvent",{name:e,value:t}))}pauseStream(){return s(this._connection.invoke("controller.pauseStream"))}resumeStream(){return s(this._connection.invoke("controller.resumeStream"))}async _startWorker(e){try{this._connection=await i("Pipeline",{client:this.client,strategy:"dedicated",signal:e})}catch(t){o(t)}}};e([n()],u.prototype,"isReady",void 0),e([n({constructOnly:!0})],u.prototype,"client",void 0),e([n()],u.prototype,"tileRenderer",null),u=e([a("esri.views.2d.layers.support.FeatureLayerProxy")],u);const l=u;export{l as default};