@arcgis/core 5.1.0-next.126 → 5.1.0-next.127

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 (265) hide show
  1. package/arcgisGlobal.d.ts +3 -3
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/02a94efda13d9b683272.js +1 -0
  4. package/assets/esri/core/workers/chunks/03354e9256b2f77fd4f2.js +1 -0
  5. package/assets/esri/core/workers/chunks/0803f022b5191171bc9c.js +1 -0
  6. package/assets/esri/core/workers/chunks/{ac33b10fe65f9e9e824f.js → 0acf8df4e9556d05136c.js} +1 -1
  7. package/assets/esri/core/workers/chunks/10605362b74cc63bd8a2.js +1 -0
  8. package/assets/esri/core/workers/chunks/{7c6f4104f5325ce0afbc.js → 1436e378d975345686aa.js} +1 -1
  9. package/assets/esri/core/workers/chunks/152f1c08197955224ad3.js +1 -0
  10. package/assets/esri/core/workers/chunks/1a0903b1d2d5101977c6.js +1 -0
  11. package/assets/esri/core/workers/chunks/1effde6a39ef0d4af525.js +1 -0
  12. package/assets/esri/core/workers/chunks/23d50c4478f40a7d62bf.js +1 -0
  13. package/assets/esri/core/workers/chunks/2623cd08487fdc9a94f1.js +1 -0
  14. package/assets/esri/core/workers/chunks/287f1441819c345f389e.js +1 -0
  15. package/assets/esri/core/workers/chunks/2c4f10eaf02ef090ee8f.js +1 -0
  16. package/assets/esri/core/workers/chunks/314bc1b356d43bfa72a8.js +1 -0
  17. package/assets/esri/core/workers/chunks/{81808c3aead7dfac3049.js → 38cfedce779dd75bd217.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{96e46424c3fb1dd9ce3b.js → 3a284a81d1fdfae2dc77.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{5bd7ee40a1c469c24013.js → 3bdef4b9f86711ae48b3.js} +2 -2
  20. package/assets/esri/core/workers/chunks/3d83ac791212b81c9d11.js +1 -0
  21. package/assets/esri/core/workers/chunks/3ecb906322a6a5c8c93b.js +1 -0
  22. package/assets/esri/core/workers/chunks/3f67162456a1f02190fa.js +1 -0
  23. package/assets/esri/core/workers/chunks/{ef46ef4f0ee9f2aeaa4a.js → 426b8e1e2eef2460851d.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{e25bcfdd8f20f8a08b19.js → 4d57c771af4137f74bfb.js} +1 -1
  25. package/assets/esri/core/workers/chunks/4e788fc6cb2ea936f676.js +1 -0
  26. package/assets/esri/core/workers/chunks/5282705a4b515d38ebde.js +1 -0
  27. package/assets/esri/core/workers/chunks/52afd43bbe23e358efb5.js +1 -0
  28. package/assets/esri/core/workers/chunks/53c8062f4573fa64c49d.js +1 -0
  29. package/assets/esri/core/workers/chunks/59a60fa09b19a0b2f473.js +1 -0
  30. package/assets/esri/core/workers/chunks/5aba23584e0b230c75f5.js +1 -0
  31. package/assets/esri/core/workers/chunks/6284eafe2c3b45a0e72a.js +1 -0
  32. package/assets/esri/core/workers/chunks/{77214e6081c1c28f1345.js → 640abe600fa069ed7640.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{d3c760109a70a71448c5.js → 67773a9f031d9f1d672f.js} +1 -1
  34. package/assets/esri/core/workers/chunks/6f7193b9ff5942c0d354.js +1 -0
  35. package/assets/esri/core/workers/chunks/70737052bab29fcaa120.js +1 -0
  36. package/assets/esri/core/workers/chunks/{b606af35a4fb893b762c.js → 71a48f597fda322ea56f.js} +1 -1
  37. package/assets/esri/core/workers/chunks/71c996e1ae84d9daddf2.js +1 -0
  38. package/assets/esri/core/workers/chunks/753e0b21e57c12c742ee.js +1 -0
  39. package/assets/esri/core/workers/chunks/764c8ba14ab74b66b391.js +1 -0
  40. package/assets/esri/core/workers/chunks/{cc697c4d9cdc116373dc.js → 81726d997a2d34449bb2.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{74e1826ad9e2c4fd3b42.js → 81883bca8a79ee2ddb00.js} +1 -1
  42. package/assets/esri/core/workers/chunks/8486ef6c7076baf0348b.js +1 -0
  43. package/assets/esri/core/workers/chunks/85505a8b8b0794656d06.js +1 -0
  44. package/assets/esri/core/workers/chunks/{8407c91cce31e087b41b.js → 886ae23a1d8fa21e531f.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{3ff7aa216cd794d951e8.js → 8e99f937fd36cf2cd05f.js} +1 -1
  46. package/assets/esri/core/workers/chunks/93d08d82ceab19e314f8.js +1 -0
  47. package/assets/esri/core/workers/chunks/972ba277a27704d28357.js +1 -0
  48. package/assets/esri/core/workers/chunks/97a654e8054302582a3b.js +1 -0
  49. package/assets/esri/core/workers/chunks/97d2bdbea39cbcf8fd0f.js +1 -0
  50. package/assets/esri/core/workers/chunks/a0208e35b217808777c4.js +1 -0
  51. package/assets/esri/core/workers/chunks/a2d7e8147dee6642029a.js +2 -0
  52. package/assets/esri/core/workers/chunks/a9003fe5975cd554ba24.js +1 -0
  53. package/assets/esri/core/workers/chunks/aa02458ceb839b555ee1.js +1 -0
  54. package/assets/esri/core/workers/chunks/aa5f36d7ed59c625ba78.js +1 -0
  55. package/assets/esri/core/workers/chunks/b045bffb4f2eb9203183.js +1 -0
  56. package/assets/esri/core/workers/chunks/b3c8aa11ae7f63cb6d74.js +1 -0
  57. package/assets/esri/core/workers/chunks/b590402170ae289290d7.js +1 -0
  58. package/assets/esri/core/workers/chunks/{100130a80bc151f2e493.js → b7e363c14919698f5b65.js} +1 -1
  59. package/assets/esri/core/workers/chunks/b9935cc8e2bd4045058a.js +1 -0
  60. package/assets/esri/core/workers/chunks/{1a527c0740d9f4fa0791.js → bc547cf814d6703cef59.js} +1 -1
  61. package/assets/esri/core/workers/chunks/bf6ae205fbfbfcd1a0ee.js +1 -0
  62. package/assets/esri/core/workers/chunks/bfd1aef8ac795e1ce227.js +1 -0
  63. package/assets/esri/core/workers/chunks/c148ad0ea9258046ac1f.js +1 -0
  64. package/assets/esri/core/workers/chunks/{0f75c19d8e296a32e329.js → c2cd80b712f29e8cbb8d.js} +1 -1
  65. package/assets/esri/core/workers/chunks/c32430e99e8cd6e5f688.js +1 -0
  66. package/assets/esri/core/workers/chunks/{58a7cdebc3d182c15ec6.js → ca8c08659d82019d775d.js} +1 -1
  67. package/assets/esri/core/workers/chunks/cc0efa716b8414a44398.js +1 -0
  68. package/assets/esri/core/workers/chunks/{8f6833671c071b522923.js → cd66bd30f654fe571e57.js} +1 -1
  69. package/assets/esri/core/workers/chunks/cf41a66fb97c1076fb34.js +1 -0
  70. package/assets/esri/core/workers/chunks/cf8ce21dc649021e97f6.js +1 -0
  71. package/assets/esri/core/workers/chunks/d3be4d914fc99a1d686c.js +1 -0
  72. package/assets/esri/core/workers/chunks/{6675d56f49d07a97dc40.js → dd0c1cf921369e2bc48b.js} +1 -1
  73. package/assets/esri/core/workers/chunks/df18b0a653b328d8d052.js +1 -0
  74. package/assets/esri/core/workers/chunks/{1996f0a930abdd97b855.js → e16710ef178d64606a55.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{1c16f3db1c98da8730b9.js → e5ef06c205d34df1e4bc.js} +1 -1
  76. package/assets/esri/core/workers/chunks/e656fd5ecf9ac059a87b.js +1 -0
  77. package/assets/esri/core/workers/chunks/{7a474ce61cf484df87b4.js → e80376832050a4b6d28a.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{00da56b977a7c61b5c94.js → f0556a695d080454b8da.js} +1 -1
  79. package/assets/esri/core/workers/chunks/f116331c6eca937aac8e.js +1 -0
  80. package/assets/esri/core/workers/chunks/{3b837b512999e6ab24bc.js → f148666308071bdb185a.js} +1 -1
  81. package/assets/esri/core/workers/chunks/f23e995320674b32e142.js +1 -0
  82. package/assets/esri/core/workers/chunks/{893c0d28a5bf3f9f29f1.js → f93facf47aba9b128fcc.js} +1 -1
  83. package/assets/esri/core/workers/chunks/fa1336b60278017d2525.js +1 -0
  84. package/assets/esri/core/workers/chunks/{c911f0b5bdd43b66b731.js → fa3faec65882c5b6f1a0.js} +1 -1
  85. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  86. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  87. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +5 -1
  88. package/assets/esri/themes/dark/main.css +1 -1
  89. package/assets/esri/themes/light/main.css +1 -1
  90. package/assets/esri/themes/light/view.css +1 -1
  91. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  92. package/chunks/arcgis-knowledge-client-core.js +1 -1
  93. package/config.js +1 -1
  94. package/core/promiseUtils.d.ts +1 -1
  95. package/core/promiseUtils.js +1 -1
  96. package/core/units.js +1 -1
  97. package/form/types.d.ts +1 -1
  98. package/geometry/Mesh.d.ts +220 -95
  99. package/geometry/operators/support/projectionZScaling.js +1 -1
  100. package/geometry/support/MeshGeoreferencedVertexSpace.d.ts +35 -13
  101. package/geometry/support/MeshLocalVertexSpace.d.ts +32 -8
  102. package/geometry/support/MeshVertexAttributes.d.ts +6 -2
  103. package/geometry/support/heightModelInfoUtils.js +1 -1
  104. package/geometry/support/zscale.js +1 -1
  105. package/graphic/{AnnotationGraphicOrigin.d.ts → AnnotationFeatureGraphicOrigin.d.ts} +9 -9
  106. package/graphic/{AnnotationGraphicOrigin.js → AnnotationFeatureGraphicOrigin.js} +1 -1
  107. package/interfaces.d.ts +3 -3
  108. package/kernel.js +1 -1
  109. package/layers/{AnnotationLayer.d.ts → AnnotationFeatureLayer.d.ts} +24 -24
  110. package/layers/AnnotationFeatureLayer.js +2 -0
  111. package/layers/GaussianSplatLayer.d.ts +4 -1
  112. package/layers/graphics/data/queryUtils.js +1 -1
  113. package/layers/save/featureLayerUtils.js +1 -1
  114. package/layers/support/AnnotationSublayer.d.ts +7 -7
  115. package/layers/support/arcgisLayers.js +1 -1
  116. package/layers/support/fetchService.js +1 -1
  117. package/layers/support/layerUtils.js +1 -1
  118. package/layers/support/layersLoader.js +1 -1
  119. package/layers/support/schemaValidator.js +1 -1
  120. package/layers/types.d.ts +1 -1
  121. package/networks/support/networkFieldUtils.js +1 -1
  122. package/package.json +2 -2
  123. package/portal/schemas/definitions.js +1 -1
  124. package/portal/schemas/gaussianSplatLayerItem.js +2 -0
  125. package/portal/schemas/integratedMesh3DTilesLayerItem.js +1 -1
  126. package/portal/support/loadUtils.js +1 -1
  127. package/rest/knowledgeGraph/ReplicaDefinition.d.ts +0 -2
  128. package/rest/knowledgeGraph/wasmInterface/replicaToWasmEncodedFactories.js +1 -1
  129. package/rest/knowledgeGraph/wasmInterface/wasmToReplicaFactories.js +1 -1
  130. package/rest/knowledgeGraphService.js +1 -1
  131. package/rest/support/AttributeBinsQuery.js +1 -1
  132. package/rest/support/Query.js +1 -1
  133. package/rest/support/TopFeaturesQuery.js +1 -1
  134. package/support/revision.js +1 -1
  135. package/views/2d/engine/webgl/TextureManager.js +1 -1
  136. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  137. package/views/2d/engine/webgl/util/createMatcher.js +1 -1
  138. package/views/2d/layerViewModuleImportUtils.js +1 -1
  139. package/views/2d/layers/AnnotationFeatureLayerView2D.js +2 -0
  140. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  141. package/views/2d/layers/TileLayerView2D.js +1 -1
  142. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  143. package/views/2d/layers/support/annodime/annotationSchema.js +1 -1
  144. package/views/2d/types.d.ts +2 -2
  145. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  146. package/views/3d/layerViewModuleImportUtils.js +1 -1
  147. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  148. package/views/3d/terrain/Tile.js +1 -1
  149. package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
  150. package/views/3d/types.d.ts +1 -1
  151. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +7 -7
  152. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +29 -20
  153. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TexelFormatInfo.js +2 -0
  154. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
  155. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
  156. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
  157. package/views/layers/{AnnotationLayerView.d.ts → AnnotationFeatureLayerView.d.ts} +6 -6
  158. package/views/layers/FeatureLikeLayerView.d.ts +2 -2
  159. package/views/layers/FeatureLikeLayerView.js +1 -1
  160. package/webdoc/widgets/FloorFilter.d.ts +14 -1
  161. package/webdoc/widgets/FloorFilter.js +1 -1
  162. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  163. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +12 -4
  164. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  165. package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
  166. package/widgets/BatchAttributeForm/ValueChangeTransaction.js +2 -0
  167. package/widgets/BatchAttributeForm/VisibleElements.d.ts +8 -1
  168. package/widgets/BatchAttributeForm/VisibleElements.js +1 -1
  169. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  170. package/widgets/BatchAttributeForm/css.js +1 -1
  171. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  172. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  173. package/widgets/BatchAttributeForm/inputs/BatchFormInputs.d.ts +3 -0
  174. package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
  175. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  176. package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
  177. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  178. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
  179. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  180. package/widgets/BatchAttributeForm/interfaceUtils.js +1 -1
  181. package/widgets/BatchAttributeForm/stringUtils.js +2 -0
  182. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  183. package/widgets/BatchAttributeForm/types.d.ts +19 -3
  184. package/widgets/BatchAttributeForm.js +1 -1
  185. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  186. package/widgets/Editor/AddAssociationWorkflowData.js +1 -1
  187. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  188. package/widgets/Editor/EditorViewModel.d.ts +1 -1
  189. package/widgets/Editor/EditorViewModel.js +1 -1
  190. package/widgets/Editor/MergeFeaturesWorkflow.d.ts +3 -3
  191. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  192. package/widgets/Editor/SplitFeatureWorkflow.d.ts +3 -3
  193. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  194. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  195. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  196. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  197. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  198. package/widgets/Editor/UpdateWorkflow.js +1 -1
  199. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  200. package/widgets/Editor/support/SketchController.js +1 -1
  201. package/widgets/Editor/workflowUtils.js +1 -1
  202. package/widgets/Editor.js +1 -1
  203. package/widgets/FloorFilter/FloorFilterViewModel.d.ts +10 -0
  204. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  205. package/assets/esri/core/workers/chunks/034a5c55ceeb1f85ccba.js +0 -1
  206. package/assets/esri/core/workers/chunks/160e5b99f1097a473e6b.js +0 -1
  207. package/assets/esri/core/workers/chunks/17e68828ca6ff6912d3e.js +0 -1
  208. package/assets/esri/core/workers/chunks/184d896fe66340129acd.js +0 -1
  209. package/assets/esri/core/workers/chunks/1e340536d3c5f94920b5.js +0 -1
  210. package/assets/esri/core/workers/chunks/24810c36ae09bb4e83dc.js +0 -1
  211. package/assets/esri/core/workers/chunks/274b82cb183ddd0042f3.js +0 -1
  212. package/assets/esri/core/workers/chunks/297ae764445e6f73a5ea.js +0 -1
  213. package/assets/esri/core/workers/chunks/29aba121db7f00e0cf81.js +0 -1
  214. package/assets/esri/core/workers/chunks/2a3145a595d19391bb8a.js +0 -1
  215. package/assets/esri/core/workers/chunks/3297658ccd8d4b9ce733.js +0 -1
  216. package/assets/esri/core/workers/chunks/38ca59db0e8f45bd7811.js +0 -1
  217. package/assets/esri/core/workers/chunks/3c5534c576528c1921d2.js +0 -1
  218. package/assets/esri/core/workers/chunks/41f12eb7c9b7086528d5.js +0 -1
  219. package/assets/esri/core/workers/chunks/426156137f279d979ddd.js +0 -1
  220. package/assets/esri/core/workers/chunks/47f65ffcf23713f0fd5c.js +0 -1
  221. package/assets/esri/core/workers/chunks/538537f9bc866d9caa75.js +0 -1
  222. package/assets/esri/core/workers/chunks/5c7aff9604b4576a0e1d.js +0 -1
  223. package/assets/esri/core/workers/chunks/5d3ddbf94539cb4f493e.js +0 -1
  224. package/assets/esri/core/workers/chunks/5eb9fdb076488de9cd83.js +0 -1
  225. package/assets/esri/core/workers/chunks/603177137eb680afe371.js +0 -1
  226. package/assets/esri/core/workers/chunks/629099f05ca5c9ca1973.js +0 -1
  227. package/assets/esri/core/workers/chunks/62f78fa455d556008f6a.js +0 -1
  228. package/assets/esri/core/workers/chunks/661f7e3f88727dc4801c.js +0 -1
  229. package/assets/esri/core/workers/chunks/686c51fd2144e132783e.js +0 -1
  230. package/assets/esri/core/workers/chunks/6f0341cfa4c68e6e60b3.js +0 -1
  231. package/assets/esri/core/workers/chunks/728ad5bbbcbf88d6249f.js +0 -1
  232. package/assets/esri/core/workers/chunks/7e89cb9ff615742e0894.js +0 -1
  233. package/assets/esri/core/workers/chunks/890b7a1153b7f65eba9a.js +0 -1
  234. package/assets/esri/core/workers/chunks/985fceacd6ec137bd490.js +0 -1
  235. package/assets/esri/core/workers/chunks/a4245bd4e67a428fd835.js +0 -1
  236. package/assets/esri/core/workers/chunks/b002304a45856b024b46.js +0 -1
  237. package/assets/esri/core/workers/chunks/b5937ce657c1fff3864f.js +0 -1
  238. package/assets/esri/core/workers/chunks/c3cf9e6e91f71c9cc5f3.js +0 -1
  239. package/assets/esri/core/workers/chunks/c755bfd90c9654170e67.js +0 -1
  240. package/assets/esri/core/workers/chunks/c9fefb6316c51cbdc61f.js +0 -1
  241. package/assets/esri/core/workers/chunks/cc3e895cff019e811c07.js +0 -1
  242. package/assets/esri/core/workers/chunks/d122431f3b0b88dcb488.js +0 -1
  243. package/assets/esri/core/workers/chunks/d24e027bb8b2c09f25c8.js +0 -1
  244. package/assets/esri/core/workers/chunks/d2df8c328054dc6cb7b7.js +0 -1
  245. package/assets/esri/core/workers/chunks/d468994822f9bc3d6279.js +0 -1
  246. package/assets/esri/core/workers/chunks/d63f532dd7d60ee8ef2c.js +0 -1
  247. package/assets/esri/core/workers/chunks/d64613209a9eb1eafb11.js +0 -1
  248. package/assets/esri/core/workers/chunks/d7be278aed1fb37ad5ec.js +0 -1
  249. package/assets/esri/core/workers/chunks/d8ec0afb2b91ccf32e55.js +0 -1
  250. package/assets/esri/core/workers/chunks/da1e8b338ab9fe9e0a8e.js +0 -1
  251. package/assets/esri/core/workers/chunks/e279bcbe4f10e87bde6c.js +0 -1
  252. package/assets/esri/core/workers/chunks/e2de13810dce01b98520.js +0 -1
  253. package/assets/esri/core/workers/chunks/e5837e5ac6ef761f26a2.js +0 -1
  254. package/assets/esri/core/workers/chunks/e82488b9b3bb0c1dedb4.js +0 -1
  255. package/assets/esri/core/workers/chunks/f274a8e8c7ca4294e876.js +0 -1
  256. package/assets/esri/core/workers/chunks/f4f642ddd4d5db7cbbb4.js +0 -1
  257. package/assets/esri/core/workers/chunks/f6d047358d14328f3622.js +0 -1
  258. package/assets/esri/core/workers/chunks/f80613cce68dc3df8303.js +0 -2
  259. package/assets/esri/core/workers/chunks/fb6605be0c5e36785543.js +0 -1
  260. package/assets/esri/core/workers/chunks/fd70a25ffdf2cc6c5be2.js +0 -1
  261. package/layers/AnnotationLayer.js +0 -2
  262. package/views/2d/layers/AnnotationLayerView2D.js +0 -2
  263. /package/assets/esri/core/workers/chunks/{5bd7ee40a1c469c24013.js.LICENSE.txt → 3bdef4b9f86711ae48b3.js.LICENSE.txt} +0 -0
  264. /package/assets/esri/core/workers/chunks/{f80613cce68dc3df8303.js.LICENSE.txt → a2d7e8147dee6642029a.js.LICENSE.txt} +0 -0
  265. /package/views/layers/{AnnotationLayerView.js → AnnotationFeatureLayerView.js} +0 -0
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{schema_definitions as e}from"./definitions.js";const i={title:"Gaussian Splat Layer config on layer item",type:"object",properties:{customParameters:{$ref:"#/definitions/customParameters_schema.json"},layerDefinition:{type:"object",description:"A layerDefinition object defining the attribute schema and drawing information for the layer.",allOf:[{$ref:"#/definitions/layerDefinition_schema.json"},{properties:{elevationInfo:{},maxScale:{},minScale:{}},additionalProperties:!1}]},listMode:{type:"string",description:"To show or hide layers in the layer list",enum:["hide","show"],default:"show"},visibility:{type:"boolean",description:"Boolean property determining whether the layer is initially visible in the web scene.",default:!0},visibilityTimeExtent:{description:"Represents time extent that will control when a layer should be visible based on webscene's current time. Visibility time extent only affects the layer visibility and will not filter the data.",$ref:"#/definitions/timeExtent_schema.json"}},additionalProperties:!1,$schema:"http://json-schema.org/draft-07/schema",definitions:e};export{i as json};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{schema_definitions as e}from"./definitions.js";const i={title:"Integrated Mesh 3D Tiles Layer config on layer item",type:"object",properties:{layers:{type:"array",items:{properties:{customParameters:{$ref:"#/definitions/customParameters_schema.json"},id:{type:"integer",description:"ID of the service layer."},layerDefinition:{type:"object",description:"A layerDefinition object defining the attribute schema and drawing information for the layer.",allOf:[{$ref:"#/definitions/layerDefinition_schema.json"},{properties:{elevationInfo:{},maxScale:{},minScale:{}},additionalProperties:!1}]},listMode:{type:"string",description:"To show or hide layers in the layer list",enum:["hide","show"],default:"show"},modifications:{type:"string",description:"URL to modifications json file, typically stored in `ITEM/resources`. Content of the file follows the $ref:[Modifications schema](modifications_schema.json)."},opacity:{type:"number",description:"The degree of transparency applied to the layer on the client side, where 0 is full transparency and 1 is no transparency.",minimum:0,maximum:1,default:1},visibility:{type:"boolean",description:"Boolean property determining whether the layer is initially visible in the web scene.",default:!0},visibilityTimeExtent:{description:"Represents time extent that will control when a layer should be visible based on webscene's current time. Visibility time extent only affects the layer visibility and will not filter the data.",$ref:"#/definitions/timeExtent_schema.json"}},additionalProperties:!1}}},additionalProperties:!1,$schema:"http://json-schema.org/draft-07/schema",definitions:e};export{i as json};
2
+ import{schema_definitions as e}from"./definitions.js";const i={title:"Integrated Mesh 3D Tiles Layer config on layer item",type:"object",properties:{customParameters:{$ref:"#/definitions/customParameters_schema.json"},layerDefinition:{type:"object",description:"A layerDefinition object defining the attribute schema and drawing information for the layer.",allOf:[{$ref:"#/definitions/layerDefinition_schema.json"},{properties:{elevationInfo:{},maxScale:{},minScale:{}},additionalProperties:!1}]},listMode:{type:"string",description:"To show or hide layers in the layer list",enum:["hide","show"],default:"show"},modifications:{type:"string",description:"URL to modifications json file, typically stored in `ITEM/resources`. Content of the file follows the $ref:[Modifications schema](modifications_schema.json)."},opacity:{type:"number",description:"The degree of transparency applied to the layer on the client side, where 0 is full transparency and 1 is no transparency.",minimum:0,maximum:1,default:1},visibility:{type:"boolean",description:"Boolean property determining whether the layer is initially visible in the web scene.",default:!0},visibilityTimeExtent:{description:"Represents time extent that will control when a layer should be visible based on webscene's current time. Visibility time extent only affects the layer visibility and will not filter the data.",$ref:"#/definitions/timeExtent_schema.json"}},additionalProperties:!1,$schema:"http://json-schema.org/draft-07/schema",definitions:e};export{i as json};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{findAssociatedFeatureService as e}from"../../layers/support/associatedFeatureServiceUtils.js";import{getFeatureServiceItemLayerType as r}from"../../layers/support/fetchService.js";import{getPreferredHost as t}from"../../layers/support/layerUtils.js";function a(e){const t={id:e.id,name:e.name},a=r(e.type);return a&&(t.layerType=a),t}async function n(e,r,n){let l;if(null==e?.layers||null==e?.tables){const u=await n.fetchServiceMetadata(r,{customParameters:s(e)?.customParameters});l=t(),(e=e||{}).layers=e.layers||u?.layers?.map(a),e.tables=e.tables||u?.tables?.map(a)}return{data:e,preferredHost:l}}function s(e){if(!e)return null;const{layers:r,tables:t}=e;return r?.length?r[0]:t?.length?t[0]:null}function l(e,r){if(null==r)return null;return[...e.layers||[],...e.tables||[]].find(e=>e.id===r)}function u(e,r){return[...e.layers||[],...e.tables||[]].filter(({layerType:e})=>e?r.includes(e):r.includes("ArcGISFeatureLayer"))}function c(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function o(e){switch(e){case"catalog":return["CatalogLayer"];case"feature":return["ArcGISFeatureLayer"];case"oriented-imagery":return["OrientedImageryLayer"];case"subtype-group":return["SubtypeGroupLayer","SubtypeGroupTable"]}return null}function i(e){switch(e){case"ArcGISAnnotationLayer":return"AnnotationLayer";case"ArcGISDimensionLayer":return"DimensionFeatureLayer";case"CatalogLayer":return"CatalogLayer";case"OrientedImageryLayer":return"OrientedImageryLayer";case"SubtypeGroupLayer":case"SubtypeGroupTable":return"SubtypeGroupLayer"}return"FeatureLayer"}async function y(r,t,n){if(!r?.url)return t??{};if(t??={},!t.layers){const e=await n.fetchServiceMetadata(r.url);t.layers=e.layers?.map(a)}const{serverUrl:l,portalItem:u}=await e(r.url,{sceneLayerItem:r,customParameters:s(t)?.customParameters}).catch(()=>({serverUrl:null,portalItem:null}));if(null==l)return t.tables=[],t;if(!t.tables&&u){const e=await u.fetchData().catch(()=>null);if(e?.tables)t.tables=e.tables.map(a);else{const r=await n.fetchServiceMetadata(l,{customParameters:s(e)?.customParameters}).catch(()=>null);t.tables=r?.tables?.map(a)}}if(t.tables)for(const e of t.tables)e.url=`${l}/${e.id}`;return t}export{a as createSublayerData,s as getFirstLayerOrTable,l as getLayerOrTable,c as getNumLayersAndTables,u as getSublayersByLayerType,o as instanceTypeToLayerTypes,i as layerTypeToLayerModuleType,y as populateSceneServiceItemData,n as preprocessFSItemData};
2
+ import{findAssociatedFeatureService as e}from"../../layers/support/associatedFeatureServiceUtils.js";import{getFeatureServiceItemLayerType as r}from"../../layers/support/fetchService.js";import{getPreferredHost as t}from"../../layers/support/layerUtils.js";function a(e){const t={id:e.id,name:e.name},a=r(e.type);return a&&(t.layerType=a),t}async function n(e,r,n){let l;if(null==e?.layers||null==e?.tables){const u=await n.fetchServiceMetadata(r,{customParameters:s(e)?.customParameters});l=t(),(e=e||{}).layers=e.layers||u?.layers?.map(a),e.tables=e.tables||u?.tables?.map(a)}return{data:e,preferredHost:l}}function s(e){if(!e)return null;const{layers:r,tables:t}=e;return r?.length?r[0]:t?.length?t[0]:null}function l(e,r){if(null==r)return null;return[...e.layers||[],...e.tables||[]].find(e=>e.id===r)}function u(e,r){return[...e.layers||[],...e.tables||[]].filter(({layerType:e})=>e?r.includes(e):r.includes("ArcGISFeatureLayer"))}function c(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function o(e){switch(e){case"catalog":return["CatalogLayer"];case"feature":return["ArcGISFeatureLayer"];case"oriented-imagery":return["OrientedImageryLayer"];case"subtype-group":return["SubtypeGroupLayer","SubtypeGroupTable"]}return null}function i(e){switch(e){case"ArcGISAnnotationLayer":return"AnnotationFeatureLayer";case"ArcGISDimensionLayer":return"DimensionFeatureLayer";case"CatalogLayer":return"CatalogLayer";case"OrientedImageryLayer":return"OrientedImageryLayer";case"SubtypeGroupLayer":case"SubtypeGroupTable":return"SubtypeGroupLayer"}return"FeatureLayer"}async function y(r,t,n){if(!r?.url)return t??{};if(t??={},!t.layers){const e=await n.fetchServiceMetadata(r.url);t.layers=e.layers?.map(a)}const{serverUrl:l,portalItem:u}=await e(r.url,{sceneLayerItem:r,customParameters:s(t)?.customParameters}).catch(()=>({serverUrl:null,portalItem:null}));if(null==l)return t.tables=[],t;if(!t.tables&&u){const e=await u.fetchData().catch(()=>null);if(e?.tables)t.tables=e.tables.map(a);else{const r=await n.fetchServiceMetadata(l,{customParameters:s(e)?.customParameters}).catch(()=>null);t.tables=r?.tables?.map(a)}}if(t.tables)for(const e of t.tables)e.url=`${l}/${e.id}`;return t}export{a as createSublayerData,s as getFirstLayerOrTable,l as getLayerOrTable,c as getNumLayersAndTables,u as getSublayersByLayerType,o as instanceTypeToLayerTypes,i as layerTypeToLayerModuleType,y as populateSceneServiceItemData,n as preprocessFSItemData};
@@ -27,8 +27,6 @@ export default class ReplicaDefinition extends Accessor {
27
27
 
28
28
  export interface ReplicaReference {}
29
29
 
30
- export interface ReplicaTransform {}
31
-
32
30
  export type ReplicaProvenanceOptions = {
33
31
  includeProvenance: true;
34
32
  includeSourceDocuments?: boolean;
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../core/Error.js";import{convertRecursiveBindParam as n}from"./queryToWasmEncodedFactories.js";import{WasmQuantizeOriginPositionTypeCode as t}from"./WasmSerializedLayerData.js";function r(e,n){const t=new n.UnregisterReplicaRequestEncoder;if(t.deleteLater(),e.unregisterAll)t.set_unregister_all();else{const{replicaIds:n=[]}=e;n.forEach(e=>t.add_replica_id(e))}return t}function i(e,n){const t=new n.CreateReplicaRequestEncoder;return t.deleteLater(),e.requestedReplicaId&&(t.replica_id=e.requestedReplicaId),e.requestedReplicaName&&(t.requested_replica_name=e.requestedReplicaName),t.sync_direction=w(e.syncDirection,n),t.sync_data_format=D(e.syncDataFormat,n),t.async=!1,"reference"===e.type&&(t.reference_replica=a(e.referenceReplica,n)),"filter"===e.type&&(t.replica_filters=c(e.replicaFilters,n)),t}function a(e,n){const t=new n.ReferenceReplica;return t.deleteLater(),t.replica_id=e.replicaId,t}function c(e,n){const t=s(e.staticDefinition,n),r=new n.ReplicaFilters(t);return r.deleteLater(),e.transform&&(r.transform=o(e.transform)),e.inputSpatialReference&&(r.input_spatial_reference=e.inputSpatialReference),r}function o(e){return{quantizeOriginPosition:{value:l(e?.quantizeOriginPosition)},scale:{xScale:e.scale.xScale,yScale:e.scale.yScale,mScale:e.scale.mScale,zScale:e.scale.zScale},translate:{xTranslate:e.translate.xTranslate,yTranslate:e.translate.yTranslate,mTranslate:e.translate.mTranslate,zTranslate:e.translate.zTranslate}}}function l(e){return"lower-left"===e?t.lowerLeft:t.upperLeft}function s(n,t){const r=new t.StaticDefinition;r.deleteLater();const i=n.entityTypeReplicaDefinitions??[],a=n.relationshipTypeReplicaDefinitions??[];if(i.length<1&&a.length<1)throw new e("knowledge-graph:replica-invalid-static-definition","A Filter Replica static definition must include at least one entity type or relationship type replica definition");for(const e of i)r.add_entity_type_replica_definition(p(e,t));for(const e of a)r.add_relationship_type_replica_definition(u(e,t));return r}function p(e,n){const t=new n.EntityTypeReplicaDefinition;return t.deleteLater(),d(e,n,t),e.documentOptions&&(t.document_options=f(e.documentOptions,n)),t}function u(e,n){const t=new n.RelationshipTypeReplicaDefinition;return t.deleteLater(),d(e,n,t),t}function d(e,t,r){if(r.type_name=e.typeName,r.open_cypher_where_clause=e.openCypherWhereClause??"",e.provenanceOptions&&(r.provenance_options=y(e.provenanceOptions,t)),e.parameters)for(const[i,a]of Object.entries(e.parameters))void 0!==a&&r.add_parameter(i,n(a,t));return r}function f(e,n){const t=e.includeConnectedDocuments?m(e,n):void 0,r=new n.DocumentOptions(t);return r.deleteLater(),r}function m(e,n){const t=y(e.includeDocumentProvenance?{includeProvenance:!0,includeSourceDocuments:e.includeDocumentSourceDocuments}:{includeProvenance:!1},n),r=new n.IncludeConnectedDocuments(t);return r.deleteLater(),r}function y(e,n){const t=_(e,n),r=new n.ProvenanceOptions(t);return r.deleteLater(),r}function _(e,n){const t=new n.IncludeProvenance("includeSourceDocuments"in e&&e.includeSourceDocuments);return t.deleteLater(),t}function w(n,t){const r=t.SyncDirection,i=n.toUpperCase(),a=r?.[i];if(!a)throw new e("knowledge-graph:replica-invalid-sync-direction",`Unsupported replica sync direction: ${n}`);return a}function D(n,t){const r=t.SyncDataFormat,i=n.toUpperCase(),a=r?.[i];if(!a)throw new e("knowledge-graph:replica-invalid-sync-data-format",`Unsupported replica sync data format: ${n}`);return a}export{f as documentOptionsToWasm,p as entityTypeReplicaDefinitionToWasm,m as includeConnectedDocumentsToWasm,_ as includeProvenanceToWasm,d as namedTypeReplicaDefinitionToWasm,y as provenanceOptionsToWasm,a as referenceReplicaToWasm,u as relationshipTypeReplicaDefinitionToWasm,c as replicaFiltersToWasm,r as replicaIdsToWasmUnregisterReplicaRequestEncoder,i as replicaToWasmCreateReplicaRequestEncoder,s as staticDefinitionToWasm,l as toWasmQuantizeOriginPosition,D as toWasmSyncDataFormatEnum,w as toWasmSyncDirectionEnum,o as transformToWasm};
2
+ import e from"../../../core/Error.js";import{convertRecursiveBindParam as n}from"./queryToWasmEncodedFactories.js";import{inputQuantizationParametersToWasmFormat as t}from"./updateToWasmEncodedFactories.js";function i(e,n){const t=new n.UnregisterReplicaRequestEncoder;if(t.deleteLater(),e.unregisterAll)t.set_unregister_all();else{const{replicaIds:n=[]}=e;n.forEach(e=>t.add_replica_id(e))}return t}function r(e,n){const t=new n.CreateReplicaRequestEncoder;return t.deleteLater(),e.requestedReplicaId&&(t.replica_id=e.requestedReplicaId),e.requestedReplicaName&&(t.requested_replica_name=e.requestedReplicaName),t.sync_direction=_(e.syncDirection,n),t.sync_data_format=y(e.syncDataFormat,n),t.async=!1,"reference"===e.type&&(t.reference_replica=c(e.referenceReplica,n)),"filter"===e.type&&(t.replica_filters=o(e.replicaFilters,n)),t}function c(e,n){const t=new n.ReferenceReplica;return t.deleteLater(),t.replica_id=e.replicaId,t}function o(e,n){const i=e.inputQuantizationParameters?t(e.inputQuantizationParameters):n.InputQuantizationUtil.WGS84_lossless(),r=a(e.staticDefinition,n),c=new n.ReplicaFilters(r);return c.deleteLater(),c.input_quantization_parameters=i,e.inputSpatialReference&&(c.input_spatial_reference=e.inputSpatialReference),c}function a(n,t){const i=new t.StaticDefinition;i.deleteLater();const r=n.entityTypeReplicaDefinitions??[],c=n.relationshipTypeReplicaDefinitions??[];if(r.length<1&&c.length<1)throw new e("knowledge-graph:replica-invalid-static-definition","A Filter Replica static definition must include at least one entity type or relationship type replica definition");for(const e of r)i.add_entity_type_replica_definition(p(e,t));for(const e of c)i.add_relationship_type_replica_definition(s(e,t));return i}function p(e,n){const t=new n.EntityTypeReplicaDefinition;return t.deleteLater(),l(e,n,t),e.documentOptions&&(t.document_options=u(e.documentOptions,n)),t}function s(e,n){const t=new n.RelationshipTypeReplicaDefinition;return t.deleteLater(),l(e,n,t),t}function l(e,t,i){if(i.type_name=e.typeName,i.open_cypher_where_clause=e.openCypherWhereClause??"",e.provenanceOptions&&(i.provenance_options=f(e.provenanceOptions,t)),e.parameters)for(const[r,c]of Object.entries(e.parameters))void 0!==c&&i.add_parameter(r,n(c,t));return i}function u(e,n){const t=e.includeConnectedDocuments?d(e,n):void 0,i=new n.DocumentOptions(t);return i.deleteLater(),i}function d(e,n){const t=f(e.includeDocumentProvenance?{includeProvenance:!0,includeSourceDocuments:e.includeDocumentSourceDocuments}:{includeProvenance:!1},n),i=new n.IncludeConnectedDocuments(t);return i.deleteLater(),i}function f(e,n){const t=m(e,n),i=new n.ProvenanceOptions(t);return i.deleteLater(),i}function m(e,n){const t=new n.IncludeProvenance("includeSourceDocuments"in e&&e.includeSourceDocuments);return t.deleteLater(),t}function _(n,t){const i=t.SyncDirection,r=n.toUpperCase(),c=i?.[r];if(!c)throw new e("knowledge-graph:replica-invalid-sync-direction",`Unsupported replica sync direction: ${n}`);return c}function y(n,t){const i=t.SyncDataFormat,r=n.toUpperCase(),c=i?.[r];if(!c)throw new e("knowledge-graph:replica-invalid-sync-data-format",`Unsupported replica sync data format: ${n}`);return c}export{u as documentOptionsToWasm,p as entityTypeReplicaDefinitionToWasm,d as includeConnectedDocumentsToWasm,m as includeProvenanceToWasm,l as namedTypeReplicaDefinitionToWasm,f as provenanceOptionsToWasm,c as referenceReplicaToWasm,s as relationshipTypeReplicaDefinitionToWasm,o as replicaFiltersToWasm,i as replicaIdsToWasmUnregisterReplicaRequestEncoder,r as replicaToWasmCreateReplicaRequestEncoder,a as staticDefinitionToWasm,y as toWasmSyncDataFormatEnum,_ as toWasmSyncDirectionEnum};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../core/Error.js";import t from"../../../geometry/SpatialReference.js";import n from"../CreateReplicaResponse.js";import r from"../ReplicaDefinition.js";import a from"../ReplicasInformationResponse.js";import c from"../UnregisterReplicaResponse.js";import{WasmQuantizeOriginPositionTypeCode as i}from"./WasmSerializedLayerData.js";import{wasmErrorToEsriError as o}from"./wasmUtils.js";function l(e){const t=new n;if(e.has_async_status_url()&&(t.asyncStatusUrl=e.get_async_status_url()),e.has_create_replica_result()){const n=e.get_create_replica_result();n.deleteLater(),t.createReplicaResult=p(n)}return t}function s(e){const t=[];for(let n=0;n<e.get_replicas_count();n++){const r=e.get_replica_info_at(n);r.deleteLater(),t.push(g(r))}return new a({replicas:t})}function u(e){const t=[];for(let n=0;n<e.get_unregister_replica_result_count();n++){const r=e.get_unregister_replica_result_at(n);r.deleteLater(),t.push(m(r))}return new c({decoderError:o(e.error)??null,unregisterReplicaResults:t})}function _(e,t){const n=e.get_replica_definition();n.deleteLater();const a=n.get_replica_filters();return a.deleteLater(),new r({replicaName:n.get_replica_name(),replicaId:n.get_replica_id(),replicaOwner:n.get_replica_owner(),lastSyncDate:P(n.get_last_sync_date()),creationDate:P(n.get_creation_date()),syncDirection:j(n.get_sync_direction(),t),replicaFilters:y(a)})}function p(e){return{errors:f(e.get_error_count(),e),warnings:d(e.get_warning_count(),e),replicaName:e.get_replica_name(),requestedReplicaName:e.get_requested_replica_name(),replicaId:e.get_replica_id(),syncDate:P(e.get_sync_date()),replicaDataFormat:I(e.get_replica_data_format()),replicaDataUrl:e.get_replica_data_url()}}function d(e,t){const n=[];for(let r=0;r<e;r++){const e=o(t.get_warning_at(r));e&&n.push(e)}return n}function f(e,t){const n=[];for(let r=0;r<e;r++){const e=o(t.get_error_at(r));e&&n.push(e)}return n}function g(e){return{replicaName:e.get_replica_name(),replicaId:e.get_replica_id(),lastSyncDate:P(e.get_last_sync_date())}}function m(e){return{replicaId:e.get_replica_id(),error:e.has_error()?o(e.get_error()):void 0}}function y(e){const n=e.get_static_definition();n.deleteLater();const r=h(n);return{transform:D(e.transform),inputSpatialReference:new t(e.input_spatial_reference),staticDefinition:r}}function D(e){return{quantizeOriginPosition:w(e.quantizeOriginPosition.value),scale:{xScale:e.scale.xScale,yScale:e.scale.yScale,mScale:e.scale.mScale,zScale:e.scale.zScale},translate:{xTranslate:e.translate.xTranslate,yTranslate:e.translate.yTranslate,mTranslate:e.translate.mTranslate,zTranslate:e.translate.zTranslate}}}function w(e){switch(e){case i.lowerLeft:return"lower-left";case i.upperLeft:default:return"upper-left"}}function h(e){const t=[],n=[];for(let r=0;r<e.get_entity_type_replica_definition_count();r++){const n=e.get_entity_type_replica_definition_at(r);n.deleteLater(),t.push(v(n))}for(let r=0;r<e.get_relationship_type_replica_definition_count();r++){const t=e.get_relationship_type_replica_definition_at(r);t.deleteLater(),n.push(S(t))}return{entityTypeReplicaDefinitions:t,relationshipTypeReplicaDefinitions:n}}function v(e){const t=e.document_options.get_include_connected_documents();return t?.deleteLater(),{...L(e),documentOptions:t?R(t):{includeConnectedDocuments:!1}}}function S(e){return L(e)}function L(e){const t=e.provenance_options;return t.deleteLater(),{typeName:e.type_name,openCypherWhereClause:e.open_cypher_where_clause,provenanceOptions:T(t)}}function R(e){const t=e.get_provenance_options();t.deleteLater();const n=T(t);return n.includeProvenance?{includeConnectedDocuments:!0,includeDocumentProvenance:!0,includeDocumentSourceDocuments:n.includeSourceDocuments}:{includeConnectedDocuments:!0,includeDocumentProvenance:!1}}function T(e){const t=e.get_include_provenance();return t?{includeProvenance:!0,includeSourceDocuments:O(t)}:{includeProvenance:!1}}function O(e){return e.get_include_source_documents()}function j(t,n){const r=t.value,a=n.SyncDirection;if(r===a.BIDIRECTIONAL.value)return"bidirectional";if(r===a.UPLOAD.value)return"upload";if(r===a.DOWNLOAD.value)return"download";throw new e("knowledge-graph:replica-invalid-sync-direction",`Unsupported replica sync direction value: ${r}`)}function I(t){switch(t.value){case 0:return;case 1:return"pbf";case 2:return"spbf";case 3:return"geoparquet";case 4:return"sqlite";default:throw new e("knowledge-graph:replica-invalid-sync-data-format",`Unsupported replica sync data format value: ${t.value}`)}}function P(e){return e?new Date(e):null}export{l as decoderToCreateReplicaResponse,_ as decoderToReplicaDefinition,s as decoderToReplicasInformationResponse,u as decoderToUnregisterReplicaResponse,f as getEsriErrors,d as getEsriWarnings,P as timestampToDate,w as toReplicaQuantizeOriginPosition,I as toReplicaSyncDataFormat,j as toReplicaSyncDirection,p as wasmCreateReplicaResultToCreateReplicaResult,v as wasmEntityTypeReplicaDefinitionToReplicaEntityTypeReplicaDefinition,R as wasmIncludeConnectedDocumentsToReplicaIncludeConnectedDocuments,O as wasmIncludeProvenanceToReplicaIncludeProvenance,L as wasmNamedTypeReplicaDefinitionToReplicaNamedTypeReplicaDefinition,T as wasmProvenanceOptionsToReplicaProvenanceOptions,S as wasmRelationshipTypeReplicaDefinitionToReplicaRelationshipTypeReplicaDefinition,y as wasmReplicaFiltersToReplicaFilters,g as wasmReplicaInfoToReplicaInformation,D as wasmReplicaTransformToReplicaTransform,h as wasmStaticDefinitionToReplicaStaticDefinition,m as wasmUnregisterReplicaResultToUnregisterReplicaResult};
2
+ import e from"../../../core/Error.js";import t from"../../../geometry/SpatialReference.js";import n from"../CreateReplicaResponse.js";import r from"../ReplicaDefinition.js";import i from"../ReplicasInformationResponse.js";import c from"../UnregisterReplicaResponse.js";import{decodedWasmObjToQueryResponseObj as a}from"./wasmToQueryResponseObjFactories.js";import{wasmErrorToEsriError as o}from"./wasmUtils.js";const u=new t({wkid:4326});function s(e){const t=new n;if(e.has_async_status_url()&&(t.asyncStatusUrl=e.get_async_status_url()),e.has_create_replica_result()){const n=e.get_create_replica_result();n.deleteLater(),t.createReplicaResult=d(n)}return t}function l(e){const t=[];for(let n=0;n<e.get_replicas_count();n++){const r=e.get_replica_info_at(n);r.deleteLater(),t.push(m(r))}return new i({replicas:t})}function _(e){const t=[];for(let n=0;n<e.get_unregister_replica_result_count();n++){const r=e.get_unregister_replica_result_at(n);r.deleteLater(),t.push(y(r))}return new c({decoderError:o(e.error)??null,unregisterReplicaResults:t})}function p(e,t,n){const i=e.get_replica_definition();i.deleteLater();const c=i.get_replica_filters();return c.deleteLater(),new r({replicaName:i.get_replica_name(),replicaId:i.get_replica_id(),replicaOwner:i.get_replica_owner(),lastSyncDate:N(i.get_last_sync_date()),creationDate:N(i.get_creation_date()),syncDirection:O(i.get_sync_direction(),t),replicaFilters:D(c,n)})}function d(e){return{errors:g(e.get_error_count(),e),warnings:f(e.get_warning_count(),e),replicaName:e.get_replica_name(),requestedReplicaName:e.get_requested_replica_name(),replicaId:e.get_replica_id(),syncDate:N(e.get_sync_date()),replicaDataFormat:C(e.get_replica_data_format()),replicaDataUrl:e.get_replica_data_url()}}function f(e,t){const n=[];for(let r=0;r<e;r++){const e=o(t.get_warning_at(r));e&&n.push(e)}return n}function g(e,t){const n=[];for(let r=0;r<e;r++){const e=o(t.get_error_at(r));e&&n.push(e)}return n}function m(e){return{replicaName:e.get_replica_name(),replicaId:e.get_replica_id(),lastSyncDate:N(e.get_last_sync_date())}}function y(e){return{replicaId:e.get_replica_id(),error:e.has_error()?o(e.get_error()):void 0}}function D(e,n){const r=e.get_static_definition();r.deleteLater();return{inputQuantizationParameters:void 0,inputSpatialReference:new t(e.input_spatial_reference),staticDefinition:w(r,n)}}function w(e,t){const n=[],r=[];for(let i=0;i<e.get_entity_type_replica_definition_count();i++){const r=e.get_entity_type_replica_definition_at(i);r.deleteLater(),n.push(v(r,t))}for(let i=0;i<e.get_relationship_type_replica_definition_count();i++){const n=e.get_relationship_type_replica_definition_at(i);n.deleteLater(),r.push(h(n,t))}return{entityTypeReplicaDefinitions:n,relationshipTypeReplicaDefinitions:r}}function v(e,t){const n=e.document_options.get_include_connected_documents();return n?.deleteLater(),{...R(e,t),documentOptions:n?j(n):{includeConnectedDocuments:!1}}}function h(e,t){return R(e,t)}function R(e,t){const n=e.provenance_options;n.deleteLater();const r={},i=e.get_parameter_count();for(let c=0;c<i;c++)r[e.get_parameter_key_at(c)]=L(e.get_parameter_value_at(c),t);return{typeName:e.type_name,openCypherWhereClause:e.open_cypher_where_clause,provenanceOptions:S(n),parameters:i?r:void 0}}function L(e,t){return a(e,t,u)}function j(e){const t=e.get_provenance_options();t.deleteLater();const n=S(t);return n.includeProvenance?{includeConnectedDocuments:!0,includeDocumentProvenance:!0,includeDocumentSourceDocuments:n.includeSourceDocuments}:{includeConnectedDocuments:!0,includeDocumentProvenance:!1}}function S(e){const t=e.get_include_provenance();return t?{includeProvenance:!0,includeSourceDocuments:I(t)}:{includeProvenance:!1}}function I(e){return e.get_include_source_documents()}function O(t,n){const r=t.value,i=n.SyncDirection;if(r===i.BIDIRECTIONAL.value)return"bidirectional";if(r===i.UPLOAD.value)return"upload";if(r===i.DOWNLOAD.value)return"download";throw new e("knowledge-graph:replica-invalid-sync-direction",`Unsupported replica sync direction value: ${r}`)}function C(t){switch(t.value){case 0:return;case 1:return"pbf";case 2:return"spbf";case 3:return"geoparquet";case 4:return"sqlite";default:throw new e("knowledge-graph:replica-invalid-sync-data-format",`Unsupported replica sync data format value: ${t.value}`)}}function N(e){return e?new Date(e):null}export{s as decoderToCreateReplicaResponse,p as decoderToReplicaDefinition,l as decoderToReplicasInformationResponse,_ as decoderToUnregisterReplicaResponse,g as getEsriErrors,f as getEsriWarnings,N as timestampToDate,C as toReplicaSyncDataFormat,O as toReplicaSyncDirection,d as wasmCreateReplicaResultToCreateReplicaResult,v as wasmEntityTypeReplicaDefinitionToReplicaEntityTypeReplicaDefinition,j as wasmIncludeConnectedDocumentsToReplicaIncludeConnectedDocuments,I as wasmIncludeProvenanceToReplicaIncludeProvenance,R as wasmNamedTypeReplicaDefinitionToReplicaNamedTypeReplicaDefinition,S as wasmProvenanceOptionsToReplicaProvenanceOptions,h as wasmRelationshipTypeReplicaDefinitionToReplicaRelationshipTypeReplicaDefinition,D as wasmReplicaFiltersToReplicaFilters,m as wasmReplicaInfoToReplicaInformation,w as wasmStaticDefinitionToReplicaStaticDefinition,y as wasmUnregisterReplicaResultToUnregisterReplicaResult};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{id as e}from"../kernel.js";import t from"../request.js";import r from"../core/Error.js";import a from"../core/Logger.js";import{isAbortError as n}from"../core/promiseUtils.js";import o from"../geometry/Geometry.js";import d from"../geometry/SpatialReference.js";import{submitJob as i}from"./geoprocessor/submitJob.js";import s from"./knowledgeGraph/GraphQueryResult.js";import c from"./knowledgeGraph/GraphQueryResultHeader.js";import p from"./knowledgeGraph/GraphQueryStreamingResult.js";import l from"./knowledgeGraph/KnowledgeGraph.js";import u from"./knowledgeGraph/ServiceDefinition.js";import{encodeClientDataAtKeysRequest as h}from"./knowledgeGraph/wasmInterface/clientDataToWasmEncodedFactories.js";import{getWasmInterface as w}from"./knowledgeGraph/wasmInterface/knowledgeWasmAccess.js";import{bindParamArrayToWasm as g,setInputQuantizationParametersOnEncoder as y,setOutputQuantizationParametersOnEncoder as f,setProvenanceBehaviorOnEncoder as m,geometryToWasm as _,bindParamObjectToWasm as k}from"./knowledgeGraph/wasmInterface/queryToWasmEncodedFactories.js";import{replicaIdsToWasmUnregisterReplicaRequestEncoder as x,replicaToWasmCreateReplicaRequestEncoder as b}from"./knowledgeGraph/wasmInterface/replicaToWasmEncodedFactories.js";import{domainToWasm as G,updateSearchPropertiesToWasm as T,fieldIndexToWasm as v,updateGraphPropertyToWasm as A,graphPropertyToWasm as R,updateEntityTypeToWasm as D,updateRelationshipTypeToWasm as P,entityTypeToWasm as S,relationshipTypeToWasm as E,inputQuantizationParametersToWasmFormat as I,namedObjectToWasm as C}from"./knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js";import{wasmClientDataAllKeysResponseToClientDataKeys as M,wasmClientDataFetchResponseToClientData as q}from"./knowledgeGraph/wasmInterface/wasmToClientDataFactories.js";import{decoderToAddNamedTypesResult as F,decoderToDeleteNamedTypeResult as U,decoderToUpdateNamedTypesResult as j,decoderToAddGraphPropertiesResult as $,decoderToDeleteGraphPropertiesResult as K,decoderToUpdateGraphPropertiesResult as N,decoderToGraphAddIndexResult as L,decoderToGraphDeleteIndexResult as Q,decoderToGraphUpdateSearchIndexResult as O,decoderToGraphDataModelSingletonOperationResult as W}from"./knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js";import{wasmToDataModel as H}from"./knowledgeGraph/wasmInterface/wasmToDataModelFactories.js";import{wasmToGraphQueryResponseHeader as B,decodedWasmObjToQueryResponseObj as z}from"./knowledgeGraph/wasmInterface/wasmToQueryResponseObjFactories.js";import{decoderToReplicasInformationResponse as V,decoderToReplicaDefinition as J,decoderToUnregisterReplicaResponse as Y,decoderToCreateReplicaResponse as X}from"./knowledgeGraph/wasmInterface/wasmToReplicaFactories.js";import{decoderToApplyEditsResponse as Z}from"./knowledgeGraph/wasmInterface/wasmToUpdateResponseFactories.js";import{checkWasmError as ee}from"./knowledgeGraph/wasmInterface/wasmUtils.js";const te=new Map,re=()=>new Map(te.entries()),ae={fetchKnowledgeGraph:async e=>{const t=new l({url:e}),r=[];return r.push(xe(t)),r.push(be(t)),await Promise.all(r),t},refreshDataModel:async e=>{e.dataModel=await xt(e)},refreshServiceDefinition:async e=>{const r=(await t(e.url,{query:{f:"json"}})).data;return r.capabilities=r?.capabilities?.split(","),r.supportedQueryFormats=r?.supportedQueryFormats?.split(","),e.serviceDefinition=new u(r),e.serviceDefinition},executeFindPathsAsynchronous:async(e,t)=>{const a=e.inKnowledgeGraphUrl.split("/rest/services");if(a.length<2)throw new r("knowledge-graph:invalid-tool-url","The URL for the KG Service was not correctly formatted. It should contain /rest/services/");const n=a[0],o=(await Fe(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,d=`/rest/services/${o&&o<12?"System":"Utilities"}/KnowledgeGraphServerToolsAsync/GPServer/ServerFilteredFindPaths`;return await qe(`${n}${d}`,{in_knowledge_graph_url:e.inKnowledgeGraphUrl,config_type:"STRING",config_string:e.config.toJSON(),result_type:"STRING"},{},t)},executeFindPaths:async(e,t)=>{const a=e.inKnowledgeGraphUrl.split("/rest/services");if(a.length<2)throw new r("knowledge-graph:invalid-tool-url","The URL for the KG Service was not correctly formatted. It should contain /rest/services/");const n=a[0],o=(await Fe(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,d=`/rest/services/${o&&o<12?"System":"Utilities"}/KnowledgeGraphServerTools/GPServer/ServerFilteredFindPaths/execute`,i=await Fe(`${n}${d}`,{method:"post",query:{f:"json",in_knowledge_graph_url:e.inKnowledgeGraphUrl,config_type:"STRING",config_string:JSON.stringify(e.config),result_type:"STRING"},...t});if(i.data.results.length<1)throw new r("knowledge-graph:no-results","No results were returned from the FindPaths tool - no results returned",i);let s;for(const r of i.data.results)if("out_results_string"===r.paramName){s=r.value;break}if(!s)throw new r("knowledge-graph:no-results","No results were returned from the FindPaths tool - no results were returned on the expected paramater out_results_string",i);return s},fetchAsynchronousFindPathsResultData:async(e,t)=>(await e.fetchResultData("out_results_string",null,t)).value,executeQueryStreaming:async(e,t,a)=>{const n="include",o=`${e.url}/graph/query`;await Ue(e);const d=await et(o,a);if(!e.serviceDefinition?.supportsProvenance&&t.provenanceBehavior===n)throw new r("knowledge-graph:provenance-not-supported","The Knowledge Graph Service definition indicated that provenance is not supported");d.data.body=await Xe(t,e);const i=await Me(d.data.url,d.data);if(e.dataModel){const t=await kt(i,e.dataModel);return new p({resultRowsStream:t.readableStream,resultHeader:t.resultHeader})}throw new r("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,t,a)=>{if(e.serviceDefinition?.dataEditingNotSupported||null!=e.dataModel.arcgisManaged&&!e.dataModel.arcgisManaged)throw new r("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await Ue(e);const o=await et(n,a);o.data.body=await $e(t,e);return rt(await Me(o.data.url,o.data))},executeAddNamedTypes:async(e,t,a)=>{if(!t.newEntityTypes?.length&&!t.newRelationshipTypes?.length)throw new r("knowledge-graph:no-arguments","The operation to add types to the data model contained no values");const n=`${e.url}/dataModel/edit/namedTypes/add`;await Ue(e);const o=await et(n,a);o.data.body=await Ke(t);const d=await Me(o.data.url,o.data),i=await at(d);return i.updatedKnowledgeGraph=await ke(e.url),i},executeDeleteNamedType:async(e,t,a)=>{if(!t)throw new r("knowledge-graph:no-arguments","The operation to delete a named type from the data model contained no value");const n=`${e.url}/dataModel/edit/namedTypes/${t}/delete`;await Ue(e);const o=await et(n,a);o.data.body="";const d=await Me(o.data.url,o.data),i=await nt(d);return i.updatedKnowledgeGraph=await ke(e.url),i},executeUpdateNamedType:async(e,t,a,n)=>{if(!t&&!Object.keys(a).length)throw new r("knowledge-graph:no-arguments","The operation to update types in the data model contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/update`;await Ue(e);const d=await et(o,n);d.data.body=await Ne(a,t,e.dataModel);const i=await Me(d.data.url,d.data),s=await ot(i);return s.updatedKnowledgeGraph=await ke(e.url),s},executeAddGraphProperties:async(e,t,a,n)=>{if(!t&&!a.length)throw new r("knowledge-graph:no-arguments","The operation to add properties to the data model contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/fields/add`;await Ue(e);const d=await et(o,n);d.data.body=await Le(a);const i=await Me(d.data.url,d.data),s=await dt(i);return s.updatedKnowledgeGraph=await ke(e.url),s},executeDeleteGraphProperty:async(e,t,a,n)=>{if(!t&&!a)throw new r("knowledge-graph:no-arguments","The operation to delete property contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/fields/delete`;await Ue(e);const d=await et(o,n);d.data.body=await Qe(a);const i=await Me(d.data.url,d.data),s=await it(i);return s.updatedKnowledgeGraph=await ke(e.url),s},executeUpdateGraphProperty:async(e,t,a,n,o)=>{if(!t&&!a&&!Object.keys(n).length)throw new r("knowledge-graph:no-arguments","The operation to update properties in the data model contained missing or empty values");const d=`${e.url}/dataModel/edit/namedTypes/${t}/fields/update`;await Ue(e);const i=await et(d,o);i.data.body=await Oe(a,n);const s=await Me(i.data.url,i.data),c=await st(s);return c.updatedKnowledgeGraph=await ke(e.url),c},executeAddGraphFieldIndex:async(e,t,a,n)=>{if(!t)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!a?.length)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty field index values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/indexes/add`;await Ue(e);const d=await et(o,n);d.data.body=await We(a);const i=await Me(d.data.url,d.data),s=await ct(i);return s.updatedKnowledgeGraph=await ke(e.url),s},executeDeleteGraphFieldIndex:async(e,t,a,n)=>{if(!t)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!a?.length)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty field index values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/indexes/delete`;await Ue(e);const d=await et(o,n);d.data.body=await Je(a);const i=await Me(d.data.url,d.data),s=await pt(i);return s.updatedKnowledgeGraph=await ke(e.url),s},executeUpdateSearchIndex:async(e,t,a,n)=>{if(!t)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!Object.keys(a.addSearchProperties??{}).length&&!Object.keys(a.removeSearchProperties??{}).length)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty properties values");const o=`${e.url}/dataModel/searchIndex/update`;await Ue(e);const d=await et(o,n);d.data.body=await Ye(t,a);const i=await Me(d.data.url,d.data),s=await lt(i);return s.updatedKnowledgeGraph=await ke(e.url),s},executeAddDomain:async(e,t,r,{mergePolicy:a="esriMergePolicyTypeDefaultValue",splitPolicy:n="esriSplitPolicyTypeDefaultValue"},o)=>{const d=`${e.url}/dataModel/domains/add`;await Ue(e);const i=await et(d,o);i.data.body=await He(t,r,{mergePolicy:a,splitPolicy:n});const s=await Me(i.data.url,i.data),c=await ut(s);return c.updatedKnowledgeGraph=await ke(e.url),c},executeUpdateDomain:async(e,t,r,a,n)=>{const o=`${e.url}/dataModel/domains/${t.name}/update`;await Ue(e);const d=await et(o,n);d.data.body=await Be(t,r,a);const i=await Me(d.data.url,d.data),s=await ht(i);return s.updatedKnowledgeGraph=await ke(e.url),s},executeDeleteDomain:async(e,t,a)=>{const n=`${e.url}/dataModel/domains/${t}/delete`;if(!t)throw new r("knowledge-graph:no-arguments","The operation to delete a domain from the data model contained missing or empty domain name");await Ue(e);const o=await et(n,a);o.data.body="";const d=await Me(o.data.url,o.data),i=await wt(d);return i.updatedKnowledgeGraph=await ke(e.url),i},executeCreateReplica:async(e,t,r)=>{const a=`${e.url}/replicas/create`;await Ue(e);const n=await et(a,r);n.data.body=await ze(t);return gt(await Me(n.data.url,n.data))},fetchReplicaDefinition:async(e,a,n)=>{const o=`${e.url}/replicas/${a}`,d=await t(o,{responseType:"array-buffer",query:{f:"pbf",...n?.query},signal:n?.signal,timeout:n?.timeout}),i=d.getHeader?.("content-type"),s=d.data;if(i?.includes("application/x-protobuf")){const e=await w(),t=new e.ReplicaDefinitionResponseDecoder;return t.deleteLater(),t.decode(new Uint8Array(s)),t.has_error()&&ee(t.error,"knowledge-graph:fetchReplica-decoding-error","An error occurred while decoding the replica definition response"),J(t,e)}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching a replica",{responseType:i,data:d.data})},fetchReplicasInformation:async(e,a)=>{const n=`${e.url}/replicas`,o=await t(n,{responseType:"array-buffer",query:{f:"pbf",...a?.query},signal:a?.signal,timeout:a?.timeout}),d=o.getHeader?.("content-type"),i=o.data;if(d?.includes("application/x-protobuf")){const e=new((await w()).ReplicasResponseDecoder);return e.deleteLater(),e.decode(new Uint8Array(i)),e.has_error()&&ee(e.error,"knowledge-graph:fetchReplicasInformation-decoding-error","An error occurred while decoding the replicas information response"),V(e)}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching replicas information",{responseType:d,data:o.data})},executeUnregisterReplica:async(e,t,a)=>{if(!0===t.unregisterAll&&"replicaIds"in t)throw new r("knowledge-graph:no-arguments","The operation to unregister replicas cannot include replica ids when unregisterAll is true");if(!0!==t.unregisterAll){const e="replicaIds"in t?t.replicaIds:void 0;if(!(Array.isArray(e)&&e.some(e=>!!e)))throw new r("knowledge-graph:no-arguments","The operation to unregister replicas requires at least one replica id")}const n=`${e.url}/replicas/unregister`;await Ue(e);const o=await et(n,a);o.data.body=await Ve(t);return yt(await Me(o.data.url,o.data))},executeQuery:async(e,a,n)=>{const o=`${e.url}/graph/query`,d=await t(o,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:a.openCypherQuery,...n?.query},signal:n?.signal,timeout:n?.timeout}),i=d.getHeader?.("content-type"),c=d.data;if(i?.includes("application/x-protobuf")){const t=new((await w()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=_t({wasmQueryDecoder:t,newArrayBufferToParse:c,dataModel:e.dataModel});return new s({resultRows:r.resultRows,resultHeader:r.resultHeader})}throw new r("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:i,data:d.data})},executeSearch:async(e,a,n)=>{const o="provenance"===a.typeCategoryFilter?"metaEntityProvenance":a.typeCategoryFilter,d=`${e.url}/graph/search`,i=await t(d,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${a.searchQuery}"`,typeCategoryFilter:o,...n?.query},signal:n?.signal,timeout:n?.timeout}),c=i.getHeader?.("content-type"),p=i.data;if(c?.includes("application/x-protobuf")){const t=new((await w()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=_t({wasmQueryDecoder:t,newArrayBufferToParse:p,dataModel:e.dataModel});return new s({resultRows:r.resultRows,resultHeader:r.resultHeader})}throw new r("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:c,data:i.data})},executeSearchStreaming:async(e,t,a)=>{const n=`${e.url}/graph/search`;await Ue(e);const o=await et(n,a);o.data.body=await Ze(t);const d=await Me(o.data.url,o.data);if(e.dataModel){const t=await kt(d,e.dataModel);return new p({resultRowsStream:t.readableStream,resultHeader:t.resultHeader})}throw new r("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},fetchClientDataAtKeys:async(e,t,a={ignoreCache:!1})=>{if(!t.length)return new Map;let n=te.get(e.url||"");n||(n=new Map,te.set(e.url||"",n));const o=new Map(n.entries()),d=`${e.url}/clientData/fetch`;t=Array.from(new Set(t));const i=await w(),s=h(t,n,i,a.ignoreCache),c=await et(d,a.requestOptions);c.data.body=s;const p=await Me(c.data.url,c.data),l=p.headers.get("content-type");if(l?.includes("application/x-protobuf")){const e=new i.ClientDataFetchResponseDecoder;e.deleteLater();const t=await p.arrayBuffer();return e.decode(new Uint8Array(t)),e.has_error()&&ee(e.error,"knowledge-graph:fetchClientDataAtKeys-decoding-error","An error occurred while decoding the client data keys response"),q(e,n,o,a.ignoreCache)}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching client data",{responseType:l,data:p})},fetchAllClientDataKeys:async(e,a)=>{const n=`${e.url}/clientData`,o=await t(n,{responseType:"array-buffer",query:{f:"pbf"},signal:a?.signal,timeout:a?.timeout}),d=o.getHeader?.("content-type"),i=o.data;if(d?.includes("application/x-protobuf")){const e=new((await w()).ClientDataKeysResponseDecoder);return e.deleteLater(),e.decode(new Uint8Array(i)),e.has_error()&&ee(e.error,"knowledge-graph:fetchAllClientDataKeys-decoding-error","An error occurred while decoding the client data keys response"),M(e)}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:d,data:o.data})},clearClientDataCache:()=>te.clear(),_fetchWrapper:async(e,t)=>fetch(e,t),_submitJobWrapper:async(e,t,r,a)=>i(e,t,r,a),_esriRequestWrapper:async(e,r)=>t(e,r)};async function ne(e,t,r){return ae.executeApplyEdits(e,t,r)}async function oe(e,t,r){return ae.executeAddNamedTypes(e,t,r)}async function de(e,t,r){return ae.executeDeleteNamedType(e,t,r)}async function ie(e,t,r,a){return ae.executeUpdateNamedType(e,t,r,a)}async function se(e,t,r,a){return ae.executeAddGraphProperties(e,t,r,a)}async function ce(e,t,r,a){return ae.executeDeleteGraphProperty(e,t,r,a)}async function pe(e,t,r,a,n){return ae.executeUpdateGraphProperty(e,t,r,a,n)}async function le(e,t,r,a){return ae.executeAddGraphFieldIndex(e,t,r,a)}async function ue(e,t,r,a){return ae.executeDeleteGraphFieldIndex(e,t,r,a)}async function he(e,t,r,a){return ae.executeUpdateSearchIndex(e,t,r,a)}async function we(e,t,r){return ae.executeQuery(e,t,r)}async function ge(e,t,r){return ae.executeQueryStreaming(e,t,r)}async function ye(e,t,r){return ae.executeSearch(e,t,r)}async function fe(e,t,r){return ae.executeSearchStreaming(e,t,r)}function me(e,t){return ae.fetchAllClientDataKeys(e,t)}function _e(e,t,r){return ae.fetchClientDataAtKeys(e,t,r)}async function ke(e){return ae.fetchKnowledgeGraph(e)}async function xe(e){return ae.refreshDataModel(e)}async function be(e){return ae.refreshServiceDefinition(e)}async function Ge(e,t){return ae.executeFindPathsAsynchronous(e,t)}async function Te(e,t){return ae.executeFindPaths(e,t)}async function ve(e,t){return ae.fetchAsynchronousFindPathsResultData(e,t)}async function Ae(e,t,r,a={mergePolicy:"esriMergePolicyTypeDefaultValue",splitPolicy:"esriSplitPolicyTypeDefaultValue"},n){return ae.executeAddDomain(e,t,r,a,n)}async function Re(e,t,r,a,n){return ae.executeUpdateDomain(e,t,r,a,n)}async function De(e,t,r){return ae.executeDeleteDomain(e,t,r)}async function Pe(e,t,r){return ae.executeCreateReplica(e,t,r)}async function Se(e,t,r){return ae.fetchReplicaDefinition(e,t,r)}async function Ee(e,t){return ae.fetchReplicasInformation(e,t)}async function Ie(e,t,r){return ae.executeUnregisterReplica(e,t,r)}function Ce(){return ae.clearClientDataCache()}async function Me(e,t){return ae._fetchWrapper(e,t)}async function qe(e,t,r,a){return ae._submitJobWrapper(e,t,r,a)}async function Fe(e,t){return ae._esriRequestWrapper(e,t)}async function Ue(t){const r=e?.findCredential(t.url);r||(t.dataModel?await xt(t):await xe(t))}function je(e,t,r,a){null==t?r.set_param_key_value(e,""):"object"!=typeof t||t instanceof Date?r.set_param_key_value(e,t):t instanceof o?r.set_param_key_value(e,_(t,a)):Array.isArray(t)?r.set_param_key_value(e,g(t,a)):r.set_param_key_value(e,k(t,a))}async function $e(e,t){if(t.dataModel||await xe(t),!t.dataModel)throw new r("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const a=await w(),n=!!e.options?.cascadeDelete,o=!!e.options?.cascadeProvenanceDelete,d=new a.GraphApplyEditsEncoder(a.SpatialReferenceUtil.WGS84(),e.options?.inputQuantizationParameters?I(e.options?.inputQuantizationParameters):a.InputQuantizationUtil.WGS84_lossless());d.deleteLater(),d.cascade_delete=n,d.cascade_delete_provenance=o;try{let t;e.entityAdds?.forEach(e=>{t=d.add_entity(C(e,a)),ee(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipAdds?.forEach(e=>{if(!e.originId||!e.destinationId)throw new r("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");t=d.add_relationship(C(e,a)),ee(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityUpdates?.forEach(e=>{if(!e.id)throw new r("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=d.update_entity(C(e,a)),ee(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipUpdates?.forEach(e=>{if(!e.id)throw new r("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=d.update_relationship(C(e,a)),ee(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityDeletes?.forEach(e=>{if(!e.typeName)throw new r("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=d.make_delete_helper(e.typeName,!0);t.deleteLater(),e.ids?.forEach(e=>{t.delete_by_id(e)})}),e.relationshipDeletes?.forEach(e=>{if(!e.typeName)throw new r("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=d.make_delete_helper(e.typeName,!1);e.ids?.forEach(e=>{t.delete_by_id(e)})}),d.encode()}catch(s){throw new r("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:s})}const i=d.get_encoding_result();return ee(i.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),structuredClone(i.get_byte_buffer())}async function Ke(e){const t=await w(),a=new t.GraphNamedObjectTypeAddsRequestEncoder;a.deleteLater(),e.newEntityTypes?.forEach(e=>{a.add_entity_type(S(e,t))}),e.newRelationshipTypes?.forEach(e=>{a.add_relationship_type(E(e,t))});try{a.encode()}catch(o){throw new r("knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed",{error:o})}const n=a.get_encoding_result();return ee(n.error,"knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed"),structuredClone(n.get_byte_buffer())}async function Ne(e,t,a){const n=await w(),o=new n.GraphNamedObjectTypeUpdateRequestEncoder;o.deleteLater();if(a.entityTypes.some(e=>e.name===t))o.update_entity_type(D(e,n));else{if(!a.relationshipTypes.some(e=>e.name===t))throw new r("knowledge-graph:updateNamedType-encoding-failed","The named type you are trying to update does not exist in the data model");o.update_relationship_type(P(e,n))}o.update_alias=e.hasOwnProperty("alias");try{o.encode()}catch(i){throw new r("knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed",{error:i})}const d=o.get_encoding_result();return ee(d.error,"knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed"),structuredClone(d.get_byte_buffer())}async function Le(e){const t=await w(),a=new t.GraphPropertyAddsRequestEncoder;a.deleteLater(),e.forEach(e=>{a.add_graph_property(R(e,t))});try{a.encode()}catch(o){throw new r("knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed",{error:o})}const n=a.get_encoding_result();return ee(n.error,"knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed"),structuredClone(n.get_byte_buffer())}async function Qe(e){const t=new((await w()).GraphPropertyDeleteRequestEncoder);t.deleteLater(),t.field_name=e;try{t.encode()}catch(n){throw new r("knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed",{error:n})}const a=t.get_encoding_result();return ee(a.error,"knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed"),structuredClone(a.get_byte_buffer())}async function Oe(e,t){const a=await w(),n=new a.GraphPropertyUpdateRequestEncoder;n.deleteLater(),n.update_graph_property(A(t,a)),n.set_property_name(e),n.update_alias=t.hasOwnProperty("alias"),n.update_editable=t.hasOwnProperty("editable"),n.update_required=t.hasOwnProperty("required"),n.update_visible=t.hasOwnProperty("defaultVisibility"),n.update_default_value=t.hasOwnProperty("defaultValue"),n.update_domain=t.hasOwnProperty("domain");try{n.encode()}catch(d){throw new r("knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed",{error:d})}const o=n.get_encoding_result();return ee(o.error,"knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed"),structuredClone(o.get_byte_buffer())}async function We(e){const t=await w(),a=new t.GraphIndexAddsRequestEncoder;a.deleteLater(),e.forEach(e=>{a.add_field_index(v(e,t))});try{a.encode()}catch(o){throw new r("knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed",{error:o})}const n=a.get_encoding_result();return ee(n.error,"knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed"),structuredClone(n.get_byte_buffer())}async function He(e,t,a){const n=await w(),o=new n.GraphDomainAddRequestEncoder;o.deleteLater(),o.set_domain(G(e,n,t,a));try{o.encode()}catch(i){throw new r("knowledge-graph:addDomain-encoding-failed","Attempting to encode the domain failed",{error:i})}const d=o.get_encoding_result();return ee(d.error,"knowledge-graph:addDomain-encoding-failed","Attempting to encode the domain failed"),structuredClone(d.get_byte_buffer())}async function Be(e,t,a){const n=await w(),o=new n.GraphDomainUpdateRequestEncoder;o.deleteLater(),o.set_domain(G(e,n,t,a)),o.update_domain=!0,a?.mergePolicy&&(o.update_merge_policy=!0),a?.splitPolicy&&(o.update_split_policy=!0);try{o.encode()}catch(i){throw new r("knowledge-graph:updateDomain-encoding-failed","Attempting to encode the domain failed",{error:i})}const d=o.get_encoding_result();return ee(d.error,"knowledge-graph:updateDomain-encoding-failed","Attempting to encode the domain failed"),structuredClone(d.get_byte_buffer())}async function ze(e){const t=await w(),a=b(e,t);try{a.encode()}catch(o){throw new r("knowledge-graph:createReplica-encoding-failed","Attempting to encode createReplica failed",{error:o})}const n=a.get_encoding_result();return ee(n.error,"knowledge-graph:createReplica-encoding-failed","Attempting to encode createReplica failed"),structuredClone(n.get_byte_buffer())}async function Ve(e){const t=await w(),a=x(e,t);try{a.encode()}catch(o){throw new r("knowledge-graph:unregisterReplica-encoding-failed","Attempting to encode unregisterReplica failed",{error:o})}const n=a.get_encoding_result();return ee(n.error,"knowledge-graph:unregisterReplica-encoding-failed","Attempting to encode unregisterReplica failed"),structuredClone(n.get_byte_buffer())}async function Je(e){const t=new((await w()).GraphIndexDeleteRequestEncoder);t.deleteLater(),e.forEach(e=>{t.add_index_name(e)});try{t.encode()}catch(n){throw new r("knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed",{error:n})}const a=t.get_encoding_result();return ee(a.error,"knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed"),structuredClone(a.get_byte_buffer())}async function Ye(e,t){const a=await w(),n=new a.GraphUpdateSearchIndexRequestEncoder;n.deleteLater(),t.hasOwnProperty("addSearchProperties")&&n.insert_add_search_property(e,T(t.addSearchProperties,a)),t.hasOwnProperty("removeSearchProperties")&&n.insert_delete_search_property(e,T(t.removeSearchProperties,a));try{n.encode()}catch(d){throw new r("knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed",{error:d})}const o=n.get_encoding_result();return ee(o.error,"knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed"),structuredClone(o.get_byte_buffer())}async function Xe(e,t){const a=await w(),n=new a.GraphQueryRequestEncoder;if(n.deleteLater(),e.outputSpatialReference?n.output_spatial_reference={wkid:e.outputSpatialReference.wkid,latestWkid:e.outputSpatialReference.latestWkid,vcsWkid:e.outputSpatialReference.vcsWkid,latestVcsWkid:e.outputSpatialReference.latestVcsWkid,wkt:e.outputSpatialReference.wkt??""}:n.output_spatial_reference=a.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[r,i]of Object.entries(e.bindParameters))je(r,i,n,a);if(e.bindGeometryQuantizationParameters)y(e.bindGeometryQuantizationParameters,n);else{if(t.dataModel||await xe(t),4326!==t.dataModel?.spatialReference?.wkid)throw new r("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=a.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&f(e.outputQuantizationParameters,n,a),e.provenanceBehavior&&m(e.provenanceBehavior,n);try{n.encode()}catch(d){throw new r("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:d})}const o=n.get_encoding_result();if(0!==o.error.error_code)throw new r("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}async function Ze(e){const t=await w(),a=new t.GraphSearchRequestEncoder;a.deleteLater(),a.search_query=e.searchQuery;const n="provenance"===e.typeCategoryFilter?"meta_entity_provenance":e.typeCategoryFilter;if(a.type_category_filter=t.esriNamedTypeCategory[n],!0===e.returnSearchContext&&(a.return_search_context=e.returnSearchContext),null!=e.start&&e.start>0&&(a.start_index=e.start),null!=e.num&&(a.max_num_results=e.num),null!=e.idsFilter&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{a.set_ids_filter(g(e.idsFilter,t))}catch(d){throw new r("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:d})}e.namedTypesFilter?.forEach(e=>{a.add_named_type_filter(e)});try{a.encode()}catch(d){throw new r("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:d})}const o=a.get_encoding_result();if(0!==o.error.error_code)throw new r("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}async function et(e,r){return t(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...r?.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:r?.signal,timeout:r?.timeout})}async function tt(e,t,a){const n=e.headers.get("content-type");if(n?.includes("application/x-protobuf")){const r=await e.arrayBuffer(),n=new t;try{return n.decode(new Uint8Array(r)),a(n)}finally{n.deleteLater()}}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:await e.text()})}async function rt(e){return tt(e,(await w()).GraphApplyEditsDecoder,Z)}async function at(e){return tt(e,(await w()).GraphNamedObjectTypeAddsResponseDecoder,F)}async function nt(e){return tt(e,(await w()).GraphNamedObjectTypeDeleteResponseDecoder,U)}async function ot(e){return tt(e,(await w()).GraphNamedObjectTypeUpdateResponseDecoder,j)}async function dt(e){return tt(e,(await w()).GraphPropertyAddsResponseDecoder,$)}async function it(e){return tt(e,(await w()).GraphPropertyDeleteResponseDecoder,K)}async function st(e){return tt(e,(await w()).GraphPropertyUpdateResponseDecoder,N)}async function ct(e){return tt(e,(await w()).GraphIndexAddsResponseDecoder,L)}async function pt(e){return tt(e,(await w()).GraphIndexDeleteResponseDecoder,Q)}async function lt(e){return tt(e,(await w()).GraphUpdateSearchIndexResponseDecoder,O)}async function ut(e){return tt(e,(await w()).GraphDomainAddResponseDecoder,W)}async function ht(e){return tt(e,(await w()).GraphDomainUpdateResponseDecoder,W)}async function wt(e){return tt(e,(await w()).GraphDomainDeleteResponseDecoder,W)}async function gt(e){const t=e.headers.get("content-type");if(t?.includes("application/x-protobuf")){const t=await e.arrayBuffer(),r=new((await w()).CreateReplicaResponseDecoder);try{return r.decode(new Uint8Array(t)),r.has_error()&&ee(r.error,"knowledge-graph:createReplica-decoding-error","An error occurred while decoding the createReplica response"),X(r)}finally{r.deleteLater()}}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response for createReplica",{responseType:t,data:await e.text()})}async function yt(e){const t=e.headers.get("content-type");if(t?.includes("application/x-protobuf")){const t=await e.arrayBuffer(),r=new((await w()).UnregisterReplicaResponseDecoder);try{return r.decode(new Uint8Array(t)),r.has_error()&&ee(r.error,"knowledge-graph:unregisterReplica-decoding-error","An error occurred while decoding the unregisterReplica response"),Y(r)}finally{r.deleteLater()}}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response for unregisterReplica",{responseType:t,data:await e.text()})}let ft=50;function mt(e){ft=e}function _t({wasmQueryDecoder:e,newArrayBufferToParse:t,dataModel:a,decodedHeader:n,limitMaxProcessingTime:o=!1}){t&&e.push_buffer(new Uint8Array(t));const i=[];let s,c,p=0;const l=Date.now();let u=!0;for(;e.next_row();){s&&c||(s=n??B(e),c=s.outSpatialReference??new d({wkid:4326})),p||(p=e.get_header_keys().size());const t=new Array(p);for(let r=0;r<p;r++){const n=e.get_value(r);t[r]=z(n,a,c)}if(i.push(t),o&&Date.now()-l>ft){u=!1;break}}if(e.has_error())throw new r("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - inner row decoding",{errorCode:e.error.error_code,errorMessage:e.error.error_message});return{resultHeader:s,resultRows:i,parsedAllResultsFromBuffer:u}}async function kt(e,t){const o=e.headers.get("content-type");if(e.headers.get("content-length")&&a.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").warnOnce("Found `Content-Length` header when expecting a streaming HTTP response! Please investigate whether all intermediate HTTP proxies and/or load balancers are configured such that they don't forcefully buffer the entire response before returning it to the client. A valid HTTP streaming response should use Chunked Transfer Encoding and not have a Content Length defined."),o?.includes("application/x-protobuf")){const o=e.body?.getReader(),d=new((await w()).GraphQueryDecoder);let i,s,p;d.deleteLater();const l=new Promise((e,t)=>{s=e,p=t});let u=!1,h=null;const g=new ReadableStream({pull:async function e(l){if(!o){const e=new r("knowledge-graph:stream-decoding-error","Error reading from stream - reader is undefined");throw p(e),e}const{done:w,value:g}=h?{done:!1,value:null}:await o.read().catch(e=>{throw p(e),o.releaseLock(),e});g&&(h=g);try{if(w){let e;if(d.has_error()?e=new r("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - query stream done",{errorCode:d.error.error_code,errorMessage:d.error.error_message}):u||s(new c),o.releaseLock(),e)throw l.error(e),p(e),e;return void l.close()}const{resultHeader:a,resultRows:n,parsedAllResultsFromBuffer:y}=_t({wasmQueryDecoder:d,newArrayBufferToParse:g,dataModel:t,decodedHeader:i,limitMaxProcessingTime:!0});return y&&(h=null),!i&&a&&(i=a,s(a),u=!0),n.length>0?void l.enqueue(n):await e(l)}catch(y){throw a.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").error(y),p(y),o.releaseLock(),n(y)?y:new r("knowledge-graph:unexpected-server-response","Error inside streaming data return parsing",{error:y})}}});return{readableStream:g,resultHeader:await l}}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:e.text()})}async function xt(e){const a=`${e.url}/dataModel/queryDataModel`,n=await t(a,{responseType:"array-buffer",query:{f:"pbf"}}),o=n.getHeader?.("content-type"),d=n.data;if(o?.includes("application/x-protobuf")){const e=(await w()).decode_data_model_from_protocol_buffer(new Uint8Array(d));if(!e)throw new r("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return H(e)}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:n.data})}export{Ue as _checkAuthentication,Fe as _esriRequestWrapper,Me as _fetchWrapper,re as _getClientDataCacheCopy,mt as _setMaxQueryParsingDurationForTesting,qe as _submitJobWrapper,Ce as clearClientDataCache,te as clientDataCache,Ae as executeAddDomain,le as executeAddGraphFieldIndex,se as executeAddGraphProperties,oe as executeAddNamedTypes,ne as executeApplyEdits,Pe as executeCreateReplica,De as executeDeleteDomain,ue as executeDeleteGraphFieldIndex,ce as executeDeleteGraphProperty,de as executeDeleteNamedType,Te as executeFindPaths,Ge as executeFindPathsAsynchronous,we as executeQuery,ge as executeQueryStreaming,ye as executeSearch,fe as executeSearchStreaming,Ie as executeUnregisterReplica,Re as executeUpdateDomain,pe as executeUpdateGraphProperty,ie as executeUpdateNamedType,he as executeUpdateSearchIndex,me as fetchAllClientDataKeys,ve as fetchAsynchronousFindPathsResultData,_e as fetchClientDataAtKeys,ke as fetchKnowledgeGraph,Se as fetchReplicaDefinition,Ee as fetchReplicasInformation,ae as kgRestServices,xe as refreshDataModel,be as refreshServiceDefinition};
2
+ import{id as e}from"../kernel.js";import t from"../request.js";import r from"../core/Error.js";import a from"../core/Logger.js";import{isAbortError as n}from"../core/promiseUtils.js";import o from"../geometry/Geometry.js";import d from"../geometry/SpatialReference.js";import{submitJob as i}from"./geoprocessor/submitJob.js";import s from"./knowledgeGraph/GraphQueryResult.js";import c from"./knowledgeGraph/GraphQueryResultHeader.js";import p from"./knowledgeGraph/GraphQueryStreamingResult.js";import l from"./knowledgeGraph/KnowledgeGraph.js";import u from"./knowledgeGraph/ServiceDefinition.js";import{encodeClientDataAtKeysRequest as h}from"./knowledgeGraph/wasmInterface/clientDataToWasmEncodedFactories.js";import{getWasmInterface as w}from"./knowledgeGraph/wasmInterface/knowledgeWasmAccess.js";import{bindParamArrayToWasm as g,setInputQuantizationParametersOnEncoder as y,setOutputQuantizationParametersOnEncoder as f,setProvenanceBehaviorOnEncoder as m,geometryToWasm as _,bindParamObjectToWasm as k}from"./knowledgeGraph/wasmInterface/queryToWasmEncodedFactories.js";import{replicaIdsToWasmUnregisterReplicaRequestEncoder as x,replicaToWasmCreateReplicaRequestEncoder as b}from"./knowledgeGraph/wasmInterface/replicaToWasmEncodedFactories.js";import{domainToWasm as G,updateSearchPropertiesToWasm as T,fieldIndexToWasm as v,updateGraphPropertyToWasm as A,graphPropertyToWasm as R,updateEntityTypeToWasm as D,updateRelationshipTypeToWasm as P,entityTypeToWasm as S,relationshipTypeToWasm as E,inputQuantizationParametersToWasmFormat as I,namedObjectToWasm as M}from"./knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js";import{wasmClientDataAllKeysResponseToClientDataKeys as C,wasmClientDataFetchResponseToClientData as q}from"./knowledgeGraph/wasmInterface/wasmToClientDataFactories.js";import{decoderToAddNamedTypesResult as F,decoderToDeleteNamedTypeResult as U,decoderToUpdateNamedTypesResult as j,decoderToAddGraphPropertiesResult as $,decoderToDeleteGraphPropertiesResult as K,decoderToUpdateGraphPropertiesResult as N,decoderToGraphAddIndexResult as L,decoderToGraphDeleteIndexResult as Q,decoderToGraphUpdateSearchIndexResult as O,decoderToGraphDataModelSingletonOperationResult as W}from"./knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js";import{wasmToDataModel as H}from"./knowledgeGraph/wasmInterface/wasmToDataModelFactories.js";import{wasmToGraphQueryResponseHeader as B,decodedWasmObjToQueryResponseObj as z}from"./knowledgeGraph/wasmInterface/wasmToQueryResponseObjFactories.js";import{decoderToReplicasInformationResponse as V,decoderToReplicaDefinition as J,decoderToUnregisterReplicaResponse as Y,decoderToCreateReplicaResponse as X}from"./knowledgeGraph/wasmInterface/wasmToReplicaFactories.js";import{decoderToApplyEditsResponse as Z}from"./knowledgeGraph/wasmInterface/wasmToUpdateResponseFactories.js";import{checkWasmError as ee}from"./knowledgeGraph/wasmInterface/wasmUtils.js";const te=new Map,re=()=>new Map(te.entries()),ae={fetchKnowledgeGraph:async e=>{const t=new l({url:e}),r=[];return r.push(xe(t)),r.push(be(t)),await Promise.all(r),t},refreshDataModel:async e=>{e.dataModel=await xt(e)},refreshServiceDefinition:async e=>{const r=(await t(e.url,{query:{f:"json"}})).data;return r.capabilities=r?.capabilities?.split(","),r.supportedQueryFormats=r?.supportedQueryFormats?.split(","),e.serviceDefinition=new u(r),e.serviceDefinition},executeFindPathsAsynchronous:async(e,t)=>{const a=e.inKnowledgeGraphUrl.split("/rest/services");if(a.length<2)throw new r("knowledge-graph:invalid-tool-url","The URL for the KG Service was not correctly formatted. It should contain /rest/services/");const n=a[0],o=(await Fe(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,d=`/rest/services/${o&&o<12?"System":"Utilities"}/KnowledgeGraphServerToolsAsync/GPServer/ServerFilteredFindPaths`;return await qe(`${n}${d}`,{in_knowledge_graph_url:e.inKnowledgeGraphUrl,config_type:"STRING",config_string:e.config.toJSON(),result_type:"STRING"},{},t)},executeFindPaths:async(e,t)=>{const a=e.inKnowledgeGraphUrl.split("/rest/services");if(a.length<2)throw new r("knowledge-graph:invalid-tool-url","The URL for the KG Service was not correctly formatted. It should contain /rest/services/");const n=a[0],o=(await Fe(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,d=`/rest/services/${o&&o<12?"System":"Utilities"}/KnowledgeGraphServerTools/GPServer/ServerFilteredFindPaths/execute`,i=await Fe(`${n}${d}`,{method:"post",query:{f:"json",in_knowledge_graph_url:e.inKnowledgeGraphUrl,config_type:"STRING",config_string:JSON.stringify(e.config),result_type:"STRING"},...t});if(i.data.results.length<1)throw new r("knowledge-graph:no-results","No results were returned from the FindPaths tool - no results returned",i);let s;for(const r of i.data.results)if("out_results_string"===r.paramName){s=r.value;break}if(!s)throw new r("knowledge-graph:no-results","No results were returned from the FindPaths tool - no results were returned on the expected paramater out_results_string",i);return s},fetchAsynchronousFindPathsResultData:async(e,t)=>(await e.fetchResultData("out_results_string",null,t)).value,executeQueryStreaming:async(e,t,a)=>{const n="include",o=`${e.url}/graph/query`;await Ue(e);const d=await et(o,a);if(!e.serviceDefinition?.supportsProvenance&&t.provenanceBehavior===n)throw new r("knowledge-graph:provenance-not-supported","The Knowledge Graph Service definition indicated that provenance is not supported");d.data.body=await Xe(t,e);const i=await Ce(d.data.url,d.data);if(e.dataModel){const t=await kt(i,e.dataModel);return new p({resultRowsStream:t.readableStream,resultHeader:t.resultHeader})}throw new r("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,t,a)=>{if(e.serviceDefinition?.dataEditingNotSupported||null!=e.dataModel.arcgisManaged&&!e.dataModel.arcgisManaged)throw new r("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await Ue(e);const o=await et(n,a);o.data.body=await $e(t,e);return rt(await Ce(o.data.url,o.data))},executeAddNamedTypes:async(e,t,a)=>{if(!t.newEntityTypes?.length&&!t.newRelationshipTypes?.length)throw new r("knowledge-graph:no-arguments","The operation to add types to the data model contained no values");const n=`${e.url}/dataModel/edit/namedTypes/add`;await Ue(e);const o=await et(n,a);o.data.body=await Ke(t);const d=await Ce(o.data.url,o.data),i=await at(d);return i.updatedKnowledgeGraph=await ke(e.url),i},executeDeleteNamedType:async(e,t,a)=>{if(!t)throw new r("knowledge-graph:no-arguments","The operation to delete a named type from the data model contained no value");const n=`${e.url}/dataModel/edit/namedTypes/${t}/delete`;await Ue(e);const o=await et(n,a);o.data.body="";const d=await Ce(o.data.url,o.data),i=await nt(d);return i.updatedKnowledgeGraph=await ke(e.url),i},executeUpdateNamedType:async(e,t,a,n)=>{if(!t&&!Object.keys(a).length)throw new r("knowledge-graph:no-arguments","The operation to update types in the data model contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/update`;await Ue(e);const d=await et(o,n);d.data.body=await Ne(a,t,e.dataModel);const i=await Ce(d.data.url,d.data),s=await ot(i);return s.updatedKnowledgeGraph=await ke(e.url),s},executeAddGraphProperties:async(e,t,a,n)=>{if(!t&&!a.length)throw new r("knowledge-graph:no-arguments","The operation to add properties to the data model contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/fields/add`;await Ue(e);const d=await et(o,n);d.data.body=await Le(a);const i=await Ce(d.data.url,d.data),s=await dt(i);return s.updatedKnowledgeGraph=await ke(e.url),s},executeDeleteGraphProperty:async(e,t,a,n)=>{if(!t&&!a)throw new r("knowledge-graph:no-arguments","The operation to delete property contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/fields/delete`;await Ue(e);const d=await et(o,n);d.data.body=await Qe(a);const i=await Ce(d.data.url,d.data),s=await it(i);return s.updatedKnowledgeGraph=await ke(e.url),s},executeUpdateGraphProperty:async(e,t,a,n,o)=>{if(!t&&!a&&!Object.keys(n).length)throw new r("knowledge-graph:no-arguments","The operation to update properties in the data model contained missing or empty values");const d=`${e.url}/dataModel/edit/namedTypes/${t}/fields/update`;await Ue(e);const i=await et(d,o);i.data.body=await Oe(a,n);const s=await Ce(i.data.url,i.data),c=await st(s);return c.updatedKnowledgeGraph=await ke(e.url),c},executeAddGraphFieldIndex:async(e,t,a,n)=>{if(!t)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!a?.length)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty field index values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/indexes/add`;await Ue(e);const d=await et(o,n);d.data.body=await We(a);const i=await Ce(d.data.url,d.data),s=await ct(i);return s.updatedKnowledgeGraph=await ke(e.url),s},executeDeleteGraphFieldIndex:async(e,t,a,n)=>{if(!t)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!a?.length)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty field index values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/indexes/delete`;await Ue(e);const d=await et(o,n);d.data.body=await Je(a);const i=await Ce(d.data.url,d.data),s=await pt(i);return s.updatedKnowledgeGraph=await ke(e.url),s},executeUpdateSearchIndex:async(e,t,a,n)=>{if(!t)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!Object.keys(a.addSearchProperties??{}).length&&!Object.keys(a.removeSearchProperties??{}).length)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty properties values");const o=`${e.url}/dataModel/searchIndex/update`;await Ue(e);const d=await et(o,n);d.data.body=await Ye(t,a);const i=await Ce(d.data.url,d.data),s=await lt(i);return s.updatedKnowledgeGraph=await ke(e.url),s},executeAddDomain:async(e,t,r,{mergePolicy:a="esriMergePolicyTypeDefaultValue",splitPolicy:n="esriSplitPolicyTypeDefaultValue"},o)=>{const d=`${e.url}/dataModel/domains/add`;await Ue(e);const i=await et(d,o);i.data.body=await He(t,r,{mergePolicy:a,splitPolicy:n});const s=await Ce(i.data.url,i.data),c=await ut(s);return c.updatedKnowledgeGraph=await ke(e.url),c},executeUpdateDomain:async(e,t,r,a,n)=>{const o=`${e.url}/dataModel/domains/${t.name}/update`;await Ue(e);const d=await et(o,n);d.data.body=await Be(t,r,a);const i=await Ce(d.data.url,d.data),s=await ht(i);return s.updatedKnowledgeGraph=await ke(e.url),s},executeDeleteDomain:async(e,t,a)=>{const n=`${e.url}/dataModel/domains/${t}/delete`;if(!t)throw new r("knowledge-graph:no-arguments","The operation to delete a domain from the data model contained missing or empty domain name");await Ue(e);const o=await et(n,a);o.data.body="";const d=await Ce(o.data.url,o.data),i=await wt(d);return i.updatedKnowledgeGraph=await ke(e.url),i},executeCreateReplica:async(e,t,r)=>{const a=`${e.url}/replicas/create`;await Ue(e);const n=await et(a,r);n.data.body=await ze(t);return gt(await Ce(n.data.url,n.data))},fetchReplicaDefinition:async(e,a,n)=>{const o=`${e.url}/replicas/${a}`,d=await t(o,{responseType:"array-buffer",query:{f:"pbf",...n?.query},signal:n?.signal,timeout:n?.timeout}),i=d.getHeader?.("content-type"),s=d.data;if(i?.includes("application/x-protobuf")){const t=await w(),r=new t.ReplicaDefinitionResponseDecoder;return r.deleteLater(),r.decode(new Uint8Array(s)),r.has_error()&&ee(r.error,"knowledge-graph:fetchReplica-decoding-error","An error occurred while decoding the replica definition response"),J(r,t,e.dataModel)}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching a replica",{responseType:i,data:d.data})},fetchReplicasInformation:async(e,a)=>{const n=`${e.url}/replicas`,o=await t(n,{responseType:"array-buffer",query:{f:"pbf",...a?.query},signal:a?.signal,timeout:a?.timeout}),d=o.getHeader?.("content-type"),i=o.data;if(d?.includes("application/x-protobuf")){const e=new((await w()).ReplicasResponseDecoder);return e.deleteLater(),e.decode(new Uint8Array(i)),e.has_error()&&ee(e.error,"knowledge-graph:fetchReplicasInformation-decoding-error","An error occurred while decoding the replicas information response"),V(e)}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching replicas information",{responseType:d,data:o.data})},executeUnregisterReplica:async(e,t,a)=>{if(!0===t.unregisterAll&&"replicaIds"in t)throw new r("knowledge-graph:no-arguments","The operation to unregister replicas cannot include replica ids when unregisterAll is true");if(!0!==t.unregisterAll){const e="replicaIds"in t?t.replicaIds:void 0;if(!(Array.isArray(e)&&e.some(e=>!!e)))throw new r("knowledge-graph:no-arguments","The operation to unregister replicas requires at least one replica id")}const n=`${e.url}/replicas/unregister`;await Ue(e);const o=await et(n,a);o.data.body=await Ve(t);return yt(await Ce(o.data.url,o.data))},executeQuery:async(e,a,n)=>{const o=`${e.url}/graph/query`,d=await t(o,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:a.openCypherQuery,...n?.query},signal:n?.signal,timeout:n?.timeout}),i=d.getHeader?.("content-type"),c=d.data;if(i?.includes("application/x-protobuf")){const t=new((await w()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=_t({wasmQueryDecoder:t,newArrayBufferToParse:c,dataModel:e.dataModel});return new s({resultRows:r.resultRows,resultHeader:r.resultHeader})}throw new r("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:i,data:d.data})},executeSearch:async(e,a,n)=>{const o="provenance"===a.typeCategoryFilter?"metaEntityProvenance":a.typeCategoryFilter,d=`${e.url}/graph/search`,i=await t(d,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${a.searchQuery}"`,typeCategoryFilter:o,...n?.query},signal:n?.signal,timeout:n?.timeout}),c=i.getHeader?.("content-type"),p=i.data;if(c?.includes("application/x-protobuf")){const t=new((await w()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=_t({wasmQueryDecoder:t,newArrayBufferToParse:p,dataModel:e.dataModel});return new s({resultRows:r.resultRows,resultHeader:r.resultHeader})}throw new r("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:c,data:i.data})},executeSearchStreaming:async(e,t,a)=>{const n=`${e.url}/graph/search`;await Ue(e);const o=await et(n,a);o.data.body=await Ze(t);const d=await Ce(o.data.url,o.data);if(e.dataModel){const t=await kt(d,e.dataModel);return new p({resultRowsStream:t.readableStream,resultHeader:t.resultHeader})}throw new r("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},fetchClientDataAtKeys:async(e,t,a={ignoreCache:!1})=>{if(!t.length)return new Map;let n=te.get(e.url||"");n||(n=new Map,te.set(e.url||"",n));const o=new Map(n.entries()),d=`${e.url}/clientData/fetch`;t=Array.from(new Set(t));const i=await w(),s=h(t,n,i,a.ignoreCache),c=await et(d,a.requestOptions);c.data.body=s;const p=await Ce(c.data.url,c.data),l=p.headers.get("content-type");if(l?.includes("application/x-protobuf")){const e=new i.ClientDataFetchResponseDecoder;e.deleteLater();const t=await p.arrayBuffer();return e.decode(new Uint8Array(t)),e.has_error()&&ee(e.error,"knowledge-graph:fetchClientDataAtKeys-decoding-error","An error occurred while decoding the client data keys response"),q(e,n,o,a.ignoreCache)}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching client data",{responseType:l,data:p})},fetchAllClientDataKeys:async(e,a)=>{const n=`${e.url}/clientData`,o=await t(n,{responseType:"array-buffer",query:{f:"pbf"},signal:a?.signal,timeout:a?.timeout}),d=o.getHeader?.("content-type"),i=o.data;if(d?.includes("application/x-protobuf")){const e=new((await w()).ClientDataKeysResponseDecoder);return e.deleteLater(),e.decode(new Uint8Array(i)),e.has_error()&&ee(e.error,"knowledge-graph:fetchAllClientDataKeys-decoding-error","An error occurred while decoding the client data keys response"),C(e)}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:d,data:o.data})},clearClientDataCache:()=>te.clear(),_fetchWrapper:async(e,t)=>fetch(e,t),_submitJobWrapper:async(e,t,r,a)=>i(e,t,r,a),_esriRequestWrapper:async(e,r)=>t(e,r)};async function ne(e,t,r){return ae.executeApplyEdits(e,t,r)}async function oe(e,t,r){return ae.executeAddNamedTypes(e,t,r)}async function de(e,t,r){return ae.executeDeleteNamedType(e,t,r)}async function ie(e,t,r,a){return ae.executeUpdateNamedType(e,t,r,a)}async function se(e,t,r,a){return ae.executeAddGraphProperties(e,t,r,a)}async function ce(e,t,r,a){return ae.executeDeleteGraphProperty(e,t,r,a)}async function pe(e,t,r,a,n){return ae.executeUpdateGraphProperty(e,t,r,a,n)}async function le(e,t,r,a){return ae.executeAddGraphFieldIndex(e,t,r,a)}async function ue(e,t,r,a){return ae.executeDeleteGraphFieldIndex(e,t,r,a)}async function he(e,t,r,a){return ae.executeUpdateSearchIndex(e,t,r,a)}async function we(e,t,r){return ae.executeQuery(e,t,r)}async function ge(e,t,r){return ae.executeQueryStreaming(e,t,r)}async function ye(e,t,r){return ae.executeSearch(e,t,r)}async function fe(e,t,r){return ae.executeSearchStreaming(e,t,r)}function me(e,t){return ae.fetchAllClientDataKeys(e,t)}function _e(e,t,r){return ae.fetchClientDataAtKeys(e,t,r)}async function ke(e){return ae.fetchKnowledgeGraph(e)}async function xe(e){return ae.refreshDataModel(e)}async function be(e){return ae.refreshServiceDefinition(e)}async function Ge(e,t){return ae.executeFindPathsAsynchronous(e,t)}async function Te(e,t){return ae.executeFindPaths(e,t)}async function ve(e,t){return ae.fetchAsynchronousFindPathsResultData(e,t)}async function Ae(e,t,r,a={mergePolicy:"esriMergePolicyTypeDefaultValue",splitPolicy:"esriSplitPolicyTypeDefaultValue"},n){return ae.executeAddDomain(e,t,r,a,n)}async function Re(e,t,r,a,n){return ae.executeUpdateDomain(e,t,r,a,n)}async function De(e,t,r){return ae.executeDeleteDomain(e,t,r)}async function Pe(e,t,r){return ae.executeCreateReplica(e,t,r)}async function Se(e,t,r){return ae.fetchReplicaDefinition(e,t,r)}async function Ee(e,t){return ae.fetchReplicasInformation(e,t)}async function Ie(e,t,r){return ae.executeUnregisterReplica(e,t,r)}function Me(){return ae.clearClientDataCache()}async function Ce(e,t){return ae._fetchWrapper(e,t)}async function qe(e,t,r,a){return ae._submitJobWrapper(e,t,r,a)}async function Fe(e,t){return ae._esriRequestWrapper(e,t)}async function Ue(t){const r=e?.findCredential(t.url);r||(t.dataModel?await xt(t):await xe(t))}function je(e,t,r,a){null==t?r.set_param_key_value(e,""):"object"!=typeof t||t instanceof Date?r.set_param_key_value(e,t):t instanceof o?r.set_param_key_value(e,_(t,a)):Array.isArray(t)?r.set_param_key_value(e,g(t,a)):r.set_param_key_value(e,k(t,a))}async function $e(e,t){if(t.dataModel||await xe(t),!t.dataModel)throw new r("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const a=await w(),n=!!e.options?.cascadeDelete,o=!!e.options?.cascadeProvenanceDelete,d=new a.GraphApplyEditsEncoder(a.SpatialReferenceUtil.WGS84(),e.options?.inputQuantizationParameters?I(e.options?.inputQuantizationParameters):a.InputQuantizationUtil.WGS84_lossless());d.deleteLater(),d.cascade_delete=n,d.cascade_delete_provenance=o;try{let t;e.entityAdds?.forEach(e=>{t=d.add_entity(M(e,a)),ee(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipAdds?.forEach(e=>{if(!e.originId||!e.destinationId)throw new r("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");t=d.add_relationship(M(e,a)),ee(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityUpdates?.forEach(e=>{if(!e.id)throw new r("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=d.update_entity(M(e,a)),ee(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipUpdates?.forEach(e=>{if(!e.id)throw new r("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=d.update_relationship(M(e,a)),ee(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityDeletes?.forEach(e=>{if(!e.typeName)throw new r("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=d.make_delete_helper(e.typeName,!0);t.deleteLater(),e.ids?.forEach(e=>{t.delete_by_id(e)})}),e.relationshipDeletes?.forEach(e=>{if(!e.typeName)throw new r("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=d.make_delete_helper(e.typeName,!1);e.ids?.forEach(e=>{t.delete_by_id(e)})}),d.encode()}catch(s){throw new r("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:s})}const i=d.get_encoding_result();return ee(i.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),structuredClone(i.get_byte_buffer())}async function Ke(e){const t=await w(),a=new t.GraphNamedObjectTypeAddsRequestEncoder;a.deleteLater(),e.newEntityTypes?.forEach(e=>{a.add_entity_type(S(e,t))}),e.newRelationshipTypes?.forEach(e=>{a.add_relationship_type(E(e,t))});try{a.encode()}catch(o){throw new r("knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed",{error:o})}const n=a.get_encoding_result();return ee(n.error,"knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed"),structuredClone(n.get_byte_buffer())}async function Ne(e,t,a){const n=await w(),o=new n.GraphNamedObjectTypeUpdateRequestEncoder;o.deleteLater();if(a.entityTypes.some(e=>e.name===t))o.update_entity_type(D(e,n));else{if(!a.relationshipTypes.some(e=>e.name===t))throw new r("knowledge-graph:updateNamedType-encoding-failed","The named type you are trying to update does not exist in the data model");o.update_relationship_type(P(e,n))}o.update_alias=e.hasOwnProperty("alias");try{o.encode()}catch(i){throw new r("knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed",{error:i})}const d=o.get_encoding_result();return ee(d.error,"knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed"),structuredClone(d.get_byte_buffer())}async function Le(e){const t=await w(),a=new t.GraphPropertyAddsRequestEncoder;a.deleteLater(),e.forEach(e=>{a.add_graph_property(R(e,t))});try{a.encode()}catch(o){throw new r("knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed",{error:o})}const n=a.get_encoding_result();return ee(n.error,"knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed"),structuredClone(n.get_byte_buffer())}async function Qe(e){const t=new((await w()).GraphPropertyDeleteRequestEncoder);t.deleteLater(),t.field_name=e;try{t.encode()}catch(n){throw new r("knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed",{error:n})}const a=t.get_encoding_result();return ee(a.error,"knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed"),structuredClone(a.get_byte_buffer())}async function Oe(e,t){const a=await w(),n=new a.GraphPropertyUpdateRequestEncoder;n.deleteLater(),n.update_graph_property(A(t,a)),n.set_property_name(e),n.update_alias=t.hasOwnProperty("alias"),n.update_editable=t.hasOwnProperty("editable"),n.update_required=t.hasOwnProperty("required"),n.update_visible=t.hasOwnProperty("defaultVisibility"),n.update_default_value=t.hasOwnProperty("defaultValue"),n.update_domain=t.hasOwnProperty("domain");try{n.encode()}catch(d){throw new r("knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed",{error:d})}const o=n.get_encoding_result();return ee(o.error,"knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed"),structuredClone(o.get_byte_buffer())}async function We(e){const t=await w(),a=new t.GraphIndexAddsRequestEncoder;a.deleteLater(),e.forEach(e=>{a.add_field_index(v(e,t))});try{a.encode()}catch(o){throw new r("knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed",{error:o})}const n=a.get_encoding_result();return ee(n.error,"knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed"),structuredClone(n.get_byte_buffer())}async function He(e,t,a){const n=await w(),o=new n.GraphDomainAddRequestEncoder;o.deleteLater(),o.set_domain(G(e,n,t,a));try{o.encode()}catch(i){throw new r("knowledge-graph:addDomain-encoding-failed","Attempting to encode the domain failed",{error:i})}const d=o.get_encoding_result();return ee(d.error,"knowledge-graph:addDomain-encoding-failed","Attempting to encode the domain failed"),structuredClone(d.get_byte_buffer())}async function Be(e,t,a){const n=await w(),o=new n.GraphDomainUpdateRequestEncoder;o.deleteLater(),o.set_domain(G(e,n,t,a)),o.update_domain=!0,a?.mergePolicy&&(o.update_merge_policy=!0),a?.splitPolicy&&(o.update_split_policy=!0);try{o.encode()}catch(i){throw new r("knowledge-graph:updateDomain-encoding-failed","Attempting to encode the domain failed",{error:i})}const d=o.get_encoding_result();return ee(d.error,"knowledge-graph:updateDomain-encoding-failed","Attempting to encode the domain failed"),structuredClone(d.get_byte_buffer())}async function ze(e){const t=await w(),a=b(e,t);try{a.encode()}catch(o){throw new r("knowledge-graph:createReplica-encoding-failed","Attempting to encode createReplica failed",{error:o})}const n=a.get_encoding_result();return ee(n.error,"knowledge-graph:createReplica-encoding-failed","Attempting to encode createReplica failed"),structuredClone(n.get_byte_buffer())}async function Ve(e){const t=await w(),a=x(e,t);try{a.encode()}catch(o){throw new r("knowledge-graph:unregisterReplica-encoding-failed","Attempting to encode unregisterReplica failed",{error:o})}const n=a.get_encoding_result();return ee(n.error,"knowledge-graph:unregisterReplica-encoding-failed","Attempting to encode unregisterReplica failed"),structuredClone(n.get_byte_buffer())}async function Je(e){const t=new((await w()).GraphIndexDeleteRequestEncoder);t.deleteLater(),e.forEach(e=>{t.add_index_name(e)});try{t.encode()}catch(n){throw new r("knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed",{error:n})}const a=t.get_encoding_result();return ee(a.error,"knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed"),structuredClone(a.get_byte_buffer())}async function Ye(e,t){const a=await w(),n=new a.GraphUpdateSearchIndexRequestEncoder;n.deleteLater(),t.hasOwnProperty("addSearchProperties")&&n.insert_add_search_property(e,T(t.addSearchProperties,a)),t.hasOwnProperty("removeSearchProperties")&&n.insert_delete_search_property(e,T(t.removeSearchProperties,a));try{n.encode()}catch(d){throw new r("knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed",{error:d})}const o=n.get_encoding_result();return ee(o.error,"knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed"),structuredClone(o.get_byte_buffer())}async function Xe(e,t){const a=await w(),n=new a.GraphQueryRequestEncoder;if(n.deleteLater(),e.outputSpatialReference?n.output_spatial_reference={wkid:e.outputSpatialReference.wkid,latestWkid:e.outputSpatialReference.latestWkid,vcsWkid:e.outputSpatialReference.vcsWkid,latestVcsWkid:e.outputSpatialReference.latestVcsWkid,wkt:e.outputSpatialReference.wkt??""}:n.output_spatial_reference=a.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[r,i]of Object.entries(e.bindParameters))je(r,i,n,a);if(e.bindGeometryQuantizationParameters)y(e.bindGeometryQuantizationParameters,n);else{if(t.dataModel||await xe(t),4326!==t.dataModel?.spatialReference?.wkid)throw new r("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=a.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&f(e.outputQuantizationParameters,n,a),e.provenanceBehavior&&m(e.provenanceBehavior,n);try{n.encode()}catch(d){throw new r("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:d})}const o=n.get_encoding_result();if(0!==o.error.error_code)throw new r("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}async function Ze(e){const t=await w(),a=new t.GraphSearchRequestEncoder;a.deleteLater(),a.search_query=e.searchQuery;const n="provenance"===e.typeCategoryFilter?"meta_entity_provenance":e.typeCategoryFilter;if(a.type_category_filter=t.esriNamedTypeCategory[n],!0===e.returnSearchContext&&(a.return_search_context=e.returnSearchContext),null!=e.start&&e.start>0&&(a.start_index=e.start),null!=e.num&&(a.max_num_results=e.num),null!=e.idsFilter&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{a.set_ids_filter(g(e.idsFilter,t))}catch(d){throw new r("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:d})}e.namedTypesFilter?.forEach(e=>{a.add_named_type_filter(e)});try{a.encode()}catch(d){throw new r("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:d})}const o=a.get_encoding_result();if(0!==o.error.error_code)throw new r("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}async function et(e,r){return t(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...r?.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:r?.signal,timeout:r?.timeout})}async function tt(e,t,a){const n=e.headers.get("content-type");if(n?.includes("application/x-protobuf")){const r=await e.arrayBuffer(),n=new t;try{return n.decode(new Uint8Array(r)),a(n)}finally{n.deleteLater()}}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:await e.text()})}async function rt(e){return tt(e,(await w()).GraphApplyEditsDecoder,Z)}async function at(e){return tt(e,(await w()).GraphNamedObjectTypeAddsResponseDecoder,F)}async function nt(e){return tt(e,(await w()).GraphNamedObjectTypeDeleteResponseDecoder,U)}async function ot(e){return tt(e,(await w()).GraphNamedObjectTypeUpdateResponseDecoder,j)}async function dt(e){return tt(e,(await w()).GraphPropertyAddsResponseDecoder,$)}async function it(e){return tt(e,(await w()).GraphPropertyDeleteResponseDecoder,K)}async function st(e){return tt(e,(await w()).GraphPropertyUpdateResponseDecoder,N)}async function ct(e){return tt(e,(await w()).GraphIndexAddsResponseDecoder,L)}async function pt(e){return tt(e,(await w()).GraphIndexDeleteResponseDecoder,Q)}async function lt(e){return tt(e,(await w()).GraphUpdateSearchIndexResponseDecoder,O)}async function ut(e){return tt(e,(await w()).GraphDomainAddResponseDecoder,W)}async function ht(e){return tt(e,(await w()).GraphDomainUpdateResponseDecoder,W)}async function wt(e){return tt(e,(await w()).GraphDomainDeleteResponseDecoder,W)}async function gt(e){const t=e.headers.get("content-type");if(t?.includes("application/x-protobuf")){const t=await e.arrayBuffer(),r=new((await w()).CreateReplicaResponseDecoder);try{return r.decode(new Uint8Array(t)),r.has_error()&&ee(r.error,"knowledge-graph:createReplica-decoding-error","An error occurred while decoding the createReplica response"),X(r)}finally{r.deleteLater()}}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response for createReplica",{responseType:t,data:await e.text()})}async function yt(e){const t=e.headers.get("content-type");if(t?.includes("application/x-protobuf")){const t=await e.arrayBuffer(),r=new((await w()).UnregisterReplicaResponseDecoder);try{return r.decode(new Uint8Array(t)),r.has_error()&&ee(r.error,"knowledge-graph:unregisterReplica-decoding-error","An error occurred while decoding the unregisterReplica response"),Y(r)}finally{r.deleteLater()}}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response for unregisterReplica",{responseType:t,data:await e.text()})}let ft=50;function mt(e){ft=e}function _t({wasmQueryDecoder:e,newArrayBufferToParse:t,dataModel:a,decodedHeader:n,limitMaxProcessingTime:o=!1}){t&&e.push_buffer(new Uint8Array(t));const i=[];let s,c,p=0;const l=Date.now();let u=!0;for(;e.next_row();){s&&c||(s=n??B(e),c=s.outSpatialReference??new d({wkid:4326})),p||(p=e.get_header_keys().size());const t=new Array(p);for(let r=0;r<p;r++){const n=e.get_value(r);t[r]=z(n,a,c)}if(i.push(t),o&&Date.now()-l>ft){u=!1;break}}if(e.has_error())throw new r("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - inner row decoding",{errorCode:e.error.error_code,errorMessage:e.error.error_message});return{resultHeader:s,resultRows:i,parsedAllResultsFromBuffer:u}}async function kt(e,t){const o=e.headers.get("content-type");if(e.headers.get("content-length")&&a.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").warnOnce("Found `Content-Length` header when expecting a streaming HTTP response! Please investigate whether all intermediate HTTP proxies and/or load balancers are configured such that they don't forcefully buffer the entire response before returning it to the client. A valid HTTP streaming response should use Chunked Transfer Encoding and not have a Content Length defined."),o?.includes("application/x-protobuf")){const o=e.body?.getReader(),d=new((await w()).GraphQueryDecoder);let i,s,p;d.deleteLater();const l=new Promise((e,t)=>{s=e,p=t});let u=!1,h=null;const g=new ReadableStream({pull:async function e(l){if(!o){const e=new r("knowledge-graph:stream-decoding-error","Error reading from stream - reader is undefined");throw p(e),e}const{done:w,value:g}=h?{done:!1,value:null}:await o.read().catch(e=>{throw p(e),o.releaseLock(),e});g&&(h=g);try{if(w){let e;if(d.has_error()?e=new r("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - query stream done",{errorCode:d.error.error_code,errorMessage:d.error.error_message}):u||s(new c),o.releaseLock(),e)throw l.error(e),p(e),e;return void l.close()}const{resultHeader:a,resultRows:n,parsedAllResultsFromBuffer:y}=_t({wasmQueryDecoder:d,newArrayBufferToParse:g,dataModel:t,decodedHeader:i,limitMaxProcessingTime:!0});return y&&(h=null),!i&&a&&(i=a,s(a),u=!0),n.length>0?void l.enqueue(n):await e(l)}catch(y){throw a.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").error(y),p(y),o.releaseLock(),n(y)?y:new r("knowledge-graph:unexpected-server-response","Error inside streaming data return parsing",{error:y})}}});return{readableStream:g,resultHeader:await l}}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:e.text()})}async function xt(e){const a=`${e.url}/dataModel/queryDataModel`,n=await t(a,{responseType:"array-buffer",query:{f:"pbf"}}),o=n.getHeader?.("content-type"),d=n.data;if(o?.includes("application/x-protobuf")){const e=(await w()).decode_data_model_from_protocol_buffer(new Uint8Array(d));if(!e)throw new r("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return H(e)}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:n.data})}export{Ue as _checkAuthentication,Fe as _esriRequestWrapper,Ce as _fetchWrapper,re as _getClientDataCacheCopy,mt as _setMaxQueryParsingDurationForTesting,qe as _submitJobWrapper,Me as clearClientDataCache,te as clientDataCache,Ae as executeAddDomain,le as executeAddGraphFieldIndex,se as executeAddGraphProperties,oe as executeAddNamedTypes,ne as executeApplyEdits,Pe as executeCreateReplica,De as executeDeleteDomain,ue as executeDeleteGraphFieldIndex,ce as executeDeleteGraphProperty,de as executeDeleteNamedType,Te as executeFindPaths,Ge as executeFindPathsAsynchronous,we as executeQuery,ge as executeQueryStreaming,ye as executeSearch,fe as executeSearchStreaming,Ie as executeUnregisterReplica,Re as executeUpdateDomain,pe as executeUpdateGraphProperty,ie as executeUpdateNamedType,he as executeUpdateSearchIndex,me as fetchAllClientDataKeys,ve as fetchAsynchronousFindPathsResultData,_e as fetchClientDataAtKeys,ke as fetchKnowledgeGraph,Se as fetchReplicaDefinition,Ee as fetchReplicasInformation,ae as kgRestServices,xe as refreshDataModel,be as refreshServiceDefinition};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../../core/Clonable.js";import{JSONMap as o}from"../../core/jsonMap.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import i from"../../core/Logger.js";import{property as s,subclass as n}from"../../core/accessorSupport/decorators.js";import{ensureType as a}from"../../core/accessorSupport/ensureType.js";import p from"../../geometry/SpatialReference.js";import{fromJSON as l}from"../../geometry/support/jsonUtils.js";import{geometryTypes as m}from"../../geometry/support/typeUtils.js";import{unitsKebabDict as u}from"../../layers/graphics/data/queryUtils.js";import d from"./AutoIntervalBinParameters.js";import y from"./BinParametersBase.js";import c from"./DateBinParameters.js";import j from"./FixedBoundariesBinParameters.js";import f from"./FixedIntervalBinParameters.js";import{spatialRelKebabDict as h}from"./spatialRelationships.js";import v from"./StatisticDefinition.js";import w from"../../time/TimeExtent.js";import{isTimeZoneValid as g}from"../../time/timeZoneUtils.js";import{enumeration as S}from"../../core/accessorSupport/decorators/enumeration.js";const b=new o({asc:"ascending",desc:"descending"}),B={base:y,key:"type",typeMap:{"auto-interval":d,date:c,"fixed-boundaries":j,"fixed-interval":f}};let R=class extends(t(r)){constructor(e){super(e),this.binParameters=null,this.binOrder="ascending",this.cacheHint=void 0,this.datumTransformation=null,this.defaultSpatialReference=null,this.distance=void 0,this.geometry=null,this.lowerBoundaryAlias=null,this.outSpatialReference=null,this.outStatistics=null,this.returnDistinctValues=null,this.spatialRelationship="intersects",this.timeExtent=null,this.upperBoundaryAlias=null,this.units=null,this.where="1=1"}set outTimeZone(e){this._set("outTimeZone",e),e&&!g(e)&&i.getLogger(this).warn("#outTimeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}};e([s({types:B,json:{name:"bin",write:!0}})],R.prototype,"binParameters",void 0),e([S(b)],R.prototype,"binOrder",void 0),e([s({type:Boolean,json:{write:!0}})],R.prototype,"cacheHint",void 0),e([s({json:{write:!0}})],R.prototype,"datumTransformation",void 0),e([s({type:p,json:{name:"defaultSR",write:!0}})],R.prototype,"defaultSpatialReference",void 0),e([s({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],R.prototype,"distance",void 0),e([s({types:m,json:{read:l,write:!0}})],R.prototype,"geometry",void 0),e([s({type:String,json:{write:!0}})],R.prototype,"lowerBoundaryAlias",void 0),e([s({type:p,json:{name:"outSR",write:!0}})],R.prototype,"outSpatialReference",void 0),e([s({type:[v],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],R.prototype,"outStatistics",void 0),e([s({value:null,json:{name:"outTimeReference",read:{reader:e=>e.ianaTimeZone},write:{writer:(e,t,o)=>{e&&(t[o]={ianaTimeZone:e})}}}})],R.prototype,"outTimeZone",null),e([s({type:Boolean,json:{name:"returnAggIds",write:{overridePolicy:e=>({enabled:null!=e})}}})],R.prototype,"returnAggregateIds",void 0),e([s({type:Boolean,json:{write:!0}})],R.prototype,"returnDistinctValues",void 0),e([S(h,{name:"spatialRel"})],R.prototype,"spatialRelationship",void 0),e([s({type:w,json:{write:!0}})],R.prototype,"timeExtent",void 0),e([s({type:String,json:{write:!0}})],R.prototype,"upperBoundaryAlias",void 0),e([s({type:String,json:{read:u.read,write:{writer:u.write,overridePolicy(e){return{enabled:null!=e&&null!=this.distance}}}}})],R.prototype,"units",void 0),e([s({type:String,json:{write:!0}})],R.prototype,"where",void 0),R=e([n("esri.rest.support.AttributeBinsQuery")],R),R.from=a(R);export{R as default};
2
+ import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../../core/Clonable.js";import{JSONMap as o}from"../../core/jsonMap.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import i from"../../core/Logger.js";import{property as s,subclass as n}from"../../core/accessorSupport/decorators.js";import{ensureType as a}from"../../core/accessorSupport/ensureType.js";import p from"../../geometry/SpatialReference.js";import{fromJSON as l}from"../../geometry/support/jsonUtils.js";import{geometryTypes as m}from"../../geometry/support/typeUtils.js";import{unitsKebabDict as u}from"../../layers/graphics/data/queryUtils.js";import d from"./AutoIntervalBinParameters.js";import y from"./BinParametersBase.js";import c from"./DateBinParameters.js";import j from"./FixedBoundariesBinParameters.js";import f from"./FixedIntervalBinParameters.js";import{spatialRelKebabDict as h}from"./spatialRelationships.js";import v from"./StatisticDefinition.js";import w from"../../time/TimeExtent.js";import{isTimeZoneValid as g}from"../../time/timeZoneUtils.js";import{enumeration as S}from"../../core/accessorSupport/decorators/enumeration.js";const b=new o({asc:"ascending",desc:"descending"}),B={base:y,key:"type",typeMap:{"auto-interval":d,date:c,"fixed-boundaries":j,"fixed-interval":f}};let R=class extends(t(r)){constructor(e){super(e),this.binParameters=null,this.binOrder="ascending",this.cacheHint=void 0,this.datumTransformation=null,this.defaultSpatialReference=null,this.distance=void 0,this.geometry=null,this.lowerBoundaryAlias=null,this.outSpatialReference=null,this.outStatistics=null,this.returnDistinctValues=null,this.spatialRelationship="intersects",this.timeExtent=null,this.upperBoundaryAlias=null,this.units=null,this.where="1=1"}set outTimeZone(e){this._set("outTimeZone",e),e&&!g(e)&&i.getLogger(this).warn("#outTimeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}};e([s({types:B,json:{name:"bin",write:!0}})],R.prototype,"binParameters",void 0),e([S(b)],R.prototype,"binOrder",void 0),e([s({type:Boolean,json:{write:!0}})],R.prototype,"cacheHint",void 0),e([s({json:{write:!0}})],R.prototype,"datumTransformation",void 0),e([s({type:p,json:{name:"defaultSR",write:!0}})],R.prototype,"defaultSpatialReference",void 0),e([s({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],R.prototype,"distance",void 0),e([s({types:m,json:{read:l,write:!0}})],R.prototype,"geometry",void 0),e([s({type:String,json:{write:!0}})],R.prototype,"lowerBoundaryAlias",void 0),e([s({type:p,json:{name:"outSR",write:!0}})],R.prototype,"outSpatialReference",void 0),e([s({type:[v],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],R.prototype,"outStatistics",void 0),e([s({value:null,json:{name:"outTimeReference",read:{reader:e=>e.ianaTimeZone},write:{writer:(e,t,o)=>{e&&(t[o]={ianaTimeZone:e})}}}})],R.prototype,"outTimeZone",null),e([s({type:Boolean,json:{name:"returnAggIds",write:{overridePolicy:e=>({enabled:null!=e})}}})],R.prototype,"returnAggregateIds",void 0),e([s({type:Boolean,json:{write:!0}})],R.prototype,"returnDistinctValues",void 0),e([S(h,{name:"spatialRel"})],R.prototype,"spatialRelationship",void 0),e([s({type:w,json:{write:!0}})],R.prototype,"timeExtent",void 0),e([s({type:String,json:{write:!0}})],R.prototype,"upperBoundaryAlias",void 0),e([s({type:String,json:{read:u.read,write:{writer:u.write,overridePolicy(e){return{enabled:null!=e&&!!this.distance}}}}})],R.prototype,"units",void 0),e([s({type:String,json:{write:!0}})],R.prototype,"where",void 0),R=e([n("esri.rest.support.AttributeBinsQuery")],R),R.from=a(R);export{R as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{JSONMap as e}from"../../core/jsonMap.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{clone as i}from"../../core/lang.js";import{property as o,cast as s,subclass as n}from"../../core/accessorSupport/decorators.js";import{ensureClass as a}from"../../core/accessorSupport/ensureType.js";import l from"../../geometry/Point.js";import p from"../../geometry/SpatialReference.js";import{fromJSON as u}from"../../geometry/support/jsonUtils.js";import{geometryTypes as d}from"../../geometry/support/typeUtils.js";import m from"../layerSources/DynamicDataLayer.js";import c from"./FullTextSearch.js";import y from"./OutDistance.js";import h from"./QuantizationParameters.js";import{spatialRelKebabDict as f}from"./spatialRelationships.js";import j from"./StatisticDefinition.js";import g from"../../time/TimeExtent.js";import{writer as v}from"../../core/accessorSupport/decorators/writer.js";import{enumeration as w}from"../../core/accessorSupport/decorators/enumeration.js";var S;const R=new e({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let b=class extends r{static{S=this}static from(t){return a(S,t)}constructor(t){super(t),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnStatisticsAggregatedIds=!1,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnExceededLimitGeometries=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.returnTrueCurves=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.outDistance=null,this.where=null}castDatumTransformation(t){return"number"==typeof t||"object"==typeof t?t:null}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}writeParameterValues(t,e){if(t){const r={};for(const e in t){const i=t[e];Array.isArray(i)?r[e]=i.map(t=>t instanceof Date?t.getTime():t):i instanceof Date?r[e]=i.getTime():r[e]=i}e.parameterValues=r}}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10,e.where="1=1"}writeWhere(t,e){e.where=t||"1=1"}clone(){return new S(i({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:null!=this.historicMoment?new Date(this.historicMoment):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnStatisticsAggregatedIds:this.returnStatisticsAggregatedIds,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnExceededLimitGeometries:this.returnExceededLimitGeometries,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,returnTrueCurves:this.returnTrueCurves,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,outDistance:this.outDistance,where:this.where}))}static{this.MAX_MAX_RECORD_COUNT_FACTOR=5}};t([o({json:{write:!0}})],b.prototype,"aggregateIds",void 0),t([o({type:Boolean,json:{write:!0}})],b.prototype,"cacheHint",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"compactGeometryEnabled",void 0),t([o({json:{write:!0}})],b.prototype,"datumTransformation",void 0),t([s("datumTransformation")],b.prototype,"castDatumTransformation",null),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"defaultSpatialReferenceEnabled",void 0),t([o({type:Number,json:{write:!0}})],b.prototype,"distance",void 0),t([o({type:m,json:{write:!0}})],b.prototype,"dynamicDataSource",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"formatOf3DObjects",void 0),t([o({type:[c],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.fullText&&this.fullText.length>0}}}}})],b.prototype,"fullText",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"gdbVersion",void 0),t([o({types:d,json:{read:u,write:!0}})],b.prototype,"geometry",void 0),t([o({type:Number,json:{write:!0}})],b.prototype,"geometryPrecision",void 0),t([o({type:[String],json:{write:!0}})],b.prototype,"groupByFieldsForStatistics",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"having",void 0),t([o({type:Date})],b.prototype,"historicMoment",void 0),t([v("historicMoment")],b.prototype,"writeHistoricMoment",null),t([o({type:Number,json:{write:!0}})],b.prototype,"maxAllowableOffset",void 0),t([o({type:Number,cast:t=>t<1?1:t>b.MAX_MAX_RECORD_COUNT_FACTOR?b.MAX_MAX_RECORD_COUNT_FACTOR:t,json:{write:{overridePolicy:t=>({enabled:t>1})}}})],b.prototype,"maxRecordCountFactor",void 0),t([o({type:["xyFootprint"],json:{write:!0}})],b.prototype,"multipatchOption",void 0),t([o({type:Number,json:{read:{source:"resultRecordCount"}}})],b.prototype,"num",void 0),t([o({json:{write:!0}})],b.prototype,"objectIds",void 0),t([o({type:[String],json:{write:!0}})],b.prototype,"orderByFields",void 0),t([o({type:[String],json:{write:!0}})],b.prototype,"outFields",void 0),t([o({type:p,json:{name:"outSR",write:!0}})],b.prototype,"outSpatialReference",void 0),t([o({type:[j],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],b.prototype,"outStatistics",void 0),t([o({json:{write:!0}})],b.prototype,"parameterValues",void 0),t([v("parameterValues")],b.prototype,"writeParameterValues",null),t([o({type:l,json:{write:!0}})],b.prototype,"pixelSize",void 0),t([o({type:h,json:{write:!0}})],b.prototype,"quantizationParameters",void 0),t([o({type:[Object],json:{write:!0}})],b.prototype,"rangeValues",void 0),t([o({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:"relation"===this.spatialRelationship}}}}})],b.prototype,"relationParameter",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"resultType",void 0),t([o({type:Boolean,json:{name:"returnAggIds",write:{overridePolicy(t){return{enabled:t&&!!this.groupByFieldsForStatistics?.length&&!!this.outStatistics?.length}}}}})],b.prototype,"returnStatisticsAggregatedIds",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"returnCentroid",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"returnDistinctValues",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],b.prototype,"returnExceededLimitFeatures",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],b.prototype,"returnExceededLimitGeometries",void 0),t([o({type:Boolean,json:{write:!0}})],b.prototype,"returnGeometry",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"returnQueryGeometry",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"returnM",void 0),t([o({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],b.prototype,"returnZ",void 0),t([o({type:Boolean,json:{write:!0}})],b.prototype,"returnTrueCurves",void 0),t([o({type:p,json:{write:!0}})],b.prototype,"sourceSpatialReference",void 0),t([w(f,{ignoreUnknown:!1,name:"spatialRel"})],b.prototype,"spatialRelationship",void 0),t([o({type:Number,json:{read:{source:"resultOffset"}}})],b.prototype,"start",void 0),t([v("start"),v("num")],b.prototype,"writeStart",null),t([o({type:String,json:{write:!0}})],b.prototype,"sqlFormat",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"text",void 0),t([o({type:g,json:{write:!0}})],b.prototype,"timeExtent",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"timeReferenceUnknownClient",void 0),t([w(R,{ignoreUnknown:!1}),o({json:{write:{overridePolicy(t){return{enabled:!!t&&null!=this.distance}}}}})],b.prototype,"units",void 0),t([o({type:y,json:{write:!0}})],b.prototype,"outDistance",void 0),t([o({type:String,json:{write:{overridePolicy(t){return{enabled:null!=t||null!=this.start&&this.start>0}}}}})],b.prototype,"where",void 0),t([v("where")],b.prototype,"writeWhere",null),b=S=t([n("esri.rest.support.Query")],b);export{b as default};
2
+ import{__decorate as t}from"tslib";import{JSONMap as e}from"../../core/jsonMap.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{clone as i}from"../../core/lang.js";import{property as o,cast as s,subclass as n}from"../../core/accessorSupport/decorators.js";import{ensureClass as a}from"../../core/accessorSupport/ensureType.js";import l from"../../geometry/Point.js";import p from"../../geometry/SpatialReference.js";import{fromJSON as u}from"../../geometry/support/jsonUtils.js";import{geometryTypes as d}from"../../geometry/support/typeUtils.js";import m from"../layerSources/DynamicDataLayer.js";import c from"./FullTextSearch.js";import y from"./OutDistance.js";import h from"./QuantizationParameters.js";import{spatialRelKebabDict as f}from"./spatialRelationships.js";import j from"./StatisticDefinition.js";import v from"../../time/TimeExtent.js";import{writer as g}from"../../core/accessorSupport/decorators/writer.js";import{enumeration as w}from"../../core/accessorSupport/decorators/enumeration.js";var S;const R=new e({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let b=class extends r{static{S=this}static from(t){return a(S,t)}constructor(t){super(t),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnStatisticsAggregatedIds=!1,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnExceededLimitGeometries=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.returnTrueCurves=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.outDistance=null,this.where=null}castDatumTransformation(t){return"number"==typeof t||"object"==typeof t?t:null}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}writeParameterValues(t,e){if(t){const r={};for(const e in t){const i=t[e];Array.isArray(i)?r[e]=i.map(t=>t instanceof Date?t.getTime():t):i instanceof Date?r[e]=i.getTime():r[e]=i}e.parameterValues=r}}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10,e.where="1=1"}writeWhere(t,e){e.where=t||"1=1"}clone(){return new S(i({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:null!=this.historicMoment?new Date(this.historicMoment):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnStatisticsAggregatedIds:this.returnStatisticsAggregatedIds,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnExceededLimitGeometries:this.returnExceededLimitGeometries,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,returnTrueCurves:this.returnTrueCurves,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,outDistance:this.outDistance,where:this.where}))}static{this.MAX_MAX_RECORD_COUNT_FACTOR=5}};t([o({json:{write:!0}})],b.prototype,"aggregateIds",void 0),t([o({type:Boolean,json:{write:!0}})],b.prototype,"cacheHint",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"compactGeometryEnabled",void 0),t([o({json:{write:!0}})],b.prototype,"datumTransformation",void 0),t([s("datumTransformation")],b.prototype,"castDatumTransformation",null),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"defaultSpatialReferenceEnabled",void 0),t([o({type:Number,json:{write:{overridePolicy:t=>({enabled:!!t})}}})],b.prototype,"distance",void 0),t([o({type:m,json:{write:!0}})],b.prototype,"dynamicDataSource",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"formatOf3DObjects",void 0),t([o({type:[c],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.fullText&&this.fullText.length>0}}}}})],b.prototype,"fullText",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"gdbVersion",void 0),t([o({types:d,json:{read:u,write:!0}})],b.prototype,"geometry",void 0),t([o({type:Number,json:{write:!0}})],b.prototype,"geometryPrecision",void 0),t([o({type:[String],json:{write:!0}})],b.prototype,"groupByFieldsForStatistics",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"having",void 0),t([o({type:Date})],b.prototype,"historicMoment",void 0),t([g("historicMoment")],b.prototype,"writeHistoricMoment",null),t([o({type:Number,json:{write:!0}})],b.prototype,"maxAllowableOffset",void 0),t([o({type:Number,cast:t=>t<1?1:t>b.MAX_MAX_RECORD_COUNT_FACTOR?b.MAX_MAX_RECORD_COUNT_FACTOR:t,json:{write:{overridePolicy:t=>({enabled:t>1})}}})],b.prototype,"maxRecordCountFactor",void 0),t([o({type:["xyFootprint"],json:{write:!0}})],b.prototype,"multipatchOption",void 0),t([o({type:Number,json:{read:{source:"resultRecordCount"}}})],b.prototype,"num",void 0),t([o({json:{write:!0}})],b.prototype,"objectIds",void 0),t([o({type:[String],json:{write:!0}})],b.prototype,"orderByFields",void 0),t([o({type:[String],json:{write:!0}})],b.prototype,"outFields",void 0),t([o({type:p,json:{name:"outSR",write:!0}})],b.prototype,"outSpatialReference",void 0),t([o({type:[j],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],b.prototype,"outStatistics",void 0),t([o({json:{write:!0}})],b.prototype,"parameterValues",void 0),t([g("parameterValues")],b.prototype,"writeParameterValues",null),t([o({type:l,json:{write:!0}})],b.prototype,"pixelSize",void 0),t([o({type:h,json:{write:!0}})],b.prototype,"quantizationParameters",void 0),t([o({type:[Object],json:{write:!0}})],b.prototype,"rangeValues",void 0),t([o({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:"relation"===this.spatialRelationship}}}}})],b.prototype,"relationParameter",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"resultType",void 0),t([o({type:Boolean,json:{name:"returnAggIds",write:{overridePolicy(t){return{enabled:t&&!!this.groupByFieldsForStatistics?.length&&!!this.outStatistics?.length}}}}})],b.prototype,"returnStatisticsAggregatedIds",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"returnCentroid",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"returnDistinctValues",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],b.prototype,"returnExceededLimitFeatures",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],b.prototype,"returnExceededLimitGeometries",void 0),t([o({type:Boolean,json:{write:!0}})],b.prototype,"returnGeometry",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"returnQueryGeometry",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"returnM",void 0),t([o({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],b.prototype,"returnZ",void 0),t([o({type:Boolean,json:{write:!0}})],b.prototype,"returnTrueCurves",void 0),t([o({type:p,json:{write:!0}})],b.prototype,"sourceSpatialReference",void 0),t([w(f,{ignoreUnknown:!1,name:"spatialRel"})],b.prototype,"spatialRelationship",void 0),t([o({type:Number,json:{read:{source:"resultOffset"}}})],b.prototype,"start",void 0),t([g("start"),g("num")],b.prototype,"writeStart",null),t([o({type:String,json:{write:!0}})],b.prototype,"sqlFormat",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"text",void 0),t([o({type:v,json:{write:!0}})],b.prototype,"timeExtent",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"timeReferenceUnknownClient",void 0),t([w(R,{ignoreUnknown:!1}),o({json:{write:{overridePolicy(t){return{enabled:!!t&&!!this.distance}}}}})],b.prototype,"units",void 0),t([o({type:y,json:{write:!0}})],b.prototype,"outDistance",void 0),t([o({type:String,json:{write:{overridePolicy(t){return{enabled:null!=t||null!=this.start&&this.start>0}}}}})],b.prototype,"where",void 0),t([g("where")],b.prototype,"writeWhere",null),b=S=t([n("esri.rest.support.Query")],b);export{b as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{JSONMap as e}from"../../core/jsonMap.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{clone as i}from"../../core/lang.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import{ensureType as n}from"../../core/accessorSupport/ensureType.js";import p from"../../geometry/SpatialReference.js";import{fromJSON as l}from"../../geometry/support/jsonUtils.js";import{geometryTypes as a}from"../../geometry/support/typeUtils.js";import u from"./TopFilter.js";import d from"../../time/TimeExtent.js";import{writer as c}from"../../core/accessorSupport/decorators/writer.js";var y;const m=new e({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),h=new e({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let j=class extends r{static{y=this}constructor(t){super(t),this.cacheHint=void 0,this.distance=void 0,this.geometry=null,this.geometryPrecision=void 0,this.maxAllowableOffset=void 0,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.resultType=null,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.start=void 0,this.spatialRelationship="intersects",this.timeExtent=null,this.topFilter=void 0,this.units=null,this.where="1=1"}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10}clone(){return new y(i({cacheHint:this.cacheHint,distance:this.distance,geometry:this.geometry,geometryPrecision:this.geometryPrecision,maxAllowableOffset:this.maxAllowableOffset,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,resultType:this.resultType,returnGeometry:this.returnGeometry,returnZ:this.returnZ,returnM:this.returnM,start:this.start,spatialRelationship:this.spatialRelationship,timeExtent:this.timeExtent,topFilter:this.topFilter,units:this.units,where:this.where}))}};t([o({type:Boolean,json:{write:!0}})],j.prototype,"cacheHint",void 0),t([o({type:Number,json:{write:{overridePolicy:t=>({enabled:t>0})}}})],j.prototype,"distance",void 0),t([o({types:a,json:{read:l,write:!0}})],j.prototype,"geometry",void 0),t([o({type:Number,json:{write:!0}})],j.prototype,"geometryPrecision",void 0),t([o({type:Number,json:{write:!0}})],j.prototype,"maxAllowableOffset",void 0),t([o({type:Number,json:{read:{source:"resultRecordCount"}}})],j.prototype,"num",void 0),t([o({json:{write:!0}})],j.prototype,"objectIds",void 0),t([o({type:[String],json:{write:!0}})],j.prototype,"orderByFields",void 0),t([o({type:[String],json:{write:!0}})],j.prototype,"outFields",void 0),t([o({type:p,json:{read:{source:"outSR"},write:{target:"outSR"}}})],j.prototype,"outSpatialReference",void 0),t([o({type:String,json:{write:!0}})],j.prototype,"resultType",void 0),t([o({json:{write:!0}})],j.prototype,"returnGeometry",void 0),t([o({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],j.prototype,"returnM",void 0),t([o({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],j.prototype,"returnZ",void 0),t([o({type:Number,json:{read:{source:"resultOffset"}}})],j.prototype,"start",void 0),t([c("start"),c("num")],j.prototype,"writeStart",null),t([o({type:String,json:{read:{source:"spatialRel",reader:m.read},write:{target:"spatialRel",writer:m.write}}})],j.prototype,"spatialRelationship",void 0),t([o({type:d,json:{write:!0}})],j.prototype,"timeExtent",void 0),t([o({type:u,json:{write:!0}})],j.prototype,"topFilter",void 0),t([o({type:String,json:{read:h.read,write:{writer:h.write,overridePolicy(t){return{enabled:null!=t&&null!=this.distance}}}}})],j.prototype,"units",void 0),t([o({type:String,json:{write:!0}})],j.prototype,"where",void 0),j=y=t([s("esri.rest.support.TopFeaturesQuery")],j),j.from=n(j);export{j as default};
2
+ import{__decorate as t}from"tslib";import{JSONMap as e}from"../../core/jsonMap.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{clone as i}from"../../core/lang.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import{ensureType as n}from"../../core/accessorSupport/ensureType.js";import p from"../../geometry/SpatialReference.js";import{fromJSON as l}from"../../geometry/support/jsonUtils.js";import{geometryTypes as a}from"../../geometry/support/typeUtils.js";import u from"./TopFilter.js";import d from"../../time/TimeExtent.js";import{writer as c}from"../../core/accessorSupport/decorators/writer.js";var y;const m=new e({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),h=new e({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let j=class extends r{static{y=this}constructor(t){super(t),this.cacheHint=void 0,this.distance=void 0,this.geometry=null,this.geometryPrecision=void 0,this.maxAllowableOffset=void 0,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.resultType=null,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.start=void 0,this.spatialRelationship="intersects",this.timeExtent=null,this.topFilter=void 0,this.units=null,this.where="1=1"}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10}clone(){return new y(i({cacheHint:this.cacheHint,distance:this.distance,geometry:this.geometry,geometryPrecision:this.geometryPrecision,maxAllowableOffset:this.maxAllowableOffset,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,resultType:this.resultType,returnGeometry:this.returnGeometry,returnZ:this.returnZ,returnM:this.returnM,start:this.start,spatialRelationship:this.spatialRelationship,timeExtent:this.timeExtent,topFilter:this.topFilter,units:this.units,where:this.where}))}};t([o({type:Boolean,json:{write:!0}})],j.prototype,"cacheHint",void 0),t([o({type:Number,json:{write:{overridePolicy:t=>({enabled:!!t})}}})],j.prototype,"distance",void 0),t([o({types:a,json:{read:l,write:!0}})],j.prototype,"geometry",void 0),t([o({type:Number,json:{write:!0}})],j.prototype,"geometryPrecision",void 0),t([o({type:Number,json:{write:!0}})],j.prototype,"maxAllowableOffset",void 0),t([o({type:Number,json:{read:{source:"resultRecordCount"}}})],j.prototype,"num",void 0),t([o({json:{write:!0}})],j.prototype,"objectIds",void 0),t([o({type:[String],json:{write:!0}})],j.prototype,"orderByFields",void 0),t([o({type:[String],json:{write:!0}})],j.prototype,"outFields",void 0),t([o({type:p,json:{read:{source:"outSR"},write:{target:"outSR"}}})],j.prototype,"outSpatialReference",void 0),t([o({type:String,json:{write:!0}})],j.prototype,"resultType",void 0),t([o({json:{write:!0}})],j.prototype,"returnGeometry",void 0),t([o({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],j.prototype,"returnM",void 0),t([o({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],j.prototype,"returnZ",void 0),t([o({type:Number,json:{read:{source:"resultOffset"}}})],j.prototype,"start",void 0),t([c("start"),c("num")],j.prototype,"writeStart",null),t([o({type:String,json:{read:{source:"spatialRel",reader:m.read},write:{target:"spatialRel",writer:m.write}}})],j.prototype,"spatialRelationship",void 0),t([o({type:d,json:{write:!0}})],j.prototype,"timeExtent",void 0),t([o({type:u,json:{write:!0}})],j.prototype,"topFilter",void 0),t([o({type:String,json:{read:h.read,write:{writer:h.write,overridePolicy(t){return{enabled:null!=t&&!!this.distance}}}}})],j.prototype,"units",void 0),t([o({type:String,json:{write:!0}})],j.prototype,"where",void 0),j=y=t([s("esri.rest.support.TopFeaturesQuery")],j),j.from=n(j);export{j as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const b="20260608",d="b8aa6bd16247959d1ea57712d124b6bd7e57b244";export{b as buildDate,d as commitHash};
2
+ const d="20260609",e="3499d3048dfeade16d9d05f79b915da23576dc0e";export{d as buildDate,e as commitHash};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../config.js";import t from"../../../../request.js";import i from"../../../../core/Error.js";import{getFullyQualifiedFontName as r}from"../../../../core/fontUtils.js";import has from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{throwIfAborted as a,isAbortError as n}from"../../../../core/promiseUtils.js";import{QueueProcessor as o}from"../../../../core/QueueProcessor.js";import{pt2px as c}from"../../../../core/screenUtils.js";import{numericHash as h}from"../../../../core/string.js";import l from"../../../../symbols/cim/CIMResourceManager.js";import{CIMSymbolHelper as u}from"../../../../symbols/cim/CIMSymbolHelper.js";import p from"../../../../symbols/cim/Rasterizer.js";import{normalizeDashTemplate as m}from"../../../../symbols/cim/utils.js";import{svgSdfTextureInnerSize as d,textureBindingSpriteAtlas as g,textureBindingGlyphAtlas as f}from"./definitions.js";import y from"./GlyphMosaic.js";import M from"./GlyphSource.js";import _ from"./Rect.js";import I from"./SDFConverter.js";import w from"./SpriteMosaic.js";import{discardUrlIfHasUrlHash as S}from"./urlUtils.js";import{getCIMMarkerPlacementHash as z,isSVGImage as T}from"./Utils.js";import{AnimatableTextureResource as C}from"./animatedFormats/AnimatableTextureResource.js";import{AnimationStore as R}from"./animations/store/AnimationStore.js";const x="arial-unicode-ms-regular",b=/[\u0695\u0698\u06a9\u06af\u06b5\u06be\u06c6\u06cc\u06ce\u06d5\u06ca]|\p{Script=Thai}|\p{Script=Lao}|\p{Script=Tamil}|\p{Script=Khmer}/u,P=new Set(["Noto Sans Khmer","Noto Sans Lao","Noto Sans Myanmar","Noto Sans Thai"]),$=()=>s.getLogger("esri.views.MapView"),v=(e,t,r)=>$().error(new i(e,t,r)),j=(e,t="")=>$().warnOnce(e,t);class k{static fromMosaic(e,t){return new k(e,t.page,t.sdf,t.samplingMode)}constructor(e,t,i,r){this.mosaicType=e,this.page=t,this.sdf=i,this.samplingMode=r}}class A{constructor(r){this._requestRender=r,this._resourceManager=new l,this._invalidFonts=new Set,this._sdfConverter=new I(d),this._bindingInfos=new Array,this._hashToBindingIndex=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new o({concurrency:10,process:async(e,r)=>{a(r);try{return await t(e,{responseType:"image",signal:r})}catch(s){if(!n(s))throw new i("mapview-invalid-resource",`Could not fetch requested resource at ${e}`,s);throw s}}}),this.animationStore=new R,this._spriteMosaic=new w(2048,2048,500),this._glyphSource=new M(`${e.fontsUrl}/{fontstack}/{range}.pbf`),this._glyphMosaic=new y(1024,1024,this._glyphSource),this._rasterizer=new p(this.resourceManager)}dispose(){this._spriteMosaic.dispose(),this._glyphMosaic.dispose(),this._rasterizer.dispose(),this._sdfConverter.dispose(),this._spriteMosaic=null,this._glyphMosaic=null,this._sdfConverter=null,this._hashToBindingIndex.clear(),this._hashToBindingIndex=null,this._bindingInfos=null,this._ongoingRasterizations.clear(),this._ongoingRasterizations=null,this._imageRequestQueue.clear(),this._imageRequestQueue=null,this._resourceManager.destroy(),this.animationStore.destroy()}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}get resourceManager(){return this._resourceManager}async rasterizeItem(e,t){if(null==e)return v("mapview-null-resource","Unable to rasterize null resource"),null;if("animation-info"===e.type){const{resource:t}=e,i=this.animationStore.add(t),{location:r}=i;return{rect:new _(r.column,r.row,t.length,1),page:r.page,type:"sprite",width:t.length,height:1,rasterizationScale:1,sdfPaddingRatio:.5,samplingMode:"Linear",sdfDecodeCoeff:1,simplePattern:!1}}if("cim-rasterization-info"!==e.type)return v("mapview-unexpected-resource","Unable to rasterize resource"),null;const{resource:i}=e;if("text"===i.type){const e=await this._rasterizeText(i,t);for(const t of e.glyphs)this._setTextureBinding(1,t.mosaicItem);return e}const r=await this._rasterizeSprite(i,t);return r&&this._setTextureBinding(0,r),r}getMosaicInfo(e,t,i=!1){const r=this._getTextureBindingInfo(e,t,i);return r?{size:r.size}:(v("mapview-invalid-resource",`Unable to find resource for ${t}`),{size:[0,0]})}getMosaicTexture(e,t,i=!1){const r=this._getTextureBindingInfo(e,t,i);return r?{texture:r.texture,unit:"sprite"===r.type?g:f}:(v("mapview-invalid-resource",`Unable to find resource for ${t}`),null)}_getTextureBindingInfo(e,t,i){const{context:r}=e,s=this._bindingInfos[t-1],a=s.page,n="Nearest"===s.samplingMode?9728:i?9987:9729;switch(s.mosaicType){case 0:{const t=[this.sprites.getWidth(a),this.sprites.getHeight(a)],i=this._spriteMosaic.getTexture(e,a);return i.setSamplingMode(n),{type:"sprite",texture:i,size:t}}case 1:{const e=[this.glyphs.width,this.glyphs.height],t=this._glyphMosaic.getTexture(r,a);return this._glyphMosaic.bind(r,n,a,f),t.setSamplingMode(n),{type:"glyph",texture:t,size:e}}default:return v("mapview-texture-manager",`Cannot handle unknown type ${s.mosaicType}`),null}}_hashMosaic(e,t){return 1|e<<1|(t.sdf?1:0)<<2|("Nearest"===t.samplingMode?1:0)<<3|t.page<<4}_setTextureBinding(e,t){const i=this._hashMosaic(e,t);if(!this._hashToBindingIndex.has(i)){const r=k.fromMosaic(e,t),s=this._bindingInfos.length+1;this._hashToBindingIndex.set(i,s),this._bindingInfos.push(r)}t.textureBinding=this._hashToBindingIndex.get(i)}async _rasterizeText(e,t){const{font:i,textString:s}=e,a=r(i),n=this._invalidFonts.has(a),o=!!has("esri-2d-force-complex-shaping"),c=!!has("esri-2d-complex-shaping")&&b.test(s),h=P.has(i.family),l=o||c||h,u=n?x:a;has("esri-2d-stabilize-glyphs")&&await this._glyphMosaic.preloadASCIIGlyphCache(u).catch(()=>{});let p=await this._glyphMosaic.getGlyphItems(s,l,u,t);return p||(j(`Font ${a} is not available on the web, using "Arial Unicode MS Regular"`),this._invalidFonts.add(a),p=await this._glyphMosaic.getGlyphItems(s,l,x,t)),p}_hashSpriteResource(e){switch(e.type){case"path":return`path:${e.path}.${e.asFill?1:0}`;case"CIMPictureMarker":return`${e.type}:${e.url}:${e.size}:${z(e.markerPlacement)}`;case"CIMPictureFill":return`${e.type}:${e.url}:${e.height}`;case"CIMPictureStroke":return`${e.type}:${e.url}:${e.width}`;case"dash":return`dash:${e.capStyle}.${m(e.dashTemplate).join("")}`;case"sdf":return`sdf:${JSON.stringify(e.geometry)}.${e.sdfTextureSize}.${e.asFill?1:0}`;case"fill-style":return`fill_style:${e.style}`;case"animated":return JSON.stringify(S(e));case"CIMGradientFill":case"CIMGradientStroke":return`gradient:${JSON.stringify(e.colorRamp)}.${e.gradientType}.${e.interval}`;case"CIMHatchFill":case"CIMVectorMarker":return JSON.stringify(e)}}async _rasterizeSprite(e,t){if(!e)return null;const i=h(this._hashSpriteResource(e));if(this._spriteMosaic.has(i))return this._spriteMosaic.getSpriteItem(i);if("url"in e&&e.url&&"animated"!==e.type||"CIMPictureFill"===e.type||"CIMPictureStroke"===e.type||"CIMPictureMarker"===e.type||"CIMVectorMarker"===e.type){const t={type:"CIMPointSymbol",symbolLayers:[e]};await u.normalizeSymbolAndFetchResources(t,this._resourceManager)}switch(e.type){case"CIMPictureMarker":return"CIMMarkerPlacementInsidePolygon"===e.markerPlacement?.type?this._rasterizeJSONResource(i,e):this._handleAsyncResource(i,e,t);case"animated":case"CIMPictureFill":case"CIMPictureStroke":case"path":return this._handleAsyncResource(i,e,t);case"CIMGradientFill":case"CIMGradientStroke":case"CIMHatchFill":case"CIMVectorMarker":case"dash":case"fill-style":case"sdf":return this._rasterizeJSONResource(i,e)}}_rasterizeJSONResource(e,t){const i=this._rasterizer.rasterizeJSONResource(t);if(i){const{size:r,image:s,sdf:a,simplePattern:n,rasterizationScale:o,samplingMode:c,sdfPaddingRatio:h,sdfDecodeCoeff:l}=i;return this._addItemToMosaic(e,r,{type:"static",data:s},F(t),a,n,o,c,h,l)}return null}async _handleAsyncResource(e,t,i){if(this._ongoingRasterizations.has(e))return this._ongoingRasterizations.get(e);let r;return r="path"===t.type?this._handleSVG(t,e,i):this._handleImage(t,e,i),this._ongoingRasterizations.set(e,r),r.finally(()=>this._ongoingRasterizations.delete(e)),r}async _handleSVG(e,t,i){const r=[d,d],{asFill:s}=e,a=await this._sdfConverter.draw(e.path,s,i);return this._addItemToMosaic(t,r,{type:"static",data:new Uint32Array(a.buffer)},!1,!0,!0)}_handleGIFOrPNG(e,t,i){const r=e.url,s=this.resourceManager.getResource(r);if(null==s)return null;const{width:a,height:n}=s;if(s instanceof HTMLImageElement){if("animated"===e.type)return v("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;const i="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:r,sdf:o,image:c}=this._rasterizer.rasterizeImageResource(a,n,s,i);return this._addItemToMosaic(t,r,{type:"static",data:c},F(e),o,!1)}let o,c,h;"animated"===e.type?(o=!1,c={type:"CIMAnimatedSymbolProperties",playAnimation:e.playAnimation,reverseAnimation:e.reverseAnimation,randomizeStartTime:e.randomizeStartTime,randomizeStartSeed:e.randomizeStartSeed,startTimeOffset:e.startTimeOffset,duration:e.duration,repeatType:e.repeatType,repeatDelay:e.repeatDelay},h=e.startGroup||0):(o=F(e),c={type:"CIMAnimatedSymbolProperties",playAnimation:!0},h=0);const l=new C(s,this._requestRender,c,h);return this._addItemToMosaic(t,[l.width,l.height],{type:"animated",data:l},o,!1,!1)}async _handleImage(e,t,r){const s=e.url;if(N(s)||O(s))return this._handleGIFOrPNG(e,t,r);if("animated"===e.type)return v("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;try{let i;const a=this.resourceManager.getResource(s);if(null!=a&&a instanceof HTMLImageElement)i=a;else{const{data:e}=await this._imageRequestQueue.push(s,{...r});i=e}if(T(s))if("width"in e&&"height"in e)i.width=c(e.width),i.height=c(e.height);else if("cim"in e){const t=e;i.width=c(t.width??t.scaleX*t.size),i.height=c(t.size)}if(!i.width||!i.height)return null;const n=i.width,o=i.height,h="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:l,sdf:u,image:p}=this._rasterizer.rasterizeImageResource(n,o,i,h);return this._addItemToMosaic(t,l,{type:"static",data:p},F(e),u,!1)}catch(v){if(!n(v))throw new i("mapview-invalid-resource",`Could not fetch requested resource at ${s}. ${v.message}`);throw v}}_addItemToMosaic(e,t,i,r,s,a,n,o,c,h){return this._spriteMosaic.addSpriteItem(e,t,i,r,s,a,n,o,c,h)}}function F(e){switch(e.type){case"CIMVectorMarker":case"CIMPictureMarker":return U(e);default:return!0}}const G=e=>null!=e&&e.startsWith("data:image/gif"),N=e=>e&&(e.includes(".gif")||G(e)),B=e=>null!=e&&e.startsWith("data:image/png"),O=e=>e&&(e.includes(".png")||B(e)),U=e=>e&&"markerPlacement"in e&&e.markerPlacement&&"CIMMarkerPlacementInsidePolygon"===e.markerPlacement.type;export{A as default};
2
+ import e from"../../../../config.js";import t from"../../../../request.js";import i from"../../../../core/Error.js";import{getFullyQualifiedFontName as r}from"../../../../core/fontUtils.js";import has from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{throwIfAborted as a,isAbortError as n}from"../../../../core/promiseUtils.js";import{QueueProcessor as o}from"../../../../core/QueueProcessor.js";import{pt2px as c}from"../../../../core/screenUtils.js";import{numericHash as l}from"../../../../core/string.js";import h from"../../../../symbols/cim/CIMResourceManager.js";import{CIMSymbolHelper as u}from"../../../../symbols/cim/CIMSymbolHelper.js";import m from"../../../../symbols/cim/Rasterizer.js";import{normalizeDashTemplate as p}from"../../../../symbols/cim/utils.js";import{svgSdfTextureInnerSize as d,textureBindingSpriteAtlas as g,textureBindingGlyphAtlas as y}from"./definitions.js";import f from"./GlyphMosaic.js";import M from"./GlyphSource.js";import _ from"./Rect.js";import S from"./SDFConverter.js";import I from"./SpriteMosaic.js";import{discardUrlIfHasUrlHash as w}from"./urlUtils.js";import{getCIMMarkerPlacementHash as z,isSVGImage as T}from"./Utils.js";import{AnimatableTextureResource as b}from"./animatedFormats/AnimatableTextureResource.js";import{AnimationStore as C}from"./animations/store/AnimationStore.js";const P="arial-unicode-ms-regular",R=/[\u0695\u0698\u06a9\u06af\u06b5\u06be\u06c6\u06cc\u06ce\u06d5\u06ca]|\p{Script=Thai}|\p{Script=Lao}|\p{Script=Tamil}|\p{Script=Khmer}/u,x=new Set(["Noto Sans Khmer","Noto Sans Lao","Noto Sans Myanmar","Noto Sans Thai"]),v=()=>s.getLogger("esri.views.MapView"),$=(e,t,r)=>v().error(new i(e,t,r)),A=(e,t="")=>v().warnOnce(e,t);class j{static fromMosaic(e,t){return new j(e,t.page,t.sdf,t.samplingMode)}constructor(e,t,i,r){this.mosaicType=e,this.page=t,this.sdf=i,this.samplingMode=r}}class k{constructor(r){this._requestRender=r,this._resourceManager=new h,this._invalidFonts=new Set,this._sdfConverter=new S(d),this._bindingInfos=new Array,this._hashToBindingIndex=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new o({concurrency:10,process:async(e,r)=>{a(r);try{return await t(e,{responseType:"image",signal:r})}catch(s){if(!n(s))throw new i("mapview-invalid-resource",`Could not fetch requested resource at ${e}`,s);throw s}}}),this.animationStore=new C,this._spriteMosaic=new I(2048,2048,500),this._glyphSource=new M(`${e.fontsUrl}/{fontstack}/{range}.pbf`),this._glyphMosaic=new f(1024,1024,this._glyphSource),this._rasterizer=new m(this.resourceManager)}dispose(){this._spriteMosaic.dispose(),this._glyphMosaic.dispose(),this._rasterizer.dispose(),this._sdfConverter.dispose(),this._spriteMosaic=null,this._glyphMosaic=null,this._sdfConverter=null,this._hashToBindingIndex.clear(),this._hashToBindingIndex=null,this._bindingInfos=null,this._ongoingRasterizations.clear(),this._ongoingRasterizations=null,this._imageRequestQueue.clear(),this._imageRequestQueue=null,this._resourceManager.destroy(),this.animationStore.destroy()}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}get resourceManager(){return this._resourceManager}async rasterizeItem(e,t){if(null==e)return $("mapview-null-resource","Unable to rasterize null resource"),null;if("animation-info"===e.type){const{resource:t}=e,i=this.animationStore.add(t),{location:r}=i;return{rect:new _(r.column,r.row,t.length,1),page:r.page,type:"sprite",width:t.length,height:1,rasterizationScale:1,sdfPaddingRatio:.5,samplingMode:"Linear",sdfDecodeCoeff:1,simplePattern:!1}}if("cim-rasterization-info"!==e.type)return $("mapview-unexpected-resource","Unable to rasterize resource"),null;const{resource:i}=e;if("text"===i.type){const e=await this._rasterizeText(i,t);for(const t of e.glyphs)this._setTextureBinding(1,t.mosaicItem);return e}const r=await this._rasterizeSprite(i,t);return r&&this._setTextureBinding(0,r),r}getMosaicInfo(e,t,i=!1){const r=this._getTextureBindingInfo(e,t,i);return r?{size:r.size}:($("mapview-invalid-resource",`Unable to find resource for ${t}`),{size:[0,0]})}getMosaicTexture(e,t,i=!1){const r=this._getTextureBindingInfo(e,t,i);return r?{texture:r.texture,unit:"sprite"===r.type?g:y}:($("mapview-invalid-resource",`Unable to find resource for ${t}`),null)}_getTextureBindingInfo(e,t,i){const{context:r}=e,s=this._bindingInfos[t-1],a=s.page,n="Nearest"===s.samplingMode?9728:i?9987:9729;switch(s.mosaicType){case 0:{const t=[this.sprites.getWidth(a),this.sprites.getHeight(a)],i=this._spriteMosaic.getTexture(e,a);return i.setSamplingMode(n),{type:"sprite",texture:i,size:t}}case 1:{const e=[this.glyphs.width,this.glyphs.height],t=this._glyphMosaic.getTexture(r,a);return this._glyphMosaic.bind(r,n,a,y),t.setSamplingMode(n),{type:"glyph",texture:t,size:e}}default:return $("mapview-texture-manager",`Cannot handle unknown type ${s.mosaicType}`),null}}_hashMosaic(e,t){return 1|e<<1|(t.sdf?1:0)<<2|("Nearest"===t.samplingMode?1:0)<<3|t.page<<4}_setTextureBinding(e,t){const i=this._hashMosaic(e,t);if(!this._hashToBindingIndex.has(i)){const r=j.fromMosaic(e,t),s=this._bindingInfos.length+1;this._hashToBindingIndex.set(i,s),this._bindingInfos.push(r)}t.textureBinding=this._hashToBindingIndex.get(i)}async _rasterizeText(e,t){const{font:i,textString:s}=e,a=r(i),n=this._invalidFonts.has(a),o=!!has("esri-2d-force-complex-shaping"),c=!!has("esri-2d-complex-shaping")&&R.test(s),l=x.has(i.family),h=o||c||l,u=n?P:a;has("esri-2d-stabilize-glyphs")&&await this._glyphMosaic.preloadASCIIGlyphCache(u).catch(()=>{});let m=await this._glyphMosaic.getGlyphItems(s,h,u,t);return m||(A(`Font ${a} is not available on the web, using "Arial Unicode MS Regular"`),this._invalidFonts.add(a),m=await this._glyphMosaic.getGlyphItems(s,h,P,t)),m}_hashSpriteResource(e){switch(e.type){case"path":return`path:${e.path}.${e.asFill?1:0}`;case"CIMPictureMarker":return`${e.type}:${e.url}:${e.size}:${z(e.markerPlacement)}`;case"CIMPictureFill":return`${e.type}:${e.url}:${e.height}`;case"CIMPictureStroke":return`${e.type}:${e.url}:${e.width}`;case"dash":return`dash:${e.capStyle}.${p(e.dashTemplate).join("")}`;case"sdf":return`sdf:${JSON.stringify(e.geometry)}.${e.sdfTextureSize}.${e.asFill?1:0}`;case"fill-style":return`fill_style:${e.style}`;case"animated":return JSON.stringify(w(e));case"CIMGradientFill":case"CIMGradientStroke":return`gradient:${JSON.stringify(e.colorRamp)}.${e.gradientType}.${e.interval}`;case"CIMHatchFill":case"CIMVectorMarker":return JSON.stringify(e)}}async _rasterizeSprite(e,t){if(!e)return null;const i=l(this._hashSpriteResource(e));if(this._spriteMosaic.has(i))return this._spriteMosaic.getSpriteItem(i);if("url"in e&&e.url&&"animated"!==e.type||"CIMPictureFill"===e.type||"CIMPictureStroke"===e.type||"CIMPictureMarker"===e.type||"CIMVectorMarker"===e.type){const t={type:"CIMPointSymbol",symbolLayers:[e]};await u.normalizeSymbolAndFetchResources(t,this._resourceManager)}switch(e.type){case"CIMPictureMarker":return"CIMMarkerPlacementInsidePolygon"===e.markerPlacement?.type?this._rasterizeJSONResource(i,e):this._handleAsyncResource(i,e,t);case"animated":case"CIMPictureFill":case"CIMPictureStroke":case"path":return this._handleAsyncResource(i,e,t);case"CIMGradientFill":case"CIMGradientStroke":case"CIMHatchFill":case"CIMVectorMarker":case"dash":case"fill-style":case"sdf":return this._rasterizeJSONResource(i,e)}}_rasterizeJSONResource(e,t){const i=this._rasterizer.rasterizeJSONResource(t);if(i){const{size:r,image:s,sdf:a,simplePattern:n,rasterizationScale:o,samplingMode:c,sdfPaddingRatio:l,sdfDecodeCoeff:h}=i;return this._addItemToMosaic(e,r,{type:"static",data:s},G(t),a,n,o,c,l,h)}return null}async _handleAsyncResource(e,t,i){if(this._ongoingRasterizations.has(e))return this._ongoingRasterizations.get(e);let r;return r="path"===t.type?this._handleSVG(t,e,i):this._handleImage(t,e,i),this._ongoingRasterizations.set(e,r),r.finally(()=>this._ongoingRasterizations.delete(e)),r}async _handleSVG(e,t,i){const r=[d,d],{asFill:s}=e,a=await this._sdfConverter.draw(e.path,s,i);return this._addItemToMosaic(t,r,{type:"static",data:new Uint32Array(a.buffer)},!1,!0,!0)}_handleGIFOrPNG(e,t,i){const r=e.url,s=this.resourceManager.getResource(r);if(null==s)return null;const{width:a,height:n}=s;if(s instanceof HTMLImageElement){if("animated"===e.type)return $("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;const i="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:r,sdf:o,image:c}=this._rasterizer.rasterizeImageResource(a,n,s,i);return this._addItemToMosaic(t,r,{type:"static",data:c},G(e),o,!1)}let o,c;const l=F(e);"animated"===e.type?(o=!1,c=e.startGroup||0):"CIMPictureMarker"===e.type?(o=!1,c=0):(o=G(e),c=0);const h=new b(s,this._requestRender,l,c);return this._addItemToMosaic(t,[h.width,h.height],{type:"animated",data:h},o,!1,!1)}async _handleImage(e,t,r){const s=e.url;if(O(s)||U(s))return this._handleGIFOrPNG(e,t,r);if("animated"===e.type)return $("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;try{let i;const a=this.resourceManager.getResource(s);if(null!=a&&a instanceof HTMLImageElement)i=a;else{const{data:e}=await this._imageRequestQueue.push(s,{...r});i=e}if(T(s))if("width"in e&&"height"in e)i.width=c(e.width),i.height=c(e.height);else if("cim"in e){const t=e;i.width=c(t.width??t.scaleX*t.size),i.height=c(t.size)}if(!i.width||!i.height)return null;const n=i.width,o=i.height,l="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:h,sdf:u,image:m}=this._rasterizer.rasterizeImageResource(n,o,i,l);return this._addItemToMosaic(t,h,{type:"static",data:m},G(e),u,!1)}catch($){if(!n($))throw new i("mapview-invalid-resource",`Could not fetch requested resource at ${s}. ${$.message}`);throw $}}_addItemToMosaic(e,t,i,r,s,a,n,o,c,l){return this._spriteMosaic.addSpriteItem(e,t,i,r,s,a,n,o,c,l)}}function F(e){return"animated"===e.type?{type:"CIMAnimatedSymbolProperties",playAnimation:e.playAnimation,reverseAnimation:e.reverseAnimation,randomizeStartTime:e.randomizeStartTime,randomizeStartSeed:e.randomizeStartSeed,startTimeOffset:e.startTimeOffset,duration:e.duration,repeatType:e.repeatType,repeatDelay:e.repeatDelay}:"CIMPictureMarker"===e.type?e.animatedSymbolProperties?{type:"CIMAnimatedSymbolProperties",playAnimation:e.animatedSymbolProperties.playAnimation??!1,reverseAnimation:e.animatedSymbolProperties.reverseAnimation,randomizeStartTime:e.animatedSymbolProperties.randomizeStartTime,randomizeStartSeed:e.animatedSymbolProperties.randomizeStartSeed,startTimeOffset:e.animatedSymbolProperties.startTimeOffset,duration:e.animatedSymbolProperties.duration,repeatType:e.animatedSymbolProperties.repeatType,repeatDelay:e.animatedSymbolProperties.repeatDelay}:{type:"CIMAnimatedSymbolProperties",playAnimation:!1}:{type:"CIMAnimatedSymbolProperties",playAnimation:!0}}function G(e){switch(e.type){case"CIMVectorMarker":case"CIMPictureMarker":return q(e);default:return!0}}const N=e=>null!=e&&e.startsWith("data:image/gif"),O=e=>e&&(e.includes(".gif")||N(e)),B=e=>null!=e&&e.startsWith("data:image/png"),U=e=>e&&(e.includes(".png")||B(e)),q=e=>e&&"markerPlacement"in e&&e.markerPlacement&&"CIMMarkerPlacementInsidePolygon"===e.markerPlacement.type;export{k as default};