@arcgis/core 5.1.0-next.71 → 5.1.0-next.73

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 (439) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/003fd7745966fe03510c.js +1 -0
  4. package/assets/esri/core/workers/chunks/00bae4b7e179336e0362.js +1 -0
  5. package/assets/esri/core/workers/chunks/{36031cb53c486630f3c9.js → 026d3fa331caec1ea3d2.js} +1 -1
  6. package/assets/esri/core/workers/chunks/027c3ea756db68e51f0a.js +1 -0
  7. package/assets/esri/core/workers/chunks/041c372e98a6fba90b36.js +1 -0
  8. package/assets/esri/core/workers/chunks/{a5a46d0a0831497cf1b4.js → 0783890816bac45277b9.js} +1 -1
  9. package/assets/esri/core/workers/chunks/07aac6245a0d1adbb2d4.js +1 -0
  10. package/assets/esri/core/workers/chunks/0839da55707f7c4cf780.js +1 -0
  11. package/assets/esri/core/workers/chunks/0ae360bf253adee46737.js +1 -0
  12. package/assets/esri/core/workers/chunks/0c00e5e4bd18467bcecd.js +1 -0
  13. package/assets/esri/core/workers/chunks/0dad0bca8d58b2c63d22.js +1 -0
  14. package/assets/esri/core/workers/chunks/0ef93722524620023f69.js +1 -0
  15. package/assets/esri/core/workers/chunks/127cd8fee3717a473fc5.js +1 -0
  16. package/assets/esri/core/workers/chunks/1286f41f245ef22b3a26.js +1 -0
  17. package/assets/esri/core/workers/chunks/12e575a6d2b008b8fc2b.js +1 -0
  18. package/assets/esri/core/workers/chunks/{c92352b0e39576ca317a.js → 13e60f19f436b8d683ae.js} +1 -1
  19. package/assets/esri/core/workers/chunks/161d60fdac2013c15543.js +1 -0
  20. package/assets/esri/core/workers/chunks/1661684357912726a72a.js +1 -0
  21. package/assets/esri/core/workers/chunks/168de44a789d1cecc1f8.js +1 -0
  22. package/assets/esri/core/workers/chunks/1961b59756933e0a82f2.js +1 -0
  23. package/assets/esri/core/workers/chunks/1d9d7915cf7449e5d468.js +1 -0
  24. package/assets/esri/core/workers/chunks/1f85646936200a399c15.js +1 -0
  25. package/assets/esri/core/workers/chunks/{deb8a0b306d7b9c86b97.js → 2171aaa147aa4d9fc5b5.js} +1 -1
  26. package/assets/esri/core/workers/chunks/235cb82952a18ff8d206.js +1 -0
  27. package/assets/esri/core/workers/chunks/260d4571722cb1ff1366.js +1 -0
  28. package/assets/esri/core/workers/chunks/{3e972ae291df1844017d.js → 266ba61b72a278d93a26.js} +1 -1
  29. package/assets/esri/core/workers/chunks/27b80c386cebadcaca3c.js +1 -0
  30. package/assets/esri/core/workers/chunks/29d3890a5a43d934067a.js +1 -0
  31. package/assets/esri/core/workers/chunks/{7e6ccf9f3e756186e93e.js → 29e76256e3e867e80520.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{333a0038d782d8a34d58.js → 2abf124e2956e4f76688.js} +1 -1
  33. package/assets/esri/core/workers/chunks/2f17438d215bea3ce70f.js +1 -0
  34. package/assets/esri/core/workers/chunks/{f6d5dd2eef0d9918096e.js → 30e710ec4d22c43d4e7e.js} +1 -1
  35. package/assets/esri/core/workers/chunks/30f04dc001eaf838d64c.js +1 -0
  36. package/assets/esri/core/workers/chunks/356cb86606b8c674f947.js +1 -0
  37. package/assets/esri/core/workers/chunks/398e0dd2bc7e1ab84831.js +1 -0
  38. package/assets/esri/core/workers/chunks/3b1052aa30af3f6186cc.js +1 -0
  39. package/assets/esri/core/workers/chunks/3bbf684ee2484eb44c9f.js +1 -0
  40. package/assets/esri/core/workers/chunks/3e87e3ad857d72f6ecbb.js +1 -0
  41. package/assets/esri/core/workers/chunks/{7cb6d8f7eaf762279632.js → 3ea5a18b264628dc37f0.js} +1 -1
  42. package/assets/esri/core/workers/chunks/41809c16544ec25120fa.js +1 -0
  43. package/assets/esri/core/workers/chunks/41913575dd45c65d645e.js +1 -0
  44. package/assets/esri/core/workers/chunks/{628f56c09838eb9c573b.js → 422824e407b550170c8c.js} +1 -1
  45. package/assets/esri/core/workers/chunks/42e483fde18f12da32a6.js +1 -0
  46. package/assets/esri/core/workers/chunks/43ab44d37bc0ea97ef98.js +1 -0
  47. package/assets/esri/core/workers/chunks/46e622857ba92a72a317.js +1 -0
  48. package/assets/esri/core/workers/chunks/47f2113357b2aa4f4f37.js +1 -0
  49. package/assets/esri/core/workers/chunks/488ed9584b527ec47be3.js +1 -0
  50. package/assets/esri/core/workers/chunks/4ad32580e0c0699fde1f.js +1 -0
  51. package/assets/esri/core/workers/chunks/4d0f793dee4ad919221b.js +1 -0
  52. package/assets/esri/core/workers/chunks/4eed175277eb0df3c821.js +1 -0
  53. package/assets/esri/core/workers/chunks/{916a8f3eed1fafdc7242.js → 54d07eadf113f0e4e506.js} +1 -1
  54. package/assets/esri/core/workers/chunks/54ed37ec9682ea739deb.js +1 -0
  55. package/assets/esri/core/workers/chunks/{9187d1caca1fd2d713e0.js → 55369c5bd65bcaf78da1.js} +1 -1
  56. package/assets/esri/core/workers/chunks/56fd3da911c2c4511e5d.js +1 -0
  57. package/assets/esri/core/workers/chunks/59592bb25f226865e88a.js +1 -0
  58. package/assets/esri/core/workers/chunks/{e77d958cb62536b8eebc.js → 5a4d7ba6dc1d4b41d80d.js} +1 -1
  59. package/assets/esri/core/workers/chunks/5c663d5f98bdfa29151b.js +1 -0
  60. package/assets/esri/core/workers/chunks/5d55b4449bcb24cd72b6.js +1 -0
  61. package/assets/esri/core/workers/chunks/5d8fe41a3c06ddb4094b.js +1 -0
  62. package/assets/esri/core/workers/chunks/{fe68c28d3c61f116ff23.js → 5ef37f37e405b3bb5450.js} +1 -1
  63. package/assets/esri/core/workers/chunks/608d707fd9d9f9088473.js +1 -0
  64. package/assets/esri/core/workers/chunks/{ae0a572cbbdd9815ee2e.js → 62b3e933f548ce354b99.js} +1 -1
  65. package/assets/esri/core/workers/chunks/656d6963e8f837fbf28f.js +1 -0
  66. package/assets/esri/core/workers/chunks/{a5afcd633b32e6ee31a7.js → 6a0352d20596ca3f4b64.js} +1 -1
  67. package/assets/esri/core/workers/chunks/6c7ff968bd4fc816442d.js +1 -0
  68. package/assets/esri/core/workers/chunks/6e526c06825ecc6c99c0.js +1 -0
  69. package/assets/esri/core/workers/chunks/6ea8b0d68881d16a2432.js +1 -0
  70. package/assets/esri/core/workers/chunks/7027d93dc5a4595d70c6.js +1 -0
  71. package/assets/esri/core/workers/chunks/70b35b2446558d5280e3.js +1 -0
  72. package/assets/esri/core/workers/chunks/7349cb45a93e6916f115.js +1 -0
  73. package/assets/esri/core/workers/chunks/751609831b283903ba48.js +1 -0
  74. package/assets/esri/core/workers/chunks/76edaeaf8fe344bb77a8.js +1 -0
  75. package/assets/esri/core/workers/chunks/76fe5b821d6b54db5721.js +1 -0
  76. package/assets/esri/core/workers/chunks/7951d93f5f15aa76f49c.js +1 -0
  77. package/assets/esri/core/workers/chunks/80ace1c7203c5059525d.js +1 -0
  78. package/assets/esri/core/workers/chunks/81d30c9062ad0120a863.js +1 -0
  79. package/assets/esri/core/workers/chunks/84772b023d04e415f17f.js +1 -0
  80. package/assets/esri/core/workers/chunks/{123e920e4460124ec3bb.js → 88b480a1d1fb01778798.js} +9 -30
  81. package/assets/esri/core/workers/chunks/88c5f7c712c6b89b5109.js +1 -0
  82. package/assets/esri/core/workers/chunks/88e469b82d2594f23649.js +1 -0
  83. package/assets/esri/core/workers/chunks/8a14e3db28c403b046cf.js +1 -0
  84. package/assets/esri/core/workers/chunks/8a664451845a47048859.js +1 -0
  85. package/assets/esri/core/workers/chunks/8a8242e7cc7e6a9e7876.js +1 -0
  86. package/assets/esri/core/workers/chunks/{4d51261d6131c07402cd.js → 8acee3fba488f202f82f.js} +1 -1
  87. package/assets/esri/core/workers/chunks/{31071a43e2c03984d619.js → 8d75f6f27c1c17c33992.js} +1 -1
  88. package/assets/esri/core/workers/chunks/9444ed8ea117861ae89b.js +1 -0
  89. package/assets/esri/core/workers/chunks/95d82c619dcbec2e1050.js +1 -0
  90. package/assets/esri/core/workers/chunks/96bba4d93a32ad34a1c8.js +1 -0
  91. package/assets/esri/core/workers/chunks/9a38fd68b02b617c45d3.js +1 -0
  92. package/assets/esri/core/workers/chunks/9d434360dfce1e49b7b9.js +1 -0
  93. package/assets/esri/core/workers/chunks/9eb4ae556950e1d0124d.js +2 -0
  94. package/assets/esri/core/workers/chunks/9f4b97204def91567e3c.js +1 -0
  95. package/assets/esri/core/workers/chunks/a37c28e3c4a2be9fd1d5.js +1 -0
  96. package/assets/esri/core/workers/chunks/{c06d021180418f2014de.js → a78bc340a794fd332667.js} +1 -1
  97. package/assets/esri/core/workers/chunks/{1edd39c7c4acdc591d10.js → a809b811121099a87a98.js} +1 -1
  98. package/assets/esri/core/workers/chunks/a8d7f59927bdad564141.js +1 -0
  99. package/assets/esri/core/workers/chunks/{f89976ec97938bf86996.js → abc06d10c7ac8ba5b0e4.js} +1 -1
  100. package/assets/esri/core/workers/chunks/abdf146b35e179b5b245.js +1 -0
  101. package/assets/esri/core/workers/chunks/abe22ae8ee0dcc9efbb7.js +1 -0
  102. package/assets/esri/core/workers/chunks/{fef5dc19736f12dfa99a.js → af5db0372d526e592fcc.js} +1 -1
  103. package/assets/esri/core/workers/chunks/{3b7cda16e656db450f11.js → afc0baf86ece710ef867.js} +1 -1
  104. package/assets/esri/core/workers/chunks/{6ac5ec3ecbca8860338b.js → b54b7cc6b23a70fed700.js} +1 -1
  105. package/assets/esri/core/workers/chunks/b6cadb8a579241adcb86.js +1 -0
  106. package/assets/esri/core/workers/chunks/b702279c48f3009f6dd8.js +1 -0
  107. package/assets/esri/core/workers/chunks/b9848bdbaf3d9ac93d54.js +1 -0
  108. package/assets/esri/core/workers/chunks/be1d6a571f76933dfbb0.js +1 -0
  109. package/assets/esri/core/workers/chunks/{eb3cdc4ff45243fc3cc5.js → bef27a25fbc4a6e19ec0.js} +1 -1
  110. package/assets/esri/core/workers/chunks/bfcdc5c315131aae34d8.js +1 -0
  111. package/assets/esri/core/workers/chunks/c0f624a2ca0d07ef8f8c.js +1 -0
  112. package/assets/esri/core/workers/chunks/c3381b9a36299210ee47.js +1 -0
  113. package/assets/esri/core/workers/chunks/{c2882a9e67124b7c18be.js → c503c79ba5761f7abbeb.js} +1 -1
  114. package/assets/esri/core/workers/chunks/{a65d576e90179a2b5400.js → c5507480344176fad241.js} +1 -1
  115. package/assets/esri/core/workers/chunks/c70df6ed190f9ebcf6aa.js +1 -0
  116. package/assets/esri/core/workers/chunks/cb5e4b9b4a59c2622eb5.js +1 -0
  117. package/assets/esri/core/workers/chunks/cd7159600ce132e32d04.js +1 -0
  118. package/assets/esri/core/workers/chunks/cfe246adb5e6cb6f0cfc.js +1 -0
  119. package/assets/esri/core/workers/chunks/d17fcfc502f0e0fa6523.js +596 -0
  120. package/assets/esri/core/workers/chunks/d201a5dff18a5bb467ab.js +1 -0
  121. package/assets/esri/core/workers/chunks/d65b1234867f7d773d50.js +2 -0
  122. package/assets/esri/core/workers/chunks/{4d8670f6fa8952b7bab6.js → d950d5c2844206502ff0.js} +1 -1
  123. package/assets/esri/core/workers/chunks/db3c484bfa607dec6050.js +1 -0
  124. package/assets/esri/core/workers/chunks/db588bf3256e95c977b7.js +1 -0
  125. package/assets/esri/core/workers/chunks/{967758a05170545cd371.js → dcc719e15b2e0cce1f3b.js} +1 -1
  126. package/assets/esri/core/workers/chunks/{6bb090f3e5c18604cb39.js → dd5b362bded458afa2d6.js} +1 -1
  127. package/assets/esri/core/workers/chunks/dfdd474fddcd1d6091ce.js +1 -0
  128. package/assets/esri/core/workers/chunks/{aa1a3a849aba84cf585b.js → e1bc9ad767e08dc18bbc.js} +1 -1
  129. package/assets/esri/core/workers/chunks/e235ea4293d5d463acfb.js +1 -0
  130. package/assets/esri/core/workers/chunks/e25a684eb9f025bdcc01.js +1 -0
  131. package/assets/esri/core/workers/chunks/e272411e2c9378aa8496.js +1312 -0
  132. package/assets/esri/core/workers/chunks/e43486113aaf72ac4dc1.js +1 -0
  133. package/assets/esri/core/workers/chunks/ea4c3393c5757e309a71.js +1 -0
  134. package/assets/esri/core/workers/chunks/ed216ddeb7f59f510bd0.js +1 -0
  135. package/assets/esri/core/workers/chunks/ef8886dff54063928bcb.js +1 -0
  136. package/assets/esri/core/workers/chunks/{231f502cd15f30d12be2.js → f1673e723b336204ad77.js} +1 -1
  137. package/assets/esri/core/workers/chunks/{d69110ec4078c583a05e.js → f207b3be0714cc50030a.js} +1 -1
  138. package/assets/esri/core/workers/chunks/f5223ffb3be548c9b0a1.js +1 -0
  139. package/assets/esri/core/workers/chunks/f53805c7a84203305b2c.js +1 -0
  140. package/assets/esri/core/workers/chunks/f5c57ff48ca505ed701d.js +1 -0
  141. package/assets/esri/core/workers/chunks/fae147d03ed723ab234d.js +1 -0
  142. package/chunks/CheckerBoard.glsl.js +3 -5
  143. package/chunks/ColorMaterial.glsl.js +4 -6
  144. package/chunks/ComponentShader.glsl.js +42 -44
  145. package/chunks/DefaultMaterial.glsl.js +21 -23
  146. package/chunks/EdgeShader.glsl.js +9 -11
  147. package/chunks/GaussianSplat.glsl.js +8 -8
  148. package/chunks/GlobalIllumination.glsl.js +186 -116
  149. package/chunks/GlobalIlluminationBlur.glsl.js +81 -61
  150. package/chunks/GlobalIlluminationUpscale.glsl.js +66 -0
  151. package/chunks/ImageMaterial.glsl.js +5 -7
  152. package/chunks/LineCallout.glsl.js +9 -12
  153. package/chunks/LineMarker.glsl.js +24 -26
  154. package/chunks/Path.glsl.js +15 -17
  155. package/chunks/Pattern.glsl.js +25 -27
  156. package/chunks/RealisticTree.glsl.js +11 -13
  157. package/chunks/RibbonLine.glsl.js +42 -45
  158. package/chunks/ShadedColorMaterial.glsl.js +8 -9
  159. package/chunks/Water.glsl.js +18 -20
  160. package/config.js +1 -1
  161. package/form/elements/FieldElement.d.ts +3 -2
  162. package/form/elements/inputs/Input.d.ts +1 -1
  163. package/form/elements/inputs/MultipleChoiceInput.d.ts +65 -0
  164. package/form/elements/inputs/MultipleChoiceInput.js +2 -0
  165. package/form/elements/inputs/inputUtils.js +1 -1
  166. package/form/elements/inputs/multipleChoice/Choice.d.ts +30 -0
  167. package/form/elements/inputs/multipleChoice/Choice.js +2 -0
  168. package/form/elements/inputs/multipleChoice/OtherChoice.d.ts +28 -0
  169. package/form/elements/inputs/multipleChoice/OtherChoice.js +2 -0
  170. package/form/elements/inputs.d.ts +11 -2
  171. package/form/elements/inputs.js +1 -1
  172. package/form/support/formUtils.js +1 -1
  173. package/interfaces.d.ts +28 -0
  174. package/kernel.js +1 -1
  175. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  176. package/layers/VoxelWasmPerSceneView.js +1 -1
  177. package/layers/graphics/FlatFeature.js +1 -1
  178. package/layers/graphics/FlatFeatureSet.js +1 -1
  179. package/layers/graphics/OptimizedFeature.js +1 -1
  180. package/layers/graphics/data/AttributesBuilder.js +1 -1
  181. package/layers/graphics/data/QueryEngineResult.js +1 -1
  182. package/layers/graphics/data/flatFeatureQueryEngineAdapter.js +1 -1
  183. package/layers/graphics/data/optimizedFeatureQueryEngineAdapter.js +1 -1
  184. package/layers/graphics/featureConversionUtils.js +1 -1
  185. package/layers/support/LabelClass.js +1 -1
  186. package/layers/support/featureLayerUtils.js +1 -1
  187. package/layers/support/labelUtils.js +1 -1
  188. package/layers/video/videoUtils.js +1 -1
  189. package/package.json +2 -2
  190. package/popupTemplateUtils.js +2 -0
  191. package/renderers/visualVariables/SizeVariable.js +1 -1
  192. package/renderers/visualVariables/support/sizeVariableUtils.js +1 -1
  193. package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
  194. package/rest/support/OutDistance.js +2 -0
  195. package/rest/support/Query.js +1 -1
  196. package/smartMapping/statistics/support/utils.js +1 -1
  197. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  198. package/support/arcadeUtils.js +1 -1
  199. package/support/revision.js +1 -1
  200. package/third-party-notices.txt +7 -29
  201. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  202. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  203. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  204. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  205. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  206. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  207. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  208. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  209. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  210. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  211. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  212. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  213. package/views/3d/environment/EnvironmentManager.js +1 -1
  214. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  215. package/views/3d/layers/I3SMeshView3D.js +1 -1
  216. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  217. package/views/3d/layers/IntegratedMeshNormals.js +1 -1
  218. package/views/3d/layers/StreamLayerView3D.js +1 -1
  219. package/views/3d/layers/graphics/featureExpressionInfoUtils.js +1 -1
  220. package/views/3d/state/ViewStateManager.js +1 -1
  221. package/views/3d/support/orientedBoundingBox.js +1 -1
  222. package/views/3d/terrain/OverlayRenderer.js +1 -1
  223. package/views/3d/terrain/TerrainRenderer.js +1 -1
  224. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  225. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialGlobalParameters.js +1 -1
  226. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  227. package/views/3d/webgl-engine/collections/Component/Material/ComponentShader.glsl.js +1 -1
  228. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  229. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +20 -32
  230. package/views/3d/webgl-engine/core/shaderLibrary/shading/GlobalIlluminationWeights.glsl.js +21 -0
  231. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadGlobalIllumination.glsl.js +11 -7
  232. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +5 -3
  233. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
  234. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  235. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  236. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +2 -0
  237. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  238. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationBlur.glsl.js +2 -0
  239. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationBlurTechnique.js +1 -1
  240. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechnique.js +1 -1
  241. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationUpscale.glsl.js +2 -0
  242. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationUpscaleTechnique.js +2 -0
  243. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  244. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  245. package/views/3d/webgl-engine/lib/Compositor.js +1 -1
  246. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  247. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  248. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  249. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  250. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  251. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  252. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
  253. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechniqueConfiguration.js +1 -1
  254. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  255. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  256. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  257. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  258. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  259. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  260. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  261. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  262. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  263. package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
  264. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  265. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  266. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  267. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  268. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  269. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  270. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  271. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  272. package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
  273. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  274. package/views/3d/webgl-engine/shaders/CheckerBoardTechniqueConfiguration.js +1 -1
  275. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  276. package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
  277. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  278. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  279. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  280. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  281. package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
  282. package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
  283. package/views/3d/webgl-engine/shaders/ImageMaterialTechniqueConfiguration.js +1 -1
  284. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  285. package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
  286. package/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration.js +1 -1
  287. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  288. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  289. package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
  290. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  291. package/views/3d/webgl-engine/shaders/PatternTechniqueConfiguration.js +1 -1
  292. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  293. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  294. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  295. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  296. package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
  297. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechniqueConfiguration.js +1 -1
  298. package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
  299. package/views/VideoView.js +1 -1
  300. package/views/interactive/sketch/SketchOptions.d.ts +3 -1
  301. package/views/interactive/sketch/SketchTooltipOptions.d.ts +6 -0
  302. package/views/layers/FeatureLikeLayerView.js +1 -1
  303. package/views/support/Scheduler.js +1 -1
  304. package/views/video/VideoOperationalDataView.js +1 -1
  305. package/views/webgl/ShaderBuilder.js +1 -1
  306. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  307. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  308. package/widgets/BatchAttributeForm/inputs/SingleFeatureInputAdapter.js +2 -0
  309. package/widgets/BatchAttributeForm/inputs/TextElementInput.d.ts +28 -4
  310. package/widgets/BatchAttributeForm/inputs/TextElementInput.js +1 -1
  311. package/widgets/BatchAttributeForm/templates/AttachmentElementTemplate.js +2 -0
  312. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  313. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  314. package/widgets/BatchAttributeForm/templates/support/templateUtils.js +1 -1
  315. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +19 -3
  316. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  317. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  318. package/widgets/FeatureTable/VisibleElements.d.ts +15 -1
  319. package/widgets/FeatureTable/VisibleElements.js +1 -1
  320. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  321. package/widgets/FeatureTable.d.ts +15 -1
  322. package/widgets/FeatureTable.js +1 -1
  323. package/widgets/Search/SearchViewModel.js +1 -1
  324. package/widgets/Search/support/layerSearchUtils.js +1 -1
  325. package/widgets/support/widgetUtils.js +1 -1
  326. package/assets/esri/core/workers/chunks/09ecb36e44096e577af8.js +0 -1
  327. package/assets/esri/core/workers/chunks/0ca06ea649bbdb93ff49.js +0 -1
  328. package/assets/esri/core/workers/chunks/10308c9f3f0d709d96bc.js +0 -1
  329. package/assets/esri/core/workers/chunks/141edf5ed890105a079b.js +0 -1
  330. package/assets/esri/core/workers/chunks/160b9a76b75875507c86.js +0 -1
  331. package/assets/esri/core/workers/chunks/16dfdee05704df249e95.js +0 -1
  332. package/assets/esri/core/workers/chunks/17ef955dc48e329aa184.js +0 -1
  333. package/assets/esri/core/workers/chunks/18001536ed345955121a.js +0 -1
  334. package/assets/esri/core/workers/chunks/20e715e3aeb1c3265901.js +0 -1
  335. package/assets/esri/core/workers/chunks/238f51d0b36f998017b8.js +0 -1
  336. package/assets/esri/core/workers/chunks/2cee6d751c5e73fe09d4.js +0 -1
  337. package/assets/esri/core/workers/chunks/314140e2e9b813191907.js +0 -1
  338. package/assets/esri/core/workers/chunks/3158a3487d3e8a61b680.js +0 -1
  339. package/assets/esri/core/workers/chunks/3b1446286a9b87f34761.js +0 -1
  340. package/assets/esri/core/workers/chunks/3f7fd58ee7d71989fc83.js +0 -1
  341. package/assets/esri/core/workers/chunks/41396724040180d2537f.js +0 -1
  342. package/assets/esri/core/workers/chunks/416e031bafc0189544fa.js +0 -1
  343. package/assets/esri/core/workers/chunks/55ee78923987ed17ea8c.js +0 -1
  344. package/assets/esri/core/workers/chunks/56c7d7c7217557375fb6.js +0 -1
  345. package/assets/esri/core/workers/chunks/58b3c888c8bfedbe6443.js +0 -1
  346. package/assets/esri/core/workers/chunks/5a1d975b3e9e6b7eff67.js +0 -1
  347. package/assets/esri/core/workers/chunks/5f6942ac94acd7842926.js +0 -1
  348. package/assets/esri/core/workers/chunks/6118706b9a038e9a06b8.js +0 -1
  349. package/assets/esri/core/workers/chunks/6d15229b3fa84a7acf4d.js +0 -599
  350. package/assets/esri/core/workers/chunks/7314c0131403cac84ad7.js +0 -1
  351. package/assets/esri/core/workers/chunks/73545bb13c70f6a347a4.js +0 -1
  352. package/assets/esri/core/workers/chunks/73a045061e69a22b6869.js +0 -1
  353. package/assets/esri/core/workers/chunks/75669912cddcb5db52c8.js +0 -1
  354. package/assets/esri/core/workers/chunks/7ca32806e47be15109a4.js +0 -1
  355. package/assets/esri/core/workers/chunks/7d6ed65bbcd279448191.js +0 -1
  356. package/assets/esri/core/workers/chunks/81f149e45c79b9b086fb.js +0 -1
  357. package/assets/esri/core/workers/chunks/84fa25f66a6949290221.js +0 -1
  358. package/assets/esri/core/workers/chunks/852aabbf671d2ca9cd33.js +0 -1
  359. package/assets/esri/core/workers/chunks/854fe80272b59fafc2e9.js +0 -1
  360. package/assets/esri/core/workers/chunks/85edbb072a2ce6c1bb30.js +0 -2
  361. package/assets/esri/core/workers/chunks/861817be5e050e9522ab.js +0 -1
  362. package/assets/esri/core/workers/chunks/89345a682dea60ef1643.js +0 -1
  363. package/assets/esri/core/workers/chunks/8985402c328b90af5724.js +0 -1
  364. package/assets/esri/core/workers/chunks/89fdf9ad10ca8fbb08a5.js +0 -1
  365. package/assets/esri/core/workers/chunks/8b094330323d9b16fb5d.js +0 -1
  366. package/assets/esri/core/workers/chunks/90aed8c4b266832f84ca.js +0 -1
  367. package/assets/esri/core/workers/chunks/943cf0653a2b7de16a4f.js +0 -1
  368. package/assets/esri/core/workers/chunks/9776c2db337222ceceef.js +0 -1
  369. package/assets/esri/core/workers/chunks/990853e9df38fdfc58b5.js +0 -1
  370. package/assets/esri/core/workers/chunks/9a21ba0c45a96b94c05e.js +0 -1
  371. package/assets/esri/core/workers/chunks/9a235c92f21df2c17aa8.js +0 -1
  372. package/assets/esri/core/workers/chunks/9b56162ac67c992193ce.js +0 -1
  373. package/assets/esri/core/workers/chunks/9f1f5fb648302c43ad12.js +0 -1
  374. package/assets/esri/core/workers/chunks/a1e6187c239fdc7553ed.js +0 -1
  375. package/assets/esri/core/workers/chunks/a4b6fdbc995be03d2afb.js +0 -1
  376. package/assets/esri/core/workers/chunks/a760be8fa6c6ea6b745c.js +0 -1
  377. package/assets/esri/core/workers/chunks/a8782286ce3c0d6c20e6.js +0 -1
  378. package/assets/esri/core/workers/chunks/a96692514dcaa50340dd.js +0 -1
  379. package/assets/esri/core/workers/chunks/a994a3c912a33b2f4100.js +0 -1
  380. package/assets/esri/core/workers/chunks/aa7aaeae31ddb259e55e.js +0 -1
  381. package/assets/esri/core/workers/chunks/abcc5fb71be2bd94878c.js +0 -1
  382. package/assets/esri/core/workers/chunks/aecb05df4ad1454f5435.js +0 -1
  383. package/assets/esri/core/workers/chunks/aecb105db7cec2c9c4c5.js +0 -1
  384. package/assets/esri/core/workers/chunks/b19f33e026a2a43b17c4.js +0 -1
  385. package/assets/esri/core/workers/chunks/b3950d5f1f3352521504.js +0 -1
  386. package/assets/esri/core/workers/chunks/b3f0600729227b458a75.js +0 -1
  387. package/assets/esri/core/workers/chunks/b5922991d2f450e6a9d9.js +0 -1
  388. package/assets/esri/core/workers/chunks/b8643976a7f984552d94.js +0 -1
  389. package/assets/esri/core/workers/chunks/b8a11d32a4847513619b.js +0 -1
  390. package/assets/esri/core/workers/chunks/b8acb6c2538053c01cc6.js +0 -1
  391. package/assets/esri/core/workers/chunks/ba4259aa050169c1d523.js +0 -1
  392. package/assets/esri/core/workers/chunks/bbaf1d9835671c0165ca.js +0 -1
  393. package/assets/esri/core/workers/chunks/bcefdf9753d9d2f6f1be.js +0 -1
  394. package/assets/esri/core/workers/chunks/c178e2cfc34603661b1d.js +0 -1
  395. package/assets/esri/core/workers/chunks/c3e80c0e29ac6a7a6f80.js +0 -1
  396. package/assets/esri/core/workers/chunks/c79827f879d1d58d3f1b.js +0 -1
  397. package/assets/esri/core/workers/chunks/c92b40a532e708e506cc.js +0 -1
  398. package/assets/esri/core/workers/chunks/cb903ccbce87172a0757.js +0 -1
  399. package/assets/esri/core/workers/chunks/cda2e445eb2ac269abdf.js +0 -1
  400. package/assets/esri/core/workers/chunks/ce44e172e2847fd8df14.js +0 -1
  401. package/assets/esri/core/workers/chunks/cff7e921649aef715c78.js +0 -1
  402. package/assets/esri/core/workers/chunks/d0c3ab70f390cd579fed.js +0 -1
  403. package/assets/esri/core/workers/chunks/d315098b038a96084ff5.js +0 -1
  404. package/assets/esri/core/workers/chunks/d4a9eb4470cc6a1f67fc.js +0 -2
  405. package/assets/esri/core/workers/chunks/d8c0d18f0132872decd3.js +0 -1
  406. package/assets/esri/core/workers/chunks/db0061a6d5bf454cc509.js +0 -1
  407. package/assets/esri/core/workers/chunks/dca595fdd5e1a571e441.js +0 -1
  408. package/assets/esri/core/workers/chunks/dcfafcf4386f2940d000.js +0 -1
  409. package/assets/esri/core/workers/chunks/df8143b72ef94806c992.js +0 -1
  410. package/assets/esri/core/workers/chunks/e2b034c391c603f7f825.js +0 -1
  411. package/assets/esri/core/workers/chunks/e3a73d9acebccd3ba49b.js +0 -1
  412. package/assets/esri/core/workers/chunks/e67bdd8bf38ebe89a344.js +0 -1
  413. package/assets/esri/core/workers/chunks/e797d45eba0884dc7e6f.js +0 -1
  414. package/assets/esri/core/workers/chunks/e81a3da05fcff97b4752.js +0 -1
  415. package/assets/esri/core/workers/chunks/e957d52cb9643961a843.js +0 -1127
  416. package/assets/esri/core/workers/chunks/e9dd60d0220036545ebb.js +0 -1
  417. package/assets/esri/core/workers/chunks/ea6d3b7c7d720aa7bc94.js +0 -1
  418. package/assets/esri/core/workers/chunks/eb9982bc866976fef960.js +0 -1
  419. package/assets/esri/core/workers/chunks/ec4669a0edeca94710e0.js +0 -1
  420. package/assets/esri/core/workers/chunks/ef013a77950c1902de11.js +0 -1
  421. package/assets/esri/core/workers/chunks/ef9d74f8d5a502fda809.js +0 -1
  422. package/assets/esri/core/workers/chunks/f09446b9ff937a84d6d3.js +0 -1
  423. package/assets/esri/core/workers/chunks/f0bc5e8e44d53b73d431.js +0 -1
  424. package/assets/esri/core/workers/chunks/f653970d983f17fb764b.js +0 -1
  425. package/assets/esri/core/workers/chunks/f9edc685099f51363f41.js +0 -1
  426. package/assets/esri/core/workers/chunks/fa687ba2d66fcc2501da.js +0 -1
  427. package/assets/esri/core/workers/chunks/fb9a889ec9fd23739a14.js +0 -1
  428. package/assets/esri/core/workers/chunks/fe1b67ab7748a3aef231.js +0 -1
  429. package/chunks/HUDCompositing.glsl.js +0 -2
  430. package/views/3d/webgl-engine/core/shaderLibrary/shading/EncodingColor.glsl.js +0 -7
  431. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js +0 -5
  432. package/views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js +0 -8
  433. package/views/3d/webgl-engine/effects/fboFormatUtils.js +0 -2
  434. package/views/3d/webgl-engine/shaders/GlobalIllumination.glsl.js +0 -2
  435. package/views/3d/webgl-engine/shaders/GlobalIlluminationBlur.glsl.js +0 -2
  436. package/views/3d/webgl-engine/shaders/HUDCompositing.glsl.js +0 -2
  437. package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +0 -2
  438. /package/assets/esri/core/workers/chunks/{85edbb072a2ce6c1bb30.js.LICENSE.txt → 9eb4ae556950e1d0124d.js.LICENSE.txt} +0 -0
  439. /package/assets/esri/core/workers/chunks/{d4a9eb4470cc6a1f67fc.js.LICENSE.txt → d65b1234867f7d773d50.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import t from"../../core/Error.js";import e from"../../core/Logger.js";import{assertIsSome as r}from"../../core/maybe.js";import{is as n,fromRectValues as o}from"../../geometry/support/aaBoundingBox.js";import{fromValues as s}from"../../geometry/support/aaBoundingRect.js";import{isPoint as u,isPolygon as c,isPolyline as l,isMultipoint as i,isGeometryWithZ as f,isGeometryWithM as a}from"../../geometry/support/jsonTypeUtils.js";import{OptimizedFeature as h}from"./OptimizedFeature.js";import m from"./OptimizedFeatureSet.js";import d from"./OptimizedGeometry.js";import{createFeatureId as g}from"./data/createFeatureId.js";const y=()=>e.getLogger("esri.layers.graphics.featureConversionUtils"),p={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryMultiPatch:3,esriGeometryEnvelope:0};function I({scale:t,translate:e},r){return Math.round((r-e[0])/t[0])}function M({scale:t,translate:e},r){return Math.round((e[1]-r)/t[1])}function b({scale:t,translate:e},r){return Math.round((r-e[0])/t[0])}function w({scale:t,translate:e},r){return Math.round((r-e[1])/t[1])}function G(t,e){return T(t,e,0)}function N(t,e){return T(t,-e,1)}function T({scale:t,translate:e},r,n){return r*t[n]+e[n]}function P(t,e,r){return e&&(t.hasZ=!0),r&&(t.hasM=!0),t}function F(t,e,r,n){if(e&&n&&t!==r)return(e,r,n,o)=>{n[o++]=e[r++],n[o++]=e[r++],t?r++:n[o++]=0,n[o++]=e[r++]??0};const o=2+(r?1:0)+(n?1:0),s=o-((!t&&r?1:0)+(!e&&n?1:0));return(t,e,r,n)=>{for(let u=0;u<o;++u)r[n++]=u<s?t[e++]??0:0}}function Z(t,e,r){if(!t)return null;const{coords:n,hasZ:o,hasM:s}=t,[u,c]=n,l=o?n[2]:0,i=s?n[2+(o?1:0)]:0;return{x:u,y:c,z:e?l:void 0,m:r?i:void 0}}function x(t,e,r,n){for(const{geometry:o,attributes:s}of e)t.push({attributes:s,geometry:Z(o,r,n)});return t}function E(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:u,centroid:c}=s,l=f(e),i=a(e);t.push(new h(e?j(e,r&&l,n&&i):null,u,c?j(c,!1,!1):null,g(s,o)))}return t}function j(t,e=f(t),r=a(t)){const{x:n,y:o,z:s,m:u}=t,c=[n,o];return e&&c.push(s??0),r&&c.push(u??0),new d([],c,e,r)}function v(t,e,r,n){for(const{geometry:o,attributes:s}of e)t.push({geometry:o&&k(o,r,n),attributes:s});return t}function k(t,e,r){if(null==t)return null;const{coords:n,stride:o,hasZ:s,hasM:u}=t,c=F(s,u,e,r),l=[];for(let i=0;i<n.length;i+=o){const t=[];c(n,i,t,0),l.push(t)}return P({points:l},e,r)}function V(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:u}=s,c=f(e),l=a(e);t.push(new h(e?Y(e,r&&c,n&&l):null,u,null,g(s,o)))}return t}function Y(t,e=f(t),r=a(t)){const{points:n,hasZ:o,hasM:s}=t,u=new d([n.length],[],e,r),{coords:c,stride:l}=u;let i=0;const h=F(o??!1,s??!1,e,r);for(const f of n)h(f,0,c,i),i+=l;return u}function _(t,e,r,n){for(const{geometry:o,attributes:s}of e)t.push({geometry:o&&L(o,r,n),attributes:s});return t}function L(t,e,r){if(!t)return null;const{coords:n,lengths:o,stride:s,hasZ:u,hasM:c}=t;let l=0;const i=F(u,c,e,r),f=[];for(const a of o){const t=[];for(let e=0;e<a;e++){const e=[];i(n,l,e,0),l+=s,t.push(e)}f.push(t)}return P({paths:f},e,r)}function O(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:u,centroid:c}=s,l=f(e),i=a(e);t.push(new h(e?S(e,r&&l,n&&i):null,u,c?j(c,!1,!1):null,g(s,o)))}return t}function S(t,e=f(t),r=a(t)){const{paths:n,hasZ:o,hasM:s}=t,u=F(o??!1,s??!1,e,r),c=new d([],[],e,r),{lengths:l,coords:i,stride:h}=c;let m=0;for(const f of n){for(const t of f)u(t,0,i,m),m+=h;l.push(f.length)}return c}function U(t,e,r,n){for(const{geometry:o,attributes:s,centroid:u}of e){const e=z(o,r,n),c=Z(u,!1,!1);t.push(u?{geometry:e,attributes:s,centroid:c}:{geometry:e,attributes:s})}return t}function z(t,e,r){if(!t)return null;const{coords:n,lengths:o,stride:s,hasZ:u,hasM:c}=t;let l=0;const i=F(u,c,e,r),f=[];for(const a of o){const t=[];for(let e=0;e<a;e++){const e=[];i(n,l,e,0),l+=s,t.push(e)}f.push(t)}return P({rings:f},e,r)}function R(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:u,centroid:c}=s,l=f(e),i=a(e);t.push(new h(e?A(e,r&&l,n&&i):null,u,c?j(c,!1,!1):null,g(s,o)))}return t}function A(t,e=f(t),r=a(t)){const{rings:n,hasZ:o,hasM:s}=t,u=new d([],[],e,r),{lengths:c,coords:l,stride:i}=u;let h=0;const m=F(o??!1,s??!1,e,r);for(const f of n){for(const t of f)m(t,0,l,h),h+=i;c.push(f.length)}return u}const $=[],q=[];function B(t,e,r,n,o){$[0]=t;const[s]=C(q,$,e,r,n,o);return dt($),dt(q),s}function C(e,r,n,o,s,u){if(dt(e),!n){for(const t of r){const r=g(t,u);e.push(new h(null,t.attributes,null,r))}return e}switch(n){case"esriGeometryPoint":return E(e,r,o,s,u);case"esriGeometryMultipoint":return V(e,r,o,s,u);case"esriGeometryPolyline":return O(e,r,o,s,u);case"esriGeometryPolygon":case"esriGeometryMultiPatch":return R(e,r,o,s,u);default:y().error("convertToFeatureSet:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${n}'`)),dt(e)}return e}function D(t,e,r,n){q[0]=t,Q($,q,e,r,n);const o=$[0];return dt($),dt(q),o}function H(e,r=f(e),n=a(e)){return null==e?null:u(e)?j(e,r,n):c(e)?A(e,r,n):l(e)?S(e,r,n):i(e)?Y(e,r,n):void y().error("convertFromGeometry:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${e}'`))}function J(e,r,n,o){if(null==e)return null;const s="coords"in e?e:e.geometry;if(null==s)return null;switch(r){case"esriGeometryPoint":return Z(s,n,o);case"esriGeometryMultipoint":return k(s,n,o);case"esriGeometryPolyline":return L(s,n,o);case"esriGeometryPolygon":return z(s,n,o);default:return y().error("convertToGeometry:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${r}'`)),null}}function K(t,e){for(const r of e)t.push({attributes:r.attributes});return t}function Q(e,r,n,o,s){if(dt(e),null==n)return K(e,r);switch(n){case"esriGeometryPoint":return x(e,r,o,s);case"esriGeometryMultipoint":return v(e,r,o,s);case"esriGeometryPolyline":return _(e,r,o,s);case"esriGeometryPolygon":return U(e,r,o,s);default:y().error("convertToFeatureSet:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${n}'`))}return e}function W(t){const{spatialReference:e,transform:r,fields:n,hasM:o,hasZ:s,features:u,geometryType:c,exceededTransferLimit:l,queryGeometry:i,queryGeometryType:f}=t,a={features:Q([],u,c,s,o),fields:n,geometryType:c,spatialReference:e,queryGeometry:J(i,f,s,o)};return r&&(a.transform=r),l&&(a.exceededTransferLimit=l),o&&(a.hasM=o),s&&(a.hasZ=s),a}function X(t,e){const r=new m,{hasM:n,hasZ:o,features:s,spatialReference:u,geometryType:c,exceededTransferLimit:l,transform:i,fields:f,globalIdFieldName:a}=t;return f&&(r.fields=f),r.geometryType=c??null,r.spatialReference=u??null,s&&C(r.features,s,c,o,n,e),l&&(r.exceededTransferLimit=l),n&&(r.hasM=n),o&&(r.hasZ=o),i&&(r.transform=i),a&&(r.globalIdFieldName=a),r}function tt(t){const{transform:e,features:r}=t;if(!e)return t;for(const n of r)null!=n.geometry&&lt(n.geometry,e),null!=n.centroid&&lt(n.centroid,e);return t.transform=null,t}function et(t,e){const{geometryType:r,features:n}=e;if(!t)return e;for(let o=0;o<n.length;o++){const e=n[o],s=e.weakClone();s.geometry=rt(e.geometry,r,t),s.centroid=rt(e.centroid,"esriGeometryPoint",t),n[o]=s}return e.transform=t,e}function rt(t,e,r,n,o){if(null==t)return null;if(!t?.coords.length)return null;const s=p[e],{coords:u,lengths:c,stride:l,hasZ:i,hasM:f}=t;n??=i,o??=f;const a=new d([],[],n,o),h=a.stride,m=F(i,f,n,o);let g=0;const y=[0,0,0,0].slice(h);function b(){m(u,g,y,0),g+=l,y[0]=I(r,y[0]),y[1]=M(r,y[1])}if(t.isPoint)return b(),a.coords.push(...y),a;let w=0;for(const d of c){if(d<s)continue;let t=1;b(),a.coords.push(...y);let[e,r]=y;for(let n=1;n<d;n++){b();const[n,o]=y;e===n&&r===o||(y[0]-=e,y[1]-=r,a.coords.push(...y),e=n,r=o,t++)}t>=s?(a.lengths.push(t),w=a.coords.length):dt(a.coords,w)}return dt(a.coords,w),a.coords.length?a:null}function nt(t,e,r,n=t.hasZ,o=t.hasM){if(!t.coords.length)return null;const s=p[e],{coords:u,lengths:c,stride:l,hasZ:i,hasM:f}=t,a=new d([],[],n,o),h=a.stride,m=F(i,f,n,o);if(t.isPoint)return m(u,0,a.coords,0),a;let g=0;const y=r*r;for(const d of c){if(d<s){g+=d*l;continue}const t=a.coords.length/h,e=g,r=g+(d-1)*l;m(u,e,a.coords,a.coords.length),st(a.coords,u,l,y,m,e,r),m(u,r,a.coords,a.coords.length);const n=a.coords.length/h-t;n>=s?a.lengths.push(n):dt(a.coords,t*h),g+=d*l}return a.coords.length?a:null}function ot(t,e,r,n){const o=t[e],s=t[e+1],u=t[r],c=t[r+1],l=t[n],i=t[n+1];let f=u,a=c,h=l-f,m=i-a;if(0!==h||0!==m){const t=((o-f)*h+(s-a)*m)/(h*h+m*m);t>1?(f=l,a=i):t>0&&(f+=h*t,a+=m*t)}return h=o-f,m=s-a,h*h+m*m}function st(t,e,r,n,o,s,u){let c,l=n,i=0;for(let f=s+r;f<u;f+=r)c=ot(e,f,s,u),c>l&&(i=f,l=c);l>n&&(i-s>r&&st(t,e,r,n,o,s,i),o(e,i,t,t.length),u-i>r&&st(t,e,r,n,o,i,u))}function ut(t,e){if(!e?.coords?.length)return null;let r=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;const{coords:i,stride:f}=e;for(let n=0;n<i.length;n+=f){const t=i[n],e=i[n+1];r=Math.min(r,t),c=Math.max(c,t),u=Math.min(u,e),l=Math.max(l,e)}return n(t)?o(t,r,u,c,l):s(r,u,c,l,t),t}function ct(t,e){const{lengths:r,coords:n,stride:o}=e;let s=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY,i=0;for(const f of r){let t=n[i],e=n[i+1];s=Math.min(t,s),u=Math.min(e,u),c=Math.max(t,c),l=Math.max(e,l),i+=o;for(let r=1;r<f;r++,i+=o){const r=n[i],o=n[i+1];t+=r,e+=o,r<0&&(s=Math.min(s,t)),r>0&&(c=Math.max(c,t)),o<0?u=Math.min(u,e):o>0&&(l=Math.max(l,e))}}return t[0]=s,t[1]=u,t[2]=c,t[3]=l,t}function lt(t,e){const{coords:n,lengths:o,stride:s}=t;if(!n.length)return void(o.length=0);r(e);const{originPosition:u,scale:c,translate:l}=e,i=gt;i.originPosition=u;const f=i.scale;f[0]=c[0]??1,f[1]=-(c[1]??1),f[2]=c[2]??1,f[3]=c[3]??1;const a=i.translate;if(a[0]=l[0]??0,a[1]=l[1]??0,a[2]=l[2]??0,a[3]=l[3]??0,!o.length){for(let t=0;t<s;++t)n[t]=T(i,n[t],t);return void(o.length=0)}let h=0;for(let r=0;r<o.length;r++){const t=o[r];o[r]=t;for(let r=0;r<s;++r)n[h+r]=T(i,n[h+r],r);let e=n[h],u=n[h+1];h+=s;for(let r=1;r<t;r++,h+=s){e+=n[h]*f[0],u+=n[h+1]*f[1],n[h]=e,n[h+1]=u;for(let t=2;t<s;++t)n[h+t]=T(i,n[h+t],t)}}}function it(t,e){if(!t?.coords?.length)return null;const r=p[e],{coords:n,lengths:o,stride:s,hasZ:u,hasM:c}=t,l=F(u,c,u,c),i=new d([],[],u,c);let f=0,a=0,h=0,m=0;for(const d of o){a=m,l(n,f,i.coords,a),f+=s,a+=s;let t=n[f],e=n[f+1];for(let r=1;r<d;r++){const o=n[f+s],u=n[f+s+1];t*u-e*o===0&&r!==d-1||(l(n,f,i.coords,a),i.coords[a]=t,i.coords[a+1]=e,a+=s,t=e=0),t+=o,e+=u,f+=s}const o=(a-m)/s;o>=r&&(i.lengths[h]=o,m=a,h++)}return i.coords.length>m&&(i.coords.length=m),i.lengths.length>h&&(i.lengths.length=h),i.coords.length&&i.lengths.length?i:null}function ft(t,e,r,n){let o=0,s=t[n*e],u=t[n*(e+1)];for(let c=1;c<r;c++){const r=s+t[n*(e+c)],l=u+t[n*(e+c)+1],i=(r-s)*(l+u);s=r,u=l,o+=i}return.5*o}function at(t,e){const{coords:r,lengths:n}=t;let o=0,s=0;for(let u=0;u<n.length;u++){const t=n[u];s+=ft(r,o,t,e),o+=t}return Math.abs(s)}function ht(t,e,r,n){return 0===t*n-r*e&&t*r+e*n>0}function mt(t,e,r){const{stride:n}=t;if(t.isPoint){if(t.coords.length<2)return null;const[r,n]=t.coords,o=b(e,r),s=w(e,n);return new d([],[o,s])}const o=new d([],[0,0]),s=p[r],u="esriGeometryPolygon"===r||"esriGeometryPolyline"===r;let c=0,l=0;for(let i=0;i<t.lengths.length;i++){const r=t.lengths[i],f=l;let a=b(e,t.coords[n*c]),h=w(e,t.coords[n*c+1]);o.coords[l++]=a,o.coords[l++]=h;let m=0,d=0,g=1;for(let s=1;s<r;s++){const r=b(e,t.coords[n*(s+c)]),i=w(e,t.coords[n*(s+c)+1]);if(r!==a||i!==h){const t=r-a,e=i-h;u&&ht(m,d,t,e)?(o.coords[l-2]+=t,o.coords[l-1]+=e,a+=t,h+=e):(o.coords[l++]=r,o.coords[l++]=i,a=r,h=i,m=t,d=e,g+=1)}}g<s?l=f:o.lengths.push(g),c+=r}return 0===o.lengths.length?null:o}function dt(t,e=0){t.length!==e&&(t.length=e)}const gt={originPosition:"lowerLeft",scale:[1,1,1,1],translate:[0,0,0,0]};export{B as convertFromFeature,X as convertFromFeatureSet,C as convertFromFeatures,H as convertFromGeometry,Y as convertFromMultipoint,V as convertFromMultipointFeatures,j as convertFromPoint,E as convertFromPointFeatures,A as convertFromPolygon,S as convertFromPolyline,O as convertFromPolylineFeatures,D as convertToFeature,W as convertToFeatureSet,Q as convertToFeatures,J as convertToGeometry,k as convertToMultipoint,v as convertToMultipointFeatures,Z as convertToPoint,z as convertToPolygon,L as convertToPolyline,nt as generalizeOptimizedGeometry,ut as getBoundsOptimizedGeometry,at as getQuantizedArea,ct as getQuantizedBoundsOptimizedGeometry,ft as getSignedQuantizedRingArea,mt as quantizeForDisplay,et as quantizeOptimizedFeatureSet,rt as quantizeOptimizedGeometry,I as quantizeX,M as quantizeY,it as removeCollinearVertices,tt as unquantizeOptimizedFeatureSetInPlace,lt as unquantizeOptimizedGeometryInPlace,T as unquantizeValue,G as unquantizeX,N as unquantizeY};
