@arcgis/core 6.0.0-next.33 → 6.0.0-next.35

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 (317) hide show
  1. package/Basemap.d.ts +2 -2
  2. package/README.md +2 -2
  3. package/analysis/ShadowCastAnalysis.d.ts +11 -5
  4. package/applications/Urban/meshUtils.d.ts +1 -0
  5. package/applications/Urban/meshUtils.js +1 -1
  6. package/arcgisGlobal.d.ts +1 -0
  7. package/assets/esri/core/libs/libtess/libtess-f32.wasm +0 -0
  8. package/assets/esri/core/libs/libtess/libtess-f64.wasm +0 -0
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/01f55004d64309f8538b.js +1 -0
  11. package/assets/esri/core/workers/chunks/0202eb8c2b2865f99981.js +1 -0
  12. package/assets/esri/core/workers/chunks/{67e533748435253aaba6.js → 0284f608d25c654fcc11.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{f3dc0bc0e00635855a7a.js → 03daf6f235c6edef6268.js} +1 -1
  14. package/assets/esri/core/workers/chunks/04a1d08c3b5b1dc7628f.js +1 -0
  15. package/assets/esri/core/workers/chunks/{1eaf8bfdd3765a90ccc2.js → 0523f893870a1546d7d9.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{1ee4df0fd61440cb5f02.js → 06102715e9a8f218e07c.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{6029773458ab98600f67.js → 07e5482e1fc69be5de09.js} +1 -1
  18. package/assets/esri/core/workers/chunks/08140725277de5d2e41a.js +1 -0
  19. package/assets/esri/core/workers/chunks/{72d20d3957d612f86431.js → 0a508e25ec05363e1f04.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{2d9a1f23ec6ce90723ac.js → 0d99bfb75dcb9fa29080.js} +1 -1
  21. package/assets/esri/core/workers/chunks/10ad7b35b6800d40444e.js +1 -0
  22. package/assets/esri/core/workers/chunks/1132e28aaa5825b10b6e.js +1 -0
  23. package/assets/esri/core/workers/chunks/{84038dd85005fea413eb.js → 139e753d95cfc9470e74.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{dd30b02c5978c1c5f511.js → 155861fbd0e5fc2db80c.js} +1 -1
  25. package/assets/esri/core/workers/chunks/15950c2fb173b62ee0ec.js +1 -0
  26. package/assets/esri/core/workers/chunks/165ca7a97b611c8f26c4.js +1 -0
  27. package/assets/esri/core/workers/chunks/{418addce122dbb8897b4.js → 1a614bac5db42c6263f8.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{0cc7fba402a93e6d2455.js → 1ae0c9345626e70affd3.js} +2 -2
  29. package/assets/esri/core/workers/chunks/{58c3ae6030def2ed5f31.js → 1b17f5f720f6cf3f6d73.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{cd355baab983033c3ef0.js → 1ec772eaa63eb6937231.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{f9dc38761b314d33890f.js → 1f51567f47c2e2fc8a23.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{5c04835b0b52461183cd.js → 1fd82fcba2758741996a.js} +1 -1
  33. package/assets/esri/core/workers/chunks/21e1d423ee33f916547e.js +1 -0
  34. package/assets/esri/core/workers/chunks/2211ff0a1f1ae8100231.js +1 -0
  35. package/assets/esri/core/workers/chunks/{096b2bf1c0d69d27f20c.js → 247617c0dbae2386ab3b.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{97ec46605f16333144b7.js → 26ea39dfdf887f357fce.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{85de980c5b296ec69323.js → 279089a6a3f08022c678.js} +1 -1
  38. package/assets/esri/core/workers/chunks/29c610ce1c81ebb84a6b.js +1 -0
  39. package/assets/esri/core/workers/chunks/2b4dd42920d37b1ff0a9.js +2 -0
  40. package/assets/esri/core/workers/chunks/{8da2a10318f49d0dc73a.js → 31ef7b7074b3e3829763.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{b657363113f4a37e634b.js → 3223f9fbc76ba9ef8d13.js} +1 -1
  42. package/assets/esri/core/workers/chunks/322b22a5d54e404bebd5.js +1 -0
  43. package/assets/esri/core/workers/chunks/{122e75b21699a4e83b15.js → 338d800d4efcc91cead1.js} +1 -1
  44. package/assets/esri/core/workers/chunks/3537fe95b83a13b156cc.js +1 -0
  45. package/assets/esri/core/workers/chunks/{360c944c610efa2051fc.js → 379db67f78161ebd5468.js} +2 -2
  46. package/assets/esri/core/workers/chunks/{f09bc86cd52224febfcb.js → 3b380e64566a6cce59e2.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{be55771758e4bcef0976.js → 3e406043a374ee17475b.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{e3b212f8af448ec29eef.js → 3fe4c89acd325d36618d.js} +1 -1
  49. package/assets/esri/core/workers/chunks/449a2dee17b54946f245.js +1 -0
  50. package/assets/esri/core/workers/chunks/46c290108a90518ef695.js +1 -0
  51. package/assets/esri/core/workers/chunks/{a596779eaeec7310671d.js → 478a89317a12e9b4d146.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{fcc3902d6d9eda6f09f5.js → 48b8b57f559a53c6c513.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{55a9eaeb152a3abada67.js → 4e5405134d079bdf9b7a.js} +1 -1
  54. package/assets/esri/core/workers/chunks/4f3e0d583cfa9d1d6727.js +2 -0
  55. package/assets/esri/core/workers/chunks/{d070fcb73ce274ab80e4.js → 5504ec9bd9ee4d10af07.js} +1 -1
  56. package/assets/esri/core/workers/chunks/552c36b40e5a5ec117fb.js +1 -0
  57. package/assets/esri/core/workers/chunks/5622f3faa59434772857.js +1 -0
  58. package/assets/esri/core/workers/chunks/{bd46a04a9ee4ea9e6ef1.js → 5864bce1498a13ee5b7e.js} +2 -2
  59. package/assets/esri/core/workers/chunks/59a1b637d2c107504a04.js +1 -0
  60. package/assets/esri/core/workers/chunks/59a88dd53f8806bbec06.js +1 -0
  61. package/assets/esri/core/workers/chunks/{f4d91d470ca5fea0bd26.js → 5bd1414220e42cb8ebcf.js} +1 -1
  62. package/assets/esri/core/workers/chunks/5c2fe67527c9d7b4dba3.js +1 -0
  63. package/assets/esri/core/workers/chunks/5c3aa8386705c5e40358.js +1 -0
  64. package/assets/esri/core/workers/chunks/5d781c2c6204cffffd0d.js +1 -0
  65. package/assets/esri/core/workers/chunks/{176d75e76318bfc25a53.js → 60c8eedd06080edab3e3.js} +1 -1
  66. package/assets/esri/core/workers/chunks/61d36730564c5ac5edab.js +1 -0
  67. package/assets/esri/core/workers/chunks/6604272ef6fe85279032.js +1 -0
  68. package/assets/esri/core/workers/chunks/{29cc6b1705418b1be5d7.js → 687deb918eb48a963c8f.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{0694c7bcfe71692e2ccf.js → 723df53cfa0189837d01.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{90c1d10eae7ae71889b0.js → 7400b8c454b47ee4fb3c.js} +1 -1
  71. package/assets/esri/core/workers/chunks/796c6195b6bf59dcc9bd.js +1 -0
  72. package/assets/esri/core/workers/chunks/7b45ac83e279fe9516a5.js +1 -0
  73. package/assets/esri/core/workers/chunks/{2de077c7b971f2c215a6.js → 7ddbde8fdd1cf3c53f50.js} +1 -1
  74. package/assets/esri/core/workers/chunks/804606b194dc9e71d088.js +1 -0
  75. package/assets/esri/core/workers/chunks/8102f0bf5707c3be3310.js +1 -0
  76. package/assets/esri/core/workers/chunks/{1a8d8274df292d65f82e.js → 81bcc495e6eaf2cf7474.js} +1 -1
  77. package/assets/esri/core/workers/chunks/90360c0bd053d3e3fd77.js +1 -0
  78. package/assets/esri/core/workers/chunks/{d1d6154b4af1c9cc497b.js → 934e1f2153e6fad6ed23.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{e096c1d9d53af74d3207.js → 990e96139b5a1dccb061.js} +1 -1
  80. package/assets/esri/core/workers/chunks/9c3de54513bf8619271c.js +1 -0
  81. package/assets/esri/core/workers/chunks/{f28b63c1179366dac8a2.js → 9e2c30b67bab5795306e.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{9184c947cdefe06bf551.js → a18c3cbe505a19d29569.js} +1 -1
  83. package/assets/esri/core/workers/chunks/aa6ee2aa4ff6e6d41efb.js +1 -0
  84. package/assets/esri/core/workers/chunks/{3fd5c3cd8457ddc68798.js → aa779896fd9e5c341349.js} +1 -1
  85. package/assets/esri/core/workers/chunks/ac10c7d2c4829a150037.js +1 -0
  86. package/assets/esri/core/workers/chunks/{fe6dcb21570395e46ce8.js → afc8a9847f31bb66b13b.js} +1 -1
  87. package/assets/esri/core/workers/chunks/c5bf19da62a3d31009fe.js +2 -0
  88. package/assets/esri/core/workers/chunks/{2226c20c38e20713bcb5.js.LICENSE.txt → c5bf19da62a3d31009fe.js.LICENSE.txt} +1 -1
  89. package/assets/esri/core/workers/chunks/c7adb7b77721c75891f4.js +1 -0
  90. package/assets/esri/core/workers/chunks/cd55cad81accf51d2989.js +1 -0
  91. package/assets/esri/core/workers/chunks/{bead830a677690eeb6fb.js → ce8ef2eec290e1df6b2a.js} +1 -1
  92. package/assets/esri/core/workers/chunks/d3369ffed19f4c264dcd.js +1 -0
  93. package/assets/esri/core/workers/chunks/d3412518a7b518860fbb.js +1 -0
  94. package/assets/esri/core/workers/chunks/{3048e74e6246324ce6fc.js → d5916500514a41a4758f.js} +1 -1
  95. package/assets/esri/core/workers/chunks/{89dc49e784f7ba3b93ea.js → dac69c0047488fdf986d.js} +1 -1
  96. package/assets/esri/core/workers/chunks/db1f7b2562de495b3401.js +2 -0
  97. package/assets/esri/core/workers/chunks/dcc782e4bf9e8a8202f9.js +1 -0
  98. package/assets/esri/core/workers/chunks/dcdf837a452dc0cac582.js +1 -0
  99. package/assets/esri/core/workers/chunks/e0a37d3bcb9a944e53dd.js +1 -0
  100. package/assets/esri/core/workers/chunks/{19a4fa965b70fc6f78f6.js → e209cb1f3f14bf576ebe.js} +1 -1
  101. package/assets/esri/core/workers/chunks/e67ea2f1714e5abeae44.js +1 -0
  102. package/assets/esri/core/workers/chunks/e8fb2ba7b7a4f0916325.js +1 -0
  103. package/assets/esri/core/workers/chunks/{636e9c4ac1f9ae98f9d1.js → ea81f9d71b0842a4be26.js} +1 -1
  104. package/assets/esri/core/workers/chunks/{164c8eeefa8232b2b191.js → eaa0e906b46ae4c84d72.js} +2 -2
  105. package/assets/esri/core/workers/chunks/efcd38aad9aa667001b2.js +1 -0
  106. package/assets/esri/core/workers/chunks/{3aafdb905c697bc9b1ad.js → f372f4eb5527238c46f5.js} +1 -1
  107. package/assets/esri/core/workers/chunks/f497968055af459c5da4.js +1 -0
  108. package/assets/esri/core/workers/chunks/f7123ba1286f64e13e91.js +1 -0
  109. package/assets/esri/core/workers/chunks/fcb4707c2e95099b9f30.js +1 -0
  110. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  111. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  112. package/chunks/BlurEmission.glsl.js +9 -4
  113. package/chunks/GlobalIllumination.glsl.js +55 -46
  114. package/chunks/GlobalIlluminationBlur.glsl.js +13 -9
  115. package/chunks/RibbonLine.glsl.js +90 -88
  116. package/chunks/Terrain.glsl.js +9 -9
  117. package/chunks/libtess-f32.js +1 -1
  118. package/chunks/libtess-f64.js +1 -1
  119. package/chunks/lyr3DMain.js +1 -1
  120. package/chunks/lyr3DWorker.js +2 -2
  121. package/config.d.ts +3 -3
  122. package/config.js +1 -1
  123. package/core/has.js +1 -1
  124. package/core/mathUtils.js +1 -1
  125. package/core/workers.d.ts +1 -0
  126. package/form/FormTemplate.d.ts +1 -1
  127. package/geometry/libtess.js +1 -1
  128. package/geometry/projection/projectors.js +1 -1
  129. package/geometry/support/MeshLocalVertexSpace.d.ts +3 -3
  130. package/geometry/support/aaBoundingRect.js +1 -1
  131. package/geometry/support/meshUtils/convertMeshVertexSpace.js +1 -1
  132. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  133. package/identity/Credential.d.ts +1 -1
  134. package/identity/IdentityManager.d.ts +1 -1
  135. package/identity/IdentityManagerBase.js +1 -1
  136. package/identity/OAuthInfo.d.ts +1 -1
  137. package/identity/ServerInfo.d.ts +1 -1
  138. package/kernel.d.ts +3 -3
  139. package/kernel.js +1 -1
  140. package/layers/CSVLayer.js +1 -1
  141. package/layers/GaussianSplatLayer.js +1 -1
  142. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  143. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  144. package/layers/VectorTileLayer.d.ts +2 -2
  145. package/layers/VideoLayer.js +1 -1
  146. package/layers/VoxelWasmPerSceneView.js +1 -1
  147. package/layers/WFSLayer.d.ts +8 -4
  148. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  149. package/layers/graphics/sources/CSVSource.js +1 -1
  150. package/layers/graphics/sources/GeoJSONSource.js +1 -1
  151. package/layers/graphics/sources/MemorySource.js +2 -2
  152. package/layers/graphics/sources/WFSSource.js +1 -1
  153. package/layers/graphics/sources/geojson/geojson.js +1 -1
  154. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  155. package/layers/graphics/sources/support/QueryTask.js +1 -1
  156. package/layers/graphics/sources/support/timeQueryUtils.js +2 -0
  157. package/layers/mixins/APIKeyMixin.d.ts +1 -1
  158. package/layers/mixins/ArcGISMapService.d.ts +17 -0
  159. package/layers/mixins/ArcGISMapService.js +1 -1
  160. package/layers/ogc/types.d.ts +1 -1
  161. package/layers/ogc/wfsUtils.d.ts +7 -2
  162. package/layers/ogc/wfsUtils.js +1 -1
  163. package/layers/ogc/xmlUtils.js +1 -1
  164. package/layers/support/TelemetryData.d.ts +28 -4
  165. package/layers/support/TimeInformation.js +1 -1
  166. package/layers/support/tiles3DUtils.js +1 -1
  167. package/layers/support/timeInfoUtils.js +2 -0
  168. package/layers/video/videoUtils.js +1 -1
  169. package/package.json +4 -4
  170. package/rest/query/executeAttributeBinsQuery.js +1 -1
  171. package/rest/query/executeForExtent.js +1 -1
  172. package/rest/query/executeForTopCount.js +1 -1
  173. package/rest/query/executeForTopExtents.js +1 -1
  174. package/rest/query/executeForTopIds.js +1 -1
  175. package/rest/query/executeTopFeaturesQuery.js +1 -1
  176. package/rest/query/operations/query.js +1 -1
  177. package/rest/query/operations/queryAttributeBins.js +1 -1
  178. package/rest/query/operations/queryTopFeatures.js +1 -1
  179. package/rest/route.d.ts +1 -1
  180. package/rest/support/AreasAndLengthsParameters.d.ts +1 -1
  181. package/rest/support/LengthsParameters.d.ts +1 -1
  182. package/rest/support/timeUtils.js +1 -1
  183. package/symbols/TextSymbol.d.ts +0 -1
  184. package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
  185. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  186. package/views/2d/engine/webgl/GlyphWorker.js +1 -1
  187. package/views/2d/engine/webgl/TextureManager.js +1 -1
  188. package/views/2d/engine/webgl/materialKeyUtils.js +2 -0
  189. package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
  190. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  191. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  192. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
  193. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
  194. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
  195. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js +1 -1
  196. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js +1 -1
  197. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  198. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js +1 -1
  199. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js +1 -1
  200. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  201. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  202. package/views/2d/layers/VideoLayerView2D.js +1 -1
  203. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  204. package/views/3d/FocusAreasView.js +1 -1
  205. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  206. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  207. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  208. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  209. package/views/3d/analysis/ShadowCast/ShadowCastError.d.ts +40 -0
  210. package/views/3d/analysis/ShadowCast/ShadowCastError.js +2 -0
  211. package/views/3d/analysis/ShadowCast/sunlightUtils.js +2 -0
  212. package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +16 -1
  213. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  214. package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
  215. package/views/3d/camera/intersectionUtils.js +1 -1
  216. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  217. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  218. package/views/3d/layers/Lyr3DWorker.js +1 -1
  219. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  220. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  221. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  222. package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
  223. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  224. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  225. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  226. package/views/3d/layers/graphics/MeshFastUpdateProcessor.js +1 -1
  227. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  228. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  229. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  230. package/views/3d/layers/support/FeatureMemory.js +1 -1
  231. package/views/3d/layers/support/FeatureTile.js +1 -1
  232. package/views/3d/navigation/modes/GroundNavigationMode3D.js +1 -1
  233. package/views/3d/state/Constraints.js +1 -1
  234. package/views/3d/state/NearFarHeuristic.js +1 -1
  235. package/views/3d/state/ScreenSizePerspective.js +1 -1
  236. package/views/3d/state/ViewStateManager.js +1 -1
  237. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  238. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  239. package/views/3d/support/RenderCoordsHelper.js +1 -1
  240. package/views/3d/support/orientedBoundingBox.js +1 -1
  241. package/views/3d/support/sphereExtentUtils.js +1 -1
  242. package/views/3d/terrain/TerrainRenderer.js +1 -1
  243. package/views/3d/terrain/TerrainSurface.js +1 -1
  244. package/views/3d/terrain/TileRenderer.js +1 -1
  245. package/views/3d/terrain/tileUtils.js +1 -1
  246. package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
  247. package/views/3d/webgl-engine/lib/NavigationDepthCache.js +1 -1
  248. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  249. package/views/3d/webgl-engine/lib/RibbonLineVertexInfo.js +1 -1
  250. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  251. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  252. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  253. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  254. package/views/3d/webgl.d.ts +1 -1
  255. package/views/SceneView.js +1 -1
  256. package/views/support/Scheduler.js +1 -1
  257. package/views/webgl/BufferObject.js +1 -1
  258. package/views/webgl/FramebufferObject.js +1 -1
  259. package/widgets/Directions.d.ts +1 -1
  260. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  261. package/widgets/HistogramRangeSlider.d.ts +1 -1
  262. package/assets/esri/core/workers/chunks/0e445ec3523de9f2dfa2.js +0 -1
  263. package/assets/esri/core/workers/chunks/0f6c0d42100c21367e5c.js +0 -1
  264. package/assets/esri/core/workers/chunks/131185d26343a997495e.js +0 -1
  265. package/assets/esri/core/workers/chunks/176d0a06ebff5a29dedf.js +0 -1
  266. package/assets/esri/core/workers/chunks/18776a130d96879a68b1.js +0 -1
  267. package/assets/esri/core/workers/chunks/1a3f71c4d97c36050030.js +0 -1
  268. package/assets/esri/core/workers/chunks/20a698709c3c11ff2c16.js +0 -1
  269. package/assets/esri/core/workers/chunks/2226c20c38e20713bcb5.js +0 -2
  270. package/assets/esri/core/workers/chunks/277263466837e1673f56.js +0 -1
  271. package/assets/esri/core/workers/chunks/2981e904ab62f3ed80d0.js +0 -2
  272. package/assets/esri/core/workers/chunks/32cc59e126df8c96a0cf.js +0 -2
  273. package/assets/esri/core/workers/chunks/379ef56f6b32494832a6.js +0 -1
  274. package/assets/esri/core/workers/chunks/38d852676677e5697864.js +0 -1
  275. package/assets/esri/core/workers/chunks/46453ebfee17b5421d9d.js +0 -1
  276. package/assets/esri/core/workers/chunks/5a9b7eb26f936f03d02e.js +0 -1
  277. package/assets/esri/core/workers/chunks/5bb6c255bdc8aa9ba23e.js +0 -1
  278. package/assets/esri/core/workers/chunks/5f07f52bb8b7721f08d3.js +0 -1
  279. package/assets/esri/core/workers/chunks/654f5441227579d2b6b4.js +0 -1
  280. package/assets/esri/core/workers/chunks/6b5c073dddd89d06ed80.js +0 -1
  281. package/assets/esri/core/workers/chunks/6bb191b19ce43a27f205.js +0 -1
  282. package/assets/esri/core/workers/chunks/6ddc29a144640acb1192.js +0 -1
  283. package/assets/esri/core/workers/chunks/6ebe73f69ae822053b70.js +0 -1
  284. package/assets/esri/core/workers/chunks/6f6d1873753a9c6994aa.js +0 -1
  285. package/assets/esri/core/workers/chunks/7084dd6e10c6c1393e92.js +0 -1
  286. package/assets/esri/core/workers/chunks/7566321c6a2913f2852b.js +0 -1
  287. package/assets/esri/core/workers/chunks/7b5cd150a4d0139850be.js +0 -1
  288. package/assets/esri/core/workers/chunks/7cc9d7a88b64e25fce14.js +0 -1
  289. package/assets/esri/core/workers/chunks/7e211d8a8ad6c6a7cf3e.js +0 -1
  290. package/assets/esri/core/workers/chunks/844eedda8f749972f707.js +0 -2
  291. package/assets/esri/core/workers/chunks/849f446c718e892f39ce.js +0 -1
  292. package/assets/esri/core/workers/chunks/87177e0f82e8a6ae3189.js +0 -1
  293. package/assets/esri/core/workers/chunks/9976eaa81085c0d17e14.js +0 -1
  294. package/assets/esri/core/workers/chunks/a2196a49f89d57a0a1c7.js +0 -1
  295. package/assets/esri/core/workers/chunks/a504a5e06cb89a620799.js +0 -1
  296. package/assets/esri/core/workers/chunks/a65951f1d5702cfd996e.js +0 -1
  297. package/assets/esri/core/workers/chunks/aba259a70bee68d2edb7.js +0 -1
  298. package/assets/esri/core/workers/chunks/b8fd7c3b36981261378b.js +0 -1
  299. package/assets/esri/core/workers/chunks/b9cb92858a576eb6aa06.js +0 -1
  300. package/assets/esri/core/workers/chunks/c33a9635c294c8774977.js +0 -1
  301. package/assets/esri/core/workers/chunks/c570b90995c65bbb2e14.js +0 -1
  302. package/assets/esri/core/workers/chunks/c576bef77e34920af188.js +0 -1
  303. package/assets/esri/core/workers/chunks/cf1ec61eb2ad147bb931.js +0 -1
  304. package/assets/esri/core/workers/chunks/daae21cf77864f3293ef.js +0 -1
  305. package/assets/esri/core/workers/chunks/dc2f93453dfa40f623ab.js +0 -1
  306. package/assets/esri/core/workers/chunks/e81173724e8de8c1e65b.js +0 -1
  307. package/assets/esri/core/workers/chunks/e83f9abee611c5b80009.js +0 -1
  308. package/assets/esri/core/workers/chunks/f39c700f3db7db52b522.js +0 -1
  309. package/assets/esri/core/workers/chunks/f45064066e1ab041a0b2.js +0 -1
  310. package/assets/esri/core/workers/chunks/ffe49d9e7df081bef4a5.js +0 -1
  311. package/views/2d/engine/webgl/hashMosaic.js +0 -2
  312. /package/assets/esri/core/workers/chunks/{0cc7fba402a93e6d2455.js.LICENSE.txt → 1ae0c9345626e70affd3.js.LICENSE.txt} +0 -0
  313. /package/assets/esri/core/workers/chunks/{844eedda8f749972f707.js.LICENSE.txt → 2b4dd42920d37b1ff0a9.js.LICENSE.txt} +0 -0
  314. /package/assets/esri/core/workers/chunks/{32cc59e126df8c96a0cf.js.LICENSE.txt → 4f3e0d583cfa9d1d6727.js.LICENSE.txt} +0 -0
  315. /package/assets/esri/core/workers/chunks/{bd46a04a9ee4ea9e6ef1.js.LICENSE.txt → 5864bce1498a13ee5b7e.js.LICENSE.txt} +0 -0
  316. /package/assets/esri/core/workers/chunks/{2981e904ab62f3ed80d0.js.LICENSE.txt → db1f7b2562de495b3401.js.LICENSE.txt} +0 -0
  317. /package/assets/esri/core/workers/chunks/{164c8eeefa8232b2b191.js.LICENSE.txt → eaa0e906b46ae4c84d72.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{toConst as n}from"../../../../core/compilerUtils.js";import r from"../../../../core/Error.js";import i from"../../../../core/Handles.js";import has from"../../../../core/has.js";import a from"../../../../core/Logger.js";import{onAbortOrThrow as o,throwIfAborted as s}from"../../../../core/promiseUtils.js";import{QueueProcessor as c}from"../../../../core/QueueProcessor.js";import{parseWhereClause as l}from"../../../../core/sql.js";import{getMetersPerUnitForSR as u}from"../../../../core/units.js";import d from"../../../../geometry/SpatialReference.js";import{set as f,create as p,expandWithAABB as m,expandWithRect as ee,negativeInfinity as h}from"../../../../geometry/support/aaBoundingBox.js";import{copy as te,create as g,expandWithRect as ne,negativeInfinity as re}from"../../../../geometry/support/aaBoundingRect.js";import{isWebMercator as _,isWGS84 as v}from"../../../../geometry/support/spatialReferenceUtils.js";import{normalizeColumnPath as y,readParquetFileAttribute as b}from"../../../parquet.js";import{convertToGeometry as x}from"../../featureConversionUtils.js";import{getFieldNamesFromStatistics as S}from"../../data/attributeSupport.js";import{getQueryResultExtent as C,getQueryBoundingRects as w,QueryEngine as T}from"../../data/QueryEngine.js";import{queryCapabilities as ie}from"../../data/QueryEngineCapabilities.js";import{QueryEngineResult as E}from"../../data/QueryEngineResult.js";import{normalizeQueryLike as D}from"../../data/queryUtils.js";import{createFileProvider as O}from"../parquet/createFileProvider.js";import{readFieldStatistic as k}from"../parquet/ParquetFileStatistics.js";import{createDrawingInfo as ae}from"./clientSideDefaults.js";import{getParquetFileId as oe,getParquetRowId as se,getParquetObjectId as ce}from"./parquetIdUtils.js";import A from"../../../support/Field.js";import j from"../../../support/FieldsIndex.js";import{isNumericField as M}from"../../../support/fieldUtils.js";import{fromParquetGeometryEncodingJSON as N}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as P,fromParquetJSONGeometryType as F,toParquetJSONGeometryType as I}from"../../../support/parquetUtils.js";import{loadParquetModule as L}from"../../../../libs/librust-parquet/loadParquetModule.js";import{utc as R}from"../../../../time/constants.js";import{FeatureStoreQueryAdapter as z}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as B}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as V}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as H}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as U}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const W=new z,G=`__OBJECTID`,K=8e3;class le{constructor(e,t){this._files=e,this._createFileStream=t,this._fileIndex=0,this._streamIndex=0,this._streams=[],this._pending=new Set,this._resolvedCount=0}async next(e){for(await this._fill(e);this._pending.size>0;){s(e),await this._fill(e);let t=await ue(this._pending);if(this._pending.delete(t.read),this._resolvedCount++,t.chunk!=null)return t.chunk}return null}async _fill(e){for(this._removeDone();this._pending.size<8;){let t=this._getOrCreateNextStream(e);if(t==null)return;this._pending.add(t.read(e))}}_getOrCreateNextStream(e){let t=this._resolvedCount>=8?8:2;if(this._fileIndex<this._files.length&&this._streams.length<t){let t=this._files[this._fileIndex++],n=new de(t.id,this._createFileStream(t,e));return this._streams.push(n),n}return this._getNextStream()}_getNextStream(){let e=this._streams.length;for(let t=0;t<e;t++){let n=(this._streamIndex+t)%e,r=this._streams[n];if(r.canRead)return this._streamIndex=(n+1)%e,r}return null}_removeDone(){let e=this._streamIndex;for(let t=this._streams.length-1;t>=0;t--)this._streams[t].done&&(this._streams.splice(t,1),t<e&&e--);this._streamIndex=this._streams.length>0?e%this._streams.length:0}}function ue(e){return Promise.race(Array.from(e,async e=>({read:e,chunk:await e})))}class de{constructor(e,t){this._fileId=e,this._stream=t,this._readCount=0,this._reachedEnd=!1}get canRead(){return!this._reachedEnd}get done(){return this._reachedEnd&&this._readCount===0}async read(e){this._readCount++;try{let t=await(await this._stream).next(e);return t==null?(this._reachedEnd=!0,null):{fileId:this._fileId,chunk:t}}finally{this._readCount--}}}class fe{constructor(){this._hasZ=!1,this._hasM=!1,this._queue=new c({concurrency:4,process:(e,t)=>this._executeQuery(e,t)}),this._streams=new Map,this._streamIdCounter=0,this._indexMap={},this._handles=new i}async load(e){let t=e.spatialReference?d.fromJSON(e.spatialReference):void 0;if(t&&!t.isWGS84&&!t.isWebMercator)throw new r(`parquet:unsupported-projection`,`Only WGS84 and Web Mercator are supported`);this._customParameters=e.customParameters,this._loadParameters=e,await this._updateProvider(O(e.provider,null,()=>this._customParameters));let n=await this._provider.getMetadata(),i=await P(n,{fields:e.fields?.map(e=>A.fromJSON(e)),geometryEncoding:e.geometryEncoding?N(e.geometryEncoding):null,geometryType:e.geometryType?F(e.geometryType):null,displayOptimization:e.displayOptimization,spatialReference:t});if(this._hasZ=!!n?.hasZ,this._hasM=!!n?.hasM,!i.fields)throw new r(`parquet:unsupported`,`Fields must be defined`);let o;if(i.spatialReference&&i.geometryType){if(!i.spatialReference)throw new r(`parquet:unsupported`,`SpatialReference must be defined`);if(!i.spatialReference.isGeographic&&!i.spatialReference.isWebMercator)throw new r(`parquet:unsupported-projection`,`Only WGS84 and Web Mercator are supported`);i.spatialReference.isGeographic&&!i.spatialReference.isWGS84&&(a.getLogger(`parquet:unsupported-projection`).warn(`Found a geographic projection that is not WGS84. Handling as WGS84.`,{spatialReference:i.spatialReference}),i.spatialReference=d.WGS84),o={geometry:i.geometryEncoding?{geometryType:I(i.geometryType),spatialReference:i.spatialReference.toJSON(),encoding:i.geometryEncoding.toJSON()}:null,displayOptimization:i.displayOptimization}}this.setCustomParameters(e.customParameters),this._displayOptimization=i.displayOptimization,await this._provider.updateGeometryInfo(o),this._capabilities=$(await this._getFileStatistics(),this._hasZ,this._hasM);let s=await this._provider.getFiles();if(!s.length)return{layerDefinition:{},capabilities:$(null,this._hasZ,this._hasM)};let c=await s[0].file;i.file=c;let{fields:l}=i;if(l==null)throw new r(`parquet-layer:missing-metadata`,`Unable to create parquet source: cannot infer fields`,l);l.push(new A({name:G,type:`oid`,alias:G}));for(let e of l){let t=c.getColumnId(e.name);t!=null&&(this._indexMap[e.name]=t)}let u=j.fromLayerJSON({fields:l.map(e=>e.toJSON()),dateFieldsTimeReference:{timeZoneIANA:`UTC`}});this._fieldsIndex=u;let f=I(i.geometryType??`point`);return this._metadata=H.createFeature({fieldsIndex:u.toJSON(),geometryType:f,hasZ:this._hasZ,hasM:this._hasM,featureIdInfo:{type:`object-id`,fieldName:G},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:i.spatialReference,outSpatialReference:null,attributeSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:R}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:f,featureIdInfo:{type:`object-id`,fieldName:G},hasM:this._hasM,hasZ:this._hasZ,spatialReference:i.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},this._fullExtent=n?.extent?n.extent:await this._tryDeriveParquetFullExtent(i),{capabilities:this._capabilities,layerDefinition:{fields:i.fields?.map(e=>e.toJSON()),drawingInfo:ae(f),extent:this._fullExtent??void 0,geometryType:f,hasZ:this._hasZ,hasM:this._hasM,geometryEncoding:i.geometryEncoding?.toJSON(),displayOptimization:i.displayOptimization}}}destroy(){this._provider.destroy(),this._queue.destroy();for(let{handle:e}of this._streams.values())e.remove();this._streams.clear(),this._indexMap={},this._handles.removeAll()}async reload(e){this.destroy(),await this.load(e)}set remoteClient(e){this._source=e.createInvokeProxy(``)}setCustomParameters(e){this._customParameters=e}getIndexMap(){return this._indexMap}async updateFileProvider(e){this._loadParameters={...this._loadParameters,provider:e};let t=O(e,this._provider.getGeometryInfo(),()=>this._customParameters);await this._updateProvider(t)}async getDiagnosticsSnapshot(){let e=await this._provider.getFiles();return{files:await Promise.all(e.map(e=>e.getDiagnosticsSnapshot()))}}async getColumnIndex(e){return(await this._getFileInfoById(e.fileId)).getColumnIndex(e.rowGroupIndex,e.columnIndex)}async getOffsetIndex(e){return(await this._getFileInfoById(e.fileId)).getOffsetIndex(e.rowGroupIndex,e.columnIndex)}async queryFeatures(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);return this._validateQuery(n),we(n)||(n.resultRecordCount=n.resultRecordCount?Math.min(n.resultRecordCount,K):K,n.resultOffset=n.resultOffset??0),n.outStatistics?this._queryStatistics(n,t):(n.returnDistinctValues&&(n.returnGeometry=void 0),(await this._enqueueQuery(n,t)).createQueryResponse())}async queryFeatureCount(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);return this._validateQuery(n),!q(n)&&!n.returnDistinctValues&&!n.groupByFieldsForStatistics?.length&&!n.outStatistics?.length?this._getFeatureCount():(n.returnDistinctValues||(n.outFields=void 0),n.returnGeometry=void 0,(await this._enqueueQuery(n,t)).createQueryResponseForCount())}async queryObjectIds(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);return this._validateQuery(n),q(n)?(n.resultRecordCount=n.resultRecordCount?Math.min(n.resultRecordCount,8e3):8e3,n.resultOffset=n.resultOffset??0,n.returnGeometry=void 0,n.outFields=void 0,n.returnDistinctValues=void 0,(await this._enqueueQuery(n,t)).items.map(e=>e.getObjectId())):Array.from({length:await this._getFeatureCount()},(e,t)=>t)}async queryAttributeBins(e,t={}){throw new r(`parquet:unsupported`,`queryAttributeBins not supported.`)}async queryExtent(e,t){let r=await D(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),this._fullExtent&&!q(r))return{count:await this._getFeatureCount(),extent:this._fullExtent};let i=n(this._metadata.spatialReference);r.returnGeometry=!0,r.outFields=void 0;let a=f(p(),h),o=p(),s=await this._enqueueQuery(r,t),c=0;for(let e of s.items)e.getBounds(o)&&(m(a,o),c+=1);let l=C(a,i,r.outSR?n(r.outSR):i.toJSON(),i,!1);return{count:c,extent:l}}async queryStream(e,t){if(!t.signal)throw Error(`InternalError: AbortSignal must be passed`);let n=await this._getCandidateFiles(e),r=new le(n,async(t,n)=>{let r=await t.file,i=await this._createParquetDisplayQuery(r,t.id,e);return r.executeQuery(i,K,n)}),i=this._streamIdCounter++,a=o(t.signal,e=>{let t=this._streams.get(i);t!=null&&(t.handle.remove(),this._streams.delete(i))});return this._streams.set(i,{stream:r,handle:a}),i}async getStreamNext(e,t){if(!t.signal)throw Error(`InternalError: AbortSignal must be passed`);let n=this._streams.get(e);if(!n)return{result:null};let r=await n.stream.next(t.signal);if(r==null)return n.handle.remove(),this._streams.delete(e),{result:null};let i=r.chunk.serialize().buffer,a={fileId:r.fileId,buffer:i};return i instanceof ArrayBuffer?{result:a,transferList:[i]}:{result:a}}async getStreamNextFeatures(e,t){let{result:n}=await this.getStreamNext(e,t);if(n==null)return null;let r=(await L()).ParquetChunk.deserialize(new Uint8Array(n.buffer)),i=new U(this._metadata,this._indexMap,r,n.fileId),a=[];for(;i.next();){let e=x(i.readGeometryWorldSpace(),i.geometryType,i.hasZ,i.hasM),t=i.readAttributes();a.push({attributes:t,geometry:e})}return{features:a}}async createPatch(e,t,n,r,i){if(!i.signal)throw Error(`InternalError: AbortSignal must be passed`);return(await(await(await this._getFileInfoById(e)).file).createChunkPatch(t,n,r,i.signal)).serialize().buffer}async _updateProvider(e){let t=this._provider;this._handles.removeAll(),this._provider=e,this._handles.add([e.events.on(`rangeRead`,e=>{this._source.onRangeRead(e)}),e.events.on(`sourceChanged`,async()=>{await this.reload(this._loadParameters),await this._source.onSourceChange()})]),await t?.destroy()}async _getCandidateFiles(e){let t=await this._provider.getFiles(),n=await this._getSpatialFilePruning(e);if(n==null)return t;let r=t.filter(e=>this._mayIncludeFileForSpatialPruning(e,n));return n.type===`xz`?Ce(r,n):r}async _queryStatistics(e,t){let n=await D({...e},null,this._queryEngineParams.spatialReference);if(n.returnGeometry=void 0,ve(n,this._fieldsIndex)){let e=await this._getStatisticsFromFiles(n);if(e)return e}return(await this._enqueueQuery(n,t)).createQueryResponse()}async _getStatisticsFromFiles(e){let t=await this._provider.getFiles(),n={},r=[];for(let i of e.outStatistics??[]){let e=xe(i,t);if(!e.available)return null;n[i.outStatisticFieldName]=e.value,r.push(be(i,this._fieldsIndex))}return{fields:r,features:[{attributes:n}]}}async _getSpatialFilePruning(e){if(e.type!==`tile`&&(e.type!==`arcade`||e.extent==null))return null;let t=this._displayOptimization?.index;if(t==null)return null;let n=e.outSpatialReference.wkid;if(t.wkid==null||n==null)return null;let r=t.wkid,i=await L();switch(t.type){case`xz`:return{type:`xz`,fieldName:y(t.code),intersects:(a,o)=>i.queryIntersectsXZStatistics(t.fullExtent,e.extent,n,r,t.maxLevel,a,o)};case`z`:return{type:`xy`,xFieldName:y(t.xColumn),yFieldName:y(t.yColumn),intersects:(t,a,o,s)=>i.queryIntersectsXYStatistics(e.extent,n,r,t,a,o,s)}}}_mayIncludeFileForSpatialPruning(e,t){switch(t.type){case`xz`:{let n=Z(e,t);return n?.type===`null-only`?!1:n?.type!==`bounds`||t.intersects(n.minValue,n.maxValue)}case`xy`:{let n=e.statistics.statistics.get(t.xFieldName),r=e.statistics.statistics.get(t.yFieldName);return n?.type===`null-only`||r?.type===`null-only`?!1:n?.type!==`bounds`||r?.type!==`bounds`||t.intersects(n.minValue,n.maxValue,r.minValue,r.maxValue)}}}async _tryDeriveParquetFullExtent(n){if(!n.spatialReference)return null;if(this._fullExtent==null&&n.geometryEncoding?.type===`location`){let r=await this._provider.getFiles(),{xField:i,yField:a}=n.geometryEncoding,o=f(p(),h),s=!1;for(let n of r){let r=await n.file;for(let n of r.rowGroups()){let r={stack:[],error:void 0,hasError:!1};try{let t=e(r,n.columnDescriptorForAttribute(i),!1),c=e(r,n.columnDescriptorForAttribute(a),!1),l=k(t),u=k(c);if(l?.type===`bounds`&&u?.type===`bounds`){let e=[l.minValue,u.minValue,l.maxValue,u.maxValue];ee(o,e),s=!0}n.free()}catch(e){r.error=e,r.hasError=!0}finally{t(r)}}}return s?{xmin:o[0],ymin:o[1],xmax:o[3],ymax:o[4],spatialReference:n.spatialReference?.toJSON()}:null}return null}async _getFileInfoById(e){let t=await this._provider.getFiles();for(let n of t)if(n.id===e)return n;throw Error(`InternalError: File ${e} does not exist`)}async _getFileStatistics(){return{featureCount:await this._getFeatureCount(),byteLength:await this._getByteLength()}}async _getFile(e){return(await this._getFileInfoById(e)).file}async _createParquetQuery(e,t,n,r,i){let a=(await L()).Query.new();n!=null&&a.setPreFilterStart(n),r!=null&&a.setPreFilterCount(r),i!=null&&a.setPostFilterCount(i);let o=await this._getRequiredFields(e);a.setOutFields(o),(e.geometry||e.returnGeometry)&&a.setReturnGeometry(!0),a.setReturnZ(!!e.returnZ),a.setReturnM(!!e.returnM);let s=this._tryGetGeneralizedGeometryResolution(e);s!=null&&a.setSourceResolution(s);let c=e.geometry?.spatialReference??this._queryEngineParams.spatialReference,l=c.wkid;if(e.geometry&&(_(c)||v(c))){let t=te(g(),re);for(let n of w(e.geometry))ne(t,n);a.setOutSpatialReference(l),a.setExtent({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]})}if(e.where){let{id:n,file:r}=t;await this._setWhereClause(a,await r,n,e.where)}return a}async _createParquetDisplayQuery(e,t,n){let r=(await L()).Query.new();if(n.type===`tile`){r.setExtent(n.extent),r.setQuantizationTransform(n.transform);let e=this._sourceResolution(n.resolution,n.outSpatialReference);e!=null&&r.setSourceResolution(e)}else n.type===`arcade`&&n.extent!=null&&r.setExtent(n.extent);return r.setOutFields(n.outFields.filter(e=>this._indexMap[e]!=null)),r.setOutSpatialReference(n.outSpatialReference.wkid),r.setReturnGeometry(n.returnGeometry),r.setReturnZ(n.returnZ),r.setReturnM(n.returnM),n.where&&await this._setWhereClause(r,e,t,n.where),r}async _getFeatureCount(){return(await this._provider.getFiles()).map(e=>e.statistics.rowCount).reduce((e,t)=>e+t,0)}async _getByteLength(){return(await this._provider.getFiles()).map(e=>e.statistics.byteSize).reduce((e,t)=>e+t,0)}_validateQuery(e){if(!this._capabilities.query.supportsStatistics&&e.outStatistics)throw new r(`parquet:unsupported`,`Statistics queries are not supported`,{query:e});if(!this._capabilities.query.supportsOrderBy&&e.orderByFields?.length)throw new r(`parquet:unsupported`,`Queries using orderBy are not supported`,{query:e});if(!this._capabilities.query.supportsDistinct&&e.returnDistinctValues)throw new r(`parquet:unsupported`,`Queries using returnDistinctValues are not supported`,{query:e})}async _setWhereClause(e,t,n,i){let a=this._indexMap,o=this._fieldsIndex,s={getAttribute(e,r){let i=a[r];if(i==null){if(o.get(r)?.name===`__OBJECTID`){let t=e.row+e.rowGroupStart;return ce(n,t)}return null}let s=o.get(r);return b(t,e.rowGroup,e.row,i,s.type)}},c=await l(i,this._fieldsIndex);if(!c.isStandardized)throw new r(`sql-parse-error`,`expression is not standardized`);let u=(e,t,n)=>c.testFeatureCompiled({rowGroup:e,row:t,rowGroupStart:n},s,null),d=c.fieldNames.map(e=>o.get(e)).filter(e=>e&&this._indexMap[e?.name]!=null);e.setWhere(i),e.setWhereEvaluator(u),e.setWhereFields(d.map(e=>e.name))}async*_streamFeatures(e,t,n,r,i){let a=await this._provider.getFiles(),o=0;for(let s of a){let a=o,c=o+s.statistics.rowCount;if(o+=s.statistics.rowCount,t!=null&&t>=c)continue;let l=t==null?null:Math.max(t-a,0),u=n;if(n!=null){let e=t??0,r=e+n;u=Math.max(Math.min(r,c)-Math.max(e,a),0)}if(u===0)continue;let d=await this._createParquetQuery(e,s,l,u,r),f=await(await s.file).executeQuery(d,K),p=async()=>{let e=await f.next(i);if(!e)return null;let t=new U(this._metadata,this._indexMap,e,s.id);return X([new B(t,null,0,!1)],this._queryEngineParams)},m=await p();for(;m!=null;)yield m,m=await p()}}async _queryFeaturesWithQueryEnginePagination(e,t){let n=[],r=this._streamFeatures(e,null,null,null,t),i=await r.next();for(;!i.done;){let a=await i.value.executeQueryForOpaqueFeatures({...e,where:void 0},t);for(let e of a)n.push(e);i=await r.next()}return n}async _queryFeaturesWithUpfrontPagination(e,t){let n=e.resultOffset??0,r=e.resultRecordCount??K,i,a,o;ge(e)?_e(e)||(o=n+r):(n&&=(i=n,0),a=e.resultRecordCount);let s=[],c=this._streamFeatures(e,i,a,o,t),l=await c.next();for(;!l.done&&r>0;){let i=await l.value.executeQueryForOpaqueFeatures({...e,where:void 0},t);for(let e of i)if(n>0)n--;else if(s.push(e),--r<=0)return s;l=await c.next()}return s}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){if(e.objectIds?.length){let n=new Map;for(let t of e.objectIds){let e=oe(t),r=se(t),i=n.get(e);i||(i=[],n.set(e,i)),i.push(r)}let r=[];for(let[i,a]of n.entries()){let n=await this._executeFileIdQuery(e,i,a,t);for(let e of n)r.push(e)}return new E(r,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:this._hasM,hasZ:this._hasZ,featureAdapter:W,featureIdInfo:this._queryEngineParams.featureIdInfo})}if(e.where===`1=1`&&(e.where=null),e.resultOffset??=0,e.resultRecordCount??=await this._getFeatureCount(),e.resultRecordCount>2e7&&!(this._displayOptimization&&e.geometry))throw new r(`parquet:cannot-execute-query`,`Unable to execute query, dataset is too large.`);let n=!!e.orderByFields?.length||!!e.outStatistics?.length||!!e.returnDistinctValues,i=n?await this._queryFeaturesWithQueryEnginePagination(e,t):await this._queryFeaturesWithUpfrontPagination(e,t);return n||(e.resultOffset=0),new E(i,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:this._hasM,hasZ:this._hasZ,featureAdapter:W,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(e,t,n,r){let i=new Set(await this._getRequiredFields(e));if(e.where){let t=await l(e.where,this._fieldsIndex);for(let e of t.fieldNames){let t=this._fieldsIndex.get(e);t&&this._indexMap[t.name]!=null&&i.add(t.name)}}let a=(await L()).Query.new();a.setOutFields(Array.from(i)),a.setReturnGeometry(!!e.returnGeometry),a.setReturnZ(!!e.returnZ),a.setReturnM(!!e.returnM),a.setIds(new Uint32Array(n));let o=await(await this._getFile(t)).executeQuery(a,K,r),s=await o.next(r),c=0,u=[];for(;s!=null;){let e=new U(this._metadata,this._indexMap,s,t),n=new B(e,null,c++,!1);u.push(n),s=await o.next(r)}return X(u,this._queryEngineParams).executeQueryForOpaqueFeatures(e,r)}async _getRequiredFields(e){let t=new Set;if(e.outStatistics)for(let n of S(this._fieldsIndex,e.outStatistics,e.groupByFieldsForStatistics))t.add(n);else if(e.outFields)for(let n of e.outFields)t.add(n);return(t.has(`*`)?this._fieldsIndex.fields.map(e=>e.name):Array.from(t)).filter(e=>this._indexMap[e]!=null)}_tryGetGeneralizedGeometryResolution(e){if(!this._displayOptimization)return null;let t=e.outSR??this._queryEngineParams.spatialReference;if(!_(t)&&!v(t))return null;let n=e.quantizationParameters?.tolerance??e.maxAllowableOffset;return n?this._sourceResolution(n,t):null}_sourceResolution(e,t){let n=this._queryEngineParams.spatialReference,r=u(t)/u(n)*e;return!Number.isFinite(r)||r<=0?null:r}}function pe(e){switch(e){case`fullText`:case`having`:case`timeExtent`:case`historicMoment`:case`aggregateIds`:case`uniqueIds`:case`gdbVersion`:case`objectIds`:case`where`:case`geometry`:case`resultOffset`:case`resultRecordCount`:return!0;default:return!1}}function me(e){switch(e){case`fullText`:case`having`:case`timeExtent`:case`historicMoment`:case`aggregateIds`:case`uniqueIds`:case`gdbVersion`:case`objectIds`:case`where`:case`geometry`:return!0;default:return!1}}function he(e){switch(e){case`fullText`:case`having`:case`timeExtent`:return!0;case`historicMoment`:case`aggregateIds`:case`uniqueIds`:case`gdbVersion`:return!1;case`objectIds`:case`where`:case`resultOffset`:case`geometry`:case`resultRecordCount`:return!1}return!1}function q(e){for(let t in e){let n=t;if(pe(n)&&e[n]!==null)return!0}return!1}function ge(e){for(let t in e){let n=t;if(me(n)&&e[n]!==null)return!0}return!1}function _e(e){for(let t in e){let n=t;if(he(n)&&e[n]!==null)return!0}return!1}function ve(e,t){return!!e.outStatistics?.length&&!q(e)&&!e.groupByFieldsForStatistics?.length&&!e.orderByFields?.length&&!e.returnDistinctValues&&!e.returnAggIds&&e.outStatistics.every(e=>ye(e,t))}function ye(e,t){switch(e.statisticType){case`count`:return e.onStatisticField===`1`||t.get(e.onStatisticField)!=null;case`min`:case`max`:{let n=t.get(e.onStatisticField);return n!=null&&M(n)}default:return!1}}function be(e,t){let n=e.statisticType===`exceedslimit`?null:t.get(e.onStatisticField),r=(e.statisticType===`min`||e.statisticType===`max`)&&n?.type===`esriFieldTypeDate`?n.type:`esriFieldTypeDouble`;return{name:e.outStatisticFieldName,alias:e.outStatisticFieldName,type:r}}function xe(e,t){switch(e.statisticType){case`count`:return J(e,t);case`min`:return Y(e,t,Math.min);case`max`:return Y(e,t,Math.max);default:return{available:!1,value:null}}}function J(e,t){if(e.statisticType!==`count`)return{available:!1,value:null};if(e.onStatisticField===`1`)return{available:!0,value:t.reduce((e,t)=>e+t.statistics.rowCount,0)};let n=0;for(let r of t){let t=r.statistics.statistics.get(e.onStatisticField);if(t==null||t.nullCount==null)return{available:!1,value:null};n+=r.statistics.rowCount-t.nullCount}return{available:!0,value:n}}function Y(e,t,n){if(e.statisticType!==`min`&&e.statisticType!==`max`)return{available:!1,value:null};let r=null,i=e.statisticType===`min`?`minValue`:`maxValue`;for(let a of t){let t=a.statistics.statistics.get(e.onStatisticField);if(t==null)return{available:!1,value:null};switch(t.type){case`null-only`:continue;case`unknown`:return{available:!1,value:null};case`bounds`:{let e=Se(t[i]);if(e==null)return{available:!1,value:null};r=r==null?e:n(r,e);break}}}return{available:!0,value:r}}function Se(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function X(e,t){let n=new V;for(let t of e)n.insert(t);return new T({...t,featureStore:n})}function Z(e,t){return e.statistics.statistics.get(t.fieldName)??null}function Ce(e,t){return e.slice().sort((e,n)=>{let r=Q(e,t),i=Q(n,t);return r===i?0:r<i?-1:1})}function Q(e,t){let n=Z(e,t);return n?.type===`bounds`?n.maxValue-n.minValue:1/0}function $(e,t,n){let r=e?.featureCount,i=!1;return r!=null&&r<has(`parquetlayer-full-query-feature-count`)&&(i=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:n,supportsTrueCurve:!1,supportsZ:t},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{...ie,maxRecordCount:K,supportsOrderBy:i,supportsDistinct:!0,supportsStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1}},queryAttributeBins:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}function we(e){return!!e.objectIds?.length||!!e.outStatistics||!!e.orderByFields?.length||!!e.returnDistinctValues}export{fe as default};
2
+ import{__addDisposableResource as e,__disposeResources as t}from"tslib";import n from"../../../../core/Error.js";import r from"../../../../core/Handles.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{onAbortOrThrow as a,throwIfAborted as o}from"../../../../core/promiseUtils.js";import{QueueProcessor as s}from"../../../../core/QueueProcessor.js";import{parseWhereClause as c}from"../../../../core/sql.js";import{getMetersPerUnitForSR as l}from"../../../../core/units.js";import{initializeProjection as u}from"../../../../geometry/projectionUtils.js";import d from"../../../../geometry/SpatialReference.js";import{set as f,create as p,expandWithAABB as m,expandWithRect as h,negativeInfinity as g}from"../../../../geometry/support/aaBoundingBox.js";import{copy as _,create as v,expandWithRect as ee,negativeInfinity as te}from"../../../../geometry/support/aaBoundingRect.js";import{isWebMercator as y,isWGS84 as b}from"../../../../geometry/support/spatialReferenceUtils.js";import{normalizeColumnPath as x,readParquetFileAttribute as ne}from"../../../parquet.js";import{convertToGeometry as S}from"../../featureConversionUtils.js";import{getFieldNamesFromStatistics as re}from"../../data/attributeSupport.js";import{project as ie}from"../../data/projectionSupport.js";import{getQueryResultExtent as ae,getQueryBoundingRects as C,QueryEngine as w}from"../../data/QueryEngine.js";import{queryCapabilities as T}from"../../data/QueryEngineCapabilities.js";import{QueryEngineResult as E}from"../../data/QueryEngineResult.js";import{normalizeQueryLike as D}from"../../data/queryUtils.js";import{createFileProvider as O}from"../parquet/createFileProvider.js";import{readFieldStatistic as k}from"../parquet/ParquetFileStatistics.js";import{createDrawingInfo as oe}from"./clientSideDefaults.js";import{getParquetFileId as se,getParquetRowId as ce,getParquetObjectId as A}from"./parquetIdUtils.js";import j from"../../../support/Field.js";import M from"../../../support/FieldsIndex.js";import{isNumericField as N}from"../../../support/fieldUtils.js";import{fromParquetGeometryEncodingJSON as P}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as F,fromParquetJSONGeometryType as I,toParquetJSONGeometryType as L}from"../../../support/parquetUtils.js";import{loadParquetModule as R}from"../../../../libs/librust-parquet/loadParquetModule.js";import{utc as z}from"../../../../time/constants.js";import{FeatureStoreQueryAdapter as B}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as V}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as H}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as U}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as W}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const G=new B,K=`__OBJECTID`,q=8e3;class le{constructor(e,t){this._files=e,this._createFileStream=t,this._fileIndex=0,this._streamIndex=0,this._streams=[],this._pending=new Set,this._resolvedCount=0}async next(e){for(await this._fill(e);this._pending.size>0;){o(e),await this._fill(e);let t=await ue(this._pending);if(this._pending.delete(t.read),this._resolvedCount++,t.chunk!=null)return t.chunk}return null}async _fill(e){for(this._removeDone();this._pending.size<8;){let t=this._getOrCreateNextStream(e);if(t==null)return;this._pending.add(t.read(e))}}_getOrCreateNextStream(e){let t=this._resolvedCount>=8?8:2;if(this._fileIndex<this._files.length&&this._streams.length<t){let t=this._files[this._fileIndex++],n=new de(t.id,this._createFileStream(t,e));return this._streams.push(n),n}return this._getNextStream()}_getNextStream(){let e=this._streams.length;for(let t=0;t<e;t++){let n=(this._streamIndex+t)%e,r=this._streams[n];if(r.canRead)return this._streamIndex=(n+1)%e,r}return null}_removeDone(){let e=this._streamIndex;for(let t=this._streams.length-1;t>=0;t--)this._streams[t].done&&(this._streams.splice(t,1),t<e&&e--);this._streamIndex=this._streams.length>0?e%this._streams.length:0}}function ue(e){return Promise.race(Array.from(e,async e=>({read:e,chunk:await e})))}class de{constructor(e,t){this._fileId=e,this._stream=t,this._readCount=0,this._reachedEnd=!1}get canRead(){return!this._reachedEnd}get done(){return this._reachedEnd&&this._readCount===0}async read(e){this._readCount++;try{let t=await(await this._stream).next(e);return t==null?(this._reachedEnd=!0,null):{fileId:this._fileId,chunk:t}}finally{this._readCount--}}}class fe{constructor(){this._hasZ=!1,this._hasM=!1,this._queue=new s({concurrency:4,process:(e,t)=>this._executeQuery(e,t)}),this._streams=new Map,this._streamIdCounter=0,this._indexMap={},this._handles=new r}async load(e){let t=e.spatialReference?d.fromJSON(e.spatialReference):void 0;if(t&&!t.isWGS84&&!t.isWebMercator)throw new n(`parquet:unsupported-projection`,`Only WGS84 and Web Mercator are supported`);this._customParameters=e.customParameters,this._loadParameters=e,await this._updateProvider(O(e.provider,null,()=>this._customParameters));let r=await this._provider.getMetadata(),a=await F(r,{fields:e.fields?.map(e=>j.fromJSON(e)),geometryEncoding:e.geometryEncoding?P(e.geometryEncoding):null,geometryType:e.geometryType?I(e.geometryType):null,displayOptimization:e.displayOptimization,spatialReference:t});if(this._hasZ=!!r?.hasZ,this._hasM=!!r?.hasM,!a.fields)throw new n(`parquet:unsupported`,`Fields must be defined`);let o;if(a.spatialReference&&a.geometryType){if(!a.spatialReference)throw new n(`parquet:unsupported`,`SpatialReference must be defined`);if(!a.spatialReference.isGeographic&&!a.spatialReference.isWebMercator)throw new n(`parquet:unsupported-projection`,`Only WGS84 and Web Mercator are supported`);a.spatialReference.isGeographic&&!a.spatialReference.isWGS84&&(i.getLogger(`parquet:unsupported-projection`).warn(`Found a geographic projection that is not WGS84. Handling as WGS84.`,{spatialReference:a.spatialReference}),a.spatialReference=d.WGS84),o={geometry:a.geometryEncoding?{geometryType:L(a.geometryType),spatialReference:a.spatialReference.toJSON(),encoding:a.geometryEncoding.toJSON()}:null,displayOptimization:a.displayOptimization}}this.setCustomParameters(e.customParameters),this._displayOptimization=a.displayOptimization,await this._provider.updateGeometryInfo(o),this._capabilities=$(await this._getFileStatistics(),this._hasZ,this._hasM);let s=await this._provider.getFiles();if(!s.length)return{layerDefinition:{},capabilities:$(null,this._hasZ,this._hasM)};let c=await s[0].file;a.file=c;let{fields:l}=a;if(l==null)throw new n(`parquet-layer:missing-metadata`,`Unable to create parquet source: cannot infer fields`,l);l.push(new j({name:K,type:`oid`,alias:K}));for(let e of l){let t=c.getColumnId(e.name);t!=null&&(this._indexMap[e.name]=t)}let u=M.fromLayerJSON({fields:l.map(e=>e.toJSON()),dateFieldsTimeReference:{timeZoneIANA:`UTC`}});this._fieldsIndex=u;let f=L(a.geometryType??`point`);return this._metadata=U.createFeature({fieldsIndex:u.toJSON(),geometryType:f,hasZ:this._hasZ,hasM:this._hasM,featureIdInfo:{type:`object-id`,fieldName:K},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:a.spatialReference,outSpatialReference:null,attributeSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:z}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:f,featureIdInfo:{type:`object-id`,fieldName:K},hasM:this._hasM,hasZ:this._hasZ,spatialReference:a.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},this._fullExtent=r?.extent?r.extent:await this._tryDeriveParquetFullExtent(a),{capabilities:this._capabilities,layerDefinition:{fields:a.fields?.map(e=>e.toJSON()),drawingInfo:oe(f),extent:this._fullExtent??void 0,geometryType:f,hasZ:this._hasZ,hasM:this._hasM,geometryEncoding:a.geometryEncoding?.toJSON(),displayOptimization:a.displayOptimization}}}destroy(){this._provider.destroy(),this._queue.destroy();for(let{handle:e}of this._streams.values())e.remove();this._streams.clear(),this._indexMap={},this._handles.removeAll()}async reload(e){this.destroy(),await this.load(e)}set remoteClient(e){this._source=e.createInvokeProxy(``)}setCustomParameters(e){this._customParameters=e}getIndexMap(){return this._indexMap}async updateFileProvider(e){this._loadParameters={...this._loadParameters,provider:e};let t=O(e,this._provider.getGeometryInfo(),()=>this._customParameters);await this._updateProvider(t)}async getDiagnosticsSnapshot(){let e=await this._provider.getFiles();return{files:await Promise.all(e.map(e=>e.getDiagnosticsSnapshot()))}}async getColumnIndex(e){return(await this._getFileInfoById(e.fileId)).getColumnIndex(e.rowGroupIndex,e.columnIndex)}async getOffsetIndex(e){return(await this._getFileInfoById(e.fileId)).getOffsetIndex(e.rowGroupIndex,e.columnIndex)}async queryFeatures(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);return this._validateQuery(n),Te(n)||(n.resultRecordCount=n.resultRecordCount?Math.min(n.resultRecordCount,q):q,n.resultOffset=n.resultOffset??0),n.outStatistics?this._queryStatistics(n,t):(n.returnDistinctValues&&(n.returnGeometry=void 0),(await this._enqueueQuery(n,t)).createQueryResponse())}async queryFeatureCount(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);return this._validateQuery(n),!J(n)&&!n.returnDistinctValues&&!n.groupByFieldsForStatistics?.length&&!n.outStatistics?.length?this._getFeatureCount():(n.returnDistinctValues||(n.outFields=void 0),n.returnGeometry=void 0,(await this._enqueueQuery(n,t)).createQueryResponseForCount())}async queryObjectIds(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);return this._validateQuery(n),J(n)?(n.resultRecordCount=n.resultRecordCount?Math.min(n.resultRecordCount,8e3):8e3,n.resultOffset=n.resultOffset??0,n.returnGeometry=void 0,n.outFields=void 0,n.returnDistinctValues=void 0,(await this._enqueueQuery(n,t)).items.map(e=>e.getObjectId())):Array.from({length:await this._getFeatureCount()},(e,t)=>t)}async queryAttributeBins(e,t={}){throw new n(`parquet:unsupported`,`queryAttributeBins not supported.`)}async queryExtent(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);this._validateQuery(n);let r=n.outSR??this._queryEngineParams.spatialReference;if(this._fullExtent&&!J(n)){let e=this._fullExtent;return await u(e.spatialReference,n.outSR),{count:await this._getFeatureCount(),extent:n.outSR?ie(e,n.outSR):e}}n.returnGeometry=!0,n.outFields=void 0;let i=f(p(),g),a=p(),o=await this._enqueueQuery(n,t),s=0;for(let e of o.items)e.getBounds(a)&&(m(i,a),s+=1);let c=ae(i,r,r,r,!1);return{count:s,extent:c}}async queryStream(e,t){if(!t.signal)throw Error(`InternalError: AbortSignal must be passed`);let n=await this._getCandidateFiles(e),r=new le(n,async(t,n)=>{let r=await t.file,i=await this._createParquetDisplayQuery(r,t.id,e);return r.executeQuery(i,q,n)}),i=this._streamIdCounter++,o=a(t.signal,e=>{let t=this._streams.get(i);t!=null&&(t.handle.remove(),this._streams.delete(i))});return this._streams.set(i,{stream:r,handle:o}),i}async getStreamNext(e,t){if(!t.signal)throw Error(`InternalError: AbortSignal must be passed`);let n=this._streams.get(e);if(!n)return{result:null};let r=await n.stream.next(t.signal);if(r==null)return n.handle.remove(),this._streams.delete(e),{result:null};let i=r.chunk.serialize().buffer,a={fileId:r.fileId,buffer:i};return i instanceof ArrayBuffer?{result:a,transferList:[i]}:{result:a}}async getStreamNextFeatures(e,t){let{result:n}=await this.getStreamNext(e,t);if(n==null)return null;let r=(await R()).ParquetChunk.deserialize(new Uint8Array(n.buffer)),i=new W(this._metadata,this._indexMap,r,n.fileId),a=[];for(;i.next();){let e=S(i.readGeometryWorldSpace(),i.geometryType,i.hasZ,i.hasM),t=i.readAttributes();a.push({attributes:t,geometry:e})}return{features:a}}async createPatch(e,t,n,r,i){if(!i.signal)throw Error(`InternalError: AbortSignal must be passed`);return(await(await(await this._getFileInfoById(e)).file).createChunkPatch(t,n,r,i.signal)).serialize().buffer}async _updateProvider(e){let t=this._provider;this._handles.removeAll(),this._provider=e,this._handles.add([e.events.on(`rangeRead`,e=>{this._source.onRangeRead(e)}),e.events.on(`sourceChanged`,async()=>{await this.reload(this._loadParameters),await this._source.onSourceChange()})]),await t?.destroy()}async _getCandidateFiles(e){let t=await this._provider.getFiles(),n=await this._getSpatialFilePruning(e);if(n==null)return t;let r=t.filter(e=>this._mayIncludeFileForSpatialPruning(e,n));return n.type===`xz`?we(r,n):r}async _queryStatistics(e,t){let n=await D({...e},null,this._queryEngineParams.spatialReference);if(n.returnGeometry=void 0,ve(n,this._fieldsIndex)){let e=await this._getStatisticsFromFiles(n);if(e)return e}return(await this._enqueueQuery(n,t)).createQueryResponse()}async _getStatisticsFromFiles(e){let t=await this._provider.getFiles(),n={},r=[];for(let i of e.outStatistics??[]){let e=xe(i,t);if(!e.available)return null;n[i.outStatisticFieldName]=e.value,r.push(be(i,this._fieldsIndex))}return{fields:r,features:[{attributes:n}]}}async _getSpatialFilePruning(e){if(e.type!==`tile`&&(e.type!==`arcade`||e.extent==null))return null;let t=this._displayOptimization?.index;if(t==null)return null;let n=e.outSpatialReference.wkid;if(t.wkid==null||n==null)return null;let r=t.wkid,i=await R();switch(t.type){case`xz`:return{type:`xz`,fieldName:x(t.code),intersects:(a,o)=>i.queryIntersectsXZStatistics(t.fullExtent,e.extent,n,r,t.maxLevel,a,o)};case`z`:return{type:`xy`,xFieldName:x(t.xColumn),yFieldName:x(t.yColumn),intersects:(t,a,o,s)=>i.queryIntersectsXYStatistics(e.extent,n,r,t,a,o,s)}}}_mayIncludeFileForSpatialPruning(e,t){switch(t.type){case`xz`:{let n=Z(e,t);return n?.type===`null-only`?!1:n?.type!==`bounds`||t.intersects(n.minValue,n.maxValue)}case`xy`:{let n=e.statistics.statistics.get(t.xFieldName),r=e.statistics.statistics.get(t.yFieldName);return n?.type===`null-only`||r?.type===`null-only`?!1:n?.type!==`bounds`||r?.type!==`bounds`||t.intersects(n.minValue,n.maxValue,r.minValue,r.maxValue)}}}async _tryDeriveParquetFullExtent(n){if(!n.spatialReference)return null;if(this._fullExtent==null&&n.geometryEncoding?.type===`location`){let r=await this._provider.getFiles(),{xField:i,yField:a}=n.geometryEncoding,o=f(p(),g),s=!1;for(let n of r){let r=await n.file;for(let n of r.rowGroups()){let r={stack:[],error:void 0,hasError:!1};try{let t=e(r,n.columnDescriptorForAttribute(i),!1),c=e(r,n.columnDescriptorForAttribute(a),!1),l=k(t),u=k(c);if(l?.type===`bounds`&&u?.type===`bounds`){let e=[l.minValue,u.minValue,l.maxValue,u.maxValue];h(o,e),s=!0}n.free()}catch(e){r.error=e,r.hasError=!0}finally{t(r)}}}return s?{xmin:o[0],ymin:o[1],xmax:o[3],ymax:o[4],spatialReference:n.spatialReference?.toJSON()}:null}return null}async _getFileInfoById(e){let t=await this._provider.getFiles();for(let n of t)if(n.id===e)return n;throw Error(`InternalError: File ${e} does not exist`)}async _getFileStatistics(){return{featureCount:await this._getFeatureCount(),byteLength:await this._getByteLength()}}async _getFile(e){return(await this._getFileInfoById(e)).file}async _createParquetQuery(e,t,n,r,i){let a=(await R()).Query.new();n!=null&&a.setPreFilterStart(n),r!=null&&a.setPreFilterCount(r),i!=null&&a.setPostFilterCount(i);let o=await this._getRequiredFields(e);a.setOutFields(o),(e.geometry||e.returnGeometry)&&a.setReturnGeometry(!0),a.setReturnZ(!!e.returnZ),a.setReturnM(!!e.returnM);let s=this._tryGetGeneralizedGeometryResolution(e);s!=null&&a.setSourceResolution(s);let c=e.geometry?.spatialReference??this._queryEngineParams.spatialReference,l=c.wkid;if(e.geometry&&(y(c)||b(c))){let t=_(v(),te);for(let n of C(e.geometry))ee(t,n);a.setOutSpatialReference(l),a.setExtent({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]})}if(e.where){let{id:n,file:r}=t;await this._setWhereClause(a,await r,n,e.where)}return a}async _createParquetDisplayQuery(e,t,n){let r=(await R()).Query.new();if(n.type===`tile`){r.setExtent(n.extent),r.setQuantizationTransform(n.transform);let e=this._sourceResolution(n.resolution,n.outSpatialReference);e!=null&&r.setSourceResolution(e)}else n.type===`arcade`&&n.extent!=null&&r.setExtent(n.extent);return r.setOutFields(n.outFields.filter(e=>this._indexMap[e]!=null)),r.setOutSpatialReference(n.outSpatialReference.wkid),r.setReturnGeometry(n.returnGeometry),r.setReturnZ(n.returnZ),r.setReturnM(n.returnM),n.where&&await this._setWhereClause(r,e,t,n.where),r}async _getFeatureCount(){return(await this._provider.getFiles()).map(e=>e.statistics.rowCount).reduce((e,t)=>e+t,0)}async _getByteLength(){return(await this._provider.getFiles()).map(e=>e.statistics.byteSize).reduce((e,t)=>e+t,0)}_validateQuery(e){if(!this._capabilities.query.supportsStatistics&&e.outStatistics)throw new n(`parquet:unsupported`,`Statistics queries are not supported`,{query:e});if(!this._capabilities.query.supportsOrderBy&&e.orderByFields?.length)throw new n(`parquet:unsupported`,`Queries using orderBy are not supported`,{query:e});if(!this._capabilities.query.supportsDistinct&&e.returnDistinctValues)throw new n(`parquet:unsupported`,`Queries using returnDistinctValues are not supported`,{query:e})}async _setWhereClause(e,t,r,i){let a=this._indexMap,o=this._fieldsIndex,s={getAttribute(e,n){let i=a[n];if(i==null){if(o.get(n)?.name===`__OBJECTID`){let t=e.row+e.rowGroupStart;return A(r,t)}return null}let s=o.get(n);return ne(t,e.rowGroup,e.row,i,s.type)}},l=await c(i,this._fieldsIndex);if(!l.isStandardized)throw new n(`sql-parse-error`,`expression is not standardized`);let u=(e,t,n)=>l.testFeatureCompiled({rowGroup:e,row:t,rowGroupStart:n},s,null),d=l.fieldNames.map(e=>o.get(e)).filter(e=>e&&this._indexMap[e?.name]!=null);e.setWhere(i),e.setWhereEvaluator(u),e.setWhereFields(d.map(e=>e.name))}async*_streamFeatures(e,t,n,r,i){let a=await this._provider.getFiles(),o=0;for(let s of a){let a=o,c=o+s.statistics.rowCount;if(o+=s.statistics.rowCount,t!=null&&t>=c)continue;let l=t==null?null:Math.max(t-a,0),u=n;if(n!=null){let e=t??0,r=e+n;u=Math.max(Math.min(r,c)-Math.max(e,a),0)}if(u===0)continue;let d=await this._createParquetQuery(e,s,l,u,r),f=await(await s.file).executeQuery(d,q),p=async()=>{let e=await f.next(i);if(!e)return null;let t=new W(this._metadata,this._indexMap,e,s.id);return X([new V(t,null,0,!1)],this._queryEngineParams)},m=await p();for(;m!=null;)yield m,m=await p()}}async _queryFeaturesWithQueryEnginePagination(e,t){let n=[],r=this._streamFeatures(e,null,null,null,t),i=await r.next();for(;!i.done;){let a=await i.value.executeQueryForOpaqueFeatures({...e,where:void 0},t);for(let e of a)n.push(e);i=await r.next()}return n}async _queryFeaturesWithUpfrontPagination(e,t){let n=e.resultOffset??0,r=e.resultRecordCount??q,i,a,o;ge(e)?_e(e)||(o=n+r):(n&&=(i=n,0),a=e.resultRecordCount);let s=[],c=this._streamFeatures(e,i,a,o,t),l=await c.next();for(;!l.done&&r>0;){let i=await l.value.executeQueryForOpaqueFeatures({...e,where:void 0},t);for(let e of i)if(n>0)n--;else if(s.push(e),--r<=0)return s;l=await c.next()}return s}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){if(e.objectIds?.length){let n=new Map;for(let t of e.objectIds){let e=se(t),r=ce(t),i=n.get(e);i||(i=[],n.set(e,i)),i.push(r)}let r=[];for(let[i,a]of n.entries()){let n=await this._executeFileIdQuery(e,i,a,t);for(let e of n)r.push(e)}return new E(r,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:this._hasM,hasZ:this._hasZ,featureAdapter:G,featureIdInfo:this._queryEngineParams.featureIdInfo})}if(e.where===`1=1`&&(e.where=null),e.resultOffset??=0,e.resultRecordCount??=await this._getFeatureCount(),e.resultRecordCount>2e7&&!(this._displayOptimization&&e.geometry))throw new n(`parquet:cannot-execute-query`,`Unable to execute query, dataset is too large.`);let r=!!e.orderByFields?.length||!!e.outStatistics?.length||!!e.returnDistinctValues,i=r?await this._queryFeaturesWithQueryEnginePagination(e,t):await this._queryFeaturesWithUpfrontPagination(e,t);return r||(e.resultOffset=0),new E(i,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:this._hasM,hasZ:this._hasZ,featureAdapter:G,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(e,t,n,r){let i=new Set(await this._getRequiredFields(e));if(e.where){let t=await c(e.where,this._fieldsIndex);for(let e of t.fieldNames){let t=this._fieldsIndex.get(e);t&&this._indexMap[t.name]!=null&&i.add(t.name)}}let a=(await R()).Query.new();a.setOutFields(Array.from(i)),a.setReturnGeometry(!!e.returnGeometry),a.setReturnZ(!!e.returnZ),a.setReturnM(!!e.returnM),a.setIds(new Uint32Array(n));let o=await(await this._getFile(t)).executeQuery(a,q,r),s=await o.next(r),l=0,u=[];for(;s!=null;){let e=new W(this._metadata,this._indexMap,s,t),n=new V(e,null,l++,!1);u.push(n),s=await o.next(r)}return X(u,this._queryEngineParams).executeQueryForOpaqueFeatures(e,r)}async _getRequiredFields(e){let t=new Set;if(e.outStatistics)for(let n of re(this._fieldsIndex,e.outStatistics,e.groupByFieldsForStatistics))t.add(n);else if(e.outFields)for(let n of e.outFields)t.add(n);return(t.has(`*`)?this._fieldsIndex.fields.map(e=>e.name):Array.from(t)).filter(e=>this._indexMap[e]!=null)}_tryGetGeneralizedGeometryResolution(e){if(!this._displayOptimization)return null;let t=e.outSR??this._queryEngineParams.spatialReference;if(!y(t)&&!b(t))return null;let n=e.quantizationParameters?.tolerance??e.maxAllowableOffset;return n?this._sourceResolution(n,t):null}_sourceResolution(e,t){let n=this._queryEngineParams.spatialReference,r=l(t)/l(n)*e;return!Number.isFinite(r)||r<=0?null:r}}function pe(e){switch(e){case`fullText`:case`having`:case`timeExtent`:case`historicMoment`:case`aggregateIds`:case`uniqueIds`:case`gdbVersion`:case`objectIds`:case`where`:case`geometry`:case`resultOffset`:case`resultRecordCount`:return!0;default:return!1}}function me(e){switch(e){case`fullText`:case`having`:case`timeExtent`:case`historicMoment`:case`aggregateIds`:case`uniqueIds`:case`gdbVersion`:case`objectIds`:case`where`:case`geometry`:return!0;default:return!1}}function he(e){switch(e){case`fullText`:case`having`:case`timeExtent`:return!0;case`historicMoment`:case`aggregateIds`:case`uniqueIds`:case`gdbVersion`:return!1;case`objectIds`:case`where`:case`resultOffset`:case`geometry`:case`resultRecordCount`:return!1}return!1}function J(e){for(let t in e){let n=t;if(pe(n)&&e[n]!==null)return!0}return!1}function ge(e){for(let t in e){let n=t;if(me(n)&&e[n]!==null)return!0}return!1}function _e(e){for(let t in e){let n=t;if(he(n)&&e[n]!==null)return!0}return!1}function ve(e,t){return!!e.outStatistics?.length&&!J(e)&&!e.groupByFieldsForStatistics?.length&&!e.orderByFields?.length&&!e.returnDistinctValues&&!e.returnAggIds&&e.outStatistics.every(e=>ye(e,t))}function ye(e,t){switch(e.statisticType){case`count`:return e.onStatisticField===`1`||t.get(e.onStatisticField)!=null;case`min`:case`max`:{let n=t.get(e.onStatisticField);return n!=null&&N(n)}default:return!1}}function be(e,t){let n=e.statisticType===`exceedslimit`?null:t.get(e.onStatisticField),r=(e.statisticType===`min`||e.statisticType===`max`)&&n?.type===`esriFieldTypeDate`?n.type:`esriFieldTypeDouble`;return{name:e.outStatisticFieldName,alias:e.outStatisticFieldName,type:r}}function xe(e,t){switch(e.statisticType){case`count`:return Se(e,t);case`min`:return Y(e,t,Math.min);case`max`:return Y(e,t,Math.max);default:return{available:!1,value:null}}}function Se(e,t){if(e.statisticType!==`count`)return{available:!1,value:null};if(e.onStatisticField===`1`)return{available:!0,value:t.reduce((e,t)=>e+t.statistics.rowCount,0)};let n=0;for(let r of t){let t=r.statistics.statistics.get(e.onStatisticField);if(t==null||t.nullCount==null)return{available:!1,value:null};n+=r.statistics.rowCount-t.nullCount}return{available:!0,value:n}}function Y(e,t,n){if(e.statisticType!==`min`&&e.statisticType!==`max`)return{available:!1,value:null};let r=null,i=e.statisticType===`min`?`minValue`:`maxValue`;for(let a of t){let t=a.statistics.statistics.get(e.onStatisticField);if(t==null)return{available:!1,value:null};switch(t.type){case`null-only`:continue;case`unknown`:return{available:!1,value:null};case`bounds`:{let e=Ce(t[i]);if(e==null)return{available:!1,value:null};r=r==null?e:n(r,e);break}}}return{available:!0,value:r}}function Ce(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function X(e,t){let n=new H;for(let t of e)n.insert(t);return new w({...t,featureStore:n})}function Z(e,t){return e.statistics.statistics.get(t.fieldName)??null}function we(e,t){return e.slice().sort((e,n)=>{let r=Q(e,t),i=Q(n,t);return r===i?0:r<i?-1:1})}function Q(e,t){let n=Z(e,t);return n?.type===`bounds`?n.maxValue-n.minValue:1/0}function $(e,t,n){let r=e?.featureCount,i=!1;return r!=null&&r<has(`parquetlayer-full-query-feature-count`)&&(i=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:n,supportsTrueCurve:!1,supportsZ:t},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{...T,maxRecordCount:q,supportsOrderBy:i,supportsDistinct:!0,supportsStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1}},queryAttributeBins:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}function Te(e){return!!e.objectIds?.length||!!e.outStatistics||!!e.orderByFields?.length||!!e.returnDistinctValues}export{fe as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import n from"../../../../core/Error.js";import has from"../../../../core/has.js";import{whenOrAbort as r}from"../../../../core/promiseUtils.js";import{urlToObject as i}from"../../../../core/urlUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{equals as s}from"../../../../geometry/support/spatialReferenceUtils.js";import{getGltfQueryFormat as c}from"../../../support/infoFor3D.js";import{parseUrl as l}from"../../../../rest/utils.js";import{dynamicDataSourceTypes as u}from"../../../../rest/layerSources/typeUtils.js";import{executeForCount as d}from"../../../../rest/query/executeForCount.js";import{executeForExtent as f}from"../../../../rest/query/executeForExtent.js";import{executeForIds as p}from"../../../../rest/query/executeForIds.js";import{executeRawQueryJSON as m}from"../../../../rest/query/executeQueryJSON.js";import{executeRawQueryPBF as h}from"../../../../rest/query/executeQueryPBF.js";import g from"../../../../rest/support/FeatureSet.js";import _ from"../../../../rest/support/Query.js";let v=class extends t{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.pbfSupportedWithCurves=!1,this.queryAttachmentsSupported=!1,this.relativeTimeBinWindow=0,this.sourceSpatialReference=null,this.timeInformation=null,this.uniqueIdFields=null,this.url=null}get parsedUrl(){return i(this.url)}async execute(e,t){let n=await this.executeJSON(e,t);return this.featureSetFromJSON(e,n,t)}async executeJSON(e,t){let n=this._normalizeQuery(e),r=e.outStatistics?.[0]!=null,i=has(`featurelayer-pbf-statistics`),a=this.pbfSupported&&(!r||i)&&(!e.returnTrueCurves||this.pbfSupportedWithCurves),o;if(a)try{o=await h(this.url,n,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}catch(e){if(e.name===`query:parsing-pbf`)this.pbfSupported=!1;else throw e}return o??=await m(this.url,n,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields}),this._normalizeFields(o.fields),o}async featureSetFromJSON(e,t,n){if(!this._queryGet3DObjectFormat(e)||this.infoFor3D==null||!t.features)return g.fromJSON(t);let{meshFeatureSetFromJSON:i}=await r(import(`../../../../rest/support/meshFeatureSet.js`),n);return i(e,this.infoFor3D,t)}executeForCount(e,t){return d(this.url,this._normalizeQuery(e),t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}executeForExtent(e,t){return f(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return p(this.url,this._normalizeQuery(e),t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}async executeRelationshipQuery(e,t){let[{default:n},{executeRelationshipQuery:i}]=await r(Promise.all([import(`../../../../rest/support/RelationshipQuery.js`),import(`../../../../rest/query/executeRelationshipQuery.js`)]),t),a=n.from(e);return(this.gdbVersion||this.dynamicDataSource)&&(a=a.clone(),a.gdbVersion=a.gdbVersion||this.gdbVersion,a.dynamicDataSource=a.dynamicDataSource||this.dynamicDataSource),i(this.url,a,t)}async executeRelationshipQueryForCount(e,t){let[{default:n},{executeRelationshipQueryForCount:i}]=await r(Promise.all([import(`../../../../rest/support/RelationshipQuery.js`),import(`../../../../rest/query/executeRelationshipQuery.js`)]),t),a=n.from(e);return(this.gdbVersion||this.dynamicDataSource)&&(a=a.clone(),a.gdbVersion=a.gdbVersion||this.gdbVersion,a.dynamicDataSource=a.dynamicDataSource||this.dynamicDataSource),i(this.url,a,t)}async executeAttachmentQuery(e,t){let{executeAttachmentQuery:n,fetchAttachments:i,processAttachmentQueryResult:a}=await r(import(`../../../../rest/query/operations/queryAttachments.js`),t),o=l(this.url);return a(o,await(this.queryAttachmentsSupported?n(o,e,t):i(o,e,t)))}async executeAttributeBinsQuery(e,t){let{executeAttributeBinsQuery:n}=await r(import(`../../../../rest/query/executeAttributeBinsQuery.js`),t);return n(this.parsedUrl,e,t)}async executePivotQuery(e,t){let{executePivotQuery:n}=await r(import(`../../../../rest/query/executePivotQuery.js`),t);return n(this.parsedUrl,e,t)}async executeTopFeaturesQuery(e,t){let{executeTopFeaturesQuery:n}=await r(import(`../../../../rest/query/executeTopFeaturesQuery.js`),t);return n(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){let{executeForTopIds:n}=await r(import(`../../../../rest/query/executeForTopIds.js`),t);return n(this.parsedUrl,e,t)}async executeForTopExtents(e,t){let{executeForTopExtents:n}=await r(import(`../../../../rest/query/executeForTopExtents.js`),t);return n(this.parsedUrl,e,t)}async executeForTopCount(e,t){let{executeForTopCount:n}=await r(import(`../../../../rest/query/executeForTopCount.js`),t);return n(this.parsedUrl,e,t)}_normalizeQuery(e){let t=_.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource);let{infoFor3D:r}=this,i=this._queryGet3DObjectFormat(e);if(r!=null&&i){if(t=t===e?t.clone():t,t.formatOf3DObjects=i,t.outSpatialReference&&!s(t.outSpatialReference,this.sourceSpatialReference))throw new n(`query:unsupported-out-spatial-reference`,`3D object feature services do not support projection of geometries`);if(t.outFields==null||!t.outFields.includes(`*`)){t=t===e?t.clone():t,t.outFields??(t.outFields=[]);let{originX:n,originY:i,originZ:a,translationX:o,translationY:s,translationZ:c,scaleX:l,scaleY:u,scaleZ:d,rotationX:f,rotationY:p,rotationZ:m,rotationDeg:h}=r.transformFieldRoles;t.outFields.push(n,i,a,o,s,c,l,u,d,f,p,m,h)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(let t of e){let e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryGet3DObjectFormat({returnGeometry:e,multipatchOption:t,outStatistics:n}){return e===!0&&t!==`xyFootprint`&&!n?c(this.infoFor3D):null}};e([a({types:u})],v.prototype,`dynamicDataSource`,void 0),e([a()],v.prototype,`fieldsIndex`,void 0),e([a()],v.prototype,`gdbVersion`,void 0),e([a()],v.prototype,`infoFor3D`,void 0),e([a({readOnly:!0})],v.prototype,`parsedUrl`,null),e([a()],v.prototype,`pbfSupported`,void 0),e([a()],v.prototype,`pbfSupportedWithCurves`,void 0),e([a()],v.prototype,`queryAttachmentsSupported`,void 0),e([a()],v.prototype,`relativeTimeBinWindow`,void 0),e([a()],v.prototype,`sourceSpatialReference`,void 0),e([a()],v.prototype,`timeInformation`,void 0),e([a()],v.prototype,`uniqueIdFields`,void 0),e([a({type:String})],v.prototype,`url`,void 0),v=e([o(`esri.layers.graphics.sources.support.QueryTask`)],v);export{v as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import n from"../../../../core/Error.js";import has from"../../../../core/has.js";import{whenOrAbort as r}from"../../../../core/promiseUtils.js";import{urlToObject as i}from"../../../../core/urlUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{equals as s}from"../../../../geometry/support/spatialReferenceUtils.js";import{getGltfQueryFormat as c}from"../../../support/infoFor3D.js";import{parseUrl as l}from"../../../../rest/utils.js";import{dynamicDataSourceTypes as u}from"../../../../rest/layerSources/typeUtils.js";import{executeForCount as d}from"../../../../rest/query/executeForCount.js";import{executeForExtent as f}from"../../../../rest/query/executeForExtent.js";import{executeForIds as p}from"../../../../rest/query/executeForIds.js";import{executeRawQueryJSON as m}from"../../../../rest/query/executeQueryJSON.js";import{executeRawQueryPBF as h}from"../../../../rest/query/executeQueryPBF.js";import g from"../../../../rest/support/FeatureSet.js";import _ from"../../../../rest/support/Query.js";let v=class extends t{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.pbfSupportedWithCurves=!1,this.queryAttachmentsSupported=!1,this.relativeTimeBinWindow=0,this.sourceSpatialReference=null,this.timeInformation=null,this.uniqueIdFields=null,this.url=null}get parsedUrl(){return i(this.url)}async execute(e,t){let n=await this.executeJSON(e,t);return this.featureSetFromJSON(e,n,t)}async executeJSON(e,t){let n=this._normalizeQuery(e),r=e.outStatistics?.[0]!=null,i=has(`featurelayer-pbf-statistics`),a=this.pbfSupported&&(!r||i)&&(!e.returnTrueCurves||this.pbfSupportedWithCurves),o;if(a)try{o=await h(this.url,n,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}catch(e){if(e.name===`query:parsing-pbf`)this.pbfSupported=!1;else throw e}return o??=await m(this.url,n,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields}),this._normalizeFields(o.fields),o}async featureSetFromJSON(e,t,n){if(!this._queryGet3DObjectFormat(e)||this.infoFor3D==null||!t.features)return g.fromJSON(t);let{meshFeatureSetFromJSON:i}=await r(import(`../../../../rest/support/meshFeatureSet.js`),n);return i(e,this.infoFor3D,t)}executeForCount(e,t){return d(this.url,this._normalizeQuery(e),t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}executeForExtent(e,t){return f(this.url,this._normalizeQuery(e),t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}executeForIds(e,t){return p(this.url,this._normalizeQuery(e),t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}async executeRelationshipQuery(e,t){let[{default:n},{executeRelationshipQuery:i}]=await r(Promise.all([import(`../../../../rest/support/RelationshipQuery.js`),import(`../../../../rest/query/executeRelationshipQuery.js`)]),t),a=n.from(e);return(this.gdbVersion||this.dynamicDataSource)&&(a=a.clone(),a.gdbVersion=a.gdbVersion||this.gdbVersion,a.dynamicDataSource=a.dynamicDataSource||this.dynamicDataSource),i(this.url,a,t)}async executeRelationshipQueryForCount(e,t){let[{default:n},{executeRelationshipQueryForCount:i}]=await r(Promise.all([import(`../../../../rest/support/RelationshipQuery.js`),import(`../../../../rest/query/executeRelationshipQuery.js`)]),t),a=n.from(e);return(this.gdbVersion||this.dynamicDataSource)&&(a=a.clone(),a.gdbVersion=a.gdbVersion||this.gdbVersion,a.dynamicDataSource=a.dynamicDataSource||this.dynamicDataSource),i(this.url,a,t)}async executeAttachmentQuery(e,t){let{executeAttachmentQuery:n,fetchAttachments:i,processAttachmentQueryResult:a}=await r(import(`../../../../rest/query/operations/queryAttachments.js`),t),o=l(this.url);return a(o,await(this.queryAttachmentsSupported?n(o,e,t):i(o,e,t)))}async executeAttributeBinsQuery(e,t){let{executeAttributeBinsQuery:n}=await r(import(`../../../../rest/query/executeAttributeBinsQuery.js`),t);return n(this.parsedUrl,e,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}async executePivotQuery(e,t){let{executePivotQuery:n}=await r(import(`../../../../rest/query/executePivotQuery.js`),t);return n(this.parsedUrl,e,t)}async executeTopFeaturesQuery(e,t){let{executeTopFeaturesQuery:n}=await r(import(`../../../../rest/query/executeTopFeaturesQuery.js`),t);return n(this.parsedUrl,e,this.sourceSpatialReference,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}async executeForTopIds(e,t){let{executeForTopIds:n}=await r(import(`../../../../rest/query/executeForTopIds.js`),t);return n(this.parsedUrl,e,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}async executeForTopExtents(e,t){let{executeForTopExtents:n}=await r(import(`../../../../rest/query/executeForTopExtents.js`),t);return n(this.parsedUrl,e,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}async executeForTopCount(e,t){let{executeForTopCount:n}=await r(import(`../../../../rest/query/executeForTopCount.js`),t);return n(this.parsedUrl,e,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}_normalizeQuery(e){let t=_.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource);let{infoFor3D:r}=this,i=this._queryGet3DObjectFormat(e);if(r!=null&&i){if(t=t===e?t.clone():t,t.formatOf3DObjects=i,t.outSpatialReference&&!s(t.outSpatialReference,this.sourceSpatialReference))throw new n(`query:unsupported-out-spatial-reference`,`3D object feature services do not support projection of geometries`);if(t.outFields==null||!t.outFields.includes(`*`)){t=t===e?t.clone():t,t.outFields??(t.outFields=[]);let{originX:n,originY:i,originZ:a,translationX:o,translationY:s,translationZ:c,scaleX:l,scaleY:u,scaleZ:d,rotationX:f,rotationY:p,rotationZ:m,rotationDeg:h}=r.transformFieldRoles;t.outFields.push(n,i,a,o,s,c,l,u,d,f,p,m,h)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(let t of e){let e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryGet3DObjectFormat({returnGeometry:e,multipatchOption:t,outStatistics:n}){return e===!0&&t!==`xyFootprint`&&!n?c(this.infoFor3D):null}};e([a({types:u})],v.prototype,`dynamicDataSource`,void 0),e([a()],v.prototype,`fieldsIndex`,void 0),e([a()],v.prototype,`gdbVersion`,void 0),e([a()],v.prototype,`infoFor3D`,void 0),e([a({readOnly:!0})],v.prototype,`parsedUrl`,null),e([a()],v.prototype,`pbfSupported`,void 0),e([a()],v.prototype,`pbfSupportedWithCurves`,void 0),e([a()],v.prototype,`queryAttachmentsSupported`,void 0),e([a()],v.prototype,`relativeTimeBinWindow`,void 0),e([a()],v.prototype,`sourceSpatialReference`,void 0),e([a()],v.prototype,`timeInformation`,void 0),e([a()],v.prototype,`uniqueIdFields`,void 0),e([a({type:String})],v.prototype,`url`,void 0),v=e([o(`esri.layers.graphics.sources.support.QueryTask`)],v);export{v as default};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import e from"../../../support/TimeInfo.js";import{hasSameTimeFields as t}from"../../../support/timeInfoUtils.js";import{timeExtentToSQL as n}from"../../../../rest/support/timeUtils.js";function r(r,i,a,o){if(!r.timeExtent||!i&&!a)return r;let s=r.clone();if(i&&a){if(!t(i,e.fromJSON(a))){let e=n(r.timeExtent,i,o,r.where);e&&(s.where=e,s.timeExtent=void 0)}return s}return!i&&a?(s.timeExtent=void 0,s):(i&&!a&&(s.where=n(r.timeExtent,i,o,r.where),s.timeExtent=void 0),s)}export{r as applyTimeExtentToQuery};
@@ -18,7 +18,7 @@ export abstract class APIKeyMixin {
18
18
  *
19
19
  * @since 4.20
20
20
  * @see [Item access privileges](https://developers.arcgis.com/documentation/security-and-authentication/api-key-authentication/api-key-credentials/#item-access-privileges)
21
- * @see [API key guide](https://developers.arcgis.com/javascript/latest/secure-resources/#api-keys)
21
+ * @see [Authentication and access tokens](https://developers.arcgis.com/javascript/latest/authentication/access-tokens/#api-keys)
22
22
  * @example
23
23
  * // set the api key to access a protected service
24
24
  * const layer = new FeatureLayer({
@@ -13,6 +13,14 @@ export interface ArcGISMapServiceProperties extends Partial<Pick<ArcGISMapServic
13
13
  * });
14
14
  */
15
15
  fullExtent?: ExtentProperties | null;
16
+ /**
17
+ * The initial extent defined by the map service. This is the service's default map extent
18
+ * and may differ from its [fullExtent](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/ArcGISMapService/#fullExtent).
19
+ * The service value is available after the layer has loaded.
20
+ *
21
+ * @since 6.0
22
+ */
23
+ initialExtent?: ExtentProperties | null;
16
24
  }
17
25
 
18
26
  /**
@@ -40,6 +48,15 @@ export abstract class ArcGISMapService {
40
48
  */
41
49
  get fullExtent(): Extent | null | undefined;
42
50
  set fullExtent(value: ExtentProperties | null | undefined);
51
+ /**
52
+ * The initial extent defined by the map service. This is the service's default map extent
53
+ * and may differ from its [fullExtent](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/ArcGISMapService/#fullExtent).
54
+ * The service value is available after the layer has loaded.
55
+ *
56
+ * @since 6.0
57
+ */
58
+ get initialExtent(): Extent | null | undefined;
59
+ set initialExtent(value: ExtentProperties | null | undefined);
43
60
  /**
44
61
  * Indicates whether the layer will be included in the legend.
45
62
  *
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../request.js";import{some as n}from"../../core/iteratorUtils.js";import{getOrCreateMapValue as r}from"../../core/MapUtils.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{join as a}from"../../core/urlUtils.js";import o from"../../core/Version.js";import{property as s,subclass as c}from"../../core/accessorSupport/decorators.js";import l from"../../geometry/Extent.js";import u from"../../geometry/SpatialReference.js";import{parse as d}from"../support/arcgisLayerUrl.js";import{id as f,popupEnabled as p}from"../support/commonProperties.js";import{isHostedLayer as m}from"../../portal/support/portalItemUtils.js";import{reader as h}from"../../core/accessorSupport/decorators/reader.js";const g=g=>{let _=g,v=class extends _{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(e,t){let n=t.capabilities&&t.capabilities.split(`,`).map(e=>e.toLowerCase().trim());if(!n)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};let r=this.type,i=r!==`tile`&&!!t.supportsDynamicLayers,a=n.includes(`query`),s=n.includes(`map`),c=!!t.exportTilesAllowed,l=n.includes(`tilemap`),u=n.includes(`data`),d=r!==`tile`&&(!t.tileInfo||i),f=r!==`tile`&&(!t.tileInfo||i),p=r!==`tile`,m=r!==`tile`&&i&&t.currentVersion>=11.1,h=t.cimVersion?o.parse(t.cimVersion):null,g=h?.greaterEqual(1,4)??!1,_=h?.greaterEqual(2,0)??!1;return{operations:{supportsExportMap:s,supportsExportTiles:c,supportsIdentify:a,supportsQuery:u,supportsTileMap:l},exportMap:s?{supportsArcadeExpressionForLabeling:g,supportsCIMSymbols:_,supportsDynamicLayers:i,supportsSublayerOrderBy:m,supportsSublayerDefinitionExpression:f,supportsSublayerVisibility:d,supportsSublayersChanges:p}:null,exportTiles:c?{maxExportTilesCount:+t.maxExportTilesCount}:null}}readVersion(e,t){let n=t.currentVersion;return n||=t.hasOwnProperty(`capabilities`)||t.hasOwnProperty(`tables`)?10:t.hasOwnProperty(`supportedImageFormatTypes`)?9.31:9.3,n}async fetchRelatedService(e){let t=this.portalItem;if(!t||!m(t))return null;this._relatedFeatureServicePromise||=t.fetchRelatedItems({relationshipType:`Service2Service`,direction:`reverse`},e).then(e=>e.find(e=>e.type===`Feature Service`)??null,()=>null);let n=await this._relatedFeatureServicePromise;return i(e),n?{itemId:n.id,url:n.url}:null}async fetchSublayerInfo(e,n){let{source:r}=e;if(this?.portalItem&&this.type===`tile`&&r?.type===`map-layer`&&m(this.portalItem)&&e.originIdOf(`url`)<2){let t=await this.fetchRelatedService(n);t&&(e.url=a(t.url,r.mapLayerId.toString()),e.layerItemId=t.itemId)}let{url:i}=e,o;if(r.type===`data-layer`||r.type===`workspace-layer`)o=(await t(i,{responseType:`json`,query:{f:`json`,...this.customParameters,token:this.apiKey},...n})).data;else{let t=e.id;r?.type===`map-layer`&&(t=r.mapLayerId);try{o=(await this.fetchAllLayersAndTables(n)).get(t)}catch{}if(i&&e.originIdOf(`url`)>2)try{let e=await this._fetchAllLayersAndTablesFromService(i),t=d(i)?.sublayer??r.mapLayerId,n=structuredClone(e.get(t));if(n!=null){for(let e of[`drawingInfo`,`maxScale`,`minScale`,`name`])delete n[e];o={...o,...n}}}catch{}}return o}async fetchAllLayersAndTables(e){return this._fetchAllLayersAndTablesFromService(this.parsedUrl?.path,e)}async _fetchAllLayersAndTablesFromService(e,o){await this.load(o),this._allLayersAndTablesMap||=new Map;let s=d(e),c=await r(this._allLayersAndTablesMap,s?.url.path,()=>t(a(s?.url.path,`/layers`),{query:{f:`json`,...this.customParameters,token:this.apiKey}}).then(async e=>{let r=new Map,{layers:i,tables:a}=e.data,o=[...i??[],...a??[]];for(let e of o)r.set(e.id,e);if(n(r.values(),e=>e.capabilities==null||e.extent==null)){let{data:e}=await t(s?.url.path,{query:{f:`json`,...this.customParameters,token:this.apiKey}}).catch(()=>({data:{capabilities:``,fullExtent:void 0}}));for(let t of r.values())t.capabilities??=e.capabilities??``,t.extent??=e.fullExtent}return{result:r}},e=>({error:e})));if(i(o),`result`in c)return c.result;throw c.error}};return e([s({readOnly:!0})],v.prototype,`capabilities`,void 0),e([h(`service`,`capabilities`,[`capabilities`,`cimVersion`,`currentVersion`,`exportTilesAllowed`,`maxExportTilesCount`,`supportsDynamicLayers`,`tileInfo`])],v.prototype,`readCapabilities`,null),e([s({json:{read:{source:`copyrightText`}}})],v.prototype,`copyright`,void 0),e([s({type:l})],v.prototype,`fullExtent`,void 0),e([s(f)],v.prototype,`id`,void 0),e([s({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:`showLegend`},write:{target:`showLegend`}}})],v.prototype,`legendEnabled`,void 0),e([s(p)],v.prototype,`popupEnabled`,void 0),e([s({type:u})],v.prototype,`spatialReference`,void 0),e([s({readOnly:!0})],v.prototype,`version`,void 0),e([h(`service`,`version`,[`currentVersion`,`capabilities`,`tables`,`supportedImageFormatTypes`])],v.prototype,`readVersion`,null),v=e([c(`esri.layers.mixins.ArcGISMapService`)],v),v};export{g as ArcGISMapService};
2
+ import{__decorate as e}from"tslib";import t from"../../request.js";import{some as n}from"../../core/iteratorUtils.js";import{getOrCreateMapValue as r}from"../../core/MapUtils.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{join as a}from"../../core/urlUtils.js";import o from"../../core/Version.js";import{property as s,subclass as c}from"../../core/accessorSupport/decorators.js";import l from"../../geometry/Extent.js";import u from"../../geometry/SpatialReference.js";import{parse as d}from"../support/arcgisLayerUrl.js";import{id as f,popupEnabled as p}from"../support/commonProperties.js";import{isHostedLayer as m}from"../../portal/support/portalItemUtils.js";import{reader as h}from"../../core/accessorSupport/decorators/reader.js";const g=g=>{let _=g,v=class extends _{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.initialExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(e,t){let n=t.capabilities&&t.capabilities.split(`,`).map(e=>e.toLowerCase().trim());if(!n)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};let r=this.type,i=r!==`tile`&&!!t.supportsDynamicLayers,a=n.includes(`query`),s=n.includes(`map`),c=!!t.exportTilesAllowed,l=n.includes(`tilemap`),u=n.includes(`data`),d=r!==`tile`&&(!t.tileInfo||i),f=r!==`tile`&&(!t.tileInfo||i),p=r!==`tile`,m=r!==`tile`&&i&&t.currentVersion>=11.1,h=t.cimVersion?o.parse(t.cimVersion):null,g=h?.greaterEqual(1,4)??!1,_=h?.greaterEqual(2,0)??!1;return{operations:{supportsExportMap:s,supportsExportTiles:c,supportsIdentify:a,supportsQuery:u,supportsTileMap:l},exportMap:s?{supportsArcadeExpressionForLabeling:g,supportsCIMSymbols:_,supportsDynamicLayers:i,supportsSublayerOrderBy:m,supportsSublayerDefinitionExpression:f,supportsSublayerVisibility:d,supportsSublayersChanges:p}:null,exportTiles:c?{maxExportTilesCount:+t.maxExportTilesCount}:null}}readVersion(e,t){let n=t.currentVersion;return n||=t.hasOwnProperty(`capabilities`)||t.hasOwnProperty(`tables`)?10:t.hasOwnProperty(`supportedImageFormatTypes`)?9.31:9.3,n}async fetchRelatedService(e){let t=this.portalItem;if(!t||!m(t))return null;this._relatedFeatureServicePromise||=t.fetchRelatedItems({relationshipType:`Service2Service`,direction:`reverse`},e).then(e=>e.find(e=>e.type===`Feature Service`)??null,()=>null);let n=await this._relatedFeatureServicePromise;return i(e),n?{itemId:n.id,url:n.url}:null}async fetchSublayerInfo(e,n){let{source:r}=e;if(this?.portalItem&&this.type===`tile`&&r?.type===`map-layer`&&m(this.portalItem)&&e.originIdOf(`url`)<2){let t=await this.fetchRelatedService(n);t&&(e.url=a(t.url,r.mapLayerId.toString()),e.layerItemId=t.itemId)}let{url:i}=e,o;if(r.type===`data-layer`||r.type===`workspace-layer`)o=(await t(i,{responseType:`json`,query:{f:`json`,...this.customParameters,token:this.apiKey},...n})).data;else{let t=e.id;r?.type===`map-layer`&&(t=r.mapLayerId);try{o=(await this.fetchAllLayersAndTables(n)).get(t)}catch{}if(i&&e.originIdOf(`url`)>2)try{let e=await this._fetchAllLayersAndTablesFromService(i),t=d(i)?.sublayer??r.mapLayerId,n=structuredClone(e.get(t));if(n!=null){for(let e of[`drawingInfo`,`maxScale`,`minScale`,`name`])delete n[e];o={...o,...n}}}catch{}}return o}async fetchAllLayersAndTables(e){return this._fetchAllLayersAndTablesFromService(this.parsedUrl?.path,e)}async _fetchAllLayersAndTablesFromService(e,o){await this.load(o),this._allLayersAndTablesMap||=new Map;let s=d(e),c=await r(this._allLayersAndTablesMap,s?.url.path,()=>t(a(s?.url.path,`/layers`),{query:{f:`json`,...this.customParameters,token:this.apiKey}}).then(async e=>{let r=new Map,{layers:i,tables:a}=e.data,o=[...i??[],...a??[]];for(let e of o)r.set(e.id,e);if(n(r.values(),e=>e.capabilities==null||e.extent==null)){let{data:e}=await t(s?.url.path,{query:{f:`json`,...this.customParameters,token:this.apiKey}}).catch(()=>({data:{capabilities:``,fullExtent:void 0}}));for(let t of r.values())t.capabilities??=e.capabilities??``,t.extent??=e.fullExtent}return{result:r}},e=>({error:e})));if(i(o),`result`in c)return c.result;throw c.error}};return e([s({readOnly:!0})],v.prototype,`capabilities`,void 0),e([h(`service`,`capabilities`,[`capabilities`,`cimVersion`,`currentVersion`,`exportTilesAllowed`,`maxExportTilesCount`,`supportsDynamicLayers`,`tileInfo`])],v.prototype,`readCapabilities`,null),e([s({json:{read:{source:`copyrightText`}}})],v.prototype,`copyright`,void 0),e([s({type:l})],v.prototype,`fullExtent`,void 0),e([s(f)],v.prototype,`id`,void 0),e([s({type:l})],v.prototype,`initialExtent`,void 0),e([s({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:`showLegend`},write:{target:`showLegend`}}})],v.prototype,`legendEnabled`,void 0),e([s(p)],v.prototype,`popupEnabled`,void 0),e([s({type:u})],v.prototype,`spatialReference`,void 0),e([s({readOnly:!0})],v.prototype,`version`,void 0),e([h(`service`,`version`,[`currentVersion`,`capabilities`,`tables`,`supportedImageFormatTypes`])],v.prototype,`readVersion`,null),v=e([c(`esri.layers.mixins.ArcGISMapService`)],v),v};export{g as ArcGISMapService};
@@ -87,7 +87,7 @@ export interface QueryParameters {
87
87
  *
88
88
  * @since 5.0
89
89
  * @see [Item access privileges](https://developers.arcgis.com/documentation/security-and-authentication/api-key-authentication/api-key-credentials/#item-access-privileges)
90
- * @see [API key guide](https://developers.arcgis.com/javascript/latest/secure-resources/#api-keys)
90
+ * @see [Authentication and access tokens](https://developers.arcgis.com/javascript/latest/authentication/access-tokens/#api-keys)
91
91
  * @example
92
92
  * // set the api key to access a protected service
93
93
  * const layer = new FeatureLayer({
@@ -72,8 +72,13 @@ export interface WFSOperationsDescribeFeatureType {
72
72
  }
73
73
 
74
74
  export interface WFSOperationsGetFeature {
75
- /** The URL to the GetFeature endpoint. */
76
- url: string;
75
+ /**
76
+ * The number of features to return by default.
77
+ * For many WFS servers, it also corresponds to the maximum number of features the service will return in a single request.
78
+ *
79
+ * @since 6.0
80
+ */
81
+ countDefault?: number;
77
82
  /** Value of the geojson-like output format parameter (if any) to send with the GetFeature call. */
78
83
  outputFormat: string | null;
79
84
  /** Indicates if the GetFeature request supports pagination. */
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../request.js";import t from"../../core/Error.js";import{find as n,cache as r}from"../../core/iteratorUtils.js";import{isHTTPSProtocol as i,hasSameOrigin as a,toHTTPS as o}from"../../core/urlUtils.js";import s from"../../geometry/Extent.js";import{initializeProjection as c,project as l}from"../../geometry/projectionUtils.js";import u from"../../geometry/SpatialReference.js";import{equals as d,wgs84 as f}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as p}from"../../geometry/support/typeUtils.js";import{getGeometryType as m}from"../graphics/sources/geojson/geojson.js";import{visitXML as h,iterateXML as g}from"./xmlUtils.js";import{isArcGISUrl as _}from"../support/arcgisLayerUrl.js";import v from"../support/Field.js";import{getFieldDefaultLength as y}from"../support/fieldUtils.js";const b=`xlink:href`,x=`2.0.0`,S=`__esri_wfs_id__`,C=`wfs-layer:feature-type-not-found`,w=`wfs-layer:unknown-geometry-type`;async function T(t,n){let r=E((await e(t,{responseType:`text`,query:{SERVICE:`WFS`,REQUEST:`GetCapabilities`,VERSION:x,...n?.customParameters},signal:n?.signal})).data);return A(t,r),r}function E(e){let t=q(e);Y(t),X(t);let n=t.firstElementChild,i=r(M(n));return{operations:k(n),get featureTypes(){return Array.from(i())},readFeatureTypes:i}}const D=[`json`,`application/json; subtype=geojson; charset=utf-8`,`application/json; subtype=geojson`,`application/json`,`geojson`,`application/geo+json`];function O(e){for(let t of D){let n=e.findIndex(e=>e.toLowerCase()===t);if(n>=0)return e[n]}return null}function k(e){let n=!0,r={GetCapabilities:{url:``},DescribeFeatureType:{url:``},GetFeature:{url:``,outputFormat:null,supportsPagination:!1}},i=[],a=[];if(h(e,{OperationsMetadata:{Parameter:e=>{if(e.getAttribute(`name`)?.toLowerCase()===`outputformat`)return{AllowedValues:{Value:({textContent:e})=>{e&&i.push(e)}}}},Operation:e=>{switch(e.getAttribute(`name`)){case`GetCapabilities`:return{DCP:{HTTP:{Get:e=>{r.GetCapabilities.url=e.getAttribute(b)}}}};case`DescribeFeatureType`:return{DCP:{HTTP:{Get:e=>{r.DescribeFeatureType.url=e.getAttribute(b)}}}};case`GetFeature`:return{DCP:{HTTP:{Get:e=>{r.GetFeature.url=e.getAttribute(b)}}},Parameter:e=>{if(e.getAttribute(`name`)?.toLowerCase()===`outputformat`)return{AllowedValues:{Value:({textContent:e})=>{e&&a.push(e)}}}}}}},Constraint:e=>{switch(e.getAttribute(`name`)){case`KVPEncoding`:return{DefaultValue:e=>{n=e.textContent.toLowerCase()===`true`}};case`ImplementsResultPaging`:return{DefaultValue:e=>{r.GetFeature.supportsPagination=e.textContent.toLowerCase()===`true`}}}}}}),r.GetFeature.outputFormat=O(a)??O(i),!n)throw new t(`wfs-layer:kvp-encoding-not-supported`,`WFS service doesn't support key/value pair (KVP) encoding`);if(r.GetFeature.outputFormat==null)throw new t(`wfs-layer:geojson-not-supported`,`WFS service doesn't support GeoJSON output format`);return r}function A(e,t){i(e)&&(a(e,t.operations.DescribeFeatureType.url,!0)&&(t.operations.DescribeFeatureType.url=o(t.operations.DescribeFeatureType.url)),a(e,t.operations.GetFeature.url,!0)&&(t.operations.GetFeature.url=o(t.operations.GetFeature.url)))}function j(e){let t=parseInt(e.textContent?.match(/(?<wkid>\d+$)/i)?.groups?.wkid??``,10);if(!Number.isNaN(t))return t}function M(e){return g(e,{FeatureTypeList:{FeatureType:e=>{let t={typeName:`undefined:undefined`,name:``,title:``,description:``,extent:null,namespacePrefix:``,namespaceUri:``,defaultSpatialReference:4326,supportedSpatialReferences:[]},n=new Set;return h(e,{Name:e=>{let{name:n,prefix:r}=J(e.textContent);t.typeName=`${r}:${n}`,t.name=n,t.namespacePrefix=r,t.namespaceUri=e.lookupNamespaceURI(r)},Abstract:e=>{t.description=e.textContent},Title:e=>{t.title=e.textContent},WGS84BoundingBox:e=>{t.extent=s.fromJSON(N(e))},DefaultCRS:e=>{let r=j(e);r&&(t.defaultSpatialReference=r,n.add(r))},OtherCRS:e=>{let t=j(e);t&&n.add(t)}}),t.title||=t.name,n.add(4326),t.supportedSpatialReferences.push(...n),t}}})}function N(e){let t,n,r,i;for(let a of e.children)switch(a.localName){case`LowerCorner`:[t,n]=a.textContent.split(` `).map(e=>Number.parseFloat(e));break;case`UpperCorner`:[r,i]=a.textContent.split(` `).map(e=>Number.parseFloat(e))}return{xmin:t,ymin:n,xmax:r,ymax:i,spatialReference:f}}function P(e,t,r){return n(e,e=>r?e.name===t&&e.namespaceUri===r:e.typeName===t||e.name===t)}async function F(e,t,n,r={}){let{featureType:i,extent:a}=await I(e,t,n,r),{spatialReference:o}=Z(e.operations.GetFeature.url,i,r.spatialReference),{fields:s,geometryType:c,swapXY:l,objectIdField:d,geometryField:f}=await L(e,i,o,r);return{url:e.operations.GetCapabilities.url,name:i.name,namespaceUri:i.namespaceUri,fields:s,geometryField:f,geometryType:c,objectIdField:d,spatialReference:r.spatialReference??new u({wkid:i.defaultSpatialReference}),extent:a,swapXY:l,wfsCapabilities:e,customParameters:r.customParameters}}async function I(e,n,r,i={}){let a=e.readFeatureTypes(),o=n?P(a,n,r):a.next().value,{spatialReference:s=new u({wkid:o?.defaultSpatialReference})}=i;if(o==null)throw n?new t(C,`The type '${n}' could not be found in the service`):new t(`wfs-layer:empty-service`,`The service is empty`);let f=o.extent;if(f&&!d(f.spatialReference,s))try{await c(f.spatialReference,s,void 0,i),f=l(f,s)}catch{throw new t(`wfs-layer:unsupported-spatial-reference`,`Projection not supported`)}return{extent:f,spatialReference:s,featureType:o}}async function L(e,n,r,i={}){let{typeName:a}=n,[o,s]=await Promise.allSettled([B(e.operations.DescribeFeatureType.url,a,i),z(e,a,r,i)]),c=e=>{let n=`An error occurred while getting info about the feature type '${a}'`;return new t(`wfs-layer:getWFSLayerTypeInfo-error`,n,{error:e})};if(o.status===`rejected`)throw c(o.reason);if(s.status===`rejected`)throw c(s.reason);let{fields:l,errors:u}=o.value??{},d=o.value?.geometryType||s.value?.geometryType,f=s.value?.swapXY??!1;if(d==null)throw new t(w,`The geometry type could not be determined for type '${a}`,{typeName:a,geometryType:d,fields:l,errors:u});return{...R(l??[]),geometryType:d,swapXY:f}}function R(e){let t=e.find(e=>e.type===`geometry`),n=e.find(e=>e.type===`oid`);return e=e.filter(e=>e.type!==`geometry`),n||(n=new v({name:S,type:`oid`,alias:S}),e.unshift(n)),{geometryField:t?.name??null,objectIdField:n.name,fields:e}}async function z(t,n,r,i={}){let a,o=!1,[s,c]=await Promise.all([W(t.operations.GetFeature.url,n,r,t.operations.GetFeature.outputFormat,{...i,count:1}),e(t.operations.GetFeature.url,{responseType:`text`,query:G(n,r,void 0,{...i,count:1}),signal:i?.signal})]),l=s.type===`FeatureCollection`&&s.features[0]?.geometry;if(l){a=p.fromJSON(m(l.type));let e;switch(l.type){case`Point`:e=l.coordinates;break;case`LineString`:case`MultiPoint`:e=l.coordinates[0];break;case`MultiLineString`:case`Polygon`:e=l.coordinates[0][0];break;case`MultiPolygon`:e=l.coordinates[0][0][0]}let t=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(c.data);if(t){let n=e[0].toFixed(3),r=e[1].toFixed(3),i=parseFloat(t[1]).toFixed(3);n===parseFloat(t[2]).toFixed(3)&&r===i&&(o=!0)}}return{geometryType:a,swapXY:o}}async function B(t,n,r){return V(n,(await e(t,{responseType:`text`,query:{SERVICE:`WFS`,REQUEST:`DescribeFeatureType`,VERSION:x,TYPENAME:n,TYPENAMES:n,...r?.customParameters},signal:r?.signal})).data)}function V(e,r){let{name:i}=J(e),a=q(r);X(a);let o=n(g(a.firstElementChild,{element:e=>e}),e=>e.getAttribute(`name`)===i);if(o!=null){let e=o.getAttribute(`type`),t=e?n(g(a.firstElementChild,{complexType:e=>e}),t=>t.getAttribute(`name`)===J(e).name):n(g(o,{complexType:e=>e}),()=>!0);if(t)return U(t)}throw new t(C,`Type '${e}' not found in document`,{document:new XMLSerializer().serializeToString(a)})}const H=new Set([`objectid`,`fid`]);function U(e){let n=[],r=[],i,a=g(e,{complexContent:{extension:{sequence:{element:e=>e}}}});for(let o of a){let a=o.getAttribute(`name`);if(!a)continue;let s,c;if(o.hasAttribute(`type`)?s=J(o.getAttribute(`type`)).name:h(o,{simpleType:{restriction:e=>(s=J(e.getAttribute(`base`)).name,{maxLength:e=>{c=+e.getAttribute(`value`)}})}}),!s)continue;let l=o.getAttribute(`nillable`)===`true`,u=!1;switch(s.toLowerCase()){case`integer`:case`nonpositiveinteger`:case`negativeinteger`:case`long`:case`int`:case`short`:case`byte`:case`nonnegativeinteger`:case`unsignedlong`:case`unsignedint`:case`unsignedshort`:case`unsignedbyte`:case`positiveinteger`:r.push(new v({name:a,alias:a,type:`integer`,nullable:l,length:y(`integer`)}));break;case`float`:case`double`:case`decimal`:r.push(new v({name:a,alias:a,type:`double`,nullable:l,length:y(`double`)}));break;case`boolean`:case`string`:case`gyearmonth`:case`gyear`:case`gmonthday`:case`gday`:case`gmonth`:case`anyuri`:case`qname`:case`notation`:case`normalizedstring`:case`token`:case`language`:case`idrefs`:case`entities`:case`nmtoken`:case`nmtokens`:case`name`:case`ncname`:case`id`:case`idref`:case`entity`:case`duration`:case`time`:r.push(new v({name:a,alias:a,type:`string`,nullable:l,length:c??y(`string`)}));break;case`datetime`:case`date`:r.push(new v({name:a,alias:a,type:`date`,nullable:l,length:c??y(`date`)}));break;case`pointpropertytype`:i=`point`,u=!0;break;case`multipointpropertytype`:i=`multipoint`,u=!0;break;case`curvepropertytype`:case`multicurvepropertytype`:case`multilinestringpropertytype`:i=`polyline`,u=!0;break;case`surfacepropertytype`:case`multisurfacepropertytype`:case`multipolygonpropertytype`:i=`polygon`,u=!0;break;case`geometrypropertytype`:case`multigeometrypropertytype`:u=!0,n.push(new t(w,`geometry type '${s}' is not supported`,{type:new XMLSerializer().serializeToString(e)}));break;default:n.push(new t(`wfs-layer:unknown-field-type`,`Unknown field type '${s}'`,{type:new XMLSerializer().serializeToString(e)}))}u&&r.push(new v({name:a,alias:a,type:`geometry`,nullable:l}))}for(let e of r)if(e.type===`integer`&&!e.nullable&&H.has(e.name.toLowerCase())){e.type=`oid`;break}return{geometryType:i,fields:r,errors:n}}async function W(n,r,i,a,o){let{data:s}=await e(n,{responseType:`text`,query:G(r,i,a,o),signal:o?.signal});s=s.replaceAll(/": +(-?\d+),(\d+)(,)?/g,`": $1.$2$3`);try{return JSON.parse(s)}catch(e){throw new t(`wfs-layer:malformed-json`,`Error while parsing the\xA0response`,{response:s,error:e})}}function G(e,t,n,r){let i=typeof t==`number`?t:t.wkid;return{SERVICE:`WFS`,REQUEST:`GetFeature`,VERSION:x,TYPENAMES:e,OUTPUTFORMAT:n,SRSNAME:`EPSG:`+i,STARTINDEX:r?.startIndex,COUNT:r?.count,...r?.customParameters}}async function K(t,n,r){let i=await e(t,{responseType:`text`,query:{SERVICE:`WFS`,REQUEST:`GetFeature`,VERSION:x,TYPENAMES:n,RESULTTYPE:`hits`,...r?.customParameters},signal:r?.signal}),a=/numberMatched=["'](?<numberMatched>\d+)["']/gi.exec(i.data);if(a?.groups)return+a.groups.numberMatched}function q(e){return new DOMParser().parseFromString(e.trim(),`text/xml`)}function J(e){let[t,n]=e.split(`:`);return{prefix:n?t:``,name:n??t}}function Y(e){let n=e.firstElementChild?.getAttribute(`version`);if(n&&n!==x)throw new t(`wfs-layer:unsupported-wfs-version`,`Unsupported WFS version ${n}. Supported version: ${x}`)}function X(e){let n=``,r=``;if(h(e.firstElementChild,{Exception:e=>(n=e.getAttribute(`exceptionCode`),{ExceptionText:e=>{r=e.textContent}})}),n)throw new t(`wfs-layer:${n}`,r)}function Z(e,t,n){let r={wkid:t.defaultSpatialReference},i=n?.wkid==null?r:{wkid:n.wkid};return{spatialReference:i,getFeatureSpatialReference:_(e)||i.wkid&&t.supportedSpatialReferences.includes(i.wkid)?{wkid:i.wkid}:{wkid:t.defaultSpatialReference}}}export{B as describeFeatureType,P as findFeatureType,T as getCapabilities,W as getFeature,K as getFeatureCount,I as getFeatureTypeInfo,Z as getGetFeatureSpatialReference,F as getWFSLayerInfo,V as parseDescribeFeatureTypeResponse,E as parseGetCapabilitiesResponse,R as prepareWFSLayerFields,S as wfsOidFieldName};
2
+ import e from"../../request.js";import t from"../../core/Error.js";import{find as n,cache as r}from"../../core/iteratorUtils.js";import{isHTTPSProtocol as i,hasSameOrigin as a,toHTTPS as o}from"../../core/urlUtils.js";import s from"../../geometry/Extent.js";import{initializeProjection as c,project as l}from"../../geometry/projectionUtils.js";import u from"../../geometry/SpatialReference.js";import{equals as d,wgs84 as f}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as p}from"../../geometry/support/typeUtils.js";import{getGeometryType as m}from"../graphics/sources/geojson/geojson.js";import{visitXML as h,iterateXML as g,readInteger as _}from"./xmlUtils.js";import{isArcGISUrl as v}from"../support/arcgisLayerUrl.js";import y from"../support/Field.js";import{getFieldDefaultLength as b}from"../support/fieldUtils.js";const x=`xlink:href`,S=`2.0.0`,C=`__esri_wfs_id__`,w=`wfs-layer:feature-type-not-found`,T=`wfs-layer:unknown-geometry-type`;async function E(t,n){let r=D((await e(t,{responseType:`text`,query:{SERVICE:`WFS`,REQUEST:`GetCapabilities`,VERSION:S,...n?.customParameters},signal:n?.signal})).data);return j(t,r),r}function D(e){let t=J(e);X(t),Z(t);let n=t.firstElementChild,i=r(N(n));return{operations:A(n),get featureTypes(){return Array.from(i())},readFeatureTypes:i}}const O=[`json`,`application/json; subtype=geojson; charset=utf-8`,`application/json; subtype=geojson`,`application/json`,`geojson`,`application/geo+json`];function k(e){for(let t of O){let n=e.findIndex(e=>e.toLowerCase()===t);if(n>=0)return e[n]}return null}function A(e){let n=!0,r={GetCapabilities:{url:``},DescribeFeatureType:{url:``},GetFeature:{url:``,outputFormat:null,supportsPagination:!1,countDefault:void 0}},i=[],a=[],o,s;if(h(e,{OperationsMetadata:{Parameter:e=>{if(e.getAttribute(`name`)?.toLowerCase()===`outputformat`)return{AllowedValues:{Value:({textContent:e})=>{e&&i.push(e)}}}},Operation:e=>{switch(e.getAttribute(`name`)){case`GetCapabilities`:return{DCP:{HTTP:{Get:e=>{r.GetCapabilities.url=e.getAttribute(x)}}}};case`DescribeFeatureType`:return{DCP:{HTTP:{Get:e=>{r.DescribeFeatureType.url=e.getAttribute(x)}}}};case`GetFeature`:return{Constraint:e=>{if(e.getAttribute(`name`)===`CountDefault`)return{DefaultValue:e=>{let t=_(e);s=t!=null&&t>0?t:void 0}}},DCP:{HTTP:{Get:e=>{r.GetFeature.url=e.getAttribute(x)}}},Parameter:e=>{if(e.getAttribute(`name`)?.toLowerCase()===`outputformat`)return{AllowedValues:{Value:({textContent:e})=>{e&&a.push(e)}}}}}}},Constraint:e=>{switch(e.getAttribute(`name`)){case`CountDefault`:return{DefaultValue:e=>{let t=_(e);o=t!=null&&t>0?t:void 0}};case`KVPEncoding`:return{DefaultValue:e=>{n=e.textContent.toLowerCase()===`true`}};case`ImplementsResultPaging`:return{DefaultValue:e=>{r.GetFeature.supportsPagination=e.textContent.toLowerCase()===`true`}}}}}}),r.GetFeature.outputFormat=k(a)??k(i),r.GetFeature.countDefault=s??o,!n)throw new t(`wfs-layer:kvp-encoding-not-supported`,`WFS service doesn't support key/value pair (KVP) encoding`);if(r.GetFeature.outputFormat==null)throw new t(`wfs-layer:geojson-not-supported`,`WFS service doesn't support GeoJSON output format`);return r}function j(e,t){i(e)&&(a(e,t.operations.DescribeFeatureType.url,!0)&&(t.operations.DescribeFeatureType.url=o(t.operations.DescribeFeatureType.url)),a(e,t.operations.GetFeature.url,!0)&&(t.operations.GetFeature.url=o(t.operations.GetFeature.url)))}function M(e){let t=parseInt(e.textContent?.match(/(?<wkid>\d+$)/i)?.groups?.wkid??``,10);if(!Number.isNaN(t))return t}function N(e){return g(e,{FeatureTypeList:{FeatureType:e=>{let t={typeName:`undefined:undefined`,name:``,title:``,description:``,extent:null,namespacePrefix:``,namespaceUri:``,defaultSpatialReference:4326,supportedSpatialReferences:[]},n=new Set;return h(e,{Name:e=>{let{name:n,prefix:r}=Y(e.textContent);t.typeName=`${r}:${n}`,t.name=n,t.namespacePrefix=r,t.namespaceUri=e.lookupNamespaceURI(r)},Abstract:e=>{t.description=e.textContent},Title:e=>{t.title=e.textContent},WGS84BoundingBox:e=>{t.extent=s.fromJSON(P(e))},DefaultCRS:e=>{let r=M(e);r&&(t.defaultSpatialReference=r,n.add(r))},OtherCRS:e=>{let t=M(e);t&&n.add(t)}}),t.title||=t.name,n.add(4326),t.supportedSpatialReferences.push(...n),t}}})}function P(e){let t,n,r,i;for(let a of e.children)switch(a.localName){case`LowerCorner`:[t,n]=a.textContent.split(` `).map(e=>Number.parseFloat(e));break;case`UpperCorner`:[r,i]=a.textContent.split(` `).map(e=>Number.parseFloat(e))}return{xmin:t,ymin:n,xmax:r,ymax:i,spatialReference:f}}function F(e,t,r){return n(e,e=>r?e.name===t&&e.namespaceUri===r:e.typeName===t||e.name===t)}async function I(e,t,n,r={}){let{featureType:i,extent:a}=await L(e,t,n,r),{spatialReference:o}=Q(e.operations.GetFeature.url,i,r.spatialReference),{fields:s,geometryType:c,swapXY:l,objectIdField:d,geometryField:f}=await R(e,i,o,r);return{url:e.operations.GetCapabilities.url,name:i.name,namespaceUri:i.namespaceUri,fields:s,geometryField:f,geometryType:c,objectIdField:d,spatialReference:r.spatialReference??new u({wkid:i.defaultSpatialReference}),extent:a,swapXY:l,wfsCapabilities:e,customParameters:r.customParameters}}async function L(e,n,r,i={}){let a=e.readFeatureTypes(),o=n?F(a,n,r):a.next().value,{spatialReference:s=new u({wkid:o?.defaultSpatialReference})}=i;if(o==null)throw n?new t(w,`The type '${n}' could not be found in the service`):new t(`wfs-layer:empty-service`,`The service is empty`);let f=o.extent;if(f&&!d(f.spatialReference,s))try{await c(f.spatialReference,s,void 0,i),f=l(f,s)}catch{throw new t(`wfs-layer:unsupported-spatial-reference`,`Projection not supported`)}return{extent:f,spatialReference:s,featureType:o}}async function R(e,n,r,i={}){let{typeName:a}=n,[o,s]=await Promise.allSettled([V(e.operations.DescribeFeatureType.url,a,i),B(e,a,r,i)]),c=e=>{let n=`An error occurred while getting info about the feature type '${a}'`;return new t(`wfs-layer:getWFSLayerTypeInfo-error`,n,{error:e})};if(o.status===`rejected`)throw c(o.reason);if(s.status===`rejected`)throw c(s.reason);let{fields:l,errors:u}=o.value??{},d=o.value?.geometryType||s.value?.geometryType,f=s.value?.swapXY??!1;if(d==null)throw new t(T,`The geometry type could not be determined for type '${a}`,{typeName:a,geometryType:d,fields:l,errors:u});return{...z(l??[]),geometryType:d,swapXY:f}}function z(e){let t=e.find(e=>e.type===`geometry`),n=e.find(e=>e.type===`oid`);return e=e.filter(e=>e.type!==`geometry`),n||(n=new y({name:C,type:`oid`,alias:C}),e.unshift(n)),{geometryField:t?.name??null,objectIdField:n.name,fields:e}}async function B(t,n,r,i={}){let a,o=!1,[s,c]=await Promise.all([G(t.operations.GetFeature.url,n,r,t.operations.GetFeature.outputFormat,{...i,count:1}),e(t.operations.GetFeature.url,{responseType:`text`,query:K(n,r,void 0,{...i,count:1}),signal:i?.signal})]),l=s.type===`FeatureCollection`&&s.features[0]?.geometry;if(l){a=p.fromJSON(m(l.type));let e;switch(l.type){case`Point`:e=l.coordinates;break;case`LineString`:case`MultiPoint`:e=l.coordinates[0];break;case`MultiLineString`:case`Polygon`:e=l.coordinates[0][0];break;case`MultiPolygon`:e=l.coordinates[0][0][0]}let t=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(c.data);if(t){let n=e[0].toFixed(3),r=e[1].toFixed(3),i=parseFloat(t[1]).toFixed(3);n===parseFloat(t[2]).toFixed(3)&&r===i&&(o=!0)}}return{geometryType:a,swapXY:o}}async function V(t,n,r){return H(n,(await e(t,{responseType:`text`,query:{SERVICE:`WFS`,REQUEST:`DescribeFeatureType`,VERSION:S,TYPENAME:n,TYPENAMES:n,...r?.customParameters},signal:r?.signal})).data)}function H(e,r){let{name:i}=Y(e),a=J(r);Z(a);let o=n(g(a.firstElementChild,{element:e=>e}),e=>e.getAttribute(`name`)===i);if(o!=null){let e=o.getAttribute(`type`),t=e?n(g(a.firstElementChild,{complexType:e=>e}),t=>t.getAttribute(`name`)===Y(e).name):n(g(o,{complexType:e=>e}),()=>!0);if(t)return W(t)}throw new t(w,`Type '${e}' not found in document`,{document:new XMLSerializer().serializeToString(a)})}const U=new Set([`objectid`,`fid`]);function W(e){let n=[],r=[],i,a=g(e,{complexContent:{extension:{sequence:{element:e=>e}}}});for(let o of a){let a=o.getAttribute(`name`);if(!a)continue;let s,c;if(o.hasAttribute(`type`)?s=Y(o.getAttribute(`type`)).name:h(o,{simpleType:{restriction:e=>(s=Y(e.getAttribute(`base`)).name,{maxLength:e=>{c=+e.getAttribute(`value`)}})}}),!s)continue;let l=o.getAttribute(`nillable`)===`true`,u=!1;switch(s.toLowerCase()){case`integer`:case`nonpositiveinteger`:case`negativeinteger`:case`long`:case`int`:case`short`:case`byte`:case`nonnegativeinteger`:case`unsignedlong`:case`unsignedint`:case`unsignedshort`:case`unsignedbyte`:case`positiveinteger`:r.push(new y({name:a,alias:a,type:`integer`,nullable:l,length:b(`integer`)}));break;case`float`:case`double`:case`decimal`:r.push(new y({name:a,alias:a,type:`double`,nullable:l,length:b(`double`)}));break;case`boolean`:case`string`:case`gyearmonth`:case`gyear`:case`gmonthday`:case`gday`:case`gmonth`:case`anyuri`:case`qname`:case`notation`:case`normalizedstring`:case`token`:case`language`:case`idrefs`:case`entities`:case`nmtoken`:case`nmtokens`:case`name`:case`ncname`:case`id`:case`idref`:case`entity`:case`duration`:case`time`:r.push(new y({name:a,alias:a,type:`string`,nullable:l,length:c??b(`string`)}));break;case`datetime`:case`date`:r.push(new y({name:a,alias:a,type:`date`,nullable:l,length:c??b(`date`)}));break;case`pointpropertytype`:i=`point`,u=!0;break;case`multipointpropertytype`:i=`multipoint`,u=!0;break;case`curvepropertytype`:case`multicurvepropertytype`:case`multilinestringpropertytype`:i=`polyline`,u=!0;break;case`surfacepropertytype`:case`multisurfacepropertytype`:case`multipolygonpropertytype`:i=`polygon`,u=!0;break;case`geometrypropertytype`:case`multigeometrypropertytype`:u=!0,n.push(new t(T,`geometry type '${s}' is not supported`,{type:new XMLSerializer().serializeToString(e)}));break;default:n.push(new t(`wfs-layer:unknown-field-type`,`Unknown field type '${s}'`,{type:new XMLSerializer().serializeToString(e)}))}u&&r.push(new y({name:a,alias:a,type:`geometry`,nullable:l}))}for(let e of r)if(e.type===`integer`&&!e.nullable&&U.has(e.name.toLowerCase())){e.type=`oid`;break}return{geometryType:i,fields:r,errors:n}}async function G(n,r,i,a,o){let{data:s}=await e(n,{responseType:`text`,query:K(r,i,a,o),signal:o?.signal});s=s.replaceAll(/": +(-?\d+),(\d+)(,)?/g,`": $1.$2$3`);try{return JSON.parse(s)}catch(e){throw new t(`wfs-layer:malformed-json`,`Error while parsing the\xA0response`,{response:s,error:e})}}function K(e,t,n,r){let i=typeof t==`number`?t:t.wkid;return{SERVICE:`WFS`,REQUEST:`GetFeature`,VERSION:S,TYPENAMES:e,OUTPUTFORMAT:n,SRSNAME:`EPSG:`+i,STARTINDEX:r?.startIndex,COUNT:r?.count,...r?.customParameters}}async function q(t,n,r){let i=await e(t,{responseType:`text`,query:{SERVICE:`WFS`,REQUEST:`GetFeature`,VERSION:S,TYPENAMES:n,RESULTTYPE:`hits`,...r?.customParameters},signal:r?.signal}),a=/numberMatched=["'](?<numberMatched>\d+)["']/gi.exec(i.data);if(a?.groups)return+a.groups.numberMatched}function J(e){return new DOMParser().parseFromString(e.trim(),`text/xml`)}function Y(e){let[t,n]=e.split(`:`);return{prefix:n?t:``,name:n??t}}function X(e){let n=e.firstElementChild?.getAttribute(`version`);if(n&&n!==S)throw new t(`wfs-layer:unsupported-wfs-version`,`Unsupported WFS version ${n}. Supported version: ${S}`)}function Z(e){let n=``,r=``;if(h(e.firstElementChild,{Exception:e=>(n=e.getAttribute(`exceptionCode`),{ExceptionText:e=>{r=e.textContent}})}),n)throw new t(`wfs-layer:${n}`,r)}function Q(e,t,n){let r={wkid:t.defaultSpatialReference},i=n?.wkid==null?r:{wkid:n.wkid};return{spatialReference:i,getFeatureSpatialReference:v(e)||i.wkid&&t.supportedSpatialReferences.includes(i.wkid)?{wkid:i.wkid}:{wkid:t.defaultSpatialReference}}}export{V as describeFeatureType,F as findFeatureType,E as getCapabilities,G as getFeature,q as getFeatureCount,L as getFeatureTypeInfo,Q as getGetFeatureSpatialReference,I as getWFSLayerInfo,H as parseDescribeFeatureTypeResponse,D as parseGetCapabilitiesResponse,z as prepareWFSLayerFields,C as wfsOidFieldName};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- function e(t,n){if(t&&n){for(let r of t.children)if(r.localName in n){let t=n[r.localName];if(typeof t==`function`){let n=t(r);n&&e(r,n)}else e(r,t)}}}function*t(e,n){for(let r of e.children)if(r.localName in n){let e=n[r.localName];typeof e==`function`?yield e(r):yield*t(r,e)}}export{t as iterateXML,e as visitXML};
2
+ function e(t,n){if(t&&n){for(let r of t.children)if(r.localName in n){let t=n[r.localName];if(typeof t==`function`){let n=t(r);n&&e(r,n)}else e(r,t)}}}function*t(e,n){for(let r of e.children)if(r.localName in n){let e=n[r.localName];typeof e==`function`?yield e(r):yield*t(r,e)}}function n(e){let t=e.textContent?.trim()??``,n=/^[+-]?\d+$/.test(t)?Number(t):NaN;return Number.isSafeInteger(n)?n:void 0}export{t as iterateXML,n as readInteger,e as visitXML};
@@ -16,9 +16,21 @@ export interface TelemetryDataProperties {
16
16
  lineOfSight?: PolylineProperties | null;
17
17
  /** The location of the sensor. */
18
18
  sensorLocation?: PointProperties | null;
19
- /** The path that the moving sensor follows through the duration of the video collection. */
19
+ /**
20
+ * The path that the moving sensor follows through the duration of the video collection.
21
+ * When coverage data is available, this is the remaining route the sensor will travel. If
22
+ * coverage data is unavailable on the layer, this polyline is not hydrated. Vertex M values
23
+ * represent video offset time in milliseconds. The path starts at the current sensor location,
24
+ * or at a time-interpolated route position when the sensor location is unavailable.
25
+ */
20
26
  sensorPath?: PolylineProperties | null;
21
- /** The trail of the sensor. */
27
+ /**
28
+ * The trail of the sensor. This polyline is created by vertex points from available coverage
29
+ * data up to the current playback offset. When coverage data is unavailable, the vertices of
30
+ * this polyline feature are built from the playback cue changes that contain sensor location
31
+ * values. Vertex M values represent video offset time in milliseconds. The trail ends at the
32
+ * same current position where the remaining sensor path starts.
33
+ */
22
34
  sensorTrail?: PolylineProperties | null;
23
35
  }
24
36
 
@@ -43,10 +55,22 @@ export default class TelemetryData extends TelemetryDataSuperclass {
43
55
  /** The location of the sensor. */
44
56
  get sensorLocation(): Point | null | undefined;
45
57
  set sensorLocation(value: PointProperties | null | undefined);
46
- /** The path that the moving sensor follows through the duration of the video collection. */
58
+ /**
59
+ * The path that the moving sensor follows through the duration of the video collection.
60
+ * When coverage data is available, this is the remaining route the sensor will travel. If
61
+ * coverage data is unavailable on the layer, this polyline is not hydrated. Vertex M values
62
+ * represent video offset time in milliseconds. The path starts at the current sensor location,
63
+ * or at a time-interpolated route position when the sensor location is unavailable.
64
+ */
47
65
  get sensorPath(): Polyline | null | undefined;
48
66
  set sensorPath(value: PolylineProperties | null | undefined);
49
- /** The trail of the sensor. */
67
+ /**
68
+ * The trail of the sensor. This polyline is created by vertex points from available coverage
69
+ * data up to the current playback offset. When coverage data is unavailable, the vertices of
70
+ * this polyline feature are built from the playback cue changes that contain sensor location
71
+ * values. Vertex M values represent video offset time in milliseconds. The trail ends at the
72
+ * same current position where the remaining sensor path starts.
73
+ */
50
74
  get sensorTrail(): Polyline | null | undefined;
51
75
  set sensorTrail(value: PolylineProperties | null | undefined);
52
76
  }
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{isMultiOriginJSONMixin as n}from"../../core/multiOriginJSONSupportUtils.js";import{sqlAnd as r,sqlName as i,sqlLiteral as a}from"../../core/sql.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{timeExtentToQueryParameter as c}from"../../rest/support/timeUtils.js";function l(e,t,n,r){let o=r.get(e)?.type,s=r.getTimeZone(e);return`${i(e)} ${t} ${a(n,{type:`date`},{type:o,timeZone:s})}`}let u=class extends t{constructor(e){super(e),this.fieldsIndex=null,this.layer=null}getExpression(e){let{layer:t}=this;if(!t)return;if(!n(t))return{type:`where`,value:this._getLayerCondition(e)};let r=t.timeInfo,i=t.getAtOrigin(`timeInfo`,`service`);if(i)return r?r===i||(r.startField===i.startField||!r.startField&&!i.startField)&&(r.endField===i.endField||!r.endField&&!i.endField)?{type:`time`,value:c(e)}:{type:`where`,value:this._getLayerCondition(e)}:void 0;if(r)return{type:`where`,value:this._getLayerCondition(e)}}_getLayerCondition(e){let{fieldsIndex:t,layer:n}=this;if(!t||!n)return;let{timeInfo:i}=n;if(!i)return;let{startField:a,endField:o}=i,{start:s,end:c}=e;if(!s&&!c||!a&&!o)return;let u=a??o,d=o??a;if(u&&d){if(s&&c){if(s.getTime()===c.getTime())return l(u,`==`,s,t);if(!a||!o){let e=l(u,`>=`,s,t),n=l(u,`<=`,c,t);return r(e,n)}let e=l(a,`>=`,s,t),n=l(o,`<=`,c,t);return r(e,n)}if(s)return l(u,`>=`,s,t);if(c)return l(d,`<=`,c,t)}}};e([o({constructOnly:!0})],u.prototype,`fieldsIndex`,void 0),e([o({constructOnly:!0})],u.prototype,`layer`,void 0),u=e([s(`esri.layers.support.TimeInformation`)],u);export{u as default};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{isMultiOriginJSONMixin as n}from"../../core/multiOriginJSONSupportUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{hasSameTimeFields as a}from"./timeInfoUtils.js";import{timeExtentToSQL as o,timeExtentToQueryParameter as s}from"../../rest/support/timeUtils.js";let c=class extends t{constructor(e){super(e),this.fieldsIndex=null,this.layer=null}getExpression(e){let{layer:t}=this;if(!t)return;let r=t.timeInfo;if(!n(t))return{type:`where`,value:o(e,r,this.fieldsIndex)};let i=t.getAtOrigin(`timeInfo`,`service`);if(i)return r?r===i||a(r,i)?{type:`time`,value:s(e)}:{type:`where`,value:o(e,r,this.fieldsIndex)}:void 0;if(r)return{type:`where`,value:o(e,r,this.fieldsIndex)}}};e([r({constructOnly:!0})],c.prototype,`fieldsIndex`,void 0),e([r({constructOnly:!0})],c.prototype,`layer`,void 0),c=e([i(`esri.layers.support.TimeInformation`)],c);export{c as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{rad2deg as e}from"../../core/mathUtils.js";import{subtract as t,add as n,transformMat4 as r,copy as i,min as a,max as o,sub as s}from"../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as c,create as l}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{WGS84ECEFSpatialReferenceLike as u}from"../../geometry/ellipsoidUtils.js";import d from"../../geometry/Extent.js";import f from"../../geometry/HeightModelInfo.js";import p from"../../geometry/SpatialReference.js";import{projectBuffer as m}from"../../geometry/projection/projectBuffer.js";const h=new p({wkid:4326,vcsWkid:115700}),g=new d(-180,-90,180,90,h);function _(e,t){if(!Array.isArray(e)||e.length<t)return!1;for(let t of e)if(typeof t!=`number`)return!1;return!0}const v=7645211,y={xmin:-180,ymin:-90,zmin:-450,xmax:180,ymax:90,zmax:8850},b=new Map([[5773,new f({heightModel:`gravity-related-height`,heightUnit:`meters`,vertCRS:`EGM96_Geoid`})],[3855,new f({heightModel:`gravity-related-height`,heightUnit:`meters`,vertCRS:`EGM2008_Geoid`})],[115700,new f({heightModel:`ellipsoidal`,heightUnit:`meters`,vertCRS:`WGS_1984`})],[115701,new f({heightModel:`ellipsoidal`,heightUnit:`meters`,vertCRS:`ETRS_1989`})],[6360,new f({heightModel:`gravity-related-height`,heightUnit:`us-feet`,vertCRS:`NAVD88_height_(ftUS)`})],[7837,new f({heightModel:`gravity-related-height`,heightUnit:`meters`,vertCRS:`DHHN2016_(height)`})],[5709,new f({heightModel:`gravity-related-height`,heightUnit:`meters`,vertCRS:`NAP`})]]);function x(e){let t=null;return e&&b.forEach((n,r)=>{!t&&n.vertCRS===e.vertCRS&&n.heightUnit===e.heightUnit&&(t=r)}),t}function S(e){if(!e)return null;let t=e.vcsWkid||e.latestVcsWkid;return t?b.get(t):null}function C(e){return!!((e.extensions?.ESRI_crs?.wkid||e.extensions?.ESRI_crs?.latestWkid||e.extensions?.ESRI_crs?.wkt)&&(e.root?.extensions?.ESRI_crs?.boundingVolume?.box||e.root?.extensions?.ESRI_crs?.boundingVolume?.sphere))}function w(f,h=!1){let g=new p({wkid:4326,vcsWkid:115700}),b=f.root?.boundingVolume,x=!1,S=f?.root?.transform;if(h&&(f.extensions?.ESRI_crs?.wkid||f.extensions?.ESRI_crs?.latestWkid||f.extensions?.ESRI_crs?.wkt)&&(f.root?.extensions?.ESRI_crs?.boundingVolume?.box||f.root?.extensions?.ESRI_crs?.boundingVolume?.sphere))g=new p(f.extensions?.ESRI_crs),b=f.root?.extensions?.ESRI_crs?.boundingVolume,S=f.root?.transform,x=!0;else if(!b)return new d(-180,-90,180,90,g);if(b.box){let e=b?.box;if(e[3]>v&&e[7]>v&&e[11]>v)return new d({...y,spatialReference:g})}let C=l();if(!x&&b.region&&_(b.region,6)){let t=b.region,n=e(t[0]),r=e(t[1]),i=t[4],a=e(t[2]),o=e(t[3]),s=t[5];return new d({xmin:n,ymin:r,zmin:i,xmax:a,ymax:o,zmax:s,spatialReference:g})}if(b.sphere&&_(b.sphere,4)){let e=b.sphere,s=c(e[0],e[1],e[2]),f=e[3]/Math.sqrt(3),h=l();t(h,s,c(f,f,f));let v=l();if(n(v,s,c(f,f,f)),S&&_(S,16)){let e=S;r(C,h,e),i(h,C),r(C,v,e),i(v,C)}x||(m(h,u,0,h,p.WGS84,0),m(v,u,0,v,p.WGS84,0));let y=l(),w=l();return a(y,h,v),o(w,h,v),new d({xmin:y[0],ymin:y[1],zmin:y[2],xmax:w[0],ymax:w[1],zmax:w[2],spatialReference:g})}if(b.box&&_(b.box,12)){let e=b.box,t=c(e[0],e[1],e[2]),i=c(e[3],e[4],e[5]),f=c(e[6],e[7],e[8]),h=c(e[9],e[10],e[11]),v=[];for(let e=0;e<8;++e)v.push(l());if(n(v[0],t,i),n(v[0],v[0],f),n(v[0],v[0],h),s(v[1],t,i),n(v[1],v[1],f),n(v[1],v[1],h),n(v[2],t,i),s(v[2],v[2],f),n(v[2],v[2],h),s(v[3],t,i),s(v[3],v[3],f),n(v[3],v[3],h),n(v[4],t,i),n(v[4],v[4],f),s(v[4],v[4],h),s(v[5],t,i),n(v[5],v[5],f),s(v[5],v[5],h),n(v[6],t,i),s(v[6],v[6],f),s(v[6],v[6],h),s(v[7],t,i),s(v[7],v[7],f),s(v[7],v[7],h),S&&_(S,16)){let e=S;for(let t=0;t<8;++t)r(v[t],v[t],e)}let y=c(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),C=c(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let e=0;e<8;++e)x||m(v[e],u,0,v[e],p.WGS84,0),a(C,C,v[e]),o(y,y,v[e]);return new d({xmin:C[0],ymin:C[1],zmin:C[2],xmax:y[0],ymax:y[1],zmax:y[2],spatialReference:g})}return new d(-180,-90,180,90,g)}function T(e){typeof e.desc==`string`&&(e.desc=JSON.parse(e.desc));let t=e.desc?.geometry?.prims.length;return e.desc!=null&&e.desc.obb!=null&&t!=null&&e.validPrimitiveIndices.length>0&&e.validPrimitiveIndices.every(e=>Number.isInteger(e)&&e>=0&&e<t)}function E(e){return`${e}`}export{g as default3DTilesFullExtent,h as default3DTilesSpatialReference,S as getHeightModelInfoFromVCS,x as getVCSFromHeightModelInfo,C as hasEsriCrs,w as initFullExtent,E as makeCacheKey,T as validateEntity3D,_ as verifyArray};
2
+ import{rad2deg as e}from"../../core/mathUtils.js";import{identity as t}from"../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{subtract as r,add as i,transformMat4 as a,copy as o,min as s,max as c,sub as l}from"../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as u,create as d}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{WGS84ECEFSpatialReferenceLike as f}from"../../geometry/ellipsoidUtils.js";import p from"../../geometry/Extent.js";import m from"../../geometry/HeightModelInfo.js";import h from"../../geometry/SpatialReference.js";import{projectBuffer as g}from"../../geometry/projection/projectBuffer.js";import{nullId as _}from"../ILyr3DWasmPerSceneView.js";const v=new h({wkid:4326,vcsWkid:115700}),y=new p(-180,-90,180,90,v);function b(e,t){if(!Array.isArray(e)||e.length<t)return!1;for(let t of e)if(typeof t!=`number`)return!1;return!0}const x=7645211,S={xmin:-180,ymin:-90,zmin:-450,xmax:180,ymax:90,zmax:8850},C=new Map([[5773,new m({heightModel:`gravity-related-height`,heightUnit:`meters`,vertCRS:`EGM96_Geoid`})],[3855,new m({heightModel:`gravity-related-height`,heightUnit:`meters`,vertCRS:`EGM2008_Geoid`})],[115700,new m({heightModel:`ellipsoidal`,heightUnit:`meters`,vertCRS:`WGS_1984`})],[115701,new m({heightModel:`ellipsoidal`,heightUnit:`meters`,vertCRS:`ETRS_1989`})],[6360,new m({heightModel:`gravity-related-height`,heightUnit:`us-feet`,vertCRS:`NAVD88_height_(ftUS)`})],[7837,new m({heightModel:`gravity-related-height`,heightUnit:`meters`,vertCRS:`DHHN2016_(height)`})],[5709,new m({heightModel:`gravity-related-height`,heightUnit:`meters`,vertCRS:`NAP`})]]);function w(e){let t=null;return e&&C.forEach((n,r)=>{!t&&n.vertCRS===e.vertCRS&&n.heightUnit===e.heightUnit&&(t=r)}),t}function T(e){if(!e)return null;let t=e.vcsWkid||e.latestVcsWkid;return t?C.get(t):null}function E(e){return!!(e.extensions?.ESRI_crs?.wkid||e.extensions?.ESRI_crs?.latestWkid||e.extensions?.ESRI_crs?.wkt||e.extensions?.ESRI_crs?.wkt2)}const D=n(),O=t(D);function k(t,n=!1){let m=new h({wkid:4326,vcsWkid:115700}),_=t.root?.boundingVolume,v=!1,C=t?.root?.transform;if(n&&E(t)&&(v=!0,m=new h(t.extensions?.ESRI_crs),(t.root?.extensions?.ESRI_crs?.boundingVolume?.box||t.root?.extensions?.ESRI_crs?.boundingVolume?.sphere)&&(_=t.root?.extensions?.ESRI_crs?.boundingVolume),C=t.root?.extensions?.ESRI_crs?.transform?t.root?.extensions?.ESRI_crs?.transform:O),!_)return y;if(_.box){let e=_?.box;if(e[3]>x&&e[7]>x&&e[11]>x)return new p({...S,spatialReference:m})}let w=d();if(!v&&_.region&&b(_.region,6)){let t=_.region,n=e(t[0]),r=e(t[1]),i=t[4],a=e(t[2]),o=e(t[3]),s=t[5];return new p({xmin:n,ymin:r,zmin:i,xmax:a,ymax:o,zmax:s,spatialReference:m})}if(_.sphere&&b(_.sphere,4)){let e=_.sphere,t=u(e[0],e[1],e[2]),n=e[3]/Math.sqrt(3),l=d();r(l,t,u(n,n,n));let y=d();if(i(y,t,u(n,n,n)),C&&b(C,16)){let e=C;a(w,l,e),o(l,w),a(w,y,e),o(y,w)}v||(g(l,f,0,l,h.WGS84,0),g(y,f,0,y,h.WGS84,0));let x=d(),S=d();return s(x,l,y),c(S,l,y),new p({xmin:x[0],ymin:x[1],zmin:x[2],xmax:S[0],ymax:S[1],zmax:S[2],spatialReference:m})}if(_.box&&b(_.box,12)){let e=_.box,t=u(e[0],e[1],e[2]),n=u(e[3],e[4],e[5]),r=u(e[6],e[7],e[8]),o=u(e[9],e[10],e[11]),y=[];for(let e=0;e<8;++e)y.push(d());if(i(y[0],t,n),i(y[0],y[0],r),i(y[0],y[0],o),l(y[1],t,n),i(y[1],y[1],r),i(y[1],y[1],o),i(y[2],t,n),l(y[2],y[2],r),i(y[2],y[2],o),l(y[3],t,n),l(y[3],y[3],r),i(y[3],y[3],o),i(y[4],t,n),i(y[4],y[4],r),l(y[4],y[4],o),l(y[5],t,n),i(y[5],y[5],r),l(y[5],y[5],o),i(y[6],t,n),l(y[6],y[6],r),l(y[6],y[6],o),l(y[7],t,n),l(y[7],y[7],r),l(y[7],y[7],o),C&&b(C,16)){let e=C;for(let t=0;t<8;++t)a(y[t],y[t],e)}let x=u(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),S=u(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let e=0;e<8;++e)v||g(y[e],f,0,y[e],h.WGS84,0),s(S,S,y[e]),c(x,x,y[e]);return new p({xmin:S[0],ymin:S[1],zmin:S[2],xmax:x[0],ymax:x[1],zmax:x[2],spatialReference:m})}return y}function A(e){typeof e.desc==`string`&&(e.desc=JSON.parse(e.desc));let t=e.desc?.geometry?.prims.length;return e.desc!=null&&e.desc.obb!=null&&t!=null&&e.validPrimitiveIndices.length>0&&e.validPrimitiveIndices.every(e=>Number.isInteger(e)&&e>=0&&e<t)}function j(e){return`${e}`}function M(e){return e!=null&&e!==_}export{y as default3DTilesFullExtent,v as default3DTilesSpatialReference,T as getHeightModelInfoFromVCS,w as getVCSFromHeightModelInfo,E as hasEsriCrs,k as initFullExtent,M as isValidHandle,j as makeCacheKey,A as validateEntity3D,b as verifyArray};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ function e(e,t){let n=e.startField===t.startField||!e.startField&&!t.startField,r=e.endField===t.endField||!e.endField&&!t.endField;return n&&r}export{e as hasSameTimeFields};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../geometry/Point.js";import t from"../../geometry/Polygon.js";import n from"../../geometry/Polyline.js";import r from"../../geometry/SpatialReference.js";import{projectExecute as i}from"../../geometry/operators/projectOperator.js";import a from"../support/TelemetryData.js";import o from"../support/VideoTimeExtent.js";import{applyCIMSymbolColor as s}from"../../symbols/support/cimSymbolUtils.js";import{applyColorToSymbol as c}from"../../symbols/support/utils.js";const l=`application/x-mpegURL`,u={UASDatalinkLocalSet:1e4,PrecisionTimeStamp:10002,MissionId:10003,PlatformTailNumber:10004,PlatformHeadingAngle:10005,PlatformPitchAngle:10006,PlatformRollAngle:10007,PlatformTrueAirspeed:10008,PlatformIndicatedAirspeed:10009,PlatformDesignation:10010,ImageSourceSensor:10011,ImageCoordinateSystem:10012,SensorLatitude:10013,SensorLongitude:10014,SensorTrueAltitude:10015,SensorHorizontalFOV:10016,SensorVerticalFOV:10017,SensorAzimuthAngle:10018,SensorElevationAngle:10019,SensorRollAngle:10020,PlatformSlantRange:10021,TargetWidth:10022,FrameCenterLatitude:10023,FrameCenterLongitude:10024,FrameCenterElevation:10025,OffsetCorner1Latitude:10026,OffsetCorner1Longitude:10027,OffsetCorner2Latitude:10028,OffsetCorner2Longitude:10029,OffsetCorner3Latitude:10030,OffsetCorner3Longitude:10031,OffsetCorner4Latitude:10032,OffsetCorner4Longitude:10033,TargetLocationLatitude:10040,TargetLocationLongitude:10041,TargetLocationElevation:10042,TargetTrackGateWidth:10043,TargetTrackGateHeight:10044,TargetErrorEstimateHorizontal:10045,TargetErrorEstimateLateral:10046,GenericFlagData:10047,PlatformGroundSpeed:10056,PlatformGroundRange:10057,PlatformRemainingFuel:10058,PlatformCallSign:10059,SensorFOVName:10063,PlatformMagneticHeading:10064,LDSVersionNumber:10065,AlternatePlatformName:10070,EventStartTimeUTC:10072,VMTIDataSet:10074,SensorEllipsoidHeight:10075,OperationalMode:10077,FrameCenterAboveEllipsoid:10078,CornerLatitudePoint1:10082,CornerLongitudePoint1:10083,CornerLatitudePoint2:10084,CornerLongitudePoint2:10085,CornerLatitudePoint3:10086,CornerLongitudePoint3:10087,CornerLatitudePoint4:10088,CornerLongitudePoint4:10089,SARMotionImageryMetadata:10095,SecurityClassification:20001,SecurityClassifyingAuthority:20002,SecurityClassifyingCountry:20003,SecuritySCI:20004,SecurityCaveats:20005,SecurityReleaseInstructions:20006,SecurityLDSVersion:20022,EsriVideoWidth:90001,EsriVideoHeight:90002,EsriFrameCenterLatitude:90050,EsriFrameCenterLongitude:90051,EsriCornerLatitudePt1:90052,EsriCornerLongitudePt1:90053,EsriCornerLatitudePt2:90054,EsriCornerLongitudePt2:90055,EsriCornerLatitudePt3:90056,EsriCornerLongitudePt3:90057,EsriCornerLatitudePt4:90058,EsriCornerLongitudePt4:90059,EsriFrameOutline:90060,EsriSensorPosition:90061,EsriHorizonPixelPack:90063,EsriGroundControlPoints:90064};function d(e,t=1e4){if(!e||!e.length)return[];let n=[],r=[];for(let t=0;t<e.length;t++){let r=e[t],i=r?.text?JSON.parse(r.text):null;i?.source===`EsriVideoServer`&&(n=[...i.data])}let i=n.find(e=>e.tagId===t);return Array.isArray(i?.value)&&(r=[...i.value]),r}function f(e){let{duration:t,end:n,start:r,timezone:i=`UTC`}=e||{};return[t,n,r].some(e=>typeof e!=`number`||e<0)?null:new o({duration:t||null,end:new Date(Number(n)),start:new Date(Number(r)),timezone:i})}function p(e,t){let n=[...t],r=n.findIndex(t=>t.equals(e));return r>-1&&n.splice(r),n.push(e),n}function m(e){if(!e?.size)return new a;let t=k(e),n=_(e),r=T(e),i=O(t,n);return new a({frameCenter:n,frameOutline:r,lineOfSight:i,sensorLocation:t})}function h(e){return e?.size?e.get(u.EsriGroundControlPoints)?.value??null??null:null}function g(e){return e?.size?e.get(u.EsriHorizonPixelPack)?.value??null:null}function _(e){return C(e)??w(e)}function v(e){if(!e)return l;let t=e.match(/\.(\w{3,4})(?:$|\?)/i);if(!t)return l;switch(t[1].toLowerCase()){case`mp4`:return`video/mp4`;case`webm`:return`video/webm`;default:return l}}function y(e){let t=e?.layers;return t?.length?t.map(e=>({layerId:e.id,posterUrl:e.poster,sourceType:e.serviceType,title:e.name,type:e.type||`Video Layer`})):[]}function b(e,t,n){if(!e)return null;let r=e.clone();switch(r.type){case`simple-fill`:c(r,n),r.outline.color=t;break;case`simple-line`:c(r,t);break;case`simple-marker`:c(r,t),r?.outline?.color&&(r.outline.color=t);break;case`cim`:s(r,t)}return r}function x(e){let{cameraAzimuth:t,platformHeading:n,source:r=null,symbolOffset:i=0}=e||{},a=0;if(!r)return a;a=r===`platformHeading`?n+i:n+t+i;let o=a>360?a-360:a;return Math.round(Math.abs(o))}function S(t,n,a){if(!n||n.length<3)return null;let o=[...n].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y),s=Array.from(new Set(o.map(e=>e.x))).sort((e,t)=>e-t),c=Array.from(new Set(o.map(e=>e.y))),l=-1;for(let e=s.length-2;e>=0;e--)if(t.x>=s[e]&&t.x<=s[e+1]){l=e;break}let u=-1;for(let e=c.length-2;e>=0;e--)if(t.y>=c[e]&&t.y<=c[e+1]){u=e;break}if(l<0||u<0||l>=s.length-1||u>=c.length-1)return null;let d=s[l],f=s[l+1],p=c[u],m=c[u+1],h=(e,t)=>{let r=n.find(n=>n.x===e&&n.y===t);if(!r)throw Error(`Control point not found for x: ${e}, y: ${t}`);return r},g=h(d,p),_=h(f,p),v=h(d,m),y=h(f,m),b=t.x,x=t.y,S,C;if(A(g.x,g.y,_.x,_.y,y.x,y.y,b,x)){let t=new e(g.lon,g.lat,r.WGS84),n=new e(_.lon,_.lat,r.WGS84),o=new e(y.lon,y.lat,r.WGS84),s=i(t,a),c=i(n,a),l=i(o,a);C=[g,_,y],S=[s,c,l]}else if(A(g.x,g.y,y.x,y.y,v.x,v.y,b,x)){let t=new e(g.lon,g.lat,r.WGS84),n=new e(y.lon,y.lat,r.WGS84),o=new e(v.lon,v.lat,r.WGS84),s=i(t,a),c=i(n,a),l=i(o,a);C=[g,y,v],S=[s,c,l]}else return null;let[w,T,E]=C,[D,O,k]=S,j=(T.y-E.y)*(w.x-E.x)+(E.x-T.x)*(w.y-E.y),M=((T.y-E.y)*(b-E.x)+(E.x-T.x)*(x-E.y))/j,N=((E.y-w.y)*(b-E.x)+(w.x-E.x)*(x-E.y))/j,P=1-M-N;return[M*D.x+N*O.x+P*k.x,M*D.y+N*O.y+P*k.y]}function C(t){return!t||!t.has(u.EsriFrameCenterLatitude)||!t.has(u.EsriFrameCenterLongitude)?null:new e({x:t.get(u.EsriFrameCenterLongitude).value,y:t.get(u.EsriFrameCenterLatitude).value,z:t.get(u.FrameCenterAboveEllipsoid)?.value??t.get(u.FrameCenterElevation)?.value})}function w(t){return!t||!t.has(u.FrameCenterLatitude)||!t.has(u.FrameCenterLongitude)?null:new e({x:t.get(u.FrameCenterLongitude)?.value,y:t.get(u.FrameCenterLatitude)?.value,z:t.get(u.FrameCenterElevation)?.value})}function T(e){if(!e)return null;let n=e.get(u.EsriFrameOutline)?.value;return n?t.fromJSON(n.geometry):E(e)??D(e)}function E(e){if(!e.has(u.EsriCornerLatitudePt1)||!e.has(u.EsriCornerLongitudePt1)||!e.has(u.EsriCornerLatitudePt2)||!e.has(u.EsriCornerLongitudePt2)||!e.has(u.EsriCornerLatitudePt3)||!e.has(u.EsriCornerLongitudePt3)||!e.has(u.EsriCornerLatitudePt4)||!e.has(u.EsriCornerLongitudePt4))return null;let n=[e.get(u.EsriCornerLongitudePt1)?.value,e.get(u.EsriCornerLatitudePt1)?.value],r=[e.get(u.EsriCornerLongitudePt2)?.value,e.get(u.EsriCornerLatitudePt2)?.value],i=[e.get(u.EsriCornerLongitudePt3)?.value,e.get(u.EsriCornerLatitudePt3)?.value],a=[e.get(u.EsriCornerLongitudePt4)?.value,e.get(u.EsriCornerLatitudePt4)?.value];return new t({rings:[[n,r,i,a]]})}function D(e){if(!e.has(u.OffsetCorner1Latitude)||!e.has(u.OffsetCorner1Longitude)||!e.has(u.OffsetCorner2Latitude)||!e.has(u.OffsetCorner2Longitude)||!e.has(u.OffsetCorner3Latitude)||!e.has(u.OffsetCorner3Longitude)||!e.has(u.OffsetCorner4Latitude)||!e.has(u.OffsetCorner4Longitude)||!e.has(u.FrameCenterLatitude)||!e.has(u.FrameCenterLongitude))return null;let n=e.get(u.FrameCenterLatitude)?.value,r=e.get(u.FrameCenterLongitude)?.value,i=n+e.get(u.OffsetCorner1Latitude)?.value,a=r+e.get(u.OffsetCorner1Longitude)?.value,o=n+e.get(u.OffsetCorner2Latitude)?.value,s=r+e.get(u.OffsetCorner2Longitude)?.value,c=n+e.get(u.OffsetCorner3Latitude)?.value,l=r+e.get(u.OffsetCorner3Longitude)?.value,d=n+e.get(u.OffsetCorner4Latitude)?.value,f=r+e.get(u.OffsetCorner4Longitude)?.value;return new t({rings:[[[a,i],[s,o],[l,c],[f,d]]]})}function O(e,t){if(!e||!t)return null;let r=[e.x,e.y,e.z??0],i=[t.x,t.y,t.z??0];return new n({hasZ:!0,hasM:!1,paths:[[r,i]]})}function k(t){if(!t?.size)return null;if(t.has(u.EsriSensorPosition)){let n=t.get(u.EsriSensorPosition)?.value;if(n)return e.fromJSON(n.geometry)}return t.has(u.SensorLongitude)&&t.has(u.SensorLatitude)?new e({x:t.get(u.SensorLongitude)?.value,y:t.get(u.SensorLatitude)?.value,z:t.get(u.SensorTrueAltitude)?.value}):null}function A(e,t,n,r,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}export{S as computeVideoToMapBaricentric,_ as getFrameCenter,g as getFrameHorizonPoints,h as getGroundControlPoints,O as getLineOfSight,p as getSensorTrailPoints,y as getServiceLayersInfo,b as getStyledTelemetrySymbol,x as getSymbolDisplayAngle,m as getTelemetryData,d as getVideoMetadataFromCueList,v as getVideoMimeType,f as readVideoTimeExtent,u as videoMetadataEntryId};
2
+ import e from"../../geometry/Point.js";import t from"../../geometry/Polygon.js";import n from"../../geometry/Polyline.js";import r from"../../geometry/SpatialReference.js";import{projectExecute as i}from"../../geometry/operators/projectOperator.js";import a from"../support/TelemetryData.js";import o from"../support/VideoTimeExtent.js";import{applyCIMSymbolColor as s}from"../../symbols/support/cimSymbolUtils.js";import{applyColorToSymbol as c}from"../../symbols/support/utils.js";const l=`application/x-mpegURL`,u={UASDatalinkLocalSet:1e4,PrecisionTimeStamp:10002,MissionId:10003,PlatformTailNumber:10004,PlatformHeadingAngle:10005,PlatformPitchAngle:10006,PlatformRollAngle:10007,PlatformTrueAirspeed:10008,PlatformIndicatedAirspeed:10009,PlatformDesignation:10010,ImageSourceSensor:10011,ImageCoordinateSystem:10012,SensorLatitude:10013,SensorLongitude:10014,SensorTrueAltitude:10015,SensorHorizontalFOV:10016,SensorVerticalFOV:10017,SensorAzimuthAngle:10018,SensorElevationAngle:10019,SensorRollAngle:10020,PlatformSlantRange:10021,TargetWidth:10022,FrameCenterLatitude:10023,FrameCenterLongitude:10024,FrameCenterElevation:10025,OffsetCorner1Latitude:10026,OffsetCorner1Longitude:10027,OffsetCorner2Latitude:10028,OffsetCorner2Longitude:10029,OffsetCorner3Latitude:10030,OffsetCorner3Longitude:10031,OffsetCorner4Latitude:10032,OffsetCorner4Longitude:10033,TargetLocationLatitude:10040,TargetLocationLongitude:10041,TargetLocationElevation:10042,TargetTrackGateWidth:10043,TargetTrackGateHeight:10044,TargetErrorEstimateHorizontal:10045,TargetErrorEstimateLateral:10046,GenericFlagData:10047,PlatformGroundSpeed:10056,PlatformGroundRange:10057,PlatformRemainingFuel:10058,PlatformCallSign:10059,SensorFOVName:10063,PlatformMagneticHeading:10064,LDSVersionNumber:10065,AlternatePlatformName:10070,EventStartTimeUTC:10072,VMTIDataSet:10074,SensorEllipsoidHeight:10075,OperationalMode:10077,FrameCenterAboveEllipsoid:10078,CornerLatitudePoint1:10082,CornerLongitudePoint1:10083,CornerLatitudePoint2:10084,CornerLongitudePoint2:10085,CornerLatitudePoint3:10086,CornerLongitudePoint3:10087,CornerLatitudePoint4:10088,CornerLongitudePoint4:10089,SARMotionImageryMetadata:10095,SecurityClassification:20001,SecurityClassifyingAuthority:20002,SecurityClassifyingCountry:20003,SecuritySCI:20004,SecurityCaveats:20005,SecurityReleaseInstructions:20006,SecurityLDSVersion:20022,EsriVideoWidth:90001,EsriVideoHeight:90002,EsriFrameCenterLatitude:90050,EsriFrameCenterLongitude:90051,EsriCornerLatitudePt1:90052,EsriCornerLongitudePt1:90053,EsriCornerLatitudePt2:90054,EsriCornerLongitudePt2:90055,EsriCornerLatitudePt3:90056,EsriCornerLongitudePt3:90057,EsriCornerLatitudePt4:90058,EsriCornerLongitudePt4:90059,EsriFrameOutline:90060,EsriSensorPosition:90061,EsriHorizonPixelPack:90063,EsriGroundControlPoints:90064};function d(e,t=1e4){if(!e||!e.length)return[];let n=[],r=[];for(let t=0;t<e.length;t++){let r=e[t],i=r?.text?JSON.parse(r.text):null;i?.source===`EsriVideoServer`&&(n=[...i.data])}let i=n.find(e=>e.tagId===t);return Array.isArray(i?.value)&&(r=[...i.value]),r}function f(e){let{duration:t,end:n,start:r,timezone:i=`UTC`}=e||{};return[t,n,r].some(e=>typeof e!=`number`||e<0)?null:new o({duration:t||null,end:new Date(Number(n)),start:new Date(Number(r)),timezone:i})}function p(e,t,n){let r=e.clone();r.m=n;let i=t.findIndex(e=>e.m>=n),a=i===-1?[...t]:t.slice(0,i);return a.push(r),a}function m(e){if(!e?.size)return new a;let t=k(e),n=_(e),r=T(e),i=O(t,n);return new a({frameCenter:n,frameOutline:r,lineOfSight:i,sensorLocation:t})}function h(e){return e?.size?e.get(u.EsriGroundControlPoints)?.value??null??null:null}function g(e){return e?.size?e.get(u.EsriHorizonPixelPack)?.value??null:null}function _(e){return C(e)??w(e)}function v(e){if(!e)return l;let t=e.match(/\.(\w{3,4})(?:$|\?)/i);if(!t)return l;switch(t[1].toLowerCase()){case`mp4`:return`video/mp4`;case`webm`:return`video/webm`;default:return l}}function y(e){let t=e?.layers;return t?.length?t.map(e=>({layerId:e.id,posterUrl:e.poster,sourceType:e.serviceType,title:e.name,type:e.type||`Video Layer`})):[]}function b(e,t,n){if(!e)return null;let r=e.clone();switch(r.type){case`simple-fill`:c(r,n),r.outline.color=t;break;case`simple-line`:c(r,t);break;case`simple-marker`:c(r,t),r?.outline?.color&&(r.outline.color=t);break;case`cim`:s(r,t)}return r}function x(e){let{cameraAzimuth:t,platformHeading:n,source:r=null,symbolOffset:i=0}=e||{},a=0;if(!r)return a;a=r===`platformHeading`?n+i:n+t+i;let o=a>360?a-360:a;return Math.round(Math.abs(o))}function S(t,n,a){if(!n||n.length<3)return null;let o=[...n].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y),s=Array.from(new Set(o.map(e=>e.x))).sort((e,t)=>e-t),c=Array.from(new Set(o.map(e=>e.y))),l=-1;for(let e=s.length-2;e>=0;e--)if(t.x>=s[e]&&t.x<=s[e+1]){l=e;break}let u=-1;for(let e=c.length-2;e>=0;e--)if(t.y>=c[e]&&t.y<=c[e+1]){u=e;break}if(l<0||u<0||l>=s.length-1||u>=c.length-1)return null;let d=s[l],f=s[l+1],p=c[u],m=c[u+1],h=(e,t)=>{let r=n.find(n=>n.x===e&&n.y===t);if(!r)throw Error(`Control point not found for x: ${e}, y: ${t}`);return r},g=h(d,p),_=h(f,p),v=h(d,m),y=h(f,m),b=t.x,x=t.y,S,C;if(A(g.x,g.y,_.x,_.y,y.x,y.y,b,x)){let t=new e(g.lon,g.lat,r.WGS84),n=new e(_.lon,_.lat,r.WGS84),o=new e(y.lon,y.lat,r.WGS84),s=i(t,a),c=i(n,a),l=i(o,a);C=[g,_,y],S=[s,c,l]}else if(A(g.x,g.y,y.x,y.y,v.x,v.y,b,x)){let t=new e(g.lon,g.lat,r.WGS84),n=new e(y.lon,y.lat,r.WGS84),o=new e(v.lon,v.lat,r.WGS84),s=i(t,a),c=i(n,a),l=i(o,a);C=[g,y,v],S=[s,c,l]}else return null;let[w,T,E]=C,[D,O,k]=S,j=(T.y-E.y)*(w.x-E.x)+(E.x-T.x)*(w.y-E.y),M=((T.y-E.y)*(b-E.x)+(E.x-T.x)*(x-E.y))/j,N=((E.y-w.y)*(b-E.x)+(w.x-E.x)*(x-E.y))/j,P=1-M-N;return[M*D.x+N*O.x+P*k.x,M*D.y+N*O.y+P*k.y]}function C(t){return!t||!t.has(u.EsriFrameCenterLatitude)||!t.has(u.EsriFrameCenterLongitude)?null:new e({x:t.get(u.EsriFrameCenterLongitude).value,y:t.get(u.EsriFrameCenterLatitude).value,z:t.get(u.FrameCenterAboveEllipsoid)?.value??t.get(u.FrameCenterElevation)?.value})}function w(t){return!t||!t.has(u.FrameCenterLatitude)||!t.has(u.FrameCenterLongitude)?null:new e({x:t.get(u.FrameCenterLongitude)?.value,y:t.get(u.FrameCenterLatitude)?.value,z:t.get(u.FrameCenterElevation)?.value})}function T(e){if(!e)return null;let n=e.get(u.EsriFrameOutline)?.value;return n?t.fromJSON(n.geometry):E(e)??D(e)}function E(e){if(!e.has(u.EsriCornerLatitudePt1)||!e.has(u.EsriCornerLongitudePt1)||!e.has(u.EsriCornerLatitudePt2)||!e.has(u.EsriCornerLongitudePt2)||!e.has(u.EsriCornerLatitudePt3)||!e.has(u.EsriCornerLongitudePt3)||!e.has(u.EsriCornerLatitudePt4)||!e.has(u.EsriCornerLongitudePt4))return null;let n=[e.get(u.EsriCornerLongitudePt1)?.value,e.get(u.EsriCornerLatitudePt1)?.value],r=[e.get(u.EsriCornerLongitudePt2)?.value,e.get(u.EsriCornerLatitudePt2)?.value],i=[e.get(u.EsriCornerLongitudePt3)?.value,e.get(u.EsriCornerLatitudePt3)?.value],a=[e.get(u.EsriCornerLongitudePt4)?.value,e.get(u.EsriCornerLatitudePt4)?.value];return new t({rings:[[n,r,i,a]]})}function D(e){if(!e.has(u.OffsetCorner1Latitude)||!e.has(u.OffsetCorner1Longitude)||!e.has(u.OffsetCorner2Latitude)||!e.has(u.OffsetCorner2Longitude)||!e.has(u.OffsetCorner3Latitude)||!e.has(u.OffsetCorner3Longitude)||!e.has(u.OffsetCorner4Latitude)||!e.has(u.OffsetCorner4Longitude)||!e.has(u.FrameCenterLatitude)||!e.has(u.FrameCenterLongitude))return null;let n=e.get(u.FrameCenterLatitude)?.value,r=e.get(u.FrameCenterLongitude)?.value,i=n+e.get(u.OffsetCorner1Latitude)?.value,a=r+e.get(u.OffsetCorner1Longitude)?.value,o=n+e.get(u.OffsetCorner2Latitude)?.value,s=r+e.get(u.OffsetCorner2Longitude)?.value,c=n+e.get(u.OffsetCorner3Latitude)?.value,l=r+e.get(u.OffsetCorner3Longitude)?.value,d=n+e.get(u.OffsetCorner4Latitude)?.value,f=r+e.get(u.OffsetCorner4Longitude)?.value;return new t({rings:[[[a,i],[s,o],[l,c],[f,d]]]})}function O(e,t){if(!e||!t)return null;let r=[e.x,e.y,e.z??0],i=[t.x,t.y,t.z??0];return new n({hasZ:!0,hasM:!1,paths:[[r,i]]})}function k(t){if(!t?.size)return null;if(t.has(u.EsriSensorPosition)){let n=t.get(u.EsriSensorPosition)?.value;if(n)return e.fromJSON(n.geometry)}return t.has(u.SensorLongitude)&&t.has(u.SensorLatitude)?new e({x:t.get(u.SensorLongitude)?.value,y:t.get(u.SensorLatitude)?.value,z:t.get(u.SensorTrueAltitude)?.value}):null}function A(e,t,n,r,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}export{S as computeVideoToMapBaricentric,_ as getFrameCenter,g as getFrameHorizonPoints,h as getGroundControlPoints,O as getLineOfSight,p as getSensorTrailPoints,y as getServiceLayersInfo,b as getStyledTelemetrySymbol,x as getSymbolDisplayAngle,m as getTelemetryData,d as getVideoMetadataFromCueList,v as getVideoMimeType,f as readVideoTimeExtent,u as videoMetadataEntryId};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "6.0.0-next.33",
3
+ "version": "6.0.0-next.35",
4
4
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
5
5
  "keywords": [
6
6
  "ArcGIS",
@@ -20,9 +20,9 @@
20
20
  "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
22
  "@amcharts/amcharts5": "~5.21.5",
23
- "@arcgis/toolkit": "6.0.0-next.33",
24
- "@esri/arcgis-html-sanitizer": "~4.2.0-next.2",
25
- "@esri/calcite-components": "^5.2.0",
23
+ "@arcgis/toolkit": "6.0.0-next.35",
24
+ "@esri/arcgis-html-sanitizer": "~4.2.0",
25
+ "@esri/calcite-components": "^5.2.1",
26
26
  "@vaadin/grid": "~25.3.5",
27
27
  "@zip.js/zip.js": "~2.24.0",
28
28
  "luxon": "~3.7.2",
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{parseUrl as e}from"../utils.js";import{executeAttributeBinsQuery as t}from"./operations/queryAttributeBins.js";import n from"../support/AttributeBinsFeatureSet.js";import r from"../support/AttributeBinsQuery.js";async function i(i,a,o){let{data:s}=await t(e(i),r.from(a),o);return n.fromJSON(s)}export{i as executeAttributeBinsQuery};
2
+ import{parseUrl as e}from"../utils.js";import{executeAttributeBinsQuery as t}from"./operations/queryAttributeBins.js";import n from"../support/AttributeBinsFeatureSet.js";import r from"../support/AttributeBinsQuery.js";async function i(i,a,o,s){let{data:c}=await t(e(i),r.from(a),o,s);return n.fromJSON(c)}export{i as executeAttributeBinsQuery};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../geometry/Extent.js";import{parseUrl as t}from"../utils.js";import{executeQueryForExtent as n}from"./operations/query.js";import r from"../support/Query.js";async function i(i,a,o){let s=t(i),c=await n(s,r.from(a),{...o}),l=c.extent;return!l||isNaN(l.xmin)||isNaN(l.ymin)||isNaN(l.xmax)||isNaN(l.ymax)?{count:c.count,extent:null}:{count:c.count,extent:e.fromJSON(l)}}export{i as executeForExtent};
2
+ import e from"../../geometry/Extent.js";import{parseUrl as t}from"../utils.js";import{executeQueryForExtent as n}from"./operations/query.js";import r from"../support/Query.js";async function i(i,a,o,s){let c=t(i),l=await n(c,r.from(a),{...o},s),u=l.extent;return!u||isNaN(u.xmin)||isNaN(u.ymin)||isNaN(u.xmax)||isNaN(u.ymax)?{count:l.count,extent:null}:{count:l.count,extent:e.fromJSON(u)}}export{i as executeForExtent};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{parseUrl as e}from"../utils.js";import{executeQueryForTopCount as t}from"./operations/queryTopFeatures.js";import n from"../support/TopFeaturesQuery.js";async function r(r,i,a){let o=e(r);return(await t(o,n.from(i),{...a})).data.count}export{r as executeForTopCount};
2
+ import{parseUrl as e}from"../utils.js";import{executeQueryForTopCount as t}from"./operations/queryTopFeatures.js";import n from"../support/TopFeaturesQuery.js";async function r(r,i,a,o){let s=e(r);return(await t(s,n.from(i),{...a},o)).data.count}export{r as executeForTopCount};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../geometry/Extent.js";import{parseUrl as t}from"../utils.js";import{executeQueryForTopExtents as n}from"./operations/queryTopFeatures.js";import r from"../support/TopFeaturesQuery.js";async function i(i,a,o){let s=t(i),c=await n(s,r.from(a),{...o}),l=c.data.extent;return!l||isNaN(l.xmin)||isNaN(l.ymin)||isNaN(l.xmax)||isNaN(l.ymax)?{count:c.data.count,extent:null}:{count:c.data.count,extent:e.fromJSON(l)}}export{i as executeForTopExtents};
2
+ import e from"../../geometry/Extent.js";import{parseUrl as t}from"../utils.js";import{executeQueryForTopExtents as n}from"./operations/queryTopFeatures.js";import r from"../support/TopFeaturesQuery.js";async function i(i,a,o,s){let c=t(i),l=await n(c,r.from(a),{...o},s),u=l.data.extent;return!u||isNaN(u.xmin)||isNaN(u.ymin)||isNaN(u.xmax)||isNaN(u.ymax)?{count:l.data.count,extent:null}:{count:l.data.count,extent:e.fromJSON(u)}}export{i as executeForTopExtents};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{parseUrl as e}from"../utils.js";import{executeQueryForTopIds as t}from"./operations/queryTopFeatures.js";import n from"../support/TopFeaturesQuery.js";async function r(r,i,a){let o=e(r);return(await t(o,n.from(i),{...a})).data.objectIds}export{r as executeForTopIds};
2
+ import{parseUrl as e}from"../utils.js";import{executeQueryForTopIds as t}from"./operations/queryTopFeatures.js";import n from"../support/TopFeaturesQuery.js";async function r(r,i,a,o){let s=e(r);return(await t(s,n.from(i),{...a},o)).data.objectIds}export{r as executeForTopIds};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{parseUrl as e}from"../utils.js";import{executeTopFeaturesQuery as t}from"./operations/queryTopFeatures.js";import n from"../support/FeatureSet.js";import r from"../support/TopFeaturesQuery.js";async function i(i,a,o,s){let c=e(i),l={...s},{data:u}=await t(c,r.from(a),o,l);return n.fromJSON(u)}export{i as executeTopFeaturesQuery};
2
+ import{parseUrl as e}from"../utils.js";import{executeTopFeaturesQuery as t}from"./operations/queryTopFeatures.js";import n from"../support/FeatureSet.js";import r from"../support/TopFeaturesQuery.js";async function i(i,a,o,s,c){let l=e(i),u={...s},{data:d}=await t(l,r.from(a),o,u,c);return n.fromJSON(d)}export{i as executeTopFeaturesQuery};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../request.js";import{urlToObject as t,join as n}from"../../../core/urlUtils.js";import{normalizeCentralMeridian as r}from"../../../geometry/support/normalizeUtils.js";import{mapParameters as i}from"../../operations/urlUtils.js";import{parsePBFFeatureQuery as a}from"./pbfQueryUtils.js";import{safeExtentResultFormat as o,queryLikeToQueryStringParameters as s}from"./queryUtils.js";import{applyFeatureSetZUnitScaling as c}from"./queryZScale.js";function l(e,t,n){return s(e,t,n)}async function u(e,t,n,r,i){let a=t.timeExtent?.isEmpty?{features:[]}:await _(e,t,`json`,r,void 0,i);return a.features??=[],c(t,n,a),a}async function d(e,t,n,r,i){if(t.timeExtent?.isEmpty)return n.featureSet;let o=await f(e,t,r,i);return a(o,n)}function f(e,t,n,r){return _(e,t,`pbf`,n,void 0,r)}function p(e,t,n,r){return t.timeExtent?.isEmpty?Promise.resolve({objectIds:[]}):_(e,t,`json`,n,{returnIdsOnly:!0},r)}async function m(e,t,n,r){return t.timeExtent?.isEmpty?0:(await _(e,t,`json`,n,{returnCountOnly:!0},r)).count}async function h(e,t,n){if(t.timeExtent?.isEmpty)return{count:0,extent:null};let r=await _(e,t,o,n,{returnExtentOnly:!0,returnCountOnly:!0});if(r.hasOwnProperty(`extent`))return r;let i=typeof e==`string`?e:e.path;if(/\/imageserver\/?$/i.test(i)&&r.hasOwnProperty(`count`)){let i=await _(e,t,o,n,{returnExtentOnly:!0});return{count:r.count,extent:i.extent}}if(r.features||r.hasOwnProperty(`count`))throw Error(`Layer does not support extent calculation.`);return r}function g(e,t){if(!e.returnIdsOnly||!t.uniqueIdFields)return e;let n={...e,returnUniqueIdsOnly:!0};return delete n.returnIdsOnly,n}async function _(t,n,r,i={},a={},o={}){let s=await v(t,n,r,i,a,o),c=r===`json`?`json`:`array-buffer`;return e(s.url,{responseType:c,...s.options}).then(({data:e})=>e)}async function v(e,a,o,s,c={},u={}){let d=typeof e==`string`?t(e):e,[f]=await r([a.geometry],s);if(f!=null){let e=a.clone();e.geometry=f.clone(),a=e}let p=i({...d.query,f:o,...g(c,u),...l(a,c,u)});return s={...s,query:{...p,...s.query}},new y(n(d.path,b(a,c)?`query3d`:`query`),s)}class y{constructor(e,t){this.url=e,this.options=t}}function b(e,t){return e.formatOf3DObjects!=null&&!(t.returnCountOnly||t.returnExtentOnly||t.returnIdsOnly)}export{y as RunQueryParameters,u as executeQuery,m as executeQueryForCount,h as executeQueryForExtent,p as executeQueryForIds,d as executeQueryPBF,f as executeQueryPBFBuffer,v as getQueryParameters,l as queryToQueryStringParameters,_ as runQuery};
2
+ import e from"../../../request.js";import{urlToObject as t,join as n}from"../../../core/urlUtils.js";import{normalizeCentralMeridian as r}from"../../../geometry/support/normalizeUtils.js";import{mapParameters as i}from"../../operations/urlUtils.js";import{parsePBFFeatureQuery as a}from"./pbfQueryUtils.js";import{safeExtentResultFormat as o,queryLikeToQueryStringParameters as s}from"./queryUtils.js";import{applyFeatureSetZUnitScaling as c}from"./queryZScale.js";function l(e,t,n){return s(e,t,n)}async function u(e,t,n,r,i){let a=t.timeExtent?.isEmpty?{features:[]}:await _(e,t,`json`,r,void 0,i);return a.features??=[],c(t,n,a),a}async function d(e,t,n,r,i){if(t.timeExtent?.isEmpty)return n.featureSet;let o=await f(e,t,r,i);return a(o,n)}function f(e,t,n,r){return _(e,t,`pbf`,n,void 0,r)}function p(e,t,n,r){return t.timeExtent?.isEmpty?Promise.resolve({objectIds:[]}):_(e,t,`json`,n,{returnIdsOnly:!0},r)}async function m(e,t,n,r){return t.timeExtent?.isEmpty?0:(await _(e,t,`json`,n,{returnCountOnly:!0},r)).count}async function h(e,t,n,r){if(t.timeExtent?.isEmpty)return{count:0,extent:null};let i=await _(e,t,o,n,{returnExtentOnly:!0,returnCountOnly:!0},r);if(i.hasOwnProperty(`extent`))return i;let a=typeof e==`string`?e:e.path;if(/\/imageserver\/?$/i.test(a)&&i.hasOwnProperty(`count`)){let a=await _(e,t,o,n,{returnExtentOnly:!0},r);return{count:i.count,extent:a.extent}}if(i.features||i.hasOwnProperty(`count`))throw Error(`Layer does not support extent calculation.`);return i}function g(e,t){if(!e.returnIdsOnly||!t.uniqueIdFields)return e;let n={...e,returnUniqueIdsOnly:!0};return delete n.returnIdsOnly,n}async function _(t,n,r,i={},a={},o={}){let s=await v(t,n,r,i,a,o),c=r===`json`?`json`:`array-buffer`;return e(s.url,{responseType:c,...s.options}).then(({data:e})=>e)}async function v(e,a,o,s,c={},u={}){let d=typeof e==`string`?t(e):e,[f]=await r([a.geometry],s);if(f!=null){let e=a.clone();e.geometry=f.clone(),a=e}let p=i({...d.query,f:o,...g(c,u),...l(a,c,u)});return s={...s,query:{...p,...s.query}},new y(n(d.path,b(a,c)?`query3d`:`query`),s)}class y{constructor(e,t){this.url=e,this.options=t}}function b(e,t){return e.formatOf3DObjects!=null&&!(t.returnCountOnly||t.returnExtentOnly||t.returnIdsOnly)}export{y as RunQueryParameters,u as executeQuery,m as executeQueryForCount,h as executeQueryForExtent,p as executeQueryForIds,d as executeQueryPBF,f as executeQueryPBFBuffer,v as getQueryParameters,l as queryToQueryStringParameters,_ as runQuery};