@arcgis/core 5.0.0-next.11 → 5.0.0-next.13

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 (382) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/analysis/AreaMeasurementAnalysis.js +1 -1
  3. package/applications/KnowledgeStudio/generalSdkInternalAccess.js +1 -1
  4. package/arcade/functions/geomasync.js +1 -1
  5. package/arcade/functions/geomsync.js +1 -1
  6. package/arcade/functions/knowledgegraph.js +1 -1
  7. package/arcade/geometry/nearestVertex.js +5 -0
  8. package/arcade/geometry/operators.js +1 -1
  9. package/arcade/geometry/operatorsWorker.js +1 -1
  10. package/assets/esri/core/workers/RemoteClient.js +1 -1
  11. package/assets/esri/core/workers/chunks/{af47272aaaef0ea57e71.js → 00ea3052170e831c6bc8.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{91dfd29e2dba200eab09.js → 0105d814fb51c366d1da.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{125e71b0e29d1d132777.js → 02a22dd6d208a925cc5a.js} +1 -1
  14. package/assets/esri/core/workers/chunks/02e7359162cf974b41b6.js +1 -0
  15. package/assets/esri/core/workers/chunks/{ead8d0cbcebd12dbfad7.js → 04211fba145d9f06b3ec.js} +1 -1
  16. package/assets/esri/core/workers/chunks/0441ea7c89266a68b6f0.js +1 -0
  17. package/assets/esri/core/workers/chunks/07f2a75431dd8fc502ef.js +1 -0
  18. package/assets/esri/core/workers/chunks/{d1e97cce5047f1791e22.js → 0ac13de43438f572f59c.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{629127877042ad784ad2.js → 0c8aeb6262e9ec7c87d0.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{d07f911d40bf05fc0306.js → 1008e3d64f5880e3dbf2.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{c29486c4eeb3e72effff.js → 110429583b28c28c36ee.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{61d970ed75c2c358b1e9.js → 14d601e0fe7a0538c7c1.js} +1 -1
  23. package/assets/esri/core/workers/chunks/18474c017ddacd1d3d2c.js +1 -0
  24. package/assets/esri/core/workers/chunks/{1257c37bf04d39c27b62.js → 1c3bee704bafb64bba70.js} +1 -1
  25. package/assets/esri/core/workers/chunks/1d07846bcaac47df0644.js +1 -0
  26. package/assets/esri/core/workers/chunks/{509392131ec473d6b988.js → 1dfca37f95f2b968aa54.js} +1 -1
  27. package/assets/esri/core/workers/chunks/2132ccc45da90f6208b2.js +1 -0
  28. package/assets/esri/core/workers/chunks/2166238a7ad63a2d43c7.js +1 -0
  29. package/assets/esri/core/workers/chunks/2214d3b1f11658a85d0f.js +1 -0
  30. package/assets/esri/core/workers/chunks/2266a8f2c2ec37c19bb4.js +1 -0
  31. package/assets/esri/core/workers/chunks/22ca80f491e070b2a5e7.js +1 -0
  32. package/assets/esri/core/workers/chunks/{f80f5dbf96c343ac4df6.js → 24d8922ac9cd48621357.js} +1 -1
  33. package/assets/esri/core/workers/chunks/257f17b3836a623a9dbe.js +1 -0
  34. package/assets/esri/core/workers/chunks/2b27499fa9de22970b7a.js +1 -0
  35. package/assets/esri/core/workers/chunks/2e76fbd3c874300fc4a7.js +1 -0
  36. package/assets/esri/core/workers/chunks/31b5900119dd7cd9e7d3.js +1 -0
  37. package/assets/esri/core/workers/chunks/34bb4852ebef0f529c96.js +1 -0
  38. package/assets/esri/core/workers/chunks/{9698f36c143953a975d4.js → 353d447f3745942c88a8.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{52282f767bd0e99ddca0.js → 3545dce74bb6b0354cb7.js} +1 -1
  40. package/assets/esri/core/workers/chunks/36b1f47d70b57d79df7b.js +1 -0
  41. package/assets/esri/core/workers/chunks/38810e3f298e8a0b64a6.js +1 -0
  42. package/assets/esri/core/workers/chunks/{7290e7a819eb291b1df2.js → 38fa50336983265c73a4.js} +3 -3
  43. package/assets/esri/core/workers/chunks/{fe49321dca22dc60d105.js → 3b1982bf7b44ff897a35.js} +1 -1
  44. package/assets/esri/core/workers/chunks/3bacd904cd93c8013f6a.js +1 -0
  45. package/assets/esri/core/workers/chunks/{588533c3abe876f20f62.js → 3d5b157bd9060b07670b.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{06e60fc7715d08ede59d.js → 3edffdb0e282ed562ac7.js} +1 -1
  47. package/assets/esri/core/workers/chunks/3fa15d4ee5fab8fff76e.js +1 -0
  48. package/assets/esri/core/workers/chunks/487e1c592f1b6fd03a7d.js +1 -0
  49. package/assets/esri/core/workers/chunks/{ee5aa11750c51b220f1e.js → 4bcb83119481453dbb90.js} +1 -1
  50. package/assets/esri/core/workers/chunks/4ca5d58117e7a5f73e1e.js +1 -0
  51. package/assets/esri/core/workers/chunks/{826fa0dfb63df77bfd95.js → 4f0016111fd84c612f41.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{24cd7b84cd0f3de4bff2.js → 4f14fed0ec885c3c33d5.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{4baf6f6e7ddedb25f806.js → 5299ec59c86022ca37e2.js} +1 -1
  54. package/assets/esri/core/workers/chunks/53a9c34cb3f6ac06cd50.js +1 -0
  55. package/assets/esri/core/workers/chunks/5415fbcc7ed203fc5575.js +1 -0
  56. package/assets/esri/core/workers/chunks/54c49a768147720c3c56.js +1 -0
  57. package/assets/esri/core/workers/chunks/558822b700e8bd844052.js +1 -0
  58. package/assets/esri/core/workers/chunks/{da24ad57747714ac5eda.js → 55adbd7481f8dfb1067e.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{7803495f8862d9025bcd.js → 56e06c9c1120bea2c641.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{dc66490520f97eef15bf.js → 57806a01f33074b601e7.js} +24 -24
  61. package/assets/esri/core/workers/chunks/{67f03d042455cd0f7009.js → 57b410198d83bf0ab708.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{0a5d74414dd02a2fb8e1.js → 5bc4140333d0db904949.js} +1 -1
  63. package/assets/esri/core/workers/chunks/5e08b19e6d7202ea38d7.js +1 -0
  64. package/assets/esri/core/workers/chunks/{0d5212f59e9b62c16164.js → 5f6df4a3376b52ead53f.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{15c7c10ff9ac63f0e792.js → 5fb2edf942b1cd8d7336.js} +1 -1
  66. package/assets/esri/core/workers/chunks/600e2e6b51e2fb9c598c.js +1 -0
  67. package/assets/esri/core/workers/chunks/{dc51438b832551924a9e.js → 6238ca7541800eb2566b.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{731f7b552dde0fb325cd.js → 62c2bd082a0c669bc857.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{b8a3f1e60e24a13749c1.js → 631fb2e62e48f8be4051.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{c8e686efe344a33a0258.js → 6490bc392a4b4f9e24f9.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{e767f83f9e2de6650f80.js → 6581b94e796781c0ad4a.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{53654edd766d9b4ef750.js → 658cd45b5fb304fd840a.js} +1 -1
  73. package/assets/esri/core/workers/chunks/67f305b0c72e77a6331a.js +1 -0
  74. package/assets/esri/core/workers/chunks/6922351c001fdb4cb757.js +1 -0
  75. package/assets/esri/core/workers/chunks/{6e22b02a9715c10578d0.js → 69cca5d3f715876c6b32.js} +1 -1
  76. package/assets/esri/core/workers/chunks/6c13c01c47abc1939f96.js +1 -0
  77. package/assets/esri/core/workers/chunks/{c37f7756d48ff9af2656.js → 736035c0069ccb03bee6.js} +1 -1
  78. package/assets/esri/core/workers/chunks/7c14f99e6cfff2a8ef4a.js +1 -0
  79. package/assets/esri/core/workers/chunks/812f2ccc01f44e3cfd41.js +1 -0
  80. package/assets/esri/core/workers/chunks/82338cdd56aa1de28db3.js +1 -0
  81. package/assets/esri/core/workers/chunks/{51ab2acac4ecc1ca9c34.js → 86830fcb5475502dac65.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{11e96a312f1294d34c50.js → 881df4fd1dc594576457.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{d1ca7c3a32ce00ed8b81.js → 8be16b03caa947ac7631.js} +1 -1
  84. package/assets/esri/core/workers/chunks/8d9ccc9a43a315cb6b04.js +1 -0
  85. package/assets/esri/core/workers/chunks/{042cd64e1f4eb326c30f.js → 8fc82fe1fcbcedf35400.js} +1 -1
  86. package/assets/esri/core/workers/chunks/91afee11072471e4eefe.js +1 -0
  87. package/assets/esri/core/workers/chunks/{fbd8d2f61f8a15bcf3db.js → 9595aabbaf411eceea1e.js} +1 -1
  88. package/assets/esri/core/workers/chunks/{6cf391b5ed7351601a2a.js → 9978ec6c67e87dc08a1d.js} +1 -1
  89. package/assets/esri/core/workers/chunks/9cdd087c43a601ec331d.js +1 -0
  90. package/assets/esri/core/workers/chunks/9e5e05d6430712b0b1bc.js +1 -0
  91. package/assets/esri/core/workers/chunks/{5e2ce34def5e053913b2.js → a10e533f336c035d8d40.js} +1 -1
  92. package/assets/esri/core/workers/chunks/{311b564e44ae637c960d.js → a3ade7e8b9ddadb5f800.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{18c5d79d5ee1136e0a57.js → a57751f3d78524c876cd.js} +1 -1
  94. package/assets/esri/core/workers/chunks/{0030d68d9edf42b4af57.js → a6a87f92f453204e9bdb.js} +1 -1
  95. package/assets/esri/core/workers/chunks/a6ee40dfc471d6612f3c.js +1 -0
  96. package/assets/esri/core/workers/chunks/a8ea050090c351e3b6d6.js +1 -0
  97. package/assets/esri/core/workers/chunks/adf7ccf4ef629211c7ee.js +1 -0
  98. package/assets/esri/core/workers/chunks/ae6066ea6cb373dc6db3.js +1 -0
  99. package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +1 -0
  100. package/assets/esri/core/workers/chunks/b328635d191f5424c047.js +1 -0
  101. package/assets/esri/core/workers/chunks/b59f9c3f7a149214256f.js +1 -0
  102. package/assets/esri/core/workers/chunks/{664ae441617afe4b17ec.js → b87bc987983b31c13f64.js} +1 -1
  103. package/assets/esri/core/workers/chunks/bb56717c4e36f28d4c08.js +1 -0
  104. package/assets/esri/core/workers/chunks/bbdfa8ffcf084cbd9938.js +1 -0
  105. package/assets/esri/core/workers/chunks/bc19a232076d98825eef.js +1 -0
  106. package/assets/esri/core/workers/chunks/bc29c29bfa5be3ebafb1.js +1 -0
  107. package/assets/esri/core/workers/chunks/{ddfd01bb9ba8577c3ffc.js → c3dcfe26c2c3c829762d.js} +1 -1
  108. package/assets/esri/core/workers/chunks/c3ddcf9148dd2640c402.js +1 -0
  109. package/assets/esri/core/workers/chunks/{6d9f2b113d6bde936a04.js → c4dfd897bcab20dee43b.js} +1 -1
  110. package/assets/esri/core/workers/chunks/{0f30a9514571c7be9978.js → c5c02ace54fe4ab9214b.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{87921f3fa9001f5801ed.js → c68935ed44eb0702a6ba.js} +1 -1
  112. package/assets/esri/core/workers/chunks/{b6853c6a25eaabc9a7f6.js → c9579d607e59bae214da.js} +1 -1
  113. package/assets/esri/core/workers/chunks/d39a10155317e6f7a21c.js +1 -0
  114. package/assets/esri/core/workers/chunks/{773f2c6c9d38db76dfed.js → d42f7e48d694b2427c0d.js} +1 -1
  115. package/assets/esri/core/workers/chunks/d466f3f0d3824c77da7c.js +1 -0
  116. package/assets/esri/core/workers/chunks/d4a91f2256e48316a8f0.js +1 -0
  117. package/assets/esri/core/workers/chunks/d69265ceabfa92b40bb7.js +1 -0
  118. package/assets/esri/core/workers/chunks/d7755c4c8d1d3059efca.js +1 -0
  119. package/assets/esri/core/workers/chunks/{eb9c166db0db6fa60e95.js → d7b0fcce847f563ea255.js} +1 -1
  120. package/assets/esri/core/workers/chunks/d87f0116ee53ec5f98e9.js +1 -0
  121. package/assets/esri/core/workers/chunks/d888ae5ac1810a486919.js +1 -0
  122. package/assets/esri/core/workers/chunks/db54552def7bc6cef9bd.js +1 -0
  123. package/assets/esri/core/workers/chunks/dc4d29cfce12ac599888.js +1 -0
  124. package/assets/esri/core/workers/chunks/dda6ca9af35518652d0f.js +1 -0
  125. package/assets/esri/core/workers/chunks/{7005d956c990a04ee8b2.js → dec336700cfb83abbbeb.js} +1 -1
  126. package/assets/esri/core/workers/chunks/{b3613a38178cad2ebc82.js → dee9867b3379e024ae96.js} +1 -1
  127. package/assets/esri/core/workers/chunks/df130abb76713a85b4f9.js +1 -0
  128. package/assets/esri/core/workers/chunks/e0aa036c56ecdfe01503.js +1 -0
  129. package/assets/esri/core/workers/chunks/e2e4f6b58763fae51ae5.js +1 -0
  130. package/assets/esri/core/workers/chunks/e8a9c56fd0e7fd2558ef.js +1 -0
  131. package/assets/esri/core/workers/chunks/{1d06fcae4c2f02fb1c95.js → eb7eb3b3b8800fd73f3e.js} +1 -1
  132. package/assets/esri/core/workers/chunks/{37c1f155da14de91565a.js → edf58513f789856cd1db.js} +1 -1
  133. package/assets/esri/core/workers/chunks/{f34e3fa0c5b28531e289.js → ef789e8487deab916fad.js} +1 -1
  134. package/assets/esri/core/workers/chunks/f28ffda9a95c6568503d.js +1 -0
  135. package/assets/esri/core/workers/chunks/f98689562017583f73ee.js +1 -0
  136. package/assets/esri/core/workers/chunks/{292daac70bb828e4923f.js → f9cd068d184cab66dc33.js} +1 -1
  137. package/assets/esri/core/workers/chunks/{dff2df259f140b7d97a9.js → fd88e07cba5964f80e9e.js} +1 -1
  138. package/assets/esri/core/workers/chunks/{c9b16fd41cd59d452522.js → fdbe16e3b23e01655c0c.js} +1 -1
  139. package/assets/esri/core/workers/chunks/{063905fbf9a0c6586949.js → ffdba51e7256ebf8ebd3.js} +1 -1
  140. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  141. package/assets/esri/themes/base/widgets/_Editor.scss +35 -2
  142. package/assets/esri/themes/dark/main.css +1 -1
  143. package/assets/esri/themes/light/main.css +1 -1
  144. package/assets/esri/themes/light/view.css +1 -1
  145. package/chunks/Envelope.js +1 -1
  146. package/chunks/Geometry.js +1 -1
  147. package/chunks/MultiPathImpl.js +1 -1
  148. package/chunks/Point2D.js +1 -1
  149. package/chunks/UnitFactory.js +1 -1
  150. package/chunks/containsOperator.js +1 -1
  151. package/chunks/densifyOperator.js +1 -1
  152. package/chunks/differenceOperator.js +1 -1
  153. package/chunks/intersectsOperator.js +1 -1
  154. package/chunks/persistableUrlUtils.js +1 -1
  155. package/config.js +1 -1
  156. package/core/XHRAdapter.js +1 -1
  157. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  158. package/core/quantityFormatUtils.js +1 -1
  159. package/core/unitFormatUtils.js +1 -1
  160. package/core/unitUtils.js +1 -1
  161. package/editing/fieldUtils.js +5 -0
  162. package/geometry/Extent.js +1 -1
  163. package/geometry/Geometry.js +1 -1
  164. package/geometry/Mesh.js +1 -1
  165. package/geometry/Point.js +1 -1
  166. package/geometry/SpatialReference.js +1 -1
  167. package/geometry/ellipsoidUtils.js +1 -1
  168. package/geometry/operators/support/jsonConverter.js +1 -1
  169. package/geometry/support/MeshTransform.js +1 -1
  170. package/geometry/support/axisAngleDegrees.js +1 -1
  171. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  172. package/geometry/support/meshUtils/rotate.js +1 -1
  173. package/geometry/support/meshUtils/scale.js +1 -1
  174. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  175. package/geometry/support/plane.js +1 -1
  176. package/geometry/support/polygonUtils.js +1 -1
  177. package/interfaces.d.ts +90 -7
  178. package/kernel.js +1 -1
  179. package/layers/Layer.js +1 -1
  180. package/layers/MapNotesLayer.js +1 -1
  181. package/layers/graphics/data/QueryEngine.js +1 -1
  182. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  183. package/layers/save/groupLayerUtils.js +1 -1
  184. package/layers/save/imageryUtils.js +1 -1
  185. package/layers/save/streamLayerUtils.js +1 -1
  186. package/layers/support/DateTimeFieldFormat.js +1 -1
  187. package/layers/support/FieldFormat.js +1 -1
  188. package/layers/support/LayerLoadContext.js +1 -1
  189. package/layers/support/NumberFieldFormat.js +1 -1
  190. package/layers/support/arcgisLayerUrl.js +1 -1
  191. package/layers/support/arcgisLayers.js +1 -1
  192. package/layers/support/fetchService.js +1 -1
  193. package/layers/support/fieldUtils.js +1 -1
  194. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  195. package/layers/video/VideoCameraSensorModel.js +1 -1
  196. package/networks/support/UNTraceConfiguration.js +1 -1
  197. package/package.json +1 -1
  198. package/popup/ExpressionInfo.js +1 -1
  199. package/popup/FieldInfo.js +1 -1
  200. package/popup/content/AttachmentsContent.js +1 -1
  201. package/popup/content/BarChartMediaInfo.js +1 -1
  202. package/popup/content/ColumnChartMediaInfo.js +1 -1
  203. package/popup/content/Content.js +1 -1
  204. package/popup/content/CustomContent.js +1 -1
  205. package/popup/content/ExpressionContent.js +1 -1
  206. package/popup/content/FieldsContent.js +1 -1
  207. package/popup/content/ImageMediaInfo.js +1 -1
  208. package/popup/content/LineChartMediaInfo.js +1 -1
  209. package/popup/content/MediaContent.js +1 -1
  210. package/popup/content/PieChartMediaInfo.js +1 -1
  211. package/popup/content/RelationshipContent.js +1 -1
  212. package/popup/content/TextContent.js +1 -1
  213. package/popup/content/UtilityNetworkAssociationsContent.js +1 -1
  214. package/popup/content/mixins/ChartMediaInfo.js +1 -1
  215. package/popup/content/mixins/MediaInfo.js +1 -1
  216. package/popup/content.js +1 -1
  217. package/popup/support/FieldInfoFormat.js +1 -1
  218. package/portal/support/layersLoader.js +1 -1
  219. package/request/cors.js +5 -0
  220. package/request/loadImage.js +5 -0
  221. package/request/preferredHosts.js +5 -0
  222. package/request/process.js +5 -0
  223. package/request/queue.js +5 -0
  224. package/request/serviceJSON.js +5 -0
  225. package/request.js +1 -1
  226. package/rest/geometryService/utils.js +1 -1
  227. package/rest/knowledgeGraphService.d.ts +1 -0
  228. package/support/getDefaultUnitForView.js +1 -1
  229. package/support/popupUtils.js +1 -1
  230. package/support/revision.js +1 -1
  231. package/symbols/support/symbolUtils.js +1 -1
  232. package/time/TimeExtent.js +1 -1
  233. package/views/2d/analysis/AreaMeasurement/AreaMeasurementAreaVisualization.js +5 -0
  234. package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +5 -0
  235. package/views/2d/analysis/AreaMeasurement/AreaMeasurementLabelVisualization.js +5 -0
  236. package/views/2d/analysis/AreaMeasurement/AreaMeasurementManipulatorVisualization.js +5 -0
  237. package/views/2d/analysis/AreaMeasurement/AreaMeasurementSketchVisualization.js +5 -0
  238. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +5 -0
  239. package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +5 -0
  240. package/views/2d/analysis/analysisViewModuleImportUtils.js +1 -1
  241. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  242. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  243. package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +1 -1
  244. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  245. package/views/3d/environment/CloudsRenderer.js +1 -1
  246. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  247. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  248. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  249. package/views/3d/layers/FlowSubView3D.js +1 -1
  250. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  251. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  252. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  253. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
  254. package/views/3d/layers/i3s/I3SDataRequester.js +1 -1
  255. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  256. package/views/3d/support/StreamTextureCollection.js +1 -1
  257. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  258. package/views/3d/terrain/TerrainSurface.js +1 -1
  259. package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
  260. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  261. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  262. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  263. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  264. package/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager.js +1 -1
  265. package/views/3d/webgl-engine/lib/TextureBackedBuffer/ManagedTextureBackedBuffer.js +1 -1
  266. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
  267. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  268. package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
  269. package/views/View2D.js +1 -1
  270. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  271. package/views/analysis/ElevationProfile/constants.js +1 -1
  272. package/views/analysis/ElevationProfile/elevationProfileErrors.js +1 -1
  273. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  274. package/views/draw/DrawOperation.js +1 -1
  275. package/views/magnifier/resources.js +1 -1
  276. package/webdoc/support/webdocSaveUtils.js +1 -1
  277. package/widgets/BasemapLayerList.js +1 -1
  278. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  279. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  280. package/widgets/Editor/EditorViewModel.js +1 -1
  281. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  282. package/widgets/Editor/MergeFeaturesWorkflowData.js +1 -1
  283. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  284. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  285. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  286. package/widgets/Editor/UpdateWorkflow.js +1 -1
  287. package/widgets/Editor/Workflow.js +1 -1
  288. package/widgets/Editor/components/FeatureList.js +1 -1
  289. package/widgets/Editor/components/MergeFeaturesList.js +5 -0
  290. package/widgets/Editor/components/Notices.js +1 -1
  291. package/widgets/Editor/components/PanelContent.js +1 -1
  292. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  293. package/widgets/Editor/css.js +1 -1
  294. package/widgets/Editor/support/EditorItem.js +1 -1
  295. package/widgets/Editor/support/SketchController.js +1 -1
  296. package/widgets/Editor/support/errors.js +1 -1
  297. package/widgets/Editor/support/mergeFeaturesUtils.js +1 -1
  298. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  299. package/widgets/Editor/workflowUtils.js +1 -1
  300. package/widgets/Editor.js +1 -1
  301. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  302. package/widgets/FeatureForm/FieldInput.js +1 -1
  303. package/widgets/FeatureForm.js +1 -1
  304. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  305. package/widgets/FeatureTable/FieldColumn.js +1 -1
  306. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  307. package/widgets/LayerList.js +1 -1
  308. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  309. package/widgets/Legend/support/utils.js +1 -1
  310. package/widgets/PanoramicVideoViewer.js +1 -1
  311. package/widgets/support/FilterCondition.js +1 -1
  312. package/assets/esri/core/workers/chunks/0200637e0503556a3b97.js +0 -1
  313. package/assets/esri/core/workers/chunks/022c854eff2c2c2aed6b.js +0 -1
  314. package/assets/esri/core/workers/chunks/06f75c5b6b50934d72a6.js +0 -1
  315. package/assets/esri/core/workers/chunks/15f969836d63c7fe2d9d.js +0 -1
  316. package/assets/esri/core/workers/chunks/2857bcb68df874e9aa62.js +0 -1
  317. package/assets/esri/core/workers/chunks/2a9fc0301268ff909246.js +0 -1
  318. package/assets/esri/core/workers/chunks/2ddcf3cea0efe4052618.js +0 -1
  319. package/assets/esri/core/workers/chunks/2e8a4df83c43f86d7361.js +0 -1
  320. package/assets/esri/core/workers/chunks/2f2e4f81f3daa3fb8527.js +0 -1
  321. package/assets/esri/core/workers/chunks/3109f0a6914e7be088ed.js +0 -1
  322. package/assets/esri/core/workers/chunks/31bb1ee9370c2753ce9d.js +0 -1
  323. package/assets/esri/core/workers/chunks/329fccd7f5cb8401e0c3.js +0 -1
  324. package/assets/esri/core/workers/chunks/38f6b9288c82dac9a800.js +0 -1
  325. package/assets/esri/core/workers/chunks/3b1848713ee25f750242.js +0 -1
  326. package/assets/esri/core/workers/chunks/4291681d067ebdf86e73.js +0 -1
  327. package/assets/esri/core/workers/chunks/42a1e71d09e8583a7327.js +0 -1
  328. package/assets/esri/core/workers/chunks/44f27eac92c5ccc57e12.js +0 -1
  329. package/assets/esri/core/workers/chunks/4941bfd3aae7f6bdac97.js +0 -1
  330. package/assets/esri/core/workers/chunks/4bd2cc65f7db0d261543.js +0 -1
  331. package/assets/esri/core/workers/chunks/4fa230dc6e5e87b0dec1.js +0 -1
  332. package/assets/esri/core/workers/chunks/4fbe2a8d742065cbaea3.js +0 -1
  333. package/assets/esri/core/workers/chunks/4fe4feeb251f2916a339.js +0 -1
  334. package/assets/esri/core/workers/chunks/55eb6a0f1e4569a65f2a.js +0 -1
  335. package/assets/esri/core/workers/chunks/591e459f9fce34f519ca.js +0 -1
  336. package/assets/esri/core/workers/chunks/59514624daf188a8030f.js +0 -1
  337. package/assets/esri/core/workers/chunks/5c09d98b41f71a036e2a.js +0 -1
  338. package/assets/esri/core/workers/chunks/605b9643b1baeff16149.js +0 -1
  339. package/assets/esri/core/workers/chunks/6293e33f304c4952f88c.js +0 -1
  340. package/assets/esri/core/workers/chunks/655beaf83e9845a02334.js +0 -1
  341. package/assets/esri/core/workers/chunks/6e25ef5ad6d6b3f88343.js +0 -1
  342. package/assets/esri/core/workers/chunks/759321045c264bc6964e.js +0 -1
  343. package/assets/esri/core/workers/chunks/7e3f27ebf366d4266350.js +0 -1
  344. package/assets/esri/core/workers/chunks/826072cfc0ac8e36f03c.js +0 -1
  345. package/assets/esri/core/workers/chunks/9b0c2f4311fe9bca370a.js +0 -1
  346. package/assets/esri/core/workers/chunks/9c48d8d17831aa57f8a4.js +0 -1
  347. package/assets/esri/core/workers/chunks/9f28b2800945903bc165.js +0 -1
  348. package/assets/esri/core/workers/chunks/a27e74117c37f3efcbca.js +0 -1
  349. package/assets/esri/core/workers/chunks/a41ba05c09a59d1eb35f.js +0 -1
  350. package/assets/esri/core/workers/chunks/a93ebd076bc55aa6eab0.js +0 -1
  351. package/assets/esri/core/workers/chunks/aaed35a6414859233678.js +0 -1
  352. package/assets/esri/core/workers/chunks/acd0564ad1544f452f3f.js +0 -1
  353. package/assets/esri/core/workers/chunks/b0f43191a431c9de16e5.js +0 -1
  354. package/assets/esri/core/workers/chunks/b320bb76c7e9998fe53b.js +0 -1
  355. package/assets/esri/core/workers/chunks/ba4571d2637a74a59552.js +0 -1
  356. package/assets/esri/core/workers/chunks/c4090a60d149a5962179.js +0 -1
  357. package/assets/esri/core/workers/chunks/c61c61dac1e8d6188749.js +0 -1
  358. package/assets/esri/core/workers/chunks/c84caf81bfaa4a8b5aa1.js +0 -1
  359. package/assets/esri/core/workers/chunks/c8c8cf43fd640d2f5cb1.js +0 -1
  360. package/assets/esri/core/workers/chunks/d28670cb11164e318e45.js +0 -1
  361. package/assets/esri/core/workers/chunks/d56ac52a5288e06365e7.js +0 -1
  362. package/assets/esri/core/workers/chunks/ddca92e18e96ea1c9d89.js +0 -1
  363. package/assets/esri/core/workers/chunks/ded9747ae04ab889d52a.js +0 -1
  364. package/assets/esri/core/workers/chunks/df5afa06c6deb6b40109.js +0 -1
  365. package/assets/esri/core/workers/chunks/df8279e1baf378faf85f.js +0 -1
  366. package/assets/esri/core/workers/chunks/e3434f91f47f551d9e02.js +0 -1
  367. package/assets/esri/core/workers/chunks/eb6c3dd440ede4adf603.js +0 -1
  368. package/assets/esri/core/workers/chunks/edc671b9b83c8e19cb42.js +0 -1
  369. package/assets/esri/core/workers/chunks/f141c9f7f0d9b2322bf6.js +0 -1
  370. package/assets/esri/core/workers/chunks/f57401a759f420596b2c.js +0 -1
  371. package/assets/esri/core/workers/chunks/f7a1f48c53422c6e2028.js +0 -1
  372. package/assets/esri/core/workers/chunks/f7f002ea5ff5fe7f6249.js +0 -1
  373. package/assets/esri/core/workers/chunks/f8e889be4b45f6f0667e.js +0 -1
  374. package/assets/esri/core/workers/chunks/fbd796c88f07bb6755dc.js +0 -1
  375. package/assets/esri/core/workers/chunks/fec3897ed7e8691387ed.js +0 -1
  376. package/processRequest.js +0 -5
  377. package/requestQueue.js +0 -5
  378. package/support/requestPresets.js +0 -5
  379. package/support/requestUtils.js +0 -5
  380. /package/{rest/support → request}/ImageWithType.js +0 -0
  381. /package/{requestConfig.js → request/config.js} +0 -0
  382. /package/{support/requestImageUtils.js → request/image.js} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9718],{5359:(e,t,i)=>{i.d(t,{H:()=>s,Z:()=>r});const s=Symbol("isImageryTileGraphicOrigin");function r(e){return!!e&&s in e}},18768:(e,t,i)=>{i.d(t,{b:()=>l});var s=i(31635),r=i(53966),a=i(10107),n=(i(44208),i(87811),i(64108)),o=i(60694);const l=e=>{const t=e;let i=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,o.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,o.Jf)(e,r.A.getLogger(this)))}};return(0,s.Cg)([(0,a.MZ)()],i.prototype,"title",null),(0,s.Cg)([(0,a.MZ)({type:String})],i.prototype,"url",null),i=(0,s.Cg)([(0,n.$)("esri.layers.mixins.ArcGISService")],i),i}},19718:(e,t,i)=>{i.r(t),i.d(t,{default:()=>Ye});var s,r=i(31635),a=i(37838),n=i(69540),o=i(49186),l=i(53966),c=i(25728),u=i(74887),f=i(36708),h=i(10107),p=i(56507),d=i(44208),m=(i(87811),i(64108)),g=i(89808),y=i(99959),w=i(5359);class v extends y.A{get[(s=w.H,g.Q)](){return this.layer}constructor(e){super(),this[s]=!0,this.type="imagery-tile",this.layer=e}get id(){return this.layer.id}}var x=i(4146),b=i(18768),I=i(63074),C=i(69208),S=i(89015),A=i(16131),T=i(8303),R=i(63660),O=i(56551),M=i(54310),_=i(25036),F=i(82935),P=i(10873),k=i(20437),D=i(74797),N=i(22796),L=i(76353),E=i(84169),B=i(4916),z=i(68197),J=i(5443),U=i(16930),$=i(73444),j=i(14140),q=i(16019);function Z(e){return["x","e","east","long","longitude"].includes(e.toLowerCase())}function H(e){return["y","n","west","lat","latitude"].includes(e.toLowerCase())}function V(e){const{axes:t}=e.domain,i=Object.keys(t),s=[],r=[];let a=-1,n=-1,o=[];for(let e=0;e<i.length;e++){const l=i[e];Z(l)?a=e:H(l)&&(n=e);const c=t[l],u=[];if("values"in c){c.values.forEach(e=>u.push("string"==typeof e?new Date(e).getTime():e));const e=u[1]-u[0];s.push([u[0]-.5*e,u[u.length-1]+.5*e]),r.push(e)}else{const{start:e,stop:t,num:i}=c,a=(t-e)/(i-1);s.push([e-.5*a,t+.5*a]),r.push(a);for(let t=0;t<i;t++)u.push(e+a*t)}o.push({name:l,values:u,extent:[u[0],u[u.length-1]]})}a>-1&&-1===n?n=0===a?1:0:n>-1&&-1===a?a=0===n?1:0:-1===n&&-1===a&&(a=0,n=1),o=o.filter((e,t)=>!(t===a||t===n));const{referencing:l}=e.domain,c=l.find(e=>e.coordinates.includes(i[a])).system.id,u=c?.slice(c.lastIndexOf("/")+1),f=null==u||"CRS84"===u?4326:Number(u),h=new U.A({wkid:f}),[p,d]=s[a],[m,g]=s[n],y=new J.A({xmin:p,xmax:d,ymin:m,ymax:g,spatialReference:h});return{width:Math.round(y.width/r[a]),height:Math.round(y.height/r[n]),extent:y,dimensions:o}}function G(e){const t=(0,$.lR)();return t?e[t]??Object.values(e)[0]:Object.values(e)[0]}function W(){return Math.round(255*Math.random())}function X(e){const t={},{parameters:i}=e;if(!i)return t;for(const[e,s]of Object.entries(i)){const{type:i,description:r,unit:a,categoryEncoding:n,observedProperty:o}=s;if("Parameter"===i&&(t[e]={},r&&(t[e].description=G(r)),a&&(t[e].unit=a.label?G(a.label):null,t[e].symbol=a.symbol?.value),n)){const i=Object.entries(n).map((e,t)=>({OID:t,Value:Number(e[1]),ClassName:e[0].slice(e[0].lastIndexOf("/")+1),Count:1}));let s=!1;o?.categories?.length&&(o.categories.forEach(e=>{if(!e.id)return;const t=e.id.slice(e.id.lastIndexOf("/")+1),r=i.find(e=>e.ClassName===t);if(!r)return;const a=e.label?G(e.label):null;if(r.Label=a,e.preferredColor){const t=z.A.fromHex(e.preferredColor);t&&(s=!0,r.Red=t.r,r.Green=t.g,r.Blue=t.b)}}),s&&i.forEach(e=>{null==e.Red&&(e.Red=W(),e.Green=W(),e.Blue=W())}));const r={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:i.map(e=>({attributes:e}))};s&&r.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),t[e].attributeTable=r}}return t}function Y(e){let t=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(let s=0;s<e.length;s++){const r=e[s];null!=r&&(r<t&&(t=r),r>i&&(i=r))}return(0,q.X1)(t,i)}function K(e,t,i){const s=e.map((e,i)=>({name:e,count:t[i]})).sort((e,t)=>e.name>t.name?-1:1),r=(a=1,e=>a*=e.count);var a;const n=[...s.slice(1),{name:"",count:1}].reverse().map(r).reverse();let o=0;for(let r=e.length-1;r>=0;r--)o+=n[s.findIndex(({name:t})=>t===e[r])]*(i%t[r]),i=Math.floor(i/t[r]);return o}var Q=i(45617),ee=i(87186),te=i(77301),ie=i(28435),se=i(6952);let re=class extends B.A{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}fetchRawTile(e,t,i,s={}){if(!this._pixelBlockTiles){const{rasterInfo:r}=this,[a,n]=r.storageInfo.tileInfo.size,{sliceId:o}=s,{pixelBlocks:l}=this.source,c={pixelBlock:null==o?l[0]:l[o],useBilinear:"thematic"!==r.dataType,tileSize:{width:a,height:n},level:e,row:t,col:i},u=this.rasterJobHandler?this.rasterJobHandler.clipTile(c,s):(0,ie.J$)(c);return Promise.resolve(u)}const r=this._pixelBlockTiles.get(`${e}/${t}/${i}`);return Promise.resolve(r)}async _open(e){const t=this.source,{pixelBlocks:i,attributeTable:s,statistics:r,histograms:a,name:n,nativeExtent:o,transform:l,colormap:c}=t,u=i[0],{width:f,height:h,pixelType:p}=u,d=t.extent??new J.A({xmin:-.5,ymin:.5,xmax:f-.5,ymax:h-.5,spatialReference:new U.A({wkid:3857})}),m=t.isPseudoSpatialReference??!t.extent,g={x:d.width/f,y:d.height/h},y={...t.keyProperties};t.dataType&&(y.DataType=t.dataType),t.bandInfos&&(y.BandProperties=t.bandInfos.map(e=>e.toJSON())),s&&(y.DataType="Thematic");const w=new ee.A({width:f,height:h,pixelType:p,extent:d,nativeExtent:o,attributeTable:s,colormap:c,transform:l,pixelSize:g,spatialReference:d.spatialReference,bandCount:u.pixels.length,keyProperties:y,multidimensionalInfo:t.multidimensionalInfo,statistics:r,isPseudoSpatialReference:m,histograms:a});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(w),this.createRemoteDatasetStorageInfo(w,512,512),this._set("rasterInfo",w),this.updateTileInfo(),w.multidimensionalInfo?await this._buildMDimStats(t.pixelBlocks,w.multidimensionalInfo):await this._buildInMemoryRaster(u,{width:512,height:512},e),w.multidimensionalInfo||(this.source=null),this.datasetName=n}async _buildInMemoryRaster(e,t,i){const{rasterInfo:s}=this,r=s.storageInfo.maximumPyramidLevel??0,a="thematic"!==s.dataType,n=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:r,useBilinear:a},i):Promise.resolve((0,ie.lD)(e,t,r,a)),l=null!=s.statistics,c=null!=s.histograms,f=this.ioConfig.skipStatistics||l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},i):Promise.resolve((0,se.f4)(e)),h=await(0,u.Lx)([n,f]);if(!h[0].value&&h[1].value)throw new o.A("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=h[0].value,l||(s.statistics=h[1].value?.statistics),c||(s.histograms=h[1].value?.histograms)}async _buildMDimStats(e,t,i){for(let s=0;s<t.variables.length;s++){const r=t.variables[s];if(r.statistics)continue;const a=r.dimensions.map(e=>new Q.A({variableName:r.name,dimensionName:e.name,values:[e.values?.[0]??e.extent?.[0]],isSlice:!0})),n=(0,te.NG)(a,t),o=null==n?null:e[n];if(null==o)continue;const l=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:o},i):(0,se.eH)(o);r.statistics=l.statistics,r.histograms||(r.histograms=l.histograms)}}};(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],re.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,h.MZ)()],re.prototype,"source",void 0),(0,r.Cg)([(0,h.MZ)()],re.prototype,"url",null),re=(0,r.Cg)([(0,m.$)("esri.layers.support.rasterDatasets.InMemoryRaster")],re);const ae=re;var ne=i(22671);let oe=class extends B.A{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(e,t,i,s={}){return this._inMemoryRaster.fetchRawTile(e,t,i,s)}async _open(e){const{extent:t,pixelBlocks:i,multidimensionalInfo:s,attributeTable:r,bandNames:a}=await this._fetchData(e),{statistics:n,histograms:o}=(0,se.eH)(i[0]),l=a?.map(e=>({BandName:e})),c={DataType:r?"Thematic":s?"Scientific":"Generic",BandProperties:l},u=new ae({source:{extent:t,pixelBlocks:i,attributeTable:r?ne.A.fromJSON(r):null,multidimensionalInfo:s,statistics:n,histograms:o,keyProperties:c,isPseudoSpatialReference:!1}});await u.open(),this._inMemoryRaster=u;const f=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",f.slice(0,f.indexOf("."))),this._set("rasterInfo",u.rasterInfo)}async _fetchData(e){const t=this.source??(await this.request(this.url,{signal:e?.signal})).data,i="imagery-tile-layer:open-coverage-json";if("coverage"!==t.type?.toLowerCase()||"grid"!==t.domain?.domainType?.toLowerCase())throw new o.A(i,"Only coverage with Grid domain type is supported");if(!t.ranges)throw new o.A(i,"Missing ranges in the grid coverage data");if(!t.domain.referencing?.length)throw new o.A(i,"Missing domain referencing in the grid coverage data");const s=Object.values(t.ranges);for(let e=0;e<s.length;e++){const{axisNames:t,shape:r,type:a,values:n}=s[e];if(!("ndarray"===a.toLowerCase()&&n?.length&&t?.length&&r?.length))throw new o.A(i,"Only ranges with valid NdArray, axisNames, shape, and inline values are supported");if(!Z(t[t.length-1])||!H(t[t.length-2]))throw new o.A(i,"Only row-major ordered pixel values are supported. X axis must be the last axis.")}return function(e){const{width:t,height:i,extent:s,dimensions:r}=V(e),{ranges:a}=e,n=Object.keys(a).sort((e,t)=>e<t?-1:1),o=[];for(let e=0;e<n.length;e++){const t=n[e];r?.length&&o.push({name:t,dimensions:r})}const l=X(e);o.forEach(e=>l[e.name]&&Object.assign(e,l[e.name]));const c=o.length?{variables:o}:void 0,u=[];for(let e=0;e<n.length;e++){const s=n[e],{values:o,dataType:l,axisNames:c,shape:f}=a[s],h=f.length>2?e*f.slice(0,-2).reduce((e,t)=>e*t):0,p=c.slice(0,-2),d=f.slice(0,-2),m="float"===l?"f32":Y(o),g=t*i,y=o.length/g;for(let s=0;s<y;s++){const a=j.A.createEmptyBand(m,g),n=new Uint8Array(g).fill(255);let l=!1;const c=s*g;for(let e=0;e<g;e++){const t=o[c+e];null==t?(n[e]=0,l=!0):a[e]=t}if(0===e||r?.length){const e=new j.A({width:t,height:i,mask:l?n:null,pixels:[a],pixelType:m});e.updateStatistics(),r?.length?u[K(p,d,s)+h]=e:u.push(e)}else{const e=u[s];e.pixels.push(a),l?e.mask&&(e.mask=j.A.combineBandMasks([e.mask,n])):e.mask=l?n:null}}}const f=Object.values(l).find(e=>e.attributeTable)?.attributeTable;return{extent:s,pixelBlocks:u,multidimensionalInfo:c,attributeTable:f,bandNames:c?void 0:n}}(t)}};(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],oe.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,h.MZ)({constructOnly:!0})],oe.prototype,"source",void 0),oe=(0,r.Cg)([(0,m.$)("esri.layers.support.rasterDatasets.CovJSONRaster")],oe);const le=oe;var ce=i(4576),ue=i(21325),fe=i(50103),he=i(21312);function pe(e,t){if(!e||!t)return null;const i=[];for(let s=0;s<e.length;s++)i.push(e[s]),i.push(t[s]);return i}function de(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new U.A({wkid:t});if(e=String(e).trim(),(0,ue.jp)(e))return new U.A({wkt2:e});const i=e.toUpperCase();if(i.startsWith("COMPD_CS")){if(!i.includes("VERTCS")||!i.includes("GEOGCS")&&!i.startsWith("PROJCS"))return null;const s=i.indexOf("VERTCS"),r=i.indexOf("PROJCS"),a=r>-1?r:i.indexOf("GEOGCS");if(-1===a)return null;const n=e.slice(a,e.lastIndexOf("]",s)+1).trim(),o=e.slice(s,e.lastIndexOf("]")).trim();t=me(n);const l=new U.A(t?{wkid:t}:{wkt:n}),c=me(o);return c&&(l.vcsWkid=c),l}return i.startsWith("GEOGCS")||i.startsWith("PROJCS")?(t=me(e),new U.A(0!==t?{wkid:t}:{wkt:e})):null}function me(e){const t=e.replaceAll("]","[").replaceAll('"',"").split("[").map(e=>e.trim()).filter(e=>""!==e),i=t[t.length-1].split(","),s=i[0]?.toLowerCase();if(("epsg"===s||"esri"===s)&&e.endsWith('"]]')){const e=Number(i[1]);if(!isNaN(e)&&0!==e)return e}return 0}function ge(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};const t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach(e=>{if(1===e.nodeType)if((0,fe.g7)(e,"SRS")){if(!t.spatialReference){const i=(0,fe.mX)(e);t.spatialReference=de(i)}}else if((0,fe.g7)(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:i,transform:s}=function(e){const t=(0,fe.V6)(e,"GeodataXform"),i=de((0,fe.v7)(t,"SpatialReference/WKID")||(0,fe.mX)(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:i,transform:null};const s=(0,fe.v7)(t,"PolynomialOrder")??1,r=(0,fe.Ui)(t,"CoeffX/Double"),a=(0,fe.Ui)(t,"CoeffY/Double"),n=(0,fe.Ui)(t,"InverseCoeffX/Double"),o=(0,fe.Ui)(t,"InverseCoeffY/Double"),l=pe(r,a),c=pe(n,o);return{spatialReference:i,transform:l&&c&&l.length&&c.length?new he.A({spatialReference:i,polynomialOrder:s,forwardCoefficients:l,inverseCoefficients:c}):null}}(e);t.transform=s,t.spatialReference||(t.spatialReference=i)}else(0,fe.IC)(e,"MDI").forEach(e=>t.metadata[e.getAttribute("key")]=(0,fe.mX)(e));else if((0,fe.g7)(e,"PAMRasterBand")){const i=function(e){const t=(0,fe.v7)(e,"NoDataValue"),i=(0,fe.V6)(e,"Histograms/HistItem"),s=(0,fe.v7)(i,"HistMin"),r=(0,fe.v7)(i,"HistMax"),a=(0,fe.v7)(i,"BucketCount"),n=(0,fe.mX)(i,"HistCounts")?.split("|").map(e=>Number(e));let o,l,c,u;(0,fe.IC)(e,"Metadata/MDI").forEach(e=>{const t=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":o=t;break;case"STATISTICS_MAXIMUM":l=t;break;case"STATISTICS_MEAN":c=t;break;case"STATISTICS_STDDEV":u=t}});const f=(0,fe.v7)(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:n?.length&&null!=s&&null!=r?{min:s,max:r,size:a||n.length,counts:n}:null,sourceBandIndex:f,statistics:null!=o&&null!=l?{min:o,max:l,avg:c,stddev:u}:null}}(e);null!=i.sourceBandIndex&&null==t.rasterBands[i.sourceBandIndex]?t.rasterBands[i.sourceBandIndex]=i:t.rasterBands.push(i)}});const i=t.rasterBands;if(i.length){const e=!!i[0].statistics;t.statistics=e?i.map(e=>e.statistics).filter(ce.Ru):null;const s=!!i[0].histogram;t.histograms=s?i.map(e=>e.histogram).filter(ce.Ru):null}return t}var ye=i(77649);let we=class extends B.A{fetchRawTile(e,t,i,s={}){return this._inMemoryRaster.fetchRawTile(e,t,i,s)}async _open(e){const t=await this._fetchData(e);let{spatialReference:i,statistics:s,histograms:r,transform:a}=await this._fetchAuxiliaryData(e);const n=!i;n&&(i=new U.A({wkid:3857})),r?.length&&null==s&&(s=(0,se.Pg)(r));const{width:o,height:l}=t;let c=new J.A({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:i});const u=a?a.forwardTransform(c):c;let f=!0;if(a){const e=a.forwardCoefficients;f=e&&0===e[1]&&0===e[2],f&&(a=null,c=u)}const h=new ae({source:{extent:u,nativeExtent:c,transform:a,pixelBlocks:[t],statistics:s,histograms:r,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:n},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(h.ioConfig.skipMapInfo=!0),await h.open(),h.source=null,this._set("rasterInfo",h.rasterInfo),this._inMemoryRaster=h}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),i=(0,ye.g)(t).toUpperCase();if("JPG"!==i&&"PNG"!==i&&"GIF"!==i&&"BMP"!==i)throw new o.A("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",i);const s=i.toLowerCase(),r="gif"===s||"bmp"===s||!(0,d.A)("ios"),a=await this.decodePixelBlock(t,{format:s,useCanvas:r,hasNoZlibMask:!0});if(null==a)throw new o.A("image-aux-raster:open","the data cannot be decoded");return a}async _fetchAuxiliaryData(e){const t=e?.signal,{skipExtensions:i=[],skipMapInfo:s}=this.ioConfig,r=s||i.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),a=this.datasetFormat,n="JPG"===a?"jgw":"PNG"===a?"pgw":"BMP"===a?"bpw":null,o=n&&i.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:t}),l=await(0,u.Lx)([r,o]);if(t?.aborted)throw(0,u.NK)();const c=ge(l[0].value?.data);if(!c.transform){const e=l[1].value?l[1].value.data.split("\n").slice(0,6).map(e=>Number(e)):null;c.transform=6===e?.length?new he.A({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return c}};(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],we.prototype,"datasetFormat",void 0),we=(0,r.Cg)([(0,m.$)("esri.layers.support.rasterDatasets.ImageAuxRaster")],we);const ve=we;var xe=i(97768),be=i(84952),Ie=i(86738),Ce=i(20223),Se=i(87045),Ae=i(25943),Te=i(73037),Re=i(82371);let Oe=class extends B.A{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(e,t,i,s={}){const{storageInfo:r,extent:a}=this.rasterInfo,{transposeInfo:n}=r,o=null!=n&&!!s.transposedVariableName;if(this._slices&&!o&&null==s.sliceId)return null;const l=o?0:r.maximumPyramidLevel-e+this._levelOffset,c=`${this.url}/tile/${l}/${t}/${i}`,u=this._slices?o?{variable:s.transposedVariableName}:{sliceId:s.sliceId||0}:null;let f,h;if(r.isBsqTile){const e=(s.bandIds?.length?s.bandIds:[0,1,2]).map(e=>this.request(c,{query:{...u,bandId:e},responseType:"array-buffer",signal:s.signal})),t=await Promise.all(e),i=t.map(e=>e.data.byteLength).reduce((e,t)=>e+t),r=new Uint8Array(i);h=[];let a=0;for(const{data:e}of t)h.push(a),r.set(new Uint8Array(e),a),a+=e.byteLength;f=r.buffer}else f=(await this.request(c,{query:u,responseType:"array-buffer",signal:s.signal})).data;if(!f)return null;const p=o?n.tileSize:r.tileInfo.size,d=await this.decodePixelBlock(f,{width:p[0],height:p[1],planes:h?.length,offsets:h,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:o,noDataValue:this.rasterInfo.noDataValue});if(null==d)return null;const m=r.blockBoundary[e];if("jpg"!==r.compression||i>m.minCol&&i<m.maxCol&&t>m.minRow&&t<m.maxRow)return d;const{origin:g,blockWidth:y,blockHeight:w}=r,{x:v,y:x}=this.getPyramidPixelSize(e),b=Math.round((a.xmin-g.x)/v)%y,I=Math.round((a.xmax-g.x)/v)%y||y,C=Math.round((g.y-a.ymax)/x)%w,S=Math.round((g.y-a.ymin)/x)%w||w,A=i===m.minCol?b:0,T=t===m.minRow?C:0,R=i===m.maxCol?I:y,O=t===m.maxRow?S:w;return(0,ie.z$)(d,{x:A,y:T},{width:R-A,height:O-T}),d}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const i=this._slices[e].multidimensionalDefinition;if(i.length===t.length&&!i.some(e=>{const i=t.find(t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName);return!i||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])}))return e}return null}async fetchVariableStatisticsHistograms(e,t){const i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.statistics),s=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.histograms),r=await Promise.all([i,s]);return r[0]&&r[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),r[1]?.[0]?.counts?.length||(r[1]=null),{statistics:r[0]||null,histograms:r[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===i)return null;let s=0;const{maximumPyramidLevel:r}=this.rasterInfo.storageInfo;let a=r-s+this._levelOffset;const n=i.srcLocation;for(;a>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(a,i.row,i.col,t))break}catch{}if(a--,s++,i=this.identifyPixelLocation(n,s,t.datumTransformation),null===i)return null}return-1===a||null==i?null:s}async _open(e){const t=e?.signal,i=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});i.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const s=i.data;if(this.sourceJSON=s,!s)throw new o.A("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!s.tileInfo)throw new o.A("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=s.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(s.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===s.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=s.name?.slice(s.name.indexOf("/")+1)??"";const r=await this._fetchRasterInfo({signal:t});if(null==r)throw new o.A("image-server-raster:open","cannot initialize image service");(0,Re.E9)(r,s);const a="Map"===this.tileType?function(e,t){if(!e)return null;const{minScale:i,maxScale:s,minLOD:r,maxLOD:a}=t;if(null!=r&&null!=a)return Se.A.fromJSON({...e,lods:e.lods.filter(({level:e})=>null!=e&&e>=r&&e<=a)});if(0!==i&&0!==s){const t=e=>Math.round(1e4*e)/1e4,r=i?t(i):1/0,a=s?t(s):-1/0;return Se.A.fromJSON({...e,lods:e.lods.filter(e=>{const i=t(e.scale);return i<=r&&i>=a})})}return Se.A.fromJSON(e)}(s.tileInfo,s):Se.A.fromJSON(s.tileInfo);(0,xe.Lw)(a);const[n,l]=this._computeMinMaxLOD(r,a),{extent:c,pixelSize:u}=r,f=.5/r.width*u.x,h=Math.max(u.x,u.y),{lods:p}=a;("Map"!==this.tileType&&0!==s.maxScale||Math.abs(u.x-u.y)>f||!p.some(e=>Math.abs(e.resolution-h)<f))&&(u.x=u.y=n.resolution,r.width=Math.ceil((c.xmax-c.xmin)/u.x-.1),r.height=Math.ceil((c.ymax-c.ymin)/u.y-.1));const d=n.level-l.level,[m,g]=a.size,y=[],w=[];p.forEach((e,t)=>{e.level>=l.level&&e.level<=n.level&&y.push({x:e.resolution,y:e.resolution}),t<p.length-1&&w.push(Math.round(10*e.resolution/p[t+1].resolution)/10)}),y.sort((e,t)=>e.x-t.x);const v=this.computeBlockBoundary(c,m,g,a.origin,y,d),x=y.length>1?y.slice(1):null;let b;s.transposeInfo&&(b={tileSize:[s.transposeInfo.rows,s.transposeInfo.cols],packetSize:r.keyProperties?._yxs.PacketSize??0});const I=w.length<=1||w.length>=3&&w.slice(0,-1).every(e=>e===w[0])?w[0]??2:Math.round(10/(l.resolution/n.resolution)**(-1/d))/10;if(r.storageInfo=new Ce.A({blockWidth:a.size[0],blockHeight:a.size[1],pyramidBlockWidth:a.size[0],pyramidBlockHeight:a.size[1],pyramidResolutions:x,pyramidScalingFactor:I,compression:a.format,origin:a.origin,firstPyramidLevel:1,maximumPyramidLevel:d,tileInfo:a,isBsqTile:!!s.bsq,transposeInfo:b,blockBoundary:v}),function(e){const{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new Te.A,e.extent=e.transform.forwardTransform(t))}(r),this._set("rasterInfo",r),s.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:r.storageInfo.tileInfo,parsedUrl:(0,be.An)(this.url),url:this.url,tileServers:[]};this._tilemapCache=new Ae.d({layer:e})}}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),s=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),r=U.A.fromJSON(t.spatialReference||e.spatialReference),a=new Ie.A({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:r});return new ee.A({width:i,height:s,bandCount:3,extent:J.A.fromJSON(e),spatialReference:r,pixelSize:a,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:i}=e,s=(0,Re.Tw)(this.url,this.sourceJSON,{signal:i,query:this.ioConfig.customFetchParameters}),r=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:i}).then(e=>e.data?.slices).catch(()=>null):null,a=await Promise.all([s,r]);return this._slices=a[1],a[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_computeMinMaxLOD(e,t){const{pixelSize:i}=e,s=.5/e.width*i.x,{lods:r}=t,a=t.lodAt(Math.max.apply(null,r.map(e=>e.level))),n=t.lodAt(Math.min.apply(null,r.map(e=>e.level))),{tileType:o}=this;if("Map"===o)return this._levelOffset=r[0].level,[a,n];if("Raster"===o)return[r.find(e=>e.resolution===i.x)??a,n];const{minScale:l,maxScale:c}=this.sourceJSON;let u=a;c>0&&(u=r.find(e=>Math.abs(e.scale-c)<s),u||(u=r.filter(e=>e.scale>c).sort((e,t)=>e.scale>t.scale?1:-1)[0]??a));let f=n;return l>0&&(f=r.find(e=>Math.abs(e.scale-l)<s)??n,this._levelOffset=f.level-n.level),[u,f]}};(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Oe.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,h.MZ)()],Oe.prototype,"tileType",void 0),Oe=(0,r.Cg)([(0,m.$)("esri.layers.support.rasterDatasets.ImageServerRaster")],Oe);const Me=Oe;var _e=i(47124);const Fe=new Map;Fe.set("Int8","s8"),Fe.set("UInt8","u8"),Fe.set("Int16","s16"),Fe.set("UInt16","u16"),Fe.set("Int32","s32"),Fe.set("UInt32","u32"),Fe.set("Float32","f32"),Fe.set("Float64","f32"),Fe.set("Double64","f32");const Pe=new Map;Pe.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Pe.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Pe.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Pe.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"}),Pe.set("qb3",{blobExtension:".pq3",isOneSegment:!0,decoderFormat:"qb3"});let ke=class extends B.A{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(e,t,i,s={}){const{blockWidth:r,blockHeight:a,blockBoundary:n}=this.rasterInfo.storageInfo,o=n[e];if(!o||o.maxRow<t||o.maxCol<i||o.minRow>t||o.minCol>i)return null;const{bandCount:l,pixelType:c}=this.rasterInfo,{ranges:u,actualTileWidth:f,actualTileHeight:h}=this._getTileLocation(e,t,i);if(!u||0===u.length)return null;if(0===u[0].from&&0===u[0].to){const e=new Uint8Array(r*a);return new j.A({width:r,height:a,pixels:void 0,mask:e,validPixelCount:0})}const{bandIds:p}=this.ioConfig,d=this._getBandSegmentCount(),m=[];let g=0;for(g=0;g<d;g++)p&&!p.includes(g)||m.push(this.request(this._files.data,{range:{from:u[g].from,to:u[g].to},responseType:"array-buffer",signal:s.signal}));const y=await Promise.all(m),w=y.map(e=>e.data.byteLength).reduce((e,t)=>e+t),v=new Uint8Array(w),x=[];let b=0;for(g=0;g<d;g++)x.push(b),v.set(new Uint8Array(y[g].data),b),b+=y[g].data.byteLength;const I=Pe.get(this.rasterInfo.storageInfo.compression).decoderFormat,C=await this.decodePixelBlock(v.buffer,{width:r,height:a,format:I,planes:p?.length||l,offsets:x,pixelType:c}).catch(()=>null);if(null==C)return null;let{noDataValue:S}=this.rasterInfo;if(null!=S&&"lerc"!==I&&!C.mask&&(S=S[0],null!=S)){const e=C.width*C.height,t=new Uint8Array(e);if(Math.abs(S)>1e24)for(g=0;g<e;g++)Math.abs((C.pixels[0][g]-S)/S)>1e-6&&(t[g]=1);else for(g=0;g<e;g++)C.pixels[0][g]!==S&&(t[g]=1);C.mask=t}let A=0,T=0;if(f!==r||h!==a){let e=C.mask;if(e)for(g=0;g<a;g++)if(T=g*r,g<h)for(A=f;A<r;A++)e[T+A]=0;else for(A=0;A<r;A++)e[T+A]=0;else for(e=new Uint8Array(r*a),C.mask=e,g=0;g<h;g++)for(T=g*r,A=0;A<f;A++)e[T+A]=1}return C}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const t=e?e.signal:null,i=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:s,files:r}=this._parseHeader(i.data),{skipMapInfo:a,skipExtensions:n=[]}=this.ioConfig;if(!n.includes("aux.xml")&&!a){const t=await this._fetchAuxiliaryData(e);null!=t&&(s.statistics=t.statistics??s.statistics,s.histograms=t.histograms,t.histograms&&null==s.statistics&&(s.statistics=(0,se.Pg)(t.histograms)))}a&&this.updateImageSpaceRasterInfo(s),this._set("rasterInfo",s),this._files=r;const o=await this.request(r.index,{responseType:"array-buffer",signal:t});this._storageIndex=function(e){if(e.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let t,i,s,r,a,n;if(_e.Z){for(i=new Uint8Array(e),r=new ArrayBuffer(e.byteLength),s=new Uint8Array(r),a=0;a<e.byteLength/4;a++)for(n=0;n<4;n++)s[4*a+n]=i[4*a+3-n];t=new Uint32Array(r)}else t=new Uint32Array(e);return t}(o.data);const{blockWidth:l,blockHeight:c}=this.rasterInfo.storageInfo,u=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:f,height:h}=this.rasterInfo,p=[],d=this._getBandSegmentCount();let m=0,g=-1;for(;m<this._storageIndex.length;){g++;const e=Math.ceil(f/l/u**g)-1,t=Math.ceil(h/c/u**g)-1;m+=(e+1)*(t+1)*d*4,p.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=p,g>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=g),this.updateTileInfo()}_getBandSegmentCount(){return Pe.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,i){const{blockWidth:s,blockHeight:r,pyramidScalingFactor:a}=this.rasterInfo.storageInfo,{width:n,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let c,u,f,h=0,p=0;for(f=0;f<e;f++)p=a**f,c=Math.ceil(n/s/p),u=Math.ceil(o/r/p),h+=c*u;p=a**e,c=Math.ceil(n/s/p),u=Math.ceil(o/r/p),h+=t*c+i,h*=4*l;const d=this._storageIndex.subarray(h,h+4*l);let m=0,g=0;const y=[];for(let e=0;e<l;e++)m=d[4*e]*2**32+d[4*e+1],g=m+d[4*e+2]*2**32+d[4*e+3]-1,y.push({from:m,to:g});return{ranges:y,actualTileWidth:i<c-1?s:Math.ceil(n/p)-s*(c-1),actualTileHeight:t<u-1?r:Math.ceil(o/p)-r*(u-1)}}_parseHeader(e){const t=(0,fe.V6)(e,"MRF_META/Raster");if(!t)throw new o.A("mrf:open","not a valid MRF format");const i=(0,fe.V6)(t,"Size"),s=parseInt(i.getAttribute("x"),10),r=parseInt(i.getAttribute("y"),10),a=parseInt(i.getAttribute("c"),10),n=((0,fe.mX)(t,"Compression")||"none").toLowerCase();if(!Pe.has(n))throw new o.A("mrf:open","currently does not support compression "+n);const l=(0,fe.mX)(t,"DataType")||"UInt8",c=Fe.get(l);if(null==c)throw new o.A("mrf:open","currently does not support pixel type "+l);const u=(0,fe.V6)(t,"PageSize"),f=parseInt(u.getAttribute("x"),10),h=parseInt(u.getAttribute("y"),10),p=(0,fe.V6)(t,"DataValues");let d,m;if(p&&(m=p.getAttribute("NoData"),null!=m&&(d=m.trim().split(" ").map(e=>parseFloat(e)))),(0,fe.V6)(e,"MRF_META/CachedSource"))throw new o.A("mrf:open","currently does not support MRF referencing other data files");const g=(0,fe.V6)(e,"MRF_META/GeoTags"),y=(0,fe.V6)(g,"BoundingBox");let w,v=!1;if(null!=y){const e=parseFloat(y.getAttribute("minx")),t=parseFloat(y.getAttribute("miny")),i=parseFloat(y.getAttribute("maxx")),s=parseFloat(y.getAttribute("maxy")),r=(0,fe.mX)(g,"Projection")||"";let a=U.A.WGS84;if("LOCAL_CS[]"!==r)if(r.toLowerCase().startsWith("epsg:")){const e=Number(r.slice(5));isNaN(e)||0===e||(a=new U.A({wkid:e}))}else a=de(r)??U.A.WGS84;else v=!0,a=new U.A({wkid:3857});w=new J.A(e,t,i,s),w.spatialReference=a}else v=!0,w=new J.A({xmin:-.5,ymin:.5-r,xmax:s-.5,ymax:.5,spatialReference:new U.A({wkid:3857})});const x=(0,fe.V6)(e,"MRF_META/Rsets"),b=parseInt(x?.getAttribute("scale")||"2",10),I=w.spatialReference,C=new Ce.A({origin:new Ie.A({x:w.xmin,y:w.ymax,spatialReference:I}),blockWidth:f,blockHeight:h,pyramidBlockWidth:f,pyramidBlockHeight:h,compression:n,pyramidScalingFactor:b}),S=new Ie.A({x:w.width/s,y:w.height/r,spatialReference:I}),A=new ee.A({width:s,height:r,extent:w,isPseudoSpatialReference:v,spatialReference:I,bandCount:a,pixelType:c,pixelSize:S,noDataValue:d,storageInfo:C}),T=(0,fe.mX)(e,"datafile"),R=(0,fe.mX)(e,"IndexFile");return{rasterInfo:A,files:{mrf:this.url,index:R||this.url.replace(".mrf",".idx"),data:T||this.url.replace(".mrf",Pe.get(n).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return ge(t)}catch{return null}}};(0,r.Cg)([(0,h.MZ)()],ke.prototype,"_files",void 0),(0,r.Cg)([(0,h.MZ)()],ke.prototype,"_storageIndex",void 0),(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],ke.prototype,"datasetFormat",void 0),ke=(0,r.Cg)([(0,m.$)("esri.layers.support.rasterDatasets.MRFRaster")],ke);const De=ke;var Ne=i(15265);function Le(e){const t=e.fields,i=e.records,s=t.some(e=>"oid"===e.name.toLowerCase())?"OBJECTID":"OID",r=[{name:s,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map(e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name}))),a=r.map(e=>e.name),n=[];let o=0,l=0;return i.forEach(e=>{const t={};for(t[s]=o++,l=1;l<a.length;l++)t[a[l]]=e[l-1];n.push({attributes:t})}),{displayFieldName:"",fields:r,features:n}}class Ee{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),i=3&t.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};const s=t.getUint32(4,!0),r=t.getUint16(8,!0),a=t.getUint16(10,!0),n={version:i,recordCount:s,headerByteCount:r,recordByteCount:a};let o=32;const l=[],c=[];let u;if(3===i){for(;13!==t.getUint8(o);)u=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,Ne.w)(new Uint8Array(e,o,11)),type:u,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(u)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;c.length<s&&e.byteLength-o>a;){const i=[];32===t.getUint8(o)?(o+=1,l.forEach(t=>{if("C"===t.type)i.push((0,Ne.w)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)i.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)i.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const s=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();i.push(new Date(parseInt(s.slice(0,4),10),parseInt(s.slice(4,6),10)-1,parseInt(s.slice(6,8),10)))}o+=t.length}),c.push(i)):o+=a}}return{header:n,fields:l,records:c,recordSet:Le({fields:l,records:c})}}}var Be=i(45664),ze=i(12196);const Je=(e,t)=>e.get(t)?.values,Ue=(e,t)=>e.get(t)?.values?.[0];let $e=class extends B.A{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this._chunkSize=10485760,this.datasetFormat="TIFF"}async fetchRawTile(e,t,i,s={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;const r=await this._fetchRawTiffTile(e,t,i,!1,s);if(null!=r&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(e,t,i,!0,s);null!=a&&a.pixels[0]instanceof Uint8Array&&(r.mask=a.pixels[0])}return r}async _open(e){const t=e?e.signal:null,{data:i}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!i)throw new o.A("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:s,firstIFDPos:r,isBigTiff:a}=(0,Be.uT)(i),n=[],c={fileChunk:i,posIFD:r,fileOffset:0};await this._readIFDs(n,c,s,a?8:4,t);const{imageInfo:u,rasterInfo:f}=function(e){const t=(0,Be.uc)(e),{width:i,height:s,tileWidth:r,tileHeight:a,planes:n,pixelType:o,compression:l,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidBlockWidth:f,pyramidBlockHeight:h,pyramidResolutions:p,tileBoundary:d,affine:m,metadata:g}=t;let y=de(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),w=!!t.isPseudoGeographic;null==y&&(w=!0,y=new U.A({wkid:3857}));const v=new J.A({...t.extent,spatialReference:y}),x=new Ie.A(v?{x:v.xmin,y:v.ymax,spatialReference:y}:{x:0,y:0}),b=new Ce.A({blockWidth:r,blockHeight:a,pyramidBlockWidth:f,pyramidBlockHeight:h,compression:l,origin:x,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidResolutions:p,blockBoundary:d}),I=new Ie.A({x:(v.xmax-v.xmin)/i,y:(v.ymax-v.ymin)/s,spatialReference:y}),C=g?{BandProperties:g.bandProperties,DataType:g.dataType}:{};let S=null;const A=Ue(e[0],"PHOTOMETRICINTERPRETATION"),T=Je(e[0],"COLORMAP");if(A<=3&&T?.length>3&&T.length%3==0){S=[];const e=T.length/3;for(let t=0;t<e;t++)S.push([t,T[t]>>>8,T[t+e]>>>8,T[t+2*e]>>>8])}const R=new ee.A({width:i,height:s,bandCount:n,pixelType:o,pixelSize:I,storageInfo:b,spatialReference:y,isPseudoSpatialReference:w,keyProperties:C,extent:v,colormap:S,statistics:g?g.statistics:null});if(m?.length&&(R.nativeExtent=new J.A({xmin:-.5,ymin:.5-s,xmax:i-.5,ymax:.5,spatialReference:y}),R.transform=new he.A({polynomialOrder:1,forwardCoefficients:[m[2]+m[0]/2,m[5]-m[3]/2,m[0],m[3],-m[1],-m[4]]}),R.extent=R.transform.forwardTransform(R.nativeExtent),R.pixelSize=new Ie.A({x:(v.xmax-v.xmin)/i,y:(v.ymax-v.ymin)/s,spatialReference:y}),b.origin.x=-.5,b.origin.y=.5),p){const{x:e,y:t}=R.pixelSize;p.forEach(i=>{i.x*=e,i.y*=t})}return{imageInfo:t,rasterInfo:R}}(n),h=(0,Be.zS)(n),p=(0,Be.r9)(n);if(this._headerInfo={littleEndian:s,isBigTiff:a,ifds:n,pyramidIFDs:h,maskIFDs:p,...u},this._set("rasterInfo",f),!u.isSupported)throw new o.A("tiffraster:open","this tiff is not supported: "+u.message);if(!u.tileWidth)throw new o.A("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");f.isPseudoSpatialReference&&l.A.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const d=n[0].get("PREDICTOR")?.values?.[0],m=n[0].get("SAMPLEFORMAT")?.values?.[0];if(3===m&&2===d)throw new o.A("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:g,skipExtensions:y=[]}=this.ioConfig;if(!y.includes("aux.xml")&&!g){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&function(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,se.Pg)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new Ie.A({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}(t,f)}y.includes("vat.dbf")||1!==f.bandCount||"u8"!==f.pixelType||g||(f.attributeTable=await this._fetchAuxiliaryTable(e),null!=f.attributeTable&&(f.keyProperties.DataType="thematic")),g&&this.updateImageSpaceRasterInfo(f),this.updateTileInfo()}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:i,fileOffset:s,posIFD:r}=e;return(r+8>=i.byteLength||r<0)&&(s=r+s,i=(await this.request(this.url,{range:{from:s,to:s+this._bufferSize},responseType:"array-buffer",signal:t})).data,r=0),{fileChunk:i,fileOffset:s,posIFD:r}}async _readIFDs(e,t,i,s=4,r){if(!t.posIFD)return null;t=await this._validateOrFetchHeaderBuffer(t,r);const a=await this._readIFD(t,i,ze.NB,s,r);if(!a?.ifd)throw new o.A("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(e.push(a.ifd),!a.nextIFD)return null;t.posIFD=a.nextIFD-t.fileOffset,await this._readIFDs(e,t,i,s,r)}async _readIFD(e,t,i=ze.NB,s=4,r){let{fileChunk:a,posIFD:n,fileOffset:o}=e;if(!e.fileChunk)return null;const l=(0,Be.JM)(a,t,n,o,i,s);if(l.success){const e=[];if(l.ifd?.forEach(t=>{t.values||e.push(t)}),e.length>0&&await this._fillOffsets(e,t,l.nextIFD,r),l.ifd?.has("GEOKEYDIRECTORY")){const e=l.ifd.get("GEOKEYDIRECTORY"),i=e?.values;if(i&&i.length>4){const s=i[0]+"."+i[1]+"."+i[2];n=e.valueOffset+6-o;const l=await this._validateOrFetchHeaderBuffer({fileChunk:a,posIFD:n,fileOffset:o},r),c=await this._readIFD(l,t,ze.YC,2,r);e.data=c?.ifd,e.data&&e.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[s]})}}return l}return l.requiredBufferSize?(a=(await this.request(this.url,{range:{from:o,to:o+n+l.requiredBufferSize+8},responseType:"array-buffer",signal:r})).data,a.byteLength<n+l.requiredBufferSize?null:(e.fileChunk=a,e.fileOffset=o,this._readIFD(e,t,i,s,r))):null}async _fillOffsets(e,t,i,s){const r=e.filter(e=>null!=e.offlineOffsetSize);if(0===r.length)return;const a=r.map(e=>e.offlineOffsetSize),n=Math.min.apply(null,a.map(e=>e[0])),o=Math.max.apply(null,a.map(e=>e[0]+e[1]));let l=1===a.length||o-n<=this._bufferSize;if(!l&&a.length>1&&(a.sort((e,t)=>e[0]-t[0]),l=a.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,a[0][0])===o),l){const e=await this._fetchOffsets(n,Math.max(o,n+this._bufferSize),s);return void r.forEach(i=>(0,Be.Cr)(e,t,i,n))}const c=r.map(async e=>{const i=e.offlineOffsetSize,r=await this._fetchOffsets(i[0],i[1]+i[0],s);(0,Be.Cr)(r,t,e,i[0])});await Promise.all(c)}async _fetchOffsets(e,t,i){const s=[],r=this._chunkSize,a=Math.ceil((t-e)/r);let n=e;for(let e=0;e<a;e++)s.push(this.request(this.url,{range:{from:n,to:e===a-1?t:n+r-1},responseType:"array-buffer",signal:i})),n+=r;const o=await Promise.all(s);if(1===a)return o[0].data;const l=new Uint8Array(t-e+1);for(let e=0;e<a;e++)l.set(new Uint8Array(o[e].data),e*r);return l.buffer}async _fetchRawTiffTile(e,t,i,s,r={}){const a=this._getTileLocation(e,t,i,s);if(!a)return null;const{ranges:n,actualTileWidth:o,actualTileHeight:l,ifd:c}=a,u=n.map(e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:r.signal})),f=await Promise.all(u),h=f.map(e=>e.data.byteLength).reduce((e,t)=>e+t),p=1===f.length?f[0].data:new ArrayBuffer(h),d=[0],m=[0];if(f.length>1){const e=new Uint8Array(p);for(let t=0,i=0;t<f.length;t++){const s=f[t].data;e.set(new Uint8Array(s),i),d[t]=i,i+=s.byteLength,m[t]=s.byteLength}}const{blockWidth:g,blockHeight:y}=this.getBlockWidthHeight(e),w=await this.decodePixelBlock(p,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:c,offsets:d,sizes:m},width:g,height:y,planes:null,pixelType:null});if(null==w)return null;let v,x,b;if(o!==g||l!==y){let e=w.mask;if(e)for(v=0;v<y;v++)if(b=v*g,v<l)for(x=o;x<g;x++)e[b+x]=0;else for(x=0;x<g;x++)e[b+x]=0;else for(e=new Uint8Array(g*y),w.mask=e,v=0;v<l;v++)for(b=v*g,x=0;x<o;x++)e[b+x]=1}return w}_getTileLocation(e,t,i,s=!1){const{firstPyramidLevel:r,blockBoundary:a}=this.rasterInfo.storageInfo,n=0===e?0:e-(r-1),{_headerInfo:o}=this;if(!o)return null;const l=s?o.maskIFDs[n]:0===n?o?.ifds[0]:o?.pyramidIFDs[n-1];if(!l)return null;const c=(0,Be.XO)(l,o),u=Je(l,"TILEOFFSETS");if(void 0===u)return null;const f=Je(l,"TILEBYTECOUNTS"),{minRow:h,minCol:p,maxRow:d,maxCol:m}=a[n];if(t>d||i>m||t<h||i<p)return null;const g=Ue(l,"IMAGEWIDTH"),y=Ue(l,"IMAGELENGTH"),w=Ue(l,"TILEWIDTH"),v=Ue(l,"TILELENGTH"),x=[];if(c){const{bandCount:e}=this.rasterInfo;for(let s=0;s<e;s++){const e=s*(d+1)*(m+1)+t*(m+1)+i;x[s]={from:u[e],to:u[e]+f[e]-1}}}else{const e=t*(m+1)+i;x.push({from:u[e],to:u[e]+f[e]-1})}for(let e=0;e<x.length;e++)if(null==x[e].from||!x[e].to||x[e].to<0)return null;return{ranges:x,ifd:l,actualTileWidth:i===m&&g%w||w,actualTileHeight:t===d&&y%v||v}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return ge(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=Ee.parse(t);return i?.recordSet?ne.A.fromJSON(i.recordSet):null}catch{return null}}};(0,r.Cg)([(0,h.MZ)()],$e.prototype,"_files",void 0),(0,r.Cg)([(0,h.MZ)()],$e.prototype,"_headerInfo",void 0),(0,r.Cg)([(0,h.MZ)()],$e.prototype,"_bufferSize",void 0),(0,r.Cg)([(0,h.MZ)()],$e.prototype,"_chunkSize",void 0),(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],$e.prototype,"datasetFormat",void 0),$e=(0,r.Cg)([(0,m.$)("esri.layers.support.rasterDatasets.TIFFRaster")],$e);const je=$e,qe=new Map;qe.set("MRF",{desc:"Meta Raster Format",constructor:De}),qe.set("TIFF",{desc:"GeoTIFF",constructor:je}),qe.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Me}),qe.set("JPG",{desc:"JPG Raster Format",constructor:ve}),qe.set("PNG",{desc:"PNG Raster Format",constructor:ve}),qe.set("GIF",{desc:"GIF Raster Format",constructor:ve}),qe.set("BMP",{desc:"BMP Raster Format",constructor:ve}),qe.set("CovJSON",{desc:"COVJSON Raster Format",constructor:le}),qe.set("MEMORY",{desc:"In Memory Raster Format",constructor:ae});class Ze{static get supportedFormats(){const e=new Set;return qe.forEach((t,i)=>e.add(i)),e}static async open(e){const{url:t,ioConfig:i,source:s,sourceJSON:r}=e;let a=e.datasetFormat??i?.datasetFormat;null==a&&(t.includes(".")?a=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===s?.type?.toLowerCase()?a="CovJSON":s?.extent&&s.pixelblocks&&(a="MEMORY")),"OVR"===a||"TIF"===a?a="TIFF":"JPG"===a||"JPEG"===a||"JFIF"===a?a="JPG":"COVJSON"===a&&(a="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(a="RasterTileServer");const n={url:t,source:s,sourceJSON:r,datasetFormat:a,ioConfig:i??{bandIds:null,sampling:null}};if(Object.keys(n).forEach(e=>{null==n[e]&&delete n[e]}),a){if(!this.supportedFormats.has(a))throw new o.A("rasterfactory:open","not a supported format "+a);if("CRF"===a)throw new o.A("rasterfactory:open",`cannot open raster: ${t}`);const i=new(0,qe.get(a).constructor)(n);return await i.open({signal:e.signal}),i}const l=Array.from(qe.keys()).filter(e=>"CovJSON"!==e&&"Memory"!==e);let c=0;const u=()=>{if(a=l[c++],!a)return null;if("CRF"===a)return null;const t=new(0,qe.get(a).constructor)(n);return t.open({signal:e.signal}).then(()=>t).catch(()=>u())};return u()}static register(e,t,i){qe.has(e.toUpperCase())||qe.set(e.toUpperCase(),{desc:t,constructor:i})}}var He=i(6049),Ve=i(56776),Ge=i(30291),We=i(88625);let Xe=class extends((0,I.dM)((0,_.j)((0,A.q)((0,T.A)((0,O.H)((0,C.d)((0,S.o)((0,R.G)((0,F.e)((0,b.b)((0,M.J)((0,c.P)((0,n.OU)(x.A)))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.graphicOrigin=new v(this),this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.fields=null,this.source=void 0,this._debouncedSaveOperations=(0,u.sg)(async(e,t,s)=>{const{save:r,saveAs:a}=await i.e(9838).then(i.bind(i,59838));switch(e){case 0:return r(this,t);case 1:return a(this,s,t)}})}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(u.QP).then(()=>this._openRaster(t))),Promise.resolve(this)}set elevationInfo(e){"relative-to-scene"!==e?.mode&&this._set("elevationInfo",e),this._validateElevationInfo(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[(0,D.rZ)("Pixel Value"),(0,D.dy)("Raw Pixel Value")],t=this.raster?.rasterInfo??this.serviceRasterInfo,i=t?.attributeTable;if(i){const t=(0,D.jC)(i);e.push(...t)}const s=t?.dataType,r=t?.multidimensionalInfo;if(("vector-magdir"===s||"vector-uv"===s)&&null!=r){const t=r.variables[0].unit?.trim(),i=(0,D.DV)(t),s=(0,D.y6)();e.push(i,s)}if(r){const t=(0,D.AL)(r);e.push(...t)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){const{rasterFields:t}=this,i=e?.visibleFieldNames??new Set(t.map(({name:e})=>e).filter(e=>e!==D.F_.rawServicePixelValue)),s=(0,Ge.tn)({fields:t,title:this.title},{...e,visibleFieldNames:i}),{rasterInfo:r}=this.raster;return s?.fieldInfos&&r&&(0,D.h4)(s.fieldInfos,r),s}async generateRasterInfo(e,t){if(e=(0,p.PZ)(N.A,e),await this.load(),!e||"none"===e.functionName?.toLowerCase())return this.serviceRasterInfo;try{const{rasterInfo:i}=await this._openFunctionRaster(e,t);return i}catch(e){if(e instanceof o.A)throw e;throw new o.A("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}supportsWrite(){const e=this._primaryRasters[0]??this.raster;return!!(this.loaded?"RasterTileServer"===e.datasetFormat&&("Raster"===e.tileType||"Map"===e.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))}write(e,t){if(this.supportsWrite())return super.write(e,t);if(t?.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new o.A("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){let t=!1;if(this.raster)await this._openFromRaster(this.raster,e),t=(0,L.qg)(this.raster),!t&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:t,rasterFunction:i,source:s}=this;if(!t&&!s)throw new o.A("imagery-tile-layer:open","missing url or source parameter");s?await this._openFromSource(s,e):i?await this._openFromUrlWithRasterFunction(t,i,e):await this._openFromUrl(t,e)}const i=this.raster.rasterInfo;if(!i)throw new o.A("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",t?i:this._primaryRasters[0].rasterInfo),this._set("spatialReference",i.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles((0,f.wB)(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,t){e.rasterInfo||await e.open({signal:t}),this._primaryRasters=(0,L.pb)(e),this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(e,t,i){const s=[e];t&&(0,He.UD)(t.toJSON(),s);const r=await Promise.all(s.map(e=>Ze.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:i}))),a=r.findIndex(e=>null==e);if(a>-1)throw new o.A("imagery-tile-layer:open",`cannot open raster: ${s[a]}`);return this._primaryRasters=r,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){const i=await Ze.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==i)throw new o.A("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[i],this.raster=i}async _openFromSource(e,t){const i="the tiled imagery data source is not supported",s="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!s)throw new o.A("imagery-tile-layer:open",i);"MEMORY"===s&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});const r=await Ze.open({url:"",source:e,datasetFormat:s,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==r)throw new o.A("imagery-tile-layer:open",i);this._primaryRasters=[r],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=r}async _openFunctionRaster(e,t){const i={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>i[e.url]=e);const s=(0,He.vt)(e.functionDefinition?.toJSON()??e.toJSON(),i),r=new E.A({rasterFunction:s});return await r.open(t),r}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(e){e instanceof o.A&&l.A.getLogger(this).error("imagery-tile-layer:open",e.message),l.A.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(e){(0,Ve.XF)(l.A.getLogger(this),(0,Ve.$7)("ImageryTile layers","relative-to-scene",e)),(0,Ve.XF)(l.A.getLogger(this),(0,Ve.tW)("ImageryTile layers",e))}};(0,r.Cg)([(0,h.MZ)({clonable:!1})],Xe.prototype,"_primaryRasters",void 0),(0,r.Cg)([(0,h.MZ)({type:We.A,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],Xe.prototype,"elevationInfo",null),(0,r.Cg)([(0,h.MZ)({readOnly:!0,clonable:!1})],Xe.prototype,"graphicOrigin",void 0),(0,r.Cg)([(0,h.MZ)(P.fV)],Xe.prototype,"legendEnabled",void 0),(0,r.Cg)([(0,h.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Xe.prototype,"isReference",void 0),(0,r.Cg)([(0,h.MZ)({type:["show","hide"]})],Xe.prototype,"listMode",void 0),(0,r.Cg)([(0,h.MZ)({json:{read:!0,write:!0}})],Xe.prototype,"blendMode",void 0),(0,r.Cg)([(0,h.MZ)({type:N.A,json:{name:"renderingRule",write:!0}})],Xe.prototype,"rasterFunction",void 0),(0,r.Cg)([(0,h.MZ)()],Xe.prototype,"sourceJSON",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],Xe.prototype,"version",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0,json:{read:!1}})],Xe.prototype,"type",void 0),(0,r.Cg)([(0,h.MZ)({type:["ArcGISTiledImageServiceLayer"]})],Xe.prototype,"operationalLayerType",void 0),(0,r.Cg)([(0,h.MZ)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,i){t[i]=!e}}}})],Xe.prototype,"popupEnabled",void 0),(0,r.Cg)([(0,h.MZ)({type:a.A,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],Xe.prototype,"popupTemplate",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0})],Xe.prototype,"defaultPopupTemplate",null),(0,r.Cg)([(0,h.MZ)(P.PY)],Xe.prototype,"screenSizePerspectiveEnabled",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0,type:[k.A]})],Xe.prototype,"fields",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0,type:[k.A]})],Xe.prototype,"rasterFields",null),(0,r.Cg)([(0,h.MZ)({constructOnly:!0})],Xe.prototype,"source",void 0),Xe=(0,r.Cg)([(0,m.$)("esri.layers.ImageryTileLayer")],Xe);const Ye=Xe},21312:(e,t,i)=>{i.d(t,{A:()=>m});var s,r=i(31635),a=i(10107),n=(i(44208),i(53966),i(87811),i(93223)),o=i(36005),l=i(64108),c=i(43937),u=i(5443),f=i(86738),h=i(82434);function p(e,t,i){const{x:s,y:r}=t;if(i<2)return{x:e[0]+s*e[2]+r*e[4],y:e[1]+s*e[3]+r*e[5]};if(2===i){const t=s*s,i=r*r,a=s*r;return{x:e[0]+s*e[2]+r*e[4]+t*e[6]+a*e[8]+i*e[10],y:e[1]+s*e[3]+r*e[5]+t*e[7]+a*e[9]+i*e[11]}}const a=s*s,n=r*r,o=s*r,l=a*s,c=a*r,u=s*n,f=r*n;return{x:e[0]+s*e[2]+r*e[4]+a*e[6]+o*e[8]+n*e[10]+l*e[12]+c*e[14]+u*e[16]+f*e[18],y:e[1]+s*e[3]+r*e[5]+a*e[7]+o*e[9]+n*e[11]+l*e[13]+c*e[15]+u*e[17]+f*e[19]}}function d(e,t,i){const{xmin:s,ymin:r,xmax:a,ymax:n,spatialReference:o}=t;let l=[];if(i<2)l.push({x:s,y:n}),l.push({x:a,y:n}),l.push({x:s,y:r}),l.push({x:a,y:r});else{let e=10;for(let t=0;t<e;t++)l.push({x:s,y:r+(n-r)*t/(e-1)}),l.push({x:a,y:r+(n-r)*t/(e-1)});e=8;for(let t=1;t<=e;t++)l.push({x:s+(a-s)*t/e,y:r}),l.push({x:s+(a-s)*t/e,y:n})}l=l.map(t=>p(e,t,i));const c=l.map(e=>e.x),f=l.map(e=>e.y);return new u.A({xmin:Math.min.apply(null,c),xmax:Math.max.apply(null,c),ymin:Math.min.apply(null,f),ymax:Math.max.apply(null,f),spatialReference:o})}let m=s=class extends h.A{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(e,t){const{coeffX:i,coeffY:s}=t;if(!i?.length||!s?.length||i.length!==s.length)return null;const r=[];for(let e=0;e<i.length;e++)r.push(i[e]),r.push(s[e]);return r}writeForwardCoefficients(e,t,i){const s=[],r=[];for(let t=0;t<e?.length;t++)t%2==0?s.push(e[t]):r.push(e[t]);t.coeffX=s,t.coeffY=r}get inverseCoefficients(){let e=this._get("inverseCoefficients");const t=this._get("forwardCoefficients");return!e&&t&&this.polynomialOrder<2&&(e=function(e){const[t,i,s,r,a,n]=e,o=s*n-a*r,l=a*r-s*n;return[(a*i-t*n)/o,(s*i-t*r)/l,n/o,r/l,-a/o,-s/l]}(t)),e}set inverseCoefficients(e){this._set("inverseCoefficients",e)}readInverseCoefficients(e,t){const{inverseCoeffX:i,inverseCoeffY:s}=t;if(!i?.length||!s?.length||i.length!==s.length)return null;const r=[];for(let e=0;e<i.length;e++)r.push(i[e]),r.push(s[e]);return r}writeInverseCoefficients(e,t,i){const s=[],r=[];for(let t=0;t<e?.length;t++)t%2==0?s.push(e[t]):r.push(e[t]);t.inverseCoeffX=s,t.inverseCoeffY=r}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(e){if("point"===e.type){const t=p(this.forwardCoefficients,e,this.polynomialOrder);return new f.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return d(this.forwardCoefficients,e,this.polynomialOrder)}inverseTransform(e){if("point"===e.type){const t=p(this.inverseCoefficients,e,this.polynomialOrder);return new f.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return d(this.inverseCoefficients,e,this.polynomialOrder)}clone(){return new s({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};(0,r.Cg)([(0,a.MZ)({json:{write:!0}})],m.prototype,"polynomialOrder",void 0),(0,r.Cg)([(0,a.MZ)()],m.prototype,"forwardCoefficients",void 0),(0,r.Cg)([(0,o.w)("forwardCoefficients",["coeffX","coeffY"])],m.prototype,"readForwardCoefficients",null),(0,r.Cg)([(0,c.K)("forwardCoefficients")],m.prototype,"writeForwardCoefficients",null),(0,r.Cg)([(0,a.MZ)({json:{write:!0}})],m.prototype,"inverseCoefficients",null),(0,r.Cg)([(0,o.w)("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],m.prototype,"readInverseCoefficients",null),(0,r.Cg)([(0,c.K)("inverseCoefficients")],m.prototype,"writeInverseCoefficients",null),(0,r.Cg)([(0,a.MZ)()],m.prototype,"affectsPixelSize",null),(0,r.Cg)([(0,n.e)({PolynomialXform:"polynomial"})],m.prototype,"type",void 0),m=s=(0,r.Cg)([(0,l.$)("esri.layers.support.rasterTransforms.PolynomialTransform")],m)},25943:(e,t,i)=>{i.d(t,{d:()=>S});var s,r=i(31635),a=i(43773),n=i(69622),o=i(49186),l=i(36563),c=(i(44208),i(66344)),u=i(15142),f=i(74887),h=i(36708),p=i(76030),d=i(84952),m=i(10107),g=(i(53966),i(87811),i(64108)),y=i(72802),w=i(4718),v=i(69397),x=i(34275);class b{constructor(e){!function(e){if(!e?.location)throw new o.A("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new o.A("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new o.A("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new o.A("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new o.A("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}(e);const{location:t,data:i}=e;this.location=Object.freeze((0,w.o8)(t));const s=this.location.width,r=this.location.height;let a=!0,n=!0;const l=function(e,t=!1){return e<=x.y9?t?new Array(e).fill(0):new Array(e):new Uint32Array(e)}(Math.ceil(s*r/32));let c=0;for(let e=0;e<i.length;e++){const t=e%32;i[e]?(n=!1,l[c]|=1<<t):a=!1,31===t&&++c}n?(this._availability="unavailable",this.byteSize=40):a?(this._availability="available",this.byteSize=40):(this._availability=l,this.byteSize=40+(0,v.Qf)(l))}getAvailability(e,t){if("unavailable"===this._availability||"available"===this._availability)return this._availability;const i=(e-this.location.top)*this.location.width+(t-this.location.left),s=i%32,r=i>>5,a=this._availability;return r<0||r>a.length?"unknown":a[r]&1<<s?"available":"unavailable"}static fromDefinition(e,t){const i=e.service.request||a.A,{row:s,col:r,width:n,height:l}=e,c={query:{f:"json"}};return t=t?{...c,...t}:c,i(function(e){let t;if(e.service.tileServers?.length){const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;const i=e.service.query;return i&&(t=`${t}?${i}`),t}(e),t).then(e=>e.data).catch(e=>{if(422===e?.details?.httpStatus)return{location:{top:s,left:r,width:n,height:l},valid:!0,data:new Array(n*l).fill(0)};throw e}).then(e=>{if(e.location&&(e.location.top!==s||e.location.left!==r||e.location.width!==n||e.location.height!==l))throw new o.A("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:s,left:r,width:n,height:l}});return b.fromJSON(e)})}static fromJSON(e){return Object.freeze(new b(e))}}function I(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function C(e,t,i){return new o.A("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})}let S=class extends n.A{static{s=this}constructor(e){super(e),this._pendingTilemapRequests={},this.request=a.A,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new c.q(2097152),this.addHandles((0,h.wB)(()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),h.Vh))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,i){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return"unavailable";const s=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return s?s.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,s){return!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD?Promise.reject(C(e,t,i)):this._fetchTilemap(e,t,i,s).catch(e=>e).then(s=>{if(s instanceof b){const r=s.getAvailability(t,i);if("unavailable"===r)throw C(e,t,i);return r}if((0,f.zf)(s))throw s;return"unknown"})}fetchAvailabilityUpsample(e,t,i,s,r){s.level=e,s.row=t,s.col=i;const a=this.layer.tileInfo;a.updateTileInfo(s);const n=this.fetchAvailability(e,t,i,r).catch(e=>{if((0,f.zf)(e))throw e;if(a.upsampleTile(s))return this.fetchAvailabilityUpsample(s.level,s.row,s.col,s,r);throw e});return this._fetchAvailabilityUpsamplePrefetch(e,t,i,r,n),n}async _fetchAvailabilityUpsamplePrefetch(e,t,i,r,a){if(!this._prefetchingEnabled)return;const n=`prefetch-${e}-${t}-${i}`;if(this.hasHandles(n))return;const o=new AbortController;a.then(()=>o.abort(),()=>o.abort());let c=!1;const u=(0,l.hA)(()=>{c||(c=!0,o.abort())});if(this.addHandles(u,n),await(0,p.md)(10,o.signal).catch(()=>{}),c||(c=!0,this.removeHandles(n)),(0,f.G4)(o))return;const h=new y.U(e,t,i),d={...r,signal:o.signal},m=this.layer.tileInfo;for(let e=0;s._prefetches.length<s._maxPrefetch&&m.upsampleTile(h);++e){const e=this.fetchAvailability(h.level,h.row,h.col,d);s._prefetches.push(e);const t=()=>{s._prefetches.removeUnordered(e)};e.then(t,t)}}static{this._maxPrefetch=4}static{this._prefetches=new u.A({initialSize:s._maxPrefetch})}static cleanupTilemapCache(){this._prefetches.prune()}_fetchTilemap(e,t,i,s){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return Promise.reject(new o.A("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const r=this._tmpTilemapDefinition,a=this._tilemapFromCache(e,t,i,r);if(a)return Promise.resolve(a);const n=s?.signal;return s={...s,signal:null},new Promise((e,t)=>{(0,f.u7)(n,()=>t((0,f.NK)()));const i=I(r);let a=this._pendingTilemapRequests[i];if(!a){a=b.fromDefinition(r,s).then(e=>(this._tilemapCache.put(i,e,e.byteSize),e));const e=()=>{delete this._pendingTilemapRequests[i]};this._pendingTilemapRequests[i]=a,a.then(e,e)}a.then(e,t)})}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:t,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:(0,d.x0)({...e.query,...i,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,s){s.level=e,s.row=t-t%this.size,s.col=i-i%this.size;const r=I(s);return this._tilemapCache.get(r)}get test(){}};(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],S.prototype,"layer",void 0),(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],S.prototype,"minLOD",void 0),(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],S.prototype,"maxLOD",void 0),(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],S.prototype,"request",void 0),(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],S.prototype,"size",void 0),S=s=(0,r.Cg)([(0,g.$)("esri.layers.support.TilemapCache")],S)},56551:(e,t,i)=>{i.d(t,{H:()=>h});var s=i(31635),r=i(10107),a=(i(44208),i(53966),i(87811),i(64108)),n=i(69540),o=i(25482),l=i(56507),c=i(93223),u=i(94359);let f=class extends((0,n.OU)(o.o)){constructor(e){super(e),this.name=void 0,this.method="none",this.value=void 0,this.bandIds=void 0,this.renderer=void 0}};(0,s.Cg)([(0,r.MZ)({type:String,json:{write:{isRequired:!0}}})],f.prototype,"name",void 0),(0,s.Cg)([(0,r.MZ)({type:["raster-function-template","variable","none"],json:{write:{isRequired:!0}}}),(0,c.e)({rasterFunctionTemplate:"raster-function-template",variable:"variable",none:"none"})],f.prototype,"method",void 0),(0,s.Cg)([(0,r.MZ)({type:String,json:{write:{isRequired:!0}}})],f.prototype,"value",void 0),(0,s.Cg)([(0,r.MZ)({type:[l.jz],json:{write:{isRequired:!0}}})],f.prototype,"bandIds",void 0),(0,s.Cg)([(0,r.MZ)({types:u.uy,json:{write:!0,origins:{"web-scene":{types:u.Gj,write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],f.prototype,"renderer",void 0),f=(0,s.Cg)([(0,a.$)("esri.renderers.support.RasterPresetRenderer")],f);const h=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.activePresetRendererName=null,this.presetRenderers=null}};return(0,s.Cg)([(0,r.MZ)({type:String,json:{name:"layerDefinition.activePresetRendererName",write:{allowNull:!0}}})],i.prototype,"activePresetRendererName",void 0),(0,s.Cg)([(0,r.MZ)({type:[f],json:{name:"layerDefinition.presetRenderers",write:!0}})],i.prototype,"presetRenderers",void 0),i=(0,s.Cg)([(0,a.$)("esri.layers.mixins.RasterPresetRendererMixin")],i),i}},69397:(e,t,i)=>{i.d(t,{$B:()=>r,Qf:()=>c,Qh:()=>o,RS:()=>a,ez:()=>h,lM:()=>n,qK:()=>f});var s=i(34275);function r(e){return 32+e.length}const a=16;function n(e){if(!e)return 0;let t=f;for(const i in e)e.hasOwnProperty(i)&&(t+=l(e[i],!1));return t}function o(e){if(!e)return 0;if("number"==typeof e[0])return c(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return u(e,8);let i=h;for(let s=0;s<t;s++)i+=l(e[s]);return i}(e);let t=f;for(const i in e)e.hasOwnProperty(i)&&(t+=l(e[i]));return t}function l(e,t=!0){switch(typeof e){case"object":return t?o(e):f;case"string":return r(e);case"number":return a;case"boolean":return 4;default:return 8}}function c(...e){return e.reduce((e,t)=>e+(t?(0,s.iu)(t)?t.byteLength+p:Array.isArray(t)?u(t,a):0:0),0)}function u(e,t){return h+e.length*t}const f=32,h=16,p=145},73037:(e,t,i)=>{i.d(t,{A:()=>c});var s,r=i(31635),a=i(10107),n=(i(44208),i(53966),i(87811),i(93223)),o=i(64108),l=i(82434);let c=s=class extends l.A{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(e){return"point"===(e=e.clone()).type?(e.x>180+this.tolerance&&(e.x-=360),e):(e.xmin>=180-this.tolerance?(e.xmax-=360,e.xmin-=360):e.xmax>180+this.tolerance&&(e.xmin=-180,e.xmax=180),e)}inverseTransform(e){return"point"===(e=e.clone()).type?(e.x<-this.tolerance&&(e.x+=360),e):(e.xmin<-this.tolerance&&(e.xmin+=360,e.xmax+=360),e)}clone(){return new s({tolerance:this.tolerance})}};(0,r.Cg)([(0,n.e)({GCSShiftXform:"gcs-shift"})],c.prototype,"type",void 0),(0,r.Cg)([(0,a.MZ)()],c.prototype,"tolerance",void 0),c=s=(0,r.Cg)([(0,o.$)("esri.layers.support.rasterTransforms.GCSShiftTransform")],c)},82371:(e,t,i)=>{i.d(t,{E9:()=>d,Tw:()=>h,X6:()=>p});var s=i(43773),r=i(5443),a=i(86738),n=i(16930),o=i(87186),l=i(20223),c=i(2272),u=i(22671);async function f(e,t,i){const f=(0,c.Dl)(e),{rasterFunction:h,sourceJSON:p}=t||{},d=h?JSON.stringify(h.rasterFunctionDefinition||h):null,m=(0,c.lF)({...f.query,renderingRule:d,f:"json"}),g=(0,c.jV)(m,i);e=f.path;const y=p||await(0,s.A)(e,g).then(e=>e.data),w=y.hasRasterAttributeTable?(0,s.A)(`${e}/rasterAttributeTable`,g):null,v=y.hasColormap?(0,s.A)(`${e}/colormap`,g):null,x=y.hasHistograms?(0,s.A)(`${e}/histograms`,g):null,b=y.currentVersion>=10.3?(0,s.A)(`${e}/keyProperties`,g):null,I=y.hasMultidimensions?(0,s.A)(`${e}/multidimensionalInfo`,g):null,C=await Promise.allSettled([w,v,x,b,I]);let S=null;if(y.minValues&&y.minValues.length===y.bandCount){S=[];for(let e=0;e<y.minValues.length;e++)S.push({min:y.minValues[e],max:y.maxValues[e],avg:y.meanValues[e],stddev:y.stdvValues[e]})}const A=r.A.fromJSON(y.extent),T=Math.ceil(A.width/y.pixelSizeX-.1),R=Math.ceil(A.height/y.pixelSizeY-.1),O=n.A.fromJSON(y.spatialReference||y.extent.spatialReference),M="fulfilled"===C[0].status?C[0].value?.data:null,_=M?.features?.length?u.A.fromJSON(M):null,F="fulfilled"===C[1].status?C[1].value?.data.colormap:null,P=F?.length?F:null,k="fulfilled"===C[2].status?C[2].value?.data.histograms:null,D=k?.[0]?.counts?.length?k:null,N="fulfilled"===C[3].status?C[3].value?.data??{}:{},L="fulfilled"===C[4].status?C[4].value?.data.multidimensionalInfo:null,E=L?.variables?.length?L:null;E&&E.variables.forEach(e=>{e.statistics?.length&&e.statistics.forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),e.dimensions?.forEach(e=>{"StdTime"!==e.name||e.recurring||e.unit||(e.unit="ISO8601")})});const{defaultVariable:B,serviceDataType:z}=y;B&&B!==N.DefaultVariable&&(N.DefaultVariable=B),z?.includes("esriImageServiceDataTypeVector")&&!z.includes(N.DataType)&&(N.DataType=z.replace("esriImageServiceDataType",""));let J=y.noDataValue;y.noDataValues?.length&&y.noDataValues.some(e=>e!==J)&&(J=y.noDataValues);const U=y.transposeInfo?new l.A({blockWidth:256,blockHeight:256,pyramidBlockWidth:256,pyramidBlockHeight:256,pyramidScalingFactor:2,compression:"lerc",origin:new a.A({x:y.extent.xmin,y:y.extent.ymax,spatialReference:O}),firstPyramidLevel:1,maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(T,R))/Math.LN2-8)),transposeInfo:y.transposeInfo}):void 0;return new o.A({width:T,height:R,bandCount:y.bandCount,extent:r.A.fromJSON(y.extent),spatialReference:O,pixelSize:new a.A({x:y.pixelSizeX,y:y.pixelSizeY,spatialReference:O}),pixelType:y.pixelType.toLowerCase(),statistics:S,attributeTable:_,colormap:P,histograms:D,keyProperties:N,noDataValue:J,multidimensionalInfo:E,storageInfo:U})}function h(e,t,i){return f(e,{sourceJSON:t},i)}function p(e,t,i){return f(e,{rasterFunction:t},i)}function d(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}},82434:(e,t,i)=>{i.d(t,{A:()=>o});var s=i(31635),r=i(25482),a=i(10107),n=(i(44208),i(53966),i(87811),i(64108));let o=class extends r.o{get affectsPixelSize(){return!1}forwardTransform(e){return e}inverseTransform(e){return e}};(0,s.Cg)([(0,a.MZ)()],o.prototype,"affectsPixelSize",null),(0,s.Cg)([(0,a.MZ)({json:{write:!0}})],o.prototype,"spatialReference",void 0),o=(0,s.Cg)([(0,n.$)("esri.layers.support.rasterTransforms.BaseRasterTransform")],o)}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9718],{5359:(e,t,i)=>{i.d(t,{H:()=>s,Z:()=>r});const s=Symbol("isImageryTileGraphicOrigin");function r(e){return!!e&&s in e}},18768:(e,t,i)=>{i.d(t,{b:()=>l});var s=i(31635),r=i(53966),a=i(10107),n=(i(44208),i(87811),i(64108)),o=i(60694);const l=e=>{const t=e;let i=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,o.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,o.Jf)(e,r.A.getLogger(this)))}};return(0,s.Cg)([(0,a.MZ)()],i.prototype,"title",null),(0,s.Cg)([(0,a.MZ)({type:String})],i.prototype,"url",null),i=(0,s.Cg)([(0,n.$)("esri.layers.mixins.ArcGISService")],i),i}},19718:(e,t,i)=>{i.r(t),i.d(t,{default:()=>Ye});var s,r=i(31635),a=i(37838),n=i(69540),o=i(49186),l=i(53966),c=i(25728),u=i(74887),f=i(36708),h=i(10107),p=i(56507),d=i(44208),m=(i(87811),i(64108)),g=i(89808),y=i(99959),w=i(5359);class v extends y.A{get[(s=w.H,g.Q)](){return this.layer}constructor(e){super(),this[s]=!0,this.type="imagery-tile",this.layer=e}get id(){return this.layer.id}}var x=i(4146),b=i(18768),I=i(63074),C=i(69208),S=i(89015),A=i(16131),T=i(8303),R=i(63660),O=i(56551),M=i(54310),_=i(25036),F=i(82935),P=i(10873),k=i(20437),D=i(74797),N=i(22796),L=i(76353),E=i(84169),B=i(4916),z=i(68197),J=i(5443),U=i(16930),$=i(73444),j=i(14140),q=i(16019);function Z(e){return["x","e","east","long","longitude"].includes(e.toLowerCase())}function H(e){return["y","n","west","lat","latitude"].includes(e.toLowerCase())}function V(e){const{axes:t}=e.domain,i=Object.keys(t),s=[],r=[];let a=-1,n=-1,o=[];for(let e=0;e<i.length;e++){const l=i[e];Z(l)?a=e:H(l)&&(n=e);const c=t[l],u=[];if("values"in c){c.values.forEach(e=>u.push("string"==typeof e?new Date(e).getTime():e));const e=u[1]-u[0];s.push([u[0]-.5*e,u[u.length-1]+.5*e]),r.push(e)}else{const{start:e,stop:t,num:i}=c,a=(t-e)/(i-1);s.push([e-.5*a,t+.5*a]),r.push(a);for(let t=0;t<i;t++)u.push(e+a*t)}o.push({name:l,values:u,extent:[u[0],u[u.length-1]]})}a>-1&&-1===n?n=0===a?1:0:n>-1&&-1===a?a=0===n?1:0:-1===n&&-1===a&&(a=0,n=1),o=o.filter((e,t)=>!(t===a||t===n));const{referencing:l}=e.domain,c=l.find(e=>e.coordinates.includes(i[a])).system.id,u=c?.slice(c.lastIndexOf("/")+1),f=null==u||"CRS84"===u?4326:Number(u),h=new U.A({wkid:f}),[p,d]=s[a],[m,g]=s[n],y=new J.A({xmin:p,xmax:d,ymin:m,ymax:g,spatialReference:h});return{width:Math.round(y.width/r[a]),height:Math.round(y.height/r[n]),extent:y,dimensions:o}}function G(e){const t=(0,$.lR)();return t?e[t]??Object.values(e)[0]:Object.values(e)[0]}function W(){return Math.round(255*Math.random())}function X(e){const t={},{parameters:i}=e;if(!i)return t;for(const[e,s]of Object.entries(i)){const{type:i,description:r,unit:a,categoryEncoding:n,observedProperty:o}=s;if("Parameter"===i&&(t[e]={},r&&(t[e].description=G(r)),a&&(t[e].unit=a.label?G(a.label):null,t[e].symbol=a.symbol?.value),n)){const i=Object.entries(n).map((e,t)=>({OID:t,Value:Number(e[1]),ClassName:e[0].slice(e[0].lastIndexOf("/")+1),Count:1}));let s=!1;o?.categories?.length&&(o.categories.forEach(e=>{if(!e.id)return;const t=e.id.slice(e.id.lastIndexOf("/")+1),r=i.find(e=>e.ClassName===t);if(!r)return;const a=e.label?G(e.label):null;if(r.Label=a,e.preferredColor){const t=z.A.fromHex(e.preferredColor);t&&(s=!0,r.Red=t.r,r.Green=t.g,r.Blue=t.b)}}),s&&i.forEach(e=>{null==e.Red&&(e.Red=W(),e.Green=W(),e.Blue=W())}));const r={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:i.map(e=>({attributes:e}))};s&&r.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),t[e].attributeTable=r}}return t}function Y(e){let t=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(let s=0;s<e.length;s++){const r=e[s];null!=r&&(r<t&&(t=r),r>i&&(i=r))}return(0,q.X1)(t,i)}function K(e,t,i){const s=e.map((e,i)=>({name:e,count:t[i]})).sort((e,t)=>e.name>t.name?-1:1),r=(a=1,e=>a*=e.count);var a;const n=[...s.slice(1),{name:"",count:1}].reverse().map(r).reverse();let o=0;for(let r=e.length-1;r>=0;r--)o+=n[s.findIndex(({name:t})=>t===e[r])]*(i%t[r]),i=Math.floor(i/t[r]);return o}var Q=i(45617),ee=i(87186),te=i(77301),ie=i(28435),se=i(6952);let re=class extends B.A{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}fetchRawTile(e,t,i,s={}){if(!this._pixelBlockTiles){const{rasterInfo:r}=this,[a,n]=r.storageInfo.tileInfo.size,{sliceId:o}=s,{pixelBlocks:l}=this.source,c={pixelBlock:null==o?l[0]:l[o],useBilinear:"thematic"!==r.dataType,tileSize:{width:a,height:n},level:e,row:t,col:i},u=this.rasterJobHandler?this.rasterJobHandler.clipTile(c,s):(0,ie.J$)(c);return Promise.resolve(u)}const r=this._pixelBlockTiles.get(`${e}/${t}/${i}`);return Promise.resolve(r)}async _open(e){const t=this.source,{pixelBlocks:i,attributeTable:s,statistics:r,histograms:a,name:n,nativeExtent:o,transform:l,colormap:c}=t,u=i[0],{width:f,height:h,pixelType:p}=u,d=t.extent??new J.A({xmin:-.5,ymin:.5,xmax:f-.5,ymax:h-.5,spatialReference:new U.A({wkid:3857})}),m=t.isPseudoSpatialReference??!t.extent,g={x:d.width/f,y:d.height/h},y={...t.keyProperties};t.dataType&&(y.DataType=t.dataType),t.bandInfos&&(y.BandProperties=t.bandInfos.map(e=>e.toJSON())),s&&(y.DataType="Thematic");const w=new ee.A({width:f,height:h,pixelType:p,extent:d,nativeExtent:o,attributeTable:s,colormap:c,transform:l,pixelSize:g,spatialReference:d.spatialReference,bandCount:u.pixels.length,keyProperties:y,multidimensionalInfo:t.multidimensionalInfo,statistics:r,isPseudoSpatialReference:m,histograms:a});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(w),this.createRemoteDatasetStorageInfo(w,512,512),this._set("rasterInfo",w),this.updateTileInfo(),w.multidimensionalInfo?await this._buildMDimStats(t.pixelBlocks,w.multidimensionalInfo):await this._buildInMemoryRaster(u,{width:512,height:512},e),w.multidimensionalInfo||(this.source=null),this.datasetName=n}async _buildInMemoryRaster(e,t,i){const{rasterInfo:s}=this,r=s.storageInfo.maximumPyramidLevel??0,a="thematic"!==s.dataType,n=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:r,useBilinear:a},i):Promise.resolve((0,ie.lD)(e,t,r,a)),l=null!=s.statistics,c=null!=s.histograms,f=this.ioConfig.skipStatistics||l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},i):Promise.resolve((0,se.f4)(e)),h=await(0,u.Lx)([n,f]);if(!h[0].value&&h[1].value)throw new o.A("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=h[0].value,l||(s.statistics=h[1].value?.statistics),c||(s.histograms=h[1].value?.histograms)}async _buildMDimStats(e,t,i){for(let s=0;s<t.variables.length;s++){const r=t.variables[s];if(r.statistics)continue;const a=r.dimensions.map(e=>new Q.A({variableName:r.name,dimensionName:e.name,values:[e.values?.[0]??e.extent?.[0]],isSlice:!0})),n=(0,te.NG)(a,t),o=null==n?null:e[n];if(null==o)continue;const l=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:o},i):(0,se.eH)(o);r.statistics=l.statistics,r.histograms||(r.histograms=l.histograms)}}};(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],re.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,h.MZ)()],re.prototype,"source",void 0),(0,r.Cg)([(0,h.MZ)()],re.prototype,"url",null),re=(0,r.Cg)([(0,m.$)("esri.layers.support.rasterDatasets.InMemoryRaster")],re);const ae=re;var ne=i(22671);let oe=class extends B.A{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(e,t,i,s={}){return this._inMemoryRaster.fetchRawTile(e,t,i,s)}async _open(e){const{extent:t,pixelBlocks:i,multidimensionalInfo:s,attributeTable:r,bandNames:a}=await this._fetchData(e),{statistics:n,histograms:o}=(0,se.eH)(i[0]),l=a?.map(e=>({BandName:e})),c={DataType:r?"Thematic":s?"Scientific":"Generic",BandProperties:l},u=new ae({source:{extent:t,pixelBlocks:i,attributeTable:r?ne.A.fromJSON(r):null,multidimensionalInfo:s,statistics:n,histograms:o,keyProperties:c,isPseudoSpatialReference:!1}});await u.open(),this._inMemoryRaster=u;const f=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",f.slice(0,f.indexOf("."))),this._set("rasterInfo",u.rasterInfo)}async _fetchData(e){const t=this.source??(await this.request(this.url,{signal:e?.signal})).data,i="imagery-tile-layer:open-coverage-json";if("coverage"!==t.type?.toLowerCase()||"grid"!==t.domain?.domainType?.toLowerCase())throw new o.A(i,"Only coverage with Grid domain type is supported");if(!t.ranges)throw new o.A(i,"Missing ranges in the grid coverage data");if(!t.domain.referencing?.length)throw new o.A(i,"Missing domain referencing in the grid coverage data");const s=Object.values(t.ranges);for(let e=0;e<s.length;e++){const{axisNames:t,shape:r,type:a,values:n}=s[e];if(!("ndarray"===a.toLowerCase()&&n?.length&&t?.length&&r?.length))throw new o.A(i,"Only ranges with valid NdArray, axisNames, shape, and inline values are supported");if(!Z(t[t.length-1])||!H(t[t.length-2]))throw new o.A(i,"Only row-major ordered pixel values are supported. X axis must be the last axis.")}return function(e){const{width:t,height:i,extent:s,dimensions:r}=V(e),{ranges:a}=e,n=Object.keys(a).sort((e,t)=>e<t?-1:1),o=[];for(let e=0;e<n.length;e++){const t=n[e];r?.length&&o.push({name:t,dimensions:r})}const l=X(e);o.forEach(e=>l[e.name]&&Object.assign(e,l[e.name]));const c=o.length?{variables:o}:void 0,u=[];for(let e=0;e<n.length;e++){const s=n[e],{values:o,dataType:l,axisNames:c,shape:f}=a[s],h=f.length>2?e*f.slice(0,-2).reduce((e,t)=>e*t):0,p=c.slice(0,-2),d=f.slice(0,-2),m="float"===l?"f32":Y(o),g=t*i,y=o.length/g;for(let s=0;s<y;s++){const a=j.A.createEmptyBand(m,g),n=new Uint8Array(g).fill(255);let l=!1;const c=s*g;for(let e=0;e<g;e++){const t=o[c+e];null==t?(n[e]=0,l=!0):a[e]=t}if(0===e||r?.length){const e=new j.A({width:t,height:i,mask:l?n:null,pixels:[a],pixelType:m});e.updateStatistics(),r?.length?u[K(p,d,s)+h]=e:u.push(e)}else{const e=u[s];e.pixels.push(a),l?e.mask&&(e.mask=j.A.combineBandMasks([e.mask,n])):e.mask=l?n:null}}}const f=Object.values(l).find(e=>e.attributeTable)?.attributeTable;return{extent:s,pixelBlocks:u,multidimensionalInfo:c,attributeTable:f,bandNames:c?void 0:n}}(t)}};(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],oe.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,h.MZ)({constructOnly:!0})],oe.prototype,"source",void 0),oe=(0,r.Cg)([(0,m.$)("esri.layers.support.rasterDatasets.CovJSONRaster")],oe);const le=oe;var ce=i(4576),ue=i(21325),fe=i(50103),he=i(21312);function pe(e,t){if(!e||!t)return null;const i=[];for(let s=0;s<e.length;s++)i.push(e[s]),i.push(t[s]);return i}function de(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new U.A({wkid:t});if(e=String(e).trim(),(0,ue.jp)(e))return new U.A({wkt2:e});const i=e.toUpperCase();if(i.startsWith("COMPD_CS")){if(!i.includes("VERTCS")||!i.includes("GEOGCS")&&!i.startsWith("PROJCS"))return null;const s=i.indexOf("VERTCS"),r=i.indexOf("PROJCS"),a=r>-1?r:i.indexOf("GEOGCS");if(-1===a)return null;const n=e.slice(a,e.lastIndexOf("]",s)+1).trim(),o=e.slice(s,e.lastIndexOf("]")).trim();t=me(n);const l=new U.A(t?{wkid:t}:{wkt:n}),c=me(o);return c&&(l.vcsWkid=c),l}return i.startsWith("GEOGCS")||i.startsWith("PROJCS")?(t=me(e),new U.A(0!==t?{wkid:t}:{wkt:e})):null}function me(e){const t=e.replaceAll("]","[").replaceAll('"',"").split("[").map(e=>e.trim()).filter(e=>""!==e),i=t[t.length-1].split(","),s=i[0]?.toLowerCase();if(("epsg"===s||"esri"===s)&&e.endsWith('"]]')){const e=Number(i[1]);if(!isNaN(e)&&0!==e)return e}return 0}function ge(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};const t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach(e=>{if(1===e.nodeType)if((0,fe.g7)(e,"SRS")){if(!t.spatialReference){const i=(0,fe.mX)(e);t.spatialReference=de(i)}}else if((0,fe.g7)(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:i,transform:s}=function(e){const t=(0,fe.V6)(e,"GeodataXform"),i=de((0,fe.v7)(t,"SpatialReference/WKID")||(0,fe.mX)(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:i,transform:null};const s=(0,fe.v7)(t,"PolynomialOrder")??1,r=(0,fe.Ui)(t,"CoeffX/Double"),a=(0,fe.Ui)(t,"CoeffY/Double"),n=(0,fe.Ui)(t,"InverseCoeffX/Double"),o=(0,fe.Ui)(t,"InverseCoeffY/Double"),l=pe(r,a),c=pe(n,o);return{spatialReference:i,transform:l&&c&&l.length&&c.length?new he.A({spatialReference:i,polynomialOrder:s,forwardCoefficients:l,inverseCoefficients:c}):null}}(e);t.transform=s,t.spatialReference||(t.spatialReference=i)}else(0,fe.IC)(e,"MDI").forEach(e=>t.metadata[e.getAttribute("key")]=(0,fe.mX)(e));else if((0,fe.g7)(e,"PAMRasterBand")){const i=function(e){const t=(0,fe.v7)(e,"NoDataValue"),i=(0,fe.V6)(e,"Histograms/HistItem"),s=(0,fe.v7)(i,"HistMin"),r=(0,fe.v7)(i,"HistMax"),a=(0,fe.v7)(i,"BucketCount"),n=(0,fe.mX)(i,"HistCounts")?.split("|").map(e=>Number(e));let o,l,c,u;(0,fe.IC)(e,"Metadata/MDI").forEach(e=>{const t=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":o=t;break;case"STATISTICS_MAXIMUM":l=t;break;case"STATISTICS_MEAN":c=t;break;case"STATISTICS_STDDEV":u=t}});const f=(0,fe.v7)(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:n?.length&&null!=s&&null!=r?{min:s,max:r,size:a||n.length,counts:n}:null,sourceBandIndex:f,statistics:null!=o&&null!=l?{min:o,max:l,avg:c,stddev:u}:null}}(e);null!=i.sourceBandIndex&&null==t.rasterBands[i.sourceBandIndex]?t.rasterBands[i.sourceBandIndex]=i:t.rasterBands.push(i)}});const i=t.rasterBands;if(i.length){const e=!!i[0].statistics;t.statistics=e?i.map(e=>e.statistics).filter(ce.Ru):null;const s=!!i[0].histogram;t.histograms=s?i.map(e=>e.histogram).filter(ce.Ru):null}return t}var ye=i(77649);let we=class extends B.A{fetchRawTile(e,t,i,s={}){return this._inMemoryRaster.fetchRawTile(e,t,i,s)}async _open(e){const t=await this._fetchData(e);let{spatialReference:i,statistics:s,histograms:r,transform:a}=await this._fetchAuxiliaryData(e);const n=!i;n&&(i=new U.A({wkid:3857})),r?.length&&null==s&&(s=(0,se.Pg)(r));const{width:o,height:l}=t;let c=new J.A({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:i});const u=a?a.forwardTransform(c):c;let f=!0;if(a){const e=a.forwardCoefficients;f=e&&0===e[1]&&0===e[2],f&&(a=null,c=u)}const h=new ae({source:{extent:u,nativeExtent:c,transform:a,pixelBlocks:[t],statistics:s,histograms:r,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:n},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(h.ioConfig.skipMapInfo=!0),await h.open(),h.source=null,this._set("rasterInfo",h.rasterInfo),this._inMemoryRaster=h}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),i=(0,ye.g)(t).toUpperCase();if("JPG"!==i&&"PNG"!==i&&"GIF"!==i&&"BMP"!==i)throw new o.A("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",i);const s=i.toLowerCase(),r="gif"===s||"bmp"===s||!(0,d.A)("ios"),a=await this.decodePixelBlock(t,{format:s,useCanvas:r,hasNoZlibMask:!0});if(null==a)throw new o.A("image-aux-raster:open","the data cannot be decoded");return a}async _fetchAuxiliaryData(e){const t=e?.signal,{skipExtensions:i=[],skipMapInfo:s}=this.ioConfig,r=s||i.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),a=this.datasetFormat,n="JPG"===a?"jgw":"PNG"===a?"pgw":"BMP"===a?"bpw":null,o=n&&i.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:t}),l=await(0,u.Lx)([r,o]);if(t?.aborted)throw(0,u.NK)();const c=ge(l[0].value?.data);if(!c.transform){const e=l[1].value?l[1].value.data.split("\n").slice(0,6).map(e=>Number(e)):null;c.transform=6===e?.length?new he.A({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return c}};(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],we.prototype,"datasetFormat",void 0),we=(0,r.Cg)([(0,m.$)("esri.layers.support.rasterDatasets.ImageAuxRaster")],we);const ve=we;var xe=i(97768),be=i(84952),Ie=i(86738),Ce=i(20223),Se=i(87045),Ae=i(25943),Te=i(73037),Re=i(82371);let Oe=class extends B.A{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(e,t,i,s={}){const{storageInfo:r,extent:a}=this.rasterInfo,{transposeInfo:n}=r,o=null!=n&&!!s.transposedVariableName;if(this._slices&&!o&&null==s.sliceId)return null;const l=o?0:r.maximumPyramidLevel-e+this._levelOffset,c=`${this.url}/tile/${l}/${t}/${i}`,u=this._slices?o?{variable:s.transposedVariableName}:{sliceId:s.sliceId||0}:null;let f,h;if(r.isBsqTile){const e=(s.bandIds?.length?s.bandIds:[0,1,2]).map(e=>this.request(c,{query:{...u,bandId:e},responseType:"array-buffer",signal:s.signal})),t=await Promise.all(e),i=t.map(e=>e.data.byteLength).reduce((e,t)=>e+t),r=new Uint8Array(i);h=[];let a=0;for(const{data:e}of t)h.push(a),r.set(new Uint8Array(e),a),a+=e.byteLength;f=r.buffer}else f=(await this.request(c,{query:u,responseType:"array-buffer",signal:s.signal})).data;if(!f)return null;const p=o?n.tileSize:r.tileInfo.size,d=await this.decodePixelBlock(f,{width:p[0],height:p[1],planes:h?.length,offsets:h,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:o,noDataValue:this.rasterInfo.noDataValue});if(null==d)return null;const m=r.blockBoundary[e];if("jpg"!==r.compression||i>m.minCol&&i<m.maxCol&&t>m.minRow&&t<m.maxRow)return d;const{origin:g,blockWidth:y,blockHeight:w}=r,{x:v,y:x}=this.getPyramidPixelSize(e),b=Math.round((a.xmin-g.x)/v)%y,I=Math.round((a.xmax-g.x)/v)%y||y,C=Math.round((g.y-a.ymax)/x)%w,S=Math.round((g.y-a.ymin)/x)%w||w,A=i===m.minCol?b:0,T=t===m.minRow?C:0,R=i===m.maxCol?I:y,O=t===m.maxRow?S:w;return(0,ie.z$)(d,{x:A,y:T},{width:R-A,height:O-T}),d}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const i=this._slices[e].multidimensionalDefinition;if(i.length===t.length&&!i.some(e=>{const i=t.find(t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName);return!i||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])}))return e}return null}async fetchVariableStatisticsHistograms(e,t){const i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.statistics),s=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.histograms),r=await Promise.all([i,s]);return r[0]&&r[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),r[1]?.[0]?.counts?.length||(r[1]=null),{statistics:r[0]||null,histograms:r[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===i)return null;let s=0;const{maximumPyramidLevel:r}=this.rasterInfo.storageInfo;let a=r-s+this._levelOffset;const n=i.srcLocation;for(;a>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(a,i.row,i.col,t))break}catch{}if(a--,s++,i=this.identifyPixelLocation(n,s,t.datumTransformation),null===i)return null}return-1===a||null==i?null:s}async _open(e){const t=e?.signal,i=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});i.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const s=i.data;if(this.sourceJSON=s,!s)throw new o.A("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!s.tileInfo)throw new o.A("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=s.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(s.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===s.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=s.name?.slice(s.name.indexOf("/")+1)??"";const r=await this._fetchRasterInfo({signal:t});if(null==r)throw new o.A("image-server-raster:open","cannot initialize image service");(0,Re.E9)(r,s);const a="Map"===this.tileType?function(e,t){if(!e)return null;const{minScale:i,maxScale:s,minLOD:r,maxLOD:a}=t;if(null!=r&&null!=a)return Se.A.fromJSON({...e,lods:e.lods.filter(({level:e})=>null!=e&&e>=r&&e<=a)});if(0!==i&&0!==s){const t=e=>Math.round(1e4*e)/1e4,r=i?t(i):1/0,a=s?t(s):-1/0;return Se.A.fromJSON({...e,lods:e.lods.filter(e=>{const i=t(e.scale);return i<=r&&i>=a})})}return Se.A.fromJSON(e)}(s.tileInfo,s):Se.A.fromJSON(s.tileInfo);(0,xe.Lw)(a);const[n,l]=this._computeMinMaxLOD(r,a),{extent:c,pixelSize:u}=r,f=.5/r.width*u.x,h=Math.max(u.x,u.y),{lods:p}=a;("Map"!==this.tileType&&0!==s.maxScale||Math.abs(u.x-u.y)>f||!p.some(e=>Math.abs(e.resolution-h)<f))&&(u.x=u.y=n.resolution,r.width=Math.ceil((c.xmax-c.xmin)/u.x-.1),r.height=Math.ceil((c.ymax-c.ymin)/u.y-.1));const d=n.level-l.level,[m,g]=a.size,y=[],w=[];p.forEach((e,t)=>{e.level>=l.level&&e.level<=n.level&&y.push({x:e.resolution,y:e.resolution}),t<p.length-1&&w.push(Math.round(10*e.resolution/p[t+1].resolution)/10)}),y.sort((e,t)=>e.x-t.x);const v=this.computeBlockBoundary(c,m,g,a.origin,y,d),x=y.length>1?y.slice(1):null;let b;s.transposeInfo&&(b={tileSize:[s.transposeInfo.rows,s.transposeInfo.cols],packetSize:r.keyProperties?._yxs.PacketSize??0});const I=w.length<=1||w.length>=3&&w.slice(0,-1).every(e=>e===w[0])?w[0]??2:Math.round(10/(l.resolution/n.resolution)**(-1/d))/10;if(r.storageInfo=new Ce.A({blockWidth:a.size[0],blockHeight:a.size[1],pyramidBlockWidth:a.size[0],pyramidBlockHeight:a.size[1],pyramidResolutions:x,pyramidScalingFactor:I,compression:a.format,origin:a.origin,firstPyramidLevel:1,maximumPyramidLevel:d,tileInfo:a,isBsqTile:!!s.bsq,transposeInfo:b,blockBoundary:v}),function(e){const{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new Te.A,e.extent=e.transform.forwardTransform(t))}(r),this._set("rasterInfo",r),s.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:r.storageInfo.tileInfo,parsedUrl:(0,be.An)(this.url),url:this.url,tileServers:[]};this._tilemapCache=new Ae.d({layer:e})}}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),s=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),r=U.A.fromJSON(t.spatialReference||e.spatialReference),a=new Ie.A({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:r});return new ee.A({width:i,height:s,bandCount:3,extent:J.A.fromJSON(e),spatialReference:r,pixelSize:a,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:i}=e,s=(0,Re.Tw)(this.url,this.sourceJSON,{signal:i,query:this.ioConfig.customFetchParameters}),r=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:i}).then(e=>e.data?.slices).catch(()=>null):null,a=await Promise.all([s,r]);return this._slices=a[1],a[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_computeMinMaxLOD(e,t){const{pixelSize:i}=e,s=.5/e.width*i.x,{lods:r}=t,a=t.lodAt(Math.max.apply(null,r.map(e=>e.level))),n=t.lodAt(Math.min.apply(null,r.map(e=>e.level))),{tileType:o}=this;if("Map"===o)return this._levelOffset=r[0].level,[a,n];if("Raster"===o)return[r.find(e=>e.resolution===i.x)??a,n];const{minScale:l,maxScale:c}=this.sourceJSON;let u=a;c>0&&(u=r.find(e=>Math.abs(e.scale-c)<s),u||(u=r.filter(e=>e.scale>c).sort((e,t)=>e.scale>t.scale?1:-1)[0]??a));let f=n;return l>0&&(f=r.find(e=>Math.abs(e.scale-l)<s)??n,this._levelOffset=f.level-n.level),[u,f]}};(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Oe.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,h.MZ)()],Oe.prototype,"tileType",void 0),Oe=(0,r.Cg)([(0,m.$)("esri.layers.support.rasterDatasets.ImageServerRaster")],Oe);const Me=Oe;var _e=i(47124);const Fe=new Map;Fe.set("Int8","s8"),Fe.set("UInt8","u8"),Fe.set("Int16","s16"),Fe.set("UInt16","u16"),Fe.set("Int32","s32"),Fe.set("UInt32","u32"),Fe.set("Float32","f32"),Fe.set("Float64","f32"),Fe.set("Double64","f32");const Pe=new Map;Pe.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Pe.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Pe.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Pe.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"}),Pe.set("qb3",{blobExtension:".pq3",isOneSegment:!0,decoderFormat:"qb3"});let ke=class extends B.A{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(e,t,i,s={}){const{blockWidth:r,blockHeight:a,blockBoundary:n}=this.rasterInfo.storageInfo,o=n[e];if(!o||o.maxRow<t||o.maxCol<i||o.minRow>t||o.minCol>i)return null;const{bandCount:l,pixelType:c}=this.rasterInfo,{ranges:u,actualTileWidth:f,actualTileHeight:h}=this._getTileLocation(e,t,i);if(!u||0===u.length)return null;if(0===u[0].from&&0===u[0].to){const e=new Uint8Array(r*a);return new j.A({width:r,height:a,pixels:void 0,mask:e,validPixelCount:0})}const{bandIds:p}=this.ioConfig,d=this._getBandSegmentCount(),m=[];let g=0;for(g=0;g<d;g++)p&&!p.includes(g)||m.push(this.request(this._files.data,{range:{from:u[g].from,to:u[g].to},responseType:"array-buffer",signal:s.signal}));const y=await Promise.all(m),w=y.map(e=>e.data.byteLength).reduce((e,t)=>e+t),v=new Uint8Array(w),x=[];let b=0;for(g=0;g<d;g++)x.push(b),v.set(new Uint8Array(y[g].data),b),b+=y[g].data.byteLength;const I=Pe.get(this.rasterInfo.storageInfo.compression).decoderFormat,C=await this.decodePixelBlock(v.buffer,{width:r,height:a,format:I,planes:p?.length||l,offsets:x,pixelType:c}).catch(()=>null);if(null==C)return null;let{noDataValue:S}=this.rasterInfo;if(null!=S&&"lerc"!==I&&!C.mask&&(S=S[0],null!=S)){const e=C.width*C.height,t=new Uint8Array(e);if(Math.abs(S)>1e24)for(g=0;g<e;g++)Math.abs((C.pixels[0][g]-S)/S)>1e-6&&(t[g]=1);else for(g=0;g<e;g++)C.pixels[0][g]!==S&&(t[g]=1);C.mask=t}let A=0,T=0;if(f!==r||h!==a){let e=C.mask;if(e)for(g=0;g<a;g++)if(T=g*r,g<h)for(A=f;A<r;A++)e[T+A]=0;else for(A=0;A<r;A++)e[T+A]=0;else for(e=new Uint8Array(r*a),C.mask=e,g=0;g<h;g++)for(T=g*r,A=0;A<f;A++)e[T+A]=1}return C}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const t=e?e.signal:null,i=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:s,files:r}=this._parseHeader(i.data),{skipMapInfo:a,skipExtensions:n=[]}=this.ioConfig;if(!n.includes("aux.xml")&&!a){const t=await this._fetchAuxiliaryData(e);null!=t&&(s.statistics=t.statistics??s.statistics,s.histograms=t.histograms,t.histograms&&null==s.statistics&&(s.statistics=(0,se.Pg)(t.histograms)))}a&&this.updateImageSpaceRasterInfo(s),this._set("rasterInfo",s),this._files=r;const o=await this.request(r.index,{responseType:"array-buffer",signal:t});this._storageIndex=function(e){if(e.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let t,i,s,r,a,n;if(_e.Z){for(i=new Uint8Array(e),r=new ArrayBuffer(e.byteLength),s=new Uint8Array(r),a=0;a<e.byteLength/4;a++)for(n=0;n<4;n++)s[4*a+n]=i[4*a+3-n];t=new Uint32Array(r)}else t=new Uint32Array(e);return t}(o.data);const{blockWidth:l,blockHeight:c}=this.rasterInfo.storageInfo,u=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:f,height:h}=this.rasterInfo,p=[],d=this._getBandSegmentCount();let m=0,g=-1;for(;m<this._storageIndex.length;){g++;const e=Math.ceil(f/l/u**g)-1,t=Math.ceil(h/c/u**g)-1;m+=(e+1)*(t+1)*d*4,p.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=p,g>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=g),this.updateTileInfo()}_getBandSegmentCount(){return Pe.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,i){const{blockWidth:s,blockHeight:r,pyramidScalingFactor:a}=this.rasterInfo.storageInfo,{width:n,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let c,u,f,h=0,p=0;for(f=0;f<e;f++)p=a**f,c=Math.ceil(n/s/p),u=Math.ceil(o/r/p),h+=c*u;p=a**e,c=Math.ceil(n/s/p),u=Math.ceil(o/r/p),h+=t*c+i,h*=4*l;const d=this._storageIndex.subarray(h,h+4*l);let m=0,g=0;const y=[];for(let e=0;e<l;e++)m=d[4*e]*2**32+d[4*e+1],g=m+d[4*e+2]*2**32+d[4*e+3]-1,y.push({from:m,to:g});return{ranges:y,actualTileWidth:i<c-1?s:Math.ceil(n/p)-s*(c-1),actualTileHeight:t<u-1?r:Math.ceil(o/p)-r*(u-1)}}_parseHeader(e){const t=(0,fe.V6)(e,"MRF_META/Raster");if(!t)throw new o.A("mrf:open","not a valid MRF format");const i=(0,fe.V6)(t,"Size"),s=parseInt(i.getAttribute("x"),10),r=parseInt(i.getAttribute("y"),10),a=parseInt(i.getAttribute("c"),10),n=((0,fe.mX)(t,"Compression")||"none").toLowerCase();if(!Pe.has(n))throw new o.A("mrf:open","currently does not support compression "+n);const l=(0,fe.mX)(t,"DataType")||"UInt8",c=Fe.get(l);if(null==c)throw new o.A("mrf:open","currently does not support pixel type "+l);const u=(0,fe.V6)(t,"PageSize"),f=parseInt(u.getAttribute("x"),10),h=parseInt(u.getAttribute("y"),10),p=(0,fe.V6)(t,"DataValues");let d,m;if(p&&(m=p.getAttribute("NoData"),null!=m&&(d=m.trim().split(" ").map(e=>parseFloat(e)))),(0,fe.V6)(e,"MRF_META/CachedSource"))throw new o.A("mrf:open","currently does not support MRF referencing other data files");const g=(0,fe.V6)(e,"MRF_META/GeoTags"),y=(0,fe.V6)(g,"BoundingBox");let w,v=!1;if(null!=y){const e=parseFloat(y.getAttribute("minx")),t=parseFloat(y.getAttribute("miny")),i=parseFloat(y.getAttribute("maxx")),s=parseFloat(y.getAttribute("maxy")),r=(0,fe.mX)(g,"Projection")||"";let a=U.A.WGS84;if("LOCAL_CS[]"!==r)if(r.toLowerCase().startsWith("epsg:")){const e=Number(r.slice(5));isNaN(e)||0===e||(a=new U.A({wkid:e}))}else a=de(r)??U.A.WGS84;else v=!0,a=new U.A({wkid:3857});w=new J.A(e,t,i,s),w.spatialReference=a}else v=!0,w=new J.A({xmin:-.5,ymin:.5-r,xmax:s-.5,ymax:.5,spatialReference:new U.A({wkid:3857})});const x=(0,fe.V6)(e,"MRF_META/Rsets"),b=parseInt(x?.getAttribute("scale")||"2",10),I=w.spatialReference,C=new Ce.A({origin:new Ie.A({x:w.xmin,y:w.ymax,spatialReference:I}),blockWidth:f,blockHeight:h,pyramidBlockWidth:f,pyramidBlockHeight:h,compression:n,pyramidScalingFactor:b}),S=new Ie.A({x:w.width/s,y:w.height/r,spatialReference:I}),A=new ee.A({width:s,height:r,extent:w,isPseudoSpatialReference:v,spatialReference:I,bandCount:a,pixelType:c,pixelSize:S,noDataValue:d,storageInfo:C}),T=(0,fe.mX)(e,"datafile"),R=(0,fe.mX)(e,"IndexFile");return{rasterInfo:A,files:{mrf:this.url,index:R||this.url.replace(".mrf",".idx"),data:T||this.url.replace(".mrf",Pe.get(n).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return ge(t)}catch{return null}}};(0,r.Cg)([(0,h.MZ)()],ke.prototype,"_files",void 0),(0,r.Cg)([(0,h.MZ)()],ke.prototype,"_storageIndex",void 0),(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],ke.prototype,"datasetFormat",void 0),ke=(0,r.Cg)([(0,m.$)("esri.layers.support.rasterDatasets.MRFRaster")],ke);const De=ke;var Ne=i(15265);function Le(e){const t=e.fields,i=e.records,s=t.some(e=>"oid"===e.name.toLowerCase())?"OBJECTID":"OID",r=[{name:s,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map(e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name}))),a=r.map(e=>e.name),n=[];let o=0,l=0;return i.forEach(e=>{const t={};for(t[s]=o++,l=1;l<a.length;l++)t[a[l]]=e[l-1];n.push({attributes:t})}),{displayFieldName:"",fields:r,features:n}}class Ee{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),i=3&t.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};const s=t.getUint32(4,!0),r=t.getUint16(8,!0),a=t.getUint16(10,!0),n={version:i,recordCount:s,headerByteCount:r,recordByteCount:a};let o=32;const l=[],c=[];let u;if(3===i){for(;13!==t.getUint8(o);)u=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,Ne.w)(new Uint8Array(e,o,11)),type:u,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(u)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;c.length<s&&e.byteLength-o>a;){const i=[];32===t.getUint8(o)?(o+=1,l.forEach(t=>{if("C"===t.type)i.push((0,Ne.w)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)i.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)i.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const s=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();i.push(new Date(parseInt(s.slice(0,4),10),parseInt(s.slice(4,6),10)-1,parseInt(s.slice(6,8),10)))}o+=t.length}),c.push(i)):o+=a}}return{header:n,fields:l,records:c,recordSet:Le({fields:l,records:c})}}}var Be=i(45664),ze=i(12196);const Je=(e,t)=>e.get(t)?.values,Ue=(e,t)=>e.get(t)?.values?.[0];let $e=class extends B.A{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this._chunkSize=10485760,this.datasetFormat="TIFF"}async fetchRawTile(e,t,i,s={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;const r=await this._fetchRawTiffTile(e,t,i,!1,s);if(null!=r&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(e,t,i,!0,s);null!=a&&a.pixels[0]instanceof Uint8Array&&(r.mask=a.pixels[0])}return r}async _open(e){const t=e?e.signal:null,{data:i}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!i)throw new o.A("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:s,firstIFDPos:r,isBigTiff:a}=(0,Be.uT)(i),n=[],c={fileChunk:i,posIFD:r,fileOffset:0};await this._readIFDs(n,c,s,a?8:4,t);const{imageInfo:u,rasterInfo:f}=function(e){const t=(0,Be.uc)(e),{width:i,height:s,tileWidth:r,tileHeight:a,planes:n,pixelType:o,compression:l,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidBlockWidth:f,pyramidBlockHeight:h,pyramidResolutions:p,tileBoundary:d,affine:m,metadata:g}=t;let y=de(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),w=!!t.isPseudoGeographic;null==y&&(w=!0,y=new U.A({wkid:3857}));const v=new J.A({...t.extent,spatialReference:y}),x=new Ie.A(v?{x:v.xmin,y:v.ymax,spatialReference:y}:{x:0,y:0}),b=new Ce.A({blockWidth:r,blockHeight:a,pyramidBlockWidth:f,pyramidBlockHeight:h,compression:l,origin:x,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidResolutions:p,blockBoundary:d}),I=new Ie.A({x:(v.xmax-v.xmin)/i,y:(v.ymax-v.ymin)/s,spatialReference:y}),C=g?{BandProperties:g.bandProperties,DataType:g.dataType}:{};let S=null;const A=Ue(e[0],"PHOTOMETRICINTERPRETATION"),T=Je(e[0],"COLORMAP");if(A<=3&&T?.length>3&&T.length%3==0){S=[];const e=T.length/3;for(let t=0;t<e;t++)S.push([t,T[t]>>>8,T[t+e]>>>8,T[t+2*e]>>>8])}const R=new ee.A({width:i,height:s,bandCount:n,pixelType:o,pixelSize:I,storageInfo:b,spatialReference:y,isPseudoSpatialReference:w,keyProperties:C,extent:v,colormap:S,statistics:g?g.statistics:null});if(m?.length&&(R.nativeExtent=new J.A({xmin:-.5,ymin:.5-s,xmax:i-.5,ymax:.5,spatialReference:y}),R.transform=new he.A({polynomialOrder:1,forwardCoefficients:[m[2]+m[0]/2,m[5]-m[3]/2,m[0],m[3],-m[1],-m[4]]}),R.extent=R.transform.forwardTransform(R.nativeExtent),R.pixelSize=new Ie.A({x:(v.xmax-v.xmin)/i,y:(v.ymax-v.ymin)/s,spatialReference:y}),b.origin.x=-.5,b.origin.y=.5),p){const{x:e,y:t}=R.pixelSize;p.forEach(i=>{i.x*=e,i.y*=t})}return{imageInfo:t,rasterInfo:R}}(n),h=(0,Be.zS)(n),p=(0,Be.r9)(n);if(this._headerInfo={littleEndian:s,isBigTiff:a,ifds:n,pyramidIFDs:h,maskIFDs:p,...u},this._set("rasterInfo",f),!u.isSupported)throw new o.A("tiffraster:open","this tiff is not supported: "+u.message);if(!u.tileWidth)throw new o.A("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");f.isPseudoSpatialReference&&l.A.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const d=n[0].get("PREDICTOR")?.values?.[0],m=n[0].get("SAMPLEFORMAT")?.values?.[0];if(3===m&&2===d)throw new o.A("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:g,skipExtensions:y=[]}=this.ioConfig;if(!y.includes("aux.xml")&&!g){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&function(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,se.Pg)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new Ie.A({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}(t,f)}y.includes("vat.dbf")||1!==f.bandCount||"u8"!==f.pixelType||g||(f.attributeTable=await this._fetchAuxiliaryTable(e),null!=f.attributeTable&&(f.keyProperties.DataType="thematic")),g&&this.updateImageSpaceRasterInfo(f),this.updateTileInfo()}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:i,fileOffset:s,posIFD:r}=e;return(r+8>=i.byteLength||r<0)&&(s=r+s,i=(await this.request(this.url,{range:{from:s,to:s+this._bufferSize},responseType:"array-buffer",signal:t})).data,r=0),{fileChunk:i,fileOffset:s,posIFD:r}}async _readIFDs(e,t,i,s=4,r){if(!t.posIFD)return null;t=await this._validateOrFetchHeaderBuffer(t,r);const a=await this._readIFD(t,i,ze.NB,s,r);if(!a?.ifd)throw new o.A("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(e.push(a.ifd),!a.nextIFD)return null;t.posIFD=a.nextIFD-t.fileOffset,await this._readIFDs(e,t,i,s,r)}async _readIFD(e,t,i=ze.NB,s=4,r){let{fileChunk:a,posIFD:n,fileOffset:o}=e;if(!e.fileChunk)return null;const l=(0,Be.JM)(a,t,n,o,i,s);if(l.success){const e=[];if(l.ifd?.forEach(t=>{t.values||e.push(t)}),e.length>0&&await this._fillOffsets(e,t,l.nextIFD,r),l.ifd?.has("GEOKEYDIRECTORY")){const e=l.ifd.get("GEOKEYDIRECTORY"),i=e?.values;if(i&&i.length>4){const s=i[0]+"."+i[1]+"."+i[2];n=e.valueOffset+6-o;const l=await this._validateOrFetchHeaderBuffer({fileChunk:a,posIFD:n,fileOffset:o},r),c=await this._readIFD(l,t,ze.YC,2,r);e.data=c?.ifd,e.data&&e.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[s]})}}return l}return l.requiredBufferSize?(a=(await this.request(this.url,{range:{from:o,to:o+n+l.requiredBufferSize+8},responseType:"array-buffer",signal:r})).data,a.byteLength<n+l.requiredBufferSize?null:(e.fileChunk=a,e.fileOffset=o,this._readIFD(e,t,i,s,r))):null}async _fillOffsets(e,t,i,s){const r=e.filter(e=>null!=e.offlineOffsetSize);if(0===r.length)return;const a=r.map(e=>e.offlineOffsetSize),n=Math.min.apply(null,a.map(e=>e[0])),o=Math.max.apply(null,a.map(e=>e[0]+e[1]));let l=1===a.length||o-n<=this._bufferSize;if(!l&&a.length>1&&(a.sort((e,t)=>e[0]-t[0]),l=a.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,a[0][0])===o),l){const e=await this._fetchOffsets(n,Math.max(o,n+this._bufferSize),s);return void r.forEach(i=>(0,Be.Cr)(e,t,i,n))}const c=r.map(async e=>{const i=e.offlineOffsetSize,r=await this._fetchOffsets(i[0],i[1]+i[0],s);(0,Be.Cr)(r,t,e,i[0])});await Promise.all(c)}async _fetchOffsets(e,t,i){const s=[],r=this._chunkSize,a=Math.ceil((t-e)/r);let n=e;for(let e=0;e<a;e++)s.push(this.request(this.url,{range:{from:n,to:e===a-1?t:n+r-1},responseType:"array-buffer",signal:i})),n+=r;const o=await Promise.all(s);if(1===a)return o[0].data;const l=new Uint8Array(t-e+1);for(let e=0;e<a;e++)l.set(new Uint8Array(o[e].data),e*r);return l.buffer}async _fetchRawTiffTile(e,t,i,s,r={}){const a=this._getTileLocation(e,t,i,s);if(!a)return null;const{ranges:n,actualTileWidth:o,actualTileHeight:l,ifd:c}=a,u=n.map(e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:r.signal})),f=await Promise.all(u),h=f.map(e=>e.data.byteLength).reduce((e,t)=>e+t),p=1===f.length?f[0].data:new ArrayBuffer(h),d=[0],m=[0];if(f.length>1){const e=new Uint8Array(p);for(let t=0,i=0;t<f.length;t++){const s=f[t].data;e.set(new Uint8Array(s),i),d[t]=i,i+=s.byteLength,m[t]=s.byteLength}}const{blockWidth:g,blockHeight:y}=this.getBlockWidthHeight(e),w=await this.decodePixelBlock(p,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:c,offsets:d,sizes:m},width:g,height:y,planes:null,pixelType:null});if(null==w)return null;let v,x,b;if(o!==g||l!==y){let e=w.mask;if(e)for(v=0;v<y;v++)if(b=v*g,v<l)for(x=o;x<g;x++)e[b+x]=0;else for(x=0;x<g;x++)e[b+x]=0;else for(e=new Uint8Array(g*y),w.mask=e,v=0;v<l;v++)for(b=v*g,x=0;x<o;x++)e[b+x]=1}return w}_getTileLocation(e,t,i,s=!1){const{firstPyramidLevel:r,blockBoundary:a}=this.rasterInfo.storageInfo,n=0===e?0:e-(r-1),{_headerInfo:o}=this;if(!o)return null;const l=s?o.maskIFDs[n]:0===n?o?.ifds[0]:o?.pyramidIFDs[n-1];if(!l)return null;const c=(0,Be.XO)(l,o),u=Je(l,"TILEOFFSETS");if(void 0===u)return null;const f=Je(l,"TILEBYTECOUNTS"),{minRow:h,minCol:p,maxRow:d,maxCol:m}=a[n];if(t>d||i>m||t<h||i<p)return null;const g=Ue(l,"IMAGEWIDTH"),y=Ue(l,"IMAGELENGTH"),w=Ue(l,"TILEWIDTH"),v=Ue(l,"TILELENGTH"),x=[];if(c){const{bandCount:e}=this.rasterInfo;for(let s=0;s<e;s++){const e=s*(d+1)*(m+1)+t*(m+1)+i;x[s]={from:u[e],to:u[e]+f[e]-1}}}else{const e=t*(m+1)+i;x.push({from:u[e],to:u[e]+f[e]-1})}for(let e=0;e<x.length;e++)if(null==x[e].from||!x[e].to||x[e].to<0)return null;return{ranges:x,ifd:l,actualTileWidth:i===m&&g%w||w,actualTileHeight:t===d&&y%v||v}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return ge(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=Ee.parse(t);return i?.recordSet?ne.A.fromJSON(i.recordSet):null}catch{return null}}};(0,r.Cg)([(0,h.MZ)()],$e.prototype,"_files",void 0),(0,r.Cg)([(0,h.MZ)()],$e.prototype,"_headerInfo",void 0),(0,r.Cg)([(0,h.MZ)()],$e.prototype,"_bufferSize",void 0),(0,r.Cg)([(0,h.MZ)()],$e.prototype,"_chunkSize",void 0),(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],$e.prototype,"datasetFormat",void 0),$e=(0,r.Cg)([(0,m.$)("esri.layers.support.rasterDatasets.TIFFRaster")],$e);const je=$e,qe=new Map;qe.set("MRF",{desc:"Meta Raster Format",constructor:De}),qe.set("TIFF",{desc:"GeoTIFF",constructor:je}),qe.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Me}),qe.set("JPG",{desc:"JPG Raster Format",constructor:ve}),qe.set("PNG",{desc:"PNG Raster Format",constructor:ve}),qe.set("GIF",{desc:"GIF Raster Format",constructor:ve}),qe.set("BMP",{desc:"BMP Raster Format",constructor:ve}),qe.set("CovJSON",{desc:"COVJSON Raster Format",constructor:le}),qe.set("MEMORY",{desc:"In Memory Raster Format",constructor:ae});class Ze{static get supportedFormats(){const e=new Set;return qe.forEach((t,i)=>e.add(i)),e}static async open(e){const{url:t,ioConfig:i,source:s,sourceJSON:r}=e;let a=e.datasetFormat??i?.datasetFormat;null==a&&(t.includes(".")?a=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===s?.type?.toLowerCase()?a="CovJSON":s?.extent&&s.pixelblocks&&(a="MEMORY")),"OVR"===a||"TIF"===a?a="TIFF":"JPG"===a||"JPEG"===a||"JFIF"===a?a="JPG":"COVJSON"===a&&(a="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(a="RasterTileServer");const n={url:t,source:s,sourceJSON:r,datasetFormat:a,ioConfig:i??{bandIds:null,sampling:null}};if(Object.keys(n).forEach(e=>{null==n[e]&&delete n[e]}),a){if(!this.supportedFormats.has(a))throw new o.A("rasterfactory:open","not a supported format "+a);if("CRF"===a)throw new o.A("rasterfactory:open",`cannot open raster: ${t}`);const i=new(0,qe.get(a).constructor)(n);return await i.open({signal:e.signal}),i}const l=Array.from(qe.keys()).filter(e=>"CovJSON"!==e&&"Memory"!==e);let c=0;const u=()=>{if(a=l[c++],!a)return null;if("CRF"===a)return null;const t=new(0,qe.get(a).constructor)(n);return t.open({signal:e.signal}).then(()=>t).catch(()=>u())};return u()}static register(e,t,i){qe.has(e.toUpperCase())||qe.set(e.toUpperCase(),{desc:t,constructor:i})}}var He=i(6049),Ve=i(56776),Ge=i(30291),We=i(88625);let Xe=class extends((0,I.dM)((0,_.j)((0,A.q)((0,T.A)((0,O.H)((0,C.d)((0,S.o)((0,R.G)((0,F.e)((0,b.b)((0,M.J)((0,c.P)((0,n.OU)(x.A)))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.graphicOrigin=new v(this),this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.fields=null,this.source=void 0,this._debouncedSaveOperations=(0,u.sg)(async(e,t,s)=>{const{save:r,saveAs:a}=await i.e(9838).then(i.bind(i,59838));switch(e){case 0:return r(this,t);case 1:return a(this,s,t)}})}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(u.QP).then(()=>this._openRaster(t))),Promise.resolve(this)}set elevationInfo(e){"relative-to-scene"!==e?.mode&&this._set("elevationInfo",e),this._validateElevationInfo(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[(0,D.rZ)("Pixel Value"),(0,D.dy)("Raw Pixel Value")],t=this.raster?.rasterInfo??this.serviceRasterInfo,i=t?.attributeTable;if(i){const t=(0,D.jC)(i);e.push(...t)}const s=t?.dataType,r=t?.multidimensionalInfo;if(("vector-magdir"===s||"vector-uv"===s)&&null!=r){const t=r.variables[0].unit?.trim(),i=(0,D.DV)(t),s=(0,D.y6)();e.push(i,s)}if(r){const t=(0,D.AL)(r);e.push(...t)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){const{rasterFields:t}=this,i=e?.visibleFieldNames??new Set(t.map(({name:e})=>e).filter(e=>e!==D.F_.rawServicePixelValue)),s=(0,Ge.tn)({fields:t,title:this.title},{...e,visibleFieldNames:i}),{rasterInfo:r}=this.raster;return s?.fieldInfos&&r&&(0,D.h4)(s.fieldInfos,r),s}async generateRasterInfo(e,t){if(e=(0,p.PZ)(N.A,e),await this.load(),!e||"none"===e.functionName?.toLowerCase())return this.serviceRasterInfo;try{const{rasterInfo:i}=await this._openFunctionRaster(e,t);return i}catch(e){if(e instanceof o.A)throw e;throw new o.A("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}supportsWrite(){const e=this._primaryRasters[0]??this.raster;return!!(this.loaded?"RasterTileServer"===e.datasetFormat&&("Raster"===e.tileType||"Map"===e.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))}write(e,t){if(this.supportsWrite())return super.write(e,t);if(t?.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new o.A("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){let t=!1;if(this.raster)await this._openFromRaster(this.raster,e),t=(0,L.qg)(this.raster),!t&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:t,rasterFunction:i,source:s}=this;if(!t&&!s)throw new o.A("imagery-tile-layer:open","missing url or source parameter");s?await this._openFromSource(s,e):i?await this._openFromUrlWithRasterFunction(t,i,e):await this._openFromUrl(t,e)}const i=this.raster.rasterInfo;if(!i)throw new o.A("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",t?i:this._primaryRasters[0].rasterInfo),this._set("spatialReference",i.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles((0,f.wB)(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,t){e.rasterInfo||await e.open({signal:t}),this._primaryRasters=(0,L.pb)(e),this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(e,t,i){const s=[e];t&&(0,He.UD)(t.toJSON(),s);const r=await Promise.all(s.map(e=>Ze.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:i}))),a=r.findIndex(e=>null==e);if(a>-1)throw new o.A("imagery-tile-layer:open",`cannot open raster: ${s[a]}`);return this._primaryRasters=r,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){const i=await Ze.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==i)throw new o.A("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[i],this.raster=i}async _openFromSource(e,t){const i="the tiled imagery data source is not supported",s="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!s)throw new o.A("imagery-tile-layer:open",i);"MEMORY"===s&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});const r=await Ze.open({url:"",source:e,datasetFormat:s,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==r)throw new o.A("imagery-tile-layer:open",i);this._primaryRasters=[r],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=r}async _openFunctionRaster(e,t){const i={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>i[e.url]=e);const s=(0,He.vt)(e.functionDefinition?.toJSON()??e.toJSON(),i),r=new E.A({rasterFunction:s});return await r.open(t),r}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(e){e instanceof o.A&&l.A.getLogger(this).error("imagery-tile-layer:open",e.message),l.A.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(e){(0,Ve.XF)(l.A.getLogger(this),(0,Ve.$7)("ImageryTile layers","relative-to-scene",e)),(0,Ve.XF)(l.A.getLogger(this),(0,Ve.tW)("ImageryTile layers",e))}};(0,r.Cg)([(0,h.MZ)({clonable:!1})],Xe.prototype,"_primaryRasters",void 0),(0,r.Cg)([(0,h.MZ)({type:We.A,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],Xe.prototype,"elevationInfo",null),(0,r.Cg)([(0,h.MZ)({readOnly:!0,clonable:!1})],Xe.prototype,"graphicOrigin",void 0),(0,r.Cg)([(0,h.MZ)(P.fV)],Xe.prototype,"legendEnabled",void 0),(0,r.Cg)([(0,h.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Xe.prototype,"isReference",void 0),(0,r.Cg)([(0,h.MZ)({type:["show","hide"]})],Xe.prototype,"listMode",void 0),(0,r.Cg)([(0,h.MZ)({json:{read:!0,write:!0}})],Xe.prototype,"blendMode",void 0),(0,r.Cg)([(0,h.MZ)({type:N.A,json:{name:"renderingRule",write:!0}})],Xe.prototype,"rasterFunction",void 0),(0,r.Cg)([(0,h.MZ)()],Xe.prototype,"sourceJSON",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],Xe.prototype,"version",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0,json:{read:!1}})],Xe.prototype,"type",void 0),(0,r.Cg)([(0,h.MZ)({type:["ArcGISTiledImageServiceLayer"]})],Xe.prototype,"operationalLayerType",void 0),(0,r.Cg)([(0,h.MZ)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,i){t[i]=!e}}}})],Xe.prototype,"popupEnabled",void 0),(0,r.Cg)([(0,h.MZ)({type:a.A,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],Xe.prototype,"popupTemplate",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0})],Xe.prototype,"defaultPopupTemplate",null),(0,r.Cg)([(0,h.MZ)(P.PY)],Xe.prototype,"screenSizePerspectiveEnabled",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0,type:[k.A]})],Xe.prototype,"fields",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0,type:[k.A]})],Xe.prototype,"rasterFields",null),(0,r.Cg)([(0,h.MZ)({constructOnly:!0})],Xe.prototype,"source",void 0),Xe=(0,r.Cg)([(0,m.$)("esri.layers.ImageryTileLayer")],Xe);const Ye=Xe},21312:(e,t,i)=>{i.d(t,{A:()=>m});var s,r=i(31635),a=i(10107),n=(i(44208),i(53966),i(87811),i(93223)),o=i(36005),l=i(64108),c=i(43937),u=i(5443),f=i(86738),h=i(82434);function p(e,t,i){const{x:s,y:r}=t;if(i<2)return{x:e[0]+s*e[2]+r*e[4],y:e[1]+s*e[3]+r*e[5]};if(2===i){const t=s*s,i=r*r,a=s*r;return{x:e[0]+s*e[2]+r*e[4]+t*e[6]+a*e[8]+i*e[10],y:e[1]+s*e[3]+r*e[5]+t*e[7]+a*e[9]+i*e[11]}}const a=s*s,n=r*r,o=s*r,l=a*s,c=a*r,u=s*n,f=r*n;return{x:e[0]+s*e[2]+r*e[4]+a*e[6]+o*e[8]+n*e[10]+l*e[12]+c*e[14]+u*e[16]+f*e[18],y:e[1]+s*e[3]+r*e[5]+a*e[7]+o*e[9]+n*e[11]+l*e[13]+c*e[15]+u*e[17]+f*e[19]}}function d(e,t,i){const{xmin:s,ymin:r,xmax:a,ymax:n,spatialReference:o}=t;let l=[];if(i<2)l.push({x:s,y:n}),l.push({x:a,y:n}),l.push({x:s,y:r}),l.push({x:a,y:r});else{let e=10;for(let t=0;t<e;t++)l.push({x:s,y:r+(n-r)*t/(e-1)}),l.push({x:a,y:r+(n-r)*t/(e-1)});e=8;for(let t=1;t<=e;t++)l.push({x:s+(a-s)*t/e,y:r}),l.push({x:s+(a-s)*t/e,y:n})}l=l.map(t=>p(e,t,i));const c=l.map(e=>e.x),f=l.map(e=>e.y);return new u.A({xmin:Math.min.apply(null,c),xmax:Math.max.apply(null,c),ymin:Math.min.apply(null,f),ymax:Math.max.apply(null,f),spatialReference:o})}let m=s=class extends h.A{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(e,t){const{coeffX:i,coeffY:s}=t;if(!i?.length||!s?.length||i.length!==s.length)return null;const r=[];for(let e=0;e<i.length;e++)r.push(i[e]),r.push(s[e]);return r}writeForwardCoefficients(e,t,i){const s=[],r=[];for(let t=0;t<e?.length;t++)t%2==0?s.push(e[t]):r.push(e[t]);t.coeffX=s,t.coeffY=r}get inverseCoefficients(){let e=this._get("inverseCoefficients");const t=this._get("forwardCoefficients");return!e&&t&&this.polynomialOrder<2&&(e=function(e){const[t,i,s,r,a,n]=e,o=s*n-a*r,l=a*r-s*n;return[(a*i-t*n)/o,(s*i-t*r)/l,n/o,r/l,-a/o,-s/l]}(t)),e}set inverseCoefficients(e){this._set("inverseCoefficients",e)}readInverseCoefficients(e,t){const{inverseCoeffX:i,inverseCoeffY:s}=t;if(!i?.length||!s?.length||i.length!==s.length)return null;const r=[];for(let e=0;e<i.length;e++)r.push(i[e]),r.push(s[e]);return r}writeInverseCoefficients(e,t,i){const s=[],r=[];for(let t=0;t<e?.length;t++)t%2==0?s.push(e[t]):r.push(e[t]);t.inverseCoeffX=s,t.inverseCoeffY=r}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(e){if("point"===e.type){const t=p(this.forwardCoefficients,e,this.polynomialOrder);return new f.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return d(this.forwardCoefficients,e,this.polynomialOrder)}inverseTransform(e){if("point"===e.type){const t=p(this.inverseCoefficients,e,this.polynomialOrder);return new f.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return d(this.inverseCoefficients,e,this.polynomialOrder)}clone(){return new s({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};(0,r.Cg)([(0,a.MZ)({json:{write:!0}})],m.prototype,"polynomialOrder",void 0),(0,r.Cg)([(0,a.MZ)()],m.prototype,"forwardCoefficients",void 0),(0,r.Cg)([(0,o.w)("forwardCoefficients",["coeffX","coeffY"])],m.prototype,"readForwardCoefficients",null),(0,r.Cg)([(0,c.K)("forwardCoefficients")],m.prototype,"writeForwardCoefficients",null),(0,r.Cg)([(0,a.MZ)({json:{write:!0}})],m.prototype,"inverseCoefficients",null),(0,r.Cg)([(0,o.w)("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],m.prototype,"readInverseCoefficients",null),(0,r.Cg)([(0,c.K)("inverseCoefficients")],m.prototype,"writeInverseCoefficients",null),(0,r.Cg)([(0,a.MZ)()],m.prototype,"affectsPixelSize",null),(0,r.Cg)([(0,n.e)({PolynomialXform:"polynomial"})],m.prototype,"type",void 0),m=s=(0,r.Cg)([(0,l.$)("esri.layers.support.rasterTransforms.PolynomialTransform")],m)},25943:(e,t,i)=>{i.d(t,{d:()=>S});var s,r=i(31635),a=i(11254),n=i(69622),o=i(49186),l=i(36563),c=(i(44208),i(66344)),u=i(15142),f=i(74887),h=i(36708),p=i(76030),d=i(84952),m=i(10107),g=(i(53966),i(87811),i(64108)),y=i(72802),w=i(4718),v=i(69397),x=i(34275);class b{constructor(e){!function(e){if(!e?.location)throw new o.A("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new o.A("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new o.A("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new o.A("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new o.A("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}(e);const{location:t,data:i}=e;this.location=Object.freeze((0,w.o8)(t));const s=this.location.width,r=this.location.height;let a=!0,n=!0;const l=function(e,t=!1){return e<=x.y9?t?new Array(e).fill(0):new Array(e):new Uint32Array(e)}(Math.ceil(s*r/32));let c=0;for(let e=0;e<i.length;e++){const t=e%32;i[e]?(n=!1,l[c]|=1<<t):a=!1,31===t&&++c}n?(this._availability="unavailable",this.byteSize=40):a?(this._availability="available",this.byteSize=40):(this._availability=l,this.byteSize=40+(0,v.Qf)(l))}getAvailability(e,t){if("unavailable"===this._availability||"available"===this._availability)return this._availability;const i=(e-this.location.top)*this.location.width+(t-this.location.left),s=i%32,r=i>>5,a=this._availability;return r<0||r>a.length?"unknown":a[r]&1<<s?"available":"unavailable"}static fromDefinition(e,t){const i=e.service.request||a.A,{row:s,col:r,width:n,height:l}=e,c={query:{f:"json"}};return t=t?{...c,...t}:c,i(function(e){let t;if(e.service.tileServers?.length){const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;const i=e.service.query;return i&&(t=`${t}?${i}`),t}(e),t).then(e=>e.data).catch(e=>{if(422===e?.details?.httpStatus)return{location:{top:s,left:r,width:n,height:l},valid:!0,data:new Array(n*l).fill(0)};throw e}).then(e=>{if(e.location&&(e.location.top!==s||e.location.left!==r||e.location.width!==n||e.location.height!==l))throw new o.A("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:s,left:r,width:n,height:l}});return b.fromJSON(e)})}static fromJSON(e){return Object.freeze(new b(e))}}function I(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function C(e,t,i){return new o.A("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})}let S=class extends n.A{static{s=this}constructor(e){super(e),this._pendingTilemapRequests={},this.request=a.A,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new c.q(2097152),this.addHandles((0,h.wB)(()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),h.Vh))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,i){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return"unavailable";const s=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return s?s.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,s){return!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD?Promise.reject(C(e,t,i)):this._fetchTilemap(e,t,i,s).catch(e=>e).then(s=>{if(s instanceof b){const r=s.getAvailability(t,i);if("unavailable"===r)throw C(e,t,i);return r}if((0,f.zf)(s))throw s;return"unknown"})}fetchAvailabilityUpsample(e,t,i,s,r){s.level=e,s.row=t,s.col=i;const a=this.layer.tileInfo;a.updateTileInfo(s);const n=this.fetchAvailability(e,t,i,r).catch(e=>{if((0,f.zf)(e))throw e;if(a.upsampleTile(s))return this.fetchAvailabilityUpsample(s.level,s.row,s.col,s,r);throw e});return this._fetchAvailabilityUpsamplePrefetch(e,t,i,r,n),n}async _fetchAvailabilityUpsamplePrefetch(e,t,i,r,a){if(!this._prefetchingEnabled)return;const n=`prefetch-${e}-${t}-${i}`;if(this.hasHandles(n))return;const o=new AbortController;a.then(()=>o.abort(),()=>o.abort());let c=!1;const u=(0,l.hA)(()=>{c||(c=!0,o.abort())});if(this.addHandles(u,n),await(0,p.md)(10,o.signal).catch(()=>{}),c||(c=!0,this.removeHandles(n)),(0,f.G4)(o))return;const h=new y.U(e,t,i),d={...r,signal:o.signal},m=this.layer.tileInfo;for(let e=0;s._prefetches.length<s._maxPrefetch&&m.upsampleTile(h);++e){const e=this.fetchAvailability(h.level,h.row,h.col,d);s._prefetches.push(e);const t=()=>{s._prefetches.removeUnordered(e)};e.then(t,t)}}static{this._maxPrefetch=4}static{this._prefetches=new u.A({initialSize:s._maxPrefetch})}static cleanupTilemapCache(){this._prefetches.prune()}_fetchTilemap(e,t,i,s){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return Promise.reject(new o.A("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const r=this._tmpTilemapDefinition,a=this._tilemapFromCache(e,t,i,r);if(a)return Promise.resolve(a);const n=s?.signal;return s={...s,signal:null},new Promise((e,t)=>{(0,f.u7)(n,()=>t((0,f.NK)()));const i=I(r);let a=this._pendingTilemapRequests[i];if(!a){a=b.fromDefinition(r,s).then(e=>(this._tilemapCache.put(i,e,e.byteSize),e));const e=()=>{delete this._pendingTilemapRequests[i]};this._pendingTilemapRequests[i]=a,a.then(e,e)}a.then(e,t)})}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:t,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:(0,d.x0)({...e.query,...i,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,s){s.level=e,s.row=t-t%this.size,s.col=i-i%this.size;const r=I(s);return this._tilemapCache.get(r)}get test(){}};(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],S.prototype,"layer",void 0),(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],S.prototype,"minLOD",void 0),(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],S.prototype,"maxLOD",void 0),(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],S.prototype,"request",void 0),(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],S.prototype,"size",void 0),S=s=(0,r.Cg)([(0,g.$)("esri.layers.support.TilemapCache")],S)},56551:(e,t,i)=>{i.d(t,{H:()=>h});var s=i(31635),r=i(10107),a=(i(44208),i(53966),i(87811),i(64108)),n=i(69540),o=i(25482),l=i(56507),c=i(93223),u=i(94359);let f=class extends((0,n.OU)(o.o)){constructor(e){super(e),this.name=void 0,this.method="none",this.value=void 0,this.bandIds=void 0,this.renderer=void 0}};(0,s.Cg)([(0,r.MZ)({type:String,json:{write:{isRequired:!0}}})],f.prototype,"name",void 0),(0,s.Cg)([(0,r.MZ)({type:["raster-function-template","variable","none"],json:{write:{isRequired:!0}}}),(0,c.e)({rasterFunctionTemplate:"raster-function-template",variable:"variable",none:"none"})],f.prototype,"method",void 0),(0,s.Cg)([(0,r.MZ)({type:String,json:{write:{isRequired:!0}}})],f.prototype,"value",void 0),(0,s.Cg)([(0,r.MZ)({type:[l.jz],json:{write:{isRequired:!0}}})],f.prototype,"bandIds",void 0),(0,s.Cg)([(0,r.MZ)({types:u.uy,json:{write:!0,origins:{"web-scene":{types:u.Gj,write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],f.prototype,"renderer",void 0),f=(0,s.Cg)([(0,a.$)("esri.renderers.support.RasterPresetRenderer")],f);const h=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.activePresetRendererName=null,this.presetRenderers=null}};return(0,s.Cg)([(0,r.MZ)({type:String,json:{name:"layerDefinition.activePresetRendererName",write:{allowNull:!0}}})],i.prototype,"activePresetRendererName",void 0),(0,s.Cg)([(0,r.MZ)({type:[f],json:{name:"layerDefinition.presetRenderers",write:!0}})],i.prototype,"presetRenderers",void 0),i=(0,s.Cg)([(0,a.$)("esri.layers.mixins.RasterPresetRendererMixin")],i),i}},69397:(e,t,i)=>{i.d(t,{$B:()=>r,Qf:()=>c,Qh:()=>o,RS:()=>a,ez:()=>h,lM:()=>n,qK:()=>f});var s=i(34275);function r(e){return 32+e.length}const a=16;function n(e){if(!e)return 0;let t=f;for(const i in e)e.hasOwnProperty(i)&&(t+=l(e[i],!1));return t}function o(e){if(!e)return 0;if("number"==typeof e[0])return c(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return u(e,8);let i=h;for(let s=0;s<t;s++)i+=l(e[s]);return i}(e);let t=f;for(const i in e)e.hasOwnProperty(i)&&(t+=l(e[i]));return t}function l(e,t=!0){switch(typeof e){case"object":return t?o(e):f;case"string":return r(e);case"number":return a;case"boolean":return 4;default:return 8}}function c(...e){return e.reduce((e,t)=>e+(t?(0,s.iu)(t)?t.byteLength+p:Array.isArray(t)?u(t,a):0:0),0)}function u(e,t){return h+e.length*t}const f=32,h=16,p=145},73037:(e,t,i)=>{i.d(t,{A:()=>c});var s,r=i(31635),a=i(10107),n=(i(44208),i(53966),i(87811),i(93223)),o=i(64108),l=i(82434);let c=s=class extends l.A{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(e){return"point"===(e=e.clone()).type?(e.x>180+this.tolerance&&(e.x-=360),e):(e.xmin>=180-this.tolerance?(e.xmax-=360,e.xmin-=360):e.xmax>180+this.tolerance&&(e.xmin=-180,e.xmax=180),e)}inverseTransform(e){return"point"===(e=e.clone()).type?(e.x<-this.tolerance&&(e.x+=360),e):(e.xmin<-this.tolerance&&(e.xmin+=360,e.xmax+=360),e)}clone(){return new s({tolerance:this.tolerance})}};(0,r.Cg)([(0,n.e)({GCSShiftXform:"gcs-shift"})],c.prototype,"type",void 0),(0,r.Cg)([(0,a.MZ)()],c.prototype,"tolerance",void 0),c=s=(0,r.Cg)([(0,o.$)("esri.layers.support.rasterTransforms.GCSShiftTransform")],c)},82371:(e,t,i)=>{i.d(t,{E9:()=>d,Tw:()=>h,X6:()=>p});var s=i(11254),r=i(5443),a=i(86738),n=i(16930),o=i(87186),l=i(20223),c=i(2272),u=i(22671);async function f(e,t,i){const f=(0,c.Dl)(e),{rasterFunction:h,sourceJSON:p}=t||{},d=h?JSON.stringify(h.rasterFunctionDefinition||h):null,m=(0,c.lF)({...f.query,renderingRule:d,f:"json"}),g=(0,c.jV)(m,i);e=f.path;const y=p||await(0,s.A)(e,g).then(e=>e.data),w=y.hasRasterAttributeTable?(0,s.A)(`${e}/rasterAttributeTable`,g):null,v=y.hasColormap?(0,s.A)(`${e}/colormap`,g):null,x=y.hasHistograms?(0,s.A)(`${e}/histograms`,g):null,b=y.currentVersion>=10.3?(0,s.A)(`${e}/keyProperties`,g):null,I=y.hasMultidimensions?(0,s.A)(`${e}/multidimensionalInfo`,g):null,C=await Promise.allSettled([w,v,x,b,I]);let S=null;if(y.minValues&&y.minValues.length===y.bandCount){S=[];for(let e=0;e<y.minValues.length;e++)S.push({min:y.minValues[e],max:y.maxValues[e],avg:y.meanValues[e],stddev:y.stdvValues[e]})}const A=r.A.fromJSON(y.extent),T=Math.ceil(A.width/y.pixelSizeX-.1),R=Math.ceil(A.height/y.pixelSizeY-.1),O=n.A.fromJSON(y.spatialReference||y.extent.spatialReference),M="fulfilled"===C[0].status?C[0].value?.data:null,_=M?.features?.length?u.A.fromJSON(M):null,F="fulfilled"===C[1].status?C[1].value?.data.colormap:null,P=F?.length?F:null,k="fulfilled"===C[2].status?C[2].value?.data.histograms:null,D=k?.[0]?.counts?.length?k:null,N="fulfilled"===C[3].status?C[3].value?.data??{}:{},L="fulfilled"===C[4].status?C[4].value?.data.multidimensionalInfo:null,E=L?.variables?.length?L:null;E&&E.variables.forEach(e=>{e.statistics?.length&&e.statistics.forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),e.dimensions?.forEach(e=>{"StdTime"!==e.name||e.recurring||e.unit||(e.unit="ISO8601")})});const{defaultVariable:B,serviceDataType:z}=y;B&&B!==N.DefaultVariable&&(N.DefaultVariable=B),z?.includes("esriImageServiceDataTypeVector")&&!z.includes(N.DataType)&&(N.DataType=z.replace("esriImageServiceDataType",""));let J=y.noDataValue;y.noDataValues?.length&&y.noDataValues.some(e=>e!==J)&&(J=y.noDataValues);const U=y.transposeInfo?new l.A({blockWidth:256,blockHeight:256,pyramidBlockWidth:256,pyramidBlockHeight:256,pyramidScalingFactor:2,compression:"lerc",origin:new a.A({x:y.extent.xmin,y:y.extent.ymax,spatialReference:O}),firstPyramidLevel:1,maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(T,R))/Math.LN2-8)),transposeInfo:y.transposeInfo}):void 0;return new o.A({width:T,height:R,bandCount:y.bandCount,extent:r.A.fromJSON(y.extent),spatialReference:O,pixelSize:new a.A({x:y.pixelSizeX,y:y.pixelSizeY,spatialReference:O}),pixelType:y.pixelType.toLowerCase(),statistics:S,attributeTable:_,colormap:P,histograms:D,keyProperties:N,noDataValue:J,multidimensionalInfo:E,storageInfo:U})}function h(e,t,i){return f(e,{sourceJSON:t},i)}function p(e,t,i){return f(e,{rasterFunction:t},i)}function d(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}},82434:(e,t,i)=>{i.d(t,{A:()=>o});var s=i(31635),r=i(25482),a=i(10107),n=(i(44208),i(53966),i(87811),i(64108));let o=class extends r.o{get affectsPixelSize(){return!1}forwardTransform(e){return e}inverseTransform(e){return e}};(0,s.Cg)([(0,a.MZ)()],o.prototype,"affectsPixelSize",null),(0,s.Cg)([(0,a.MZ)({json:{write:!0}})],o.prototype,"spatialReference",void 0),o=(0,s.Cg)([(0,n.$)("esri.layers.support.rasterTransforms.BaseRasterTransform")],o)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[146],{146:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var r=n(31635),i=n(49186),s=n(25728),l=n(76030),o=n(10107),a=(n(44208),n(53966),n(87811),n(64108)),u=n(4146),c=n(8303);let p=class extends((0,c.A)((0,s.P)(u.A))){constructor(e){super(e),this.resourceInfo=null,this.type="unknown"}initialize(){this.addResolvingPromise(new Promise((e,t)=>{(0,l._)(()=>{const e=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let n="Unknown layer type";e&&(n+=" "+e),t(new i.A("layer:unknown-layer-type",n,{layerType:e}))})}))}read(e,t){super.read({resourceInfo:e},t)}write(e,t){return null}};(0,r.Cg)([(0,o.MZ)({readOnly:!0})],p.prototype,"resourceInfo",void 0),(0,r.Cg)([(0,o.MZ)({type:["show","hide"]})],p.prototype,"listMode",void 0),(0,r.Cg)([(0,o.MZ)({json:{read:!1},readOnly:!0,value:"unknown"})],p.prototype,"type",void 0),p=(0,r.Cg)([(0,a.$)("esri.layers.UnknownLayer")],p);const f=p},159:(e,t,n)=>{n.d(t,{A:()=>u});var r,i=n(31635),s=n(69622),l=n(10107),o=(n(44208),n(53966),n(87811),n(64108)),a=n(99157);let u=r=class extends s.A{constructor(e){super(e),this.steps=[]}getInverse(){const e=new r;for(let t=this.steps.length-1;t>=0;t--){const n=this.steps[t];e.steps.push(n.getInverse())}return e}};(0,i.Cg)([(0,l.MZ)({type:[a.A],nonNullable:!0})],u.prototype,"steps",void 0),u=r=(0,i.Cg)([(0,o.$)("esri.geometry.operators.support.GeographicTransformation")],u)},8303:(e,t,n)=>{n.d(t,{A:()=>_});var r=n(31635),i=n(92602),s=n(70333),l=n(43773),o=n(60999),a=n(49186),u=n(53966),c=n(97768),p=n(74887),f=n(84952),h=n(10107),d=(n(44208),n(87811),n(36005)),g=n(64108),y=n(43937),m=n(77548),v=n(20655),w=n(80812),M=n(41318),I=n(10407);const _=e=>{const t=e;let _=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,c.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,n){if(t.itemId)return new w.default({id:t.itemId,portal:n?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:r}=await n.e(1204).then(n.bind(n,41204));return(0,p.Te)(t),await r({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,p.zf)(e)||u.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,p.QP)(e),!0)))}async setUserPrivileges(e,t){if(!i.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:n,fullEdit:r},content:{updateItem:i}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",n),this._set("userHasFullEditingPrivileges",r),this._set("userHasUpdateItemPrivileges",i)}catch(e){(0,p.QP)(e)}}async _fetchUserPrivileges(e,t){let n=this.portalItem;if(!e||!n||!n.loaded||n.sourceUrl)return this._fetchFallbackUserPrivileges(t);const r=!s.id?.findCredential(this.url),i=e===n.id;if(i&&n.portal.user)return this._getUserPrivileges(n,r);let l,o;if(i)l=n.portal.url;else try{l=await(0,m.wI)(this.url,t)}catch(e){(0,p.QP)(e)}if(!l||!(0,f.b8)(l,n.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;o=await(s.id?.getCredential(`${l}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,p.QP)(e)}const a=!0,u=!1,c=!1;if(!o)return{features:{edit:a,fullEdit:u},content:{updateItem:c}};try{if(i?await n.reload():(n=new w.default({id:e,portal:{url:l}}),await n.load(t)),n.portal.user)return this._getUserPrivileges(n,r)}catch(e){(0,p.QP)(e)}return{features:{edit:a,fullEdit:u},content:{updateItem:c}}}_getUserPrivileges(e,t){const n=(0,I.It)(e);return t&&(n.features.edit=!0),n}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,p.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?s.id?.findCredential(this.url):null;if(!t)return!0;const n=P.credential===t?P.user:await this._fetchEditingUser(e);return P.credential=t,P.user=n,null==n?.privileges||n.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const n=s.id?.findServerInfo(this.url??"");if(!n?.owningSystemUrl)return null;const r=`${n.owningSystemUrl}/sharing/rest`,i=v.A.getDefault();if(i&&i.loaded&&(0,f.S8)(i.restUrl)===(0,f.S8)(r))return i.user;const a=`${r}/community/self`,u=null!=e?e.signal:null,c=await(0,o.Ke)((0,l.A)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return c.ok?M.A.fromJSON(c.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const n=t?.portal,r=this.portalItem?.id&&(this.portalItem.portal||v.A.getDefault());return n&&r&&!(0,f.ut)(r.restUrl,n.restUrl)?(t.messages&&t.messages.push(new a.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,r.Cg)([(0,h.MZ)({type:w.default})],_.prototype,"portalItem",null),(0,r.Cg)([(0,d.w)("web-document","portalItem",["itemId"])],_.prototype,"readPortalItem",null),(0,r.Cg)([(0,y.K)("web-document","portalItem",{itemId:{type:String}})],_.prototype,"writePortalItem",null),(0,r.Cg)([(0,h.MZ)({clonable:!1})],_.prototype,"resourceReferences",void 0),(0,r.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],_.prototype,"userHasEditingPrivileges",void 0),(0,r.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],_.prototype,"userHasFullEditingPrivileges",void 0),(0,r.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],_.prototype,"userHasUpdateItemPrivileges",void 0),_=(0,r.Cg)([(0,g.$)("esri.layers.mixins.PortalLayer")],_),_},P={credential:null,user:null}},9762:(e,t,n)=>{n.r(t),n.d(t,{projectBuffer:()=>i});var r=n(37539);function i(e,t,n,i,s,l,o=Math.floor(e.length/3)){const a=(0,r.jd)(t,s);if(null==a)return!1;if(a===r.pO){if(e===i&&n===l)return!0;const t=n+3*o;for(let r=n,s=l;r<t;r++,s++)i[s]=e[r];return!0}const u=n+3*o;for(let t=n,r=l;t<u;t+=3,r+=3)a(e,t,i,r);return!0}},10407:(e,t,n)=>{n.d(t,{It:()=>h,LG:()=>l,OM:()=>u,Sm:()=>c,Y:()=>o,bK:()=>a,mm:()=>f,sQ:()=>p});var r=n(91218),i=n(16930),s=n(28735);function l(e,t){if(!o(e,t)){const n=e.typeKeywords;n?n.push(t):e.typeKeywords=[t]}}function o(e,t){return!!e.typeKeywords?.includes(t)}function a(e){return o(e,f.HOSTED_SERVICE)}function u(e,t){const n=e.typeKeywords;if(n){const e=n.indexOf(t);e>-1&&n.splice(e,1)}}function c(e,t,n){n?l(e,t):u(e,t)}async function p(e){const t=e.clone().normalize();let n;if(t.length>1)for(const e of t)n?e.width>n.width&&(n=e):n=e;else n=t[0];return async function(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,s.ci)(e);const n=i.A.WGS84;return await(0,r.initializeProjection)(t,n),(0,r.project)(e,n)}(n)}const f={CHARTS:"Charts",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery"};function h(e){const{portal:t,isOrgItem:n,itemControl:r}=e,i=t.user?.privileges;let s=!i||i.includes("features:user:edit"),l=!!n&&!!i?.includes("features:user:fullEdit");const o="update"===r||"admin"===r;return o?l=s=!0:l&&(s=!0),{features:{edit:s,fullEdit:l},content:{updateItem:o}}}},25728:(e,t,n)=>{n.d(t,{P:()=>v,L:()=>w});var r=n(31635),i=n(69622),s=n(76953),l=n(4718),o=n(35666);class a{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(o.AU),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new a,n=this._originStores[0];n&&n.forEach((e,n)=>{t.set(n,(0,l.o8)(e),0)});for(let n=2;n<o.AU;n++){const r=this._originStores[n];r&&r.forEach((r,i)=>{e&&e.has(i)||t.set(i,(0,l.o8)(r),n)})}return t}get(e,t){const n=void 0===t?this._values:this._originStores[t];return n?n.get(e):void 0}keys(e){const t=null==e?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,n=7){let r=this._originStores[n];if(r||(r=new Map,this._originStores[n]=r),r.set(e,t),!this._values.has(e)||this._propertyOriginMap.get(e)<=n){const r=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,n),r!==t}return!1}delete(e,t=7){const n=this._originStores[t];if(!n)return;const r=n.get(e);if(n.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let n=t-1;n>=0;n--){const t=this._originStores[n];if(t&&t.has(e)){this._values.set(e,t.get(e)),this._propertyOriginMap.set(e,n);break}}}return r}has(e,t){const n=void 0===t?this._values:this._originStores[t];return!!n&&n.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const n=this._originStores[t],r=n?.get(e),i=this._values.get(e);return this._values.set(e,r),this._propertyOriginMap.set(e,t),i!==r}originOf(e){return this._propertyOriginMap.get(e)||0}isAtOrigin(e,t){return this.has(e,t)&&this.originOf(e)===t}isBelowOrigin(e,t){return!this.has(e)||this.originOf(e)<t}forEach(e){this._values.forEach(e)}}var u=n(45917),c=n(88620),p=n(64108);const f=e=>{const t=e;let n=class extends t{constructor(...e){super(...e);const t=(0,c.oY)(this),n=t.store,r=new a;t.store=r,(0,s.k)(t,n,r)}read(e,t){(0,u.L)(this,e,t)}getAtOrigin(e,t){const n=h(this),r=(0,o.aB)(t);if("string"==typeof e)return n.get(e,r);const i={};return e.forEach(e=>{i[e]=n.get(e,r)}),i}originOf(e){return(0,o.OL)(this.originIdOf(e))}originIdOf(e){return h(this).originOf(e)}revert(e,t){const n=h(this),r=(0,o.aB)(t),i=(0,c.oY)(this);let s;s="string"==typeof e?"*"===e?n.keys(r):[e]:e,s.forEach(e=>{i.invalidate(e),n.revert(e,r),i.commit(e)})}};return n=(0,r.Cg)([(0,p.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],n),n};function h(e){return(0,c.oY)(e).store}f(i.A),n(53966),n(44208);var d=n(16649),g=(n(87811),n(49186),n(49422));const y=e=>{const t=e;let n=class extends t{constructor(...e){super(...e)}clear(e,t="user"){(0,c.oY)(this).clearOrigin(e,(0,o.aB)(t))}write(e,t){return(0,g.M)(this,e=e||{},t),e}setAtOrigin(e,t,n){(0,c.oY)(this).setAtOrigin(e,t,(0,o.aB)(n))}removeOrigin(e){const t=m(this),n=(0,o.aB)(e),r=t.keys(n);for(const e of r)t.originOf(e)===n&&t.set(e,t.get(e,n),7)}updateOrigin(e,t){const n=m(this),r=(0,o.aB)(t),i=(0,d.Jt)(this,e);for(let t=r+1;t<o.AU;++t)n.delete(e,t);n.set(e,i,r)}toJSON(e){return this.write({},e)}};return n=(0,r.Cg)([(0,p.$)("esri.core.WriteableMultiOriginJSONMixin")],n),n.prototype.toJSON.isDefaultToJSON=!0,n};function m(e){return(0,c.oY)(e).store}const v=e=>{const t=y(f(e));let n=class extends t{};return n=(0,r.Cg)([(0,p.$)("esri.core.MultiOriginJSONSupport")],n),n},w=v(i.A)},37539:(e,t,n)=>{n.d(t,{pO:()=>g,jd:()=>f,Tp:()=>h,w5:()=>p});var r=n(34727),i=n(83047),s=n(73941),l=n(79258);Math.PI;const o=l.$O.radius,a=l.$O.eccentricitySquared,u={a1:o*a,a2:o*a*o*a,a3:o*a*a/2,a4:o*a*o*a*2.5,a5:o*a+o*a*a/2,a6:1-a};l.$O.radius,l.$O.flattening,l.Sw.radius,l.Sw.flattening,l.sH.radius,l.sH.flattening,l.sH.radius;var c=n(21325);const p={2:{5:g,7:null,9:null,10:g,1:P,6:null,8:null,0:null,3:m,11:v,2:g,4:E},5:{5:g,7:null,9:null,10:g,1:P,6:null,8:null,0:null,3:m,11:v,2:g,4:E},7:{5:null,7:g,9:null,10:g,1:null,6:_,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:g,10:g,1:null,6:null,8:I,0:null,3:null,11:null,2:null,4:null},3:{5:y,7:null,9:null,10:y,1:function(e,t,n,r){const i=e[t]/T,s=L-2*Math.atan(Math.exp(-e[t+1]/T)),l=T+e[t+2],o=Math.cos(s)*l;n[r]=Math.cos(i)*o,n[r+1]=Math.sin(i)*o,n[r+2]=Math.sin(s)*l},6:null,8:null,0:null,3:g,11:function(e,t,n,r){y(e,t,n,r),v(n,r,n,r)},2:y,4:function(e,t,n,r){y(e,t,n,r),E(n,r,n,r)}},4:{5:x,7:null,9:null,10:x,1:function(e,t,n,r){x(e,t,n,r),P(n,r,n,r)},6:null,8:null,0:null,3:function(e,t,n,r){x(e,t,n,r),m(n,r,n,r)},11:function(e,t,n,r){x(e,t,n,r),v(n,r,n,r)},2:x,4:g},1:{5:S,7:null,9:null,10:S,1:g,6:null,8:null,0:null,3:function(e,t,n,r){S(e,t,n,r),m(n,r,n,r)},11:function(e,t,n,r){S(e,t,n,r),v(n,r,n,r)},2:S,4:function(e,t,n,r){S(e,t,n,r),E(n,r,n,r)}},6:{5:null,7:A,9:null,10:A,1:null,6:g,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:O,10:O,1:null,6:null,8:g,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:g,3:null,11:null,2:null,4:null},10:{5:g,7:g,9:g,10:g,1:P,6:_,8:I,0:null,3:m,11:v,2:g,4:E},11:{5:w,7:null,9:null,10:w,1:function(e,t,n,r){w(e,t,n,r),P(n,r,n,r)},6:null,8:null,0:null,3:function(e,t,n,r){w(e,t,n,r),m(n,r,n,r)},11:g,2:w,4:function(e,t,n,r){w(e,t,n,r),E(n,r,n,r)}}};function f(e,t){return h(e,t)?.projector}function h(e,t){if(null==e||null==t)return null;if(C.source.spatialReference===e&&C.dest.spatialReference===t)return C;const n=d(e,C.source),r=d(t,C.dest);return 0===n&&0===r?(0,c.aI)(e,t)?C.projector=g:C.projector=null:C.projector=p[n][r],C}function d(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,i.GA)(e,1)),(0,s.jA)(e)?t.spatialReferenceId=1:(0,c.oT)(e)?t.spatialReferenceId=2:(0,c.K8)(e)?t.spatialReferenceId=3:(0,c.r1)(e)?t.spatialReferenceId=11:e.wkt===s.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===s.FY.wkt?t.spatialReferenceId=6:e.wkt===s.LJ.wkt?t.spatialReferenceId=8:(0,c.q8)(e)?t.spatialReferenceId=7:(0,c.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function g(e,t,n,r){e!==n&&(n[r++]=e[t++],n[r++]=e[t++],n[r]=e[t])}function y(e,t,n,r){n[r]=b*(e[t]/T),n[r+1]=b*(L-2*Math.atan(Math.exp(-e[t+1]/T))),n[r+2]=e[t+2]}function m(e,t,n,i){!function(e,t,n,i,s){const l=.4999999*Math.PI,o=(0,r.qE)(k*e[t+1],-l,l),a=Math.sin(o);n[i++]=k*e[t]*s.radius,n[i++]=s.halfSemiMajorAxis*Math.log((1+a)/(1-a)),n[i]=e[t+2]}(e,t,n,i,l.$O)}function v(e,t,n,r){n[r]=e[t]*U,n[r+1]=e[t+1]*U,n[r+2]=e[t+2]}function w(e,t,n,r){n[r]=e[t]*j,n[r+1]=e[t+1]*j,n[r+2]=e[t+2]}function M(e,t,n,r,i){const s=i+e[t+2],l=k*e[t+1],o=k*e[t],a=Math.cos(l)*s;n[r]=Math.cos(o)*a,n[r+1]=Math.sin(o)*a,n[r+2]=Math.sin(l)*s}function I(e,t,n,r){M(e,t,n,r,l.Sw.radius)}function _(e,t,n,r){M(e,t,n,r,l.sH.radius)}function P(e,t,n,r){M(e,t,n,r,l.$O.radius)}function R(e,t,n,i,s){const l=e[t],o=e[t+1],a=e[t+2],u=Math.sqrt(l*l+o*o+a*a),c=(0,r.YN)(a/(0===u?1:u)),p=Math.atan2(o,l);n[i++]=b*p,n[i++]=b*c,n[i]=u-s}function O(e,t,n,r){R(e,t,n,r,l.Sw.radius)}function A(e,t,n,r){R(e,t,n,r,l.sH.radius)}function S(e,t,n,r){R(e,t,n,r,l.$O.radius)}function E(e,t,n,r){!function(e,t,n,r,i){const s=k*e[t],l=k*e[t+1],o=e[t+2],a=Math.sin(l),u=Math.cos(l),c=i.radius/Math.sqrt(1-i.eccentricitySquared*a*a);n[r++]=(c+o)*u*Math.cos(s),n[r++]=(c+o)*u*Math.sin(s),n[r++]=(c*(1-i.eccentricitySquared)+o)*a}(e,t,n,r,l.$O)}function x(e,t,n,r){const i=u,s=e[t],o=e[t+1],a=e[t+2];let c,p,f,h,d,g,y,m,v,w,M,I,_,P,R,O,A,S,E,x,C;c=Math.abs(a),p=s*s+o*o,f=Math.sqrt(p),h=p+a*a,d=Math.sqrt(h),x=Math.atan2(o,s),g=a*a/h,y=p/h,P=i.a2/d,R=i.a3-i.a4/d,y>.3?(m=c/d*(1+y*(i.a1+P+g*R)/d),E=Math.asin(m),w=m*m,v=Math.sqrt(1-w)):(v=f/d*(1-g*(i.a5-P-y*R)/d),E=Math.acos(v),w=1-v*v,m=Math.sqrt(w)),M=1-l.$O.eccentricitySquared*w,I=l.$O.radius/Math.sqrt(M),_=i.a6*I,P=f-I*v,R=c-_*m,A=v*P+m*R,O=v*R-m*P,S=O/(_/M+A),E+=S,C=A+O*S/2,a<0&&(E=-E),n[r++]=b*x,n[r++]=b*E,n[r]=C}const C={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:g},k=(0,r.kU)(1),b=(0,r.KJ)(1),L=.5*Math.PI,T=l.$O.radius,U=T*Math.PI/180,j=180/(T*Math.PI)},60999:(e,t,n)=>{n.d(t,{DZ:()=>d,Ke:()=>h,Tj:()=>c,UT:()=>g,aD:()=>m,jJ:()=>u});var r=n(31635),i=n(69622),s=n(97768),l=n(74887),o=n(10107),a=n(64108);function u(e,t,n){return(0,l.Lx)(e.map((e,r)=>t.apply(n,[e,r])))}async function c(e,t,n){return(await(0,l.Lx)(e.map((e,r)=>t.apply(n,[e,r])))).map(e=>e.value)}function p(e){return{ok:!0,value:e}}function f(e){return{ok:!1,error:e}}async function h(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return p(await e)}catch(e){return f(e)}}async function d(e){try{return p(await e)}catch(e){return(0,l.QP)(e),f(e)}}function g(e,t){return new y(e,t)}let y=class extends i.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,s.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:n}=this._abortController;this.promise=e(n),this.promise.then(e=>{this._result=p(e),this._cleanup()},e=>{this._result=f(e),this._cleanup()}),this._abortHandle=(0,l.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,s.xt)(this._abortHandle),this._abortController=null}};(0,r.Cg)([(0,o.MZ)()],y.prototype,"value",null),(0,r.Cg)([(0,o.MZ)()],y.prototype,"error",null),(0,r.Cg)([(0,o.MZ)()],y.prototype,"finished",null),(0,r.Cg)([(0,o.MZ)()],y.prototype,"promise",void 0),(0,r.Cg)([(0,o.MZ)()],y.prototype,"_result",void 0),y=(0,r.Cg)([(0,a.$)("esri.core.asyncUtils.ReactiveTask")],y);class m{constructor(){this._sequence=Promise.resolve()}async acquire(){let e;this._sequence=new Promise(t=>{e=this._sequence.then(()=>t,()=>t)});const t=await e;return{[Symbol.dispose]:t}}async run(e){const t={stack:[],error:void 0,hasError:!1};try{return(0,r.mS)(t,await this.acquire(),!1),await e()}catch(e){t.error=e,t.hasError=!0}finally{(0,r.hk)(t)}}}},62815:(e,t,n)=>{n.d(t,{N:()=>l});var r=n(83047),i=n(73941),s=n(21325);function l(e,t,n){if(null==t||null==n||n.vcsWkid||(0,s.aI)(t,n)||(0,i.xP)(t)||(0,i.xP)(n))return null;const l=(0,r.G9)(t)/(0,r.G9)(n);if(1===l)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,l);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const n of e.paths)for(const e of n)e.length>2&&(e[2]*=t)}(e,l);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const n of e.rings)for(const e of n)e.length>2&&(e[2]*=t)}(e,l);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const n of e.points)n.length>2&&(n[2]*=t)}(e,l);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,l);default:return null}}},91218:(e,t,n)=>{n.r(t),n.d(t,{canProjectWithoutEngine:()=>Y,initializeProjection:()=>N,isEqualBaseGCS:()=>D,isLoaded:()=>C,isLoadedOrLoad:()=>k,isLoadedOrLoadFor:()=>b,load:()=>T,project:()=>U,projectExtent:()=>ne,projectMany:()=>j,projectMultipoint:()=>F,projectOrLoad:()=>Z,projectOrLoadMany:()=>G,projectPoint:()=>K,projectPolygon:()=>ee,projectPolyline:()=>V,projectWithZConversion:()=>q,projectWithoutEngine:()=>J,requiresLoad:()=>L,test:()=>z,tryProjectWithZConversion:()=>B,unload:()=>H});var r=n(49186),i=n(74887),s=n(62788),l=n(95488),o=n(51850),a=n(21276),u=n(73941),c=n(5443),p=n(91075),f=n(48526),h=n(86738),d=n(39829),g=n(82799),y=n(16930),m=n(159),v=n(9762),w=n(37539);function M(e,t,n,r,i,s){return I[0]=e,I[1]=t,I[2]=n,(0,v.projectBuffer)(I,r,0,i,s,0)}const I=(0,o.vt)();var _=n(21325),P=n(62815);let R=null,O=null,A=null,S=null,E={};const x=new l.I;function C(){return!!(O?.isLoaded()&&A?.isLoaded()&&S?.isLoaded())}function k(){return!!C()||((0,s.gc)(x),T(),!1)}function b(e,t){return!e||!t||Y(e,t)||k()}function L(e,t){return!Y(e,t)&&!C()}async function T(e){null==R&&(R=Promise.all([n.e(3276).then(n.bind(n,83276)).then(e=>(O=e,O.load())),n.e(8377).then(n.bind(n,8377)).then(e=>(A=e,A.load())),n.e(2158).then(n.bind(n,12158)).then(e=>(S=e,S.load()))])),await R,(0,i.Te)(e),x.notify()}function U(e,t,n){return Array.isArray(e)?0===e.length?[]:((0,a.H)(e),j(e,e[0].spatialReference,t,n)):((0,a.f)(e),j([e],e.spatialReference,t,n)[0])}function j(e,t,n,r){if(null==t||null==n)return e;if(Y(t,n,r))return e.map(e=>J(e,t,n));if(null==r?.geographicTransformation&&(0,u.jA)(t))return e.map(e=>J(e,t,y.A.WGS84)).map(e=>B(e,n));if(null==r?.geographicTransformation&&(0,u.jA)(n))return e.map(e=>B(e,y.A.WGS84)).map(e=>J(e,y.A.WGS84,n));if(!C())throw new $;if(!r?.geographicTransformation)if(r?.extendedParams)r={...r,geographicTransformation:S.getTransformation(t,n,r.areaOfInterestExtent)||new m.A};else if(!r?.areaOfInterestExtent){const e=function(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}(t,n);let i=E[e];i||(i=S.getTransformation(t,n)||new m.A,E[e]=i),r={geographicTransformation:i}}return e[0].spatialReference||(e[0].spatialReference=t),e[0]instanceof p.A?O.executeMany(e,n,r):A.executeMany(e,n,r)}function Z(e,t){const n=G([e],t);return null!=n.pending?{pending:n.pending,geometry:null}:null!=n.geometries?{pending:null,geometry:n.geometries[0]}:{pending:null,geometry:null}}function G(e,t){if(!C())for(const n of e)if(null!=n&&!(0,_.aI)(n.spatialReference,t)&&(0,_.fn)(n.spatialReference)&&(0,_.fn)(t)&&!Y(n.spatialReference,t))return(0,s.gc)(x),{pending:T(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,_.aI)(e.spatialReference,t)?e:(0,_.fn)(e.spatialReference)&&(0,_.fn)(t)?B(e,t):null)}}class $ extends r.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function H(){R=null,O=null,A=null,S=null,E={}}const z={get loadPromise(){return R}};function B(e,t){try{const n=U(e,t);if(null==n)return null;"xmin"in e&&"xmin"in n&&(n.zmin=e.zmin,n.zmax=e.zmax);const r=(0,P.N)(n.type,e.spatialReference,t);return null!=r&&r(n),n}catch(e){if(!(e instanceof $))throw e;return null}}async function q(e,t,n){const r=e.spatialReference;return null!=r&&null!=t&&await N(r,t,null,n),B(e,t)}function Y(e,t,n){return!(n?.areaOfInterestExtent||n?.extendedParams||n?.geographicTransformation)&&(!!(0,_.aI)(e,t)||(0,_.fn)(e)&&(0,_.fn)(t)&&!!(0,w.jd)(e,t))}function D(e,t){if((0,_.aI)(e,t))return!0;if(!(0,_.fn)(e)||!(0,_.fn)(t))return!1;const n=(0,_.oT)(e)||(0,_.K8)(e)||(0,_.x1)(e),r=(0,_.oT)(t)||(0,_.K8)(t)||(0,_.x1)(t);return n&&r}async function N(e,t,n,r){if(C())return(0,i.NO)(r);if(Array.isArray(e)){for(const{source:t,dest:n,options:i}of e)if(t&&n&&!Y(t,n,i))return T(r)}else if(e&&t&&!Y(e,t,n))return T(r);return(0,i.NO)(r)}function J(e,t,n){return e?"x"in e?W(e,t,new h.A,n,0):"xmin"in e?re(e,t,new c.A,n,0):"rings"in e?te(e,t,new d.A,n,0):"paths"in e?X(e,t,new g.A,n,0):"points"in e?Q(e,t,new f.A,n,0):null:null}function K(e,t,n=t.spatialReference,r=0){return null!=n&&null!=e.spatialReference&&null!=W(e,e.spatialReference,t,n,r)}function W(e,t,n,r,i){se[0]=e.x,se[1]=e.y;const s=e.z;return se[2]=void 0!==s?s:i,(0,v.projectBuffer)(se,t,0,se,r,0)?(n.x=se[0],n.y=se[1],n.spatialReference=r,void 0!==s||(0,u.xP)(r)?(n.z=se[2],n.hasZ=!0):(n.z=void 0,n.hasZ=!1),void 0===e.m?(n.m=void 0,n.hasM=!1):(n.m=e.m,n.hasM=!0),n):null}function F(e,t,n=t.spatialReference,r=0){return null!=e.spatialReference&&null!=n&&null!=Q(e,e.spatialReference,t,n,r)}function Q(e,t,n,r,i){const{points:s,hasZ:l,hasM:o}=e,a=[],c=s.length,p=[];for(const e of s)p.push(e[0],e[1],l?e[2]:i);if(!(0,v.projectBuffer)(p,t,0,p,r,0,c))return null;const f=l||(0,u.xP)(r);for(let e=0;e<c;++e){const t=3*e,n=p[t],r=p[t+1];f&&o?a.push([n,r,p[t+2],s[e][3]]):f?a.push([n,r,p[t+2]]):o?a.push([n,r,s[e][2]]):a.push([n,r])}return n.points=a,n.spatialReference=r,n.hasZ=l,n.hasM=o,n}function V(e,t,n=t.spatialReference,r=0){return null!=e.spatialReference&&null!=n&&null!=X(e,e.spatialReference,t,n,r)}function X(e,t,n,r,i){const{paths:s,hasZ:l,hasM:o}=e,a=[];if(!ie(s,l??!1,o??!1,t,a,r,i))return null;const c=l||(0,u.xP)(r);return n.paths=a,n.spatialReference=r,n.hasZ=c,n.hasM=o,n}function ee(e,t,n=t.spatialReference,r=0){return null!=e.spatialReference&&null!=n&&null!=te(e,e.spatialReference,t,n,r)}function te(e,t,n,r,i){const{rings:s,hasZ:l,hasM:o}=e,a=[];if(!ie(s,l??!1,o??!1,t,a,r,i))return null;const c=l||(0,u.xP)(r);return n.rings=a,n.spatialReference=r,n.hasZ=c,n.hasM=o,n}function ne(e,t,n=t.spatialReference,r=0){return null!=e.spatialReference&&null!=n&&null!=re(e,e.spatialReference,t,n,r)}function re(e,t,n,r,i){const{xmin:s,ymin:l,xmax:o,ymax:a,hasZ:c,hasM:p}=e;if(!M(s,l,c?e.zmin:i,t,se,r))return null;const f=c||(0,u.xP)(r);return n.xmin=se[0],n.ymin=se[1],f&&(n.zmin=se[2]),M(o,a,c?e.zmax:i,t,se,r)?(n.xmax=se[0],n.ymax=se[1],f&&(n.zmax=se[2]),p&&(n.mmin=e.mmin,n.mmax=e.mmax),n.spatialReference=r,n):null}function ie(e,t,n,r,i,s,l=0){const o=new Array;for(const n of e)for(const e of n)o.push(e[0],e[1],t?e[2]:l);if(!(0,v.projectBuffer)(o,r,0,o,s,0))return!1;let a=0;i.length=0;const c=t||(0,u.xP)(s);for(const t of e){const e=new Array;for(const r of t)c&&n?e.push([o[a++],o[a++],o[a++],r[3]]):c?e.push([o[a++],o[a++],o[a++]]):n?(e.push([o[a++],o[a++],r[2]]),a++):(e.push([o[a++],o[a++]]),a++);i.push(e)}return!0}const se=(0,o.vt)()},99157:(e,t,n)=>{n.d(t,{A:()=>a});var r,i=n(31635),s=n(69622),l=n(10107),o=(n(44208),n(53966),n(87811),n(64108));let a=r=class extends s.A{constructor(e){super(e),this.isInverse=!1,this.wkt=null,this.wkid=null}getInverse(){return new r({isInverse:!this.isInverse,wkid:this.wkid,wkt:this.wkt})}};(0,i.Cg)([(0,l.MZ)()],a.prototype,"isInverse",void 0),(0,i.Cg)([(0,l.MZ)()],a.prototype,"wkt",void 0),(0,i.Cg)([(0,l.MZ)()],a.prototype,"wkid",void 0),a=r=(0,i.Cg)([(0,o.$)("esri.geometry.operators.support.GeographicTransformationStep")],a)}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[146],{146:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var r=n(31635),i=n(49186),s=n(25728),l=n(76030),o=n(10107),a=(n(44208),n(53966),n(87811),n(64108)),u=n(4146),c=n(8303);let p=class extends((0,c.A)((0,s.P)(u.A))){constructor(e){super(e),this.resourceInfo=null,this.type="unknown"}initialize(){this.addResolvingPromise(new Promise((e,t)=>{(0,l._)(()=>{const e=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let n="Unknown layer type";e&&(n+=" "+e),t(new i.A("layer:unknown-layer-type",n,{layerType:e}))})}))}read(e,t){super.read({resourceInfo:e},t)}write(e,t){return null}};(0,r.Cg)([(0,o.MZ)({readOnly:!0})],p.prototype,"resourceInfo",void 0),(0,r.Cg)([(0,o.MZ)({type:["show","hide"]})],p.prototype,"listMode",void 0),(0,r.Cg)([(0,o.MZ)({json:{read:!1},readOnly:!0,value:"unknown"})],p.prototype,"type",void 0),p=(0,r.Cg)([(0,a.$)("esri.layers.UnknownLayer")],p);const f=p},159:(e,t,n)=>{n.d(t,{A:()=>u});var r,i=n(31635),s=n(69622),l=n(10107),o=(n(44208),n(53966),n(87811),n(64108)),a=n(99157);let u=r=class extends s.A{constructor(e){super(e),this.steps=[]}getInverse(){const e=new r;for(let t=this.steps.length-1;t>=0;t--){const n=this.steps[t];e.steps.push(n.getInverse())}return e}};(0,i.Cg)([(0,l.MZ)({type:[a.A],nonNullable:!0})],u.prototype,"steps",void 0),u=r=(0,i.Cg)([(0,o.$)("esri.geometry.operators.support.GeographicTransformation")],u)},8303:(e,t,n)=>{n.d(t,{A:()=>_});var r=n(31635),i=n(92602),s=n(70333),l=n(11254),o=n(60999),a=n(49186),u=n(53966),c=n(97768),p=n(74887),f=n(84952),h=n(10107),d=(n(44208),n(87811),n(36005)),g=n(64108),y=n(43937),m=n(77548),v=n(20655),w=n(80812),M=n(41318),I=n(10407);const _=e=>{const t=e;let _=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,c.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,n){if(t.itemId)return new w.default({id:t.itemId,portal:n?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:r}=await n.e(1204).then(n.bind(n,41204));return(0,p.Te)(t),await r({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,p.zf)(e)||u.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,p.QP)(e),!0)))}async setUserPrivileges(e,t){if(!i.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:n,fullEdit:r},content:{updateItem:i}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",n),this._set("userHasFullEditingPrivileges",r),this._set("userHasUpdateItemPrivileges",i)}catch(e){(0,p.QP)(e)}}async _fetchUserPrivileges(e,t){let n=this.portalItem;if(!e||!n||!n.loaded||n.sourceUrl)return this._fetchFallbackUserPrivileges(t);const r=!s.id?.findCredential(this.url),i=e===n.id;if(i&&n.portal.user)return this._getUserPrivileges(n,r);let l,o;if(i)l=n.portal.url;else try{l=await(0,m.wI)(this.url,t)}catch(e){(0,p.QP)(e)}if(!l||!(0,f.b8)(l,n.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;o=await(s.id?.getCredential(`${l}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,p.QP)(e)}const a=!0,u=!1,c=!1;if(!o)return{features:{edit:a,fullEdit:u},content:{updateItem:c}};try{if(i?await n.reload():(n=new w.default({id:e,portal:{url:l}}),await n.load(t)),n.portal.user)return this._getUserPrivileges(n,r)}catch(e){(0,p.QP)(e)}return{features:{edit:a,fullEdit:u},content:{updateItem:c}}}_getUserPrivileges(e,t){const n=(0,I.It)(e);return t&&(n.features.edit=!0),n}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,p.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?s.id?.findCredential(this.url):null;if(!t)return!0;const n=P.credential===t?P.user:await this._fetchEditingUser(e);return P.credential=t,P.user=n,null==n?.privileges||n.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const n=s.id?.findServerInfo(this.url??"");if(!n?.owningSystemUrl)return null;const r=`${n.owningSystemUrl}/sharing/rest`,i=v.A.getDefault();if(i&&i.loaded&&(0,f.S8)(i.restUrl)===(0,f.S8)(r))return i.user;const a=`${r}/community/self`,u=null!=e?e.signal:null,c=await(0,o.Ke)((0,l.A)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return c.ok?M.A.fromJSON(c.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const n=t?.portal,r=this.portalItem?.id&&(this.portalItem.portal||v.A.getDefault());return n&&r&&!(0,f.ut)(r.restUrl,n.restUrl)?(t.messages&&t.messages.push(new a.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,r.Cg)([(0,h.MZ)({type:w.default})],_.prototype,"portalItem",null),(0,r.Cg)([(0,d.w)("web-document","portalItem",["itemId"])],_.prototype,"readPortalItem",null),(0,r.Cg)([(0,y.K)("web-document","portalItem",{itemId:{type:String}})],_.prototype,"writePortalItem",null),(0,r.Cg)([(0,h.MZ)({clonable:!1})],_.prototype,"resourceReferences",void 0),(0,r.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],_.prototype,"userHasEditingPrivileges",void 0),(0,r.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],_.prototype,"userHasFullEditingPrivileges",void 0),(0,r.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],_.prototype,"userHasUpdateItemPrivileges",void 0),_=(0,r.Cg)([(0,g.$)("esri.layers.mixins.PortalLayer")],_),_},P={credential:null,user:null}},9762:(e,t,n)=>{n.r(t),n.d(t,{projectBuffer:()=>i});var r=n(37539);function i(e,t,n,i,s,l,o=Math.floor(e.length/3)){const a=(0,r.jd)(t,s);if(null==a)return!1;if(a===r.pO){if(e===i&&n===l)return!0;const t=n+3*o;for(let r=n,s=l;r<t;r++,s++)i[s]=e[r];return!0}const u=n+3*o;for(let t=n,r=l;t<u;t+=3,r+=3)a(e,t,i,r);return!0}},10407:(e,t,n)=>{n.d(t,{It:()=>h,LG:()=>l,OM:()=>u,Sm:()=>c,Y:()=>o,bK:()=>a,mm:()=>f,sQ:()=>p});var r=n(91218),i=n(16930),s=n(28735);function l(e,t){if(!o(e,t)){const n=e.typeKeywords;n?n.push(t):e.typeKeywords=[t]}}function o(e,t){return!!e.typeKeywords?.includes(t)}function a(e){return o(e,f.HOSTED_SERVICE)}function u(e,t){const n=e.typeKeywords;if(n){const e=n.indexOf(t);e>-1&&n.splice(e,1)}}function c(e,t,n){n?l(e,t):u(e,t)}async function p(e){const t=e.clone().normalize();let n;if(t.length>1)for(const e of t)n?e.width>n.width&&(n=e):n=e;else n=t[0];return async function(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,s.ci)(e);const n=i.A.WGS84;return await(0,r.initializeProjection)(t,n),(0,r.project)(e,n)}(n)}const f={CHARTS:"Charts",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery"};function h(e){const{portal:t,isOrgItem:n,itemControl:r}=e,i=t.user?.privileges;let s=!i||i.includes("features:user:edit"),l=!!n&&!!i?.includes("features:user:fullEdit");const o="update"===r||"admin"===r;return o?l=s=!0:l&&(s=!0),{features:{edit:s,fullEdit:l},content:{updateItem:o}}}},25728:(e,t,n)=>{n.d(t,{P:()=>v,L:()=>w});var r=n(31635),i=n(69622),s=n(76953),l=n(4718),o=n(35666);class a{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(o.AU),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new a,n=this._originStores[0];n&&n.forEach((e,n)=>{t.set(n,(0,l.o8)(e),0)});for(let n=2;n<o.AU;n++){const r=this._originStores[n];r&&r.forEach((r,i)=>{e&&e.has(i)||t.set(i,(0,l.o8)(r),n)})}return t}get(e,t){const n=void 0===t?this._values:this._originStores[t];return n?n.get(e):void 0}keys(e){const t=null==e?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,n=7){let r=this._originStores[n];if(r||(r=new Map,this._originStores[n]=r),r.set(e,t),!this._values.has(e)||this._propertyOriginMap.get(e)<=n){const r=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,n),r!==t}return!1}delete(e,t=7){const n=this._originStores[t];if(!n)return;const r=n.get(e);if(n.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let n=t-1;n>=0;n--){const t=this._originStores[n];if(t&&t.has(e)){this._values.set(e,t.get(e)),this._propertyOriginMap.set(e,n);break}}}return r}has(e,t){const n=void 0===t?this._values:this._originStores[t];return!!n&&n.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const n=this._originStores[t],r=n?.get(e),i=this._values.get(e);return this._values.set(e,r),this._propertyOriginMap.set(e,t),i!==r}originOf(e){return this._propertyOriginMap.get(e)||0}isAtOrigin(e,t){return this.has(e,t)&&this.originOf(e)===t}isBelowOrigin(e,t){return!this.has(e)||this.originOf(e)<t}forEach(e){this._values.forEach(e)}}var u=n(45917),c=n(88620),p=n(64108);const f=e=>{const t=e;let n=class extends t{constructor(...e){super(...e);const t=(0,c.oY)(this),n=t.store,r=new a;t.store=r,(0,s.k)(t,n,r)}read(e,t){(0,u.L)(this,e,t)}getAtOrigin(e,t){const n=h(this),r=(0,o.aB)(t);if("string"==typeof e)return n.get(e,r);const i={};return e.forEach(e=>{i[e]=n.get(e,r)}),i}originOf(e){return(0,o.OL)(this.originIdOf(e))}originIdOf(e){return h(this).originOf(e)}revert(e,t){const n=h(this),r=(0,o.aB)(t),i=(0,c.oY)(this);let s;s="string"==typeof e?"*"===e?n.keys(r):[e]:e,s.forEach(e=>{i.invalidate(e),n.revert(e,r),i.commit(e)})}};return n=(0,r.Cg)([(0,p.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],n),n};function h(e){return(0,c.oY)(e).store}f(i.A),n(53966),n(44208);var d=n(16649),g=(n(87811),n(49186),n(49422));const y=e=>{const t=e;let n=class extends t{constructor(...e){super(...e)}clear(e,t="user"){(0,c.oY)(this).clearOrigin(e,(0,o.aB)(t))}write(e,t){return(0,g.M)(this,e=e||{},t),e}setAtOrigin(e,t,n){(0,c.oY)(this).setAtOrigin(e,t,(0,o.aB)(n))}removeOrigin(e){const t=m(this),n=(0,o.aB)(e),r=t.keys(n);for(const e of r)t.originOf(e)===n&&t.set(e,t.get(e,n),7)}updateOrigin(e,t){const n=m(this),r=(0,o.aB)(t),i=(0,d.Jt)(this,e);for(let t=r+1;t<o.AU;++t)n.delete(e,t);n.set(e,i,r)}toJSON(e){return this.write({},e)}};return n=(0,r.Cg)([(0,p.$)("esri.core.WriteableMultiOriginJSONMixin")],n),n.prototype.toJSON.isDefaultToJSON=!0,n};function m(e){return(0,c.oY)(e).store}const v=e=>{const t=y(f(e));let n=class extends t{};return n=(0,r.Cg)([(0,p.$)("esri.core.MultiOriginJSONSupport")],n),n},w=v(i.A)},37539:(e,t,n)=>{n.d(t,{pO:()=>g,jd:()=>f,Tp:()=>h,w5:()=>p});var r=n(34727),i=n(83047),s=n(73941),l=n(79258);Math.PI;const o=l.$O.radius,a=l.$O.eccentricitySquared,u={a1:o*a,a2:o*a*o*a,a3:o*a*a/2,a4:o*a*o*a*2.5,a5:o*a+o*a*a/2,a6:1-a};l.$O.radius,l.$O.flattening,l.Sw.radius,l.Sw.flattening,l.sH.radius,l.sH.flattening,l.sH.radius;var c=n(21325);const p={2:{5:g,7:null,9:null,10:g,1:P,6:null,8:null,0:null,3:m,11:v,2:g,4:E},5:{5:g,7:null,9:null,10:g,1:P,6:null,8:null,0:null,3:m,11:v,2:g,4:E},7:{5:null,7:g,9:null,10:g,1:null,6:_,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:g,10:g,1:null,6:null,8:I,0:null,3:null,11:null,2:null,4:null},3:{5:y,7:null,9:null,10:y,1:function(e,t,n,r){const i=e[t]/T,s=L-2*Math.atan(Math.exp(-e[t+1]/T)),l=T+e[t+2],o=Math.cos(s)*l;n[r]=Math.cos(i)*o,n[r+1]=Math.sin(i)*o,n[r+2]=Math.sin(s)*l},6:null,8:null,0:null,3:g,11:function(e,t,n,r){y(e,t,n,r),v(n,r,n,r)},2:y,4:function(e,t,n,r){y(e,t,n,r),E(n,r,n,r)}},4:{5:x,7:null,9:null,10:x,1:function(e,t,n,r){x(e,t,n,r),P(n,r,n,r)},6:null,8:null,0:null,3:function(e,t,n,r){x(e,t,n,r),m(n,r,n,r)},11:function(e,t,n,r){x(e,t,n,r),v(n,r,n,r)},2:x,4:g},1:{5:S,7:null,9:null,10:S,1:g,6:null,8:null,0:null,3:function(e,t,n,r){S(e,t,n,r),m(n,r,n,r)},11:function(e,t,n,r){S(e,t,n,r),v(n,r,n,r)},2:S,4:function(e,t,n,r){S(e,t,n,r),E(n,r,n,r)}},6:{5:null,7:A,9:null,10:A,1:null,6:g,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:O,10:O,1:null,6:null,8:g,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:g,3:null,11:null,2:null,4:null},10:{5:g,7:g,9:g,10:g,1:P,6:_,8:I,0:null,3:m,11:v,2:g,4:E},11:{5:w,7:null,9:null,10:w,1:function(e,t,n,r){w(e,t,n,r),P(n,r,n,r)},6:null,8:null,0:null,3:function(e,t,n,r){w(e,t,n,r),m(n,r,n,r)},11:g,2:w,4:function(e,t,n,r){w(e,t,n,r),E(n,r,n,r)}}};function f(e,t){return h(e,t)?.projector}function h(e,t){if(null==e||null==t)return null;if(C.source.spatialReference===e&&C.dest.spatialReference===t)return C;const n=d(e,C.source),r=d(t,C.dest);return 0===n&&0===r?(0,c.aI)(e,t)?C.projector=g:C.projector=null:C.projector=p[n][r],C}function d(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,i.GA)(e,1)),(0,s.jA)(e)?t.spatialReferenceId=1:(0,c.oT)(e)?t.spatialReferenceId=2:(0,c.K8)(e)?t.spatialReferenceId=3:(0,c.r1)(e)?t.spatialReferenceId=11:e.wkt===s.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===s.FY.wkt?t.spatialReferenceId=6:e.wkt===s.LJ.wkt?t.spatialReferenceId=8:(0,c.q8)(e)?t.spatialReferenceId=7:(0,c.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function g(e,t,n,r){e!==n&&(n[r++]=e[t++],n[r++]=e[t++],n[r]=e[t])}function y(e,t,n,r){n[r]=b*(e[t]/T),n[r+1]=b*(L-2*Math.atan(Math.exp(-e[t+1]/T))),n[r+2]=e[t+2]}function m(e,t,n,i){!function(e,t,n,i,s){const l=.4999999*Math.PI,o=(0,r.qE)(k*e[t+1],-l,l),a=Math.sin(o);n[i++]=k*e[t]*s.radius,n[i++]=s.halfSemiMajorAxis*Math.log((1+a)/(1-a)),n[i]=e[t+2]}(e,t,n,i,l.$O)}function v(e,t,n,r){n[r]=e[t]*U,n[r+1]=e[t+1]*U,n[r+2]=e[t+2]}function w(e,t,n,r){n[r]=e[t]*j,n[r+1]=e[t+1]*j,n[r+2]=e[t+2]}function M(e,t,n,r,i){const s=i+e[t+2],l=k*e[t+1],o=k*e[t],a=Math.cos(l)*s;n[r]=Math.cos(o)*a,n[r+1]=Math.sin(o)*a,n[r+2]=Math.sin(l)*s}function I(e,t,n,r){M(e,t,n,r,l.Sw.radius)}function _(e,t,n,r){M(e,t,n,r,l.sH.radius)}function P(e,t,n,r){M(e,t,n,r,l.$O.radius)}function R(e,t,n,i,s){const l=e[t],o=e[t+1],a=e[t+2],u=Math.sqrt(l*l+o*o+a*a),c=(0,r.YN)(a/(0===u?1:u)),p=Math.atan2(o,l);n[i++]=b*p,n[i++]=b*c,n[i]=u-s}function O(e,t,n,r){R(e,t,n,r,l.Sw.radius)}function A(e,t,n,r){R(e,t,n,r,l.sH.radius)}function S(e,t,n,r){R(e,t,n,r,l.$O.radius)}function E(e,t,n,r){!function(e,t,n,r,i){const s=k*e[t],l=k*e[t+1],o=e[t+2],a=Math.sin(l),u=Math.cos(l),c=i.radius/Math.sqrt(1-i.eccentricitySquared*a*a);n[r++]=(c+o)*u*Math.cos(s),n[r++]=(c+o)*u*Math.sin(s),n[r++]=(c*(1-i.eccentricitySquared)+o)*a}(e,t,n,r,l.$O)}function x(e,t,n,r){const i=u,s=e[t],o=e[t+1],a=e[t+2];let c,p,f,h,d,g,y,m,v,w,M,I,_,P,R,O,A,S,E,x,C;c=Math.abs(a),p=s*s+o*o,f=Math.sqrt(p),h=p+a*a,d=Math.sqrt(h),x=Math.atan2(o,s),g=a*a/h,y=p/h,P=i.a2/d,R=i.a3-i.a4/d,y>.3?(m=c/d*(1+y*(i.a1+P+g*R)/d),E=Math.asin(m),w=m*m,v=Math.sqrt(1-w)):(v=f/d*(1-g*(i.a5-P-y*R)/d),E=Math.acos(v),w=1-v*v,m=Math.sqrt(w)),M=1-l.$O.eccentricitySquared*w,I=l.$O.radius/Math.sqrt(M),_=i.a6*I,P=f-I*v,R=c-_*m,A=v*P+m*R,O=v*R-m*P,S=O/(_/M+A),E+=S,C=A+O*S/2,a<0&&(E=-E),n[r++]=b*x,n[r++]=b*E,n[r]=C}const C={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:g},k=(0,r.kU)(1),b=(0,r.KJ)(1),L=.5*Math.PI,T=l.$O.radius,U=T*Math.PI/180,j=180/(T*Math.PI)},60999:(e,t,n)=>{n.d(t,{DZ:()=>d,Ke:()=>h,Tj:()=>c,UT:()=>g,aD:()=>m,jJ:()=>u});var r=n(31635),i=n(69622),s=n(97768),l=n(74887),o=n(10107),a=n(64108);function u(e,t,n){return(0,l.Lx)(e.map((e,r)=>t.apply(n,[e,r])))}async function c(e,t,n){return(await(0,l.Lx)(e.map((e,r)=>t.apply(n,[e,r])))).map(e=>e.value)}function p(e){return{ok:!0,value:e}}function f(e){return{ok:!1,error:e}}async function h(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return p(await e)}catch(e){return f(e)}}async function d(e){try{return p(await e)}catch(e){return(0,l.QP)(e),f(e)}}function g(e,t){return new y(e,t)}let y=class extends i.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,s.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:n}=this._abortController;this.promise=e(n),this.promise.then(e=>{this._result=p(e),this._cleanup()},e=>{this._result=f(e),this._cleanup()}),this._abortHandle=(0,l.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,s.xt)(this._abortHandle),this._abortController=null}};(0,r.Cg)([(0,o.MZ)()],y.prototype,"value",null),(0,r.Cg)([(0,o.MZ)()],y.prototype,"error",null),(0,r.Cg)([(0,o.MZ)()],y.prototype,"finished",null),(0,r.Cg)([(0,o.MZ)()],y.prototype,"promise",void 0),(0,r.Cg)([(0,o.MZ)()],y.prototype,"_result",void 0),y=(0,r.Cg)([(0,a.$)("esri.core.asyncUtils.ReactiveTask")],y);class m{constructor(){this._sequence=Promise.resolve()}async acquire(){let e;this._sequence=new Promise(t=>{e=this._sequence.then(()=>t,()=>t)});const t=await e;return{[Symbol.dispose]:t}}async run(e){const t={stack:[],error:void 0,hasError:!1};try{return(0,r.mS)(t,await this.acquire(),!1),await e()}catch(e){t.error=e,t.hasError=!0}finally{(0,r.hk)(t)}}}},62815:(e,t,n)=>{n.d(t,{N:()=>l});var r=n(83047),i=n(73941),s=n(21325);function l(e,t,n){if(null==t||null==n||n.vcsWkid||(0,s.aI)(t,n)||(0,i.xP)(t)||(0,i.xP)(n))return null;const l=(0,r.G9)(t)/(0,r.G9)(n);if(1===l)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,l);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const n of e.paths)for(const e of n)e.length>2&&(e[2]*=t)}(e,l);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const n of e.rings)for(const e of n)e.length>2&&(e[2]*=t)}(e,l);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const n of e.points)n.length>2&&(n[2]*=t)}(e,l);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,l);default:return null}}},91218:(e,t,n)=>{n.r(t),n.d(t,{canProjectWithoutEngine:()=>Y,initializeProjection:()=>N,isEqualBaseGCS:()=>D,isLoaded:()=>C,isLoadedOrLoad:()=>k,isLoadedOrLoadFor:()=>b,load:()=>T,project:()=>U,projectExtent:()=>ne,projectMany:()=>j,projectMultipoint:()=>F,projectOrLoad:()=>Z,projectOrLoadMany:()=>G,projectPoint:()=>K,projectPolygon:()=>ee,projectPolyline:()=>V,projectWithZConversion:()=>q,projectWithoutEngine:()=>J,requiresLoad:()=>L,test:()=>z,tryProjectWithZConversion:()=>B,unload:()=>H});var r=n(49186),i=n(74887),s=n(62788),l=n(95488),o=n(51850),a=n(21276),u=n(73941),c=n(5443),p=n(91075),f=n(48526),h=n(86738),d=n(39829),g=n(82799),y=n(16930),m=n(159),v=n(9762),w=n(37539);function M(e,t,n,r,i,s){return I[0]=e,I[1]=t,I[2]=n,(0,v.projectBuffer)(I,r,0,i,s,0)}const I=(0,o.vt)();var _=n(21325),P=n(62815);let R=null,O=null,A=null,S=null,E={};const x=new l.I;function C(){return!!(O?.isLoaded()&&A?.isLoaded()&&S?.isLoaded())}function k(){return!!C()||((0,s.gc)(x),T(),!1)}function b(e,t){return!e||!t||Y(e,t)||k()}function L(e,t){return!Y(e,t)&&!C()}async function T(e){null==R&&(R=Promise.all([n.e(3276).then(n.bind(n,83276)).then(e=>(O=e,O.load())),n.e(8377).then(n.bind(n,8377)).then(e=>(A=e,A.load())),n.e(2158).then(n.bind(n,12158)).then(e=>(S=e,S.load()))])),await R,(0,i.Te)(e),x.notify()}function U(e,t,n){return Array.isArray(e)?0===e.length?[]:((0,a.H)(e),j(e,e[0].spatialReference,t,n)):((0,a.f)(e),j([e],e.spatialReference,t,n)[0])}function j(e,t,n,r){if(null==t||null==n)return e;if(Y(t,n,r))return e.map(e=>J(e,t,n));if(null==r?.geographicTransformation&&(0,u.jA)(t))return e.map(e=>J(e,t,y.A.WGS84)).map(e=>B(e,n));if(null==r?.geographicTransformation&&(0,u.jA)(n))return e.map(e=>B(e,y.A.WGS84)).map(e=>J(e,y.A.WGS84,n));if(!C())throw new $;if(!r?.geographicTransformation)if(r?.extendedParams)r={...r,geographicTransformation:S.getTransformation(t,n,r.areaOfInterestExtent)||new m.A};else if(!r?.areaOfInterestExtent){const e=function(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}(t,n);let i=E[e];i||(i=S.getTransformation(t,n)||new m.A,E[e]=i),r={geographicTransformation:i}}return e[0].spatialReference||(e[0].spatialReference=t),e[0]instanceof p.A?O.executeMany(e,n,r):A.executeMany(e,n,r)}function Z(e,t){const n=G([e],t);return null!=n.pending?{pending:n.pending,geometry:null}:null!=n.geometries?{pending:null,geometry:n.geometries[0]}:{pending:null,geometry:null}}function G(e,t){if(!C())for(const n of e)if(null!=n&&!(0,_.aI)(n.spatialReference,t)&&(0,_.fn)(n.spatialReference)&&(0,_.fn)(t)&&!Y(n.spatialReference,t))return(0,s.gc)(x),{pending:T(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,_.aI)(e.spatialReference,t)?e:(0,_.fn)(e.spatialReference)&&(0,_.fn)(t)?B(e,t):null)}}class $ extends r.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function H(){R=null,O=null,A=null,S=null,E={}}const z={get loadPromise(){return R}};function B(e,t){try{const n=U(e,t);if(null==n)return null;"xmin"in e&&"xmin"in n&&(n.zmin=e.zmin,n.zmax=e.zmax);const r=(0,P.N)(n.type,e.spatialReference,t);return null!=r&&r(n),n}catch(e){if(!(e instanceof $))throw e;return null}}async function q(e,t,n){const r=e.spatialReference;return null!=r&&null!=t&&await N(r,t,null,n),B(e,t)}function Y(e,t,n){return!(n?.areaOfInterestExtent||n?.extendedParams||n?.geographicTransformation)&&(!!(0,_.aI)(e,t)||(0,_.fn)(e)&&(0,_.fn)(t)&&!!(0,w.jd)(e,t))}function D(e,t){if((0,_.aI)(e,t))return!0;if(!(0,_.fn)(e)||!(0,_.fn)(t))return!1;const n=(0,_.oT)(e)||(0,_.K8)(e)||(0,_.x1)(e),r=(0,_.oT)(t)||(0,_.K8)(t)||(0,_.x1)(t);return n&&r}async function N(e,t,n,r){if(C())return(0,i.NO)(r);if(Array.isArray(e)){for(const{source:t,dest:n,options:i}of e)if(t&&n&&!Y(t,n,i))return T(r)}else if(e&&t&&!Y(e,t,n))return T(r);return(0,i.NO)(r)}function J(e,t,n){return e?"x"in e?W(e,t,new h.A,n,0):"xmin"in e?re(e,t,new c.A,n,0):"rings"in e?te(e,t,new d.A,n,0):"paths"in e?X(e,t,new g.A,n,0):"points"in e?Q(e,t,new f.A,n,0):null:null}function K(e,t,n=t.spatialReference,r=0){return null!=n&&null!=e.spatialReference&&null!=W(e,e.spatialReference,t,n,r)}function W(e,t,n,r,i){se[0]=e.x,se[1]=e.y;const s=e.z;return se[2]=void 0!==s?s:i,(0,v.projectBuffer)(se,t,0,se,r,0)?(n.x=se[0],n.y=se[1],n.spatialReference=r,void 0!==s||(0,u.xP)(r)?(n.z=se[2],n.hasZ=!0):(n.z=void 0,n.hasZ=!1),void 0===e.m?(n.m=void 0,n.hasM=!1):(n.m=e.m,n.hasM=!0),n):null}function F(e,t,n=t.spatialReference,r=0){return null!=e.spatialReference&&null!=n&&null!=Q(e,e.spatialReference,t,n,r)}function Q(e,t,n,r,i){const{points:s,hasZ:l,hasM:o}=e,a=[],c=s.length,p=[];for(const e of s)p.push(e[0],e[1],l?e[2]:i);if(!(0,v.projectBuffer)(p,t,0,p,r,0,c))return null;const f=l||(0,u.xP)(r);for(let e=0;e<c;++e){const t=3*e,n=p[t],r=p[t+1];f&&o?a.push([n,r,p[t+2],s[e][3]]):f?a.push([n,r,p[t+2]]):o?a.push([n,r,s[e][2]]):a.push([n,r])}return n.points=a,n.spatialReference=r,n.hasZ=l,n.hasM=o,n}function V(e,t,n=t.spatialReference,r=0){return null!=e.spatialReference&&null!=n&&null!=X(e,e.spatialReference,t,n,r)}function X(e,t,n,r,i){const{paths:s,hasZ:l,hasM:o}=e,a=[];if(!ie(s,l??!1,o??!1,t,a,r,i))return null;const c=l||(0,u.xP)(r);return n.paths=a,n.spatialReference=r,n.hasZ=c,n.hasM=o,n}function ee(e,t,n=t.spatialReference,r=0){return null!=e.spatialReference&&null!=n&&null!=te(e,e.spatialReference,t,n,r)}function te(e,t,n,r,i){const{rings:s,hasZ:l,hasM:o}=e,a=[];if(!ie(s,l??!1,o??!1,t,a,r,i))return null;const c=l||(0,u.xP)(r);return n.rings=a,n.spatialReference=r,n.hasZ=c,n.hasM=o,n}function ne(e,t,n=t.spatialReference,r=0){return null!=e.spatialReference&&null!=n&&null!=re(e,e.spatialReference,t,n,r)}function re(e,t,n,r,i){const{xmin:s,ymin:l,xmax:o,ymax:a,hasZ:c,hasM:p}=e;if(!M(s,l,c?e.zmin:i,t,se,r))return null;const f=c||(0,u.xP)(r);return n.xmin=se[0],n.ymin=se[1],f&&(n.zmin=se[2]),M(o,a,c?e.zmax:i,t,se,r)?(n.xmax=se[0],n.ymax=se[1],f&&(n.zmax=se[2]),p&&(n.mmin=e.mmin,n.mmax=e.mmax),n.spatialReference=r,n):null}function ie(e,t,n,r,i,s,l=0){const o=new Array;for(const n of e)for(const e of n)o.push(e[0],e[1],t?e[2]:l);if(!(0,v.projectBuffer)(o,r,0,o,s,0))return!1;let a=0;i.length=0;const c=t||(0,u.xP)(s);for(const t of e){const e=new Array;for(const r of t)c&&n?e.push([o[a++],o[a++],o[a++],r[3]]):c?e.push([o[a++],o[a++],o[a++]]):n?(e.push([o[a++],o[a++],r[2]]),a++):(e.push([o[a++],o[a++]]),a++);i.push(e)}return!0}const se=(0,o.vt)()},99157:(e,t,n)=>{n.d(t,{A:()=>a});var r,i=n(31635),s=n(69622),l=n(10107),o=(n(44208),n(53966),n(87811),n(64108));let a=r=class extends s.A{constructor(e){super(e),this.isInverse=!1,this.wkt=null,this.wkid=null}getInverse(){return new r({isInverse:!this.isInverse,wkid:this.wkid,wkt:this.wkt})}};(0,i.Cg)([(0,l.MZ)()],a.prototype,"isInverse",void 0),(0,i.Cg)([(0,l.MZ)()],a.prototype,"wkt",void 0),(0,i.Cg)([(0,l.MZ)()],a.prototype,"wkid",void 0),a=r=(0,i.Cg)([(0,o.$)("esri.geometry.operators.support.GeographicTransformationStep")],a)}}]);