@arcgis/core 4.24.0-next.20220430 → 4.24.0-next.20220503

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 (998) hide show
  1. package/Basemap.js +1 -1
  2. package/Color.js +1 -1
  3. package/Ground.js +1 -1
  4. package/Map.js +1 -1
  5. package/PopupTemplate.js +1 -1
  6. package/WebMap.js +1 -1
  7. package/WebScene.js +1 -1
  8. package/analysis/LinearDimension.js +1 -1
  9. package/analysis/SliceAnalysis.js +1 -1
  10. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  11. package/arcade/Dictionary.js +1 -1
  12. package/arcade/Feature.js +1 -1
  13. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  14. package/arcade/featureset/support/FeatureSet.js +1 -1
  15. package/assets/esri/core/workers/RemoteClient.js +1 -1
  16. package/assets/esri/core/workers/chunks/{e06461703e6f1acfcfdc.js → 076d1b1101b59af0d389.js} +1 -1
  17. package/assets/esri/core/workers/chunks/0b72d123386dc4ec7538.js +1 -0
  18. package/assets/esri/core/workers/chunks/0d53e575f11198867619.js +1 -0
  19. package/assets/esri/core/workers/chunks/0e6e3cf07c84d9f040c0.js +1 -0
  20. package/assets/esri/core/workers/chunks/105728404ddd9e73d5c9.js +1 -0
  21. package/assets/esri/core/workers/chunks/11106873b009b98e4286.js +1 -0
  22. package/assets/esri/core/workers/chunks/11a7b156591d1feca952.js +1 -0
  23. package/assets/esri/core/workers/chunks/{94325f920a125610e1f5.js → 12feeace7215248be23f.js} +1 -1
  24. package/assets/esri/core/workers/chunks/17be5bd0d1c233d73d7a.js +1 -0
  25. package/assets/esri/core/workers/chunks/1b53bd65407ba5c479d7.js +1 -0
  26. package/assets/esri/core/workers/chunks/1d91aa745b49b2ab36cf.js +1 -0
  27. package/assets/esri/core/workers/chunks/{fd35b69872ac9393924f.js → 1db8bfb1731be3ae320c.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{3433361f09c84b31aec4.js → 2290bd6dc2e6bb136e14.js} +1 -1
  29. package/assets/esri/core/workers/chunks/24217129d492e170f0f0.js +1 -0
  30. package/assets/esri/core/workers/chunks/24e194107e0e5090125b.js +1 -0
  31. package/assets/esri/core/workers/chunks/2a1301a1d0cd4c0c17cf.js +1 -0
  32. package/assets/esri/core/workers/chunks/{178831b0d0bdabcc45e7.js → 2a676221ca1fc8e0cf34.js} +1 -1
  33. package/assets/esri/core/workers/chunks/2aede0d1dcac8592436b.js +1 -0
  34. package/assets/esri/core/workers/chunks/2b93ad626f5e75b97692.js +1 -0
  35. package/assets/esri/core/workers/chunks/2d03210fc6b5884c6bf9.js +1 -0
  36. package/assets/esri/core/workers/chunks/{b10c333abe4f4e52841c.js → 2dfd3def105005fc72c7.js} +1 -1
  37. package/assets/esri/core/workers/chunks/2f8ff35b8ab15c0e39c2.js +1 -0
  38. package/assets/esri/core/workers/chunks/36272141b3c33cb19026.js +1 -0
  39. package/assets/esri/core/workers/chunks/36c8e8de9c3f67d32572.js +1 -0
  40. package/assets/esri/core/workers/chunks/3ab8c6ae2f2713f637b0.js +1 -0
  41. package/assets/esri/core/workers/chunks/3c058381adcfdc407aa1.js +1 -0
  42. package/assets/esri/core/workers/chunks/3f39df1dfc0a685e5f9d.js +1 -0
  43. package/assets/esri/core/workers/chunks/3fd52a03b3126556aee6.js +1 -0
  44. package/assets/esri/core/workers/chunks/4082d8573f41f952c72e.js +1 -0
  45. package/assets/esri/core/workers/chunks/40b11eea270f6688ff9c.js +1 -0
  46. package/assets/esri/core/workers/chunks/4281b4b27f4767cdd3ae.js +1 -0
  47. package/assets/esri/core/workers/chunks/43fcaaeb6fd179e9199b.js +1 -0
  48. package/assets/esri/core/workers/chunks/4c65b27d80b23c0c3101.js +1 -0
  49. package/assets/esri/core/workers/chunks/{a6406a248b7b2ed65f35.js → 4ec7d59b0c814dbaa7a4.js} +1 -1
  50. package/assets/esri/core/workers/chunks/4f378ad6f4299183df85.js +1 -0
  51. package/assets/esri/core/workers/chunks/505b0aa5ee3e5a26c351.js +1 -0
  52. package/assets/esri/core/workers/chunks/509a9cdd0228a730bcea.js +1 -0
  53. package/assets/esri/core/workers/chunks/52255ad573cec0a34720.js +1 -0
  54. package/assets/esri/core/workers/chunks/52d4fdc451a58a858af1.js +1 -0
  55. package/assets/esri/core/workers/chunks/5405f478af3563580926.js +1 -0
  56. package/assets/esri/core/workers/chunks/54577c2522ca3ff08f7e.js +1 -0
  57. package/assets/esri/core/workers/chunks/54d67e450da6ce2641b4.js +1 -0
  58. package/assets/esri/core/workers/chunks/56d3cb0ae0069a8eadde.js +1 -0
  59. package/assets/esri/core/workers/chunks/5b4efe0014162f777534.js +1 -0
  60. package/assets/esri/core/workers/chunks/5baa162351551817838b.js +1 -0
  61. package/assets/esri/core/workers/chunks/5cf2064bfd9d0847d9ec.js +1 -0
  62. package/assets/esri/core/workers/chunks/620dc3c13c345d5aa9f6.js +1 -0
  63. package/assets/esri/core/workers/chunks/7c290763920f52a1f504.js +1 -0
  64. package/assets/esri/core/workers/chunks/7dc266be958e34e81007.js +972 -0
  65. package/assets/esri/core/workers/chunks/7dfd70f4fa1096e56641.js +1 -0
  66. package/assets/esri/core/workers/chunks/7f097de06972a68cd08a.js +1 -0
  67. package/assets/esri/core/workers/chunks/8033531b0cc706b40d86.js +1 -0
  68. package/assets/esri/core/workers/chunks/814234844a056d9f1ddc.js +1 -0
  69. package/assets/esri/core/workers/chunks/83700cdd60ceecc639cd.js +1 -0
  70. package/assets/esri/core/workers/chunks/857df84cea67079a91e5.js +1 -0
  71. package/assets/esri/core/workers/chunks/8793070d288878d6f49b.js +1 -0
  72. package/assets/esri/core/workers/chunks/8865c5cc28df60364e60.js +1 -0
  73. package/assets/esri/core/workers/chunks/{e9f786d4ba3143ed9644.js → 8cc85d1d46dda16ad041.js} +1 -1
  74. package/assets/esri/core/workers/chunks/958a7ef2cbf048819988.js +1 -0
  75. package/assets/esri/core/workers/chunks/967af0aa4dc4da032fdc.js +1 -0
  76. package/assets/esri/core/workers/chunks/9722880bd7f455b2bd07.js +1 -0
  77. package/assets/esri/core/workers/chunks/9d738aab0d907cd09a9d.js +1 -0
  78. package/assets/esri/core/workers/chunks/{86b31ae136f931d7884a.js → 9e6df034d7949880471f.js} +1 -1
  79. package/assets/esri/core/workers/chunks/a056a79f31cddb066f15.js +1 -0
  80. package/assets/esri/core/workers/chunks/a2c9fd78d42df7314a3e.js +1 -0
  81. package/assets/esri/core/workers/chunks/a4dcb50f6622cb1444c8.js +1 -0
  82. package/assets/esri/core/workers/chunks/a6bfbe449b8c2fa5334c.js +1 -0
  83. package/assets/esri/core/workers/chunks/a8ed1a938dc164b401d9.js +1 -0
  84. package/assets/esri/core/workers/chunks/a9a73bc4875a5aeaf1b9.js +1 -0
  85. package/assets/esri/core/workers/chunks/ac0df52b2f2a4874e4ea.js +1 -0
  86. package/assets/esri/core/workers/chunks/{431efa172901ab8e4d53.js → acfa8eb19225f7862b1d.js} +1 -1
  87. package/assets/esri/core/workers/chunks/adae54f116f311d72d97.js +1 -0
  88. package/assets/esri/core/workers/chunks/{718073d13d3de67b629b.js → aeeb364b7c1876f6e7db.js} +1 -1
  89. package/assets/esri/core/workers/chunks/afddfe620e6539991e6b.js +1 -0
  90. package/assets/esri/core/workers/chunks/b02a83845d3da4caee9d.js +1 -0
  91. package/assets/esri/core/workers/chunks/{0d21506b7d4f9afdbb09.js → b3847a6bbd45d813f03c.js} +1 -1
  92. package/assets/esri/core/workers/chunks/b4c23630d6c85f7b59c0.js +1 -0
  93. package/assets/esri/core/workers/chunks/{c318b229911b60fc3cbf.js → b50ae3dc7e43ff452568.js} +1 -1
  94. package/assets/esri/core/workers/chunks/b5ede4df4620097c6528.js +1 -0
  95. package/assets/esri/core/workers/chunks/b7d7ad127f8939cbdec2.js +1 -0
  96. package/assets/esri/core/workers/chunks/bf1d1c02d12b526b0750.js +1 -0
  97. package/assets/esri/core/workers/chunks/c0e6dbecdbd30066a82c.js +1 -0
  98. package/assets/esri/core/workers/chunks/c2a36243eb105d570bff.js +1 -0
  99. package/assets/esri/core/workers/chunks/c8a3a28809542396c6fd.js +1 -0
  100. package/assets/esri/core/workers/chunks/cf1047ad176a25dcd2d6.js +1 -0
  101. package/assets/esri/core/workers/chunks/d03de043d43691665a93.js +1 -0
  102. package/assets/esri/core/workers/chunks/d3fecbaca51ef8844026.js +1 -0
  103. package/assets/esri/core/workers/chunks/dafe120243db6648a4ab.js +1 -0
  104. package/assets/esri/core/workers/chunks/dccc33d87cb7d902f5c7.js +1 -0
  105. package/assets/esri/core/workers/chunks/dd43f5647900ee27af22.js +1 -0
  106. package/assets/esri/core/workers/chunks/{52489e2f7748dc610263.js → dfdd853dd6c023089963.js} +1 -1
  107. package/assets/esri/core/workers/chunks/e6f76f62cf58fb1e67c6.js +1 -0
  108. package/assets/esri/core/workers/chunks/ea73a1d9cad5e1a5d861.js +1 -0
  109. package/assets/esri/core/workers/chunks/{4130ea1f5a9f197168d7.js → ed4519ac9533a4d340f1.js} +1 -1
  110. package/assets/esri/core/workers/chunks/f0e462f5a16852f33225.js +1 -0
  111. package/assets/esri/core/workers/chunks/f13c29bcc71aed8f3a2e.js +1 -0
  112. package/assets/esri/core/workers/chunks/f356e505c36397fda3cf.js +1 -0
  113. package/assets/esri/core/workers/chunks/f55cbaf5a1d6ee6ac171.js +1 -0
  114. package/assets/esri/core/workers/chunks/f6e613ae6812a347a26c.js +1 -0
  115. package/assets/esri/core/workers/chunks/fb3279408bd5323ec612.js +1 -0
  116. package/assets/esri/core/workers/chunks/fdf80a371b7b2a45f1ff.js +1 -0
  117. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  118. package/chunks/ChapmanAtmosphere.glsl.js +15 -15
  119. package/chunks/CheckerBoard.glsl.js +3 -3
  120. package/chunks/Clouds.glsl.js +2 -3
  121. package/chunks/CloudsComposition.glsl.js +3 -3
  122. package/chunks/ColorMaterial.glsl.js +11 -11
  123. package/chunks/DefaultMaterial.glsl.js +26 -26
  124. package/chunks/EdgeShader.glsl.js +3 -3
  125. package/chunks/Fog.glsl.js +6 -6
  126. package/chunks/HUDMaterial.glsl.js +48 -48
  127. package/chunks/HeatmapDensity.glsl.js +7 -7
  128. package/chunks/HighlightApply.glsl.js +3 -3
  129. package/chunks/LineCallout.glsl.js +3 -3
  130. package/chunks/LineMarker.glsl.js +22 -22
  131. package/chunks/MeasurementArrow.glsl.js +4 -4
  132. package/chunks/NativeLine.glsl.js +11 -11
  133. package/chunks/Path.glsl.js +16 -16
  134. package/chunks/Pattern.glsl.js +30 -30
  135. package/chunks/RasterColorizer.glsl.js +4 -4
  136. package/chunks/RealisticTree.glsl.js +20 -20
  137. package/chunks/RibbonLine.glsl.js +39 -39
  138. package/chunks/ShadedColorMaterial.glsl.js +10 -10
  139. package/chunks/ShadowCastVisualize.glsl.js +5 -5
  140. package/chunks/ShadowHighlight.glsl.js +2 -2
  141. package/chunks/SlicePlaneMaterial.glsl.js +3 -3
  142. package/chunks/Stars.glsl.js +2 -2
  143. package/chunks/WaterSurface.glsl.js +20 -20
  144. package/chunks/languageUtils.js +1 -1
  145. package/chunks/persistableUrlUtils.js +1 -1
  146. package/chunks/vec22.js +1 -1
  147. package/chunks/vec2f64.js +1 -1
  148. package/chunks/vec3.js +1 -1
  149. package/chunks/vec33.js +1 -1
  150. package/chunks/vec43.js +1 -1
  151. package/colorUtils.js +1 -1
  152. package/config.js +1 -1
  153. package/core/Accessor.js +1 -1
  154. package/core/AsyncUpdate.js +1 -1
  155. package/core/Clonable.js +1 -1
  156. package/core/Collection.js +1 -1
  157. package/core/HandleOwner.js +1 -1
  158. package/core/Loadable.js +1 -1
  159. package/core/NestedMap.js +1 -1
  160. package/core/accessorSupport/DefaultsStore.js +1 -1
  161. package/core/accessorSupport/Properties.js +1 -1
  162. package/core/accessorSupport/decorators/enumeration.js +1 -1
  163. package/core/accessorSupport/extensions/serializableProperty/reader.js +1 -1
  164. package/core/accessorSupport/extensions/serializableProperty/writePolicyUtils.js +1 -1
  165. package/core/accessorSupport/extensions/serializableProperty/writer.js +1 -1
  166. package/core/accessorSupport/read.js +1 -1
  167. package/core/accessorSupport/tracking.js +1 -1
  168. package/core/accessorSupport/write.js +1 -1
  169. package/core/devEnvironmentUtils.js +1 -1
  170. package/core/has.js +1 -1
  171. package/core/libs/gl-matrix-2/factories/vec2f64.js +1 -1
  172. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  173. package/core/libs/rbush/PooledRBush.js +1 -1
  174. package/core/promiseUtils.js +1 -1
  175. package/core/reactiveUtils.js +1 -1
  176. package/core/scheduling.js +1 -1
  177. package/core/throttle.js +1 -1
  178. package/core/urlUtils.js +1 -1
  179. package/core/watchUtils.js +1 -1
  180. package/core/workers/RemoteClient.js +1 -1
  181. package/core/workers/WorkerOwner.js +1 -1
  182. package/core/workers/loaderConfig.js +1 -1
  183. package/core/workers/workerFactory.js +1 -1
  184. package/geometry/Mesh.js +1 -1
  185. package/geometry/geometryEngine.js +1 -1
  186. package/geometry/geometryEngineAsync.js +1 -1
  187. package/geometry/projection.js +1 -1
  188. package/geometry/support/axisAngleDegrees.js +1 -1
  189. package/geometry/support/meshUtils/centerAt.js +1 -1
  190. package/geometry/support/meshUtils/deduplicate.js +1 -1
  191. package/geometry/support/meshUtils/elevation.js +1 -1
  192. package/geometry/support/meshUtils/geographicUtils.js +1 -1
  193. package/geometry/support/meshUtils/georeference.js +1 -1
  194. package/geometry/support/meshUtils/loadExternal.js +1 -1
  195. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  196. package/geometry/support/meshUtils/offset.js +1 -1
  197. package/geometry/support/meshUtils/rotate.js +1 -1
  198. package/geometry/support/meshUtils/scale.js +1 -1
  199. package/geometry/support/normalizeUtils.js +1 -1
  200. package/geometry/support/normalizeUtilsCommon.js +1 -1
  201. package/geometry/support/offset.js +1 -1
  202. package/geometry/support/rotate.js +1 -1
  203. package/identity/IdentityManagerBase.js +1 -1
  204. package/identity/IdentityModal.js +1 -1
  205. package/interfaces.d.ts +109 -2
  206. package/intl/locale.js +1 -1
  207. package/intl/messages.js +1 -1
  208. package/kernel.js +1 -1
  209. package/layers/AnalysisLayer.js +1 -1
  210. package/layers/CSVLayer.js +1 -1
  211. package/layers/FeatureLayer.js +1 -1
  212. package/layers/GeoJSONLayer.js +1 -1
  213. package/layers/GeoRSSLayer.js +1 -1
  214. package/layers/ImageryLayer.js +1 -1
  215. package/layers/ImageryTileLayer.js +1 -1
  216. package/layers/Layer.js +1 -1
  217. package/layers/MapImageLayer.js +1 -1
  218. package/layers/MapNotesLayer.js +1 -1
  219. package/layers/OGCFeatureLayer.js +1 -1
  220. package/layers/RouteLayer.js +1 -1
  221. package/layers/SceneLayer.js +1 -1
  222. package/layers/StreamLayer.js +1 -1
  223. package/layers/SubtypeGroupLayer.js +1 -1
  224. package/layers/TileLayer.js +1 -1
  225. package/layers/VectorTileLayer.js +1 -1
  226. package/layers/VoxelLayer.js +1 -1
  227. package/layers/VoxelWasmPerScene.js +1 -1
  228. package/layers/WCSLayer.js +1 -1
  229. package/layers/WFSLayer.js +1 -1
  230. package/layers/WMSLayer.js +1 -1
  231. package/layers/WMTSLayer.js +1 -1
  232. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  233. package/layers/effects/EffectView.js +1 -1
  234. package/layers/effects/FeatureEffectView.js +1 -1
  235. package/layers/effects/jsonUtils.js +1 -1
  236. package/layers/graphics/OptimizedGeometry.js +1 -1
  237. package/layers/graphics/centroid.js +1 -1
  238. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  239. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  240. package/layers/graphics/data/QueryEngineResult.js +1 -1
  241. package/layers/graphics/data/StreamFeatureManager.js +1 -1
  242. package/layers/graphics/editingSupport.js +1 -1
  243. package/layers/graphics/objectIdUtils.js +1 -1
  244. package/layers/graphics/sources/CSVSource.js +1 -1
  245. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  246. package/layers/graphics/sources/GeoJSONSource.js +1 -1
  247. package/layers/graphics/sources/MemorySource.js +1 -1
  248. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  249. package/layers/graphics/sources/WFSSource.js +1 -1
  250. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  251. package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
  252. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  253. package/layers/graphics/sources/geojson/geojson.js +1 -1
  254. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  255. package/layers/graphics/sources/support/QueryTask.js +1 -1
  256. package/layers/mixins/APIKeyMixin.js +1 -1
  257. package/layers/mixins/ArcGISImageService.js +1 -1
  258. package/layers/mixins/ArcGISMapService.js +1 -1
  259. package/layers/mixins/ImageryTileMixin.js +1 -1
  260. package/layers/mixins/OperationalLayer.js +1 -1
  261. package/layers/mixins/PortalLayer.js +1 -1
  262. package/layers/mixins/SceneService.js +1 -1
  263. package/layers/mixins/refresh.js +1 -1
  264. package/layers/ogc/dateUtils.js +1 -1
  265. package/layers/ogc/ogcFeatureUtils.js +1 -1
  266. package/layers/ogc/wfsUtils.js +1 -1
  267. package/layers/save/featureLayerUtils.js +1 -1
  268. package/layers/support/ExportImageParameters.js +1 -1
  269. package/layers/support/ExportImageServiceParameters.js +1 -1
  270. package/layers/support/ExportWMSImageParameters.js +1 -1
  271. package/layers/support/FeatureEffect.js +1 -1
  272. package/layers/support/FeatureType.js +1 -1
  273. package/layers/support/FetchAssociatedFeatureLayer.js +1 -1
  274. package/layers/support/LabelClass.js +1 -1
  275. package/layers/support/LayerContingentValuesCache.js +1 -1
  276. package/layers/support/RasterFunction.js +1 -1
  277. package/layers/support/RasterInfo.js +1 -1
  278. package/layers/support/RasterJobHandler.js +1 -1
  279. package/layers/support/RasterWorker.js +1 -1
  280. package/layers/support/Sublayer.js +1 -1
  281. package/layers/support/SubtypeSublayer.js +1 -1
  282. package/layers/support/TilemapCache.js +1 -1
  283. package/layers/support/TimeReference.d.ts +4 -0
  284. package/layers/support/WMTSSublayer.js +1 -1
  285. package/layers/support/arcgisLayers.js +1 -1
  286. package/layers/support/commonProperties.js +1 -1
  287. package/layers/support/editableLayers.js +1 -1
  288. package/layers/support/fieldUtils.js +1 -1
  289. package/layers/support/floorFilterUtils.js +1 -1
  290. package/layers/support/imageryRendererUtils.js +1 -1
  291. package/layers/support/layerUtils.js +1 -1
  292. package/layers/support/layersCreator.js +1 -1
  293. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  294. package/layers/support/rasterDatasets/CloudRaster.js +1 -1
  295. package/layers/support/rasterDatasets/ImageAuxRaster.js +1 -1
  296. package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
  297. package/layers/support/rasterDatasets/InMemoryRaster.js +1 -1
  298. package/layers/support/rasterDatasets/MRFRaster.js +1 -1
  299. package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
  300. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  301. package/layers/support/rasterDatasets/multipartParser.js +1 -1
  302. package/layers/support/rasterDatasets/pamParser.js +1 -1
  303. package/layers/support/rasterDatasets/wcsCapabilitiesParser.js +1 -1
  304. package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
  305. package/layers/support/rasterDatasets/xmlUtilities.js +1 -1
  306. package/layers/support/rasterFormats/Lerc.js +1 -1
  307. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  308. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  309. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  310. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  311. package/layers/support/rasterFunctions/stretchUtils.js +1 -1
  312. package/layers/support/rasterFunctions/vectorFieldUtils.js +1 -1
  313. package/layers/support/rasterTransforms/PolynomialTransform.js +1 -1
  314. package/layers/support/rasterTransforms/utils.js +1 -1
  315. package/layers/support/source/DataLayerSource.js +1 -1
  316. package/layers/support/source/QueryTableDataSource.js +1 -1
  317. package/layers/support/vectorTileLayerLoader.js +1 -1
  318. package/layers/support/wmsUtils.js +1 -1
  319. package/layers/support/wmtsUtils.js +1 -1
  320. package/libs/maquette-advanced-projector/projector.js +1 -1
  321. package/networks/Network.js +1 -1
  322. package/networks/UtilityNetwork.js +1 -1
  323. package/networks/support/utils.js +1 -1
  324. package/package.json +1 -1
  325. package/popup/content/ExpressionContent.js +1 -1
  326. package/portal/Portal.js +1 -1
  327. package/portal/PortalItem.js +1 -1
  328. package/portal/support/geometryServiceUtils.js +1 -1
  329. package/portal/support/layersLoader.js +1 -1
  330. package/portal/support/portalItemUtils.js +1 -1
  331. package/portal/support/portalLayers.js +1 -1
  332. package/renderers/DictionaryRenderer.js +1 -1
  333. package/renderers/FlowRenderer.js +1 -1
  334. package/renderers/RasterColormapRenderer.js +1 -1
  335. package/renderers/RasterStretchRenderer.js +1 -1
  336. package/renderers/VectorFieldRenderer.js +1 -1
  337. package/renderers/support/RasterSymbolizer.js +1 -1
  338. package/renderers/support/UniqueValueInfo.js +1 -1
  339. package/renderers/support/colorRampUtils.js +1 -1
  340. package/renderers/support/heatmapUtils.js +1 -1
  341. package/renderers/support/rasterRendererHelper.js +1 -1
  342. package/request.js +1 -1
  343. package/rest/identify.js +1 -1
  344. package/rest/imageService.js +1 -1
  345. package/rest/networkService.js +1 -1
  346. package/rest/networks/support/SynthesizeAssociationGeometriesParameters.js +1 -1
  347. package/rest/operations/identify.js +1 -1
  348. package/rest/print.js +1 -1
  349. package/rest/query/executeQuery.js +1 -1
  350. package/rest/query/operations/query.js +1 -1
  351. package/rest/query/operations/queryRelatedRecords.js +1 -1
  352. package/rest/query/operations/queryTopFeatures.js +1 -1
  353. package/rest/route.js +1 -1
  354. package/rest/support/DirectionLine.js +1 -1
  355. package/rest/support/DirectionPoint.js +1 -1
  356. package/rest/support/DirectionsFeatureSet.js +1 -1
  357. package/rest/support/FeatureSet.js +1 -1
  358. package/rest/support/ImageSampleParameters.js +1 -1
  359. package/rest/support/PointBarrier.js +1 -1
  360. package/rest/support/PolygonBarrier.js +1 -1
  361. package/rest/support/PolylineBarrier.js +1 -1
  362. package/rest/support/RouteInfo.js +1 -1
  363. package/rest/support/Stop.js +1 -1
  364. package/rest/support/meshFeatureSet.js +1 -1
  365. package/rest/support/printTaskUtils.js +1 -1
  366. package/smartMapping/labels/clusters.js +1 -1
  367. package/smartMapping/raster/renderers/rgb.js +1 -1
  368. package/smartMapping/raster/renderers/uniqueValue.js +1 -1
  369. package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
  370. package/smartMapping/raster/support/adapters/RasterLayerAdapter.js +1 -1
  371. package/smartMapping/raster/support/utils.js +1 -1
  372. package/smartMapping/renderers/color.js +1 -1
  373. package/smartMapping/renderers/size.js +1 -1
  374. package/smartMapping/renderers/support/utils.js +1 -1
  375. package/smartMapping/renderers/univariateColorSize.js +1 -1
  376. package/smartMapping/statistics/support/WorkerClient.js +1 -1
  377. package/smartMapping/support/adapters/CSVLayerAdapter.js +1 -1
  378. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  379. package/smartMapping/support/adapters/OGCFeatureLayerAdapter.js +1 -1
  380. package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
  381. package/smartMapping/support/adapters/support/utils.js +1 -1
  382. package/statistics/utils.js +1 -1
  383. package/support/LayersMixin.js +1 -1
  384. package/support/TablesMixin.js +1 -1
  385. package/support/arcadeUtils.js +1 -1
  386. package/support/basemapUtils.js +1 -1
  387. package/support/popupUtils.js +1 -1
  388. package/support/revision.js +1 -1
  389. package/support/timeUtils.js +1 -1
  390. package/symbols/FillSymbol3DLayer.js +1 -1
  391. package/symbols/LineSymbol3DLayer.js +1 -1
  392. package/symbols/LineSymbolMarker.js +1 -1
  393. package/symbols/PictureFillSymbol.js +1 -1
  394. package/symbols/PointSymbol3D.js +1 -1
  395. package/symbols/SimpleLineSymbol.js +1 -1
  396. package/symbols/SimpleMarkerSymbol.js +1 -1
  397. package/symbols/cim/CIMResourceManager.js +1 -1
  398. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  399. package/symbols/cim/CIMSymbolHelper.js +1 -1
  400. package/symbols/cim/ExpandedCIM.js +1 -1
  401. package/symbols/cim/SDFHelper.js +1 -1
  402. package/symbols/cim/cimAnalyzer.js +1 -1
  403. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  404. package/symbols/cim/effects/EffectDashes.js +1 -1
  405. package/symbols/cim/effects/EffectOffset.js +1 -1
  406. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  407. package/symbols/cim/utils.js +1 -1
  408. package/symbols/support/cimSymbolUtils.js +1 -1
  409. package/symbols/support/jsonUtils.js +1 -1
  410. package/symbols/support/previewCIMSymbol.js +1 -1
  411. package/symbols/support/previewSymbol2D.js +1 -1
  412. package/symbols/support/previewSymbol3D.js +1 -1
  413. package/symbols/support/previewWebStyleSymbol.js +1 -1
  414. package/symbols/support/svgUtils.js +1 -1
  415. package/symbols/support/symbolConversion.js +1 -1
  416. package/symbols/support/symbolUtils.js +1 -1
  417. package/tasks/GenerateRendererTask.js +1 -1
  418. package/views/2d/MapViewConstraints.js +1 -1
  419. package/views/2d/constraints/GeometryConstraint.js +1 -1
  420. package/views/2d/engine/Bitmap.js +1 -1
  421. package/views/2d/engine/Container.js +1 -1
  422. package/views/2d/engine/DisplayObject.js +1 -1
  423. package/views/2d/engine/Stage.js +1 -1
  424. package/views/2d/engine/imagery/BrushRasterBitmap.js +1 -1
  425. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  426. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  427. package/views/2d/engine/vectorTiles/TilemapRequest.js +1 -1
  428. package/views/2d/engine/vectorTiles/WorkerTileHandler.js +1 -1
  429. package/views/2d/engine/vectorTiles/buckets/FillBucket.js +1 -1
  430. package/views/2d/engine/vectorTiles/buckets/LineBucket.js +1 -1
  431. package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
  432. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  433. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  434. package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
  435. package/views/2d/engine/vectorTiles/style/VectorTileSource.js +1 -1
  436. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  437. package/views/2d/engine/webgl/GraphicTile.js +1 -1
  438. package/views/2d/engine/webgl/TextureManager.js +1 -1
  439. package/views/2d/engine/webgl/brushes/WGLBrushHeatmap.js +1 -1
  440. package/views/2d/engine/webgl/brushes/WGLBrushVTLCircle.js +1 -1
  441. package/views/2d/engine/webgl/brushes/WGLBrushVTLFill.js +1 -1
  442. package/views/2d/engine/webgl/brushes/WGLBrushVTLLine.js +1 -1
  443. package/views/2d/engine/webgl/collisions/CollisionEngine.js +1 -1
  444. package/views/2d/engine/webgl/collisions/MetricReader.js +1 -1
  445. package/views/2d/engine/webgl/cpuMapped/DisplayRecordReader.js +1 -1
  446. package/views/2d/engine/webgl/cpuMapped/FreeList.js +1 -1
  447. package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
  448. package/views/2d/engine/webgl/mesh/templates/WGLBaseLineTemplate.js +1 -1
  449. package/views/2d/engine/webgl/mesh/templates/WGLBaseMarkerTemplate.js +1 -1
  450. package/views/2d/engine/webgl/mesh/templates/WGLBaseTextTemplate.js +1 -1
  451. package/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js +1 -1
  452. package/views/2d/engine/webgl/mesh/templates/WGLLabelTemplate.js +1 -1
  453. package/views/2d/engine/webgl/mesh/templates/WGLLineTemplate.js +1 -1
  454. package/views/2d/engine/webgl/mesh/templates/WGLMeshTemplate.js +1 -1
  455. package/views/2d/engine/webgl/painter/RenderPass.js +1 -1
  456. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  457. package/views/2d/engine/webgl/techniques/dotDensity/TechniqueDotDensity.js +1 -1
  458. package/views/2d/input/MapViewInputManager.js +1 -1
  459. package/views/2d/input/handlers/GamepadNavigation.js +1 -1
  460. package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
  461. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  462. package/views/2d/layers/BaseLayerView2D.js +1 -1
  463. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  464. package/views/2d/layers/BitmapTileLayerView2D.js +1 -1
  465. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  466. package/views/2d/layers/GeoRSSLayerView2D.js +1 -1
  467. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  468. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  469. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  470. package/views/2d/layers/KMLLayerView2D.js +1 -1
  471. package/views/2d/layers/LayerView2D.js +1 -1
  472. package/views/2d/layers/SubtypeGroupLayerView2D.js +1 -1
  473. package/views/2d/layers/TileLayerView2D.js +1 -1
  474. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  475. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  476. package/views/2d/layers/features/FeatureStore2D.js +1 -1
  477. package/views/2d/layers/features/Pipeline.js +1 -1
  478. package/views/2d/layers/features/batchUtils.js +1 -1
  479. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  480. package/views/2d/layers/features/controllers/support/sourceAdapters.js +1 -1
  481. package/views/2d/layers/features/createSymbolSchema.js +1 -1
  482. package/views/2d/layers/features/processors/SymbolProcessor.js +1 -1
  483. package/views/2d/layers/features/schemaUtils.js +1 -1
  484. package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
  485. package/views/2d/layers/features/sources/DataTileSource.js +1 -1
  486. package/views/2d/layers/features/sources/DataTileSubscription.js +1 -1
  487. package/views/2d/layers/features/sources/SnapshotFeatureSource.js +1 -1
  488. package/views/2d/layers/features/support/ClusterStore.js +1 -1
  489. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  490. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  491. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  492. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  493. package/views/2d/layers/features/support/ResourceManagerProxy.js +1 -1
  494. package/views/2d/layers/features/tileRenderers/SymbolTileRenderer.js +1 -1
  495. package/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js +1 -1
  496. package/views/2d/layers/graphics/graphicsUtils.js +1 -1
  497. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  498. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  499. package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
  500. package/views/2d/layers/support/ExportStrategy.js +1 -1
  501. package/views/2d/layers/support/FeatureCommandQueue.js +1 -1
  502. package/views/2d/magnifier/MagnifierView2D.js +1 -1
  503. package/views/2d/support/engineHelpers.js +1 -1
  504. package/views/2d/tiling/TileManager.js +1 -1
  505. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  506. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  507. package/views/3d/analysis/Dimensioning/DimensioningVisualization.js +5 -0
  508. package/views/3d/analysis/Dimensioning/LinearDimensionVisualization.js +5 -0
  509. package/views/3d/analysis/DimensioningAnalysisView3D.js +1 -1
  510. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
  511. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  512. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  513. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  514. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  515. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  516. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  517. package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
  518. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  519. package/views/3d/environment/Clouds.glsl.js +1 -1
  520. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  521. package/views/3d/environment/CloudsComposition.js +1 -1
  522. package/views/3d/environment/CloudsCompositionParameters.js +5 -0
  523. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  524. package/views/3d/environment/Fog.glsl.js +1 -1
  525. package/views/3d/environment/Fog.js +1 -1
  526. package/views/3d/environment/Precipitation.js +1 -1
  527. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  528. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  529. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  530. package/views/3d/environment/Stars.glsl.js +1 -1
  531. package/views/3d/environment/Stars.js +1 -1
  532. package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
  533. package/views/3d/glTF/internal/Resource.js +1 -1
  534. package/views/3d/glTF/loader.js +1 -1
  535. package/views/3d/input/SceneInputManager.js +1 -1
  536. package/views/3d/input/handlers/TwoFingerTilt.js +1 -1
  537. package/views/3d/interactive/Manipulator3D.js +1 -1
  538. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  539. package/views/3d/interactive/editingTools/manipulations/MoveManipulation.js +1 -1
  540. package/views/3d/interactive/editingTools/moveGraphic/isSupportedGraphic.js +1 -1
  541. package/views/3d/interactive/editingTools/reshapeGraphic/GraphicReshapeTool.js +1 -1
  542. package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
  543. package/views/3d/interactive/editingTools/reshapeGraphic/isSupportedGraphic.js +1 -1
  544. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  545. package/views/3d/interactive/editingTools/transformGraphic/isSupportedGraphic.js +1 -1
  546. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  547. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  548. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  549. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  550. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  551. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  552. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  553. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  554. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  555. package/views/3d/layers/FeatureLayerView3D.js +1 -1
  556. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  557. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  558. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  559. package/views/3d/layers/GraphicsView3D.js +1 -1
  560. package/views/3d/layers/I3SMeshView3D.js +1 -1
  561. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  562. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  563. package/views/3d/layers/LayerView3D.js +1 -1
  564. package/views/3d/layers/RouteLayerView3D.js +1 -1
  565. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  566. package/views/3d/layers/SceneLayerView3D.js +1 -1
  567. package/views/3d/layers/SceneLayerWorker.js +1 -1
  568. package/views/3d/layers/StreamLayerView3D.js +1 -1
  569. package/views/3d/layers/TiledLayerView3D.js +1 -1
  570. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  571. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  572. package/views/3d/layers/WMSLayerView3D.js +1 -1
  573. package/views/3d/layers/WMTSLayerView3D.js +1 -1
  574. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  575. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  576. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  577. package/views/3d/layers/graphics/Graphics3DFilterVisibility.js +1 -1
  578. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  579. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  580. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  581. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  582. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  583. package/views/3d/layers/graphics/Graphics3DPointSymbol.js +1 -1
  584. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  585. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  586. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  587. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  588. package/views/3d/layers/graphics/Labeler.js +1 -1
  589. package/views/3d/layers/i3s/I3SAttributeOverrides.js +1 -1
  590. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  591. package/views/3d/layers/i3s/I3SStreamDataController.js +1 -1
  592. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  593. package/views/3d/layers/support/FeatureTileTree3D.js +1 -1
  594. package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
  595. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  596. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  597. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  598. package/views/3d/state/ConstraintsManager.js +1 -1
  599. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  600. package/views/3d/support/ResourceController.js +1 -1
  601. package/views/3d/support/SharedSymbolResources.js +1 -1
  602. package/views/3d/support/TextureCollection.js +1 -1
  603. package/views/3d/support/cameraUtils.js +1 -1
  604. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  605. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  606. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  607. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  608. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  609. package/views/3d/terrain/OverlayManager.js +1 -1
  610. package/views/3d/terrain/OverlayRenderer.js +1 -1
  611. package/views/3d/terrain/PatchGeometry.js +1 -1
  612. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  613. package/views/3d/terrain/PatchRenderData.js +1 -1
  614. package/views/3d/terrain/PlanarPatch.js +1 -1
  615. package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
  616. package/views/3d/terrain/RasterTile.js +1 -1
  617. package/views/3d/terrain/SphericalPatch.js +1 -1
  618. package/views/3d/terrain/TerrainRenderer.js +1 -1
  619. package/views/3d/terrain/TerrainSurface.js +1 -1
  620. package/views/3d/terrain/Tile.js +1 -1
  621. package/views/3d/terrain/TileCompositor.js +1 -1
  622. package/views/3d/terrain/TileRenderer.js +1 -1
  623. package/views/3d/terrain/TilingSchemeLogic.js +1 -1
  624. package/views/3d/terrain/terrainUtils.js +1 -1
  625. package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
  626. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  627. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  628. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +2 -2
  629. package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
  630. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +1 -1
  631. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +5 -5
  632. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +8 -8
  633. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +6 -6
  634. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +4 -4
  635. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +2 -2
  636. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +5 -5
  637. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +13 -13
  638. package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
  639. package/views/3d/webgl-engine/core/shaderLibrary/raster/Colormap.glsl.js +1 -1
  640. package/views/3d/webgl-engine/core/shaderLibrary/raster/Common.glsl.js +2 -2
  641. package/views/3d/webgl-engine/core/shaderLibrary/raster/Projection.glsl.js +1 -1
  642. package/views/3d/webgl-engine/core/shaderLibrary/raster/RasterColorizer.glsl.js +1 -1
  643. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +1 -1
  644. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +5 -5
  645. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js +3 -3
  646. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +13 -13
  647. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +17 -17
  648. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +1 -1
  649. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +7 -7
  650. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +2 -2
  651. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +5 -5
  652. package/views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js +2 -2
  653. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +15 -15
  654. package/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js +2 -2
  655. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  656. package/views/3d/webgl-engine/core/shaderModules/BooleanPassUniform.js +5 -0
  657. package/views/3d/webgl-engine/core/shaderModules/Float4DrawUniform.js +5 -0
  658. package/views/3d/webgl-engine/core/shaderModules/{Matrix3Uniform.js → Float4PassUniform.js} +1 -1
  659. package/views/3d/webgl-engine/core/shaderModules/Float4Uniform.js +1 -1
  660. package/views/3d/webgl-engine/core/shaderModules/Matrix3DrawUniform.js +5 -0
  661. package/views/3d/webgl-engine/core/shaderModules/Matrix3PassUniform.js +5 -0
  662. package/views/3d/webgl-engine/core/shaderModules/{TextureCubeUniform.js → TextureCubePassUniform.js} +1 -1
  663. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js +1 -1
  664. package/views/3d/webgl-engine/lib/AutoDisposable.js +1 -1
  665. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  666. package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
  667. package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
  668. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  669. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  670. package/views/3d/webgl-engine/lib/ShadowHighlight.js +1 -1
  671. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  672. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  673. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  674. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  675. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  676. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  677. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  678. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  679. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  680. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  681. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  682. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  683. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  684. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  685. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  686. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  687. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  688. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  689. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  690. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  691. package/views/3d/webgl-engine/materials/{VisualVariableMaterialParameters.js → VisualVariablePassParameters.js} +1 -1
  692. package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
  693. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  694. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  695. package/views/3d/webgl-engine/parts/requireUtils.js +1 -1
  696. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  697. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  698. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  699. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  700. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  701. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  702. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  703. package/views/3d/webgl-engine/shaders/HeatmapDensity.glsl.js +1 -1
  704. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  705. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  706. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +1 -1
  707. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  708. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  709. package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +3 -3
  710. package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
  711. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  712. package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
  713. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  714. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  715. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  716. package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
  717. package/views/3d/webgl-engine/shaders/ShadowCastVisualize.glsl.js +1 -1
  718. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
  719. package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
  720. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  721. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +3 -3
  722. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShader.glsl.js +1 -1
  723. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +5 -5
  724. package/views/BasemapView.js +1 -1
  725. package/views/GroundView.js +1 -1
  726. package/views/LayerViewManager.js +1 -1
  727. package/views/MapView.js +1 -1
  728. package/views/SceneView.js +1 -1
  729. package/views/ToolViewManager.js +1 -1
  730. package/views/View.js +1 -1
  731. package/views/draw/DrawAction.js +1 -1
  732. package/views/draw/DrawGraphicTool.js +1 -1
  733. package/views/draw/DrawOperation.js +1 -1
  734. package/views/draw/DrawTool.js +1 -1
  735. package/views/draw/support/Box.js +1 -1
  736. package/views/draw/support/GraphicMover.js +1 -1
  737. package/views/draw/support/Reshape.js +1 -1
  738. package/views/interactive/coordinateHelper.js +1 -1
  739. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  740. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  741. package/views/interactive/snapping/SnappingManager.js +1 -1
  742. package/views/interactive/snapping/featureSources/WorkerTileTreeDebugger.js +1 -1
  743. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  744. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  745. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  746. package/views/layers/FeatureLayerView.js +1 -1
  747. package/views/layers/GroupLayerView.js +1 -1
  748. package/views/layers/ImageryLayerView.js +1 -1
  749. package/views/layers/ImageryTileLayerView.js +1 -1
  750. package/views/layers/LayerView.js +1 -1
  751. package/views/layers/MapImageLayerView.js +1 -1
  752. package/views/layers/WMSLayerView.js +1 -1
  753. package/views/support/AllocationTracer.js +1 -1
  754. package/views/support/DefaultsFromMap.js +1 -1
  755. package/views/support/geometry2dUtils.js +1 -1
  756. package/views/support/layerViewUtils.js +1 -1
  757. package/views/support/waitForResources.js +1 -1
  758. package/views/ui/UI.js +1 -1
  759. package/views/webgl/BufferObject.js +1 -1
  760. package/views/webgl/FramebufferObject.js +1 -1
  761. package/views/webgl/RenderingContext.js +1 -1
  762. package/views/webgl/Texture.js +1 -1
  763. package/views/webgl/UniformBufferLayout.js +1 -1
  764. package/views/webgl/VertexArrayObject.js +1 -1
  765. package/views/webgl/capabilities.js +1 -1
  766. package/views/webgl/rasterUtils.js +1 -1
  767. package/views/webgl/testFloatBufferBlend.js +1 -1
  768. package/webdoc/widgets/TimeSlider.js +1 -1
  769. package/webmap/Bookmark.js +1 -1
  770. package/webscene/Slide.js +1 -1
  771. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  772. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  773. package/widgets/AreaMeasurement2D.js +1 -1
  774. package/widgets/AreaMeasurement3D.js +1 -1
  775. package/widgets/Attribution.js +1 -1
  776. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  777. package/widgets/BasemapGallery/support/BasemapGalleryItem.js +1 -1
  778. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  779. package/widgets/BasemapLayerList.js +1 -1
  780. package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
  781. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  782. package/widgets/Bookmarks.js +1 -1
  783. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  784. package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
  785. package/widgets/BuildingExplorer/BuildingLevel.js +1 -1
  786. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  787. package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.js +1 -1
  788. package/widgets/BuildingExplorer/BuildingPhase.js +1 -1
  789. package/widgets/BuildingExplorer/support/buildingLayerUtils.js +1 -1
  790. package/widgets/BuildingExplorer.js +1 -1
  791. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  792. package/widgets/CoordinateConversion/support/Format.js +1 -1
  793. package/widgets/Daylight/DaylightViewModel.js +1 -1
  794. package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
  795. package/widgets/Daylight.js +1 -1
  796. package/widgets/DirectLineMeasurement3D.js +1 -1
  797. package/widgets/Directions/DirectionsViewModel.js +1 -1
  798. package/widgets/Directions.js +1 -1
  799. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  800. package/widgets/DistanceMeasurement2D.js +1 -1
  801. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  802. package/widgets/Editor/CreateWorkflow.js +1 -1
  803. package/widgets/Editor/EditorViewModel.js +1 -1
  804. package/widgets/Editor/UpdateWorkflow.js +1 -1
  805. package/widgets/Editor/workflowUtils.js +1 -1
  806. package/widgets/Editor.js +1 -1
  807. package/widgets/ElevationProfile/ElevationProfileLineGround.js +1 -1
  808. package/widgets/ElevationProfile/ElevationProfileLineInput.js +1 -1
  809. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  810. package/widgets/ElevationProfile/ElevationProfileTool.js +1 -1
  811. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  812. package/widgets/ElevationProfile/components/Statistics.js +1 -1
  813. package/widgets/ElevationProfile/support/elevationQuerySourceUtils.js +1 -1
  814. package/widgets/ElevationProfile/support/profileUtils.js +1 -1
  815. package/widgets/ElevationProfile.js +1 -1
  816. package/widgets/Expand.js +1 -1
  817. package/widgets/Feature/FeatureAttachments.js +1 -1
  818. package/widgets/Feature/FeatureContent.js +1 -1
  819. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  820. package/widgets/Feature/FeatureExpression.js +1 -1
  821. package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
  822. package/widgets/Feature/FeatureFields.js +1 -1
  823. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  824. package/widgets/Feature/FeatureMedia.js +1 -1
  825. package/widgets/Feature/FeatureViewModel.js +1 -1
  826. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  827. package/widgets/Feature/support/featureUtils.js +1 -1
  828. package/widgets/Feature/support/relatedFeatureUtils.js +1 -1
  829. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  830. package/widgets/FeatureForm/InputField.js +1 -1
  831. package/widgets/FeatureForm/support/formTemplateUtils.js +1 -1
  832. package/widgets/FeatureForm.js +1 -1
  833. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  834. package/widgets/FeatureTable/FieldColumn.js +1 -1
  835. package/widgets/FeatureTable/Grid/Column.js +1 -1
  836. package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
  837. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  838. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  839. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
  840. package/widgets/FeatureTable/Grid/support/LocalStore.js +1 -1
  841. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  842. package/widgets/FeatureTable.js +1 -1
  843. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  844. package/widgets/FeatureTemplates/ItemList.js +1 -1
  845. package/widgets/FeatureTemplates/TemplateItem.js +1 -1
  846. package/widgets/FeatureTemplates.js +1 -1
  847. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  848. package/widgets/FloorFilter.js +1 -1
  849. package/widgets/Fullscreen.js +1 -1
  850. package/widgets/Home.js +1 -1
  851. package/widgets/LayerList/LayerListViewModel.js +1 -1
  852. package/widgets/LayerList/support/layerListUtils.js +1 -1
  853. package/widgets/LayerList.js +1 -1
  854. package/widgets/Legend/LegendViewModel.js +1 -1
  855. package/widgets/Legend/styles/Card.js +1 -1
  856. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  857. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  858. package/widgets/Legend/support/clusterUtils.js +1 -1
  859. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  860. package/widgets/Locate/LocateViewModel.js +1 -1
  861. package/widgets/Popup/PopupViewModel.js +1 -1
  862. package/widgets/Popup/actionUtils.js +1 -1
  863. package/widgets/Popup.js +1 -1
  864. package/widgets/Print/PrintViewModel.js +1 -1
  865. package/widgets/Print.js +1 -1
  866. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  867. package/widgets/Search/LayerSearchSource.js +1 -1
  868. package/widgets/Search/SearchResultRenderer.js +1 -1
  869. package/widgets/Search/SearchViewModel.js +1 -1
  870. package/widgets/Search/support/geometryUtils.js +1 -1
  871. package/widgets/Search/support/layerSearchUtils.js +1 -1
  872. package/widgets/Search/support/locatorUtils.js +1 -1
  873. package/widgets/Search.js +1 -1
  874. package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
  875. package/widgets/ShadowCast/components/Label.js +1 -1
  876. package/widgets/ShadowCast/components/TimezonePicker.js +1 -1
  877. package/widgets/ShadowCast.js +1 -1
  878. package/widgets/Sketch/SketchViewModel.js +1 -1
  879. package/widgets/Sketch.js +1 -1
  880. package/widgets/Slider.js +1 -1
  881. package/widgets/Swipe/SwipeViewModel.js +1 -1
  882. package/widgets/TableList/TableListViewModel.js +1 -1
  883. package/widgets/TableList/support/tableListUtils.js +1 -1
  884. package/widgets/TableList.js +1 -1
  885. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  886. package/widgets/TimeSlider/utils.js +1 -1
  887. package/widgets/TimeSlider.js +1 -1
  888. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  889. package/widgets/Weather.js +1 -1
  890. package/widgets/Widget.js +1 -1
  891. package/widgets/smartMapping/BinaryColorSizeSlider/BinaryColorSizeSliderViewModel.js +1 -1
  892. package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
  893. package/widgets/smartMapping/ClassedColorSlider.js +1 -1
  894. package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
  895. package/widgets/smartMapping/ColorSizeSlider.js +1 -1
  896. package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.js +1 -1
  897. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  898. package/widgets/smartMapping/SmartMappingSliderViewModel.js +1 -1
  899. package/widgets/support/AnalysisViewModel.js +1 -1
  900. package/widgets/support/ColorPicker.js +1 -1
  901. package/widgets/support/DatePicker.js +1 -1
  902. package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
  903. package/widgets/support/Popover.js +1 -1
  904. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  905. package/widgets/support/SelectionToolbar.js +1 -1
  906. package/widgets/support/Selector2D/SelectionOperation2D.js +1 -1
  907. package/widgets/support/Selector2D.js +1 -1
  908. package/widgets/support/SnappingControls/SnappingControlsViewModel.js +1 -1
  909. package/widgets/support/SnappingControls.js +1 -1
  910. package/widgets/support/jsxWidgetSupport.js +1 -1
  911. package/widgets/support/widgetUtils.js +1 -1
  912. package/assets/esri/core/workers/chunks/049c5c30bd37693dddb7.js +0 -1
  913. package/assets/esri/core/workers/chunks/055a0ebf22a82f859474.js +0 -1
  914. package/assets/esri/core/workers/chunks/0b12ff7b2ed2838afbb8.js +0 -1
  915. package/assets/esri/core/workers/chunks/0e25548573baf855e394.js +0 -1
  916. package/assets/esri/core/workers/chunks/0edd4c3ca6e7d749d0e5.js +0 -1
  917. package/assets/esri/core/workers/chunks/0fcbf7e2db58e38ee6d1.js +0 -1
  918. package/assets/esri/core/workers/chunks/133f971e72a1a6277ac4.js +0 -1
  919. package/assets/esri/core/workers/chunks/135a90ae61f3b3cae91b.js +0 -1
  920. package/assets/esri/core/workers/chunks/13fde7fd56c39fa3f2d5.js +0 -1
  921. package/assets/esri/core/workers/chunks/1c90855c3b0e5dcff908.js +0 -1
  922. package/assets/esri/core/workers/chunks/1dbef1919c7ac10a6bcc.js +0 -1
  923. package/assets/esri/core/workers/chunks/1facbda248863cf72cbd.js +0 -1
  924. package/assets/esri/core/workers/chunks/1fb2d7abe6c8efa84695.js +0 -1
  925. package/assets/esri/core/workers/chunks/2068377c2a796d5f2245.js +0 -1
  926. package/assets/esri/core/workers/chunks/28a5878cbe5880476855.js +0 -1
  927. package/assets/esri/core/workers/chunks/2cf3934b3ecabdf207c8.js +0 -1
  928. package/assets/esri/core/workers/chunks/2d42711a629384144625.js +0 -1
  929. package/assets/esri/core/workers/chunks/3021fda52083fc67d18c.js +0 -1
  930. package/assets/esri/core/workers/chunks/30333a95dc0a44e23fb5.js +0 -1
  931. package/assets/esri/core/workers/chunks/30837d93116f0337972f.js +0 -1
  932. package/assets/esri/core/workers/chunks/320543485c8e22485075.js +0 -1
  933. package/assets/esri/core/workers/chunks/3f0f7da92a6e4493686e.js +0 -1
  934. package/assets/esri/core/workers/chunks/42057f252ba4e82a8b45.js +0 -1
  935. package/assets/esri/core/workers/chunks/45a3f6033cdf4bc74a4c.js +0 -1
  936. package/assets/esri/core/workers/chunks/492b65fe99641f5740f0.js +0 -1
  937. package/assets/esri/core/workers/chunks/4d1cd7df617273c489f4.js +0 -1
  938. package/assets/esri/core/workers/chunks/4df9dfa80dbbae9b743d.js +0 -1
  939. package/assets/esri/core/workers/chunks/515c1c055666ff4740f3.js +0 -1
  940. package/assets/esri/core/workers/chunks/541e644fc77dbe527124.js +0 -1
  941. package/assets/esri/core/workers/chunks/59e341b2db44351bf557.js +0 -1
  942. package/assets/esri/core/workers/chunks/5a10b58533b4116115ac.js +0 -1
  943. package/assets/esri/core/workers/chunks/5f940853341d7e2bc852.js +0 -1
  944. package/assets/esri/core/workers/chunks/5ff2cdecf95e0136dd52.js +0 -1
  945. package/assets/esri/core/workers/chunks/6147bfbe2bd7292d6ad0.js +0 -1
  946. package/assets/esri/core/workers/chunks/6467f996fe9f136c370b.js +0 -1
  947. package/assets/esri/core/workers/chunks/682a8f15f352de76df69.js +0 -1
  948. package/assets/esri/core/workers/chunks/6a06635089761ee3e6d4.js +0 -972
  949. package/assets/esri/core/workers/chunks/725828a41917d3d56f2d.js +0 -1
  950. package/assets/esri/core/workers/chunks/794b47764ebb0257ed41.js +0 -1
  951. package/assets/esri/core/workers/chunks/7fd03a75eb07a09cda35.js +0 -1
  952. package/assets/esri/core/workers/chunks/86ad6b020c01850d9095.js +0 -1
  953. package/assets/esri/core/workers/chunks/86f9d1ce36661781d962.js +0 -1
  954. package/assets/esri/core/workers/chunks/8dcf6c836b53b40dfbf1.js +0 -1
  955. package/assets/esri/core/workers/chunks/8e98ff9404a802352037.js +0 -1
  956. package/assets/esri/core/workers/chunks/94e51fe1c539df6257c2.js +0 -1
  957. package/assets/esri/core/workers/chunks/9519a02b9b8db88a3150.js +0 -1
  958. package/assets/esri/core/workers/chunks/9a8b50ed75219b4a42e1.js +0 -1
  959. package/assets/esri/core/workers/chunks/9f3a094aa4b47e4eb046.js +0 -1
  960. package/assets/esri/core/workers/chunks/a0ebf25c9c9a7f839b93.js +0 -1
  961. package/assets/esri/core/workers/chunks/a25f0a195f9217665530.js +0 -1
  962. package/assets/esri/core/workers/chunks/a2be1e0b632cef87f6a4.js +0 -1
  963. package/assets/esri/core/workers/chunks/a4d8cf9829da9cfc5f36.js +0 -1
  964. package/assets/esri/core/workers/chunks/a562059dbdd1bf1fab66.js +0 -1
  965. package/assets/esri/core/workers/chunks/a59ee7d2b98c85f27dd2.js +0 -1
  966. package/assets/esri/core/workers/chunks/a5dbab94697757c87c49.js +0 -1
  967. package/assets/esri/core/workers/chunks/a5e65d5a7a536759d1cc.js +0 -1
  968. package/assets/esri/core/workers/chunks/a8ac0b6a3eba35e3a5b6.js +0 -1
  969. package/assets/esri/core/workers/chunks/acbd0f4d72d1f5d8e4e8.js +0 -1
  970. package/assets/esri/core/workers/chunks/acc97a210f36bff2d1b0.js +0 -1
  971. package/assets/esri/core/workers/chunks/ad68fe924456d6d7d4f0.js +0 -1
  972. package/assets/esri/core/workers/chunks/b06c949fc7d08e376a5f.js +0 -1
  973. package/assets/esri/core/workers/chunks/b26bd8fde2fc65bb67fb.js +0 -1
  974. package/assets/esri/core/workers/chunks/b4405e9fe6c0cf7250d3.js +0 -1
  975. package/assets/esri/core/workers/chunks/bc08fe3b03767bd694c5.js +0 -1
  976. package/assets/esri/core/workers/chunks/c11501e96ffd81bf39a0.js +0 -1
  977. package/assets/esri/core/workers/chunks/c44116378cc1bc627044.js +0 -1
  978. package/assets/esri/core/workers/chunks/c9b09099488d0e719dfb.js +0 -1
  979. package/assets/esri/core/workers/chunks/cbea4f1eb814115748db.js +0 -1
  980. package/assets/esri/core/workers/chunks/ce262a2accd982988ef1.js +0 -1
  981. package/assets/esri/core/workers/chunks/d15e6662d90718411d62.js +0 -1
  982. package/assets/esri/core/workers/chunks/d16aac3461af9cee0c29.js +0 -1
  983. package/assets/esri/core/workers/chunks/d60dd3e1028f714f2258.js +0 -1
  984. package/assets/esri/core/workers/chunks/d6c150c243ca1f6108f9.js +0 -1
  985. package/assets/esri/core/workers/chunks/d85748b57a71999caf3a.js +0 -1
  986. package/assets/esri/core/workers/chunks/d8c59b1d73650c060dfb.js +0 -1
  987. package/assets/esri/core/workers/chunks/dcb6e1b33402d7fa455b.js +0 -1
  988. package/assets/esri/core/workers/chunks/df653bca2b14dffc82d1.js +0 -1
  989. package/assets/esri/core/workers/chunks/e2a12142439d3037a3a7.js +0 -1
  990. package/assets/esri/core/workers/chunks/e3e1d87b8532bf84a18d.js +0 -1
  991. package/assets/esri/core/workers/chunks/e7744b7e0c16bba93151.js +0 -1
  992. package/assets/esri/core/workers/chunks/ea50effc5c39870dc871.js +0 -1
  993. package/assets/esri/core/workers/chunks/f1665a64564593f2a438.js +0 -1
  994. package/assets/esri/core/workers/chunks/f4c12f3a5e7f89106ae0.js +0 -1
  995. package/assets/esri/core/workers/chunks/fbefdc74b3aab716187f.js +0 -1
  996. package/assets/esri/core/workers/chunks/fc4fd9db056579e09bfe.js +0 -1
  997. package/assets/esri/core/workers/chunks/fd4907fa96f55128764d.js +0 -1
  998. package/views/3d/webgl-engine/core/shaderModules/BooleanUniform.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import{clone as i}from"../../../core/lang.js";import s from"../../../core/Logger.js";import{isNone as r}from"../../../core/maybe.js";import{isAbortError as a}from"../../../core/promiseUtils.js";import{watch as l,initial as n}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{diff as u,hasDiff as y}from"../../../core/accessorSupport/diffUtils.js";import{create as c}from"../../../geometry/support/aaBoundingRect.js";import{equals as p}from"../../../geometry/support/spatialReferenceUtils.js";import{StyleUpdateType as d}from"../engine/vectorTiles/enums.js";import{TileHandler as _}from"../engine/vectorTiles/TileHandler.js";import{TileManager as f}from"../engine/vectorTiles/TileManager.js";import{VectorTile as g}from"../engine/vectorTiles/VectorTile.js";import{VectorTileContainer as m}from"../engine/vectorTiles/VectorTileContainer.js";import{drawColliders as C}from"../engine/vectorTiles/decluttering/debugging.js";import{StyleLayerType as T}from"../engine/vectorTiles/style/StyleDefinition.js";import v from"../engine/vectorTiles/style/StyleRepository.js";import{LayerView2DMixin as R}from"./LayerView2D.js";import{Display as D}from"./support/Display.js";import H from"../tiling/TileInfoViewPOT.js";import w from"../tiling/TileQueue.js";import S from"../../layers/LayerView.js";const Q=s.getLogger("esri.views.2d.layers.VectorTileLayerView2D");let L=class extends(R(S)){constructor(){super(...arguments),this._styleChanges=[],this._fetchQueue=null,this._parseQueue=null,this._isTileHandlerReady=!1,this.fading=!1}async hitTest(e,i){if(!this._tileHandlerPromise)return null;await this._tileHandlerPromise;const s=await this._vectorTileContainer.hitTest(i);if(!s||0===s.length)return null;const r=s[0]-1,a=this._styleRepository,l=a.getStyleLayerByUID(r);if(!l)return null;const n=a.getStyleLayerIndex(l.id),o=new t({attributes:{layerId:n,layerName:l.id,layerUID:r}});return o.layer=this.layer,o.sourceLayer=this.layer,[o]}update(e){if(this._tileHandlerPromise&&this._isTileHandlerReady)return e.pixelRatio!==this._tileHandler.devicePixelRatio?(this._start(),void(this._tileHandler.devicePixelRatio=e.pixelRatio)):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.state=e.state,this._parseQueue.state=e.state,this._tileManager.update(e)||this.requestUpdate(),this._parseQueue.resume(),this._fetchQueue.resume()))}attach(){const{style:e}=this.layer.currentStyleInfo;this._styleRepository=new v(e),this._tileInfoView=new H(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new m(this._tileInfoView),this._tileHandler=new _(this.layer,this._styleRepository,window.devicePixelRatio||1),this.container.addChild(this._vectorTileContainer),this._start(),this.handles.add([this._vectorTileContainer.on("fade-start",(()=>{this.fading=!0,this.notifyChange("updating"),this.requestUpdate()})),this._vectorTileContainer.on("fade-complete",(()=>{var e;null==(e=this._collisionBoxesDisplay)||e.requestRender(),this.fading=!1,this.notifyChange("updating"),this.requestUpdate()})),l((()=>this.layer.symbolCollisionBoxesVisible),(e=>{e?(this._collisionBoxesDisplay=new D({render:e=>this._renderCollisionBoxes(e.context)}),this.container.addChild(this._collisionBoxesDisplay)):(this.container.removeChild(this._collisionBoxesDisplay),this._collisionBoxesDisplay=null)}),n),this.layer.on("paint-change",(e=>{if(e.isDataDriven)this._styleChanges.push({type:d.PAINTER_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate();else{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;const s=i.type===T.SYMBOL;t.setPaintProperties(e.layer,e.paint),s&&this._vectorTileContainer.restartDeclutter(),this._vectorTileContainer.requestRender()}})),this.layer.on("layout-change",(e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;const s=u(i.layout,e.layout);if(!r(s)){if(y(s,"visibility")&&1===b(s))return t.setLayoutProperties(e.layer,e.layout),i.type===T.SYMBOL&&this._vectorTileContainer.restartDeclutter(),void this._vectorTileContainer.requestRender();this._styleChanges.push({type:d.LAYOUT_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate()}})),this.layer.on("style-layer-visibility-change",(e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);i&&(t.setStyleLayerVisibility(e.layer,e.visibility),i.type===T.SYMBOL&&this._vectorTileContainer.restartDeclutter(),this._vectorTileContainer.requestRender())})),this.layer.on("style-layer-change",(e=>{this._styleChanges.push({type:d.LAYER_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate()})),this.layer.on("delete-style-layer",(e=>{this._styleChanges.push({type:d.LAYER_REMOVED,data:e}),this.notifyChange("updating"),this.requestUpdate()})),this.layer.on("load-style",(()=>this._loadStyle())),this.layer.on("spriteSource-change",(e=>{this._newSpriteSource=e.spriteSource,this._styleChanges.push({type:d.SPRITES_CHANGED,data:null});const t=this._styleRepository.layers;for(const i of t)switch(i.type){case T.SYMBOL:i.getLayoutProperty("icon-image")&&this._styleChanges.push({type:d.LAYOUT_CHANGED,data:{layer:i.id,layout:i.layout}});break;case T.LINE:i.getPaintProperty("line-pattern")&&this._styleChanges.push({type:d.PAINTER_CHANGED,data:{layer:i.id,paint:i.paint,isDataDriven:i.isPainterDataDriven()}});break;case T.FILL:i.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:d.PAINTER_CHANGED,data:{layer:i.id,paint:i.paint,isDataDriven:i.isPainterDataDriven()}})}this.notifyChange("updating"),this.requestUpdate()}))],this.declaredClass)}detach(){var e,t;this._stop(),this.container.removeAllChildren(),null==(e=this._vectorTileContainer)||e.destroy(),this._vectorTileContainer=null,null==(t=this._tileHandler)||t.destroy(),this._tileHandler=null,this.handles.remove(this.declaredClass)}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this._collisionBoxesDisplay&&this._vectorTileContainer.restartDeclutter(),this.requestUpdate()}supportsSpatialReference(e){var t;return p(null==(t=this.layer.tileInfo)?void 0:t.spatialReference,e)}canResume(){let e=super.canResume();const{currentStyleInfo:t}=this.layer;if(e&&null!=t&&t.layerDefinition){const i=this.view.scale,{minScale:s,maxScale:r}=t.layerDefinition;t&&t.layerDefinition&&(s&&s<i&&(e=!1),r&&r>i&&(e=!1))}return e}isUpdating(){const e=this._vectorTileContainer.children;return!this._isTileHandlerReady||!this._fetchQueue||!this._parseQueue||this._fetchQueue.updating||this._parseQueue.updating||e.length>0&&e.some((e=>e.invalidating))||this.fading}acquireTile(e){const t=this._createVectorTile(e);return this._tileHandlerPromise.then((()=>{this._fetchQueue.push(t.key).then((e=>this._parseQueue.push({key:t.key,data:e}))).then((e=>{t.once("attach",(()=>this.requestUpdate())),t.setData(e),this.requestUpdate(),this.notifyChange("updating")})).catch((e=>{this.notifyChange("updating"),a(e)||Q.error(e)}))})),t}releaseTile(e){const t=e.key.id;this._fetchQueue.abort(t),this._parseQueue.abort(t),this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new f({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const e=new AbortController,t=this._tileHandler.start({signal:e.signal}).then((()=>{this._fetchQueue=new w({tileInfoView:this._tileInfoView,process:(e,t)=>this._getTileData(e,t),concurrency:15}),this._parseQueue=new w({tileInfoView:this._tileInfoView,process:(e,t)=>this._parseTileData(e,t),concurrency:8}),this.requestUpdate(),this._isTileHandlerReady=!0}));this._tileHandler.spriteMosaic.then((e=>{this._vectorTileContainer.setStyleResources(e,this._tileHandler.glyphMosaic,this._styleRepository),this.requestUpdate()})),this._tileHandlerAbortController=e,this._tileHandlerPromise=t}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue&&(this._fetchQueue.destroy(),this._fetchQueue=null),this._parseQueue&&(this._parseQueue.destroy(),this._parseQueue=null),this._tileManager&&(this._tileManager.destroy(),this._tileManager=null),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,t){const i=await this._tileHandler.fetchTileData(e,t);return this.notifyChange("updating"),i}async _parseTileData(e,t){return this._tileHandler.parseTileData(e,t)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this._tileManager.clearCache();const e=this._styleChanges;try{await this._tileHandler.updateStyle(e)}catch(l){Q.error("error applying vector-tiles style update",l.message),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0}const t=this._styleRepository,i=[];e.forEach((e=>{if(e.type!==d.LAYER_REMOVED)return;const s=e.data,r=t.getLayerById(s.layer);r&&i.push(r.uid)}));const s=[];let r;e.forEach((e=>{const i=e.type,a=e.data;switch(i){case d.PAINTER_CHANGED:t.setPaintProperties(a.layer,a.paint),r=a.layer;break;case d.LAYOUT_CHANGED:t.setLayoutProperties(a.layer,a.layout),r=a.layer;break;case d.LAYER_REMOVED:return void t.deleteStyleLayer(a.layer);case d.LAYER_CHANGED:t.setStyleLayer(a.layer,a.index),r=a.layer.id;break;case d.SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(this._newSpriteSource)),this._newSpriteSource=null,r=null}const l=t.getLayerById(r);l&&s.push(l.uid)}));const a=this._vectorTileContainer.children;if(i.length>0){this._vectorTileContainer.deleteStyleLayers(i);for(const e of a)e.deleteLayerData(i)}if(this._fetchQueue.resume(),this._parseQueue.resume(),s.length>0){const e=[];for(const t of a){const i=this._fetchQueue.push(t.key).then((e=>this._parseQueue.push({key:t.key,data:e,styleLayerUIDs:s}))).then((e=>t.setData(e)));e.push(i)}await Promise.all(e)}this._styleChanges=[],this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate()}async _loadStyle(){const{style:e}=this.layer.currentStyleInfo,t=i(e);this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this.notifyChange("updating"),this._styleRepository=new v(t),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:s}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,t),await this._tileHandlerPromise}catch(l){if(!a(l))throw l}if(s.aborted)return this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),void this.requestUpdate();const r=await this._tileHandler.spriteMosaic;this._vectorTileContainer.setStyleResources(r,this._tileHandler.glyphMosaic,this._styleRepository),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate()}_createVectorTile(e){const t=this._tileInfoView.getTileBounds(c(),e);return new g(e,t[0],t[3],512,512,this._styleRepository)}_renderCollisionBoxes(e){for(const t of this._vectorTileContainer.children)if(t.symbols){const i=[];for(const[e,s]of t.symbols)i.push(...s);C(e,i)}}};function b(e){if(r(e))return 0;switch(e.type){case"partial":return Object.keys(e.diff).length;case"complete":return Math.max(Object.keys(e.oldValue).length,Object.keys(e.newValue).length);case"collection":return Object.keys(e.added).length+Object.keys(e.changed).length+Object.keys(e.removed).length}}e([o()],L.prototype,"_fetchQueue",void 0),e([o()],L.prototype,"_parseQueue",void 0),e([o()],L.prototype,"_isTileHandlerReady",void 0),e([o()],L.prototype,"fading",void 0),L=e([h("esri.views.2d.layers.VectorTileLayerView2D")],L);const I=L;export{I as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import{clone as i}from"../../../core/lang.js";import s from"../../../core/Logger.js";import{isNone as r}from"../../../core/maybe.js";import{isAbortError as a}from"../../../core/promiseUtils.js";import{watch as l,initial as n}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{diff as u,hasDiff as y}from"../../../core/accessorSupport/diffUtils.js";import{create as c}from"../../../geometry/support/aaBoundingRect.js";import{equals as p}from"../../../geometry/support/spatialReferenceUtils.js";import{StyleUpdateType as d}from"../engine/vectorTiles/enums.js";import{TileHandler as _}from"../engine/vectorTiles/TileHandler.js";import{TileManager as f}from"../engine/vectorTiles/TileManager.js";import{VectorTile as g}from"../engine/vectorTiles/VectorTile.js";import{VectorTileContainer as m}from"../engine/vectorTiles/VectorTileContainer.js";import{drawColliders as C}from"../engine/vectorTiles/decluttering/debugging.js";import{StyleLayerType as T}from"../engine/vectorTiles/style/StyleDefinition.js";import v from"../engine/vectorTiles/style/StyleRepository.js";import{LayerView2DMixin as R}from"./LayerView2D.js";import{Display as D}from"./support/Display.js";import H from"../tiling/TileInfoViewPOT.js";import w from"../tiling/TileQueue.js";import S from"../../layers/LayerView.js";const Q=s.getLogger("esri.views.2d.layers.VectorTileLayerView2D");let L=class extends(R(S)){constructor(){super(...arguments),this._styleChanges=[],this._fetchQueue=null,this._parseQueue=null,this._isTileHandlerReady=!1,this.fading=!1}async hitTest(e,i){if(!this._tileHandlerPromise)return null;await this._tileHandlerPromise;const s=await this._vectorTileContainer.hitTest(i);if(!s||0===s.length)return null;const r=s[0]-1,a=this._styleRepository,l=a.getStyleLayerByUID(r);if(!l)return null;const n=a.getStyleLayerIndex(l.id),o=new t({attributes:{layerId:n,layerName:l.id,layerUID:r}});return o.layer=this.layer,o.sourceLayer=this.layer,[o]}update(e){if(this._tileHandlerPromise&&this._isTileHandlerReady)return e.pixelRatio!==this._tileHandler.devicePixelRatio?(this._start(),void(this._tileHandler.devicePixelRatio=e.pixelRatio)):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.state=e.state,this._parseQueue.state=e.state,this._tileManager.update(e)||this.requestUpdate(),this._parseQueue.resume(),this._fetchQueue.resume()))}attach(){const{style:e}=this.layer.currentStyleInfo;this._styleRepository=new v(e),this._tileInfoView=new H(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new m(this._tileInfoView),this._tileHandler=new _(this.layer,this._styleRepository,window.devicePixelRatio||1),this.container.addChild(this._vectorTileContainer),this._start(),this.handles.add([this._vectorTileContainer.on("fade-start",(()=>{this.fading=!0,this.notifyChange("updating"),this.requestUpdate()})),this._vectorTileContainer.on("fade-complete",(()=>{this._collisionBoxesDisplay?.requestRender(),this.fading=!1,this.notifyChange("updating"),this.requestUpdate()})),l((()=>this.layer.symbolCollisionBoxesVisible),(e=>{e?(this._collisionBoxesDisplay=new D({render:e=>this._renderCollisionBoxes(e.context)}),this.container.addChild(this._collisionBoxesDisplay)):(this.container.removeChild(this._collisionBoxesDisplay),this._collisionBoxesDisplay=null)}),n),this.layer.on("paint-change",(e=>{if(e.isDataDriven)this._styleChanges.push({type:d.PAINTER_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate();else{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;const s=i.type===T.SYMBOL;t.setPaintProperties(e.layer,e.paint),s&&this._vectorTileContainer.restartDeclutter(),this._vectorTileContainer.requestRender()}})),this.layer.on("layout-change",(e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;const s=u(i.layout,e.layout);if(!r(s)){if(y(s,"visibility")&&1===b(s))return t.setLayoutProperties(e.layer,e.layout),i.type===T.SYMBOL&&this._vectorTileContainer.restartDeclutter(),void this._vectorTileContainer.requestRender();this._styleChanges.push({type:d.LAYOUT_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate()}})),this.layer.on("style-layer-visibility-change",(e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);i&&(t.setStyleLayerVisibility(e.layer,e.visibility),i.type===T.SYMBOL&&this._vectorTileContainer.restartDeclutter(),this._vectorTileContainer.requestRender())})),this.layer.on("style-layer-change",(e=>{this._styleChanges.push({type:d.LAYER_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate()})),this.layer.on("delete-style-layer",(e=>{this._styleChanges.push({type:d.LAYER_REMOVED,data:e}),this.notifyChange("updating"),this.requestUpdate()})),this.layer.on("load-style",(()=>this._loadStyle())),this.layer.on("spriteSource-change",(e=>{this._newSpriteSource=e.spriteSource,this._styleChanges.push({type:d.SPRITES_CHANGED,data:null});const t=this._styleRepository.layers;for(const i of t)switch(i.type){case T.SYMBOL:i.getLayoutProperty("icon-image")&&this._styleChanges.push({type:d.LAYOUT_CHANGED,data:{layer:i.id,layout:i.layout}});break;case T.LINE:i.getPaintProperty("line-pattern")&&this._styleChanges.push({type:d.PAINTER_CHANGED,data:{layer:i.id,paint:i.paint,isDataDriven:i.isPainterDataDriven()}});break;case T.FILL:i.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:d.PAINTER_CHANGED,data:{layer:i.id,paint:i.paint,isDataDriven:i.isPainterDataDriven()}})}this.notifyChange("updating"),this.requestUpdate()}))],this.declaredClass)}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer?.destroy(),this._vectorTileContainer=null,this._tileHandler?.destroy(),this._tileHandler=null,this.handles.remove(this.declaredClass)}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this._collisionBoxesDisplay&&this._vectorTileContainer.restartDeclutter(),this.requestUpdate()}supportsSpatialReference(e){return p(this.layer.tileInfo?.spatialReference,e)}canResume(){let e=super.canResume();const{currentStyleInfo:t}=this.layer;if(e&&t?.layerDefinition){const i=this.view.scale,{minScale:s,maxScale:r}=t.layerDefinition;t&&t.layerDefinition&&(s&&s<i&&(e=!1),r&&r>i&&(e=!1))}return e}isUpdating(){const e=this._vectorTileContainer.children;return!this._isTileHandlerReady||!this._fetchQueue||!this._parseQueue||this._fetchQueue.updating||this._parseQueue.updating||e.length>0&&e.some((e=>e.invalidating))||this.fading}acquireTile(e){const t=this._createVectorTile(e);return this._tileHandlerPromise.then((()=>{this._fetchQueue.push(t.key).then((e=>this._parseQueue.push({key:t.key,data:e}))).then((e=>{t.once("attach",(()=>this.requestUpdate())),t.setData(e),this.requestUpdate(),this.notifyChange("updating")})).catch((e=>{this.notifyChange("updating"),a(e)||Q.error(e)}))})),t}releaseTile(e){const t=e.key.id;this._fetchQueue.abort(t),this._parseQueue.abort(t),this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new f({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const e=new AbortController,t=this._tileHandler.start({signal:e.signal}).then((()=>{this._fetchQueue=new w({tileInfoView:this._tileInfoView,process:(e,t)=>this._getTileData(e,t),concurrency:15}),this._parseQueue=new w({tileInfoView:this._tileInfoView,process:(e,t)=>this._parseTileData(e,t),concurrency:8}),this.requestUpdate(),this._isTileHandlerReady=!0}));this._tileHandler.spriteMosaic.then((e=>{this._vectorTileContainer.setStyleResources(e,this._tileHandler.glyphMosaic,this._styleRepository),this.requestUpdate()})),this._tileHandlerAbortController=e,this._tileHandlerPromise=t}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue&&(this._fetchQueue.destroy(),this._fetchQueue=null),this._parseQueue&&(this._parseQueue.destroy(),this._parseQueue=null),this._tileManager&&(this._tileManager.destroy(),this._tileManager=null),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,t){const i=await this._tileHandler.fetchTileData(e,t);return this.notifyChange("updating"),i}async _parseTileData(e,t){return this._tileHandler.parseTileData(e,t)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this._tileManager.clearCache();const e=this._styleChanges;try{await this._tileHandler.updateStyle(e)}catch(l){Q.error("error applying vector-tiles style update",l.message),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0}const t=this._styleRepository,i=[];e.forEach((e=>{if(e.type!==d.LAYER_REMOVED)return;const s=e.data,r=t.getLayerById(s.layer);r&&i.push(r.uid)}));const s=[];let r;e.forEach((e=>{const i=e.type,a=e.data;switch(i){case d.PAINTER_CHANGED:t.setPaintProperties(a.layer,a.paint),r=a.layer;break;case d.LAYOUT_CHANGED:t.setLayoutProperties(a.layer,a.layout),r=a.layer;break;case d.LAYER_REMOVED:return void t.deleteStyleLayer(a.layer);case d.LAYER_CHANGED:t.setStyleLayer(a.layer,a.index),r=a.layer.id;break;case d.SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(this._newSpriteSource)),this._newSpriteSource=null,r=null}const l=t.getLayerById(r);l&&s.push(l.uid)}));const a=this._vectorTileContainer.children;if(i.length>0){this._vectorTileContainer.deleteStyleLayers(i);for(const e of a)e.deleteLayerData(i)}if(this._fetchQueue.resume(),this._parseQueue.resume(),s.length>0){const e=[];for(const t of a){const i=this._fetchQueue.push(t.key).then((e=>this._parseQueue.push({key:t.key,data:e,styleLayerUIDs:s}))).then((e=>t.setData(e)));e.push(i)}await Promise.all(e)}this._styleChanges=[],this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate()}async _loadStyle(){const{style:e}=this.layer.currentStyleInfo,t=i(e);this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this.notifyChange("updating"),this._styleRepository=new v(t),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:s}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,t),await this._tileHandlerPromise}catch(l){if(!a(l))throw l}if(s.aborted)return this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),void this.requestUpdate();const r=await this._tileHandler.spriteMosaic;this._vectorTileContainer.setStyleResources(r,this._tileHandler.glyphMosaic,this._styleRepository),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate()}_createVectorTile(e){const t=this._tileInfoView.getTileBounds(c(),e);return new g(e,t[0],t[3],512,512,this._styleRepository)}_renderCollisionBoxes(e){for(const t of this._vectorTileContainer.children)if(t.symbols){const i=[];for(const[e,s]of t.symbols)i.push(...s);C(e,i)}}};function b(e){if(r(e))return 0;switch(e.type){case"partial":return Object.keys(e.diff).length;case"complete":return Math.max(Object.keys(e.oldValue).length,Object.keys(e.newValue).length);case"collection":return Object.keys(e.added).length+Object.keys(e.changed).length+Object.keys(e.removed).length}}e([o()],L.prototype,"_fetchQueue",void 0),e([o()],L.prototype,"_parseQueue",void 0),e([o()],L.prototype,"_isTileHandlerReady",void 0),e([o()],L.prototype,"fading",void 0),L=e([h("esri.views.2d.layers.VectorTileLayerView2D")],L);const I=L;export{I 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.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Logger.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{equals as a}from"../../../geometry/support/spatialReferenceUtils.js";import{BitmapTileLayerView2D as l}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as o}from"./LayerView2D.js";import{resampleImage as h}from"./support/imageUtils.js";import n from"../tiling/TileInfoView.js";import c from"../tiling/TileKey.js";import u from"../tiling/TileQueue.js";import f from"../tiling/TileStrategy.js";import p from"../../layers/LayerView.js";import d from"../../layers/RefreshableLayerView.js";const m=[102113,102100,3857,3785,900913],y=[0,0],_=t.getLogger("esri.views.2d.layers.WMTSLayerView2D");let w=class extends(d(l(o(p)))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this._tileRequests=new Map,this.layer=null}get tileMatrixSet(){const e=this._getTileMatrixSetBySpatialReference(this.layer.activeLayer);return e?(e.id!==this.layer.activeLayer.tileMatrixSetId&&(this.layer.activeLayer.tileMatrixSetId=e.id),e):null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume()}attach(){if(!this.tileMatrixSet)return;const{tileInfo:e}=this.tileMatrixSet;this._tileInfoView=new n(e),this._fetchQueue=new u({tileInfoView:this._tileInfoView,concurrency:16,process:(e,t)=>this.fetchTile(e,t)}),this._tileStrategy=new f({cachePolicy:"keep",resampling:!0,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),this.handles.add(this.watch(["layer.activeLayer.styleId","tileMatrixSet"],(()=>this._refresh())),this.declaredClass),super.attach()}detach(){var e,t;super.detach(),this.handles.remove(this.declaredClass),null==(e=this._tileStrategy)||e.destroy(),null==(t=this._fetchQueue)||t.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",(()=>e.destroy())),this.requestUpdate()}acquireTile(e){const t=this._bitmapView.createTile(e),i=t.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(y,t.key),i.resolution=this._tileInfoView.getTileResolution(t.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._enqueueTileFetch(t),this._bitmapView.addChild(t),this.requestUpdate(),t}async doRefresh(){this.updateRequested||this.suspended||this._refresh()}isUpdating(){var e,t;return null!=(e=null==(t=this._fetchQueue)?void 0:t.updating)&&e}async fetchTile(e,t={}){const s="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:r,resamplingLevel:a=0}=t;if(!s)return this._fetchImage(e,r);const l=new c(0,0,0,0);let o;try{await s.fetchAvailabilityUpsample(e.level,e.row,e.col,l,{signal:r}),o=await this._fetchImage(l,r)}catch(n){if(i(n))throw n;if(a<3){const i=this._tileInfoView.getTileParentId(e.id);if(i){const s=new c(i),r=await this.fetchTile(s,{...t,resamplingLevel:a+1});return h(this._tileInfoView,r,s,e)}}throw n}return h(this._tileInfoView,o,l,e)}canResume(){const e=super.canResume();return e?null!==this.tileMatrixSet:e}supportsSpatialReference(e){return this.layer.activeLayer.tileMatrixSets.some((t=>a(t.tileInfo.spatialReference,e)))}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",(()=>this.requestUpdate()))}catch(t){i(t)||_.error(t)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchTile(e.level,e.row,e.col,{signal:t})}_refresh(){this._fetchQueue.reset(),this._tileStrategy.tiles.forEach((e=>{if(!e.bitmap.source)return;const t={id:e.key.id,fulfilled:!1,promise:this._fetchQueue.push(e.key).then((t=>{e.bitmap.source=t})).catch((t=>{i(t)||(e.bitmap.source=null)})).finally((()=>{e.requestRender(),t.fulfilled=!0}))};this._tileRequests.set(e,t)}))}_getTileMatrixSetBySpatialReference(e){const t=this.view.spatialReference;if(!e.tileMatrixSets)return null;let i=e.tileMatrixSets.find((e=>a(e.tileInfo.spatialReference,t)));return!i&&t.isWebMercator&&(i=e.tileMatrixSets.find((e=>m.includes(e.tileInfo.spatialReference.wkid)))),i}};e([s()],w.prototype,"_fetchQueue",void 0),e([s({readOnly:!0})],w.prototype,"tileMatrixSet",null),w=e([r("esri.views.2d.layers.WMTSLayerView2D")],w);const g=w;export{g as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Logger.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{equals as a}from"../../../geometry/support/spatialReferenceUtils.js";import{BitmapTileLayerView2D as l}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as o}from"./LayerView2D.js";import{resampleImage as h}from"./support/imageUtils.js";import n from"../tiling/TileInfoView.js";import c from"../tiling/TileKey.js";import u from"../tiling/TileQueue.js";import f from"../tiling/TileStrategy.js";import p from"../../layers/LayerView.js";import m from"../../layers/RefreshableLayerView.js";const d=[102113,102100,3857,3785,900913],y=[0,0],_=t.getLogger("esri.views.2d.layers.WMTSLayerView2D");let w=class extends(m(l(o(p)))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this._tileRequests=new Map,this.layer=null}get tileMatrixSet(){const e=this._getTileMatrixSetBySpatialReference(this.layer.activeLayer);return e?(e.id!==this.layer.activeLayer.tileMatrixSetId&&(this.layer.activeLayer.tileMatrixSetId=e.id),e):null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume()}attach(){if(!this.tileMatrixSet)return;const{tileInfo:e}=this.tileMatrixSet;this._tileInfoView=new n(e),this._fetchQueue=new u({tileInfoView:this._tileInfoView,concurrency:16,process:(e,t)=>this.fetchTile(e,t)}),this._tileStrategy=new f({cachePolicy:"keep",resampling:!0,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),this.handles.add(this.watch(["layer.activeLayer.styleId","tileMatrixSet"],(()=>this._refresh())),this.declaredClass),super.attach()}detach(){super.detach(),this.handles.remove(this.declaredClass),this._tileStrategy?.destroy(),this._fetchQueue?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",(()=>e.destroy())),this.requestUpdate()}acquireTile(e){const t=this._bitmapView.createTile(e),i=t.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(y,t.key),i.resolution=this._tileInfoView.getTileResolution(t.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._enqueueTileFetch(t),this._bitmapView.addChild(t),this.requestUpdate(),t}async doRefresh(){this.updateRequested||this.suspended||this._refresh()}isUpdating(){return this._fetchQueue?.updating??!1}async fetchTile(e,t={}){const s="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:r,resamplingLevel:a=0}=t;if(!s)return this._fetchImage(e,r);const l=new c(0,0,0,0);let o;try{await s.fetchAvailabilityUpsample(e.level,e.row,e.col,l,{signal:r}),o=await this._fetchImage(l,r)}catch(n){if(i(n))throw n;if(a<3){const i=this._tileInfoView.getTileParentId(e.id);if(i){const s=new c(i),r=await this.fetchTile(s,{...t,resamplingLevel:a+1});return h(this._tileInfoView,r,s,e)}}throw n}return h(this._tileInfoView,o,l,e)}canResume(){const e=super.canResume();return e?null!==this.tileMatrixSet:e}supportsSpatialReference(e){return this.layer.activeLayer.tileMatrixSets.some((t=>a(t.tileInfo.spatialReference,e)))}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",(()=>this.requestUpdate()))}catch(t){i(t)||_.error(t)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchTile(e.level,e.row,e.col,{signal:t})}_refresh(){this._fetchQueue.reset(),this._tileStrategy.tiles.forEach((e=>{if(!e.bitmap.source)return;const t={id:e.key.id,fulfilled:!1,promise:this._fetchQueue.push(e.key).then((t=>{e.bitmap.source=t})).catch((t=>{i(t)||(e.bitmap.source=null)})).finally((()=>{e.requestRender(),t.fulfilled=!0}))};this._tileRequests.set(e,t)}))}_getTileMatrixSetBySpatialReference(e){const t=this.view.spatialReference;if(!e.tileMatrixSets)return null;let i=e.tileMatrixSets.find((e=>a(e.tileInfo.spatialReference,t)));return!i&&t.isWebMercator&&(i=e.tileMatrixSets.find((e=>d.includes(e.tileInfo.spatialReference.wkid)))),i}};e([s()],w.prototype,"_fetchQueue",void 0),e([s({readOnly:!0})],w.prototype,"tileMatrixSet",null),w=e([r("esri.views.2d.layers.WMTSLayerView2D")],w);const g=w;export{g 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.24/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../core/CircularArray.js";import e from"../../../../core/Evented.js";import"../../../../core/has.js";import{isNone as s,isSome as a,unwrap as r}from"../../../../core/maybe.js";import{r as n}from"../../../../chunks/rbush.js";import{fromRect as i}from"../../../../geometry/support/aaBoundingBox.js";import{Store2D as o}from"./Store2D.js";import{FeatureSetReaderIndirect as d}from"./support/FeatureSetReaderPBFIndirect.js";function h(t,e){return t<<16|e}function c(t){return(4294901760&t)>>>16}function I(t){return 65535&t}const u={getObjectId:t=>t.getObjectId(),getAttributes:t=>t.readAttributes(),getAttribute:(t,e)=>t.readAttribute(e),cloneWithGeometry:(t,e)=>t,getGeometry:t=>t.readHydratedGeometry(),getCentroid:(t,e)=>t.readCentroid()};class l extends o{constructor(s,a,r){super(s,a),this.featureAdapter=u,this.events=new e,this._featureSetsByInstance=new Map,this._objectIdToDisplayId=new Map,this._spatialIndexInvalid=!0,this._indexSearchCache=new t(50),this._index=n(9,(t=>({minX:this._storage.getXMin(t),minY:this._storage.getYMin(t),maxX:this._storage.getXMax(t),maxY:this._storage.getYMax(t)}))),this._storage=a,this.mode=r}get storage(){return this._storage}get storeStatistics(){let t=0,e=0,s=0;return this.forEach((a=>{const r=a.readGeometry();r&&(e+=r.isPoint?1:r.lengths.reduce(((t,e)=>t+e),0),s+=r.isPoint?1:r.lengths.length,t+=1)})),{featureCount:t,vertexCount:e,ringCount:s}}hasInstance(t){return this._featureSetsByInstance.has(t)}onTileData(t,e){if(s(e.addOrUpdate))return e;if(e.addOrUpdate.attachStorage(this._storage),"snapshot"===this.mode){const s=e.addOrUpdate.getCursor();for(;s.next();){const e=s.getDisplayId();this.setComputedAttributes(this._storage,s,e,t.scale)}return e}this._featureSetsByInstance.set(e.addOrUpdate.instance,e.addOrUpdate);const a=e.addOrUpdate.getCursor();for(;a.next();)this._insertFeature(a,t.scale);return this._spatialIndexInvalid=!0,this.events.emit("changed"),e}search(t){this._rebuildIndex();const e=t.id,s=this._indexSearchCache.find((t=>t.tileId===e));if(a(s))return s.readers;const r=new Map,n=this._searchIndex(t.bounds),i=[];for(const a of n){const t=this._storage.getInstanceId(a),e=c(t),s=I(t);r.has(e)||r.set(e,[]);r.get(e).push(s)}return r.forEach(((t,e)=>{const s=this._featureSetsByInstance.get(e);i.push(d.from(s,t))})),this._indexSearchCache.enqueue({tileId:e,readers:i}),i}insert(t){const e=t.getCursor(),s=this._storage;for(;e.next();){var a;const t=h(e.instance,e.getIndex()),r=e.getObjectId(),n=null!=(a=this._objectIdToDisplayId.get(r))?a:this._storage.createDisplayId();e.setDisplayId(n),s.setInstanceId(n,t),this._objectIdToDisplayId.set(r,n)}this._featureSetsByInstance.set(t.instance,t),this._spatialIndexInvalid=!0}remove(t){const e=this._objectIdToDisplayId.get(t);if(!e)return;const s=this._storage.getInstanceId(e),a=I(s),r=c(s),n=this._featureSetsByInstance.get(r);this._objectIdToDisplayId.delete(t),this._storage.releaseDisplayId(e),n.removeAtIndex(a),n.isEmpty&&this._featureSetsByInstance.delete(r),this._spatialIndexInvalid=!0}forEach(t){this._objectIdToDisplayId.forEach((e=>{const s=this._storage.getInstanceId(e),a=this._lookupFeature(s);t(a)}))}forEachUnsafe(t){this._objectIdToDisplayId.forEach((e=>{const s=this._storage.getInstanceId(e),a=c(s),r=I(s),n=this._getFeatureSet(a);n.setIndex(r),t(n)}))}forEachInBounds(t,e){const s=this._searchIndex(t);for(const a of s){const t=this.lookupFeatureByDisplayId(a,this._storage);e(r(t))}}forEachBounds(t,e,s){this._rebuildIndex();const a=[0,0,0,0];for(const r of t){if(!r.readGeometry())continue;const t=r.getDisplayId();a[0]=this._storage.getXMin(t),a[1]=this._storage.getYMin(t),a[2]=this._storage.getXMax(t),a[3]=this._storage.getYMax(t),e(i(s,a))}}sweepFeatures(t,e,s){this._spatialIndexInvalid=!0,this._objectIdToDisplayId.forEach(((a,r)=>{t.has(a)||(e.releaseDisplayId(a),s&&s.unsetAttributeData(a),this._objectIdToDisplayId.delete(r))})),this.events.emit("changed")}sweepFeatureSets(t){this._spatialIndexInvalid=!0,this._featureSetsByInstance.forEach(((e,s)=>{t.has(s)||this._featureSetsByInstance.delete(s)}))}lookupObjectId(t,e){const a=this.lookupFeatureByDisplayId(t,e);return s(a)?null:a.getObjectId()}lookupDisplayId(t){return this._objectIdToDisplayId.get(t)}lookupFeatureByDisplayId(t,e){const s=e.getInstanceId(t);return this._lookupFeature(s)}lookupByDisplayIdUnsafe(t){const e=this._storage.getInstanceId(t),s=c(e),a=I(e),r=this._getFeatureSet(s);return r?(r.setIndex(a),r):null}_insertFeature(t,e){const s=this._storage,a=t.getObjectId(),r=h(t.instance,t.getIndex());s.getInstanceId(t.getDisplayId());let n=this._objectIdToDisplayId.get(a);n||(n=s.createDisplayId(),this._objectIdToDisplayId.set(a,n),this._spatialIndexInvalid=!0),t.setDisplayId(n),s.setInstanceId(n,r),this.setComputedAttributes(s,t,n,e)}_searchIndex(t){this._rebuildIndex();const e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this._index.search(e)}_rebuildIndex(){if(!this._spatialIndexInvalid)return;const t=[];"snapshot"===this.mode?this._featureSetsByInstance.forEach((e=>{const s=e.getCursor();for(;s.next();){const e=s.getDisplayId();this._storage.setBounds(e,s)&&t.push(e)}})):this._objectIdToDisplayId.forEach((e=>{const s=this._storage.getInstanceId(e);this._storage.setBounds(e,this._lookupFeature(s))&&t.push(e)})),this._index.clear(),this._index.load(t),this._indexSearchCache.clear(),this._spatialIndexInvalid=!1}_lookupFeature(t){const e=c(t),s=I(t),a=this._getFeatureSet(e);if(!a)return null;const r=a.getCursor();return r.setIndex(s),r}_getFeatureSet(t){return this._featureSetsByInstance.get(t)}}export{l as FeatureStore2D,u as featureAdapter};
5
+ import t from"../../../../core/CircularArray.js";import e from"../../../../core/Evented.js";import"../../../../core/has.js";import{isNone as s,isSome as a,unwrap as r}from"../../../../core/maybe.js";import{r as n}from"../../../../chunks/rbush.js";import{fromRect as i}from"../../../../geometry/support/aaBoundingBox.js";import{Store2D as o}from"./Store2D.js";import{FeatureSetReaderIndirect as d}from"./support/FeatureSetReaderPBFIndirect.js";function h(t,e){return t<<16|e}function c(t){return(4294901760&t)>>>16}function I(t){return 65535&t}const u={getObjectId:t=>t.getObjectId(),getAttributes:t=>t.readAttributes(),getAttribute:(t,e)=>t.readAttribute(e),cloneWithGeometry:(t,e)=>t,getGeometry:t=>t.readHydratedGeometry(),getCentroid:(t,e)=>t.readCentroid()};class l extends o{constructor(s,a,r){super(s,a),this.featureAdapter=u,this.events=new e,this._featureSetsByInstance=new Map,this._objectIdToDisplayId=new Map,this._spatialIndexInvalid=!0,this._indexSearchCache=new t(50),this._index=n(9,(t=>({minX:this._storage.getXMin(t),minY:this._storage.getYMin(t),maxX:this._storage.getXMax(t),maxY:this._storage.getYMax(t)}))),this._storage=a,this.mode=r}get storage(){return this._storage}get storeStatistics(){let t=0,e=0,s=0;return this.forEach((a=>{const r=a.readGeometry();r&&(e+=r.isPoint?1:r.lengths.reduce(((t,e)=>t+e),0),s+=r.isPoint?1:r.lengths.length,t+=1)})),{featureCount:t,vertexCount:e,ringCount:s}}hasInstance(t){return this._featureSetsByInstance.has(t)}onTileData(t,e){if(s(e.addOrUpdate))return e;if(e.addOrUpdate.attachStorage(this._storage),"snapshot"===this.mode){const s=e.addOrUpdate.getCursor();for(;s.next();){const e=s.getDisplayId();this.setComputedAttributes(this._storage,s,e,t.scale)}return e}this._featureSetsByInstance.set(e.addOrUpdate.instance,e.addOrUpdate);const a=e.addOrUpdate.getCursor();for(;a.next();)this._insertFeature(a,t.scale);return this._spatialIndexInvalid=!0,this.events.emit("changed"),e}search(t){this._rebuildIndex();const e=t.id,s=this._indexSearchCache.find((t=>t.tileId===e));if(a(s))return s.readers;const r=new Map,n=this._searchIndex(t.bounds),i=[];for(const a of n){const t=this._storage.getInstanceId(a),e=c(t),s=I(t);r.has(e)||r.set(e,[]);r.get(e).push(s)}return r.forEach(((t,e)=>{const s=this._featureSetsByInstance.get(e);i.push(d.from(s,t))})),this._indexSearchCache.enqueue({tileId:e,readers:i}),i}insert(t){const e=t.getCursor(),s=this._storage;for(;e.next();){const t=h(e.instance,e.getIndex()),a=e.getObjectId(),r=this._objectIdToDisplayId.get(a)??this._storage.createDisplayId();e.setDisplayId(r),s.setInstanceId(r,t),this._objectIdToDisplayId.set(a,r)}this._featureSetsByInstance.set(t.instance,t),this._spatialIndexInvalid=!0}remove(t){const e=this._objectIdToDisplayId.get(t);if(!e)return;const s=this._storage.getInstanceId(e),a=I(s),r=c(s),n=this._featureSetsByInstance.get(r);this._objectIdToDisplayId.delete(t),this._storage.releaseDisplayId(e),n.removeAtIndex(a),n.isEmpty&&this._featureSetsByInstance.delete(r),this._spatialIndexInvalid=!0}forEach(t){this._objectIdToDisplayId.forEach((e=>{const s=this._storage.getInstanceId(e),a=this._lookupFeature(s);t(a)}))}forEachUnsafe(t){this._objectIdToDisplayId.forEach((e=>{const s=this._storage.getInstanceId(e),a=c(s),r=I(s),n=this._getFeatureSet(a);n.setIndex(r),t(n)}))}forEachInBounds(t,e){const s=this._searchIndex(t);for(const a of s){const t=this.lookupFeatureByDisplayId(a,this._storage);e(r(t))}}forEachBounds(t,e,s){this._rebuildIndex();const a=[0,0,0,0];for(const r of t){if(!r.readGeometry())continue;const t=r.getDisplayId();a[0]=this._storage.getXMin(t),a[1]=this._storage.getYMin(t),a[2]=this._storage.getXMax(t),a[3]=this._storage.getYMax(t),e(i(s,a))}}sweepFeatures(t,e,s){this._spatialIndexInvalid=!0,this._objectIdToDisplayId.forEach(((a,r)=>{t.has(a)||(e.releaseDisplayId(a),s&&s.unsetAttributeData(a),this._objectIdToDisplayId.delete(r))})),this.events.emit("changed")}sweepFeatureSets(t){this._spatialIndexInvalid=!0,this._featureSetsByInstance.forEach(((e,s)=>{t.has(s)||this._featureSetsByInstance.delete(s)}))}lookupObjectId(t,e){const a=this.lookupFeatureByDisplayId(t,e);return s(a)?null:a.getObjectId()}lookupDisplayId(t){return this._objectIdToDisplayId.get(t)}lookupFeatureByDisplayId(t,e){const s=e.getInstanceId(t);return this._lookupFeature(s)}lookupByDisplayIdUnsafe(t){const e=this._storage.getInstanceId(t),s=c(e),a=I(e),r=this._getFeatureSet(s);return r?(r.setIndex(a),r):null}_insertFeature(t,e){const s=this._storage,a=t.getObjectId(),r=h(t.instance,t.getIndex());s.getInstanceId(t.getDisplayId());let n=this._objectIdToDisplayId.get(a);n||(n=s.createDisplayId(),this._objectIdToDisplayId.set(a,n),this._spatialIndexInvalid=!0),t.setDisplayId(n),s.setInstanceId(n,r),this.setComputedAttributes(s,t,n,e)}_searchIndex(t){this._rebuildIndex();const e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this._index.search(e)}_rebuildIndex(){if(!this._spatialIndexInvalid)return;const t=[];"snapshot"===this.mode?this._featureSetsByInstance.forEach((e=>{const s=e.getCursor();for(;s.next();){const e=s.getDisplayId();this._storage.setBounds(e,s)&&t.push(e)}})):this._objectIdToDisplayId.forEach((e=>{const s=this._storage.getInstanceId(e);this._storage.setBounds(e,this._lookupFeature(s))&&t.push(e)})),this._index.clear(),this._index.load(t),this._indexSearchCache.clear(),this._spatialIndexInvalid=!1}_lookupFeature(t){const e=c(t),s=I(t),a=this._getFeatureSet(e);if(!a)return null;const r=a.getCursor();return r.setIndex(s),r}_getFeatureSet(t){return this._featureSetsByInstance.get(t)}}export{l as FeatureStore2D,u as featureAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../../core/HandleOwner.js";import"../../../../core/has.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as o}from"../../../../geometry/support/spatialReferenceUtils.js";import i from"../../../../layers/support/TileInfo.js";import{loadProcessorModule as l}from"./processors.js";import n from"./controllers/FeatureController2D.js";import a from"./support/TileStore.js";import{UpdateToken as c}from"./support/UpdateToken.js";import p from"../../tiling/TileInfoView.js";let h=class extends t{constructor(){super(...arguments),this.controller=null,this.processor=null,this.remoteClient=null,this.tileStore=null,this.service=null,this.viewState=null,this._paused=!1,this._pendingTileUpdates=[]}initialize(){this.handles.add(this.watch("updating",(e=>{this.remoteClient.invoke("setUpdating",e).catch((e=>{}))})))}destroy(){var e,t;this.stop(),null==(e=this.controller)||e.destroy(),null==(t=this.processor)||t.destroy(),this.controller=this.processor=this.tileStore=this.remoteClient=null}get updating(){return!this.controller||this.controller.updating}stop(){var e,t,r;this._paused=!0,Array.isArray(null==(e=this.service)?void 0:e.source)&&(this.service.source.forEach((e=>e.close())),this.service.source.length=0),null==(t=this.tileStore)||t.updateTiles({added:[],removed:this.tileStore.tiles.map((e=>e.id))}),null==(r=this.tileStore)||r.destroy(),this.tileStore=null,this._pendingTileUpdates.length=0}async startup({service:e,config:t,tileInfo:r,tiles:s}){var l;if(this._paused=!0,Array.isArray(null==(l=this.service)?void 0:l.source)&&(this.service.source.forEach((e=>e.close())),this.service.source.length=0),this.service=e,!this.tileStore||!o(this.tileStore.tileScheme.spatialReference,r.spatialReference)){var n,c;const e=new p(i.fromJSON(r));s.added.length=s.removed.length=0,null==(n=this.tileStore)||n.updateTiles({added:[],removed:this.tileStore.tiles.map((e=>e.id))}),null==(c=this.tileStore)||c.destroy(),this.tileStore=new a(e),this._pendingTileUpdates.length=0}for(await this._createProcessorAndController(t),await this.update({config:t}),this.controller.resume(),this.tileStore.clear(),this.tileStore.updateTiles(s),this._paused=!1;this._pendingTileUpdates.length;)this.tileStore.updateTiles(this._pendingTileUpdates.pop())}async updateTiles(e){this._paused?this._pendingTileUpdates.push(e):this.tileStore.updateTiles(e)}async update({config:e}){const t=c.empty();return await Promise.all([this.processor.update(t,e),this.controller.update(t,e)]),t.toJSON()}async applyUpdate(e){return this.controller.applyUpdate(c.create(e))}async _createProcessorAndController(e){await Promise.all([this._handleControllerConfig(e),this._handleProcessorConfig(e)]),this.controller.processor=this.processor}async _handleControllerConfig(e){const t=await this._createController(this.service,e);return await t.startup(),t}async _handleProcessorConfig(e){return this._createProcessor(this.service,e)}async _createController(e,t){this.controller&&this.controller.destroy();const{tileStore:r,remoteClient:s}=this,o=new n({service:e,config:t,tileStore:r,remoteClient:s});return this.controller=o,o}async _createProcessor(e,t){const r=t.schema.processors[0].type,s=(await l(r)).default,{remoteClient:o,tileStore:i}=this,n=new s({service:e,config:t,tileStore:i,remoteClient:o});return this.processor&&this.processor.destroy(),this.processor=n,n}};e([r()],h.prototype,"controller",void 0),e([r()],h.prototype,"processor",void 0),e([r()],h.prototype,"updating",null),e([r()],h.prototype,"viewState",void 0),h=e([s("esri.views.2d.layers.features.Pipeline")],h);const d=h;export{d as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../../core/HandleOwner.js";import"../../../../core/has.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as o}from"../../../../geometry/support/spatialReferenceUtils.js";import i from"../../../../layers/support/TileInfo.js";import{loadProcessorModule as l}from"./processors.js";import n from"./controllers/FeatureController2D.js";import a from"./support/TileStore.js";import{UpdateToken as c}from"./support/UpdateToken.js";import p from"../../tiling/TileInfoView.js";let h=class extends t{constructor(){super(...arguments),this.controller=null,this.processor=null,this.remoteClient=null,this.tileStore=null,this.service=null,this.viewState=null,this._paused=!1,this._pendingTileUpdates=[]}initialize(){this.handles.add(this.watch("updating",(e=>{this.remoteClient.invoke("setUpdating",e).catch((e=>{}))})))}destroy(){this.stop(),this.controller?.destroy(),this.processor?.destroy(),this.controller=this.processor=this.tileStore=this.remoteClient=null}get updating(){return!this.controller||this.controller.updating}stop(){this._paused=!0,Array.isArray(this.service?.source)&&(this.service.source.forEach((e=>e.close())),this.service.source.length=0),this.tileStore?.updateTiles({added:[],removed:this.tileStore.tiles.map((e=>e.id))}),this.tileStore?.destroy(),this.tileStore=null,this._pendingTileUpdates.length=0}async startup({service:e,config:t,tileInfo:r,tiles:s}){if(this._paused=!0,Array.isArray(this.service?.source)&&(this.service.source.forEach((e=>e.close())),this.service.source.length=0),this.service=e,!this.tileStore||!o(this.tileStore.tileScheme.spatialReference,r.spatialReference)){const e=new p(i.fromJSON(r));s.added.length=s.removed.length=0,this.tileStore?.updateTiles({added:[],removed:this.tileStore.tiles.map((e=>e.id))}),this.tileStore?.destroy(),this.tileStore=new a(e),this._pendingTileUpdates.length=0}for(await this._createProcessorAndController(t),await this.update({config:t}),this.controller.resume(),this.tileStore.clear(),this.tileStore.updateTiles(s),this._paused=!1;this._pendingTileUpdates.length;)this.tileStore.updateTiles(this._pendingTileUpdates.pop())}async updateTiles(e){this._paused?this._pendingTileUpdates.push(e):this.tileStore.updateTiles(e)}async update({config:e}){const t=c.empty();return await Promise.all([this.processor.update(t,e),this.controller.update(t,e)]),t.toJSON()}async applyUpdate(e){return this.controller.applyUpdate(c.create(e))}async _createProcessorAndController(e){await Promise.all([this._handleControllerConfig(e),this._handleProcessorConfig(e)]),this.controller.processor=this.processor}async _handleControllerConfig(e){const t=await this._createController(this.service,e);return await t.startup(),t}async _handleProcessorConfig(e){return this._createProcessor(this.service,e)}async _createController(e,t){this.controller&&this.controller.destroy();const{tileStore:r,remoteClient:s}=this,o=new n({service:e,config:t,tileStore:r,remoteClient:s});return this.controller=o,o}async _createProcessor(e,t){const r=t.schema.processors[0].type,s=(await l(r)).default,{remoteClient:o,tileStore:i}=this,n=new s({service:e,config:t,tileStore:i,remoteClient:o});return this.processor&&this.processor.destroy(),this.processor=n,n}};e([r()],h.prototype,"controller",void 0),e([r()],h.prototype,"processor",void 0),e([r()],h.prototype,"updating",null),e([r()],h.prototype,"viewState",void 0),h=e([s("esri.views.2d.layers.features.Pipeline")],h);const d=h;export{d 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.24/esri/copyright.txt for details.
4
4
  */
5
- import{createResolver as t,throwIfAborted as e}from"../../../../core/promiseUtils.js";function o(o,r,n){var l;const c=null!=(l=null==n?void 0:n.batchSize)?l:100,i=500,s=t();let a=0;const m=()=>{const t=Date.now();let l=!1,h=0;for(;!l&&h<i;){try{for(n&&e(n);a<Math.min(a+c,o.length);a++)r(o[a])}catch(u){s.reject(u)}h=Date.now()-t,l=a>=o.length}l?s.resolve():setTimeout(m,0)};return m(),s.promise}export{o as executeForEachAsync};
5
+ import{createResolver as t,throwIfAborted as e}from"../../../../core/promiseUtils.js";function o(o,r,n){const c=n?.batchSize??100,s=500,i=t();let l=0;const m=()=>{const t=Date.now();let a=!1,h=0;for(;!a&&h<s;){try{for(n&&e(n);l<Math.min(l+c,o.length);l++)r(o[l])}catch(f){i.reject(f)}h=Date.now()-t,a=l>=o.length}a?i.resolve():setTimeout(m,0)};return m(),i.promise}export{o as executeForEachAsync};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../../../core/HandleOwner.js";import s from"../../../../../core/has.js";import{isNone as r,isSome as i}from"../../../../../core/maybe.js";import{ignoreAbortErrors as a,after as o,throwIfAborted as n,throwIfNotAbortError as u,isAbortError as h}from"../../../../../core/promiseUtils.js";import{whenOnce as c}from"../../../../../core/reactiveUtils.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{convertToGeometry as p}from"../../../../../layers/graphics/featureConversionUtils.js";import{QueryEngine as g}from"../../../../../layers/graphics/data/QueryEngine.js";import f from"../../../../../layers/support/FieldsIndex.js";import{FeatureStore2D as y}from"../FeatureStore2D.js";import{createSource as m}from"../sources/createSource.js";import _ from"../support/AttributeStore.js";import{ClusterStore as S}from"../support/ClusterStore.js";import{ComputedAttributeStorage as v}from"../support/ComputedAttributeStorage.js";import{FeatureSetReaderJSON as b}from"../support/FeatureSetReaderJSON.js";import{UpdateToken as I}from"../support/UpdateToken.js";import{QueueProcessor as w}from"../../../../support/QueueProcessor.js";const C=5e3,E="tileRenderer.featuresView.attributeView.initialize",j="tileRenderer.featuresView.attributeView.requestUpdate",F="tileRenderer.featuresView.requestRender";function k(e){return"worker:port-closed"===e.name}function T(e){if(!h(e)&&!k(e))throw e}function q(e){return"feature"===e.type&&"snapshot"===e.mode}let A=class extends t{constructor(){super(...arguments),this._storage=new v,this._markedIdsBufId=this._storage.createBitset(),this._lastCleanup=performance.now(),this._cleanupNeeded=!1,this._invalidated=!1,this._tileToResolver=new Map,this._didEdit=!1,this._updateVersion=1,this.tileStore=null,this.config=null,this.processor=null,this.remoteClient=null,this.service=null}initialize(){this._initAttributeStore(),this._initStores(),this._initQueryEngine(),this._initSource(),this._updateQueue=new w({concurrency:"geoevent"===this._source.type?1:4,process:(e,t)=>this._onTileMessage(e,{signal:t})}),this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this)),this.watch("updating",(e=>!e&&this.onIdle()))]),this._checkUpdating=setInterval((()=>this.notifyChange("updating")),300)}async startup(){this._initAttributeStore()}_initSource(){const e=this.tileStore.tileScheme,t=()=>this._updateQueue.length<50,s=(e,t)=>(this._invalidated=!0,this._patchTile(e,t));this._source=m(this.service,this.spatialReference,e,s,t,this.featureStore),this._proxyEvents()}_proxyEvents(){if("geoevent"===this._source.type){const e=this._source.events;this.handles.add([e.on("connectionStatus",(e=>this.remoteClient.invoke("setProperty",{propertyName:"connectionStatus",value:e}).catch(T))),e.on("errorString",(e=>this.remoteClient.invoke("setProperty",{propertyName:"errorString",value:e}).catch(T))),e.on("feature",(e=>this.remoteClient.invoke("emitEvent",{name:"data-received",event:{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry}}).catch(T))),e.on("updateRate",(e=>this.remoteClient.invoke("emitEvent",{name:"update-rate",event:{...e}}).catch(T)))])}}_initAttributeStore(){this.attributeStore?this.attributeStore.invalidateResources():this.attributeStore=new _({type:"remote",initialize:(e,t)=>a(this.remoteClient.invoke(E,e,{signal:t}).catch(T)),update:(e,t)=>a(this.remoteClient.invoke(j,e,{signal:t}).catch(T)),render:e=>a(this.remoteClient.invoke(F,void 0,{signal:e}).catch(T))},this.config)}_initStores(){const e="snapshot"===this.service.type?"snapshot":"on-demand",t={geometryInfo:{geometryType:this.service.geometryType,hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.featureStore=new y(t,this._storage,e),this.aggregateStore=new S(t,this.spatialReference,this._storage,this.service),this.handles.add(this.aggregateStore.events.on("valueRangesChanged",(e=>{this.remoteClient.invoke("emitEvent",{name:"valueRangesChanged",event:{valueRanges:e.valueRanges}}).catch(T)})))}_initQueryEngine(){var e;const t=this;null==(e=this.queryEngine)||e.destroy(),this.queryEngine=new g({definitionExpression:this.config.definitionExpression,fields:this.service.fields,geometryType:this.service.geometryType,objectIdField:this.service.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!0,featureStore:this.featureStore,aggregateAdapter:{getFeatureObjectIds:e=>t.aggregateStore.getFeatureDisplayIdsForAggregate(e).map((e=>t.getObjectId(e)))},timeInfo:this.service.timeInfo})}destroy(){this._updateQueue.destroy(),this._source.destroy(),this.queryEngine.destroy(),this.attributeStore&&this.attributeStore.destroy();for(const e of this.tileStore.tiles)this._source.unsubscribe(e);clearInterval(this._checkUpdating)}get fieldsIndex(){return new f(this.service.fields)}get hasAggregates(){return!!this.config.schema.targets.aggregate}get spatialReference(){return this.tileStore.tileScheme.spatialReference}get updating(){return this.isUpdating()}isUpdating(){return this._source.updating||!!this._updateQueue.length}enableEvent(e){this._source.enableEvent(e.name,e.value)}pause(){this._updateQueue.pause(),this._updateQueue.clear()}resume(){this._updateQueue.resume()}pauseStream(){"geoevent"===this._source.type&&this._source.pauseStream()}resumeStream(){"geoevent"===this._source.type&&this._source.resumeStream()}async update(e,t){this._updateVersion++,this._set("config",t),this._schema=t.schema,this._initQueryEngine(),this.pause(),await Promise.all([this._source.update(e,t.schema.source),this.featureStore.updateSchema(e,t.schema.targets.feature),this.attributeStore.update(e,t),this.attributeStore.updateFilters(e,this)]),await this.aggregateStore.updateSchema(e,t.schema.targets.aggregate),s("esri-2d-update-debug")&&e.describe()}async applyUpdate(e){e.version=this._updateVersion,s("esri-2d-update-debug")&&console.debug(`Applying update ${e.version}`),e.mesh&&this.clearTiles(),this._updateQueue.resume(),await this._source.applyUpdate(e),this.notifyChange("updating"),await c((()=>!this.updating)),this.hasAggregates&&(await o(10),await c((()=>!this.updating)))}async onEdits({edits:e}){s("esri-2d-update-debug")&&console.debug("Applying Edit:",e),this._didEdit=!0;try{const t=e.removed.map((e=>e.objectId&&-1!==e.objectId?e.objectId:this._lookupObjectIdByGlobalId(e.globalId))),s=e.addOrModified.map((({objectId:e})=>e));this.featureStore.invalidate(),await this._source.edit(s,t),this.clearTiles(),this.notifyChange("updating"),this.aggregateStore.clear(),await this._source.resend(),await c((()=>!this.updating))}catch(t){}}async refresh(e){if(!e){const e=I.empty();return e.storage.filters=!0,this.applyUpdate(e)}this.featureStore.invalidate(),this.clearTiles(),this._source.refresh(this._updateVersion),this._cleanupNeeded=!0,this.notifyChange("updating"),await c((()=>!this.updating))}clearTiles(){for(const e of this.tileStore.tiles)this.processor.onTileClear(e)}onTileUpdate(e){this.aggregateStore.onTileUpdate(e);for(const t of e.added)this._source.subscribe(t,this._updateVersion),this._level=t.level;for(const t of e.removed)this._source.unsubscribe(t),this._cleanupNeeded=!0,this._tileToResolver.has(t.id)&&(this._tileToResolver.get(t.id).resolve(),this._tileToResolver.delete(t.id));this.notifyChange("updating")}async onIdle(){this._invalidated&&(this._invalidated=!1,(this.hasAggregates||"heatmap"===this.processor.type)&&await this._repushCurrentLevelTiles()),this._markAndSweep()}async querySummaryStatistics({query:e,params:t}){return this.queryEngine.executeQueryForSummaryStatistics(e,t)}async queryUniqueValues({query:e,params:t}){return this.queryEngine.executeQueryForUniqueValues(e,t)}async queryClassBreaks({query:e,params:t}){return this.queryEngine.executeQueryForClassBreaks(e,t)}async queryHistogram({query:e,params:t}){return this.queryEngine.executeQueryForHistogram(e,t)}queryExtent(e){return this.queryEngine.executeQueryForExtent(e)}queryFeatures(e){return this.queryEngine.executeQuery(e)}async queryVisibleFeatures(e){const t=await this.queryEngine.executeQuery(e),s=t.objectIdFieldName;return t.features=t.features.filter((e=>{const t=e.attributes[s],r=this.getDisplayId(t);return this.attributeStore.isVisible(r)})),t}queryFeatureCount(e){return this.queryEngine.executeQueryForCount(e)}queryLatestObservations(e){return this.queryEngine.executeQueryForLatestObservations(e)}queryObjectIds(e){return this.queryEngine.executeQueryForIds(e)}async queryStatistics(){return this.featureStore.storeStatistics}getObjectId(e){return this.featureStore.lookupObjectId(e,this._storage)}getDisplayId(e){if(this._schema.targets.aggregate){const t=this.aggregateStore.getDisplayId(e);if(r(t)){const t=this.featureStore.lookupDisplayId(e);return this.aggregateStore.getDisplayIdForReferenceId(t)}return t}return this.featureStore.lookupDisplayId(e)}getFeatures(e){const t=[],s=[];for(const r of e){const e=this.hasAggregates?this.getAggregate(r):null;if(i(e))if(i(e.referenceId)){const s=this.getFeature(e.referenceId);i(s)&&t.push(s)}else s.push(e);else{const e=this.getFeature(r);i(e)&&t.push(e)}}return{features:t,aggregates:s}}getFeature(e){const t=this.featureStore.lookupFeatureByDisplayId(e,this._storage);if(r(t))return null;const s=t.readHydratedGeometry(),i=p(s,t.geometryType,t.hasZ,t.hasM);return{attributes:t.readAttributes(),geometry:i}}getAggregate(e){return this.aggregateStore.getAggregate(e)}getAggregates(){return this.aggregateStore.getAggregates()}async setHighlight(e){const t=e.map((e=>this.getDisplayId(e)));return this.attributeStore.setHighlight(e,t)}_lookupObjectIdByGlobalId(e){const t=this.service.globalIdField;if(r(t))throw new Error("Expected globalIdField to be defined");let s=null;if(this.featureStore.forEach((r=>{e===r.readAttribute(t)&&(s=r.getObjectId())})),r(s))throw new Error(`Expected to find a feature with globalId ${e}`);return s}async _repushCurrentLevelTiles(){const e=this.tileStore.tiles.filter((e=>e.level===this._level)).map((async e=>this._patchTile({type:"append",id:e.key.id,addOrUpdate:b.fromOptimizedFeatures([],this.service),remove:[],end:!0,status:I.empty()})));await Promise.all(e)}_maybeForceCleanup(){performance.now()-this._lastCleanup>C&&this._markAndSweep()}_patchTile(e,t){const s=this._updateQueue.push(e,t).then((()=>{this.notifyChange("updating")})).catch((e=>{this.notifyChange("updating")}));return this.notifyChange("updating"),s}async _onTileMessage(e,t){n(t);const s=this.tileStore.get(e.id);if(!s)return;if(e.clear)return this.processor.onTileClear(s);const i=e.status;this._cleanupNeeded=!0;const a=[];for(const r of e.remove){const e=this.featureStore.lookupDisplayId(r);e&&a.push(e)}e.remove=a;try{if(r(e.addOrUpdate))return void this.processor.onTileMessage(s,{...e,addOrUpdate:null},this.hasAggregates,t).catch(u);if(e.addOrUpdate.setArcadeSpatialReference(this.spatialReference),this.featureStore.hasInstance(e.addOrUpdate.instance)&&i.targets.feature||(i.targets.feature=!0,this.featureStore.onTileData(s,e)),!i.storage.data||!i.storage.filters){i.storage.data=!0,i.storage.filters=!0,this.attributeStore.onTileData(s,e);"geoevent"===this._source.type||this._didEdit?(await this.attributeStore.sendUpdates(),n(t)):this.attributeStore.sendUpdates()}if(this.hasAggregates&&!i.targets.aggregate){i.targets.aggregate=!0;const t=q(this._source)&&this._source.loading,r=!q(this._source)||t||e.end;if(this.aggregateStore.onTileData(s,e,this._storage,this.attributeStore,r),!r)return;i.mesh||(this.attributeStore.onTileData(s,e),await this.attributeStore.sendUpdates(),this.processor.onTileClear(s))}i.mesh||(i.mesh=!0,await this.processor.onTileMessage(s,e,this.hasAggregates,t),n(t)),this._maybeForceCleanup()}catch(o){u(o)}}_mark(e,t,s){const r=(4294901760&this._storage.getInstanceId(e))>>>16;e&&(t.add(r),s.set(e))}_markAndSweep(){this._lastCleanup=performance.now();if(!(!("feature"===this._source.type&&"snapshot"===this._source.mode)&&("geoevent"===this._source.type||this._cleanupNeeded)))return;this._cleanupNeeded=!1;const e=this._storage.getBitset(this._markedIdsBufId),t=new Set;e.clear();for(const s of this.tileStore.tiles)for(const r of this._source.readers(s.id)){const s=r.getCursor();for(;s.next();){let r=s.getDisplayId();if(!r){const e=s.getObjectId();r=this.featureStore.lookupDisplayId(e)}this._mark(r,t,e)}}"symbol"===this.processor.type&&this.processor.forEachBufferId((s=>{this._mark(s,t,e)})),this._updateQueue.forEach((s=>{for(const r of s.remove){const s=this.featureStore.lookupDisplayId(r);this._mark(s,t,e)}})),this.config.schema.targets.aggregate&&(this.aggregateStore.sweepFeatures(e,this.featureStore),this.aggregateStore.sweepClusters(this._storage,this.attributeStore,this._level)),this.featureStore.sweepFeatures(e,this._storage,this.attributeStore),this.featureStore.sweepFeatureSets(t)}};e([d({constructOnly:!0})],A.prototype,"tileStore",void 0),e([d()],A.prototype,"config",void 0),e([d({readOnly:!0})],A.prototype,"fieldsIndex",null),e([d()],A.prototype,"processor",void 0),e([d({constructOnly:!0})],A.prototype,"remoteClient",void 0),e([d({constructOnly:!0})],A.prototype,"service",void 0),e([d()],A.prototype,"spatialReference",null),e([d()],A.prototype,"updating",null),A=e([l("esri.views.2d.layers.features.controllers.FeatureController2D")],A);const R=A;export{R as default};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../../../core/HandleOwner.js";import s from"../../../../../core/has.js";import{isNone as r,isSome as i}from"../../../../../core/maybe.js";import{ignoreAbortErrors as a,after as o,throwIfAborted as n,throwIfNotAbortError as u,isAbortError as h}from"../../../../../core/promiseUtils.js";import{whenOnce as c}from"../../../../../core/reactiveUtils.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";import{convertToGeometry as l}from"../../../../../layers/graphics/featureConversionUtils.js";import{QueryEngine as g}from"../../../../../layers/graphics/data/QueryEngine.js";import f from"../../../../../layers/support/FieldsIndex.js";import{FeatureStore2D as y}from"../FeatureStore2D.js";import{createSource as m}from"../sources/createSource.js";import _ from"../support/AttributeStore.js";import{ClusterStore as S}from"../support/ClusterStore.js";import{ComputedAttributeStorage as v}from"../support/ComputedAttributeStorage.js";import{FeatureSetReaderJSON as b}from"../support/FeatureSetReaderJSON.js";import{UpdateToken as I}from"../support/UpdateToken.js";import{QueueProcessor as w}from"../../../../support/QueueProcessor.js";const C=5e3,E="tileRenderer.featuresView.attributeView.initialize",j="tileRenderer.featuresView.attributeView.requestUpdate",F="tileRenderer.featuresView.requestRender";function k(e){return"worker:port-closed"===e.name}function T(e){if(!h(e)&&!k(e))throw e}function q(e){return"feature"===e.type&&"snapshot"===e.mode}let A=class extends t{constructor(){super(...arguments),this._storage=new v,this._markedIdsBufId=this._storage.createBitset(),this._lastCleanup=performance.now(),this._cleanupNeeded=!1,this._invalidated=!1,this._tileToResolver=new Map,this._didEdit=!1,this._updateVersion=1,this.tileStore=null,this.config=null,this.processor=null,this.remoteClient=null,this.service=null}initialize(){this._initAttributeStore(),this._initStores(),this._initQueryEngine(),this._initSource(),this._updateQueue=new w({concurrency:"geoevent"===this._source.type?1:4,process:(e,t)=>this._onTileMessage(e,{signal:t})}),this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this)),this.watch("updating",(e=>!e&&this.onIdle()))]),this._checkUpdating=setInterval((()=>this.notifyChange("updating")),300)}async startup(){this._initAttributeStore()}_initSource(){const e=this.tileStore.tileScheme,t=()=>this._updateQueue.length<50,s=(e,t)=>(this._invalidated=!0,this._patchTile(e,t));this._source=m(this.service,this.spatialReference,e,s,t,this.featureStore),this._proxyEvents()}_proxyEvents(){if("geoevent"===this._source.type){const e=this._source.events;this.handles.add([e.on("connectionStatus",(e=>this.remoteClient.invoke("setProperty",{propertyName:"connectionStatus",value:e}).catch(T))),e.on("errorString",(e=>this.remoteClient.invoke("setProperty",{propertyName:"errorString",value:e}).catch(T))),e.on("feature",(e=>this.remoteClient.invoke("emitEvent",{name:"data-received",event:{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry}}).catch(T))),e.on("updateRate",(e=>this.remoteClient.invoke("emitEvent",{name:"update-rate",event:{...e}}).catch(T)))])}}_initAttributeStore(){this.attributeStore?this.attributeStore.invalidateResources():this.attributeStore=new _({type:"remote",initialize:(e,t)=>a(this.remoteClient.invoke(E,e,{signal:t}).catch(T)),update:(e,t)=>a(this.remoteClient.invoke(j,e,{signal:t}).catch(T)),render:e=>a(this.remoteClient.invoke(F,void 0,{signal:e}).catch(T))},this.config)}_initStores(){const e="snapshot"===this.service.type?"snapshot":"on-demand",t={geometryInfo:{geometryType:this.service.geometryType,hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.featureStore=new y(t,this._storage,e),this.aggregateStore=new S(t,this.spatialReference,this._storage,this.service),this.handles.add(this.aggregateStore.events.on("valueRangesChanged",(e=>{this.remoteClient.invoke("emitEvent",{name:"valueRangesChanged",event:{valueRanges:e.valueRanges}}).catch(T)})))}_initQueryEngine(){const e=this;this.queryEngine?.destroy(),this.queryEngine=new g({definitionExpression:this.config.definitionExpression,fields:this.service.fields,geometryType:this.service.geometryType,objectIdField:this.service.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!0,featureStore:this.featureStore,aggregateAdapter:{getFeatureObjectIds:t=>e.aggregateStore.getFeatureDisplayIdsForAggregate(t).map((t=>e.getObjectId(t)))},timeInfo:this.service.timeInfo})}destroy(){this._updateQueue.destroy(),this._source.destroy(),this.queryEngine.destroy(),this.attributeStore&&this.attributeStore.destroy();for(const e of this.tileStore.tiles)this._source.unsubscribe(e);clearInterval(this._checkUpdating)}get fieldsIndex(){return new f(this.service.fields)}get hasAggregates(){return!!this.config.schema.targets.aggregate}get spatialReference(){return this.tileStore.tileScheme.spatialReference}get updating(){return this.isUpdating()}isUpdating(){return this._source.updating||!!this._updateQueue.length}enableEvent(e){this._source.enableEvent(e.name,e.value)}pause(){this._updateQueue.pause(),this._updateQueue.clear()}resume(){this._updateQueue.resume()}pauseStream(){"geoevent"===this._source.type&&this._source.pauseStream()}resumeStream(){"geoevent"===this._source.type&&this._source.resumeStream()}async update(e,t){this._updateVersion++,this._set("config",t),this._schema=t.schema,this._initQueryEngine(),this.pause(),await Promise.all([this._source.update(e,t.schema.source),this.featureStore.updateSchema(e,t.schema.targets.feature),this.attributeStore.update(e,t),this.attributeStore.updateFilters(e,this)]),await this.aggregateStore.updateSchema(e,t.schema.targets.aggregate),s("esri-2d-update-debug")&&e.describe()}async applyUpdate(e){e.version=this._updateVersion,s("esri-2d-update-debug")&&console.debug(`Applying update ${e.version}`),e.mesh&&this.clearTiles(),this._updateQueue.resume(),await this._source.applyUpdate(e),this.notifyChange("updating"),await c((()=>!this.updating)),this.hasAggregates&&(await o(10),await c((()=>!this.updating)))}async onEdits({edits:e}){s("esri-2d-update-debug")&&console.debug("Applying Edit:",e),this._didEdit=!0;try{const t=e.removed.map((e=>e.objectId&&-1!==e.objectId?e.objectId:this._lookupObjectIdByGlobalId(e.globalId))),s=e.addOrModified.map((({objectId:e})=>e));this.featureStore.invalidate(),await this._source.edit(s,t),this.clearTiles(),this.notifyChange("updating"),this.aggregateStore.clear(),await this._source.resend(),await c((()=>!this.updating))}catch(t){}}async refresh(e){if(!e){const e=I.empty();return e.storage.filters=!0,this.applyUpdate(e)}this.featureStore.invalidate(),this.clearTiles(),this._source.refresh(this._updateVersion),this._cleanupNeeded=!0,this.notifyChange("updating"),await c((()=>!this.updating))}clearTiles(){for(const e of this.tileStore.tiles)this.processor.onTileClear(e)}onTileUpdate(e){this.aggregateStore.onTileUpdate(e);for(const t of e.added)this._source.subscribe(t,this._updateVersion),this._level=t.level;for(const t of e.removed)this._source.unsubscribe(t),this._cleanupNeeded=!0,this._tileToResolver.has(t.id)&&(this._tileToResolver.get(t.id).resolve(),this._tileToResolver.delete(t.id));this.notifyChange("updating")}async onIdle(){this._invalidated&&(this._invalidated=!1,(this.hasAggregates||"heatmap"===this.processor.type)&&await this._repushCurrentLevelTiles()),this._markAndSweep()}async querySummaryStatistics({query:e,params:t}){return this.queryEngine.executeQueryForSummaryStatistics(e,t)}async queryUniqueValues({query:e,params:t}){return this.queryEngine.executeQueryForUniqueValues(e,t)}async queryClassBreaks({query:e,params:t}){return this.queryEngine.executeQueryForClassBreaks(e,t)}async queryHistogram({query:e,params:t}){return this.queryEngine.executeQueryForHistogram(e,t)}queryExtent(e){return this.queryEngine.executeQueryForExtent(e)}queryFeatures(e){return this.queryEngine.executeQuery(e)}async queryVisibleFeatures(e){const t=await this.queryEngine.executeQuery(e),s=t.objectIdFieldName;return t.features=t.features.filter((e=>{const t=e.attributes[s],r=this.getDisplayId(t);return this.attributeStore.isVisible(r)})),t}queryFeatureCount(e){return this.queryEngine.executeQueryForCount(e)}queryLatestObservations(e){return this.queryEngine.executeQueryForLatestObservations(e)}queryObjectIds(e){return this.queryEngine.executeQueryForIds(e)}async queryStatistics(){return this.featureStore.storeStatistics}getObjectId(e){return this.featureStore.lookupObjectId(e,this._storage)}getDisplayId(e){if(this._schema.targets.aggregate){const t=this.aggregateStore.getDisplayId(e);if(r(t)){const t=this.featureStore.lookupDisplayId(e);return this.aggregateStore.getDisplayIdForReferenceId(t)}return t}return this.featureStore.lookupDisplayId(e)}getFeatures(e){const t=[],s=[];for(const r of e){const e=this.hasAggregates?this.getAggregate(r):null;if(i(e))if(i(e.referenceId)){const s=this.getFeature(e.referenceId);i(s)&&t.push(s)}else s.push(e);else{const e=this.getFeature(r);i(e)&&t.push(e)}}return{features:t,aggregates:s}}getFeature(e){const t=this.featureStore.lookupFeatureByDisplayId(e,this._storage);if(r(t))return null;const s=t.readHydratedGeometry(),i=l(s,t.geometryType,t.hasZ,t.hasM);return{attributes:t.readAttributes(),geometry:i}}getAggregate(e){return this.aggregateStore.getAggregate(e)}getAggregates(){return this.aggregateStore.getAggregates()}async setHighlight(e){const t=e.map((e=>this.getDisplayId(e)));return this.attributeStore.setHighlight(e,t)}_lookupObjectIdByGlobalId(e){const t=this.service.globalIdField;if(r(t))throw new Error("Expected globalIdField to be defined");let s=null;if(this.featureStore.forEach((r=>{e===r.readAttribute(t)&&(s=r.getObjectId())})),r(s))throw new Error(`Expected to find a feature with globalId ${e}`);return s}async _repushCurrentLevelTiles(){const e=this.tileStore.tiles.filter((e=>e.level===this._level)).map((async e=>this._patchTile({type:"append",id:e.key.id,addOrUpdate:b.fromOptimizedFeatures([],this.service),remove:[],end:!0,status:I.empty()})));await Promise.all(e)}_maybeForceCleanup(){performance.now()-this._lastCleanup>C&&this._markAndSweep()}_patchTile(e,t){const s=this._updateQueue.push(e,t).then((()=>{this.notifyChange("updating")})).catch((e=>{this.notifyChange("updating")}));return this.notifyChange("updating"),s}async _onTileMessage(e,t){n(t);const s=this.tileStore.get(e.id);if(!s)return;if(e.clear)return this.processor.onTileClear(s);const i=e.status;this._cleanupNeeded=!0;const a=[];for(const r of e.remove){const e=this.featureStore.lookupDisplayId(r);e&&a.push(e)}e.remove=a;try{if(r(e.addOrUpdate))return void this.processor.onTileMessage(s,{...e,addOrUpdate:null},this.hasAggregates,t).catch(u);if(e.addOrUpdate.setArcadeSpatialReference(this.spatialReference),this.featureStore.hasInstance(e.addOrUpdate.instance)&&i.targets.feature||(i.targets.feature=!0,this.featureStore.onTileData(s,e)),!i.storage.data||!i.storage.filters){i.storage.data=!0,i.storage.filters=!0,this.attributeStore.onTileData(s,e);"geoevent"===this._source.type||this._didEdit?(await this.attributeStore.sendUpdates(),n(t)):this.attributeStore.sendUpdates()}if(this.hasAggregates&&!i.targets.aggregate){i.targets.aggregate=!0;const t=q(this._source)&&this._source.loading,r=!q(this._source)||t||e.end;if(this.aggregateStore.onTileData(s,e,this._storage,this.attributeStore,r),!r)return;i.mesh||(this.attributeStore.onTileData(s,e),await this.attributeStore.sendUpdates(),this.processor.onTileClear(s))}i.mesh||(i.mesh=!0,await this.processor.onTileMessage(s,e,this.hasAggregates,t),n(t)),this._maybeForceCleanup()}catch(o){u(o)}}_mark(e,t,s){const r=(4294901760&this._storage.getInstanceId(e))>>>16;e&&(t.add(r),s.set(e))}_markAndSweep(){this._lastCleanup=performance.now();if(!(!("feature"===this._source.type&&"snapshot"===this._source.mode)&&("geoevent"===this._source.type||this._cleanupNeeded)))return;this._cleanupNeeded=!1;const e=this._storage.getBitset(this._markedIdsBufId),t=new Set;e.clear();for(const s of this.tileStore.tiles)for(const r of this._source.readers(s.id)){const s=r.getCursor();for(;s.next();){let r=s.getDisplayId();if(!r){const e=s.getObjectId();r=this.featureStore.lookupDisplayId(e)}this._mark(r,t,e)}}"symbol"===this.processor.type&&this.processor.forEachBufferId((s=>{this._mark(s,t,e)})),this._updateQueue.forEach((s=>{for(const r of s.remove){const s=this.featureStore.lookupDisplayId(r);this._mark(s,t,e)}})),this.config.schema.targets.aggregate&&(this.aggregateStore.sweepFeatures(e,this.featureStore),this.aggregateStore.sweepClusters(this._storage,this.attributeStore,this._level)),this.featureStore.sweepFeatures(e,this._storage,this.attributeStore),this.featureStore.sweepFeatureSets(t)}};e([d({constructOnly:!0})],A.prototype,"tileStore",void 0),e([d()],A.prototype,"config",void 0),e([d({readOnly:!0})],A.prototype,"fieldsIndex",null),e([d()],A.prototype,"processor",void 0),e([d({constructOnly:!0})],A.prototype,"remoteClient",void 0),e([d({constructOnly:!0})],A.prototype,"service",void 0),e([d()],A.prototype,"spatialReference",null),e([d()],A.prototype,"updating",null),A=e([p("esri.views.2d.layers.features.controllers.FeatureController2D")],A);const R=A;export{R as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../../core/has.js";import{isSome as t,unwrap as r}from"../../../../../../core/maybe.js";import s from"../../../../../../core/workers/Connection.js";import{toQuantizationTransform as i}from"../../../../../../geometry/support/quantizationUtils.js";import{convertFromFeatureSet as a,quantizeOptimizedFeatureSet as o}from"../../../../../../layers/graphics/featureConversionUtils.js";import{queryOptimizedFeatureSet as n}from"../../../../../../layers/ogc/ogcFeatureUtils.js";import{executeQueryPBFBuffer as c,executeQuery as u}from"../../../../../../rest/query/operations/query.js";import{FeatureSetReaderJSON as m}from"../../support/FeatureSetReaderJSON.js";import{FeatureSetReaderPBF as p}from"../../support/FeatureSetReaderPBF.js";class l{constructor(e){this.service=e}destroy(){}}function f(e){return Array.isArray(e.source)}function y(e){return e&&e.capabilities&&e.collection&&e.layerDefinition}function h(t){const{capabilities:r}=t;return y(t.source)?new w(t):f(t)?new v(t):r.query.supportsFormatPBF&&e("featurelayer-pbf")?new F(t):new q(t)}async function d(e){const t=new s;return await t.open(e,{}),t}class v extends l{constructor(e){super(e),this._portsOpen=d(e.source).then((e=>this.client=e))}destroy(){this.client.close(),this.client=null}async executeQuery(e,t){await this._portsOpen;const r=await this.client.invoke("queryFeatures",e.toJSON(),t);return m.fromFeatureSet(r,this.service)}}class F extends l{async executeQuery(e,t){const{data:r}=await c(this.service.source,e,t),s=!e.quantizationParameters;return p.fromBuffer(r,this.service,s)}}class q extends l{async executeQuery(e,s){const{source:n,capabilities:c,spatialReference:p,objectIdField:l,geometryType:f}=this.service;if(t(e.quantizationParameters)&&!c.query.supportsQuantization){const t=e.clone(),c=i(r(t.quantizationParameters));t.quantizationParameters=null;const{data:f}=await u(n,t,p,s),y=a(f,l);return o(c,y),m.fromOptimizedFeatureSet(y,this.service)}const{data:y}=await u(n,e,this.service.spatialReference,s);var h;"esriGeometryPoint"===f&&(y.features=null==(h=y.features)?void 0:h.filter((e=>{if(t(e.geometry)){const t=e.geometry;return Number.isFinite(t.x)&&Number.isFinite(t.y)}return!0})));return m.fromFeatureSet(y,this.service)}}class w extends l{async executeQuery(e,t){const{capabilities:s}=this.service;if(e.quantizationParameters&&!s.query.supportsQuantization){const s=e.clone(),a=i(r(s.quantizationParameters));s.quantizationParameters=null;const c=await n(this.service.source,e,t);return o(a,c),m.fromOptimizedFeatureSet(c,this.service)}const a=await n(this.service.source,e,t);return m.fromOptimizedFeatureSet(a,this.service)}}export{l as SourceAdapter,h as createSourceAdapter};
5
+ import e from"../../../../../../core/has.js";import{isSome as t,unwrap as r}from"../../../../../../core/maybe.js";import s from"../../../../../../core/workers/Connection.js";import{toQuantizationTransform as i}from"../../../../../../geometry/support/quantizationUtils.js";import{convertFromFeatureSet as a,quantizeOptimizedFeatureSet as o}from"../../../../../../layers/graphics/featureConversionUtils.js";import{queryOptimizedFeatureSet as n}from"../../../../../../layers/ogc/ogcFeatureUtils.js";import{executeQueryPBFBuffer as c,executeQuery as u}from"../../../../../../rest/query/operations/query.js";import{FeatureSetReaderJSON as m}from"../../support/FeatureSetReaderJSON.js";import{FeatureSetReaderPBF as p}from"../../support/FeatureSetReaderPBF.js";class l{constructor(e){this.service=e}destroy(){}}function f(e){return Array.isArray(e.source)}function y(e){return e&&e.capabilities&&e.collection&&e.layerDefinition}function h(t){const{capabilities:r}=t;return y(t.source)?new w(t):f(t)?new v(t):r.query.supportsFormatPBF&&e("featurelayer-pbf")?new F(t):new q(t)}async function d(e){const t=new s;return await t.open(e,{}),t}class v extends l{constructor(e){super(e),this._portsOpen=d(e.source).then((e=>this.client=e))}destroy(){this.client.close(),this.client=null}async executeQuery(e,t){await this._portsOpen;const r=await this.client.invoke("queryFeatures",e.toJSON(),t);return m.fromFeatureSet(r,this.service)}}class F extends l{async executeQuery(e,t){const{data:r}=await c(this.service.source,e,t),s=!e.quantizationParameters;return p.fromBuffer(r,this.service,s)}}class q extends l{async executeQuery(e,s){const{source:n,capabilities:c,spatialReference:p,objectIdField:l,geometryType:f}=this.service;if(t(e.quantizationParameters)&&!c.query.supportsQuantization){const t=e.clone(),c=i(r(t.quantizationParameters));t.quantizationParameters=null;const{data:f}=await u(n,t,p,s),y=a(f,l);return o(c,y),m.fromOptimizedFeatureSet(y,this.service)}const{data:y}=await u(n,e,this.service.spatialReference,s);return"esriGeometryPoint"===f&&(y.features=y.features?.filter((e=>{if(t(e.geometry)){const t=e.geometry;return Number.isFinite(t.x)&&Number.isFinite(t.y)}return!0}))),m.fromFeatureSet(y,this.service)}}class w extends l{async executeQuery(e,t){const{capabilities:s}=this.service;if(e.quantizationParameters&&!s.query.supportsQuantization){const s=e.clone(),a=i(r(s.quantizationParameters));s.quantizationParameters=null;const c=await n(this.service.source,e,t);return o(a,c),m.fromOptimizedFeatureSet(c,this.service)}const a=await n(this.service.source,e,t);return m.fromOptimizedFeatureSet(a,this.service)}}export{l as SourceAdapter,h as createSourceAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{WGLGeometryType as e,WGLSymbologyType as a}from"../../engine/webgl/enums.js";import{createMaterialKey as r,hydrateMaterialKey as t,isOutlineFillSymbology as n}from"../../engine/webgl/materialKey/MaterialKey.js";function l(e){if("line-marker"===e.type){var a;return{type:"line-marker",color:null==(a=e.color)?void 0:a.toJSON(),placement:e.placement,style:e.style}}return e.constructor.fromJSON(e.toJSON()).toJSON()}function s(e){return t(e)}function o(e,a,r){if(!e)return null;switch(e.type){case"simple-fill":case"picture-fill":return c(e,a,r);case"simple-marker":case"picture-marker":return h(e,a,r);case"simple-line":return m(e,a,r);case"text":return u(e,a,r);case"label":return i(e,a,r);case"cim":return{type:"cim",rendererKey:a.vvFlags,data:e.data,maxVVSize:a.maxVVSize};case"CIMSymbolReference":return{type:"cim",rendererKey:a.vvFlags,data:e,maxVVSize:a.maxVVSize};case"web-style":return{...l(e),type:"web-style",hash:e.hash(),rendererKey:a.vvFlags,maxVVSize:a.maxVVSize};default:throw new Error(`symbol not supported ${e.type}`)}}function i(a,t,n){const l=a.toJSON(),o=r(e.LABEL,{...t,placement:l.labelPlacement});return{materialKey:n?s(o):o,hash:a.hash(),...l,labelPlacement:l.labelPlacement}}function c(a,t,o){const i=r(e.FILL,t),c=o?s(i):i,m=a.clone(),h=m.outline,u=n(t.symbologyType);u||(m.outline=null);const y={materialKey:c,hash:m.hash(),...l(m)};if(u)return y;const p=[];if(p.push(y),h){const a=r(e.LINE,{...t,isOutline:!0}),n={materialKey:o?s(a):a,hash:h.hash(),...l(h)};p.push(n)}return{type:"composite-symbol",layers:p,hash:p.reduce(((e,a)=>a.hash+e),"")}}function m(t,o,i){const c=n(o.symbologyType)?a.DEFAULT:o.symbologyType,m=r(e.LINE,{...o,symbologyType:c}),h=i?s(m):m,u=t.clone(),y=u.marker;u.marker=null;const p=[];if(p.push({materialKey:h,hash:u.hash(),...l(u)}),y){var f;const a=r(e.MARKER,o),t=i?s(a):a;y.color=null!=(f=y.color)?f:u.color,p.push({materialKey:t,hash:y.hash(),lineWidth:u.width,...l(y)})}return{type:"composite-symbol",layers:p,hash:p.reduce(((e,a)=>a.hash+e),"")}}function h(a,t,n){const o=r(e.MARKER,t),i=n?s(o):o,c=l(a);return{materialKey:i,hash:a.hash(),...c,angle:a.angle,maxVVSize:t.maxVVSize}}function u(a,t,n){const o=r(e.TEXT,t),i=n?s(o):o,c=l(a);return{materialKey:i,hash:a.hash(),...c,angle:a.angle,maxVVSize:t.maxVVSize}}export{o as createSymbolSchema};
5
+ import{WGLGeometryType as e,WGLSymbologyType as a}from"../../engine/webgl/enums.js";import{createMaterialKey as t,hydrateMaterialKey as r,isOutlineFillSymbology as n}from"../../engine/webgl/materialKey/MaterialKey.js";function l(e){if("line-marker"===e.type){return{type:"line-marker",color:e.color?.toJSON(),placement:e.placement,style:e.style}}return e.constructor.fromJSON(e.toJSON()).toJSON()}function s(e){return r(e)}function o(e,a,t){if(!e)return null;switch(e.type){case"simple-fill":case"picture-fill":return c(e,a,t);case"simple-marker":case"picture-marker":return h(e,a,t);case"simple-line":return m(e,a,t);case"text":return y(e,a,t);case"label":return i(e,a,t);case"cim":return{type:"cim",rendererKey:a.vvFlags,data:e.data,maxVVSize:a.maxVVSize};case"CIMSymbolReference":return{type:"cim",rendererKey:a.vvFlags,data:e,maxVVSize:a.maxVVSize};case"web-style":return{...l(e),type:"web-style",hash:e.hash(),rendererKey:a.vvFlags,maxVVSize:a.maxVVSize};default:throw new Error(`symbol not supported ${e.type}`)}}function i(a,r,n){const l=a.toJSON(),o=t(e.LABEL,{...r,placement:l.labelPlacement});return{materialKey:n?s(o):o,hash:a.hash(),...l,labelPlacement:l.labelPlacement}}function c(a,r,o){const i=t(e.FILL,r),c=o?s(i):i,m=a.clone(),h=m.outline,y=n(r.symbologyType);y||(m.outline=null);const u={materialKey:c,hash:m.hash(),...l(m)};if(y)return u;const p=[];if(p.push(u),h){const a=t(e.LINE,{...r,isOutline:!0}),n={materialKey:o?s(a):a,hash:h.hash(),...l(h)};p.push(n)}return{type:"composite-symbol",layers:p,hash:p.reduce(((e,a)=>a.hash+e),"")}}function m(r,o,i){const c=n(o.symbologyType)?a.DEFAULT:o.symbologyType,m=t(e.LINE,{...o,symbologyType:c}),h=i?s(m):m,y=r.clone(),u=y.marker;y.marker=null;const p=[];if(p.push({materialKey:h,hash:y.hash(),...l(y)}),u){const a=t(e.MARKER,o),r=i?s(a):a;u.color=u.color??y.color,p.push({materialKey:r,hash:u.hash(),lineWidth:y.width,...l(u)})}return{type:"composite-symbol",layers:p,hash:p.reduce(((e,a)=>a.hash+e),"")}}function h(a,r,n){const o=t(e.MARKER,r),i=n?s(o):o,c=l(a);return{materialKey:i,hash:a.hash(),...c,angle:a.angle,maxVVSize:r.maxVVSize}}function y(a,r,n){const o=t(e.TEXT,r),i=n?s(o):o,c=l(a);return{materialKey:i,hash:a.hash(),...c,angle:a.angle,maxVVSize:r.maxVVSize}}export{o as createSymbolSchema};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{bidiText as t}from"../../../../../core/BidiText.js";import"../../../../../core/Error.js";import"../../../../../core/has.js";import s from"../../../../../core/Logger.js";import{applySome as r,isNone as i,isSome as a,unwrapOrThrow as o,unwrap as n}from"../../../../../core/maybe.js";import{throwIfAborted as l,isAbortError as c}from"../../../../../core/promiseUtils.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/accessorSupport/set.js";import{subclass as d}from"../../../../../core/accessorSupport/decorators/subclass.js";import{diff as h,hasDiff as f}from"../../../../../core/accessorSupport/diffUtils.js";import m from"../../../../../geometry/SpatialReference.js";import{isAggregateId as u}from"../../../engine/webgl/DisplayId.js";import{MeshData as p}from"../../../engine/webgl/mesh/MeshData.js";import{WGLMeshFactory as g}from"../../../engine/webgl/mesh/factories/WGLMeshFactory.js";import{WGLTemplateStore as y}from"../../../engine/webgl/mesh/templates/WGLTemplateStore.js";import{createMatcher as _}from"../../../engine/webgl/util/Matcher.js";import{codepoints as b}from"../textUtils.js";import S from"./BaseProcessor.js";import w from"../support/ResourceManagerProxy.js";function I(e,t){return(!e.minScale||e.minScale>=t)&&(!e.maxScale||e.maxScale<=t)}function v(e){const t=e.message,s={message:{data:{},tileKey:t.tileKey,tileKeyOrigin:t.tileKeyOrigin,version:t.version},transferList:new Array};for(const i in t.data){const e=t.data[i];if(s.message.data[i]=null,a(e)){const t=e.stride,a=e.indices.slice(0),o=e.vertices.slice(0),n=e.records.slice(0),l={stride:t,indices:a,vertices:o,records:n,metrics:r(e.metrics,(e=>e.slice(0)))};s.transferList.push(a,o,n),s.message.data[i]=l}}return s}s.getLogger("esri.views.2d.layers.features.processors.SymbolProcessor");let M=class extends S{constructor(){super(...arguments),this.type="symbol",this._matchers={feature:null,aggregate:null},this._bufferData=new Map,this._bufferIds=new Map}initialize(){this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this))]),this._resourceManagerProxy=new w(this.remoteClient)}destroy(){this._resourceManagerProxy.destroy()}get supportsTileUpdates(){return!0}forEachBufferId(e){this._bufferIds.forEach((t=>{t.forEach(e)}))}async update(e,t){const s=t.schema.processors[0];if("symbol"!==s.type)return;const r=h(this._schema,s);f(r,"mesh")&&(e.mesh=!0,e.why.mesh.push("Symbology changed"),this._schema=s,this._factory=this._createFactory(s),this._factory.update(s,this.tileStore.tileScheme.tileInfo))}onTileMessage(e,t,s,r){return l(r),this._onTileData(e,t,s,r)}onTileClear(e){const t={clear:!0};return this._bufferData.delete(e.key.id),this._bufferIds.delete(e.key.id),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:e.id,data:t})}onTileError(e,t,s){const r=s.signal,i={tileKey:e.id,error:t};return this.remoteClient.invoke("tileRenderer.onTileError",i,{signal:r})}onTileUpdate(e){for(const t of e.removed)this._bufferData.has(t.key.id)&&this._bufferData.delete(t.key.id),this._bufferIds.has(t.key.id)&&this._bufferIds.delete(t.key.id);for(const t of e.added)this._bufferData.forEach((e=>{for(const s of e)s.message.tileKey===t.id&&this._updateTileMesh("append",t,v(s),[],!1,!1,null)}))}_addBufferData(e,t){this._bufferData.has(e)||this._bufferData.set(e,[]),this._bufferData.get(e).push(v(t))}_createFactory(e){const{geometryType:t,objectIdField:s,fields:i}=this.service,a=(e,t)=>this.remoteClient.invoke("tileRenderer.getMaterialItems",e,t),o={geometryType:t,fields:i,spatialReference:m.fromJSON(this.spatialReference)},n=new y(a,this.tileStore.tileScheme.tileInfo),{matcher:l,aggregateMatcher:c}=e.mesh;return this._store=n,this._matchers.feature=_(l,n,o,this._resourceManagerProxy),this._matchers.aggregate=r(c,(e=>_(e,n,o,this._resourceManagerProxy))),new g(t,s,n)}async _onTileData(e,t,s,r){l(r);const{type:o,addOrUpdate:n,remove:c}=t,d=t.end,h=!!this._schema.mesh.sortKey;if(!n){const t={type:o,addOrUpdate:null,remove:c,clear:!1,end:d,sort:h};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:e.id,data:t},r)}const f=this._processFeatures(e,n,s,r,t.status.version);try{const s=await f;if(i(s)){const t={type:o,addOrUpdate:null,remove:c,clear:!1,end:d,sort:h};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:e.id,data:t},r)}const n=[];for(const t of s){let s=!1;const r=t.message.bufferIds,i=e.key.id,o=t.message.tileKey;if(i!==o&&a(r)){if(!this.tileStore.get(o)){this._addBufferData(i,t),n.push(t);continue}let e=this._bufferIds.get(o);e||(e=new Set,this._bufferIds.set(o,e));const a=Array.from(r);for(const t of a){if(e.has(t)){s=!0;break}e.add(t)}}s||(this._addBufferData(i,t),n.push(t))}await Promise.all(n.map((s=>{const i=e.key.id===s.message.tileKey,a=i?t.remove:[],n=i&&t.end;return this._updateTileMesh(o,e,s,a,n,t.clear,r.signal)})))}catch(m){this._handleError(e,m,r)}}async _updateTileMesh(e,t,s,i,a,o,c){const d=e,h=s.message.tileKey,f=!!this._schema.mesh.sortKey;h!==t.key.id&&(a=!1);const m=r(s,(e=>e.message)),u=r(s,(e=>e.transferList))||[],p={type:d,addOrUpdate:m,remove:i,clear:!1,end:a,sort:f},g={transferList:n(u)||[],signal:c};return l(g),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:h,data:p},g)}async _processFeatures(e,t,s,r,a){if(i(t)||!t.hasFeatures)return null;const o={transform:e.transform,hasZ:!1,hasM:!1},n=this._factory,c={viewingMode:"",scale:e.scale},d=await this._matchers.feature,h=await this._matchers.aggregate;l(r);const f=this._getLabelInfos(e,t);return await n.analyze(t.getCursor(),this._resourceManagerProxy,d,h,o,c),l(r),this._writeFeatureSet(e,t,o,f,n,s,a)}_writeFeatureSet(e,t,s,r,i,o,n){const l=t.getSize(),c=new p(e.key.id,{features:l,records:l,metrics:0},this._schema.mesh.matcher.symbologyType,o,!0,n),d={viewingMode:"",scale:e.scale},h=t.getCursor();for(;h.next();)try{const t=h.getDisplayId(),o=a(r)?r.get(t):null;i.writeCursor(c,h,s,d,e.level,o,this._resourceManagerProxy)}catch(m){}const f=e.tileInfoView.tileInfo.isWrappable;return c.serialize(f)}_handleError(e,t,s){if(!c(t)){const r={tileKey:e.id,error:t.message};return this.remoteClient.invoke("tileRenderer.onTileError",r,{signal:s.signal})}}_getLabelingSchemaForScale(e){const t=this._schema.mesh.labels;if(i(t))return null;if("subtype"===t.type){const s={type:"subtype",classes:{}};let r=!1;for(const i in t.classes){const a=t.classes[i].filter((t=>I(t,e.scale)));r=r||!!a.length,s.classes[i]=a}return r?s:null}const s=t.classes.filter((t=>I(t,e.scale)));return s.length?{type:"simple",classes:s}:null}_getLabels(e,t){if("subtype"===t.type){var s;const r=this.service.subtypeField,i=o(r,"Expected to find subtype Field"),a=e.readAttribute(i);return null==a?[]:null!=(s=t.classes[a])?s:[]}return t.classes}_getLabelInfos(e,s){const r=this._getLabelingSchemaForScale(e);if(i(r))return null;const a=new Map,o=s.getCursor();for(;o.next();){const e=o.getDisplayId(),s=[],i=u(e),n=i&&1!==o.readAttribute("cluster_count")?"aggregate":"feature",l=this._getLabels(o,r);for(const r of l){if(r.target!==n)continue;const a=o.getStorage(),l=i&&"feature"===n?a.getComputedStringAtIndex(o.readAttribute("referenceId"),r.fieldIndex):a.getComputedStringAtIndex(e,r.fieldIndex);if(!l)continue;const c=t(l.toString()),d=c[0],h=c[1];this._store.getMosaicItem(r.symbol,b(d)).then((e=>{s[r.index]={glyphs:e.glyphMosaicItems,rtl:h,index:r.index}}))}a.set(e,s)}return a}};M=e([d("esri.views.2d.layers.features.processors.SymbolProcessor")],M);const x=M;export{x as default};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{bidiText as t}from"../../../../../core/BidiText.js";import"../../../../../core/Error.js";import"../../../../../core/has.js";import s from"../../../../../core/Logger.js";import{applySome as r,isNone as i,isSome as a,unwrapOrThrow as o,unwrap as n}from"../../../../../core/maybe.js";import{throwIfAborted as l,isAbortError as c}from"../../../../../core/promiseUtils.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/accessorSupport/set.js";import{subclass as d}from"../../../../../core/accessorSupport/decorators/subclass.js";import{diff as h,hasDiff as f}from"../../../../../core/accessorSupport/diffUtils.js";import m from"../../../../../geometry/SpatialReference.js";import{isAggregateId as u}from"../../../engine/webgl/DisplayId.js";import{MeshData as p}from"../../../engine/webgl/mesh/MeshData.js";import{WGLMeshFactory as g}from"../../../engine/webgl/mesh/factories/WGLMeshFactory.js";import{WGLTemplateStore as y}from"../../../engine/webgl/mesh/templates/WGLTemplateStore.js";import{createMatcher as _}from"../../../engine/webgl/util/Matcher.js";import{codepoints as b}from"../textUtils.js";import S from"./BaseProcessor.js";import w from"../support/ResourceManagerProxy.js";function I(e,t){return(!e.minScale||e.minScale>=t)&&(!e.maxScale||e.maxScale<=t)}function v(e){const t=e.message,s={message:{data:{},tileKey:t.tileKey,tileKeyOrigin:t.tileKeyOrigin,version:t.version},transferList:new Array};for(const i in t.data){const e=t.data[i];if(s.message.data[i]=null,a(e)){const t=e.stride,a=e.indices.slice(0),o=e.vertices.slice(0),n=e.records.slice(0),l={stride:t,indices:a,vertices:o,records:n,metrics:r(e.metrics,(e=>e.slice(0)))};s.transferList.push(a,o,n),s.message.data[i]=l}}return s}s.getLogger("esri.views.2d.layers.features.processors.SymbolProcessor");let M=class extends S{constructor(){super(...arguments),this.type="symbol",this._matchers={feature:null,aggregate:null},this._bufferData=new Map,this._bufferIds=new Map}initialize(){this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this))]),this._resourceManagerProxy=new w(this.remoteClient)}destroy(){this._resourceManagerProxy.destroy()}get supportsTileUpdates(){return!0}forEachBufferId(e){this._bufferIds.forEach((t=>{t.forEach(e)}))}async update(e,t){const s=t.schema.processors[0];if("symbol"!==s.type)return;const r=h(this._schema,s);f(r,"mesh")&&(e.mesh=!0,e.why.mesh.push("Symbology changed"),this._schema=s,this._factory=this._createFactory(s),this._factory.update(s,this.tileStore.tileScheme.tileInfo))}onTileMessage(e,t,s,r){return l(r),this._onTileData(e,t,s,r)}onTileClear(e){const t={clear:!0};return this._bufferData.delete(e.key.id),this._bufferIds.delete(e.key.id),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:e.id,data:t})}onTileError(e,t,s){const r=s.signal,i={tileKey:e.id,error:t};return this.remoteClient.invoke("tileRenderer.onTileError",i,{signal:r})}onTileUpdate(e){for(const t of e.removed)this._bufferData.has(t.key.id)&&this._bufferData.delete(t.key.id),this._bufferIds.has(t.key.id)&&this._bufferIds.delete(t.key.id);for(const t of e.added)this._bufferData.forEach((e=>{for(const s of e)s.message.tileKey===t.id&&this._updateTileMesh("append",t,v(s),[],!1,!1,null)}))}_addBufferData(e,t){this._bufferData.has(e)||this._bufferData.set(e,[]),this._bufferData.get(e).push(v(t))}_createFactory(e){const{geometryType:t,objectIdField:s,fields:i}=this.service,a=(e,t)=>this.remoteClient.invoke("tileRenderer.getMaterialItems",e,t),o={geometryType:t,fields:i,spatialReference:m.fromJSON(this.spatialReference)},n=new y(a,this.tileStore.tileScheme.tileInfo),{matcher:l,aggregateMatcher:c}=e.mesh;return this._store=n,this._matchers.feature=_(l,n,o,this._resourceManagerProxy),this._matchers.aggregate=r(c,(e=>_(e,n,o,this._resourceManagerProxy))),new g(t,s,n)}async _onTileData(e,t,s,r){l(r);const{type:o,addOrUpdate:n,remove:c}=t,d=t.end,h=!!this._schema.mesh.sortKey;if(!n){const t={type:o,addOrUpdate:null,remove:c,clear:!1,end:d,sort:h};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:e.id,data:t},r)}const f=this._processFeatures(e,n,s,r,t.status.version);try{const s=await f;if(i(s)){const t={type:o,addOrUpdate:null,remove:c,clear:!1,end:d,sort:h};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:e.id,data:t},r)}const n=[];for(const t of s){let s=!1;const r=t.message.bufferIds,i=e.key.id,o=t.message.tileKey;if(i!==o&&a(r)){if(!this.tileStore.get(o)){this._addBufferData(i,t),n.push(t);continue}let e=this._bufferIds.get(o);e||(e=new Set,this._bufferIds.set(o,e));const a=Array.from(r);for(const t of a){if(e.has(t)){s=!0;break}e.add(t)}}s||(this._addBufferData(i,t),n.push(t))}await Promise.all(n.map((s=>{const i=e.key.id===s.message.tileKey,a=i?t.remove:[],n=i&&t.end;return this._updateTileMesh(o,e,s,a,n,t.clear,r.signal)})))}catch(m){this._handleError(e,m,r)}}async _updateTileMesh(e,t,s,i,a,o,c){const d=e,h=s.message.tileKey,f=!!this._schema.mesh.sortKey;h!==t.key.id&&(a=!1);const m=r(s,(e=>e.message)),u=r(s,(e=>e.transferList))||[],p={type:d,addOrUpdate:m,remove:i,clear:!1,end:a,sort:f},g={transferList:n(u)||[],signal:c};return l(g),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:h,data:p},g)}async _processFeatures(e,t,s,r,a){if(i(t)||!t.hasFeatures)return null;const o={transform:e.transform,hasZ:!1,hasM:!1},n=this._factory,c={viewingMode:"",scale:e.scale},d=await this._matchers.feature,h=await this._matchers.aggregate;l(r);const f=this._getLabelInfos(e,t);return await n.analyze(t.getCursor(),this._resourceManagerProxy,d,h,o,c),l(r),this._writeFeatureSet(e,t,o,f,n,s,a)}_writeFeatureSet(e,t,s,r,i,o,n){const l=t.getSize(),c=new p(e.key.id,{features:l,records:l,metrics:0},this._schema.mesh.matcher.symbologyType,o,!0,n),d={viewingMode:"",scale:e.scale},h=t.getCursor();for(;h.next();)try{const t=h.getDisplayId(),o=a(r)?r.get(t):null;i.writeCursor(c,h,s,d,e.level,o,this._resourceManagerProxy)}catch(m){}const f=e.tileInfoView.tileInfo.isWrappable;return c.serialize(f)}_handleError(e,t,s){if(!c(t)){const r={tileKey:e.id,error:t.message};return this.remoteClient.invoke("tileRenderer.onTileError",r,{signal:s.signal})}}_getLabelingSchemaForScale(e){const t=this._schema.mesh.labels;if(i(t))return null;if("subtype"===t.type){const s={type:"subtype",classes:{}};let r=!1;for(const i in t.classes){const a=t.classes[i].filter((t=>I(t,e.scale)));r=r||!!a.length,s.classes[i]=a}return r?s:null}const s=t.classes.filter((t=>I(t,e.scale)));return s.length?{type:"simple",classes:s}:null}_getLabels(e,t){if("subtype"===t.type){const s=this.service.subtypeField,r=o(s,"Expected to find subtype Field"),i=e.readAttribute(r);return null==i?[]:t.classes[i]??[]}return t.classes}_getLabelInfos(e,s){const r=this._getLabelingSchemaForScale(e);if(i(r))return null;const a=new Map,o=s.getCursor();for(;o.next();){const e=o.getDisplayId(),s=[],i=u(e),n=i&&1!==o.readAttribute("cluster_count")?"aggregate":"feature",l=this._getLabels(o,r);for(const r of l){if(r.target!==n)continue;const a=o.getStorage(),l=i&&"feature"===n?a.getComputedStringAtIndex(o.readAttribute("referenceId"),r.fieldIndex):a.getComputedStringAtIndex(e,r.fieldIndex);if(!l)continue;const c=t(l.toString()),d=c[0],h=c[1];this._store.getMosaicItem(r.symbol,b(d)).then((e=>{s[r.index]={glyphs:e.glyphMosaicItems,rtl:h,index:r.index}}))}a.set(e,s)}return a}};M=e([d("esri.views.2d.layers.features.processors.SymbolProcessor")],M);const x=M;export{x 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.24/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import t from"../../../../core/has.js";import{clone as i}from"../../../../core/lang.js";import r from"../../../../core/Logger.js";import{isSome as l,unwrap as n,isNone as s,unwrapOr as o}from"../../../../core/maybe.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{WGLSymbologyType as u}from"../../engine/webgl/enums.js";import{getVVType as f}from"../../engine/webgl/Utils.js";import{getTechniqueFromRenderer as d}from"../../engine/webgl/techniques/utils.js";import{getVVFlags as p}from"../../engine/webgl/util/vvFlagUtils.js";import{createSymbolSchema as c}from"./createSymbolSchema.js";export{createSymbolSchema}from"./createSymbolSchema.js";import{getPtMaxVVSize as y}from"./support/pixelBuffering.js";import{getSupportedHeatmapRenderer as m,simplifyVisualVariables as g}from"./support/rendererUtils.js";import{createClusterRenderer as b}from"../support/clusterUtils.js";import{toJSONGeometryType as x}from"../support/util.js";const v=r.getLogger("esri.views.2d.layers.features.schemaUtils"),h="ValidationError",w={esriGeometryPoint:["above-right","above-center","above-left","center-center","center-left","center-right","below-center","below-left","below-right"],esriGeometryPolygon:["always-horizontal"],esriGeometryPolyline:["center-along"],esriGeometryMultipoint:null};function T(e){return e}function E(e){let t=0,i=0,r=u.DEFAULT;if(l(e)){if(i=y(e),"visualVariables"in e&&(t=p(e.visualVariables||[]),"dot-density"===e.type&&(r=u.DOT_DENSITY)),"heatmap"===e.type&&(r=u.HEATMAP),"dictionary"===e.type)return{maxVVSize:i,vvFlags:t,symbologyType:u.DEFAULT};if(r!==u.DOT_DENSITY&&r!==u.HEATMAP){const t=e.getSymbols();"backgroundFillSymbol"in e&&e.backgroundFillSymbol&&t.push(e.backgroundFillSymbol);let i=!0,l=!0;for(const e of t)if("cim"===e.type&&(l=!1),"simple-fill"===e.type||"picture-fill"===e.type){const t=e.outline,r=t&&"none"!==t.style&&"solid"!==t.style,n="simple-fill"===e.type&&"none"!==e.style&&"solid"!==e.style,s="picture-fill"===e.type||n||r;r&&(i=!1),s&&(l=!1)}i?r=l?u.OUTLINE_FILL_SIMPLE:u.OUTLINE_FILL:l&&(r=u.SIMPLE)}}return{vvFlags:t,maxVVSize:i,symbologyType:r}}function I(t,i){const r=t.labelPlacement,l=w[i];if(!t.symbol)return v.warn("No ILabelClass symbol specified."),!0;if(!l)return v.error(new e("mapview-labeling:unsupported-geometry-type",`Unable to create labels for Feature Layer, ${i} is not supported`)),!0;if(!l.includes(r)){const e=l[0];r&&v.warn(`Found invalid label placement type ${r} for ${i}. Defaulting to ${e}`),t.labelPlacement=e}return!1}function S(e,t){const r=i(e);return r.some((e=>I(e,t)))?[]:r}function F(e){return t("esri-2d-update-debug")&&console.debug("Created new schema",V(e,!0)),V(e)}function V(e,t=!1){try{var i,r;const l=R(e,t),n=B(e),s={};l.map((t=>z(s,e,t)));return{source:{definitionExpression:e.definitionExpression,fields:e.fields.map((e=>e.toJSON())),gdbVersion:e.gdbVersion,historicMoment:null==(i=e.historicMoment)?void 0:i.getTime(),outFields:e.availableFields,pixelBuffer:e.pixelBuffer,spatialReference:e.spatialReference.toJSON(),timeExtent:null==(r=e.timeExtent)?void 0:r.toJSON(),customParameters:e.customParameters},attributes:{fields:{},indexCount:0},processors:l,tileRenderer:n,targets:s}}catch(l){if(l.fieldName===h)return v.error(l),null;throw l}}function z(t,i,r){switch(r.target){case"feature":return void L(t,M(i),r);case"aggregate":{if(!("featureReduction"in i))return;const l=i.featureReduction;if("selection"===l.type)throw new e(h,"Mapview does not support `selection` reduction type",l);return L(t,M(i),r),void j(t,l,r)}}}function N(e,t){for(const i in t){const r=t[i];if(r.target!==e.name)continue;const l=e.attributes[i];l?(l.context.mesh=l.context.mesh||r.context.mesh,l.context.storage=l.context.storage||r.context.storage):e.attributes[i]=r}return e}function M(e){var t,i,r,l,s;return[null!=(t=null==(i=n(e.filter))?void 0:i.toJSON())?t:null,null!=(r=null==(l=n(null==(s=n(e.featureEffect))?void 0:s.filter))?void 0:l.toJSON())?r:null]}function L(e,t,i){return e.feature||(e.feature={name:"feature",input:"source",filters:t,attributes:{}}),N(e.feature,i.attributes.fields),e}function j(e,t,i){return e.aggregate||(e.aggregate={name:"aggregate",input:"feature",filters:null,attributes:{},params:{clusterRadius:a(t.clusterRadius/2),clusterPixelBuffer:64*Math.ceil(a(t.clusterMaxSize)/64),fields:i.aggregateFields}}),N(e.aggregate,i.attributes.fields),e}function O(e,t){return t.field?P(e,{...t,type:"field",field:t.field}):t.valueExpression?P(e,{...t,type:"expression",valueExpression:t.valueExpression}):{field:null,fieldIndex:null}}function P(e,t){switch(t.type){case"expression":{const i=T(t.valueExpression);if(!e.fields[i]){const r=e.indexCount++;e.fields[i]={...t,name:i,fieldIndex:r}}return{fieldIndex:e.fields[i].fieldIndex}}case"label-expression":{const i=T(JSON.stringify(t.label));if(!e.fields[i]){const r=e.indexCount++;e.fields[i]={...t,name:i,fieldIndex:r}}return{fieldIndex:e.fields[i].fieldIndex}}case"field":{const i=t.field;return"aggregate"===t.target&&e.fields[i]||(e.fields[i]={...t,name:i}),{field:i}}case"statistic":return e.fields[t.name]={...t},{field:t.name}}}function R(e,t=!1){const i=new Array;let r=0;return i.push(k(e,r++,t)),i}function U(e,t,i,r,l,n=!1){const s=P(t,{type:"label-expression",target:r,context:{mesh:!0},resultType:"string",label:{labelExpression:i.labelExpression,labelExpressionInfo:i.labelExpressionInfo?{expression:i.labelExpressionInfo.expression}:null,symbol:!!i.symbol,where:i.where}}),{fieldIndex:o}=s,a=E(e);return{...c(i,a,n),fieldIndex:o,target:r,index:l}}function k(t,i,r=!1){const n={indexCount:0,fields:{}},s="featureReduction"in t&&t.featureReduction,o=s?"aggregate":"feature";if("sublayers"in t){const i={type:"subtype",subtypeField:t.subtypeField,renderers:{},symbologyType:u.DEFAULT},s={type:"subtype",mapping:{},target:"feature"},a={type:"subtype",classes:{}},f={type:"symbol",target:"feature",aggregateFields:[],attributes:n,storage:s,mesh:{matcher:i,aggregateMatcher:null,labels:a,sortKey:null}},d=new Set;let p=0;for(const{renderer:u,subtypeCode:c,labelingInfo:y,labelsVisible:m}of t.sublayers){const t=q(n,o,u,r),f=C(n,o,u),g=m&&y;if("visualVariables"in u&&u.visualVariables&&u.visualVariables.length)throw new e(h,"Visual variables are currently not supported for subtype layers");if("dictionary"===t.type)throw new e(h,"Dictionary renderer is not supported in subtype layers");if("subtype"===t.type)throw new e(h,"Nested subtype renderers is not supported");if(l(f)&&"subtype"===f.type)throw new e(h,"Nested subtype storage is not supported");if(l(f)&&l(f.attributeMapping))throw new e(h,"Non-visual-variable attributes are not supported in subtype layers");if("heatmap"===t.type)throw new e(h,"Heatmaps are not supported in subtype layers");if(d.has(c))throw new e(h,"Subtype codes for sublayers must be unique");d.add(c),i.renderers[c]=t,s.mapping[c]=f,g&&(a.classes[c]=g.map((e=>U(u,n,e,"feature",p++,r))))}return f}if("heatmap"===t.renderer.type&&"raster"===m()){const{blurRadius:e,fieldOffset:i,field:r}=t.renderer;return{type:"heatmap",aggregateFields:[],attributes:n,target:o,storage:null,mesh:{blurRadius:e,fieldOffset:i,field:O(n,{target:o,field:r,resultType:"numeric"}).field}}}const a=[],f="aggregate"===o?b(a,t.renderer,s,null):t.renderer;A(n,a);const d=q(n,o,f,r);let p=null;const y=C(n,o,f),g=x(t.geometryType);let v=t.labelsVisible&&t.labelingInfo||[],w=[];if(s){if("selection"===s.type)throw new e(h,"Mapview does not support `selection` reduction type",s);if(s.symbol){const e=E(f);p={type:"simple",symbol:c(s.symbol,e,r),symbologyType:e.symbologyType}}w=s&&s.labelsVisible&&s.labelingInfo||[]}v=S(v,g),w=S(w,g);let T=0;const I=[...v.map((e=>U(f,n,e,"feature",T++,r))),...w.map((e=>U(f,n,e,"aggregate",T++,r)))],F=D(n,t.orderBy);return{type:"symbol",target:o,attributes:n,aggregateFields:a,storage:y,mesh:{matcher:d,labels:{type:"simple",classes:I},aggregateMatcher:p,sortKey:F}}}function B(e){var t;return"heatmap"===(null==(t=e.renderer)?void 0:t.type)&&"raster"===m()?{type:"heatmap"}:{type:"symbol"}}function D(t,i){if(s(i)||!i.length)return null;i.length>1&&v.warn(`Layer rendering currently only supports ordering by 1 orderByInfo, but found ${i.length}. All but the first will be discarded`);const r=i[0],l="ascending"===r.order?"asc":"desc";if(r.field)return{field:r.field,order:l};if(r.valueExpression){return{fieldIndex:P(t,{type:"expression",target:"feature",valueExpression:r.valueExpression,resultType:"numeric"}).fieldIndex,order:l}}return v.error(new e(h,"Expected to find a field or valueExpression for OrderByInfo",r)),null}function A(e,t){const i={mesh:!0,storage:!0};for(const r of t){const{name:t,outStatistic:l}=r,{statisticType:n,onStatisticField:s}=l;let o=null,a=null,u=null;const f="numeric",d="feature";if("onStatisticValueExpression"in l){a=P(e,{type:"expression",target:d,valueExpression:l.onStatisticValueExpression,resultType:f}).fieldIndex}else if("onStatisticNormalizationField"in l){o=P(e,{type:"field",target:d,field:s,resultType:f}).field,u=l.onStatisticNormalizationField}else{o=P(e,{type:"field",target:d,field:s,resultType:f}).field}P(e,{type:"statistic",target:"aggregate",name:t,context:i,inField:o,inNormalizationField:u,inFieldIndex:a,statisticType:n})}}function C(e,t,i){let r;switch(i.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":r={visualVariables:!0,attributes:null};break;default:r=d(i).getStorageSpec(i)}return J(e,t,r,i)}function J(e,t,i,r){if(s(i))return null;const{visualVariables:n,attributes:o}=i;let a=null;n&&"visualVariables"in r&&(a=$(e,t,r.visualVariables));const u=l(a)?4:0;let f=null;return l(o)&&(f=o.map(((i,r)=>{const{field:l,fieldIndex:n}=O(e,{valueExpression:i.valueExpression,field:i.field,resultType:"numeric",target:t});return{binding:r+u,field:l,fieldIndex:n}}))),{type:"simple",target:t,attributeMapping:f,vvMapping:a}}function $(e,t,i){if(!i||!i.length)return[];const r={storage:!0},l="numeric";return g(i).map((i=>{var n;const s=f(i.type),{field:o,fieldIndex:a}=O(e,{target:t,valueExpression:i.valueExpression,field:i.field,context:r,resultType:l});switch(i.type){case"size":return"$view.scale"===i.valueExpression?null:{type:"size",binding:s,field:o,fieldIndex:a,normalizationField:O(e,{target:t,field:i.normalizationField,context:r,resultType:l}).field,valueRepresentation:null!=(n=i.valueRepresentation)?n:null};case"color":return{type:"color",binding:s,field:o,fieldIndex:a,normalizationField:O(e,{target:t,field:i.normalizationField,context:r,resultType:l}).field};case"opacity":return{type:"opacity",binding:s,field:o,fieldIndex:a,normalizationField:O(e,{target:t,field:i.normalizationField,context:r,resultType:l}).field};case"rotation":return{type:"rotation",binding:s,field:o,fieldIndex:a}}})).filter((e=>e))}function q(e,t,i,r=!1){const l=o(e,{indexCount:0,fields:{}});switch(i.type){case"simple":case"dot-density":return _(l,i,r);case"class-breaks":return G(l,t,i,r);case"unique-value":return H(l,t,i,r);case"dictionary":return K(l,i,r);case"heatmap":return Y(l,i,r)}}function _(e,t,i=!1){const r=t.getSymbols(),l=r.length?r[0]:null,n=E(t);return{type:"simple",symbol:c(l,n,i),symbologyType:n.symbologyType}}function G(e,t,i,r=!1){const l={mesh:!0,use:"renderer.field"},n=i.backgroundFillSymbol,{field:s,fieldIndex:o}=O(e,{target:t,field:i.field,valueExpression:i.valueExpression,resultType:"numeric",context:l}),a=i.normalizationType,u="log"===a?"esriNormalizeByLog":"percent-of-total"===a?"esriNormalizeByPercentOfTotal":"field"===a?"esriNormalizeByField":null,f=E(i),d=i.classBreakInfos.map((e=>({symbol:c(e.symbol,f,r),min:e.minValue,max:e.maxValue}))).sort(((e,t)=>e.min-t.min));return{type:"interval",attributes:e.fields,field:s,fieldIndex:o,backgroundFillSymbol:c(n,f,r),defaultSymbol:c(i.defaultSymbol,f,r),intervals:d,normalizationField:i.normalizationField,normalizationTotal:i.normalizationTotal,normalizationType:u,isMaxInclusive:i.isMaxInclusive,symbologyType:f.symbologyType}}function H(t,i,r,l=!1){const n=[],s=r.backgroundFillSymbol,o={target:i,context:{mesh:!0},resultType:"string"};if(r.field&&"string"!=typeof r.field)throw new e(h,"Expected renderer.field to be a string",r);const{field:a,fieldIndex:u}=O(t,{...o,field:r.field,valueExpression:r.valueExpression}),f=E(r);for(const e of r.uniqueValueInfos)n.push({value:""+e.value,symbol:c(e.symbol,f,l)});return{type:"map",attributes:t.fields,field:a,fieldIndex:u,field2:O(t,{...o,field:r.field2}).field,field3:O(t,{...o,field:r.field3}).field,fieldDelimiter:r.fieldDelimiter,backgroundFillSymbol:c(s,f),defaultSymbol:c(r.defaultSymbol,f),map:n,symbologyType:f.symbologyType}}function K(e,t,i=!1){const r=E(t);return{type:"dictionary",config:t.config,fieldMap:t.fieldMap,scaleExpression:t.scaleExpression,url:t.url,symbolOptions:r,symbologyType:r.symbologyType}}function Y(e,t,i=!1){const r=t.getSymbols(),l=r.length?r[0]:null,n=E(t);return{type:"heatmap",symbol:c(l,n,i),symbologyType:n.symbologyType}}export{A as addAggregateFields,q as createMatcherSchema,O as createRendererAttributeSchema,F as createSchema,E as createSymbolSchemaOptions};
5
+ import e from"../../../../core/Error.js";import t from"../../../../core/has.js";import{clone as i}from"../../../../core/lang.js";import r from"../../../../core/Logger.js";import{isSome as l,unwrap as n,isNone as s,unwrapOr as o}from"../../../../core/maybe.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{WGLSymbologyType as u}from"../../engine/webgl/enums.js";import{getVVType as f}from"../../engine/webgl/Utils.js";import{getTechniqueFromRenderer as d}from"../../engine/webgl/techniques/utils.js";import{getVVFlags as p}from"../../engine/webgl/util/vvFlagUtils.js";import{createSymbolSchema as c}from"./createSymbolSchema.js";export{createSymbolSchema}from"./createSymbolSchema.js";import{getPtMaxVVSize as y}from"./support/pixelBuffering.js";import{getSupportedHeatmapRenderer as m,simplifyVisualVariables as g}from"./support/rendererUtils.js";import{createClusterRenderer as b}from"../support/clusterUtils.js";import{toJSONGeometryType as x}from"../support/util.js";const h=r.getLogger("esri.views.2d.layers.features.schemaUtils"),v="ValidationError",w={esriGeometryPoint:["above-right","above-center","above-left","center-center","center-left","center-right","below-center","below-left","below-right"],esriGeometryPolygon:["always-horizontal"],esriGeometryPolyline:["center-along"],esriGeometryMultipoint:null};function T(e){return e}function E(e){let t=0,i=0,r=u.DEFAULT;if(l(e)){if(i=y(e),"visualVariables"in e&&(t=p(e.visualVariables||[]),"dot-density"===e.type&&(r=u.DOT_DENSITY)),"heatmap"===e.type&&(r=u.HEATMAP),"dictionary"===e.type)return{maxVVSize:i,vvFlags:t,symbologyType:u.DEFAULT};if(r!==u.DOT_DENSITY&&r!==u.HEATMAP){const t=e.getSymbols();"backgroundFillSymbol"in e&&e.backgroundFillSymbol&&t.push(e.backgroundFillSymbol);let i=!0,l=!0;for(const e of t)if("cim"===e.type&&(l=!1),"simple-fill"===e.type||"picture-fill"===e.type){const t=e.outline,r=t&&"none"!==t.style&&"solid"!==t.style,n="simple-fill"===e.type&&"none"!==e.style&&"solid"!==e.style,s="picture-fill"===e.type||n||r;r&&(i=!1),s&&(l=!1)}i?r=l?u.OUTLINE_FILL_SIMPLE:u.OUTLINE_FILL:l&&(r=u.SIMPLE)}}return{vvFlags:t,maxVVSize:i,symbologyType:r}}function I(t,i){const r=t.labelPlacement,l=w[i];if(!t.symbol)return h.warn("No ILabelClass symbol specified."),!0;if(!l)return h.error(new e("mapview-labeling:unsupported-geometry-type",`Unable to create labels for Feature Layer, ${i} is not supported`)),!0;if(!l.includes(r)){const e=l[0];r&&h.warn(`Found invalid label placement type ${r} for ${i}. Defaulting to ${e}`),t.labelPlacement=e}return!1}function S(e,t){const r=i(e);return r.some((e=>I(e,t)))?[]:r}function F(e){return t("esri-2d-update-debug")&&console.debug("Created new schema",V(e,!0)),V(e)}function V(e,t=!1){try{const i=R(e,t),r=B(e),l={};i.map((t=>z(l,e,t)));return{source:{definitionExpression:e.definitionExpression,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:r,targets:l}}catch(i){if(i.fieldName===v)return h.error(i),null;throw i}}function z(t,i,r){switch(r.target){case"feature":return void L(t,M(i),r);case"aggregate":{if(!("featureReduction"in i))return;const l=i.featureReduction;if("selection"===l.type)throw new e(v,"Mapview does not support `selection` reduction type",l);return L(t,M(i),r),void j(t,l,r)}}}function N(e,t){for(const i in t){const r=t[i];if(r.target!==e.name)continue;const l=e.attributes[i];l?(l.context.mesh=l.context.mesh||r.context.mesh,l.context.storage=l.context.storage||r.context.storage):e.attributes[i]=r}return e}function M(e){return[n(e.filter)?.toJSON()??null,n(n(e.featureEffect)?.filter)?.toJSON()??null]}function L(e,t,i){return e.feature||(e.feature={name:"feature",input:"source",filters:t,attributes:{}}),N(e.feature,i.attributes.fields),e}function j(e,t,i){return e.aggregate||(e.aggregate={name:"aggregate",input:"feature",filters:null,attributes:{},params:{clusterRadius:a(t.clusterRadius/2),clusterPixelBuffer:64*Math.ceil(a(t.clusterMaxSize)/64),fields:i.aggregateFields}}),N(e.aggregate,i.attributes.fields),e}function O(e,t){return t.field?P(e,{...t,type:"field",field:t.field}):t.valueExpression?P(e,{...t,type:"expression",valueExpression:t.valueExpression}):{field:null,fieldIndex:null}}function P(e,t){switch(t.type){case"expression":{const i=T(t.valueExpression);if(!e.fields[i]){const r=e.indexCount++;e.fields[i]={...t,name:i,fieldIndex:r}}return{fieldIndex:e.fields[i].fieldIndex}}case"label-expression":{const i=T(JSON.stringify(t.label));if(!e.fields[i]){const r=e.indexCount++;e.fields[i]={...t,name:i,fieldIndex:r}}return{fieldIndex:e.fields[i].fieldIndex}}case"field":{const i=t.field;return"aggregate"===t.target&&e.fields[i]||(e.fields[i]={...t,name:i}),{field:i}}case"statistic":return e.fields[t.name]={...t},{field:t.name}}}function R(e,t=!1){const i=new Array;let r=0;return i.push(k(e,r++,t)),i}function U(e,t,i,r,l,n=!1){const s=P(t,{type:"label-expression",target:r,context:{mesh:!0},resultType:"string",label:{labelExpression:i.labelExpression,labelExpressionInfo:i.labelExpressionInfo?{expression:i.labelExpressionInfo.expression}:null,symbol:!!i.symbol,where:i.where}}),{fieldIndex:o}=s,a=E(e);return{...c(i,a,n),fieldIndex:o,target:r,index:l}}function k(t,i,r=!1){const n={indexCount:0,fields:{}},s="featureReduction"in t&&t.featureReduction,o=s?"aggregate":"feature";if("sublayers"in t){const i={type:"subtype",subtypeField:t.subtypeField,renderers:{},symbologyType:u.DEFAULT},s={type:"subtype",mapping:{},target:"feature"},a={type:"subtype",classes:{}},f={type:"symbol",target:"feature",aggregateFields:[],attributes:n,storage:s,mesh:{matcher:i,aggregateMatcher:null,labels:a,sortKey:null}},d=new Set;let p=0;for(const{renderer:u,subtypeCode:c,labelingInfo:y,labelsVisible:m}of t.sublayers){const t=q(n,o,u,r),f=C(n,o,u),g=m&&y;if("visualVariables"in u&&u.visualVariables&&u.visualVariables.length)throw new e(v,"Visual variables are currently not supported for subtype layers");if("dictionary"===t.type)throw new e(v,"Dictionary renderer is not supported in subtype layers");if("subtype"===t.type)throw new e(v,"Nested subtype renderers is not supported");if(l(f)&&"subtype"===f.type)throw new e(v,"Nested subtype storage is not supported");if(l(f)&&l(f.attributeMapping))throw new e(v,"Non-visual-variable attributes are not supported in subtype layers");if("heatmap"===t.type)throw new e(v,"Heatmaps are not supported in subtype layers");if(d.has(c))throw new e(v,"Subtype codes for sublayers must be unique");d.add(c),i.renderers[c]=t,s.mapping[c]=f,g&&(a.classes[c]=g.map((e=>U(u,n,e,"feature",p++,r))))}return f}if("heatmap"===t.renderer.type&&"raster"===m()){const{blurRadius:e,fieldOffset:i,field:r}=t.renderer;return{type:"heatmap",aggregateFields:[],attributes:n,target:o,storage:null,mesh:{blurRadius:e,fieldOffset:i,field:O(n,{target:o,field:r,resultType:"numeric"}).field}}}const a=[],f="aggregate"===o?b(a,t.renderer,s,null):t.renderer;A(n,a);const d=q(n,o,f,r);let p=null;const y=C(n,o,f),g=x(t.geometryType);let h=t.labelsVisible&&t.labelingInfo||[],w=[];if(s){if("selection"===s.type)throw new e(v,"Mapview does not support `selection` reduction type",s);if(s.symbol){const e=E(f);p={type:"simple",symbol:c(s.symbol,e,r),symbologyType:e.symbologyType}}w=s&&s.labelsVisible&&s.labelingInfo||[]}h=S(h,g),w=S(w,g);let T=0;const I=[...h.map((e=>U(f,n,e,"feature",T++,r))),...w.map((e=>U(f,n,e,"aggregate",T++,r)))],F=D(n,t.orderBy);return{type:"symbol",target:o,attributes:n,aggregateFields:a,storage:y,mesh:{matcher:d,labels:{type:"simple",classes:I},aggregateMatcher:p,sortKey:F}}}function B(e){return"heatmap"===e.renderer?.type&&"raster"===m()?{type:"heatmap"}:{type:"symbol"}}function D(t,i){if(s(i)||!i.length)return null;i.length>1&&h.warn(`Layer rendering currently only supports ordering by 1 orderByInfo, but found ${i.length}. All but the first will be discarded`);const r=i[0],l="ascending"===r.order?"asc":"desc";if(r.field)return{field:r.field,order:l};if(r.valueExpression){return{fieldIndex:P(t,{type:"expression",target:"feature",valueExpression:r.valueExpression,resultType:"numeric"}).fieldIndex,order:l}}return h.error(new e(v,"Expected to find a field or valueExpression for OrderByInfo",r)),null}function A(e,t){const i={mesh:!0,storage:!0};for(const r of t){const{name:t,outStatistic:l}=r,{statisticType:n,onStatisticField:s}=l;let o=null,a=null,u=null;const f="numeric",d="feature";if("onStatisticValueExpression"in l){a=P(e,{type:"expression",target:d,valueExpression:l.onStatisticValueExpression,resultType:f}).fieldIndex}else if("onStatisticNormalizationField"in l){o=P(e,{type:"field",target:d,field:s,resultType:f}).field,u=l.onStatisticNormalizationField}else{o=P(e,{type:"field",target:d,field:s,resultType:f}).field}P(e,{type:"statistic",target:"aggregate",name:t,context:i,inField:o,inNormalizationField:u,inFieldIndex:a,statisticType:n})}}function C(e,t,i){let r;switch(i.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":r={visualVariables:!0,attributes:null};break;default:r=d(i).getStorageSpec(i)}return J(e,t,r,i)}function J(e,t,i,r){if(s(i))return null;const{visualVariables:n,attributes:o}=i;let a=null;n&&"visualVariables"in r&&(a=$(e,t,r.visualVariables));const u=l(a)?4:0;let f=null;return l(o)&&(f=o.map(((i,r)=>{const{field:l,fieldIndex:n}=O(e,{valueExpression:i.valueExpression,field:i.field,resultType:"numeric",target:t});return{binding:r+u,field:l,fieldIndex:n}}))),{type:"simple",target:t,attributeMapping:f,vvMapping:a}}function $(e,t,i){if(!i||!i.length)return[];const r={storage:!0},l="numeric";return g(i).map((i=>{const n=f(i.type),{field:s,fieldIndex:o}=O(e,{target:t,valueExpression:i.valueExpression,field:i.field,context:r,resultType:l});switch(i.type){case"size":return"$view.scale"===i.valueExpression?null:{type:"size",binding:n,field:s,fieldIndex:o,normalizationField:O(e,{target:t,field:i.normalizationField,context:r,resultType:l}).field,valueRepresentation:i.valueRepresentation??null};case"color":return{type:"color",binding:n,field:s,fieldIndex:o,normalizationField:O(e,{target:t,field:i.normalizationField,context:r,resultType:l}).field};case"opacity":return{type:"opacity",binding:n,field:s,fieldIndex:o,normalizationField:O(e,{target:t,field:i.normalizationField,context:r,resultType:l}).field};case"rotation":return{type:"rotation",binding:n,field:s,fieldIndex:o}}})).filter((e=>e))}function q(e,t,i,r=!1){const l=o(e,{indexCount:0,fields:{}});switch(i.type){case"simple":case"dot-density":return _(l,i,r);case"class-breaks":return G(l,t,i,r);case"unique-value":return H(l,t,i,r);case"dictionary":return K(l,i,r);case"heatmap":return Y(l,i,r)}}function _(e,t,i=!1){const r=t.getSymbols(),l=r.length?r[0]:null,n=E(t);return{type:"simple",symbol:c(l,n,i),symbologyType:n.symbologyType}}function G(e,t,i,r=!1){const l={mesh:!0,use:"renderer.field"},n=i.backgroundFillSymbol,{field:s,fieldIndex:o}=O(e,{target:t,field:i.field,valueExpression:i.valueExpression,resultType:"numeric",context:l}),a=i.normalizationType,u="log"===a?"esriNormalizeByLog":"percent-of-total"===a?"esriNormalizeByPercentOfTotal":"field"===a?"esriNormalizeByField":null,f=E(i),d=i.classBreakInfos.map((e=>({symbol:c(e.symbol,f,r),min:e.minValue,max:e.maxValue}))).sort(((e,t)=>e.min-t.min));return{type:"interval",attributes:e.fields,field:s,fieldIndex:o,backgroundFillSymbol:c(n,f,r),defaultSymbol:c(i.defaultSymbol,f,r),intervals:d,normalizationField:i.normalizationField,normalizationTotal:i.normalizationTotal,normalizationType:u,isMaxInclusive:i.isMaxInclusive,symbologyType:f.symbologyType}}function H(t,i,r,l=!1){const n=[],s=r.backgroundFillSymbol,o={target:i,context:{mesh:!0},resultType:"string"};if(r.field&&"string"!=typeof r.field)throw new e(v,"Expected renderer.field to be a string",r);const{field:a,fieldIndex:u}=O(t,{...o,field:r.field,valueExpression:r.valueExpression}),f=E(r);for(const e of r.uniqueValueInfos)n.push({value:""+e.value,symbol:c(e.symbol,f,l)});return{type:"map",attributes:t.fields,field:a,fieldIndex:u,field2:O(t,{...o,field:r.field2}).field,field3:O(t,{...o,field:r.field3}).field,fieldDelimiter:r.fieldDelimiter,backgroundFillSymbol:c(s,f),defaultSymbol:c(r.defaultSymbol,f),map:n,symbologyType:f.symbologyType}}function K(e,t,i=!1){const r=E(t);return{type:"dictionary",config:t.config,fieldMap:t.fieldMap,scaleExpression:t.scaleExpression,url:t.url,symbolOptions:r,symbologyType:r.symbologyType}}function Y(e,t,i=!1){const r=t.getSymbols(),l=r.length?r[0]:null,n=E(t);return{type:"heatmap",symbol:c(l,n,i),symbologyType:n.symbologyType}}export{A as addAggregateFields,q as createMatcherSchema,O as createRendererAttributeSchema,F as createSchema,E 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.24/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../request.js";import t from"../../../../../core/Error.js";import r from"../../../../../core/has.js";import s from"../../../../../core/Logger.js";import{isSome as i,unwrapOr as a,isNone as o}from"../../../../../core/maybe.js";import{throwIfAborted as n,isAbortError as u}from"../../../../../core/promiseUtils.js";import{createSourceAdapter as c}from"../controllers/support/sourceAdapters.js";import{DataTileSource as l}from"./DataTileSource.js";import{QueueProcessor as p}from"../../../../support/QueueProcessor.js";const d=s.getLogger("esri.views.2d.layers.features.sources.BaseFeatureSource"),y=4;class h extends l{constructor(e){super(e),this.type="feature",this.mode="on-demand",this._adapter=c(e.serviceInfo),this._queue=new p({concurrency:8,process:async e=>{if(n(e),i(e.tile)){const t=e.tile.key.id,{signal:s}=e,i=r("esri-tiles-debug")?{tile:t.replace(/\//g,"."),depth:e.depth}:void 0,a=await this._adapter.executeQuery(e.query,{signal:s,query:{...i,...this._schema.customParameters}});return a.level=e.tile.key.level,a}return this._adapter.executeQuery(e.query,{...e,query:this._schema.customParameters})}}),this._patchQueue=new p({concurrency:8,process:async e=>{if(n(e),i(e.tile)){const t=e.tile.key.id,{signal:s}=e,i=r("esri-tiles-debug")?{tile:t.replace(/\//g,"."),depth:e.depth}:void 0,a=await this._adapter.executeQuery(e.query,{signal:s,query:{...i,...this._schema.customParameters}});return a.level=e.tile.key.level,a}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?y:null}get maxPageSize(){var e;const{query:t}=this._serviceInfo.capabilities;return(null!=(e=t.maxRecordCount)?e:8e3)*a(this.maxRecordCountFactor,1)}get pageSize(){return Math.min(8e3,this.maxPageSize)}enableEvent(e,t){}subscribe(e,r){super.subscribe(e,r);const s=this._subscriptions.get(e.id);this._fetchDataTile(e).catch((r=>{u(r)||d.error(new t("mapview-query-error","Encountered error when fetching tile",{tile:e,error:r}))})).then((()=>s.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={}){var s;const i=this._serviceInfo.geometryType,a=this.createQuery(t);a.quantizationParameters=null!=(s=t.quantizationParameters)?s:e.getQuantizationParameters(),a.resultType="tile",a.geometry=e.extent,this._serviceInfo.capabilities.query.supportsQuantization?"esriGeometryPolyline"===i&&(a.maxAllowableOffset=e.resolution*r("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==i&&"esriGeometryPolygon"!==i||(a.maxAllowableOffset=e.resolution,"esriGeometryPolyline"===i&&(a.maxAllowableOffset*=r("feature-polyline-generalization-factor")));const o=this._serviceInfo.capabilities.query;return a.defaultSpatialReferenceEnabled=o.supportsDefaultSpatialReference,a.compactGeometryEnabled=o.supportsCompactGeometry,a}async _executePatchQuery(e,t,r,s){const a=t.clone();a.outFields=[this._serviceInfo.objectIdField,...r],a.returnCentroid=!1,a.returnGeometry=!1;const o=i(a.start)?a.start/8e3:0,n=s.signal;return this._patchQueue.push({tile:e,query:a,signal:n,depth:o})}async _resend(e,t){const{query:r,message:s}=e,a=i(r.outFields)?r.outFields:[],u=this._queryInfo.outFields,c=u.filter((e=>!a.includes(e)));if(o(s.addOrUpdate))this._onMessage({...s,type:"append"});else if(c.length)try{const e=this._subscriptions.get(s.id).tile,i=await this._executePatchQuery(e,r,c,t);n(t),r.outFields=u,s.addOrUpdate.joinAttributes(i),this._onMessage({...s,end:s.end,type:"append"})}catch(l){}else this._onMessage({...s,type:"append"})}async _resendSubscription(e){if(r("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 i(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{h as BaseFeatureSource};
5
+ import e from"../../../../../request.js";import t from"../../../../../core/Error.js";import r from"../../../../../core/has.js";import s from"../../../../../core/Logger.js";import{isSome as i,unwrapOr as a,isNone as o}from"../../../../../core/maybe.js";import{throwIfAborted as n,isAbortError as u}from"../../../../../core/promiseUtils.js";import{createSourceAdapter as c}from"../controllers/support/sourceAdapters.js";import{DataTileSource as l}from"./DataTileSource.js";import{QueueProcessor as p}from"../../../../support/QueueProcessor.js";const d=s.getLogger("esri.views.2d.layers.features.sources.BaseFeatureSource"),y=4;class h extends l{constructor(e){super(e),this.type="feature",this.mode="on-demand",this._adapter=c(e.serviceInfo),this._queue=new p({concurrency:8,process:async e=>{if(n(e),i(e.tile)){const t=e.tile.key.id,{signal:s}=e,i=r("esri-tiles-debug")?{tile:t.replace(/\//g,"."),depth:e.depth}:void 0,a=await this._adapter.executeQuery(e.query,{signal:s,query:{...i,...this._schema.customParameters}});return a.level=e.tile.key.level,a}return this._adapter.executeQuery(e.query,{...e,query:this._schema.customParameters})}}),this._patchQueue=new p({concurrency:8,process:async e=>{if(n(e),i(e.tile)){const t=e.tile.key.id,{signal:s}=e,i=r("esri-tiles-debug")?{tile:t.replace(/\//g,"."),depth:e.depth}:void 0,a=await this._adapter.executeQuery(e.query,{signal:s,query:{...i,...this._schema.customParameters}});return a.level=e.tile.key.level,a}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?y:null}get maxPageSize(){const{query:e}=this._serviceInfo.capabilities;return(e.maxRecordCount??8e3)*a(this.maxRecordCountFactor,1)}get pageSize(){return Math.min(8e3,this.maxPageSize)}enableEvent(e,t){}subscribe(e,r){super.subscribe(e,r);const s=this._subscriptions.get(e.id);this._fetchDataTile(e).catch((r=>{u(r)||d.error(new t("mapview-query-error","Encountered error when fetching tile",{tile:e,error:r}))})).then((()=>s.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 s=this._serviceInfo.geometryType,i=this.createQuery(t);i.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),i.resultType="tile",i.geometry=e.extent,this._serviceInfo.capabilities.query.supportsQuantization?"esriGeometryPolyline"===s&&(i.maxAllowableOffset=e.resolution*r("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==s&&"esriGeometryPolygon"!==s||(i.maxAllowableOffset=e.resolution,"esriGeometryPolyline"===s&&(i.maxAllowableOffset*=r("feature-polyline-generalization-factor")));const a=this._serviceInfo.capabilities.query;return i.defaultSpatialReferenceEnabled=a.supportsDefaultSpatialReference,i.compactGeometryEnabled=a.supportsCompactGeometry,i}async _executePatchQuery(e,t,r,s){const a=t.clone();a.outFields=[this._serviceInfo.objectIdField,...r],a.returnCentroid=!1,a.returnGeometry=!1;const o=i(a.start)?a.start/8e3:0,n=s.signal;return this._patchQueue.push({tile:e,query:a,signal:n,depth:o})}async _resend(e,t){const{query:r,message:s}=e,a=i(r.outFields)?r.outFields:[],u=this._queryInfo.outFields,c=u.filter((e=>!a.includes(e)));if(o(s.addOrUpdate))this._onMessage({...s,type:"append"});else if(c.length)try{const e=this._subscriptions.get(s.id).tile,i=await this._executePatchQuery(e,r,c,t);n(t),r.outFields=u,s.addOrUpdate.joinAttributes(i),this._onMessage({...s,end:s.end,type:"append"})}catch(l){}else this._onMessage({...s,type:"append"})}async _resendSubscription(e){if(r("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 i(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{h 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.24/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../TimeExtent.js";import s from"../../../../../core/Evented.js";import t from"../../../../../core/has.js";import{isSome as r}from"../../../../../core/maybe.js";import{createResolver as i,ignoreAbortErrors as o,eachAlwaysValues as n,eachAlways as u}from"../../../../../core/promiseUtils.js";import{diff as c,hasDiff as a,hasDiffAny as h}from"../../../../../core/accessorSupport/diffUtils.js";import d from"../../../../../rest/support/Query.js";import{DataTileSubscription as l}from"./DataTileSubscription.js";import{UpdateToken as p}from"../support/UpdateToken.js";function m(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 f{constructor(e){this.events=new s,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){var s,t;const r=this._subscriptions.get(e.id);if(!r)return;const i={...e,remove:null!=(s=e.remove)?s:[],status:null!=(t=e.status)?t:p.empty()};return o(this._onTileUpdateMessage(i,r.options))}update(s,r){var i;const o=r.fields.length;r.outFields=m(null==(i=this._schema)?void 0:i.outFields,r.outFields),r.outFields=r.outFields.length>=.75*o?["*"]:r.outFields,r.outFields.sort();const n=c(this._schema,r);if(!n)return;t("esri-2d-update-debug")&&console.debug("Applying Update - Source:",n);const u="orderByFields"in this._serviceInfo&&this._serviceInfo.orderByFields?this._serviceInfo.orderByFields:this._serviceInfo.objectIdField+" ASC",d={returnCentroid:t("esri-2d-query-centroid-enabled")&&"esriGeometryPolygon"===this._serviceInfo.geometryType,returnGeometry:!0,timeReferenceUnknownClient:"stream"!==this._serviceInfo.type&&this._serviceInfo.timeReferenceUnknownClient,outFields:r.outFields,outSpatialReference:this._outSR,orderByFields:[u],where:r.definitionExpression||"1=1",gdbVersion:r.gdbVersion,historicMoment:r.historicMoment,timeExtent:e.fromJSON(r.timeExtent)},l=this._schema&&a(n,"outFields");this._schema&&h(n,["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),l&&(s.why.source.push("Layer required fields changed"),s.source=!0),c(d,this._queryInfo)&&(this._queryInfo=d),this._schema=r,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){for(const s of this._tiles())this.unsubscribe(s),this.subscribe(s,e)}subscribe(e,s){const t=new l(e,s);this._subscriptions.set(e.id,t)}unsubscribe(e){const s=this.get(e.id);r(s)&&s.abort(),this._subscriptions.delete(e.id)}createQuery(e={}){const s=this._queryInfo.historicMoment?new Date(this._queryInfo.historicMoment):null;return new d({...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 n(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 u(i)}this._didEdit=!0}}export{f as DataTileSource};
5
+ import e from"../../../../../TimeExtent.js";import s from"../../../../../core/Evented.js";import t from"../../../../../core/has.js";import{isSome as r}from"../../../../../core/maybe.js";import{createResolver as i,ignoreAbortErrors as o,eachAlwaysValues as n,eachAlways as c}from"../../../../../core/promiseUtils.js";import{diff as u,hasDiff as h,hasDiffAny as a}from"../../../../../core/accessorSupport/diffUtils.js";import d from"../../../../../rest/support/Query.js";import{DataTileSubscription as l}from"./DataTileSubscription.js";import{UpdateToken as p}from"../support/UpdateToken.js";function m(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 f{constructor(e){this.events=new s,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 s=this._subscriptions.get(e.id);if(!s)return;const t={...e,remove:e.remove??[],status:e.status??p.empty()};return o(this._onTileUpdateMessage(t,s.options))}update(s,r){const i=r.fields.length;r.outFields=m(this._schema?.outFields,r.outFields),r.outFields=r.outFields.length>=.75*i?["*"]:r.outFields,r.outFields.sort();const o=u(this._schema,r);if(!o)return;t("esri-2d-update-debug")&&console.debug("Applying Update - Source:",o);const n="orderByFields"in this._serviceInfo&&this._serviceInfo.orderByFields?this._serviceInfo.orderByFields:this._serviceInfo.objectIdField+" ASC",c={returnCentroid:t("esri-2d-query-centroid-enabled")&&"esriGeometryPolygon"===this._serviceInfo.geometryType,returnGeometry:!0,timeReferenceUnknownClient:"stream"!==this._serviceInfo.type&&this._serviceInfo.timeReferenceUnknownClient,outFields:r.outFields,outSpatialReference:this._outSR,orderByFields:[n],where:r.definitionExpression||"1=1",gdbVersion:r.gdbVersion,historicMoment:r.historicMoment,timeExtent:e.fromJSON(r.timeExtent)},d=this._schema&&h(o,"outFields");this._schema&&a(o,["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),d&&(s.why.source.push("Layer required fields changed"),s.source=!0),u(c,this._queryInfo)&&(this._queryInfo=c),this._schema=r,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){for(const s of this._tiles())this.unsubscribe(s),this.subscribe(s,e)}subscribe(e,s){const t=new l(e,s);this._subscriptions.set(e.id,t)}unsubscribe(e){const s=this.get(e.id);r(s)&&s.abort(),this._subscriptions.delete(e.id)}createQuery(e={}){const s=this._queryInfo.historicMoment?new Date(this._queryInfo.historicMoment):null;return new d({...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 n(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 c(i)}this._didEdit=!0}}export{f 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.24/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/CircularArray.js";import s from"../../../../../core/has.js";import{isSome as t,isNone as r,unwrap as i}from"../../../../../core/maybe.js";import{FeatureSetReaderJSON as d}from"../support/FeatureSetReaderJSON.js";import{UpdateToken as a}from"../support/UpdateToken.js";class o{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,t(this._edits)&&this._edits.status.unset(e)}add(e){var r;e.message.status=null!=(r=e.message.status)?r:a.empty(),e.message.status.version=this._version,s("esri-2d-update-debug")&&console.debug(this.tile.id,"DataTileSubscription:add",this._version),e.message.end&&this.requests.done.forEach((e=>{t(e.message)&&e.message.end&&(e.message.end=!1)})),this.requests.done.push(e)}edit(e,s){const t=e.getQuantizationTransform(),o=e.fullSchema(),n=Array.from(e.features()),h=[...s,...n.map((e=>e.objectId))];if(this.removeIds(h),this._invalidate(),r(this._edits))return void(this._edits={type:"append",addOrUpdate:d.fromOptimizedFeatures(n,o,i(t)),id:this.tile.id,status:a.empty(),end:!0});this.requests.done.forEach((e=>e.message.end=!1));i(this._edits.addOrUpdate).append(e.features())}*readers(){for(const{message:e}of this.requests.done)t(e.addOrUpdate)&&(yield e.addOrUpdate);t(this._edits)&&t(this._edits.addOrUpdate)&&(yield this._edits.addOrUpdate)}_invalidate(){for(const e of this.requests.done)e.message.status=a.empty();t(this._edits)&&(this._edits.status=a.empty())}removeIds(e){this._invalidate();for(const{message:s}of this.requests.done){const r=s.addOrUpdate;t(r)&&(r.removeIds(e),r.isEmpty&&(s.addOrUpdate=null))}t(this._edits)&&t(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{o as DataTileSubscription};
5
+ import e from"../../../../../core/CircularArray.js";import s from"../../../../../core/has.js";import{isSome as t,isNone as r,unwrap as i}from"../../../../../core/maybe.js";import{FeatureSetReaderJSON as d}from"../support/FeatureSetReaderJSON.js";import{UpdateToken as a}from"../support/UpdateToken.js";class o{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,t(this._edits)&&this._edits.status.unset(e)}add(e){e.message.status=e.message.status??a.empty(),e.message.status.version=this._version,s("esri-2d-update-debug")&&console.debug(this.tile.id,"DataTileSubscription:add",this._version),e.message.end&&this.requests.done.forEach((e=>{t(e.message)&&e.message.end&&(e.message.end=!1)})),this.requests.done.push(e)}edit(e,s){const t=e.getQuantizationTransform(),o=e.fullSchema(),n=Array.from(e.features()),h=[...s,...n.map((e=>e.objectId))];if(this.removeIds(h),this._invalidate(),r(this._edits))return void(this._edits={type:"append",addOrUpdate:d.fromOptimizedFeatures(n,o,i(t)),id:this.tile.id,status:a.empty(),end:!0});this.requests.done.forEach((e=>e.message.end=!1));i(this._edits.addOrUpdate).append(e.features())}*readers(){for(const{message:e}of this.requests.done)t(e.addOrUpdate)&&(yield e.addOrUpdate);t(this._edits)&&t(this._edits.addOrUpdate)&&(yield this._edits.addOrUpdate)}_invalidate(){for(const e of this.requests.done)e.message.status=a.empty();t(this._edits)&&(this._edits.status=a.empty())}removeIds(e){this._invalidate();for(const{message:s}of this.requests.done){const r=s.addOrUpdate;t(r)&&(r.removeIds(e),r.isEmpty&&(s.addOrUpdate=null))}t(this._edits)&&t(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{o 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.24/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{unwrapOrThrow as e,isSome as s,isNone as r}from"../../../../../core/maybe.js";import{throwIfAborted as o,after as a}from"../../../../../core/promiseUtils.js";import i from"../../../../../core/RandomLCG.js";import{BaseFeatureSource as n}from"./BaseFeatureSource.js";import{FeatureSetReaderIndirect as d}from"../support/FeatureSetReaderPBFIndirect.js";import{UpdateToken as h}from"../support/UpdateToken.js";const l=t.getLogger("esri.views.2d.layers.features.sources.SnapshotFeatureSource");function u(t,e,s){const r=t.getXHydrated(),o=t.getYHydrated(),a=e.getColumnForX(r),i=Math.floor(e.normalizeCol(a));return`${s}/${Math.floor(e.getRowForY(o))}/${i}`}function c(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,i=-o/e,n=1/e,d=a/r,h=1/-r;return t.transform(i,d,n,h)}const[a,i]=o.scale,[n,d]=o.translate,[h,l]=s.scale,[u,c]=s.translate,g=a/h,p=(n-u)/h,_=i/l,m=(-d+c)/l;return t.transform(p,m,g,_)}class g extends n{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 i(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,e){super.update(t,e),this._hasAggregates=t.targets.aggregate}async resend(t=!1){if(await this._downloadPromise,this._invalidated||t){const t=e(this._schema.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 s=this._queries.map((({query:t,reader:e})=>this._sendPatchQuery(t,e)));await Promise.all(s),this._subscriptions.forEach((t=>{t.requests.done.forEach((t=>this._onMessage(t.message)))}))}async refresh(){await this.resend(!0)}async _sendPatchQuery(t,e){const r=s(t.outFields)?t.outFields:[],a=this._queryInfo.outFields,i=a.filter((t=>!r.includes(t)));if(!i.length)return;const n=t.clone(),d=this._signal;n.returnGeometry=!1,n.returnCentroid=!1,n.outFields=i,t.outFields=a;const h=await this._queue.push({query:n,depth:0,signal:d});o({signal:d}),e.joinAttributes(h)}async _fetchDataTile(t){if(!this._downloadPromise){const t=e(this._schema.featureCount,"Expected featureCount to be defined");this._downloadPromise=this._download(t)}const s=this._store.search(t),r=this._subscriptions.get(t.key.id),o=s.length-1;for(let e=0;e<o;e++){const o=c(s[e],t),i={type:"append",id:t.id,addOrUpdate:o,end:!1,status:h.empty()};r.add({query:null,message:i}),this._hasAggregates||await a(1),this._onMessage(i)}const i=c(o>=0?s[o]:null,t),n=this._didSendEnd,d={type:"append",id:t.id,addOrUpdate:i,end:n,status:h.empty()};r.add({query:null,message:d}),this._onMessage(d)}async _download(t){try{await this.whenInitialized();const e=this._store.storage.getBitset(this._markedIdsBufId),s=new Set;e.clear();const r=Math.ceil(t/this.pageSize),o=Array.from({length:r},((t,e)=>e)).sort(((t,e)=>this._random.getInt()-this._random.getInt())).map((t=>this._downloadPage(t,e,s)));await Promise.all(o),this._store.sweepFeatures(e,this._store.storage),this._store.sweepFeatureSets(s)}catch(e){l.error("mapview-snapshot-source","Encountered and error when downloading feature snapshot",e)}this._sendEnd(),this._loading=!1}async _downloadPage(t,e,r){const a=this.pageSize,i={start:t*a,num:a,cacheHint:!0};s(this.maxRecordCountFactor)&&(i.maxRecordCountFactor=this.maxRecordCountFactor);const n=this.createQuery(i),d=this._signal,h=await this._queue.push({query:n,depth:t,signal:d});o({signal:d}),this._queries.push({query:n,reader:h}),this._store.insert(h),r.add(h.instance);const l=h.getCursor();for(;l.next();)e.set(l.getDisplayId());this._send(h)}_send(t){if(!this._subscriptions.size)return;let e=null;const o=new Map,a=new Set,i=new Map;this._subscriptions.forEach((t=>{var s;const r=t.tile;o.set(r.key.id,null),e=r.tileInfoView,a.add(r.level);const{row:n,col:d}=r.key,h=`${r.level}/${n}/${d}`,l=null!=(s=i.get(h))?s:[];l.push(t),i.set(h,l)}));for(const s of a){const a=e.getLODInfoAt(s),n=t.getCursor();for(;n.next();){const t=u(n,a,s),e=n.getIndex();if(i.has(t))for(const s of i.get(t)){const t=s.tile.id;let a=o.get(t);r(a)&&(a=[],o.set(t,a)),a.push(e)}}}o.forEach(((e,r)=>{if(s(e)){const s=this._subscriptions.get(r),o={type:"append",id:r,addOrUpdate:c(d.from(t,e),s.tile),end:!1,status:h.empty()};s.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:h.empty()};t.add({query:null,message:e}),this._onMessage(e)})),this._didSendEnd=!0}}export{g as SnapshotFeatureSource};
5
+ import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{unwrapOrThrow as e,isSome as s,isNone as r}from"../../../../../core/maybe.js";import{throwIfAborted as o,after as a}from"../../../../../core/promiseUtils.js";import i from"../../../../../core/RandomLCG.js";import{BaseFeatureSource as n}from"./BaseFeatureSource.js";import{FeatureSetReaderIndirect as d}from"../support/FeatureSetReaderPBFIndirect.js";import{UpdateToken as h}from"../support/UpdateToken.js";const u=t.getLogger("esri.views.2d.layers.features.sources.SnapshotFeatureSource");function l(t,e,s){const r=t.getXHydrated(),o=t.getYHydrated(),a=e.getColumnForX(r),i=Math.floor(e.normalizeCol(a));return`${s}/${Math.floor(e.getRowForY(o))}/${i}`}function c(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,i=-o/e,n=1/e,d=a/r,h=1/-r;return t.transform(i,d,n,h)}const[a,i]=o.scale,[n,d]=o.translate,[h,u]=s.scale,[l,c]=s.translate,g=a/h,p=(n-l)/h,_=i/u,m=(-d+c)/u;return t.transform(p,m,g,_)}class g extends n{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 i(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,e){super.update(t,e),this._hasAggregates=t.targets.aggregate}async resend(t=!1){if(await this._downloadPromise,this._invalidated||t){const t=e(this._schema.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 s=this._queries.map((({query:t,reader:e})=>this._sendPatchQuery(t,e)));await Promise.all(s),this._subscriptions.forEach((t=>{t.requests.done.forEach((t=>this._onMessage(t.message)))}))}async refresh(){await this.resend(!0)}async _sendPatchQuery(t,e){const r=s(t.outFields)?t.outFields:[],a=this._queryInfo.outFields,i=a.filter((t=>!r.includes(t)));if(!i.length)return;const n=t.clone(),d=this._signal;n.returnGeometry=!1,n.returnCentroid=!1,n.outFields=i,t.outFields=a;const h=await this._queue.push({query:n,depth:0,signal:d});o({signal:d}),e.joinAttributes(h)}async _fetchDataTile(t){if(!this._downloadPromise){const t=e(this._schema.featureCount,"Expected featureCount to be defined");this._downloadPromise=this._download(t)}const s=this._store.search(t),r=this._subscriptions.get(t.key.id),o=s.length-1;for(let e=0;e<o;e++){const o=c(s[e],t),i={type:"append",id:t.id,addOrUpdate:o,end:!1,status:h.empty()};r.add({query:null,message:i}),this._hasAggregates||await a(1),this._onMessage(i)}const i=c(o>=0?s[o]:null,t),n=this._didSendEnd,d={type:"append",id:t.id,addOrUpdate:i,end:n,status:h.empty()};r.add({query:null,message:d}),this._onMessage(d)}async _download(t){try{await this.whenInitialized();const e=this._store.storage.getBitset(this._markedIdsBufId),s=new Set;e.clear();const r=Math.ceil(t/this.pageSize),o=Array.from({length:r},((t,e)=>e)).sort(((t,e)=>this._random.getInt()-this._random.getInt())).map((t=>this._downloadPage(t,e,s)));await Promise.all(o),this._store.sweepFeatures(e,this._store.storage),this._store.sweepFeatureSets(s)}catch(e){u.error("mapview-snapshot-source","Encountered and error when downloading feature snapshot",e)}this._sendEnd(),this._loading=!1}async _downloadPage(t,e,r){const a=this.pageSize,i={start:t*a,num:a,cacheHint:!0};s(this.maxRecordCountFactor)&&(i.maxRecordCountFactor=this.maxRecordCountFactor);const n=this.createQuery(i),d=this._signal,h=await this._queue.push({query:n,depth:t,signal:d});o({signal:d}),this._queries.push({query:n,reader:h}),this._store.insert(h),r.add(h.instance);const u=h.getCursor();for(;u.next();)e.set(u.getDisplayId());this._send(h)}_send(t){if(!this._subscriptions.size)return;let e=null;const o=new Map,a=new Set,i=new Map;this._subscriptions.forEach((t=>{const s=t.tile;o.set(s.key.id,null),e=s.tileInfoView,a.add(s.level);const{row:r,col:n}=s.key,d=`${s.level}/${r}/${n}`,h=i.get(d)??[];h.push(t),i.set(d,h)}));for(const s of a){const a=e.getLODInfoAt(s),n=t.getCursor();for(;n.next();){const t=l(n,a,s),e=n.getIndex();if(i.has(t))for(const s of i.get(t)){const t=s.tile.id;let a=o.get(t);r(a)&&(a=[],o.set(t,a)),a.push(e)}}}o.forEach(((e,r)=>{if(s(e)){const s=this._subscriptions.get(r),o={type:"append",id:r,addOrUpdate:c(d.from(t,e),s.tile),end:!1,status:h.empty()};s.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:h.empty()};t.add({query:null,message:e}),this._onMessage(e)})),this._didSendEnd=!0}}export{g 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.24/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../geometry.js";import e from"../../../../../core/Evented.js";import t from"../../../../../core/has.js";import{isNone as s,isSome as r,applySome as i}from"../../../../../core/maybe.js";import{diff as a,hasDiff as o}from"../../../../../core/accessorSupport/diffUtils.js";import{GeohashTree as h}from"../../../../../geohash/GeohashTree.js";import{setGeohashBuf as l,setGeohashXY as n}from"../../../../../geohash/geohashUtils.js";import{earth as u}from"../../../../../geometry/support/Ellipsoid.js";import{getInfo as c}from"../../../../../geometry/support/spatialReferenceUtils.js";import{quantizeX as g,quantizeY as d}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeatureWithGeometry as f,OptimizedFeature as p}from"../../../../../layers/graphics/OptimizedFeature.js";import _ from"../../../../../layers/graphics/OptimizedGeometry.js";import{checkProjectionSupport as m,project as y}from"../../../../../layers/graphics/data/projectionSupport.js";import{TILE_SIZE as v}from"../../../engine/webgl/definitions.js";import{DISPLAY_ID_TEXEL_MASK as I}from"../../../engine/webgl/DisplayId.js";import{Store2D as b}from"../Store2D.js";import{FeatureSetReaderJSON as R}from"./FeatureSetReaderJSON.js";import C from"../../../../../geometry/SpatialReference.js";const M=12,x=1;class L extends f{constructor(e,t,s,r,i){super(new _([],[t,s]),r,null,e),this.geohashBoundsInfo=i}get count(){return this.attributes.cluster_count}static create(e,t,s,r,i,a,o,h){const l=new L(t,s,r,a,o);return l.displayId=e.createDisplayId(!0),l.referenceId=h,l.tileLevel=i,l}update(e,t,s,r,i,a){return this.geometry.coords[0]=e,this.geometry.coords[1]=t,this.tileLevel=s,this.attributes=r,this.geohashBoundsInfo=i,this.referenceId=null,this.referenceId=a,this}toJSON(){return{objectId:this.objectId,referenceId:1===this.attributes.cluster_count?this.referenceId:null,attributes:{...this.attributes,clusterId:this.objectId},geometry:{x:this.geometry.coords[0],y:this.geometry.coords[1]}}}}function j(e){return 57.29577951308232*e}class w extends b{constructor(t,s,r,i){super(t,r),this.events=new e,this._geohashLevel=0,this._tileLevel=0,this._aggregateValueRanges={},this._aggregateValueRangesChanged=!1,this._geohashBuf=[],this._clusters=new Map,this._tiles=new Map,this._serviceInfo=i,this.geometryInfo=t.geometryInfo,this._spatialReference=s,this._projectionSupportCheck=m(s,C.WGS84),this._bitsets.geohash=r.getBitset(r.createBitset()),this._bitsets.inserted=r.getBitset(r.createBitset())}async updateSchema(e,r){const i=this._schema;try{await super.updateSchema(e,r),await this._projectionSupportCheck}catch(n){}const l=a(i,r);r&&(!s(l)||e.source||e.storage.filters)?((o(l,"params.fields")||!this._tree||e.source)&&(this._tree=new h(this._statisticFields,this._serviceInfo),this._rebuildTree(),t("esri-2d-update-debug")&&console.debug("Aggregate mesh needs update due to tree changing")),t("esri-2d-update-debug")&&console.debug("Applying Update - ClusterStore:",l),e.targets[r.name]=!0,e.mesh=!1,this._aggregateValueRanges={}):i&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,t){this._bitsets.inserted.forEachSet((s=>{if(!e.has(s)){const e=t.lookupByDisplayIdUnsafe(s);this._remove(e)}}))}sweepClusters(e,t,s){this._clusters.forEach(((r,i)=>{r&&r.tileLevel!==s&&(e.releaseDisplayId(r.displayId),t.unsetAttributeData(r.displayId),this._clusters.delete(i))}))}onTileData(e,t,r,i,a=!0){if(!this._schema||s(t.addOrUpdate))return t;const o=this._getTransforms(e,this._spatialReference);{const e=t.addOrUpdate.getCursor();for(;e.next();)this._update(e,i)}if(t.status.mesh||!a)return t;const h=new Array,l=this._schema.params.clusterRadius;this._getClustersForTile(h,e,l,r,o),t.addOrUpdate=R.fromOptimizedFeatures(h,this._serviceInfo),t.addOrUpdate.attachStorage(r),t.end=!0;{const s=t.addOrUpdate.getCursor();for(;s.next();){const t=s.getDisplayId();this._bitsets.computed.unset(t),this.setComputedAttributes(r,s,t,e.scale)}}return this._aggregateValueRangesChanged&&t.end&&(this.events.emit("valueRangesChanged",{valueRanges:this._aggregateValueRanges}),this._aggregateValueRangesChanged=!1),t}onTileUpdate({added:e,removed:t}){if(e.length){const t=e[0].level;this._tileLevel=t,this._setGeohashLevel(t)}if(!this._schema)return;const s=this._schema.params.clusterRadius;t.forEach((e=>{this._tiles.delete(e.key.id),this._markTileClustersForDeletion(e,s)}))}getAggregate(e){for(const t of this._clusters.values())if(((null==t?void 0:t.displayId)&I)==(e&I))return t.toJSON();return null}getAggregates(){const e=[];for(const t of this._clusters.values())(null==t?void 0:t.tileLevel)===this._tileLevel&&e.push(t.toJSON());return e}getDisplayId(e){const t=this._clusters.get(e);return t?t.displayId:null}getFeatureDisplayIdsForAggregate(e){const t=this._clusters.get(e);if(!t)return[];const s=t.geohashBoundsInfo;return this._tree.getRegionDisplayIds(s.xLL,s.yLL,s.xTR,s.yTR,s.level)}getDisplayIdForReferenceId(e){for(const t of this._clusters.values())if((null==t?void 0:t.referenceId)===e)return t.displayId;return null}getAggregateValueRanges(){return this._aggregateValueRanges}forEach(e){for(const[t,s]of this._clusters)s&&e(s,t)}size(){let e=0;return this.forEach((t=>e++)),e}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const t=e.getDisplayId(),s=e.getXHydrated(),r=e.getYHydrated(),i=this._geohashBuf[2*t],a=this._geohashBuf[2*t+1];this._bitsets.inserted.has(t)&&(this._bitsets.inserted.unset(t),this._tree.removeCursor(e,s,r,i,a,this._geohashLevel))}_update(e,t){const s=e.getDisplayId(),r=this._bitsets.inserted,i=t.isVisible(s);if(i===r.has(s))return;if(!i)return void this._remove(e);const a=e.getXHydrated(),o=e.getYHydrated();if(!this._setGeohash(s,a,o))return;const h=this._geohashBuf[2*s],l=this._geohashBuf[2*s+1];this._tree.insertCursor(e,s,a,o,h,l,this._geohashLevel),r.set(s)}_setGeohash(e,t,s){if(this._bitsets.geohash.has(e))return!0;const r=this._geohashBuf;if(this._spatialReference.isWebMercator){const i=j(t/u.radius),a=i-360*Math.floor((i+180)/360),o=j(Math.PI/2-2*Math.atan(Math.exp(-s/u.radius)));l(r,e,o,a,M)}else{const i=y({x:t,y:s},this._spatialReference,C.WGS84);if(!i)return!1;l(r,e,i.y,i.x,M)}return this._bitsets.geohash.set(e),!0}_getClustersForTile(e,t,a,o,h,l=!0){const n=this._schema.params.clusterPixelBuffer,u=2*a,c=this._getGeohashLevel(t.key.level),f=Math.ceil(2**t.key.level*v/u),_=Math.ceil(n/u)+0,m=Math.ceil(v/u),{row:y,col:I}=t.key,b=I*v,R=y*v,C=Math.floor(b/u)-_,M=Math.floor(R/u)-_,x=C+m+2*_,L=M+m+2*_,j=t.tileInfoView.getLODInfoAt(t.key.level);for(let v=C;v<=x;v++)for(let a=M;a<=L;a++){let n=v;j.wrap&&(n=v<0?v+f:v%f);const u=j.wrap&&v<0,_=j.wrap&&v%f!==v,m=this._lookupCluster(o,j,t.key.level,n,a,c);if(r(m)){const t=i(h,(e=>u?e.left:_?e.right:e.tile));if(l&&s(t))continue;if(!m.count)continue;if(r(t)&&l){const s=m.geometry.clone();let i=m.attributes;s.coords[0]=g(t,s.coords[0]),s.coords[1]=d(t,s.coords[1]),1===m.count&&r(m.referenceId)&&(i={...m.attributes,referenceId:m.referenceId});const a=new p(s,i);a.displayId=m.displayId,e.push(a)}}}}_getGeohashLevel(e){return Math.min(Math.ceil(e/2+2),M)}_setGeohashLevel(e){const t=this._getGeohashLevel(e),s=(Math.floor(t/x)+1)*x-1;if(this._geohashLevel!==s)return this._geohashLevel=s,this._rebuildTree(),void this._bitsets.geohash.clear()}_getTransforms(e,t){const s={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},r=c(t);if(!r)return{tile:s,left:null,right:null};const[i,a]=r.valid;return{tile:s,left:{...s,translate:[a,e.bounds[3]]},right:{...s,translate:[i-a+e.bounds[0],e.bounds[3]]}}}_getClusterId(e,t,s){return(15&e)<<28|(16383&t)<<14|16383&s}_markForDeletion(e,t,s){const r=this._getClusterId(e,t,s);this._clusters.delete(r)}_getClusterBounds(e,t,s){const r=this._schema.params.clusterRadius,i=2*r;let a=s%2?t*i:t*i-r;const o=s*i;let h=a+i;const l=o-i,n=2**e.level*v;e.wrap&&a<0&&(a=0),e.wrap&&h>n&&(h=n);const u=a/v,c=o/v,g=h/v,d=l/v;return[e.getXForColumn(u),e.getYForRow(c),e.getXForColumn(g),e.getYForRow(d)]}_lookupCluster(e,t,s,i,a,o){const h=this._getClusterId(s,i,a),l=this._clusters.get(h),[c,g,d,f]=this._getClusterBounds(t,i,a),p={x:c,y:g},_={x:d,y:f};let m=0,v=0,I=0,b=0;if(this._spatialReference.isWebMercator){{const e=j(p.x/u.radius);m=e-360*Math.floor((e+180)/360),v=j(Math.PI/2-2*Math.atan(Math.exp(-p.y/u.radius)))}{const e=j(_.x/u.radius);I=e-360*Math.floor((e+180)/360),b=j(Math.PI/2-2*Math.atan(Math.exp(-_.y/u.radius)))}}else{const e=y(p,this._spatialReference,C.WGS84),t=y(_,this._spatialReference,C.WGS84);if(!e||!t)return null;m=e.x,v=e.y,I=t.x,b=t.y}const R={geohashX:0,geohashY:0},M={geohashX:0,geohashY:0};n(R,v,m,o),n(M,b,I,o);const x=R.geohashX,w=R.geohashY,V=M.geohashX,S=M.geohashY,F={xLL:x,yLL:w,xTR:V,yTR:S,level:o},D=this._tree.getRegionStatistics(x,w,V,S,o),{count:T,xTotal:k,yTotal:B,referenceId:G}=D,O=T?k/T:0,A=T?B/T:0;if(0===T)return this._clusters.set(h,null),null;const U={cluster_count:T,...D.attributes},X=r(l)?l.update(O,A,s,U,F,G):L.create(e,h,O,A,s,U,F,G);return 0===T&&(X.geometry.coords[0]=(c+d)/2,X.geometry.coords[1]=(g+f)/2),this._clusters.set(h,X),this._updateAggregateValueRangeForCluster(X,X.tileLevel),X}_updateAggregateValueRangeForCluster(e,t){const s=this._aggregateValueRanges[t]||{minValue:1/0,maxValue:0},r=s.minValue,i=s.maxValue;s.minValue=Math.min(r,e.count),s.maxValue=Math.max(i,e.count),this._aggregateValueRanges[t]=s,r===s.minValue&&i===s.maxValue||(this._aggregateValueRangesChanged=!0)}_markTileClustersForDeletion(e,t){const s=2*t,r=Math.ceil(v/s),{row:i,col:a}=e.key,o=a*v,h=i*v,l=Math.floor(o/s),n=Math.floor(h/s);for(let u=l;u<l+r;u++)for(let t=n;t<n+r;t++)this._markForDeletion(e.key.level,u,t)}}export{L as ClusterInfo,w as ClusterStore};
5
+ import"../../../../../geometry.js";import e from"../../../../../core/Evented.js";import t from"../../../../../core/has.js";import{isNone as s,isSome as r,applySome as i}from"../../../../../core/maybe.js";import{diff as a,hasDiff as o}from"../../../../../core/accessorSupport/diffUtils.js";import{GeohashTree as h}from"../../../../../geohash/GeohashTree.js";import{setGeohashBuf as l,setGeohashXY as n}from"../../../../../geohash/geohashUtils.js";import{earth as u}from"../../../../../geometry/support/Ellipsoid.js";import{getInfo as c}from"../../../../../geometry/support/spatialReferenceUtils.js";import{quantizeX as g,quantizeY as d}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeatureWithGeometry as f,OptimizedFeature as p}from"../../../../../layers/graphics/OptimizedFeature.js";import _ from"../../../../../layers/graphics/OptimizedGeometry.js";import{checkProjectionSupport as m,project as y}from"../../../../../layers/graphics/data/projectionSupport.js";import{TILE_SIZE as I}from"../../../engine/webgl/definitions.js";import{DISPLAY_ID_TEXEL_MASK as v}from"../../../engine/webgl/DisplayId.js";import{Store2D as b}from"../Store2D.js";import{FeatureSetReaderJSON as R}from"./FeatureSetReaderJSON.js";import C from"../../../../../geometry/SpatialReference.js";const M=12,x=1;class L extends f{constructor(e,t,s,r,i){super(new _([],[t,s]),r,null,e),this.geohashBoundsInfo=i}get count(){return this.attributes.cluster_count}static create(e,t,s,r,i,a,o,h){const l=new L(t,s,r,a,o);return l.displayId=e.createDisplayId(!0),l.referenceId=h,l.tileLevel=i,l}update(e,t,s,r,i,a){return this.geometry.coords[0]=e,this.geometry.coords[1]=t,this.tileLevel=s,this.attributes=r,this.geohashBoundsInfo=i,this.referenceId=null,this.referenceId=a,this}toJSON(){return{objectId:this.objectId,referenceId:1===this.attributes.cluster_count?this.referenceId:null,attributes:{...this.attributes,clusterId:this.objectId},geometry:{x:this.geometry.coords[0],y:this.geometry.coords[1]}}}}function j(e){return 57.29577951308232*e}class w extends b{constructor(t,s,r,i){super(t,r),this.events=new e,this._geohashLevel=0,this._tileLevel=0,this._aggregateValueRanges={},this._aggregateValueRangesChanged=!1,this._geohashBuf=[],this._clusters=new Map,this._tiles=new Map,this._serviceInfo=i,this.geometryInfo=t.geometryInfo,this._spatialReference=s,this._projectionSupportCheck=m(s,C.WGS84),this._bitsets.geohash=r.getBitset(r.createBitset()),this._bitsets.inserted=r.getBitset(r.createBitset())}async updateSchema(e,r){const i=this._schema;try{await super.updateSchema(e,r),await this._projectionSupportCheck}catch(n){}const l=a(i,r);r&&(!s(l)||e.source||e.storage.filters)?((o(l,"params.fields")||!this._tree||e.source)&&(this._tree=new h(this._statisticFields,this._serviceInfo),this._rebuildTree(),t("esri-2d-update-debug")&&console.debug("Aggregate mesh needs update due to tree changing")),t("esri-2d-update-debug")&&console.debug("Applying Update - ClusterStore:",l),e.targets[r.name]=!0,e.mesh=!1,this._aggregateValueRanges={}):i&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,t){this._bitsets.inserted.forEachSet((s=>{if(!e.has(s)){const e=t.lookupByDisplayIdUnsafe(s);this._remove(e)}}))}sweepClusters(e,t,s){this._clusters.forEach(((r,i)=>{r&&r.tileLevel!==s&&(e.releaseDisplayId(r.displayId),t.unsetAttributeData(r.displayId),this._clusters.delete(i))}))}onTileData(e,t,r,i,a=!0){if(!this._schema||s(t.addOrUpdate))return t;const o=this._getTransforms(e,this._spatialReference);{const e=t.addOrUpdate.getCursor();for(;e.next();)this._update(e,i)}if(t.status.mesh||!a)return t;const h=new Array,l=this._schema.params.clusterRadius;this._getClustersForTile(h,e,l,r,o),t.addOrUpdate=R.fromOptimizedFeatures(h,this._serviceInfo),t.addOrUpdate.attachStorage(r),t.end=!0;{const s=t.addOrUpdate.getCursor();for(;s.next();){const t=s.getDisplayId();this._bitsets.computed.unset(t),this.setComputedAttributes(r,s,t,e.scale)}}return this._aggregateValueRangesChanged&&t.end&&(this.events.emit("valueRangesChanged",{valueRanges:this._aggregateValueRanges}),this._aggregateValueRangesChanged=!1),t}onTileUpdate({added:e,removed:t}){if(e.length){const t=e[0].level;this._tileLevel=t,this._setGeohashLevel(t)}if(!this._schema)return;const s=this._schema.params.clusterRadius;t.forEach((e=>{this._tiles.delete(e.key.id),this._markTileClustersForDeletion(e,s)}))}getAggregate(e){for(const t of this._clusters.values())if((t?.displayId&v)==(e&v))return t.toJSON();return null}getAggregates(){const e=[];for(const t of this._clusters.values())t?.tileLevel===this._tileLevel&&e.push(t.toJSON());return e}getDisplayId(e){const t=this._clusters.get(e);return t?t.displayId:null}getFeatureDisplayIdsForAggregate(e){const t=this._clusters.get(e);if(!t)return[];const s=t.geohashBoundsInfo;return this._tree.getRegionDisplayIds(s.xLL,s.yLL,s.xTR,s.yTR,s.level)}getDisplayIdForReferenceId(e){for(const t of this._clusters.values())if(t?.referenceId===e)return t.displayId;return null}getAggregateValueRanges(){return this._aggregateValueRanges}forEach(e){for(const[t,s]of this._clusters)s&&e(s,t)}size(){let e=0;return this.forEach((t=>e++)),e}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const t=e.getDisplayId(),s=e.getXHydrated(),r=e.getYHydrated(),i=this._geohashBuf[2*t],a=this._geohashBuf[2*t+1];this._bitsets.inserted.has(t)&&(this._bitsets.inserted.unset(t),this._tree.removeCursor(e,s,r,i,a,this._geohashLevel))}_update(e,t){const s=e.getDisplayId(),r=this._bitsets.inserted,i=t.isVisible(s);if(i===r.has(s))return;if(!i)return void this._remove(e);const a=e.getXHydrated(),o=e.getYHydrated();if(!this._setGeohash(s,a,o))return;const h=this._geohashBuf[2*s],l=this._geohashBuf[2*s+1];this._tree.insertCursor(e,s,a,o,h,l,this._geohashLevel),r.set(s)}_setGeohash(e,t,s){if(this._bitsets.geohash.has(e))return!0;const r=this._geohashBuf;if(this._spatialReference.isWebMercator){const i=j(t/u.radius),a=i-360*Math.floor((i+180)/360),o=j(Math.PI/2-2*Math.atan(Math.exp(-s/u.radius)));l(r,e,o,a,M)}else{const i=y({x:t,y:s},this._spatialReference,C.WGS84);if(!i)return!1;l(r,e,i.y,i.x,M)}return this._bitsets.geohash.set(e),!0}_getClustersForTile(e,t,a,o,h,l=!0){const n=this._schema.params.clusterPixelBuffer,u=2*a,c=this._getGeohashLevel(t.key.level),f=Math.ceil(2**t.key.level*I/u),_=Math.ceil(n/u)+0,m=Math.ceil(I/u),{row:y,col:v}=t.key,b=v*I,R=y*I,C=Math.floor(b/u)-_,M=Math.floor(R/u)-_,x=C+m+2*_,L=M+m+2*_,j=t.tileInfoView.getLODInfoAt(t.key.level);for(let I=C;I<=x;I++)for(let a=M;a<=L;a++){let n=I;j.wrap&&(n=I<0?I+f:I%f);const u=j.wrap&&I<0,_=j.wrap&&I%f!==I,m=this._lookupCluster(o,j,t.key.level,n,a,c);if(r(m)){const t=i(h,(e=>u?e.left:_?e.right:e.tile));if(l&&s(t))continue;if(!m.count)continue;if(r(t)&&l){const s=m.geometry.clone();let i=m.attributes;s.coords[0]=g(t,s.coords[0]),s.coords[1]=d(t,s.coords[1]),1===m.count&&r(m.referenceId)&&(i={...m.attributes,referenceId:m.referenceId});const a=new p(s,i);a.displayId=m.displayId,e.push(a)}}}}_getGeohashLevel(e){return Math.min(Math.ceil(e/2+2),M)}_setGeohashLevel(e){const t=this._getGeohashLevel(e),s=(Math.floor(t/x)+1)*x-1;if(this._geohashLevel!==s)return this._geohashLevel=s,this._rebuildTree(),void this._bitsets.geohash.clear()}_getTransforms(e,t){const s={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},r=c(t);if(!r)return{tile:s,left:null,right:null};const[i,a]=r.valid;return{tile:s,left:{...s,translate:[a,e.bounds[3]]},right:{...s,translate:[i-a+e.bounds[0],e.bounds[3]]}}}_getClusterId(e,t,s){return(15&e)<<28|(16383&t)<<14|16383&s}_markForDeletion(e,t,s){const r=this._getClusterId(e,t,s);this._clusters.delete(r)}_getClusterBounds(e,t,s){const r=this._schema.params.clusterRadius,i=2*r;let a=s%2?t*i:t*i-r;const o=s*i;let h=a+i;const l=o-i,n=2**e.level*I;e.wrap&&a<0&&(a=0),e.wrap&&h>n&&(h=n);const u=a/I,c=o/I,g=h/I,d=l/I;return[e.getXForColumn(u),e.getYForRow(c),e.getXForColumn(g),e.getYForRow(d)]}_lookupCluster(e,t,s,i,a,o){const h=this._getClusterId(s,i,a),l=this._clusters.get(h),[c,g,d,f]=this._getClusterBounds(t,i,a),p={x:c,y:g},_={x:d,y:f};let m=0,I=0,v=0,b=0;if(this._spatialReference.isWebMercator){{const e=j(p.x/u.radius);m=e-360*Math.floor((e+180)/360),I=j(Math.PI/2-2*Math.atan(Math.exp(-p.y/u.radius)))}{const e=j(_.x/u.radius);v=e-360*Math.floor((e+180)/360),b=j(Math.PI/2-2*Math.atan(Math.exp(-_.y/u.radius)))}}else{const e=y(p,this._spatialReference,C.WGS84),t=y(_,this._spatialReference,C.WGS84);if(!e||!t)return null;m=e.x,I=e.y,v=t.x,b=t.y}const R={geohashX:0,geohashY:0},M={geohashX:0,geohashY:0};n(R,I,m,o),n(M,b,v,o);const x=R.geohashX,w=R.geohashY,V=M.geohashX,S=M.geohashY,F={xLL:x,yLL:w,xTR:V,yTR:S,level:o},D=this._tree.getRegionStatistics(x,w,V,S,o),{count:T,xTotal:k,yTotal:B,referenceId:G}=D,O=T?k/T:0,A=T?B/T:0;if(0===T)return this._clusters.set(h,null),null;const U={cluster_count:T,...D.attributes},X=r(l)?l.update(O,A,s,U,F,G):L.create(e,h,O,A,s,U,F,G);return 0===T&&(X.geometry.coords[0]=(c+d)/2,X.geometry.coords[1]=(g+f)/2),this._clusters.set(h,X),this._updateAggregateValueRangeForCluster(X,X.tileLevel),X}_updateAggregateValueRangeForCluster(e,t){const s=this._aggregateValueRanges[t]||{minValue:1/0,maxValue:0},r=s.minValue,i=s.maxValue;s.minValue=Math.min(r,e.count),s.maxValue=Math.max(i,e.count),this._aggregateValueRanges[t]=s,r===s.minValue&&i===s.maxValue||(this._aggregateValueRangesChanged=!0)}_markTileClustersForDeletion(e,t){const s=2*t,r=Math.ceil(I/s),{row:i,col:a}=e.key,o=a*I,h=i*I,l=Math.floor(o/s),n=Math.floor(h/s);for(let u=l;u<l+r;u++)for(let t=n;t<n+r;t++)this._markForDeletion(e.key.level,u,t)}}export{L as ClusterInfo,w as ClusterStore};