@arcgis/core 6.0.0-next.1 → 6.0.0-next.11

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 (703) hide show
  1. package/analysis/AreaMeasurementAnalysis.d.ts +11 -1
  2. package/analysis/DimensionSimpleStyle.js +1 -1
  3. package/analysis/DirectLineMeasurementAnalysis.d.ts +11 -1
  4. package/analysis/DistanceMeasurementAnalysis.d.ts +8 -0
  5. package/arcade/featureSetUtils.js +1 -1
  6. package/arcade/functions/knowledgegraph.js +1 -1
  7. package/arcade/geometry/unitConversion.js +1 -1
  8. package/arcgisGlobal.d.ts +5 -5
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/01803f76bc0d9f2cd566.js +1 -0
  11. package/assets/esri/core/workers/chunks/{f09c9d9a554c33a753b4.js → 02253bdffbd580af22d8.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{5078b66ba31b770b689f.js → 037a8cc19debbaaa4e10.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{1ede8666d804c553803e.js → 0b6941781e35ce0f7274.js} +1 -1
  14. package/assets/esri/core/workers/chunks/0ccab50877b24f862d6e.js +1 -0
  15. package/assets/esri/core/workers/chunks/{ff3a53c3f00335552317.js → 0dc66b03ff55d0ea5a09.js} +1 -1
  16. package/assets/esri/core/workers/chunks/0f725cf79ce00e790a7d.js +1 -0
  17. package/assets/esri/core/workers/chunks/{a0d459bdb91ee892d4b6.js → 116293b1ee788a89ce1e.js} +1 -1
  18. package/assets/esri/core/workers/chunks/12a7997a40c77f5c9160.js +1 -0
  19. package/assets/esri/core/workers/chunks/{a7325ebb7edf3273bb34.js → 12b84262dedc6b393136.js} +1 -1
  20. package/assets/esri/core/workers/chunks/1b077c92345ffb5916c2.js +1 -0
  21. package/assets/esri/core/workers/chunks/{6dd0b79fa3a629ab4f27.js → 1bca39e0e651426bdbb5.js} +1 -1
  22. package/assets/esri/core/workers/chunks/1c0c5cb13c2590aae906.js +1 -0
  23. package/assets/esri/core/workers/chunks/{8959a825f5e1ce6f38ac.js → 1c65ab9ed611c322ce27.js} +1 -1
  24. package/assets/esri/core/workers/chunks/1e0d2715d603f48a7e0b.js +1 -0
  25. package/assets/esri/core/workers/chunks/261fea092ee7d27608a0.js +1 -0
  26. package/assets/esri/core/workers/chunks/2686fe5b62dd0be699c0.js +1 -0
  27. package/assets/esri/core/workers/chunks/2a97268000c6d03ef720.js +1 -0
  28. package/assets/esri/core/workers/chunks/{83589144eeeb08f45557.js → 2aeb5cc32284dd3e4d22.js} +1 -1
  29. package/assets/esri/core/workers/chunks/2d9a1f23ec6ce90723ac.js +1 -0
  30. package/assets/esri/core/workers/chunks/2e096537a3a5555a4a93.js +1 -0
  31. package/assets/esri/core/workers/chunks/{7a05b18f655c1167ce0a.js → 2ef5237e4c876d6a4ee0.js} +1 -1
  32. package/assets/esri/core/workers/chunks/37d6a264a3f1d8072aa0.js +1 -0
  33. package/assets/esri/core/workers/chunks/3b3e519f15ed52c83f0c.js +1 -0
  34. package/assets/esri/core/workers/chunks/3c0ed15b544df6fb0903.js +1 -0
  35. package/assets/esri/core/workers/chunks/{b612de42ee86c0d95247.js → 3d9d7d3a40b51eb7ee3d.js} +1 -1
  36. package/assets/esri/core/workers/chunks/3df5500a85345577480a.js +1 -0
  37. package/assets/esri/core/workers/chunks/3f7d583b676b23b3fadb.js +1 -0
  38. package/assets/esri/core/workers/chunks/3ffda5bf0b91700dc308.js +1 -0
  39. package/assets/esri/core/workers/chunks/40a584cb952e94326e9e.js +1 -0
  40. package/assets/esri/core/workers/chunks/{1317ecdfd0cfa683a493.js → 42323093827adffe56d3.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{1ba0dfbe0958cdbd7c9f.js → 42fd2a7b22b03dacc6a7.js} +1 -1
  42. package/assets/esri/core/workers/chunks/444e5f214abce3d607cd.js +1 -0
  43. package/assets/esri/core/workers/chunks/{d201fbf3ceff946d2bd6.js → 44d5508042cacdfcac47.js} +1 -1
  44. package/assets/esri/core/workers/chunks/4503b20ca6a80fb63d72.js +1 -0
  45. package/assets/esri/core/workers/chunks/45367aa8e5c5d574de94.js +1 -0
  46. package/assets/esri/core/workers/chunks/45800373650fbc8262e6.js +1 -0
  47. package/assets/esri/core/workers/chunks/{6a7ab1ef9a37e87db5ae.js → 46a7da93a63663878583.js} +1 -1
  48. package/assets/esri/core/workers/chunks/46b4fb6a7fe4877b0efc.js +1120 -0
  49. package/assets/esri/core/workers/chunks/47d074136a7f8e551a9a.js +1 -0
  50. package/assets/esri/core/workers/chunks/4911ce62421a6c3320b0.js +1 -0
  51. package/assets/esri/core/workers/chunks/4a1e23e021bac37a88ab.js +1 -0
  52. package/assets/esri/core/workers/chunks/4a6b92ecbb1f1c55cc43.js +1 -0
  53. package/assets/esri/core/workers/chunks/4debf2d9c3465250ef7a.js +1 -0
  54. package/assets/esri/core/workers/chunks/4e544de61f07ca660236.js +1 -0
  55. package/assets/esri/core/workers/chunks/4e8e322b469657ac22e2.js +1 -0
  56. package/assets/esri/core/workers/chunks/505227797bcf2a1d908d.js +1 -0
  57. package/assets/esri/core/workers/chunks/{67ac6b326bf80fc3d33d.js → 53be85d04cd2da4f391d.js} +1 -1
  58. package/assets/esri/core/workers/chunks/54778dec1598818d93cb.js +1 -0
  59. package/assets/esri/core/workers/chunks/54b18559280a7d2a8d93.js +1 -0
  60. package/assets/esri/core/workers/chunks/557671c897ca5563be6c.js +1 -0
  61. package/assets/esri/core/workers/chunks/567a65f4203f6e81f4b4.js +1 -0
  62. package/assets/esri/core/workers/chunks/5c7780f804d789cb37f5.js +1 -0
  63. package/assets/esri/core/workers/chunks/606ea251075fe81a1206.js +1 -0
  64. package/assets/esri/core/workers/chunks/{ceb680688fe7e570a774.js → 608be1172a908e92b9f1.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{e521bb9ee2030245c3ce.js → 612104dff305ff062dfa.js} +2 -2
  66. package/assets/esri/core/workers/chunks/6299be5e7e26bf3c6859.js +1 -0
  67. package/assets/esri/core/workers/chunks/{3ac9dcbb0571a2580236.js → 62c8c9ad09e0166207fd.js} +1 -1
  68. package/assets/esri/core/workers/chunks/6400446b7615b97c3521.js +1 -0
  69. package/assets/esri/core/workers/chunks/6431480ba0fa8c8d487f.js +1 -0
  70. package/assets/esri/core/workers/chunks/6588725275c75fae0d9c.js +1 -0
  71. package/assets/esri/core/workers/chunks/665e31c494d2af505acc.js +1 -0
  72. package/assets/esri/core/workers/chunks/{9232f57623e1fa3ccabc.js → 67e4b5651fd7ff7d8cf0.js} +1 -1
  73. package/assets/esri/core/workers/chunks/68be3fb88ca61f82fb90.js +1 -0
  74. package/assets/esri/core/workers/chunks/6c9266120d46e8c69dbf.js +1 -0
  75. package/assets/esri/core/workers/chunks/6c9acd9e4e201dc380e9.js +1 -0
  76. package/assets/esri/core/workers/chunks/6ebe73f69ae822053b70.js +1 -0
  77. package/assets/esri/core/workers/chunks/709e019885822b1f6f3e.js +1 -0
  78. package/assets/esri/core/workers/chunks/70cc2d79653d66e85b58.js +1 -0
  79. package/assets/esri/core/workers/chunks/7449568eb2305bf2d650.js +1 -0
  80. package/assets/esri/core/workers/chunks/745a153d0cd34faa124e.js +1 -0
  81. package/assets/esri/core/workers/chunks/7572c2bc5062e66f6330.js +1 -0
  82. package/assets/esri/core/workers/chunks/76196c414e48834f7b92.js +1 -0
  83. package/assets/esri/core/workers/chunks/78472a57c2ba146fec65.js +1 -0
  84. package/assets/esri/core/workers/chunks/7ef182e24cad50815b4e.js +1 -0
  85. package/assets/esri/core/workers/chunks/7f0f9dddc44b1f1600f0.js +1 -0
  86. package/assets/esri/core/workers/chunks/814751e705c05099f864.js +1 -0
  87. package/assets/esri/core/workers/chunks/8293600f94553afc8c38.js +1 -0
  88. package/assets/esri/core/workers/chunks/8487727f1197cf7dbf50.js +1 -0
  89. package/assets/esri/core/workers/chunks/88e54449261ef94e390d.js +1 -0
  90. package/assets/esri/core/workers/chunks/8b0d5551978ab0aac0d1.js +1 -0
  91. package/assets/esri/core/workers/chunks/8d0c2de92770a1567536.js +1 -0
  92. package/assets/esri/core/workers/chunks/900181f68449d8f82eeb.js +1 -0
  93. package/assets/esri/core/workers/chunks/917f53833b853898facc.js +1 -0
  94. package/assets/esri/core/workers/chunks/939942b00ba380e2957e.js +1 -0
  95. package/assets/esri/core/workers/chunks/943a0f140813ee4ab04a.js +1 -0
  96. package/assets/esri/core/workers/chunks/9ce91a909eccc4dfe388.js +1 -0
  97. package/assets/esri/core/workers/chunks/{c76c42c74eedd43263d3.js → 9dd1fc56eb1ea6eb705e.js} +1 -1
  98. package/assets/esri/core/workers/chunks/{86a051e9fe71aa356108.js → 9e3e442a9874ed23a043.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{aa1054834738aef48bda.js → a0356702f2d3f787aeac.js} +1 -1
  100. package/assets/esri/core/workers/chunks/a40b6d8b5c73e06e14d4.js +1 -0
  101. package/assets/esri/core/workers/chunks/{1ba1f705b6ce5c8ea702.js → a655ebdb4bf0660615a2.js} +1 -1
  102. package/assets/esri/core/workers/chunks/a8286febe371dc186aaa.js +1 -0
  103. package/assets/esri/core/workers/chunks/aaba33611753c6aada68.js +1 -0
  104. package/assets/esri/core/workers/chunks/aba42885c5d6b2b5fe7f.js +1 -0
  105. package/assets/esri/core/workers/chunks/ad76f7ab2f3e6d5a5b3c.js +1 -0
  106. package/assets/esri/core/workers/chunks/ae40eac1eadd1a537bf4.js +1 -0
  107. package/assets/esri/core/workers/chunks/aeaaff7a4b1a99540f52.js +1 -0
  108. package/assets/esri/core/workers/chunks/af349c7bc8ef41a0e1bd.js +1 -0
  109. package/assets/esri/core/workers/chunks/af75747b06d79446a855.js +1 -0
  110. package/assets/esri/core/workers/chunks/b564ec4e03478f5659db.js +1 -0
  111. package/assets/esri/core/workers/chunks/b5fdcc80d5973b6e26d1.js +1 -0
  112. package/assets/esri/core/workers/chunks/bbf993dba74850bbf9d7.js +1 -0
  113. package/assets/esri/core/workers/chunks/bc0f54a2c15502b630ec.js +1 -0
  114. package/assets/esri/core/workers/chunks/{9ab25ee06041f907b9a2.js → c2c1f51a4668055c2838.js} +1 -1
  115. package/assets/esri/core/workers/chunks/c337fc0e6dc69c233e6d.js +1 -0
  116. package/assets/esri/core/workers/chunks/{a7985d20fa6e8d4878e7.js → d0f5bee9db1ad51ae687.js} +1 -1
  117. package/assets/esri/core/workers/chunks/d6ad4390df576198e45b.js +1 -0
  118. package/assets/esri/core/workers/chunks/d90a3bfd45b5ed4092e0.js +1 -0
  119. package/assets/esri/core/workers/chunks/dba280c370df13196711.js +1 -0
  120. package/assets/esri/core/workers/chunks/ddf0671976648f621269.js +1 -0
  121. package/assets/esri/core/workers/chunks/{c18189710d6198516175.js → de5ecb567bd69c613e9d.js} +1 -1
  122. package/assets/esri/core/workers/chunks/e10b57aefcc89671116e.js +1 -0
  123. package/assets/esri/core/workers/chunks/{534186fc921a0ccf58dc.js → e1f5d00878f27e1d413e.js} +1 -1
  124. package/assets/esri/core/workers/chunks/e65dfa19f030ec298437.js +1 -0
  125. package/assets/esri/core/workers/chunks/e932951598499befabf5.js +1 -0
  126. package/assets/esri/core/workers/chunks/{e1ba915dae7747932c0f.js → eb04e1717a1002cda3ab.js} +1 -1
  127. package/assets/esri/core/workers/chunks/f122c18af10e56f9ec2b.js +1 -0
  128. package/assets/esri/core/workers/chunks/f1df76f098a3cc924832.js +1 -0
  129. package/assets/esri/core/workers/chunks/f1f90adae13b04898008.js +1 -0
  130. package/assets/esri/core/workers/chunks/f46d9a19f79d4a4bd354.js +1 -0
  131. package/assets/esri/core/workers/chunks/f4f9d08b2df856e3b694.js +1 -0
  132. package/assets/esri/core/workers/chunks/{711cfb84659cb4437679.js → f528ac5c648ca6a98582.js} +1 -1
  133. package/assets/esri/core/workers/chunks/f92364afaefbac7e8f77.js +1 -0
  134. package/assets/esri/core/workers/chunks/fb444954be74c1962ced.js +1 -0
  135. package/assets/esri/core/workers/chunks/fc44227c1756f65b95df.js +1 -0
  136. package/assets/esri/core/workers/chunks/{72019baeba520edb6bb0.js → fc44d45598a7476bc606.js} +1 -1
  137. package/assets/esri/core/workers/chunks/fecaf0bc28aeea4d15db.js +1 -0
  138. package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
  139. package/assets/esri/themes/base/_mixins.scss +2 -2
  140. package/assets/esri/themes/base/widgets/_Attribution.scss +1 -1
  141. package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +2 -2
  142. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +5 -5
  143. package/assets/esri/themes/base/widgets/_Bookmarks.scss +1 -1
  144. package/assets/esri/themes/base/widgets/_BuildingLevelPicker.scss +2 -2
  145. package/assets/esri/themes/base/widgets/_BuildingPhasePicker.scss +5 -5
  146. package/assets/esri/themes/base/widgets/_CatalogLayerList.scss +1 -1
  147. package/assets/esri/themes/base/widgets/_Compass.scss +0 -2
  148. package/assets/esri/themes/base/widgets/_DirectionalPad.scss +4 -10
  149. package/assets/esri/themes/base/widgets/_Directions.scss +40 -40
  150. package/assets/esri/themes/base/widgets/_Editor.scss +7 -7
  151. package/assets/esri/themes/base/widgets/_Expand.scss +1 -1
  152. package/assets/esri/themes/base/widgets/_Feature.scss +1 -1
  153. package/assets/esri/themes/base/widgets/_FeatureForm.scss +6 -6
  154. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationLayers.scss +1 -1
  155. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationList.scss +1 -1
  156. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationSettings.scss +4 -4
  157. package/assets/esri/themes/base/widgets/_FeatureTable.scss +27 -27
  158. package/assets/esri/themes/base/widgets/_FeatureTemplates.scss +1 -1
  159. package/assets/esri/themes/base/widgets/_Features.scss +6 -6
  160. package/assets/esri/themes/base/widgets/_FilterBuilder.scss +1 -1
  161. package/assets/esri/themes/base/widgets/_FilterCondition.scss +1 -1
  162. package/assets/esri/themes/base/widgets/_Grid.scss +18 -18
  163. package/assets/esri/themes/base/widgets/_GridControls.scss +11 -11
  164. package/assets/esri/themes/base/widgets/_LayerList.scss +1 -1
  165. package/assets/esri/themes/base/widgets/_Legend.scss +5 -5
  166. package/assets/esri/themes/base/widgets/_NavigationToggle.scss +4 -1
  167. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +23 -28
  168. package/assets/esri/themes/base/widgets/_ResponsiveToolbar.scss +0 -2
  169. package/assets/esri/themes/base/widgets/_SearchResultRenderer.scss +1 -1
  170. package/assets/esri/themes/base/widgets/_SelectionList.scss +15 -15
  171. package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +3 -5
  172. package/assets/esri/themes/base/widgets/_ShadowCast.scss +11 -11
  173. package/assets/esri/themes/base/widgets/_Sketch.scss +1 -1
  174. package/assets/esri/themes/base/widgets/_Slice.scss +3 -3
  175. package/assets/esri/themes/base/widgets/_SnappingControls.scss +1 -1
  176. package/assets/esri/themes/base/widgets/_TimeSlider.scss +5 -5
  177. package/assets/esri/themes/base/widgets/_TimeZoneLabel.scss +5 -4
  178. package/assets/esri/themes/base/widgets/_Tooltip.scss +14 -17
  179. package/assets/esri/themes/base/widgets/_UtilityNetworkAssociations.scss +2 -2
  180. package/assets/esri/themes/base/widgets/_UtilityNetworkTrace.scss +1 -1
  181. package/assets/esri/themes/base/widgets/_UtilityNetworkValidateTopology.scss +2 -2
  182. package/assets/esri/themes/base/widgets/_ValuePicker.scss +2 -2
  183. package/assets/esri/themes/base/widgets/_VideoPlayer.scss +5 -5
  184. package/assets/esri/themes/base/widgets/_Widget.scss +5 -1
  185. package/assets/esri/themes/dark/main.css +1 -1
  186. package/assets/esri/themes/light/main.css +1 -1
  187. package/assets/esri/themes/light/view.css +1 -1
  188. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.en.json +1 -1
  189. package/{basemaps/BasemapCollection.d.ts → basemapGallery/BasemapGalleryModel.d.ts} +8 -8
  190. package/{basemaps/BasemapCollection.js → basemapGallery/BasemapGalleryModel.js} +1 -1
  191. package/{basemaps → basemapGallery}/BasemapsSource.d.ts +1 -1
  192. package/{basemaps → basemapGallery}/BasemapsSource.js +1 -1
  193. package/{basemaps → basemapGallery}/LocalBasemapsSource.d.ts +2 -2
  194. package/{basemaps → basemapGallery}/LocalBasemapsSource.js +1 -1
  195. package/{basemaps → basemapGallery}/PortalBasemapsSource.d.ts +2 -2
  196. package/{basemaps → basemapGallery}/PortalBasemapsSource.js +1 -1
  197. package/{basemaps → basemapGallery}/support/BasemapItem.d.ts +2 -2
  198. package/{basemaps → basemapGallery}/support/BasemapItem.js +1 -1
  199. package/{basemaps → basemapGallery}/types.d.ts +2 -2
  200. package/chunks/AtmosphereCompositing.glsl.js +1 -1
  201. package/chunks/ChapmanAtmosphere.glsl.js +3 -3
  202. package/chunks/CloudsComposition.glsl.js +1 -1
  203. package/chunks/Component.glsl.js +41 -41
  204. package/chunks/DefaultMaterial.glsl.js +2 -2
  205. package/chunks/EdgeShader.glsl.js +9 -9
  206. package/chunks/Fog.glsl.js +5 -5
  207. package/chunks/GaussianSplat.glsl.js +2 -2
  208. package/chunks/GlobalIllumination.glsl.js +13 -11
  209. package/chunks/GlobalIlluminationBlur.glsl.js +3 -5
  210. package/chunks/GlobalIlluminationUpscale.glsl.js +1 -1
  211. package/chunks/HUDMaterial.glsl.js +13 -13
  212. package/chunks/Haze.glsl.js +6 -6
  213. package/chunks/HazeCompositing.glsl.js +1 -1
  214. package/chunks/LaserlinePath.glsl.js +6 -6
  215. package/chunks/LineCallout.glsl.js +1 -1
  216. package/chunks/LineMarker.glsl.js +5 -5
  217. package/chunks/NavigationDepth.glsl.js +2 -2
  218. package/chunks/Path.glsl.js +1 -1
  219. package/chunks/Pattern.glsl.js +26 -26
  220. package/chunks/Precipitation.glsl.js +7 -7
  221. package/chunks/RealisticTree.glsl.js +2 -2
  222. package/chunks/RibbonLine.glsl.js +80 -73
  223. package/chunks/ShadowCastAccumulate.glsl.js +1 -1
  224. package/chunks/ShadowHighlight.glsl.js +5 -5
  225. package/chunks/ShadowHighlightBuffer.glsl.js +1 -1
  226. package/chunks/SimpleAtmosphere.glsl.js +4 -4
  227. package/chunks/Terrain.glsl.js +29 -32
  228. package/chunks/Viewshed.glsl.js +2 -2
  229. package/chunks/Water.glsl.js +2 -2
  230. package/config.js +1 -1
  231. package/core/Loadable.js +1 -1
  232. package/core/arrayUtils.js +1 -1
  233. package/core/colorUtils.js +1 -1
  234. package/core/has.js +1 -1
  235. package/core/screenUtils.js +1 -1
  236. package/core/units.js +1 -1
  237. package/core/workers/workerFactory.js +1 -1
  238. package/form/elements/inputs/DynamicChoiceInput.d.ts +35 -5
  239. package/geometry/HeightModelInfo.js +1 -1
  240. package/geometry/operators/proximityOperator.js +1 -1
  241. package/geometry/projectionUtils.js +1 -1
  242. package/geometry/support/meshUtils.d.ts +1 -1
  243. package/geometry/support/scaleUtils.js +1 -1
  244. package/geometry/support/wkt.js +2 -0
  245. package/kernel.js +1 -1
  246. package/layers/BaseDynamicLayer.d.ts +1 -0
  247. package/layers/BaseElevationLayer.d.ts +2 -0
  248. package/layers/BaseTileLayer.d.ts +12 -9
  249. package/layers/CSVLayer.d.ts +0 -15
  250. package/layers/FeatureLayer.d.ts +2 -15
  251. package/layers/GeoJSONLayer.d.ts +0 -52
  252. package/layers/GeoRSSLayer.d.ts +0 -44
  253. package/layers/GeospatialPDFLayer.d.ts +2 -5
  254. package/layers/GeospatialPDFLayer.js +1 -1
  255. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  256. package/layers/OrientedImageryLayer.js +1 -1
  257. package/layers/ParquetLayer.d.ts +100 -12
  258. package/layers/ParquetLayer.js +1 -1
  259. package/layers/SketchLayer.d.ts +0 -1
  260. package/layers/VectorTileLayer.d.ts +2 -12
  261. package/layers/geospatialPDF/renderExtentUtils.js +1 -1
  262. package/layers/graphics/data/FeatureStore.js +1 -1
  263. package/layers/graphics/data/QueryEngineResult.js +1 -1
  264. package/layers/graphics/data/geometryUtils.js +1 -1
  265. package/layers/graphics/data/projectionSupport.js +1 -1
  266. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  267. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  268. package/layers/graphics/transferFeatures.js +1 -1
  269. package/layers/knowledgeGraph/layerUtils.js +1 -1
  270. package/layers/knowledgeGraph/nodeMovementUtils.js +1 -1
  271. package/layers/mixins/PortalLayer.js +1 -1
  272. package/layers/mixins/RefreshableLayer.d.ts +1 -3
  273. package/layers/mixins/ScaleRangeLayer.js +1 -1
  274. package/layers/mixins/SublayersOwner.js +1 -1
  275. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  276. package/layers/orientedImagery/core/utils.js +1 -1
  277. package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
  278. package/layers/raster/datasets/TIFFRaster.js +1 -1
  279. package/layers/raster/datasets/byteStreamUtils.js +1 -1
  280. package/layers/raster/formats/tiffParser.js +1 -1
  281. package/layers/support/ParquetPortalItemData.d.ts +2 -0
  282. package/layers/support/ParquetPortalItemData.js +1 -1
  283. package/layers/support/PortalItemData.d.ts +21 -0
  284. package/layers/support/PortalItemData.js +1 -1
  285. package/layers/support/Sublayer.js +1 -1
  286. package/layers/support/SubtypeSublayer.js +1 -1
  287. package/layers/support/layersLoader.js +1 -1
  288. package/layers/support/parquetUtils.d.ts +1 -1
  289. package/layers/support/types.d.ts +1 -1
  290. package/package.json +3 -3
  291. package/popup/FeaturesModel.d.ts +27 -6
  292. package/popup/FeaturesModel.js +1 -1
  293. package/portal/support/layersLoader.js +1 -1
  294. package/portal/support/portalLayers.js +1 -1
  295. package/renderers/VectorFieldRenderer.d.ts +4 -4
  296. package/rest/print.d.ts +49 -3
  297. package/rest/print.js +1 -1
  298. package/rest/query/operations/pbfFlatFeatureSet.js +1 -1
  299. package/rest/support/printTaskUtils.js +1 -1
  300. package/smartMapping/renderers/color.js +1 -1
  301. package/smartMapping/renderers/dotDensity.js +1 -1
  302. package/smartMapping/renderers/heatmap.js +1 -1
  303. package/smartMapping/renderers/pieChart.js +1 -1
  304. package/smartMapping/renderers/support/spikeUtils.js +3 -3
  305. package/smartMapping/renderers/type.js +1 -1
  306. package/smartMapping/statistics/heatmapStatistics.js +1 -1
  307. package/smartMapping/statistics/histogram.js +1 -1
  308. package/smartMapping/statistics/summaryStatistics.js +1 -1
  309. package/smartMapping/statistics/summaryStatisticsForAttributes.js +1 -1
  310. package/smartMapping/statistics/uniqueValues.js +1 -1
  311. package/smartMapping/support/adapters/support/layerUtils.js +1 -1
  312. package/smartMapping/types.d.ts +3 -1
  313. package/symbols/LineSymbol3DLayer.js +1 -1
  314. package/symbols/callouts/LineCallout3D.js +1 -1
  315. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  316. package/symbols/cim/CIMSymbolHelper.js +1 -1
  317. package/symbols/cim/cimAnalyzer.js +1 -1
  318. package/symbols/edges/Edges3D.js +1 -1
  319. package/symbols/support/Symbol3DIconOutline.js +1 -1
  320. package/symbols/support/Symbol3DOutline.js +1 -1
  321. package/symbols/support/Symbol3DTextBorder.js +1 -1
  322. package/symbols/support/defaults3D.js +1 -1
  323. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
  324. package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +6 -4
  325. package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +1 -1
  326. package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
  327. package/views/2d/analysis/DistanceMeasurementAnalysisView2D.d.ts +6 -4
  328. package/views/2d/analysis/DistanceMeasurementAnalysisView2D.js +1 -1
  329. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  330. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  331. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  332. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TexturedLineShader.js +1 -1
  333. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
  334. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  335. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  336. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  337. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  338. package/views/2d/layers/LayerView2D.js +1 -1
  339. package/views/2d/layers/features/FeatureContainer.js +1 -1
  340. package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
  341. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  342. package/views/2d/layers/features/processor/tracks/TrackAdapter.js +1 -1
  343. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  344. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  345. package/views/2d/layers/features/sources/strategies/AFeatureTileLoadStrategy.js +1 -1
  346. package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +1 -1
  347. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  348. package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
  349. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  350. package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
  351. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  352. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  353. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  354. package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
  355. package/views/3d/analysis/LineOfSight/LineOfSightInteractionVisuals.js +1 -1
  356. package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
  357. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
  358. package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
  359. package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
  360. package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
  361. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  362. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
  363. package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
  364. package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
  365. package/views/3d/analysis/Viewshed/types.d.ts +3 -1
  366. package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +3 -0
  367. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.d.ts +2 -1
  368. package/views/3d/environment/Environment.d.ts +2 -2
  369. package/views/3d/environment/Environment.js +1 -1
  370. package/views/3d/environment/EnvironmentView.js +2 -0
  371. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  372. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  373. package/views/3d/interactive/editingTools/originGeometryVisualElementUtils.js +1 -1
  374. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  375. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  376. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  377. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  378. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  379. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  380. package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
  381. package/views/3d/layers/FlowSubView3D.js +1 -1
  382. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  383. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  384. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  385. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  386. package/views/3d/layers/MediaLayerView3D.js +1 -1
  387. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  388. package/views/3d/layers/RouteLayerView3D.js +1 -1
  389. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  390. package/views/3d/layers/SceneLayerView3D.js +1 -1
  391. package/views/3d/layers/TiledLayerView3D.js +1 -1
  392. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  393. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  394. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  395. package/views/3d/layers/graphics/Graphics3DBufferGraphicLayer.js +2 -0
  396. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  397. package/views/3d/layers/graphics/Graphics3DDrapedBufferGraphicLayer.js +2 -0
  398. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
  399. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayerBase.js +2 -0
  400. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  401. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  402. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  403. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  404. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  405. package/views/3d/layers/graphics/Graphics3DStageObjectGraphicLayer.js +2 -0
  406. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  407. package/views/3d/layers/graphics/LabelInfo.js +1 -1
  408. package/views/3d/layers/graphics/Labeler.js +1 -1
  409. package/views/3d/layers/graphics/elevationAlignmentUtils.js +1 -1
  410. package/views/3d/layers/graphics/pointUtils.js +1 -1
  411. package/views/3d/layers/support/FeatureMemory.js +1 -1
  412. package/views/3d/layers/support/FeatureTile.js +1 -1
  413. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  414. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  415. package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
  416. package/views/3d/layers/support/SampledGeometryMaxDistanceRatio.js +1 -1
  417. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  418. package/views/3d/support/PBFDecoder.js +1 -1
  419. package/views/3d/support/elevationUpdateUtils.js +1 -1
  420. package/views/3d/support/popupHitTest.js +1 -1
  421. package/views/3d/terrain/OverlayManager.js +1 -1
  422. package/views/3d/terrain/OverlayRenderer.js +1 -1
  423. package/views/3d/terrain/TerrainRenderer.js +1 -1
  424. package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
  425. package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +5 -5
  426. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +13 -13
  427. package/views/3d/webgl-engine/core/shaderLibrary/bindUniforms.js +2 -0
  428. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +2 -2
  429. package/views/3d/webgl-engine/core/shaderLibrary/lastFrameUniforms.js +2 -0
  430. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +7 -7
  431. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +31 -29
  432. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +26 -12
  433. package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +2 -2
  434. package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +14 -14
  435. package/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js +1 -1
  436. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadGlobalIllumination.glsl.js +16 -11
  437. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +5 -5
  438. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +8 -8
  439. package/views/3d/webgl-engine/core/shaderLibrary/shading/evaluateSceneLightingFragment.glsl.js +1 -1
  440. package/views/3d/webgl-engine/core/shaderLibrary/shading/lightingUniforms.js +2 -0
  441. package/views/3d/webgl-engine/core/shaderLibrary/shading/pbrGlobals.glsl.js +1 -1
  442. package/views/3d/webgl-engine/core/shaderLibrary/shading/readShadow.glsl.js +6 -6
  443. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
  444. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +3 -3
  445. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  446. package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
  447. package/views/3d/webgl-engine/effects/WeatherFader.js +1 -1
  448. package/views/3d/webgl-engine/effects/atmosphere/ChapmanApproximation.glsl.js +3 -3
  449. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.glsl.js +1 -1
  450. package/views/3d/webgl-engine/effects/atmosphere/ChapmanRaymarching.glsl.js +1 -1
  451. package/views/3d/webgl-engine/effects/atmosphere/SimpleAtmosphere.glsl.js +1 -1
  452. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.glsl.js +1 -1
  453. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
  454. package/views/3d/webgl-engine/effects/fog/Fog.glsl.js +1 -1
  455. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  456. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
  457. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  458. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationColorQuantization.glsl.js +2 -2
  459. package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +5 -5
  460. package/views/3d/webgl-engine/effects/haze/Haze.glsl.js +1 -1
  461. package/views/3d/webgl-engine/effects/haze/HazeCompositing.glsl.js +1 -1
  462. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.glsl.js +1 -1
  463. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.glsl.js +1 -1
  464. package/views/3d/webgl-engine/effects/laserlines/LaserlinePath.glsl.js +1 -1
  465. package/views/3d/webgl-engine/effects/raymarching/DistanceFalloff.glsl.js +1 -1
  466. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowCastAccumulate.glsl.js +1 -1
  467. package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
  468. package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
  469. package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
  470. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  471. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  472. package/views/3d/webgl-engine/lib/affectsGeometry.js +1 -1
  473. package/views/3d/webgl-engine/lib/bufferGeometryUtils.js +2 -0
  474. package/views/3d/webgl-engine/lib/edgeRendering/AdjustProjectedPosition.glsl.js +5 -5
  475. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
  476. package/views/3d/webgl-engine/lib/edgeRendering/EdgeUtil.glsl.js +11 -11
  477. package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
  478. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  479. package/views/3d/webgl-engine/shaders/AtmosphereCompositing.glsl.js +1 -1
  480. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  481. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  482. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  483. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  484. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  485. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  486. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  487. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
  488. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  489. package/views/3d/webgl-engine/shaders/Viewshed.glsl.js +1 -1
  490. package/views/3d/webgl-engine/shaders/lineUniforms.js +2 -0
  491. package/views/DOMContainer.d.ts +28 -9
  492. package/views/DOMContainer.js +1 -1
  493. package/views/PopupView.d.ts +6 -0
  494. package/views/SceneView.d.ts +4 -10
  495. package/views/SceneView.js +1 -1
  496. package/views/VideoView.d.ts +27 -9
  497. package/views/View.d.ts +20 -19
  498. package/views/View.js +1 -1
  499. package/views/View2D.d.ts +13 -13
  500. package/views/draw/Draw.d.ts +1 -1
  501. package/views/draw/support/InteractiveHandle.js +1 -1
  502. package/views/draw/support/PluginContext.js +1 -1
  503. package/views/draw/support/managers/TooltipManager.js +1 -1
  504. package/views/interactive/options/SnappingOptions.d.ts +29 -12
  505. package/views/interactive/options/TooltipOptions.d.ts +9 -1
  506. package/views/interactive/options/ValueOptions.d.ts +9 -2
  507. package/views/interactive/options/ViewOptions.d.ts +82 -6
  508. package/views/interactive/snapping/FeatureSnappingSourceInfo.js +1 -1
  509. package/views/interactive/snapping/SnappingManagerPool.js +1 -1
  510. package/views/interactive/snapping/SnappingOptions.d.ts +1 -1
  511. package/views/interactive/snapping/SnappingVisualizer.js +1 -1
  512. package/views/interactive/support/Units.d.ts +1 -0
  513. package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
  514. package/views/interactive/tooltip/components/ElevationModeSelect.js +1 -1
  515. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  516. package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +1 -1
  517. package/views/layers/FeatureLikeLayerView.d.ts +2 -2
  518. package/views/layers/GraphicsLayerView.d.ts +1 -0
  519. package/views/layers/ImageryLayerView.d.ts +1 -0
  520. package/views/layers/LayerView.js +1 -1
  521. package/views/layers/LineOfSightLayerView.d.ts +3 -4
  522. package/views/layers/ParquetLayerView.d.ts +15 -0
  523. package/views/layers/ParquetLayerView.js +1 -1
  524. package/views/layers/ViewshedLayerView.d.ts +5 -6
  525. package/views/support/layerViewUtils.js +1 -1
  526. package/views/support/projectionUtils.js +1 -1
  527. package/views/types.d.ts +3 -1
  528. package/webdoc/support/saveUtils.js +1 -1
  529. package/webdoc/support/unsupportedErrors.js +1 -1
  530. package/widgets/BasemapGallery/BasemapGalleryViewModel.d.ts +2 -2
  531. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  532. package/widgets/BasemapGallery/support/BasemapGalleryItem.d.ts +3 -3
  533. package/widgets/BasemapGallery/support/LocalBasemapsSource.d.ts +2 -2
  534. package/widgets/BasemapGallery/support/PortalBasemapsSource.d.ts +2 -2
  535. package/widgets/BasemapGallery/types.d.ts +3 -3
  536. package/widgets/BasemapLayerList.js +1 -1
  537. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  538. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  539. package/widgets/BatchAttributeForm/expressions/expressionUtils.js +1 -1
  540. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +6 -0
  541. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  542. package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
  543. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  544. package/widgets/BatchAttributeForm.js +1 -1
  545. package/widgets/DirectionalPad.js +1 -1
  546. package/widgets/Editor/EditorViewModel.d.ts +13 -8
  547. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  548. package/widgets/Editor/workflowUtils.js +1 -1
  549. package/widgets/Editor.d.ts +19 -9
  550. package/widgets/Expand.js +1 -1
  551. package/widgets/FeatureForm.d.ts +2 -2
  552. package/widgets/FeatureForm.js +1 -1
  553. package/widgets/FeatureTable/FieldColumn.js +1 -1
  554. package/widgets/FeatureTable.js +1 -1
  555. package/widgets/Features/FeaturesDrillIn.js +1 -1
  556. package/widgets/Features.js +1 -1
  557. package/widgets/Legend.d.ts +1 -0
  558. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  559. package/widgets/OrientedImageryViewer/adapters/draw/HeightMeasurementAdapter.js +1 -1
  560. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  561. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  562. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  563. package/widgets/OrientedImageryViewer/components/ImageLocationViewModel.js +1 -1
  564. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  565. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  566. package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
  567. package/widgets/OrientedImageryViewer/types.d.ts +20 -0
  568. package/widgets/OrientedImageryViewer.d.ts +9 -1
  569. package/widgets/PanoramicVideoViewer.js +1 -1
  570. package/widgets/Print/PrintViewModel.d.ts +3 -2
  571. package/widgets/Print/PrintViewModel.js +1 -1
  572. package/widgets/Print.js +1 -1
  573. package/widgets/ScaleRangeSlider.js +1 -1
  574. package/widgets/Search/SearchResultRenderer.js +1 -1
  575. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  576. package/widgets/Sketch/SketchViewModel.d.ts +14 -9
  577. package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
  578. package/widgets/Sketch.d.ts +10 -10
  579. package/widgets/Track/TrackViewModel.d.ts +1 -1
  580. package/widgets/UtilityNetworkAssociations.js +1 -1
  581. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  582. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
  583. package/widgets/UtilityNetworkTrace/types.d.ts +2 -2
  584. package/widgets/UtilityNetworkTrace.js +1 -1
  585. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  586. package/widgets/ValuePicker.js +1 -1
  587. package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
  588. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  589. package/widgets/support/GridControls.js +1 -1
  590. package/widgets/support/PluginSettingsControls.js +1 -1
  591. package/widgets/support/SelectionList/FeatureItem.d.ts +9 -2
  592. package/widgets/support/SelectionToolbar.js +1 -1
  593. package/widgets/support/SnappingControls.d.ts +1 -1
  594. package/widgets/support/SnappingControls.js +1 -1
  595. package/widgets/support/componentsUtils.js +1 -1
  596. package/arcade/geometry/wkt.js +0 -2
  597. package/assets/esri/core/workers/chunks/00a600c71ceebe7bfeee.js +0 -1
  598. package/assets/esri/core/workers/chunks/00d24415bdeb0adae3df.js +0 -1
  599. package/assets/esri/core/workers/chunks/0193df3f9fb23633da87.js +0 -1
  600. package/assets/esri/core/workers/chunks/01b00fbf6a6a22d573ee.js +0 -1
  601. package/assets/esri/core/workers/chunks/02d4f91652a79d2b637e.js +0 -1
  602. package/assets/esri/core/workers/chunks/050c4b212f2b5691db34.js +0 -1
  603. package/assets/esri/core/workers/chunks/05963f57cbe5a5249496.js +0 -1
  604. package/assets/esri/core/workers/chunks/05d865b2736f452ad2aa.js +0 -1
  605. package/assets/esri/core/workers/chunks/06e7400f5ebe0719b81c.js +0 -1
  606. package/assets/esri/core/workers/chunks/07aa6d36f1006b6ab7ff.js +0 -1
  607. package/assets/esri/core/workers/chunks/084222c00d263a534952.js +0 -1
  608. package/assets/esri/core/workers/chunks/0b36abcbf03037b4073d.js +0 -1
  609. package/assets/esri/core/workers/chunks/107b025dc5b09465a78f.js +0 -1
  610. package/assets/esri/core/workers/chunks/1b551ef3d84d9c1e93f9.js +0 -1
  611. package/assets/esri/core/workers/chunks/1ef39aef6b33c530cbe4.js +0 -1
  612. package/assets/esri/core/workers/chunks/1f3148cebee1961249a4.js +0 -1
  613. package/assets/esri/core/workers/chunks/1f43e06dcfe56229bb0f.js +0 -1
  614. package/assets/esri/core/workers/chunks/2164fcaced72b0fda31f.js +0 -1
  615. package/assets/esri/core/workers/chunks/25b0885d3bc190b28c04.js +0 -1
  616. package/assets/esri/core/workers/chunks/25d6c674b1c4829f040f.js +0 -1
  617. package/assets/esri/core/workers/chunks/260dcb79dfd0f981949f.js +0 -1
  618. package/assets/esri/core/workers/chunks/2a570ce6b99dac6ee996.js +0 -1
  619. package/assets/esri/core/workers/chunks/2e6a2f4d686b71249c0e.js +0 -1
  620. package/assets/esri/core/workers/chunks/2f9033890c465acff698.js +0 -1
  621. package/assets/esri/core/workers/chunks/303676d1b10676c9cab4.js +0 -1
  622. package/assets/esri/core/workers/chunks/303fde8f3459dde16555.js +0 -1
  623. package/assets/esri/core/workers/chunks/32d08b571bbd996d4e6d.js +0 -1
  624. package/assets/esri/core/workers/chunks/33956f12505e72e60293.js +0 -1
  625. package/assets/esri/core/workers/chunks/350540770781b281c39a.js +0 -1
  626. package/assets/esri/core/workers/chunks/37a636f61cfe89c6bfd1.js +0 -1
  627. package/assets/esri/core/workers/chunks/380cc538c1ab453870fa.js +0 -1
  628. package/assets/esri/core/workers/chunks/3880d2c7fb14955d7f93.js +0 -1
  629. package/assets/esri/core/workers/chunks/3b017b718ea2d4ed498f.js +0 -1
  630. package/assets/esri/core/workers/chunks/40fb1910f780e78c128c.js +0 -1
  631. package/assets/esri/core/workers/chunks/4310c8d2b40ae69c3681.js +0 -1
  632. package/assets/esri/core/workers/chunks/43fc42405167a5537039.js +0 -1
  633. package/assets/esri/core/workers/chunks/4848f195eb93cc93dd15.js +0 -1
  634. package/assets/esri/core/workers/chunks/4cddd217383b9333f32e.js +0 -1
  635. package/assets/esri/core/workers/chunks/4d82db661365daa513a6.js +0 -1
  636. package/assets/esri/core/workers/chunks/4fa59f8ed3b7b6239548.js +0 -1
  637. package/assets/esri/core/workers/chunks/57970d43cdcc5cf57a30.js +0 -1
  638. package/assets/esri/core/workers/chunks/5e184fd47e76eb976fa9.js +0 -1
  639. package/assets/esri/core/workers/chunks/5ea8809b6519c05ad9f6.js +0 -1
  640. package/assets/esri/core/workers/chunks/5f3ab77a79c408423fde.js +0 -1
  641. package/assets/esri/core/workers/chunks/5fd099ca1024707387b2.js +0 -1
  642. package/assets/esri/core/workers/chunks/604344e45c0f27497188.js +0 -1
  643. package/assets/esri/core/workers/chunks/61ad8306ab79aca79505.js +0 -1
  644. package/assets/esri/core/workers/chunks/633a9051580c5302d2f7.js +0 -1
  645. package/assets/esri/core/workers/chunks/6469c0d18d3663e7da4b.js +0 -1
  646. package/assets/esri/core/workers/chunks/65654e481cce9ae40e54.js +0 -1
  647. package/assets/esri/core/workers/chunks/669e39c3437d7273f0c7.js +0 -1
  648. package/assets/esri/core/workers/chunks/68e24fa3f564c2a5c9fd.js +0 -1
  649. package/assets/esri/core/workers/chunks/6aebf7cfd294e88bf926.js +0 -1
  650. package/assets/esri/core/workers/chunks/71f739bb3f7350704af6.js +0 -1
  651. package/assets/esri/core/workers/chunks/750a9f3cdb96b966274a.js +0 -1
  652. package/assets/esri/core/workers/chunks/776565dd9741ba2ba151.js +0 -1
  653. package/assets/esri/core/workers/chunks/798a63653f82c0e842c5.js +0 -1
  654. package/assets/esri/core/workers/chunks/841f67baf6a1634ada48.js +0 -1
  655. package/assets/esri/core/workers/chunks/84fcbf7a1d04f01685d1.js +0 -1
  656. package/assets/esri/core/workers/chunks/897fc8e78a0d54a5ff5a.js +0 -1
  657. package/assets/esri/core/workers/chunks/8af92bcc075e03e3e902.js +0 -1742
  658. package/assets/esri/core/workers/chunks/8e511079918e2fd9261f.js +0 -1
  659. package/assets/esri/core/workers/chunks/8e7a33cc1f83063043f2.js +0 -1
  660. package/assets/esri/core/workers/chunks/8fcfd515ee1b18c902e5.js +0 -1
  661. package/assets/esri/core/workers/chunks/9001e9a1e81bce175ddd.js +0 -1
  662. package/assets/esri/core/workers/chunks/9432feca48ca3e5849bd.js +0 -1
  663. package/assets/esri/core/workers/chunks/956a40f40bde416efe93.js +0 -1
  664. package/assets/esri/core/workers/chunks/95b82cbbe355266c65d7.js +0 -1
  665. package/assets/esri/core/workers/chunks/9673a9efec86040b8c13.js +0 -1
  666. package/assets/esri/core/workers/chunks/97dbbedea9fe03bd1306.js +0 -1
  667. package/assets/esri/core/workers/chunks/985b3f18cee87c3fe022.js +0 -1
  668. package/assets/esri/core/workers/chunks/9a7fc93cc693fd12b5d8.js +0 -1
  669. package/assets/esri/core/workers/chunks/9c0fd8baa00ee9733ba4.js +0 -1
  670. package/assets/esri/core/workers/chunks/a010d2e4e34eb7bc1fec.js +0 -1
  671. package/assets/esri/core/workers/chunks/a20526996d01386ec3b7.js +0 -1
  672. package/assets/esri/core/workers/chunks/a23272a7a47a95f6ddea.js +0 -1
  673. package/assets/esri/core/workers/chunks/a7edf7541569fef77cb3.js +0 -1
  674. package/assets/esri/core/workers/chunks/aa5b42e44d2959fdacd3.js +0 -1
  675. package/assets/esri/core/workers/chunks/ae2181805d8ba130babc.js +0 -1
  676. package/assets/esri/core/workers/chunks/b05a41a60e30935644be.js +0 -1
  677. package/assets/esri/core/workers/chunks/b0cfec11c758eed8095f.js +0 -1
  678. package/assets/esri/core/workers/chunks/bff767ec5bb4c0d6b324.js +0 -1
  679. package/assets/esri/core/workers/chunks/c906f984b2b6e7578c06.js +0 -1
  680. package/assets/esri/core/workers/chunks/ca7fb75e2c62e7d37122.js +0 -1
  681. package/assets/esri/core/workers/chunks/cbdebdfa5f2cded29d0d.js +0 -1
  682. package/assets/esri/core/workers/chunks/cbe6c0f32608cb504695.js +0 -1
  683. package/assets/esri/core/workers/chunks/cfae60b9d2f2939e9c16.js +0 -1
  684. package/assets/esri/core/workers/chunks/d270cc9807161033686e.js +0 -1
  685. package/assets/esri/core/workers/chunks/d56780290e0218d3e9de.js +0 -1
  686. package/assets/esri/core/workers/chunks/d6d5a9e73ee43d6066d3.js +0 -1
  687. package/assets/esri/core/workers/chunks/d89fe41c71c9621c41ae.js +0 -1
  688. package/assets/esri/core/workers/chunks/da18d96b35af20e73b3b.js +0 -1
  689. package/assets/esri/core/workers/chunks/de02a6a1f4810f99e9bb.js +0 -1
  690. package/assets/esri/core/workers/chunks/df0481bcc1613ee4b7af.js +0 -1
  691. package/assets/esri/core/workers/chunks/e22d45aeef293a5ffb78.js +0 -1
  692. package/assets/esri/core/workers/chunks/e5943f3a4bbc12c06c4d.js +0 -1
  693. package/assets/esri/core/workers/chunks/e7c60bd85abbd36cdc64.js +0 -1
  694. package/assets/esri/core/workers/chunks/ec9a2425b4a498054a19.js +0 -1
  695. package/assets/esri/core/workers/chunks/edf3be87a997f4f05b96.js +0 -1
  696. package/assets/esri/core/workers/chunks/f05de08e194a3f9b96f2.js +0 -1
  697. package/assets/esri/core/workers/chunks/f0a68d2900d24f56afa0.js +0 -1
  698. package/assets/esri/core/workers/chunks/f0aaa646b17ffdbdcefa.js +0 -1
  699. package/assets/esri/core/workers/chunks/f0c0c02730fe0d948fc1.js +0 -1
  700. package/assets/esri/core/workers/chunks/fd0254c6fc6c03ec11ba.js +0 -1
  701. package/assets/esri/core/workers/chunks/ffb3728e6ac428f62af1.js +0 -1
  702. package/views/3d/environment/EnvironmentManager.js +0 -2
  703. /package/{basemaps → basemapGallery}/support/basemapCompatibilityUtils.js +0 -0
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{transformMat4 as e,add as t}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as r,create as i,isPoint as a,empty as o,center as s,offset as c}from"../../../../geometry/support/aaBoundingBox.js";import{evaluateElevationInfoAtPoint as l}from"./elevationAlignmentUtils.js";import{demResolutionForBoundingBox as u}from"./graphicUtils.js";class d{_getFlag(e){return(this._flags&e)===e}_setFlag(e,t){t?this._flags|=e:this._flags&=~e}get needsElevationUpdates(){return this._getFlag(2)}set needsElevationUpdates(e){this._setFlag(2,e)}get hiddenIfDeconflicted(){return this._getFlag(8)}set hiddenIfDeconflicted(e){this._setFlag(8,e)}get occlusionCheck(){return this._getFlag(16)}get adaptiveOcclusion(){return this._getFlag(32)}setOccludedVisibilityMode(e=`hidden`){this._setFlag(16,e!==`visible`),this._setFlag(32,e===`adaptive`)}get isElevationSource(){return!!this.stageObject.lastValidElevationBB}constructor(e,t,n,r){this.graphics3DSymbolLayer=e,this.stageObject=t,this._sharedResource=n,this.elevationContext=r,this._stageLayer=null,this._flags=0,this.alignedSampledElevation=0}initialize(e){this._stageLayer=e,this.hiddenIfDeconflicted&&(e.add(this.stageObject),this._setFlag(1,!0))}destroy(){this._getFlag(64)||(this._setFlag(64,!0),this._getFlag(1)&&(this._stageLayer.remove(this.stageObject),this._setFlag(1,!1)),this._disposeStageObject(),this._sharedResource?.release(),this._stageLayer=null)}_disposeStageObject(){this.stageObject.dispose()}get usedMemory(){return this.graphics3DSymbolLayer.usedMemory}updateHighlights(e){}setVisibility(e){let{stageObject:t,_stageLayer:n}=this;n!=null&&this.visible!==e&&(t.visible=e,e&&!this._getFlag(1)&&(n.add(t),this._setFlag(1,!0)))}get visible(){return this._getFlag(1)&&this.stageObject.visible}alignWithElevation(e,t,n){this._alignWithElevation(e.spatialReference,(n,r)=>l(n,e,this.elevationContext,t,r),t,n)}alignWithAbsoluteElevation(e,t,n){this._alignWithElevation(this.graphics3DSymbolLayer.view.spatialReference,(t,n)=>{n.sampledElevation=e,n.verticalDistanceToGround=0,n.z=e},t,n)}getCenterObjectSpace(){return this.stageObject.boundingVolumeObjectSpace.sphere.center}getBoundingBoxObjectSpace(e=i()){let t=this.stageObject.boundingVolumeObjectSpace;return r(e,t.box),e}computeAttachmentOrigin(n){let r=this.stageObject.effectiveTransformation;for(let i of this.stageObject.geometries)i.computeAttachmentOrigin(m)&&(e(m,m,r),t(n.render.origin,n.render.origin,m),n.render.num++)}async getProjectedBoundingBox(t,n,r,i,l){let d=this.getBoundingBoxObjectSpace(l),g=h,_=a(d)?1:g.length;for(let t=0;t<_;t++){let n=g[t];p[0]=d[n[0]],p[1]=d[n[1]],p[2]=d[n[2]],e(p,p,this.stageObject.transformation),f[t*3]=p[0],f[t*3+1]=p[1],f[t*3+2]=p[2]}if(!t(f,0,_))return null;o(d);let v=null;this.calculateRelativeScreenBounds&&(v=this.calculateRelativeScreenBounds());for(let e=0;e<_*3;e+=3){for(let t=0;t<3;t++)d[t]=Math.min(d[t],f[e+t]),d[t+3]=Math.max(d[t+3],f[e+t]);v&&r.push({location:f.slice(e,e+3),screenSpaceBoundingRect:v})}if(n?.service&&this.elevationContext.mode!==`absolute-height`){s(d,m);let e=this.elevationContext.mode===`relative-to-scene`?`scene`:`ground`,t=0;if(n.useViewElevation)t=n.service.getElevation(m[0],m[1],e)??0;else try{let r=u(d,n.service.spatialReference,n);t=await n.service.queryElevation(m[0],m[1],i,r,e)??0}catch{}c(d,0,0,-this.alignedSampledElevation+t)}return d}addObjectState(e){e.stateType===0&&e.addObject(this.stageObject,this.stageObject.highlight(e.highlightName)),e.stateType===1&&e.addObject(this.stageObject,this.stageObject.maskOccludee())}removeObjectState(e){e.removeByObject(this.stageObject)}}const f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],p=n(),m=n(),h=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];export{d as Graphics3DStageObjectGraphicLayer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{isSome as e}from"../../../../core/arrayUtils.js";import{forEach as t}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import{onAbortOrThrow as n,throwIfAborted as r}from"../../../../core/promiseUtils.js";import{aggregateSymbolComplexity as i}from"./defaultSymbolComplexity.js";import{Graphics3DGraphic as a}from"./Graphics3DGraphic.js";import{Graphics3DObject3DGraphicLayer as o}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayerCreationContext as s}from"./Graphics3DSymbolCreationContext.js";import{Loadable as c}from"./Loadable.js";import{AggregateSymbolComplexity as l}from"./SymbolComplexity.js";import{getSymbolMemorySize as u}from"./symbolMemory.js";class d extends c{set symbol(e){this._symbol=e,e.symbolLayers.forEach((t,n)=>{let r=this.symbolLayers[n];r!=null&&(r.symbol=e,r.symbolLayer=t)})}get symbol(){return this._symbol}constructor(e,t,n){super(t.schedule),this._symbol=e,this._context=t,this._backgroundLayers=n,this._destroyed=!1,this.symbolLayers=[],this.referenced=0,this._extentPadding=0}async doLoad(e){let i=this._symbol.symbolLayers;this._extentPadding=0,this._backgroundLayers&&(i=this._backgroundLayers.concat(i));let a=i.length;for(;this.symbolLayers.length<i.length;)this.symbolLayers.push(null);this.symbolLayers.length=i.length;let o=[];if(!f){let{make:e}=await import(`./Graphics3DSymbolLayerFactory.js`);f=e}for(let t=0;t<a;t++){let r=i.at(t);if(r.enabled===!1)continue;p.renderPriority=1-(1+t)/a,p.renderPriorityStep=1/a,p.ignoreDrivers=r.ignoreDrivers;let s=f(this.symbol,r,this._context,p),c=n(e,()=>{this.symbolLayers[t]=null,s.destroy()});c&&o.push(c),this.symbolLayers[t]=s}if(await t(this.symbolLayers,async(e,t)=>{if(e!=null)try{await e.load(),this._extentPadding+=Math.max(this._extentPadding,e.extentPadding)}catch{this.symbolLayers[t]=null}}),o.forEach(e=>e.remove()),r(e),this.symbolLayers.length&&!this.symbolLayers.some(e=>!!e))throw Error()}getSymbolLayerSize(e){let t=this.symbolLayers[e];return t==null?null:t.getCachedSize()}get extentPadding(){return this._extentPadding}get symbologySnappingSupported(){return this.symbolLayers.some(e=>e?.queryForSnapping)}get needsUpdateFocus(){return this.symbolLayers.some(e=>e?.needsUpdateFocus===!0)}createGraphics3DGraphic(e,t){let{graphic:n}=e,r=this.symbolLayers.map(t=>t?.createGraphics3DGraphic(e)??null);return new a(n,t||this,r)}get complexity(){let e=new l;return this.symbolLayers.forEach(t=>i(t?.complexity,e)),e}globalPropertyChanged(e,t){let n=this.symbolLayers.length;for(let r=0;r<n;r++){let n=this.symbolLayers[r];if(n!=null&&!n.globalPropertyChanged(e,t,e=>{let t=e.layers[r];return t instanceof o?t:null}))return!1}return!0}applyRendererDiff(e,t){return this.loadStatus===1?this.symbolLayers.reduce((n,r)=>n!==0&&r!=null?Math.min(n,r.applyRendererDiff(e,t)):n,2):0}prepareSymbolPatch(e){if(this.loadStatus===2||e.diff.type!==`partial`)return;let t=e.diff.diff;if(!t.symbolLayers||t.symbolLayers.type!==`partial`)return;let n=t.symbolLayers.diff;this.symbolLayers.forEach((t,r)=>{if(t==null)return;let i=n[r];if(i){let n={diff:i,graphics3DGraphicPatches:[],symbolLayerStatePatches:[]};t.prepareSymbolLayerPatch(n),e.symbolStatePatches.push(...n.symbolLayerStatePatches),n.graphics3DGraphicPatches.length&&e.graphics3DGraphicPatches.push((e,t)=>{let i=e.layers[r];i!=null&&n.graphics3DGraphicPatches.forEach(e=>e(i,t))})}})}updateGeometry(e){return this._updateGeometryOrTransform(e,(t,n)=>t.updateGeometry?t.updateGeometry(e.graphic,n):!1)}updateTransform(e,t,n,r){return this._updateGeometryOrTransform(e,(e,i)=>e.updateTransform?e.updateTransform(i,t,n,r):!1)}_updateGeometryOrTransform(e,t){for(let n=0;n<this.symbolLayers.length;n++){let r=this.symbolLayers[n];if(r==null)continue;let i=e.layers[n];if(!i||!t(r,i))return!1}return!0}onRemoveGraphic(e){for(let t=0;t<this.symbolLayers.length;t++){let n=this.symbolLayers[t];if(n==null)continue;let r=e.layers[t];r!=null&&n.onRemoveGraphic(r)}}getFastUpdateStatus(){let e=!1,t=!1;for(let n of this.symbolLayers)if(n!=null){if(n.loadStatus===0)return 3;n.isFastUpdatesEnabled()?t=!0:e=!0}return t?e?2:1:e?0:4}async queryForSnapping(t,n,i,a){let o=this.symbolLayers.filter(e).filter(e=>e.queryForSnapping!=null).map(e=>e.queryForSnapping(t,n,i,a)),s=await Promise.all(o);return r(a),s.flat()}destroy(){if(!this.destroyed){super.destroy();for(let e of this.symbolLayers)e?.destroy();this.symbolLayers.length=0,this._destroyed=!0}}get destroyed(){return this._destroyed}get usedMemory(){return u(this)}}let f=null;const p=new s;export{d as Graphics3DSymbol};
2
+ import{isSome as e}from"../../../../core/arrayUtils.js";import{forEach as t}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import{onAbortOrThrow as n,throwIfAborted as r}from"../../../../core/promiseUtils.js";import{aggregateSymbolComplexity as i}from"./defaultSymbolComplexity.js";import{Graphics3DGraphic as a}from"./Graphics3DGraphic.js";import{Graphics3DSymbolLayerCreationContext as o}from"./Graphics3DSymbolCreationContext.js";import{Loadable as s}from"./Loadable.js";import{AggregateSymbolComplexity as c}from"./SymbolComplexity.js";import{getSymbolMemorySize as l}from"./symbolMemory.js";class u extends s{set symbol(e){this._symbol=e,e.symbolLayers.forEach((t,n)=>{let r=this.symbolLayers[n];r!=null&&(r.symbol=e,r.symbolLayer=t)})}get symbol(){return this._symbol}constructor(e,t,n){super(t.schedule),this._symbol=e,this._context=t,this._backgroundLayers=n,this._destroyed=!1,this.symbolLayers=[],this.referenced=0,this._extentPadding=0}async doLoad(e){let i=this._symbol.symbolLayers;this._extentPadding=0,this._backgroundLayers&&(i=this._backgroundLayers.concat(i));let a=i.length;for(;this.symbolLayers.length<i.length;)this.symbolLayers.push(null);this.symbolLayers.length=i.length;let o=[];if(!d){let{make:e}=await import(`./Graphics3DSymbolLayerFactory.js`);d=e}for(let t=0;t<a;t++){let r=i.at(t);if(r.enabled===!1)continue;f.renderPriority=1-(1+t)/a,f.renderPriorityStep=1/a,f.ignoreDrivers=r.ignoreDrivers;let s=d(this.symbol,r,this._context,f),c=n(e,()=>{this.symbolLayers[t]=null,s.destroy()});c&&o.push(c),this.symbolLayers[t]=s}if(await t(this.symbolLayers,async(e,t)=>{if(e!=null)try{await e.load(),this._extentPadding+=Math.max(this._extentPadding,e.extentPadding)}catch{this.symbolLayers[t]=null}}),o.forEach(e=>e.remove()),r(e),this.symbolLayers.length&&!this.symbolLayers.some(e=>!!e))throw Error()}getSymbolLayerSize(e){let t=this.symbolLayers[e];return t==null?null:t.getCachedSize()}get extentPadding(){return this._extentPadding}get symbologySnappingSupported(){return this.symbolLayers.some(e=>e?.queryForSnapping)}get needsUpdateFocus(){return this.symbolLayers.some(e=>e?.needsUpdateFocus===!0)}createGraphics3DGraphic(e,t){let{graphic:n}=e,r=this.symbolLayers.map(t=>t?.createGraphics3DGraphic(e)??null);return new a(n,t||this,r)}get complexity(){let e=new c;return this.symbolLayers.forEach(t=>i(t?.complexity,e)),e}globalPropertyChanged(e,t){let n=this.symbolLayers.length;for(let r=0;r<n;r++){let n=this.symbolLayers[r];if(n!=null&&!n.globalPropertyChanged(e,t,e=>{let t=e.layers[r];return t?.type===`object3d`||t?.type===`buffer`?t:null}))return!1}return!0}applyRendererDiff(e,t){return this.loadStatus===1?this.symbolLayers.reduce((n,r)=>n!==0&&r!=null?Math.min(n,r.applyRendererDiff(e,t)):n,2):0}prepareSymbolPatch(e){if(this.loadStatus===2||e.diff.type!==`partial`)return;let t=e.diff.diff;if(!t.symbolLayers||t.symbolLayers.type!==`partial`)return;let n=t.symbolLayers.diff;this.symbolLayers.forEach((t,r)=>{if(t==null)return;let i=n[r];if(i){let n={diff:i,graphics3DGraphicPatches:[],symbolLayerStatePatches:[]};t.prepareSymbolLayerPatch(n),e.symbolStatePatches.push(...n.symbolLayerStatePatches),n.graphics3DGraphicPatches.length&&e.graphics3DGraphicPatches.push((e,t)=>{let i=e.layers[r];i!=null&&n.graphics3DGraphicPatches.forEach(e=>e(i,t))})}})}updateGeometry(e){return this._updateGeometryOrTransform(e,(t,n)=>t.updateGeometry?t.updateGeometry(e.graphic,n):!1)}updateTransform(e,t,n,r){return this._updateGeometryOrTransform(e,(e,i)=>e.updateTransform?e.updateTransform(i,t,n,r):!1)}_updateGeometryOrTransform(e,t){for(let n=0;n<this.symbolLayers.length;n++){let r=this.symbolLayers[n];if(r==null)continue;let i=e.layers[n];if(!i||!t(r,i))return!1}return!0}onRemoveGraphic(e){for(let t=0;t<this.symbolLayers.length;t++){let n=this.symbolLayers[t];if(n==null)continue;let r=e.layers[t];r!=null&&n.onRemoveGraphic(r)}}getFastUpdateStatus(){let e=!1,t=!1;for(let n of this.symbolLayers)if(n!=null){if(n.loadStatus===0)return 3;n.isFastUpdatesEnabled()?t=!0:e=!0}return t?e?2:1:e?0:4}async queryForSnapping(t,n,i,a){let o=this.symbolLayers.filter(e).filter(e=>e.queryForSnapping!=null).map(e=>e.queryForSnapping(t,n,i,a)),s=await Promise.all(o);return r(a),s.flat()}destroy(){if(!this.destroyed){super.destroy();for(let e of this.symbolLayers)e?.destroy();this.symbolLayers.length=0,this._destroyed=!0}}get destroyed(){return this._destroyed}get usedMemory(){return l(this)}}let d=null;const f=new o;export{u as Graphics3DSymbol};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{copy as t,set as n,length as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as i,fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as o,center as s,height as c}from"../../../../geometry/support/aaBoundingBox.js";import{labelMarginPx as l}from"./constants.js";import{getGraphics3DSymbol as u}from"./graphicSymbolUtils.js";import{LabelPlacement as d}from"./LabelParameters.js";import{textVerticalPaddingPx as f}from"../../webgl-engine/lib/TextRenderer.js";import{HUDMaterial as p}from"../../webgl-engine/materials/HUDMaterial.js";const m=()=>e.getLogger(`esri.views.3d.layers.graphics.labelPlacement`);class h{constructor(e,t,n,r=null){this._graphic=e,this._symbol=t,this._class=n,this._disablePlacement=r}get placement(){let e=this._verticalOffsetPlacement;if(e==null)return null;let t=this._getPlacementInfo(e);if(t==null)return null;let n=t.anchor,r=!!e.hasLabelVerticalOffset,i=e.verticalOffset,a=new d(i,n,r);return this._calculatePlacementOffsets(a,t)}get _verticalOffsetPlacement(){let e=this._class.labelPlacement,{_symbol:t,_graphic:n}=this,r=u(n.graphics3DSymbol),i=r?.symbol.type===`point-3d`?r.symbol:null,a=y[e]||this._defaultPlacementInfo;return i?.supportsCallout()&&i.hasVisibleVerticalOffset()&&!n.isDraped?{placement:null,hasLabelVerticalOffset:!1,verticalOffset:i.verticalOffset.clone(),anchor:null,normalizedOffset:null}:t?.hasVisibleVerticalOffset()&&(i==null||!i.supportsCallout()||!i.verticalOffset||n.isDraped)?!a||!v(a.placement)?(m().errorOncePerTick(`Callouts and vertical offset on labels are currently only supported with 'above-center' label placement (not with `+e+` placement)`),null):{placement:`above-center`,verticalOffset:t.verticalOffset.clone(),anchor:`bottom`,normalizedOffset:[0,a.normalizedOffset[1],0],hasLabelVerticalOffset:!0}:{placement:null,verticalOffset:null,anchor:null,normalizedOffset:null,hasLabelVerticalOffset:!1}}_getPlacementInfo(e){if(e.anchor)return e;let t=this._class.labelPlacement,n=y[t],r=n||this._defaultPlacementInfo;return t&&!n&&m().warnOnce(`the requested label placement '${t}' is currently unsupported in SceneView.`),this._validatePlacementInfo(r)}_calculatePlacementOffsets(e,t){let n=this._graphic.graphic.geometry;if(n==null)return null;switch(n.type){case`point`:this._setPointSpecificPlacement(e,t);break;case`mesh`:this._setMeshSpecificPlacement(e,t);break;case`polygon`:this._setPolygonSpecificPlacement(e,t)}let r=l-f;return e.screenOffset[0]+=r*t.normalizedOffset[0],e.screenOffset[1]+=r*t.normalizedOffset[1],e}get _defaultPlacementInfo(){let e=this._graphic.graphic.geometry;if(e==null)return null;switch(e.type){case`polyline`:case`extent`:case`multipoint`:return{placement:`center-center`,normalizedOffset:i,anchor:`center`};case`polygon`:return this._firstSymbolLayer?.type===`extrude`?y[`above-center`]:{placement:`center-center`,normalizedOffset:i,anchor:`center`};case`point`:return y[`above-center`];case`mesh`:return y[`above-center`];default:return}}_validatePlacementInfo(e){let t=this._graphic.graphic.geometry;if(t==null)return null;if(this._disablePlacement!=null){let t=this._class.labelPlacement;return t?(m().warnOncePerTick(g(t,this._disablePlacement.logEntityDescription)),this._defaultPlacementInfo):e}let n=t.type;switch(n){case`polyline`:case`polygon`:case`extent`:case`multipoint`:{let e=this._class.labelPlacement;if(e)return y[e]&&m().warnOnce(g(e,`'${n}' geometries`)),this._defaultPlacementInfo;break}case`point`:case`mesh`:return e}return e}_setPointSpecificPlacement(e,r){let i=this._firstSymbolLayer;if(i==null)return;let a=this._graphic.layers[0];switch(a==null?n(e.translation,0,0,0):t(e.translation,a.getCenterObjectSpace()),i.type){case`icon`:case`text`:this._setHUDSpecificPlacement(e,r,a);break;case`object`:_(e,r,a)}}_setMeshSpecificPlacement(e,t){let n=this._firstSymbolLayer;if(n!=null&&n.type===`fill`){let n=this._graphic.layers[0];_(e,t,n)}}_setPolygonSpecificPlacement(e,t){let r=this._firstSymbolLayer;if(r!=null)switch(r.type){case`extrude`:{let r=this._graphic.layers[0];r==null?n(e.translation,0,0,0):(r.getBoundingBoxObjectSpace(S),s(S,e.translation),e.translation[2]=c(S)/2),_(e,t,r);break}}}_setHUDSpecificPlacement(e,t,n){let r=n==null?null:n.getScreenSize();if(!this._graphic.isDraped&&r!=null){let n=this._normalizedSymbolAnchorPos;e.screenOffset[0]=r[0]/2*(t.normalizedOffset[0]-n[0]);let i=r[1]/2*(t.normalizedOffset[1]-n[1]);e.hasLabelVerticalOffset?(e.centerOffset[1]=i,e.centerOffsetUnits=`screen`):e.screenOffset[1]=i}else!e.hasLabelVerticalOffset&&e.anchor!==`center`&&(y[this._class.labelPlacement]&&m().warnOncePerTick(`the requested placement '${t.placement}' is currently unsupported for draped graphics`),e.anchor=`center`)}get _firstSymbolLayer(){let e=this._graphic.graphics3DSymbol,t=u(e);return t==null?null:t.symbol.symbolLayers.at(0)}get _normalizedSymbolAnchorPos(){let e=this._graphic.layers[0]?.stageObject.geometries[0].material??null;if(e&&e instanceof p){let t=e.parameters.anchorPosition;x[0]=(t[0]-.5)*2,x[1]=(t[1]-.5)*2}else x[0]=0,x[1]=0;return x}}function g(e,t){return`the requested label placement '${e}' is currently unsupported for ${t} in SceneView.`}function _(e,t,n){let i=n==null?S:n.getBoundingBoxObjectSpace(S),o=a(i[3]-i[0],i[4]-i[1],i[5]-i[2]),s=Math.sqrt(o[0]*o[0]+o[1]*o[1]);e.centerOffset[0]=s/2*t.normalizedOffset[0];let c=e.translation[2],l=o[2]/2*t.normalizedOffset[1];e.translation[2]=0,e.elevationOffset=c+l;let u=r(o);e.centerOffset[2]=u/2*t.normalizedOffset[2]}function v(e){switch(e){case`above-center`:return!0;default:return!1}}const y={"above-center":{placement:`above-center`,normalizedOffset:[0,1,0],anchor:`bottom`},"above-left":{placement:`above-left`,normalizedOffset:[-1,1,0],anchor:`bottom-right`},"above-right":{placement:`above-right`,normalizedOffset:[1,1,0],anchor:`bottom-left`},"below-center":{placement:`below-center`,normalizedOffset:[0,-1,2],anchor:`top`},"below-left":{placement:`below-left`,normalizedOffset:[-1,-1,0],anchor:`top-right`},"below-right":{placement:`below-right`,normalizedOffset:[1,-1,0],anchor:`top-left`},"center-center":{placement:`center-center`,normalizedOffset:[0,0,1],anchor:`center`},"center-left":{placement:`center-left`,normalizedOffset:[-1,0,0],anchor:`right`},"center-right":{placement:`center-right`,normalizedOffset:[1,0,0],anchor:`left`}},b={"above-center":[`default`,`esriServerPointLabelPlacementAboveCenter`],"above-left":[`esriServerPointLabelPlacementAboveLeft`],"above-right":[`esriServerPointLabelPlacementAboveRight`],"below-center":[`esriServerPointLabelPlacementBelowCenter`],"below-left":[`esriServerPointLabelPlacementBelowLeft`],"below-right":[`esriServerPointLabelPlacementBelowRight`],"center-center":[`esriServerPointLabelPlacementCenterCenter`],"center-left":[`esriServerPointLabelPlacementCenterLeft`],"center-right":[`esriServerPointLabelPlacementCenterRight`]};for(let e in b){let t=b[e],n=y[e];t.forEach(e=>{y[e]=n})}Object.freeze&&(Object.freeze(y),Object.keys(y).forEach(e=>{Object.freeze(y[e]),Object.freeze(y[e]?.normalizedOffset)}));const x=[0,0],S=o();export{h as LabelInfo};
2
+ import e from"../../../../core/Logger.js";import{copy as t,set as n,length as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as i,fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as o,center as s,height as c}from"../../../../geometry/support/aaBoundingBox.js";import{labelMarginPx as l}from"./constants.js";import{getGraphics3DSymbol as u}from"./graphicSymbolUtils.js";import{LabelPlacement as d}from"./LabelParameters.js";import{textVerticalPaddingPx as f}from"../../webgl-engine/lib/TextRenderer.js";import{HUDMaterial as p}from"../../webgl-engine/materials/HUDMaterial.js";const m=()=>e.getLogger(`esri.views.3d.layers.graphics.labelPlacement`);class h{constructor(e,t,n,r=null){this._graphic=e,this._symbol=t,this._class=n,this._disablePlacement=r}get placement(){let e=this._verticalOffsetPlacement;if(e==null)return null;let t=this._getPlacementInfo(e);if(t==null)return null;let n=t.anchor,r=!!e.hasLabelVerticalOffset,i=e.verticalOffset,a=new d(i,n,r);return this._calculatePlacementOffsets(a,t)}get _verticalOffsetPlacement(){let e=this._class.labelPlacement,{_symbol:t,_graphic:n}=this,r=u(n.graphics3DSymbol),i=r?.symbol.type===`point-3d`?r.symbol:null,a=y[e]||this._defaultPlacementInfo;return i?.supportsCallout()&&i.hasVisibleVerticalOffset()&&!n.isDraped?{placement:null,hasLabelVerticalOffset:!1,verticalOffset:i.verticalOffset.clone(),anchor:null,normalizedOffset:null}:t?.hasVisibleVerticalOffset()&&(i==null||!i.supportsCallout()||!i.verticalOffset||n.isDraped)?!a||!v(a.placement)?(m().errorOncePerTick(`Callouts and vertical offset on labels are currently only supported with 'above-center' label placement (not with `+e+` placement)`),null):{placement:`above-center`,verticalOffset:t.verticalOffset.clone(),anchor:`bottom`,normalizedOffset:[0,a.normalizedOffset[1],0],hasLabelVerticalOffset:!0}:{placement:null,verticalOffset:null,anchor:null,normalizedOffset:null,hasLabelVerticalOffset:!1}}_getPlacementInfo(e){if(e.anchor)return e;let t=this._class.labelPlacement,n=y[t],r=n||this._defaultPlacementInfo;return t&&!n&&m().warnOnce(`the requested label placement '${t}' is currently unsupported in SceneView.`),this._validatePlacementInfo(r)}_calculatePlacementOffsets(e,t){let n=this._graphic.graphic.geometry;if(n==null)return null;switch(n.type){case`point`:this._setPointSpecificPlacement(e,t);break;case`mesh`:this._setMeshSpecificPlacement(e,t);break;case`polygon`:this._setPolygonSpecificPlacement(e,t)}let r=l-f;return e.screenOffset[0]+=r*t.normalizedOffset[0],e.screenOffset[1]+=r*t.normalizedOffset[1],e}get _defaultPlacementInfo(){let e=this._graphic.graphic.geometry;if(e==null)return null;switch(e.type){case`polyline`:case`extent`:case`multipoint`:return{placement:`center-center`,normalizedOffset:i,anchor:`center`};case`polygon`:return this._firstSymbolLayer?.type===`extrude`?y[`above-center`]:{placement:`center-center`,normalizedOffset:i,anchor:`center`};case`point`:return y[`above-center`];case`mesh`:return y[`above-center`];default:return}}_validatePlacementInfo(e){let t=this._graphic.graphic.geometry;if(t==null)return null;if(this._disablePlacement!=null){let t=this._class.labelPlacement;return t?(m().warnOncePerTick(g(t,this._disablePlacement.logEntityDescription)),this._defaultPlacementInfo):e}let n=t.type;switch(n){case`polyline`:case`polygon`:case`extent`:case`multipoint`:{let e=this._class.labelPlacement;if(e)return y[e]&&m().warnOnce(g(e,`'${n}' geometries`)),this._defaultPlacementInfo;break}case`point`:case`mesh`:return e}return e}_setPointSpecificPlacement(e,r){let i=this._firstSymbolLayer;if(i==null)return;let a=this._graphic.layers[0],o=a?.type===`buffer`&&(i.type===`icon`||i.type===`text`);switch(a!=null&&!o?t(e.translation,a.getCenterObjectSpace()):n(e.translation,0,0,0),i.type){case`icon`:case`text`:this._setHUDSpecificPlacement(e,r,a);break;case`object`:_(e,r,a)}}_setMeshSpecificPlacement(e,t){let n=this._firstSymbolLayer;if(n!=null&&n.type===`fill`){let n=this._graphic.layers[0];_(e,t,n)}}_setPolygonSpecificPlacement(e,t){let r=this._firstSymbolLayer;if(r!=null)switch(r.type){case`extrude`:{let r=this._graphic.layers[0];r==null?n(e.translation,0,0,0):(r.getBoundingBoxObjectSpace(S),s(S,e.translation),e.translation[2]=c(S)/2),_(e,t,r);break}}}_setHUDSpecificPlacement(e,t,n){let r=n==null?null:n.getScreenSize();if(!this._graphic.isDraped&&r!=null){let n=this._normalizedSymbolAnchorPos;e.screenOffset[0]=r[0]/2*(t.normalizedOffset[0]-n[0]);let i=r[1]/2*(t.normalizedOffset[1]-n[1]);e.hasLabelVerticalOffset?(e.centerOffset[1]=i,e.centerOffsetUnits=`screen`):e.screenOffset[1]=i}else!e.hasLabelVerticalOffset&&e.anchor!==`center`&&(y[this._class.labelPlacement]&&m().warnOncePerTick(`the requested placement '${t.placement}' is currently unsupported for draped graphics`),e.anchor=`center`)}get _firstSymbolLayer(){let e=this._graphic.graphics3DSymbol,t=u(e);return t==null?null:t.symbol.symbolLayers.at(0)}get _normalizedSymbolAnchorPos(){let e=this._graphic.layers[0],t=e?.type===`object3d`||e?.type===`buffer`?e.stageObject.geometries[0].material:null;if(t&&t instanceof p){let e=t.parameters.anchorPosition;x[0]=(e[0]-.5)*2,x[1]=(e[1]-.5)*2}else x[0]=0,x[1]=0;return x}}function g(e,t){return`the requested label placement '${e}' is currently unsupported for ${t} in SceneView.`}function _(e,t,n){let i=n==null?S:n.getBoundingBoxObjectSpace(S),o=a(i[3]-i[0],i[4]-i[1],i[5]-i[2]),s=Math.sqrt(o[0]*o[0]+o[1]*o[1]);e.centerOffset[0]=s/2*t.normalizedOffset[0];let c=e.translation[2],l=o[2]/2*t.normalizedOffset[1];e.translation[2]=0,e.elevationOffset=c+l;let u=r(o);e.centerOffset[2]=u/2*t.normalizedOffset[2]}function v(e){switch(e){case`above-center`:return!0;default:return!1}}const y={"above-center":{placement:`above-center`,normalizedOffset:[0,1,0],anchor:`bottom`},"above-left":{placement:`above-left`,normalizedOffset:[-1,1,0],anchor:`bottom-right`},"above-right":{placement:`above-right`,normalizedOffset:[1,1,0],anchor:`bottom-left`},"below-center":{placement:`below-center`,normalizedOffset:[0,-1,2],anchor:`top`},"below-left":{placement:`below-left`,normalizedOffset:[-1,-1,0],anchor:`top-right`},"below-right":{placement:`below-right`,normalizedOffset:[1,-1,0],anchor:`top-left`},"center-center":{placement:`center-center`,normalizedOffset:[0,0,1],anchor:`center`},"center-left":{placement:`center-left`,normalizedOffset:[-1,0,0],anchor:`right`},"center-right":{placement:`center-right`,normalizedOffset:[1,0,0],anchor:`left`}},b={"above-center":[`default`,`esriServerPointLabelPlacementAboveCenter`],"above-left":[`esriServerPointLabelPlacementAboveLeft`],"above-right":[`esriServerPointLabelPlacementAboveRight`],"below-center":[`esriServerPointLabelPlacementBelowCenter`],"below-left":[`esriServerPointLabelPlacementBelowLeft`],"below-right":[`esriServerPointLabelPlacementBelowRight`],"center-center":[`esriServerPointLabelPlacementCenterCenter`],"center-left":[`esriServerPointLabelPlacementCenterLeft`],"center-right":[`esriServerPointLabelPlacementCenterRight`]};for(let e in b){let t=b[e],n=y[e];t.forEach(e=>{y[e]=n})}Object.freeze&&(Object.freeze(y),Object.keys(y).forEach(e=>{Object.freeze(y[e]),Object.freeze(y[e]?.normalizedOffset)}));const x=[0,0],S=o();export{h as LabelInfo};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{forEach as n,result as r}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{disposeMaybe as a,abortMaybe as o}from"../../../../core/maybe.js";import{throwIfAborted as s,isAbortError as c}from"../../../../core/promiseUtils.js";import l from"../../../../core/Queue.js";import{watch as u}from"../../../../core/reactiveUtils.js";import{property as d,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{hydrateGraphic as m}from"../../../../layers/graphics/hydratedFeatures.js";import{createLabelFunction as h}from"../../../../layers/support/labelFormatUtils.js";import{hasCalloutSupport as g}from"../../../../symbols/callouts/calloutUtils.js";import{make as _}from"./Graphics3DCalloutSymbolLayerFactory.js";import{LineCalloutCreationContext as v,LineCalloutSymbolLayerRenderingInfo as y}from"./Graphics3DLineCalloutSymbolLayer.js";import{getGraphics3DSymbol as b}from"./graphicSymbolUtils.js";import{LabelInfo as x}from"./LabelInfo.js";import{LabelParameters as S}from"./LabelParameters.js";import{horizontalPlacementFromAnchor as C,verticalPlacementFromAnchor as w,textRenderAlignmentFromHorizontalPlacement as T}from"./placementUtils.js";import{placePointOnGeometry as E}from"./pointUtils.js";import{TextRenderer as D}from"../../webgl-engine/lib/TextRenderer.js";import{TextRenderParameters as O}from"../../webgl-engine/lib/TextRenderParameters.js";import{TextTextureAtlas as k}from"../../webgl-engine/lib/TextTextureAtlas.js";import{WebGLLayer as A}from"../../webgl-engine/lib/WebGLLayer.js";import{hasLayerBasedScaleVisibility as j,isInEffectiveScaleRange as M}from"../../../support/layerViewUtils.js";import{TaskPriority as N}from"../../../support/Scheduler.js";import{Yield as P}from"../../../support/Yield.js";class F{constructor(e,t){this.labelingContext=e,this.graphics3DGraphic=t,this.hasGraphics3DResources=!1,this.visible=!1,this.textureAtlasHandles=[],this.textInitialized=!1,this.textRenderers=[],this.textLabelPlacements=[]}}class I{constructor(e,t,n,r,i){this.labelClass=e,this.graphics3DSymbol=t,this.graphics3DCalloutSymbolLayer=n,this.textRenderParameters=r,this.labelFunction=i,this.calloutSymbolLayerIndex=0,this.graphics=new Map,this.scaleVisibility=null}}class L{constructor(e,t,n,r,i,a,o,s){this.layer=t,this.graphics3DCore=n,this.scaleVisibility=r,this.emptySymbolLabelSupported=i,this.elevationInfoOverride=a,this.disablePlacement=o,this.active=s,this.labelClassAbortController=new AbortController,this._labelClassContexts=[],this.graphics=new Map,this.labelsToInitialize=new Map,this.stageLayer=new A(e,{pickable:!0},n.owner.layerViewUid)}destroy(){this.stageLayer.destroy()}get labelClassContexts(){return this._labelClassContexts}setLabelClassContext(e,t){this._labelClassContexts[e]=t}resetLabelClassContext(){this._labelClassContexts.length=0}}let R=class extends t{constructor(e){super(e),this._hudMaterials=new Map,this._calloutMaterials=new Map,this._dirty=!1,this._focusAreasLabelsQueue=new l,this._labels=new Map,this._labelingContexts=[]}setup(){this.dispose(),this.addHandles([u(()=>this.view.state?.camera,()=>this.setDirty()),u(()=>this.view.state?.rasterPixelRatio,()=>this._resetAllLabels()),u(()=>this.view.timeZone,()=>this._resetArcadeLabels()),u(()=>this.view.focusAreasView?.polygons,()=>this._updateFocus()),this.view.resourceController.scheduler.registerTask(N.LABELER,this)]),j()&&this.addHandles(u(()=>this.view.scale,()=>this._updateScaleVisibility())),this._textTextureAtlas=new k({view:this.view})}dispose(){this.removeAllHandles(),this._textTextureAtlas=a(this._textTextureAtlas),this._hudMaterials.clear(),this._calloutMaterials.clear(),this._labelingContexts.length=0,this._labels.clear()}destroy(){this.dispose(),G.graphic=null,G.renderingInfo=null,G.layer=null}_updateFocus(){this._focusAreasLabelsQueue.clear(),this._labelingContexts.forEach(e=>{e.graphics.forEach(t=>{this._focusAreasLabelsQueue.push({graphic3DGraphic:t,labelingContext:e})})})}_activateLabelingContext(e){e.graphics.forEach((t,n)=>{let r=new F(e,t);this._labels.set(n,r),e.labelsToInitialize.set(n,r),t.setVisibilityFlag(16,1,!0)}),e.active=!0}_deactivateLabelingContext(e){e.graphics.forEach((e,t)=>{e.setVisibilityFlag(16,1,!1),this.setLabelGraphicVisibility(e,!1),e.clearLabelGraphics(),this._labels.delete(t)}),e.active=!1}_addLabelTextureToAtlas(e){if(this._textTextureAtlas)for(let t of e.graphics3DGraphic.labelLayers){if(!t.labelClass)continue;let n=e.textRenderers[t.labelClassContextIndex];n&&(e.textureAtlasHandles.push(this._textTextureAtlas.addText(n,e=>B(t.stageObject,e))),z(t.stageObject,n))}}_removeLabelTextureFromAtlas(e){e.textureAtlasHandles.forEach(e=>e.remove()),e.textureAtlasHandles.length=0}get readyToRun(){return this.view.ready&&(this._dirty||this.deconflictor.readyToRun||this._focusAreasLabelsQueue.length>0)}runTask(e){return this._updateLabels(e),this._applyFocusAreasUpdates(e),!this._dirty&&this.deconflictor.readyToRun&&this.deconflictor.runTask(e),P}_updateLabels(e){if(this._dirty){this._dirty=!1;for(let t of this._labelingContexts)if(t.active){if(V(t))this._dirty=!0;else if(H(t.labelClassContexts)){if(t.labelClassContexts===null){this._deactivateLabelingContext(t);continue}this._createLabelClassContext(t),this._dirty=!0}else for(let[n,r]of t.labelsToInitialize)if(this._ensureGraphics3DResources(r)&&(this._labels.set(n,r),this.deconflictor.setDirty(),e.madeProgress()),(r.visible&&r.textInitialized||!r.visible&&r.hasGraphics3DResources)&&(t.labelsToInitialize.delete(n),e.madeProgress()),e.done){this._dirty=!0;break}}this._dirty||this.notifyChange(`updating`)}}_applyFocusAreasUpdates(e){for(;this._focusAreasLabelsQueue.length>0&&!e.done;){e.madeProgress();let{graphic3DGraphic:t,labelingContext:n}=this._focusAreasLabelsQueue.pop();if(t.labelLayers.length===0||!n.active)continue;let r=E(t.graphic.geometry);if(r==null)continue;let i=this.view.focusAreasView?.containsGeometry(r)??!0;t.labelLayers.forEach(e=>{e.stageObject.geometries.some(e=>e.material.parameters.focusAreaStyle==null!==i)&&(this._removeGraphic(n,t),this._addGraphic(n,t),this.setDirty())})}this._focusAreasLabelsQueue.length===0&&(this.notifyChange(`readyToRun`),this.notifyChange(`updating`))}async _createLabelClassContextAsync(e){let t=e.labelClassAbortController?.signal;e.layer.when&&await e.layer.when(),s(t),e.scaleVisibility?.updateScaleRangeActive();let a=e.graphics3DCore,o=a.layer.labelingInfo?.filter(e=>!!e.symbol);o&&o.length!==0&&(await n(o,async(n,o)=>{let c=n.symbol,l=b(a.getOrCreateGraphics3DSymbol(c));if(l==null){i.getLogger(this).error(`Failed to create Graphics3DSymbol for label`);return}await l.load(),s(t);let u=null;g(c)&&c.hasVisibleCallout()&&(u=_(c,a.symbolCreationContext),await u.load(),s(t));let d=await r(h(n,e.layer.fieldsIndex,this.view.spatialReference));if(s(t),d.ok===!0){let r=await this._createTextRenderParameters(l.symbol);s(t);let i=new I(n,l,u,r,d.value);this._updateLabelClassContextVisibility(i),e.setLabelClassContext(o,i)}else i.getLogger(this).error(`Label expression failed to evaluate: ${d.error}`)}),s(t))}async _createLabelClassContext(e){return e.labelClassPromise??(e.labelClassPromise=this._createLabelClassContextAsync(e).catch(t=>{if(c(t))throw t;e.resetLabelClassContext()}).then(()=>{e.labelClassAbortController=null,this.notifyChange(`updating`)}).catch(()=>{}),this.notifyChange(`updating`)),e.labelClassPromise}async _createTextRenderParameters(e){let t=e.symbolLayers.at(0);return t?.type===`text`?O.fromSymbol(t,this.view.state.rasterPixelRatio):null}_destroyLabelClassContext(e){for(let t of e.labelClassContexts)t&&--t.graphics3DSymbol.referenced;let t=e.labelClassAbortController;e.labelClassAbortController=new AbortController,o(t),e.resetLabelClassContext(),e.labelClassPromise=null,this.notifyChange(`updating`)}_createTextSymbolGraphic(e,t,n,r,i,a){if(!this._textTextureAtlas)return null;let o=new S(n,C(n.anchor),w(n.anchor),e.text,p(e.displayWidth,e.displayHeight));return G.graphic=t,G.layer=r,G.renderingInfo=null,i.createLabel(G,o,this._hudMaterials,this._textTextureAtlas,()=>a.placement?.elevationOffset??null)}_createLineCalloutGraphic(e,t,n,r,i){G.graphic=e,G.layer=i;let a=r.screenOffset[0];return G.renderingInfo=new y(null,t,r.translation,r.centerOffset,r.groundDistance,a,r.centerOffsetUnits,r.elevationOffset),n.createGraphics3DGraphic(G,this._calloutMaterials)}_ensureGraphics3DResources(e){if(e.hasGraphics3DResources)return!1;let t=e.graphics3DGraphic;if(t.destroyed)return!1;this._ensureTextTextureResources(e);let n=e.labelingContext,r=n.labelClassContexts;if(H(r)||!n.emptySymbolLabelSupported&&t.layers.length===0)return!1;let i=!1,a=t.graphic,o=n.layer,s=W(n.layer);for(let c=0;c<r.length;c++){let l=e.textRenderers[c],u=e.textLabelPlacements[c],d=r[c];if(l==null||u==null||d==null)continue;let f=d.graphics3DSymbol,p=U(f),m=f.symbolLayers[0];if(!m)continue;m.setElevationInfoOverride(n.elevationInfoOverride);let h=new x(t,p,d.labelClass),g=this._createTextSymbolGraphic(l,a,u,o,m,h);if(g==null)return!1;g.labelClass=d.labelClass,g.labelClassContextIndex=c,t.addLabelGraphic(g,n.stageLayer),this.deconflictor.setPriority(t,d.textRenderParameters?.definition.size??0),t.setVisibilityFlag(16,1,s),t.setVisibilityFlag(16,2,d.scaleVisibility??!0),t.setVisibilityFlag(16,8,!1),j()&&d.graphics.set(a.uid,t),i=!0;let _=d.graphics3DCalloutSymbolLayer;if(_&&u.hasLabelVerticalOffset){_.setElevationInfoOverride(n.elevationInfoOverride);let e=this._createLineCalloutGraphic(a,p,_,u,o);e!=null&&(d.calloutSymbolLayerIndex=t.labelLayers.length,t.addLabelGraphic(e,n.stageLayer))}break}return i&&n.scaleVisibility?.updateGraphicLabelScaleVisibility(t),e.hasGraphics3DResources=!0,!0}_destroyGraphics3DResources(e){let t=e.labelingContext.labelClassContexts;for(let n of e.graphics3DGraphic.labelLayers)n.labelClass!=null&&t[n.labelClassContextIndex].graphics3DSymbol.symbolLayers[0]?.onRemoveGraphic(n);e.graphics3DGraphic.clearLabelGraphics(),e.hasGraphics3DResources=!1}_ensureTextTextureResources(e){if(e.textInitialized)return;let t=e.labelingContext,n=t.labelClassContexts;if(H(n))return;let r=e.graphics3DGraphic.graphic;for(let i=0;i<n.length;i++){let a=n[i];if(e.textRenderers[i]=null,e.textLabelPlacements[i]=null,a?.textRenderParameters==null)continue;let o=a.labelFunction,s;if(o.type===`arcade`)try{let e=o.needsHydrationToEvaluate()?m(r,t.layer,null):r;s=o.evaluate(e,this.view.timeZone)}catch{s=null}else s=o.evaluate(r);if(s==null||s===``||/^\s+$/.test(s))continue;let c=a.graphics3DSymbol;if(!c.symbolLayers[0])continue;let l=e.graphics3DGraphic,u=c.symbol?.type===`label-3d`?c.symbol:null,d=a.labelClass,f=t.disablePlacement,p=new x(l,u,d,f).placement;if(p==null)continue;let h=C(p.anchor),g=T(h);e.textRenderers[i]=new D(s,g,a.textRenderParameters,k.maxSize),e.textLabelPlacements[i]=p}e.textInitialized=!0}_destroyTextTextureResources(e){e.textInitialized=!1,e.textRenderers.length=0,e.textLabelPlacements.length=0}_addGraphic(e,t){let n=t.graphic.uid;if(e.graphics.set(n,t),e.active){let r=new F(e,t);this._labels.set(n,r),e.labelsToInitialize.set(n,r)}this.setDirty(),this.deconflictor.setDirty()}_updateGraphicGeometry(e,t){let n=t.graphic.uid,r=this._labels.get(n);if(!r)return!0;for(let n of r.graphics3DGraphic.labelLayers)if(n.labelClass!=null&&!e.labelClassContexts[n.labelClassContextIndex].graphics3DSymbol.symbolLayers[0].updateGeometry(t.graphic,n))return!1;return this.setDirty(),this.deconflictor.setDirty(),!0}_removeGraphic(e,t){let n=t.graphic.uid,r=this._labels.get(n);e.graphics.delete(n),e.labelClassContexts.forEach(e=>e?.graphics.delete(n)),r&&(this._destroyGraphic(r,n),e.labelsToInitialize.delete(n),this.setDirty(),this.deconflictor.setDirty())}_destroyGraphic(e,t){this._labels.delete(t),e.textureAtlasHandles.length&&this._removeLabelTextureFromAtlas(e),this._destroyTextTextureResources(e),e.hasGraphics3DResources&&this._destroyGraphics3DResources(e)}async _labelingInfoChange(e,t){if(t)for(let n of t){let t=e.graphics.get(n);t&&(this._removeGraphic(e,t),this._addGraphic(e,t))}else return this._visibilityInfoChange(e),this._resetLabels(e),this._createLabelClassContext(e)}_globalPropertyChanged(e,t){for(let n of t.labelClassContexts){if(!n)continue;let r=new Map;t.graphics.forEach(e=>r.set(e.graphic.uid,e)),n.graphics3DSymbol.symbolLayers[0].globalPropertyChanged(e,r,e=>e.labelLayers[0]),n.graphics3DCalloutSymbolLayer&&n.graphics3DCalloutSymbolLayer.globalPropertyChanged(e,r,e=>e.labelLayers[n.calloutSymbolLayerIndex])}}_visibilityInfoChange(e){let t=W(e.layer);t&&!e.active&&this._activateLabelingContext(e),!t&&e.active&&this._deactivateLabelingContext(e),this.setDirty()}_resetAllLabels(){for(let e of this._labelingContexts)this._resetLabels(e)}_resetArcadeLabels(){for(let e of this._labelingContexts)e.labelClassContexts.some(e=>e?.labelFunction.type===`arcade`)&&this._resetLabels(e)}_resetLabels(e){e.graphics.forEach((t,n)=>{let r=this._labels.get(n);r&&(this._destroyGraphic(r,n),r.visible=!1,e.labelsToInitialize.set(n,r))}),this._destroyLabelClassContext(e),this.setDirty(),this.deconflictor.setDirty()}_findLabelingContext(e){for(let t of this._labelingContexts)if(t.graphics3DCore===e)return t;return null}addGraphicsOwner(e,t,n){let r=n?.emptySymbolLabelSupported||!1,i=n?.elevationInfoOverride||null,a=n?.disablePlacement||null;if(this._findLabelingContext(e))return;let o=e.layer,s=new L(this.view.stage,o,e,t,r,i,a,W(o));return this._labelingContexts.push(s),this.setDirty(),{addGraphic:e=>this._addGraphic(s,e),removeGraphic:e=>this._removeGraphic(s,e),updateGraphicGeometry:e=>this._updateGraphicGeometry(s,e),layerLabelsEnabled:()=>W(s.layer),labelingInfoChange:e=>this._labelingInfoChange(s,e),elevationInfoChange:()=>this._globalPropertyChanged(`elevationInfo`,s),screenSizePerspectiveEnabledChanged:()=>this._globalPropertyChanged(`screenSizePerspectiveEnabled`,s),slicePlaneEnabledChange:()=>this._globalPropertyChanged(`slicePlaneEnabled`,s),visibilityInfoChange:()=>this._visibilityInfoChange(s),reset:()=>this._resetLabels(s),remove:()=>this._removeGraphicsOwner(e),setDirty:()=>this.setDirty()}}_removeGraphicsOwner(e){let t=this._findLabelingContext(e);if(!t)return;let n=this._labelingContexts.indexOf(t);this._labelingContexts.splice(n,1),t.graphics.forEach(e=>this._removeGraphic(t,e)),t.destroy(),this.setDirty()}_updateScaleVisibility(){for(let e of this._labelingContexts)if(e.active&&!V(e))for(let t of e.labelClassContexts)this._updateLabelClassContextVisibility(t)}_updateLabelClassContextVisibility(e){if(!e||!j())return;let{labelClass:t,graphics:n}=e,r={minScale:t.minScale,maxScale:t.maxScale},i=M(r,this.view.scale),a=e.scaleVisibility==null||e.scaleVisibility!==i;e.scaleVisibility=i,a&&n.size&&(n.forEach(e=>e.setVisibilityFlag(16,2,i)),this.deconflictor.setDirty(),this.setDirty())}setLabelGraphicVisibility(e,t){let n=e.graphic.uid,r=this._labels.get(n);r&&r.visible!==t&&(t&&!r.textureAtlasHandles.length?(this._addLabelTextureToAtlas(r),r.textInitialized||r.labelingContext.labelsToInitialize.set(n,r)):!t&&r.textureAtlasHandles.length&&this._removeLabelTextureFromAtlas(r),r.visible=t,this.setDirty())}setDirty(){!this._dirty&&this._labelingContexts.length>0&&(this._dirty=!0,this.notifyChange(`updating`))}get updating(){return this._dirty||this._textTextureAtlas?.updating||this.deconflictor.updating||this._labelingContexts.some(e=>V(e))||this._focusAreasLabelsQueue.length>0}get updatingProgress(){if(!this.updating||!this._textTextureAtlas)return 1;let e=this._labelingContexts.length>0?this._labelingContexts.reduce((e,t)=>e+ +!V(t),0)/this._labelingContexts.length:1;return(this._dirty?0:.3)+(this._textTextureAtlas.updating?0:.1)+e*.1+this.deconflictor.updatingProgress*.5}get usedMemory(){return this._textTextureAtlas?.usedMemory??0}get test(){}};e([d({constructOnly:!0})],R.prototype,`view`,void 0),e([d({constructOnly:!0})],R.prototype,`deconflictor`,void 0),e([d()],R.prototype,`_textTextureAtlas`,void 0),e([d({type:Boolean,readOnly:!0})],R.prototype,`updating`,null),R=e([f(`esri.views.3d.layers.graphics.Labeler`)],R);function z(e,t){e.geometries[0].setAttributeData(`size`,[t.displayWidth,t.displayHeight]),e.geometryVertexAttributeUpdated(e.geometries[0],`size`)}function B(e,t){e.geometries[0].setAttributeData(`uvi`,t),e.geometryVertexAttributeUpdated(e.geometries[0],`uvi`,!0)}function V(e){return!!e.labelClassPromise&&!!e.labelClassAbortController}function H(e){return(e?.length??0)===0}function U(e){return e.symbol?.type===`label-3d`?e.symbol:null}function W(e){return!!e.labelsVisible&&!!e.labelingInfo?.some(e=>!!e.symbol)}const G=new v(null,null,null);export{R as Labeler,W as areLabelsVisible};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{forEach as n,result as r}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{disposeMaybe as a,abortMaybe as o}from"../../../../core/maybe.js";import{throwIfAborted as s,isAbortError as c}from"../../../../core/promiseUtils.js";import l from"../../../../core/Queue.js";import{watch as u}from"../../../../core/reactiveUtils.js";import{property as d,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isInEffectiveScaleRange as m}from"../../../../geometry/support/scaleUtils.js";import{hydrateGraphic as h}from"../../../../layers/graphics/hydratedFeatures.js";import{createLabelFunction as g}from"../../../../layers/support/labelFormatUtils.js";import{hasCalloutSupport as _}from"../../../../symbols/callouts/calloutUtils.js";import{make as v}from"./Graphics3DCalloutSymbolLayerFactory.js";import{LineCalloutCreationContext as y,LineCalloutSymbolLayerRenderingInfo as b}from"./Graphics3DLineCalloutSymbolLayer.js";import{getGraphics3DSymbol as x}from"./graphicSymbolUtils.js";import{LabelInfo as S}from"./LabelInfo.js";import{LabelParameters as C}from"./LabelParameters.js";import{horizontalPlacementFromAnchor as w,verticalPlacementFromAnchor as T,textRenderAlignmentFromHorizontalPlacement as E}from"./placementUtils.js";import{placePointOnGeometry as D}from"./pointUtils.js";import{TextRenderer as O}from"../../webgl-engine/lib/TextRenderer.js";import{TextRenderParameters as k}from"../../webgl-engine/lib/TextRenderParameters.js";import{TextTextureAtlas as A}from"../../webgl-engine/lib/TextTextureAtlas.js";import{WebGLLayer as j}from"../../webgl-engine/lib/WebGLLayer.js";import{hasLayerBasedScaleVisibility as M}from"../../../support/layerViewUtils.js";import{TaskPriority as N}from"../../../support/Scheduler.js";import{Yield as P}from"../../../support/Yield.js";class F{constructor(e,t){this.labelingContext=e,this.graphics3DGraphic=t,this.hasGraphics3DResources=!1,this.visible=!1,this.textureAtlasHandles=[],this.textInitialized=!1,this.textRenderers=[],this.textLabelPlacements=[]}}class I{constructor(e,t,n,r,i){this.labelClass=e,this.graphics3DSymbol=t,this.graphics3DCalloutSymbolLayer=n,this.textRenderParameters=r,this.labelFunction=i,this.calloutSymbolLayerIndex=0,this.graphics=new Map,this.scaleVisibility=null}}class L{constructor(e,t,n,r,i,a,o,s){this.layer=t,this.graphics3DCore=n,this.scaleVisibility=r,this.emptySymbolLabelSupported=i,this.elevationInfoOverride=a,this.disablePlacement=o,this.active=s,this.labelClassAbortController=new AbortController,this._labelClassContexts=[],this.graphics=new Map,this.labelsToInitialize=new Map,this.stageLayer=new j(e,{pickable:!0},n.owner.layerViewUid)}destroy(){this.stageLayer.destroy()}get labelClassContexts(){return this._labelClassContexts}setLabelClassContext(e,t){this._labelClassContexts[e]=t}resetLabelClassContext(){this._labelClassContexts.length=0}}let R=class extends t{constructor(e){super(e),this._hudMaterials=new Map,this._calloutMaterials=new Map,this._dirty=!1,this._focusAreasLabelsQueue=new l,this._labels=new Map,this._labelingContexts=[]}setup(){this.dispose(),this.addHandles([u(()=>this.view.state?.camera,()=>this.setDirty()),u(()=>this.view.state?.rasterPixelRatio,()=>this._resetAllLabels()),u(()=>this.view.timeZone,()=>this._resetArcadeLabels()),u(()=>this.view.focusAreasView?.polygons,()=>this._updateFocus()),this.view.resourceController.scheduler.registerTask(N.LABELER,this)]),M()&&this.addHandles(u(()=>this.view.scale,()=>this._updateScaleVisibility())),this._textTextureAtlas=new A({view:this.view})}dispose(){this.removeAllHandles(),this._textTextureAtlas=a(this._textTextureAtlas),this._hudMaterials.clear(),this._calloutMaterials.clear(),this._labelingContexts.length=0,this._labels.clear()}destroy(){this.dispose(),G.graphic=null,G.renderingInfo=null,G.layer=null}_updateFocus(){this._focusAreasLabelsQueue.clear(),this._labelingContexts.forEach(e=>{e.graphics.forEach(t=>{this._focusAreasLabelsQueue.push({graphic3DGraphic:t,labelingContext:e})})})}_activateLabelingContext(e){e.graphics.forEach((t,n)=>{let r=new F(e,t);this._labels.set(n,r),e.labelsToInitialize.set(n,r),t.setVisibilityFlag(16,1,!0)}),e.active=!0}_deactivateLabelingContext(e){e.graphics.forEach((e,t)=>{e.setVisibilityFlag(16,1,!1),this.setLabelGraphicVisibility(e,!1),e.clearLabelGraphics(),this._labels.delete(t)}),e.active=!1}_addLabelTextureToAtlas(e){if(this._textTextureAtlas)for(let t of e.graphics3DGraphic.labelLayers){if(!t.labelClass)continue;let n=e.textRenderers[t.labelClassContextIndex];n&&(e.textureAtlasHandles.push(this._textTextureAtlas.addText(n,e=>B(t.stageObject,e))),z(t.stageObject,n))}}_removeLabelTextureFromAtlas(e){e.textureAtlasHandles.forEach(e=>e.remove()),e.textureAtlasHandles.length=0}get readyToRun(){return this.view.ready&&(this._dirty||this.deconflictor.readyToRun||this._focusAreasLabelsQueue.length>0)}runTask(e){return this._updateLabels(e),this._applyFocusAreasUpdates(e),!this._dirty&&this.deconflictor.readyToRun&&this.deconflictor.runTask(e),P}_updateLabels(e){if(this._dirty){this._dirty=!1;for(let t of this._labelingContexts)if(t.active){if(V(t))this._dirty=!0;else if(H(t.labelClassContexts)){if(t.labelClassContexts===null){this._deactivateLabelingContext(t);continue}this._createLabelClassContext(t),this._dirty=!0}else for(let[n,r]of t.labelsToInitialize)if(this._ensureGraphics3DResources(r)&&(this._labels.set(n,r),this.deconflictor.setDirty(),e.madeProgress()),(r.visible&&r.textInitialized||!r.visible&&r.hasGraphics3DResources)&&(t.labelsToInitialize.delete(n),e.madeProgress()),e.done){this._dirty=!0;break}}this._dirty||this.notifyChange(`updating`)}}_applyFocusAreasUpdates(e){for(;this._focusAreasLabelsQueue.length>0&&!e.done;){e.madeProgress();let{graphic3DGraphic:t,labelingContext:n}=this._focusAreasLabelsQueue.pop();if(t.labelLayers.length===0||!n.active)continue;let r=D(t.graphic.geometry);if(r==null)continue;let i=this.view.focusAreasView?.containsGeometry(r)??!0;t.labelLayers.forEach(e=>{e.stageObject.geometries.some(e=>e.material.parameters.focusAreaStyle==null!==i)&&(this._removeGraphic(n,t),this._addGraphic(n,t),this.setDirty())})}this._focusAreasLabelsQueue.length===0&&(this.notifyChange(`readyToRun`),this.notifyChange(`updating`))}async _createLabelClassContextAsync(e){let t=e.labelClassAbortController?.signal;e.layer.when&&await e.layer.when(),s(t),e.scaleVisibility?.updateScaleRangeActive();let a=e.graphics3DCore,o=a.layer.labelingInfo?.filter(e=>!!e.symbol);o&&o.length!==0&&(await n(o,async(n,o)=>{let c=n.symbol,l=x(a.getOrCreateGraphics3DSymbol(c));if(l==null){i.getLogger(this).error(`Failed to create Graphics3DSymbol for label`);return}await l.load(),s(t);let u=null;_(c)&&c.hasVisibleCallout()&&(u=v(c,a.symbolCreationContext),await u.load(),s(t));let d=await r(g(n,e.layer.fieldsIndex,this.view.spatialReference));if(s(t),d.ok===!0){let r=await this._createTextRenderParameters(l.symbol);s(t);let i=new I(n,l,u,r,d.value);this._updateLabelClassContextVisibility(i),e.setLabelClassContext(o,i)}else i.getLogger(this).error(`Label expression failed to evaluate: ${d.error}`)}),s(t))}async _createLabelClassContext(e){return e.labelClassPromise??(e.labelClassPromise=this._createLabelClassContextAsync(e).catch(t=>{if(c(t))throw t;e.resetLabelClassContext()}).then(()=>{e.labelClassAbortController=null,this.notifyChange(`updating`)}).catch(()=>{}),this.notifyChange(`updating`)),e.labelClassPromise}async _createTextRenderParameters(e){let t=e.symbolLayers.at(0);return t?.type===`text`?k.fromSymbol(t,this.view.state.rasterPixelRatio):null}_destroyLabelClassContext(e){for(let t of e.labelClassContexts)t&&--t.graphics3DSymbol.referenced;let t=e.labelClassAbortController;e.labelClassAbortController=new AbortController,o(t),e.resetLabelClassContext(),e.labelClassPromise=null,this.notifyChange(`updating`)}_createTextSymbolGraphic(e,t,n,r,i,a){if(!this._textTextureAtlas)return null;let o=new C(n,w(n.anchor),T(n.anchor),e.text,p(e.displayWidth,e.displayHeight));return G.graphic=t,G.layer=r,G.renderingInfo=null,i.createLabel(G,o,this._hudMaterials,this._textTextureAtlas,()=>a.placement?.elevationOffset??null)}_createLineCalloutGraphic(e,t,n,r,i){G.graphic=e,G.layer=i;let a=r.screenOffset[0];return G.renderingInfo=new b(null,t,r.translation,r.centerOffset,r.groundDistance,a,r.centerOffsetUnits,r.elevationOffset),n.createGraphics3DGraphic(G,this._calloutMaterials)}_ensureGraphics3DResources(e){if(e.hasGraphics3DResources)return!1;let t=e.graphics3DGraphic;if(t.destroyed)return!1;this._ensureTextTextureResources(e);let n=e.labelingContext,r=n.labelClassContexts;if(H(r)||!n.emptySymbolLabelSupported&&t.layers.length===0)return!1;let i=!1,a=t.graphic,o=n.layer,s=W(n.layer);for(let c=0;c<r.length;c++){let l=e.textRenderers[c],u=e.textLabelPlacements[c],d=r[c];if(l==null||u==null||d==null)continue;let f=d.graphics3DSymbol,p=U(f),m=f.symbolLayers[0];if(!m)continue;m.setElevationInfoOverride(n.elevationInfoOverride);let h=new S(t,p,d.labelClass),g=this._createTextSymbolGraphic(l,a,u,o,m,h);if(g==null)return!1;g.labelClass=d.labelClass,g.labelClassContextIndex=c,t.addLabelGraphic(g,n.stageLayer),this.deconflictor.setPriority(t,d.textRenderParameters?.definition.size??0),t.setVisibilityFlag(16,1,s),t.setVisibilityFlag(16,2,d.scaleVisibility??!0),t.setVisibilityFlag(16,8,!1),M()&&d.graphics.set(a.uid,t),i=!0;let _=d.graphics3DCalloutSymbolLayer;if(_&&u.hasLabelVerticalOffset){_.setElevationInfoOverride(n.elevationInfoOverride);let e=this._createLineCalloutGraphic(a,p,_,u,o);e!=null&&(d.calloutSymbolLayerIndex=t.labelLayers.length,t.addLabelGraphic(e,n.stageLayer))}break}return i&&n.scaleVisibility?.updateGraphicLabelScaleVisibility(t),e.hasGraphics3DResources=!0,!0}_destroyGraphics3DResources(e){let t=e.labelingContext.labelClassContexts;for(let n of e.graphics3DGraphic.labelLayers)n.labelClass!=null&&t[n.labelClassContextIndex].graphics3DSymbol.symbolLayers[0]?.onRemoveGraphic(n);e.graphics3DGraphic.clearLabelGraphics(),e.hasGraphics3DResources=!1}_ensureTextTextureResources(e){if(e.textInitialized)return;let t=e.labelingContext,n=t.labelClassContexts;if(H(n))return;let r=e.graphics3DGraphic.graphic;for(let i=0;i<n.length;i++){let a=n[i];if(e.textRenderers[i]=null,e.textLabelPlacements[i]=null,a?.textRenderParameters==null)continue;let o=a.labelFunction,s;if(o.type===`arcade`)try{let e=o.needsHydrationToEvaluate()?h(r,t.layer,null):r;s=o.evaluate(e,this.view.timeZone)}catch{s=null}else s=o.evaluate(r);if(s==null||s===``||/^\s+$/.test(s))continue;let c=a.graphics3DSymbol;if(!c.symbolLayers[0])continue;let l=e.graphics3DGraphic,u=c.symbol?.type===`label-3d`?c.symbol:null,d=a.labelClass,f=t.disablePlacement,p=new S(l,u,d,f).placement;if(p==null)continue;let m=w(p.anchor),g=E(m);e.textRenderers[i]=new O(s,g,a.textRenderParameters,A.maxSize),e.textLabelPlacements[i]=p}e.textInitialized=!0}_destroyTextTextureResources(e){e.textInitialized=!1,e.textRenderers.length=0,e.textLabelPlacements.length=0}_addGraphic(e,t){let n=t.graphic.uid;if(e.graphics.set(n,t),e.active){let r=new F(e,t);this._labels.set(n,r),e.labelsToInitialize.set(n,r)}this.setDirty(),this.deconflictor.setDirty()}_updateGraphicGeometry(e,t){let n=t.graphic.uid,r=this._labels.get(n);if(!r)return!0;for(let n of r.graphics3DGraphic.labelLayers)if(n.labelClass!=null&&!e.labelClassContexts[n.labelClassContextIndex].graphics3DSymbol.symbolLayers[0].updateGeometry(t.graphic,n))return!1;return this.setDirty(),this.deconflictor.setDirty(),!0}_removeGraphic(e,t){let n=t.graphic.uid,r=this._labels.get(n);e.graphics.delete(n),e.labelClassContexts.forEach(e=>e?.graphics.delete(n)),r&&(this._destroyGraphic(r,n),e.labelsToInitialize.delete(n),this.setDirty(),this.deconflictor.setDirty())}_destroyGraphic(e,t){this._labels.delete(t),e.textureAtlasHandles.length&&this._removeLabelTextureFromAtlas(e),this._destroyTextTextureResources(e),e.hasGraphics3DResources&&this._destroyGraphics3DResources(e)}async _labelingInfoChange(e,t){if(t)for(let n of t){let t=e.graphics.get(n);t&&(this._removeGraphic(e,t),this._addGraphic(e,t))}else return this._visibilityInfoChange(e),this._resetLabels(e),this._createLabelClassContext(e)}_globalPropertyChanged(e,t){for(let n of t.labelClassContexts){if(!n)continue;let r=new Map;t.graphics.forEach(e=>r.set(e.graphic.uid,e)),n.graphics3DSymbol.symbolLayers[0].globalPropertyChanged(e,r,e=>e.labelLayers[0]),n.graphics3DCalloutSymbolLayer&&n.graphics3DCalloutSymbolLayer.globalPropertyChanged(e,r,e=>e.labelLayers[n.calloutSymbolLayerIndex])}}_visibilityInfoChange(e){let t=W(e.layer);t&&!e.active&&this._activateLabelingContext(e),!t&&e.active&&this._deactivateLabelingContext(e),this.setDirty()}_resetAllLabels(){for(let e of this._labelingContexts)this._resetLabels(e)}_resetArcadeLabels(){for(let e of this._labelingContexts)e.labelClassContexts.some(e=>e?.labelFunction.type===`arcade`)&&this._resetLabels(e)}_resetLabels(e){e.graphics.forEach((t,n)=>{let r=this._labels.get(n);r&&(this._destroyGraphic(r,n),r.visible=!1,e.labelsToInitialize.set(n,r))}),this._destroyLabelClassContext(e),this.setDirty(),this.deconflictor.setDirty()}_findLabelingContext(e){for(let t of this._labelingContexts)if(t.graphics3DCore===e)return t;return null}addGraphicsOwner(e,t,n){let r=n?.emptySymbolLabelSupported||!1,i=n?.elevationInfoOverride||null,a=n?.disablePlacement||null;if(this._findLabelingContext(e))return;let o=e.layer,s=new L(this.view.stage,o,e,t,r,i,a,W(o));return this._labelingContexts.push(s),this.setDirty(),{addGraphic:e=>this._addGraphic(s,e),removeGraphic:e=>this._removeGraphic(s,e),updateGraphicGeometry:e=>this._updateGraphicGeometry(s,e),layerLabelsEnabled:()=>W(s.layer),labelingInfoChange:e=>this._labelingInfoChange(s,e),elevationInfoChange:()=>this._globalPropertyChanged(`elevationInfo`,s),screenSizePerspectiveEnabledChanged:()=>this._globalPropertyChanged(`screenSizePerspectiveEnabled`,s),slicePlaneEnabledChange:()=>this._globalPropertyChanged(`slicePlaneEnabled`,s),visibilityInfoChange:()=>this._visibilityInfoChange(s),reset:()=>this._resetLabels(s),remove:()=>this._removeGraphicsOwner(e),setDirty:()=>this.setDirty()}}_removeGraphicsOwner(e){let t=this._findLabelingContext(e);if(!t)return;let n=this._labelingContexts.indexOf(t);this._labelingContexts.splice(n,1),t.graphics.forEach(e=>this._removeGraphic(t,e)),t.destroy(),this.setDirty()}_updateScaleVisibility(){for(let e of this._labelingContexts)if(e.active&&!V(e))for(let t of e.labelClassContexts)this._updateLabelClassContextVisibility(t)}_updateLabelClassContextVisibility(e){if(!e||!M())return;let{labelClass:t,graphics:n}=e,r={minScale:t.minScale,maxScale:t.maxScale},i=m(r,this.view.scale),a=e.scaleVisibility==null||e.scaleVisibility!==i;e.scaleVisibility=i,a&&n.size&&(n.forEach(e=>e.setVisibilityFlag(16,2,i)),this.deconflictor.setDirty(),this.setDirty())}setLabelGraphicVisibility(e,t){let n=e.graphic.uid,r=this._labels.get(n);r&&r.visible!==t&&(t&&!r.textureAtlasHandles.length?(this._addLabelTextureToAtlas(r),r.textInitialized||r.labelingContext.labelsToInitialize.set(n,r)):!t&&r.textureAtlasHandles.length&&this._removeLabelTextureFromAtlas(r),r.visible=t,this.setDirty())}setDirty(){!this._dirty&&this._labelingContexts.length>0&&(this._dirty=!0,this.notifyChange(`updating`))}get updating(){return this._dirty||this._textTextureAtlas?.updating||this.deconflictor.updating||this._labelingContexts.some(e=>V(e))||this._focusAreasLabelsQueue.length>0}get updatingProgress(){if(!this.updating||!this._textTextureAtlas)return 1;let e=this._labelingContexts.length>0?this._labelingContexts.reduce((e,t)=>e+ +!V(t),0)/this._labelingContexts.length:1;return(this._dirty?0:.3)+(this._textTextureAtlas.updating?0:.1)+e*.1+this.deconflictor.updatingProgress*.5}get usedMemory(){return this._textTextureAtlas?.usedMemory??0}get test(){}};e([d({constructOnly:!0})],R.prototype,`view`,void 0),e([d({constructOnly:!0})],R.prototype,`deconflictor`,void 0),e([d()],R.prototype,`_textTextureAtlas`,void 0),e([d({type:Boolean,readOnly:!0})],R.prototype,`updating`,null),R=e([f(`esri.views.3d.layers.graphics.Labeler`)],R);function z(e,t){e.geometries[0].setAttributeData(`size`,[t.displayWidth,t.displayHeight]),e.geometryVertexAttributeUpdated(e.geometries[0],`size`)}function B(e,t){e.geometries[0].setAttributeData(`uvi`,t),e.geometryVertexAttributeUpdated(e.geometries[0],`uvi`,!0)}function V(e){return!!e.labelClassPromise&&!!e.labelClassAbortController}function H(e){return(e?.length??0)===0}function U(e){return e.symbol?.type===`label-3d`?e.symbol:null}function W(e){return!!e.labelsVisible&&!!e.labelingInfo?.some(e=>!!e.symbol)}const G=new y(null,null,null);export{R as Labeler,W as areLabelsVisible};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{copy as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as r}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as i}from"../../../../geometry/projection/projectBuffer.js";import{isDehydratedPoint as a}from"../../../../layers/graphics/dehydratedFeatureUtils.js";import{isSamplePosition as o,getElevationAtPoint as s}from"../../support/ElevationProvider.js";function c(e,t,n,r,a,o,s,c,l,u,d){let f=S[d.mode],p=0;if(!i(e,t,n,r,l.spatialReference,a,c))return;let m,h;if(f?.requiresAlignment(d)?(p=f.applyElevationAlignmentBuffer(r,a,o,s,c,l,u,d),m=o,h=s):(m=r,h=a),i(m,l.spatialReference,h,o,u.spatialReference,s,c))return p}function l(e,t,n,r,i){let c=(a(e)?e.z:o(e)?e.array[e.offset+2]:e[2])||0;switch(n.mode){case`on-the-ground`:{let n=s(t,e,`ground`)??0;i.verticalDistanceToGround=0,i.sampledElevation=n,i.z=n;return}case`relative-to-ground`:{let a=s(t,e,`ground`)??0,o=n.geometryZWithOffset(c,r);i.verticalDistanceToGround=o,i.sampledElevation=a,i.z=o+a;return}case`relative-to-scene`:{let a=s(t,e,`scene`)??0,o=n.geometryZWithOffset(c,r);i.verticalDistanceToGround=o,i.sampledElevation=a,i.z=o+a;return}case`absolute-height`:{let a=n.geometryZWithOffset(c,r),o=s(t,e,`ground`)??0;i.verticalDistanceToGround=a-o,i.sampledElevation=o,i.z=a;return}default:i.z=0;return}}function u(e,t,n,r){return l(e,t,n,r,w),w.z}function d(e,t,n){return t===`on-the-ground`&&n===`on-the-ground`?e.staysOnTheGround:t!==n&&(t===`on-the-ground`||n===`on-the-ground`)?e.onTheGroundChanged:t==null||n==null?e.definedChanged:1}function f(e){return e===`relative-to-ground`||e===`relative-to-scene`}function p(e){return e!==`absolute-height`}function m(t,n,i,a,o){l(n,i,o,a,w),h(t,w.verticalDistanceToGround);let s=w.sampledElevation,c=e(C,t.transformation);return T[0]=n.x,T[1]=n.y,T[2]=w.z,r(n.spatialReference,T,c,a.spatialReference)?t.transformation=c:console.warn(`Could not locate symbol object properly, it might be misplaced`),s}function h(e,t){for(let n=0;n<e.geometries.length;++n){let r=e.geometries[n].getMutableAttribute(`groundDistance`);r&&r.data[0]!==t&&(r.data[0]=t,e.geometryVertexAttributeUpdated(e.geometries[n],`groundDistance`))}}function g(e,t,n,r,i,a){let o=0,s=a.spatialReference;t*=3,r*=3;for(let c=0;c<i;++c){let i=e[t],c=e[t+1],l=e[t+2],u=a.getElevation(i,c,l,s,`ground`)??0;o+=u,n[r]=i,n[r+1]=c,n[r+2]=u,t+=3,r+=3}return o/i}function _(e,t,n,r,i,a,o,s){let c=0,l=s.calculateOffsetRenderUnits(o),u=s.featureExpressionInfoContext,d=a.spatialReference;t*=3,r*=3;for(let o=0;o<i;++o){let i=e[t],o=e[t+1],s=e[t+2],f=a.getElevation(i,o,s,d,`ground`)??0;c+=f,n[r]=i,n[r+1]=o,u==null?n[r+2]=s+f+l:n[r+2]=f+l,t+=3,r+=3}return c/i}function v(e,t,n,r,i,a,o,s){let c=0,l=s.calculateOffsetRenderUnits(o),u=s.featureExpressionInfoContext,d=a.spatialReference;t*=3,r*=3;for(let o=0;o<i;++o){let i=e[t],o=e[t+1],s=e[t+2],f=a.getElevation(i,o,s,d,`scene`)??0;c+=f,n[r]=i,n[r+1]=o,u==null?n[r+2]=s+f+l:n[r+2]=f+l,t+=3,r+=3}return c/i}function y(e){let t=e.meterUnitOffset,n=e.featureExpressionInfoContext;return t!==0||n!=null}function b(e,t,n,r,i,a,o,s){let c=s.calculateOffsetRenderUnits(o),l=s.featureExpressionInfoContext;t*=3,r*=3;for(let a=0;a<i;++a){let i=e[t],a=e[t+1],o=e[t+2];n[r]=i,n[r+1]=a,l==null?n[r+2]=o+c:n[r+2]=c,t+=3,r+=3}return 0}class x{constructor(){this.verticalDistanceToGround=0,this.sampledElevation=0,this.z=0}}const S={"absolute-height":{applyElevationAlignmentBuffer:b,requiresAlignment:y},"on-the-ground":{applyElevationAlignmentBuffer:g,requiresAlignment:()=>!0},"relative-to-ground":{applyElevationAlignmentBuffer:_,requiresAlignment:()=>!0},"relative-to-scene":{applyElevationAlignmentBuffer:v,requiresAlignment:()=>!0}},C=t(),w=new x,T=n();export{x as SampleElevationInfo,m as applyElevationAlignmentForHUD,c as applyPerVertexElevationAlignment,d as elevationModeChangeUpdateType,u as evaluateElevationAlignmentAtPoint,l as evaluateElevationInfoAtPoint,f as needsElevationUpdates2D,p as needsElevationUpdates3D,h as updateVertexPointGroundDistance};
2
+ import{copy as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,normalize as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as a}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as o}from"../../../../geometry/projection/projectBuffer.js";import{isDehydratedPoint as s}from"../../../../layers/graphics/dehydratedFeatureUtils.js";import{isSamplePosition as c,getElevationAtPoint as l}from"../../support/ElevationProvider.js";import{updateObjectVertexField as u,updateVertexFieldVec3f as d,updateVertexFieldFloat as f}from"../../webgl-engine/lib/bufferGeometryUtils.js";function p(e,t,n,r,i,a,s,c,l,u,d){let f=j[d.mode],p=0;if(!o(e,t,n,r,l.spatialReference,i,c))return;let m,h;if(f?.requiresAlignment(d)?(p=f.applyElevationAlignmentBuffer(r,i,a,s,c,l,u,d),m=a,h=s):(m=r,h=i),o(m,l.spatialReference,h,a,u.spatialReference,s,c))return p}function m(e,t,n,r,i){let a=(s(e)?e.z:c(e)?e.array[e.offset+2]:e[2])||0;switch(n.mode){case`on-the-ground`:{let n=l(t,e,`ground`)??0;i.verticalDistanceToGround=0,i.sampledElevation=n,i.z=n;return}case`relative-to-ground`:{let o=l(t,e,`ground`)??0,s=n.geometryZWithOffset(a,r);i.verticalDistanceToGround=s,i.sampledElevation=o,i.z=s+o;return}case`relative-to-scene`:{let o=l(t,e,`scene`)??0,s=n.geometryZWithOffset(a,r);i.verticalDistanceToGround=s,i.sampledElevation=o,i.z=s+o;return}case`absolute-height`:{let o=n.geometryZWithOffset(a,r),s=l(t,e,`ground`)??0;i.verticalDistanceToGround=o-s,i.sampledElevation=s,i.z=o;return}default:i.z=0;return}}function h(e,t,n,r){return m(e,t,n,r,L),L.z}function g(e,t,n){return t===`on-the-ground`&&n===`on-the-ground`?e.staysOnTheGround:t!==n&&(t===`on-the-ground`||n===`on-the-ground`)?e.onTheGroundChanged:t==null||n==null?e.definedChanged:1}function _(e){return e===`relative-to-ground`||e===`relative-to-scene`}function v(e){return e!==`absolute-height`}function y(t,n,r,i,o){m(n,r,o,i,L),w(t,L.verticalDistanceToGround);let s=L.sampledElevation,c=e(M,t.transformation);return R[0]=n.x,R[1]=n.y,R[2]=L.z,a(n.spatialReference,R,c,i.spatialReference)?t.transformation=c:console.warn(`Could not locate symbol object properly, it might be misplaced`),s}function b(e,t,r,i,a){m(t,r,a,i,L),C(e,L.verticalDistanceToGround);let o=L.sampledElevation;return n(P,t.x,t.y,L.z),x(e,P,t.spatialReference,i),o}function x(e,t,n,r){a(n,t,N,r.spatialReference)?S(e,N):console.warn(`Could not locate symbol object properly, it might be misplaced`)}function S(e,t){n(I,t[8],t[9],t[10]),r(I,I);for(let r of e.geometries){let i=r.localOrigin.vec3;n(F,t[12]-i[0],t[13]-i[1],t[14]-i[2]),u(e,d,r,`position`,0,F),u(e,d,r,`normal`,0,I)}}function C(e,t){for(let n of e.geometries)u(e,f,n,`groundDistance`,0,t)}function w(e,t){for(let n=0;n<e.geometries.length;++n){let r=e.geometries[n].getMutableAttribute(`groundDistance`);r&&r.data[0]!==t&&(r.data[0]=t,e.geometryVertexAttributeUpdated(e.geometries[n],`groundDistance`))}}function T(e,t,n,r,i,a){let o=0,s=a.spatialReference;t*=3,r*=3;for(let c=0;c<i;++c){let i=e[t],c=e[t+1],l=e[t+2],u=a.getElevation(i,c,l,s,`ground`)??0;o+=u,n[r]=i,n[r+1]=c,n[r+2]=u,t+=3,r+=3}return o/i}function E(e,t,n,r,i,a,o,s){let c=0,l=s.calculateOffsetRenderUnits(o),u=s.featureExpressionInfoContext,d=a.spatialReference;t*=3,r*=3;for(let o=0;o<i;++o){let i=e[t],o=e[t+1],s=e[t+2],f=a.getElevation(i,o,s,d,`ground`)??0;c+=f,n[r]=i,n[r+1]=o,u==null?n[r+2]=s+f+l:n[r+2]=f+l,t+=3,r+=3}return c/i}function D(e,t,n,r,i,a,o,s){let c=0,l=s.calculateOffsetRenderUnits(o),u=s.featureExpressionInfoContext,d=a.spatialReference;t*=3,r*=3;for(let o=0;o<i;++o){let i=e[t],o=e[t+1],s=e[t+2],f=a.getElevation(i,o,s,d,`scene`)??0;c+=f,n[r]=i,n[r+1]=o,u==null?n[r+2]=s+f+l:n[r+2]=f+l,t+=3,r+=3}return c/i}function O(e){let t=e.meterUnitOffset,n=e.featureExpressionInfoContext;return t!==0||n!=null}function k(e,t,n,r,i,a,o,s){let c=s.calculateOffsetRenderUnits(o),l=s.featureExpressionInfoContext;t*=3,r*=3;for(let a=0;a<i;++a){let i=e[t],a=e[t+1],o=e[t+2];n[r]=i,n[r+1]=a,l==null?n[r+2]=o+c:n[r+2]=c,t+=3,r+=3}return 0}class A{constructor(){this.verticalDistanceToGround=0,this.sampledElevation=0,this.z=0}}const j={"absolute-height":{applyElevationAlignmentBuffer:k,requiresAlignment:O},"on-the-ground":{applyElevationAlignmentBuffer:T,requiresAlignment:()=>!0},"relative-to-ground":{applyElevationAlignmentBuffer:E,requiresAlignment:()=>!0},"relative-to-scene":{applyElevationAlignmentBuffer:D,requiresAlignment:()=>!0}},M=t(),N=t(),P=i(),F=i(),I=i(),L=new A,R=i();export{A as SampleElevationInfo,b as applyBufferElevationAlignmentForHUD,x as applyBufferPointPlacement,S as applyBufferPointTransformation,y as applyElevationAlignmentForHUD,p as applyPerVertexElevationAlignment,g as elevationModeChangeUpdateType,h as evaluateElevationAlignmentAtPoint,m as evaluateElevationInfoAtPoint,_ as needsElevationUpdates2D,v as needsElevationUpdates3D,C as updateBufferPointGroundDistance,w as updateVertexPointGroundDistance};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{fromValues as e,create as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectPointToVector as n}from"../../../../geometry/projection/projectPointToVector.js";import{containsPoint as r}from"../../../../geometry/support/aaBoundingBox.js";import{getPointOnPath as i,getPathLength as a}from"../../../../geometry/support/coordsUtils.js";import{makeDehydratedPoint as o}from"../../../../layers/graphics/dehydratedPoint.js";import{applyElevationAlignmentForHUD as s}from"./elevationAlignmentUtils.js";import{computeCentroid as c}from"./graphicUtils.js";import{Object3D as l}from"../../webgl-engine/lib/Object3D.js";function u(e,t,n,r,i){if(f(e,t))return null;n.localOrigin=h(e,t);let a=new l({geometries:[n],castShadow:!1,layerViewUid:e.layerViewUid,graphicUid:i,usesVerticalDistanceToGround:!0});return{object:a,sampledElevation:s(a,t,e.elevationProvider,e.renderCoordsHelper,r)}}function d(e,t,n,r){return f(t,n)?null:s(e,n,t.elevationProvider,t.renderCoordsHelper,r)}function f(e,t){let i=e.clippingExtent;return i?(n(t,g,e.elevationProvider.spatialReference),!r(i,g)):!1}function p(t,r,i){let a=t.elevationContext,o=i.spatialReference;n(r,g,o),a.centerInElevationSR=e(g[0],g[1],r.hasZ?g[2]:0)}function m(e){switch(e.type){case`point`:return e;case`polygon`:case`extent`:return c(e);case`polyline`:{let t=e.paths[0];if(!t||t.length===0)return null;let n=i(t,a(t)/2);return o(n[0],n[1],n[2],e.spatialReference)}case`mesh`:return e.extent.center}return null}function h(e,t){return n(t,g,e.renderCoordsHelper.spatialReference),e.localOriginFactory.getOrigin(g)}const g=t();export{u as createStageObject,p as extendPointGraphicElevationContext,h as getLocalOriginForPoint,m as placePointOnGeometry,d as updateStageObjectGeometry};
2
+ import{fromValues as e,create as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectPointToVector as n}from"../../../../geometry/projection/projectPointToVector.js";import{containsPoint as r}from"../../../../geometry/support/aaBoundingBox.js";import{getPointOnPath as i,getPathLength as a}from"../../../../geometry/support/coordsUtils.js";import{makeDehydratedPoint as o}from"../../../../layers/graphics/dehydratedPoint.js";import{applyElevationAlignmentForHUD as s,applyBufferElevationAlignmentForHUD as c}from"./elevationAlignmentUtils.js";import{computeCentroid as l}from"./graphicUtils.js";import{BufferObject3D as u}from"../../webgl-engine/lib/BufferObject3D.js";import{Object3D as d}from"../../webgl-engine/lib/Object3D.js";function f(e,t,n,r,i){if(g(e,t))return null;n.localOrigin=y(e,t);let a=new d({geometries:[n],castShadow:!1,layerViewUid:e.layerViewUid,graphicUid:i,usesVerticalDistanceToGround:!0});return{object:a,sampledElevation:s(a,t,e.elevationProvider,e.renderCoordsHelper,r)}}function p(e,t,n,r){return g(t,n)?null:s(e,n,t.elevationProvider,t.renderCoordsHelper,r)}function m(e,t,n,r,i){if(g(e,t))return null;let a=new u({geometries:[n],castShadow:!1,layerViewUid:e.layerViewUid,graphicUid:i});return{object:a,sampledElevation:c(a,t,e.elevationProvider,e.renderCoordsHelper,r)}}function h(e,t,n,r){if(g(t,n))return null;let i=y(t,n);return e.geometries.some(e=>e.localOrigin!==i)?null:c(e,n,t.elevationProvider,t.renderCoordsHelper,r)}function g(e,t){let i=e.clippingExtent;return i?(n(t,b,e.elevationProvider.spatialReference),!r(i,b)):!1}function _(t,r,i){let a=t.elevationContext,o=i.spatialReference;n(r,b,o),a.centerInElevationSR=e(b[0],b[1],r.hasZ?b[2]:0)}function v(e){switch(e.type){case`point`:return e;case`polygon`:case`extent`:return l(e);case`polyline`:{let t=e.paths[0];if(!t||t.length===0)return null;let n=i(t,a(t)/2);return o(n[0],n[1],n[2],e.spatialReference)}case`mesh`:return e.extent.center}return null}function y(e,t){return n(t,b,e.renderCoordsHelper.spatialReference),e.localOriginFactory.getOrigin(b)}const b=t();export{m as createBufferStageObject,f as createStageObject,_ as extendPointGraphicElevationContext,y as getLocalOriginForPoint,v as placePointOnGeometry,h as updateBufferStageObjectGeometry,p as updateStageObjectGeometry};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"../../../../core/has.js";import{estimateAttributesMemory as e}from"../../../../core/memoryEstimations.js";import{signal as t}from"../../../../core/signal.js";import{estimateGeometryMemory as n}from"../../../../layers/graphics/dehydratedFeatures.js";class r{constructor(){this._payloads=new Map,this._usedMemory=t(0),this._duplicatedMemory=t(0),this._referenceCount=t(0)}get usedMemory(){return this._usedMemory.value}get usedMemoryPerFeature(){return this._referenceCount.value>0?this._duplicatedMemory.value/this._referenceCount.value:0}ref(t){this._duplicatedMemory.value+=this._refPayload(t.geometry,n)+this._refPayload(t.attributes,e),this._referenceCount.value++}unref(e){this._duplicatedMemory.value-=this._unrefPayload(e.geometry)+this._unrefPayload(e.attributes),this._referenceCount.value--}_refPayload(e,t){if(e==null)return 0;let n=this._payloads.get(e);if(n)return n.count++,n.size;let r=t(e);return this._payloads.set(e,new i(r)),this._usedMemory.value+=r,r}_unrefPayload(e){if(e==null)return 0;let t=this._payloads.get(e);return--t.count===0&&(this._payloads.delete(e),this._usedMemory.value-=t.size),t.size}get test(){}}class i{constructor(e){this.size=e,this.count=1}}export{r as FeatureMemory};
2
+ import"../../../../core/has.js";import{getOrCreateMapValue as e}from"../../../../core/MapUtils.js";import{estimateAttributesMemory as t}from"../../../../core/memoryEstimations.js";import{signal as n}from"../../../../core/signal.js";import{estimateGeometryMemory as r}from"../../../../layers/graphics/dehydratedFeatures.js";class i{constructor(e=()=>void 0){this._getGeometryKey=e,this._payloads=new Map,this._geometries=new Map,this._usedMemory=n(0),this._duplicatedMemory=n(0),this._referenceCount=n(0)}findGeometry(e,t){if(e===void 0)return;let n=this._geometries.get(e);if(n){for(let e of n)if(t(e))return e}}get usedMemory(){return this._usedMemory.value}get usedMemoryPerFeature(){return this._referenceCount.value>0?this._duplicatedMemory.value/this._referenceCount.value:0}ref(n,i,a=!0){let o;a&&n.geometry&&!this._payloads.has(n.geometry)&&(o=this._getGeometryKey(n.geometry,i),o!==void 0&&e(this._geometries,o,()=>new Set).add(n.geometry)),this._duplicatedMemory.value+=this._refPayload(n.geometry,r,o)+this._refPayload(n.attributes,t),this._referenceCount.value++}unref(e){let t=e.geometry,n=t&&this._payloads.get(t);if(t&&n?.count===1&&n.geometryKey!==void 0){let e=this._geometries.get(n.geometryKey);e.delete(t),e.size===0&&this._geometries.delete(n.geometryKey)}this._duplicatedMemory.value-=this._unrefPayload(e.geometry)+this._unrefPayload(e.attributes),this._referenceCount.value--}_refPayload(e,t,n){if(e==null)return 0;let r=this._payloads.get(e);if(r)return r.count++,r.size;let i=t(e);return this._payloads.set(e,new a(i,n)),this._usedMemory.value+=i,i}_unrefPayload(e){if(e==null)return 0;let t=this._payloads.get(e);return--t.count===0&&(this._payloads.delete(e),this._usedMemory.value-=t.size),t.size}get test(){}}class a{constructor(e,t){this.size=e,this.geometryKey=t,this.count=1}}export{i as FeatureMemory};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{shuffle as e}from"../../../../core/arrayUtils.js";import{baseObjectMemory as t}from"../../../../core/memoryEstimations.js";import{signal as n}from"../../../../core/signal.js";import{create as r,diameter as i}from"../../../../geometry/support/aaBoundingBox.js";import{create as a,fromExtent as o,intersects as s,copy as c,positiveInfinity as l,intersection as u}from"../../../../geometry/support/aaBoundingRect.js";import{numVertices as d,estimateSize as f,getObjectId as p,computeAABB as m}from"../../../../layers/graphics/dehydratedFeatures.js";import{computeMaxZ as h}from"../graphics/graphicUtils.js";import{SampledGeometryMaxDistanceRatio as g}from"./SampledGeometryMaxDistanceRatio.js";class _{constructor(e,t){this.descriptor=e,this._memory=t,this._numVertices=0,this.exceededTransferLimit=n(!1),this._fetchFailed=n(!1),this._sorted=!1,this._numFeatures=n(v),this._emptyFeatureRatio=n(0),this._estimatedSize=-1,this._sampledDensityEstimate=-1,this._displayingFeatures=null,this.alive=!0,this.filtered=!1,this._features=null,this._featuresLength=n(0),this._featureLimit=n(0),this._fetchStatus=0,this.fetchInformation=n(``),this.fetchingResolution=this.displayingResolution=e.resolution}get featuresMissing(){return this.fetchFailed||(this.hasPreciseFeatureCount?this._featuresLength.value<this.numFeatures:this.exceededTransferLimit.value)}get showsAllFeatures(){return!this.fetchFailed&&this.displayingFeatures!=null&&(this.hasPreciseFeatureCount?this.displayingFeatures.length===this.numFeatures:!this.exceededTransferLimit.value)}get missingAttributes(){return this._missingAttributes}get fetchFailed(){return this._fetchFailed.value}set fetchFailed(e){this._fetchFailed.value=e}get displayingFeatures(){return this._displayingFeatures}set displayingFeatures(e){this._displayingFeatures=e,this.extentIncludingBorrowedFeatures=null}get perTileMaximumNumberOfFeaturesExceeded(){let e=this.isFetched&&this.featuresMissing;return!this.filtered&&(e||this.hasFeatureLimit)}get features(){return this._features}get featureLimit(){return this._featureLimit.value}set featureLimit(e){this._featureLimit.value=e}get hasFeatureLimit(){return this.featureLimit!==this._featuresLength.value}get availableFields(){return this._availableFields}setFeatures(e,t,n,r){this._replaceFeatures(e),this._availableFields=n,this._featuresLength.value=e?.length??0,this._sorted=!1,this._estimatedSize=-1,this._sampledDensityEstimate=-1,this._missingAttributes=r,e&&e.length>0?(this._emptyFeatureRatio.value=t/(e.length+t),this._numVertices=e.reduce((e,t)=>e+d(t.geometry),0)):(this._emptyFeatureRatio.value=0,this._numVertices=0)}computeZQuantizationFactor(){if(this._features&&this._features.length>0){let e=this._features.reduce((e,{geometry:t})=>Math.max(e,h(t)??0),0);return Math.floor(e/this.descriptor.planetRadius)+1}return 1}get emptyFeatureRatio(){return this._emptyFeatureRatio.value}get numFeatures(){return this.hasPreciseFeatureCount?this._numFeatures.value:this._features?this._featuresLength.value:0}set numFeatures(e){this._numFeatures.value=e}get hasPreciseFeatureCount(){return this._numFeatures.value>v}get needsFeatureCount(){return this._numFeatures.value===v}get numVertices(){return this._numVertices}get id(){return this.descriptor.id}get estimatedSize(){return this.updateEstimates(),this._estimatedSize}get sampledDensityEstimate(){return this._sampledDensityEstimate}updateEstimates(){if(this._estimatedSize<0||this._sampledDensityEstimate<0){this._estimatedSize=0,this._sampledDensityEstimate=0;let e=Math.floor(Math.sqrt(S));if(this._features){let t=null,n=new g(S,w*this.fetchingResolution),r=this._features.length;for(let i=0;i<r;++i){let a=this._features[i],o=f(a);if(this._estimatedSize+=o,!n.done){let o=r-i,s=Math.ceil(o/Math.max(1,Math.floor(Math.sqrt(n.numRemainingSamples))));if(i%s===0){let r=Math.max(Math.floor(n.numRemainingSamples/o),e);n.sampleGeometry(a.geometry,t,r)}}t=a.geometry}this._sampledDensityEstimate=n.numSamples>=C?n.ratio:0}return!0}return!1}get fetchStatus(){return this._fetchStatus}requestFetch(){this._fetchStatus=0}requestRefetch(){this._fetchStatus=1}startFetch(){this._fetchStatus=this.needsRefetch?3:2}fetchDone(e){this._fetchStatus=e}get isFetching(){return this._fetchStatus===2||this._fetchStatus===3}get isRefetching(){return this._fetchStatus===3}get needsFetch(){return this._fetchStatus===0||this._fetchStatus===1}get needsRefetch(){return this._fetchStatus===1}get isFetched(){return this._fetchStatus===4||this._fetchStatus===5}isFullyFetched(e){return!!this.features&&(this.features.length>=e||this.fetchStatus===5)}resetFetching(){this._fetchStatus=+!!this.isRefetching}get needsDisplayUpdate(){return!!this._features&&!x(this._features,this.displayingFeatures,this.featureLimit)}intersects(e){return e==null||!this.descriptor.extent||(o(e,T),s(this.descriptor.extent,T))}intersectionIncludingBorrowed(e,t){let n=this.extentIncludingBorrowedFeatures==null?this.descriptor.extent:this.extentIncludingBorrowedFeatures;return!e&&!n?(c(t,l),t):(e==null?c(t,n):(o(e,t),u(t,n,t)),t)}_shuffle(t){this._features?.sort((e,n)=>p(e,t)-p(n,t)),e(this._features,16438)}_sortBySize(e){this._features?.sort((t,n)=>i(m(n.geometry,E))-i(m(t.geometry,E))||p(t,e)-p(n,e))}reduceFeatures(e,t,n,r){if(e<=0)return!1;if(!this._features)return this.featureLimit=0,!1;let i=!1;this.featureLimit=Math.ceil(this.numFeatures*e),this.featureLimit>this._features.length&&this._fetchStatus===4&&this._features.length>0&&(this._fetchStatus=1,i=!0),!this._sorted&&e<1&&(r===1?this._shuffle(n):this._sortBySize(n),this._sorted=!0);let a=Math.max(this.featureLimit,Math.ceil(t*this.numFeatures));if(this._features.length>a){for(let e=a;e<this._features.length;e++)this._memory.unref(this._features[e]);this._features.length=this._featuresLength.value=a,this._estimatedSize=-1,this.exceededTransferLimit.value=!1,this._fetchStatus===5&&(this._fetchStatus=4)}return i}get cache(){return new b(this,this._features,this._numFeatures.value,this._emptyFeatureRatio.value)}set cache(e){this._replaceFeatures(e.features),this.requestController=null,this._availableFields=e.availableFields,this._featuresLength.value=e.features?.length??0,this._numFeatures.value=e.numFeatures,this._emptyFeatureRatio.value=e.emptyFeatureRatio,this._fetchStatus=e.fetchStatus,this.exceededTransferLimit.value=e.exceededTransferLimit,this._estimatedSize=-1,this._sampledDensityEstimate=-1,this.fetchInformation.value=e.fetchInformation}_replaceFeatures(e){for(let t of e??[])this._memory.ref(t);for(let e of this._features??[])this._memory.unref(e);this._features=e}}const v=-1,y=-2;class b{constructor(e,n,r,i){this.features=n,this.numFeatures=r,this.emptyFeatureRatio=i,this.usedMemory=t+e.estimatedSize,this.resolution=e.displayingResolution,this.availableFields=e.availableFields,this.fetchStatus=e.fetchStatus,this.exceededTransferLimit=e.exceededTransferLimit.value,this.fetchInformation=e.fetchInformation.value}}function x(e,t,n){if(t==null||e==null||n!==t.length||n>e.length)return!1;for(let r=0;r<n;++r)if(e[r]!==t[r])return!1;return!0}const S=150,C=100,w=2,T=a(),E=r();export{_ as FeatureTile,b as FeatureTileCacheItem,y as failedFeatureCount};
2
+ import{shuffle as e}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import{baseObjectMemory as t}from"../../../../core/memoryEstimations.js";import{signal as n}from"../../../../core/signal.js";import{create as r,diameter as i}from"../../../../geometry/support/aaBoundingBox.js";import{create as a,fromExtent as o,intersects as s,copy as c,positiveInfinity as l,intersection as u}from"../../../../geometry/support/aaBoundingRect.js";import{numVertices as d,estimateSize as f,getObjectId as p,computeAABB as m}from"../../../../layers/graphics/dehydratedFeatures.js";import{computeMaxZ as h}from"../graphics/graphicUtils.js";import{SampledGeometryMaxDistanceRatio as g}from"./SampledGeometryMaxDistanceRatio.js";class _{constructor(e,t){this.descriptor=e,this._memory=t,this._numVertices=0,this.exceededTransferLimit=n(!1),this._fetchFailed=n(!1),this._sorted=!1,this._numFeatures=n(v),this._emptyFeatureRatio=n(0),this._estimatedSize=-1,this._sampledDensityEstimate=-1,this._displayingFeatures=null,this.alive=!0,this.filtered=!1,this._features=null,this._featuresLength=n(0),this._featureLimit=n(0),this._fetchStatus=0,this.fetchInformation=n(``),this.fetchingResolution=this.displayingResolution=e.resolution}get featuresMissing(){return this.fetchFailed||(this.hasPreciseFeatureCount?this._featuresLength.value<this.numFeatures:this.exceededTransferLimit.value)}get showsAllFeatures(){return!this.fetchFailed&&this.displayingFeatures!=null&&(this.hasPreciseFeatureCount?this.displayingFeatures.length===this.numFeatures:!this.exceededTransferLimit.value)}get missingAttributes(){return this._missingAttributes}get fetchFailed(){return this._fetchFailed.value}set fetchFailed(e){this._fetchFailed.value=e}get displayingFeatures(){return this._displayingFeatures}set displayingFeatures(e){this._displayingFeatures=e,this.extentIncludingBorrowedFeatures=null}get perTileMaximumNumberOfFeaturesExceeded(){let e=this.isFetched&&this.featuresMissing;return!this.filtered&&(e||this.hasFeatureLimit)}get features(){return this._features}get featureLimit(){return this._featureLimit.value}set featureLimit(e){this._featureLimit.value=e}get hasFeatureLimit(){return this.featureLimit!==this._featuresLength.value}get availableFields(){return this._availableFields}setFeatures(e,t,n,r,i=this.fetchingResolution,a=!0){this._replaceFeatures(e,i,a),this._availableFields=n,this._featuresLength.value=e?.length??0,this._sorted=!1,this._estimatedSize=-1,this._sampledDensityEstimate=-1,this._missingAttributes=r,e&&e.length>0?(this._emptyFeatureRatio.value=t/(e.length+t),this._numVertices=e.reduce((e,t)=>e+d(t.geometry),0)):(this._emptyFeatureRatio.value=0,this._numVertices=0)}computeZQuantizationFactor(){if(this._features&&this._features.length>0){let e=this._features.reduce((e,{geometry:t})=>Math.max(e,h(t)??0),0);return Math.floor(e/this.descriptor.planetRadius)+1}return 1}get emptyFeatureRatio(){return this._emptyFeatureRatio.value}get numFeatures(){return this.hasPreciseFeatureCount?this._numFeatures.value:this._features?this._featuresLength.value:0}set numFeatures(e){this._numFeatures.value=e}get hasPreciseFeatureCount(){return this._numFeatures.value>v}get needsFeatureCount(){return this._numFeatures.value===v}get numVertices(){return this._numVertices}get id(){return this.descriptor.id}get estimatedSize(){return this.updateEstimates(),this._estimatedSize}get sampledDensityEstimate(){return this._sampledDensityEstimate}updateEstimates(){if(this._estimatedSize<0||this._sampledDensityEstimate<0){this._estimatedSize=0,this._sampledDensityEstimate=0;let e=Math.floor(Math.sqrt(S));if(this._features){let t=null,n=new g(S,has(`featurelayer-snapping-density-max-distance`)*this.fetchingResolution),r=this._features.length;for(let i=0;i<r;++i){let a=this._features[i],o=f(a);if(this._estimatedSize+=o,!n.done){let o=r-i,s=Math.ceil(o/Math.max(1,Math.floor(Math.sqrt(n.numRemainingSamples))));if(i%s===0){let r=Math.max(Math.floor(n.numRemainingSamples/o),e);n.sampleGeometry(a.geometry,t,r)}}t=a.geometry}this._sampledDensityEstimate=n.numSamples>=C?n.ratio:0}return!0}return!1}get fetchStatus(){return this._fetchStatus}requestFetch(){this._fetchStatus=0}requestRefetch(){this._fetchStatus=1}startFetch(){this._fetchStatus=this.needsRefetch?3:2}fetchDone(e){this._fetchStatus=e}get isFetching(){return this._fetchStatus===2||this._fetchStatus===3}get isRefetching(){return this._fetchStatus===3}get needsFetch(){return this._fetchStatus===0||this._fetchStatus===1}get needsRefetch(){return this._fetchStatus===1}get isFetched(){return this._fetchStatus===4||this._fetchStatus===5}isFullyFetched(e){return!!this.features&&(this.features.length>=e||this.fetchStatus===5)}resetFetching(){this._fetchStatus=+!!this.isRefetching}get needsDisplayUpdate(){return!!this._features&&!x(this._features,this.displayingFeatures,this.featureLimit)}intersects(e){return e==null||!this.descriptor.extent||(o(e,w),s(this.descriptor.extent,w))}intersectionIncludingBorrowed(e,t){let n=this.extentIncludingBorrowedFeatures==null?this.descriptor.extent:this.extentIncludingBorrowedFeatures;return!e&&!n?(c(t,l),t):(e==null?c(t,n):(o(e,t),u(t,n,t)),t)}_shuffle(t){this._features?.sort((e,n)=>p(e,t)-p(n,t)),e(this._features,16438)}_sortBySize(e){this._features?.sort((t,n)=>i(m(n.geometry,T))-i(m(t.geometry,T))||p(t,e)-p(n,e))}reduceFeatures(e,t,n,r){if(e<=0)return!1;if(!this._features)return this.featureLimit=0,!1;let i=!1;this.featureLimit=Math.ceil(this.numFeatures*e),this.featureLimit>this._features.length&&this._fetchStatus===4&&this._features.length>0&&(this._fetchStatus=1,i=!0),!this._sorted&&e<1&&(r===1?this._shuffle(n):this._sortBySize(n),this._sorted=!0);let a=Math.max(this.featureLimit,Math.ceil(t*this.numFeatures));if(this._features.length>a){for(let e=a;e<this._features.length;e++)this._memory.unref(this._features[e]);this._features.length=this._featuresLength.value=a,this._estimatedSize=-1,this.exceededTransferLimit.value=!1,this._fetchStatus===5&&(this._fetchStatus=4)}return i}get cache(){return new b(this,this._features,this._numFeatures.value,this._emptyFeatureRatio.value)}set cache(e){this._replaceFeatures(e.features,e.resolution),this.requestController=null,this._availableFields=e.availableFields,this._featuresLength.value=e.features?.length??0,this._numFeatures.value=e.numFeatures,this._emptyFeatureRatio.value=e.emptyFeatureRatio,this._fetchStatus=e.fetchStatus,this.exceededTransferLimit.value=e.exceededTransferLimit,this._estimatedSize=-1,this._sampledDensityEstimate=-1,this.fetchInformation.value=e.fetchInformation}_replaceFeatures(e,t,n=!0){for(let r of e??[])this._memory.ref(r,t,n);for(let e of this._features??[])this._memory.unref(e);this._features=e}}const v=-1,y=-2;class b{constructor(e,n,r,i){this.features=n,this.numFeatures=r,this.emptyFeatureRatio=i,this.usedMemory=t+e.estimatedSize,this.resolution=e.displayingResolution,this.availableFields=e.availableFields,this.fetchStatus=e.fetchStatus,this.exceededTransferLimit=e.exceededTransferLimit.value,this.fetchInformation=e.fetchInformation.value}}function x(e,t,n){if(t==null||e==null||n!==t.length||n>e.length)return!1;for(let r=0;r<n;++r)if(e[r]!==t[r])return!1;return!0}const S=150,C=100,w=a(),T=r();export{_ as FeatureTile,b as FeatureTileCacheItem,y as failedFeatureCount};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{filterInPlace as n}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import r from"../../../../core/Logger.js";import{getOrCreateMapValue as i}from"../../../../core/MapUtils.js";import{isAbortError as a,throwIfAborted as o}from"../../../../core/promiseUtils.js";import s from"../../../../core/ReactiveMap.js";import{on as c,watch as l}from"../../../../core/reactiveUtils.js";import{schedule as u}from"../../../../core/scheduling.js";import{signal as d}from"../../../../core/signal.js";import{sqlAnd as f}from"../../../../core/sql.js";import{property as p,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{getEpsilon as h}from"../../../../core/libs/gl-matrix-2/math/common.js";import{create as g,equals as _,clone as v,expand as y,toExtent as b,width as x,height as S}from"../../../../geometry/support/aaBoundingRect.js";import{getObjectId as C,hasVertices as w,computeAABR as T}from"../../../../layers/graphics/dehydratedFeatures.js";import E from"../../../../rest/support/QuantizationParameters.js";import D from"../../../../rest/support/Query.js";import{FeatureMemory as O}from"./FeatureMemory.js";import{MultiFeatureReference as k,SingleFeatureReference as A}from"./featureReference.js";import{failedFeatureCount as j,FeatureTile as M}from"./FeatureTile.js";import{virtualDisplayFilterHighlightTileId as N,virtualSnapshotTileId as P}from"./FeatureTileDescriptor.js";import{tilesAreRelated as F}from"../../terrain/tileUtils.js";import{ImmediateTask as I,TaskPriority as L}from"../../../support/Scheduler.js";let R=class extends t{set maximumNumberOfFeatures(e){e||=1/0;let t=this._get(`maximumNumberOfFeatures`);e===t||e<1||(this._set(`maximumNumberOfFeatures`,e),this._maximumFeaturesUpdated(t,e))}set memoryFactor(e){this.memoryFactor!==e&&(this._set(`memoryFactor`,e),this._setDirty())}set lodFactor(e){this.lodFactor!==e&&(this._set(`lodFactor`,e),this._supportsResolution&&this.refetch())}get useTileCount(){return this._useTileCount&&this.context.query.queryFeatureCount!=null}set useTileCount(e){this._useTileCount=e,this.notifyChange(`useTileCount`)}get updating(){return this._dirty||!!this._pendingEdits||this._isFetching||(this.tileDescriptors?.updating??!1)}get readyToRun(){return this._dirty}get usedMemory(){return this._memory.usedMemory}get usedMemoryPerFeature(){return this._memory.usedMemoryPerFeature}get totalVertices(){let e=0;return this._featureTiles.forEach(t=>e+=t.numVertices),e}get totalFeatures(){let e=0;return this._featureTiles.forEach(t=>e+=t.numFeatures),e}get showsAllFeatures(){if(this._paused||this.dataUpdating)return!1;for(let e of this._featureTiles.values())if(!this.hasFullGeometries&&e.emptyFeatureRatio!==0||!e.showsAllFeatures)return!1;return!0}get hasFullGeometries(){return!this._supportsResolution||this.tileDescriptors?.some(z)||!this.context.capabilities.supportsQuantization&&this.context.geometryType!==`polyline`}set filterExtent(e){if(e!=null&&this.context.tilingScheme&&!e.spatialReference.equals(this.context.tilingScheme.spatialReference)){r.getLogger(this).error(`#filterExtent=`,`extent needs to be in the same spatial reference as the tiling scheme`);return}let t=this._get(`filterExtent`);if(t===e||t!=null&&e&&t.equals(e))return;let n=e==null?null:e.clone();this._set(`filterExtent`,n),this._reclip(n,t)}_updateTileZQuantization(e){if(this.context.viewingMode===1){let t=e.computeZQuantizationFactor();this._zQuantizationFactor.value<t&&(this._zQuantizationFactor.value=t)}}get _tileZQuantization(){return this.context.isDraped?1:this._zQuantizationFactor.value}constructor(e){super(e),this._useTileCount=!1,this.dataUpdating=!1,this.updatingTotal=0,this.updatingRemaining=0,this.expectedFeatureDiff=0,this.maximumNumberOfFeaturesExceeded=!1,this._fullRatio=1,this._farRatio=1,this._zQuantizationFactor=d(1),this._changes={updates:{adds:[],removes:[]},adds:[],removes:[]},this._featureTiles=new s,this._displayingFeatureReferences=new Map,this._numDisplayingFeatureReferences=0,this._memory=new O,this._dirty=!1,this._suspended=!0,this._pendingEdits=null,this._applyEditsTilesUpdated=!1,this.snappingComplexityExceeded=!0,this._isFetching=!1;let t=e.context;this._frameTask=t.scheduler?.registerTask(L.FEATURE_TILE_FETCHER,this)??I,this.FeatureReferenceClass=t.capabilities.supportsMultipleResolutions?k:A,this._objectIdField=t.objectIdField}initialize(){this.addHandles([c(()=>this.tileDescriptors,`change`,()=>this._setDirty(),{onListenerAdd:()=>this._setDirty(),onListenerRemove:()=>this._setDirty()}),l(()=>this._tileZQuantization,()=>this.refetch())]),this._setDirty()}destroy(){this._frameTask.remove(),this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._removeTile(e)}),this._featureTiles.clear(),this._displayingFeatureReferences.clear(),this._pendingEdits?.controller.abort(),this._pendingEdits=null}get _paused(){return this._suspended||!!this._pendingEdits}restart(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._clearTile(e),this._resetFetchTile(e)}),this.context.memoryCache!=null&&this.context.memoryCache.clear(),this._setDirty()}refetch(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._resetFetchTile(e)}),this.context.memoryCache!=null&&this.context.memoryCache.clear(),this._setDirty()}refetchDisplayFilterHighlightTile(){let e=this._featureTiles.get(N);e&&(this._cancelFetchTile(e),this._resetFetchTile(e),this._setDirty())}suspend(){this._suspended||(this._suspended=!0,this._pause(),this._setDirty())}resume(){this._suspended&&(this._suspended=!1,this._unpause())}getMissingAttributesForFeature(e){for(let t of this._featureTiles.values()){let n=t.missingAttributes?.get(e);if(n!=null)return n}}_pause(){this._paused&&(this._featureTiles.forEach(e=>this._cancelFetchTile(e)),this._updated())}_unpause(){this._paused||this._setDirty()}get availableFields(){let e=null;return this._featureTiles.forEach(t=>{t.displayingFeatures!=null&&t.displayingFeatures.length!==0&&(e==null?e=new Set(t.availableFields):e.forEach(n=>{t.availableFields?.has(n)||e.delete(n)}))}),e??new Set}applyEdits(e){this._pendingEdits||(this._pendingEdits={edits:Promise.resolve(),count:0,controller:new AbortController},this._pause());let t=this._pendingEdits;t.count++;let n=t.edits.then(()=>e.result.catch(e=>{if(a(e))throw e;return null}).then(e=>e&&(this._applyEditsDeleteFeatures(e.deletedFeatures),this._applyEditsAddUpdateFeatures(e.addedFeatures,e.updatedFeatures,t.controller.signal).then(()=>e))).then(e=>(--t.count===0&&(this._pendingEdits===t&&(this._pendingEdits=null),this.context.memoryCache!=null&&this.context.memoryCache.clear(),this._applyEditsTilesUpdated=!1,this._unpause()),e)));return t.edits=n,this._updated(),n}_applyEditsDeleteFeatures(e){if(e.length===0)return;let t=this.context.globalIdField,n=t&&this.availableFields.has(t),i=new Set,a=this._objectIdField;e.forEach(({objectId:e,globalId:o})=>{(!e||e<0)&&t&&o&&(n||r.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected in the view`),e=this._objectIdFromGlobalId(o,a,t)),e!=null&&e>=0&&i.add(e)}),this._featureTiles.forEach(e=>{if(!e.features)return;let t=e.features.filter(e=>!i.has(C(e,this._objectIdField)));t.length!==e.features.length&&(this._applyEditsTileUpdated(),e.setFeatures(t,0,e.availableFields,e.missingAttributes),this._updateTileZQuantization(e),this._invalidateCounts())})}_objectIdFromGlobalId(e,t,n){if(e==null)return null;let r=this.features.find(t=>t.attributes?.[n]===e);return r?C(r,t):null}async _applyEditsAddUpdateFeatures(e,t,n){let{objectIdField:i,globalIdField:a}=this.context,o=a&&this.availableFields.has(a),s=new Set,c=new Set;for(let t of e){let e=t.objectId;e!=null&&s.add(e)}for(let{objectId:e,globalId:n}of t){let t=e;(t==null||t<0)&&a&&(o||r.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${a} to be included the layer's outFields for updates to be reflected in the view`),t=this._objectIdFromGlobalId(n,i,a)),t!=null&&t>=0&&(s.add(t),c.add(t))}if(s.size===0)return;let l=[];this._featureTiles.forEach(e=>{let t=this._applyEditsAddUpdateTile(e,s,c,n);l.push(t)}),this._updated(),await Promise.allSettled(l)}async _applyEditsAddUpdateTile(e,t,n,r){if(!e.features)return;e.fetchingResolution=e.descriptor.resolution;let i=this._createQuery(e);i.resultType=void 0,i.cacheHint=!1,i.objectIds=Array.from(t);let a=await this._queryFeatures(i,r),o=null;if(n.size>0){let t=e.features.filter(e=>!n.has(C(e,this._objectIdField)));t.length!==e.features.length&&(o=t)}if(a.features.length>0){o||=e.features.slice();for(let e of a.features)o.push(e)}o&&(e.hasPreciseFeatureCount&&(e.numFeatures=Math.max(e.numFeatures,o.length)),this._applyEditsTileUpdated(),e.setFeatures(o,0,G(e.availableFields,a.fields),K(e.missingAttributes,a.missingAttributes)),this._updateTileZQuantization(e),this._invalidateCounts())}_applyEditsTileUpdated(){this._applyEditsTilesUpdated||(this._applyEditsTilesUpdated=!0,this._updated())}_queryFeatures(e,t){return this.context.query.queryFeaturesDehydrated(e,{signal:t,timeout:Z})}_setDirty(){this._dirty=!0,this._updated()}runTask(e){let t=this._frameTask.processQueue(e);if(!this._dirty||!this.initialized)return t;this._dirty=!1;let n=this._featureTilesArray;if(this._markTilesNotAlive(n),!e.run(()=>this._addTiles(n,e))||!e.run(()=>this._filterExtentTiles(n,e))||!e.run(()=>this._removeTiles(n,e))||e.done){this._setDirty();return}let r=this._sortTiles(n);(!e.run(()=>this._showTiles(r,e))||!e.run(()=>this._fetchTiles(r,e))||!e.run(()=>this._updateMemoryEstimates(r,e)))&&this._setDirty(),this._updated(),this.updating||(this._updateMaximumNumberOfFeaturesExceeded(),this._updateSnappingComplexityExceeded(r))}_updateSnappingComplexityExceeded(e){let t=ee;for(let n of e){if(z(n)||t<=0)break;if(!B(n)&&(t--,n.sampledDensityEstimate>$)){this.snappingComplexityExceeded=!0;return}}this.snappingComplexityExceeded=this._featureTiles.size===0}_markTilesNotAlive(e){for(let t of e)t.alive=!1}_addTiles(e,t){return this._suspended||!this.tileDescriptors?!1:(this.tileDescriptors.forEach(n=>{let r=this._featureTiles.get(n.id);r?r.alive=!0:t.done||(e.push(this._addTile(n)),t.madeProgress())}),t.hasProgressed)}_filterExtentTiles(e,t){for(let n of e){if(t.done)break;n.alive&&(n.filtered=!n.intersects(this.filterExtent),n.filtered&&(this._clearTile(n),t.madeProgress()))}return t.hasProgressed}_removeTiles(e,t){for(let n=e.length-1;n>=0&&!t.done;n--){let r=e[n];r.alive||(this._removeTile(r),n!==e.length-1&&(e[n]=e[e.length-1]),e.pop(),t.madeProgress())}return t.hasProgressed}_sortTiles(e){return e.sort((e,t)=>e.descriptor.loadPriority-t.descriptor.loadPriority),e}_showTiles(e,t){let n=this._updateRatio(e),r=e=>{let t=this._fullRatio<1?n(e)*this._farRatio:1;e.reduceFeatures(t,this.memoryFactor,this._objectIdField,this._reduceMode)&&this._setDirty();let{numFeatures:r,fetchingResolution:i,descriptor:a,isFetched:o}=e;return this._supportsResolution&&r>0&&i!==a.resolution&&o&&(e.requestRefetch(),this._setDirty()),this._showTile(e)};for(let n of e)if(!t.run(()=>r(n))){this._setDirty();break}return t.hasProgressed}_fetchTiles(e,t){if(this._paused)return!1;let n=!1;for(let r of e){if(!r.needsFetch)continue;let e=this.context.memoryCache==null?null:this.context.memoryCache.pop(r.id);if(e?.resolution===r.displayingResolution)r.cache=e,r.numFeatures&&this._notifyDataUpdating(),this._setDirty(),this._scheduleUpdated(),t.madeProgress();else{if(this._needsNumFeatures(r)){let e=new AbortController,i=this._fetchTileCount(r,e.signal);this._handleRequest(r,i,e,()=>r.resetFetching(),()=>r.numFeatures=j),n=!0,t.madeProgress()}if(t.done)return!0}}if(n)return t.hasProgressed;for(let n of e){if(!n.needsFetch)continue;let e=new AbortController,i=this._fetchTile(n,e.signal);if(this._handleRequest(n,i,e,e=>n.fetchDone(e),e=>{n.fetchFailed=!0,this.context.logFetchError(r.getLogger(this),e)}),t.madeProgress(),t.done)return!0}return t.hasProgressed}_updateMemoryEstimates(e,t){return e.some(e=>!t.run(()=>e.updateEstimates())&&(this._setDirty(),!0)),t.hasProgressed}_reclip(e,t){if(!this.initialized)return;let n=[];this._featureTiles.forEach(r=>{r.displayingFeatures!=null&&r.displayingFeatures.length!==0&&(r.intersectionIncludingBorrowed(t,J),r.intersectionIncludingBorrowed(e,Y),_(J,Y)||n.push(r))}),this._refreshDisplayingFeatures(n),this._updated()}_refreshDisplayingFeatures(e){let t=new Set,n=this._changes.updates;for(let r of e)if(r.displayingFeatures!=null)for(let e of r.displayingFeatures){let r=C(e,this._objectIdField);if(t.has(r))continue;t.add(r);let i=this._displayingFeatureReferences.get(r).feature;n.removes.push(i),n.adds.push(i)}this._applyChanges()}_updated(){let e=0;if(this._paused||this._featureTiles.forEach(t=>t.isFetching?++e:0),this._isFetching=e>0,e>0||this._applyEditsTilesUpdated?this._notifyDataUpdating():this._dirty||this._set(`dataUpdating`,!1),this.updating){let t=0,n=0,r=0,i=0,a=0,o=this._displayingFeatureReferences.size/this._numDisplayingFeatureReferences;this._featureTiles.forEach(e=>{if(++n,e.isFetching&&e.hasPreciseFeatureCount){let t=this._maximumFeaturesForTile(e)*(1-e.emptyFeatureRatio),n=e.displayingFeatures==null?0:e.displayingFeatures.length*o;a+=t-n}e.needsFetch?++i:e.numFeatures>0&&(++r,t+=e.numFeatures)}),i+=e;let s=0,c=0;t?(c=t,s=Math.min(i*t/r,t)):(c=n,s=i),a=Math.min(this.maximumNumberOfFeatures-this.features.length,a),this._set(`updatingTotal`,c),this._set(`updatingRemaining`,s),this._set(`expectedFeatureDiff`,a)}else this._set(`updatingTotal`,0),this._set(`updatingRemaining`,0),this._set(`expectedFeatureDiff`,0);this.debugger?.update()}_updateMaximumNumberOfFeaturesExceeded(){for(let{perTileMaximumNumberOfFeaturesExceeded:e}of this._featureTiles.values())if(e){this._set(`maximumNumberOfFeaturesExceeded`,!0);return}this._set(`maximumNumberOfFeaturesExceeded`,!1)}_updateRatio(e){let t=H(e),n=e=>1/(1<<Math.max(0,t-e.descriptor.lij[0])),r=0,i=0;for(let t of e){let e=t.numFeatures;r+=e,i+=e*n(t)}return this._fullRatio=Math.min(1,this.maximumNumberOfFeatures/r),this._farRatio=this.maximumNumberOfFeatures/i,this._scheduleUpdated(),n}_maximumFeaturesUpdated(e,t){e!==t&&(t>e&&this._featureTiles.forEach(e=>{if(!e.featuresMissing)return;let t=this._maximumFeaturesForTile(e);e.isFullyFetched(t)||(this._cancelFetchTile(e),this._resetFetchTile(e))}),this._setDirty())}_addTile(e){let t=new M(e,this._memory);return this._featureTiles.set(t.id,t),this._resetFetchTile(t),this._referenceDisplayingFeaturesFromRelatedTiles(t),t}_referenceDisplayingFeaturesFromRelatedTiles(e){let t=e.displayingResolution;this._featureTiles.forEach(n=>{if(n.displayingFeatures!=null&&e!==n&&F(e.descriptor.lij,n.descriptor.lij)){e.displayingFeatures??=[],e.descriptor.extent&&n.descriptor.extent&&(e.extentIncludingBorrowedFeatures??=v(e.descriptor.extent),y(e.extentIncludingBorrowedFeatures,n.descriptor.extent,e.extentIncludingBorrowedFeatures));for(let r of n.displayingFeatures){e.displayingFeatures.push(r),this._memory.ref(r);let n=this._displayingFeatureReferences.get(C(r,this._objectIdField));n.ref(this._memory,n.feature,t),this._numDisplayingFeatureReferences++}}})}_removeTile(e){this._clearTile(e),this._featureTiles.delete(e.id)}_resetFetchTile(e){e.filtered=!e.intersects(this.filterExtent),e.filtered?e.needsFetch&&e.fetchDone(4):e.requestFetch()}_cancelFetchTile(e){let t=e.requestController;t!=null&&(e.requestController=null,e.resetFetching(),t.abort())}async _fetchTileCount(e,t){e.numFeatures=await this.context.query.queryFeatureCount(this._createFeatureCountQuery(e),{signal:t}),this._updateRatio(this._featureTilesArray)}async _fetchTile(e,t){e.fetchFailed=!1;let n=this._maximumFeaturesForTile(e);if(n<=0)return(!e.hasPreciseFeatureCount||e.numFeatures!==0)&&(e.fetchFailed=!0),U(e),e.fetchInformation.value=`Empty tile`,4;let r=this._getMaxRecordCount(e),i=Math.ceil(n/r);if(e.fetchingResolution=e.descriptor.resolution,V(e)||!this.context.capabilities.supportsMaxRecordCountFactor||e.numFeatures<=n&&i>D.MAX_MAX_RECORD_COUNT_FACTOR)return this._fetchPagedTile(e,t);let a=this._createQuery(e);if(a.maxRecordCountFactor=i,e.isRefetching&&e.features&&e.features.length>0){let t=Math.ceil(e.features.length/(1-e.emptyFeatureRatio)/r);a.maxRecordCountFactor=Math.max(t+1,a.maxRecordCountFactor)}e.fetchInformation.value=`Single fetch\n${n} features`;let{features:s,exceededTransferLimit:c,fields:l,missingAttributes:u}=await this._queryFeatures(a,t),d=c||a.maxRecordCountFactor>=D.MAX_MAX_RECORD_COUNT_FACTOR||n===this._totalFeaturesForTile(e)?5:4,f=await this._frameTask.schedule(()=>{e.exceededTransferLimit.value=!!c;let t=this._removeEmptyFeatures(s,this._getEffectiveTileResolution(e));return e.fetchInformation.value=`Single fetch\n${s.length}/${n} features`,e.setFeatures(s,t,W(l),K(void 0,u)),this._updateTileZQuantization(e),this._maximumFeaturesForTile(e)>n?1:d},t);return o(t),this._invalidateCounts(),f}async _fetchPagedTile(e,t){let n=0,r=0,i,a=0,s=this._maximumFeaturesForTile(e)-a,c=this._getMaxRecordCount(e),l=null,u;for(;;){let d=this._createQuery(e),f=this._setPagingParameters(d,n,s,c);e.fetchInformation.value=`Paged fetch\n${e.features?.length}/${s} features`;let{features:p,exceededTransferLimit:m,fields:h,missingAttributes:g}=await this._queryFeatures(d,t);if(await this._frameTask.schedule(()=>{f&&(n+=d.num),a+=p.length,r+=this._removeEmptyFeatures(p,this._getEffectiveTileResolution(e)),e.exceededTransferLimit.value=!!m,i=i?.concat(p)??p,l=G(l,h),u=K(u,g),e.setFeatures(i,r,l,u),this._updateTileZQuantization(e),this._invalidateCounts(),this._setDirty()},t),o(t),s=this._maximumFeaturesForTile(e)-(i?.length??0),!f||!m||s<=0)return m?4:5}}_createFeatureCountQuery(e){let t=this._createQuery(e);return this.context.capabilities.supportsCacheHint&&(t.resultType=void 0,t.cacheHint=!0),t}_createQuery(e){let t=this.context.createQuery();if(t.resultType=this._resultType(e),!V(e)&&e.descriptor.extent&&this.context.tilingScheme&&(t.geometry=b(e.descriptor.extent,this.context.tilingScheme.spatialReference)),this._setResolutionParams(t,e),t.resultType!==`tile`&&this.context.capabilities.supportsCacheHint&&(t.cacheHint=!0),B(e)){let{highlightIds:e}=this.context;e&&e.length>q&&r.getLogger(this).warn(`highlight-too-many-features`,`highlight is limited to ${q} features on large layers configured with a display filter to avoid performance issues`),t.objectIds=e?.slice(0,q)}else!z(e)&&this.context.effectiveDisplayFilter&&(t.where=f(t.where,this.context.effectiveDisplayFilter.where));return t}_setPagingParameters(e,t,n,r){return this.context.capabilities.supportsPagination?(e.start=t,n>0&&this.context.capabilities.supportsMaxRecordCountFactor?(e.maxRecordCountFactor=Math.ceil(n/r),e.num=Math.min(e.maxRecordCountFactor*r,n)):e.num=Math.min(r),!0):!1}_getEffectiveTileResolution(e){if(V(e)||!this._supportsResolution)return null;let t=this.context.viewingMode===1&&this.context.tilingScheme?this.context.tilingScheme.resolutionAtLevel(3):1/0;return Math.min(e.fetchingResolution,t)/this.lodFactor/this._tileZQuantization}get _supportsResolution(){return this.context.capabilities.supportsMultipleResolutions&&this.context.geometryType!==`point`}_setResolutionParams(e,t){let n=this._getEffectiveTileResolution(t);n!=null&&(this.context.capabilities.supportsQuantization?e.quantizationParameters=new E({mode:`view`,originPosition:`upper-left`,tolerance:n,extent:this.context.fullExtent}):this.context.geometryType===`polyline`&&(e.maxAllowableOffset=n))}_removeEmptyFeatures(e,t){let r=e.length;if(t&&this._supportsResolution){let r=t*(1+h());n(e,({geometry:e})=>!e||!w(e)?!1:(T(e,X),x(X)>r||S(X)>r))}else n(e,({geometry:e})=>w(e));return r-e.length}_needsNumFeatures(e){return this.useTileCount&&e.needsFeatureCount&&!z(e)}_getMaxRecordCount(e){switch(this._resultType(e)){case`tile`:if(this.context.tileMaxRecordCount)return this.context.tileMaxRecordCount;break;case`standard`:if(this.context.standardMaxRecordCount)return this.context.standardMaxRecordCount}return this.context.maxRecordCount||q}_resultType(e){if(this.context.capabilities.supportsResultType)return z(e)?`standard`:`tile`}get _reduceMode(){let e=this.context.geometryType;return e===`polygon`||e===`polyline`?0:1}_handleRequest(e,t,n,r,i){e.startFetch(),e.requestController=n;let o=!1;t.then(t=>{e.requestController=null,r(t)}).catch(t=>{e.requestController===n&&(e.requestController=null,e.fetchDone(4)),a(t)?o=!0:i(t)}).then(()=>{o||this._setDirty(),this._scheduleUpdated()})}_scheduleUpdated(){this.hasHandles(`scheduleUpdated`)||this.addHandles(u(()=>{this.removeHandles(`scheduleUpdated`),this._updated()}),`scheduleUpdated`)}_showTile(e){if(e.displayingFeatures&&!e.needsDisplayUpdate)return!1;let t=e.features;if(e.featureLimit===0||!t){let t=e.displayingFeatures!=null&&e.displayingFeatures.length>0;return this._hideTileFeatures(e),e.displayingFeatures=[],t}let n=e.fetchingResolution,{adds:r,updates:i}=this._changes,a=Math.min(e.featureLimit,t.length);for(let e=0;e<a;++e){let a=t[e],o=C(a,this._objectIdField),s=this._displayingFeatureReferences.get(o);if(this._memory.ref(a),s){let{oldVersion:e,newVersion:t}=s.ref(this._memory,a,n);e!==t&&(e&&i.removes.push(e),t&&i.adds.push(t))}else this._displayingFeatureReferences.set(o,new this.FeatureReferenceClass(a,n,this._memory)),r.push(a);this._numDisplayingFeatureReferences++}return this._hideTileFeatures(e),e.displayingResolution=e.fetchingResolution,this._applyChanges(),e.displayingFeatures=t.slice(0,a),!0}_hideTile(e){this._cancelFetchTile(e),this._hideTileFeatures(e)}_hideTileFeatures(e){if(e.displayingFeatures==null)return;let{updates:t,removes:n}=this._changes;for(let r of e.displayingFeatures){this._memory.unref(r);let i=C(r,this._objectIdField),a=this._displayingFeatureReferences.get(i);if(!a)continue;let{oldVersion:o,newVersion:s}=a.unref(this._memory,e.displayingResolution);this._numDisplayingFeatureReferences--,o!==s&&(s==null?(this._displayingFeatureReferences.delete(i),o&&n.push(o)):(t.adds.push(s),o&&t.removes.push(o)))}this._applyChanges(),e.displayingFeatures=null}_notifyDataUpdating(){this._get(`dataUpdating`)||this._set(`dataUpdating`,!0)}_applyChanges(){let e=this._changes.updates;e.removes.length>0&&(this._notifyDataUpdating(),this.features.removeMany(e.removes),e.removes.length=0),e.adds.length>0&&(this._notifyDataUpdating(),this.features.addMany(e.adds),e.adds.length=0);let t=this._changes.adds,n=this._changes.removes,r=Math.min(t.length,n.length),i=0;for(;i<r;){let e=Math.min(i+Q,r);this._notifyDataUpdating(),this.features.addMany(t.slice(i,e)),this.features.removeMany(n.slice(i,e)),i=e}t.length>r&&(this._notifyDataUpdating(),this.features.addMany(i===0?t:t.slice(i))),n.length>r&&(this._notifyDataUpdating(),this.features.removeMany(i===0?n:n.slice(i))),t.length=0,n.length=0}_clearTile(e){this._hideTile(e),e.features&&this.context.memoryCache!=null&&this.context.memoryCache.put(e.id,e.cache),e.setFeatures(null,0,null,void 0),this._invalidateCounts()}_invalidateCounts(){this.notifyChange(`totalVertices`),this.notifyChange(`totalFeatures`)}get _featureTilesArray(){return Array.from(this._featureTiles.values())}get featureTiles(){return this._featureTiles}get storedFeatures(){return this._featureTilesArray.reduce((e,t)=>e+(t.features?t.features.length:0),0)}get missingTiles(){return this._featureTiles.values().reduce((e,t)=>e+(t.needsFetch||t.isFetching?1:0),0)}_totalFeaturesForTile(e){return e.hasPreciseFeatureCount?e.numFeatures:this.maximumNumberOfFeatures}_maximumFeaturesForTile(e){let t=this._totalFeaturesForTile(e),n=this._fullRatio<1?this._farRatio:1;return Math.min(Math.ceil(t*n/(1-e.emptyFeatureRatio)),t)}get test(){}};e([p({constructOnly:!0})],R.prototype,`features`,void 0),e([p({constructOnly:!0})],R.prototype,`context`,void 0),e([p()],R.prototype,`tileDescriptors`,void 0),e([p({value:1/0})],R.prototype,`maximumNumberOfFeatures`,null),e([p({value:1})],R.prototype,`memoryFactor`,null),e([p({value:1})],R.prototype,`lodFactor`,null),e([p()],R.prototype,`useTileCount`,null),e([p({readOnly:!0})],R.prototype,`updating`,null),e([p({readOnly:!0})],R.prototype,`dataUpdating`,void 0),e([p({readOnly:!0})],R.prototype,`updatingTotal`,void 0),e([p({readOnly:!0})],R.prototype,`updatingRemaining`,void 0),e([p({readOnly:!0})],R.prototype,`expectedFeatureDiff`,void 0),e([p()],R.prototype,`usedMemory`,null),e([p()],R.prototype,`usedMemoryPerFeature`,null),e([p({readOnly:!0})],R.prototype,`maximumNumberOfFeaturesExceeded`,void 0),e([p({readOnly:!0})],R.prototype,`totalVertices`,null),e([p({readOnly:!0})],R.prototype,`totalFeatures`,null),e([p({readOnly:!0})],R.prototype,`showsAllFeatures`,null),e([p({readOnly:!0})],R.prototype,`hasFullGeometries`,null),e([p()],R.prototype,`filterExtent`,null),e([p()],R.prototype,`_dirty`,void 0),e([p()],R.prototype,`_suspended`,void 0),e([p()],R.prototype,`_pendingEdits`,void 0),e([p()],R.prototype,`_applyEditsTilesUpdated`,void 0),e([p()],R.prototype,`_paused`,null),e([p()],R.prototype,`snappingComplexityExceeded`,void 0),e([p()],R.prototype,`_isFetching`,void 0),R=e([m(`esri.views.3d.layers.support.FeatureTileFetcher3D`)],R);function z(e){return e.id===P}function B(e){return e.id===N}function V(e){return z(e)||B(e)}function H(e){let t=0;for(let n of e)n.features&&n.features.length>0&&n.alive&&(t=Math.max(t,n.descriptor.lij[0]));return t}function U(e){e.setFeatures([],0,null,void 0)}function W(e){return e==null?new Set:new Set(e.map(e=>e.name))}function G(e,t){if(e==null||t==null)return W(t);let n=new Set;for(let{name:r}of t)e.has(r)&&n.add(r);return n}function K(e,t){if(!t?.length)return e;e??=new Map;let n=()=>new Set;for(let{objectId:r,attribute:a}of t)i(e,r,n).add(a);return e}const q=2e3,J=g(),Y=g(),X=g(),Z=6e5,Q=200,$=.95,ee=10;export{R as FeatureTileFetcher3D};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{filterInPlace as n}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import r from"../../../../core/Logger.js";import{getOrCreateMapValue as i}from"../../../../core/MapUtils.js";import{isAbortError as a,throwIfAborted as o}from"../../../../core/promiseUtils.js";import s from"../../../../core/ReactiveMap.js";import{on as c,watch as l}from"../../../../core/reactiveUtils.js";import{schedule as u}from"../../../../core/scheduling.js";import{signal as d}from"../../../../core/signal.js";import{sqlAnd as f}from"../../../../core/sql.js";import{property as p,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{getEpsilon as h}from"../../../../core/libs/gl-matrix-2/math/common.js";import{create as g,equals as _,clone as v,expand as y,toExtent as b,width as x,height as S}from"../../../../geometry/support/aaBoundingRect.js";import{getObjectId as C,hasVertices as w,computeAABR as T}from"../../../../layers/graphics/dehydratedFeatures.js";import{geometryKey as E,transferGeometryKey as D,identicalTransferGeometry as O,completeDehydratedFeatureFromTransfer as k}from"../../../../layers/graphics/transferFeatures.js";import A from"../../../../rest/support/QuantizationParameters.js";import j from"../../../../rest/support/Query.js";import{FeatureMemory as M}from"./FeatureMemory.js";import{MultiFeatureReference as ee,SingleFeatureReference as te}from"./featureReference.js";import{failedFeatureCount as N,FeatureTile as P}from"./FeatureTile.js";import{virtualDisplayFilterHighlightTileId as F,virtualSnapshotTileId as I}from"./FeatureTileDescriptor.js";import{tilesAreRelated as L}from"../../terrain/tileUtils.js";import{ImmediateTask as R,TaskPriority as z}from"../../../support/Scheduler.js";let B=class extends t{set maximumNumberOfFeatures(e){e||=1/0;let t=this._get(`maximumNumberOfFeatures`);e===t||e<1||(this._set(`maximumNumberOfFeatures`,e),this._maximumFeaturesUpdated(t,e))}set memoryFactor(e){this.memoryFactor!==e&&(this._set(`memoryFactor`,e),this._setDirty())}set lodFactor(e){this.lodFactor!==e&&(this._set(`lodFactor`,e),this._supportsResolution&&this.refetch())}get useTileCount(){return this._useTileCount&&this.context.query.queryFeatureCount!=null}set useTileCount(e){this._useTileCount=e,this.notifyChange(`useTileCount`)}get updating(){return this._dirty||!!this._pendingEdits||this._isFetching||(this.tileDescriptors?.updating??!1)}get readyToRun(){return this._dirty}get usedMemory(){return this._memory.usedMemory}get usedMemoryPerFeature(){return this._memory.usedMemoryPerFeature}get totalVertices(){let e=0;return this._featureTiles.forEach(t=>e+=t.numVertices),e}get totalFeatures(){let e=0;return this._featureTiles.forEach(t=>e+=t.numFeatures),e}get showsAllFeatures(){if(this._paused||this.dataUpdating)return!1;for(let e of this._featureTiles.values())if(!this.hasFullGeometries&&e.emptyFeatureRatio!==0||!e.showsAllFeatures)return!1;return!0}get hasFullGeometries(){return!this._supportsResolution||this.tileDescriptors?.some(V)||!this.context.capabilities.supportsQuantization&&this.context.geometryType!==`polyline`}set filterExtent(e){if(e!=null&&this.context.tilingScheme&&!e.spatialReference.equals(this.context.tilingScheme.spatialReference)){r.getLogger(this).error(`#filterExtent=`,`extent needs to be in the same spatial reference as the tiling scheme`);return}let t=this._get(`filterExtent`);if(t===e||t!=null&&e&&t.equals(e))return;let n=e==null?null:e.clone();this._set(`filterExtent`,n),this._reclip(n,t)}_updateTileZQuantization(e){if(this.context.viewingMode===1){let t=e.computeZQuantizationFactor();this._zQuantizationFactor.value<t&&(this._zQuantizationFactor.value=t)}}get _tileZQuantization(){return this.context.isDraped?1:this._zQuantizationFactor.value}constructor(e){super(e),this._useTileCount=!1,this.dataUpdating=!1,this.updatingTotal=0,this.updatingRemaining=0,this.expectedFeatureDiff=0,this.maximumNumberOfFeaturesExceeded=!1,this._fullRatio=1,this._farRatio=1,this._zQuantizationFactor=d(1),this._changes={updates:{adds:[],removes:[]},adds:[],removes:[]},this._featureTiles=new s,this._displayingFeatureReferences=new Map,this._numDisplayingFeatureReferences=0,this._memory=new M(E),this._dirty=!1,this._suspended=!0,this._pendingEdits=null,this._applyEditsTilesUpdated=!1,this.snappingComplexityExceeded=!0,this._isFetching=!1;let t=e.context;this._frameTask=t.scheduler?.registerTask(z.FEATURE_TILE_FETCHER,this)??R,this.FeatureReferenceClass=t.capabilities.supportsMultipleResolutions?ee:te,this._objectIdField=t.objectIdField}initialize(){this.addHandles([c(()=>this.tileDescriptors,`change`,()=>this._setDirty(),{onListenerAdd:()=>this._setDirty(),onListenerRemove:()=>this._setDirty()}),l(()=>this._tileZQuantization,()=>this.refetch())]),this._setDirty()}destroy(){this._frameTask.remove(),this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._removeTile(e)}),this._featureTiles.clear(),this._displayingFeatureReferences.clear(),this._pendingEdits?.controller.abort(),this._pendingEdits=null}get _paused(){return this._suspended||!!this._pendingEdits}restart(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._clearTile(e),this._resetFetchTile(e)}),this.context.memoryCache!=null&&this.context.memoryCache.clear(),this._setDirty()}refetch(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._resetFetchTile(e)}),this.context.memoryCache!=null&&this.context.memoryCache.clear(),this._setDirty()}refetchDisplayFilterHighlightTile(){let e=this._featureTiles.get(F);e&&(this._cancelFetchTile(e),this._resetFetchTile(e),this._setDirty())}suspend(){this._suspended||(this._suspended=!0,this._pause(),this._setDirty())}resume(){this._suspended&&(this._suspended=!1,this._unpause())}getMissingAttributesForFeature(e){for(let t of this._featureTiles.values()){let n=t.missingAttributes?.get(e);if(n!=null)return n}}_pause(){this._paused&&(this._featureTiles.forEach(e=>this._cancelFetchTile(e)),this._updated())}_unpause(){this._paused||this._setDirty()}get availableFields(){let e=null;return this._featureTiles.forEach(t=>{t.displayingFeatures!=null&&t.displayingFeatures.length!==0&&(e==null?e=new Set(t.availableFields):e.forEach(n=>{t.availableFields?.has(n)||e.delete(n)}))}),e??new Set}applyEdits(e){this._pendingEdits||(this._pendingEdits={edits:Promise.resolve(),count:0,controller:new AbortController},this._pause());let t=this._pendingEdits;t.count++;let n=t.edits.then(()=>e.result.catch(e=>{if(a(e))throw e;return null}).then(e=>e&&(this._applyEditsDeleteFeatures(e.deletedFeatures),this._applyEditsAddUpdateFeatures(e.addedFeatures,e.updatedFeatures,t.controller.signal).then(()=>e))).then(e=>(--t.count===0&&(this._pendingEdits===t&&(this._pendingEdits=null),this.context.memoryCache!=null&&this.context.memoryCache.clear(),this._applyEditsTilesUpdated=!1,this._unpause()),e)));return t.edits=n,this._updated(),n}_applyEditsDeleteFeatures(e){if(e.length===0)return;let t=this.context.globalIdField,n=t&&this.availableFields.has(t),i=new Set,a=this._objectIdField;e.forEach(({objectId:e,globalId:o})=>{(!e||e<0)&&t&&o&&(n||r.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected in the view`),e=this._objectIdFromGlobalId(o,a,t)),e!=null&&e>=0&&i.add(e)}),this._featureTiles.forEach(e=>{if(!e.features)return;let t=e.features.filter(e=>!i.has(C(e,this._objectIdField)));t.length!==e.features.length&&(this._applyEditsTileUpdated(),e.setFeatures(t,0,e.availableFields,e.missingAttributes),this._updateTileZQuantization(e),this._invalidateCounts())})}_objectIdFromGlobalId(e,t,n){if(e==null)return null;let r=this.features.find(t=>t.attributes?.[n]===e);return r?C(r,t):null}async _applyEditsAddUpdateFeatures(e,t,n){let{objectIdField:i,globalIdField:a}=this.context,o=a&&this.availableFields.has(a),s=new Set,c=new Set;for(let t of e){let e=t.objectId;e!=null&&s.add(e)}for(let{objectId:e,globalId:n}of t){let t=e;(t==null||t<0)&&a&&(o||r.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${a} to be included the layer's outFields for updates to be reflected in the view`),t=this._objectIdFromGlobalId(n,i,a)),t!=null&&t>=0&&(s.add(t),c.add(t))}if(s.size===0)return;let l=[];this._featureTiles.forEach(e=>{let t=this._applyEditsAddUpdateTile(e,s,c,n);l.push(t)}),this._updated(),await Promise.allSettled(l)}async _applyEditsAddUpdateTile(e,t,n,r){if(!e.features)return;e.fetchingResolution=e.descriptor.resolution;let i=this._createQuery(e);i.resultType=void 0,i.cacheHint=!1,i.objectIds=Array.from(t);let a=await this.context.query.queryFeaturesDehydrated(i,{signal:r,timeout:$}),o=null;if(n.size>0){let t=e.features.filter(e=>!n.has(C(e,this._objectIdField)));t.length!==e.features.length&&(o=t)}if(a.features.length>0){o||=e.features.slice();for(let e of a.features)o.push(e)}o&&(e.hasPreciseFeatureCount&&(e.numFeatures=Math.max(e.numFeatures,o.length)),this._applyEditsTileUpdated(),e.setFeatures(o,0,q(e.availableFields,a.fields),J(e.missingAttributes,a.missingAttributes),void 0,!1),this._updateTileZQuantization(e),this._invalidateCounts())}_applyEditsTileUpdated(){this._applyEditsTilesUpdated||(this._applyEditsTilesUpdated=!0,this._updated())}_queryFeatures(e,t,n){return this.context.query.queryFeaturesDehydrated(e,{signal:n,timeout:$,completeFeatureFromTransfer:(e,n,r)=>{let i=D(e.geometry,n,t),a=this._memory.findGeometry(i,t=>O(e.geometry,n,t));a?e.geometry=a:k(e,n,r)}})}_setDirty(){this._dirty=!0,this._updated()}runTask(e){let t=this._frameTask.processQueue(e);if(!this._dirty||!this.initialized)return t;this._dirty=!1;let n=this._featureTilesArray;if(this._markTilesNotAlive(n),!e.run(()=>this._addTiles(n,e))||!e.run(()=>this._filterExtentTiles(n,e))||!e.run(()=>this._removeTiles(n,e))||e.done){this._setDirty();return}let r=this._sortTiles(n);(!e.run(()=>this._showTiles(r,e))||!e.run(()=>this._fetchTiles(r,e))||!e.run(()=>this._updateMemoryEstimates(r,e)))&&this._setDirty(),this._updated(),this.updating||(this._updateMaximumNumberOfFeaturesExceeded(),this._updateSnappingComplexityExceeded(r))}_updateSnappingComplexityExceeded(e){let t=ie;for(let n of e){if(V(n)||t<=0)break;if(!H(n)&&(t--,n.sampledDensityEstimate>re)){this.snappingComplexityExceeded=!0;return}}this.snappingComplexityExceeded=this._featureTiles.size===0}_markTilesNotAlive(e){for(let t of e)t.alive=!1}_addTiles(e,t){return this._suspended||!this.tileDescriptors?!1:(this.tileDescriptors.forEach(n=>{let r=this._featureTiles.get(n.id);r?r.alive=!0:t.done||(e.push(this._addTile(n)),t.madeProgress())}),t.hasProgressed)}_filterExtentTiles(e,t){for(let n of e){if(t.done)break;n.alive&&(n.filtered=!n.intersects(this.filterExtent),n.filtered&&(this._clearTile(n),t.madeProgress()))}return t.hasProgressed}_removeTiles(e,t){for(let n=e.length-1;n>=0&&!t.done;n--){let r=e[n];r.alive||(this._removeTile(r),n!==e.length-1&&(e[n]=e[e.length-1]),e.pop(),t.madeProgress())}return t.hasProgressed}_sortTiles(e){return e.sort((e,t)=>e.descriptor.loadPriority-t.descriptor.loadPriority),e}_showTiles(e,t){let n=this._updateRatio(e),r=e=>{let t=this._fullRatio<1?n(e)*this._farRatio:1;e.reduceFeatures(t,this.memoryFactor,this._objectIdField,this._reduceMode)&&this._setDirty();let{numFeatures:r,fetchingResolution:i,descriptor:a,isFetched:o}=e;return this._supportsResolution&&r>0&&i!==a.resolution&&o&&(e.requestRefetch(),this._setDirty()),this._showTile(e)};for(let n of e)if(!t.run(()=>r(n))){this._setDirty();break}return t.hasProgressed}_fetchTiles(e,t){if(this._paused)return!1;let n=!1;for(let r of e){if(!r.needsFetch)continue;let e=this.context.memoryCache==null?null:this.context.memoryCache.pop(r.id);if(e?.resolution===r.displayingResolution)r.cache=e,r.numFeatures&&this._notifyDataUpdating(),this._setDirty(),this._scheduleUpdated(),t.madeProgress();else{if(this._needsNumFeatures(r)){let e=new AbortController,i=this._fetchTileCount(r,e.signal);this._handleRequest(r,i,e,()=>r.resetFetching(),()=>r.numFeatures=N),n=!0,t.madeProgress()}if(t.done)return!0}}if(n)return t.hasProgressed;for(let n of e){if(!n.needsFetch)continue;let e=new AbortController,i=this._fetchTile(n,e.signal);if(this._handleRequest(n,i,e,e=>n.fetchDone(e),e=>{n.fetchFailed=!0,this.context.logFetchError(r.getLogger(this),e)}),t.madeProgress(),t.done)return!0}return t.hasProgressed}_updateMemoryEstimates(e,t){return e.some(e=>!t.run(()=>e.updateEstimates())&&(this._setDirty(),!0)),t.hasProgressed}_reclip(e,t){if(!this.initialized)return;let n=[];this._featureTiles.forEach(r=>{r.displayingFeatures!=null&&r.displayingFeatures.length!==0&&(r.intersectionIncludingBorrowed(t,X),r.intersectionIncludingBorrowed(e,Z),_(X,Z)||n.push(r))}),this._refreshDisplayingFeatures(n),this._updated()}_refreshDisplayingFeatures(e){let t=new Set,n=this._changes.updates;for(let r of e)if(r.displayingFeatures!=null)for(let e of r.displayingFeatures){let r=C(e,this._objectIdField);if(t.has(r))continue;t.add(r);let i=this._displayingFeatureReferences.get(r).feature;n.removes.push(i),n.adds.push(i)}this._applyChanges()}_updated(){let e=0;if(this._paused||this._featureTiles.forEach(t=>t.isFetching?++e:0),this._isFetching=e>0,e>0||this._applyEditsTilesUpdated?this._notifyDataUpdating():this._dirty||this._set(`dataUpdating`,!1),this.updating){let t=0,n=0,r=0,i=0,a=0,o=this._displayingFeatureReferences.size/this._numDisplayingFeatureReferences;this._featureTiles.forEach(e=>{if(++n,e.isFetching&&e.hasPreciseFeatureCount){let t=this._maximumFeaturesForTile(e)*(1-e.emptyFeatureRatio),n=e.displayingFeatures==null?0:e.displayingFeatures.length*o;a+=t-n}e.needsFetch?++i:e.numFeatures>0&&(++r,t+=e.numFeatures)}),i+=e;let s=0,c=0;t?(c=t,s=Math.min(i*t/r,t)):(c=n,s=i),a=Math.min(this.maximumNumberOfFeatures-this.features.length,a),this._set(`updatingTotal`,c),this._set(`updatingRemaining`,s),this._set(`expectedFeatureDiff`,a)}else this._set(`updatingTotal`,0),this._set(`updatingRemaining`,0),this._set(`expectedFeatureDiff`,0);this.debugger?.update()}_updateMaximumNumberOfFeaturesExceeded(){for(let{perTileMaximumNumberOfFeaturesExceeded:e}of this._featureTiles.values())if(e){this._set(`maximumNumberOfFeaturesExceeded`,!0);return}this._set(`maximumNumberOfFeaturesExceeded`,!1)}_updateRatio(e){let t=W(e),n=e=>1/(1<<Math.max(0,t-e.descriptor.lij[0])),r=0,i=0;for(let t of e){let e=t.numFeatures;r+=e,i+=e*n(t)}return this._fullRatio=Math.min(1,this.maximumNumberOfFeatures/r),this._farRatio=this.maximumNumberOfFeatures/i,this._scheduleUpdated(),n}_maximumFeaturesUpdated(e,t){e!==t&&(t>e&&this._featureTiles.forEach(e=>{if(!e.featuresMissing)return;let t=this._maximumFeaturesForTile(e);e.isFullyFetched(t)||(this._cancelFetchTile(e),this._resetFetchTile(e))}),this._setDirty())}_addTile(e){let t=new P(e,this._memory);return this._featureTiles.set(t.id,t),this._resetFetchTile(t),this._referenceDisplayingFeaturesFromRelatedTiles(t),t}_referenceDisplayingFeaturesFromRelatedTiles(e){let t=e.displayingResolution;this._featureTiles.forEach(n=>{if(n.displayingFeatures!=null&&e!==n&&L(e.descriptor.lij,n.descriptor.lij)){e.displayingFeatures??=[],e.descriptor.extent&&n.descriptor.extent&&(e.extentIncludingBorrowedFeatures??=v(e.descriptor.extent),y(e.extentIncludingBorrowedFeatures,n.descriptor.extent,e.extentIncludingBorrowedFeatures));for(let r of n.displayingFeatures){e.displayingFeatures.push(r),this._memory.ref(r);let n=this._displayingFeatureReferences.get(C(r,this._objectIdField));n.ref(this._memory,n.feature,t),this._numDisplayingFeatureReferences++}}})}_removeTile(e){this._clearTile(e),this._featureTiles.delete(e.id)}_resetFetchTile(e){e.filtered=!e.intersects(this.filterExtent),e.filtered?e.needsFetch&&e.fetchDone(4):e.requestFetch()}_cancelFetchTile(e){let t=e.requestController;t!=null&&(e.requestController=null,e.resetFetching(),t.abort())}async _fetchTileCount(e,t){e.numFeatures=await this.context.query.queryFeatureCount(this._createFeatureCountQuery(e),{signal:t}),this._updateRatio(this._featureTilesArray)}async _fetchTile(e,t){e.fetchFailed=!1;let n=this._maximumFeaturesForTile(e);if(n<=0)return(!e.hasPreciseFeatureCount||e.numFeatures!==0)&&(e.fetchFailed=!0),G(e),e.fetchInformation.value=`Empty tile`,4;let r=this._getMaxRecordCount(e),i=Math.ceil(n/r);if(e.fetchingResolution=e.descriptor.resolution,U(e)||!this.context.capabilities.supportsMaxRecordCountFactor||e.numFeatures<=n&&i>j.MAX_MAX_RECORD_COUNT_FACTOR)return this._fetchPagedTile(e,t);let a=this._createQuery(e);if(a.maxRecordCountFactor=i,e.isRefetching&&e.features&&e.features.length>0){let t=Math.ceil(e.features.length/(1-e.emptyFeatureRatio)/r);a.maxRecordCountFactor=Math.max(t+1,a.maxRecordCountFactor)}e.fetchInformation.value=`Single fetch\n${n} features`;let{features:s,exceededTransferLimit:c,fields:l,missingAttributes:u}=await this._queryFeatures(a,e.fetchingResolution,t),d=c||a.maxRecordCountFactor>=j.MAX_MAX_RECORD_COUNT_FACTOR||n===this._totalFeaturesForTile(e)?5:4,f=await this._frameTask.schedule(()=>{e.exceededTransferLimit.value=!!c;let t=this._removeEmptyFeatures(s,this._getEffectiveTileResolution(e));return e.fetchInformation.value=`Single fetch\n${s.length}/${n} features`,e.setFeatures(s,t,K(l),J(void 0,u)),this._updateTileZQuantization(e),this._maximumFeaturesForTile(e)>n?1:d},t);return o(t),this._invalidateCounts(),f}async _fetchPagedTile(e,t){let n=0,r=0,i,a=0,s=this._maximumFeaturesForTile(e)-a,c=this._getMaxRecordCount(e),l=null,u;for(;;){let d=this._createQuery(e),f=this._setPagingParameters(d,n,s,c);e.fetchInformation.value=`Paged fetch\n${e.features?.length}/${s} features`;let{features:p,exceededTransferLimit:m,fields:h,missingAttributes:g}=await this._queryFeatures(d,e.fetchingResolution,t);if(await this._frameTask.schedule(()=>{f&&(n+=d.num),a+=p.length,r+=this._removeEmptyFeatures(p,this._getEffectiveTileResolution(e)),e.exceededTransferLimit.value=!!m,i=i?.concat(p)??p,l=q(l,h),u=J(u,g),e.setFeatures(i,r,l,u),this._updateTileZQuantization(e),this._invalidateCounts(),this._setDirty()},t),o(t),s=this._maximumFeaturesForTile(e)-(i?.length??0),!f||!m||s<=0)return m?4:5}}_createFeatureCountQuery(e){let t=this._createQuery(e);return this.context.capabilities.supportsCacheHint&&(t.resultType=void 0,t.cacheHint=!0),t}_createQuery(e){let t=this.context.createQuery();if(t.resultType=this._resultType(e),!U(e)&&e.descriptor.extent&&this.context.tilingScheme&&(t.geometry=b(e.descriptor.extent,this.context.tilingScheme.spatialReference)),this._setResolutionParams(t,e),t.resultType!==`tile`&&this.context.capabilities.supportsCacheHint&&(t.cacheHint=!0),H(e)){let{highlightIds:e}=this.context;e&&e.length>Y&&r.getLogger(this).warn(`highlight-too-many-features`,`highlight is limited to ${Y} features on large layers configured with a display filter to avoid performance issues`),t.objectIds=e?.slice(0,Y)}else!V(e)&&this.context.effectiveDisplayFilter&&(t.where=f(t.where,this.context.effectiveDisplayFilter.where));return t}_setPagingParameters(e,t,n,r){return this.context.capabilities.supportsPagination?(e.start=t,n>0&&this.context.capabilities.supportsMaxRecordCountFactor?(e.maxRecordCountFactor=Math.ceil(n/r),e.num=Math.min(e.maxRecordCountFactor*r,n)):e.num=Math.min(r),!0):!1}_getEffectiveTileResolution(e){if(U(e)||!this._supportsResolution)return null;let t=this.context.viewingMode===1&&this.context.tilingScheme?this.context.tilingScheme.resolutionAtLevel(3):1/0;return Math.min(e.fetchingResolution,t)/this.lodFactor/this._tileZQuantization}get _supportsResolution(){return this.context.capabilities.supportsMultipleResolutions&&this.context.geometryType!==`point`}_setResolutionParams(e,t){let n=this._getEffectiveTileResolution(t);n!=null&&(this.context.capabilities.supportsQuantization?e.quantizationParameters=new A({mode:`view`,originPosition:`upper-left`,tolerance:n,extent:this.context.fullExtent}):this.context.geometryType===`polyline`&&(e.maxAllowableOffset=n))}_removeEmptyFeatures(e,t){let r=e.length;if(t&&this._supportsResolution){let r=t*(1+h());n(e,({geometry:e})=>!e||!w(e)?!1:(T(e,Q),x(Q)>r||S(Q)>r))}else n(e,({geometry:e})=>w(e));return r-e.length}_needsNumFeatures(e){return this.useTileCount&&e.needsFeatureCount&&!V(e)}_getMaxRecordCount(e){switch(this._resultType(e)){case`tile`:if(this.context.tileMaxRecordCount)return this.context.tileMaxRecordCount;break;case`standard`:if(this.context.standardMaxRecordCount)return this.context.standardMaxRecordCount}return this.context.maxRecordCount||Y}_resultType(e){if(this.context.capabilities.supportsResultType)return V(e)?`standard`:`tile`}get _reduceMode(){let e=this.context.geometryType;return e===`polygon`||e===`polyline`?0:1}_handleRequest(e,t,n,r,i){e.startFetch(),e.requestController=n;let o=!1;t.then(t=>{e.requestController=null,r(t)}).catch(t=>{e.requestController===n&&(e.requestController=null,e.fetchDone(4)),a(t)?o=!0:i(t)}).then(()=>{o||this._setDirty(),this._scheduleUpdated()})}_scheduleUpdated(){this.hasHandles(`scheduleUpdated`)||this.addHandles(u(()=>{this.removeHandles(`scheduleUpdated`),this._updated()}),`scheduleUpdated`)}_showTile(e){if(e.displayingFeatures&&!e.needsDisplayUpdate)return!1;let t=e.features;if(e.featureLimit===0||!t){let t=e.displayingFeatures!=null&&e.displayingFeatures.length>0;return this._hideTileFeatures(e),e.displayingFeatures=[],t}let n=e.fetchingResolution,{adds:r,updates:i}=this._changes,a=Math.min(e.featureLimit,t.length);for(let e=0;e<a;++e){let a=t[e],o=C(a,this._objectIdField),s=this._displayingFeatureReferences.get(o);if(this._memory.ref(a),s){let{oldVersion:e,newVersion:t}=s.ref(this._memory,a,n);e!==t&&(e&&i.removes.push(e),t&&i.adds.push(t))}else this._displayingFeatureReferences.set(o,new this.FeatureReferenceClass(a,n,this._memory)),r.push(a);this._numDisplayingFeatureReferences++}return this._hideTileFeatures(e),e.displayingResolution=e.fetchingResolution,this._applyChanges(),e.displayingFeatures=t.slice(0,a),!0}_hideTile(e){this._cancelFetchTile(e),this._hideTileFeatures(e)}_hideTileFeatures(e){if(e.displayingFeatures==null)return;let{updates:t,removes:n}=this._changes;for(let r of e.displayingFeatures){this._memory.unref(r);let i=C(r,this._objectIdField),a=this._displayingFeatureReferences.get(i);if(!a)continue;let{oldVersion:o,newVersion:s}=a.unref(this._memory,e.displayingResolution);this._numDisplayingFeatureReferences--,o!==s&&(s==null?(this._displayingFeatureReferences.delete(i),o&&n.push(o)):(t.adds.push(s),o&&t.removes.push(o)))}this._applyChanges(),e.displayingFeatures=null}_notifyDataUpdating(){this._get(`dataUpdating`)||this._set(`dataUpdating`,!0)}_applyChanges(){let e=this._changes.updates;e.removes.length>0&&(this._notifyDataUpdating(),this.features.removeMany(e.removes),e.removes.length=0),e.adds.length>0&&(this._notifyDataUpdating(),this.features.addMany(e.adds),e.adds.length=0);let t=this._changes.adds,n=this._changes.removes,r=Math.min(t.length,n.length),i=0;for(;i<r;){let e=Math.min(i+ne,r);this._notifyDataUpdating(),this.features.addMany(t.slice(i,e)),this.features.removeMany(n.slice(i,e)),i=e}t.length>r&&(this._notifyDataUpdating(),this.features.addMany(i===0?t:t.slice(i))),n.length>r&&(this._notifyDataUpdating(),this.features.removeMany(i===0?n:n.slice(i))),t.length=0,n.length=0}_clearTile(e){this._hideTile(e),e.features&&this.context.memoryCache!=null&&this.context.memoryCache.put(e.id,e.cache),e.setFeatures(null,0,null,void 0),this._invalidateCounts()}_invalidateCounts(){this.notifyChange(`totalVertices`),this.notifyChange(`totalFeatures`)}get _featureTilesArray(){return Array.from(this._featureTiles.values())}get featureTiles(){return this._featureTiles}get storedFeatures(){return this._featureTilesArray.reduce((e,t)=>e+(t.features?t.features.length:0),0)}get missingTiles(){return this._featureTiles.values().reduce((e,t)=>e+(t.needsFetch||t.isFetching?1:0),0)}_totalFeaturesForTile(e){return e.hasPreciseFeatureCount?e.numFeatures:this.maximumNumberOfFeatures}_maximumFeaturesForTile(e){let t=this._totalFeaturesForTile(e),n=this._fullRatio<1?this._farRatio:1;return Math.min(Math.ceil(t*n/(1-e.emptyFeatureRatio)),t)}get test(){}};e([p({constructOnly:!0})],B.prototype,`features`,void 0),e([p({constructOnly:!0})],B.prototype,`context`,void 0),e([p()],B.prototype,`tileDescriptors`,void 0),e([p({value:1/0})],B.prototype,`maximumNumberOfFeatures`,null),e([p({value:1})],B.prototype,`memoryFactor`,null),e([p({value:1})],B.prototype,`lodFactor`,null),e([p()],B.prototype,`useTileCount`,null),e([p({readOnly:!0})],B.prototype,`updating`,null),e([p({readOnly:!0})],B.prototype,`dataUpdating`,void 0),e([p({readOnly:!0})],B.prototype,`updatingTotal`,void 0),e([p({readOnly:!0})],B.prototype,`updatingRemaining`,void 0),e([p({readOnly:!0})],B.prototype,`expectedFeatureDiff`,void 0),e([p()],B.prototype,`usedMemory`,null),e([p()],B.prototype,`usedMemoryPerFeature`,null),e([p({readOnly:!0})],B.prototype,`maximumNumberOfFeaturesExceeded`,void 0),e([p({readOnly:!0})],B.prototype,`totalVertices`,null),e([p({readOnly:!0})],B.prototype,`totalFeatures`,null),e([p({readOnly:!0})],B.prototype,`showsAllFeatures`,null),e([p({readOnly:!0})],B.prototype,`hasFullGeometries`,null),e([p()],B.prototype,`filterExtent`,null),e([p()],B.prototype,`_dirty`,void 0),e([p()],B.prototype,`_suspended`,void 0),e([p()],B.prototype,`_pendingEdits`,void 0),e([p()],B.prototype,`_applyEditsTilesUpdated`,void 0),e([p()],B.prototype,`_paused`,null),e([p()],B.prototype,`snappingComplexityExceeded`,void 0),e([p()],B.prototype,`_isFetching`,void 0),B=e([m(`esri.views.3d.layers.support.FeatureTileFetcher3D`)],B);function V(e){return e.id===I}function H(e){return e.id===F}function U(e){return V(e)||H(e)}function W(e){let t=0;for(let n of e)n.features&&n.features.length>0&&n.alive&&(t=Math.max(t,n.descriptor.lij[0]));return t}function G(e){e.setFeatures([],0,null,void 0)}function K(e){return e==null?new Set:new Set(e.map(e=>e.name))}function q(e,t){if(e==null||t==null)return K(t);let n=new Set;for(let{name:r}of t)e.has(r)&&n.add(r);return n}function J(e,t){if(!t?.length)return e;e??=new Map;let n=()=>new Set;for(let{objectId:r,attribute:a}of t)i(e,r,n).add(a);return e}const Y=2e3,X=g(),Z=g(),Q=g(),$=6e5,ne=200,re=.95,ie=10;export{B as FeatureTileFetcher3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isSome as t}from"../../../../core/arrayUtils.js";import{makeHandle as n}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import r from"../../../../core/Logger.js";import{estimateFixedArrayMemory as i,estimateNumberMemory as a,estimateAttributesMemory as o}from"../../../../core/memoryEstimations.js";import{EsriPromise as s}from"../../../../core/Promise.js";import{initial as c,sync as l,watch as u}from"../../../../core/reactiveUtils.js";import{pt2px as d}from"../../../../core/screenUtils.js";import{property as f,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import{projectPointToVector as g}from"../../../../geometry/projection/projectPointToVector.js";import{getContinuousIndexArray as _}from"../../../../geometry/support/Indices.js";import{getResolutionForScale as v}from"../../../../geometry/support/scaleUtils.js";import{getObjectId as y}from"../../../../layers/graphics/dehydratedFeatures.js";import{convertFromPoint as b}from"../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as x}from"../../../../layers/graphics/OptimizedFeature.js";import S from"../../../../layers/graphics/data/FeatureStore.js";import{isNumericField as C}from"../../../../layers/support/fieldUtils.js";import{generateGradient as w}from"../../../../renderers/support/heatmapUtils.js";import{DisplayFeatureLimit as T}from"../graphics/DisplayFeatureLimit.js";import{GraphicsCorePerformanceInfo as E}from"../graphics/GraphicsCorePerformanceInfo.js";import{FeatureVisibilityFilter as D}from"./FeatureVisibilityFilter.js";import{emptyHighlightHandle as O}from"./highlightUtils.js";import{Attribute as k}from"../../webgl-engine/lib/Attribute.js";import{DrapedHeatmapRenderer as A}from"../../webgl-engine/lib/DrapedHeatmapRenderer.js";import{Geometry as j}from"../../webgl-engine/lib/Geometry.js";import{GeometryBaseInstance as M}from"../../webgl-engine/lib/GeometryBaseInstance.js";import{RenderGeometry as N}from"../../webgl-engine/lib/RenderGeometry.js";import{HeatmapDensityMaterial as P}from"../../webgl-engine/materials/HeatmapDensityMaterial.js";import{scaleBoundsPredicate as F,isScaleRangeActive as I}from"../../../support/layerViewUtils.js";import{PixelType as L}from"../../../webgl/enums.js";import{loadHeatmapTextureConfiguration as R,fallBackHeatmapConfiguration as z}from"../../../webgl/heatmapTextureUtils.js";const B=112;let V=class extends s{constructor(e){super(e),this.type=`heatmap`,this.preferredUpdatePolicy=0,this.dataExtent=null,this.drapeSourceType=1,this._renderGeometries=new Map,this._fieldTotal=0,this._drapeSourceRenderer=null,this._dataType=L.HALF_FLOAT,this._pixelFormat=6408,this._baseInstance=new M([]),this._updatingHandles=new h}initialize(){let e;try{e=R(this._renderView.renderingContext,r.getLogger(this))}catch(t){this.addResolvingPromise(Promise.reject(t)),e=z}let{dataType:t,samplingMode:i,pixelFormat:a,internalFormat:o}=e;this._featureStore=new S({geometryType:`esriGeometryPoint`,hasZ:this.hasZ,hasM:this.hasM}),this._dataType=t,this._pixelFormat=a;let s=t!==L.FLOAT,d=this.view.overlayManager,f={...this._rendererParameters,stage:this.view.stage,dataType:t,samplingMode:i,pixelFormat:a,internalFormat:o,rendererContext:d.renderer,drapeSource:this};this._drapeSourceRenderer=new A(f),d.registerDrapeSource(this,this._drapeSourceRenderer),this._material=new P({usesHalfFloats:s}),this._materialWithField=new P({usesHalfFloats:s,isAttributeDriven:!0}),this._filterVisibility=new D({context:{configuration:this.owner,featureStore:this.featureStore,getFeatureCount:()=>this._loadedPointGraphics.length,setAllFeaturesVisibility:e=>this._setAllFeaturesVisibility(e),clearFeaturesVisibility:()=>this._setAllFeaturesVisibility(!0),updateFeatureVisibilities:e=>this._updateFeatureVisibilities(e)}}),this._updatingHandles.addOnCollectionChange(()=>this._loadedPointGraphics,e=>this._onLoadedFeaturesChange(e),c),this._updatingHandles.addWhen(()=>this._materialParameters,e=>this._forEachMaterial(t=>t.setParameters(e)),c),this._updatingHandles.add(()=>this._rendererParameters,e=>this._drapeSourceRenderer.set(e)),this._updatingHandles.add(()=>this._heatmapRendererField,()=>{this._recreate()},l),this._updatingHandles.add(()=>({fieldName:this._heatmapRendererFieldName,numeric:this._heatmapRendererFieldIsNumeric}),({fieldName:e,numeric:t})=>{if(e!=null&&t){let t=0;this._featureStore.forEach(n=>t+=n.attributes[e]??0),this._fieldTotal=t}else this._fieldTotal=this._featureStore.numFeatures},c),this.addHandles([u(()=>({fieldName:this._heatmapRendererFieldName,field:this._heatmapRendererField}),({fieldName:e,field:t})=>{e&&!t&&r.getLogger(this).warn(`Heatmap renderer field '${e}' for layer '${this.layer.title??this.layer.id}' not found`)}),u(()=>({field:this._heatmapRendererField,numeric:this._heatmapRendererFieldIsNumeric}),({field:e,numeric:t})=>{e!=null&&!t&&r.getLogger(this).warn(`Heatmap renderer field '${e.name}' for layer '${this.layer.title??this.layer.id}' does not contain numeric values and cannot be used to drive the heatmap density`)}),n(()=>this.view.overlayManager.unregisterDrapeSource(this))])}destroy(){this._renderGeometries.clear(),this._material=null,this._materialWithField=null,this._featureStore.clear(),this._featureStore=null,this._updatingHandles.destroy(),this._baseInstance=null}get layer(){return this.owner.layer}get featureStore(){return this._featureStore}get updating(){return this._updatingHandles.updating||this.filterVisibility.updating}get updatingRemaining(){return 0}get suspendInfo(){return{}}get legendEnabled(){return!0}get filterVisibility(){return this._filterVisibility}get displayFeatureLimit(){let e=this.owner?.view?.quality??1,t=this.owner?.view?.qualitySettings,n=t?Math.ceil(t.graphics3D.maxTotalNumberOfFeatures*e):0,r=n*6;return new T(r,n)}get hasZ(){return`hasZ`in this.layer&&this.layer.hasZ===!0}get hasM(){return`hasM`in this.layer&&this.layer.hasM}get view(){return this.owner.view}get fullOpacity(){return this.owner.fullOpacity}get updatePolicy(){return this.owner.updatePolicy}get scaleVisibilitySuspended(){if(!this._isScaleRangeActive)return!1;let{minScale:e,maxScale:t}=this.layer.effectiveScaleRange,{scale:n}=this.view;return!F(n,e??0,t??0)}get usedMemory(){let e=this.usedMemoryPerFeature*this._featureStore.numFeatures,t=this._pixelFormat===6403?1:4,n=this._dataType===L.FLOAT?4:2,r=Math.ceil((this._overlayRenderer?.overlays[0]?.resolution??0)*this._densityMapPixelRatio)??0;return r*r*t*n+e+H}get usedMemoryPerFeature(){let e=this._loadedPointGraphics.find(()=>!0);if(e==null)return 0;let t=o(e);return i([0,0],a)+(this._heatmapRendererFieldIsNumeric?a:0)+t}get loadedFeatures(){return this._featureStore.numFeatures}get unprocessedMemoryEstimate(){return 0}get performanceInfo(){return new E(this._renderGeometries.size,this._visibleFeatures,0,0)}get renderer(){return this._heatmapRenderer}get _overlayRenderer(){return this.view.overlayManager.renderer}get _overlaySpatialReference(){return this.view.overlayManager.spatialReference}get _rendererParameters(){return{...this._radiusParameter,...this._densityParameters,...this._colorRampParameter,...this._pixelRatioParameter}}get _materialParameters(){return{...this._radiusParameter,...this._resolutionForScaleParameter}}get _densityParameters(){let e=this._heatmapRenderer;if(e==null)return null;let{minDensity:t,maxDensity:n}=e;return{minDensity:t,maxDensity:n,fieldTotal:this._fieldTotal}}get _radiusParameter(){let e=this._heatmapRenderer;return e?{searchRadius:d(this._clampSearchRadius(e.radius))}:null}get _resolutionForScaleParameter(){let e=this._heatmapRenderer;if(!e)return null;let{referenceScale:t}=e;return{resolutionForScale:t===0?0:v(t,this.view.spatialReference)}}get _colorRampParameter(){let e=this._heatmapRenderer;return e?{colorRampData:w(e.colorStops)}:null}get _pixelRatioParameter(){return{pixelRatio:this._densityMapPixelRatio}}get _densityMapPixelRatio(){return this.owner?.view?.qualitySettings.heatmap.pixelRatio??1}get _renderView(){return this.view.stage.renderView}get _featuresArePoints(){return this.layer.geometryType===`point`}get _loadedPointGraphics(){return this.owner.loadedGraphics}get _heatmapRenderer(){let e=this.layer.renderer;return e?.type===`heatmap`?e:null}get _heatmapRendererFieldName(){return this._heatmapRenderer?.field}get _heatmapRendererField(){let e=this._heatmapRendererFieldName;return e==null?null:this.layer.fieldsIndex.get(e)}get _heatmapRendererFieldIsNumeric(){let e=this._heatmapRendererField;return e!=null&&C(e)}get _isScaleRangeActive(){let{layer:e}=this;if(!(`effectiveScaleRange`in e))return!1;let{minScale:t,maxScale:n}=e.effectiveScaleRange;return I(t,n)}get _visibleFeatures(){return this._renderGeometries.values().reduce((e,{visible:t})=>e+ +!!t,0)}async whenGraphicBounds(){return null}computeAttachmentOrigin(){return null}highlightByGraphics(){return O}highlightByObjectIds(){return O}maskOccludee(){return n()}setObjectIdVisibility(){}refreshFilter(){this.filterVisibility.reapply()}_onLoadedFeaturesChange(e){if(!this._featuresArePoints)return;let{objectIdField:n}=this.layer;this._featureStore.removeManyById(e.removed.map(e=>y(e,n))),this._featureStore.addMany(e.added.map(e=>{let{attributes:t,centroid:r,geometry:i}=e,a=new x(b(i),t,r?b(r):null,y(e,n));return a.displayId=e.uid,a}));let r=e.added,i=e.removed;this._fieldTotal+=this._computeFieldTotalChange(r,i);let a=i.map(({uid:e})=>{let t=this._renderGeometries.get(e);return this._renderGeometries.delete(e),t}).filter(t),o=r.map(e=>{let t=this._pointGraphicToRenderGeometry(e);return this._renderGeometries.set(e.uid,t),t});a.length>0&&this._drapeSourceRenderer.removeGeometries(a,2),o.length>0&&this._drapeSourceRenderer.addGeometries(o,0),(o.length>0||a.length>0)&&(this.filterVisibility.reapply(),this._renderView.requestRender())}_recreate(){if(!this._loadedPointGraphics)return;let e=this._loadedPointGraphics.toArray();this._onLoadedFeaturesChange({added:e,removed:e})}_pointGraphicToRenderGeometry(e){let t=this._heatmapRendererFieldName,n=t==null?this._material:this._materialWithField,r=m();g(e.geometry,r,this._overlaySpatialReference);let i=_(1),a=[[`position`,new k([r[0],r[1]],i,2)]],o=this._heatmapRendererFieldIsNumeric;t!=null&&a.push([`featureAttribute`,new k([o?e.attributes[t]??0:0],i,1)]);let s=new N(new j(n,a,null,void 0,this._baseInstance),{layerViewUid:this.owner.layerViewUid,graphicUid:e.uid});return s.visible=this.filterVisibility.defaultVisibility,s}_forEachMaterial(e){e(this._material),e(this._materialWithField)}_computeFieldTotalChange(e,t){if(this._heatmapRendererFieldName==null||!this._heatmapRendererFieldIsNumeric)return e.length-t.length;let n=this._heatmapRendererFieldName,r=(e,t)=>e+(t.attributes[n]??0);return e.reduce(r,0)-t.reduce(r,0)}_clampSearchRadius(e){return e>112&&r.getLogger(this).warnOnce(`SceneView supports a maximum radius of 112 pt for HeatmapRenderer.`),Math.min(e,112)}_updateFeatureVisibilities(e){let t=[];this._featureStore.forEach(({objectId:n,displayId:r})=>{let i=e(n),a=this._renderGeometries.get(r);a&&a.visible!==i&&(t.push(a),a.visible=i)}),this._drapeSourceRenderer.modifyGeometries(t,1)}_setAllFeaturesVisibility(e){let t=[];for(let n of this._renderGeometries.values())n.visible!==e&&(t.push(n),n.visible=e);this._drapeSourceRenderer.modifyGeometries(t,1)}get test(){}};e([f()],V.prototype,`type`,void 0),e([f({constructOnly:!0})],V.prototype,`owner`,void 0),e([f()],V.prototype,`layer`,null),e([f()],V.prototype,`featureStore`,null),e([f()],V.prototype,`updating`,null),e([f()],V.prototype,`updatingRemaining`,null),e([f()],V.prototype,`suspendInfo`,null),e([f()],V.prototype,`legendEnabled`,null),e([f()],V.prototype,`filterVisibility`,null),e([f()],V.prototype,`displayFeatureLimit`,null),e([f()],V.prototype,`preferredUpdatePolicy`,void 0),e([f()],V.prototype,`hasZ`,null),e([f()],V.prototype,`hasM`,null),e([f()],V.prototype,`dataExtent`,void 0),e([f()],V.prototype,`view`,null),e([f()],V.prototype,`fullOpacity`,null),e([f()],V.prototype,`updatePolicy`,null),e([f()],V.prototype,`drapeSourceType`,void 0),e([f()],V.prototype,`scaleVisibilitySuspended`,null),e([f()],V.prototype,`renderer`,null),e([f()],V.prototype,`_featureStore`,void 0),e([f()],V.prototype,`_filterVisibility`,void 0),e([f()],V.prototype,`_overlayRenderer`,null),e([f()],V.prototype,`_overlaySpatialReference`,null),e([f()],V.prototype,`_rendererParameters`,null),e([f()],V.prototype,`_materialParameters`,null),e([f()],V.prototype,`_densityParameters`,null),e([f()],V.prototype,`_radiusParameter`,null),e([f()],V.prototype,`_resolutionForScaleParameter`,null),e([f()],V.prototype,`_colorRampParameter`,null),e([f()],V.prototype,`_pixelRatioParameter`,null),e([f()],V.prototype,`_densityMapPixelRatio`,null),e([f()],V.prototype,`_renderGeometries`,void 0),e([f()],V.prototype,`_material`,void 0),e([f()],V.prototype,`_materialWithField`,void 0),e([f()],V.prototype,`_renderView`,null),e([f()],V.prototype,`_featuresArePoints`,null),e([f()],V.prototype,`_loadedPointGraphics`,null),e([f()],V.prototype,`_heatmapRenderer`,null),e([f()],V.prototype,`_heatmapRendererFieldName`,null),e([f()],V.prototype,`_heatmapRendererField`,null),e([f()],V.prototype,`_heatmapRendererFieldIsNumeric`,null),e([f()],V.prototype,`_fieldTotal`,void 0),e([f()],V.prototype,`_drapeSourceRenderer`,void 0),e([f()],V.prototype,`_isScaleRangeActive`,null),V=e([p(`esri.views.3d.layers.support.HeatmapFeatureProcessor`)],V);const H=i([0,0,0,0,0,0,0,0],a);export{V as HeatmapFeatureProcessor,B as maxRadiusPt};
2
+ import{__decorate as e}from"tslib";import{isSome as t}from"../../../../core/arrayUtils.js";import{makeHandle as n}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import r from"../../../../core/Logger.js";import{estimateFixedArrayMemory as i,estimateNumberMemory as a,estimateAttributesMemory as o}from"../../../../core/memoryEstimations.js";import{EsriPromise as s}from"../../../../core/Promise.js";import{initial as c,sync as l,watch as u}from"../../../../core/reactiveUtils.js";import{pt2px as d}from"../../../../core/screenUtils.js";import{property as f,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import{projectPointToVector as g}from"../../../../geometry/projection/projectPointToVector.js";import{getContinuousIndexArray as _}from"../../../../geometry/support/Indices.js";import{scaleBoundsPredicate as v,getResolutionForScale as y,isScaleRangeActive as b}from"../../../../geometry/support/scaleUtils.js";import{getObjectId as x}from"../../../../layers/graphics/dehydratedFeatures.js";import{convertFromPoint as S}from"../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as C}from"../../../../layers/graphics/OptimizedFeature.js";import w from"../../../../layers/graphics/data/FeatureStore.js";import{isNumericField as T}from"../../../../layers/support/fieldUtils.js";import{generateGradient as E}from"../../../../renderers/support/heatmapUtils.js";import{DisplayFeatureLimit as D}from"../graphics/DisplayFeatureLimit.js";import{GraphicsCorePerformanceInfo as O}from"../graphics/GraphicsCorePerformanceInfo.js";import{FeatureVisibilityFilter as k}from"./FeatureVisibilityFilter.js";import{emptyHighlightHandle as A}from"./highlightUtils.js";import{Attribute as j}from"../../webgl-engine/lib/Attribute.js";import{DrapedHeatmapRenderer as M}from"../../webgl-engine/lib/DrapedHeatmapRenderer.js";import{Geometry as N}from"../../webgl-engine/lib/Geometry.js";import{GeometryBaseInstance as P}from"../../webgl-engine/lib/GeometryBaseInstance.js";import{RenderGeometry as F}from"../../webgl-engine/lib/RenderGeometry.js";import{HeatmapDensityMaterial as I}from"../../webgl-engine/materials/HeatmapDensityMaterial.js";import{PixelType as L}from"../../../webgl/enums.js";import{loadHeatmapTextureConfiguration as R,fallBackHeatmapConfiguration as z}from"../../../webgl/heatmapTextureUtils.js";const B=112;let V=class extends s{constructor(e){super(e),this.type=`heatmap`,this.preferredUpdatePolicy=0,this.dataExtent=null,this.drapeSourceType=1,this._renderGeometries=new Map,this._fieldTotal=0,this._drapeSourceRenderer=null,this._dataType=L.HALF_FLOAT,this._pixelFormat=6408,this._baseInstance=new P([]),this._updatingHandles=new h}initialize(){let e;try{e=R(this._renderView.renderingContext,r.getLogger(this))}catch(t){this.addResolvingPromise(Promise.reject(t)),e=z}let{dataType:t,samplingMode:i,pixelFormat:a,internalFormat:o}=e;this._featureStore=new w({geometryType:`esriGeometryPoint`,hasZ:this.hasZ,hasM:this.hasM}),this._dataType=t,this._pixelFormat=a;let s=t!==L.FLOAT,d=this.view.overlayManager,f={...this._rendererParameters,stage:this.view.stage,dataType:t,samplingMode:i,pixelFormat:a,internalFormat:o,rendererContext:d.renderer,drapeSource:this};this._drapeSourceRenderer=new M(f),d.registerDrapeSource(this,this._drapeSourceRenderer),this._material=new I({usesHalfFloats:s}),this._materialWithField=new I({usesHalfFloats:s,isAttributeDriven:!0}),this._filterVisibility=new k({context:{configuration:this.owner,featureStore:this.featureStore,getFeatureCount:()=>this._loadedPointGraphics.length,setAllFeaturesVisibility:e=>this._setAllFeaturesVisibility(e),clearFeaturesVisibility:()=>this._setAllFeaturesVisibility(!0),updateFeatureVisibilities:e=>this._updateFeatureVisibilities(e)}}),this._updatingHandles.addOnCollectionChange(()=>this._loadedPointGraphics,e=>this._onLoadedFeaturesChange(e),c),this._updatingHandles.addWhen(()=>this._materialParameters,e=>this._forEachMaterial(t=>t.setParameters(e)),c),this._updatingHandles.add(()=>this._rendererParameters,e=>this._drapeSourceRenderer.set(e)),this._updatingHandles.add(()=>this._heatmapRendererField,()=>{this._recreate()},l),this._updatingHandles.add(()=>({fieldName:this._heatmapRendererFieldName,numeric:this._heatmapRendererFieldIsNumeric}),({fieldName:e,numeric:t})=>{if(e!=null&&t){let t=0;this._featureStore.forEach(n=>t+=n.attributes[e]??0),this._fieldTotal=t}else this._fieldTotal=this._featureStore.numFeatures},c),this.addHandles([u(()=>({fieldName:this._heatmapRendererFieldName,field:this._heatmapRendererField}),({fieldName:e,field:t})=>{e&&!t&&r.getLogger(this).warn(`Heatmap renderer field '${e}' for layer '${this.layer.title??this.layer.id}' not found`)}),u(()=>({field:this._heatmapRendererField,numeric:this._heatmapRendererFieldIsNumeric}),({field:e,numeric:t})=>{e!=null&&!t&&r.getLogger(this).warn(`Heatmap renderer field '${e.name}' for layer '${this.layer.title??this.layer.id}' does not contain numeric values and cannot be used to drive the heatmap density`)}),n(()=>this.view.overlayManager.unregisterDrapeSource(this))])}destroy(){this._renderGeometries.clear(),this._material=null,this._materialWithField=null,this._featureStore.clear(),this._featureStore=null,this._updatingHandles.destroy(),this._baseInstance=null}get layer(){return this.owner.layer}get featureStore(){return this._featureStore}get updating(){return this._updatingHandles.updating||this.filterVisibility.updating}get updatingRemaining(){return 0}get suspendInfo(){return{}}get legendEnabled(){return!0}get filterVisibility(){return this._filterVisibility}get displayFeatureLimit(){let e=this.owner?.view?.quality??1,t=this.owner?.view?.qualitySettings,n=t?Math.ceil(t.graphics3D.maxTotalNumberOfFeatures*e):0,r=n*6;return new D(r,n)}get hasZ(){return`hasZ`in this.layer&&this.layer.hasZ===!0}get hasM(){return`hasM`in this.layer&&this.layer.hasM}get view(){return this.owner.view}get fullOpacity(){return this.owner.fullOpacity}get updatePolicy(){return this.owner.updatePolicy}get scaleVisibilitySuspended(){if(!this._isScaleRangeActive)return!1;let{minScale:e,maxScale:t}=this.layer.effectiveScaleRange,{scale:n}=this.view;return!v(n,e??0,t??0)}get usedMemory(){let e=this.usedMemoryPerFeature*this._featureStore.numFeatures,t=this._pixelFormat===6403?1:4,n=this._dataType===L.FLOAT?4:2,r=Math.ceil((this._overlayRenderer?.overlays[0]?.resolution??0)*this._densityMapPixelRatio)??0;return r*r*t*n+e+H}get usedMemoryPerFeature(){let e=this._loadedPointGraphics.find(()=>!0);if(e==null)return 0;let t=o(e);return i([0,0],a)+(this._heatmapRendererFieldIsNumeric?a:0)+t}get loadedFeatures(){return this._featureStore.numFeatures}get unprocessedMemoryEstimate(){return 0}get performanceInfo(){return new O(this._renderGeometries.size,this._visibleFeatures,0,0)}get renderer(){return this._heatmapRenderer}get _overlayRenderer(){return this.view.overlayManager.renderer}get _overlaySpatialReference(){return this.view.overlayManager.spatialReference}get _rendererParameters(){return{...this._radiusParameter,...this._densityParameters,...this._colorRampParameter,...this._pixelRatioParameter}}get _materialParameters(){return{...this._radiusParameter,...this._resolutionForScaleParameter}}get _densityParameters(){let e=this._heatmapRenderer;if(e==null)return null;let{minDensity:t,maxDensity:n}=e;return{minDensity:t,maxDensity:n,fieldTotal:this._fieldTotal}}get _radiusParameter(){let e=this._heatmapRenderer;return e?{searchRadius:d(this._clampSearchRadius(e.radius))}:null}get _resolutionForScaleParameter(){let e=this._heatmapRenderer;if(!e)return null;let{referenceScale:t}=e;return{resolutionForScale:t===0?0:y(t,this.view.spatialReference)}}get _colorRampParameter(){let e=this._heatmapRenderer;return e?{colorRampData:E(e.colorStops)}:null}get _pixelRatioParameter(){return{pixelRatio:this._densityMapPixelRatio}}get _densityMapPixelRatio(){return this.owner?.view?.qualitySettings.heatmap.pixelRatio??1}get _renderView(){return this.view.stage.renderView}get _featuresArePoints(){return this.layer.geometryType===`point`}get _loadedPointGraphics(){return this.owner.loadedGraphics}get _heatmapRenderer(){let e=this.layer.renderer;return e?.type===`heatmap`?e:null}get _heatmapRendererFieldName(){return this._heatmapRenderer?.field}get _heatmapRendererField(){let e=this._heatmapRendererFieldName;return e==null?null:this.layer.fieldsIndex.get(e)}get _heatmapRendererFieldIsNumeric(){let e=this._heatmapRendererField;return e!=null&&T(e)}get _isScaleRangeActive(){let{layer:e}=this;if(!(`effectiveScaleRange`in e))return!1;let{minScale:t,maxScale:n}=e.effectiveScaleRange;return b(t,n)}get _visibleFeatures(){return this._renderGeometries.values().reduce((e,{visible:t})=>e+ +!!t,0)}async whenGraphicBounds(){return null}computeAttachmentOrigin(){return null}highlightByGraphics(){return A}highlightByObjectIds(){return A}maskOccludee(){return n()}setObjectIdVisibility(){}refreshFilter(){this.filterVisibility.reapply()}_onLoadedFeaturesChange(e){if(!this._featuresArePoints)return;let{objectIdField:n}=this.layer;this._featureStore.removeManyById(e.removed.map(e=>x(e,n))),this._featureStore.addMany(e.added.map(e=>{let{attributes:t,centroid:r,geometry:i}=e,a=new C(S(i),t,r?S(r):null,x(e,n));return a.displayId=e.uid,a}));let r=e.added,i=e.removed;this._fieldTotal+=this._computeFieldTotalChange(r,i);let a=i.map(({uid:e})=>{let t=this._renderGeometries.get(e);return this._renderGeometries.delete(e),t}).filter(t),o=r.map(e=>{let t=this._pointGraphicToRenderGeometry(e);return this._renderGeometries.set(e.uid,t),t});a.length>0&&this._drapeSourceRenderer.removeGeometries(a,2),o.length>0&&this._drapeSourceRenderer.addGeometries(o,0),(o.length>0||a.length>0)&&(this.filterVisibility.reapply(),this._renderView.requestRender())}_recreate(){if(!this._loadedPointGraphics)return;let e=this._loadedPointGraphics.toArray();this._onLoadedFeaturesChange({added:e,removed:e})}_pointGraphicToRenderGeometry(e){let t=this._heatmapRendererFieldName,n=t==null?this._material:this._materialWithField,r=m();g(e.geometry,r,this._overlaySpatialReference);let i=_(1),a=[[`position`,new j([r[0],r[1]],i,2)]],o=this._heatmapRendererFieldIsNumeric;t!=null&&a.push([`featureAttribute`,new j([o?e.attributes[t]??0:0],i,1)]);let s=new F(new N(n,a,null,void 0,this._baseInstance),{layerViewUid:this.owner.layerViewUid,graphicUid:e.uid});return s.visible=this.filterVisibility.defaultVisibility,s}_forEachMaterial(e){e(this._material),e(this._materialWithField)}_computeFieldTotalChange(e,t){if(this._heatmapRendererFieldName==null||!this._heatmapRendererFieldIsNumeric)return e.length-t.length;let n=this._heatmapRendererFieldName,r=(e,t)=>e+(t.attributes[n]??0);return e.reduce(r,0)-t.reduce(r,0)}_clampSearchRadius(e){return e>112&&r.getLogger(this).warnOnce(`SceneView supports a maximum radius of 112 pt for HeatmapRenderer.`),Math.min(e,112)}_updateFeatureVisibilities(e){let t=[];this._featureStore.forEach(({objectId:n,displayId:r})=>{let i=e(n),a=this._renderGeometries.get(r);a&&a.visible!==i&&(t.push(a),a.visible=i)}),this._drapeSourceRenderer.modifyGeometries(t,1)}_setAllFeaturesVisibility(e){let t=[];for(let n of this._renderGeometries.values())n.visible!==e&&(t.push(n),n.visible=e);this._drapeSourceRenderer.modifyGeometries(t,1)}get test(){}};e([f()],V.prototype,`type`,void 0),e([f({constructOnly:!0})],V.prototype,`owner`,void 0),e([f()],V.prototype,`layer`,null),e([f()],V.prototype,`featureStore`,null),e([f()],V.prototype,`updating`,null),e([f()],V.prototype,`updatingRemaining`,null),e([f()],V.prototype,`suspendInfo`,null),e([f()],V.prototype,`legendEnabled`,null),e([f()],V.prototype,`filterVisibility`,null),e([f()],V.prototype,`displayFeatureLimit`,null),e([f()],V.prototype,`preferredUpdatePolicy`,void 0),e([f()],V.prototype,`hasZ`,null),e([f()],V.prototype,`hasM`,null),e([f()],V.prototype,`dataExtent`,void 0),e([f()],V.prototype,`view`,null),e([f()],V.prototype,`fullOpacity`,null),e([f()],V.prototype,`updatePolicy`,null),e([f()],V.prototype,`drapeSourceType`,void 0),e([f()],V.prototype,`scaleVisibilitySuspended`,null),e([f()],V.prototype,`renderer`,null),e([f()],V.prototype,`_featureStore`,void 0),e([f()],V.prototype,`_filterVisibility`,void 0),e([f()],V.prototype,`_overlayRenderer`,null),e([f()],V.prototype,`_overlaySpatialReference`,null),e([f()],V.prototype,`_rendererParameters`,null),e([f()],V.prototype,`_materialParameters`,null),e([f()],V.prototype,`_densityParameters`,null),e([f()],V.prototype,`_radiusParameter`,null),e([f()],V.prototype,`_resolutionForScaleParameter`,null),e([f()],V.prototype,`_colorRampParameter`,null),e([f()],V.prototype,`_pixelRatioParameter`,null),e([f()],V.prototype,`_densityMapPixelRatio`,null),e([f()],V.prototype,`_renderGeometries`,void 0),e([f()],V.prototype,`_material`,void 0),e([f()],V.prototype,`_materialWithField`,void 0),e([f()],V.prototype,`_renderView`,null),e([f()],V.prototype,`_featuresArePoints`,null),e([f()],V.prototype,`_loadedPointGraphics`,null),e([f()],V.prototype,`_heatmapRenderer`,null),e([f()],V.prototype,`_heatmapRendererFieldName`,null),e([f()],V.prototype,`_heatmapRendererField`,null),e([f()],V.prototype,`_heatmapRendererFieldIsNumeric`,null),e([f()],V.prototype,`_fieldTotal`,void 0),e([f()],V.prototype,`_drapeSourceRenderer`,void 0),e([f()],V.prototype,`_isScaleRangeActive`,null),V=e([p(`esri.views.3d.layers.support.HeatmapFeatureProcessor`)],V);const H=i([0,0,0,0,0,0,0,0],a);export{V as HeatmapFeatureProcessor,B as maxRadiusPt};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../Color.js";import n from"../../../../core/Accessor.js";import{isSome as r}from"../../../../core/arrayUtils.js";import{makeHandle as i,destroyHandle as a}from"../../../../core/handleUtils.js";import{watch as o,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{initializeProjection as u,project as d}from"../../../../geometry/projectionUtils.js";import{GraphicsCollection as f}from"../../../../support/GraphicsCollection.js";import p from"../../../../symbols/SimpleFillSymbol.js";import m from"../../../../symbols/SimpleLineSymbol.js";import h from"../../../../symbols/SimpleMarkerSymbol.js";import{getHighlightGraphics as g}from"../../../layers/support/highlightUtils.js";let _=class extends n{get updating(){return this.graphicsView?.updating??!1}constructor(e){super(e),this._highlightCounts=new Map,this._graphicsViewLoader=null,this.graphics=new f,this.graphicsView=null,this.suspended=!1;let n=new t([255,255,255,1/255]);this._symbols=new Map([[`point`,new h({size:`2px`,style:`square`,color:n})],[`polyline`,new m({width:`2px`,color:n})],[`polygon`,new p({outline:null,color:n})]])}highlight(e,t){let n=g(e);if(n.length===0)return i();let r=!1,a;return this.updatingHandles.consumePromise(Promise.all([this._createHighlightGraphics(n),this._ensureGraphicsView3D()]).then(([e,n])=>{!r&&n&&(a=this._addHighlightGraphics(n,e,t))})),i(()=>{r=!0,a?.remove()})}preload(){this._ensureGraphicsView3D()}_addHighlightGraphics(e,t,n){for(let e of t)this._highlightCounts.set(e,(this._highlightCounts.get(e)??0)+1);this.graphics.addMany(t);let r=e.highlight(t,n);return i(()=>{this._removeHighlightGraphics(t),r.remove()})}_removeHighlightGraphics(e){this.graphics.removeMany(e.filter(e=>{let t=Math.max(0,(this._highlightCounts.get(e)??0)-1);return t===0?(this._highlightCounts.delete(e),!0):(this._highlightCounts.set(e,t),!1)}))}async _ensureGraphicsView3D(){if(this.graphicsView)return this.graphicsView;this._graphicsViewLoader||=import(`../GraphicsView3D.js`);let{default:e}=await this._graphicsViewLoader;if(this.destroyed)return null;let t=new e({view:this.view,layer:{type:`graphics-view-3d-dummy`,id:this.layer.id,uid:this.layer.uid,elevationInfo:{mode:`on-the-ground`}},getGraphics:()=>this.graphics,drapeSourcePriorityOffset:.5});return this._set(`graphicsView`,t),this.addHandles([a(this.graphicsView),o(()=>this.suspended,e=>{t.suspended=e},s)]),t}async _createHighlightGraphics(e){let t=e.map(({geometry:e})=>e?.spatialReference).filter(r).reduce((e,t)=>((e.length===0||!e.at(-1)?.equals(t))&&e.push(t),e),[]),n=this.view.spatialReference,i=t.map(e=>({source:e,dest:n}));try{await u(i)}catch{return[]}return e.map(e=>{let{geometry:t}=e;try{let r=t?d(t,n):null,i=e.cloneShallow();return i.geometry=r,i.symbol=this._symbols.get(r?.type),i}catch{return e}})}};e([c()],_.prototype,`graphics`,void 0),e([c()],_.prototype,`graphicsView`,void 0),e([c()],_.prototype,`view`,void 0),e([c()],_.prototype,`layer`,void 0),e([c()],_.prototype,`updatingHandles`,void 0),e([c()],_.prototype,`suspended`,void 0),e([c()],_.prototype,`updating`,null),_=e([l(`esri.views.3d.layers.support.ImageHighlightHelper3D`)],_);export{_ as ImageHighlightHelper3D};
2
+ import{__decorate as e}from"tslib";import t from"../../../../Color.js";import n from"../../../../core/Accessor.js";import{isSome as r}from"../../../../core/arrayUtils.js";import{makeHandle as i,destroyHandle as a}from"../../../../core/handleUtils.js";import{watch as o,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{assertNotMesh as u}from"../../../../geometry/asserts.js";import{initializeProjection as d,project as f}from"../../../../geometry/projectionUtils.js";import{GraphicsCollection as p}from"../../../../support/GraphicsCollection.js";import m from"../../../../symbols/SimpleFillSymbol.js";import h from"../../../../symbols/SimpleLineSymbol.js";import g from"../../../../symbols/SimpleMarkerSymbol.js";import{getHighlightGraphics as _}from"../../../layers/support/highlightUtils.js";let v=class extends n{get updating(){return this.graphicsView?.updating??!1}constructor(e){super(e),this._highlightCounts=new Map,this._graphicsViewLoader=null,this.graphics=new p,this.graphicsView=null,this.suspended=!1;let n=new t([255,255,255,1/255]);this._symbols=new Map([[`point`,new g({size:`2px`,style:`square`,color:n})],[`polyline`,new h({width:`2px`,color:n})],[`polygon`,new m({outline:null,color:n})]])}highlight(e,t){let n=_(e);if(n.length===0)return i();let r=!1,a;return this.updatingHandles.consumePromise(Promise.all([this._createHighlightGraphics(n),this._ensureGraphicsView3D()]).then(([e,n])=>{!r&&n&&(a=this._addHighlightGraphics(n,e,t))})),i(()=>{r=!0,a?.remove()})}preload(){this._ensureGraphicsView3D()}_addHighlightGraphics(e,t,n){for(let e of t)this._highlightCounts.set(e,(this._highlightCounts.get(e)??0)+1);this.graphics.addMany(t);let r=e.highlight(t,n);return i(()=>{this._removeHighlightGraphics(t),r.remove()})}_removeHighlightGraphics(e){this.graphics.removeMany(e.filter(e=>{let t=Math.max(0,(this._highlightCounts.get(e)??0)-1);return t===0?(this._highlightCounts.delete(e),!0):(this._highlightCounts.set(e,t),!1)}))}async _ensureGraphicsView3D(){if(this.graphicsView)return this.graphicsView;this._graphicsViewLoader||=import(`../GraphicsView3D.js`);let{default:e}=await this._graphicsViewLoader;if(this.destroyed)return null;let t=new e({view:this.view,layer:{type:`graphics-view-3d-dummy`,id:this.layer.id,uid:this.layer.uid,elevationInfo:{mode:`on-the-ground`}},getGraphics:()=>this.graphics,drapeSourcePriorityOffset:.5});return this._set(`graphicsView`,t),this.addHandles([a(this.graphicsView),o(()=>this.suspended,e=>{t.suspended=e},s)]),t}async _createHighlightGraphics(e){let t=e.map(({geometry:e})=>e?.spatialReference).filter(r).reduce((e,t)=>((e.length===0||!e.at(-1)?.equals(t))&&e.push(t),e),[]),n=this.view.spatialReference,i=t.map(e=>({source:e,dest:n}));try{await d(i)}catch{return[]}return e.map(e=>{let{geometry:t}=e;try{u(t);let r=t?f(t,n):null,i=e.cloneShallow();return i.geometry=r,i.symbol=this._symbols.get(r?.type),i}catch{return e}})}};e([c()],v.prototype,`graphics`,void 0),e([c()],v.prototype,`graphicsView`,void 0),e([c()],v.prototype,`view`,void 0),e([c()],v.prototype,`layer`,void 0),e([c()],v.prototype,`updatingHandles`,void 0),e([c()],v.prototype,`suspended`,void 0),e([c()],v.prototype,`updating`,null),v=e([l(`esri.views.3d.layers.support.ImageHighlightHelper3D`)],v);export{v as ImageHighlightHelper3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- class e{constructor(e,t){this._maxTotalSamples=e,this._maxDistance=t,this.count=0,this.numSamples=0}get done(){return this.numRemainingSamples===0}get numRemainingSamples(){return Math.max(0,this._maxTotalSamples-this.numSamples)}get ratio(){return this.numSamples?this.count/this.numSamples:0}sampleGeometry(e,t,n){switch(e?.type){case`point`:if(t?.type!==`point`)return;this._withinDistance(e.x-t.x,e.y-t.y)&&this.count++,this.numSamples++;break;case`polyline`:case`polygon`:{let t=e.type===`polyline`?e.paths:e.rings;for(let e=0;e<t.length;e++){let r=t[e],i=t.length-e,a=n/i,o=Math.max(1,Math.ceil(r.length/a));for(let e=Math.floor(o/2);e<r.length-1;e+=o){let t=r[e],i=r[e+1],a=i[0]-t[0],o=i[1]-t[1];if(this._withinDistance(a,o)&&this.count++,this.numSamples++,n--,n<=0||this.numSamples>=this._maxTotalSamples)return}}}}}_withinDistance(e,t){return Math.abs(e)<=this._maxDistance||Math.abs(t)<=this._maxDistance}}export{e as SampledGeometryMaxDistanceRatio};
2
+ class e{constructor(e,t){this._maxTotalSamples=e,this.count=0,this.numSamples=0,this._maxDistanceSquared=t**2}get done(){return this.numRemainingSamples===0}get numRemainingSamples(){return Math.max(0,this._maxTotalSamples-this.numSamples)}get ratio(){return this.numSamples?this.count/this.numSamples:0}sampleGeometry(e,t,n){switch(e?.type){case`point`:if(t?.type!==`point`)return;this._withinDistance(e.x-t.x,e.y-t.y)&&this.count++,this.numSamples++;break;case`polyline`:case`polygon`:{let t=e.type===`polyline`?e.paths:e.rings;for(let e=0;e<t.length;e++){let r=t[e],i=t.length-e,a=n/i,o=Math.max(1,Math.ceil(r.length/a));for(let e=Math.floor(o/2);e<r.length-1;e+=o){let t=r[e],i=r[e+1],a=i[0]-t[0],o=i[1]-t[1];if(this._withinDistance(a,o)&&this.count++,this.numSamples++,n--,n<=0||this.numSamples>=this._maxTotalSamples)return}}}}}_withinDistance(e,t){return e**2+t**2<=this._maxDistanceSquared}}export{e as SampledGeometryMaxDistanceRatio};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import n from"../../../../core/Error.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as i,createAbortError as a}from"../../../../core/promiseUtils.js";import{difference as o}from"../../../../core/SetUtils.js";import{parseWhereClause as s}from"../../../../core/sql.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{fromFeatureSetJSON as u}from"../../../../layers/graphics/dehydratedFeatures.js";import{canConvertSqlRelativeTime as d,sqlRelativeTimeToAbsolute as f}from"../../../../layers/support/relativeTimeQueryUtils.js";import{queueAutoPriority as p}from"../../../../request/queue.js";import{runQuery as m,executeQuery as h,executeQueryForCount as g}from"../../../../rest/query/operations/query.js";import{PBFDecoder as _}from"../../support/PBFDecoder.js";let v=class extends t{constructor(e){super(e)}get implicitFields(){if(!this.layer.outFields?.includes(`*`))return new Set;let e=new Set(this.layerView.requiredFields),t=new Set(this.layerView.availableFields);return o(t,e)}async queryFeaturesDehydrated(e,t){let{layer:n}=this,r=n.capabilities,o=r?.query?.supportsFormatPBF,c=n.parsedUrl,l=d(e.where)?await f(n.fieldsIndex,e.where,r.query.relativeTimeBinWindow):e.where,p=e.where;l!==e.where&&(e=e.clone(),e.where=l);let g;if(o){this._decoder??=new _(this.controller);let r={sourceSpatialReference:n.spatialReference?.toJSON()??null,applyTransform:!0,maxStringAttributeFields:this.implicitFields,maxStringAttributeLength:S};g=await m(c,e,`pbf`,this._createRequestOptions(t)).then(e=>(i(t),this._decoder==null?Promise.reject(a()):this._decoder.invoke({buffer:e,options:r},t.signal)))}else g=await h(c,e,n.spatialReference,this._createRequestOptions(t)).then(e=>u(e,{maxStringAttributeFields:this.implicitFields,maxStringAttributeLength:S}));if(p&&e.where!==p){let e=await this.controller.schedule(()=>s(p,this.layer.fieldsIndex),t.signal);g.features=await this.controller.schedule(()=>g.features.filter(t=>e.testFeatureCompiled(t)),t.signal)}return g}queryFeatureCount(e,t){return g(this.layer.parsedUrl,e,this._createRequestOptions(t))}destroy(){this._decoder=r(this._decoder)}_createRequestOptions(e){return{...p,...e,query:{...this.layer.customParameters,token:this.layer.apiKey,...e?.query}}}};e([c({constructOnly:!0})],v.prototype,`layer`,void 0),e([c({constructOnly:!0})],v.prototype,`layerView`,void 0),e([c({constructOnly:!0})],v.prototype,`controller`,void 0),e([c({readOnly:!0})],v.prototype,`implicitFields`,null),v=e([l(`esri.views.3d.layers.support.featureTileQuery3D.FeatureTileServiceQuery3D`)],v);let y=class extends t{constructor(e){super(e)}queryFeaturesDehydrated(e,t){return this.layer.queryFeatures(e,t)}};e([c({constructOnly:!0})],y.prototype,`layer`,void 0),y=e([l(`esri.views.3d.layers.support.featureTileQuery3D.FeatureTileOGCServiceQuery3D`)],y);let b=class extends t{constructor(e){super(e)}queryFeaturesDehydrated(e,t){return this.layer.source.queryFeaturesJSON(e,t).then(u,n=>{if(n&&n.name===`query-features-json:unsupported`)return this.layer.queryFeatures(e,t);throw n})}queryFeatureCount(e,t){return this.layer.queryFeatureCount(e,t)}};e([c({constructOnly:!0})],b.prototype,`layer`,void 0),b=e([l(`esri.views.3d.layers.support.featureTileQuery3D.FeatureTileClientQuery3D`)],b);function x(e,t){let{layer:r}=e;switch(r.type){case`feature`:switch(r.source.type){case`feature-layer`:return new v({layer:r,layerView:e,controller:t});case`memory`:return new b({layer:r});case`csv`:case`geojson`:case`oriented-imagery`:case`wfs`:case`ogc-feature`:case`parquet`:break;default:r.source.type}break;case`catalog-footprint`:return new v({layer:r,layerView:e,controller:t});case`csv`:case`geojson`:case`oriented-imagery`:case`wfs`:return new b({layer:r});case`ogc-feature`:return new y({layer:r})}throw new n(`feature-layer:unsupported`,`Unsupported Feature layer type ${e.layer.type}:${e.layer.source.type}`)}const S=1024;export{x as createFeatureTileQuery3D};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import n from"../../../../core/Error.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as i,createAbortError as a}from"../../../../core/promiseUtils.js";import{difference as o}from"../../../../core/SetUtils.js";import{parseWhereClause as s}from"../../../../core/sql.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{fromFeatureSetJSON as u}from"../../../../layers/graphics/dehydratedFeatures.js";import{canConvertSqlRelativeTime as d,sqlRelativeTimeToAbsolute as f}from"../../../../layers/support/relativeTimeQueryUtils.js";import{queueAutoPriority as p}from"../../../../request/queue.js";import{runQuery as m,executeQuery as h,executeQueryForCount as g}from"../../../../rest/query/operations/query.js";import{PBFDecoder as _}from"../../support/PBFDecoder.js";let v=class extends t{constructor(e){super(e)}get implicitFields(){if(!this.layer.outFields?.includes(`*`))return new Set;let e=new Set(this.layerView.requiredFields),t=new Set(this.layerView.availableFields);return o(t,e)}async queryFeaturesDehydrated(e,t){let{layer:n}=this,r=n.capabilities,o=r?.query?.supportsFormatPBF,c=n.parsedUrl,l=d(e.where)?await f(n.fieldsIndex,e.where,r.query.relativeTimeBinWindow):e.where,p=e.where;l!==e.where&&(e=e.clone(),e.where=l);let g;if(o){this._decoder??=new _(this.controller);let r={sourceSpatialReference:n.spatialReference?.toJSON()??null,applyTransform:!0,maxStringAttributeFields:this.implicitFields,maxStringAttributeLength:S};g=await m(c,e,`pbf`,this._createRequestOptions(t)).then(e=>(i(t),this._decoder==null?Promise.reject(a()):this._decoder.invoke({buffer:e,options:r},t.completeFeatureFromTransfer,t.signal)))}else g=await h(c,e,n.spatialReference,this._createRequestOptions(t)).then(e=>u(e,{maxStringAttributeFields:this.implicitFields,maxStringAttributeLength:S}));if(p&&e.where!==p){let e=await this.controller.schedule(()=>s(p,this.layer.fieldsIndex),t.signal);g.features=await this.controller.schedule(()=>g.features.filter(t=>e.testFeatureCompiled(t)),t.signal)}return g}queryFeatureCount(e,t){return g(this.layer.parsedUrl,e,this._createRequestOptions(t))}destroy(){this._decoder=r(this._decoder)}_createRequestOptions(e){return{...p,...e,query:{...this.layer.customParameters,token:this.layer.apiKey,...e?.query}}}};e([c({constructOnly:!0})],v.prototype,`layer`,void 0),e([c({constructOnly:!0})],v.prototype,`layerView`,void 0),e([c({constructOnly:!0})],v.prototype,`controller`,void 0),e([c({readOnly:!0})],v.prototype,`implicitFields`,null),v=e([l(`esri.views.3d.layers.support.featureTileQuery3D.FeatureTileServiceQuery3D`)],v);let y=class extends t{constructor(e){super(e)}queryFeaturesDehydrated(e,t){return this.layer.queryFeatures(e,t)}};e([c({constructOnly:!0})],y.prototype,`layer`,void 0),y=e([l(`esri.views.3d.layers.support.featureTileQuery3D.FeatureTileOGCServiceQuery3D`)],y);let b=class extends t{constructor(e){super(e)}queryFeaturesDehydrated(e,t){return this.layer.source.queryFeaturesJSON(e,t).then(u,n=>{if(n&&n.name===`query-features-json:unsupported`)return this.layer.queryFeatures(e,t);throw n})}queryFeatureCount(e,t){return this.layer.queryFeatureCount(e,t)}};e([c({constructOnly:!0})],b.prototype,`layer`,void 0),b=e([l(`esri.views.3d.layers.support.featureTileQuery3D.FeatureTileClientQuery3D`)],b);function x(e,t){let{layer:r}=e;switch(r.type){case`feature`:switch(r.source.type){case`feature-layer`:return new v({layer:r,layerView:e,controller:t});case`memory`:return new b({layer:r});case`csv`:case`geojson`:case`oriented-imagery`:case`wfs`:case`ogc-feature`:case`parquet`:break;default:r.source.type}break;case`catalog-footprint`:return new v({layer:r,layerView:e,controller:t});case`csv`:case`geojson`:case`oriented-imagery`:case`wfs`:return new b({layer:r});case`ogc-feature`:return new y({layer:r})}throw new n(`feature-layer:unsupported`,`Unsupported Feature layer type ${e.layer.type}:${e.layer.source.type}`)}const S=1024;export{x as createFeatureTileQuery3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{throwIfAborted as e}from"../../../core/promiseUtils.js";import{generateUID as t}from"../../../core/uid.js";import{WorkerHandle as n}from"../../../core/workers/WorkerHandle.js";import r from"../../../geometry/SpatialReference.js";import{toDehydratedGeometry as i}from"../../../layers/graphics/transferFeatures.js";import a from"../../../layers/support/Field.js";class o{constructor(e){this._controller=e,this._abortController=new AbortController,this._handle=new s((t,n)=>e.schedule(t,n))}destroy(){this._abortController.abort(),this._handle.destroy()}async invoke(n,o){if(o=AbortSignal.any([o,this._abortController.signal]),e(o),!n.buffer||n.buffer.byteLength===0)return null;n.options.sourceSpatialReference&&n.options.sourceSpatialReference instanceof r&&(n.options={...n.options,sourceSpatialReference:n.options.sourceSpatialReference.toJSON()});let{featureSet:s,coordinates:c,queryGeometry:l,queryCoordinates:u}=await this._handle.invoke(n,o);return await this._controller.scheduleGenerator(function*(e){let n=r.fromJSON(s.spatialReference),o=[];for(let t=0;t<s.fields.length;++t)o.push(a.fromJSON(s.fields[t])),e.madeProgress()&&(e=yield);let d=s.features;for(let r=0;r<d.length;++r){let a=d[r];a.geometry=i(a.geometry,c[r],n),a.uid=t(),a.centroid&&(a.centroid.spatialReference=n),c[r]=null,e.madeProgress()&&(e=yield)}return Object.assign(s,{spatialReference:n,fields:o,queryGeometry:i(l,u,n)})},o)}}class s extends n{constructor(e){super(`PBFDecoderWorker`,`parseFeatureQuery`,{parseFeatureQuery:e=>[e.buffer]},e)}}export{o as PBFDecoder};
2
+ import{throwIfAborted as e}from"../../../core/promiseUtils.js";import{generateUID as t}from"../../../core/uid.js";import{WorkerHandle as n}from"../../../core/workers/WorkerHandle.js";import r from"../../../geometry/SpatialReference.js";import{completeDehydratedGeometryFromTransfer as i,completeDehydratedFeatureFromTransfer as a}from"../../../layers/graphics/transferFeatures.js";import o from"../../../layers/support/Field.js";class s{constructor(e){this._controller=e,this._abortController=new AbortController,this._handle=new c((t,n)=>e.schedule(t,n))}destroy(){this._abortController.abort(),this._handle.destroy()}async invoke(n,s,c){if(c=AbortSignal.any([c,this._abortController.signal]),e(c),!n.buffer||n.buffer.byteLength===0)return null;n.options.sourceSpatialReference&&n.options.sourceSpatialReference instanceof r&&(n.options={...n.options,sourceSpatialReference:n.options.sourceSpatialReference.toJSON()});let{featureSet:l,coordinates:u,queryGeometry:d,queryCoordinates:f}=await this._handle.invoke(n,c);return await this._controller.scheduleGenerator(function*(e){let n=r.fromJSON(l.spatialReference),c=[];for(let t=0;t<l.fields.length;++t)c.push(o.fromJSON(l.fields[t])),e.madeProgress()&&(e=yield);let p=l.features,m=[],h=s??a;for(let r=0;r<p.length;++r){let i=p[r],a=u[r];h(i,a,n),i.uid=t(),i.centroid&&(i.centroid.spatialReference=n),m.push(i),p[r]=null,u[r]=null,e.madeProgress()&&(e=yield)}return i(d,f,n),Object.assign(l,{spatialReference:n,fields:c,features:m,queryGeometry:d})},c)}}class c extends n{constructor(e){super(`PBFDecoderWorker`,`parseFeatureQuery`,{parseFeatureQuery:e=>[e.buffer]},e)}}export{s as PBFDecoder};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{handlesGroup as e}from"../../../core/handleUtils.js";import{watch as t,initial as n}from"../../../core/reactiveUtils.js";import r from"../../../geometry/Extent.js";import{projectOrLoad as i}from"../../../geometry/projectionUtils.js";import{projectBoundingRect as a}from"../../../geometry/projection/projectBoundingRect.js";import{intersects as o,fromExtent as s,empty as c}from"../../../geometry/support/aaBoundingRect.js";function l(c){let l=!1,p=(e,t,n)=>{if(l||u(e,n)||t==null)return;let m=i(t,c.view.spatialReference);if(m.pending!=null){l=!0,m.pending.finally(()=>{l=!1,p(e,t,n)});return}let h=m.geometry;if(h==null)return;let g=h.type===`point`?r.fromPoint(h):h.extent;g!=null&&a(e.extent,e.spatialReference,d,c.view.spatialReference)&&o(d,s(g,f))&&c.onElevationChanges()},m,h=t(()=>({elevationMode:c.elevationInfo?.mode,geometry:c.geometry}),({elevationMode:e,geometry:t})=>{m?.remove(),e!==`absolute-height`&&(m=c.view.elevationProvider.on(`elevation-change`,n=>p(n,t,e)))},n);return e([h,m])}function u({context:e},t){return t==null?!1:t===`absolute-height`||e===`scene`&&t!==`relative-to-scene`}const d=c(),f=c();export{l as createElevationUpdateHandle};
2
+ import{handlesGroup as e}from"../../../core/handleUtils.js";import{watch as t,initial as n}from"../../../core/reactiveUtils.js";import{assertNotMesh as r}from"../../../geometry/asserts.js";import i from"../../../geometry/Extent.js";import{projectOrLoad as a}from"../../../geometry/projectionUtils.js";import{projectBoundingRect as o}from"../../../geometry/projection/projectBoundingRect.js";import{intersects as s,fromExtent as c,empty as l}from"../../../geometry/support/aaBoundingRect.js";function u(l){let u=!1,m=(e,t,n)=>{if(u||d(e,n)||t==null)return;r(t);let h=a(t,l.view.spatialReference);if(h.pending!=null){u=!0,h.pending.finally(()=>{u=!1,m(e,t,n)});return}let g=h.geometry;if(g==null)return;let _=g.type===`point`?i.fromPoint(g):g.extent;_!=null&&o(e.extent,e.spatialReference,f,l.view.spatialReference)&&s(f,c(_,p))&&l.onElevationChanges()},h,g=t(()=>({elevationMode:l.elevationInfo?.mode,geometry:l.geometry}),({elevationMode:e,geometry:t})=>{h?.remove(),e!==`absolute-height`&&(h=l.view.elevationProvider.on(`elevation-change`,n=>m(n,t,e)))},n);return e([g,h])}function d({context:e},t){return t==null?!1:t===`absolute-height`||e===`scene`&&t!==`relative-to-scene`}const f=l(),p=l();export{u as createElevationUpdateHandle};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{isScreenRect as e,createScreenPoint as t}from"../../../core/screenUtils.js";import{isTiledLayer as n,isLayerWithFlowRenderer as r}from"../../../layers/support/layerUtils.js";import{hitTestSelectSimilarDistance as i}from"../../support/hitTestSelectUtils.js";import{isScaleRangeActive as a,scaleBoundsPredicate as o}from"../../support/layerViewUtils.js";async function s(s,d){let f=await i(s,d),{results:p}=f,m=f.ground,h=e(d)?s.toMap(t(d.x+d.width/2,d.y+d.height/2)):m.mapPoint,g=h!=null,_=[],v=u(s),y=m.layer==null,b=g?c(s,v,y):l,x=0,S=0,C=()=>{let e=b.layerViews[S++];if(!g||!e||!(`fetchPopupFeaturesAtTarget`in e))return;let t=h,i=e.layer;if(n(i)&&`effectiveScaleRange`in i){let{minScale:e,maxScale:n}=i.effectiveScaleRange;if(a(e,n)){if(r(i)&&!o(s.scale,e,n))return;let a=s.basemapTerrain.getScale(t);if(!o(a,e,n))return}}_.push({geometry:t,layerView:e})},w=null;for(;x<p.length||S<b.layerViews.length;){let e=p[x];if(e&&e.type!==`graphic`)++x;else if(e?.layer?.type===`scene`&&e?.layer?.parent===s?.map?.basemap)++x;else if(e){let t=e.layer?.uid,n=b.layerUids.has(t)&&e.distance===m.distance,r=v.get(e.layer?.uid);if(w??=e.mapPoint,S<b.layerViews.length&&(n||(e.distance??0)>m.distance)&&b.layerViews[S]!==r){C();continue}_.push({graphic:e.graphic,layerView:r}),++x}else C()}return w??=h,{hits:_,location:w}}function c(e,t,n){let r=new Set,i=new Set,a=e=>{e&&(r.add(e.layer.uid),i.add(e))};if(n){let{basemapTerrain:t}=e,n=t.numLayers(1);for(let e=n-1;e>=0;e--)a(t.layerViewByIndex(e,1))}let o=e.overlayManager.renderer.layers;for(let{uid:e}of o)a(t.get(e));return{layerUids:r,layerViews:Array.from(i).reverse()}}const l={layerUids:new Set,layerViews:[]};function u(e){let t=new Map;for(let n of e.allLayerViews){let e=n.layer.uid;t.set(e,n)}return t}export{s as popupHitTest};
2
+ import{isScreenRect as e,createScreenPoint as t}from"../../../core/screenUtils.js";import{isScaleRangeActive as n,scaleBoundsPredicate as r}from"../../../geometry/support/scaleUtils.js";import{isTiledLayer as i,isLayerWithFlowRenderer as a}from"../../../layers/support/layerUtils.js";import{hitTestSelectSimilarDistance as o}from"../../support/hitTestSelectUtils.js";async function s(s,d){let f=await o(s,d),{results:p}=f,m=f.ground,h=e(d)?s.toMap(t(d.x+d.width/2,d.y+d.height/2)):m.mapPoint,g=h!=null,_=[],v=u(s),y=m.layer==null,b=g?c(s,v,y):l,x=0,S=0,C=()=>{let e=b.layerViews[S++];if(!g||!e||!(`fetchPopupFeaturesAtTarget`in e))return;let t=h,o=e.layer;if(i(o)&&`effectiveScaleRange`in o){let{minScale:e,maxScale:i}=o.effectiveScaleRange;if(n(e,i)){if(a(o)&&!r(s.scale,e,i))return;let n=s.basemapTerrain.getScale(t);if(!r(n,e,i))return}}_.push({geometry:t,layerView:e})},w=null;for(;x<p.length||S<b.layerViews.length;){let e=p[x];if(e&&e.type!==`graphic`)++x;else if(e?.layer?.type===`scene`&&e?.layer?.parent===s?.map?.basemap)++x;else if(e){let t=e.layer?.uid,n=b.layerUids.has(t)&&e.distance===m.distance,r=v.get(e.layer?.uid);if(w??=e.mapPoint,S<b.layerViews.length&&(n||(e.distance??0)>m.distance)&&b.layerViews[S]!==r){C();continue}_.push({graphic:e.graphic,layerView:r}),++x}else C()}return w??=h,{hits:_,location:w}}function c(e,t,n){let r=new Set,i=new Set,a=e=>{e&&(r.add(e.layer.uid),i.add(e))};if(n){let{basemapTerrain:t}=e,n=t.numLayers(1);for(let e=n-1;e>=0;e--)a(t.layerViewByIndex(e,1))}let o=e.overlayManager.renderer.layers;for(let{uid:e}of o)a(t.get(e));return{layerUids:r,layerViews:Array.from(i).reverse()}}const l={layerUids:new Set,layerViews:[]};function u(e){let t=new Map;for(let n of e.allLayerViews){let e=n.layer.uid;t.set(e,n)}return t}export{s as popupHitTest};