2
+ import t from"../../core/Error.js";import e from"../../core/Logger.js";import{assertIsSome as n}from"../../core/maybe.js";import{is as r,fromRectValues as o}from"../../geometry/support/aaBoundingBox.js";import{fromValues as s}from"../../geometry/support/aaBoundingRect.js";import{isPoint as u,isPolygon as c,isPolyline as i,isMultipoint as l,isGeometryWithZ as a,isGeometryWithM as f}from"../../geometry/support/jsonTypeUtils.js";import{OptimizedFeature as h}from"./OptimizedFeature.js";import d from"./OptimizedFeatureSet.js";import m from"./OptimizedGeometry.js";import{createFeatureId as g}from"./data/createFeatureId.js";const y=()=>e.getLogger("esri.layers.graphics.featureConversionUtils"),p={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryMultiPatch:3,esriGeometryEnvelope:0};function I({scale:t,translate:e},n){return Math.round((n-e[0])/t[0])}function M({scale:t,translate:e},n){return Math.round((e[1]-n)/t[1])}function b({scale:t,translate:e},n){return Math.round((n-e[0])/t[0])}function w({scale:t,translate:e},n){return Math.round((n-e[1])/t[1])}function G(t,e){return T(t,e,0)}function N(t,e){return T(t,-e,1)}function T({scale:t,translate:e},n,r){return n*t[r]+e[r]}function P(t,e,n){return e&&(t.hasZ=!0),n&&(t.hasM=!0),t}function Z(t,e,n,r){if(e&&r&&t!==n)return(e,n,r,o)=>{r[o++]=e[n++],r[o++]=e[n++],t?n++:r[o++]=0,r[o++]=e[n++]??0};const o=2+(n?1:0)+(r?1:0),s=o-((!t&&n?1:0)+(!e&&r?1:0));return(t,e,n,r)=>{for(let u=0;u<o;++u)n[r++]=u<s?t[e++]??0:0}}function F(t,e,n){if(!t)return null;const{coords:r,hasZ:o,hasM:s}=t,[u,c]=r,i=o?r[2]:0,l=s?r[2+(o?1:0)]:0;return{x:u,y:c,z:e?i:void 0,m:n?l:void 0}}function x(t,e,n,r){for(const{geometry:o,attributes:s}of e)t.push({attributes:s,geometry:F(o,n,r)});return t}function E(t,e,n,r,o){for(const s of e){const{geometry:e,attributes:u,centroid:c}=s,i=a(e),l=f(e);t.push(new h(e?j(e,n&&i,r&&l):null,u,c?j(c,!1,!1):null,g(s,o),s.displayId,s.distance))}return t}function j(t,e=a(t),n=f(t)){const{x:r,y:o,z:s,m:u}=t,c=[r,o];return e&&c.push(s??0),n&&c.push(u??0),new m([],c,e,n)}function v(t,e,n,r){for(const{geometry:o,attributes:s}of e)t.push({geometry:o&&k(o,n,r),attributes:s});return t}function k(t,e,n){if(null==t)return null;const{coords:r,stride:o,hasZ:s,hasM:u}=t,c=Z(s,u,e,n),i=[];for(let l=0;l<r.length;l+=o){const t=[];c(r,l,t,0),i.push(t)}return P({points:i},e,n)}function V(t,e,n,r,o){for(const s of e){const{geometry:e,attributes:u}=s,c=a(e),i=f(e);t.push(new h(e?Y(e,n&&c,r&&i):null,u,null,g(s,o),s.displayId,s.distance))}return t}function Y(t,e=a(t),n=f(t)){const{points:r,hasZ:o,hasM:s}=t,u=new m([r.length],[],e,n),{coords:c,stride:i}=u;let l=0;const h=Z(o??!1,s??!1,e,n);for(const a of r)h(a,0,c,l),l+=i;return u}function _(t,e,n,r){for(const{geometry:o,attributes:s}of e)t.push({geometry:o&&L(o,n,r),attributes:s});return t}function L(t,e,n){if(!t)return null;const{coords:r,lengths:o,stride:s,hasZ:u,hasM:c}=t;let i=0;const l=Z(u,c,e,n),a=[];for(const f of o){const t=[];for(let e=0;e<f;e++){const e=[];l(r,i,e,0),i+=s,t.push(e)}a.push(t)}return P({paths:a},e,n)}function O(t,e,n,r,o){for(const s of e){const{geometry:e,attributes:u,centroid:c}=s,i=a(e),l=f(e);t.push(new h(e?S(e,n&&i,r&&l):null,u,c?j(c,!1,!1):null,g(s,o),s.displayId,s.distance))}return t}function S(t,e=a(t),n=f(t)){const{paths:r,hasZ:o,hasM:s}=t,u=Z(o??!1,s??!1,e,n),c=new m([],[],e,n),{lengths:i,coords:l,stride:h}=c;let d=0;for(const a of r){for(const t of a)u(t,0,l,d),d+=h;i.push(a.length)}return c}function U(t,e,n,r){for(const{geometry:o,attributes:s,centroid:u}of e){const e=z(o,n,r),c=F(u,!1,!1);t.push(u?{geometry:e,attributes:s,centroid:c}:{geometry:e,attributes:s})}return t}function z(t,e,n){if(!t)return null;const{coords:r,lengths:o,stride:s,hasZ:u,hasM:c}=t;let i=0;const l=Z(u,c,e,n),a=[];for(const f of o){const t=[];for(let e=0;e<f;e++){const e=[];l(r,i,e,0),i+=s,t.push(e)}a.push(t)}return P({rings:a},e,n)}function R(t,e,n,r,o){for(const s of e){const{geometry:e,attributes:u,centroid:c}=s,i=a(e),l=f(e);t.push(new h(e?A(e,n&&i,r&&l):null,u,c?j(c,!1,!1):null,g(s,o),s.displayId,s.distance))}return t}function A(t,e=a(t),n=f(t)){const{rings:r,hasZ:o,hasM:s}=t,u=new m([],[],e,n),{lengths:c,coords:i,stride:l}=u;let h=0;const d=Z(o??!1,s??!1,e,n);for(const a of r){for(const t of a)d(t,0,i,h),h+=l;c.push(a.length)}return u}const $=[],q=[];function B(t,e,n,r,o){$[0]=t;const[s]=C(q,$,e,n,r,o);return mt($),mt(q),s}function C(e,n,r,o,s,u){if(mt(e),!r){for(const t of n){const n=g(t,u);e.push(new h(null,t.attributes,null,n))}return e}switch(r){case"esriGeometryPoint":return E(e,n,o,s,u);case"esriGeometryMultipoint":return V(e,n,o,s,u);case"esriGeometryPolyline":return O(e,n,o,s,u);case"esriGeometryPolygon":case"esriGeometryMultiPatch":return R(e,n,o,s,u);default:y().error("convertToFeatureSet:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${r}'`)),mt(e)}return e}function D(t,e,n,r){q[0]=t,Q($,q,e,n,r);const o=$[0];return mt($),mt(q),o}function H(e,n=a(e),r=f(e)){return null==e?null:u(e)?j(e,n,r):c(e)?A(e,n,r):i(e)?S(e,n,r):l(e)?Y(e,n,r):void y().error("convertFromGeometry:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${e}'`))}function J(e,n,r,o){if(null==e)return null;const s="coords"in e?e:e.geometry;if(null==s)return null;switch(n){case"esriGeometryPoint":return F(s,r,o);case"esriGeometryMultipoint":return k(s,r,o);case"esriGeometryPolyline":return L(s,r,o);case"esriGeometryPolygon":return z(s,r,o);default:return y().error("convertToGeometry:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${n}'`)),null}}function K(t,e){for(const n of e)t.push({attributes:n.attributes});return t}function Q(e,n,r,o,s){if(mt(e),null==r)return K(e,n);switch(r){case"esriGeometryPoint":return x(e,n,o,s);case"esriGeometryMultipoint":return v(e,n,o,s);case"esriGeometryPolyline":return _(e,n,o,s);case"esriGeometryPolygon":return U(e,n,o,s);default:y().error("convertToFeatureSet:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${r}'`))}return e}function W(t){const{spatialReference:e,transform:n,fields:r,hasM:o,hasZ:s,features:u,geometryType:c,exceededTransferLimit:i,queryGeometry:l,queryGeometryType:a}=t,f={features:Q([],u,c,s,o),fields:r,geometryType:c,spatialReference:e,queryGeometry:J(l,a,s,o)};return n&&(f.transform=n),i&&(f.exceededTransferLimit=i),o&&(f.hasM=o),s&&(f.hasZ=s),f}function X(t,e){const n=new d,{hasM:r,hasZ:o,features:s,spatialReference:u,geometryType:c,exceededTransferLimit:i,transform:l,fields:a,globalIdFieldName:f}=t;return a&&(n.fields=a),n.geometryType=c??null,n.spatialReference=u??null,s&&C(n.features,s,c,o,r,e),i&&(n.exceededTransferLimit=i),r&&(n.hasM=r),o&&(n.hasZ=o),l&&(n.transform=l),f&&(n.globalIdFieldName=f),n}function tt(t){const{transform:e,features:n}=t;if(!e)return t;for(const r of n)null!=r.geometry&&it(r.geometry,e),null!=r.centroid&&it(r.centroid,e);return t.transform=null,t}function et(t,e){const{geometryType:n,features:r}=e;if(!t)return e;for(let o=0;o<r.length;o++){const e=r[o],s=e.weakClone();s.geometry=nt(e.geometry,n,t),s.centroid=nt(e.centroid,"esriGeometryPoint",t),r[o]=s}return e.transform=t,e}function nt(t,e,n,r,o){if(null==t)return null;if(!t?.coords.length)return null;const s=p[e],{coords:u,lengths:c,stride:i,hasZ:l,hasM:a}=t;r??=l,o??=a;const f=new m([],[],r,o),h=f.stride,d=Z(l,a,r,o);let g=0;const y=[0,0,0,0].slice(h);function b(){d(u,g,y,0),g+=i,y[0]=I(n,y[0]),y[1]=M(n,y[1])}if(t.isPoint)return b(),f.coords.push(...y),f;let w=0;for(const m of c){if(m<s)continue;let t=1;b(),f.coords.push(...y);let[e,n]=y;for(let r=1;r<m;r++){b();const[r,o]=y;e===r&&n===o||(y[0]-=e,y[1]-=n,f.coords.push(...y),e=r,n=o,t++)}t>=s?(f.lengths.push(t),w=f.coords.length):mt(f.coords,w)}return mt(f.coords,w),f.coords.length?f:null}function rt(t,e,n,r=t.hasZ,o=t.hasM){if(!t.coords.length)return null;const s=p[e],{coords:u,lengths:c,stride:i,hasZ:l,hasM:a}=t,f=new m([],[],r,o),h=f.stride,d=Z(l,a,r,o);if(t.isPoint)return d(u,0,f.coords,0),f;let g=0;const y=n*n;for(const m of c){if(m<s){g+=m*i;continue}const t=f.coords.length/h,e=g,n=g+(m-1)*i;d(u,e,f.coords,f.coords.length),st(f.coords,u,i,y,d,e,n),d(u,n,f.coords,f.coords.length);const r=f.coords.length/h-t;r>=s?f.lengths.push(r):mt(f.coords,t*h),g+=m*i}return f.coords.length?f:null}function ot(t,e,n,r){const o=t[e],s=t[e+1],u=t[n],c=t[n+1],i=t[r],l=t[r+1];let a=u,f=c,h=i-a,d=l-f;if(0!==h||0!==d){const t=((o-a)*h+(s-f)*d)/(h*h+d*d);t>1?(a=i,f=l):t>0&&(a+=h*t,f+=d*t)}return h=o-a,d=s-f,h*h+d*d}function st(t,e,n,r,o,s,u){let c,i=r,l=0;for(let a=s+n;a<u;a+=n)c=ot(e,a,s,u),c>i&&(l=a,i=c);i>r&&(l-s>n&&st(t,e,n,r,o,s,l),o(e,l,t,t.length),u-l>n&&st(t,e,n,r,o,l,u))}function ut(t,e){if(!e?.coords?.length)return null;let n=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const{coords:l,stride:a}=e;for(let r=0;r<l.length;r+=a){const t=l[r],e=l[r+1];n=Math.min(n,t),c=Math.max(c,t),u=Math.min(u,e),i=Math.max(i,e)}return r(t)?o(t,n,u,c,i):s(n,u,c,i,t),t}function ct(t,e){const{lengths:n,coords:r,stride:o}=e;let s=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY,l=0;for(const a of n){let t=r[l],e=r[l+1];s=Math.min(t,s),u=Math.min(e,u),c=Math.max(t,c),i=Math.max(e,i),l+=o;for(let n=1;n<a;n++,l+=o){const n=r[l],o=r[l+1];t+=n,e+=o,n<0&&(s=Math.min(s,t)),n>0&&(c=Math.max(c,t)),o<0?u=Math.min(u,e):o>0&&(i=Math.max(i,e))}}return t[0]=s,t[1]=u,t[2]=c,t[3]=i,t}function it(t,e){const{coords:r,lengths:o,stride:s,hasZ:u,hasM:c}=t;if(!r.length)return void(o.length=0);n(e);const{originPosition:i,scale:l,translate:a}=e,f=gt;f.originPosition=i;const h=f.scale;h[0]=l[0]??1,h[1]=-(l[1]??1),h[2]=l[2]??1,h[3]=l[3]??1;const d=f.translate;if(d[0]=a[0]??0,d[1]=a[1]??0,d[2]=a[2]??0,d[3]=a[3]??0,c&&!u&&(h[2]=h[3],d[2]=d[3]),!o.length){for(let t=0;t<s;++t)r[t]=T(f,r[t],t);return void(o.length=0)}let m=0;for(let n=0;n<o.length;n++){const t=o[n];o[n]=t;for(let n=0;n<s;++n)r[m+n]=T(f,r[m+n],n);let e=r[m],u=r[m+1];m+=s;for(let n=1;n<t;n++,m+=s){e+=r[m]*h[0],u+=r[m+1]*h[1],r[m]=e,r[m+1]=u;for(let t=2;t<s;++t)r[m+t]=T(f,r[m+t],t)}}}function lt(t,e){if(!t?.coords?.length)return null;const n=p[e],{coords:r,lengths:o,stride:s,hasZ:u,hasM:c}=t,i=Z(u,c,u,c),l=new m([],[],u,c);let a=0,f=0,h=0,d=0;for(const m of o){f=d,i(r,a,l.coords,f),a+=s,f+=s;let t=r[a],e=r[a+1];for(let n=1;n<m;n++){const o=r[a+s],u=r[a+s+1];t*u-e*o===0&&n!==m-1||(i(r,a,l.coords,f),l.coords[f]=t,l.coords[f+1]=e,f+=s,t=e=0),t+=o,e+=u,a+=s}const o=(f-d)/s;o>=n&&(l.lengths[h]=o,d=f,h++)}return l.coords.length>d&&(l.coords.length=d),l.lengths.length>h&&(l.lengths.length=h),l.coords.length&&l.lengths.length?l:null}function at(t,e,n,r){let o=0,s=t[r*e],u=t[r*(e+1)];for(let c=1;c<n;c++){const n=s+t[r*(e+c)],i=u+t[r*(e+c)+1],l=(n-s)*(i+u);s=n,u=i,o+=l}return.5*o}function ft(t,e){const{coords:n,lengths:r}=t;let o=0,s=0;for(let u=0;u<r.length;u++){const t=r[u];s+=at(n,o,t,e),o+=t}return Math.abs(s)}function ht(t,e,n,r){return 0===t*r-n*e&&t*n+e*r>0}function dt(t,e,n){const{stride:r}=t;if(t.isPoint){if(t.coords.length<2)return null;const[n,r]=t.coords,o=b(e,n),s=w(e,r);return new m([],[o,s])}const o=new m([],[0,0]),s=p[n],u="esriGeometryPolygon"===n||"esriGeometryPolyline"===n;let c=0,i=0;for(let l=0;l<t.lengths.length;l++){const n=t.lengths[l],a=i;let f=b(e,t.coords[r*c]),h=w(e,t.coords[r*c+1]);o.coords[i++]=f,o.coords[i++]=h;let d=0,m=0,g=1;for(let s=1;s<n;s++){const n=b(e,t.coords[r*(s+c)]),l=w(e,t.coords[r*(s+c)+1]);if(n!==f||l!==h){const t=n-f,e=l-h;u&&ht(d,m,t,e)?(o.coords[i-2]+=t,o.coords[i-1]+=e,f+=t,h+=e):(o.coords[i++]=n,o.coords[i++]=l,f=n,h=l,d=t,m=e,g+=1)}}g<s?i=a:o.lengths.push(g),c+=n}return 0===o.lengths.length?null:o}function mt(t,e=0){t.length!==e&&(t.length=e)}const gt={originPosition:"lowerLeft",scale:[1,1,1,1],translate:[0,0,0,0]};export{B as convertFromFeature,X as convertFromFeatureSet,C as convertFromFeatures,H as convertFromGeometry,Y as convertFromMultipoint,V as convertFromMultipointFeatures,j as convertFromPoint,E as convertFromPointFeatures,A as convertFromPolygon,S as convertFromPolyline,O as convertFromPolylineFeatures,D as convertToFeature,W as convertToFeatureSet,Q as convertToFeatures,J as convertToGeometry,k as convertToMultipoint,v as convertToMultipointFeatures,F as convertToPoint,z as convertToPolygon,L as convertToPolyline,rt as generalizeOptimizedGeometry,ut as getBoundsOptimizedGeometry,ft as getQuantizedArea,ct as getQuantizedBoundsOptimizedGeometry,at as getSignedQuantizedRingArea,dt as quantizeForDisplay,et as quantizeOptimizedFeatureSet,nt as quantizeOptimizedGeometry,I as quantizeX,M as quantizeY,lt as removeCollinearVertices,tt as unquantizeOptimizedFeatureSetInPlace,it as unquantizeOptimizedGeometryInPlace,T as unquantizeValue,G as unquantizeX,N as unquantizeY};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../core/has.js";import{JSONMap as r}from"../../core/jsonMap.js";import{JSONSupport as t}from"../../core/JSONSupport.js";import{clone as o}from"../../core/lang.js";import{toPt as i}from"../../core/screenUtils.js";import{property as l,subclass as n}from"../../core/accessorSupport/decorators.js";import s from"./LabelExpressionInfo.js";import{templateStringToSql as a,getSingleFieldArcadeExpression as p,getLabelExpression as c,getLabelExpressionArcade as b,getLabelExpressionSingleField as m}from"./labelUtils.js";import{isSceneServiceLayer as u}from"./layerUtils.js";import{defaultTextSymbol2D as w}from"../../symbols/support/defaults.js";import{writeLabelSymbol as f}from"../../symbols/support/jsonUtils.js";import{symbolTypesLabel3D as v,symbolTypesLabel as y}from"../../symbols/support/typeUtils.js";import{reader as h}from"../../core/accessorSupport/decorators/reader.js";import{writer as d}from"../../core/accessorSupport/decorators/writer.js";var S;const L=new r({esriServerPointLabelPlacementAboveCenter:"above-center",esriServerPointLabelPlacementAboveLeft:"above-left",esriServerPointLabelPlacementAboveRight:"above-right",esriServerPointLabelPlacementBelowCenter:"below-center",esriServerPointLabelPlacementBelowLeft:"below-left",esriServerPointLabelPlacementBelowRight:"below-right",esriServerPointLabelPlacementCenterCenter:"center-center",esriServerPointLabelPlacementCenterLeft:"center-left",esriServerPointLabelPlacementCenterRight:"center-right",esriServerLinePlacementAboveAfter:"above-after",esriServerLinePlacementAboveAlong:"above-along",esriServerLinePlacementAboveBefore:"above-before",esriServerLinePlacementAboveStart:"above-start",esriServerLinePlacementAboveEnd:"above-end",esriServerLinePlacementBelowAfter:"below-after",esriServerLinePlacementBelowAlong:"below-along",esriServerLinePlacementBelowBefore:"below-before",esriServerLinePlacementBelowStart:"below-start",esriServerLinePlacementBelowEnd:"below-end",esriServerLinePlacementCenterAfter:"center-after",esriServerLinePlacementCenterAlong:"center-along",esriServerLinePlacementCenterBefore:"center-before",esriServerLinePlacementCenterStart:"center-start",esriServerLinePlacementCenterEnd:"center-end",esriServerPolygonPlacementAlwaysHorizontal:"always-horizontal"},{ignoreUnknown:!0});function P(e,r,t){return{enabled:!u(t?.layer)}}function x(e){return!e||"service"!==e.origin&&!("map-image"===e.layer?.type)}function g(e){return"map-image"===e?.type}function E(e){return!!g(e)&&!!e.capabilities?.exportMap?.supportsArcadeExpressionForLabeling}function j(e){return x(e)||E(e?.layer)}let A=class extends t{static{S=this}static evaluateWhere(e,r){const t=(e,r,t)=>{switch(r){case"=":return e==t;case"<>":return e!=t;case">":return e>t;case">=":return e>=t;case"<":return e<t;case"<=":return e<=t}return!1};try{if(null==e)return!0;const o=e.split(" ");if(3===o.length)return t(r[o[0]],o[1],o[2]);if(7===o.length){const e=t(r[o[0]],o[1],o[2]),i=o[3],l=t(r[o[4]],o[5],o[6]);switch(i){case"AND":return e&&l;case"OR":return e||l}}return!1}catch(o){}}constructor(e){super(e),this.type="label",this.name=null,this.allowOverrun=!1,this.deconflictionStrategy="static",this.labelExpression=null,this.labelExpressionInfo=null,this.labelPlacement=null,this.labelPosition="curved",this.maxScale=0,this.minScale=0,this.repeatLabel=!0,this.symbol=w,this.useCodedValues=void 0,this.where=null}readLabelExpression(e,r){const t=r.labelExpressionInfo;if(!t||!t.value&&!t.expression)return e}writeLabelExpression(e,r,t){if(this.labelExpressionInfo)if(null!=this.labelExpressionInfo.value)e=a(this.labelExpressionInfo.value);else if(null!=this.labelExpressionInfo.expression){const r=p(this.labelExpressionInfo.expression);r&&(e="["+r+"]")}null!=e&&(r[t]=e)}writeLabelExpressionInfo(e,r,t,o){if(null==e&&null!=this.labelExpression&&x(o))e=new s({expression:this.getLabelExpressionArcade()});else if(!e)return;const i=e.toJSON(o);i.expression&&(r[t]=i)}writeMaxScale(e,r){(e||this.minScale)&&(r.maxScale=e)}writeMinScale(e,r){(e||this.maxScale)&&(r.minScale=e)}get repeatLabelDistance(){return this._get("repeatLabelDistance")}set repeatLabelDistance(e){this._set("repeatLabelDistance",e)}getLabelExpression(){return c(this)}getLabelExpressionArcade(){return b(this)}getLabelExpressionSingleField(){return m(this)}hash(){return JSON.stringify(this)}clone(){return new S({allowOverrun:this.allowOverrun,deconflictionStrategy:this.deconflictionStrategy,labelExpression:this.labelExpression,labelExpressionInfo:o(this.labelExpressionInfo),labelPosition:this.labelPosition,labelPlacement:this.labelPlacement,maxScale:this.maxScale,minScale:this.minScale,name:this.name,repeatLabel:this.repeatLabel,repeatLabelDistance:this.repeatLabelDistance,symbol:o(this.symbol),where:this.where,useCodedValues:this.useCodedValues})}};e([l({type:String,json:{write:!0}})],A.prototype,"name",void 0),e([l({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1},"portal-item":{default:!1,write:{overridePolicy:P}}}}})],A.prototype,"allowOverrun",void 0),e([l({type:String,json:{write:!0,default:"static",origins:{"web-scene":{write:!1},"portal-item":{default:"static",write:{overridePolicy:P}}}}})],A.prototype,"deconflictionStrategy",void 0),e([l({type:String,json:{write:{overridePolicy(e,r,t){return this.labelExpressionInfo&&"service"===t?.origin&&E(t.layer)?{enabled:!1}:{allowNull:!0}}}}})],A.prototype,"labelExpression",void 0),e([h("labelExpression")],A.prototype,"readLabelExpression",null),e([d("labelExpression")],A.prototype,"writeLabelExpression",null),e([l({type:s,json:{write:{overridePolicy:(e,r,t)=>j(t)?{allowNull:!0}:{enabled:!1}}}})],A.prototype,"labelExpressionInfo",void 0),e([d("labelExpressionInfo")],A.prototype,"writeLabelExpressionInfo",null),e([l({type:L.apiValues,json:{type:L.jsonValues,read:L.read,write:L.write}})],A.prototype,"labelPlacement",void 0),e([l({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],A.prototype,"labelPosition",void 0),e([l({type:Number})],A.prototype,"maxScale",void 0),e([d("maxScale")],A.prototype,"writeMaxScale",null),e([l({type:Number})],A.prototype,"minScale",void 0),e([d("minScale")],A.prototype,"writeMinScale",null),e([l({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:P}}}}})],A.prototype,"repeatLabel",void 0),e([l({type:Number,cast:i,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:P}}}}})],A.prototype,"repeatLabelDistance",null),e([l({types:y,json:{origins:{"web-scene":{types:v,write:f,default:null}},write:f,default:null}})],A.prototype,"symbol",void 0),e([l({type:Boolean,json:{write:!0}})],A.prototype,"useCodedValues",void 0),e([l({type:String,json:{write:!0}})],A.prototype,"where",void 0),A=S=e([n("esri.layers.support.LabelClass")],A);export{A as default};
2
+ import{__decorate as e}from"tslib";import"../../core/has.js";import{JSONMap as r}from"../../core/jsonMap.js";import{JSONSupport as t}from"../../core/JSONSupport.js";import{clone as o}from"../../core/lang.js";import{toPt as i}from"../../core/screenUtils.js";import{property as l,subclass as n}from"../../core/accessorSupport/decorators.js";import s from"./LabelExpressionInfo.js";import{templateStringToSql as a,getSingleFieldArcadeExpression as p,getLabelExpression as c,getLabelExpressionArcade as b,getLabelExpressionSingleField as m,LabelClassSymbol as u}from"./labelUtils.js";import{isSceneServiceLayer as w}from"./layerUtils.js";import{defaultTextSymbol2D as f}from"../../symbols/support/defaults.js";import{writeLabelSymbol as v}from"../../symbols/support/jsonUtils.js";import{symbolTypesLabel3D as y,symbolTypesLabel as h}from"../../symbols/support/typeUtils.js";import{reader as d}from"../../core/accessorSupport/decorators/reader.js";import{writer as S}from"../../core/accessorSupport/decorators/writer.js";var L,P;const x=new r({esriServerPointLabelPlacementAboveCenter:"above-center",esriServerPointLabelPlacementAboveLeft:"above-left",esriServerPointLabelPlacementAboveRight:"above-right",esriServerPointLabelPlacementBelowCenter:"below-center",esriServerPointLabelPlacementBelowLeft:"below-left",esriServerPointLabelPlacementBelowRight:"below-right",esriServerPointLabelPlacementCenterCenter:"center-center",esriServerPointLabelPlacementCenterLeft:"center-left",esriServerPointLabelPlacementCenterRight:"center-right",esriServerLinePlacementAboveAfter:"above-after",esriServerLinePlacementAboveAlong:"above-along",esriServerLinePlacementAboveBefore:"above-before",esriServerLinePlacementAboveStart:"above-start",esriServerLinePlacementAboveEnd:"above-end",esriServerLinePlacementBelowAfter:"below-after",esriServerLinePlacementBelowAlong:"below-along",esriServerLinePlacementBelowBefore:"below-before",esriServerLinePlacementBelowStart:"below-start",esriServerLinePlacementBelowEnd:"below-end",esriServerLinePlacementCenterAfter:"center-after",esriServerLinePlacementCenterAlong:"center-along",esriServerLinePlacementCenterBefore:"center-before",esriServerLinePlacementCenterStart:"center-start",esriServerLinePlacementCenterEnd:"center-end",esriServerPolygonPlacementAlwaysHorizontal:"always-horizontal"},{ignoreUnknown:!0});function g(e,r,t){return{enabled:!w(t?.layer)}}function E(e){return!e||"service"!==e.origin&&!("map-image"===e.layer?.type)}function j(e){return"map-image"===e?.type}function A(e){return!!j(e)&&!!e.capabilities?.exportMap?.supportsArcadeExpressionForLabeling}function C(e){return E(e)||A(e?.layer)}let I=class extends t{static{L=u}static{P=this}static evaluateWhere(e,r){const t=(e,r,t)=>{switch(r){case"=":return e==t;case"<>":return e!=t;case">":return e>t;case">=":return e>=t;case"<":return e<t;case"<=":return e<=t}return!1};try{if(null==e)return!0;const o=e.split(" ");if(3===o.length)return t(r[o[0]],o[1],o[2]);if(7===o.length){const e=t(r[o[0]],o[1],o[2]),i=o[3],l=t(r[o[4]],o[5],o[6]);switch(i){case"AND":return e&&l;case"OR":return e||l}}return!1}catch(o){}}constructor(e){super(e),this[L]=!0,this.type="label",this.name=null,this.allowOverrun=!1,this.deconflictionStrategy="static",this.labelExpression=null,this.labelExpressionInfo=null,this.labelPlacement=null,this.labelPosition="curved",this.maxScale=0,this.minScale=0,this.repeatLabel=!0,this.symbol=f,this.useCodedValues=void 0,this.where=null}readLabelExpression(e,r){const t=r.labelExpressionInfo;if(!t||!t.value&&!t.expression)return e}writeLabelExpression(e,r,t){if(this.labelExpressionInfo)if(null!=this.labelExpressionInfo.value)e=a(this.labelExpressionInfo.value);else if(null!=this.labelExpressionInfo.expression){const r=p(this.labelExpressionInfo.expression);r&&(e="["+r+"]")}null!=e&&(r[t]=e)}writeLabelExpressionInfo(e,r,t,o){if(null==e&&null!=this.labelExpression&&E(o))e=new s({expression:this.getLabelExpressionArcade()});else if(!e)return;const i=e.toJSON(o);i.expression&&(r[t]=i)}writeMaxScale(e,r){(e||this.minScale)&&(r.maxScale=e)}writeMinScale(e,r){(e||this.maxScale)&&(r.minScale=e)}get repeatLabelDistance(){return this._get("repeatLabelDistance")}set repeatLabelDistance(e){this._set("repeatLabelDistance",e)}getLabelExpression(){return c(this)}getLabelExpressionArcade(){return b(this)}getLabelExpressionSingleField(){return m(this)}hash(){return JSON.stringify(this)}clone(){return new P({allowOverrun:this.allowOverrun,deconflictionStrategy:this.deconflictionStrategy,labelExpression:this.labelExpression,labelExpressionInfo:o(this.labelExpressionInfo),labelPosition:this.labelPosition,labelPlacement:this.labelPlacement,maxScale:this.maxScale,minScale:this.minScale,name:this.name,repeatLabel:this.repeatLabel,repeatLabelDistance:this.repeatLabelDistance,symbol:o(this.symbol),where:this.where,useCodedValues:this.useCodedValues})}};e([l({type:String,json:{write:!0}})],I.prototype,"name",void 0),e([l({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1},"portal-item":{default:!1,write:{overridePolicy:g}}}}})],I.prototype,"allowOverrun",void 0),e([l({type:String,json:{write:!0,default:"static",origins:{"web-scene":{write:!1},"portal-item":{default:"static",write:{overridePolicy:g}}}}})],I.prototype,"deconflictionStrategy",void 0),e([l({type:String,json:{write:{overridePolicy(e,r,t){return this.labelExpressionInfo&&"service"===t?.origin&&A(t.layer)?{enabled:!1}:{allowNull:!0}}}}})],I.prototype,"labelExpression",void 0),e([d("labelExpression")],I.prototype,"readLabelExpression",null),e([S("labelExpression")],I.prototype,"writeLabelExpression",null),e([l({type:s,json:{write:{overridePolicy:(e,r,t)=>C(t)?{allowNull:!0}:{enabled:!1}}}})],I.prototype,"labelExpressionInfo",void 0),e([S("labelExpressionInfo")],I.prototype,"writeLabelExpressionInfo",null),e([l({type:x.apiValues,json:{type:x.jsonValues,read:x.read,write:x.write}})],I.prototype,"labelPlacement",void 0),e([l({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],I.prototype,"labelPosition",void 0),e([l({type:Number})],I.prototype,"maxScale",void 0),e([S("maxScale")],I.prototype,"writeMaxScale",null),e([l({type:Number})],I.prototype,"minScale",void 0),e([S("minScale")],I.prototype,"writeMinScale",null),e([l({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:g}}}}})],I.prototype,"repeatLabel",void 0),e([l({type:Number,cast:i,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:g}}}}})],I.prototype,"repeatLabelDistance",null),e([l({types:h,json:{origins:{"web-scene":{types:y,write:v,default:null}},write:v,default:null}})],I.prototype,"symbol",void 0),e([l({type:Boolean,json:{write:!0}})],I.prototype,"useCodedValues",void 0),e([l({type:String,json:{write:!0}})],I.prototype,"where",void 0),I=P=e([n("esri.layers.support.LabelClass")],I);export{I as default};
@@ -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{resultOrAbort as t}from"../../core/asyncUtils.js";import r from"../../core/Error.js";import{JSONMap as n}from"../../core/jsonMap.js";import o from"../../core/Logger.js";import{parseWhereClause as i}from"../../core/sql.js";import{normalizeGlobalID as s}from"../../core/uuid.js";import{createTypeReader as a}from"../../core/accessorSupport/extensions/serializableProperty/reader.js";import{isHostedAgolService as u}from"./arcgisLayerUrl.js";import c from"./CodedValue.js";import l from"./CodedValueDomain.js";import{queryAllJSON as p}from"./featureQueryAll.js";import{isStringField as d,isIntegerField as f}from"./fieldUtils.js";import{isLayerWithFeatureCapabilities as y,getOwningPortalUrl as m}from"./layerUtils.js";import h from"../../renderers/SimpleRenderer.js";import w from"../../renderers/UniqueValueRenderer.js";import b from"../../rest/support/AttachmentQuery.js";import{normalizationTypeJsonMap as g}from"../../rest/support/NormalizationBinParametersMixin.js";import I from"../../rest/support/Query.js";import j from"../../rest/support/RelationshipQuery.js";import{symbolTypesRenderer as F}from"../../symbols/support/typeUtils.js";const x=()=>o.getLogger("esri.layers.support.featureLayerUtils"),P=new n({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function S(e,t,n,o){const i=await W(e);if(await q(e,t,o),!i.addAttachment)throw new r(o,"Layer source does not support addAttachment capability");return i.addAttachment(t,n)}function q(e,t,n){const{attributes:o}=t,{objectIdField:i}=e;return e.capabilities?.data?.supportsAttachment?t?o?i&&o[i]?Promise.resolve():Promise.reject(new r(n,`feature is missing the identifying attribute ${i}`)):Promise.reject(new r(n,"'attributes' are required on a feature to query attachments")):Promise.reject(new r(n,"A feature is required to add/delete/update attachments")):Promise.reject(new r(n,"this layer doesn't support attachments"))}async function v(e,t,n,o,i){const s=await W(e);if(await q(e,t,i),!s.updateAttachment)throw new r(i,"Layer source does not support updateAttachment capability");return s.updateAttachment(t,n,o)}async function L(e,t,r){const{applyEdits:n}=await import("../graphics/editingSupport.js"),o=await e.load();let i=r;const{url:s,type:a,globalIdField:c}=o;return"feature"===a&&u(s)&&o.infoFor3D&&null!=t.deleteFeatures&&null!=c&&(i={...i,globalIdToObjectId:await ae(o,t.deleteFeatures,c)}),n(o,o.source,t,i)}async function O(e,t,r){const{uploadAssets:n}=await import("../graphics/editingSupport.js"),o=await e.load();return n(o,o.source,t,r)}async function A(e,t,n,o){const i=await W(e);if(await q(e,t,o),!i.deleteAttachments)throw new r(o,"Layer source does not support deleteAttachments capability");return i.deleteAttachments(t,n)}async function E(e,t,n){const o=(await e.load({signal:t?.signal})).source;if(!o.fetchRecomputedExtents)throw new r(n,"Layer source does not support fetchUpdates capability");return o.fetchRecomputedExtents(t)}async function D(e,t,n,o){let i=b.from(t);await e.load();const s=e.source,a=e.capabilities;if(!a?.data?.supportsAttachment)throw new r(o,"this layer doesn't support attachments");const{attachmentTypes:u,objectIds:c,globalIds:l,num:p,size:d,start:f,where:y}=i;if(!a?.operations?.supportsQueryAttachments){if(u?.length>0||l?.length>0||d?.length>0||p||f||y)throw new r(o,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",i)}if(!(c?.length||l?.length||y))throw new r(o,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",i);if(!s.queryAttachments)throw new r(o,"Layer source does not support queryAttachments capability",i);return!a?.attachment?.supportsOrderByFields&&i.orderByFields?.length&&(i=i.clone(),i.orderByFields=null),s.queryAttachments(i)}async function T(e,t,n,o){const i=await W(e);if(!i.queryObjectIds)throw new r(o,"Layer source does not support queryObjectIds capability");return i.queryObjectIds(I.from(t)??e.createQuery(),n)}async function C(e,t,n,o){const i=await W(e);if(!i.queryFeatureCount)throw new r(o,"Layer source does not support queryFeatureCount capability");return i.queryFeatureCount(I.from(t)??e.createQuery(),n)}async function B(e,t,n,o){const i=await W(e);if(!i.queryExtent)throw new r(o,"Layer source does not support queryExtent capability");return i.queryExtent(I.from(t)??e.createQuery(),n)}async function R(e,t,n,o){const i=await W(e);if(!i.queryRelatedFeatures)throw new r(o,"Layer source does not support queryRelatedFeatures capability");return i.queryRelatedFeatures(j.from(t),n)}async function M(e,t,n,o){const i=await W(e);if(!i.queryRelatedFeaturesCount)throw new r(o,"Layer source does not support queryRelatedFeaturesCount capability");return i.queryRelatedFeaturesCount(j.from(t),n)}async function k(e){const t=e.source;if(t?.refresh)try{const{dataChanged:r,updates:n}=await t.refresh();if(null!=n&&(e.sourceJSON={...e.sourceJSON,...n},e.read(n,{origin:"service",url:e.parsedUrl})),r)return!0}catch{}if(e.definitionExpression)try{return(await i(e.definitionExpression,e.fieldsIndex)).hasDateFunctions}catch{}return!1}function z(e){const t=new I;t.historicMoment=e.historicMoment,t.gdbVersion=e.gdbVersion,t.returnGeometry=!0,t.outFields=["*"],t.multipatchOption="multipatch"===e.geometryType?"xyFootprint":null;const r=e.capabilities?.query;r&&(t.compactGeometryEnabled=r.supportsCompactGeometry,t.defaultSpatialReferenceEnabled=r.supportsDefaultSpatialReference);const n=e.capabilities?.data;n?.supportsZ&&null!=e.returnZ&&(t.returnZ=e.returnZ),n?.supportsM&&null!=e.returnM&&(t.returnM=e.returnM);const{timeOffset:o,timeExtent:i}=e;return t.timeExtent=null!=o&&null!=i?i.offset(-o.value,o.unit):i||null,t}function U(e){const{globalIdField:t,fields:r}=e;if(t)return t;if(r)for(const n of r)if("esriFieldTypeGlobalID"===n.type)return n.name}function N(e){const{objectIdField:t,fields:r}=e;if(t)return t;if(r)for(const n of r)if("esriFieldTypeOID"===n.type)return n.name}function Q(e){return e.currentVersion?e.currentVersion:e.hasOwnProperty("capabilities")||e.hasOwnProperty("drawingInfo")||e.hasOwnProperty("hasAttachments")||e.hasOwnProperty("htmlPopupType")||e.hasOwnProperty("relationships")||e.hasOwnProperty("timeInfo")||e.hasOwnProperty("typeIdField")||e.hasOwnProperty("types")?10:9.3}function V(e,t,r,n){const o=r?.feature,i=!!e.subtypes?.length;if(i&&!r?.excludeImpliedDomains){const r=$(e,t);if(r)return r}const s=i&&G(e,o);if(s){const e=s?.domains?.[t];return"inherited"===e?.type?n:e}const a=ue(e.types,e.typeIdField,o);if(a){const e=a.domains&&a.domains[t];if(e&&"inherited"!==e?.type)return e}if(n)return n;if(!r?.excludeImpliedDomains){const r=J(e,t);if(r)return r}return null}function G(e,t){const{subtypes:r,subtypeField:n}=e;if(!t?.attributes||!r?.length||!n)return null;const o=t.attributes[n];return null==o?null:r.find(e=>e.code===o)}function $(e,t){const{fieldsIndex:r,subtypeField:n}=e,{name:o,type:i}=r.get(t)??{};if(!o)return null;if((n&&r.get(n)?.name)===o&&e.subtypes?.length){const t=e.subtypes.map(e=>new c({code:H(e.code,i),name:e.name}));if(t?.length)return new l({codedValues:t})}return null}function J(e,t){const{fieldsIndex:r}=e,{name:n,type:o}=r.get(t)??{};if(!n)return null;if(("typeIdField"in e?r.get(e.typeIdField)?.name:null)===n&&"types"in e&&e.types?.length&&Z(e.types)){const t=e.types?.map(e=>new c({code:H(e.id,o),name:e.name}));return new l({codedValues:t})}return null}function Z(e){const t=new Set,r=new Set;for(const n of e){if(t.has(n.id)||r.has(n.name))return!1;t.add(n.id),r.add(n.name)}return!0}function H(e,t){return t?d({type:t})&&"number"==typeof e?`${e}`:f({type:t})&&"string"==typeof e?Number.parseInt(e,10):e:e}async function W(e){return(await e.load()).source}async function _(t,r){if(!e)return;const n=e.findCredential(t);if(n)return n.userId;let o;try{const n=await m(t,r);n&&(o=await e.checkSignInStatus(`${n}/sharing`))}catch(i){}return o?o.userId:null}async function K(t,r){if(!e)return;if(e.findCredential(t))return;let n;try{const o=await m(t,r);o&&(n=await e.checkSignInStatus(`${o}/sharing`))}catch(o){}if(n)try{const n=null!=r?r.signal:null;await e.getCredential(t,{signal:n})}catch(o){}}async function X(e,t,r){const n=e.parsedUrl?.path;n&&e.authenticationTriggerEvent===t&&await K(n,r)}async function Y(e){const t=e.parsedUrl?.path;t&&ee(e)&&await K(t)}function ee(e){return te(e)&&("serviceDefinitionExpression"in e&&re(e.serviceDefinitionExpression)||"definitionExpression"in e&&re(e.definitionExpression))}function te(e){return!(!y(e)||!e.capabilities?.query.supportsCurrentUser)}function re(e){return!!e?.toLowerCase().includes("current_user")}function ne(e){return!ce(e)&&(e.userHasUpdateItemPrivileges||e.editingEnabled)}const oe=a({types:F});function ie(e,t){if(e.defaultSymbol)return e.types?.length?new w({defaultSymbol:oe(e.defaultSymbol,e,t),field:e.typeIdField,uniqueValueInfos:e.types.map(e=>({id:e.id,symbol:oe(e.symbol,e,t)}))}):new h({symbol:oe(e.defaultSymbol,e,t)})}function se(e){let t=e.sourceJSON?.cacheMaxAge;if(!t)return!1;const r=e.editingInfo?.lastEditDate?.getTime();return null==r||(t*=1e3,Date.now()-r<t)}async function ae(e,r,n){if(null==r)return null;const o=[],{objectIdField:i}=e;if(r.forEach(e=>{let t=null;if("attributes"in e){const{attributes:r}=e;t={globalId:r[n],objectId:null!=r[i]&&-1!==r[i]?r[i]:null}}else t={globalId:e.globalId,objectId:null!=e.objectId&&-1!==e.objectId?e.objectId:null};null!=t.globalId&&(null!=t.objectId&&-1!==t.objectId||o.push(t.globalId))}),0===o.length)return null;const a=e.createQuery();a.where=o.map(e=>`${n}='${e}'`).join(" OR "),a.returnGeometry=!1,a.outFields=[i,n],a.cacheHint=!1;const u=await t(p(e,a));if(!u.ok)return null;const c=new Map,l=u.value.features;for(const t of l){const e=t.attributes[n],r=t.attributes[i];null!=e&&null!=r&&-1!==r&&c.set(s(e),r)}return c}function ue(e,t,r){if(!t||!r||!e)return null;const n=r.getAttribute(t);if(null==n)return null;const o=e.filter(e=>{const{id:t}=e;return null!=t&&t.toString()===n.toString()});return o.length>1&&x().warn("getFeatureType",`Cannot unambiguously determine feature type because multiple types have the id ${n}.`),o[0]??null}function ce(e){return e.sourceJSON?.isMultiServicesView||le(e)}function le(e){return!!e.sourceJSON?.capabilities?.toLowerCase().split(",").map(e=>e.trim()).includes("map")}function pe(e,t,n){const o=t?.queryAttributeBins;if(!t?.operations?.supportsQueryBins||!o)throw new r(n,"Layer source does not support binning");switch(e.binParameters?.type){case"auto-interval":if(!o.supportsAutoInterval)throw new r(n,"Layer source does not support auto-interval binning");if(e.binParameters.normalizationType&&(!o.supportsNormalization||!de(e.binParameters.normalizationType,o.supportedNormalizationTypes)))throw new r(n,"Layer source does not support normalization binning");break;case"date":if(!o.supportsDate)throw new r(n,"Layer source does not support date binning");if(e.binParameters.snapToData&&!o.supportsSnapToData)throw new r(n,"Layer source does not support snapToData binning");if(e.binParameters.returnFullIntervalBin&&!o.supportsReturnFullIntervalBin)throw new r(n,"Layer source does not support returnFullIntervalBin binning");break;case"fixed-boundaries":if(!o.supportsFixedBoundaries)throw new r(n,"Layer source does not support fixed-boundaries binning");break;case"fixed-interval":if(!o.supportsFixedInterval)throw new r(n,"Layer source does not support fixed-interval binning");if(e.binParameters.normalizationType&&(!o.supportsNormalization||!de(e.binParameters.normalizationType,o.supportedNormalizationTypes)))throw new r(n,"Layer source does not support normalization binning")}if(e.binParameters?.stackBy&&!o.supportsStackBy)throw new r(n,"Layer source does not support stackBy binning");if(e.binParameters?.splitBy&&!o.supportsSplitBy)throw new r(n,"Layer source does not support splitBy binning");if(e.binParameters?.firstDayOfWeek&&!o.supportsFirstDayOfWeek)throw new r(n,"Layer source does not support firstDayOfWeek binning");const i=o?.supportedStatistics;if(e.outStatistics&&i){const t=new Map([["count","count"],["sum","sum"],["min","min"],["max","max"],["avg","avg"],["stddev","stddev"],["var","var"],["percentile-continuous","percentileContinuous"],["percentile-discrete","percentileDiscrete"],["centroid-aggregate","centroid"],["convex-hull-aggregate","convexHull"],["envelope-aggregate","envelope"]]);for(const{statisticType:o}of e.outStatistics){const e=t.get(o);if(e&&!i[e])throw new r(n,`Layer source does not support ${o} statistic type`)}}}function de(e,t){return null!=e&&!!t?.[g.toJSON(e)]}export{S as addAttachment,L as applyEdits,Y as checkServiceCurrentUserSupport,$ as computeDomainFromSubtypes,J as computeDomainFromTypes,ne as computeEffectiveEditingEnabled,ie as createDefaultRenderer,z as createQuery,A as deleteAttachments,K as ensureCredentialIfSignedIn,X as ensureLayerCredential,E as fetchRecomputedExtents,P as geometryTypeKebabDict,G as getFeatureSubtype,ue as getFeatureType,V as getFieldDomain,ae as getGlobalIdToObjectIdMap,_ as getSignedInUser,re as hasCurrentUser,k as hasDataChanged,se as isLayerCacheStale,D as queryAttachments,B as queryExtent,C as queryFeatureCount,T as queryObjectIds,R as queryRelatedFeatures,M as queryRelatedFeaturesCount,U as readGlobalIdField,N as readObjectIdField,Q as readVersion,ce as supportsQueryOnly,Z as typesHaveUniqueIdsAndNames,v as updateAttachment,O as uploadAssets,pe as validateBinsQuery};
2
+ import{id as e}from"../../kernel.js";import{isPopupTemplate as t}from"../../popupTemplateUtils.js";import{resultOrAbort as r}from"../../core/asyncUtils.js";import n from"../../core/Error.js";import{JSONMap as o}from"../../core/jsonMap.js";import i from"../../core/Logger.js";import{parseWhereClause as s}from"../../core/sql.js";import{normalizeGlobalID as a}from"../../core/uuid.js";import{createTypeReader as u}from"../../core/accessorSupport/extensions/serializableProperty/reader.js";import{isHostedAgolService as l}from"./arcgisLayerUrl.js";import c from"./CodedValue.js";import p from"./CodedValueDomain.js";import{queryAllJSON as d}from"./featureQueryAll.js";import{isStringField as f,isIntegerField as y}from"./fieldUtils.js";import{isLabelClass as m}from"./labelUtils.js";import{isLayerWithFeatureCapabilities as b,getOwningPortalUrl as h}from"./layerUtils.js";import w from"../../renderers/SimpleRenderer.js";import g from"../../renderers/UniqueValueRenderer.js";import{isSizeVariable as I}from"../../renderers/visualVariables/support/sizeVariableUtils.js";import j from"../../rest/support/AttachmentQuery.js";import{normalizationTypeJsonMap as x}from"../../rest/support/NormalizationBinParametersMixin.js";import F from"../../rest/support/Query.js";import v from"../../rest/support/RelationshipQuery.js";import{loadArcade as S}from"../../support/loadArcade.js";import{symbolTypesRenderer as P}from"../../symbols/support/typeUtils.js";const L=()=>i.getLogger("esri.layers.support.featureLayerUtils"),q=new o({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function A(e,t,r,o){const i=await Y(e);if(await E(e,t,o),!i.addAttachment)throw new n(o,"Layer source does not support addAttachment capability");return i.addAttachment(t,r)}function E(e,t,r){const{attributes:o}=t,{objectIdField:i}=e;return e.capabilities?.data?.supportsAttachment?t?o?i&&o[i]?Promise.resolve():Promise.reject(new n(r,`feature is missing the identifying attribute ${i}`)):Promise.reject(new n(r,"'attributes' are required on a feature to query attachments")):Promise.reject(new n(r,"A feature is required to add/delete/update attachments")):Promise.reject(new n(r,"this layer doesn't support attachments"))}async function M(e,t,r,o,i){const s=await Y(e);if(await E(e,t,i),!s.updateAttachment)throw new n(i,"Layer source does not support updateAttachment capability");return s.updateAttachment(t,r,o)}async function O(e,t,r){const{applyEdits:n}=await import("../graphics/editingSupport.js"),o=await e.load();let i=r;const{url:s,type:a,globalIdField:u}=o;return"feature"===a&&l(s)&&o.infoFor3D&&null!=t.deleteFeatures&&null!=u&&(i={...i,globalIdToObjectId:await pe(o,t.deleteFeatures,u)}),n(o,o.source,t,i)}async function C(e,t,r){const{uploadAssets:n}=await import("../graphics/editingSupport.js"),o=await e.load();return n(o,o.source,t,r)}async function D(e,t,r,o){const i=await Y(e);if(await E(e,t,o),!i.deleteAttachments)throw new n(o,"Layer source does not support deleteAttachments capability");return i.deleteAttachments(t,r)}async function T(e,t,r){const o=(await e.load({signal:t?.signal})).source;if(!o.fetchRecomputedExtents)throw new n(r,"Layer source does not support fetchUpdates capability");return o.fetchRecomputedExtents(t)}async function z(e,t,r,o){let i=j.from(t);await e.load();const s=e.source,a=e.capabilities;if(!a?.data?.supportsAttachment)throw new n(o,"this layer doesn't support attachments");const{attachmentTypes:u,objectIds:l,globalIds:c,num:p,size:d,start:f,where:y}=i;if(!a?.operations?.supportsQueryAttachments){if(u?.length>0||c?.length>0||d?.length>0||p||f||y)throw new n(o,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",i)}if(!(l?.length||c?.length||y))throw new n(o,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",i);if(!s.queryAttachments)throw new n(o,"Layer source does not support queryAttachments capability",i);return!a?.attachment?.supportsOrderByFields&&i.orderByFields?.length&&(i=i.clone(),i.orderByFields=null),s.queryAttachments(i)}async function U(e,t,r,o){const i=await Y(e);if(!i.queryObjectIds)throw new n(o,"Layer source does not support queryObjectIds capability");return i.queryObjectIds(F.from(t)??e.createQuery(),r)}async function k(e,t,r,o){const i=await Y(e);if(!i.queryFeatureCount)throw new n(o,"Layer source does not support queryFeatureCount capability");return i.queryFeatureCount(F.from(t)??e.createQuery(),r)}async function B(e,t,r,o){const i=await Y(e);if(!i.queryExtent)throw new n(o,"Layer source does not support queryExtent capability");return i.queryExtent(F.from(t)??e.createQuery(),r)}async function V(e,t,r,o){const i=await Y(e);if(!i.queryRelatedFeatures)throw new n(o,"Layer source does not support queryRelatedFeatures capability");return i.queryRelatedFeatures(v.from(t),r)}async function R(e,t,r,o){const i=await Y(e);if(!i.queryRelatedFeaturesCount)throw new n(o,"Layer source does not support queryRelatedFeaturesCount capability");return i.queryRelatedFeaturesCount(v.from(t),r)}async function N(e){const t=e.source;if(t?.refresh)try{const{dataChanged:r,updates:n}=await t.refresh();if(null!=n&&(e.sourceJSON={...e.sourceJSON,...n},e.read(n,{origin:"service",url:e.parsedUrl})),r)return!0}catch{}if(e.definitionExpression)try{return(await s(e.definitionExpression,e.fieldsIndex)).hasDateFunctions}catch{}return!1}function G(e){const t=new F;t.historicMoment=e.historicMoment,t.gdbVersion=e.gdbVersion,t.returnGeometry=!0,t.outFields=["*"],t.multipatchOption="multipatch"===e.geometryType?"xyFootprint":null;const r=e.capabilities?.query;r&&(t.compactGeometryEnabled=r.supportsCompactGeometry,t.defaultSpatialReferenceEnabled=r.supportsDefaultSpatialReference);const n=e.capabilities?.data;n?.supportsZ&&null!=e.returnZ&&(t.returnZ=e.returnZ),n?.supportsM&&null!=e.returnM&&(t.returnM=e.returnM);const{timeOffset:o,timeExtent:i}=e;return t.timeExtent=null!=o&&null!=i?i.offset(-o.value,o.unit):i||null,t}function Q(e){const{globalIdField:t,fields:r}=e;if(t)return t;if(r)for(const n of r)if("esriFieldTypeGlobalID"===n.type)return n.name}function Z(e){const{objectIdField:t,fields:r}=e;if(t)return t;if(r)for(const n of r)if("esriFieldTypeOID"===n.type)return n.name}function $(e){return e.currentVersion?e.currentVersion:e.hasOwnProperty("capabilities")||e.hasOwnProperty("drawingInfo")||e.hasOwnProperty("hasAttachments")||e.hasOwnProperty("htmlPopupType")||e.hasOwnProperty("relationships")||e.hasOwnProperty("timeInfo")||e.hasOwnProperty("typeIdField")||e.hasOwnProperty("types")?10:9.3}function J(e,t,r,n){const o=r?.feature,i=!!e.subtypes?.length;if(i&&!r?.excludeImpliedDomains){const r=W(e,t);if(r)return r}const s=i&&H(e,o);if(s){const e=s?.domains?.[t];return"inherited"===e?.type?n:e}const a=de(e.types,e.typeIdField,o);if(a){const e=a.domains&&a.domains[t];if(e&&"inherited"!==e?.type)return e}if(n)return n;if(!r?.excludeImpliedDomains){const r=_(e,t);if(r)return r}return null}function H(e,t){const{subtypes:r,subtypeField:n}=e;if(!t?.attributes||!r?.length||!n)return null;const o=t.attributes[n];return null==o?null:r.find(e=>e.code===o)}function W(e,t){const{fieldsIndex:r,subtypeField:n}=e,{name:o,type:i}=r.get(t)??{};if(!o)return null;if((n&&r.get(n)?.name)===o&&e.subtypes?.length){const t=e.subtypes.map(e=>new c({code:X(e.code,i),name:e.name}));if(t?.length)return new p({codedValues:t})}return null}function _(e,t){const{fieldsIndex:r}=e,{name:n,type:o}=r.get(t)??{};if(!n)return null;if(("typeIdField"in e?r.get(e.typeIdField)?.name:null)===n&&"types"in e&&e.types?.length&&K(e.types)){const t=e.types?.map(e=>new c({code:X(e.id,o),name:e.name}));return new p({codedValues:t})}return null}function K(e){const t=new Set,r=new Set;for(const n of e){if(t.has(n.id)||r.has(n.name))return!1;t.add(n.id),r.add(n.name)}return!0}function X(e,t){return t?f({type:t})&&"number"==typeof e?`${e}`:y({type:t})&&"string"==typeof e?Number.parseInt(e,10):e:e}async function Y(e){return(await e.load()).source}async function ee(t,r){if(!e)return;const n=e.findCredential(t);if(n)return n.userId;let o;try{const n=await h(t,r);n&&(o=await e.checkSignInStatus(`${n}/sharing`))}catch(i){}return o?o.userId:null}async function te(t,r){if(!e)return;if(e.findCredential(t))return;let n;try{const o=await h(t,r);o&&(n=await e.checkSignInStatus(`${o}/sharing`))}catch(o){}if(n)try{const n=null!=r?r.signal:null;await e.getCredential(t,{signal:n})}catch(o){}}async function re(e,t,r){const n=e.parsedUrl?.path;n&&e.authenticationTriggerEvent===t&&await te(n,r)}async function ne(e){const t=e.parsedUrl?.path;t&&oe(e)&&await te(t)}function oe(e){return ie(e)&&("serviceDefinitionExpression"in e&&se(e.serviceDefinitionExpression)||"definitionExpression"in e&&se(e.definitionExpression))}function ie(e){return!(!b(e)||!e.capabilities?.query.supportsCurrentUser)}function se(e){return!!e?.toLowerCase().includes("current_user")}function ae(e){return!fe(e)&&(e.userHasUpdateItemPrivileges||e.editingEnabled)}const ue=u({types:P});function le(e,t){if(e.defaultSymbol)return e.types?.length?new g({defaultSymbol:ue(e.defaultSymbol,e,t),field:e.typeIdField,uniqueValueInfos:e.types.map(e=>({id:e.id,symbol:ue(e.symbol,e,t)}))}):new w({symbol:ue(e.defaultSymbol,e,t)})}function ce(e){let t=e.sourceJSON?.cacheMaxAge;if(!t)return!1;const r=e.editingInfo?.lastEditDate?.getTime();return null==r||(t*=1e3,Date.now()-r<t)}async function pe(e,t,n){if(null==t)return null;const o=[],{objectIdField:i}=e;if(t.forEach(e=>{let t=null;if("attributes"in e){const{attributes:r}=e;t={globalId:r[n],objectId:null!=r[i]&&-1!==r[i]?r[i]:null}}else t={globalId:e.globalId,objectId:null!=e.objectId&&-1!==e.objectId?e.objectId:null};null!=t.globalId&&(null!=t.objectId&&-1!==t.objectId||o.push(t.globalId))}),0===o.length)return null;const s=e.createQuery();s.where=o.map(e=>`${n}='${e}'`).join(" OR "),s.returnGeometry=!1,s.outFields=[i,n],s.cacheHint=!1;const u=await r(d(e,s));if(!u.ok)return null;const l=new Map,c=u.value.features;for(const r of c){const e=r.attributes[n],t=r.attributes[i];null!=e&&null!=t&&-1!==t&&l.set(a(e),t)}return l}function de(e,t,r){if(!t||!r||!e)return null;const n=r.getAttribute(t);if(null==n)return null;const o=e.filter(e=>{const{id:t}=e;return null!=t&&t.toString()===n.toString()});return o.length>1&&L().warn("getFeatureType",`Cannot unambiguously determine feature type because multiple types have the id ${n}.`),o[0]??null}function fe(e){return e.sourceJSON?.isMultiServicesView||ye(e)}function ye(e){return!!e.sourceJSON?.capabilities?.toLowerCase().split(",").map(e=>e.trim()).includes("map")}function me(e,t,r){const o=t?.queryAttributeBins;if(!t?.operations?.supportsQueryBins||!o)throw new n(r,"Layer source does not support binning");switch(e.binParameters?.type){case"auto-interval":if(!o.supportsAutoInterval)throw new n(r,"Layer source does not support auto-interval binning");if(e.binParameters.normalizationType&&(!o.supportsNormalization||!be(e.binParameters.normalizationType,o.supportedNormalizationTypes)))throw new n(r,"Layer source does not support normalization binning");break;case"date":if(!o.supportsDate)throw new n(r,"Layer source does not support date binning");if(e.binParameters.snapToData&&!o.supportsSnapToData)throw new n(r,"Layer source does not support snapToData binning");if(e.binParameters.returnFullIntervalBin&&!o.supportsReturnFullIntervalBin)throw new n(r,"Layer source does not support returnFullIntervalBin binning");break;case"fixed-boundaries":if(!o.supportsFixedBoundaries)throw new n(r,"Layer source does not support fixed-boundaries binning");break;case"fixed-interval":if(!o.supportsFixedInterval)throw new n(r,"Layer source does not support fixed-interval binning");if(e.binParameters.normalizationType&&(!o.supportsNormalization||!be(e.binParameters.normalizationType,o.supportedNormalizationTypes)))throw new n(r,"Layer source does not support normalization binning")}if(e.binParameters?.stackBy&&!o.supportsStackBy)throw new n(r,"Layer source does not support stackBy binning");if(e.binParameters?.splitBy&&!o.supportsSplitBy)throw new n(r,"Layer source does not support splitBy binning");if(e.binParameters?.firstDayOfWeek&&!o.supportsFirstDayOfWeek)throw new n(r,"Layer source does not support firstDayOfWeek binning");const i=o?.supportedStatistics;if(e.outStatistics&&i){const t=new Map([["count","count"],["sum","sum"],["min","min"],["max","max"],["avg","avg"],["stddev","stddev"],["var","var"],["percentile-continuous","percentileContinuous"],["percentile-discrete","percentileDiscrete"],["centroid-aggregate","centroid"],["convex-hull-aggregate","convexHull"],["envelope-aggregate","envelope"]]);for(const{statisticType:o}of e.outStatistics){const e=t.get(o);if(e&&!i[e])throw new n(r,`Layer source does not support ${o} statistic type`)}}}function be(e,t){return null!=e&&!!t?.[x.toJSON(e)]}function he(e){return m(e)?Boolean(e.labelExpressionInfo?.expression):t(e)?!!e.expressionInfos?.some(e=>e.expression)||!!Array.isArray(e.content)&&e.content.some(e=>"expression"===e.type&&e.expressionInfo?.expression):!("dot-density"!==e.type||!e.attributes?.some(e=>e.valueExpression))||(!(!("valueExpression"in e)||!e.valueExpression)||"visualVariables"in e&&null!=e.visualVariables&&e.visualVariables.some(e=>!!e.valueExpression||"size"===e.type&&(I(e.minSize)&&e.minSize.valueExpression||I(e.maxSize)&&e.maxSize.valueExpression)))}function we(e){if("renderer"in e&&e.renderer&&he(e.renderer))return!0;if("labelingInfo"in e&&e.labelingInfo)for(const t of e.labelingInfo)if(m(t)&&he(t))return!0;return!1}async function ge(e){let t="returnZ"in e&&e.returnZ,r="returnM"in e&&e.returnM;if(null!=t&&null!=r)return{returnZ:t,returnM:r};if(we(e)){const{arcadeUtils:n}=await S();n.layerHasGeometryFunctions(e)&&(t??=!0,r??=!0)}if("renderer"in e&&e.renderer?.symbols)for(const n of e.renderer.symbols)"cim"===n.type&&(Ie??=(await import("../../symbols/cim/CIMSymbolHelper.js")).forEachSymbolLayer,Ie(n.data.symbol,e=>{switch(e.type){case"CIMPictureMarker":case"CIMVectorMarker":if("CIMMarkerPlacementAtMeasuredUnits"===e.markerPlacement?.type)r??=!0}}));return{returnZ:t,returnM:r}}let Ie;export{A as addAttachment,O as applyEdits,ne as checkServiceCurrentUserSupport,W as computeDomainFromSubtypes,_ as computeDomainFromTypes,ae as computeEffectiveEditingEnabled,le as createDefaultRenderer,G as createQuery,D as deleteAttachments,te as ensureCredentialIfSignedIn,re as ensureLayerCredential,T as fetchRecomputedExtents,q as geometryTypeKebabDict,H as getFeatureSubtype,de as getFeatureType,J as getFieldDomain,pe as getGlobalIdToObjectIdMap,ee as getSignedInUser,se as hasCurrentUser,N as hasDataChanged,ce as isLayerCacheStale,ge as layerRequiresGeometryZM,z as queryAttachments,B as queryExtent,k as queryFeatureCount,U as queryObjectIds,V as queryRelatedFeatures,R as queryRelatedFeaturesCount,Q as readGlobalIdField,Z as readObjectIdField,$ as readVersion,fe as supportsQueryOnly,K as typesHaveUniqueIdsAndNames,M as updateAttachment,C as uploadAssets,me as validateBinsQuery};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{replace as e}from"../../core/string.js";const n="__begin__",r="__end__",s=new RegExp(n,"ig"),t=new RegExp(r,"ig"),l=new RegExp("^"+n,"i"),o=new RegExp(r+"$","i"),i='"',a=i+" + ",c=" + "+i;function p(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function u(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function x(e){const n={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(n.expression=e.labelExpressionInfo.value,n.type="conventional"):e.labelExpressionInfo.expression&&(n.expression=e.labelExpressionInfo.expression,n.type="arcade"):null!=e.labelExpression&&(n.expression=p(e.labelExpression),n.type="conventional"),n}function f(e){const n=x(e);if(!n)return null;switch(n.type){case"conventional":return E(n.expression);case"arcade":return n.expression}return null}function g(e){const n=x(e);if(!n)return null;switch(n.type){case"conventional":return $(n.expression);case"arcade":return _(n.expression)}return null}function E(p){let u;return p?(u=e(p,e=>n+'$feature["'+e+'"]'+r),u=l.test(u)?u.replace(l,""):i+u,u=o.test(u)?u.replace(o,""):u+i,u=u.replaceAll(s,a).replaceAll(t,c)):u='""',u}const w=/^\s*\{([^}]+)\}\s*$/i;function $(e){const n=e?.match(w);return n?.[1].trim()||null}const b=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,m=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,R=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function _(e){if(!e)return null;let n=b.exec(e)||m.exec(e);return n?n[1]||n[3]:(n=R.exec(e),n?n[2]:null)}export{E as convertTemplatedStringToArcade,x as getLabelExpression,f as getLabelExpressionArcade,g as getLabelExpressionSingleField,_ as getSingleFieldArcadeExpression,$ as getSingleFieldTemplatedString,p as sqlToTemplateString,u as templateStringToSql};
2
+ import{replace as e}from"../../core/string.js";const n="__begin__",r="__end__",s=new RegExp(n,"ig"),t=new RegExp(r,"ig"),l=new RegExp("^"+n,"i"),o=new RegExp(r+"$","i"),i='"',a=i+" + ",c=" + "+i;function u(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function p(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function x(e){const n={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(n.expression=e.labelExpressionInfo.value,n.type="conventional"):e.labelExpressionInfo.expression&&(n.expression=e.labelExpressionInfo.expression,n.type="arcade"):null!=e.labelExpression&&(n.expression=u(e.labelExpression),n.type="conventional"),n}function f(e){const n=x(e);if(!n)return null;switch(n.type){case"conventional":return E(n.expression);case"arcade":return n.expression}return null}function g(e){const n=x(e);if(!n)return null;switch(n.type){case"conventional":return $(n.expression);case"arcade":return R(n.expression)}return null}function E(u){let p;return u?(p=e(u,e=>n+'$feature["'+e+'"]'+r),p=l.test(p)?p.replace(l,""):i+p,p=o.test(p)?p.replace(o,""):p+i,p=p.replaceAll(s,a).replaceAll(t,c)):p='""',p}const w=/^\s*\{([^}]+)\}\s*$/i;function $(e){const n=e?.match(w);return n?.[1].trim()||null}const b=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,m=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,y=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function R(e){if(!e)return null;let n=b.exec(e)||m.exec(e);return n?n[1]||n[3]:(n=y.exec(e),n?n[2]:null)}const _=Symbol("LabelClassInstance");function v(e){return null!=e&&"object"==typeof e&&_ in e}export{_ as LabelClassSymbol,E as convertTemplatedStringToArcade,x as getLabelExpression,f as getLabelExpressionArcade,g as getLabelExpressionSingleField,R as getSingleFieldArcadeExpression,$ as getSingleFieldTemplatedString,v as isLabelClass,u as sqlToTemplateString,p as templateStringToSql};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../geometry/Point.js";import t from"../../geometry/Polygon.js";import r from"../../geometry/Polyline.js";import n from"../support/TelemetryData.js";import o from"../support/VideoTimeExtent.js";import{applyCIMSymbolColor as i}from"../../symbols/support/cimSymbolUtils.js";import{applyColorToSymbol as a}from"../../symbols/support/utils.js";const u="application/x-mpegURL",s="video/mp4",l="video/webm",d={UASDatalinkLocalSet:1e4,PrecisionTimeStamp:10002,MissionId:10003,PlatformTailNumber:10004,PlatformHeadingAngle:10005,PlatformPitchAngle:10006,PlatformRollAngle:10007,PlatformTrueAirspeed:10008,PlatformIndicatedAirspeed:10009,PlatformDesignation:10010,ImageSourceSensor:10011,ImageCoordinateSystem:10012,SensorLatitude:10013,SensorLongitude:10014,SensorTrueAltitude:10015,SensorHorizontalFOV:10016,SensorVerticalFOV:10017,SensorAzimuthAngle:10018,SensorElevationAngle:10019,SensorRollAngle:10020,PlatformSlantRange:10021,TargetWidth:10022,FrameCenterLatitude:10023,FrameCenterLongitude:10024,FrameCenterElevation:10025,OffsetCorner1Latitude:10026,OffsetCorner1Longitude:10027,OffsetCorner2Latitude:10028,OffsetCorner2Longitude:10029,OffsetCorner3Latitude:10030,OffsetCorner3Longitude:10031,OffsetCorner4Latitude:10032,OffsetCorner4Longitude:10033,TargetLocationLatitude:10040,TargetLocationLongitude:10041,TargetLocationElevation:10042,TargetTrackGateWidth:10043,TargetTrackGateHeight:10044,TargetErrorEstimateHorizontal:10045,TargetErrorEstimateLateral:10046,GenericFlagData:10047,PlatformGroundSpeed:10056,PlatformGroundRange:10057,PlatformRemainingFuel:10058,PlatformCallSign:10059,SensorFOVName:10063,PlatformMagneticHeading:10064,LDSVersionNumber:10065,AlternatePlatformName:10070,EventStartTimeUTC:10072,VMTIDataSet:10074,SensorEllipsoidHeight:10075,OperationalMode:10077,FrameCenterAboveEllipsoid:10078,CornerLatitudePoint1:10082,CornerLongitudePoint1:10083,CornerLatitudePoint2:10084,CornerLongitudePoint2:10085,CornerLatitudePoint3:10086,CornerLongitudePoint3:10087,CornerLatitudePoint4:10088,CornerLongitudePoint4:10089,SARMotionImageryMetadata:10095,SecurityClassification:20001,SecurityClassifyingAuthority:20002,SecurityClassifyingCountry:20003,SecuritySCI:20004,SecurityCaveats:20005,SecurityReleaseInstructions:20006,SecurityLDSVersion:20022,EsriVideoWidth:90001,EsriVideoHeight:90002,EsriFrameCenterLatitude:90050,EsriFrameCenterLongitude:90051,EsriCornerLatitudePt1:90052,EsriCornerLongitudePt1:90053,EsriCornerLatitudePt2:90054,EsriCornerLongitudePt2:90055,EsriCornerLatitudePt3:90056,EsriCornerLongitudePt3:90057,EsriCornerLatitudePt4:90058,EsriCornerLongitudePt4:90059,EsriFrameOutline:90060,EsriSensorPosition:90061,EsriHorizonPixelPack:90063,EsriGroundControlPoints:90064};function f(e,t=1e4){if(!e||!e.length)return[];let r=[],n=[];for(let i=0;i<e.length;i++){const t=e[i],n=t?.text?JSON.parse(t.text):null;"EsriVideoServer"===n?.source&&(r=[...n.data])}const o=r.find(e=>e.tagId===t);return Array.isArray(o?.value)&&(n=[...o.value]),n}function g(e){const{duration:t,end:r,start:n,timezone:i="UTC"}=e||{};return"number"!=typeof t?null:new o({duration:t||null,end:"number"==typeof r?new Date(r):null,start:"number"==typeof n?new Date(n):null,timezone:i})}function m(e,t){const r=[...t],n=r.findIndex(t=>t.equals(e));return n>-1&&r.splice(n),r.push(e),r}function C(e){if(!e?.size)return new n;const t=b(e),r=P(e),o=O(e),i=A(t,r);return new n({frameCenter:r,frameOutline:o,lineOfSight:i,sensorLocation:t})}function L(e){if(!e?.size)return null;return e.get(d.EsriGroundControlPoints)?.value??null??null}function c(e){return e?.size?e.get(d.EsriHorizonPixelPack)?.value??null:null}function P(e){return S(e)??y(e)}function E(e){if(!e)return u;const t=e.match(/\.(\w{3,4})(?:$|\?)/i);if(!t)return u;switch(t[1].toLowerCase()){case"mp4":return s;case"webm":return l;default:return u}}function p(e){const t=e?.layers;return t?.length?t.map(e=>({layerId:e.id,posterUrl:e.poster,sourceType:e.serviceType,title:e.name,type:e.type||"Video Layer"})):[]}function v(e,t,r){if(!e)return null;const n=e.clone();switch(n.type){case"simple-fill":a(n,r),n.outline.color=t;break;case"simple-line":a(n,t);break;case"simple-marker":a(n,t),n?.outline?.color&&(n.outline.color=t);break;case"cim":i(n,t)}return n}function h(e){const{cameraAzimuth:t,platformHeading:r,source:n=null,symbolOffset:o=0}=e||{};let i=0;if(!n)return i;i="platformHeading"===n?r+o:r+t+o;const a=i>360?i-360:i;return Math.round(Math.abs(a))}function S(t){return t&&t.has(d.EsriFrameCenterLatitude)&&t.has(d.EsriFrameCenterLongitude)?new e({x:t.get(d.EsriFrameCenterLongitude).value,y:t.get(d.EsriFrameCenterLatitude).value,z:t.get(d.FrameCenterAboveEllipsoid)?.value??t.get(d.FrameCenterElevation)?.value}):null}function y(t){return t&&t.has(d.FrameCenterLatitude)&&t.has(d.FrameCenterLongitude)?new e({x:t.get(d.FrameCenterLongitude)?.value,y:t.get(d.FrameCenterLatitude)?.value,z:t.get(d.FrameCenterElevation)?.value}):null}function O(e){if(!e)return null;const r=e.get(d.EsriFrameOutline)?.value;return r?t.fromJSON(r.geometry):F(e)??T(e)}function F(e){if(!(e.has(d.EsriCornerLatitudePt1)&&e.has(d.EsriCornerLongitudePt1)&&e.has(d.EsriCornerLatitudePt2)&&e.has(d.EsriCornerLongitudePt2)&&e.has(d.EsriCornerLatitudePt3)&&e.has(d.EsriCornerLongitudePt3)&&e.has(d.EsriCornerLatitudePt4)&&e.has(d.EsriCornerLongitudePt4)))return null;const r=[e.get(d.EsriCornerLongitudePt1)?.value,e.get(d.EsriCornerLatitudePt1)?.value],n=[e.get(d.EsriCornerLongitudePt2)?.value,e.get(d.EsriCornerLatitudePt2)?.value],o=[e.get(d.EsriCornerLongitudePt3)?.value,e.get(d.EsriCornerLatitudePt3)?.value],i=[e.get(d.EsriCornerLongitudePt4)?.value,e.get(d.EsriCornerLatitudePt4)?.value];return new t({rings:[[r,n,o,i]]})}function T(e){if(!(e.has(d.OffsetCorner1Latitude)&&e.has(d.OffsetCorner1Longitude)&&e.has(d.OffsetCorner2Latitude)&&e.has(d.OffsetCorner2Longitude)&&e.has(d.OffsetCorner3Latitude)&&e.has(d.OffsetCorner3Longitude)&&e.has(d.OffsetCorner4Latitude)&&e.has(d.OffsetCorner4Longitude)&&e.has(d.FrameCenterLatitude)&&e.has(d.FrameCenterLongitude)))return null;const r=e.get(d.FrameCenterLatitude)?.value,n=e.get(d.FrameCenterLongitude)?.value,o=r+e.get(d.OffsetCorner1Latitude)?.value,i=n+e.get(d.OffsetCorner1Longitude)?.value,a=r+e.get(d.OffsetCorner2Latitude)?.value,u=n+e.get(d.OffsetCorner2Longitude)?.value,s=r+e.get(d.OffsetCorner3Latitude)?.value,l=n+e.get(d.OffsetCorner3Longitude)?.value,f=r+e.get(d.OffsetCorner4Latitude)?.value,g=n+e.get(d.OffsetCorner4Longitude)?.value;return new t({rings:[[[i,o],[u,a],[l,s],[g,f]]]})}function A(e,t){if(!e||!t)return null;const n=[e.x,e.y,e.z??0],o=[t.x,t.y,t.z??0];return new r({paths:[[n,o]]})}function b(t){if(!t?.size)return null;if(t.has(d.EsriSensorPosition)){const r=t.get(d.EsriSensorPosition)?.value;if(r)return e.fromJSON(r.geometry)}return t.has(d.SensorLongitude)&&t.has(d.SensorLatitude)?new e({x:t.get(d.SensorLongitude)?.value,y:t.get(d.SensorLatitude)?.value,z:t.get(d.SensorTrueAltitude)?.value}):null}export{P as getFrameCenter,c as getFrameHorizonPoints,L as getGroundControlPoints,m as getSensorTrailPoints,p as getServiceLayersInfo,v as getStyledTelemetrySymbol,h as getSymbolDisplayAngle,C as getTelemetryData,f as getVideoMetadataFromCueList,E as getVideoMimeType,g as readVideoTimeExtent,d as videoMetadataEntryId};
2
+ import e from"../../geometry/Point.js";import t from"../../geometry/Polygon.js";import r from"../../geometry/Polyline.js";import n from"../../geometry/SpatialReference.js";import{execute as o}from"../../geometry/operators/projectOperator.js";import i from"../support/TelemetryData.js";import a from"../support/VideoTimeExtent.js";import{applyCIMSymbolColor as u}from"../../symbols/support/cimSymbolUtils.js";import{applyColorToSymbol as s}from"../../symbols/support/utils.js";const l="application/x-mpegURL",f="video/mp4",d="video/webm",g={UASDatalinkLocalSet:1e4,PrecisionTimeStamp:10002,MissionId:10003,PlatformTailNumber:10004,PlatformHeadingAngle:10005,PlatformPitchAngle:10006,PlatformRollAngle:10007,PlatformTrueAirspeed:10008,PlatformIndicatedAirspeed:10009,PlatformDesignation:10010,ImageSourceSensor:10011,ImageCoordinateSystem:10012,SensorLatitude:10013,SensorLongitude:10014,SensorTrueAltitude:10015,SensorHorizontalFOV:10016,SensorVerticalFOV:10017,SensorAzimuthAngle:10018,SensorElevationAngle:10019,SensorRollAngle:10020,PlatformSlantRange:10021,TargetWidth:10022,FrameCenterLatitude:10023,FrameCenterLongitude:10024,FrameCenterElevation:10025,OffsetCorner1Latitude:10026,OffsetCorner1Longitude:10027,OffsetCorner2Latitude:10028,OffsetCorner2Longitude:10029,OffsetCorner3Latitude:10030,OffsetCorner3Longitude:10031,OffsetCorner4Latitude:10032,OffsetCorner4Longitude:10033,TargetLocationLatitude:10040,TargetLocationLongitude:10041,TargetLocationElevation:10042,TargetTrackGateWidth:10043,TargetTrackGateHeight:10044,TargetErrorEstimateHorizontal:10045,TargetErrorEstimateLateral:10046,GenericFlagData:10047,PlatformGroundSpeed:10056,PlatformGroundRange:10057,PlatformRemainingFuel:10058,PlatformCallSign:10059,SensorFOVName:10063,PlatformMagneticHeading:10064,LDSVersionNumber:10065,AlternatePlatformName:10070,EventStartTimeUTC:10072,VMTIDataSet:10074,SensorEllipsoidHeight:10075,OperationalMode:10077,FrameCenterAboveEllipsoid:10078,CornerLatitudePoint1:10082,CornerLongitudePoint1:10083,CornerLatitudePoint2:10084,CornerLongitudePoint2:10085,CornerLatitudePoint3:10086,CornerLongitudePoint3:10087,CornerLatitudePoint4:10088,CornerLongitudePoint4:10089,SARMotionImageryMetadata:10095,SecurityClassification:20001,SecurityClassifyingAuthority:20002,SecurityClassifyingCountry:20003,SecuritySCI:20004,SecurityCaveats:20005,SecurityReleaseInstructions:20006,SecurityLDSVersion:20022,EsriVideoWidth:90001,EsriVideoHeight:90002,EsriFrameCenterLatitude:90050,EsriFrameCenterLongitude:90051,EsriCornerLatitudePt1:90052,EsriCornerLongitudePt1:90053,EsriCornerLatitudePt2:90054,EsriCornerLongitudePt2:90055,EsriCornerLatitudePt3:90056,EsriCornerLongitudePt3:90057,EsriCornerLatitudePt4:90058,EsriCornerLongitudePt4:90059,EsriFrameOutline:90060,EsriSensorPosition:90061,EsriHorizonPixelPack:90063,EsriGroundControlPoints:90064};function m(e,t=1e4){if(!e||!e.length)return[];let r=[],n=[];for(let i=0;i<e.length;i++){const t=e[i],n=t?.text?JSON.parse(t.text):null;"EsriVideoServer"===n?.source&&(r=[...n.data])}const o=r.find(e=>e.tagId===t);return Array.isArray(o?.value)&&(n=[...o.value]),n}function C(e){const{duration:t,end:r,start:n,timezone:o="UTC"}=e||{};return"number"!=typeof t?null:new a({duration:t||null,end:"number"==typeof r?new Date(r):null,start:"number"==typeof n?new Date(n):null,timezone:o})}function c(e,t){const r=[...t],n=r.findIndex(t=>t.equals(e));return n>-1&&r.splice(n),r.push(e),r}function L(e){if(!e?.size)return new i;const t=z(e),r=p(e),n=w(e),o=b(t,r);return new i({frameCenter:r,frameOutline:n,lineOfSight:o,sensorLocation:t})}function y(e){if(!e?.size)return null;return e.get(g.EsriGroundControlPoints)?.value??null??null}function P(e){return e?.size?e.get(g.EsriHorizonPixelPack)?.value??null:null}function p(e){return O(e)??F(e)}function E(e){if(!e)return l;const t=e.match(/\.(\w{3,4})(?:$|\?)/i);if(!t)return l;switch(t[1].toLowerCase()){case"mp4":return f;case"webm":return d;default:return l}}function S(e){const t=e?.layers;return t?.length?t.map(e=>({layerId:e.id,posterUrl:e.poster,sourceType:e.serviceType,title:e.name,type:e.type||"Video Layer"})):[]}function h(e,t,r){if(!e)return null;const n=e.clone();switch(n.type){case"simple-fill":s(n,r),n.outline.color=t;break;case"simple-line":s(n,t);break;case"simple-marker":s(n,t),n?.outline?.color&&(n.outline.color=t);break;case"cim":u(n,t)}return n}function v(e){const{cameraAzimuth:t,platformHeading:r,source:n=null,symbolOffset:o=0}=e||{};let i=0;if(!n)return i;i="platformHeading"===n?r+o:r+t+o;const a=i>360?i-360:i;return Math.round(Math.abs(a))}function x(t,r,i){if(!r||r.length<3)return null;const a=[...r].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y),u=Array.from(new Set(a.map(e=>e.x))).sort((e,t)=>e-t),s=Array.from(new Set(a.map(e=>e.y)));let l=-1;for(let e=u.length-2;e>=0;e--)if(t.x>=u[e]&&t.x<=u[e+1]){l=e;break}let f=-1;for(let e=s.length-2;e>=0;e--)if(t.y>=s[e]&&t.y<=s[e+1]){f=e;break}if(l<0||f<0||l>=u.length-1||f>=s.length-1)return null;const d=u[l],g=u[l+1],m=s[f],C=s[f+1],c=(e,t)=>{const n=r.find(r=>r.x===e&&r.y===t);if(!n)throw new Error(`Control point not found for x: ${e}, y: ${t}`);return n},L=c(d,m),y=c(g,m),P=c(d,C),p=c(g,C),E=t.x,S=t.y;let h,v;if(G(L.x,L.y,y.x,y.y,p.x,p.y,E,S)){const t=new e(L.lon,L.lat,n.WGS84),r=new e(y.lon,y.lat,n.WGS84),a=new e(p.lon,p.lat,n.WGS84);v=[L,y,p],h=[o(t,i),o(r,i),o(a,i)]}else{if(!G(L.x,L.y,p.x,p.y,P.x,P.y,E,S))return null;{const t=new e(L.lon,L.lat,n.WGS84),r=new e(p.lon,p.lat,n.WGS84),a=new e(P.lon,P.lat,n.WGS84);v=[L,p,P],h=[o(t,i),o(r,i),o(a,i)]}}const[x,O,F]=v,[w,T,A]=h,b=(O.y-F.y)*(x.x-F.x)+(F.x-O.x)*(x.y-F.y),z=((O.y-F.y)*(E-F.x)+(F.x-O.x)*(S-F.y))/b,V=((F.y-x.y)*(E-F.x)+(x.x-F.x)*(S-F.y))/b,k=1-z-V;return[z*w.x+V*T.x+k*A.x,z*w.y+V*T.y+k*A.y]}function O(t){return t&&t.has(g.EsriFrameCenterLatitude)&&t.has(g.EsriFrameCenterLongitude)?new e({x:t.get(g.EsriFrameCenterLongitude).value,y:t.get(g.EsriFrameCenterLatitude).value,z:t.get(g.FrameCenterAboveEllipsoid)?.value??t.get(g.FrameCenterElevation)?.value}):null}function F(t){return t&&t.has(g.FrameCenterLatitude)&&t.has(g.FrameCenterLongitude)?new e({x:t.get(g.FrameCenterLongitude)?.value,y:t.get(g.FrameCenterLatitude)?.value,z:t.get(g.FrameCenterElevation)?.value}):null}function w(e){if(!e)return null;const r=e.get(g.EsriFrameOutline)?.value;return r?t.fromJSON(r.geometry):T(e)??A(e)}function T(e){if(!(e.has(g.EsriCornerLatitudePt1)&&e.has(g.EsriCornerLongitudePt1)&&e.has(g.EsriCornerLatitudePt2)&&e.has(g.EsriCornerLongitudePt2)&&e.has(g.EsriCornerLatitudePt3)&&e.has(g.EsriCornerLongitudePt3)&&e.has(g.EsriCornerLatitudePt4)&&e.has(g.EsriCornerLongitudePt4)))return null;const r=[e.get(g.EsriCornerLongitudePt1)?.value,e.get(g.EsriCornerLatitudePt1)?.value],n=[e.get(g.EsriCornerLongitudePt2)?.value,e.get(g.EsriCornerLatitudePt2)?.value],o=[e.get(g.EsriCornerLongitudePt3)?.value,e.get(g.EsriCornerLatitudePt3)?.value],i=[e.get(g.EsriCornerLongitudePt4)?.value,e.get(g.EsriCornerLatitudePt4)?.value];return new t({rings:[[r,n,o,i]]})}function A(e){if(!(e.has(g.OffsetCorner1Latitude)&&e.has(g.OffsetCorner1Longitude)&&e.has(g.OffsetCorner2Latitude)&&e.has(g.OffsetCorner2Longitude)&&e.has(g.OffsetCorner3Latitude)&&e.has(g.OffsetCorner3Longitude)&&e.has(g.OffsetCorner4Latitude)&&e.has(g.OffsetCorner4Longitude)&&e.has(g.FrameCenterLatitude)&&e.has(g.FrameCenterLongitude)))return null;const r=e.get(g.FrameCenterLatitude)?.value,n=e.get(g.FrameCenterLongitude)?.value,o=r+e.get(g.OffsetCorner1Latitude)?.value,i=n+e.get(g.OffsetCorner1Longitude)?.value,a=r+e.get(g.OffsetCorner2Latitude)?.value,u=n+e.get(g.OffsetCorner2Longitude)?.value,s=r+e.get(g.OffsetCorner3Latitude)?.value,l=n+e.get(g.OffsetCorner3Longitude)?.value,f=r+e.get(g.OffsetCorner4Latitude)?.value,d=n+e.get(g.OffsetCorner4Longitude)?.value;return new t({rings:[[[i,o],[u,a],[l,s],[d,f]]]})}function b(e,t){if(!e||!t)return null;const n=[e.x,e.y,e.z??0],o=[t.x,t.y,t.z??0];return new r({paths:[[n,o]]})}function z(t){if(!t?.size)return null;if(t.has(g.EsriSensorPosition)){const r=t.get(g.EsriSensorPosition)?.value;if(r)return e.fromJSON(r.geometry)}return t.has(g.SensorLongitude)&&t.has(g.SensorLatitude)?new e({x:t.get(g.SensorLongitude)?.value,y:t.get(g.SensorLatitude)?.value,z:t.get(g.SensorTrueAltitude)?.value}):null}function G(e,t,r,n,o,i,a,u){return(o-a)*(t-u)-(e-a)*(i-u)>=0&&(e-a)*(n-u)-(r-a)*(t-u)>=0&&(r-a)*(i-u)-(o-a)*(n-u)>=0}export{x as computeVideoToMapBaricentric,p as getFrameCenter,P as getFrameHorizonPoints,y as getGroundControlPoints,c as getSensorTrailPoints,S as getServiceLayersInfo,h as getStyledTelemetrySymbol,v as getSymbolDisplayAngle,L as getTelemetryData,m as getVideoMetadataFromCueList,E as getVideoMimeType,C as readVideoTimeExtent,g as videoMetadataEntryId};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.1.0-next.71",
3
+ "version": "5.1.0-next.73",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -19,7 +19,7 @@
19
19
  "license": "SEE LICENSE IN LICENSE.md",
20
20
  "dependencies": {
21
21
  "@amcharts/amcharts5": "~5.17.1",
22
- "@arcgis/toolkit": "^5.1.0-next.73",
22
+ "@arcgis/toolkit": "^5.1.0-next.76",
23
23
  "@esri/arcgis-html-sanitizer": "~4.1.0",
24
24
  "@esri/calcite-components": "^5.1.0-next.30",
25
25
  "@vaadin/grid": "~25.1.0",
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ const n=Symbol("PopupTemplateInstance");function t(t){return null!=t&&"object"==typeof t&&n in t}export{n as PopupTemplateSymbol,t as isPopupTemplate};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{JSONMap as t}from"../../core/jsonMap.js";import i from"../../core/Logger.js";import{property as s,subclass as r}from"../../core/accessorSupport/decorators.js";import n from"./VisualVariable.js";import{castSizeFromStringOrNumber as a}from"./support/castSizeVariable.js";import o from"./support/SizeStop.js";import l from"./support/SizeVariableLegendOptions.js";import{isSizeVariable as p,getInputValueType as u,getTransformationType as m}from"./support/sizeVariableUtils.js";import{viewScaleRE as h}from"./support/visualVariableUtils.js";import{addPropertyUnsupportedError as d,addUnsupportedMessage as y}from"../../webdoc/support/unsupportedErrors.js";import{reader as c}from"../../core/accessorSupport/decorators/reader.js";import{writer as S}from"../../core/accessorSupport/decorators/writer.js";var z;const x=new t({width:"width",depth:"depth",height:"height",widthAndDepth:"width-and-depth",all:"all"}),w=new t({unknown:"unknown",inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"});function v(e){if(null!=e)return"string"==typeof e||"number"==typeof e?a(e):"size"===e.type?p(e)?e:(delete(e={...e}).type,new V(e)):void 0}function g(e,t,i){if("object"!=typeof e)return e;if("web-scene"===i.origin)return;const s=new V;return s.read(e,i),s}function f(e,t,i,s){"number"!=typeof e?"web-scene"!==s?.origin?t[i]=e.toJSON(s):y(s,"error","property",`Size variable '${i}' can only be a number in web scenes.`):t[i]=e}let V=z=class extends n{constructor(e){super(e),this.axis=null,this.legendOptions=null,this.normalizationField=null,this.scaleBy=null,this.target=null,this.type="size",this.useSymbolValue=null,this.valueExpression=null,this.valueRepresentation=null,this.valueUnit=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null,isScaleDriven:null!=this.valueExpression&&h.test(this.valueExpression)}}set index(e){p(this.maxSize)&&(this.maxSize.index=`visualVariables[${e}].maxSize`),p(this.minSize)&&(this.minSize.index=`visualVariables[${e}].minSize`),this._set("index",e)}get inputValueType(){return u(this)}set maxDataValue(e){e&&this.stops&&(i.getLogger(this).warn("cannot set maxDataValue when stops is not null."),e=null),this._set("maxDataValue",e)}get maxSize(){return this._get("maxSize")}set maxSize(e){e&&this.stops&&(i.getLogger(this).warn("cannot set maxSize when stops is not null."),e=null),this._set("maxSize",v(e))}readMaxSize(e,t,i){return g(e,t,i)}writeMaxSize(e,t,i,s){return f(e,t,i,s)}set minDataValue(e){e&&this.stops&&(i.getLogger(this).warn("cannot set minDataValue when stops is not null."),e=null),this._set("minDataValue",e)}get minSize(){return this._get("minSize")}set minSize(e){e&&this.stops&&(i.getLogger(this).warn("cannot set minSize when stops is not null."),e=null),this._set("minSize",v(e))}readMinSize(e,t,i){return g(e,t,i)}writeMinSize(e,t,i,s){return f(e,t,i,s)}get arcadeRequired(){return!!this.valueExpression||(null!=this.minSize&&"object"==typeof this.minSize&&this.minSize.arcadeRequired||null!=this.maxSize&&"object"==typeof this.maxSize&&this.maxSize.arcadeRequired)}set stops(e){null==this.minDataValue&&null==this.maxDataValue&&null==this.minSize&&null==this.maxSize?e&&Array.isArray(e)&&(e=e.filter(e=>!!e)).sort((e,t)=>e.value-t.value):e&&(i.getLogger(this).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),e=null),this._set("stops",e)}get transformationType(){return m(this,this.inputValueType)}readValueExpression(e,t){return e||t.expression&&"$view.scale"}writeValueExpressionWebScene(e,t,i,s){if(h.test(e)){if(s?.messages){const e=this.index;d(s,`visualVariables[${"string"==typeof e?e:`visualVariables[${e}]`}].valueExpression`,"SizeVariable with '$view.scale' valueExpression is not supported in Web Scene. Please remove this property to save the Web Scene.")}}else t[i]=e}readValueUnit(e){return e?w.read(e):null}clone(){return new z({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:p(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:p(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:this.stops?.map(e=>e.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions?.clone()})}flipSizes(){if("clamped-linear"===this.transformationType){const{minSize:e,maxSize:t}=this;return this.minSize=t,this.maxSize=e,this}if("stops"===this.transformationType){const e=this.stops;if(!e)return this;const t=e.map(e=>e.size).reverse(),i=e.length;for(let s=0;s<i;s++)e[s].size=t[s];return this}return this}_interpolateData(){return this.stops?.map(e=>e.value||0)}};e([s({readOnly:!0})],V.prototype,"cache",null),e([s({type:x.apiValues,json:{type:x.jsonValues,origins:{"web-map":{read:!1}},read:x.read,write:x.write}})],V.prototype,"axis",void 0),e([s()],V.prototype,"index",null),e([s({type:String,readOnly:!0})],V.prototype,"inputValueType",null),e([s({type:l,json:{write:!0}})],V.prototype,"legendOptions",void 0),e([s({type:Number,value:null,json:{write:!0}})],V.prototype,"maxDataValue",null),e([s({type:Number,useTypeForAutocast:!1,value:null,json:{write:!0}})],V.prototype,"maxSize",null),e([c("maxSize")],V.prototype,"readMaxSize",null),e([S("maxSize")],V.prototype,"writeMaxSize",null),e([s({type:Number,value:null,json:{write:!0}})],V.prototype,"minDataValue",null),e([s({type:Number,useTypeForAutocast:!1,value:null,json:{write:!0}})],V.prototype,"minSize",null),e([c("minSize")],V.prototype,"readMinSize",null),e([S("minSize")],V.prototype,"writeMinSize",null),e([s({type:String,json:{write:!0}})],V.prototype,"normalizationField",void 0),e([s({readOnly:!0})],V.prototype,"arcadeRequired",null),e([s({type:String})],V.prototype,"scaleBy",void 0),e([s({type:[o],value:null,json:{write:!0}})],V.prototype,"stops",null),e([s({type:["outline"],json:{write:!0}})],V.prototype,"target",void 0),e([s({type:String,readOnly:!0})],V.prototype,"transformationType",null),e([s({type:["size"],json:{type:["sizeInfo"]}})],V.prototype,"type",void 0),e([s({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],V.prototype,"useSymbolValue",void 0),e([s({type:String,json:{write:!0}})],V.prototype,"valueExpression",void 0),e([c("valueExpression",["valueExpression","expression"])],V.prototype,"readValueExpression",null),e([S("web-scene","valueExpression")],V.prototype,"writeValueExpressionWebScene",null),e([s({type:["radius","diameter","area","width","distance"],json:{write:!0}})],V.prototype,"valueRepresentation",void 0),e([s({type:w.apiValues,json:{write:w.write,origins:{"web-map":{read:!1},"web-scene":{write:!0},"portal-item":{write:!0}}}})],V.prototype,"valueUnit",void 0),e([c("valueUnit")],V.prototype,"readValueUnit",null),V=z=e([r("esri.renderers.visualVariables.SizeVariable")],V);export{V as default};
2
+ import{__decorate as e}from"tslib";import{JSONMap as t}from"../../core/jsonMap.js";import i from"../../core/Logger.js";import{property as s,subclass as r}from"../../core/accessorSupport/decorators.js";import n from"./VisualVariable.js";import{castSizeFromStringOrNumber as a}from"./support/castSizeVariable.js";import o from"./support/SizeStop.js";import l from"./support/SizeVariableLegendOptions.js";import{isSizeVariable as p,getInputValueType as u,getTransformationType as m,SizeVariableSymbol as h}from"./support/sizeVariableUtils.js";import{viewScaleRE as d}from"./support/visualVariableUtils.js";import{addPropertyUnsupportedError as y,addUnsupportedMessage as c}from"../../webdoc/support/unsupportedErrors.js";import{reader as S}from"../../core/accessorSupport/decorators/reader.js";import{writer as z}from"../../core/accessorSupport/decorators/writer.js";var x,w;const v=new t({width:"width",depth:"depth",height:"height",widthAndDepth:"width-and-depth",all:"all"}),g=new t({unknown:"unknown",inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"});function f(e){if(null!=e)return"string"==typeof e||"number"==typeof e?a(e):"size"===e.type?p(e)?e:(delete(e={...e}).type,new j(e)):void 0}function V(e,t,i){if("object"!=typeof e)return e;if("web-scene"===i.origin)return;const s=new j;return s.read(e,i),s}function b(e,t,i,s){"number"!=typeof e?"web-scene"!==s?.origin?t[i]=e.toJSON(s):c(s,"error","property",`Size variable '${i}' can only be a number in web scenes.`):t[i]=e}let j=w=class extends n{static{x=h}constructor(e){super(e),this[x]=!0,this.axis=null,this.legendOptions=null,this.normalizationField=null,this.scaleBy=null,this.target=null,this.type="size",this.useSymbolValue=null,this.valueExpression=null,this.valueRepresentation=null,this.valueUnit=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null,isScaleDriven:null!=this.valueExpression&&d.test(this.valueExpression)}}set index(e){p(this.maxSize)&&(this.maxSize.index=`visualVariables[${e}].maxSize`),p(this.minSize)&&(this.minSize.index=`visualVariables[${e}].minSize`),this._set("index",e)}get inputValueType(){return u(this)}set maxDataValue(e){e&&this.stops&&(i.getLogger(this).warn("cannot set maxDataValue when stops is not null."),e=null),this._set("maxDataValue",e)}get maxSize(){return this._get("maxSize")}set maxSize(e){e&&this.stops&&(i.getLogger(this).warn("cannot set maxSize when stops is not null."),e=null),this._set("maxSize",f(e))}readMaxSize(e,t,i){return V(e,t,i)}writeMaxSize(e,t,i,s){return b(e,t,i,s)}set minDataValue(e){e&&this.stops&&(i.getLogger(this).warn("cannot set minDataValue when stops is not null."),e=null),this._set("minDataValue",e)}get minSize(){return this._get("minSize")}set minSize(e){e&&this.stops&&(i.getLogger(this).warn("cannot set minSize when stops is not null."),e=null),this._set("minSize",f(e))}readMinSize(e,t,i){return V(e,t,i)}writeMinSize(e,t,i,s){return b(e,t,i,s)}get arcadeRequired(){return!!this.valueExpression||(null!=this.minSize&&"object"==typeof this.minSize&&this.minSize.arcadeRequired||null!=this.maxSize&&"object"==typeof this.maxSize&&this.maxSize.arcadeRequired)}set stops(e){null==this.minDataValue&&null==this.maxDataValue&&null==this.minSize&&null==this.maxSize?e&&Array.isArray(e)&&(e=e.filter(e=>!!e)).sort((e,t)=>e.value-t.value):e&&(i.getLogger(this).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),e=null),this._set("stops",e)}get transformationType(){return m(this,this.inputValueType)}readValueExpression(e,t){return e||t.expression&&"$view.scale"}writeValueExpressionWebScene(e,t,i,s){if(d.test(e)){if(s?.messages){const e=this.index;y(s,`visualVariables[${"string"==typeof e?e:`visualVariables[${e}]`}].valueExpression`,"SizeVariable with '$view.scale' valueExpression is not supported in Web Scene. Please remove this property to save the Web Scene.")}}else t[i]=e}readValueUnit(e){return e?g.read(e):null}clone(){return new w({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:p(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:p(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:this.stops?.map(e=>e.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions?.clone()})}flipSizes(){if("clamped-linear"===this.transformationType){const{minSize:e,maxSize:t}=this;return this.minSize=t,this.maxSize=e,this}if("stops"===this.transformationType){const e=this.stops;if(!e)return this;const t=e.map(e=>e.size).reverse(),i=e.length;for(let s=0;s<i;s++)e[s].size=t[s];return this}return this}_interpolateData(){return this.stops?.map(e=>e.value||0)}};e([s({readOnly:!0})],j.prototype,"cache",null),e([s({type:v.apiValues,json:{type:v.jsonValues,origins:{"web-map":{read:!1}},read:v.read,write:v.write}})],j.prototype,"axis",void 0),e([s()],j.prototype,"index",null),e([s({type:String,readOnly:!0})],j.prototype,"inputValueType",null),e([s({type:l,json:{write:!0}})],j.prototype,"legendOptions",void 0),e([s({type:Number,value:null,json:{write:!0}})],j.prototype,"maxDataValue",null),e([s({type:Number,useTypeForAutocast:!1,value:null,json:{write:!0}})],j.prototype,"maxSize",null),e([S("maxSize")],j.prototype,"readMaxSize",null),e([z("maxSize")],j.prototype,"writeMaxSize",null),e([s({type:Number,value:null,json:{write:!0}})],j.prototype,"minDataValue",null),e([s({type:Number,useTypeForAutocast:!1,value:null,json:{write:!0}})],j.prototype,"minSize",null),e([S("minSize")],j.prototype,"readMinSize",null),e([z("minSize")],j.prototype,"writeMinSize",null),e([s({type:String,json:{write:!0}})],j.prototype,"normalizationField",void 0),e([s({readOnly:!0})],j.prototype,"arcadeRequired",null),e([s({type:String})],j.prototype,"scaleBy",void 0),e([s({type:[o],value:null,json:{write:!0}})],j.prototype,"stops",null),e([s({type:["outline"],json:{write:!0}})],j.prototype,"target",void 0),e([s({type:String,readOnly:!0})],j.prototype,"transformationType",null),e([s({type:["size"],json:{type:["sizeInfo"]}})],j.prototype,"type",void 0),e([s({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],j.prototype,"useSymbolValue",void 0),e([s({type:String,json:{write:!0}})],j.prototype,"valueExpression",void 0),e([S("valueExpression",["valueExpression","expression"])],j.prototype,"readValueExpression",null),e([z("web-scene","valueExpression")],j.prototype,"writeValueExpressionWebScene",null),e([s({type:["radius","diameter","area","width","distance"],json:{write:!0}})],j.prototype,"valueRepresentation",void 0),e([s({type:g.apiValues,json:{write:g.write,origins:{"web-map":{read:!1},"web-scene":{write:!0},"portal-item":{write:!0}}}})],j.prototype,"valueUnit",void 0),e([S("valueUnit")],j.prototype,"readValueUnit",null),j=w=e([r("esri.renderers.visualVariables.SizeVariable")],j);export{j as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- function n(n){return n&&"esri.renderers.visualVariables.SizeVariable"===n.declaredClass}function e(n){return null!=n&&!isNaN(n)&&isFinite(n)}function i(n){return n.valueExpression?"expression":n.field&&"string"==typeof n.field?"field":"unknown"}function l(n,e){const l=e||i(n),a=n.valueUnit||"unknown";return"unknown"===l?"constant":n.stops?"stops":null!=n.minSize&&null!=n.maxSize&&null!=n.minDataValue&&null!=n.maxDataValue?"clamped-linear":"unknown"===a?null!=n.minSize&&null!=n.minDataValue?n.minSize&&n.minDataValue?"proportional":"additive":"identity":"real-world-size"}export{i as getInputValueType,l as getTransformationType,n as isSizeVariable,e as isValidNumber};
2
+ const n=Symbol("SizeVariableInstance");function i(i){return null!=i&&"object"==typeof i&&n in i}function e(n){return null!=n&&!isNaN(n)&&isFinite(n)}function l(n){return n.valueExpression?"expression":n.field&&"string"==typeof n.field?"field":"unknown"}function t(n,i){const e=i||l(n),t=n.valueUnit||"unknown";return"unknown"===e?"constant":n.stops?"stops":null!=n.minSize&&null!=n.maxSize&&null!=n.minDataValue&&null!=n.maxDataValue?"clamped-linear":"unknown"===t?null!=n.minSize&&null!=n.minDataValue?n.minSize&&n.minDataValue?"proportional":"additive":"identity":"real-world-size"}export{n as SizeVariableSymbol,l as getInputValueType,t as getTransformationType,i as isSizeVariable,e as isValidNumber};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as t}from"tslib";import s from"../../../core/Error.js";import r from"../../../core/pbf.js";import{featureGeometryTypeKebabDictionary as n}from"../../../geometry/support/typeUtils.js";const a=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],o=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeBigInteger","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],i=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],c=["upperLeft","lowerLeft"];function l(e,t){const s=e.getEnum();return s<t.length?t[s]:void 0}function u(e,t){e.featureSet.geometryType=e.usesShortGeometryTypes?n.fromJSON(t):t}function g(e,t=e.featureSet.geometryType){return e.usesShortGeometryTypes?n.toJSON(t):t}function p(e){const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:return t.getString();case 2:return t.getFloat();case 3:return t.getDouble();case 4:return t.getSInt32();case 5:return t.getUInt32();case 6:return t.getInt64();case 7:return t.getUInt64();case 8:return t.getSInt64();case 9:return t.getBool();default:return t.skip(),null}return null}function f(e){const t=e.asUnsafe(),s={type:o[0]};for(;t.next();)switch(t.tag()){case 1:s.name=t.getString();break;case 2:s.type=l(t,o);break;case 3:s.alias=t.getString();break;case 4:s.sqlType=l(t,i);break;case 5:default:t.skip();break;case 6:s.defaultValue=t.getString()}return s}function y(e){const t={},s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t.name=s.getString();break;case 2:t.isSystemMaintained=s.getBool();break;default:s.skip()}return t}let d=[];function h(e,t,s){let r=g(t),n=0;const o=e.asUnsafe();for(;o.next();)switch(o.tag()){case 1:1===s?r=g(t,l(o,a)):o.skip();continue;case 2:for(const e=o.getPackedEnd();o.pos()<e;)d[n++]=o.getUInt32();continue;case 3:n>0?(d.length=n,null!=t.geometry(s,r,d)&&(d=[])):t.geometry(s,r,[]);for(const e=o.getPackedEnd();o.pos()<e;)t.coord(o.getSInt64());continue;default:o.skip()}}function m(e,t){const s=[],r=e.asUnsafe();for(;r.next();)if(3!==r.tag())r.skip();else for(const e=r.getPackedEnd();r.pos()<e;)s.push(r.getSInt64());t.centroid(s)}let k=[],T=[],b=[];function S(s,r){const n={stack:[],error:void 0,hasError:!1};try{let o=0;const i=d;let c=0;const l=s.asUnsafe(),u=e(n,l.clonePooled().asUnsafe(),!1);for(;l.next();)switch(l.tag()){case 2:for(const p=l.getPackedEnd();l.pos()<p;)i[o++]=l.getUInt32();continue;case 3:if(!("curvedGeometry"in r))throw new Error(`Tried to parse curved geometry in a ${r.constructor.name}, which doesn't support them.`);l.processMessageWithArgs(I,c++);continue;case 4:{const f=l.getUInt32(),y=l.pos()+f;if(0===c||0===o||0===f){l.move(y);continue}i.length=o,b.length=T.length=c,r.curvedGeometry(g(r),i,T,b);const{hasZ:h,hasM:m}=r.featureSet,S=[],q=[0,0];function w(){for(let e=0;e<q.length;++e)S[e]=q[e],q[e]=l.getSInt64()}h&&q.push(0),m&&q.push(0);const F=[0,0],U=[0,0],D=F,M=F;let x=0;for(let G=0;G<o;++G){w(),S.fill(0),r.startCurvedPart(q);for(const E=x+i[G];x<E;++x){const v=T[x],A=b[x];switch(v){case 0:for(let P=0;P<A;++P)w(),q[0]+=S[0],q[1]+=S[1],r.lineSegment(S,q);continue;case 1:for(let W=0;W<A;++W)w(),D[0]=l.getSInt64(),D[1]=l.getSInt64(),r.circularArcSegment(S,q,D);continue;case 2:for(let O=0;O<A;++O)w(),F[0]=l.getSInt64(),F[1]=l.getSInt64(),U[0]=l.getSInt64(),U[1]=l.getSInt64(),r.bezierSegment(S,q,F,U);continue;case 3:u.move(k[x]);if(u.getUInt32()<7*A)throw new Error("Not implemented: compressed full circle encoding");for(let B=0;B<A;++B){w(),M[0]=u.getDouble(),M[1]=u.getDouble();const N=u.getDouble(),V=u.getDouble(),L=u.getDouble(),C=u.getDouble(),R=u.getDouble();r.ellipticArcSegment(S,q,M,N,V,L,C,R)}continue}}r.finishCurvedPart(q)}continue}default:l.skip()}}catch(a){n.error=a,n.hasError=!0}finally{t(n)}}function I(e,t){const s=e.asUnsafe();let r=0,n=0,a=0;for(;s.next();)switch(s.tag()){case 1:r=s.getEnum();continue;case 2:n=s.getUInt32();continue;case 3:a=s.pos(),s.skip();continue;default:s.skip()}if(3===r&&0===a)throw new Error("An elliptic arc segment set did not include a parameters array");T[t]=r,b[t]=n,k[t]=a}function q(e,t){t.feature();const s=t.featureSet.features.at(-1);let r=0;const{fields:n}=t.featureSet;for(;e.next();)switch(e.tag()){case 1:if(null==n)throw new Error("A Feature had attributes but the FeatureResult didn't include any fields");s.attributes[n[r++].name]=e.processMessage(p);continue;case 2:e.processMessageWithArgs(h,t,0);continue;case 4:e.processMessageWithArgs(m,t);continue;case 7:e.processMessageWithArgs(S,t);continue;default:e.skip();continue}t.finishFeature?.()}function w(e){const t=[1,1,1,1],s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t[0]=s.getDouble();break;case 2:t[1]=s.getDouble();break;case 4:t[2]=s.getDouble();break;case 3:t[3]=s.getDouble();break;default:s.skip()}return t}function F(e){const t=[0,0,0,0],s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t[0]=s.getDouble();break;case 2:t[1]=s.getDouble();break;case 4:t[2]=s.getDouble();break;case 3:t[3]=s.getDouble();break;default:s.skip()}return t}function U(e){const t={originPosition:c[0]},s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t.originPosition=l(s,c);break;case 2:t.scale=s.processMessage(w);break;case 3:t.translate=s.processMessage(F);break;default:s.skip()}return t}function D(e){const t={},s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t.shapeAreaFieldName=s.getString();break;case 2:t.shapeLengthFieldName=s.getString();break;case 3:t.units=s.getString();break;default:s.skip()}return t}function M(e){const t={};for(;e.next();)switch(e.tag()){case 1:t.wkid=e.getUInt32();break;case 5:t.wkt=e.getString();break;case 2:t.latestWkid=e.getUInt32();break;case 3:t.vcsWkid=e.getUInt32();break;case 4:t.latestVcsWkid=e.getUInt32();break;default:e.skip()}return t}function x(e,t){const s=e.asUnsafe();if(t.featureSet.features.length=0,"features"===t.parseOnly?.type){const e=t.parseOnly.indices.values();let r=0,n=e.next().value;for(;s.next();)15===s.tag()&&r++===n?(n=e.next().value,s.processMessageWithArgs(q,t)):s.skip();return}let r=!1;for("metadata"===t.parseOnly?.type&&(r=!0,t.parseOnly.featureCount=0),u(t,"esriGeometryPoint");s.next();)switch(s.tag()){case 1:t.idField(s.getString());continue;case 3:t.featureSet.globalIdFieldName=s.getString();continue;case 4:t.featureSet.geohashFieldName=s.getString();continue;case 5:t.featureSet.geometryProperties=s.processMessage(D);continue;case 7:u(t,l(s,a));continue;case 8:t.featureSet.spatialReference=s.processMessageWithArgs(M);continue;case 10:t.featureSet.hasZ=s.getBool();continue;case 11:t.featureSet.hasM=s.getBool();continue;case 12:t.featureSet.transform=s.processMessage(U);continue;case 9:t.featureSet.exceededTransferLimit=s.getBool();continue;case 13:t.featureSet.fields??=[],t.featureSet.fields.push(s.processMessage(f));continue;case 15:if(r){++t.parseOnly.featureCount,s.skip();continue}s.processMessageWithArgs(q,t);continue;case 2:t.idField(s.processMessage(y));continue;default:s.skip()}}function G(e,t,s){let r=-1;for(;e.next();)switch(e.tag()){case 4:r=e.pos(),e.skip();continue;case 1:e.processMessageWithArgs(x,t);continue;default:e.skip()}if(-1!==r){if(!t.queryGeometry()){const s=e.pos();e.move(r),e.processMessageWithArgs(h,t,1),e.move(s)}s.queryGeometryType=t.queryGeometryType(),s.queryGeometry=t.queryGeometry()}t.finish(),s.featureResult=t.featureSet}function E(n,a){const o={stack:[],error:void 0,hasError:!1};try{e(o,{[Symbol.dispose](){d=[],k=[],T=[],b=[]}},!1);try{const s={stack:[],error:void 0,hasError:!1};try{const t=e(s,r.constructPooled(new Uint8Array(n),new DataView(n)),!1);let o;for(;t.next();)if(2===t.tag())o={},t.processMessageWithArgs(G,a,o);else t.skip();return o}catch(i){s.error=i,s.hasError=!0}finally{t(s)}}catch(c){throw new s("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:c})}}catch(l){o.error=l,o.hasError=!0}finally{t(o)}}export{E as parseFeatureQuery,f as parseField,U as parseTransform};
2
+ import{__addDisposableResource as e,__disposeResources as t}from"tslib";import s from"../../../core/Error.js";import r from"../../../core/pbf.js";import{featureGeometryTypeKebabDictionary as n}from"../../../geometry/support/typeUtils.js";const a=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],o=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeBigInteger","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],i=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],c=["upperLeft","lowerLeft"];function l(e,t){const s=e.getEnum();return s<t.length?t[s]:void 0}function u(e,t){e.featureSet.geometryType=e.usesShortGeometryTypes?n.fromJSON(t):t}function g(e,t=e.featureSet.geometryType){return e.usesShortGeometryTypes?n.toJSON(t):t}function p(e){const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:return t.getString();case 2:return t.getFloat();case 3:return t.getDouble();case 4:return t.getSInt32();case 5:return t.getUInt32();case 6:return t.getInt64();case 7:return t.getUInt64();case 8:return t.getSInt64();case 9:return t.getBool();default:return t.skip(),null}return null}function f(e){const t=e.asUnsafe(),s={type:o[0]};for(;t.next();)switch(t.tag()){case 1:s.name=t.getString();break;case 2:s.type=l(t,o);break;case 3:s.alias=t.getString();break;case 4:s.sqlType=l(t,i);break;case 5:default:t.skip();break;case 6:s.defaultValue=t.getString()}return s}function y(e){const t={},s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t.name=s.getString();break;case 2:t.isSystemMaintained=s.getBool();break;default:s.skip()}return t}let d=[];function h(e,t,s){let r=g(t),n=0;const o=e.asUnsafe();for(;o.next();)switch(o.tag()){case 1:1===s?r=g(t,l(o,a)):o.skip();continue;case 2:for(const e=o.getPackedEnd();o.pos()<e;)d[n++]=o.getUInt32();continue;case 3:n>0?(d.length=n,null!=t.geometry(s,r,d)&&(d=[])):t.geometry(s,r,[]);for(const e=o.getPackedEnd();o.pos()<e;)t.coord(o.getSInt64());continue;default:o.skip()}}function m(e,t){const s=[],r=e.asUnsafe();for(;r.next();)if(3!==r.tag())r.skip();else for(const e=r.getPackedEnd();r.pos()<e;)s.push(r.getSInt64());t.centroid(s)}let k=[],b=[],T=[];function S(s,r){const n={stack:[],error:void 0,hasError:!1};try{let o=0;const i=d;let c=0;const l=s.asUnsafe(),u=e(n,l.clonePooled().asUnsafe(),!1);for(;l.next();)switch(l.tag()){case 2:for(const p=l.getPackedEnd();l.pos()<p;)i[o++]=l.getUInt32();continue;case 3:if(!("curvedGeometry"in r))throw new Error(`Tried to parse curved geometry in a ${r.constructor.name}, which doesn't support them.`);l.processMessageWithArgs(I,c++);continue;case 4:{const f=l.getUInt32(),y=l.pos()+f;if(0===c||0===o||0===f){l.move(y);continue}i.length=o,T.length=b.length=c,r.curvedGeometry(g(r),i,b,T);const{hasZ:h,hasM:m}=r.featureSet,S=[],q=[0,0];function w(){for(let e=0;e<q.length;++e)S[e]=q[e],q[e]=l.getSInt64()}h&&q.push(0),m&&q.push(0);const F=[0,0],D=[0,0],U=F,M=F;let x=0;for(let G=0;G<o;++G){w(),S.fill(0),r.startCurvedPart(q);for(const E=x+i[G];x<E;++x){const v=b[x],A=T[x];switch(v){case 0:for(let P=0;P<A;++P)w(),q[0]+=S[0],q[1]+=S[1],r.lineSegment(S,q);continue;case 1:for(let W=0;W<A;++W)w(),U[0]=l.getSInt64(),U[1]=l.getSInt64(),r.circularArcSegment(S,q,U);continue;case 2:for(let O=0;O<A;++O)w(),F[0]=l.getSInt64(),F[1]=l.getSInt64(),D[0]=l.getSInt64(),D[1]=l.getSInt64(),r.bezierSegment(S,q,F,D);continue;case 3:u.move(k[x]);if(u.getUInt32()<7*A)throw new Error("Not implemented: compressed full circle encoding");for(let B=0;B<A;++B){w(),M[0]=u.getDouble(),M[1]=u.getDouble();const N=u.getDouble(),V=u.getDouble(),L=u.getDouble(),C=u.getDouble(),R=u.getDouble();r.ellipticArcSegment(S,q,M,N,V,L,C,R)}continue}}r.finishCurvedPart(q)}continue}default:l.skip()}}catch(a){n.error=a,n.hasError=!0}finally{t(n)}}function I(e,t){const s=e.asUnsafe();let r=0,n=0,a=0;for(;s.next();)switch(s.tag()){case 1:r=s.getEnum();continue;case 2:n=s.getUInt32();continue;case 3:a=s.pos(),s.skip();continue;default:s.skip()}if(3===r&&0===a)throw new Error("An elliptic arc segment set did not include a parameters array");b[t]=r,T[t]=n,k[t]=a}function q(e,t){t.feature();const s=t.featureSet.features.at(-1);let r=0;const{fields:n}=t.featureSet;for(;e.next();)switch(e.tag()){case 1:if(null==n)throw new Error("A Feature had attributes but the FeatureResult didn't include any fields");s.attributes[n[r++].name]=e.processMessage(p);continue;case 2:e.processMessageWithArgs(h,t,0);continue;case 4:e.processMessageWithArgs(m,t);continue;case 7:e.processMessageWithArgs(S,t);continue;case 11:s.distance=e.getDouble();continue;default:e.skip();continue}t.finishFeature?.()}function w(e){const t=[1,1,1,1],s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t[0]=s.getDouble();break;case 2:t[1]=s.getDouble();break;case 4:t[2]=s.getDouble();break;case 3:t[3]=s.getDouble();break;default:s.skip()}return t}function F(e){const t=[0,0,0,0],s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t[0]=s.getDouble();break;case 2:t[1]=s.getDouble();break;case 4:t[2]=s.getDouble();break;case 3:t[3]=s.getDouble();break;default:s.skip()}return t}function D(e){const t={originPosition:c[0]},s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t.originPosition=l(s,c);break;case 2:t.scale=s.processMessage(w);break;case 3:t.translate=s.processMessage(F);break;default:s.skip()}return t}function U(e){const t={},s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t.shapeAreaFieldName=s.getString();break;case 2:t.shapeLengthFieldName=s.getString();break;case 3:t.units=s.getString();break;default:s.skip()}return t}function M(e){const t={};for(;e.next();)switch(e.tag()){case 1:t.wkid=e.getUInt32();break;case 5:t.wkt=e.getString();break;case 2:t.latestWkid=e.getUInt32();break;case 3:t.vcsWkid=e.getUInt32();break;case 4:t.latestVcsWkid=e.getUInt32();break;default:e.skip()}return t}function x(e,t){const s=e.asUnsafe();if(t.featureSet.features.length=0,"features"===t.parseOnly?.type){const e=t.parseOnly.indices.values();let r=0,n=e.next().value;for(;s.next();)15===s.tag()&&r++===n?(n=e.next().value,s.processMessageWithArgs(q,t)):s.skip();return}let r=!1;for("metadata"===t.parseOnly?.type&&(r=!0,t.parseOnly.featureCount=0),u(t,"esriGeometryPoint");s.next();)switch(s.tag()){case 1:t.idField(s.getString());continue;case 3:t.featureSet.globalIdFieldName=s.getString();continue;case 4:t.featureSet.geohashFieldName=s.getString();continue;case 5:t.featureSet.geometryProperties=s.processMessage(U);continue;case 7:u(t,l(s,a));continue;case 8:t.featureSet.spatialReference=s.processMessageWithArgs(M);continue;case 10:t.featureSet.hasZ=s.getBool();continue;case 11:t.featureSet.hasM=s.getBool();continue;case 12:t.featureSet.transform=s.processMessage(D);continue;case 9:t.featureSet.exceededTransferLimit=s.getBool();continue;case 13:t.featureSet.fields??=[],t.featureSet.fields.push(s.processMessage(f));continue;case 15:if(r){++t.parseOnly.featureCount,s.skip();continue}s.processMessageWithArgs(q,t);continue;case 2:t.idField(s.processMessage(y));continue;default:s.skip()}}function G(e,t,s){let r=-1;for(;e.next();)switch(e.tag()){case 4:r=e.pos(),e.skip();continue;case 1:e.processMessageWithArgs(x,t);continue;default:e.skip()}if(-1!==r){if(!t.queryGeometry()){const s=e.pos();e.move(r),e.processMessageWithArgs(h,t,1),e.move(s)}s.queryGeometryType=t.queryGeometryType(),s.queryGeometry=t.queryGeometry()}t.finish(),s.featureResult=t.featureSet}function E(n,a){const o={stack:[],error:void 0,hasError:!1};try{e(o,{[Symbol.dispose](){d=[],k=[],b=[],T=[]}},!1);try{const s={stack:[],error:void 0,hasError:!1};try{const t=e(s,r.constructPooled(new Uint8Array(n),new DataView(n)),!1);let o;for(;t.next();)if(2===t.tag())o={},t.processMessageWithArgs(G,a,o);else t.skip();return o}catch(i){s.error=i,s.hasError=!0}finally{t(s)}}catch(c){throw new s("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:c})}}catch(l){o.error=l,o.hasError=!0}finally{t(o)}}export{E as parseFeatureQuery,f as parseField,D as parseTransform};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{__decorate as r}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as e,subclass as s}from"../../core/accessorSupport/decorators.js";var o;let n=class extends t{constructor(){super(...arguments),this.returnDistance=!0,this.ascendingOrder=!0}static{o=this}clone(){return new o({returnDistance:this.returnDistance,ascendingOrder:this.ascendingOrder})}};r([e()],n.prototype,"returnDistance",void 0),r([e()],n.prototype,"ascendingOrder",void 0),n=o=r([s("esri.rest.support.OutDistance")],n);const i=n;export{i 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 o}from"../../core/lang.js";import{property as i,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 m}from"../../geometry/support/typeUtils.js";import d from"../layerSources/DynamicDataLayer.js";import c from"./FullTextSearch.js";import y from"./QuantizationParameters.js";import{spatialRelKebabDict as h}from"./spatialRelationships.js";import f from"./StatisticDefinition.js";import j 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 g=new e({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let R=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.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!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.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 o=t[e];Array.isArray(o)?r[e]=o.map(t=>t instanceof Date?t.getTime():t):o instanceof Date?r[e]=o.getTime():r[e]=o}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(o({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,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,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,where:this.where}))}static{this.MAX_MAX_RECORD_COUNT_FACTOR=5}};t([i({json:{write:!0}})],R.prototype,"aggregateIds",void 0),t([i({type:Boolean,json:{write:!0}})],R.prototype,"cacheHint",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"compactGeometryEnabled",void 0),t([i({json:{write:!0}})],R.prototype,"datumTransformation",void 0),t([s("datumTransformation")],R.prototype,"castDatumTransformation",null),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"defaultSpatialReferenceEnabled",void 0),t([i({type:Number,json:{write:!0}})],R.prototype,"distance",void 0),t([i({type:d,json:{write:!0}})],R.prototype,"dynamicDataSource",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"formatOf3DObjects",void 0),t([i({type:[c],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.fullText&&this.fullText.length>0}}}}})],R.prototype,"fullText",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"gdbVersion",void 0),t([i({types:m,json:{read:u,write:!0}})],R.prototype,"geometry",void 0),t([i({type:Number,json:{write:!0}})],R.prototype,"geometryPrecision",void 0),t([i({type:[String],json:{write:!0}})],R.prototype,"groupByFieldsForStatistics",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"having",void 0),t([i({type:Date})],R.prototype,"historicMoment",void 0),t([v("historicMoment")],R.prototype,"writeHistoricMoment",null),t([i({type:Number,json:{write:!0}})],R.prototype,"maxAllowableOffset",void 0),t([i({type:Number,cast:t=>t<1?1:t>R.MAX_MAX_RECORD_COUNT_FACTOR?R.MAX_MAX_RECORD_COUNT_FACTOR:t,json:{write:{overridePolicy:t=>({enabled:t>1})}}})],R.prototype,"maxRecordCountFactor",void 0),t([i({type:["xyFootprint"],json:{write:!0}})],R.prototype,"multipatchOption",void 0),t([i({type:Number,json:{read:{source:"resultRecordCount"}}})],R.prototype,"num",void 0),t([i({json:{write:!0}})],R.prototype,"objectIds",void 0),t([i({type:[String],json:{write:!0}})],R.prototype,"orderByFields",void 0),t([i({type:[String],json:{write:!0}})],R.prototype,"outFields",void 0),t([i({type:p,json:{name:"outSR",write:!0}})],R.prototype,"outSpatialReference",void 0),t([i({type:[f],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],R.prototype,"outStatistics",void 0),t([i({json:{write:!0}})],R.prototype,"parameterValues",void 0),t([v("parameterValues")],R.prototype,"writeParameterValues",null),t([i({type:l,json:{write:!0}})],R.prototype,"pixelSize",void 0),t([i({type:y,json:{write:!0}})],R.prototype,"quantizationParameters",void 0),t([i({type:[Object],json:{write:!0}})],R.prototype,"rangeValues",void 0),t([i({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:"relation"===this.spatialRelationship}}}}})],R.prototype,"relationParameter",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"resultType",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnCentroid",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnDistinctValues",void 0),t([i({type:Boolean,json:{default:!0,write:!0}})],R.prototype,"returnExceededLimitFeatures",void 0),t([i({type:Boolean,json:{write:!0}})],R.prototype,"returnGeometry",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnQueryGeometry",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnM",void 0),t([i({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],R.prototype,"returnZ",void 0),t([i({type:Boolean,json:{write:!0}})],R.prototype,"returnTrueCurves",void 0),t([i({type:p,json:{write:!0}})],R.prototype,"sourceSpatialReference",void 0),t([w(h,{ignoreUnknown:!1,name:"spatialRel"})],R.prototype,"spatialRelationship",void 0),t([i({type:Number,json:{read:{source:"resultOffset"}}})],R.prototype,"start",void 0),t([v("start"),v("num")],R.prototype,"writeStart",null),t([i({type:String,json:{write:!0}})],R.prototype,"sqlFormat",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"text",void 0),t([i({type:j,json:{write:!0}})],R.prototype,"timeExtent",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"timeReferenceUnknownClient",void 0),t([w(g,{ignoreUnknown:!1}),i({json:{write:{overridePolicy(t){return{enabled:!!t&&null!=this.distance}}}}})],R.prototype,"units",void 0),t([i({type:String,json:{write:{overridePolicy(t){return{enabled:null!=t||null!=this.start&&this.start>0}}}}})],R.prototype,"where",void 0),t([v("where")],R.prototype,"writeWhere",null),R=S=t([n("esri.rest.support.Query")],R);export{R 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 o}from"../../core/lang.js";import{property as i,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 m}from"../../geometry/support/typeUtils.js";import d from"../layerSources/DynamicDataLayer.js";import c from"./FullTextSearch.js";import y from"./QuantizationParameters.js";import{spatialRelKebabDict as h}from"./spatialRelationships.js";import f from"./StatisticDefinition.js";import j 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 g=new e({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let R=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.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!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 o=t[e];Array.isArray(o)?r[e]=o.map(t=>t instanceof Date?t.getTime():t):o instanceof Date?r[e]=o.getTime():r[e]=o}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(o({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,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,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([i({json:{write:!0}})],R.prototype,"aggregateIds",void 0),t([i({type:Boolean,json:{write:!0}})],R.prototype,"cacheHint",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"compactGeometryEnabled",void 0),t([i({json:{write:!0}})],R.prototype,"datumTransformation",void 0),t([s("datumTransformation")],R.prototype,"castDatumTransformation",null),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"defaultSpatialReferenceEnabled",void 0),t([i({type:Number,json:{write:!0}})],R.prototype,"distance",void 0),t([i({type:d,json:{write:!0}})],R.prototype,"dynamicDataSource",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"formatOf3DObjects",void 0),t([i({type:[c],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.fullText&&this.fullText.length>0}}}}})],R.prototype,"fullText",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"gdbVersion",void 0),t([i({types:m,json:{read:u,write:!0}})],R.prototype,"geometry",void 0),t([i({type:Number,json:{write:!0}})],R.prototype,"geometryPrecision",void 0),t([i({type:[String],json:{write:!0}})],R.prototype,"groupByFieldsForStatistics",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"having",void 0),t([i({type:Date})],R.prototype,"historicMoment",void 0),t([v("historicMoment")],R.prototype,"writeHistoricMoment",null),t([i({type:Number,json:{write:!0}})],R.prototype,"maxAllowableOffset",void 0),t([i({type:Number,cast:t=>t<1?1:t>R.MAX_MAX_RECORD_COUNT_FACTOR?R.MAX_MAX_RECORD_COUNT_FACTOR:t,json:{write:{overridePolicy:t=>({enabled:t>1})}}})],R.prototype,"maxRecordCountFactor",void 0),t([i({type:["xyFootprint"],json:{write:!0}})],R.prototype,"multipatchOption",void 0),t([i({type:Number,json:{read:{source:"resultRecordCount"}}})],R.prototype,"num",void 0),t([i({json:{write:!0}})],R.prototype,"objectIds",void 0),t([i({type:[String],json:{write:!0}})],R.prototype,"orderByFields",void 0),t([i({type:[String],json:{write:!0}})],R.prototype,"outFields",void 0),t([i({type:p,json:{name:"outSR",write:!0}})],R.prototype,"outSpatialReference",void 0),t([i({type:[f],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],R.prototype,"outStatistics",void 0),t([i({json:{write:!0}})],R.prototype,"parameterValues",void 0),t([v("parameterValues")],R.prototype,"writeParameterValues",null),t([i({type:l,json:{write:!0}})],R.prototype,"pixelSize",void 0),t([i({type:y,json:{write:!0}})],R.prototype,"quantizationParameters",void 0),t([i({type:[Object],json:{write:!0}})],R.prototype,"rangeValues",void 0),t([i({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:"relation"===this.spatialRelationship}}}}})],R.prototype,"relationParameter",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"resultType",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnCentroid",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnDistinctValues",void 0),t([i({type:Boolean,json:{default:!0,write:!0}})],R.prototype,"returnExceededLimitFeatures",void 0),t([i({type:Boolean,json:{write:!0}})],R.prototype,"returnGeometry",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnQueryGeometry",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnM",void 0),t([i({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],R.prototype,"returnZ",void 0),t([i({type:Boolean,json:{write:!0}})],R.prototype,"returnTrueCurves",void 0),t([i({type:p,json:{write:!0}})],R.prototype,"sourceSpatialReference",void 0),t([w(h,{ignoreUnknown:!1,name:"spatialRel"})],R.prototype,"spatialRelationship",void 0),t([i({type:Number,json:{read:{source:"resultOffset"}}})],R.prototype,"start",void 0),t([v("start"),v("num")],R.prototype,"writeStart",null),t([i({type:String,json:{write:!0}})],R.prototype,"sqlFormat",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"text",void 0),t([i({type:j,json:{write:!0}})],R.prototype,"timeExtent",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"timeReferenceUnknownClient",void 0),t([w(g,{ignoreUnknown:!1}),i({json:{write:{overridePolicy(t){return{enabled:!!t&&null!=this.distance}}}}})],R.prototype,"units",void 0),t([i()],R.prototype,"outDistance",void 0),t([i({type:String,json:{write:{overridePolicy(t){return{enabled:null!=t||null!=this.start&&this.start>0}}}}})],R.prototype,"where",void 0),t([v("where")],R.prototype,"writeWhere",null),R=S=t([n("esri.rest.support.Query")],R);export{R as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../core/Error.js";import{pt2px as t}from"../../../core/screenUtils.js";import{timeOnlyToMilliseconds as n}from"../../../core/timeUtils.js";import o from"../../../geometry/Point.js";import i from"../../../geometry/SpatialReference.js";import{quantizePoint as r}from"../../../geometry/support/quantizationUtils.js";import{isWrappable as s,getInfo as l}from"../../../geometry/support/spatialReferenceUtils.js";import a from"../../../layers/support/FieldsIndex.js";import{isTimeOnlyField as u,isNumericField as f,numericTypes as c}from"../../../layers/support/fieldUtils.js";import{createValueFunction as p,evaluateDensityKernel as m}from"../../../renderers/support/heatmapUtils.js";import{isAnyDateField as d,getWhereClause as h}from"../../support/utils.js";import{processNullValue as y,getNormalizedValue as $}from"../../../statistics/utils.js";import{loadArcade as g}from"../../../support/loadArcade.js";let j=null;function w(e,t,n){return e.x<0?e.x+=t:e.x>n&&(e.x-=t),e}function x(e,t,n,i){const a=s(n)?l(n):null,u=a?Math.round((a.valid[1]-a.valid[0])/t.scale[0]):null;return e.map(e=>{const n=new o(e.geometry);return r(t,n,n),e.geometry=a?w(n,u??0,i[0]):n,e})}function I(e,n=18,o,i,r){const s=new Float64Array(i*r);n=Math.round(t(n));let l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;const u=p(o);for(const{geometry:t,attributes:f}of e){const{x:e,y:o}=t,c=Math.max(0,e-n),p=Math.max(0,o-n),d=Math.min(r,o+n),h=Math.min(i,e+n),y=+u(f);for(let t=p;t<d;t++)for(let r=c;r<h;r++){const u=t*i+r,f=m(r-e,t-o,n)*y,c=s[u]+=f;l=Math.min(l,c),a=Math.max(a,c)}}return{min:l,max:a}}async function F(e,t,o=!0){if(!t)return[];const{field:r,field2:s,field3:l,fieldDelimiter:f,sqlExpression:c,fieldInfos:p,timeZone:m}=e,w=r&&p?.find(e=>e.name.toLowerCase()===r.toLowerCase()),x=!!w&&u(w),I=!!w&&d(w),F=e.valueExpression,b=e.normalizationType,E=e.normalizationField,v=e.normalizationTotal,N=[],U=e.viewInfoParams;let M=null,T=null;if(F){if(!j){const{arcadeUtils:e}=await g();j=e}j.hasGeometryOperations(F)&&await j.enableGeometryOperations(),M=j.createFunction(F),T=U?j.getViewInfo({viewingMode:U.viewingMode,scale:U.scale,spatialReference:new i(U.spatialReference)}):null}const z=e.fieldInfos,O=!(t[0]&&"declaredClass"in t[0]&&"esri.Graphic"===t[0].declaredClass)&&z?{fields:z}:null;for await(const i of t){const e=i.attributes;let t;if(c){const e=await h(c,new a(z));e&&(t=e.calculateValue(i.attributes))}else if(F){const e=O?Object.assign({},i,{layer:O}):i,n=j.createExecContext(e,T,m);t=j.executeFunction(M,n)}else e&&(t=e[r],s?(t=`${y(t)}${f}${y(e[s])}`,l&&(t=`${t}${f}${y(e[l])}`)):"string"==typeof t&&o&&(I?t=t?new Date(t).getTime():null:x&&(t=t?n(t):null)));if(b&&"number"==typeof t&&isFinite(t)){const n=e&&parseFloat(e[E]);t=$(t,b,n,v)}N.push(t)}return N}function b(e){const t=e.field,n=e.normalizationType,o=e.normalizationField;let i;return"field"===n?i="(NOT "+o+" = 0)":"log"!==n&&"natural-log"!==n&&"square-root"!==n||(i=`(${t} > 0)`),i}function E(e,t,n){const o=null!=t?e+" >= "+t:"",i=null!=n?e+" <= "+n:"";let r="";return r=o&&i?U(o,i):o||i,r?"("+r+")":""}function v(t,n,o,i){let r;return n?n.name!==t.objectIdField&&i.includes(n.type)||(r=new e(o,"'field' should be one of these types: "+i.join(","))):r=new e(o,"'field' is not defined in the layer schema"),r}function N(t,n,o){let i;return n?n.name!==t.objectIdField&&f(n)||(i=new e(o,"'field' should be one of these numeric types: "+c.join(","))):i=new e(o,"'field' is not defined in the layer schema"),i}function U(e,t){let n=null!=e?e:"";return null!=t&&t&&(n=n?"("+n+") AND ("+t+")":t),n}function M(t,n){if(t&&"intersects"!==t.spatialRelationship)return new e(n,"Only 'intersects' spatialRelationship is supported for featureFilter")}function T(t,n,o){const i=z({layer:t,fields:n});if(i.length)return new e(o,"Unknown fields: "+i.join(", ")+". You can only use fields defined in the layer schema");const r=O({layer:t,fields:n});return r.length?new e(o,"Unsupported fields: "+r.join(", ")+". You can only use fields that can be fetched i.e. AdapterFieldUsageInfo.supportsStatistics must be true"):void 0}function z(e){const t=e.layer;return e.fields.filter(e=>!t.getField(e))}function O(e){const t=e.layer;return e.fields.filter(e=>{const n=t.getFieldUsageInfo(e);return!n||!n.supportsStatistics})}function R(e,t,n){const o=[],i=[],r=[],s=[],l=[];e.forEach((e,t)=>{const a=e.field?"field":"expression",u=e.field||e.valueExpression;e.field?(l.push(u),i.push(`var ${a}${t} = Number($feature["${u}"]);`)):(o.push(`function getValueForExpr${t}() {\n ${u} \n}`),i.push(`var ${a}${t} = Number(getValueForExpr${t}());`)),n||r.push(`${a}${t} = IIf(${a}${t} < 0, 0, ${a}${t});`),s.push(`${a}${t}`)});const a=o.length?null:l.reduce((e,t)=>`${e} + ${t}`);let u=null;t||n?t?n||a&&(u=`(( ${a} ) >= 0)`):a&&(u=`(( ${a} ) <> 0)`):a&&(u=`(( ${a} ) > 0)`);return{valueExpression:[o.length?o.join("\n"):"",i.join("\n"),r.join("\n"),`var total = ${s.join(" + ")};`,"return total;"].filter(Boolean).join("\n\n"),sqlExpression:a,sqlWhere:u}}export{I as calculateHeatmapStats,F as getDataValues,E as getRangeExpr,b as getSQLFilterForNormalization,R as getSumOfAttributesExpr,U as mergeWhereClauses,x as quantizeFeatures,T as verifyBasicFieldValidity,v as verifyFieldType,M as verifyFilterValidity,N as verifyNumericField};
2
+ import e from"../../../core/Error.js";import{pt2px as t}from"../../../core/screenUtils.js";import{timeOnlyToMilliseconds as n}from"../../../core/timeUtils.js";import o from"../../../geometry/Point.js";import i from"../../../geometry/SpatialReference.js";import{quantizePoint as r}from"../../../geometry/support/quantizationUtils.js";import{isWrappable as s,getInfo as l}from"../../../geometry/support/spatialReferenceUtils.js";import a from"../../../layers/support/FieldsIndex.js";import{isTimeOnlyField as u,isNumericField as f,numericTypes as c}from"../../../layers/support/fieldUtils.js";import{createValueFunction as p,evaluateDensityKernel as m}from"../../../renderers/support/heatmapUtils.js";import{isAnyDateField as d,getWhereClause as h}from"../../support/utils.js";import{processNullValue as y,getNormalizedValue as $}from"../../../statistics/utils.js";import{loadArcade as g}from"../../../support/loadArcade.js";let j;function w(e,t,n){return e.x<0?e.x+=t:e.x>n&&(e.x-=t),e}function x(e,t,n,i){const a=s(n)?l(n):null,u=a?Math.round((a.valid[1]-a.valid[0])/t.scale[0]):null;return e.map(e=>{const n=new o(e.geometry);return r(t,n,n),e.geometry=a?w(n,u??0,i[0]):n,e})}function I(e,n=18,o,i,r){const s=new Float64Array(i*r);n=Math.round(t(n));let l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;const u=p(o);for(const{geometry:t,attributes:f}of e){const{x:e,y:o}=t,c=Math.max(0,e-n),p=Math.max(0,o-n),d=Math.min(r,o+n),h=Math.min(i,e+n),y=+u(f);for(let t=p;t<d;t++)for(let r=c;r<h;r++){const u=t*i+r,f=m(r-e,t-o,n)*y,c=s[u]+=f;l=Math.min(l,c),a=Math.max(a,c)}}return{min:l,max:a}}async function F(e,t,o=!0){if(!t)return[];const{field:r,field2:s,field3:l,fieldDelimiter:f,sqlExpression:c,fieldInfos:p,timeZone:m}=e,w=r&&p?.find(e=>e.name.toLowerCase()===r.toLowerCase()),x=!!w&&u(w),I=!!w&&d(w),F=e.valueExpression,b=e.normalizationType,E=e.normalizationField,v=e.normalizationTotal,N=[],U=e.viewInfoParams;let M,T=null;if(F){if(!j){const{arcadeUtils:e}=await g();j=e}j.hasGeometryOperations(F)&&await j.enableGeometryOperations(),T=j.createFunction(F),M=U?j.getViewInfo({viewingMode:U.viewingMode,scale:U.scale,spatialReference:new i(U.spatialReference)}):null}const z=e.fieldInfos,O=!(t[0]&&"declaredClass"in t[0]&&"esri.Graphic"===t[0].declaredClass)&&z?{fields:z}:null;for await(const i of t){const e=i.attributes;let t;if(c){const e=await h(c,new a(z));e&&(t=e.calculateValue(i.attributes))}else if(F){const e=O?Object.assign({},i,{layer:O}):i,n=j.createExecContext(e,M,m);t=j.executeFunction(T,n)}else e&&(t=e[r],s?(t=`${y(t)}${f}${y(e[s])}`,l&&(t=`${t}${f}${y(e[l])}`)):"string"==typeof t&&o&&(I?t=t?new Date(t).getTime():null:x&&(t=t?n(t):null)));if(b&&"number"==typeof t&&isFinite(t)){const n=e&&parseFloat(e[E]);t=$(t,b,n,v)}N.push(t)}return N}function b(e){const t=e.field,n=e.normalizationType,o=e.normalizationField;let i;return"field"===n?i="(NOT "+o+" = 0)":"log"!==n&&"natural-log"!==n&&"square-root"!==n||(i=`(${t} > 0)`),i}function E(e,t,n){const o=null!=t?e+" >= "+t:"",i=null!=n?e+" <= "+n:"";let r="";return r=o&&i?U(o,i):o||i,r?"("+r+")":""}function v(t,n,o,i){let r;return n?n.name!==t.objectIdField&&i.includes(n.type)||(r=new e(o,"'field' should be one of these types: "+i.join(","))):r=new e(o,"'field' is not defined in the layer schema"),r}function N(t,n,o){let i;return n?n.name!==t.objectIdField&&f(n)||(i=new e(o,"'field' should be one of these numeric types: "+c.join(","))):i=new e(o,"'field' is not defined in the layer schema"),i}function U(e,t){let n=null!=e?e:"";return null!=t&&t&&(n=n?"("+n+") AND ("+t+")":t),n}function M(t,n){if(t&&"intersects"!==t.spatialRelationship)return new e(n,"Only 'intersects' spatialRelationship is supported for featureFilter")}function T(t,n,o){const i=z({layer:t,fields:n});if(i.length)return new e(o,"Unknown fields: "+i.join(", ")+". You can only use fields defined in the layer schema");const r=O({layer:t,fields:n});return r.length?new e(o,"Unsupported fields: "+r.join(", ")+". You can only use fields that can be fetched i.e. AdapterFieldUsageInfo.supportsStatistics must be true"):void 0}function z(e){const t=e.layer;return e.fields.filter(e=>!t.getField(e))}function O(e){const t=e.layer;return e.fields.filter(e=>{const n=t.getFieldUsageInfo(e);return!n||!n.supportsStatistics})}function R(e,t,n){const o=[],i=[],r=[],s=[],l=[];e.forEach((e,t)=>{const a=e.field?"field":"expression",u=e.field||e.valueExpression;e.field?(l.push(u),i.push(`var ${a}${t} = Number($feature["${u}"]);`)):(o.push(`function getValueForExpr${t}() {\n ${u} \n}`),i.push(`var ${a}${t} = Number(getValueForExpr${t}());`)),n||r.push(`${a}${t} = IIf(${a}${t} < 0, 0, ${a}${t});`),s.push(`${a}${t}`)});const a=o.length?null:l.reduce((e,t)=>`${e} + ${t}`);let u=null;t||n?t?n||a&&(u=`(( ${a} ) >= 0)`):a&&(u=`(( ${a} ) <> 0)`):a&&(u=`(( ${a} ) > 0)`);return{valueExpression:[o.length?o.join("\n"):"",i.join("\n"),r.join("\n"),`var total = ${s.join(" + ")};`,"return total;"].filter(Boolean).join("\n\n"),sqlExpression:a,sqlWhere:u}}export{I as calculateHeatmapStats,F as getDataValues,E as getRangeExpr,b as getSQLFilterForNormalization,R as getSumOfAttributesExpr,U as mergeWhereClauses,x as quantizeFeatures,T as verifyBasicFieldValidity,v as verifyFieldType,M as verifyFilterValidity,N as verifyNumericField};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{pickRandom as t}from"../../../core/arrayUtils.js";import r from"../../../core/Error.js";import a from"../../../core/Logger.js";import{assertIsSome as i}from"../../../core/maybe.js";import{timeout as s,throwIfAborted as o}from"../../../core/promiseUtils.js";import{whenOnce as n}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{toQuantizationTransform as m}from"../../../geometry/support/quantizationUtils.js";import{kebabDict as p}from"../../../layers/support/fieldType.js";import{isTimeOnlyField as y}from"../../../layers/support/fieldUtils.js";import f from"../../../rest/support/QuantizationParameters.js";import{getArcadeForPredominantCategory as c}from"../../statistics/support/predominanceUtils.js";import{summaryStatistics as d,uniqueValues as h,histogram as w,classBreaks as g,heatmapStatistics as F}from"../../statistics/support/statsWorker.js";import{mergeWhereClauses as S}from"../../statistics/support/utils.js";import{WorkerClient as q}from"../../statistics/support/WorkerClient.js";import{getFieldsList as v,isAnyDateField as x,getFieldsFromWhereClauses as V,fieldDelimiter as _}from"../utils.js";import z from"./LayerAdapter.js";import{getHistogramAttributeDefinition as T,getAttributeBinsQuery as N,processQueryAttributeBinsResult as M}from"./support/histogramUtils.js";import{ensureFeaturesJSON as L,getSummaryStatsQuery as E,getSummaryStatisticsFromFeatureSet as C,getViewInfoParams as j,getMissingFields as b,updateQueryWithFeatureFilter as I,getUVQuery as k,getUniqueValuesFromFeatureSet as O,getBins as Q,getDomainsForFields as J,getPredominantCategoriesFromUVInfos as B}from"./support/utils.js";import{processSummaryStatisticsResult as P,createUVResult as U,resolveCBResult as A}from"../../../statistics/utils.js";import{loadArcade as $}from"../../../support/loadArcade.js";const G=5;let R=null,D=class extends z{constructor(){super(...arguments),this._hasLocalSource=!1,this.adapterName="in-memory-layer-adapter"}destroy(){this.workerClient?.destroy()}async _waitForLayerViewUpdate(e){if(!e)throw new r(`${this.adapterName}:insufficient-data`,"layerView is required to fetch the features");const t=new AbortController,i=n(()=>!e.updating,t.signal);await s(i,5e3,t).catch(e=>{throw a.getLogger(this).warn("LayerView is taking too long to update. Aborting fetch from layerView."),e})}async _fetchFeatureSetFromMemory(e,t,a){const i=this.layer;if(this._hasLocalSource&&"queryFeatures"in i)return i.queryFeatures(e);if(!t)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=await t.whenLayerView(this.layer);return await this._waitForLayerViewUpdate(s),s.queryFeatures(e,{signal:a})}async _fetchFeaturesFromMemory(e,t,a,i){const s=this.layer,o="json"===i;if(this._hasLocalSource&&"queryFeatures"in s){const e=await s.queryFeatures(t);return o?L(e.features):e.features}if(await this._waitForLayerViewUpdate(e),o&&"queryFeaturesJSON"in e&&e.queryFeaturesJSON){const{features:r}=await e.queryFeaturesJSON(t,{signal:a});return r}if(!("queryFeatures"in e))throw new r(`${this.adapterName}:not-supported`,"'queryFeatures' is not supported on the layerView");const n=await e.queryFeatures(t,{signal:a});return o?L(n.features):n.features}_fetchFeaturesForStats(e,t){return v({field:e.field,field2:e.field2,field3:e.field3,normalizationField:e.normalizationField,valueExpression:e.valueExpression,fields:e.fields}).then(r=>this.getSampleFeatures({sampleSize:-1,view:e.view,returnGeometry:e.returnGeometry,filter:e.filter,requiredFields:r,sqlWhere:e.sqlWhere,signal:e.signal},t))}async _summaryStatsFromClientQuery(e,t){const{view:r,signal:a}=e,i=E(this,e,t),s=await this._fetchFeatureSetFromMemory(i,r,a),o=C(s,x(t)||y(t));return P(o,e.outStatisticTypes)}async _getNormalizationTotalFromMemory(e,t,a){const{featuresJSON:i,graphics:s,layerView:o,query:n}=t,l={include:["sum"]},u=(!i&&!s&&o&&"querySummaryStatistics"in o?await o.querySummaryStatistics(n,{field:e},{signal:a}):i?await this.workerClient.summaryStatistics({field:e,outStatisticTypes:l},i):await d({attribute:{field:e,outStatisticTypes:l},features:s??[]})).sum;if(null==u)throw new r(`${this.adapterName}:invalid`,"invalid normalizationTotal");return u}async _summaryStatsFromMemory(e,t){const{view:r,field:a,valueExpression:i,normalizationType:s,signal:o}=e,n={field:a,valueExpression:i,normalizationType:s,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,outStatisticTypes:e.outStatisticTypes},{featuresJSON:l,graphics:u,layerView:m,query:y,fieldInfos:f}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"querySummaryStatistics"});return i&&r&&(l||u)&&(n.fieldType=t?.type?p.toJSON(t.type):null,n.viewInfoParams=j(r),n.timeZone=r.timeZone,n.fieldInfos=f),"percent-of-total"===s&&null==e.normalizationTotal&&(n.normalizationTotal=await this._getNormalizationTotalFromMemory(a,{featuresJSON:l,graphics:u,layerView:m,query:y},o)),!l&&!u&&m&&"querySummaryStatistics"in m?m.querySummaryStatistics(y,n,{signal:o}):l?this.workerClient.summaryStatistics(n,l):d({attribute:n,features:u})}async _getFilteredFeatures(e,t){let r=e;const a=t?.geometry;if("intersects"===t?.spatialRelationship&&a){const t=await import("../../../geometry/operators/intersectionOperator.js");r=e.filter(({geometry:e})=>!(!e||!t.execute(e,a)))}return e.length&&"declaredClass"in e[0]&&"esri.Graphic"===e[0].declaredClass?{graphics:r}:{featuresJSON:r}}async _processStatsFromMemoryParams(e){const{features:t,filter:r}=e;if(t?.length)return this._getFilteredFeatures(t,r);const{view:a,field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,sqlExpression:u,sqlWhere:m,layerViewFunc:p,signal:y}=e;let f=e.returnGeometry;if(null==f&&l){if(!R){const{arcadeUtils:e}=await $();R=e}const e=R.hasGeometryOperations(l);e&&await R.enableGeometryOperations(),f=e}let c=null,d=null,h=null,w=null,g=null;if(a)try{const e="subtype-sublayer"===this.layer.type?this.layer.parent:this.layer;c=await a.whenLayerView(e),d=null!=p&&null!=c&&p in c&&"function"==typeof c[p]}catch{d=!1}if(d)try{await this._waitForLayerViewUpdate(c);const e=await v({field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,fields:await V([u,m],this.layer.fieldsIndex)});b(this,e,c).length?d=!1:(h=this.layer.createQuery(),h.outFields=e,h.returnGeometry=!1,h.where=S(h.where,m),I(h,r)),c.suspended&&(d=!1)}catch{d=!1}return d||(w=await this._fetchFeaturesForStats({field:i,field2:s,field3:o,fields:await V([u,m],this.layer.fieldsIndex),valueExpression:l,normalizationField:n,returnGeometry:f,filter:r,sqlWhere:m,view:a,signal:y},"json"),g=(await v({valueExpression:l})).map(e=>this.getField(e)?.toJSON()).filter(Boolean)),{layerView:c,query:h,featuresJSON:w,fieldInfos:g}}async _uvFromClientQuery(e,t){const{view:r,signal:a}=e,i=k(this,e),s=await this._fetchFeatureSetFromMemory(i,r,a),o=await O(s,{layer:this,field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:_,view:e.view,signal:e.signal});return U(o,t,e.returnAllCodedValues,_)}async _uvFromMemory(e,t){const{view:r,field:a,valueExpression:i,returnAllCodedValues:s,signal:o}=e,{featuresJSON:n,graphics:l,layerView:u,query:m,fieldInfos:p}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryUniqueValues"}),y={field:a,field2:e.field2,field3:e.field3,fieldDelimiter:_,valueExpression:i,domains:t,returnAllCodedValues:s};return i&&r&&(n||l)&&(y.viewInfoParams=j(r),y.timeZone=r.timeZone,y.fieldInfos=p),!n&&!l&&u&&"queryUniqueValues"in u?u.queryUniqueValues(m,y,{signal:o}):n?this.workerClient.uniqueValues(y,n):h({attribute:y,features:l})}_histogramForField(e){let t=null;return t=null!=e.minValue&&null!=e.maxValue?Promise.resolve({min:e.minValue,max:e.maxValue}):this.summaryStatistics({...e,outStatisticTypes:{include:["min","max","count"]}}).then(e=>{if(!e.count)throw new r(`${this.adapterName}:insufficient-data`,"Either the layer has no features or none of the features have data for the field");return{min:e.min,max:e.max}}),t.then(t=>Q(this,{min:t.min,max:t.max},e.field,e.numBins??void 0,e.view,e.filter,e.signal))}async _histogramFromQueryAttributeBinsFromMemory(e){const{field:t,normalizationType:r,signal:a}=e,i=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAttributeBins"}),{featuresJSON:s,graphics:o,layerView:n,query:l}=i,u="percent-of-total"===r?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,i,a):void 0;if(!n||!("queryAttributeBins"in n)||s||o){const t=T(e,i,u);return s?this.workerClient.histogram(t,s):w({attribute:t,features:o})}const{query:m,min:p,max:y}=await N(e,this,u,l);if(!m)return{bins:[],minValue:p,maxValue:y,normalizationTotal:u};const f=await n.queryAttributeBins(m,{signal:a});return M(f,t?this.getField(t):null,{minValue:p,maxValue:y,normalizationTotal:u})}async _histogramFromMemory(e){const{field:t,signal:r}=e,a=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryHistogram"}),{featuresJSON:i,graphics:s,layerView:o,query:n}=a,l="percent-of-total"===e.normalizationType?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,a,r):void 0,u=T(e,a,l);return!i&&!s&&o&&"queryHistogram"in o?o.queryHistogram(n,u,{signal:r}):i?this.workerClient.histogram(u,i):w({attribute:u,features:s})}_classBreaksFromInterpolation(e){const{minValue:t,maxValue:r}=e,a=e.numClasses||G,i=[],s=(r-t)/a;for(let l=0;l<a;l++){const e=t+l*s;i.push({minValue:e,maxValue:e+s})}i[a-1].maxValue=r;const o={classBreaks:i,normalizationTotal:e.normalizationTotal},n=A(o,e.classificationMethod);return Promise.resolve(n)}async _classBreaksFromMemory(e){const{view:t,field:r,valueExpression:a,signal:i}=e,{featuresJSON:s,graphics:o,layerView:n,query:l,fieldInfos:u}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryClassBreaks"}),m={field:r,valueExpression:a,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numClasses:e.numClasses};return a&&t&&(s||o)&&(m.viewInfoParams=j(t),m.timeZone=t.timeZone,m.fieldInfos=u),"percent-of-total"===e.normalizationType&&null==e.normalizationTotal&&(m.normalizationTotal=await this._getNormalizationTotalFromMemory(r,{featuresJSON:s,graphics:o,layerView:n,query:l},i)),!s&&!o&&n&&"queryClassBreaks"in n?n.queryClassBreaks(l,m,{signal:i}):s?this.workerClient.classBreaks(m,s):g({attribute:m,features:o})}async _heatmapStatsFromMemory(e){const{view:t,field:r,radius:a,signal:s}=e;i(t,"InMemoryLayerAdapter: must have a view");try{const r=await t.whenLayerView(this.layer);if("queryHeatmapStatistics"in r&&!r.updating&&!e.filter)return await r.queryHeatmapStatistics({field:e.field,radius:e.radius})}catch{o(s)}const{featuresJSON:n,graphics:l}=await this._processStatsFromMemoryParams({...e,returnGeometry:!0}),u=new f({extent:t.extent,tolerance:"2d"===t.type?t.state.resolution:t.pixelSizeAt?.(t.center)}),p={field:r,radius:a,transform:m(u),spatialReference:t.spatialReference?.toJSON(),size:t.size};return n?.length||l?.length?n?this.workerClient.heatmapStatistics(p,n):F({attribute:p,features:l}):{min:null,max:null}}getField(e=""){return this.layer.getField(e)}getFieldUsageInfo(e){return this.getField(e)?{supportsLabelingInfo:!0,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:!0,supportsStatistics:!0}:null}getFieldDomain(e,t){return this.layer.getFieldDomain(e,t)}createQuery(){return this.layer.createQuery()}async summaryStatistics(e){const{field:t,valueExpression:a,sqlExpression:i,features:s,view:o}=e,n=t?this.getField(t):null,l=!!a,u="3d"===o?.type;if(!a&&i&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return l||s||u?this._summaryStatsFromMemory(e,n):this._summaryStatsFromClientQuery(e,n)}async uniqueValues(e){const{valueExpression:t,sqlExpression:a,features:i,view:s}=e,o=await J(e,this),n=!!t,l="3d"===s?.type;if(!t&&a&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return n||i||l?this._uvFromMemory(e,o):this._uvFromClientQuery(e,o)}async histogram(e){const{features:t,valueExpression:a,normalizationType:i,sqlExpression:s}=e,o=t||!!a;if(!a&&s&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return o||i?this._histogramFromMemory(e):this._histogramForField(e)}async classBreaks(e){return!1!==e.analyzeData?this._classBreaksFromMemory(e):this._classBreaksFromInterpolation(e)}async queryFeatureCount(e){const{whereClause:t,view:a,signal:i}=e;if(!a)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=this.layer.createQuery();s.where=S(s.where,t);const o=await a.whenLayerView(this.layer);return await n(()=>!o.updating,i),o.queryFeatureCount(s,{signal:i})}async generateRenderer(e,t){throw new r(`${this.adapterName}:not-supported`,"Layer does not support generateRenderer operation")}async predominantCategories(e){const{fields:t,view:r,signal:a,filter:i}=e,s=c(t),o=await this._uvFromMemory({valueExpression:s,view:r,signal:a,filter:i});return B(o.uniqueValueInfos,t)}async heatmapStatistics(e){return this._heatmapStatsFromMemory(e)}async getSampleFeatures(e,a){const{view:i,sampleSize:s,requiredFields:o,returnGeometry:n,sqlWhere:l,filter:u,signal:m}=e,p=this.layer.createQuery(),y=1;if(p.outSpatialReference=i?.spatialReference,p.returnGeometry=!!n,p.outFields=o,p.where=S(p.where,l),I(p,u),!i)throw new r(`${this.adapterName}:not-supported`,"view is required to get sample features for Layer");const f=await i.whenLayerView(this.layer);if(b(this,o,f).length)throw new r(`${this.adapterName}:not-supported`,"Required fields need to be passed in the outFields for Layer");const c=await this._fetchFeaturesFromMemory(f,p,m,a),d=null!=s&&s>0&&s<=c.length?s:c.length;return t(c,d,y)}load(e){const t=this.layer.load(e).then(async t=>{this.geometryType=t.geometryType,this.objectIdField=t.objectIdField,this.supportsSQLExpression="stream"===t.type||!!t.capabilities?.query?.supportsSqlExpression,this.minScale=t.minScale,this.maxScale=t.maxScale,this.fullExtent="fullExtent"in t?t.fullExtent:t.parent?.fullExtent,this._hasLocalSource=!1,this.hasQueryEngine=!0,this.workerClient=q.getInstance(),await this.workerClient.open(e.signal)});return this.addResolvingPromise(t),Promise.resolve(this)}};e([l({readOnly:!0})],D.prototype,"adapterName",void 0),e([l({constructOnly:!0})],D.prototype,"layer",void 0),D=e([u("esri.smartMapping.support.adapters.InMemoryLayerAdapter")],D);export{D as default};
2
+ import{__decorate as e}from"tslib";import{pickRandom as t}from"../../../core/arrayUtils.js";import r from"../../../core/Error.js";import a from"../../../core/Logger.js";import{assertIsSome as i}from"../../../core/maybe.js";import{timeout as s,throwIfAborted as o}from"../../../core/promiseUtils.js";import{whenOnce as n}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{toQuantizationTransform as m}from"../../../geometry/support/quantizationUtils.js";import{kebabDict as p}from"../../../layers/support/fieldType.js";import{isTimeOnlyField as y}from"../../../layers/support/fieldUtils.js";import f from"../../../rest/support/QuantizationParameters.js";import{getArcadeForPredominantCategory as c}from"../../statistics/support/predominanceUtils.js";import{summaryStatistics as d,uniqueValues as h,histogram as w,classBreaks as g,heatmapStatistics as F}from"../../statistics/support/statsWorker.js";import{mergeWhereClauses as S}from"../../statistics/support/utils.js";import{WorkerClient as q}from"../../statistics/support/WorkerClient.js";import{getFieldsList as v,isAnyDateField as x,getFieldsFromWhereClauses as V,fieldDelimiter as _}from"../utils.js";import z from"./LayerAdapter.js";import{getHistogramAttributeDefinition as T,getAttributeBinsQuery as N,processQueryAttributeBinsResult as M}from"./support/histogramUtils.js";import{ensureFeaturesJSON as L,getSummaryStatsQuery as E,getSummaryStatisticsFromFeatureSet as C,getViewInfoParams as j,getMissingFields as b,updateQueryWithFeatureFilter as I,getUVQuery as k,getUniqueValuesFromFeatureSet as O,getBins as Q,getDomainsForFields as J,getPredominantCategoriesFromUVInfos as B}from"./support/utils.js";import{processSummaryStatisticsResult as P,createUVResult as U,resolveCBResult as A}from"../../../statistics/utils.js";import{loadArcade as $}from"../../../support/loadArcade.js";const G=5;let R,D=class extends z{constructor(){super(...arguments),this._hasLocalSource=!1,this.adapterName="in-memory-layer-adapter"}destroy(){this.workerClient?.destroy()}async _waitForLayerViewUpdate(e){if(!e)throw new r(`${this.adapterName}:insufficient-data`,"layerView is required to fetch the features");const t=new AbortController,i=n(()=>!e.updating,t.signal);await s(i,5e3,t).catch(e=>{throw a.getLogger(this).warn("LayerView is taking too long to update. Aborting fetch from layerView."),e})}async _fetchFeatureSetFromMemory(e,t,a){const i=this.layer;if(this._hasLocalSource&&"queryFeatures"in i)return i.queryFeatures(e);if(!t)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=await t.whenLayerView(this.layer);return await this._waitForLayerViewUpdate(s),s.queryFeatures(e,{signal:a})}async _fetchFeaturesFromMemory(e,t,a,i){const s=this.layer,o="json"===i;if(this._hasLocalSource&&"queryFeatures"in s){const e=await s.queryFeatures(t);return o?L(e.features):e.features}if(await this._waitForLayerViewUpdate(e),o&&"queryFeaturesJSON"in e&&e.queryFeaturesJSON){const{features:r}=await e.queryFeaturesJSON(t,{signal:a});return r}if(!("queryFeatures"in e))throw new r(`${this.adapterName}:not-supported`,"'queryFeatures' is not supported on the layerView");const n=await e.queryFeatures(t,{signal:a});return o?L(n.features):n.features}_fetchFeaturesForStats(e,t){return v({field:e.field,field2:e.field2,field3:e.field3,normalizationField:e.normalizationField,valueExpression:e.valueExpression,fields:e.fields}).then(r=>this.getSampleFeatures({sampleSize:-1,view:e.view,returnGeometry:e.returnGeometry,filter:e.filter,requiredFields:r,sqlWhere:e.sqlWhere,signal:e.signal},t))}async _summaryStatsFromClientQuery(e,t){const{view:r,signal:a}=e,i=E(this,e,t),s=await this._fetchFeatureSetFromMemory(i,r,a),o=C(s,x(t)||y(t));return P(o,e.outStatisticTypes)}async _getNormalizationTotalFromMemory(e,t,a){const{featuresJSON:i,graphics:s,layerView:o,query:n}=t,l={include:["sum"]},u=(!i&&!s&&o&&"querySummaryStatistics"in o?await o.querySummaryStatistics(n,{field:e},{signal:a}):i?await this.workerClient.summaryStatistics({field:e,outStatisticTypes:l},i):await d({attribute:{field:e,outStatisticTypes:l},features:s??[]})).sum;if(null==u)throw new r(`${this.adapterName}:invalid`,"invalid normalizationTotal");return u}async _summaryStatsFromMemory(e,t){const{view:r,field:a,valueExpression:i,normalizationType:s,signal:o}=e,n={field:a,valueExpression:i,normalizationType:s,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,outStatisticTypes:e.outStatisticTypes},{featuresJSON:l,graphics:u,layerView:m,query:y,fieldInfos:f}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"querySummaryStatistics"});return i&&r&&(l||u)&&(n.fieldType=t?.type?p.toJSON(t.type):null,n.viewInfoParams=j(r),n.timeZone=r.timeZone,n.fieldInfos=f),"percent-of-total"===s&&null==e.normalizationTotal&&(n.normalizationTotal=await this._getNormalizationTotalFromMemory(a,{featuresJSON:l,graphics:u,layerView:m,query:y},o)),!l&&!u&&m&&"querySummaryStatistics"in m?m.querySummaryStatistics(y,n,{signal:o}):l?this.workerClient.summaryStatistics(n,l):d({attribute:n,features:u})}async _getFilteredFeatures(e,t){let r=e;const a=t?.geometry;if("intersects"===t?.spatialRelationship&&a){const t=await import("../../../geometry/operators/intersectionOperator.js");r=e.filter(({geometry:e})=>!(!e||!t.execute(e,a)))}return e.length&&"declaredClass"in e[0]&&"esri.Graphic"===e[0].declaredClass?{graphics:r}:{featuresJSON:r}}async _processStatsFromMemoryParams(e){const{features:t,filter:r}=e;if(t?.length)return this._getFilteredFeatures(t,r);const{view:a,field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,sqlExpression:u,sqlWhere:m,layerViewFunc:p,signal:y}=e;let f=e.returnGeometry;if(null==f&&l){if(!R){const{arcadeUtils:e}=await $();R=e}const e=R.hasGeometryOperations(l);e&&await R.enableGeometryOperations(),f=e}let c=null,d=null,h=null,w=null,g=null;if(a)try{const e="subtype-sublayer"===this.layer.type?this.layer.parent:this.layer;c=await a.whenLayerView(e),d=null!=p&&null!=c&&p in c&&"function"==typeof c[p]}catch{d=!1}if(d)try{await this._waitForLayerViewUpdate(c);const e=await v({field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,fields:await V([u,m],this.layer.fieldsIndex)});b(this,e,c).length?d=!1:(h=this.layer.createQuery(),h.outFields=e,h.returnGeometry=!1,h.where=S(h.where,m),I(h,r)),c.suspended&&(d=!1)}catch{d=!1}return d||(w=await this._fetchFeaturesForStats({field:i,field2:s,field3:o,fields:await V([u,m],this.layer.fieldsIndex),valueExpression:l,normalizationField:n,returnGeometry:f,filter:r,sqlWhere:m,view:a,signal:y},"json"),g=(await v({valueExpression:l})).map(e=>this.getField(e)?.toJSON()).filter(Boolean)),{layerView:c,query:h,featuresJSON:w,fieldInfos:g}}async _uvFromClientQuery(e,t){const{view:r,signal:a}=e,i=k(this,e),s=await this._fetchFeatureSetFromMemory(i,r,a),o=await O(s,{layer:this,field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:_,view:e.view,signal:e.signal});return U(o,t,e.returnAllCodedValues,_)}async _uvFromMemory(e,t){const{view:r,field:a,valueExpression:i,returnAllCodedValues:s,signal:o}=e,{featuresJSON:n,graphics:l,layerView:u,query:m,fieldInfos:p}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryUniqueValues"}),y={field:a,field2:e.field2,field3:e.field3,fieldDelimiter:_,valueExpression:i,domains:t,returnAllCodedValues:s};return i&&r&&(n||l)&&(y.viewInfoParams=j(r),y.timeZone=r.timeZone,y.fieldInfos=p),!n&&!l&&u&&"queryUniqueValues"in u?u.queryUniqueValues(m,y,{signal:o}):n?this.workerClient.uniqueValues(y,n):h({attribute:y,features:l})}_histogramForField(e){let t=null;return t=null!=e.minValue&&null!=e.maxValue?Promise.resolve({min:e.minValue,max:e.maxValue}):this.summaryStatistics({...e,outStatisticTypes:{include:["min","max","count"]}}).then(e=>{if(!e.count)throw new r(`${this.adapterName}:insufficient-data`,"Either the layer has no features or none of the features have data for the field");return{min:e.min,max:e.max}}),t.then(t=>Q(this,{min:t.min,max:t.max},e.field,e.numBins??void 0,e.view,e.filter,e.signal))}async _histogramFromQueryAttributeBinsFromMemory(e){const{field:t,normalizationType:r,signal:a}=e,i=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAttributeBins"}),{featuresJSON:s,graphics:o,layerView:n,query:l}=i,u="percent-of-total"===r?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,i,a):void 0;if(!n||!("queryAttributeBins"in n)||s||o){const t=T(e,i,u);return s?this.workerClient.histogram(t,s):w({attribute:t,features:o})}const{query:m,min:p,max:y}=await N(e,this,u,l);if(!m)return{bins:[],minValue:p,maxValue:y,normalizationTotal:u};const f=await n.queryAttributeBins(m,{signal:a});return M(f,t?this.getField(t):null,{minValue:p,maxValue:y,normalizationTotal:u})}async _histogramFromMemory(e){const{field:t,signal:r}=e,a=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryHistogram"}),{featuresJSON:i,graphics:s,layerView:o,query:n}=a,l="percent-of-total"===e.normalizationType?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,a,r):void 0,u=T(e,a,l);return!i&&!s&&o&&"queryHistogram"in o?o.queryHistogram(n,u,{signal:r}):i?this.workerClient.histogram(u,i):w({attribute:u,features:s})}_classBreaksFromInterpolation(e){const{minValue:t,maxValue:r}=e,a=e.numClasses||G,i=[],s=(r-t)/a;for(let l=0;l<a;l++){const e=t+l*s;i.push({minValue:e,maxValue:e+s})}i[a-1].maxValue=r;const o={classBreaks:i,normalizationTotal:e.normalizationTotal},n=A(o,e.classificationMethod);return Promise.resolve(n)}async _classBreaksFromMemory(e){const{view:t,field:r,valueExpression:a,signal:i}=e,{featuresJSON:s,graphics:o,layerView:n,query:l,fieldInfos:u}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryClassBreaks"}),m={field:r,valueExpression:a,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numClasses:e.numClasses};return a&&t&&(s||o)&&(m.viewInfoParams=j(t),m.timeZone=t.timeZone,m.fieldInfos=u),"percent-of-total"===e.normalizationType&&null==e.normalizationTotal&&(m.normalizationTotal=await this._getNormalizationTotalFromMemory(r,{featuresJSON:s,graphics:o,layerView:n,query:l},i)),!s&&!o&&n&&"queryClassBreaks"in n?n.queryClassBreaks(l,m,{signal:i}):s?this.workerClient.classBreaks(m,s):g({attribute:m,features:o})}async _heatmapStatsFromMemory(e){const{view:t,field:r,radius:a,signal:s}=e;i(t,"InMemoryLayerAdapter: must have a view");try{const r=await t.whenLayerView(this.layer);if("queryHeatmapStatistics"in r&&!r.updating&&!e.filter)return await r.queryHeatmapStatistics({field:e.field,radius:e.radius})}catch{o(s)}const{featuresJSON:n,graphics:l}=await this._processStatsFromMemoryParams({...e,returnGeometry:!0}),u=new f({extent:t.extent,tolerance:"2d"===t.type?t.state.resolution:t.pixelSizeAt?.(t.center)}),p={field:r,radius:a,transform:m(u),spatialReference:t.spatialReference?.toJSON(),size:t.size};return n?.length||l?.length?n?this.workerClient.heatmapStatistics(p,n):F({attribute:p,features:l}):{min:null,max:null}}getField(e=""){return this.layer.getField(e)}getFieldUsageInfo(e){return this.getField(e)?{supportsLabelingInfo:!0,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:!0,supportsStatistics:!0}:null}getFieldDomain(e,t){return this.layer.getFieldDomain(e,t)}createQuery(){return this.layer.createQuery()}async summaryStatistics(e){const{field:t,valueExpression:a,sqlExpression:i,features:s,view:o}=e,n=t?this.getField(t):null,l=!!a,u="3d"===o?.type;if(!a&&i&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return l||s||u?this._summaryStatsFromMemory(e,n):this._summaryStatsFromClientQuery(e,n)}async uniqueValues(e){const{valueExpression:t,sqlExpression:a,features:i,view:s}=e,o=await J(e,this),n=!!t,l="3d"===s?.type;if(!t&&a&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return n||i||l?this._uvFromMemory(e,o):this._uvFromClientQuery(e,o)}async histogram(e){const{features:t,valueExpression:a,normalizationType:i,sqlExpression:s}=e,o=t||!!a;if(!a&&s&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return o||i?this._histogramFromMemory(e):this._histogramForField(e)}async classBreaks(e){return!1!==e.analyzeData?this._classBreaksFromMemory(e):this._classBreaksFromInterpolation(e)}async queryFeatureCount(e){const{whereClause:t,view:a,signal:i}=e;if(!a)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=this.layer.createQuery();s.where=S(s.where,t);const o=await a.whenLayerView(this.layer);return await n(()=>!o.updating,i),o.queryFeatureCount(s,{signal:i})}async generateRenderer(e,t){throw new r(`${this.adapterName}:not-supported`,"Layer does not support generateRenderer operation")}async predominantCategories(e){const{fields:t,view:r,signal:a,filter:i}=e,s=c(t),o=await this._uvFromMemory({valueExpression:s,view:r,signal:a,filter:i});return B(o.uniqueValueInfos,t)}async heatmapStatistics(e){return this._heatmapStatsFromMemory(e)}async getSampleFeatures(e,a){const{view:i,sampleSize:s,requiredFields:o,returnGeometry:n,sqlWhere:l,filter:u,signal:m}=e,p=this.layer.createQuery(),y=1;if(p.outSpatialReference=i?.spatialReference,p.returnGeometry=!!n,p.outFields=o,p.where=S(p.where,l),I(p,u),!i)throw new r(`${this.adapterName}:not-supported`,"view is required to get sample features for Layer");const f=await i.whenLayerView(this.layer);if(b(this,o,f).length)throw new r(`${this.adapterName}:not-supported`,"Required fields need to be passed in the outFields for Layer");const c=await this._fetchFeaturesFromMemory(f,p,m,a),d=null!=s&&s>0&&s<=c.length?s:c.length;return t(c,d,y)}load(e){const t=this.layer.load(e).then(async t=>{this.geometryType=t.geometryType,this.objectIdField=t.objectIdField,this.supportsSQLExpression="stream"===t.type||!!t.capabilities?.query?.supportsSqlExpression,this.minScale=t.minScale,this.maxScale=t.maxScale,this.fullExtent="fullExtent"in t?t.fullExtent:t.parent?.fullExtent,this._hasLocalSource=!1,this.hasQueryEngine=!0,this.workerClient=q.getInstance(),await this.workerClient.open(e.signal)});return this.addResolvingPromise(t),Promise.resolve(this)}};e([l({readOnly:!0})],D.prototype,"adapterName",void 0),e([l({constructOnly:!0})],D.prototype,"layer",void 0),D=e([u("esri.smartMapping.support.adapters.InMemoryLayerAdapter")],D);export{D as default};