@arcgis/core 4.27.0-next.20230521 → 4.27.0-next.20230523

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 (268) hide show
  1. package/Graphic.js +1 -1
  2. package/WebMap.js +1 -1
  3. package/arcade/featureset/actions/SpatialFilter.js +1 -1
  4. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  5. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  6. package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
  7. package/arcade/functions/featuresetbase.js +1 -1
  8. package/assets/esri/core/workers/RemoteClient.js +1 -1
  9. package/assets/esri/core/workers/chunks/030b43764f945cb1f8b0.js +1 -0
  10. package/assets/esri/core/workers/chunks/0d02856e55d20b99fc8b.js +1 -0
  11. package/assets/esri/core/workers/chunks/{69242c66492717c7388c.js → 0fcb8d408696075338e2.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{b91c155de9a89e4e6971.js → 187c3b971ed0fc4363ef.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{85c6ce93aa41e6b65997.js → 18db07d739a713cc0465.js} +1 -1
  14. package/assets/esri/core/workers/chunks/1b6177e23327be645c8c.js +1 -0
  15. package/assets/esri/core/workers/chunks/28286014a575042619ee.js +1 -0
  16. package/assets/esri/core/workers/chunks/{692dfeb2e255fdc0ade2.js → 39288fa69561d21f04f8.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{2b9d3e60977934a6d471.js → 3bc6b5f0643364749ef8.js} +1 -1
  18. package/assets/esri/core/workers/chunks/45e5ad704d18dd0857ce.js +1 -0
  19. package/assets/esri/core/workers/chunks/4d24efa01d1accc5a5f0.js +1 -0
  20. package/assets/esri/core/workers/chunks/{6312783626bacf52df7a.js → 55486c644e8b01326a0d.js} +1 -1
  21. package/assets/esri/core/workers/chunks/5576858f56314afcb4d5.js +1 -0
  22. package/assets/esri/core/workers/chunks/{62d9d15f0d00a75da42c.js → 571dac507622948ac03e.js} +1 -1
  23. package/assets/esri/core/workers/chunks/59063d6abf70f6598425.js +1 -0
  24. package/assets/esri/core/workers/chunks/5a4c04bf4f57e74457c5.js +1 -0
  25. package/assets/esri/core/workers/chunks/5bf04c32e0ac89dcbf9f.js +1 -0
  26. package/assets/esri/core/workers/chunks/6a3d611e8842afbb50ab.js +2 -0
  27. package/assets/esri/core/workers/chunks/{55ca6ba8b40921025181.js.LICENSE.txt → 6a3d611e8842afbb50ab.js.LICENSE.txt} +1 -1
  28. package/assets/esri/core/workers/chunks/70d6e5edf05ef7079fa8.js +1 -0
  29. package/assets/esri/core/workers/chunks/71bdf8f10aee0077f681.js +1 -0
  30. package/assets/esri/core/workers/chunks/72b2c3c8e76da699690c.js +1 -0
  31. package/assets/esri/core/workers/chunks/78ce0b1af62435d8ebf4.js +1 -0
  32. package/assets/esri/core/workers/chunks/791f529e90135398b3d5.js +1 -0
  33. package/assets/esri/core/workers/chunks/8d3abfe6fdc5ac8d6cb7.js +1 -0
  34. package/assets/esri/core/workers/chunks/{1edc5c06874cb12c5478.js → 924e4a18d8403d1caea3.js} +1 -1
  35. package/assets/esri/core/workers/chunks/96d339abcd917f1f0ae1.js +1 -0
  36. package/assets/esri/core/workers/chunks/97cdbec7532cfcdf9ad2.js +1 -0
  37. package/assets/esri/core/workers/chunks/{f3f6035a17f7dcd19675.js → 9ab400a89dd701778d2c.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{1488b3d48232844b8bb4.js → 9fe349f43d5ff5a4ac2d.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{22396dd3717d17a5d235.js → a1c31bb8c12831539328.js} +1 -1
  40. package/assets/esri/core/workers/chunks/b0571b9e602218cdc7aa.js +1 -0
  41. package/assets/esri/core/workers/chunks/b1d88f8e528bf7092f35.js +1 -0
  42. package/assets/esri/core/workers/chunks/b4e2dc6b3d06b426e596.js +1 -0
  43. package/assets/esri/core/workers/chunks/{48abcb2d88f22e6e9fde.js → c2cb9fa18c77f0c5104e.js} +1 -1
  44. package/assets/esri/core/workers/chunks/cad7a2092ea7f51dbd8b.js +1 -0
  45. package/assets/esri/core/workers/chunks/d08800a30b1227591986.js +1 -0
  46. package/assets/esri/core/workers/chunks/d725dbbdeb05322e6d88.js +1 -0
  47. package/assets/esri/core/workers/chunks/df3e497d12ed77bae168.js +1 -0
  48. package/assets/esri/core/workers/chunks/fb080339bfaf32731ca6.js +1 -0
  49. package/assets/esri/core/workers/chunks/{56fc7924b4fb30239c19.js → fdf58386a67e54c09bfb.js} +1 -1
  50. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  51. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  52. package/assets/esri/themes/base/_core.scss +2 -0
  53. package/assets/esri/themes/base/widgets/_BasemapGallery.scss +86 -96
  54. package/assets/esri/themes/base/widgets/_FloorFilter.scss +6 -0
  55. package/assets/esri/themes/base/widgets/_UtilityNetworkValidateTopology.scss +40 -0
  56. package/assets/esri/themes/dark/main.css +1 -1
  57. package/assets/esri/themes/light/main.css +1 -1
  58. package/assets/esri/themes/light/view.css +1 -1
  59. package/assets/esri/views/interactive/tooltip/t9n/Tooltip.json +1 -1
  60. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_en.json +1 -1
  61. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  62. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  63. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  64. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  65. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  66. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  67. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  68. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  69. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  70. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  71. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  72. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  73. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  74. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  75. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  76. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  77. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  78. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  79. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  80. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  81. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  82. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  83. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  84. package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
  85. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  86. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  87. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  88. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  89. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  90. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  91. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  92. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  93. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  94. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  95. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  96. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  97. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  98. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  99. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  100. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  101. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  102. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology.json +1 -1
  103. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ar.json +1 -1
  104. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_bg.json +1 -1
  105. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_bs.json +1 -1
  106. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ca.json +1 -1
  107. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_cs.json +1 -1
  108. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_da.json +1 -1
  109. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_de.json +1 -1
  110. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_el.json +1 -1
  111. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_en.json +1 -1
  112. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_es.json +1 -1
  113. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_et.json +1 -1
  114. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_fi.json +1 -1
  115. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_fr.json +1 -1
  116. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_he.json +1 -1
  117. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_hr.json +1 -1
  118. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_hu.json +1 -1
  119. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_id.json +1 -1
  120. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_it.json +1 -1
  121. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ja.json +1 -1
  122. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ko.json +1 -1
  123. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_lt.json +1 -1
  124. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_lv.json +1 -1
  125. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_nb.json +1 -1
  126. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_nl.json +1 -1
  127. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_pl.json +1 -1
  128. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_pt-BR.json +1 -1
  129. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_pt-PT.json +1 -1
  130. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ro.json +1 -1
  131. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ru.json +1 -1
  132. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sk.json +1 -1
  133. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sl.json +1 -1
  134. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sr.json +1 -1
  135. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sv.json +1 -1
  136. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_th.json +1 -1
  137. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_tr.json +1 -1
  138. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_uk.json +1 -1
  139. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_vi.json +1 -1
  140. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_zh-CN.json +1 -1
  141. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_zh-HK.json +1 -1
  142. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_zh-TW.json +1 -1
  143. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  144. package/chunks/arcgis-knowledge-client-core.js +1 -1
  145. package/chunks/mat4.js +1 -1
  146. package/core/accessorSupport/write.js +1 -1
  147. package/core/fontUtils.js +1 -1
  148. package/core/libs/gl-matrix-2/math/mat4.js +1 -1
  149. package/geometry/Mesh.js +1 -1
  150. package/geometry/support/MeshGeoreferencedRelativeVertexSpace.d.ts +4 -0
  151. package/geometry/support/MeshGeoreferencedRelativeVertexSpace.js +5 -0
  152. package/geometry/support/MeshGeoreferencedVertexSpace.d.ts +4 -0
  153. package/geometry/support/MeshGeoreferencedVertexSpace.js +5 -0
  154. package/geometry/support/MeshLocalVertexSpace.d.ts +4 -0
  155. package/geometry/support/MeshLocalVertexSpace.js +5 -0
  156. package/geometry/support/MeshTransform.d.ts +4 -0
  157. package/geometry/support/MeshTransform.js +1 -1
  158. package/geometry/support/meshUtils/ElevationSamplerWorker.js +1 -1
  159. package/geometry/support/meshUtils/centerAt.js +1 -1
  160. package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
  161. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  162. package/geometry/support/meshUtils/geographicUtils.js +1 -1
  163. package/geometry/support/meshUtils/georeference.js +1 -1
  164. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  165. package/geometry/support/meshUtils/merge.js +1 -1
  166. package/geometry/support/meshUtils/offset.js +1 -1
  167. package/geometry/support/meshUtils/primitives.js +1 -1
  168. package/geometry/support/meshUtils/rotate.js +1 -1
  169. package/geometry/support/meshUtils/scale.js +1 -1
  170. package/interfaces.d.ts +227 -25
  171. package/layers/LinkChartLayer.js +1 -1
  172. package/layers/VoxelWasmPerSceneView.js +1 -1
  173. package/layers/graphics/data/attributeSupport.js +1 -1
  174. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  175. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  176. package/layers/knowledgeGraph/SessionMemoryStorage.js +1 -1
  177. package/layers/support/SubtypeSublayer.js +1 -1
  178. package/layers/support/rasterFunctions/BandArithmeticFunction.js +1 -1
  179. package/layers/support/rasterFunctions/BaseRasterFunction.js +1 -1
  180. package/layers/support/rasterFunctions/CompositeBandFunction.js +1 -1
  181. package/layers/support/rasterFunctions/ExtractBandFunction.js +1 -1
  182. package/layers/support/rasterFunctions/ExtractBandFunctionArguments.js +1 -1
  183. package/layers/support/rasterFunctions/NDVIFunction.js +1 -1
  184. package/networks/support/TopologyValidationJobInfo.js +1 -1
  185. package/package.json +2 -2
  186. package/popup/FieldInfo.js +1 -1
  187. package/portal/Portal.js +1 -1
  188. package/rest/support/FeatureSet.js +1 -1
  189. package/rest/support/meshFeatureSet.js +1 -1
  190. package/smartMapping/symbology/color.js +1 -1
  191. package/smartMapping/symbology/support/colors.js +1 -1
  192. package/support/revision.js +1 -1
  193. package/symbols/cim/cimAnalyzer.js +1 -1
  194. package/symbols/support/utils.js +1 -1
  195. package/views/2d/layers/StreamLayerView2D.js +1 -1
  196. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  197. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  198. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  199. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  200. package/views/3d/interactive/editingTools/meshFastUpdateUtils.js +1 -1
  201. package/views/3d/interactive/editingTools/moveGraphic/GraphicMoveTool.js +1 -1
  202. package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
  203. package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
  204. package/views/3d/interactive/editingTools/transformGraphic/undoRecords.js +1 -1
  205. package/views/3d/layers/StreamLayerView3D.js +1 -1
  206. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  207. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  208. package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
  209. package/views/3d/layers/graphics/symbolComplexity.js +1 -1
  210. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  211. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  212. package/views/3d/state/utils/navigationUtils.js +1 -1
  213. package/views/3d/support/DisplayQualityProfile.js +1 -1
  214. package/views/3d/support/QualitySettings.js +1 -1
  215. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  216. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  217. package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
  218. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  219. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  220. package/views/draw/DrawOperation.js +1 -1
  221. package/views/draw/support/helpMessageUtils.js +1 -1
  222. package/views/interactive/dragEventPipeline.js +1 -1
  223. package/views/layers/StreamLayerView.js +1 -1
  224. package/widgets/BasemapGallery/css.js +1 -1
  225. package/widgets/BasemapGallery/support/PortalBasemapsSource.js +1 -1
  226. package/widgets/BasemapGallery.js +1 -1
  227. package/widgets/CoordinateConversion.js +1 -1
  228. package/widgets/Editor/EditorViewModel.js +1 -1
  229. package/widgets/Editor/Edits.js +1 -1
  230. package/widgets/Editor/Upload.js +1 -1
  231. package/widgets/Editor/workflowUtils.js +1 -1
  232. package/widgets/Editor.js +1 -1
  233. package/widgets/Feature/support/featureUtils.js +1 -1
  234. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  235. package/widgets/FeatureTable/FieldColumn.js +1 -1
  236. package/widgets/LayerList.js +1 -1
  237. package/widgets/Locate.js +1 -1
  238. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  239. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +5 -0
  240. package/widgets/UtilityNetworkValidateTopology.js +5 -0
  241. package/widgets/support/widgetUtils.js +1 -1
  242. package/assets/esri/core/workers/chunks/163bf2e13abbdd298374.js +0 -1
  243. package/assets/esri/core/workers/chunks/23f73f81aea461c0c6e6.js +0 -1
  244. package/assets/esri/core/workers/chunks/2640204c4655aa535ccb.js +0 -1
  245. package/assets/esri/core/workers/chunks/2bf42d060f877566b989.js +0 -1
  246. package/assets/esri/core/workers/chunks/34ec9623a1bece86a82b.js +0 -1
  247. package/assets/esri/core/workers/chunks/3bf52139340827794c3b.js +0 -1
  248. package/assets/esri/core/workers/chunks/3cebdd77a8401495097f.js +0 -1
  249. package/assets/esri/core/workers/chunks/48cb634255e39711a720.js +0 -1
  250. package/assets/esri/core/workers/chunks/4d5f71d84c85f45c97ea.js +0 -1
  251. package/assets/esri/core/workers/chunks/52d02021e858820bc4fa.js +0 -1
  252. package/assets/esri/core/workers/chunks/55ca6ba8b40921025181.js +0 -2
  253. package/assets/esri/core/workers/chunks/64b8f65e2ef6cbf08380.js +0 -1
  254. package/assets/esri/core/workers/chunks/662e479c370c11bcb8a7.js +0 -1
  255. package/assets/esri/core/workers/chunks/78aede1e114deefacb54.js +0 -1
  256. package/assets/esri/core/workers/chunks/7ef100158ca28631fcaf.js +0 -1
  257. package/assets/esri/core/workers/chunks/93ad67930aa7d4a4b0ac.js +0 -1
  258. package/assets/esri/core/workers/chunks/964795dfb57f0d0635d0.js +0 -1
  259. package/assets/esri/core/workers/chunks/99ce0a202dcd3d7dc290.js +0 -1
  260. package/assets/esri/core/workers/chunks/abe6c99a1a719543dbe8.js +0 -1
  261. package/assets/esri/core/workers/chunks/c3bf44146fddfe8990f7.js +0 -1
  262. package/assets/esri/core/workers/chunks/cbe817e966b57599bafd.js +0 -1
  263. package/assets/esri/core/workers/chunks/e15b5d7e46a834eacc57.js +0 -1
  264. package/assets/esri/core/workers/chunks/e1e0b3580e2c3098c9f4.js +0 -1
  265. package/assets/esri/core/workers/chunks/e305d20e4424451cab5b.js +0 -1
  266. package/assets/esri/core/workers/chunks/e6836c84470fb6bd25bf.js +0 -1
  267. package/assets/esri/core/workers/chunks/f924732902703233655e.js +0 -1
  268. package/assets/esri/core/workers/chunks/ff1c005eede0cf964332.js +0 -1
package/interfaces.d.ts CHANGED
@@ -5623,6 +5623,12 @@ declare namespace __esri {
5623
5623
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#components)
5624
5624
  */
5625
5625
  components: MeshComponent[];
5626
+ /**
5627
+ * The transform of the mesh.
5628
+ *
5629
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#transform)
5630
+ */
5631
+ transform: void;
5626
5632
  /**
5627
5633
  * The string value representing the type of geometry.
5628
5634
  *
@@ -5635,6 +5641,12 @@ declare namespace __esri {
5635
5641
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes)
5636
5642
  */
5637
5643
  vertexAttributes: MeshVertexAttributes;
5644
+ /**
5645
+ * The vertex space of the mesh.
5646
+ *
5647
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexSpace)
5648
+ */
5649
+ vertexSpace: MeshGeoreferencedVertexSpace | MeshGeoreferencedRelativeVertexSpace | MeshLocalVertexSpace;
5638
5650
  /**
5639
5651
  * A mesh is a general, client-side 3D [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) type composed of [vertices with attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes).
5640
5652
  *
@@ -5744,12 +5756,26 @@ declare namespace __esri {
5744
5756
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#components)
5745
5757
  */
5746
5758
  components?: MeshComponentProperties[];
5759
+ /**
5760
+ * The transform of the mesh.
5761
+ *
5762
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#transform)
5763
+ */
5764
+ transform?: void;
5747
5765
  /**
5748
5766
  * Object describing the attributes of each vertex of the mesh.
5749
5767
  *
5750
5768
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes)
5751
5769
  */
5752
5770
  vertexAttributes?: MeshVertexAttributesProperties;
5771
+ /**
5772
+ * The vertex space of the mesh.
5773
+ *
5774
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexSpace)
5775
+ */
5776
+ vertexSpace?: | (MeshGeoreferencedVertexSpaceProperties & { type: "georeferenced" })
5777
+ | (MeshGeoreferencedRelativeVertexSpaceProperties & { type: "georeferenced-relative" })
5778
+ | (MeshLocalVertexSpaceProperties & { type: "local" });
5753
5779
  }
5754
5780
 
5755
5781
  export interface MeshCenterAtParams {
@@ -6963,6 +6989,105 @@ declare namespace __esri {
6963
6989
  shading?: "source" | "flat" | "smooth";
6964
6990
  }
6965
6991
 
6992
+ export interface MeshGeoreferencedRelativeVertexSpace extends Accessor, JSONSupport {
6993
+ }
6994
+
6995
+ export class MeshGeoreferencedRelativeVertexSpace {
6996
+ /**
6997
+ * Origin of the vertex space.
6998
+ *
6999
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshGeoreferencedRelativeVertexSpace.html#origin)
7000
+ */
7001
+ origin: number[];
7002
+ /**
7003
+ * Type of the vertex space.
7004
+ *
7005
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshGeoreferencedRelativeVertexSpace.html#type)
7006
+ */
7007
+ readonly type: "georeferenced-relative";
7008
+ /**
7009
+ * A georeferenced relative mesh vertex space.
7010
+ *
7011
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshGeoreferencedRelativeVertexSpace.html)
7012
+ */
7013
+ constructor(properties?: MeshGeoreferencedRelativeVertexSpaceProperties);
7014
+ static fromJSON(json: any): MeshGeoreferencedRelativeVertexSpace;
7015
+ }
7016
+
7017
+ /** @deprecated Import the MeshGeoreferencedRelativeVertexSpace class instead. */
7018
+ export type MeshGeoreferencedRelativeVertexSpaceConstructor = typeof MeshGeoreferencedRelativeVertexSpace;
7019
+
7020
+ interface MeshGeoreferencedRelativeVertexSpaceProperties {
7021
+ /**
7022
+ * Origin of the vertex space.
7023
+ *
7024
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshGeoreferencedRelativeVertexSpace.html#origin)
7025
+ */
7026
+ origin?: number[];
7027
+ }
7028
+
7029
+ export interface MeshGeoreferencedVertexSpace extends Accessor, JSONSupport {
7030
+ }
7031
+
7032
+ export class MeshGeoreferencedVertexSpace {
7033
+ /**
7034
+ * Type of the vertex space.
7035
+ *
7036
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshGeoreferencedVertexSpace.html#type)
7037
+ */
7038
+ readonly type: "georeferenced";
7039
+ /**
7040
+ * A georeferenced mesh vertex space.
7041
+ *
7042
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshGeoreferencedVertexSpace.html)
7043
+ */
7044
+ constructor(properties?: MeshGeoreferencedVertexSpaceProperties);
7045
+ static fromJSON(json: any): MeshGeoreferencedVertexSpace;
7046
+ }
7047
+
7048
+ /** @deprecated Import the MeshGeoreferencedVertexSpace class instead. */
7049
+ export type MeshGeoreferencedVertexSpaceConstructor = typeof MeshGeoreferencedVertexSpace;
7050
+
7051
+ interface MeshGeoreferencedVertexSpaceProperties {
7052
+ }
7053
+
7054
+ export interface MeshLocalVertexSpace extends Accessor, JSONSupport {
7055
+ }
7056
+
7057
+ export class MeshLocalVertexSpace {
7058
+ /**
7059
+ * Origin of the vertex space.
7060
+ *
7061
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshLocalVertexSpace.html#origin)
7062
+ */
7063
+ origin: number[];
7064
+ /**
7065
+ * Type of the vertex space.
7066
+ *
7067
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshLocalVertexSpace.html#type)
7068
+ */
7069
+ readonly type: "local";
7070
+ /**
7071
+ * A local mesh vertex space.
7072
+ *
7073
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshLocalVertexSpace.html)
7074
+ */
7075
+ constructor(properties?: MeshLocalVertexSpaceProperties);
7076
+ static fromJSON(json: any): MeshLocalVertexSpace;
7077
+ }
7078
+
7079
+ /** @deprecated Import the MeshLocalVertexSpace class instead. */
7080
+ export type MeshLocalVertexSpaceConstructor = typeof MeshLocalVertexSpace;
7081
+
7082
+ interface MeshLocalVertexSpaceProperties {
7083
+ /**
7084
+ * Origin of the vertex space.
7085
+ *
7086
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshLocalVertexSpace.html#origin)
7087
+ */
7088
+ origin?: number[];
7089
+ }
7090
+
6966
7091
  export class MeshMaterial extends Accessor {
6967
7092
  /**
6968
7093
  * Specifies how transparency on the object is handled.
@@ -7381,6 +7506,95 @@ declare namespace __esri {
7381
7506
  scale?: number[];
7382
7507
  }
7383
7508
 
7509
+ export interface MeshTransform extends Accessor, JSONSupport {
7510
+ }
7511
+
7512
+ export class MeshTransform {
7513
+ /**
7514
+ * Rotation angle in degrees.
7515
+ *
7516
+ * @default 0
7517
+ *
7518
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshTransform.html#rotationAngle)
7519
+ */
7520
+ rotationAngle: number;
7521
+ /**
7522
+ * Axis of rotation.
7523
+ *
7524
+ * @default [0, 0, 1]
7525
+ *
7526
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshTransform.html#rotationAxis)
7527
+ */
7528
+ rotationAxis: number[];
7529
+ /**
7530
+ * Scale.
7531
+ *
7532
+ * @default [1, 1, 1]
7533
+ *
7534
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshTransform.html#scale)
7535
+ */
7536
+ scale: number[];
7537
+ /**
7538
+ * Translation.
7539
+ *
7540
+ * @default [0, 0, 0]
7541
+ *
7542
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshTransform.html#translation)
7543
+ */
7544
+ translation: number[];
7545
+ /**
7546
+ * A mesh transform.
7547
+ *
7548
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshTransform.html)
7549
+ */
7550
+ constructor(properties?: MeshTransformProperties);
7551
+ /**
7552
+ * Creates a deep clone.
7553
+ *
7554
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshTransform.html#clone)
7555
+ */
7556
+ clone(): MeshTransform;
7557
+ static fromJSON(json: any): MeshTransform;
7558
+ }
7559
+
7560
+ /** @deprecated Import the MeshTransform class instead. */
7561
+ export type MeshTransformConstructor = typeof MeshTransform;
7562
+
7563
+ interface MeshTransformProperties {
7564
+ /**
7565
+ * Rotation angle in degrees.
7566
+ *
7567
+ * @default 0
7568
+ *
7569
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshTransform.html#rotationAngle)
7570
+ */
7571
+ rotationAngle?: number;
7572
+ /**
7573
+ * Axis of rotation.
7574
+ *
7575
+ * @default [0, 0, 1]
7576
+ *
7577
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshTransform.html#rotationAxis)
7578
+ */
7579
+ rotationAxis?: number[];
7580
+ /**
7581
+ * Scale.
7582
+ *
7583
+ * @default [1, 1, 1]
7584
+ *
7585
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshTransform.html#scale)
7586
+ */
7587
+ scale?: number[];
7588
+ /**
7589
+ * Translation.
7590
+ *
7591
+ * @default [0, 0, 0]
7592
+ *
7593
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshTransform.html#translation)
7594
+ */
7595
+ translation?: number[];
7596
+ }
7597
+
7384
7598
  /**
7385
7599
  * Various utilities and convenience functions for working with [Mesh](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html) objects.
7386
7600
  *
@@ -35707,6 +35921,12 @@ declare namespace __esri {
35707
35921
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#urlKey)
35708
35922
  */
35709
35923
  urlKey: string;
35924
+ /**
35925
+ * When `false`, 3D basemaps are hidden from the [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html), regardless of the type of the view.
35926
+ *
35927
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#use3dBasemaps)
35928
+ */
35929
+ use3dBasemaps: boolean;
35710
35930
  /**
35711
35931
  * Information representing a registered user of the portal.
35712
35932
  *
@@ -36171,6 +36391,12 @@ declare namespace __esri {
36171
36391
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#urlKey)
36172
36392
  */
36173
36393
  urlKey?: string;
36394
+ /**
36395
+ * When `false`, 3D basemaps are hidden from the [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html), regardless of the type of the view.
36396
+ *
36397
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#use3dBasemaps)
36398
+ */
36399
+ use3dBasemaps?: boolean;
36174
36400
  /**
36175
36401
  * Information representing a registered user of the portal.
36176
36402
  *
@@ -36224,7 +36450,7 @@ declare namespace __esri {
36224
36450
  *
36225
36451
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps)
36226
36452
  */
36227
- fetchBasemaps3D?: boolean;
36453
+ include3d?: boolean;
36228
36454
  }
36229
36455
 
36230
36456
  export interface PortalFetchCategorySchemaOptions {
@@ -77706,24 +77932,6 @@ declare namespace __esri {
77706
77932
  }
77707
77933
 
77708
77934
  export class StreamLayerView {
77709
- /**
77710
- * The error that explains an unsuccessful attempt to connect to the stream service or an unexpected disconnection from the stream service.
77711
- *
77712
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#connectionError)
77713
- */
77714
- readonly connectionError: Error;
77715
- /**
77716
- * The status of the Web Socket connection with the stream service.
77717
- *
77718
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#connectionStatus)
77719
- */
77720
- readonly connectionStatus: "connected" | "disconnected" | "paused";
77721
- /**
77722
- * The featureEffect can be used to draw attention features of interest.
77723
- *
77724
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#featureEffect)
77725
- */
77726
- featureEffect: FeatureEffect;
77727
77935
  /**
77728
77936
  * The [attribute](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureFilter.html#where), [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureFilter.html#geometry), and [time extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureFilter.html#timeExtent) filter.
77729
77937
  *
@@ -77793,12 +78001,6 @@ declare namespace __esri {
77793
78001
  export type StreamLayerViewConstructor = typeof StreamLayerView;
77794
78002
 
77795
78003
  interface StreamLayerViewProperties extends LayerViewProperties, HighlightLayerViewMixinProperties {
77796
- /**
77797
- * The featureEffect can be used to draw attention features of interest.
77798
- *
77799
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#featureEffect)
77800
- */
77801
- featureEffect?: FeatureEffectProperties;
77802
78004
  /**
77803
78005
  * The [attribute](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureFilter.html#where), [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureFilter.html#geometry), and [time extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureFilter.html#timeExtent) filter.
77804
78006
  *
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import t from"../core/Collection.js";import a from"../core/Error.js";import i from"../core/Logger.js";import{throwIfAborted as o}from"../core/promiseUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import{encodeGeohash as s}from"../geohash/geohashUtils.js";import h from"./Layer.js";import{convertFromGeometry as l}from"./graphics/featureConversionUtils.js";import c from"./graphics/OptimizedGeometry.js";import{KnowledgeGraphLayerDataManager as p,MOCK_OID_FIELD_NAME as d,MOCK_ORIGIN_ID_FIELD_NAME as u,MOCK_DESTINATION_ID_FIELD_NAME as y,MOCK_LAYOUT_GEOMETRY_FIELD_NAME as m,GEOHASH_ENCODING_PRECISION as f}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import g from"./knowledgeGraph/KnowledgeGraphSubLayer.js";import{BlendLayer as k}from"./mixins/BlendLayer.js";import{ScaleRangeLayer as C}from"./mixins/ScaleRangeLayer.js";import{LCSimpleLayout as L,LCSmartTreeLayout as b,LCRadialTreeLayout as M,LCHierarchicalLayout as w,LCCommunityLayout as x,LCForceDirectedLayout as D,NodeFlag as E,load as T}from"../libs/linkchartlayout/LinkChartLayout.js";import{fetchKnowledgeGraph as G}from"../rest/knowledgeGraphService.js";import I from"../rest/knowledgeGraph/EntityType.js";import A from"../rest/knowledgeGraph/RelationshipType.js";import R from"../geometry/Extent.js";import _ from"../geometry/Point.js";import v from"../geometry/Polyline.js";const j=(e,t,a)=>(e.has(t)||e.set(t,a()),e.get(t));let S=class extends(k(C(h))){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE",xScaleFactor:1,yScaleFactor:1},this._graphTypeLookup=new Map,this.layers=new t,this.linkChartDiagramLookup=new Map,this.linkChartExtent=new R({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.linkChartGeohashLookup=new Map,this.sublayerIdsCache=new Map,this.tables=new t,this.type="link-chart",this._originalInclusionList=e.inclusionModeDefinition,e.dataPreloadedInLocalCache&&!e.inclusionModeDefinition)throw new a("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it")}normalizeCtorArgs(e){return{url:e.url,title:e.title,dataPreloadedInLocalCache:e.dataPreloadedInLocalCache,defaultLinkChartConfig:e.defaultLinkChartConfig}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split("/");this.title=e[e.length-2]}const t=new Set;let o=[],n=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new a("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),e.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),e.inclusionModeDefinition?.generateAllSublayers?(o=e.knowledgeGraph.dataModel.entityTypes??[],n=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((a,r)=>{if(!this._graphTypeLookup.get(r))return i.getLogger(this).warn(`A named type, ${r}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(r);this._graphTypeLookup.get(r)instanceof A||"strictOrigin"in this._graphTypeLookup.get(r)?t.has(r)||(t.add(r),n.push(this._graphTypeLookup.get(r))):this._graphTypeLookup.get(r)instanceof I||"properties"in this._graphTypeLookup.get(r)?t.has(r)||(t.add(r),o.push(this._graphTypeLookup.get(r))):(i.getLogger(this).warn(`A named type, ${r}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(r))})):(o=e.knowledgeGraph.dataModel.entityTypes??[],n=e.knowledgeGraph.dataModel.relationshipTypes??[]);const r=new p({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=o,this.memberRelationshipTypes=n,this.dataManager=r}load(e){return this.addResolvingPromise(new Promise((t=>{G(this.url).then((a=>{if(this._initializeLayerProperties({knowledgeGraph:a,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})})),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}))),this.dataPreloadedInLocalCache)this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((e=>{e.useAllData=!1,e.members?.forEach((e=>{let t;t=e.linkChartLocation instanceof c?e.linkChartLocation:e.linkChartLocation?l(e.linkChartLocation):null,this.linkChartDiagramLookup.set(e.id,t),t&&2===t.coords.length&&0===t.lengths.length?this.linkChartGeohashLookup.set(e.id,s(t.coords[1],t.coords[0],f)):this.linkChartGeohashLookup.set(e.id,"")})),this.addResolvingPromise(this._initializeDiagram().then((async()=>{this.layers.forEach((async e=>{await e.refreshCachedQueryEngine()})),this.tables.forEach((async e=>{await e.refreshCachedQueryEngine()}))})))}));else{const t="GEOGRAPHIC"===this.defaultLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,t,!0).then((async()=>{o(e);const t=[],a=[];this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1,this.dataManager.inclusionModeDefinition.namedTypeDefinitions.forEach((e=>{e.useAllData=!1}))),await this._initializeDiagram(),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine()),t.push(new Promise((t=>{e.on("layerview-create",(()=>{t(null)}))})))})),this.tables.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),await Promise.all(a)})))}t(null)}))}))),Promise.resolve(this)}async addRecords(e){await this._handleNewRecords(e)}async expand(e){const t=await this.dataManager.getConnectedRecordIds(e);await this._handleNewRecords(t)}loadLayerAssumingLocalCache(){this.memberRelationshipTypes.forEach((e=>{const t=new g({objectType:e,parentCompositeLayer:this,graphType:"relationship",title:e.name});t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.has(e.name)||this.dataManager.sublayerCaches.set(e.name,new Map)})),this.memberEntityTypes.forEach((e=>{const t=new g({objectType:e,parentCompositeLayer:this,graphType:"entity",title:e.name});t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.has(e.name)||this.dataManager.sublayerCaches.set(e.name,new Map)})),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{const a=j(this.sublayerIdsCache,t,(()=>new Set));e.members?.forEach((e=>{if(a.add(e.id),e.linkChartLocation)if(e.linkChartLocation instanceof c)this.linkChartDiagramLookup.set(e.id,e.linkChartLocation),2===e.linkChartLocation.coords.length&&0===e.linkChartLocation.lengths.length?this.linkChartGeohashLookup.set(e.id,s(e.linkChartLocation.coords[1],e.linkChartLocation.coords[0],f)):this.linkChartGeohashLookup.set(e.id,"");else{const t=l(e.linkChartLocation);this.linkChartDiagramLookup.set(e.id,e.linkChartLocation?t:null),"x"in e.linkChartLocation&&"y"in e.linkChartLocation?this.linkChartGeohashLookup.set(e.id,s(e.linkChartLocation.x,e.linkChartLocation.y,f)):this.linkChartGeohashLookup.set(e.id,"")}}))}))}async calculateLinkChartLayout(e="RADIAL_TREE",t){const o=[],n=[];this.dataManager.sublayerCaches.forEach(((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach((e=>{o.push({typeName:t,feature:e})})):this.dataManager.relationshipTypeNames.has(t)&&e.forEach((e=>{n.push({typeName:t,feature:e})}))})),this.linkChartDiagramLookup=new Map;const r=new Map,h=new Map,c=new Map,p=new Map,g=new Uint8Array(o.length),k=new Float64Array(o.length),C=new Float64Array(o.length),G=new Uint32Array(n.length),I=new Uint32Array(n.length),A=[],j=t?.geographicStrategy??"FORCE_DIRECTED",S=t?.xScaleFactor??1,N=t?.yScaleFactor??1,P=new R({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let F,z="FORCE_DIRECTED",O=0,U=0;switch(z="GEOGRAPHIC"===e?j:e,z){case"FORCE_DIRECTED":F=D.apply;break;case"COMMUNITY":F=x.apply;break;case"HIERARCHICAL":F=w.apply;break;case"RADIAL_TREE":F=M.apply;break;case"SMART_TREE":F=b.apply;break;default:F=L.apply}o.forEach((({typeName:a,feature:i})=>{if(t?.lockedNodeLocations?.has(i.attributes[d])){"GEOGRAPHIC"===e&&this.dataManager.geographicLookup.has(a)?g[O]=E.IsGeographic:g[O]=E.None;const o=t.lockedNodeLocations.get(i.attributes[d]);k[O]=o.x,C[O]=o.y}else if("GEOGRAPHIC"===e&&this.dataManager.geographicLookup.has(a)){g[O]=E.IsGeographic;let e=null;const t=i.attributes[this.dataManager.geographicLookup.get(a).name],o=this.dataManager.geographicLookup.get(a)?.geometryType;switch(o){case"esriGeometryPoint":k[O]=t?.x,C[O]=t?.y;break;case"esriGeometryPolygon":e=t?.centroid,e?.x&&e?.y?(k[O]=e?.x,C[O]=e?.y):g[O]=E.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,e?.x&&e?.y?(k[O]=e?.x,C[O]=e?.y):g[O]=E.IsMovable;break;default:g[O]=E.IsMovable}k[O]||(k[O]=0),C[O]||(C[O]=0)}else g[O]=E.IsMovable,k[O]=0,C[O]=0;p.set(i.attributes[d],O),A[O]={feature:i,typeName:a},O++}));let H=!1;n.forEach((e=>{const t=p.get(e.feature.attributes[u]),a=p.get(e.feature.attributes[y]);void 0!==t&&void 0!==a?(G[U]=t,I[U]=a,U++):(H=!0,this.linkChartDiagramLookup.set(e.feature.attributes[u],null),this.linkChartGeohashLookup.set(e.feature.attributes[u],null))})),H&&i.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null"),await T();if(!F(g,k,C,G,I))throw new a("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let a=0;a<A.length;a++){if(g[a]===E.IsMovable&&(k[a]=k[a]*S,C[a]=C[a]*N),C[a]>84.9999&&(C[a]=84.9999),C[a]<-84.9999&&(C[a]=-84.9999),k[a]>179.9999&&(k[a]=179.9999),k[a]<-179.9999&&(k[a]=-179.9999),A[a].feature.attributes[m]=new _(k[a],C[a]),r.has(A[a].typeName)){const e=r.get(A[a].typeName);e?.set(A[a].feature.attributes[d],A[a].feature)}else{const e=new Map;e.set(A[a].feature.attributes[d],A[a].feature),r.set(A[a].typeName,e)}c.set(A[a].feature.attributes[d],A[a].feature);const e=l(A[a].feature.attributes[m]);this.linkChartDiagramLookup.set(A[a].feature.attributes[d],A[a].feature.attributes[m]?e:null),this.linkChartGeohashLookup.set(A[a].feature.attributes[d],s(A[a].feature.attributes[m].y,A[a].feature.attributes[m].x,f)),A[a].feature.attributes[m].x<P.xmin&&(P.xmin=A[a].feature.attributes[m].x),A[a].feature.attributes[m].x>P.xmax&&(P.xmax=A[a].feature.attributes[m].x),A[a].feature.attributes[m].y<P.ymin&&(P.ymin=A[a].feature.attributes[m].y),A[a].feature.attributes[m].y>P.ymax&&(P.ymax=A[a].feature.attributes[m].y)}return this.linkChartExtent.xmin=P.xmin,this.linkChartExtent.xmax=P.xmax,this.linkChartExtent.ymin=P.ymin,this.linkChartExtent.ymax=P.ymax,n.forEach((e=>{const t=A[p.get(e.feature.attributes[u])]?.feature.attributes[m],a=A[p.get(e.feature.attributes[y])]?.feature.attributes[m];if(!t||!a)return;const i=new v({paths:[[t.x,t.y],[a.x,a.y]]});if(e.feature.attributes[m]=i,h.has(e.typeName)){const t=h.get(e.typeName);t?.set(e.feature.attributes[d],e.feature)}else{const t=new Map;t.set(e.feature.attributes[d],e.feature),h.set(e.typeName,t)}c.set(e.feature.attributes[d],e.feature);const o=l(e.feature.attributes[m]);this.linkChartDiagramLookup.set(e.feature.attributes[d],e.feature.attributes[m]?o:null),this.linkChartGeohashLookup.set(e.feature.attributes[d],"")})),this._currentLinkChartConfig={layoutMode:e,xScaleFactor:S,yScaleFactor:N},{nodes:r,links:h,idMap:c}}async applyNewLinkChartLayout(e="RADIAL_TREE",t){const a=[];await this.calculateLinkChartLayout(e,t),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),await Promise.all(a),this.layers.forEach((e=>{e.emit("refresh",{dataChanged:!0})}))}async synchronizeInclusionListWithCache(){return new Promise((e=>{this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{if(e.useAllData=!1,e.members&&e.members.size>0){if(!this.dataManager.sublayerCaches.get(t))return;const a=Array.from(this.dataManager.sublayerCaches.get(t).keys());Array.from(e.members.keys()).filter((e=>!a.includes(e))).forEach((t=>{e.members?.delete(t)}))}})),e()}))}async _handleNewRecords(e){const t=[];this.dataManager.addToLayerInclusionSet(e);for(const a of e)this.sublayerIdsCache.has(a.typeName)||(this.sublayerIdsCache.set(a.typeName,new Set),t.push(a.typeName)),this.sublayerIdsCache.get(a.typeName).add(a.id);for(const a of t)if(this._graphTypeLookup.has(a)){const e=this._graphTypeLookup.get(a),t="endPoints"in e?"relationship":"entity",i=new g({objectType:e,parentCompositeLayer:this,graphType:t,title:a});"entity"===t?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a),i.geometryType?this.layers.push(i):this.tables.push(i),this.dataManager.sublayerCaches.set(a,new Map)}await this.dataManager.refreshCacheContent(e.map((e=>e.id))),await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,{xScaleFactor:this._currentLinkChartConfig.xScaleFactor,yScaleFactor:this._currentLinkChartConfig.xScaleFactor})}async _initializeDiagram(){if(this.defaultLinkChartConfig)if(this.defaultLinkChartConfig.doNotRecalculateLayout)this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e=>{e?.members?.forEach((e=>{const t=e.linkChartLocation;let a;const i=e.id;if(!t)return;a="x"in t?{x:t.x,y:t.y}:{x:t.coords[0],y:t.coords[1]};const o=l(a);this.linkChartDiagramLookup.set(i,o),this.linkChartGeohashLookup.set(i,s(a.x,a.y,f)),this.linkChartExtent.xmin>a.x&&(this.linkChartExtent.xmin=a.x),this.linkChartExtent.xmax<a.x&&(this.linkChartExtent.xmax=a.x),this.linkChartExtent.ymin>a.y&&(this.linkChartExtent.ymin=a.y),this.linkChartExtent.ymax<a.y&&(this.linkChartExtent.ymax=a.y)}))})),this.memberRelationshipTypes.forEach((e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach((e=>{const t=this.linkChartDiagramLookup.get(e.attributes[u]),a=this.linkChartDiagramLookup.get(e.attributes[y]);if(t&&a){const i=l(new v({paths:[[t.coords[0],t.coords[1]],[a.coords[0],a.coords[1]]]}));this.linkChartDiagramLookup.set(e.attributes[d],i)}else this.linkChartDiagramLookup.set(e.attributes[d],null);this.linkChartGeohashLookup.set(e.attributes[d],"")}))}));else{const e=new Map;this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t=>{t?.members?.forEach((t=>{const a=t.linkChartLocation;let i;const o=t.id;a&&(i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(o,new _({x:i.x,y:i.y})))}))})),await this.calculateLinkChartLayout(this.defaultLinkChartConfig.layoutMode,{xScaleFactor:this.defaultLinkChartConfig.xScaleFactor,yScaleFactor:this.defaultLinkChartConfig.yScaleFactor,lockedNodeLocations:e})}else await this.calculateLinkChartLayout()}};e([n()],S.prototype,"dataPreloadedInLocalCache",void 0),e([n()],S.prototype,"defaultLinkChartConfig",void 0),e([n()],S.prototype,"dataManager",void 0),e([n()],S.prototype,"knowledgeGraph",void 0),e([n()],S.prototype,"layers",void 0),e([n()],S.prototype,"linkChartDiagramLookup",void 0),e([n()],S.prototype,"linkChartExtent",void 0),e([n()],S.prototype,"linkChartGeohashLookup",void 0),e([n()],S.prototype,"memberEntityTypes",void 0),e([n()],S.prototype,"memberRelationshipTypes",void 0),e([n()],S.prototype,"sublayerIdsCache",void 0),e([n()],S.prototype,"tables",void 0),e([n({json:{read:!1}})],S.prototype,"type",void 0),S=e([r("esri.layers.LinkChartLayer")],S);const N=S;export{N as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import t from"../core/Collection.js";import a from"../core/Error.js";import i from"../core/Logger.js";import{throwIfAborted as o}from"../core/promiseUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import{encodeGeohash as s}from"../geohash/geohashUtils.js";import h from"./Layer.js";import{convertFromGeometry as l}from"./graphics/featureConversionUtils.js";import c from"./graphics/OptimizedGeometry.js";import{KnowledgeGraphLayerDataManager as p,MOCK_OID_FIELD_NAME as d,MOCK_ORIGIN_ID_FIELD_NAME as u,MOCK_DESTINATION_ID_FIELD_NAME as y,MOCK_LAYOUT_GEOMETRY_FIELD_NAME as m,GEOHASH_ENCODING_PRECISION as f}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import g from"./knowledgeGraph/KnowledgeGraphSubLayer.js";import{BlendLayer as k}from"./mixins/BlendLayer.js";import{ScaleRangeLayer as C}from"./mixins/ScaleRangeLayer.js";import{LCSimpleLayout as L,LCSmartTreeLayout as b,LCRadialTreeLayout as M,LCHierarchicalLayout as w,LCCommunityLayout as x,LCForceDirectedLayout as E,NodeFlag as D,load as T}from"../libs/linkchartlayout/LinkChartLayout.js";import{fetchKnowledgeGraph as G}from"../rest/knowledgeGraphService.js";import I from"../rest/knowledgeGraph/EntityType.js";import A from"../rest/knowledgeGraph/RelationshipType.js";import R from"../geometry/Extent.js";import N from"../geometry/Point.js";import _ from"../geometry/Polyline.js";const v=(e,t,a)=>(e.has(t)||e.set(t,a()),e.get(t));let j=class extends(k(C(h))){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE",xScaleFactor:1,yScaleFactor:1},this._graphTypeLookup=new Map,this.layers=new t,this.linkChartDiagramLookup=new Map,this.linkChartExtent=new R({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.linkChartGeohashLookup=new Map,this.sublayerIdsCache=new Map,this.tables=new t,this.type="link-chart",this._originalInclusionList=e.inclusionModeDefinition,e.dataPreloadedInLocalCache&&!e.inclusionModeDefinition)throw new a("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it")}normalizeCtorArgs(e){return{url:e.url,title:e.title,dataPreloadedInLocalCache:e.dataPreloadedInLocalCache,defaultLinkChartConfig:e.defaultLinkChartConfig}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split("/");this.title=e[e.length-2]}const t=new Set;let o=[],n=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new a("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),e.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),e.inclusionModeDefinition?.generateAllSublayers?(o=e.knowledgeGraph.dataModel.entityTypes??[],n=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((a,r)=>{if(!this._graphTypeLookup.get(r))return i.getLogger(this).warn(`A named type, ${r}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(r);this._graphTypeLookup.get(r)instanceof A||"strictOrigin"in this._graphTypeLookup.get(r)?t.has(r)||(t.add(r),n.push(this._graphTypeLookup.get(r))):this._graphTypeLookup.get(r)instanceof I||"properties"in this._graphTypeLookup.get(r)?t.has(r)||(t.add(r),o.push(this._graphTypeLookup.get(r))):(i.getLogger(this).warn(`A named type, ${r}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(r))})):(o=e.knowledgeGraph.dataModel.entityTypes??[],n=e.knowledgeGraph.dataModel.relationshipTypes??[]);const r=new p({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=o,this.memberRelationshipTypes=n,this.dataManager=r}load(e){return this.addResolvingPromise(new Promise((t=>{G(this.url).then((a=>{if(this._initializeLayerProperties({knowledgeGraph:a,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})})),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}))),this.dataPreloadedInLocalCache)this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((e=>{e.useAllData=!1,e.members?.forEach((e=>{let t;t=e.linkChartLocation instanceof c?e.linkChartLocation:e.linkChartLocation?l(e.linkChartLocation):null,this.linkChartDiagramLookup.set(e.id,t),t&&2===t.coords.length&&0===t.lengths.length?this.linkChartGeohashLookup.set(e.id,s(t.coords[1],t.coords[0],f)):this.linkChartGeohashLookup.set(e.id,"")})),this.addResolvingPromise(this._initializeDiagram().then((async()=>{this.layers.forEach((async e=>{await e.refreshCachedQueryEngine()})),this.tables.forEach((async e=>{await e.refreshCachedQueryEngine()}))})))}));else{const t="GEOGRAPHIC"===this.defaultLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,t,!0).then((async()=>{o(e);const t=[],a=[];this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1,this.dataManager.inclusionModeDefinition.namedTypeDefinitions.forEach((e=>{e.useAllData=!1}))),await this._initializeDiagram(),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine()),t.push(new Promise((t=>{e.on("layerview-create",(()=>{t(null)}))})))})),this.tables.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),await Promise.all(a)})))}t(null)}))}))),Promise.resolve(this)}async addRecords(e){await this._handleNewRecords(e)}async expand(e){const t=await this.dataManager.getConnectedRecordIds(e),a=t.filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)));return await this._handleNewRecords(t),{records:a}}loadLayerAssumingLocalCache(){this.memberRelationshipTypes.forEach((e=>{const t=new g({objectType:e,parentCompositeLayer:this,graphType:"relationship",title:e.name});t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.has(e.name)||this.dataManager.sublayerCaches.set(e.name,new Map)})),this.memberEntityTypes.forEach((e=>{const t=new g({objectType:e,parentCompositeLayer:this,graphType:"entity",title:e.name});t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.has(e.name)||this.dataManager.sublayerCaches.set(e.name,new Map)})),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{const a=v(this.sublayerIdsCache,t,(()=>new Set));e.members?.forEach((e=>{if(a.add(e.id),e.linkChartLocation)if(e.linkChartLocation instanceof c)this.linkChartDiagramLookup.set(e.id,e.linkChartLocation),2===e.linkChartLocation.coords.length&&0===e.linkChartLocation.lengths.length?this.linkChartGeohashLookup.set(e.id,s(e.linkChartLocation.coords[1],e.linkChartLocation.coords[0],f)):this.linkChartGeohashLookup.set(e.id,"");else{const t=l(e.linkChartLocation);this.linkChartDiagramLookup.set(e.id,e.linkChartLocation?t:null),"x"in e.linkChartLocation&&"y"in e.linkChartLocation?this.linkChartGeohashLookup.set(e.id,s(e.linkChartLocation.x,e.linkChartLocation.y,f)):this.linkChartGeohashLookup.set(e.id,"")}}))}))}async calculateLinkChartLayout(e="RADIAL_TREE",t){const o=[],n=[];this.dataManager.sublayerCaches.forEach(((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach((e=>{o.push({typeName:t,feature:e})})):this.dataManager.relationshipTypeNames.has(t)&&e.forEach((e=>{n.push({typeName:t,feature:e})}))})),this.linkChartDiagramLookup=new Map;const r=new Map,h=new Map,c=new Map,p=new Map,g=new Uint8Array(o.length),k=new Float64Array(o.length),C=new Float64Array(o.length),G=new Uint32Array(n.length),I=new Uint32Array(n.length),A=[],v="FORCE_DIRECTED",j=t?.xScaleFactor??1,S=t?.yScaleFactor??1,P=new R({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let F,z="FORCE_DIRECTED",O=0,U=0;switch(z="GEOGRAPHIC"===e?v:e,z){case"FORCE_DIRECTED":F=E.apply;break;case"COMMUNITY":F=x.apply;break;case"HIERARCHICAL":F=w.apply;break;case"RADIAL_TREE":F=M.apply;break;case"SMART_TREE":F=b.apply;break;default:F=L.apply}o.forEach((({typeName:a,feature:i})=>{if(t?.lockedNodeLocations?.has(i.attributes[d])){"GEOGRAPHIC"===e&&this.dataManager.geographicLookup.has(a)?g[O]=D.IsGeographic:g[O]=D.None;const o=t.lockedNodeLocations.get(i.attributes[d]);k[O]=o.x,C[O]=o.y}else if("GEOGRAPHIC"===e&&this.dataManager.geographicLookup.has(a)){g[O]=D.IsGeographic;let e=null;const t=i.attributes[this.dataManager.geographicLookup.get(a).name],o=this.dataManager.geographicLookup.get(a)?.geometryType;switch(o){case"esriGeometryPoint":k[O]=t?.x,C[O]=t?.y;break;case"esriGeometryPolygon":e=t?.centroid,e?.x&&e?.y?(k[O]=e?.x,C[O]=e?.y):g[O]=D.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,e?.x&&e?.y?(k[O]=e?.x,C[O]=e?.y):g[O]=D.IsMovable;break;default:g[O]=D.IsMovable}(null==k[O]||null==C[O]||Number.isNaN(k[O])||Number.isNaN(C[O]))&&(g[O]=D.IsMovable,k[O]=0,C[O]=0)}else g[O]=D.IsMovable,k[O]=0,C[O]=0;p.set(i.attributes[d],O),A[O]={feature:i,typeName:a},O++}));let H=!1;n.forEach((e=>{const t=p.get(e.feature.attributes[u]),a=p.get(e.feature.attributes[y]);void 0!==t&&void 0!==a?(G[U]=t,I[U]=a,U++):(H=!0,this.linkChartDiagramLookup.set(e.feature.attributes[u],null),this.linkChartGeohashLookup.set(e.feature.attributes[u],null))})),H&&i.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null"),await T();if(!F(g,k,C,G,I))throw new a("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let a=0;a<A.length;a++){if(g[a]===D.IsMovable&&(k[a]=k[a]*j,C[a]=C[a]*S),C[a]>84.9999&&(C[a]=84.9999),C[a]<-84.9999&&(C[a]=-84.9999),k[a]>179.9999&&(k[a]=179.9999),k[a]<-179.9999&&(k[a]=-179.9999),A[a].feature.attributes[m]=new N(k[a],C[a]),r.has(A[a].typeName)){const e=r.get(A[a].typeName);e?.set(A[a].feature.attributes[d],A[a].feature)}else{const e=new Map;e.set(A[a].feature.attributes[d],A[a].feature),r.set(A[a].typeName,e)}c.set(A[a].feature.attributes[d],A[a].feature);const e=l(A[a].feature.attributes[m]);this.linkChartDiagramLookup.set(A[a].feature.attributes[d],A[a].feature.attributes[m]?e:null),this.linkChartGeohashLookup.set(A[a].feature.attributes[d],s(A[a].feature.attributes[m].y,A[a].feature.attributes[m].x,f)),A[a].feature.attributes[m].x<P.xmin&&(P.xmin=A[a].feature.attributes[m].x),A[a].feature.attributes[m].x>P.xmax&&(P.xmax=A[a].feature.attributes[m].x),A[a].feature.attributes[m].y<P.ymin&&(P.ymin=A[a].feature.attributes[m].y),A[a].feature.attributes[m].y>P.ymax&&(P.ymax=A[a].feature.attributes[m].y)}return this.linkChartExtent.xmin=P.xmin,this.linkChartExtent.xmax=P.xmax,this.linkChartExtent.ymin=P.ymin,this.linkChartExtent.ymax=P.ymax,n.forEach((e=>{const t=A[p.get(e.feature.attributes[u])]?.feature.attributes[m],a=A[p.get(e.feature.attributes[y])]?.feature.attributes[m];if(!t||!a)return;const i=new _({paths:[[t.x,t.y],[a.x,a.y]]});if(e.feature.attributes[m]=i,h.has(e.typeName)){const t=h.get(e.typeName);t?.set(e.feature.attributes[d],e.feature)}else{const t=new Map;t.set(e.feature.attributes[d],e.feature),h.set(e.typeName,t)}c.set(e.feature.attributes[d],e.feature);const o=l(e.feature.attributes[m]);this.linkChartDiagramLookup.set(e.feature.attributes[d],e.feature.attributes[m]?o:null),this.linkChartGeohashLookup.set(e.feature.attributes[d],"")})),this._currentLinkChartConfig={layoutMode:e,xScaleFactor:j,yScaleFactor:S},{nodes:r,links:h,idMap:c}}async applyNewLinkChartLayout(e="RADIAL_TREE",t){const a=[];await this.calculateLinkChartLayout(e,t),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),await Promise.all(a),this.layers.forEach((e=>{e.emit("refresh",{dataChanged:!0})}))}async synchronizeInclusionListWithCache(){return new Promise((e=>{this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{if(e.useAllData=!1,e.members&&e.members.size>0){if(!this.dataManager.sublayerCaches.get(t))return;const a=Array.from(this.dataManager.sublayerCaches.get(t).keys());Array.from(e.members.keys()).filter((e=>!a.includes(e))).forEach((t=>{e.members?.delete(t)}))}})),e()}))}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach((e=>{t.push(e.refreshCachedQueryEngine())})),await Promise.all(t),this.layers.forEach((e=>{e.emit("refresh",{dataChanged:!0})}))}async _handleNewRecords(e){const t=[];this.dataManager.addToLayerInclusionSet(e);for(const a of e)this.sublayerIdsCache.has(a.typeName)||(this.sublayerIdsCache.set(a.typeName,new Set),t.push(a.typeName)),this.sublayerIdsCache.get(a.typeName).add(a.id);for(const a of t)if(this._graphTypeLookup.has(a)){const e=this._graphTypeLookup.get(a),t="endPoints"in e?"relationship":"entity",i=new g({objectType:e,parentCompositeLayer:this,graphType:t,title:a});"entity"===t?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a),i.geometryType?this.layers.push(i):this.tables.push(i),this.dataManager.sublayerCaches.set(a,new Map)}await this.dataManager.refreshCacheContent(e.map((e=>e.id))),await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,{xScaleFactor:this._currentLinkChartConfig.xScaleFactor,yScaleFactor:this._currentLinkChartConfig.xScaleFactor})}async _initializeDiagram(){if(this.defaultLinkChartConfig)if(this.defaultLinkChartConfig.doNotRecalculateLayout)this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e=>{e?.members?.forEach((e=>{const t=e.linkChartLocation;let a;const i=e.id;if(!t)return;a="x"in t?{x:t.x,y:t.y}:{x:t.coords[0],y:t.coords[1]};const o=l(a);this.linkChartDiagramLookup.set(i,o),this.linkChartGeohashLookup.set(i,s(a.x,a.y,f)),this.linkChartExtent.xmin>a.x&&(this.linkChartExtent.xmin=a.x),this.linkChartExtent.xmax<a.x&&(this.linkChartExtent.xmax=a.x),this.linkChartExtent.ymin>a.y&&(this.linkChartExtent.ymin=a.y),this.linkChartExtent.ymax<a.y&&(this.linkChartExtent.ymax=a.y)}))})),this.memberRelationshipTypes.forEach((e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach((e=>{const t=this.linkChartDiagramLookup.get(e.attributes[u]),a=this.linkChartDiagramLookup.get(e.attributes[y]);if(t&&a){const i=l(new _({paths:[[t.coords[0],t.coords[1]],[a.coords[0],a.coords[1]]]}));this.linkChartDiagramLookup.set(e.attributes[d],i)}else this.linkChartDiagramLookup.set(e.attributes[d],null);this.linkChartGeohashLookup.set(e.attributes[d],"")}))}));else{const e=new Map;this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t=>{t?.members?.forEach((t=>{const a=t.linkChartLocation;let i;const o=t.id;a&&(i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(o,new N({x:i.x,y:i.y})))}))})),await this.calculateLinkChartLayout(this.defaultLinkChartConfig.layoutMode,{xScaleFactor:this.defaultLinkChartConfig.xScaleFactor,yScaleFactor:this.defaultLinkChartConfig.yScaleFactor,lockedNodeLocations:e})}else await this.calculateLinkChartLayout()}};e([n()],j.prototype,"dataPreloadedInLocalCache",void 0),e([n()],j.prototype,"defaultLinkChartConfig",void 0),e([n()],j.prototype,"dataManager",void 0),e([n()],j.prototype,"knowledgeGraph",void 0),e([n()],j.prototype,"layers",void 0),e([n()],j.prototype,"linkChartDiagramLookup",void 0),e([n()],j.prototype,"linkChartExtent",void 0),e([n()],j.prototype,"linkChartGeohashLookup",void 0),e([n()],j.prototype,"memberEntityTypes",void 0),e([n()],j.prototype,"memberRelationshipTypes",void 0),e([n()],j.prototype,"sublayerIdsCache",void 0),e([n()],j.prototype,"tables",void 0),e([n({json:{read:!1}})],j.prototype,"type",void 0),j=e([r("esri.layers.LinkChartLayer")],j);const S=j;export{S as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import e from"../Graphic.js";import t from"../request.js";import has from"../core/has.js";import i from"../core/Logger.js";import{removeMaybe as s}from"../core/maybe.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{i as n}from"../chunks/vec3.js";import{c as o}from"../chunks/vec3f64.js";import{renderSRFromViewSR as l}from"../geometry/support/coordinateSystem.js";import{PointIndex as h,PlaneIndex as d}from"../geometry/support/frustum.js";import{WasmCullMode as _,VoxelRequestType as u,UpdateFlags as c,ContainerType as m}from"../libs/vxl/enums.js";import{loadVoxelWASM as g}from"../libs/vxl/VxlModule.js";import{ViewingMode as f}from"../views/ViewingMode.js";import{VoxelTarget as p}from"../views/3d/layers/i3s/Intersector.js";import{Frustum as x}from"../views/3d/state/Frustum.js";import{RenderCoordsHelper as y}from"../views/3d/support/RenderCoordsHelper.js";import{ShaderOutput as v}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{newIntersectorResult as b}from"../views/3d/webgl-engine/lib/Intersector.js";import{IntersectorType as w,StoreResults as T}from"../views/3d/webgl-engine/lib/IntersectorInterfaces.js";import{RenderFeature as R}from"../views/3d/webgl-engine/lib/RenderFeature.js";import{RenderSlot as L}from"../views/3d/webgl-engine/lib/RenderSlot.js";import{ContextType as E}from"../views/webgl/contextUtils.js";import{CompareFunction as C,Face as F,StencilOperation as V}from"../views/webgl/enums.js";const S=i.getLogger("esri.layers.VoxelWasmPerSceneView");var P;!function(e){e[e.Lifetime=1]="Lifetime",e[e.RequestResponse=2]="RequestResponse",e[e.Rendering=3]="Rendering",e[e.Error=4]="Error"}(P||(P={}));class U{constructor(e){this._halfIntTexturesAvailable=!1,this._textureFloatLinearAvailable=!1,this._havePreparedWithAllLayers=!1,this._readyWatchHandle=null,this._qualityWatchHandle=null,this._stationaryWatchHandle=null,this._timeExtentWatchHandle=null,this._renderPluginContext=null,this._vxlPromise=null,this._vxl=null,this._pluginIsActive=!1,this._moreToLoad=!1,this._viewportWidth=-1,this._viewportHeight=-1,this._newLayers=[],this._layers=new Map,this._shaderOutput=v.Color,this._renderSlot=L.VOXEL,this._rctx=null,this._renderTargetToRestore=null,this._lastFrameWasStationary=!1,this._wasmMemBlockSizes=[512,1024,2048,4096,8192,16384,32768,65536],this._wasmMemBlocks=new Map,this._dbgFlags=new Set,this._captureFrustum=!1,this._frustum=null,this._frustumRenderableId=-1,this._renderCoordsHelper=null,this.type=w.VOXEL,this.slicePlaneEnabled=!0,this.isGround=!1,this.layerUid=[],this._view=e,this._initialize()}get canRender(){return!!this._vxl&&"local"===this._view.viewingMode}_dbg(e,t){this._dbgFlags.has(e)&&(e===P.Error?S.error(t):S.warn(t))}_removeRenderPlugin(){this._pluginIsActive&&this._view._stage&&(this._dbg(P.Lifetime,"--removeRenderPlugin--"),this._view._stage.removeRenderPlugin(this)),this._pluginIsActive=!1}_initialize(){this._dbg(P.Lifetime,"--initialize--");for(const e of this._wasmMemBlockSizes)this._wasmMemBlocks.set(e,0);this._readyWatchHandle=a((()=>this._view.ready),(e=>{e&&"local"===this._view.viewingMode?(this._dbg(P.Lifetime,"view ready status changed to ready on a local view, calling addRenderPlugin"),this._view._stage.addRenderPlugin([this._renderSlot],this),this._pluginIsActive=!0):(this._dbg(P.Lifetime,"view ready status changed, not ready or not a local view!"),this._removeRenderPlugin())}),{initial:!0}),this._qualityWatchHandle=a((()=>this._view?.qualityProfile),(e=>{this._dbg(P.Rendering,"qualityProfile changed to "+e),this._vxl&&this._vxl.set_quality(this._toWasmQuality(e))}),{initial:!0}),this._timeExtentWatchHandle=a((()=>this._view?.timeExtent),(()=>{if(this._vxl){const e=this._getTimeArgs(this._view?.timeExtent);this._dbg(P.Rendering,"sceneView timeExtent changed to useTime="+e.useTime+" st="+e.startTime+" et="+e.endTime),this._vxl.set_scene_time_extent(e.startTime,e.endTime,e.useTime),this._renderPluginContext.requestRender()}}),{initial:!0}),this._stationaryWatchHandle=a((()=>this._view?.stationary),(e=>{this._vxl&&e&&!this._lastFrameWasStationary&&this._renderPluginContext.requestRender()}))}initializeRenderContext(e){this._dbg(P.Lifetime,"--initializeRenderContext--");const t=e.renderContext.rctx;t.type===E.WEBGL2?(this._renderPluginContext=e,this._rctx=e.renderContext.rctx,this._halfIntTexturesAvailable=!!this._rctx.capabilities.textureNorm16,this._textureFloatLinearAvailable=this._rctx.capabilities.textureFloatLinear,this._initializeWasm(t.gl)):this._dbg(P.Error,"WebGL 1 context only!")}uninitializeRenderContext(){this._renderPluginContext=null,this._rctx=null,this._dbg(P.Lifetime,"--uninitializeRenderContext--")}_restoreFramebuffer(){if(!this._renderTargetToRestore)return;const e=this._renderTargetToRestore.fbo;if(!!!this._rctx)return void this._dbg(P.Error,"no context in restoreFramebuffer!");this._rctx.bindFramebuffer(e,!0);const t=this._renderTargetToRestore.viewport;this._rctx.setViewport(t.x,t.y,t.width,t.height)}_bindPreviousDepthToSlot(e,t){const i=!!this._rctx,s=!!this._renderTargetToRestore;if(!i||!s)return 0;const r=this._renderTargetToRestore.fbo.depthStencilTexture;return r?(0===t?this._rctx.bindTexture(null,e,!0):this._rctx.bindTexture(r,e,!0),1):(this._dbg(P.Error,"no depth/stencil texture exists!"),0)}_modifyResourceCount(e,t,i){if(!this._rctx)return void this._dbg(P.Error,"modifyAllocation callback has no rendering context!");const s=e;1===i?this._rctx.instanceCounter.increment(s,t):this._rctx.instanceCounter.decrement(s,t)}_setBlendState(e,t,i,s){this._rctx?(this._rctx.setBlendingEnabled(1===e),this._rctx.setBlendFunction(t,i),this._rctx.setBlendEquation(s)):this._dbg(P.Error,"setBlendState callback has no rendering context!")}_setFrontFace(e){this._rctx?this._rctx.setFrontFace(e):this._dbg(P.Error,"setFrontFace callback has no rendering context!")}_setDepthStencilStateFunction(e,t,i){this._rctx?(this._rctx.setDepthFunction(i),this._rctx.setDepthTestEnabled(1===e),this._rctx.setDepthWriteEnabled(1===t),this._rctx.setStencilTestEnabled(!1),this._rctx.setStencilFunction(C.ALWAYS,0,255),this._rctx.setStencilOpSeparate(F.FRONT,V.KEEP,V.INCR,V.KEEP),this._rctx.setStencilOpSeparate(F.BACK,V.KEEP,V.DECR,V.KEEP)):this._dbg(P.Error,"setDepthStencilStateFunction callback has no rendering context!")}_setRasterizerState(e){if(this._rctx)switch(e){case _.None:this._rctx.setFaceCullingEnabled(!1);break;case _.Back:this._rctx.setCullFace(F.BACK),this._rctx.setFaceCullingEnabled(!0);break;case _.Front:this._rctx.setCullFace(F.FRONT),this._rctx.setFaceCullingEnabled(!0)}else this._dbg(P.Error,"setRasterizerState callback has no rendering context!")}_setViewport(e,t,i,s){this._rctx?this._rctx.setViewport(e,t,i,s):this._dbg(P.Error,"setViewport callback has no rendering context!")}_updateMemoryUsage(){this._layers.forEach(((e,t)=>{if(e.needMemoryUsageUpdate){const i=this._vxl.estimate_memory_usage(t);i>=0&&(e.needMemoryUsageUpdate=!1,e.layerView.setUsedMemory(i))}}))}_syncRequestsResponses(){this._layers.forEach(((e,i)=>{const s=[];e.responses.forEach(((t,r)=>{s.push(r),this._dbg(P.RequestResponse,"responding for requestID:"+r+" size:"+t.size),this._vxl.respond(i,r,t),t.requestType!==u.TreeIndex&&t.requestType!==u.Section||(e.needMemoryUsageUpdate=!0)}));const a=e.responses;for(const t of s)a.delete(t);const n=this._vxl.get_new_requests(i),o=e.abortController.signal;for(const l in n){e.outstandingRequestCount+=1,1===e.outstandingRequestCount&&e.layerView.updatingFlagChanged();const i=n[l],s={responseType:"array-buffer",signal:o};this._dbg(P.RequestResponse,"making requestID:"+l+" url:"+i.url),t(i.url,s).then((t=>{e.outstandingRequestCount-=1,0===e.outstandingRequestCount&&e.layerView.updatingFlagChanged(),this._dbg(P.RequestResponse,"have response for requestID:"+l);let s=0;if(t.data.byteLength>0){s=this._vxl._malloc(t.data.byteLength);const e=new Uint8Array(this._vxl.HEAPU8.buffer,s,t.data.byteLength),i=new Uint8Array(t.data);for(let s=0;s<t.data.byteLength;++s)e[s]=i[s]}a.set(+l,{responseType:i.responseType,ptr:s,size:t.data.byteLength,success:!0,requestType:i.requestType})})).catch((t=>{e.outstandingRequestCount-=1,0===e.outstandingRequestCount&&e.layerView.updatingFlagChanged(),r(t)||(this._dbg(P.Error,`requestID:${l} failed, error=${t.toString()}`),a.set(+l,{responseType:i.responseType,ptr:0,size:0,success:!1,requestType:i.requestType}))}))}}))}updateWasmCamera(e){this._vxl.set_projection_matrix.apply(this._vxl,e.projectionMatrix),this._vxl.set_view_matrix.apply(this._vxl,e.viewMatrix),this._vxl.set_near_far(e.near,e.far)}isUpdating(e){if(!this._vxl&&this._vxlPromise)return!0;const t=this._layers.get(e);return!!t&&t.outstandingRequestCount>0}getLayerTimes(e){const t=[];return this._layers.forEach(((i,s)=>{if(i.layerView.wasmLayerId===e.wasmLayerId){const i=this._vxl.get_layer_epoch_times(s,e.layer.currentVariableId);for(let e=0;e<i.length;++e)t.push(i[e])}})),t}getCurrentLayerTimeIndex(e){let t=0;return this._layers.forEach(((i,s)=>{i.layerView.wasmLayerId===e.wasmLayerId&&(t=this._vxl.get_layer_current_time_id(s))})),t}setEnabled(e,t){this._layers.forEach(((i,s)=>{i.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl.set_enabled(s,t),i.needMemoryUsageUpdate=!0,this._renderPluginContext.requestRender())}))}setStaticSections(e,t){const i={mask:c.StaticSections,staticSections:t};return this._doMaskedUIUpdate(e,i,!0)}setCurrentVariable(e,t){const i={mask:c.CurrentVariable,currentVariable:t};return this._doMaskedUIUpdate(e,i,!0)}setRenderMode(e,t){const i={mask:c.RenderMode,renderMode:t};return this._doMaskedUIUpdate(e,i,!0)}setVerticalExaggerationAndOffset(e,t,i,s){const r={mask:c.ExaggerationAndOffset,volStyleDesc:{volumeId:t,verticalExaggeration:i,verticalOffset:s}};return this._doMaskedUIUpdate(e,r,!0)}setVariableStyles(e,t){const i={mask:c.VariableStyles,variableStyles:t};return this._doMaskedUIUpdate(e,i,!0)}setVolumeStyles(e,t){const i={mask:c.VolumeStyles,volumeStyles:t};return this._doMaskedUIUpdate(e,i,!0)}setEnableDynamicSections(e,t){const i={mask:c.ContainerVisibility,containerIsVisible:t,container:m.DynamicSections};return this._doMaskedUIUpdate(e,i,!0)}setEnableIsosurfaces(e,t){const i={mask:c.ContainerVisibility,containerIsVisible:t,container:m.Isosurfaces};return this._doMaskedUIUpdate(e,i,!0)}setEnableSections(e,t){const i={mask:c.ContainerVisibility,containerIsVisible:t,container:m.StaticSections};return this._doMaskedUIUpdate(e,i,!0)}setAnalysisSlice(e,t,i,s){const r={mask:c.AnalysisSlice,analysisSlice:{point:i,normal:s,enabled:t}};return this._doMaskedUIUpdate(e,r,!0)}_doMaskedUIUpdate(e,t,i){if(!this._vxl)return!1;let s=!1;return this._layers.forEach(((i,r)=>{if(i.layerView.wasmLayerId===e.wasmLayerId){const e={str:JSON.stringify(t),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(s=1===this._vxl.handle_masked_ui_update(r,e.ptr,e.byteCount),e.isReusable||this._vxl._free(e.ptr))}})),s&&i&&this._renderPluginContext.requestRender(),s}_addTriangleToWasmBuffer(e,t,i,s,r){return e[3*t]=i[0],e[3*t+1]=i[1],e[3*t+2]=i[2],e[3*(t+=1)]=s[0],e[3*t+1]=s[1],e[3*t+2]=s[2],e[3*(t+=1)]=r[0],e[3*t+1]=r[1],e[3*t+2]=r[2],t+=1}_addNormalToWasmBuffer(e,t,i){return e[3*t]=i[0],e[3*t+1]=i[1],e[3*t+2]=i[2],t+=1}_doCaptureFrustum(){if(!this._vxl)return;const e=36,t=e/3,i=this._vxl._malloc(3*e*Float32Array.BYTES_PER_ELEMENT),s=new Float32Array(this._vxl.HEAPF32.buffer,i,3*e),r=this._vxl._malloc(3*t*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(this._vxl.HEAPF32.buffer,r,e),n=this._frustum.points[h.NEAR_BOTTOM_LEFT],o=this._frustum.points[h.NEAR_BOTTOM_RIGHT],l=this._frustum.points[h.NEAR_TOP_RIGHT],_=this._frustum.points[h.NEAR_TOP_LEFT],u=this._frustum.points[h.FAR_BOTTOM_LEFT],c=this._frustum.points[h.FAR_BOTTOM_RIGHT],m=this._frustum.points[h.FAR_TOP_RIGHT],g=this._frustum.points[h.FAR_TOP_LEFT];let f=0,p=0;const x=this._frustum.planes[d.NEAR];f=this._addTriangleToWasmBuffer(s,f,l,o,n),p=this._addNormalToWasmBuffer(a,p,x),f=this._addTriangleToWasmBuffer(s,f,n,_,l),p=this._addNormalToWasmBuffer(a,p,x);const y=this._frustum.planes[d.FAR];f=this._addTriangleToWasmBuffer(s,f,u,c,m),p=this._addNormalToWasmBuffer(a,p,y),f=this._addTriangleToWasmBuffer(s,f,m,g,u),p=this._addNormalToWasmBuffer(a,p,y);const v=this._frustum.planes[d.TOP];f=this._addTriangleToWasmBuffer(s,f,m,l,_),p=this._addNormalToWasmBuffer(a,p,v),f=this._addTriangleToWasmBuffer(s,f,_,g,m),p=this._addNormalToWasmBuffer(a,p,v);const b=this._frustum.planes[d.BOTTOM];f=this._addTriangleToWasmBuffer(s,f,n,o,c),p=this._addNormalToWasmBuffer(a,p,b),f=this._addTriangleToWasmBuffer(s,f,c,u,n),p=this._addNormalToWasmBuffer(a,p,b);const w=this._frustum.planes[d.LEFT];f=this._addTriangleToWasmBuffer(s,f,_,n,u),p=this._addNormalToWasmBuffer(a,p,w),f=this._addTriangleToWasmBuffer(s,f,u,g,_),p=this._addNormalToWasmBuffer(a,p,w);const T=this._frustum.planes[d.RIGHT];f=this._addTriangleToWasmBuffer(s,f,l,m,c),p=this._addNormalToWasmBuffer(a,p,T),f=this._addTriangleToWasmBuffer(s,f,c,o,l),p=this._addNormalToWasmBuffer(a,p,T),-1!==this._frustumRenderableId&&this._vxl.remove_generic_mesh(this._frustumRenderableId),this._frustumRenderableId=this._vxl.add_generic_mesh(i,3*e,r,e,255,0,0,64),this._vxl._free(i),this._vxl._free(r),this._captureFrustum=!1,this._renderPluginContext.requestRender()}captureFrustum(){null===this._renderCoordsHelper&&(this._renderCoordsHelper=y.create(f.Local,l(!1,this._view.spatialReference))),null===this._frustum&&(this._frustum=new x(this._renderCoordsHelper)),this._captureFrustum=!0,null!==this._renderPluginContext&&this._renderPluginContext.requestRender()}toggleFullVolumeExtentDraw(e){this._vxl&&this._layers.forEach(((t,i)=>{t.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl.toggle_full_volume_extent_draw(i),this._renderPluginContext.requestRender())}))}addVoxelLayer(e){if(!this._vxl){const t={layerView:e,resolveCallback:null,rejectCallback:null},i=new Promise(((e,i)=>{t.resolveCallback=e,t.rejectCallback=i}));return this._newLayers.push(t),i}const t=this._addVoxelLayer(e);return t<0?Promise.reject(-1):Promise.resolve(t)}removeVoxelLayer(e){if(!this._vxl){const t=this._newLayers.findIndex((t=>e.uid===t.layerView.uid));t>=0&&(this._newLayers[t].resolveCallback(-1),this._newLayers.splice(t,1));const i=this._newLayers.length;return 0===i&&(this._dbg(P.Lifetime," no voxel layers left after removing a layer, removing RenderPlugin and destroying"),this.destroy()),i}let t=-1;this._layers.forEach(((i,s)=>{if(i.layerView.wasmLayerId===e.wasmLayerId){t=s,i.abortController.abort(),this._vxl.remove_layer(t);const r=this.layerUid.indexOf(e.layer.uid);-1!==r&&this.layerUid.splice(r,1)}})),t>=0&&this._layers.delete(t);const i=this._layers.size;return 0===i&&(this._dbg(P.Lifetime," no voxel layers left after removing a layer, removing RenderPlugin and destroying"),this.destroy()),i}_getBlockSize(e){for(const t of this._wasmMemBlockSizes)if(e<t)return t;return-1}_allocateBlock(e){e.byteCount=this._vxl.lengthBytesUTF8(e.str)+1;const t=this._getBlockSize(e.byteCount);return t<0?(e.isReusable=!1,e.ptr=this._vxl._malloc(e.byteCount)):(e.isReusable=!0,e.ptr=this._wasmMemBlocks.get(t),0===e.ptr&&(e.ptr=this._vxl._malloc(t),this._wasmMemBlocks.set(t,e.ptr))),0!==e.ptr&&(this._vxl.stringToUTF8(e.str,e.ptr,e.byteCount),!0)}_getTimeArgs(e){let t=-Number.MAX_VALUE,i=Number.MAX_VALUE,s=!1;return null!=e&&(e.isAllTime?s=!0:(null!=e.start&&(s=!0,t=e.start.getTime()/1e3),null!=e.end&&(s=!0,i=e.end.getTime()/1e3))),{startTime:t,endTime:i,useTime:s}}_addVoxelLayer(e){const t=e.layer;let i=-1;const s=t.getConfiguration();if(s.length<1)return-1;const r={str:s,byteCount:0,ptr:0,isReusable:!1};if(!this._allocateBlock(r))return-1;const a=this._getTimeArgs(this._view?.timeExtent),n=this._view.spatialReference.isWGS84&&t.spatialReference.isWGS84?111319.49079327357:1;if(i=this._vxl.add_layer(t.serviceRoot,r.ptr,r.byteCount,n,n,a.startTime,a.endTime,a.useTime,this._toWasmQuality(this._view.qualityProfile)),r.isReusable||this._vxl._free(r.ptr),i>=0){t.test?.constantUpscaling&&(this._setUpscalingLimits(0,.25,.25),this._setUpscalingLimits(1,.5,.5),this._setUpscalingLimits(2,.75,.75));const s=new AbortController;if(this._layers.set(i,{layerView:e,responses:new Map,outstandingRequestCount:0,abortController:s,needMemoryUsageUpdate:!1}),this.layerUid.push(e.layer.uid),!this._halfIntTexturesAvailable||has("mac")){const t=[];let i="";for(const s of e.layer.variables)"Int16"!==s.renderingFormat.type&&"UInt16"!==s.renderingFormat.type||(t.push(s.name),s.id===e.layer.currentVariableId&&(i=s.name));""!==i&&S.error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${i}' in this browser`),t.length>0&&S.warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}if(!this._textureFloatLinearAvailable){const t=[];let i="";for(const s of e.layer.variables)"Float32"===s.renderingFormat.type&&(t.push(s.name),s.id===e.layer.currentVariableId&&(i=s.name));""!==i&&S.error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${i}' in this browser`),t.length>0&&S.warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}return has("esri-mobile")&&S.warnOnce("Mobile support differs across devices. Voxel layer might not display as expected."),i}return-1}prepareRender(e){if(!this._vxl)return;const t=e.bindParameters.camera.viewForward,i=e.bindParameters.camera.eye;this._vxl.update_camera_pos_and_direction(i[0],i[1],i[2],t[0],t[1],t[2]);const s=this._vxl.cull();this._dbg(P.RequestResponse,"missingResourceCount="+s),this._moreToLoad=s>0,this._havePreparedWithAllLayers=0===this._newLayers.length,this._updateMemoryUsage()}render(e){if(!this._vxl||e.output!==this._shaderOutput||e.bindParameters.slot!==this._renderSlot)return;for(const i of this._newLayers){const e=this._addVoxelLayer(i.layerView);-1===e?i.rejectCallback(-1):i.resolveCallback(e)}if(this._newLayers=[],0===this._layers.size)return void this._dbg(P.Error,"No voxel layers but RenderPlugin instance is being asked to render!");this._lastFrameWasStationary=this._view.stationary,this._syncRequestsResponses(),this._beforeDraw(),this._vxl.begin_color_frame(!this._view._stage.renderer.isFeatureEnabled(R.HighQualityVoxel),e.bindParameters.lighting.mainLight.direction[0],e.bindParameters.lighting.mainLight.direction[1],e.bindParameters.lighting.mainLight.direction[2]);const t=this._renderTargetToRestore.viewport;t.width===this._viewportWidth&&t.height===this._viewportHeight||(this._viewportWidth=t.width,this._viewportHeight=t.height,this._vxl.set_viewport(t.width,t.height),this._layers.forEach((e=>{e.needMemoryUsageUpdate=!0}))),0===t.x&&0===t.y||this._dbg(P.Error,"Unsupported viewport parameters detected!"),this.updateWasmCamera(e.bindParameters.camera),this._captureFrustum&&(this._frustum.update(e.bindParameters.camera),this._doCaptureFrustum()),this._vxl.draw(),this._afterDraw(),(this._moreToLoad||!this._havePreparedWithAllLayers&&this._layers.size>0)&&this._renderPluginContext.requestRender()}destroy(){this._dbg(P.Lifetime,"--destroy--"),this._removeRenderPlugin(),this._readyWatchHandle=s(this._readyWatchHandle),this._qualityWatchHandle=s(this._qualityWatchHandle),this._timeExtentWatchHandle=s(this._timeExtentWatchHandle),this._stationaryWatchHandle=s(this._stationaryWatchHandle),this._vxl&&(this._layers.forEach((e=>{e.abortController.abort()})),this._wasmMemBlocks.forEach((e=>{0!==e&&this._vxl._free(e)})),this._vxl.uninitialize_voxel_wasm(),this._vxl=null)}_initializeWasm(e){return this._vxl?Promise.resolve():(this._vxlPromise||(this._vxlPromise=g(e).then((e=>{if(this._vxl=e,this._vxlPromise=null,this._newLayers.length<=0)return this._dbg(P.Lifetime," no voxel layers left after WASM downloaded, removing RenderPlugin and destroying"),void this.destroy();const t=this._getTimeArgs(this._view?.timeExtent),i=this._vxl.addFunction(this._restoreFramebuffer.bind(this),"v"),s=this._vxl.addFunction(this._setBlendState.bind(this),"viiii"),r=this._vxl.addFunction(this._setFrontFace.bind(this),"vi"),a=this._vxl.addFunction(this._setRasterizerState.bind(this),"vi"),n=this._vxl.addFunction(this._setDepthStencilStateFunction.bind(this),"viii"),o=this._vxl.addFunction(this._setViewport.bind(this),"viiii"),l=this._vxl.addFunction(this._bindPreviousDepthToSlot.bind(this),"iii"),h=this._vxl.addFunction(this._modifyResourceCount.bind(this),"viii"),d=this._halfIntTexturesAvailable&&!has("mac"),_=this._textureFloatLinearAvailable;this._vxl.initialize_voxel_wasm(i,s,r,a,n,o,l,h,t.startTime,t.endTime,t.useTime,d,_),this._renderPluginContext&&this._renderPluginContext.requestRender()})).catch((()=>{for(const e of this._newLayers)e.rejectCallback(-2);this._dbg(P.Error," WASM failed to download, removing RenderPlugin and destroying"),this.destroy()}))),this._vxlPromise)}pickDepth(e,t,i){if(!this._vxl||!this._rctx||0===this._layers.size)return null;const s=i.viewport[3]-t;if(e<0||e>i.viewport[2]||t<0||t>i.viewport[3])return this._dbg(P.Error,`[js] pickDepth: outOfRange, screenXY=[${e.toFixed(0)}, ${s.toFixed(0)}]]`),null;this._beforeDraw();const r=i.viewForward,a=i.eye;this._vxl.update_camera_pos_and_direction(a[0],a[1],a[2],r[0],r[1],r[2]),this.updateWasmCamera(i),this._vxl.begin_frame();const n=this._vxl.pick_depth(e,s);if(this._afterDraw(),n.success){return n.distanceToCamera}return null}pickObject(e,t,i,s){if(!this._vxl||!this._rctx||0===this._layers.size)return null;const r=Math.round(e),a=Math.round(t);if(r<0||r>i.viewport[2]||a<0||a>i.viewport[3])return this._dbg(P.Error,`[js] pickObject: outOfRange, screenXY=[${r}, ${a}], vp=[${i.viewport.toString()}]`),null;this._beforeDraw();const n=i.viewForward,o=i.eye;this._vxl.update_camera_pos_and_direction(o[0],o[1],o[2],n[0],n[1],n[2]),this.updateWasmCamera(i),this._vxl.begin_frame();let l=null;if(0===s.length)l=this._vxl.pick_object(r,a,0,0);else{const e={str:JSON.stringify({layerIds:s}),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(l=this._vxl.pick_object(r,a,e.ptr,e.byteCount),e.isReusable||this._vxl._free(e.ptr))}return this._afterDraw(),l}_beforeDraw(){this._renderTargetToRestore={fbo:this._rctx.getBoundFramebufferObject(),viewport:this._rctx.getViewport()},this._rctx.setPolygonOffsetFillEnabled(!1),this._rctx.setScissorTestEnabled(!1),this._rctx.setColorMask(!0,!0,!0,!0)}_afterDraw(){this._renderTargetToRestore.fbo=null,this._rctx.externalTextureUnitUpdate(this._vxl.get_texture_units_bound_in_frame(),this._vxl.get_active_texture_unit()),this._rctx.externalVertexArrayObjectUpdate(),this._rctx.externalVertexBufferUpdate(),this._rctx.externalProgramUpdate()}intersect(e,t,i,s,r){if(!this._vxl||!this._rctx||0===this._layers.size||!e.options.selectionMode||e.options.isFiltered)return;if(r[0]<0||r[0]>e.camera.viewport[2]||r[1]<0||r[1]>e.camera.viewport[3])return this._dbg(P.Error,`[js] VoxelWasmPerScene.intersect: outOfRange, screenXY=[${r[0].toFixed(0)}, ${r[1].toFixed(0)}]`),null;const a=[];this._layers.forEach((t=>{e.options.filteredLayerUids.includes(t.layerView.layer.uid)&&a.push(t.layerView.wasmLayerId)}));const l=this.pickObject(r[0],r[1],e.camera,a);if(null==l||-1===l.layerId)return;const h=this._layers.get(l.layerId);if(h){const t=h.layerView.layer.uid,r=l.distanceToCamera/n(i,s),a=o();a[0]=l.worldX,a[1]=l.worldY,a[2]=l.worldZ;const d={};if(null!=l.continuousValue&&null!=l.continuousValueUnits?d["Voxel.ServiceValue"]=`${l.continuousValue.toLocaleString()} ${l.continuousValueUnits}`:null!=l.uniqueValueLabel&&null!=l.uniqueValue?d["Voxel.ServiceValue"]=`${l.uniqueValueLabel} (${l.uniqueValue})`:null!=l.uniqueValue&&(d["Voxel.ServiceValue"]=`${l.uniqueValue}`),d["Voxel.ServiceVariableLabel"]=l.variableLabel,d["Voxel.Position"]=l.voxelSpacePosition,null!=l.epochTime&&null!=l.nativeTime&&null!=l.nativeTimeUnits){const e=new Date(l.epochTime);d["Voxel.ServiceLocalTime"]=e.toString(),d["Voxel.ServiceNativeTime"]=`${l.nativeTime.toLocaleString()} ${l.nativeTimeUnits}`}null!=l.depth&&null!=l.depthUnits&&(d["Voxel.ServiceDepth"]=`${l.depth.toLocaleString()} ${l.depthUnits}`);const _=l.faceNormal;d["Voxel.WorldPosition"]=`[${a[0]}, ${a[1]}, ${a[2]}]`;const u=e=>{const i=new p(a,t,(()=>this._createVoxelGraphic(h.layerView.layer,d)));e.set(this.type,i,r,_)},c=e.results,m=e.options.store===T.ALL;if((null==c.min.dist||r<c.min.dist)&&u(c.min),(null==c.max.dist||r>c.max.dist)&&u(c.max),m){const t=b(e.ray);u(t),e.results.all.push(t)}}}_createVoxelGraphic(t,i){return new e({layer:t,sourceLayer:t,attributes:i})}_toWasmQuality(e){switch(e){case"low":return 0;case"medium":return 1;case"high":return 2}}_setUpscalingLimits(e,t,i){this._vxl&&this._vxl.set_upscaling_limits(e,t,i)}}export{U as default};
5
+ import e from"../Graphic.js";import t from"../request.js";import has from"../core/has.js";import i from"../core/Logger.js";import{removeMaybe as s}from"../core/maybe.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{i as n}from"../chunks/vec3.js";import{c as o}from"../chunks/vec3f64.js";import{renderSRFromViewSR as l}from"../geometry/support/coordinateSystem.js";import{PointIndex as h,PlaneIndex as d}from"../geometry/support/frustum.js";import{WasmCullMode as _,VoxelRequestType as u,UpdateFlags as c,ContainerType as m}from"../libs/vxl/enums.js";import{loadVoxelWASM as g}from"../libs/vxl/VxlModule.js";import{ViewingMode as f}from"../views/ViewingMode.js";import{VoxelTarget as p}from"../views/3d/layers/i3s/Intersector.js";import{Frustum as x}from"../views/3d/state/Frustum.js";import{RenderCoordsHelper as y}from"../views/3d/support/RenderCoordsHelper.js";import{ShaderOutput as v}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{newIntersectorResult as b}from"../views/3d/webgl-engine/lib/Intersector.js";import{IntersectorType as w,StoreResults as T}from"../views/3d/webgl-engine/lib/IntersectorInterfaces.js";import{RenderFeature as R}from"../views/3d/webgl-engine/lib/RenderFeature.js";import{RenderSlot as L}from"../views/3d/webgl-engine/lib/RenderSlot.js";import{ContextType as E}from"../views/webgl/contextUtils.js";import{CompareFunction as C,Face as F,StencilOperation as V}from"../views/webgl/enums.js";const S=i.getLogger("esri.layers.VoxelWasmPerSceneView");var P;!function(e){e[e.Lifetime=1]="Lifetime",e[e.RequestResponse=2]="RequestResponse",e[e.Rendering=3]="Rendering",e[e.Error=4]="Error"}(P||(P={}));class U{constructor(e){this._halfIntTexturesAvailable=!1,this._textureFloatLinearAvailable=!1,this._havePreparedWithAllLayers=!1,this._readyWatchHandle=null,this._qualityWatchHandle=null,this._stationaryWatchHandle=null,this._timeExtentWatchHandle=null,this._renderPluginContext=null,this._vxlPromise=null,this._vxl=null,this._pluginIsActive=!1,this._moreToLoad=!1,this._viewportWidth=-1,this._viewportHeight=-1,this._newLayers=[],this._layers=new Map,this._shaderOutput=v.Color,this._renderSlot=L.VOXEL,this._rctx=null,this._renderTargetToRestore=null,this._lastFrameWasStationary=!1,this._wasmMemBlockSizes=[512,1024,2048,4096,8192,16384,32768,65536],this._wasmMemBlocks=new Map,this._dbgFlags=new Set,this._captureFrustum=!1,this._frustum=null,this._frustumRenderableId=-1,this._renderCoordsHelper=null,this.type=w.VOXEL,this.slicePlaneEnabled=!0,this.isGround=!1,this.layerUid=[],this._view=e,this._initialize()}get canRender(){return!!this._vxl&&"local"===this._view.viewingMode}_dbg(e,t){this._dbgFlags.has(e)&&(e===P.Error?S.error(t):S.warn(t))}_removeRenderPlugin(){this._pluginIsActive&&this._view._stage&&(this._dbg(P.Lifetime,"--removeRenderPlugin--"),this._view._stage.removeRenderPlugin(this)),this._pluginIsActive=!1}_initialize(){this._dbg(P.Lifetime,"--initialize--");for(const e of this._wasmMemBlockSizes)this._wasmMemBlocks.set(e,0);this._readyWatchHandle=a((()=>this._view.ready),(e=>{e&&"local"===this._view.viewingMode?(this._dbg(P.Lifetime,"view ready status changed to ready on a local view, calling addRenderPlugin"),this._view._stage.addRenderPlugin([this._renderSlot],this),this._pluginIsActive=!0):(this._dbg(P.Lifetime,"view ready status changed, not ready or not a local view!"),this._removeRenderPlugin())}),{initial:!0}),this._qualityWatchHandle=a((()=>this._view?.qualityProfile),(e=>{this._dbg(P.Rendering,"qualityProfile changed to "+e),this._vxl&&this._vxl.set_quality(this._toWasmQuality(e))}),{initial:!0}),this._timeExtentWatchHandle=a((()=>this._view?.timeExtent),(()=>{if(this._vxl){const e=this._getTimeArgs(this._view?.timeExtent);this._dbg(P.Rendering,"sceneView timeExtent changed to useTime="+e.useTime+" st="+e.startTime+" et="+e.endTime),this._vxl.set_scene_time_extent(e.startTime,e.endTime,e.useTime),this._renderPluginContext.requestRender()}}),{initial:!0}),this._stationaryWatchHandle=a((()=>this._view?.stationary),(e=>{this._vxl&&e&&!this._lastFrameWasStationary&&this._renderPluginContext.requestRender()}))}initializeRenderContext(e){this._dbg(P.Lifetime,"--initializeRenderContext--");const t=e.renderContext.rctx;t.type===E.WEBGL2?(this._renderPluginContext=e,this._rctx=e.renderContext.rctx,this._halfIntTexturesAvailable=!!this._rctx.capabilities.textureNorm16,this._textureFloatLinearAvailable=this._rctx.capabilities.textureFloatLinear,this._initializeWasm(t.gl)):this._dbg(P.Error,"WebGL 1 context only!")}uninitializeRenderContext(){this._renderPluginContext=null,this._rctx=null,this._dbg(P.Lifetime,"--uninitializeRenderContext--")}_restoreFramebuffer(){if(!this._renderTargetToRestore)return;const e=this._renderTargetToRestore.fbo;if(!!!this._rctx)return void this._dbg(P.Error,"no context in restoreFramebuffer!");this._rctx.bindFramebuffer(e,!0);const t=this._renderTargetToRestore.viewport;this._rctx.setViewport(t.x,t.y,t.width,t.height)}_bindPreviousDepthToSlot(e,t){const i=!!this._rctx,s=!!this._renderTargetToRestore;if(!i||!s)return 0;const r=this._renderTargetToRestore.fbo.depthStencilTexture;return r?(0===t?this._rctx.bindTexture(null,e,!0):this._rctx.bindTexture(r,e,!0),1):(this._dbg(P.Error,"no depth/stencil texture exists!"),0)}_modifyResourceCount(e,t,i){if(!this._rctx)return void this._dbg(P.Error,"modifyAllocation callback has no rendering context!");const s=e;1===i?this._rctx.instanceCounter.increment(s,t):this._rctx.instanceCounter.decrement(s,t)}_setBlendState(e,t,i,s){this._rctx?(this._rctx.setBlendingEnabled(1===e),this._rctx.setBlendFunction(t,i),this._rctx.setBlendEquation(s)):this._dbg(P.Error,"setBlendState callback has no rendering context!")}_setFrontFace(e){this._rctx?this._rctx.setFrontFace(e):this._dbg(P.Error,"setFrontFace callback has no rendering context!")}_setDepthStencilStateFunction(e,t,i){this._rctx?(this._rctx.setDepthFunction(i),this._rctx.setDepthTestEnabled(1===e),this._rctx.setDepthWriteEnabled(1===t),this._rctx.setStencilTestEnabled(!1),this._rctx.setStencilFunction(C.ALWAYS,0,255),this._rctx.setStencilOpSeparate(F.FRONT,V.KEEP,V.INCR,V.KEEP),this._rctx.setStencilOpSeparate(F.BACK,V.KEEP,V.DECR,V.KEEP)):this._dbg(P.Error,"setDepthStencilStateFunction callback has no rendering context!")}_setRasterizerState(e){if(this._rctx)switch(e){case _.None:this._rctx.setFaceCullingEnabled(!1);break;case _.Back:this._rctx.setCullFace(F.BACK),this._rctx.setFaceCullingEnabled(!0);break;case _.Front:this._rctx.setCullFace(F.FRONT),this._rctx.setFaceCullingEnabled(!0)}else this._dbg(P.Error,"setRasterizerState callback has no rendering context!")}_setViewport(e,t,i,s){this._rctx?this._rctx.setViewport(e,t,i,s):this._dbg(P.Error,"setViewport callback has no rendering context!")}_updateMemoryUsage(){this._layers.forEach(((e,t)=>{if(e.needMemoryUsageUpdate){const i=this._vxl.estimate_memory_usage(t);i>=0&&(e.needMemoryUsageUpdate=!1,e.layerView.setUsedMemory(i))}}))}_syncRequestsResponses(){this._layers.forEach(((e,i)=>{const s=[];e.responses.forEach(((t,r)=>{s.push(r),this._dbg(P.RequestResponse,"responding for requestID:"+r+" size:"+t.size),this._vxl.respond(i,r,t),t.requestType!==u.TreeIndex&&t.requestType!==u.Section||(e.needMemoryUsageUpdate=!0)}));const a=e.responses;for(const t of s)a.delete(t);const n=this._vxl.get_new_requests(i),o=e.abortController.signal;for(const l in n){e.outstandingRequestCount+=1,1===e.outstandingRequestCount&&e.layerView.updatingFlagChanged();const i=n[l],s={responseType:"array-buffer",signal:o};this._dbg(P.RequestResponse,"making requestID:"+l+" url:"+i.url),t(i.url,s).then((t=>{e.outstandingRequestCount-=1,0===e.outstandingRequestCount&&e.layerView.updatingFlagChanged(),this._dbg(P.RequestResponse,"have response for requestID:"+l);let s=0;if(t.data.byteLength>0){s=this._vxl._malloc(t.data.byteLength);const e=new Uint8Array(this._vxl.HEAPU8.buffer,s,t.data.byteLength),i=new Uint8Array(t.data);for(let s=0;s<t.data.byteLength;++s)e[s]=i[s]}a.set(+l,{responseType:i.responseType,ptr:s,size:t.data.byteLength,success:!0,requestType:i.requestType})})).catch((t=>{e.outstandingRequestCount-=1,0===e.outstandingRequestCount&&e.layerView.updatingFlagChanged(),r(t)||(this._dbg(P.Error,`requestID:${l} failed, error=${t.toString()}`),a.set(+l,{responseType:i.responseType,ptr:0,size:0,success:!1,requestType:i.requestType}))}))}}))}updateWasmCamera(e){this._vxl.set_projection_matrix.apply(this._vxl,e.projectionMatrix),this._vxl.set_view_matrix.apply(this._vxl,e.viewMatrix),this._vxl.set_near_far(e.near,e.far)}isUpdating(e){if(!this._vxl&&this._vxlPromise)return!0;const t=this._layers.get(e);return!!t&&t.outstandingRequestCount>0}getLayerTimes(e){const t=[];return this._layers.forEach(((i,s)=>{if(i.layerView.wasmLayerId===e.wasmLayerId){const i=this._vxl.get_layer_epoch_times(s,e.layer.currentVariableId);for(let e=0;e<i.length;++e)t.push(i[e])}})),t}getCurrentLayerTimeIndex(e){let t=0;return this._layers.forEach(((i,s)=>{i.layerView.wasmLayerId===e.wasmLayerId&&(t=this._vxl.get_layer_current_time_id(s))})),t}setEnabled(e,t){this._layers.forEach(((i,s)=>{i.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl.set_enabled(s,t),i.needMemoryUsageUpdate=!0,this._renderPluginContext.requestRender())}))}setStaticSections(e,t){const i={mask:c.StaticSections,staticSections:t};return this._doMaskedUIUpdate(e,i,!0)}setCurrentVariable(e,t){const i={mask:c.CurrentVariable,currentVariable:t};return this._doMaskedUIUpdate(e,i,!0)}setRenderMode(e,t){const i={mask:c.RenderMode,renderMode:t};return this._doMaskedUIUpdate(e,i,!0)}setVerticalExaggerationAndOffset(e,t,i,s){const r={mask:c.ExaggerationAndOffset,volStyleDesc:{volumeId:t,verticalExaggeration:i,verticalOffset:s}};return this._doMaskedUIUpdate(e,r,!0)}setVariableStyles(e,t){const i={mask:c.VariableStyles,variableStyles:t};return this._doMaskedUIUpdate(e,i,!0)}setVolumeStyles(e,t){const i={mask:c.VolumeStyles,volumeStyles:t};return this._doMaskedUIUpdate(e,i,!0)}setEnableDynamicSections(e,t){const i={mask:c.ContainerVisibility,containerIsVisible:t,container:m.DynamicSections};return this._doMaskedUIUpdate(e,i,!0)}setEnableIsosurfaces(e,t){const i={mask:c.ContainerVisibility,containerIsVisible:t,container:m.Isosurfaces};return this._doMaskedUIUpdate(e,i,!0)}setEnableSections(e,t){const i={mask:c.ContainerVisibility,containerIsVisible:t,container:m.StaticSections};return this._doMaskedUIUpdate(e,i,!0)}setAnalysisSlice(e,t,i,s){const r={mask:c.AnalysisSlice,analysisSlice:{point:i,normal:s,enabled:t}};return this._doMaskedUIUpdate(e,r,!0)}_doMaskedUIUpdate(e,t,i){if(!this._vxl)return!1;let s=!1;return this._layers.forEach(((i,r)=>{if(i.layerView.wasmLayerId===e.wasmLayerId){const e={str:JSON.stringify(t),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(s=1===this._vxl.handle_masked_ui_update(r,e.ptr,e.byteCount),e.isReusable||this._vxl._free(e.ptr))}})),s&&i&&this._renderPluginContext.requestRender(),s}_addTriangleToWasmBuffer(e,t,i,s,r){return e[3*t]=i[0],e[3*t+1]=i[1],e[3*t+2]=i[2],e[3*(t+=1)]=s[0],e[3*t+1]=s[1],e[3*t+2]=s[2],e[3*(t+=1)]=r[0],e[3*t+1]=r[1],e[3*t+2]=r[2],t+=1}_addNormalToWasmBuffer(e,t,i){return e[3*t]=i[0],e[3*t+1]=i[1],e[3*t+2]=i[2],t+=1}_doCaptureFrustum(){if(!this._vxl)return;const e=36,t=e/3,i=this._vxl._malloc(3*e*Float32Array.BYTES_PER_ELEMENT),s=new Float32Array(this._vxl.HEAPF32.buffer,i,3*e),r=this._vxl._malloc(3*t*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(this._vxl.HEAPF32.buffer,r,e),n=this._frustum.points[h.NEAR_BOTTOM_LEFT],o=this._frustum.points[h.NEAR_BOTTOM_RIGHT],l=this._frustum.points[h.NEAR_TOP_RIGHT],_=this._frustum.points[h.NEAR_TOP_LEFT],u=this._frustum.points[h.FAR_BOTTOM_LEFT],c=this._frustum.points[h.FAR_BOTTOM_RIGHT],m=this._frustum.points[h.FAR_TOP_RIGHT],g=this._frustum.points[h.FAR_TOP_LEFT];let f=0,p=0;const x=this._frustum.planes[d.NEAR];f=this._addTriangleToWasmBuffer(s,f,l,o,n),p=this._addNormalToWasmBuffer(a,p,x),f=this._addTriangleToWasmBuffer(s,f,n,_,l),p=this._addNormalToWasmBuffer(a,p,x);const y=this._frustum.planes[d.FAR];f=this._addTriangleToWasmBuffer(s,f,u,c,m),p=this._addNormalToWasmBuffer(a,p,y),f=this._addTriangleToWasmBuffer(s,f,m,g,u),p=this._addNormalToWasmBuffer(a,p,y);const v=this._frustum.planes[d.TOP];f=this._addTriangleToWasmBuffer(s,f,m,l,_),p=this._addNormalToWasmBuffer(a,p,v),f=this._addTriangleToWasmBuffer(s,f,_,g,m),p=this._addNormalToWasmBuffer(a,p,v);const b=this._frustum.planes[d.BOTTOM];f=this._addTriangleToWasmBuffer(s,f,n,o,c),p=this._addNormalToWasmBuffer(a,p,b),f=this._addTriangleToWasmBuffer(s,f,c,u,n),p=this._addNormalToWasmBuffer(a,p,b);const w=this._frustum.planes[d.LEFT];f=this._addTriangleToWasmBuffer(s,f,_,n,u),p=this._addNormalToWasmBuffer(a,p,w),f=this._addTriangleToWasmBuffer(s,f,u,g,_),p=this._addNormalToWasmBuffer(a,p,w);const T=this._frustum.planes[d.RIGHT];f=this._addTriangleToWasmBuffer(s,f,l,m,c),p=this._addNormalToWasmBuffer(a,p,T),f=this._addTriangleToWasmBuffer(s,f,c,o,l),p=this._addNormalToWasmBuffer(a,p,T),-1!==this._frustumRenderableId&&this._vxl.remove_generic_mesh(this._frustumRenderableId),this._frustumRenderableId=this._vxl.add_generic_mesh(i,3*e,r,e,255,0,0,64),this._vxl._free(i),this._vxl._free(r),this._captureFrustum=!1,this._renderPluginContext.requestRender()}captureFrustum(){null===this._renderCoordsHelper&&(this._renderCoordsHelper=y.create(f.Local,l(!1,this._view.spatialReference))),null===this._frustum&&(this._frustum=new x(this._renderCoordsHelper)),this._captureFrustum=!0,null!==this._renderPluginContext&&this._renderPluginContext.requestRender()}toggleFullVolumeExtentDraw(e){this._vxl&&this._layers.forEach(((t,i)=>{t.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl.toggle_full_volume_extent_draw(i),this._renderPluginContext.requestRender())}))}addVoxelLayer(e){if(!this._vxl){const t={layerView:e,resolveCallback:null,rejectCallback:null},i=new Promise(((e,i)=>{t.resolveCallback=e,t.rejectCallback=i}));return this._newLayers.push(t),i}const t=this._addVoxelLayer(e);return t<0?Promise.reject(-1):Promise.resolve(t)}removeVoxelLayer(e){if(!this._vxl){const t=this._newLayers.findIndex((t=>e.uid===t.layerView.uid));t>=0&&(this._newLayers[t].resolveCallback(-1),this._newLayers.splice(t,1));const i=this._newLayers.length;return 0===i&&(this._dbg(P.Lifetime," no voxel layers left after removing a layer, removing RenderPlugin and destroying"),this.destroy()),i}let t=-1;this._layers.forEach(((i,s)=>{if(i.layerView.wasmLayerId===e.wasmLayerId){t=s,i.abortController.abort(),this._vxl.remove_layer(t);const r=this.layerUid.indexOf(e.layer.uid);-1!==r&&this.layerUid.splice(r,1)}})),t>=0&&this._layers.delete(t);const i=this._layers.size;return 0===i&&(this._dbg(P.Lifetime," no voxel layers left after removing a layer, removing RenderPlugin and destroying"),this.destroy()),i}_getBlockSize(e){for(const t of this._wasmMemBlockSizes)if(e<t)return t;return-1}_allocateBlock(e){e.byteCount=this._vxl.lengthBytesUTF8(e.str)+1;const t=this._getBlockSize(e.byteCount);return t<0?(e.isReusable=!1,e.ptr=this._vxl._malloc(e.byteCount)):(e.isReusable=!0,e.ptr=this._wasmMemBlocks.get(t),0===e.ptr&&(e.ptr=this._vxl._malloc(t),this._wasmMemBlocks.set(t,e.ptr))),0!==e.ptr&&(this._vxl.stringToUTF8(e.str,e.ptr,e.byteCount),!0)}_getTimeArgs(e){let t=-Number.MAX_VALUE,i=Number.MAX_VALUE,s=!1;return null!=e&&(e.isAllTime?s=!0:(null!=e.start&&(s=!0,t=e.start.getTime()/1e3),null!=e.end&&(s=!0,i=e.end.getTime()/1e3))),{startTime:t,endTime:i,useTime:s}}_addVoxelLayer(e){const t=e.layer;let i=-1;const s=t.getConfiguration();if(s.length<1)return-1;const r={str:s,byteCount:0,ptr:0,isReusable:!1};if(!this._allocateBlock(r))return-1;const a=this._getTimeArgs(this._view?.timeExtent),n=this._view.spatialReference.isWGS84&&t.spatialReference.isWGS84?111319.49079327357:1;if(i=this._vxl.add_layer(t.serviceRoot,r.ptr,r.byteCount,n,n,a.startTime,a.endTime,a.useTime,this._toWasmQuality(this._view.qualityProfile)),r.isReusable||this._vxl._free(r.ptr),i>=0){t.test?.constantUpscaling&&(this._setUpscalingLimits(0,.25,.25),this._setUpscalingLimits(1,.5,.5),this._setUpscalingLimits(2,.75,.75));const s=new AbortController;if(this._layers.set(i,{layerView:e,responses:new Map,outstandingRequestCount:0,abortController:s,needMemoryUsageUpdate:!1}),this.layerUid.push(e.layer.uid),!this._halfIntTexturesAvailable||has("mac")){const t=[];let i="";for(const s of e.layer.variables)"Int16"!==s.renderingFormat.type&&"UInt16"!==s.renderingFormat.type||(t.push(s.name),s.id===e.layer.currentVariableId&&(i=s.name));""!==i&&S.error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${i}' in this browser`),t.length>0&&S.warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}if(!this._textureFloatLinearAvailable){const t=[];let i="";for(const s of e.layer.variables)"Float32"===s.renderingFormat.type&&(t.push(s.name),s.id===e.layer.currentVariableId&&(i=s.name));""!==i&&S.error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${i}' in this browser`),t.length>0&&S.warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}return has("esri-mobile")&&S.warnOnce("Mobile support differs across devices. Voxel layer might not display as expected."),i}return-1}prepareRender(e){if(!this._vxl)return;const t=e.bindParameters.camera.viewForward,i=e.bindParameters.camera.eye;this._vxl.update_camera_pos_and_direction(i[0],i[1],i[2],t[0],t[1],t[2]);const s=this._vxl.cull();this._dbg(P.RequestResponse,"missingResourceCount="+s),this._moreToLoad=s>0,this._havePreparedWithAllLayers=0===this._newLayers.length,this._updateMemoryUsage()}render(e){if(!this._vxl||e.output!==this._shaderOutput||e.bindParameters.slot!==this._renderSlot)return;for(const i of this._newLayers){const e=this._addVoxelLayer(i.layerView);-1===e?i.rejectCallback(-1):i.resolveCallback(e)}if(this._newLayers=[],0===this._layers.size)return void this._dbg(P.Error,"No voxel layers but RenderPlugin instance is being asked to render!");this._lastFrameWasStationary=this._view.stationary,this._syncRequestsResponses(),this._beforeDraw(),this._vxl.begin_color_frame(!this._view._stage.renderer.isFeatureEnabled(R.HighResolutionVoxel),e.bindParameters.lighting.mainLight.direction[0],e.bindParameters.lighting.mainLight.direction[1],e.bindParameters.lighting.mainLight.direction[2]);const t=this._renderTargetToRestore.viewport;t.width===this._viewportWidth&&t.height===this._viewportHeight||(this._viewportWidth=t.width,this._viewportHeight=t.height,this._vxl.set_viewport(t.width,t.height),this._layers.forEach((e=>{e.needMemoryUsageUpdate=!0}))),0===t.x&&0===t.y||this._dbg(P.Error,"Unsupported viewport parameters detected!"),this.updateWasmCamera(e.bindParameters.camera),this._captureFrustum&&(this._frustum.update(e.bindParameters.camera),this._doCaptureFrustum()),this._vxl.draw(),this._afterDraw(),(this._moreToLoad||!this._havePreparedWithAllLayers&&this._layers.size>0)&&this._renderPluginContext.requestRender()}destroy(){this._dbg(P.Lifetime,"--destroy--"),this._removeRenderPlugin(),this._readyWatchHandle=s(this._readyWatchHandle),this._qualityWatchHandle=s(this._qualityWatchHandle),this._timeExtentWatchHandle=s(this._timeExtentWatchHandle),this._stationaryWatchHandle=s(this._stationaryWatchHandle),this._vxl&&(this._layers.forEach((e=>{e.abortController.abort()})),this._wasmMemBlocks.forEach((e=>{0!==e&&this._vxl._free(e)})),this._vxl.uninitialize_voxel_wasm(),this._vxl=null)}_initializeWasm(e){return this._vxl?Promise.resolve():(this._vxlPromise||(this._vxlPromise=g(e).then((e=>{if(this._vxl=e,this._vxlPromise=null,this._newLayers.length<=0)return this._dbg(P.Lifetime," no voxel layers left after WASM downloaded, removing RenderPlugin and destroying"),void this.destroy();const t=this._getTimeArgs(this._view?.timeExtent),i=this._vxl.addFunction(this._restoreFramebuffer.bind(this),"v"),s=this._vxl.addFunction(this._setBlendState.bind(this),"viiii"),r=this._vxl.addFunction(this._setFrontFace.bind(this),"vi"),a=this._vxl.addFunction(this._setRasterizerState.bind(this),"vi"),n=this._vxl.addFunction(this._setDepthStencilStateFunction.bind(this),"viii"),o=this._vxl.addFunction(this._setViewport.bind(this),"viiii"),l=this._vxl.addFunction(this._bindPreviousDepthToSlot.bind(this),"iii"),h=this._vxl.addFunction(this._modifyResourceCount.bind(this),"viii"),d=this._halfIntTexturesAvailable&&!has("mac"),_=this._textureFloatLinearAvailable;this._vxl.initialize_voxel_wasm(i,s,r,a,n,o,l,h,t.startTime,t.endTime,t.useTime,d,_),this._renderPluginContext&&this._renderPluginContext.requestRender()})).catch((()=>{for(const e of this._newLayers)e.rejectCallback(-2);this._dbg(P.Error," WASM failed to download, removing RenderPlugin and destroying"),this.destroy()}))),this._vxlPromise)}pickDepth(e,t,i){if(!this._vxl||!this._rctx||0===this._layers.size)return null;const s=i.viewport[3]-t;if(e<0||e>i.viewport[2]||t<0||t>i.viewport[3])return this._dbg(P.Error,`[js] pickDepth: outOfRange, screenXY=[${e.toFixed(0)}, ${s.toFixed(0)}]]`),null;this._beforeDraw();const r=i.viewForward,a=i.eye;this._vxl.update_camera_pos_and_direction(a[0],a[1],a[2],r[0],r[1],r[2]),this.updateWasmCamera(i),this._vxl.begin_frame();const n=this._vxl.pick_depth(e,s);if(this._afterDraw(),n.success){return n.distanceToCamera}return null}pickObject(e,t,i,s){if(!this._vxl||!this._rctx||0===this._layers.size)return null;const r=Math.round(e),a=Math.round(t);if(r<0||r>i.viewport[2]||a<0||a>i.viewport[3])return this._dbg(P.Error,`[js] pickObject: outOfRange, screenXY=[${r}, ${a}], vp=[${i.viewport.toString()}]`),null;this._beforeDraw();const n=i.viewForward,o=i.eye;this._vxl.update_camera_pos_and_direction(o[0],o[1],o[2],n[0],n[1],n[2]),this.updateWasmCamera(i),this._vxl.begin_frame();let l=null;if(0===s.length)l=this._vxl.pick_object(r,a,0,0);else{const e={str:JSON.stringify({layerIds:s}),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(l=this._vxl.pick_object(r,a,e.ptr,e.byteCount),e.isReusable||this._vxl._free(e.ptr))}return this._afterDraw(),l}_beforeDraw(){this._renderTargetToRestore={fbo:this._rctx.getBoundFramebufferObject(),viewport:this._rctx.getViewport()},this._rctx.setPolygonOffsetFillEnabled(!1),this._rctx.setScissorTestEnabled(!1),this._rctx.setColorMask(!0,!0,!0,!0)}_afterDraw(){this._renderTargetToRestore.fbo=null,this._rctx.externalTextureUnitUpdate(this._vxl.get_texture_units_bound_in_frame(),this._vxl.get_active_texture_unit()),this._rctx.externalVertexArrayObjectUpdate(),this._rctx.externalVertexBufferUpdate(),this._rctx.externalProgramUpdate()}intersect(e,t,i,s,r){if(!this._vxl||!this._rctx||0===this._layers.size||!e.options.selectionMode||e.options.isFiltered)return;if(r[0]<0||r[0]>e.camera.viewport[2]||r[1]<0||r[1]>e.camera.viewport[3])return this._dbg(P.Error,`[js] VoxelWasmPerScene.intersect: outOfRange, screenXY=[${r[0].toFixed(0)}, ${r[1].toFixed(0)}]`),null;const a=[];this._layers.forEach((t=>{e.options.filteredLayerUids.includes(t.layerView.layer.uid)&&a.push(t.layerView.wasmLayerId)}));const l=this.pickObject(r[0],r[1],e.camera,a);if(null==l||-1===l.layerId)return;const h=this._layers.get(l.layerId);if(h){const t=h.layerView.layer.uid,r=l.distanceToCamera/n(i,s),a=o();a[0]=l.worldX,a[1]=l.worldY,a[2]=l.worldZ;const d={};if(null!=l.continuousValue&&null!=l.continuousValueUnits?d["Voxel.ServiceValue"]=`${l.continuousValue.toLocaleString()} ${l.continuousValueUnits}`:null!=l.uniqueValueLabel&&null!=l.uniqueValue?d["Voxel.ServiceValue"]=`${l.uniqueValueLabel} (${l.uniqueValue})`:null!=l.uniqueValue&&(d["Voxel.ServiceValue"]=`${l.uniqueValue}`),d["Voxel.ServiceVariableLabel"]=l.variableLabel,d["Voxel.Position"]=l.voxelSpacePosition,null!=l.epochTime&&null!=l.nativeTime&&null!=l.nativeTimeUnits){const e=new Date(l.epochTime);d["Voxel.ServiceLocalTime"]=e.toString(),d["Voxel.ServiceNativeTime"]=`${l.nativeTime.toLocaleString()} ${l.nativeTimeUnits}`}null!=l.depth&&null!=l.depthUnits&&(d["Voxel.ServiceDepth"]=`${l.depth.toLocaleString()} ${l.depthUnits}`);const _=l.faceNormal;d["Voxel.WorldPosition"]=`[${a[0]}, ${a[1]}, ${a[2]}]`;const u=e=>{const i=new p(a,t,(()=>this._createVoxelGraphic(h.layerView.layer,d)));e.set(this.type,i,r,_)},c=e.results,m=e.options.store===T.ALL;if((null==c.min.dist||r<c.min.dist)&&u(c.min),(null==c.max.dist||r>c.max.dist)&&u(c.max),m){const t=b(e.ray);u(t),e.results.all.push(t)}}}_createVoxelGraphic(t,i){return new e({layer:t,sourceLayer:t,attributes:i})}_toWasmQuality(e){switch(e){case"low":return 0;case"medium":return 1;case"high":return 2}}_setUpscalingLimits(e,t,i){this._vxl&&this._vxl.set_upscaling_limits(e,t,i)}}export{U as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Error.js";import{JSONMap as s}from"../../../core/jsonMap.js";import{WhereClauseCache as n}from"../../../core/sql/WhereClauseCache.js";const i=new n(50,500),r="feature-store:unsupported-query",t=" as ",o=new s({esriFieldTypeString:"string"}),a=new s({esriFieldTypeOID:"oid",esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long"}),l=new s({esriFieldTypeDate:"date"}),p=new Set([...a.jsonValues,...l.jsonValues,...o.jsonValues]),d=new Intl.ListFormat("en-US",{type:"conjunction"}).format([...a.apiValues,...l.apiValues,...o.apiValues]);function u(s,n,i={}){const t=f(s,n);if(!t)throw new e(r,"invalid SQL expression",{expression:s});const o=i.expressionName||"expression";if(i.validateStandardized&&!t.isStandardized)throw new e(r,`${o} is not standard`,{expression:s});if(i.validateAggregate&&!t.isAggregate)throw new e(r,`${o} does not contain a valid aggregate function`,{expression:s});return t.fieldNames}function g(e,s){if(!s)return!0;const n="where clause",i=u(s,e,{validateStandardized:!0,expressionName:n});return m(e,i,{expressionName:n}),x(e,i,{expressionName:n}),!0}function c(s,n,t){if(!n)return!0;const o="having",a=u(n,s,{validateAggregate:!0,expressionName:o});m(s,a,{expressionName:o}),x(s,a,{expressionName:o});const l=i.get(n,s),p=l?.getExpressions().every((e=>{const{aggregateType:n,field:i}=e,r=s.get(i)?.name;return t.some((e=>{const{onStatisticField:i,statisticType:t}=e,o=s.get(i)?.name;return o===r&&t.toLowerCase().trim()===n}))}));if(!p)throw new e(r,"expressions in having should also exist in outStatistics",{having:n});return!0}function f(e,s){return e?i.get(e,s):null}function m(e,s,n={}){n.errorMessage||(n.errorMessage=n.expressionName?`${n.expressionName} contains invalid fields`:"Fields are invalid"),h(e,s,((e,s)=>s.has(e)),n)}function x(e,s,n={}){n.errorMessage||(n.errorMessage=n.expressionName?`${n.expressionName} only supports ${d} field types`:`Only ${d} field types are supported`),h(e,s,((e,s)=>!v(e,s)),n)}function h(s,n,i,t={}){const o=t.verifyExpression??!0,a=[];for(const e of n){const n=i(e,s);if("*"!==e&&!n)if(o){const n=y(e);try{h(s,u(n,s,{validateStandardized:!0}),i,t)}catch(l){const s=l?.details;if(s?.expression)throw l;s?.invalidFields?a.push(...s.invalidFields):a.push(e)}}else a.push(e)}if(a.length)throw new e(r,t.errorMessage,{invalidFields:a})}function y(e){return e.split(t)[0]}function w(e){return e.split(t)[1]}function v(e,s,n=p){const i=s.get(e);return!!i&&!n.has(i.type)}export{w as getAliasFromFieldName,y as getExpressionFromFieldName,f as getWhereClause,v as hasInvalidFieldType,l as validDateTypesKebabDict,a as validNumericTypesKebabDict,x as validateFieldTypes,m as validateFields,c as validateHaving,g as validateWhere};
5
+ import e from"../../../core/Error.js";import{JSONMap as s}from"../../../core/jsonMap.js";import{WhereClauseCache as i}from"../../../core/sql/WhereClauseCache.js";const n=new i(50,500),r="feature-store:unsupported-query",t=" as ",o=new s({esriFieldTypeString:"string"}),a=new s({esriFieldTypeOID:"oid",esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long"}),l=new s({esriFieldTypeDate:"date"}),d=new s({esriFieldTypeGUID:"guid",esriFieldTypeGlobalId:"global-id"}),p=new Set([...a.jsonValues,...l.jsonValues,...o.jsonValues,...d.jsonValues]),u=new Intl.ListFormat("en-US",{type:"conjunction"}).format([...a.apiValues,...l.apiValues,...o.apiValues,...d.apiValues]);function g(s,i,n={}){const t=m(s,i);if(!t)throw new e(r,"invalid SQL expression",{expression:s});const o=n.expressionName||"expression";if(n.validateStandardized&&!t.isStandardized)throw new e(r,`${o} is not standard`,{expression:s});if(n.validateAggregate&&!t.isAggregate)throw new e(r,`${o} does not contain a valid aggregate function`,{expression:s});return t.fieldNames}function c(e,s){if(!s)return!0;const i="where clause",n=g(s,e,{validateStandardized:!0,expressionName:i});return x(e,n,{expressionName:i}),y(e,n,{expressionName:i}),!0}function f(s,i,t){if(!i)return!0;const o="having",a=g(i,s,{validateAggregate:!0,expressionName:o});x(s,a,{expressionName:o}),y(s,a,{expressionName:o});const l=n.get(i,s),d=l?.getExpressions().every((e=>{const{aggregateType:i,field:n}=e,r=s.get(n)?.name;return t.some((e=>{const{onStatisticField:n,statisticType:t}=e,o=s.get(n)?.name;return o===r&&t.toLowerCase().trim()===i}))}));if(!d)throw new e(r,"expressions in having should also exist in outStatistics",{having:i});return!0}function m(e,s){return e?n.get(e,s):null}function x(e,s,i={}){i.errorMessage||(i.errorMessage=i.expressionName?`${i.expressionName} contains invalid fields`:"Fields are invalid"),h(e,s,((e,s)=>s.has(e)),i)}function y(e,s,i={}){i.errorMessage||(i.errorMessage=i.expressionName?`${i.expressionName} only supports ${u} field types`:`Only ${u} field types are supported`),h(e,s,((e,s)=>!F(e,s)),i)}function h(s,i,n,t={}){const o=t.verifyExpression??!0,a=[];for(const e of i){const i=n(e,s);if("*"!==e&&!i)if(o){const i=w(e);try{h(s,g(i,s,{validateStandardized:!0}),n,t)}catch(l){const s=l?.details;if(s?.expression)throw l;s?.invalidFields?a.push(...s.invalidFields):a.push(e)}}else a.push(e)}if(a.length)throw new e(r,t.errorMessage,{invalidFields:a})}function w(e){return e.split(t)[0]}function v(e){return e.split(t)[1]}function F(e,s,i=p){const n=s.get(e);return!!n&&!i.has(n.type)}export{v as getAliasFromFieldName,w as getExpressionFromFieldName,m as getWhereClause,F as hasInvalidFieldType,l as validDateTypesKebabDict,d as validGuidTypesKebabDict,a as validNumericTypesKebabDict,y as validateFieldTypes,x as validateFields,f as validateHaving,c as validateWhere};