@arcgis/core 5.1.0-next.74 → 5.1.0-next.76

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 (254) hide show
  1. package/arcade/ArcadePortal.js +1 -1
  2. package/arcade/functions/aiServices.js +1 -1
  3. package/arcade/functions/featuresetbase.js +1 -1
  4. package/arcade/functions/geomasync.js +1 -1
  5. package/arcade/functions/knowledgegraph.js +1 -1
  6. package/arcade/functions/string.js +1 -1
  7. package/arcade/languageUtils.js +1 -1
  8. package/arcade/portalUtils.js +1 -1
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/07aca5ecad659d55e795.js +2 -0
  11. package/assets/esri/core/workers/chunks/09630888267cde87654f.js +1 -0
  12. package/assets/esri/core/workers/chunks/0fa207c68dfd7ddee160.js +1 -0
  13. package/assets/esri/core/workers/chunks/146424b5717d0a645ee1.js +1 -0
  14. package/assets/esri/core/workers/chunks/{d00dafad202450e6ee2e.js → 14eb2cc8e2ad6d8d03fd.js} +1 -1
  15. package/assets/esri/core/workers/chunks/1765dfeac20e34ce25b7.js +1 -0
  16. package/assets/esri/core/workers/chunks/176dd195f77b98cb0b0f.js +1 -0
  17. package/assets/esri/core/workers/chunks/1906416c84bab369bbd6.js +1 -0
  18. package/assets/esri/core/workers/chunks/{b98c24229463029504e8.js → 1f6b7626f333809837ef.js} +1 -1
  19. package/assets/esri/core/workers/chunks/1ff3c15a51c4dc991806.js +1 -0
  20. package/assets/esri/core/workers/chunks/2a2e97918524e0f436d7.js +1 -0
  21. package/assets/esri/core/workers/chunks/2b0b398180ed98c2c84c.js +1 -0
  22. package/assets/esri/core/workers/chunks/{bab23b905678e42815e5.js → 312036c89a6a09bb06c2.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{37091cf498a16ccad7ff.js → 330b47ac0759c3c35cc5.js} +1 -1
  24. package/assets/esri/core/workers/chunks/34b6b5dd415c68f0b0d1.js +1 -0
  25. package/assets/esri/core/workers/chunks/{a270960d80d8344dd75f.js → 34ea3ed78041437a8fc8.js} +1 -1
  26. package/assets/esri/core/workers/chunks/384c235d36f32769e32b.js +1 -0
  27. package/assets/esri/core/workers/chunks/3a183259805638c25363.js +1 -0
  28. package/assets/esri/core/workers/chunks/{deaca3cd202851ecf9c2.js → 3cce9dad8ee0e4971d50.js} +1 -1
  29. package/assets/esri/core/workers/chunks/3efbb684c0409955186d.js +1 -0
  30. package/assets/esri/core/workers/chunks/40d251b6b42a41d68bd2.js +1 -0
  31. package/assets/esri/core/workers/chunks/42336e0d1ef88737b078.js +1 -0
  32. package/assets/esri/core/workers/chunks/47b3a5213539548ff3a6.js +1 -0
  33. package/assets/esri/core/workers/chunks/4a23b27bfbcfa08fd9a7.js +1 -0
  34. package/assets/esri/core/workers/chunks/52b3a11c962810bc6dbe.js +1 -0
  35. package/assets/esri/core/workers/chunks/53750e85f3128993a43a.js +1 -0
  36. package/assets/esri/core/workers/chunks/{4bbe684050b3b04681d0.js → 537fe2522dff1e6ce03b.js} +1 -1
  37. package/assets/esri/core/workers/chunks/55fd201ca5e10c6e4761.js +1 -0
  38. package/assets/esri/core/workers/chunks/56941e8bbd2d49bf2656.js +1 -0
  39. package/assets/esri/core/workers/chunks/5d8e944b192aad4cf986.js +1 -0
  40. package/assets/esri/core/workers/chunks/{5476c2f7b83f4ccd0335.js → 5e1b847b116d21908a54.js} +1 -1
  41. package/assets/esri/core/workers/chunks/5ed8d8b5336c81fbcda3.js +1 -0
  42. package/assets/esri/core/workers/chunks/60915a3708a34da1977e.js +1 -0
  43. package/assets/esri/core/workers/chunks/61c523dd9d8027922465.js +1 -0
  44. package/assets/esri/core/workers/chunks/65c61171e6c6be5c5c2f.js +1 -0
  45. package/assets/esri/core/workers/chunks/6a3d207308b29651f397.js +1 -0
  46. package/assets/esri/core/workers/chunks/6c35583707f5c339ee99.js +1 -0
  47. package/assets/esri/core/workers/chunks/702e8468836863abd81b.js +1 -0
  48. package/assets/esri/core/workers/chunks/7540f7df86620f067b5a.js +1 -0
  49. package/assets/esri/core/workers/chunks/76e34f81bb4a7b0e694c.js +1 -0
  50. package/assets/esri/core/workers/chunks/7b6c8be59ed87e386aa4.js +1 -0
  51. package/assets/esri/core/workers/chunks/7c820c5f6f05480d5050.js +1 -0
  52. package/assets/esri/core/workers/chunks/80f4f686ce403cb2693f.js +1 -0
  53. package/assets/esri/core/workers/chunks/852f4cd514008fee5a55.js +1 -0
  54. package/assets/esri/core/workers/chunks/8a3bff0f58483c1665f9.js +1 -0
  55. package/assets/esri/core/workers/chunks/8b046e28f879079caada.js +1 -0
  56. package/assets/esri/core/workers/chunks/8d738e9acc2f222235ea.js +1 -0
  57. package/assets/esri/core/workers/chunks/9103eb0b9078019d3a26.js +1 -0
  58. package/assets/esri/core/workers/chunks/915e2711d3a2cfa402b2.js +1 -0
  59. package/assets/esri/core/workers/chunks/91f9e0e3662d4bf9f163.js +1 -0
  60. package/assets/esri/core/workers/chunks/99c161fecae710b53b40.js +1 -0
  61. package/assets/esri/core/workers/chunks/99d298d0039c536fcf3e.js +1 -0
  62. package/assets/esri/core/workers/chunks/9a5ef33d99a8f89956ff.js +1 -0
  63. package/assets/esri/core/workers/chunks/9d10db72e342fe63c981.js +1 -0
  64. package/assets/esri/core/workers/chunks/{a36761e3122f70fbb3c9.js → 9d6491f996eeb0c646ed.js} +1 -1
  65. package/assets/esri/core/workers/chunks/a015c2f54eb91e43a1f4.js +1 -0
  66. package/assets/esri/core/workers/chunks/a242ec19a7508de436da.js +1 -0
  67. package/assets/esri/core/workers/chunks/a320998f18922a35899f.js +1 -0
  68. package/assets/esri/core/workers/chunks/a7f9f478bd1493fc3c76.js +1 -0
  69. package/assets/esri/core/workers/chunks/aac6a57edd7494125204.js +1 -0
  70. package/assets/esri/core/workers/chunks/b73c146d3e550eaf07eb.js +1 -0
  71. package/assets/esri/core/workers/chunks/b7af0e6b9aadbcaf6a0b.js +1 -0
  72. package/assets/esri/core/workers/chunks/b803e7b0d489bb628d72.js +1 -0
  73. package/assets/esri/core/workers/chunks/baeb96aef03d4c566af7.js +1 -0
  74. package/assets/esri/core/workers/chunks/bc75ab48f4c7609ef09d.js +1 -0
  75. package/assets/esri/core/workers/chunks/bc78937986854e500b8e.js +1 -0
  76. package/assets/esri/core/workers/chunks/bd10d21545bca9a49de0.js +1 -0
  77. package/assets/esri/core/workers/chunks/{b905e637a67fbb7af4ae.js → bf8f603848bad4a7deb4.js} +1 -1
  78. package/assets/esri/core/workers/chunks/bfe575da727ce7c8d331.js +2 -0
  79. package/assets/esri/core/workers/chunks/c31ee5617c61a933cb0e.js +1 -0
  80. package/assets/esri/core/workers/chunks/cb45e5d4a4ef82cda583.js +1 -0
  81. package/assets/esri/core/workers/chunks/ce7ef7c4ca14d66d96f6.js +1 -0
  82. package/assets/esri/core/workers/chunks/{5b324e572737a308500d.js → cf14b3a44705dacefac4.js} +1 -1
  83. package/assets/esri/core/workers/chunks/d3b086eb9aa8c7d09048.js +1 -0
  84. package/assets/esri/core/workers/chunks/d55cef8199b8246fea3f.js +1 -0
  85. package/assets/esri/core/workers/chunks/d8decaee2c780e1b5e35.js +1 -0
  86. package/assets/esri/core/workers/chunks/{41809c16544ec25120fa.js → d95ffd990b3a7df69e1e.js} +1 -1
  87. package/assets/esri/core/workers/chunks/dc54d4a9fe1691862356.js +1 -0
  88. package/assets/esri/core/workers/chunks/dda2cb5c073d1e65f14f.js +1 -0
  89. package/assets/esri/core/workers/chunks/e18badd11f360cc2912b.js +1 -0
  90. package/assets/esri/core/workers/chunks/{ad064583f8a836005098.js → e262c4864dc06c43b380.js} +1 -1
  91. package/assets/esri/core/workers/chunks/e610d24539a675fb054b.js +1 -0
  92. package/assets/esri/core/workers/chunks/e9c5c295b6bf10e942a4.js +1 -0
  93. package/assets/esri/core/workers/chunks/ea59b81299acaf0d85ee.js +1 -0
  94. package/assets/esri/core/workers/chunks/{873c1b705ac3d4e6c384.js → ea97619a4470f1540b99.js} +1 -1
  95. package/assets/esri/core/workers/chunks/eaab5ac049622986e3bc.js +1 -0
  96. package/assets/esri/core/workers/chunks/edee616b6f1b5be8fd39.js +1 -0
  97. package/assets/esri/core/workers/chunks/ef0085aa743b33cb549f.js +1 -0
  98. package/assets/esri/core/workers/chunks/f0250cecb243b32cdba7.js +1 -0
  99. package/assets/esri/core/workers/chunks/f518835b2dc89a48cfb1.js +1 -0
  100. package/assets/esri/core/workers/chunks/f6c8e93ca2987e83f925.js +1 -0
  101. package/assets/esri/themes/base/widgets/_Sketch.scss +32 -0
  102. package/assets/esri/themes/dark/main.css +1 -1
  103. package/assets/esri/themes/light/main.css +1 -1
  104. package/assets/esri/themes/light/view.css +1 -1
  105. package/assets/esri/widgets/Sketch/t9n/Sketch.json +1 -1
  106. package/assets/esri/widgets/Sketch/t9n/Sketch_en.json +1 -1
  107. package/chunks/MultiPathImpl.js +1 -1
  108. package/chunks/Point2D.js +1 -1
  109. package/chunks/SpatialReference.js +1 -1
  110. package/chunks/aiServices.js +1 -1
  111. package/chunks/languageUtils.js +1 -1
  112. package/config.js +1 -1
  113. package/core/workers/registry.js +1 -1
  114. package/form/elements/AttachmentElement.d.ts +15 -16
  115. package/form/elements/GroupElement.d.ts +3 -2
  116. package/form/elements/inputs/attachments/AttachmentInput.d.ts +7 -9
  117. package/form/elements/inputs/attachments/AudioInput.d.ts +6 -8
  118. package/form/elements/inputs/attachments/DocumentInput.d.ts +5 -7
  119. package/form/elements/inputs/attachments/ImageInput.d.ts +6 -8
  120. package/form/elements/inputs/attachments/Input.d.ts +2 -6
  121. package/form/elements/inputs/attachments/SignatureInput.d.ts +5 -7
  122. package/form/elements/inputs/attachments/VideoInput.d.ts +6 -8
  123. package/form/elements/inputs/attachments/types.d.ts +3 -3
  124. package/geometry/FlatGeometry.js +1 -1
  125. package/geometry/operators/projectOperator.js +1 -1
  126. package/graphic/ImageryGraphicOrigin.js +1 -1
  127. package/graphic/ImageryTileGraphicOrigin.js +1 -1
  128. package/graphic/WCSGraphicOrigin.js +1 -1
  129. package/kernel.js +1 -1
  130. package/layers/mixins/ArcGISImageService.js +1 -1
  131. package/package.json +4 -4
  132. package/popup/Features.js +1 -1
  133. package/support/revision.js +1 -1
  134. package/symbols/cim/CIMSymbolHelper.js +1 -1
  135. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  136. package/symbols/support/previewCIMSymbol.js +1 -1
  137. package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +1 -1
  138. package/views/2d/engine/webgl/TextureManager.js +1 -1
  139. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  140. package/views/2d/layers/MediaLayerView2D.js +1 -1
  141. package/views/2d/layers/TileLayerView2D.js +1 -1
  142. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  143. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  144. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  145. package/views/3d/analysis/Dimension/DimensionController.js +1 -1
  146. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
  147. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  148. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  149. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  150. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentMove.js +1 -1
  151. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  152. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  153. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  154. package/views/VideoView.js +1 -1
  155. package/views/draw/DrawGraphicTool.js +1 -1
  156. package/views/draw/DrawTool.js +1 -1
  157. package/views/draw/support/Box.js +1 -1
  158. package/views/draw/support/Reshape.js +1 -1
  159. package/views/draw/support/managers/MeasurementManager.js +1 -1
  160. package/views/interactive/SegmentLabels.js +1 -1
  161. package/views/interactive/snapping/SelfSnappingEngine.js +1 -1
  162. package/views/support/GeometryWorker.js +2 -0
  163. package/views/support/GeometryWorkerHandle.js +2 -0
  164. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +1 -3
  165. package/widgets/FeatureTable/Grid/GridViewModel.d.ts +2 -11
  166. package/widgets/FeatureTable/support/types.d.ts +2 -1
  167. package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.d.ts +28 -0
  168. package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
  169. package/widgets/OrientedImageryViewer.d.ts +27 -0
  170. package/widgets/Sketch/SketchViewModel.d.ts +10 -2
  171. package/widgets/Sketch/SketchViewModel.js +1 -1
  172. package/widgets/Sketch/support/ResponsiveToolbar/MeasuredContentGroup.js +1 -1
  173. package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
  174. package/widgets/Sketch.js +1 -1
  175. package/assets/esri/core/workers/chunks/00bae4b7e179336e0362.js +0 -1
  176. package/assets/esri/core/workers/chunks/041c372e98a6fba90b36.js +0 -1
  177. package/assets/esri/core/workers/chunks/0783890816bac45277b9.js +0 -1
  178. package/assets/esri/core/workers/chunks/07aac6245a0d1adbb2d4.js +0 -1
  179. package/assets/esri/core/workers/chunks/1286f41f245ef22b3a26.js +0 -1
  180. package/assets/esri/core/workers/chunks/12e575a6d2b008b8fc2b.js +0 -1
  181. package/assets/esri/core/workers/chunks/161d60fdac2013c15543.js +0 -1
  182. package/assets/esri/core/workers/chunks/168de44a789d1cecc1f8.js +0 -1
  183. package/assets/esri/core/workers/chunks/1d9d7915cf7449e5d468.js +0 -1
  184. package/assets/esri/core/workers/chunks/1db1656a033f3992f0d6.js +0 -1
  185. package/assets/esri/core/workers/chunks/235cb82952a18ff8d206.js +0 -1
  186. package/assets/esri/core/workers/chunks/27b80c386cebadcaca3c.js +0 -1
  187. package/assets/esri/core/workers/chunks/29d3890a5a43d934067a.js +0 -1
  188. package/assets/esri/core/workers/chunks/2f17438d215bea3ce70f.js +0 -1
  189. package/assets/esri/core/workers/chunks/356cb86606b8c674f947.js +0 -1
  190. package/assets/esri/core/workers/chunks/398e0dd2bc7e1ab84831.js +0 -1
  191. package/assets/esri/core/workers/chunks/3b1052aa30af3f6186cc.js +0 -1
  192. package/assets/esri/core/workers/chunks/3e87e3ad857d72f6ecbb.js +0 -1
  193. package/assets/esri/core/workers/chunks/42e483fde18f12da32a6.js +0 -1
  194. package/assets/esri/core/workers/chunks/43ab44d37bc0ea97ef98.js +0 -1
  195. package/assets/esri/core/workers/chunks/488ed9584b527ec47be3.js +0 -1
  196. package/assets/esri/core/workers/chunks/4ad32580e0c0699fde1f.js +0 -1
  197. package/assets/esri/core/workers/chunks/4c13869d260a902d3014.js +0 -1
  198. package/assets/esri/core/workers/chunks/54ed37ec9682ea739deb.js +0 -1
  199. package/assets/esri/core/workers/chunks/5511e640e171c294f52a.js +0 -2
  200. package/assets/esri/core/workers/chunks/55369c5bd65bcaf78da1.js +0 -1
  201. package/assets/esri/core/workers/chunks/56fd3da911c2c4511e5d.js +0 -1
  202. package/assets/esri/core/workers/chunks/59592bb25f226865e88a.js +0 -1
  203. package/assets/esri/core/workers/chunks/5d55b4449bcb24cd72b6.js +0 -1
  204. package/assets/esri/core/workers/chunks/5d8fe41a3c06ddb4094b.js +0 -1
  205. package/assets/esri/core/workers/chunks/608d707fd9d9f9088473.js +0 -1
  206. package/assets/esri/core/workers/chunks/6a21c9a4aeebe806ea39.js +0 -1
  207. package/assets/esri/core/workers/chunks/6c7ff968bd4fc816442d.js +0 -1
  208. package/assets/esri/core/workers/chunks/6d11ec355e5474b2968b.js +0 -1
  209. package/assets/esri/core/workers/chunks/6d25230dd85a4ba54c4f.js +0 -1
  210. package/assets/esri/core/workers/chunks/7027d93dc5a4595d70c6.js +0 -1
  211. package/assets/esri/core/workers/chunks/70b35b2446558d5280e3.js +0 -1
  212. package/assets/esri/core/workers/chunks/7349cb45a93e6916f115.js +0 -1
  213. package/assets/esri/core/workers/chunks/76edaeaf8fe344bb77a8.js +0 -1
  214. package/assets/esri/core/workers/chunks/76fe5b821d6b54db5721.js +0 -1
  215. package/assets/esri/core/workers/chunks/7951d93f5f15aa76f49c.js +0 -1
  216. package/assets/esri/core/workers/chunks/7a56c836c89a8b978800.js +0 -1
  217. package/assets/esri/core/workers/chunks/81d30c9062ad0120a863.js +0 -1
  218. package/assets/esri/core/workers/chunks/88c5f7c712c6b89b5109.js +0 -1
  219. package/assets/esri/core/workers/chunks/88e469b82d2594f23649.js +0 -1
  220. package/assets/esri/core/workers/chunks/8a8242e7cc7e6a9e7876.js +0 -1
  221. package/assets/esri/core/workers/chunks/9444ed8ea117861ae89b.js +0 -1
  222. package/assets/esri/core/workers/chunks/9a38fd68b02b617c45d3.js +0 -1
  223. package/assets/esri/core/workers/chunks/9be9ccce6369f67202bc.js +0 -1
  224. package/assets/esri/core/workers/chunks/a37c28e3c4a2be9fd1d5.js +0 -1
  225. package/assets/esri/core/workers/chunks/a8d7f59927bdad564141.js +0 -1
  226. package/assets/esri/core/workers/chunks/a94bd20551c1179c7ec5.js +0 -1
  227. package/assets/esri/core/workers/chunks/a9d2c83bb10b5ade0ca0.js +0 -1
  228. package/assets/esri/core/workers/chunks/abe22ae8ee0dcc9efbb7.js +0 -1
  229. package/assets/esri/core/workers/chunks/b702279c48f3009f6dd8.js +0 -1
  230. package/assets/esri/core/workers/chunks/bc887bd62579dba81e2b.js +0 -1
  231. package/assets/esri/core/workers/chunks/be0341567bb19e101a4f.js +0 -1
  232. package/assets/esri/core/workers/chunks/be1d6a571f76933dfbb0.js +0 -1
  233. package/assets/esri/core/workers/chunks/bfcdc5c315131aae34d8.js +0 -1
  234. package/assets/esri/core/workers/chunks/c0f624a2ca0d07ef8f8c.js +0 -1
  235. package/assets/esri/core/workers/chunks/c327fe276238af60fda4.js +0 -1
  236. package/assets/esri/core/workers/chunks/c5f155fe114a2a05aaf2.js +0 -2
  237. package/assets/esri/core/workers/chunks/c61002a117dc2218d6af.js +0 -1
  238. package/assets/esri/core/workers/chunks/c804a66ef7615aa8de89.js +0 -1
  239. package/assets/esri/core/workers/chunks/cb5e4b9b4a59c2622eb5.js +0 -1
  240. package/assets/esri/core/workers/chunks/d201a5dff18a5bb467ab.js +0 -1
  241. package/assets/esri/core/workers/chunks/d21fdd67477800101f3b.js +0 -1
  242. package/assets/esri/core/workers/chunks/db588bf3256e95c977b7.js +0 -1
  243. package/assets/esri/core/workers/chunks/dfdd474fddcd1d6091ce.js +0 -1
  244. package/assets/esri/core/workers/chunks/e235ea4293d5d463acfb.js +0 -1
  245. package/assets/esri/core/workers/chunks/e43486113aaf72ac4dc1.js +0 -1
  246. package/assets/esri/core/workers/chunks/ea4c3393c5757e309a71.js +0 -1
  247. package/assets/esri/core/workers/chunks/ed216ddeb7f59f510bd0.js +0 -1
  248. package/assets/esri/core/workers/chunks/ef8886dff54063928bcb.js +0 -1
  249. package/assets/esri/core/workers/chunks/f43a63094190d2074cd0.js +0 -1
  250. package/assets/esri/core/workers/chunks/f5223ffb3be548c9b0a1.js +0 -1
  251. package/views/support/MeasurementWorker.js +0 -2
  252. package/views/support/MeasurementWorkerHandle.js +0 -2
  253. /package/assets/esri/core/workers/chunks/{5511e640e171c294f52a.js.LICENSE.txt → 07aca5ecad659d55e795.js.LICENSE.txt} +0 -0
  254. /package/assets/esri/core/workers/chunks/{c5f155fe114a2a05aaf2.js.LICENSE.txt → bfe575da727ce7c8d331.js.LICENSE.txt} +0 -0
@@ -1,7 +1,7 @@
1
1
  import type Input from "./Input.js";
2
2
  import type { InputMethod } from "../../../../portal/jsonTypes.js";
3
3
 
4
- /** @internal */
4
+ /** @since 5.1 */
5
5
  export interface VideoInputProperties extends Partial<Pick<VideoInput, "inputMethod" | "maxDuration">> {}
6
6
 
7
7
  /**
@@ -11,8 +11,7 @@ export interface VideoInputProperties extends Partial<Pick<VideoInput, "inputMet
11
11
  * >
12
12
  * > This class is not yet fully supported within the SDK and is not intended for use in development. Support will be added in an upcoming release.
13
13
  *
14
- * @internal
15
- * @since 4.31
14
+ * @since 5.1
16
15
  * @see [VideoInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/VideoInput/)
17
16
  * @example
18
17
  * // Creates a new VideoInput for an attachment element within a form
@@ -22,26 +21,25 @@ export interface VideoInputProperties extends Partial<Pick<VideoInput, "inputMet
22
21
  * });
23
22
  */
24
23
  export default class VideoInput extends Input {
25
- /** @internal */
24
+ /** @since 5.1 */
26
25
  constructor(properties?: VideoInputProperties);
27
26
  /**
28
27
  * The supported input methods used to attach a video.
29
28
  *
30
29
  * @default "any"
31
- * @internal
30
+ * @since 5.1
32
31
  */
33
32
  accessor inputMethod: InputMethod;
34
33
  /**
35
34
  * Defines the maximum length of an attachment for this element in seconds. If not specified, there is no maximum length.
36
35
  *
37
- * @internal
36
+ * @since 5.1
38
37
  */
39
38
  accessor maxDuration: number | null | undefined;
40
39
  /**
41
40
  * The input type identifier. Valid value of this property is "video"
42
41
  *
43
- * @internal
44
- * @since 5.0
42
+ * @since 5.1
45
43
  */
46
44
  get type(): "video";
47
45
  }
@@ -5,11 +5,11 @@ import type ImageInput from "./ImageInput.js";
5
5
  import type SignatureInput from "./SignatureInput.js";
6
6
  import type VideoInput from "./VideoInput.js";
7
7
 
8
- /** @internal */
8
+ /** @since 5.1 */
9
9
  export type AttachmentInputUnion = AttachmentInput | AudioInput | DocumentInput | ImageInput | SignatureInput | VideoInput;
10
10
 
11
- /** @internal */
11
+ /** @since 5.1 */
12
12
  export type AttachmentInputType = AttachmentInputUnion["type"];
13
13
 
14
- /** @internal */
14
+ /** @since 5.1 */
15
15
  export type NestableAttachmentInputUnion = Exclude<AttachmentInputUnion, AttachmentInput>;
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__addDisposableResource as t,__disposeResources as e}from"tslib";import{baseTypedSubArrayMemory as r}from"../core/memoryEstimations.js";import s from"./SpatialReference.js";import{empty as n,expandWithExtent as i}from"./support/aaBoundingBox.js";import{empty as a,expandExtentInPlace as o}from"./support/aaBoundingRect.js";import{isPoint as u,isMultipoint as h,isPolyline as l,isGeometryWithM as c,isGeometryWithZ as g}from"./support/jsonTypeUtils.js";import{equals as f}from"./support/spatialReferenceUtils.js";import{interpolateCircle as m}from"./support/curves/circleUtils.js";import{deriveCircleFromCircularArc as p}from"./support/curves/circularArcUtils.js";import{curveExtent as x}from"./support/curves/curveExtent.js";import{getEndpoint as v,isCurvedGeometry as d,isEllipticArc7 as y,isEllipticArc4 as C,isCircularArc as M,isBezierCurve as E}from"./support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as O}from"./support/curves/ellipticArc4Utils.js";import{deriveEllipse as S,interpolateEllipse as F}from"./support/curves/ellipticArc7Utils.js";import P from"../layers/graphics/OptimizedGeometry.js";class _{constructor({type:t,spatialReference:e,vertexCount:r,vertexXY:s,vertexZ:n,vertexM:i,partCount:a,partOffsets:o,partFlags:u,segmentFlags:h,segmentIndices:l,segmentParams:c,segmentCountArc:g,segmentCountBezier:f}){this.segmentCountArc=0,this.segmentCountBezier=0,this.type=t,this.spatialReference=e,this.vertexCount=r,this.vertexXY=s,this.vertexZ=n,this.vertexM=i,this.partCount=a,this.partOffsets=o,this.partFlags=u,this.segmentFlags=h,this.segmentIndices=l,this.segmentParams=c,this.segmentCountArc=g,this.segmentCountBezier=f}get segmentParamCount(){return 10*this.segmentCountArc+4*this.segmentCountBezier}get segmentCountLine(){const{segmentCount:t,segmentCountArc:e,segmentCountBezier:r}=this;return t&&t-e-r}get segmentCount(){return"polyline"===this.type?this.vertexCount-this.partCount:"polygon"===this.type?this.vertexCount:0}get hasZ(){return null!=this.vertexZ}get hasM(){return null!=this.vertexM}hasCurves(){return null!=this.segmentFlags}isMultipart(){return"polyline"===this.type||"polygon"===this.type}get usedMemory(){function t(t){return t?r+t.byteLength:0}return t(this.vertexXY)+t(this.vertexZ)+t(this.vertexM)+t(this.partOffsets)+t(this.partFlags)+t(this.segmentFlags)+t(this.segmentIndices)+t(this.segmentParams)}clone(){const{type:t,vertexCount:e,partCount:r,hasZ:s,hasM:n,segmentCountArc:i,segmentCountBezier:a}=this,o=U(t,e,r,s,n,this.hasCurves(),i,a);o.spatialReference=this.spatialReference;const{vertexXY:u,vertexZ:h,vertexM:l}=this;if(o.vertexXY.set(u.subarray(0,2*e),0),o.vertexZ?.set(h.subarray(0,e),0),o.vertexM?.set(l.subarray(0,e),0),this.isMultipart()){const{partOffsets:t,partFlags:e}=this;o.partFlags.set(e.subarray(0,r+1)),o.partOffsets.set(t.subarray(0,r+1))}if(this.hasCurves()){const{segmentFlags:t,segmentIndices:r,segmentParams:s,segmentParamCount:n}=this;o.segmentFlags.set(t.subarray(0,e),0),o.segmentIndices.set(r.subarray(0,e),0),o.segmentParams.set(s.subarray(0,n),0)}return o}equals(t){return this.equalsWithinTolerance(t,0)}equalsWithinTolerance(t,e){if(null==t)return!1;if(this===t)return!0;if(!f(this.spatialReference,t.spatialReference))return!1;if(this.vertexCount!==t.vertexCount||this.partCount!==t.partCount)return!1;if(this.hasZ!==t.hasZ||this.hasM!==t.hasM)return!1;if(this.hasCurves()!==t.hasCurves()||this.segmentCountArc!==t.segmentCountArc||this.segmentCountBezier!==t.segmentCountBezier)return!1;const r=0===e?(t,e)=>t!==e||isNaN(t)!==isNaN(e):(t,r)=>Math.abs(t-r)>e||isNaN(t)!==isNaN(r);for(let s=0;s<this.vertexCount;++s)if(r(this.vertexXY[2*s],t.vertexXY[2*s])||r(this.vertexXY[2*s+1],t.vertexXY[2*s+1]))return!1;if(this.hasZ)for(let s=0;s<this.vertexCount;++s)if(r(this.vertexZ[s],t.vertexZ[s]))return!1;if(this.hasM)for(let s=0;s<this.vertexCount;++s)if(r(this.vertexM[s],t.vertexM[s]))return!1;for(let s=0;s<this.partCount;++s)if(this.partFlags[s]!==t.partFlags[s]||this.partOffsets[s]!==t.partOffsets[s])return!1;if(this.hasCurves()){for(let e=0;e<this.vertexCount;++e)if(this.segmentFlags[e]!==t.segmentFlags[e]||this.segmentIndices[e]!==t.segmentIndices[e])return!1;for(let e=0;e<this.segmentParamCount;++e)if(r(this.segmentParams[e],t.segmentParams[e]))return!1}return!0}get parts(){return this.isMultipart()?new Z(this):[][Symbol.iterator]()}}class Z{constructor(t){this.geometry=t,this.value=new A(t)}get done(){return this.value.index>=this.geometry.partCount}next(){return++this.value.index,this}[Symbol.iterator](){return this}}class A{constructor(t){this.geometry=t,this.index=-1,this._readVertex=j(t),this._segments=new R(this)}get segments(){return this._segments.reset(),this._segments}get startVertex(){return this._readVertex(this.geometry.partOffsets[this.index])}get vertexCount(){const t=this.geometry.partOffsets;return t[this.index+1]-t[this.index]}}class R{constructor(t){this._part=t,this._partStart=0,this._partEnd=0,this._isPolygon="polygon"===t.geometry.type,this.value=new V(t.geometry)}get done(){return this.value.indexOfStartVertex>this._partEnd}next(){++this.value.indexOfStartVertex;const t=this.value.indexOfStartVertex>=this._partEnd;return this.value.indexOfEndVertex=t&&this._isPolygon?this._partStart:this.value.indexOfStartVertex+1,this}[Symbol.iterator](){return this}reset(){const{index:t}=this._part,e=this._part.geometry.partOffsets;this._partStart=e[t],this._partEnd=e[t+1]-(this._isPolygon?1:2),this.value.indexOfStartVertex=this._partStart-1}}class V{constructor(t){this.geometry=t,this.indexOfStartVertex=-1,this.indexOfEndVertex=-1,this._readVertex=j(t)}get xStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex]}get yStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex+1]}get zStart(){return this.geometry.vertexZ[this.indexOfStartVertex]}get mStart(){return this.geometry.vertexM[this.indexOfStartVertex]}get xEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex]}get yEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex+1]}get zEnd(){return this.geometry.vertexZ[this.indexOfEndVertex]}get mEnd(){return this.geometry.vertexM[this.indexOfEndVertex]}get start(){return this._readVertex(this.indexOfStartVertex)}get end(){return this._readVertex(this.indexOfEndVertex)}get curve(){const t=this.geometry.segmentFlags?.[this.indexOfStartVertex]??1;if(1===t)return this.end;const e=this.geometry.segmentParams;let r=this.geometry.segmentIndices[this.indexOfStartVertex];if(2===t){const t=e[r++],s=e[r++],n=e[r++],i=e[r++];return{b:[this.end,[t,s],[n,i]]}}const s=e[r++],n=e[r++],i=e[r++],a=e[r++],o=e[r++],u=e[r++];r++,r++;const h=e[r++],l=e[r++];if(!Boolean(4&s)&&1===i)return{c:[this.end,[h,l]]};const c=2&s?0:1,g=1&s?0:1;return{a:[this.end,[o,u],c,g,a,n,i]}}}function Y(r){let s;const{vertexCount:n,vertexXY:i,vertexZ:o,vertexM:u}=r,h=z(r);if(r.hasCurves()){const n={stack:[],error:void 0,hasError:!1};try{t(n,new k(r,["vertexZ","vertexM"]),!1);const e=a();for(const t of r.parts){let r=t.startVertex;for(const{curve:s}of t.segments)x(e,r,s),r=v(s)}const[i,o,u,l]=e;s={xmin:i,ymin:o,xmax:u,ymax:l,spatialReference:h}}catch(l){n.error=l,n.hasError=!0}finally{e(n)}}else{let t,e,r,a;t=e=1/0,r=a=-1/0;for(let s=0;s<n;++s){const n=i[2*s],o=i[2*s+1];t=Math.min(t,n),r=Math.max(r,n),e=Math.min(e,o),a=Math.max(a,o)}s={xmin:t,ymin:e,xmax:r,ymax:a,spatialReference:h}}if(o){let t=1/0,e=-1/0;for(const r of o)t=Math.min(t,r),e=Math.max(e,r);s.zmin=t,s.zmax=e}if(u){let t=1/0,e=-1/0;for(const r of u)t=Math.min(t,r),e=Math.max(e,r);s.mmin=t,s.mmax=e}return s}function b(r,s){const n={stack:[],error:void 0,hasError:!1};try{s??=a();t(n,new k(r,["vertexZ","vertexM","spatialReference"]),!1);return o(s,Y(r)),s}catch(i){n.error=i,n.hasError=!0}finally{e(n)}}function w(r,s){const a={stack:[],error:void 0,hasError:!1};try{s??=n();t(a,new k(r,["vertexM","spatialReference"]),!1);return i(s,Y(r)),s}catch(o){a.error=o,a.hasError=!0}finally{e(a)}}function I(t){let e,r,s;if(u(t)){s="point";const{x:n,y:i,z:a,m:o}=t,u=[n,i];null!=a&&u.push(a),null!=o&&u.push(o),r=[[u]],e=1}else h(t)?(s="multipoint",r=[t.points],e=t.points.length):l(t)?(s="polyline",r=t.curvePaths??t.paths,e=r.reduce((t,e)=>t+e.length,0)):(s="polygon",r=t.curveRings??t.rings,e=r.reduce((t,e)=>(0===e.length||(t+=e.length,W(e[0],v(e.at(-1)))&&--t),t),0));const n=U(s,e,s.includes("point")?0:r.length,g(t),c(t),d(t)),{hasZ:i,hasM:a,vertexXY:o,vertexZ:f,vertexM:m}=n;function p(t){o[2*O]=t[0],o[2*O+1]=t[1],i&&(f[O]=t[2]),a&&(m[O]=t[x]),++O}n.spatialReference=t.spatialReference??void 0;const x=n.hasZ?3:2;let O=0;if(!n.isMultipart()){if(!i&&!a){for(const[t,e]of r[0])o[2*O]=t,o[2*O+1]=e,++O;return n}for(const t of r[0])p(t);return n}const S="polygon"===s,{partOffsets:F}=n;let P=0;if(!n.hasCurves()){for(const t of r){if(F[P++]=O,0===t.length)continue;let e=t.length;if(S&&W(t[0],t.at(-1))&&--e,i||a)for(let r=0;r<e;++r)p(t[r]);else for(let r=0;r<e;++r){const[e,s]=t[r];o[2*O]=e,o[2*O+1]=s,++O}}return F[P]=O,n}function _(t){const e=Z+t;if(e<=(n.segmentParams?.length??0))return;let r=e*K;r=20*Math.ceil(r/20);const s=n.segmentParams;n.segmentParams=new Float64Array(r),null!=s&&n.segmentParams.set(s)}let Z=0;for(const u of r){if(n.partOffsets[P++]=O,0===u.length)continue;const t=u[0];let e=t;for(let r=1;r<u.length;++r){const t=u[r];p(e);const s=O-1;y(t)?(_(10),++n.segmentCountArc,Z=D(e,t,n,s,Z),e=t.a[0]):C(t)?(_(10),++n.segmentCountArc,Z=q(e,t,n,s,Z),e=t.a[0]):M(t)?(_(10),++n.segmentCountArc,Z=G(e,t,n,s,Z),e=t.c[0]):E(t)?(_(4),++n.segmentCountBezier,Z=H(e,t,n,s,Z),e=t.b[0]):e=t}S&&W(t,e)||p(e)}return n.partOffsets[P]=O,n}function X(t){const e=j(t),{vertexCount:r,partCount:s,hasZ:n,hasM:i}=t,a=z(t);if("point"===t.type){const[e,r]=t.vertexXY,s=t.vertexZ?.[0],n=t.vertexM?.[0];return{x:e,y:r,z:s,m:n,spatialReference:a}}let o=0;if("multipoint"===t.type){const t=[];for(;o<r;)t.push(e(o++));return{points:t,spatialReference:a,hasZ:n,hasM:i}}const u="polygon"===t.type;if(!t.hasCurves()){const r=new Array;for(let n=0;n<s;++n){const s=t.partOffsets[n+1],i=new Array;for(;o<s;)i.push(e(o++));u&&i.length>0&&i.push(i[0]),r.push(i)}return u?{rings:r,hasZ:n,hasM:i,spatialReference:a}:{paths:r,hasZ:n,hasM:i,spatialReference:a}}const h=new Array;for(const{segments:l,startVertex:c}of t.parts){const t=[c];for(const{curve:e}of l)t.push(e);h.push(t)}return u?{rings:[],curveRings:h,hasZ:n,hasM:i,spatialReference:a}:{paths:[],curvePaths:h,hasZ:n,hasM:i,spatialReference:a}}function B(t,{lengths:e,coords:r,hasZ:s,hasM:n},i){const a=t.includes("point")?0:e.length,o="polygon"===t,u="point"===t?1:e.reduce((t,e)=>t+e,0)-(o?a:0);s??=!1,n??=!1;const h=U(t,u,a,s,n,!1,0,0);if(h.spatialReference=i??void 0,!h.isMultipart()){for(let t=0,e=0;t<u;++t)h.vertexXY[2*t]=r[e++],h.vertexXY[2*t+1]=r[e++],s&&(h.vertexZ[t]=r[e++]),n&&(h.vertexM[t]=r[e++]);return h}const l=2+Number(s)+Number(n);let c=0,g=0;h.partOffsets[0]=0;for(const f of e){const t=h.partOffsets[g],e=t+f-Number(o);h.partOffsets[++g]=e;for(let i=t;i<e;++i)h.vertexXY[2*i]=r[c++],h.vertexXY[2*i+1]=r[c++],s&&(h.vertexZ[i]=r[c++]),n&&(h.vertexM[i]=r[c++]);o&&(c+=l)}return h}function L({type:t,vertexCount:e,vertexXY:r,vertexZ:s,vertexM:n,partCount:i,partOffsets:a,hasZ:o,hasM:u}){const h=new P([],[],o,u);i=Math.max(i,1);const l="polygon"===t;let c=0;for(let g=0;g<i;++g){const t=a?.[g+1]??e,i=h.coords.length;for(let e=c;e<t;++e)h.coords.push(r[2*e],r[2*e+1]),o&&h.coords.push(s[e]),u&&h.coords.push(n[e]);if(l){const t=c;h.coords.push(r[2*t],r[2*t+1]),o&&h.coords.push(s[t]),u&&h.coords.push(n[t])}h.lengths.push((h.coords.length-i)/h.stride),c=t}return"point"===t&&(h.lengths.length=0),h}function N(t,e){return"getSpatialReference"in t&&(e=T(t.getSpatialReference()),t=t.getGeometry()),new _({...t.toFlatGeometry(),spatialReference:e})}function T(t){if(null==t)return;const e=t.getText()||void 0,r=t.isCustomWkid()?0:t.getOldID();if(r<=0)return{wkt:e};let s=t.getLatestID();(s<=0||s===r)&&(s=void 0);const n=t.getVCS();if(null==n)return{wkid:r,latestWkid:s,wkt:e};const i=n.isCustomWkid()?0:n.getOldID();if(i<=0)return{wkt:e};let a=t.getLatestVerticalID();return(a<=0||a===i)&&(a=void 0),{wkid:r,wkt:e,latestWkid:s,vcsWkid:i,latestVcsWkid:a}}class k{constructor(t,e){this.target=t,this.keys=e,this.oldValues=e.map(e=>t[e]);for(const r of e)t[r]=void 0}[Symbol.dispose](){this.keys.map((t,e)=>{this.target[t]=this.oldValues[e]})}}function z({spatialReference:t}){return t instanceof s?t.toJSON():t}function j({vertexXY:t,vertexZ:e,vertexM:r}){return e?r?s=>[t[2*s],t[2*s+1],e[s],r[s]]:r=>[t[2*r],t[2*r+1],e[r]]:r?e=>[t[2*e],t[2*e+1],r[e]]:e=>[t[2*e],t[2*e+1]]}function W(t,e){return t.every((t,r)=>t===e[r])}function U(t,e,r,s,n,i,a,o){a??=0,o??=0;const u=new _({type:t,vertexCount:e,vertexXY:null,vertexZ:void 0,vertexM:void 0,partCount:r,partOffsets:void 0,partFlags:void 0,segmentFlags:void 0,segmentIndices:void 0,segmentParams:void 0,segmentCountArc:a,segmentCountBezier:o});let h=2*Float64Array.BYTES_PER_ELEMENT*e;s&&(h+=Float64Array.BYTES_PER_ELEMENT*e),n&&(h+=Float64Array.BYTES_PER_ELEMENT*e),u.isMultipart()&&(h+=(r+1)*Int32Array.BYTES_PER_ELEMENT,h+=(r+1)*Int8Array.BYTES_PER_ELEMENT),i&&(h+=e*Int8Array.BYTES_PER_ELEMENT,h+=e*Int32Array.BYTES_PER_ELEMENT,h+=u.segmentParamCount*Float64Array.BYTES_PER_ELEMENT);const l=new ArrayBuffer(h);let c=0;return u.vertexXY=new Float64Array(l,c,2*e),c+=u.vertexXY.byteLength,s&&(u.vertexZ=new Float64Array(l,c,e),c+=u.vertexZ.byteLength),n&&(u.vertexM=new Float64Array(l,c,e),c+=u.vertexM.byteLength),i&&(u.segmentParams=new Float64Array(l,c,u.segmentParamCount),c+=u.segmentParams.byteLength,u.segmentIndices=new Int32Array(l,c,e),u.segmentIndices.fill(Q),c+=u.segmentIndices.byteLength),u.isMultipart()&&(u.partOffsets=new Int32Array(l,c,r+1),c+=u.partOffsets.byteLength,u.partFlags=new Int8Array(l,c,r+1),c+=u.partFlags.byteLength,"polygon"===u.type&&u.partFlags.subarray(0,r).fill(1)),i&&(u.segmentFlags=new Int8Array(l,c,e),u.segmentFlags.fill(1),c+=u.segmentFlags.byteLength),u}function D(t,e,{segmentFlags:r,segmentIndices:s,segmentParams:n},i,a){r[i]=4,s[i]=a;const[o,[u,h],l,c,g,f,m]=e.a;let p=4;c||(p|=1),l||(p|=2);const x=S(t,e),[v,d]=F(x,.5);return n[a++]=p,n[a++]=f,n[a++]=m,n[a++]=g,n[a++]=u,n[a++]=h,n[a++]=x.u2-x.u1,n[a++]=x.u1,n[a++]=v,n[a++]=d,a}function q(t,e,{segmentFlags:r,segmentIndices:s,segmentParams:n},i,a){r[i]=4,s[i]=a;const o=O(t,e);return J(o,4,...m(o,.5),n,a)}function G(t,e,{segmentFlags:r,segmentIndices:s,segmentParams:n},i,a){r[i]=4,s[i]=a;return J(p(t,e),0,...e.c[1],n,a)}function J(t,e,r,s,n,i){const{cx:a,cy:o,thetaStart:u,thetaEnd:h,radius:l}=t;u>h||(e|=1);return Math.abs(h-u)<=Math.PI||(e|=2),n[i++]=e,n[i++]=l,n[i++]=1,n[i++]=0,n[i++]=a,n[i++]=o,n[i++]=h-u,n[i++]=u,n[i++]=r,n[i++]=s,i}function H(t,{b:[e,[r,s],[n,i]]},{segmentFlags:a,segmentIndices:o,segmentParams:u},h,l){return a[h]=2,o[h]=l,u[l++]=r,u[l++]=s,u[l++]=n,u[l++]=i,l}const K=1.61803,Q=-1;export{_ as FlatGeometry,U as allocateFlatGeometry,X as convertFlatToGeometryJSON,L as convertFlatToOptimizedGeometry,I as convertGeometryToFlat,N as convertGeometryxToFlat,B as convertOptimizedGeometryToFlat,w as getBoundingBox,b as getBoundingRect,Y as getExtentJSON,H as writeBezierCurveSegment,G as writeCircularArcSegment,q as writeEllipticArc4Segment,D as writeEllipticArc7Segment};
2
+ import{__addDisposableResource as t,__disposeResources as e}from"tslib";import{baseTypedSubArrayMemory as r}from"../core/memoryEstimations.js";import s from"./SpatialReference.js";import{empty as n,expandWithExtent as i}from"./support/aaBoundingBox.js";import{empty as a,expandExtentInPlace as o}from"./support/aaBoundingRect.js";import{isPoint as u,isMultipoint as h,isPolyline as l,isGeometryWithM as c,isGeometryWithZ as g}from"./support/jsonTypeUtils.js";import{equals as f}from"./support/spatialReferenceUtils.js";import{interpolateCircle as m}from"./support/curves/circleUtils.js";import{deriveCircleFromCircularArc as p}from"./support/curves/circularArcUtils.js";import{curveExtent as x}from"./support/curves/curveExtent.js";import{getEndpoint as v,isCurvedGeometry as d,isEllipticArc7 as y,isEllipticArc4 as C,isCircularArc as M,isBezierCurve as E}from"./support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as O}from"./support/curves/ellipticArc4Utils.js";import{deriveEllipse as S,interpolateEllipse as P}from"./support/curves/ellipticArc7Utils.js";import _ from"../layers/graphics/OptimizedGeometry.js";class A{constructor({type:t,spatialReference:e,vertexCount:r,vertexXY:s,vertexZ:n,vertexM:i,partCount:a,partOffsets:o,partFlags:u,segmentFlags:h,segmentIndices:l,segmentParams:c,segmentCountArc:g,segmentCountBezier:f}){this.segmentCountArc=0,this.segmentCountBezier=0,this.type=t,this.spatialReference=e,this.vertexCount=r,this.vertexXY=s,this.vertexZ=n,this.vertexM=i,this.partCount=a,this.partOffsets=o,this.partFlags=u,this.segmentFlags=h,this.segmentIndices=l,this.segmentParams=c,this.segmentCountArc=g,this.segmentCountBezier=f}get segmentParamCount(){return 10*this.segmentCountArc+4*this.segmentCountBezier}get segmentCountLine(){const{segmentCount:t,segmentCountArc:e,segmentCountBezier:r}=this;return t&&t-e-r}get segmentCount(){return"polyline"===this.type?this.vertexCount-this.partCount:"polygon"===this.type?this.vertexCount:0}get hasZ(){return null!=this.vertexZ}get hasM(){return null!=this.vertexM}hasCurves(){return this.segmentCountArc+this.segmentCountBezier>0}isMultipart(){return"polyline"===this.type||"polygon"===this.type}get usedMemory(){function t(t){return t?r+t.byteLength:0}return t(this.vertexXY)+t(this.vertexZ)+t(this.vertexM)+t(this.partOffsets)+t(this.partFlags)+t(this.segmentFlags)+t(this.segmentIndices)+t(this.segmentParams)}clone(){const{type:t,vertexCount:e,partCount:r,hasZ:s,hasM:n,segmentCountArc:i,segmentCountBezier:a}=this,o=U(t,e,r,s,n,this.hasCurves(),i,a);o.spatialReference=this.spatialReference;const{vertexXY:u,vertexZ:h,vertexM:l}=this;if(o.vertexXY.set(u.subarray(0,2*e),0),o.vertexZ?.set(h.subarray(0,e),0),o.vertexM?.set(l.subarray(0,e),0),this.isMultipart()){const{partOffsets:t,partFlags:e}=this;o.partFlags.set(e.subarray(0,r+1)),o.partOffsets.set(t.subarray(0,r+1))}if(this.hasCurves()){const{segmentFlags:t,segmentIndices:r,segmentParams:s,segmentParamCount:n}=this;o.segmentFlags.set(t.subarray(0,e),0),o.segmentIndices.set(r.subarray(0,e),0),o.segmentParams.set(s.subarray(0,n),0)}return o}equals(t){return this.equalsWithinTolerance(t,0)}equalsWithinTolerance(t,e){if(null==t)return!1;if(this===t)return!0;if(!f(this.spatialReference,t.spatialReference))return!1;if(this.vertexCount!==t.vertexCount||this.partCount!==t.partCount)return!1;if(this.hasZ!==t.hasZ||this.hasM!==t.hasM)return!1;if(this.hasCurves()!==t.hasCurves()||this.segmentCountArc!==t.segmentCountArc||this.segmentCountBezier!==t.segmentCountBezier)return!1;const r=0===e?(t,e)=>t!==e||isNaN(t)!==isNaN(e):(t,r)=>Math.abs(t-r)>e||isNaN(t)!==isNaN(r);for(let s=0;s<this.vertexCount;++s)if(r(this.vertexXY[2*s],t.vertexXY[2*s])||r(this.vertexXY[2*s+1],t.vertexXY[2*s+1]))return!1;if(this.hasZ)for(let s=0;s<this.vertexCount;++s)if(r(this.vertexZ[s],t.vertexZ[s]))return!1;if(this.hasM)for(let s=0;s<this.vertexCount;++s)if(r(this.vertexM[s],t.vertexM[s]))return!1;for(let s=0;s<this.partCount;++s)if(this.partFlags[s]!==t.partFlags[s]||this.partOffsets[s]!==t.partOffsets[s])return!1;if(this.hasCurves()){for(let e=0;e<this.vertexCount;++e)if(this.segmentFlags[e]!==t.segmentFlags[e]||this.segmentIndices[e]!==t.segmentIndices[e])return!1;for(let e=0;e<this.segmentParamCount;++e)if(r(this.segmentParams[e],t.segmentParams[e]))return!1}return!0}get parts(){return this.isMultipart()?new F(this):[][Symbol.iterator]()}}class F{constructor(t){this.geometry=t,this.value=new Z(t)}get done(){return this.value.index>=this.geometry.partCount}next(){return++this.value.index,this}[Symbol.iterator](){return this}}class Z{constructor(t){this.geometry=t,this.index=-1,this._readVertex=j(t),this._segments=new R(this)}get segments(){return this._segments.reset(),this._segments}get startVertex(){return this._readVertex(this.geometry.partOffsets[this.index])}get vertexCount(){const t=this.geometry.partOffsets;return t[this.index+1]-t[this.index]}}class R{constructor(t){this._part=t,this._partStart=0,this._partEnd=0,this._isPolygon="polygon"===t.geometry.type,this.value=new V(t.geometry)}get done(){return this.value.indexOfStartVertex>this._partEnd}next(){++this.value.indexOfStartVertex;const t=this.value.indexOfStartVertex>=this._partEnd;return this.value.indexOfEndVertex=t&&this._isPolygon?this._partStart:this.value.indexOfStartVertex+1,this}[Symbol.iterator](){return this}reset(){const{index:t}=this._part,e=this._part.geometry.partOffsets;this._partStart=e[t],this._partEnd=e[t+1]-(this._isPolygon?1:2),this.value.indexOfStartVertex=this._partStart-1}}class V{constructor(t){this.geometry=t,this.indexOfStartVertex=-1,this.indexOfEndVertex=-1,this._readVertex=j(t)}get xStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex]}get yStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex+1]}get zStart(){return this.geometry.vertexZ[this.indexOfStartVertex]}get mStart(){return this.geometry.vertexM[this.indexOfStartVertex]}get xEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex]}get yEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex+1]}get zEnd(){return this.geometry.vertexZ[this.indexOfEndVertex]}get mEnd(){return this.geometry.vertexM[this.indexOfEndVertex]}get start(){return this._readVertex(this.indexOfStartVertex)}get end(){return this._readVertex(this.indexOfEndVertex)}get curve(){const t=this.geometry.segmentFlags?.[this.indexOfStartVertex]??1;if(1===t)return this.end;const e=this.geometry.segmentParams;let r=this.geometry.segmentIndices[this.indexOfStartVertex];if(2===t){const t=e[r++],s=e[r++],n=e[r++],i=e[r++];return{b:[this.end,[t,s],[n,i]]}}const s=e[r++],n=e[r++],i=e[r++],a=e[r++],o=e[r++],u=e[r++];r++,r++;const h=e[r++],l=e[r++];if(!Boolean(4&s)&&1===i)return{c:[this.end,[h,l]]};const c=2&s?0:1,g=1&s?0:1;return{a:[this.end,[o,u],c,g,a,n,i]}}}function Y(r){let s;const{vertexCount:n,vertexXY:i,vertexZ:o,vertexM:u}=r,h=k(r);if(r.hasCurves()){const n={stack:[],error:void 0,hasError:!1};try{t(n,new z(r,["vertexZ","vertexM"]),!1);const e=a();for(const t of r.parts){let r=t.startVertex;for(const{curve:s}of t.segments)x(e,r,s),r=v(s)}const[i,o,u,l]=e;s={xmin:i,ymin:o,xmax:u,ymax:l,spatialReference:h}}catch(l){n.error=l,n.hasError=!0}finally{e(n)}}else{let t,e,r,a;t=e=1/0,r=a=-1/0;for(let s=0;s<n;++s){const n=i[2*s],o=i[2*s+1];t=Math.min(t,n),r=Math.max(r,n),e=Math.min(e,o),a=Math.max(a,o)}s={xmin:t,ymin:e,xmax:r,ymax:a,spatialReference:h}}if(o){let t=1/0,e=-1/0;for(const r of o)t=Math.min(t,r),e=Math.max(e,r);s.zmin=t,s.zmax=e}if(u){let t=1/0,e=-1/0;for(const r of u)t=Math.min(t,r),e=Math.max(e,r);s.mmin=t,s.mmax=e}return s}function b(r,s){const n={stack:[],error:void 0,hasError:!1};try{s??=a();t(n,new z(r,["vertexZ","vertexM","spatialReference"]),!1);return o(s,Y(r)),s}catch(i){n.error=i,n.hasError=!0}finally{e(n)}}function w(r,s){const a={stack:[],error:void 0,hasError:!1};try{s??=n();t(a,new z(r,["vertexM","spatialReference"]),!1);return i(s,Y(r)),s}catch(o){a.error=o,a.hasError=!0}finally{e(a)}}function I(t){let e,r,s;if(u(t)){s="point";const{x:n,y:i,z:a,m:o}=t,u=[n,i];null!=a&&u.push(a),null!=o&&u.push(o),r=[[u]],e=1}else h(t)?(s="multipoint",r=[t.points],e=t.points.length):l(t)?(s="polyline",r=t.curvePaths??t.paths,e=r.reduce((t,e)=>t+e.length,0)):(s="polygon",r=t.curveRings??t.rings,e=r.reduce((t,e)=>(0===e.length||(t+=e.length,W(e[0],v(e.at(-1)))&&--t),t),0));const n=U(s,e,s.includes("point")?0:r.length,g(t),c(t),d(t)),{hasZ:i,hasM:a,vertexXY:o,vertexZ:f,vertexM:m}=n;function p(t){o[2*O]=t[0],o[2*O+1]=t[1],i&&(f[O]=t[2]),a&&(m[O]=t[x]),++O}n.spatialReference=t.spatialReference??void 0;const x=n.hasZ?3:2;let O=0;if(!n.isMultipart()){if(!i&&!a){for(const[t,e]of r[0])o[2*O]=t,o[2*O+1]=e,++O;return n}for(const t of r[0])p(t);return n}const S="polygon"===s,{partOffsets:P}=n;let _=0;if(!d(t)){for(const t of r){if(P[_++]=O,0===t.length)continue;let e=t.length;if(S&&W(t[0],t.at(-1))&&--e,i||a)for(let r=0;r<e;++r)p(t[r]);else for(let r=0;r<e;++r){const[e,s]=t[r];o[2*O]=e,o[2*O+1]=s,++O}}return P[_]=O,n}function A(t){const e=F+t;if(e<=(n.segmentParams?.length??0))return;let r=e*K;r=20*Math.ceil(r/20);const s=n.segmentParams;n.segmentParams=new Float64Array(r),null!=s&&n.segmentParams.set(s)}let F=0;for(const u of r){if(n.partOffsets[_++]=O,0===u.length)continue;const t=u[0];let e=t;for(let r=1;r<u.length;++r){const t=u[r];p(e);const s=O-1;y(t)?(A(10),++n.segmentCountArc,F=D(e,t,n,s,F),e=t.a[0]):C(t)?(A(10),++n.segmentCountArc,F=q(e,t,n,s,F),e=t.a[0]):M(t)?(A(10),++n.segmentCountArc,F=G(e,t,n,s,F),e=t.c[0]):E(t)?(A(4),++n.segmentCountBezier,F=H(e,t,n,s,F),e=t.b[0]):e=t}S&&W(t,e)||p(e)}return n.partOffsets[_]=O,n}function X(t){const e=j(t),{vertexCount:r,partCount:s,hasZ:n,hasM:i}=t,a=k(t);if("point"===t.type){const[e,r]=t.vertexXY,s=t.vertexZ?.[0],n=t.vertexM?.[0];return{x:e,y:r,z:s,m:n,spatialReference:a}}let o=0;if("multipoint"===t.type){const t=[];for(;o<r;)t.push(e(o++));return{points:t,spatialReference:a,hasZ:n,hasM:i}}const u="polygon"===t.type;if(!t.hasCurves()){const r=new Array;for(let n=0;n<s;++n){const s=t.partOffsets[n+1],i=new Array;for(;o<s;)i.push(e(o++));u&&i.length>0&&i.push(i[0]),r.push(i)}return u?{rings:r,hasZ:n,hasM:i,spatialReference:a}:{paths:r,hasZ:n,hasM:i,spatialReference:a}}const h=new Array;for(const{segments:l,startVertex:c}of t.parts){const t=[c];for(const{curve:e}of l)t.push(e);h.push(t)}return u?{rings:[],curveRings:h,hasZ:n,hasM:i,spatialReference:a}:{paths:[],curvePaths:h,hasZ:n,hasM:i,spatialReference:a}}function B(t,{lengths:e,coords:r,hasZ:s,hasM:n},i){const a=t.includes("point")?0:e.length,o="polygon"===t,u="point"===t?1:e.reduce((t,e)=>t+e,0)-(o?a:0);s??=!1,n??=!1;const h=U(t,u,a,s,n,!1,0,0);if(h.spatialReference=i??void 0,!h.isMultipart()){for(let t=0,e=0;t<u;++t)h.vertexXY[2*t]=r[e++],h.vertexXY[2*t+1]=r[e++],s&&(h.vertexZ[t]=r[e++]),n&&(h.vertexM[t]=r[e++]);return h}const l=2+Number(s)+Number(n);let c=0,g=0;h.partOffsets[0]=0;for(const f of e){const t=h.partOffsets[g],e=t+f-Number(o);h.partOffsets[++g]=e;for(let i=t;i<e;++i)h.vertexXY[2*i]=r[c++],h.vertexXY[2*i+1]=r[c++],s&&(h.vertexZ[i]=r[c++]),n&&(h.vertexM[i]=r[c++]);o&&(c+=l)}return h}function L({type:t,vertexCount:e,vertexXY:r,vertexZ:s,vertexM:n,partCount:i,partOffsets:a,hasZ:o,hasM:u}){const h=new _([],[],o,u);i=Math.max(i,1);const l="polygon"===t;let c=0;for(let g=0;g<i;++g){const t=a?.[g+1]??e,i=h.coords.length;for(let e=c;e<t;++e)h.coords.push(r[2*e],r[2*e+1]),o&&h.coords.push(s[e]),u&&h.coords.push(n[e]);if(l){const t=c;h.coords.push(r[2*t],r[2*t+1]),o&&h.coords.push(s[t]),u&&h.coords.push(n[t])}h.lengths.push((h.coords.length-i)/h.stride),c=t}return"point"===t&&(h.lengths.length=0),h}function N(t,e){return"getSpatialReference"in t&&(e=T(t.getSpatialReference()),t=t.getGeometry()),new A({...t.toFlatGeometry(),spatialReference:e})}function T(t){if(null==t)return;const e=t.getText()||void 0,r=t.isCustomWkid()?0:t.getOldID();if(r<=0)return{wkt:e};let s=t.getLatestID();(s<=0||s===r)&&(s=void 0);const n=t.getVCS();if(null==n)return{wkid:r,latestWkid:s,wkt:e};const i=n.isCustomWkid()?0:n.getOldID();if(i<=0)return{wkt:e};let a=t.getLatestVerticalID();return(a<=0||a===i)&&(a=void 0),{wkid:r,wkt:e,latestWkid:s,vcsWkid:i,latestVcsWkid:a}}class z{constructor(t,e){this.target=t,this.keys=e,this.oldValues=e.map(e=>t[e]);for(const r of e)t[r]=void 0}[Symbol.dispose](){this.keys.map((t,e)=>{this.target[t]=this.oldValues[e]})}}function k({spatialReference:t}){return t instanceof s?t.toJSON():t}function j({vertexXY:t,vertexZ:e,vertexM:r}){return e?r?s=>[t[2*s],t[2*s+1],e[s],r[s]]:r=>[t[2*r],t[2*r+1],e[r]]:r?e=>[t[2*e],t[2*e+1],r[e]]:e=>[t[2*e],t[2*e+1]]}function W(t,e){return t.every((t,r)=>t===e[r])}function U(t,e,r,s,n,i,a,o){a??=0,o??=0;const u=new A({type:t,vertexCount:e,vertexXY:null,vertexZ:void 0,vertexM:void 0,partCount:r,partOffsets:void 0,partFlags:void 0,segmentFlags:void 0,segmentIndices:void 0,segmentParams:void 0,segmentCountArc:a,segmentCountBezier:o});let h=2*Float64Array.BYTES_PER_ELEMENT*e;s&&(h+=Float64Array.BYTES_PER_ELEMENT*e),n&&(h+=Float64Array.BYTES_PER_ELEMENT*e),u.isMultipart()&&(h+=(r+1)*Int32Array.BYTES_PER_ELEMENT,h+=(r+1)*Int8Array.BYTES_PER_ELEMENT),i&&(h+=e*Int8Array.BYTES_PER_ELEMENT,h+=e*Int32Array.BYTES_PER_ELEMENT,h+=u.segmentParamCount*Float64Array.BYTES_PER_ELEMENT);const l=new ArrayBuffer(h);let c=0;return u.vertexXY=new Float64Array(l,c,2*e),c+=u.vertexXY.byteLength,s&&(u.vertexZ=new Float64Array(l,c,e),c+=u.vertexZ.byteLength),n&&(u.vertexM=new Float64Array(l,c,e),c+=u.vertexM.byteLength),i&&(u.segmentParams=new Float64Array(l,c,u.segmentParamCount),c+=u.segmentParams.byteLength,u.segmentIndices=new Int32Array(l,c,e),u.segmentIndices.fill(Q),c+=u.segmentIndices.byteLength),u.isMultipart()&&(u.partOffsets=new Int32Array(l,c,r+1),c+=u.partOffsets.byteLength,u.partFlags=new Int8Array(l,c,r+1),c+=u.partFlags.byteLength,"polygon"===u.type&&u.partFlags.subarray(0,r).fill(1)),i&&(u.segmentFlags=new Int8Array(l,c,e),u.segmentFlags.fill(1),c+=u.segmentFlags.byteLength),u}function D(t,e,{segmentFlags:r,segmentIndices:s,segmentParams:n},i,a){r[i]=4,s[i]=a;const[o,[u,h],l,c,g,f,m]=e.a;let p=4;c||(p|=1),l||(p|=2);const x=S(t,e),[v,d]=P(x,.5);return n[a++]=p,n[a++]=f,n[a++]=m,n[a++]=g,n[a++]=u,n[a++]=h,n[a++]=x.u2-x.u1,n[a++]=x.u1,n[a++]=v,n[a++]=d,a}function q(t,e,{segmentFlags:r,segmentIndices:s,segmentParams:n},i,a){r[i]=4,s[i]=a;const o=O(t,e);return J(o,4,...m(o,.5),n,a)}function G(t,e,{segmentFlags:r,segmentIndices:s,segmentParams:n},i,a){r[i]=4,s[i]=a;return J(p(t,e),0,...e.c[1],n,a)}function J(t,e,r,s,n,i){const{cx:a,cy:o,thetaStart:u,thetaEnd:h,radius:l}=t;u>h||(e|=1);return Math.abs(h-u)<=Math.PI||(e|=2),n[i++]=e,n[i++]=l,n[i++]=1,n[i++]=0,n[i++]=a,n[i++]=o,n[i++]=h-u,n[i++]=u,n[i++]=r,n[i++]=s,i}function H(t,{b:[e,[r,s],[n,i]]},{segmentFlags:a,segmentIndices:o,segmentParams:u},h,l){return a[h]=2,o[h]=l,u[l++]=r,u[l++]=s,u[l++]=n,u[l++]=i,l}const K=1.61803,Q=-1;export{A as FlatGeometry,U as allocateFlatGeometry,X as convertFlatToGeometryJSON,L as convertFlatToOptimizedGeometry,I as convertGeometryToFlat,N as convertGeometryxToFlat,B as convertOptimizedGeometryToFlat,w as getBoundingBox,b as getBoundingRect,Y as getExtentJSON,H as writeBezierCurveSegment,G as writeCircularArcSegment,q as writeEllipticArc4Segment,D as writeEllipticArc7Segment};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{execute as o,executeMany as e,load as r,supportsCurves as t,isLoaded as n}from"./gx/operatorProject.js";import{applyZConversionAfterProjection as a}from"./support/projectionZScaling.js";let s,i,p,c,m,u;function f(){return!!s&&n()}async function l(){if(!f()){const[o,e]=await Promise.all([import("./support/apiConverter.js"),import("./support/projectionTransformation.js"),r()]);s=o.fromGeometry,i=o.fromSpatialReference,p=o.getSpatialReference,c=o.toGeometry,m=e.createProjectionTransformation,u=t()}}function j(e,r,t){const n=p(e),u=m(i(n),i(r),t),f=c(o(s(e),u),r);return!t?.zConversionDisabled&&f?.hasZ&&a([f],n,r),f}function d(o,r,t){const n=o.map(s),u=p(o),f=m(i(u),i(r),t),l=e(n,f).map(o=>c(o,r));return!t?.zConversionDisabled&&l&&a(l,u,r),l}export{j as execute,d as executeMany,f as isLoaded,l as load,u as supportsCurves};
2
+ import{load as o,supportsCurves as e,execute as r,executeMany as t,isLoaded as n}from"./gx/operatorProject.js";import{applyZConversionAfterProjection as a}from"./support/projectionZScaling.js";let s,i,p,c,m,u;function f(){return!!s&&n()}async function l(){if(!f()){const[r,t]=await Promise.all([import("./support/apiConverter.js"),import("./support/projectionTransformation.js"),o()]);s=r.fromGeometry,i=r.fromSpatialReference,p=r.getSpatialReference,c=r.toGeometry,m=t.createProjectionTransformation,u=e()}}function j(o,e,t){const n=p(o),u=m(i(n),i(e),t),f=c(r(s(o),u),e);return!t?.zConversionDisabled&&f?.hasZ&&a([f],n,e),f}function d(o,e,r){const n=o.map(s),u=p(o),f=m(i(u),i(e),r),l=t(n,f).map(o=>c(o,e));return!r?.zConversionDisabled&&l&&a(l,u,e),l}export{j as execute,d as executeMany,f as isLoaded,l as load,u as supportsCurves};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{getSliceableContainerSymbol as r}from"./getSliceableContainer.js";import i from"./GraphicOrigin.js";import{isImageryGraphicOriginSymbol as t}from"./isImageryGraphicOrigin.js";var e;class s extends i{get[(e=t,r)](){return this.layer}constructor(r){super(),this[e]=!0,this.type="imagery",this.layer=r}get id(){return this.layer.id}}export{s as default};
2
+ import{idFieldsProviderSymbol as r}from"./getIdFieldsProvider.js";import{popupProviderSymbol as e}from"./getPopupProvider.js";import{getSliceableContainerSymbol as t}from"./getSliceableContainer.js";import i from"./GraphicOrigin.js";import{isImageryGraphicOriginSymbol as s}from"./isImageryGraphicOrigin.js";var o;class a extends i{get[(o=s,e)](){return this.layer}get[r](){return this.layer}get[t](){return this.layer}constructor(r){super(),this[o]=!0,this.type="imagery",this.layer=r}get id(){return this.layer.id}}export{a as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{getSliceableContainerSymbol as r}from"./getSliceableContainer.js";import i from"./GraphicOrigin.js";import{isImageryTileGraphicOriginSymbol as e}from"./isImageryTileGraphicOrigin.js";var t;class s extends i{get[(t=e,r)](){return this.layer}constructor(r){super(),this[t]=!0,this.type="imagery-tile",this.layer=r}get id(){return this.layer.id}}export{s as default};
2
+ import{popupProviderSymbol as r}from"./getPopupProvider.js";import{getSliceableContainerSymbol as e}from"./getSliceableContainer.js";import t from"./GraphicOrigin.js";import{isImageryTileGraphicOriginSymbol as i}from"./isImageryTileGraphicOrigin.js";var s;class a extends t{get[(s=i,r)](){return this.layer}get[e](){return this.layer}constructor(r){super(),this[s]=!0,this.type="imagery-tile",this.layer=r}get id(){return this.layer.id}}export{a as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{getSliceableContainerSymbol as r}from"./getSliceableContainer.js";import t from"./GraphicOrigin.js";import{isWCSGraphicOriginSymbol as i}from"./isWCSGraphicOrigin.js";var e;class s extends t{get[(e=i,r)](){return this.layer}constructor(r){super(),this[e]=!0,this.type="wcs",this.layer=r}get id(){return this.layer.id}}export{s as default};
2
+ import{popupProviderSymbol as r}from"./getPopupProvider.js";import{getSliceableContainerSymbol as t}from"./getSliceableContainer.js";import e from"./GraphicOrigin.js";import{isWCSGraphicOriginSymbol as i}from"./isWCSGraphicOrigin.js";var s;class o extends e{get[(s=i,r)](){return this.layer}get[t](){return this.layer}constructor(r){super(),this[s]=!0,this.type="wcs",this.layer=r}get id(){return this.layer.id}}export{o as default};
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.1";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.1.0-next.74",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
2
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.1";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.1.0-next.76",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../Graphic.js";import i from"../../request.js";import r from"../../core/Error.js";import{clone as s}from"../../core/lang.js";import n from"../../core/Logger.js";import{watch as a}from"../../core/reactiveUtils.js";import{urlToObject as o}from"../../core/urlUtils.js";import{property as l,subclass as u}from"../../core/accessorSupport/decorators.js";import{Integer as p,ensureClass as m}from"../../core/accessorSupport/ensureType.js";import{runUntracked as c}from"../../core/accessorSupport/tracking.js";import d from"../../geometry/Extent.js";import h from"../../geometry/Polygon.js";import f from"../../geometry/SpatialReference.js";import{srToRESTValue as y}from"../../geometry/support/spatialReferenceUtils.js";import{intersectMultimensionalSubset as g,getEffectiveMultidimensionalDefinition as R,getSubsetVariablesFromMdInfo as I,getDefaultMultidimensionalDefinition as v}from"../raster/datasets/multidimensionalUtils.js";import{decode as w,getFormat as b}from"../raster/formats/RasterCodec.js";import{uvComponentToVector as S}from"../raster/functions/vectorFieldUtils.js";import{opacity as x,url as F}from"../support/commonProperties.js";import _ from"../support/DimensionalDefinition.js";import{ExportImageServiceParameters as D}from"../support/ExportImageServiceParameters.js";import O from"../support/Field.js";import T from"../support/FieldsIndex.js";import{createBitmap as C}from"../support/imageBitmapUtils.js";import{isSupportedRendererType as M}from"../support/imageryRendererUtils.js";import N from"../support/MosaicRule.js";import q from"../support/MultidimensionalSubset.js";import P from"../support/PixelBlock.js";import{interpolationKebab as j,noDataInterpretationKebab as E,pixelTypeKebabDict as A}from"../support/rasterEnums.js";import{getServicePixelValueField as Q,getItemPixelValueField as V,getRawServicePixelValueField as J,getProcessedServicePixelValueField as U,getMagnitudeField as B,getDirectionField as z,getMultidimensionalFields as L,getRasterAttributeTableFields as H,addMultidimensionalFieldValues as G,commonRasterFieldNames as k,rasterFieldPrefix as W}from"../support/rasterFieldUtils.js";import $ from"../support/RasterFunction.js";import X from"../support/RasterInfo.js";import{createDefaultRenderer as K,getDefaultBandCombination as Y,getSupportedRendererTypes as Z,matchPresetRenderer as ee,normalizeRendererJSON as te}from"../../renderers/support/rasterRendererHelper.js";import ie from"../../renderers/support/RasterSymbolizer.js";import{rasterRendererTypes as re,websceneRasterRendererTypes as se,read as ne}from"../../renderers/support/rasterTypeUtils.js";import{calculateVolume as ae,computeAngles as oe,computePixelSpaceLocations as le,computeHistograms as ue,computeStatisticsHistograms as pe,measureHeight as me,measureAreaAndPerimeter as ce,measureDistanceAndAngle as de,measurePointOrCentroid as he,measureLengthFromImage as fe,measureAreaFromImage as ye,getImageSpatialReferenceQueryParameter as ge,getSamples as Re,identify as Ie,imageToMap as ve,imageToMapMultiray as we,mapToImage as be,findImages as Se,getImageUrl as xe,queryBoundary as Fe,queryGPSInfo as _e}from"../../rest/imageService.js";import{fetchServiceRasterInfo as De,generateRasterInfo as Oe,patchServiceInfo as Te}from"../../rest/imageService/fetchRasterInfo.js";import{getCatalogItemRasterInfo as Ce}from"../../rest/imageService/getCatalogItemRasterInfo.js";import{executeForCount as Me}from"../../rest/query/executeForCount.js";import{executeForExtent as Ne}from"../../rest/query/executeForExtent.js";import{executeForIds as qe}from"../../rest/query/executeForIds.js";import{executeQueryJSON as Pe}from"../../rest/query/executeQueryJSON.js";import je from"../../rest/support/FeatureSet.js";import Ee from"../../rest/support/ImageIdentifyParameters.js";import Ae from"../../rest/support/Query.js";import{reader as Qe}from"../../core/accessorSupport/decorators/reader.js";import{writer as Ve}from"../../core/accessorSupport/decorators/writer.js";const Je=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]);function Ue(e){const t=JSON.stringify(e),i=t.includes('"rasterFunctionDefinition":{'),r=i?t.match(/"type":"(.*?FunctionArguments")/gi):t.match(/"rasterFunction":"(.*?")/gi),s=r?.map(e=>i?e.slice(8,-18):e.slice(18,-1));return s?s.join("/"):null}const Be=Be=>{const ze=Be;let Le=class extends ze{constructor(){super(...arguments),this._functionRasterInfos={},this._serviceSupportsMosaicRule=null,this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new D({layer:this}))}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.length<1||null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.forEach(t=>{e.set(t.name.toLowerCase().replaceAll(/ /gi,"_"),t.name)}),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every(e=>"number"==typeof e))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,i){null!=e&&"lerc"!==this.format&&(t[i]=e)}writeCompressionTolerance(e,t,i){"lerc"===this.format&&null!=e&&(t[i]=e)}readDefaultMosaicRule(e,t){return this._serviceSupportsMosaicRule?c(()=>N.fromJSON(t)):null}get fieldsIndex(){return this.fields?new T(this.fields):null}set format(e){e&&Je.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,t){return"esriImageServiceDataTypeVector-UV"===t.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===t.serviceDataType||null!=this.pixelFilter?"lerc":"jpgpng"}get isRenderedFormat(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}set mosaicRule(e){let t=e;t?.mosaicMethod&&(t=N.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}readMosaicRule(e,t){const i=e||t.mosaicRule;return i?N.fromJSON(i):this._isMosaicRuleSupported(t)?N.fromJSON(t):null}writeMosaicRule(e,t,i){const{mosaicRule:r}=this;this._isValidCustomizedMosaicRule(r)&&(t[i]=r.toJSON())}readObjectIdField(e,t){if(!e){const i=t.fields.find(e=>"esriFieldTypeOID"===e.type||"oid"===e.type);e=i?.name}return e}get parsedUrl(){return o(this.url)}readSourceType(e,t){return this._isMosaicDataset(t)?"mosaic-dataset":"raster-dataset"}get renderer(){const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find(({name:t})=>t===e);return i?.renderer.clone()}return this.internalRenderer}set renderer(e){this.activePresetRendererName=null,this.internalRenderer=e}set internalRenderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("internalRenderer",e)}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer,s=ne(r,i);return null==s?null:("vector-field"===s.type&&t.symbolTileSize&&!r.symbolTileSize&&(s.symbolTileSize=t.symbolTileSize),M(s)||n.getLogger(this).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),s)}writeRenderer(e,t,i){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON()}get rasterFields(){const e=this.fields?.map(e=>e.clone())??[];e.push(Q()),"mosaic-dataset"===this.sourceType&&this.fields?.length&&e.push(V()),this.version>=10.4&&null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.some(({name:e})=>"none"===e.toLowerCase())&&e.push(J()),null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.filter(({name:e})=>"none"!==e.toLowerCase()).forEach(({name:t})=>e.push(U(t)));const{rasterInfo:t}=this;if(this._isVectorDataSet()){const i=t?.multidimensionalInfo?.variables[0].unit?.trim(),r=B(i),s=z();e.push(r,s)}if(t?.multidimensionalInfo&&"raster-dataset"===this.sourceType){const i=L(t.multidimensionalInfo);e.push(...i)}const i=t?.attributeTable;if(null!=i){const t=H(i);e.push(...t)}return e}set rasterFunction(e){let t=e;t?.rasterFunction&&(t=$.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("rasterFunction",t)}readRasterFunction(e,t){const i=t.rasterFunctionInfos;return t.renderingRule||i?.length&&"None"!==i[0].name?this._isRFTJson(t.renderingRule)?$.fromJSON({rasterFunctionDefinition:t.renderingRule}):$.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}readSpatialReference(e,t){const i=e||t.extent.spatialReference;return i?f.fromJSON(i):null}writePixelType(e,t,i){null!=this.serviceRasterInfo&&this.pixelType===this.serviceRasterInfo.pixelType||(t[i]=A.toJSON(e))}readVersion(e,t){let i=t.currentVersion;return i||(i=t.hasOwnProperty("fields")||t.hasOwnProperty("timeInfo")?10:9.3),i}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let i=e,{renderer:r,symbolizer:s,pixelFilter:n}=this;const{isRawData:a}=e;if(a&&"lerc"!==this.format&&(r??=K(this.rasterInfo,{bandIds:this.bandIds,variableName:this.rasterFunction?null:this.mosaicRule?.multidimensionalDefinition?.[0].variableName}),s||(this.symbolizer=new ie({rendererJSON:r.toJSON(),rasterInfo:this.rasterInfo}),s=this.symbolizer)),(a||!this.isRenderedFormat)&&r&&s&&!n){await this._updateSymbolizer(s,r);const n=this.bandIds?.length?this.bandIds:Y(this.rasterInfo);i=await this._symbolize({pixelData:e,bandIds:n,symbolizer:s},t)}return i}destroy(){this._shutdownJobHandler()}async calculateVolume(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsCalculateVolume)throw new r("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return e=s(e),this.mosaicRule&&null==e.mosaicRule&&(e.mosaicRule=this.mosaicRule),ae(this.url,e,this._getRequestOptions(t))}async computeAngles(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeAngles)throw new r("imagery-layer:compute-angles","this operation is not supported on the input image service");return oe(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputePixelLocation)throw new r("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return le(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeHistograms)throw new r("imagery-layer:compute-histograms","this operation is not supported on the input image service");return e=s(e),this._applyMosaicAndRenderingRules(e),ue(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeStatisticsHistograms)throw new r("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return e=s(e),this._applyMosaicAndRenderingRules(e),pe(this.url,e,this._getRequestOptions(t))}async measureHeight(e,t){const i=await this._fetchCapabilities(t?.signal);if(!("base-and-top"===e.operationType?i.mensuration.supportsHeightFromBaseAndTop:"base-and-top-shadow"===e.operationType?i.mensuration.supportsHeightFromBaseAndTopShadow:i.mensuration.supportsHeightFromTopAndTopShadow))throw new r("imagery-layer:measure-height","this operation is not supported on the input image service");return e=s(e),this._applyMosaicRule(e),me(this.url,e,this._getRequestOptions(t))}async measureAreaAndPerimeter(e,t){const i=await this._fetchCapabilities(t?.signal);if(!(i.mensuration.supportsAreaAndPerimeter&&(!e.is3D||i.mensuration.supports3D)))throw new r("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return e=s(e),this._applyMosaicRule(e),ce(this.url,e,this._getRequestOptions(t))}async measureDistanceAndAngle(e,t){const i=await this._fetchCapabilities(t?.signal);if(!(i.mensuration.supportsDistanceAndAngle&&(!e.is3D||i.mensuration.supports3D)))throw new r("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return e=s(e),this._applyMosaicRule(e),de(this.url,e,this._getRequestOptions(t))}async measurePointOrCentroid(e,t){const i=await this._fetchCapabilities(t?.signal);if(!(i.mensuration.supportsPointOrCentroid&&(!e.is3D||i.mensuration.supports3D)))throw new r("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return e=s(e),this._applyMosaicRule(e),he(this.url,e,this._getRequestOptions(t))}async measureLengthFromImage(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsMeasureFromImage)throw new r("imagery-layer:measure-length-from-image","this operation is not supported on the input image service");if("polyline"!==e.geometry.type)throw new r("imagery-layer:measure-length-from-image","this input geometry must be a polyline");return fe(this.url,e,this._getRequestOptions(t))}async measureAreaFromImage(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsMeasureFromImage)throw new r("imagery-layer:measure-area-from-image","this operation is not supported on the input image service");if("polygon"!==e.geometry.type)throw new r("imagery-layer:measure-area-from-image","this input geometry must be a polygon");return ye(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return null!=t?t.get(e):void 0}getFieldDomain(e,t){const i=this.getField(e);return i?i.domain:null}async internalFetchImage(e,t,i,r={}){await this._updateCurrentRasterInfo();const{exportImageServiceParameters:s}=this;let n=!1;r.requestRawData&&(await this._initJobHandler(),s.requestRawData||"lerc"===this.format||(n=!0,s.requestRawData=!0));const a=this.getExportImageServiceParameters(e,t,i,r.timeExtent);if(n&&(s.requestRawData=!1,a&&!this.bandIds?.length&&(null==a.bandIds||""===a.bandIds))){const e=Y(this.rasterInfo);a.bandIds=e?.join(",")}if(null==a){if(r.requestAsImageElement&&this._canRequestImageElement(this.format)){const e=document.createElement("canvas");if(e.width=t,e.height=i,r.returnImageBitmap){return{imageBitmap:await C(e,`${He(this.parsedUrl)}/exportImage`,r.signal)}}return{imageOrCanvasElement:e}}const{bandIds:s,rasterInfo:n}=this,a=(s?.length||n.bandCount)??0,o=t*i,l=n.pixelType,u=[];for(let e=0;e<a;e++)u.push(P.createEmptyBand(l,o));return{pixelData:{pixelBlock:new P({width:t,height:i,pixels:u,mask:new Uint8Array(o),pixelType:l}),extent:e}}}const o=!!r.requestAsImageElement&&!this.pixelFilter,l=o&&!!r.returnImageBitmap,u={imageServiceParameters:a,imageProps:{extent:e,width:t,height:i,format:this.format},requestAsImageElement:o,returnImageBitmap:l,signal:r.signal};return this._requestArrayBuffer(u)}async fetchPixels(e,t,i,r={}){await this._initJobHandler(),r.applyRendering&&this._updateCurrentRasterInfo();const s=r.applyRendering?void 0:new D({layer:this,requestRawData:!0,interpolation:r.interpolation??"nearest",bandIds:r.bandIds??[]}),n=this.getExportImageServiceParameters(e,t,i,r.timeExtent,s);if(null==n)return{extent:e,pixelBlock:null};delete n.pixelType,r.bandIds||delete n.bandIds,delete n.compressionQuality;const a={imageServiceParameters:n,imageProps:{extent:e,width:t,height:i,format:this.format},requestAsImageElement:!1,returnImageBitmap:!1,signal:r.signal},{pixelData:o}=await this._requestArrayBuffer(a);return o??{extent:e,pixelBlock:null}}fetchKeyProperties(e){return i(He(this.parsedUrl)+"/keyProperties",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then(e=>e.data)}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new r("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):i(He(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then(e=>je.fromJSON(e.data))}getCatalogItemRasterInfo(e,t){const i={...t,query:this._getQueryParams()};return Ce(He(this.parsedUrl),e,i)}async getCatalogItemICSInfo(e,t){const{data:r}=await i(He(this.parsedUrl)+"/"+e+"/info/ics",{query:this._getQueryParams(),...t}),s=r?.ics;if(!s)return;let n=null;try{n=(await i(He(this.parsedUrl)+"/"+e+"/info",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!n?.spatialReference)return{ics:s,icsToPixelTransform:null,icsExtent:null,northDirection:null};const a=this.version>=10.7?i(He(this.parsedUrl)+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...t}).then(e=>e.data).catch(()=>({})):{},o=n.spatialReference,l={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[n]}),inSR:y(o),outSR:"0:"+e},u=i(He(this.parsedUrl)+"/project",{query:this._getQueryParams(l),...t}).then(e=>e.data).catch(()=>({})),p=5,m=(n.xmin+n.xmax)/2,c=(n.ymax-n.ymin)/(p+1),h=n.ymin+c,g=[];for(let i=0;i<p;i++)g.push({x:m,y:h+c*i});const R={geometries:JSON.stringify({geometryType:"esriGeometryPoint",geometries:g}),inSR:y(o),outSR:"0:"+e},I=i(He(this.parsedUrl)+"/project",{query:this._getQueryParams(R),...t}).then(e=>e.data).catch(()=>({})),v=await Promise.all([a,u,I]);let w=v[0].ipxf;if(null==w){const e=s.geodataXform?.xf_0;"topup"===e?.name?.toLowerCase()&&6===e?.coefficients?.length&&(w={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:e.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const b=d.fromJSON(v[1]?.geometries?.[0]);b&&(b.spatialReference=new f({wkid:0,imageCoordinateSystem:s}));const S=v[2].geometries?v[2].geometries.filter(e=>null!=e?.x&&null!=e.y&&"NaN"!==e.x&&"NaN"!==e.y):[],x=S.length;if(x<3)return{ics:s,icsToPixelTransform:w,icsExtent:b,northDirection:null};let F=0,_=0,D=0,O=0;for(let i=0;i<x;i++)F+=S[i].x,_+=S[i].y,D+=S[i].x*S[i].x,O+=S[i].x*S[i].y;const T=(x*O-F*_)/(x*D-F*F);let C=0;const M=S[p-1].x>S[0].x,N=S[p-1].y>S[0].y;return T===1/0?C=N?90:270:0===T?C=M?0:180:T>0?C=M?180*Math.atan(T)/Math.PI:180*Math.atan(T)/Math.PI+180:T<0&&(C=N?180+180*Math.atan(T)/Math.PI:360+180*Math.atan(T)/Math.PI),{ics:s,icsToPixelTransform:w,icsExtent:b,northDirection:C}}async generateRasterInfo(e,t){const i=m($,e),s={...t,query:this._getQueryParams()};if(!i||"none"===i.functionName?.toLowerCase()||this._isVectorFieldResampleFunction(i))return this.serviceRasterInfo??De(He(this.parsedUrl),this.sourceJSON,s);const n=Ue(i);if(!n)throw new r("imagery-layer:generate-raster-info","the rendering rule is not supported");if(this._functionRasterInfos[n])return this._functionRasterInfos[n];const a=Oe(He(this.parsedUrl),i,s);this._functionRasterInfos[n]=a;try{return await a}catch(o){throw this._functionRasterInfos[n]=null,o}}getExportImageServiceParameters(e,t,i,r,s){e=e.clone().shiftCentralMeridian();const n=ge(e.spatialReference,He(this.parsedUrl));s??=this.exportImageServiceParameters;const a=s.toJSON(),{bandIds:o,noData:l}=a;let{renderingRule:u}=a;const p=this.rasterFunction?.rasterFunctionDefinition,m=this.renderer?.type,c=!m||"raster-stretch"===m||"raster-colormap"===m||"unique-value"===m||"class-breaks"===m||"raster-shaded-relief"===m;if(o?.length&&this._hasRasterFunction(this.rasterFunction)&&!p&&c){const e={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:o}};if("Stretch"===u.rasterFunction)e.rasterFunctionArguments.Raster=u.rasterFunctionArguments.Raster,u.rasterFunctionArguments.Raster=e;else if("Colormap"===u.rasterFunction){const t=u.rasterFunctionArguments.Raster;"Stretch"===t?.rasterFunction?(e.rasterFunctionArguments.Raster=t.rasterFunctionArguments.Raster,t.rasterFunctionArguments.Raster=e):(e.rasterFunctionArguments.Raster=t,u.rasterFunctionArguments.Raster=e)}else e.rasterFunctionArguments.Raster=u,u=e;a.bandIds=void 0}else a.bandIds=o?.join(",");Array.isArray(l)&&l.length>0&&(a.noData=l.join(","));const d=this._processMultidimensionalIntersection(null,r,s.mosaicRule);if(d.isOutSide)return null;a.mosaicRule=null!=d.mosaicRule?JSON.stringify(d.mosaicRule):null,r=d.timeExtent,a.renderingRule=this._getRenderingRuleString($.fromJSON(u));const h={};if(null!=r){const{start:e,end:t}=r.toJSON();e&&t&&e===t?h.time=""+e:null==e&&null==t||(h.time=`${e??"null"},${t??"null"}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:n,imageSR:n,size:t+","+i,...a,...h}}async getSamples(e,t){const i=await this._fetchCapabilities(t?.signal);if(!i?.operations.supportsGetSamples)throw new r("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=s(e);const{raster:n}=this;return n&&null==e.raster&&(e.raster=n),Re(this.url,e,this._getRequestOptions(t))}async identify(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsIdentify)throw new r("imagery-layer:identify","identify operation is not supported on the input image service");e=s(e),this.version<10.91&&"extent"===e.geometry?.type&&(e.geometry=h.fromExtent(e.geometry));const i=this._processMultidimensionalIntersection(e.geometry,e.timeExtent,e.mosaicRule||this.mosaicRule);if(i.isOutSide)throw new r("imagery-layer:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");e.timeExtent=i.timeExtent,e.mosaicRule=i.mosaicRule;const{raster:n,rasterFunction:a}=this;return a&&null==e.rasterFunction&&(e.rasterFunction=a),n&&null==e.raster&&(e.raster=n),Ie(this.url,e,this._getRequestOptions(t))}async imageToMap(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsImageToMap)throw new r("imagery-layer:image-to-map","imageToMap operation is not supported on the input image service");return ve(He(this.parsedUrl),e,this._getRequestOptions(t))}async imageToMapMultiray(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsImageToMapMultiray)throw new r("imagery-layer:image-to-map-multiray","imageToMapMultiray operation is not supported on the input image service");return we(He(this.parsedUrl),e,this._getRequestOptions(t))}async mapToImage(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsMapToImage)throw new r("imagery-layer:map-to-image","mapToImage operation is not supported on the input image service");return be(He(this.parsedUrl),e,this._getRequestOptions(t))}async findImages(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsFindImages)throw new r("imagery-layer:find-images","findImages operation is not supported on the input image service");return Se(He(this.parsedUrl),e,this._getRequestOptions(t))}async getImageUrl(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsGetImageUrl)throw new r("imagery-layer:get-image-url","getImageUrl operation is not supported on the input image service");return xe(He(this.parsedUrl),e,this._getRequestOptions(t))}createQuery(){return new Ae({outFields:["*"],returnGeometry:!0,where:this.definitionExpression||"1=1"})}async queryBoundary(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQueryBoundary)throw new r("imagery-layer:query-boundary","queryBoundary operation is not supported on the input image service");return e=e??{outSpatialReference:this.spatialReference},Fe(He(this.parsedUrl),e,this._getRequestOptions(t))}async queryExtent(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),Ne(this.url,e,t)}async queryRasters(e,t){({query:e,requestOptions:t}=await this._prepareForQuery(e,t));const i=await Pe(this.url,e,t),r=this.graphicOrigin;return i.features.forEach(e=>{e.layer=this,e.origin=r}),i}async queryObjectIds(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),qe(this.url,e,t)}async queryGPSInfo(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQueryGPSInfo)throw new r("imagery-layer:query-gps-info","queryGPSInfo operation is not supported on the input image service");return e=e??{where:"1=1"},_e(He(this.parsedUrl),e,this._getRequestOptions(t))}async queryRasterCount(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),Me(this.url,e,t)}async queryVisibleRasters(e,t){if(!e)throw new r("imagery-layer: query-visible-rasters","missing query parameter");await this.load();const{pixelSize:i,returnDomainValues:s,returnTopmostRaster:n,showNoDataRecords:a}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let o=!1,l=null,u=null;const p=k.servicePixelValue.toLowerCase(),m=this._rasterFunctionNamesIndex;if(null!=e.outFields&&(o=e.outFields.some(e=>!e.toLowerCase().startsWith(p)),this.version>=10.4)){const t=e.outFields.filter(e=>e.toLowerCase().startsWith(p)&&e.length>p.length).map(e=>{const t=e.slice(p.length+1);return[this._updateRenderingRulesFunctionName(t,m),t]});l=t.map(e=>new $({functionName:e[0]})),u=t.map(e=>e[1]);const{rasterFunction:i}=this;0===l.length?i?.functionName?(l.push(i),u.push(i.functionName)):l=null:i?.functionName&&!l.some(e=>e.functionName===i.functionName)&&(l.push(i),u.push(i.functionName))}const c=null==e.outSpatialReference||e.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:d}=this;let f=e.timeExtent||this.timeExtent;if(d){const{isOutside:t,intersection:i}=g(d,{geometry:e.geometry,timeExtent:e.timeExtent,multidimensionalDefinition:this.exportImageServiceParameters.mosaicRule?.multidimensionalDefinition});if(t)throw new r("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");null!=i?.timeExtent&&(f=i.timeExtent)}const y=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,f);let I=e.geometry;this.version<10.91&&"extent"===I?.type&&(I=h.fromExtent(I));const v=this._getQueryParams({geometry:I,timeExtent:f,mosaicRule:y,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:l,pixelSize:i,returnCatalogItems:o,returnGeometry:c,raster:this.raster,maxItemCount:n?1:null});delete v.f;const w=new Ee(v);try{await this._generateRasterInfo(this.rasterFunction);const i=await Ie(this.url,w,{signal:t?.signal,query:{...this.customParameters}}),r=e.outFields,n=null!=i.value&&i.value.toLowerCase().includes("nodata"),l=o&&!c&&i?.catalogItems?.features.length&&(a||!n),p=this.multidimensionalInfo&&"raster-dataset"===this.sourceType?R({rasterInfo:this.rasterInfo,multidimensionalDefinition:y?.multidimensionalDefinition,timeExtent:f,multidimensionalSubset:this.multidimensionalSubset}):null;if(!l)return this._processVisibleRastersResponse(i,{returnDomainValues:s,templateRRFunctionNames:u,showNoDataRecords:a,templateFields:r,effectiveMultidimensionalDefinition:p});const m=this.objectIdField||"ObjectId",d=i.catalogItems?.features??[],h=d.map(e=>e.attributes?.[m]),g=new Ae({objectIds:h,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[m]}),I=await this.queryRasters(g);return I?.features?.length&&I.features.forEach(t=>{d.forEach(i=>{i.attributes[m]===t.attributes[m]&&t.geometry&&(i.geometry=t.geometry.clone(),null!=e.outSpatialReference&&(i.geometry.spatialReference=e.outSpatialReference))})}),this._processVisibleRastersResponse(i,{returnDomainValues:s,templateRRFunctionNames:u,showNoDataRecords:a,templateFields:r,effectiveMultidimensionalDefinition:p})}catch{throw new r("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,t){const r=i(He(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:e}),signal:t}).then(e=>e.data?.statistics),s=i(He(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:e}),signal:t}).then(e=>e.data?.histograms),n=await Promise.all([r,s]);return n[0]&&n[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),{statistics:n[0]||null,histograms:n[1]||null}}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo.multidimensionalInfo;return I(this.multidimensionalSubset,t)}async _fetchService(e){await this._fetchServiceInfo(e),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,i=null!=this.serviceRasterInfo?Promise.resolve(this.serviceRasterInfo):De(He(this.parsedUrl),t,{signal:e,query:this._getQueryParams()}).then(e=>(this._set("serviceRasterInfo",e),this._set("multidimensionalInfo",e.multidimensionalInfo),Te(e,t),e)),r=this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:e}):null,s=this._getRasterFunctionInfos();return Promise.all([i,r,s]).then(e=>{e[1]?this._set("rasterInfo",e[1]):this._set("rasterInfo",e[0]),e[2]&&this._set("rasterFunctionInfos",e[2]),this.internalRenderer&&!this._isSupportedRenderer(this.internalRenderer)&&(this._set("internalRenderer",null),n.getLogger(this).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("internalRenderer",this._configRenderer(this.renderer)),this.addHandles([a(()=>this.rasterFunction,e=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(e).then(e=>{e&&(this.rasterInfo=e)})})]);const{serviceRasterInfo:t}=this;null!=t.multidimensionalInfo&&this._updateMultidimensionalDefinition(t)})}_combineMosaicRuleWithTimeExtent(e,t){const i=this.timeInfo,{multidimensionalInfo:r}=this.serviceRasterInfo;if(null==e||null==r||null==t||null==i?.startField)return e;const{startField:s}=i,n=r.variables.some(e=>e.dimensions.some(e=>e.name===s))?s:"StdTime";if(e=e.clone(),"mosaic-dataset"===this.sourceType)return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter(e=>e.dimensionName!==n),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const a=e.multidimensionalDefinition.filter(e=>e.dimensionName===n),o=null!=t.start?t.start.getTime():null,l=null!=t.end?t.end.getTime():null,u=null==o||null==l||o===l,p=u?[o||l]:[[o,l]],m=this.version>=10.8;if(a.length)a.forEach(e=>{e.dimensionName===n&&(m?(e.dimensionName=null,e.isSlice=!1,e.values=[]):(e.isSlice=u,e.values=p))});else if(!m){const t=e.multidimensionalDefinition.filter(e=>null!=e.variableName&&null==e.dimensionName);t.length?t.forEach(e=>{e.dimensionName=n,e.isSlice=u,e.values=p}):e.multidimensionalDefinition.push(new _({variableName:"",dimensionName:n,isSlice:u,values:p}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return null==e?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter(e=>!(!e.variableName&&!e.dimensionName)),0===e.multidimensionalDefinition.length&&(e.multidimensionalDefinition=null)),"mosaic-dataset"!==this.sourceType&&null==e.multidimensionalDefinition?null:e)}async _prepareForQuery(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQuery)throw new r("imagery-layer:query-rasters","query operation is not supported on the input image service");const i=null!=e?m(Ae,e):this.createQuery();return t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:i,requestOptions:t}}_isSupportedRenderer(e){const{rasterInfo:t,rasterFunction:i}=this;return"unique-value"===e.type&&this._hasRasterFunction(i)&&1===t?.bandCount&&["u8","s8"].includes(t.pixelType)||null!=t&&null!=e&&Z(t).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let t=this.sourceJSON;if(!t){const{data:r,ssl:s}=await i(He(this.parsedUrl),{query:this._getQueryParams(),signal:e});t=r,this.sourceJSON=t,s&&(this.url=this.url.replace(/^http:/i,"https:"))}if(t.capabilities?.toLowerCase().split(",").map(e=>e.trim()).indexOf("tilesonly")>-1)throw new r("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(t,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?"esriImageServiceSourceTypeMosaicDataset"===e.serviceSourceType:e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;const t=this._isMosaicDataset(e),i=e.currentVersion>=10.71&&e.hasMultidimensions&&!(e.fields?.length>1);return t||i}_isVectorFieldResampleFunction(e){if(null==e)return!1;const{functionName:t,functionArguments:i}=e,r="resample"===t?.toLowerCase(),s=i?.ResampleType||i?.resampleType;return r&&(7===s||10===s)}_configRenderer(e){const{rasterInfo:t}=this;if(!this.isRenderedFormat&&!this.pixelFilter||this._isVectorDataSet()){const i=this.mosaicRule?.multidimensionalDefinition?.[0].variableName,r=ee({variableName:i,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>=3){const e=r?.bandIds??Y(t);!e||3===t.bandCount&&0===e[0]&&1===e[1]&&2===e[2]||(this.bandIds=e)}e||(e=r?.renderer??K(t,{bandIds:this.bandIds,variableName:this.rasterFunction?null:i}));const s=te(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=s,this.symbolizer.rasterInfo=t):this.symbolizer=new ie({rendererJSON:s,rasterInfo:t}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return null==e?e:{extent:e.extent&&e.extent.clone(),pixelBlock:null!=e.pixelBlock?e.pixelBlock.clone():null}}_getQueryParams(e){null!=e?.renderingRule&&"string"!=typeof e.renderingRule&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:t,viewId:i}=this;return{raster:t,viewId:i,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,t,i){return this._rasterJobHandler?this._rasterJobHandler.decode({data:e,options:t}):w(e,t,i)}async _getRasterFunctionInfos(e){const t=this.sourceJSON.rasterFunctionInfos;if(this.loaded)return t;if(t&&this.version>=10.3){if(1===t.length&&"none"===t[0].name.toLowerCase())return t;const r=await i(He(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e});return r.data?.rasterFunctionInfos}return null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes("png"))}async _requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:s,returnImageBitmap:n,signal:a}=e;if(s&&this._canRequestImageElement(t.format)){const r=`${He(this.parsedUrl)}/exportImage`,{data:s}=await i(r,{responseType:n?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...e.imageServiceParameters}),signal:a});if(s instanceof Blob){return{imageBitmap:await C(s,r,a),params:t}}return{imageOrCanvasElement:s,params:t}}const o=this._initJobHandler(),l=i(He(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:a}),u=(await Promise.all([l,o]))[0].data,p=t.format||"jpgpng";let m=p;if("bsq"!==m&&"bip"!==m&&(m=b(u)),!m)throw new r("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(u)));const c={signal:a},d=this._decodePixelBlock(u,{width:t.width,height:t.height,format:p,applyJpegMask:!0},c);return{pixelData:{pixelBlock:await d,extent:t.extent},params:t}}_generateRasterInfo(e,t){return this.generateRasterInfo(e,t).catch(()=>null)}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this.defaultMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let t=v(e,{multidimensionalSubset:this.multidimensionalSubset});if(null!=t&&t.length>0){this.mosaicRule=this.mosaicRule||new N;const e=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&"none"!==this.rasterFunction.functionName?.toLowerCase()&&t.forEach(e=>e.variableName=""),t=t.filter(({variableName:e,dimensionName:t})=>e&&"*"!==e||t),!e?.length&&t.length&&(this.mosaicRule.multidimensionalDefinition=t)}}_processVisibleRastersResponse(e,i){i=i||{};const r=e.value,{templateRRFunctionNames:s,showNoDataRecords:n,returnDomainValues:a,templateFields:o}=i,l=e.processedValues;let u=e.catalogItems?.features,p=e.properties?.Values?.map(e=>e.replaceAll(/ /gi,", "))||[];const m=this.objectIdField||"ObjectId",c="string"==typeof r&&r.toLowerCase().includes("nodata"),d=[];if(r&&!u&&(!c||n)){const e={};e[m]=0;p=[r],u=[new t({geometry:this.fullExtent,attributes:e})],this.multidimensionalInfo&&"raster-dataset"===this.sourceType&&G(this.rasterFields,e,i.effectiveMultidimensionalDefinition)}if(!u)return[];this._updateResponseFieldNames(u,o),c&&!n&&(u=[]);const{itemPixelValue:h,servicePixelValue:f}=k,y=this.rasterFields.some(e=>e.name===h),g=this.graphicOrigin;for(let t=0;t<u.length;t++){const e=u[t];if(null!=r){const i=p[t],a=this.rasterFunction&&l&&l.length>0&&s&&s.length>0&&s.includes(this.rasterFunction.functionName)?l[s.indexOf(this.rasterFunction.functionName)]:r;if("nodata"===i.toLowerCase()&&!n)continue;y&&(e.attributes[h]=i),e.attributes[f]=a,this._updateFeatureWithMagDirValues(e,i);const o=this.fields&&this.fields.length>0;let u=this.rasterFunction&&null!=this.serviceRasterInfo.attributeTable?o?i:r:a;this.rasterFunction||(u=o?i:r),this._updateFeatureWithRasterAttributeTableValues(e,u)}if(e.sourceLayer=e.layer=this,e.origin=g,a&&this._updateFeatureWithDomainValues(e),s&&l&&s.length===l.length)for(let t=0;t<s.length;t++){const i=`${k.servicePixelValue}.${s[t]}`;e.attributes[i]=l[t]}d.push(u[t])}return d}_processMultidimensionalIntersection(e,t,i){const{multidimensionalSubset:r}=this;if(!r)return{isOutSide:!1,timeExtent:t,mosaicRule:i=this._combineMosaicRuleWithTimeExtent(i,t)};if(r){const{isOutside:i,intersection:s}=g(r,{geometry:e,timeExtent:t});if(i)return{isOutSide:!0,timeExtent:null,mosaicRule:null};null!=s?.timeExtent&&(t=s.timeExtent)}if(i=this._combineMosaicRuleWithTimeExtent(i,t),i?.multidimensionalDefinition){const{isOutside:e}=g(r,{multidimensionalDefinition:i.multidimensionalDefinition});if(e)return{isOutSide:!0,timeExtent:null,mosaicRule:null}}return{isOutSide:!1,timeExtent:t,mosaicRule:i}}_updateFeatureWithRasterAttributeTableValues(e,t){const i=this.rasterInfo.attributeTable||this.serviceRasterInfo.attributeTable;if(null==i)return;const{features:r,fields:s}=i,n=s.map(e=>e.name).find(e=>"value"===e.toLowerCase());if(!n)return;const a=r.filter(e=>e.attributes[n]===(null!=t?parseInt(t,10):null));a&&a[0]&&s.forEach(t=>{const i=W+t.name;e.attributes[i]=a[0].attributes[t.name]})}_updateFeatureWithMagDirValues(e,t){if(!this._isVectorDataSet())return;const i=t.split(/,\s*/).map(e=>parseFloat(e)),r=i.map(e=>[e]),s=i.map(e=>({minValue:e,maxValue:e,noDataValue:null})),n=new P({height:1,width:1,pixelType:"f32",pixels:r,statistics:s});null!=this.pixelFilter&&this.pixelFilter({pixelBlock:n,extent:new d(0,0,0,0,this.spatialReference)});const a="esriImageServiceDataTypeVector-MagDir"===this.serviceDataType?[n.pixels[0][0],n.pixels[1][0]]:S([n.pixels[0][0],n.pixels[1][0]]);e.attributes[k.magnitude]=a[0],e.attributes[k.direction]=a[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter(e=>"coded-value"===e.domain?.type);null!=t&&t.forEach(t=>{const i=e.attributes[t.name];if(null!=i){const r=t.domain.codedValues.find(e=>e.code===i);r&&(e.attributes[t.name]=r.name)}})}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const i=this.fieldsIndex;null!=i&&e.forEach(e=>{if(e?.attributes)for(const r of t){const t=i.get(r)?.name;t&&t!==r&&(e.attributes[r]=e.attributes[t],delete e.attributes[t])}})}_getRenderingRuleString(e){if(e){let t=e.toJSON();return t=t.rasterFunctionDefinition??t,(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=null),JSON.stringify(t)}return null}_hasRasterFunction(e){return null!=e?.functionName&&"none"!==e.functionName.toLowerCase()}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if("Raw"===e)return e.replace("Raw","None");const i=e.toLowerCase().replaceAll(/ /gi,"_");return t.has(i)?t.get(i):e}_isRFTJson(e){return e?.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return"esriImageServiceDataTypeVector-UV"===this.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===this.serviceDataType}_applyMosaicAndRenderingRules(e){const{raster:t,mosaicRule:i,rasterFunction:r}=this;r&&null==e.rasterFunction&&(e.rasterFunction=r),i&&null==e.mosaicRule&&(e.mosaicRule=i),t&&null==e.raster&&(e.raster=t)}async _updateCurrentRasterInfo(e){if(this.renderer||this.symbolizer){const t=await this._generateRasterInfo(this.rasterFunction,{signal:e});t&&(this.rasterInfo=t)}}_applyMosaicRule(e){const{raster:t,mosaicRule:i}=this;i&&null==e.mosaicRule&&(e.mosaicRule=i),t&&null==e.raster&&(e.raster=t)}_readCapabilities(e){const t=e.capabilities?e.capabilities.toLowerCase().split(",").map(e=>e.trim()):["image","catalog"],{currentVersion:i,maxRecordCount:r}=e,s=t.includes("image"),n="esriImageServiceDataTypeElevation"===e.serviceDataType,a=!(!e.spatialReference&&!e.extent?.spatialReference),o=t.includes("edit"),l=t.includes("mensuration")&&a,u=null==e.mensurationCapabilities?[]:e.mensurationCapabilities.toLowerCase().split(",").map(e=>e.trim()),p=l&&u.includes("basic"),m=this._isMosaicDataset(e)&&t.includes("catalog"),c=t.includes("download"),d=i>=10.7&&n||i>=11.4&&(n||l&&u.includes("3d")),h=m&&e.fields&&e.fields.length>0,f=h&&e.supportsAdvancedQueries?e.advancedQueryCapabilities:void 0;return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:s,supportsExportImage:s,supportsIdentify:s,supportsImageToMap:i>=11.2&&m,supportsImageToMapMultiray:i>=11.2&&m,supportsMapToImage:i>=11.2&&m,supportsFindImages:i>=11.2&&m,supportsGetImageUrl:i>=11.3&&c,supportsMeasure:l,supportsMeasureFromImage:i>=11.2,supportsDownload:c,supportsQuery:h,supportsGetSamples:i>=10.2&&s,supportsProject:i>=10.3&&s,supportsComputeStatisticsHistograms:i>=10.4&&s,supportsQueryBoundary:i>=10.6&&s,supportsCalculateVolume:d,supportsComputePixelLocation:i>=10.7&&m,supportsComputeAngles:i>=10.91,supportsQueryGPSInfo:i>=11.2&&m,supportsAdd:o,supportsDelete:o,supportsEditing:o,supportsUpdate:o,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:r,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,relativeTimeBinWindow:void 0,supportsStatistics:!!f?.supportsStatistics,supportsOrderBy:!!f?.supportsOrderBy,supportsDistinct:!!f?.supportsDistinct,supportsPagination:!!f?.supportsPagination,supportsPaginationOnAggregatedQueries:!!f?.supportsPaginationOnAggregatedQueries,supportsStandardizedQueriesOnly:!!f?.useStandardizedQueries,supportsPercentileStatistics:!!f?.supportsPercentileStatistics,supportsCentroid:!!f?.supportsReturningGeometryCentroid,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDistance:!!f?.supportsQueryWithDistance,supportsExtent:!!f?.supportsReturningQueryExtent,supportsGeometryProperties:!!f?.supportsReturningGeometryProperties,supportsHavingClause:!!f?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:f?.supportsSqlExpression??!!f,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsFormatPBFWithCurves:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!f?.supportsDefaultSR,supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,standardMaxRecordCountNoGeometry:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1},mensuration:{supportsDistanceAndAngle:p,supportsAreaAndPerimeter:p,supportsPointOrCentroid:p,supportsHeightFromBaseAndTop:l&&u.includes("base-top height"),supportsHeightFromBaseAndTopShadow:l&&u.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:l&&u.includes("top-top shadow height"),supports3D:l&&u.includes("3d")}}}};function He(e){return e?.path??""}return e([l({clonable:!1})],Le.prototype,"_functionRasterInfos",void 0),e([l({readOnly:!0})],Le.prototype,"_serviceSupportsMosaicRule",void 0),e([Qe("_serviceSupportsMosaicRule",["currentVersion","fields"])],Le.prototype,"readServiceSupportsMosaicRule",null),e([l({readOnly:!0})],Le.prototype,"_rasterFunctionNamesIndex",null),e([l()],Le.prototype,"adjustAspectRatio",void 0),e([l({type:[p],json:{write:!0}})],Le.prototype,"bandIds",void 0),e([Qe("bandIds")],Le.prototype,"readBandIds",null),e([l({readOnly:!0,json:{read:!1}})],Le.prototype,"capabilities",void 0),e([Qe("service","capabilities",["capabilities","currentVersion","serviceDataType"])],Le.prototype,"readCapabilities",null),e([l({type:Number})],Le.prototype,"compressionQuality",void 0),e([Ve("compressionQuality")],Le.prototype,"writeCompressionQuality",null),e([l({type:Number})],Le.prototype,"compressionTolerance",void 0),e([Ve("compressionTolerance")],Le.prototype,"writeCompressionTolerance",null),e([l({json:{read:{source:"copyrightText"}}})],Le.prototype,"copyright",void 0),e([l({readOnly:!0})],Le.prototype,"defaultMosaicRule",void 0),e([Qe("defaultMosaicRule",["defaultMosaicMethod"])],Le.prototype,"readDefaultMosaicRule",null),e([l({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Le.prototype,"definitionExpression",void 0),e([l({readOnly:!0,constructOnly:!0})],Le.prototype,"exportImageServiceParameters",void 0),e([l()],Le.prototype,"rasterInfo",void 0),e([l({readOnly:!0,type:[O]})],Le.prototype,"fields",void 0),e([l({readOnly:!0})],Le.prototype,"fieldsIndex",null),e([l({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff","bip","bsq"],json:{write:!0}})],Le.prototype,"format",null),e([Qe("service","format",["serviceDataType"])],Le.prototype,"readFormat",null),e([l({type:d})],Le.prototype,"fullExtent",void 0),e([l({readOnly:!0})],Le.prototype,"hasMultidimensions",void 0),e([l({json:{read:{source:"maxImageHeight"}}})],Le.prototype,"imageMaxHeight",void 0),e([l({json:{read:{source:"maxImageWidth"}}})],Le.prototype,"imageMaxWidth",void 0),e([l({type:String,json:{type:j.jsonValues,read:j.read,write:j.write}})],Le.prototype,"interpolation",void 0),e([l()],Le.prototype,"minScale",void 0),e([Qe("service","minScale")],Le.prototype,"readMinScale",null),e([l()],Le.prototype,"maxScale",void 0),e([Qe("service","maxScale")],Le.prototype,"readMaxScale",null),e([l({type:N})],Le.prototype,"mosaicRule",null),e([Qe("mosaicRule",["mosaicRule","defaultMosaicMethod"])],Le.prototype,"readMosaicRule",null),e([Ve("mosaicRule")],Le.prototype,"writeMosaicRule",null),e([l()],Le.prototype,"multidimensionalInfo",void 0),e([l({type:q,json:{write:!0}})],Le.prototype,"multidimensionalSubset",void 0),e([l({json:{type:[Number,[Number]],write:!0}})],Le.prototype,"noData",void 0),e([l({type:String,json:{type:E.jsonValues,read:E.read,write:E.write}})],Le.prototype,"noDataInterpretation",void 0),e([l({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],Le.prototype,"objectIdField",void 0),e([Qe("objectIdField")],Le.prototype,"readObjectIdField",null),e([l({readOnly:!0})],Le.prototype,"geometryType",void 0),e([l({})],Le.prototype,"typeIdField",void 0),e([l({})],Le.prototype,"types",void 0),e([l({readOnly:!0})],Le.prototype,"parsedUrl",null),e([l({type:Function})],Le.prototype,"pixelFilter",void 0),e([l()],Le.prototype,"raster",void 0),e([l({readOnly:!0})],Le.prototype,"sourceType",void 0),e([Qe("sourceType",["serviceSourceType","fields"])],Le.prototype,"readSourceType",null),e([l()],Le.prototype,"viewId",void 0),e([l({types:re})],Le.prototype,"renderer",null),e([l({types:re,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:se,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],Le.prototype,"internalRenderer",null),e([Qe("internalRenderer")],Le.prototype,"readRenderer",null),e([Ve("internalRenderer")],Le.prototype,"writeRenderer",null),e([l({clonable:!1})],Le.prototype,"symbolizer",void 0),e([l(x)],Le.prototype,"opacity",void 0),e([l({readOnly:!0})],Le.prototype,"rasterFields",null),e([l({constructOnly:!0})],Le.prototype,"rasterFunctionInfos",void 0),e([l({type:$,json:{name:"renderingRule"}})],Le.prototype,"rasterFunction",null),e([Qe("rasterFunction",["renderingRule","rasterFunctionInfos"])],Le.prototype,"readRasterFunction",null),e([l({readOnly:!0})],Le.prototype,"serviceDataType",void 0),e([l({readOnly:!0,type:f})],Le.prototype,"spatialReference",void 0),e([Qe("spatialReference",["spatialReference","extent"])],Le.prototype,"readSpatialReference",null),e([l({type:A.apiValues,json:{read:A.read,type:A.jsonValues}})],Le.prototype,"pixelType",void 0),e([Ve("pixelType")],Le.prototype,"writePixelType",null),e([l({constructOnly:!0,type:X})],Le.prototype,"serviceRasterInfo",void 0),e([l()],Le.prototype,"sourceJSON",void 0),e([l(F)],Le.prototype,"url",void 0),e([l({readOnly:!0})],Le.prototype,"version",void 0),e([Qe("version",["currentVersion","fields","timeInfo"])],Le.prototype,"readVersion",null),Le=e([u("esri.layers.mixins.ArcGISImageService")],Le),Le};export{Be as ArcGISImageService};
2
+ import{__decorate as e}from"tslib";import t from"../../Graphic.js";import i from"../../request.js";import r from"../../core/Error.js";import{clone as s}from"../../core/lang.js";import n from"../../core/Logger.js";import{watch as a}from"../../core/reactiveUtils.js";import{urlToObject as o}from"../../core/urlUtils.js";import{property as l,subclass as u}from"../../core/accessorSupport/decorators.js";import{Integer as p,ensureClass as m}from"../../core/accessorSupport/ensureType.js";import{runUntracked as c}from"../../core/accessorSupport/tracking.js";import h from"../../geometry/Extent.js";import d from"../../geometry/Polygon.js";import f from"../../geometry/SpatialReference.js";import{srToRESTValue as y}from"../../geometry/support/spatialReferenceUtils.js";import{intersectMultimensionalSubset as g,getEffectiveMultidimensionalDefinition as R,getSubsetVariablesFromMdInfo as I,getDefaultMultidimensionalDefinition as w}from"../raster/datasets/multidimensionalUtils.js";import{decode as v,getFormat as b}from"../raster/formats/RasterCodec.js";import{uvComponentToVector as x}from"../raster/functions/vectorFieldUtils.js";import{opacity as S,url as F}from"../support/commonProperties.js";import _ from"../support/DimensionalDefinition.js";import{ExportImageServiceParameters as D}from"../support/ExportImageServiceParameters.js";import O from"../support/Field.js";import T from"../support/FieldsIndex.js";import{createBitmap as C}from"../support/imageBitmapUtils.js";import{isSupportedRendererType as M}from"../support/imageryRendererUtils.js";import q from"../support/MosaicRule.js";import N from"../support/MultidimensionalSubset.js";import P from"../support/PixelBlock.js";import{interpolationKebab as j,noDataInterpretationKebab as E,pixelTypeKebabDict as A}from"../support/rasterEnums.js";import{getServicePixelValueField as Q,getItemPixelValueField as V,getRawServicePixelValueField as J,getProcessedServicePixelValueField as U,getMagnitudeField as B,getDirectionField as z,getMultidimensionalFields as L,getRasterAttributeTableFields as H,addMultidimensionalFieldValues as G,commonRasterFieldNames as k,rasterFieldPrefix as W}from"../support/rasterFieldUtils.js";import $ from"../support/RasterFunction.js";import X from"../support/RasterInfo.js";import{createDefaultRenderer as K,getDefaultBandCombination as Y,getSupportedRendererTypes as Z,matchPresetRenderer as ee,normalizeRendererJSON as te}from"../../renderers/support/rasterRendererHelper.js";import ie from"../../renderers/support/RasterSymbolizer.js";import{rasterRendererTypes as re,websceneRasterRendererTypes as se,read as ne}from"../../renderers/support/rasterTypeUtils.js";import{calculateVolume as ae,computeAngles as oe,computePixelSpaceLocations as le,computeHistograms as ue,computeStatisticsHistograms as pe,measureHeight as me,measureAreaAndPerimeter as ce,measureDistanceAndAngle as he,measurePointOrCentroid as de,measureLengthFromImage as fe,measureAreaFromImage as ye,getImageSpatialReferenceQueryParameter as ge,getSamples as Re,identify as Ie,imageToMap as we,imageToMapMultiray as ve,mapToImage as be,findImages as xe,getImageUrl as Se,queryBoundary as Fe,queryGPSInfo as _e}from"../../rest/imageService.js";import{fetchServiceRasterInfo as De,generateRasterInfo as Oe,patchServiceInfo as Te}from"../../rest/imageService/fetchRasterInfo.js";import{getCatalogItemRasterInfo as Ce}from"../../rest/imageService/getCatalogItemRasterInfo.js";import{executeForCount as Me}from"../../rest/query/executeForCount.js";import{executeForExtent as qe}from"../../rest/query/executeForExtent.js";import{executeForIds as Ne}from"../../rest/query/executeForIds.js";import{executeQueryJSON as Pe}from"../../rest/query/executeQueryJSON.js";import je from"../../rest/support/FeatureSet.js";import Ee from"../../rest/support/ImageIdentifyParameters.js";import Ae from"../../rest/support/Query.js";import{reader as Qe}from"../../core/accessorSupport/decorators/reader.js";import{writer as Ve}from"../../core/accessorSupport/decorators/writer.js";const Je=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]);function Ue(e){const t=JSON.stringify(e),i=t.includes('"rasterFunctionDefinition":{'),r=i?t.match(/"type":"(.*?FunctionArguments")/gi):t.match(/"rasterFunction":"(.*?")/gi),s=r?.map(e=>i?e.slice(8,-18):e.slice(18,-1));return s?s.join("/"):null}const Be=Be=>{const ze=Be;let Le=class extends ze{constructor(){super(...arguments),this._functionRasterInfos={},this._serviceSupportsMosaicRule=null,this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new D({layer:this}))}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.length<1||null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.forEach(t=>{e.set(t.name.toLowerCase().replaceAll(/ /gi,"_"),t.name)}),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every(e=>"number"==typeof e))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,i){null!=e&&"lerc"!==this.format&&(t[i]=e)}writeCompressionTolerance(e,t,i){"lerc"===this.format&&null!=e&&(t[i]=e)}readDefaultMosaicRule(e,t){return this._serviceSupportsMosaicRule?c(()=>q.fromJSON(t)):null}get fieldsIndex(){return this.fields?new T(this.fields):null}set format(e){e&&Je.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,t){return"esriImageServiceDataTypeVector-UV"===t.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===t.serviceDataType||null!=this.pixelFilter?"lerc":"jpgpng"}get isRenderedFormat(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}set mosaicRule(e){let t=e;t?.mosaicMethod&&(t=q.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}readMosaicRule(e,t){const i=e||t.mosaicRule;return i?q.fromJSON(i):this._isMosaicRuleSupported(t)?q.fromJSON(t):null}writeMosaicRule(e,t,i){const{mosaicRule:r}=this;this._isValidCustomizedMosaicRule(r)&&(t[i]=r.toJSON())}readObjectIdField(e,t){if(!e){const i=t.fields.find(e=>"esriFieldTypeOID"===e.type||"oid"===e.type);e=i?.name}return e}get parsedUrl(){return o(this.url)}readSourceType(e,t){return this._isMosaicDataset(t)?"mosaic-dataset":"raster-dataset"}get renderer(){const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find(({name:t})=>t===e);return i?.renderer.clone()}return this.internalRenderer}set renderer(e){this.activePresetRendererName=null,this.internalRenderer=e}set internalRenderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("internalRenderer",e)}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer,s=ne(r,i);return null==s?null:("vector-field"===s.type&&t.symbolTileSize&&!r.symbolTileSize&&(s.symbolTileSize=t.symbolTileSize),M(s)||n.getLogger(this).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),s)}writeRenderer(e,t,i){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON()}get rasterFields(){const e=this.fields?.map(e=>e.clone())??[];e.push(Q()),"mosaic-dataset"===this.sourceType&&this.fields?.length&&e.push(V()),this.version>=10.4&&null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.some(({name:e})=>"none"===e.toLowerCase())&&e.push(J()),null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.filter(({name:e})=>"none"!==e.toLowerCase()).forEach(({name:t})=>e.push(U(t)));const{rasterInfo:t}=this;if(this._isVectorDataSet()){const i=t?.multidimensionalInfo?.variables[0].unit?.trim(),r=B(i),s=z();e.push(r,s)}if(t?.multidimensionalInfo&&"raster-dataset"===this.sourceType){const i=L(t.multidimensionalInfo);e.push(...i)}const i=t?.attributeTable;if(null!=i){const t=H(i);e.push(...t)}return e}set rasterFunction(e){let t=e;t?.rasterFunction&&(t=$.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("rasterFunction",t)}readRasterFunction(e,t){const i=t.rasterFunctionInfos;return t.renderingRule||i?.length&&"None"!==i[0].name?this._isRFTJson(t.renderingRule)?$.fromJSON({rasterFunctionDefinition:t.renderingRule}):$.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}readSpatialReference(e,t){const i=e||t.extent.spatialReference;return i?f.fromJSON(i):null}writePixelType(e,t,i){null!=this.serviceRasterInfo&&this.pixelType===this.serviceRasterInfo.pixelType||(t[i]=A.toJSON(e))}readVersion(e,t){let i=t.currentVersion;return i||(i=t.hasOwnProperty("fields")||t.hasOwnProperty("timeInfo")?10:9.3),i}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let i=e,{renderer:r,symbolizer:s,pixelFilter:n}=this;const{isRawData:a}=e;if(a&&"lerc"!==this.format&&(r??=K(this.rasterInfo,{bandIds:this.bandIds,variableName:this.rasterFunction?null:this.mosaicRule?.multidimensionalDefinition?.[0].variableName}),s||(this.symbolizer=new ie({rendererJSON:r.toJSON(),rasterInfo:this.rasterInfo}),s=this.symbolizer)),(a||!this.isRenderedFormat)&&r&&s&&!n){await this._updateSymbolizer(s,r);const n=this.bandIds?.length?this.bandIds:Y(this.rasterInfo);i=await this._symbolize({pixelData:e,bandIds:n,symbolizer:s},t)}return i}destroy(){this._shutdownJobHandler()}async calculateVolume(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsCalculateVolume)throw new r("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return e=s(e),this.mosaicRule&&null==e.mosaicRule&&(e.mosaicRule=this.mosaicRule),ae(this.url,e,this._getRequestOptions(t))}async computeAngles(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeAngles)throw new r("imagery-layer:compute-angles","this operation is not supported on the input image service");return oe(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputePixelLocation)throw new r("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return le(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeHistograms)throw new r("imagery-layer:compute-histograms","this operation is not supported on the input image service");return e=s(e),this._applyMosaicAndRenderingRules(e),ue(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeStatisticsHistograms)throw new r("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return e=s(e),this._applyMosaicAndRenderingRules(e),pe(this.url,e,this._getRequestOptions(t))}async measureHeight(e,t){const i=await this._fetchCapabilities(t?.signal);if(!("base-and-top"===e.operationType?i.mensuration.supportsHeightFromBaseAndTop:"base-and-top-shadow"===e.operationType?i.mensuration.supportsHeightFromBaseAndTopShadow:i.mensuration.supportsHeightFromTopAndTopShadow))throw new r("imagery-layer:measure-height","this operation is not supported on the input image service");return e=s(e),this._applyMosaicRule(e),me(this.url,e,this._getRequestOptions(t))}async measureAreaAndPerimeter(e,t){const i=await this._fetchCapabilities(t?.signal);if(!(i.mensuration.supportsAreaAndPerimeter&&(!e.is3D||i.mensuration.supports3D)))throw new r("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return e=s(e),this._applyMosaicRule(e),ce(this.url,e,this._getRequestOptions(t))}async measureDistanceAndAngle(e,t){const i=await this._fetchCapabilities(t?.signal);if(!(i.mensuration.supportsDistanceAndAngle&&(!e.is3D||i.mensuration.supports3D)))throw new r("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return e=s(e),this._applyMosaicRule(e),he(this.url,e,this._getRequestOptions(t))}async measurePointOrCentroid(e,t){const i=await this._fetchCapabilities(t?.signal);if(!(i.mensuration.supportsPointOrCentroid&&(!e.is3D||i.mensuration.supports3D)))throw new r("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return e=s(e),this._applyMosaicRule(e),de(this.url,e,this._getRequestOptions(t))}async measureLengthFromImage(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsMeasureFromImage)throw new r("imagery-layer:measure-length-from-image","this operation is not supported on the input image service");if("polyline"!==e.geometry.type)throw new r("imagery-layer:measure-length-from-image","this input geometry must be a polyline");return fe(this.url,e,this._getRequestOptions(t))}async measureAreaFromImage(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsMeasureFromImage)throw new r("imagery-layer:measure-area-from-image","this operation is not supported on the input image service");if("polygon"!==e.geometry.type)throw new r("imagery-layer:measure-area-from-image","this input geometry must be a polygon");return ye(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return null!=t?t.get(e):void 0}getFieldDomain(e,t){const i=this.getField(e);return i?i.domain:null}async internalFetchImage(e,t,i,r={}){await this._updateCurrentRasterInfo();const{exportImageServiceParameters:s}=this;let n=!1;r.requestRawData&&(await this._initJobHandler(),s.requestRawData||"lerc"===this.format||(n=!0,s.requestRawData=!0));const a=this.getExportImageServiceParameters(e,t,i,r.timeExtent);if(n&&(s.requestRawData=!1,a&&!this.bandIds?.length&&(null==a.bandIds||""===a.bandIds))){const e=Y(this.rasterInfo);a.bandIds=e?.join(",")}if(null==a){if(r.requestAsImageElement&&this._canRequestImageElement(this.format)){const e=document.createElement("canvas");if(e.width=t,e.height=i,r.returnImageBitmap){return{imageBitmap:await C(e,`${He(this.parsedUrl)}/exportImage`,r.signal)}}return{imageOrCanvasElement:e}}const{bandIds:s,rasterInfo:n}=this,a=(s?.length||n.bandCount)??0,o=t*i,l=n.pixelType,u=[];for(let e=0;e<a;e++)u.push(P.createEmptyBand(l,o));return{pixelData:{pixelBlock:new P({width:t,height:i,pixels:u,mask:new Uint8Array(o),pixelType:l}),extent:e}}}const o=!!r.requestAsImageElement&&!this.pixelFilter,l=o&&!!r.returnImageBitmap,u={imageServiceParameters:a,imageProps:{extent:e,width:t,height:i,format:this.format},requestAsImageElement:o,returnImageBitmap:l,signal:r.signal};return this._requestArrayBuffer(u)}async fetchPixels(e,t,i,r={}){await this._initJobHandler(),r.applyRendering&&this._updateCurrentRasterInfo();const s=r.applyRendering?void 0:new D({layer:this,requestRawData:!0,interpolation:r.interpolation??"nearest",bandIds:r.bandIds??[]}),n=this.getExportImageServiceParameters(e,t,i,r.timeExtent,s);if(null==n)return{extent:e,pixelBlock:null};delete n.pixelType,r.bandIds||delete n.bandIds,delete n.compressionQuality;const a={imageServiceParameters:n,imageProps:{extent:e,width:t,height:i,format:this.format},requestAsImageElement:!1,returnImageBitmap:!1,signal:r.signal},{pixelData:o}=await this._requestArrayBuffer(a);return o??{extent:e,pixelBlock:null}}fetchKeyProperties(e){return i(He(this.parsedUrl)+"/keyProperties",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then(e=>e.data)}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new r("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):i(He(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then(e=>je.fromJSON(e.data))}getCatalogItemRasterInfo(e,t){const i={...t,query:this._getQueryParams()};return Ce(He(this.parsedUrl),e,i)}async getCatalogItemICSInfo(e,t){const{data:r}=await i(He(this.parsedUrl)+"/"+e+"/info/ics",{query:this._getQueryParams(),...t}),s=r?.ics;if(!s)return;let n=null;try{n=(await i(He(this.parsedUrl)+"/"+e+"/info",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!n?.spatialReference)return{ics:s,icsToPixelTransform:null,icsExtent:null,northDirection:null};const a=this.version>=10.7?i(He(this.parsedUrl)+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...t}).then(e=>e.data).catch(()=>({})):{},o=n.spatialReference,l={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[n]}),inSR:y(o),outSR:"0:"+e},u=i(He(this.parsedUrl)+"/project",{query:this._getQueryParams(l),...t}).then(e=>e.data).catch(()=>({})),p=5,m=(n.xmin+n.xmax)/2,c=(n.ymax-n.ymin)/(p+1),d=n.ymin+c,g=[];for(let i=0;i<p;i++)g.push({x:m,y:d+c*i});const R={geometries:JSON.stringify({geometryType:"esriGeometryPoint",geometries:g}),inSR:y(o),outSR:"0:"+e},I=i(He(this.parsedUrl)+"/project",{query:this._getQueryParams(R),...t}).then(e=>e.data).catch(()=>({})),w=await Promise.all([a,u,I]);let v=w[0].ipxf;if(null==v){const e=s.geodataXform?.xf_0;"topup"===e?.name?.toLowerCase()&&6===e?.coefficients?.length&&(v={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:e.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const b=h.fromJSON(w[1]?.geometries?.[0]);b&&(b.spatialReference=new f({wkid:0,imageCoordinateSystem:s}));const x=w[2].geometries?w[2].geometries.filter(e=>null!=e?.x&&null!=e.y&&"NaN"!==e.x&&"NaN"!==e.y):[],S=x.length;if(S<3)return{ics:s,icsToPixelTransform:v,icsExtent:b,northDirection:null};let F=0,_=0,D=0,O=0;for(let i=0;i<S;i++)F+=x[i].x,_+=x[i].y,D+=x[i].x*x[i].x,O+=x[i].x*x[i].y;const T=(S*O-F*_)/(S*D-F*F);let C=0;const M=x[p-1].x>x[0].x,q=x[p-1].y>x[0].y;return T===1/0?C=q?90:270:0===T?C=M?0:180:T>0?C=M?180*Math.atan(T)/Math.PI:180*Math.atan(T)/Math.PI+180:T<0&&(C=q?180+180*Math.atan(T)/Math.PI:360+180*Math.atan(T)/Math.PI),{ics:s,icsToPixelTransform:v,icsExtent:b,northDirection:C}}async generateRasterInfo(e,t){const i=m($,e),s={...t,query:this._getQueryParams()};if(!i||"none"===i.functionName?.toLowerCase()||this._isVectorFieldResampleFunction(i))return this.serviceRasterInfo??De(He(this.parsedUrl),this.sourceJSON,s);const n=Ue(i);if(!n)throw new r("imagery-layer:generate-raster-info","the rendering rule is not supported");if(this._functionRasterInfos[n])return this._functionRasterInfos[n];const a=Oe(He(this.parsedUrl),i,s);this._functionRasterInfos[n]=a;try{return await a}catch(o){throw this._functionRasterInfos[n]=null,o}}getExportImageServiceParameters(e,t,i,r,s){e=e.clone().shiftCentralMeridian();const n=ge(e.spatialReference,He(this.parsedUrl));s??=this.exportImageServiceParameters;const a=s.toJSON(),{bandIds:o,noData:l}=a;let{renderingRule:u}=a;const p=this.rasterFunction?.rasterFunctionDefinition,m=this.renderer?.type,c=!m||"raster-stretch"===m||"raster-colormap"===m||"unique-value"===m||"class-breaks"===m||"raster-shaded-relief"===m;if(o?.length&&this._hasRasterFunction(this.rasterFunction)&&!p&&c){const e={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:o}};if("Stretch"===u.rasterFunction)e.rasterFunctionArguments.Raster=u.rasterFunctionArguments.Raster,u.rasterFunctionArguments.Raster=e;else if("Colormap"===u.rasterFunction){const t=u.rasterFunctionArguments.Raster;"Stretch"===t?.rasterFunction?(e.rasterFunctionArguments.Raster=t.rasterFunctionArguments.Raster,t.rasterFunctionArguments.Raster=e):(e.rasterFunctionArguments.Raster=t,u.rasterFunctionArguments.Raster=e)}else e.rasterFunctionArguments.Raster=u,u=e;a.bandIds=void 0}else a.bandIds=o?.join(",");Array.isArray(l)&&l.length>0&&(a.noData=l.join(","));const h=this._processMultidimensionalIntersection(null,r,s.mosaicRule);if(h.isOutSide)return null;a.mosaicRule=null!=h.mosaicRule?JSON.stringify(h.mosaicRule):null,r=h.timeExtent,a.renderingRule=this._getRenderingRuleString($.fromJSON(u));const d={};if(null!=r){const{start:e,end:t}=r.toJSON();e&&t&&e===t?d.time=""+e:null==e&&null==t||(d.time=`${e??"null"},${t??"null"}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:n,imageSR:n,size:t+","+i,...a,...d}}async getSamples(e,t){const i=await this._fetchCapabilities(t?.signal);if(!i?.operations.supportsGetSamples)throw new r("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=s(e);const{raster:n}=this;return n&&null==e.raster&&(e.raster=n),Re(this.url,e,this._getRequestOptions(t))}async identify(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsIdentify)throw new r("imagery-layer:identify","identify operation is not supported on the input image service");e=s(e),this.version<10.91&&"extent"===e.geometry?.type&&(e.geometry=d.fromExtent(e.geometry));const i=this._processMultidimensionalIntersection(e.geometry,e.timeExtent,e.mosaicRule||this.mosaicRule);if(i.isOutSide)throw new r("imagery-layer:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");e.timeExtent=i.timeExtent,e.mosaicRule=i.mosaicRule;const{raster:n,rasterFunction:a}=this;return a&&null==e.rasterFunction&&(e.rasterFunction=a),n&&null==e.raster&&(e.raster=n),Ie(this.url,e,this._getRequestOptions(t))}async imageToMap(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsImageToMap)throw new r("imagery-layer:image-to-map","imageToMap operation is not supported on the input image service");return we(He(this.parsedUrl),e,this._getRequestOptions(t))}async imageToMapMultiray(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsImageToMapMultiray)throw new r("imagery-layer:image-to-map-multiray","imageToMapMultiray operation is not supported on the input image service");return ve(He(this.parsedUrl),e,this._getRequestOptions(t))}async mapToImage(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsMapToImage)throw new r("imagery-layer:map-to-image","mapToImage operation is not supported on the input image service");return be(He(this.parsedUrl),e,this._getRequestOptions(t))}async findImages(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsFindImages)throw new r("imagery-layer:find-images","findImages operation is not supported on the input image service");return xe(He(this.parsedUrl),e,this._getRequestOptions(t))}async getImageUrl(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsGetImageUrl)throw new r("imagery-layer:get-image-url","getImageUrl operation is not supported on the input image service");return Se(He(this.parsedUrl),e,this._getRequestOptions(t))}createQuery(){return new Ae({outFields:["*"],returnGeometry:!0,where:this.definitionExpression||"1=1"})}async queryBoundary(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQueryBoundary)throw new r("imagery-layer:query-boundary","queryBoundary operation is not supported on the input image service");return e=e??{outSpatialReference:this.spatialReference},Fe(He(this.parsedUrl),e,this._getRequestOptions(t))}async queryExtent(e,t){({query:e,requestOptions:t}=await this._prepareForQuery(e,t));const{where:i,objectIds:r,geometry:s,timeExtent:n,start:a,num:o,pixelSize:l}=e,u=null!=i&&"1=1"!==i,p=null!=r&&r.length>0,m=null!=s&&("extent"!==s.type||!s.equals(this.fullExtent)),c=null!=l,h=null!=a||null!=o,{timeInfo:d}=this,f=null!=n&&null!=d&&!n.equals(d.fullTimeExtent);if(!(u||p||m||c||f||h)){const i=await Me(this.url,e,t),{outSpatialReference:r}=e;if(!r||r.equals(this.spatialReference))return{count:i,extent:this.fullExtent.clone()};const s=await import("../../geometry/operators/projectOperator.js");await s.load();return{count:i,extent:s.execute(this.fullExtent,r)}}return qe(this.url,e,t)}async queryRasters(e,t){({query:e,requestOptions:t}=await this._prepareForQuery(e,t));const i=await Pe(this.url,e,t),r=this.graphicOrigin;return i.features.forEach(e=>{e.layer=this,e.origin=r}),i}async queryObjectIds(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),Ne(this.url,e,t)}async queryGPSInfo(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQueryGPSInfo)throw new r("imagery-layer:query-gps-info","queryGPSInfo operation is not supported on the input image service");return e=e??{where:"1=1"},_e(He(this.parsedUrl),e,this._getRequestOptions(t))}async queryRasterCount(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),Me(this.url,e,t)}async queryVisibleRasters(e,t){if(!e)throw new r("imagery-layer: query-visible-rasters","missing query parameter");await this.load();const{pixelSize:i,returnDomainValues:s,returnTopmostRaster:n,showNoDataRecords:a}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let o=!1,l=null,u=null;const p=k.servicePixelValue.toLowerCase(),m=this._rasterFunctionNamesIndex;if(null!=e.outFields&&(o=e.outFields.some(e=>!e.toLowerCase().startsWith(p)),this.version>=10.4)){const t=e.outFields.filter(e=>e.toLowerCase().startsWith(p)&&e.length>p.length).map(e=>{const t=e.slice(p.length+1);return[this._updateRenderingRulesFunctionName(t,m),t]});l=t.map(e=>new $({functionName:e[0]})),u=t.map(e=>e[1]);const{rasterFunction:i}=this;0===l.length?i?.functionName?(l.push(i),u.push(i.functionName)):l=null:i?.functionName&&!l.some(e=>e.functionName===i.functionName)&&(l.push(i),u.push(i.functionName))}const c=null==e.outSpatialReference||e.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:h}=this;let f=e.timeExtent||this.timeExtent;if(h){const{isOutside:t,intersection:i}=g(h,{geometry:e.geometry,timeExtent:e.timeExtent,multidimensionalDefinition:this.exportImageServiceParameters.mosaicRule?.multidimensionalDefinition});if(t)throw new r("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");null!=i?.timeExtent&&(f=i.timeExtent)}const y=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,f);let I=e.geometry;this.version<10.91&&"extent"===I?.type&&(I=d.fromExtent(I));const w=this._getQueryParams({geometry:I,timeExtent:f,mosaicRule:y,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:l,pixelSize:i,returnCatalogItems:o,returnGeometry:c,raster:this.raster,maxItemCount:n?1:null});delete w.f;const v=new Ee(w);try{await this._generateRasterInfo(this.rasterFunction);const i=await Ie(this.url,v,{signal:t?.signal,query:{...this.customParameters}}),r=e.outFields,n=null!=i.value&&i.value.toLowerCase().includes("nodata"),l=o&&!c&&i?.catalogItems?.features.length&&(a||!n),p=this.multidimensionalInfo&&"raster-dataset"===this.sourceType?R({rasterInfo:this.rasterInfo,multidimensionalDefinition:y?.multidimensionalDefinition,timeExtent:f,multidimensionalSubset:this.multidimensionalSubset}):null;if(!l)return this._processVisibleRastersResponse(i,{returnDomainValues:s,templateRRFunctionNames:u,showNoDataRecords:a,templateFields:r,effectiveMultidimensionalDefinition:p});const m=this.objectIdField||"ObjectId",h=i.catalogItems?.features??[],d=h.map(e=>e.attributes?.[m]),g=new Ae({objectIds:d,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[m]}),I=await this.queryRasters(g);return I?.features?.length&&I.features.forEach(t=>{h.forEach(i=>{i.attributes[m]===t.attributes[m]&&t.geometry&&(i.geometry=t.geometry.clone(),null!=e.outSpatialReference&&(i.geometry.spatialReference=e.outSpatialReference))})}),this._processVisibleRastersResponse(i,{returnDomainValues:s,templateRRFunctionNames:u,showNoDataRecords:a,templateFields:r,effectiveMultidimensionalDefinition:p})}catch{throw new r("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,t){const r=i(He(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:e}),signal:t}).then(e=>e.data?.statistics),s=i(He(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:e}),signal:t}).then(e=>e.data?.histograms),n=await Promise.all([r,s]);return n[0]&&n[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),{statistics:n[0]||null,histograms:n[1]||null}}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo.multidimensionalInfo;return I(this.multidimensionalSubset,t)}async _fetchService(e){await this._fetchServiceInfo(e),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,i=null!=this.serviceRasterInfo?Promise.resolve(this.serviceRasterInfo):De(He(this.parsedUrl),t,{signal:e,query:this._getQueryParams()}).then(e=>(this._set("serviceRasterInfo",e),this._set("multidimensionalInfo",e.multidimensionalInfo),Te(e,t),e)),r=this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:e}):null,s=this._getRasterFunctionInfos();return Promise.all([i,r,s]).then(e=>{e[1]?this._set("rasterInfo",e[1]):this._set("rasterInfo",e[0]),e[2]&&this._set("rasterFunctionInfos",e[2]),this.internalRenderer&&!this._isSupportedRenderer(this.internalRenderer)&&(this._set("internalRenderer",null),n.getLogger(this).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("internalRenderer",this._configRenderer(this.renderer)),this.addHandles([a(()=>this.rasterFunction,e=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(e).then(e=>{e&&(this.rasterInfo=e)})})]);const{serviceRasterInfo:t}=this;null!=t.multidimensionalInfo&&this._updateMultidimensionalDefinition(t)})}_combineMosaicRuleWithTimeExtent(e,t){const i=this.timeInfo,{multidimensionalInfo:r}=this.serviceRasterInfo;if(null==e||null==r||null==t||null==i?.startField)return e;const{startField:s}=i,n=r.variables.some(e=>e.dimensions.some(e=>e.name===s))?s:"StdTime";if(e=e.clone(),"mosaic-dataset"===this.sourceType)return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter(e=>e.dimensionName!==n),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const a=e.multidimensionalDefinition.filter(e=>e.dimensionName===n),o=null!=t.start?t.start.getTime():null,l=null!=t.end?t.end.getTime():null,u=null==o||null==l||o===l,p=u?[o||l]:[[o,l]],m=this.version>=10.8;if(a.length)a.forEach(e=>{e.dimensionName===n&&(m?(e.dimensionName=null,e.isSlice=!1,e.values=[]):(e.isSlice=u,e.values=p))});else if(!m){const t=e.multidimensionalDefinition.filter(e=>null!=e.variableName&&null==e.dimensionName);t.length?t.forEach(e=>{e.dimensionName=n,e.isSlice=u,e.values=p}):e.multidimensionalDefinition.push(new _({variableName:"",dimensionName:n,isSlice:u,values:p}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return null==e?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter(e=>!(!e.variableName&&!e.dimensionName)),0===e.multidimensionalDefinition.length&&(e.multidimensionalDefinition=null)),"mosaic-dataset"!==this.sourceType&&null==e.multidimensionalDefinition?null:e)}async _prepareForQuery(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQuery)throw new r("imagery-layer:query-rasters","query operation is not supported on the input image service");const i=null!=e?m(Ae,e):this.createQuery();return t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:i,requestOptions:t}}_isSupportedRenderer(e){const{rasterInfo:t,rasterFunction:i}=this;return"unique-value"===e.type&&this._hasRasterFunction(i)&&1===t?.bandCount&&["u8","s8"].includes(t.pixelType)||null!=t&&null!=e&&Z(t).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let t=this.sourceJSON;if(!t){const{data:r,ssl:s}=await i(He(this.parsedUrl),{query:this._getQueryParams(),signal:e});t=r,this.sourceJSON=t,s&&(this.url=this.url.replace(/^http:/i,"https:"))}if(t.capabilities?.toLowerCase().split(",").map(e=>e.trim()).indexOf("tilesonly")>-1)throw new r("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(t,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?"esriImageServiceSourceTypeMosaicDataset"===e.serviceSourceType:e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;const t=this._isMosaicDataset(e),i=e.currentVersion>=10.71&&e.hasMultidimensions&&!(e.fields?.length>1);return t||i}_isVectorFieldResampleFunction(e){if(null==e)return!1;const{functionName:t,functionArguments:i}=e,r="resample"===t?.toLowerCase(),s=i?.ResampleType||i?.resampleType;return r&&(7===s||10===s)}_configRenderer(e){const{rasterInfo:t}=this;if(!this.isRenderedFormat&&!this.pixelFilter||this._isVectorDataSet()){const i=this.mosaicRule?.multidimensionalDefinition?.[0].variableName,r=ee({variableName:i,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>=3){const e=r?.bandIds??Y(t);!e||3===t.bandCount&&0===e[0]&&1===e[1]&&2===e[2]||(this.bandIds=e)}e||(e=r?.renderer??K(t,{bandIds:this.bandIds,variableName:this.rasterFunction?null:i}));const s=te(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=s,this.symbolizer.rasterInfo=t):this.symbolizer=new ie({rendererJSON:s,rasterInfo:t}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return null==e?e:{extent:e.extent&&e.extent.clone(),pixelBlock:null!=e.pixelBlock?e.pixelBlock.clone():null}}_getQueryParams(e){null!=e?.renderingRule&&"string"!=typeof e.renderingRule&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:t,viewId:i}=this;return{raster:t,viewId:i,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,t,i){return this._rasterJobHandler?this._rasterJobHandler.decode({data:e,options:t}):v(e,t,i)}async _getRasterFunctionInfos(e){const t=this.sourceJSON.rasterFunctionInfos;if(this.loaded)return t;if(t&&this.version>=10.3){if(1===t.length&&"none"===t[0].name.toLowerCase())return t;const r=await i(He(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e});return r.data?.rasterFunctionInfos}return null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes("png"))}async _requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:s,returnImageBitmap:n,signal:a}=e;if(s&&this._canRequestImageElement(t.format)){const r=`${He(this.parsedUrl)}/exportImage`,{data:s}=await i(r,{responseType:n?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...e.imageServiceParameters}),signal:a});if(s instanceof Blob){return{imageBitmap:await C(s,r,a),params:t}}return{imageOrCanvasElement:s,params:t}}const o=this._initJobHandler(),l=i(He(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:a}),u=(await Promise.all([l,o]))[0].data,p=t.format||"jpgpng";let m=p;if("bsq"!==m&&"bip"!==m&&(m=b(u)),!m)throw new r("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(u)));const c={signal:a},h=this._decodePixelBlock(u,{width:t.width,height:t.height,format:p,applyJpegMask:!0},c);return{pixelData:{pixelBlock:await h,extent:t.extent},params:t}}_generateRasterInfo(e,t){return this.generateRasterInfo(e,t).catch(()=>null)}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this.defaultMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let t=w(e,{multidimensionalSubset:this.multidimensionalSubset});if(null!=t&&t.length>0){this.mosaicRule=this.mosaicRule||new q;const e=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&"none"!==this.rasterFunction.functionName?.toLowerCase()&&t.forEach(e=>e.variableName=""),t=t.filter(({variableName:e,dimensionName:t})=>e&&"*"!==e||t),!e?.length&&t.length&&(this.mosaicRule.multidimensionalDefinition=t)}}_processVisibleRastersResponse(e,i){i=i||{};const r=e.value,{templateRRFunctionNames:s,showNoDataRecords:n,returnDomainValues:a,templateFields:o}=i,l=e.processedValues;let u=e.catalogItems?.features,p=e.properties?.Values?.map(e=>e.replaceAll(/ /gi,", "))||[];const m=this.objectIdField||"ObjectId",c="string"==typeof r&&r.toLowerCase().includes("nodata"),h=[];if(r&&!u&&(!c||n)){const e={};e[m]=0;p=[r],u=[new t({geometry:this.fullExtent,attributes:e})],this.multidimensionalInfo&&"raster-dataset"===this.sourceType&&G(this.rasterFields,e,i.effectiveMultidimensionalDefinition)}if(!u)return[];this._updateResponseFieldNames(u,o),c&&!n&&(u=[]);const{itemPixelValue:d,servicePixelValue:f}=k,y=this.rasterFields.some(e=>e.name===d),g=this.graphicOrigin;for(let t=0;t<u.length;t++){const e=u[t];if(null!=r){const i=p[t],a=this.rasterFunction&&l&&l.length>0&&s&&s.length>0&&s.includes(this.rasterFunction.functionName)?l[s.indexOf(this.rasterFunction.functionName)]:r;if("nodata"===i.toLowerCase()&&!n)continue;y&&(e.attributes[d]=i),e.attributes[f]=a,this._updateFeatureWithMagDirValues(e,i);const o=this.fields&&this.fields.length>0;let u=this.rasterFunction&&null!=this.serviceRasterInfo.attributeTable?o?i:r:a;this.rasterFunction||(u=o?i:r),this._updateFeatureWithRasterAttributeTableValues(e,u)}if(e.sourceLayer=e.layer=this,e.origin=g,a&&this._updateFeatureWithDomainValues(e),s&&l&&s.length===l.length)for(let t=0;t<s.length;t++){const i=`${k.servicePixelValue}.${s[t]}`;e.attributes[i]=l[t]}h.push(u[t])}return h}_processMultidimensionalIntersection(e,t,i){const{multidimensionalSubset:r}=this;if(!r)return{isOutSide:!1,timeExtent:t,mosaicRule:i=this._combineMosaicRuleWithTimeExtent(i,t)};if(r){const{isOutside:i,intersection:s}=g(r,{geometry:e,timeExtent:t});if(i)return{isOutSide:!0,timeExtent:null,mosaicRule:null};null!=s?.timeExtent&&(t=s.timeExtent)}if(i=this._combineMosaicRuleWithTimeExtent(i,t),i?.multidimensionalDefinition){const{isOutside:e}=g(r,{multidimensionalDefinition:i.multidimensionalDefinition});if(e)return{isOutSide:!0,timeExtent:null,mosaicRule:null}}return{isOutSide:!1,timeExtent:t,mosaicRule:i}}_updateFeatureWithRasterAttributeTableValues(e,t){const i=this.rasterInfo.attributeTable||this.serviceRasterInfo.attributeTable;if(null==i)return;const{features:r,fields:s}=i,n=s.map(e=>e.name).find(e=>"value"===e.toLowerCase());if(!n)return;const a=r.filter(e=>e.attributes[n]===(null!=t?parseInt(t,10):null));a&&a[0]&&s.forEach(t=>{const i=W+t.name;e.attributes[i]=a[0].attributes[t.name]})}_updateFeatureWithMagDirValues(e,t){if(!this._isVectorDataSet())return;const i=t.split(/,\s*/).map(e=>parseFloat(e)),r=i.map(e=>[e]),s=i.map(e=>({minValue:e,maxValue:e,noDataValue:null})),n=new P({height:1,width:1,pixelType:"f32",pixels:r,statistics:s});null!=this.pixelFilter&&this.pixelFilter({pixelBlock:n,extent:new h(0,0,0,0,this.spatialReference)});const a="esriImageServiceDataTypeVector-MagDir"===this.serviceDataType?[n.pixels[0][0],n.pixels[1][0]]:x([n.pixels[0][0],n.pixels[1][0]]);e.attributes[k.magnitude]=a[0],e.attributes[k.direction]=a[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter(e=>"coded-value"===e.domain?.type);null!=t&&t.forEach(t=>{const i=e.attributes[t.name];if(null!=i){const r=t.domain.codedValues.find(e=>e.code===i);r&&(e.attributes[t.name]=r.name)}})}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const i=this.fieldsIndex;null!=i&&e.forEach(e=>{if(e?.attributes)for(const r of t){const t=i.get(r)?.name;t&&t!==r&&(e.attributes[r]=e.attributes[t],delete e.attributes[t])}})}_getRenderingRuleString(e){if(e){let t=e.toJSON();return t=t.rasterFunctionDefinition??t,(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=null),JSON.stringify(t)}return null}_hasRasterFunction(e){return null!=e?.functionName&&"none"!==e.functionName.toLowerCase()}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if("Raw"===e)return e.replace("Raw","None");const i=e.toLowerCase().replaceAll(/ /gi,"_");return t.has(i)?t.get(i):e}_isRFTJson(e){return e?.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return"esriImageServiceDataTypeVector-UV"===this.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===this.serviceDataType}_applyMosaicAndRenderingRules(e){const{raster:t,mosaicRule:i,rasterFunction:r}=this;r&&null==e.rasterFunction&&(e.rasterFunction=r),i&&null==e.mosaicRule&&(e.mosaicRule=i),t&&null==e.raster&&(e.raster=t)}async _updateCurrentRasterInfo(e){if(this.renderer||this.symbolizer){const t=await this._generateRasterInfo(this.rasterFunction,{signal:e});t&&(this.rasterInfo=t)}}_applyMosaicRule(e){const{raster:t,mosaicRule:i}=this;i&&null==e.mosaicRule&&(e.mosaicRule=i),t&&null==e.raster&&(e.raster=t)}_readCapabilities(e){const t=e.capabilities?e.capabilities.toLowerCase().split(",").map(e=>e.trim()):["image","catalog"],{currentVersion:i,maxRecordCount:r}=e,s=t.includes("image"),n="esriImageServiceDataTypeElevation"===e.serviceDataType,a=!(!e.spatialReference&&!e.extent?.spatialReference),o=t.includes("edit"),l=t.includes("mensuration")&&a,u=null==e.mensurationCapabilities?[]:e.mensurationCapabilities.toLowerCase().split(",").map(e=>e.trim()),p=l&&u.includes("basic"),m=this._isMosaicDataset(e)&&t.includes("catalog"),c=t.includes("download"),h=i>=10.7&&n||i>=11.4&&(n||l&&u.includes("3d")),d=m&&e.fields&&e.fields.length>0,f=d&&e.supportsAdvancedQueries?e.advancedQueryCapabilities:void 0;return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:s,supportsExportImage:s,supportsIdentify:s,supportsImageToMap:i>=11.2&&m,supportsImageToMapMultiray:i>=11.2&&m,supportsMapToImage:i>=11.2&&m,supportsFindImages:i>=11.2&&m,supportsGetImageUrl:i>=11.3&&c,supportsMeasure:l,supportsMeasureFromImage:i>=11.2,supportsDownload:c,supportsQuery:d,supportsGetSamples:i>=10.2&&s,supportsProject:i>=10.3&&s,supportsComputeStatisticsHistograms:i>=10.4&&s,supportsQueryBoundary:i>=10.6&&s,supportsCalculateVolume:h,supportsComputePixelLocation:i>=10.7&&m,supportsComputeAngles:i>=10.91,supportsQueryGPSInfo:i>=11.2&&m,supportsAdd:o,supportsDelete:o,supportsEditing:o,supportsUpdate:o,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:r,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,relativeTimeBinWindow:void 0,supportsStatistics:!!f?.supportsStatistics,supportsOrderBy:!!f?.supportsOrderBy,supportsDistinct:!!f?.supportsDistinct,supportsPagination:!!f?.supportsPagination,supportsPaginationOnAggregatedQueries:!!f?.supportsPaginationOnAggregatedQueries,supportsStandardizedQueriesOnly:!!f?.useStandardizedQueries,supportsPercentileStatistics:!!f?.supportsPercentileStatistics,supportsCentroid:!!f?.supportsReturningGeometryCentroid,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDistance:!!f?.supportsQueryWithDistance,supportsExtent:!!f?.supportsReturningQueryExtent,supportsGeometryProperties:!!f?.supportsReturningGeometryProperties,supportsHavingClause:!!f?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:f?.supportsSqlExpression??!!f,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsFormatPBFWithCurves:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!f?.supportsDefaultSR,supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,standardMaxRecordCountNoGeometry:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1},mensuration:{supportsDistanceAndAngle:p,supportsAreaAndPerimeter:p,supportsPointOrCentroid:p,supportsHeightFromBaseAndTop:l&&u.includes("base-top height"),supportsHeightFromBaseAndTopShadow:l&&u.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:l&&u.includes("top-top shadow height"),supports3D:l&&u.includes("3d")}}}};function He(e){return e?.path??""}return e([l({clonable:!1})],Le.prototype,"_functionRasterInfos",void 0),e([l({readOnly:!0})],Le.prototype,"_serviceSupportsMosaicRule",void 0),e([Qe("_serviceSupportsMosaicRule",["currentVersion","fields"])],Le.prototype,"readServiceSupportsMosaicRule",null),e([l({readOnly:!0})],Le.prototype,"_rasterFunctionNamesIndex",null),e([l()],Le.prototype,"adjustAspectRatio",void 0),e([l({type:[p],json:{write:!0}})],Le.prototype,"bandIds",void 0),e([Qe("bandIds")],Le.prototype,"readBandIds",null),e([l({readOnly:!0,json:{read:!1}})],Le.prototype,"capabilities",void 0),e([Qe("service","capabilities",["capabilities","currentVersion","serviceDataType"])],Le.prototype,"readCapabilities",null),e([l({type:Number})],Le.prototype,"compressionQuality",void 0),e([Ve("compressionQuality")],Le.prototype,"writeCompressionQuality",null),e([l({type:Number})],Le.prototype,"compressionTolerance",void 0),e([Ve("compressionTolerance")],Le.prototype,"writeCompressionTolerance",null),e([l({json:{read:{source:"copyrightText"}}})],Le.prototype,"copyright",void 0),e([l({readOnly:!0})],Le.prototype,"defaultMosaicRule",void 0),e([Qe("defaultMosaicRule",["defaultMosaicMethod"])],Le.prototype,"readDefaultMosaicRule",null),e([l({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Le.prototype,"definitionExpression",void 0),e([l({readOnly:!0,constructOnly:!0})],Le.prototype,"exportImageServiceParameters",void 0),e([l()],Le.prototype,"rasterInfo",void 0),e([l({readOnly:!0,type:[O]})],Le.prototype,"fields",void 0),e([l({readOnly:!0})],Le.prototype,"fieldsIndex",null),e([l({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff","bip","bsq"],json:{write:!0}})],Le.prototype,"format",null),e([Qe("service","format",["serviceDataType"])],Le.prototype,"readFormat",null),e([l({type:h})],Le.prototype,"fullExtent",void 0),e([l({readOnly:!0})],Le.prototype,"hasMultidimensions",void 0),e([l({json:{read:{source:"maxImageHeight"}}})],Le.prototype,"imageMaxHeight",void 0),e([l({json:{read:{source:"maxImageWidth"}}})],Le.prototype,"imageMaxWidth",void 0),e([l({type:String,json:{type:j.jsonValues,read:j.read,write:j.write}})],Le.prototype,"interpolation",void 0),e([l()],Le.prototype,"minScale",void 0),e([Qe("service","minScale")],Le.prototype,"readMinScale",null),e([l()],Le.prototype,"maxScale",void 0),e([Qe("service","maxScale")],Le.prototype,"readMaxScale",null),e([l({type:q})],Le.prototype,"mosaicRule",null),e([Qe("mosaicRule",["mosaicRule","defaultMosaicMethod"])],Le.prototype,"readMosaicRule",null),e([Ve("mosaicRule")],Le.prototype,"writeMosaicRule",null),e([l()],Le.prototype,"multidimensionalInfo",void 0),e([l({type:N,json:{write:!0}})],Le.prototype,"multidimensionalSubset",void 0),e([l({json:{type:[Number,[Number]],write:!0}})],Le.prototype,"noData",void 0),e([l({type:String,json:{type:E.jsonValues,read:E.read,write:E.write}})],Le.prototype,"noDataInterpretation",void 0),e([l({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],Le.prototype,"objectIdField",void 0),e([Qe("objectIdField")],Le.prototype,"readObjectIdField",null),e([l({readOnly:!0})],Le.prototype,"geometryType",void 0),e([l({})],Le.prototype,"typeIdField",void 0),e([l({})],Le.prototype,"types",void 0),e([l({readOnly:!0})],Le.prototype,"parsedUrl",null),e([l({type:Function})],Le.prototype,"pixelFilter",void 0),e([l()],Le.prototype,"raster",void 0),e([l({readOnly:!0})],Le.prototype,"sourceType",void 0),e([Qe("sourceType",["serviceSourceType","fields"])],Le.prototype,"readSourceType",null),e([l()],Le.prototype,"viewId",void 0),e([l({types:re})],Le.prototype,"renderer",null),e([l({types:re,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:se,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],Le.prototype,"internalRenderer",null),e([Qe("internalRenderer")],Le.prototype,"readRenderer",null),e([Ve("internalRenderer")],Le.prototype,"writeRenderer",null),e([l({clonable:!1})],Le.prototype,"symbolizer",void 0),e([l(S)],Le.prototype,"opacity",void 0),e([l({readOnly:!0})],Le.prototype,"rasterFields",null),e([l({constructOnly:!0})],Le.prototype,"rasterFunctionInfos",void 0),e([l({type:$,json:{name:"renderingRule"}})],Le.prototype,"rasterFunction",null),e([Qe("rasterFunction",["renderingRule","rasterFunctionInfos"])],Le.prototype,"readRasterFunction",null),e([l({readOnly:!0})],Le.prototype,"serviceDataType",void 0),e([l({readOnly:!0,type:f})],Le.prototype,"spatialReference",void 0),e([Qe("spatialReference",["spatialReference","extent"])],Le.prototype,"readSpatialReference",null),e([l({type:A.apiValues,json:{read:A.read,type:A.jsonValues}})],Le.prototype,"pixelType",void 0),e([Ve("pixelType")],Le.prototype,"writePixelType",null),e([l({constructOnly:!0,type:X})],Le.prototype,"serviceRasterInfo",void 0),e([l()],Le.prototype,"sourceJSON",void 0),e([l(F)],Le.prototype,"url",void 0),e([l({readOnly:!0})],Le.prototype,"version",void 0),e([Qe("version",["currentVersion","fields","timeInfo"])],Le.prototype,"readVersion",null),Le=e([u("esri.layers.mixins.ArcGISImageService")],Le),Le};export{Be as ArcGISImageService};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.1.0-next.74",
3
+ "version": "5.1.0-next.76",
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": [
@@ -18,11 +18,11 @@
18
18
  ],
19
19
  "license": "SEE LICENSE IN LICENSE.md",
20
20
  "dependencies": {
21
- "@amcharts/amcharts5": "~5.17.1",
22
- "@arcgis/toolkit": "^5.1.0-next.77",
21
+ "@amcharts/amcharts5": "~5.17.2",
22
+ "@arcgis/toolkit": "^5.1.0-next.78",
23
23
  "@esri/arcgis-html-sanitizer": "~4.1.0",
24
24
  "@esri/calcite-components": "^5.1.0-next.30",
25
- "@vaadin/grid": "~25.1.0",
25
+ "@vaadin/grid": "~25.1.1",
26
26
  "@zip.js/zip.js": "~2.8.26",
27
27
  "luxon": "~3.7.2",
28
28
  "marked": "~18.0.0",
package/popup/Features.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import i from"../core/Error.js";import{EventedAccessor as r}from"../core/Evented.js";import s from"../core/Logger.js";import{abortMaybe as o}from"../core/maybe.js";import{debounce as n,isAbortError as a}from"../core/promiseUtils.js";import l from"../core/ReactiveSet.js";import{watch as h,when as u,sync as c}from"../core/reactiveUtils.js";import{addMany as p}from"../core/SetUtils.js";import{property as d,subclass as g}from"../core/accessorSupport/decorators.js";import m from"../geometry/Point.js";import{initializeProjection as f,project as y}from"../geometry/projectionUtils.js";import _ from"../geometry/SpatialReference.js";import{geographicToWebMercator as F}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as v}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as w}from"../layers/LayerConstants.js";import{ActionsCollection as C,zoomToAggregatedFeatures as b,browseAggregatedFeatures as I,zoomToFeature as P}from"./actions.js";import{getSelectedTarget as A}from"./actionUtils.js";import L from"./Feature.js";import j from"./support/FeatureAbilities.js";import{getDisplayedSymbol as x}from"../symbols/support/symbolUtils.js";import{system as E}from"../time/constants.js";import{highlightsSupported as R}from"../views/support/layerViewUtils.js";import{GoTo as O}from"../widgets/support/GoTo.js";const U="location-scale-handle",S=()=>[P.clone()],T=()=>[b.clone(),I.clone()];let M=null;function H(e,t){switch(e){case"building-scene":case"map-image":case"tile":case"imagery":return!0;case"imagery-tile":return"2d"===t;default:return!1}}let D=class extends(O(r)){constructor(e){super(e),this._pendingPromises=new l,this._fetchFeaturesController=null,this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new j,this.actions=new C,this.activeFeature=null,this.browseClusterEnabled=!1,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=n(async e=>{this._cancelLocationUpdate();const t=new AbortController,{signal:i}=t;this._locationUpdateController=t,await this._locationUpdate(e,{signal:i}).catch(()=>{}).finally(()=>{this._locationUpdateController===t&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([h(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),h(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),h(()=>this.location,e=>this._locationChange(e)),h(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),h(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),h(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),h(()=>this.featureItems,()=>this._featureItemsChange()),h(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),u(()=>!this.waitingForResult,()=>this._waitingForResultChange(),c),h(()=>this.view?.scale,()=>this._viewScaleChange()),u(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelFetchingFeatures(),this._cancelCenterAtLocation(),this._pendingPromises.clear(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){const e=this._get("allActions")||new C;e.removeAll();const{actions:i,defaultActions:r,defaultPopupTemplateEnabled:s,includeDefaultActions:o,selectedFeature:n}=this,a=o?r.concat(i):i,l=n&&("function"==typeof n.getEffectivePopupTemplate&&n.getEffectivePopupTemplate(s)||n.popupTemplate),h=l?.actions,u=l?.overwriteActions?h:h?.concat(a)??a;return u?.filter(t).forEach(t=>e.add(t)),e}set content(e){this.promises=[],this._set("content",e)}get defaultActions(){const e=this._get("defaultActions")||new C;return e.removeAll(),e.addMany(this.selectedFeature?.isAggregate?T():S()),e}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t),this._syncSelectedFeatureIndex(t)}get initialDisplayMode(){return this._get("initialDisplayMode")||"feature"}set initialDisplayMode(e){this._set("initialDisplayMode",e),this._syncSelectedFeatureIndex(this.features)}set location(e){let t=e;const i=this.spatialReference?.isWebMercator,r=e?.spatialReference?.isWGS84;r&&i&&(t=F(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._get("promises")!==e&&(this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),e=e.slice(),p(this._pendingPromises,e),e.reduce((e,t)=>e.finally(()=>t.then(e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)}).finally(()=>this._pendingPromises.delete(t)).catch(()=>{})),Promise.resolve())):this._set("promises",[]))}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;if(-1===t)return null;return e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??E}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return(!!this._fetchFeaturesController||this.pendingPromisesCount>0)&&0===this.featureCount}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,heading:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:r}=this;if(!r||!e)throw new i("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:r});return r.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}next(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount),this}previous(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount),this}async handleViewClick(e){return this._fetchFeaturesAndOpen(e)}_syncSelectedFeatureIndex(e){const{pendingPromisesCount:t,promiseCount:i,selectedFeatureIndex:r}=this,s=i&&e.length;"list"!==this.initialDisplayMode?s&&t&&-1===r?this.selectedFeatureIndex=0:s&&-1!==r||(this.selectedFeatureIndex=e.length?0:-1):(!s||s&&t===i)&&(this.selectedFeatureIndex=-1)}_centerAtLocation(){const{view:e}=this,t=A(this);this._cancelCenterAtLocation();const r=new AbortController,{signal:o}=r;return this._centerAtLocationController=r,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:o}}).catch(e=>{a(e)||s.getLogger(this).error(e)}):Promise.reject(new i("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}_getRoundRobinIndex(e,t){return(e+t)%t}_viewScaleChange(){if(this.selectedFeature?.isAggregate)return this.aggregatedFeaturesEnabled=!1,this.open=!1,void this.clear()}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:r}=this;r&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:r,featureItems:s}=this;if(null==i)return;const o=((i-1)*r+t)%t,n=Math.min(o+r,s.length);for(let a=o;a<n;a++){const t=s[a];t&&(t.graphic??=e[a])}}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;const s=v(e)?.type;if("map-image"!==s&&"imagery"!==s&&"imagery-tile"!==s||(e.symbol=await x(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const t=await import("../geometry/operators/labelPointOperator.js");return void(this.location=t.execute(e.geometry))}if(i&&!e.geometry){await this._centerAtLocation();const e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",[])}_updateFeatureItems(){const e=this.selectedFeature,t=this.features,i=this.featureItems,r=this.view,s=this.spatialReference,o=this.map,n=this.timeZone,a=this.location,l=this.featureItemAbilities??this._defaultFeatureAbilities;if(!t?.length)return void this._destroyFeatureItems();const h=[],u=new Map,c=new Set;i.forEach(e=>{const t=e?.graphic;e&&t&&u.set(t,e)}),t.forEach((t,p)=>{if(!t)return;const d=i[p];if(d&&!c.has(d)&&(null==d.graphic||d.graphic===t))return d.abilities=l,h[p]=d,void c.add(d);const g=u.get(t);if(g&&!c.has(g))return g.abilities=l,h[p]=g,void c.add(g);const m=new L({abilities:l,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:s,graphic:t===e?t:null,location:a,map:o,view:r,timeZone:n});h[p]=m,c.add(m)}),i.forEach(e=>{!e||c.has(e)||e.destroyed||e.destroy()}),this._set("featureItems",h)}async _getScreenPoint(e,t){const{spatialReference:i,view:r}=this;if(!r)return null;await r.when();const s=e?.spatialReference;return s&&i?(await f(s,i,null,t),r.toScreen(e)):null}_cancelCenterAtLocation(){this._centerAtLocationController=o(this._centerAtLocationController)}_cancelFetchingFeatures(){this._fetchFeaturesController=o(this._fetchFeaturesController)}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:r}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:r}),{signal:r,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const r=new AbortController,{signal:s}=r;this._fetchFeaturesController=r;const o=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:s,event:i});return o.catch(()=>{}).finally(()=>{this._fetchFeaturesController===r&&(this._fetchFeaturesController=null)}),o}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e;this.removeHandles(U),this.addHandles([h(()=>this.view?.scale,()=>this._debouncedLocationUpdate(t).catch(e=>{a(e)||s.getLogger(this).error(e)})),u(()=>!this.open,()=>{this.removeHandles(U)},{once:!0})],U);const{pendingFeatures:r}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});return{location:t??void 0,promises:r}}async _locationUpdate(e,t){const{spatialReference:i}=this,r=this.selectedFeature?.geometry?.type,o=this.location??e;if(r&&"mesh"!==r&&i&&o&&this.selectedFeature){if("point"===r){const e=await import("../geometry/operators/labelPointOperator.js");return void(this.location=e.execute(this.selectedFeature.geometry))}try{const e=this.selectedFeature;let r=e.geometry;const s=this._getHighlightLayer(e),n=e.getObjectId();if(!s||!this.view)return;if(n){const e=this.view?.allLayerViews.find(e=>e.layer.uid===s.uid);if(!e||!("queryFeatures"in e))return;const o=e.createQuery();o.outSpatialReference=i,o.objectIds=[n],o.returnGeometry=!0;const{features:a}=await e.queryFeatures(o,t);r=a[0]?.geometry}if(!r||"mesh"===r.type)return;r=y(r,i),M??=await Promise.all([import("../geometry/operators/intersectsOperator.js"),import("../geometry/operators/proximityOperator.js")]);const[a,l]=M;if(!a.execute(r,o)){const t=l.getNearestCoordinate(r,o).coordinate??o;this.selectedFeature===e&&(this.location=t)}}catch(n){a(n)||s.getLogger(this).error(n)}}}_cancelLocationUpdate(){this._locationUpdateController=o(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const t=v(e),{layer:i}=e;return t&&"layer"in t&&t.layer?t.layer:"map-notes"===t?.type||"subtype-group"===t?.type?t:i??t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(H(t.type,i))return e;const r=e.getObjectId();if(null!=r)return r;const s="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||w:null,o=e.attributes;return o&&s&&o[s]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:r,view:s,open:o}=this;if(!s||!r||!o)return;const n=this._getHighlightLayer(i);if(!n)return;const a=this._getHighlightLayerView(s,n);if(!a)return;this._highlightPromises[e]=a;const l=await a;if(!(l&&R(l)&&this._highlightPromises[e]===a&&this[t]&&this.highlightEnabled))return;const h=l.highlight(this._getHighlightTarget(i,n,s.type));this.addHandles(h,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}_updateFeatures(e){const{features:t}=this,i=new Set(t),r=e.filter(e=>!i.has(e));r?.length&&(this.features=t.concat(r))}};e([d()],D.prototype,"_fetchFeaturesController",void 0),e([d({type:C})],D.prototype,"actions",void 0),e([d({readOnly:!0})],D.prototype,"active",null),e([d()],D.prototype,"activeFeature",void 0),e([d({readOnly:!0})],D.prototype,"allActions",null),e([d()],D.prototype,"browseClusterEnabled",void 0),e([d()],D.prototype,"aggregatedFeaturesEnabled",void 0),e([d({value:null})],D.prototype,"content",null),e([d({type:C,readOnly:!0})],D.prototype,"defaultActions",null),e([d({type:Boolean})],D.prototype,"defaultPopupTemplateEnabled",void 0),e([d({readOnly:!0})],D.prototype,"featureCount",null),e([d()],D.prototype,"featurePage",void 0),e([d({value:[]})],D.prototype,"features",null),e([d()],D.prototype,"featuresPerPage",void 0),e([d()],D.prototype,"featureMenuOpen",void 0),e([d({type:j})],D.prototype,"featureItemAbilities",void 0),e([d({readOnly:!0})],D.prototype,"featureItems",void 0),e([d()],D.prototype,"heading",void 0),e([d()],D.prototype,"highlightEnabled",void 0),e([d()],D.prototype,"includeDefaultActions",void 0),e([d({value:"feature"})],D.prototype,"initialDisplayMode",null),e([d({type:m})],D.prototype,"location",null),e([d()],D.prototype,"map",null),e([d()],D.prototype,"open",void 0),e([d({readOnly:!0})],D.prototype,"pendingPromisesCount",null),e([d({readOnly:!0})],D.prototype,"promiseCount",null),e([d()],D.prototype,"promises",null),e([d({value:null,readOnly:!0})],D.prototype,"selectedFeature",null),e([d({value:-1})],D.prototype,"selectedFeatureIndex",null),e([d({readOnly:!0})],D.prototype,"selectedFeatureItem",null),e([d({type:_})],D.prototype,"spatialReference",null),e([d({readOnly:!0})],D.prototype,"state",null),e([d()],D.prototype,"timeZone",null),e([d()],D.prototype,"updateLocationEnabled",void 0),e([d()],D.prototype,"view",void 0),e([d({readOnly:!0})],D.prototype,"waitingForContents",null),e([d({readOnly:!0})],D.prototype,"waitingForResult",null),e([d()],D.prototype,"zoomFactor",void 0),D=e([g("esri.popup.Features")],D);const V=D;export{V as default};
2
+ import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import i from"../core/Error.js";import{EventedAccessor as r}from"../core/Evented.js";import s from"../core/Logger.js";import{abortMaybe as o}from"../core/maybe.js";import{debounce as a,isAbortError as n}from"../core/promiseUtils.js";import l from"../core/ReactiveSet.js";import{watch as h,when as u,sync as c}from"../core/reactiveUtils.js";import{addMany as p}from"../core/SetUtils.js";import{property as d,subclass as g}from"../core/accessorSupport/decorators.js";import m from"../geometry/Point.js";import{initializeProjection as f,project as y}from"../geometry/projectionUtils.js";import _ from"../geometry/SpatialReference.js";import{geographicToWebMercator as F}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as v}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as w}from"../layers/LayerConstants.js";import{ActionsCollection as C,zoomToAggregatedFeatures as b,browseAggregatedFeatures as I,zoomToFeature as P}from"./actions.js";import{getSelectedTarget as A}from"./actionUtils.js";import L from"./Feature.js";import j from"./support/FeatureAbilities.js";import{getDisplayedSymbol as x}from"../symbols/support/symbolUtils.js";import{system as E}from"../time/constants.js";import{highlightsSupported as R}from"../views/support/layerViewUtils.js";import{GoTo as O}from"../widgets/support/GoTo.js";const U="location-scale-handle",S=()=>[P.clone()],T=()=>[b.clone(),I.clone()];let M=null;function H(e,t){switch(e){case"building-scene":case"map-image":case"tile":case"imagery":return!0;case"imagery-tile":return"2d"===t;default:return!1}}let D=class extends(O(r)){constructor(e){super(e),this._pendingPromises=new l,this._fetchFeaturesController=null,this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new j,this.actions=new C,this.activeFeature=null,this.browseClusterEnabled=!1,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=a(async e=>{this._cancelLocationUpdate();const t=new AbortController,{signal:i}=t;this._locationUpdateController=t,await this._locationUpdate(e,{signal:i}).catch(()=>{}).finally(()=>{this._locationUpdateController===t&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([h(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),h(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),h(()=>this.location,e=>this._locationChange(e)),h(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),h(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),h(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),h(()=>this.featureItems,()=>this._featureItemsChange()),h(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),u(()=>!this.waitingForResult,()=>this._waitingForResultChange(),c),h(()=>this.view?.scale,()=>this._viewScaleChange()),u(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelFetchingFeatures(),this._cancelCenterAtLocation(),this._pendingPromises.clear(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){const e=this._get("allActions")||new C;e.removeAll();const{actions:i,defaultActions:r,defaultPopupTemplateEnabled:s,includeDefaultActions:o,selectedFeature:a}=this,n=o?r.concat(i):i,l=a&&("function"==typeof a.getEffectivePopupTemplate&&a.getEffectivePopupTemplate(s)||a.popupTemplate),h=l?.actions,u=l?.overwriteActions?h:h?.concat(n)??n;return u?.filter(t).forEach(t=>e.add(t)),e}set content(e){this.promises=[],this._set("content",e)}get defaultActions(){const e=this._get("defaultActions")||new C;return e.removeAll(),e.addMany(this.selectedFeature?.isAggregate?T():S()),e}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t),this._syncSelectedFeatureIndex(t)}get initialDisplayMode(){return this._get("initialDisplayMode")||"feature"}set initialDisplayMode(e){this._set("initialDisplayMode",e),this._syncSelectedFeatureIndex(this.features)}set location(e){let t=e;const i=this.spatialReference?.isWebMercator,r=e?.spatialReference?.isWGS84;r&&i&&(t=F(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._get("promises")!==e&&(this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),e=e.slice(),p(this._pendingPromises,e),e.reduce((e,t)=>e.finally(()=>t.then(e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)}).finally(()=>this._pendingPromises.delete(t)).catch(()=>{})),Promise.resolve())):this._set("promises",[]))}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;if(-1===t)return null;return e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??E}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return(!!this._fetchFeaturesController||this.pendingPromisesCount>0)&&0===this.featureCount}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,heading:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:r}=this;if(!r||!e)throw new i("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:r});return r.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}next(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount),this}previous(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount),this}async handleViewClick(e){return this._fetchFeaturesAndOpen(e)}_syncSelectedFeatureIndex(e){const{pendingPromisesCount:t,promiseCount:i,selectedFeatureIndex:r}=this,s=i&&e.length;"list"!==this.initialDisplayMode?s&&t&&-1===r?this.selectedFeatureIndex=0:s&&-1!==r||(this.selectedFeatureIndex=e.length?0:-1):(!s||s&&t===i)&&(this.selectedFeatureIndex=-1)}_centerAtLocation(){const{view:e}=this,t=A(this);this._cancelCenterAtLocation();const r=new AbortController,{signal:o}=r;return this._centerAtLocationController=r,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:o}}).catch(e=>{n(e)||s.getLogger(this).error(e)}):Promise.reject(new i("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}_getRoundRobinIndex(e,t){return(e+t)%t}_viewScaleChange(){if(this.selectedFeature?.isAggregate)return this.aggregatedFeaturesEnabled=!1,this.open=!1,void this.clear()}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:r}=this;r&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){"list"!==this.initialDisplayMode&&(this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null)}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:r,featureItems:s}=this;if(null==i)return;const o=((i-1)*r+t)%t,a=Math.min(o+r,s.length);for(let n=o;n<a;n++){const t=s[n];t&&(t.graphic??=e[n])}}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;const s=v(e)?.type;if("map-image"!==s&&"imagery"!==s&&"imagery-tile"!==s||(e.symbol=await x(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const t=await import("../geometry/operators/labelPointOperator.js");return void(this.location=t.execute(e.geometry))}if(i&&!e.geometry){await this._centerAtLocation();const e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",[])}_updateFeatureItems(){const e=this.selectedFeature,t=this.features,i=this.featureItems,r=this.view,s=this.spatialReference,o=this.map,a=this.timeZone,n=this.location,l=this.featureItemAbilities??this._defaultFeatureAbilities;if(!t?.length)return void this._destroyFeatureItems();const h=[],u=new Map,c=new Set;i.forEach(e=>{const t=e?.graphic;e&&t&&u.set(t,e)}),t.forEach((t,p)=>{if(!t)return;const d=i[p];if(d&&!c.has(d)&&(null==d.graphic||d.graphic===t))return d.abilities=l,h[p]=d,void c.add(d);const g=u.get(t);if(g&&!c.has(g))return g.abilities=l,h[p]=g,void c.add(g);const m=new L({abilities:l,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:s,graphic:t===e?t:null,location:n,map:o,view:r,timeZone:a});h[p]=m,c.add(m)}),i.forEach(e=>{!e||c.has(e)||e.destroyed||e.destroy()}),this._set("featureItems",h)}async _getScreenPoint(e,t){const{spatialReference:i,view:r}=this;if(!r)return null;await r.when();const s=e?.spatialReference;return s&&i?(await f(s,i,null,t),r.toScreen(e)):null}_cancelCenterAtLocation(){this._centerAtLocationController=o(this._centerAtLocationController)}_cancelFetchingFeatures(){this._fetchFeaturesController=o(this._fetchFeaturesController)}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:r}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:r}),{signal:r,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const r=new AbortController,{signal:s}=r;this._fetchFeaturesController=r;const o=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:s,event:i});return o.catch(()=>{}).finally(()=>{this._fetchFeaturesController===r&&(this._fetchFeaturesController=null)}),o}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e;this.removeHandles(U),this.addHandles([h(()=>this.view?.scale,()=>this._debouncedLocationUpdate(t).catch(e=>{n(e)||s.getLogger(this).error(e)})),u(()=>!this.open,()=>{this.removeHandles(U)},{once:!0})],U);const{pendingFeatures:r}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});return{location:t??void 0,promises:r}}async _locationUpdate(e,t){const{spatialReference:i}=this,r=this.selectedFeature?.geometry?.type,o=this.location??e;if(r&&"mesh"!==r&&i&&o&&this.selectedFeature){if("point"===r){const e=await import("../geometry/operators/labelPointOperator.js");return void(this.location=e.execute(this.selectedFeature.geometry))}try{const e=this.selectedFeature;let r=e.geometry;const s=this._getHighlightLayer(e),a=e.getObjectId();if(!s||!this.view)return;if(a){const e=this.view?.allLayerViews.find(e=>e.layer.uid===s.uid);if(!e||!("queryFeatures"in e))return;const o=e.createQuery();o.outSpatialReference=i,o.objectIds=[a],o.returnGeometry=!0;const{features:n}=await e.queryFeatures(o,t);r=n[0]?.geometry}if(!r||"mesh"===r.type)return;r=y(r,i),M??=await Promise.all([import("../geometry/operators/intersectsOperator.js"),import("../geometry/operators/proximityOperator.js")]);const[n,l]=M;if(!n.execute(r,o)){const t=l.getNearestCoordinate(r,o).coordinate??o;this.selectedFeature===e&&(this.location=t)}}catch(a){n(a)||s.getLogger(this).error(a)}}}_cancelLocationUpdate(){this._locationUpdateController=o(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const t=v(e),{layer:i}=e;return t&&"layer"in t&&t.layer?t.layer:"map-notes"===t?.type||"subtype-group"===t?.type?t:i??t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(H(t.type,i))return e;const r=e.getObjectId();if(null!=r)return r;const s="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||w:null,o=e.attributes;return o&&s&&o[s]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:r,view:s,open:o}=this;if(!s||!r||!o)return;const a=this._getHighlightLayer(i);if(!a)return;const n=this._getHighlightLayerView(s,a);if(!n)return;this._highlightPromises[e]=n;const l=await n;if(!(l&&R(l)&&this._highlightPromises[e]===n&&this[t]&&this.highlightEnabled))return;const h=l.highlight(this._getHighlightTarget(i,a,s.type));this.addHandles(h,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}_updateFeatures(e){const{features:t}=this,i=new Set(t),r=e.filter(e=>!i.has(e));r?.length&&(this.features=t.concat(r))}};e([d()],D.prototype,"_fetchFeaturesController",void 0),e([d({type:C})],D.prototype,"actions",void 0),e([d({readOnly:!0})],D.prototype,"active",null),e([d()],D.prototype,"activeFeature",void 0),e([d({readOnly:!0})],D.prototype,"allActions",null),e([d()],D.prototype,"browseClusterEnabled",void 0),e([d()],D.prototype,"aggregatedFeaturesEnabled",void 0),e([d({value:null})],D.prototype,"content",null),e([d({type:C,readOnly:!0})],D.prototype,"defaultActions",null),e([d({type:Boolean})],D.prototype,"defaultPopupTemplateEnabled",void 0),e([d({readOnly:!0})],D.prototype,"featureCount",null),e([d()],D.prototype,"featurePage",void 0),e([d({value:[]})],D.prototype,"features",null),e([d()],D.prototype,"featuresPerPage",void 0),e([d()],D.prototype,"featureMenuOpen",void 0),e([d({type:j})],D.prototype,"featureItemAbilities",void 0),e([d({readOnly:!0})],D.prototype,"featureItems",void 0),e([d()],D.prototype,"heading",void 0),e([d()],D.prototype,"highlightEnabled",void 0),e([d()],D.prototype,"includeDefaultActions",void 0),e([d({value:"feature"})],D.prototype,"initialDisplayMode",null),e([d({type:m})],D.prototype,"location",null),e([d()],D.prototype,"map",null),e([d()],D.prototype,"open",void 0),e([d({readOnly:!0})],D.prototype,"pendingPromisesCount",null),e([d({readOnly:!0})],D.prototype,"promiseCount",null),e([d()],D.prototype,"promises",null),e([d({value:null,readOnly:!0})],D.prototype,"selectedFeature",null),e([d({value:-1})],D.prototype,"selectedFeatureIndex",null),e([d({readOnly:!0})],D.prototype,"selectedFeatureItem",null),e([d({type:_})],D.prototype,"spatialReference",null),e([d({readOnly:!0})],D.prototype,"state",null),e([d()],D.prototype,"timeZone",null),e([d()],D.prototype,"updateLocationEnabled",void 0),e([d()],D.prototype,"view",void 0),e([d({readOnly:!0})],D.prototype,"waitingForContents",null),e([d({readOnly:!0})],D.prototype,"waitingForResult",null),e([d()],D.prototype,"zoomFactor",void 0),D=e([g("esri.popup.Features")],D);const V=D;export{V as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const e="20260417",c="4cc2c29e6eae8456a4def54fd1e921131b4252bc";export{e as buildDate,c as commitHash};
2
+ const a="20260419",b="be9298bdf9a242ffa2d20a2ca74f3cb7221968b5";export{a as buildDate,b as commitHash};