@arcgis/core 5.0.0-next.7 → 5.0.0-next.8

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 (286) hide show
  1. package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{8f56f298e7c1a283f407.js → 0030d68d9edf42b4af57.js} +1 -1
  4. package/assets/esri/core/workers/chunks/01d460398f3ba6767a37.js +1 -0
  5. package/assets/esri/core/workers/chunks/{17d5f8dba6ebb1184506.js → 042cd64e1f4eb326c30f.js} +1 -1
  6. package/assets/esri/core/workers/chunks/05429f9d292a7a714309.js +316 -0
  7. package/assets/esri/core/workers/chunks/{66db5f77e09d25e33951.js → 063905fbf9a0c6586949.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{9486032af3e934d85582.js → 0a5d74414dd02a2fb8e1.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{3815ffa13e7b439bca6e.js → 0d5212f59e9b62c16164.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{73487b9d85e726e9c012.js → 1257c37bf04d39c27b62.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{398f356b11fd33bd3831.js → 136a7d781dad05a7463b.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{1e4e7aedf4b779241a02.js → 15c7c10ff9ac63f0e792.js} +1 -1
  13. package/assets/esri/core/workers/chunks/17784cf16fa91504b9ea.js +1 -0
  14. package/assets/esri/core/workers/chunks/{a395373e3173e6458a56.js → 1ab37e13947d0e2e4181.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{f03635ddf56e2ef90e4c.js → 1d06fcae4c2f02fb1c95.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{020c8913d8e35d63080b.js → 1d15d1b20dc10fde6def.js} +1 -1
  17. package/assets/esri/core/workers/chunks/1dfca37f95f2b968aa54.js +1 -0
  18. package/assets/esri/core/workers/chunks/20975513be0a3a1da286.js +1 -0
  19. package/assets/esri/core/workers/chunks/{285762ff92d5388b6024.js → 2166238a7ad63a2d43c7.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{620a94b54be3ed78350d.js → 22ca80f491e070b2a5e7.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{88074189fa10c335370b.js → 24cd7b84cd0f3de4bff2.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{9fac5a12e878cd745354.js → 28020063048e644f17a5.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{95c594a87b732f5c4979.js → 2a8dff8521e1e6a10cf6.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{7e43c105f1cfc44b7bd0.js → 2fa01bd3f3608616fd7f.js} +1 -1
  25. package/assets/esri/core/workers/chunks/30e220f4f843681a4cdd.js +1 -0
  26. package/assets/esri/core/workers/chunks/{5d3661d1fe46dd29aae9.js → 311b564e44ae637c960d.js} +1 -1
  27. package/assets/esri/core/workers/chunks/31c7ce65e16f7858400f.js +1 -0
  28. package/assets/esri/core/workers/chunks/{8a314b3790313e6dc5db.js → 333b62dad3811cff0f14.js} +1 -1
  29. package/assets/esri/core/workers/chunks/36d067c8d03d7a894f5f.js +1 -0
  30. package/assets/esri/core/workers/chunks/{e31192ae920e3e19b6aa.js → 37c1f155da14de91565a.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{aa54b6f2aba6952af149.js → 38cc18fd93c18815ded0.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{c55c096669677321a227.js → 38cd3648932bf2534b0f.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{ac26e3e77df4302f47a2.js → 3afb83f5de033dda89ec.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{f5e47eea8720ba84665b.js → 3c07aa2015ab1dff5f7b.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{e9311386f58f3cb95c22.js → 42a1e71d09e8583a7327.js} +1 -1
  36. package/assets/esri/core/workers/chunks/443dfe7029ec208f670c.js +1 -0
  37. package/assets/esri/core/workers/chunks/{b75930d60449eceb0f1c.js → 4baf6f6e7ddedb25f806.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{bb5484b5eeacc9ad2ceb.js → 4d0cbf9584446f411a37.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{17103e6542aae53c7301.js → 4e3e27673d0671fc2b58.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{5fc7b61f467f1d60a284.js → 51ab2acac4ecc1ca9c34.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{fc4417d1260b717a9385.js → 52282f767bd0e99ddca0.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{fc06014fb484fc8c697e.js → 53654edd766d9b4ef750.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{90f8b4bda28af43ea019.js → 538f509d7fc8337d37ac.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{ed8a85efbd90241512bb.js → 588533c3abe876f20f62.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{c8733cd621105afab2ac.js → 59d3cac32ad6dad941dc.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{72846fb9c87c6642daf0.js → 5e2ce34def5e053913b2.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{8c056eac35d05d9524b7.js → 5f29422a051311ef9b3c.js} +1 -1
  48. package/assets/esri/core/workers/chunks/5f402b3c00bc4afc77b2.js +1 -0
  49. package/assets/esri/core/workers/chunks/{ff35a077ac6776469805.js → 61d970ed75c2c358b1e9.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{7a6a96edc892d7060b7d.js → 629127877042ad784ad2.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{fd2efd1d1cf9d95a87e6.js → 63a6f3e70d2b6ea57e40.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{90b2b43b8b54c9a1ec35.js → 664ae441617afe4b17ec.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{c4e4da69969499a89a2c.js → 695cdef5057e5461078a.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{4c5a7249a311070d8f43.js → 6af18d7a0d314d7c1756.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{f35aaa04cca676c2d3f8.js → 6b59f94040c7d2f6728a.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{811d4c46c75cf6a63e78.js → 6bb7dbc46787b8e34bd9.js} +1 -1
  57. package/assets/esri/core/workers/chunks/6d9f2b113d6bde936a04.js +1 -0
  58. package/assets/esri/core/workers/chunks/{5132ca68e8c7af111a47.js → 6e22b02a9715c10578d0.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{cd1930f08e1fc8b30b14.js → 6ee2f0f708494102a493.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{f0e0a63962784acb4ba1.js → 6f0aec7428021e440ac9.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{deb2854bb7d082a26f52.js → 7005d956c990a04ee8b2.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{a3991ae8caa713d4ddcd.js → 731f7b552dde0fb325cd.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{464d42bebb365287808d.js → 773f2c6c9d38db76dfed.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{3f3d492f1093b7832aab.js → 7803495f8862d9025bcd.js} +1 -1
  65. package/assets/esri/core/workers/chunks/78694ad8229347903f41.js +1 -0
  66. package/assets/esri/core/workers/chunks/7e4c14d4502e3f06d94b.js +1 -0
  67. package/assets/esri/core/workers/chunks/{7544316a75dbd981aea6.js → 86cb097deec50b0da3f3.js} +1 -1
  68. package/assets/esri/core/workers/chunks/8a40ed2ee4b032822c30.js +1 -0
  69. package/assets/esri/core/workers/chunks/{09de8be660174a229efb.js → 8cbb28476151a37ae958.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{62a49cfd9a2508950e9f.js → 8fedfd33c37172dba6bf.js} +1 -1
  71. package/assets/esri/core/workers/chunks/90cbd627d4113db3b686.js +1 -0
  72. package/assets/esri/core/workers/chunks/91aa1157da32f650983b.js +1 -0
  73. package/assets/esri/core/workers/chunks/{e7638b9ab6674bc8a18f.js → 91dfd29e2dba200eab09.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{794748fd1edc29a621cd.js → 9698f36c143953a975d4.js} +1 -1
  75. package/assets/esri/core/workers/chunks/98584902c9db6faa3e4d.js +1 -0
  76. package/assets/esri/core/workers/chunks/9e5e05d6430712b0b1bc.js +1 -0
  77. package/assets/esri/core/workers/chunks/{6f4bd0ee85e7e5a74340.js → a31635a6366347dcef0f.js} +1 -1
  78. package/assets/esri/core/workers/chunks/a6ee40dfc471d6612f3c.js +1 -0
  79. package/assets/esri/core/workers/chunks/{ccc0da0e01f023c8aa1f.js → a876d6159ca120c1567e.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{a4db5c9a90107e097df8.js → af47272aaaef0ea57e71.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{d1fe816b6990918c13c7.js → afc13d5b842275db7dbc.js} +1 -1
  82. package/assets/esri/core/workers/chunks/aff8e40a641c6822af1d.js +1 -0
  83. package/assets/esri/core/workers/chunks/{22d6b8102e75bdef204c.js → b0365cbc3d2a41969e3b.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{79968c183135281d2a6f.js → b3613a38178cad2ebc82.js} +1 -1
  85. package/assets/esri/core/workers/chunks/b548910e820d731ffe8a.js +1 -0
  86. package/assets/esri/core/workers/chunks/{5bd36dbf46c25bd961c8.js → b708792c84620b73c847.js} +1 -1
  87. package/assets/esri/core/workers/chunks/c29486c4eeb3e72effff.js +1 -0
  88. package/assets/esri/core/workers/chunks/{2b94623cabc6ae0f86ce.js → c37f7756d48ff9af2656.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{1c52999a6392370844a6.js → c4090a60d149a5962179.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{73c1d43070b4fe1e5c1e.js → c8e686efe344a33a0258.js} +1 -1
  91. package/assets/esri/core/workers/chunks/{6bb5158de43c4b59107f.js → c9b16fd41cd59d452522.js} +1 -1
  92. package/assets/esri/core/workers/chunks/ce98416437cc1a89d8ea.js +1 -0
  93. package/assets/esri/core/workers/chunks/{279366e6b743f9680603.js → cfff044859e6e6dcc75d.js} +1 -1
  94. package/assets/esri/core/workers/chunks/d07f911d40bf05fc0306.js +1 -0
  95. package/assets/esri/core/workers/chunks/{8833c3d168951be4bf20.js → d0d79dd3e88eecf5c314.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{76ae1702fecc7ad7017c.js → d1e97cce5047f1791e22.js} +1 -1
  97. package/assets/esri/core/workers/chunks/{17acde0245ecd956306c.js → d233cc33497a663450f9.js} +1 -1
  98. package/assets/esri/core/workers/chunks/{36fe6b8228e622407ec2.js → d8793eead02491136841.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{dedc4583b5f32a278124.js → d88f2fe680b8d5603ef8.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{4d599008e1ea42321b37.js → da24ad57747714ac5eda.js} +1 -1
  101. package/assets/esri/core/workers/chunks/{facb3886714222772ab2.js → ddfd01bb9ba8577c3ffc.js} +1 -1
  102. package/assets/esri/core/workers/chunks/{50d9f69d5255af4b29bb.js → df5afa06c6deb6b40109.js} +1 -1
  103. package/assets/esri/core/workers/chunks/e25c4b4a03270d48f408.js +1 -0
  104. package/assets/esri/core/workers/chunks/e3294318daf1192b8319.js +1 -0
  105. package/assets/esri/core/workers/chunks/{da573ecc68e6aa8f6da9.js → e767f83f9e2de6650f80.js} +1 -1
  106. package/assets/esri/core/workers/chunks/e9d4cae2144974489d6e.js +1 -0
  107. package/assets/esri/core/workers/chunks/{91df8638b8b904e6d8c5.js → ead8d0cbcebd12dbfad7.js} +1 -1
  108. package/assets/esri/core/workers/chunks/{f9324e88c359c03f35aa.js → eb9c166db0db6fa60e95.js} +1 -1
  109. package/assets/esri/core/workers/chunks/{8ffd4710d168c2fcfd96.js → ebf23b46db56aaa88841.js} +1 -1
  110. package/assets/esri/core/workers/chunks/{bc241c7735e4efba734a.js → f34e3fa0c5b28531e289.js} +1 -1
  111. package/assets/esri/core/workers/chunks/f64037a88ab03662dc2a.js +1 -0
  112. package/assets/esri/core/workers/chunks/{d97fadbc69e055d183a0.js → f77f4bd6a577b92cf66f.js} +1 -1
  113. package/assets/esri/core/workers/chunks/{16d66770ef841564ee3f.js → f89c90f98c85667b0ebc.js} +1 -1
  114. package/assets/esri/core/workers/chunks/{4c4227b0ea21a5e429ab.js → fb192de7e4fa152342bb.js} +1 -1
  115. package/assets/esri/core/workers/chunks/fbd8d2f61f8a15bcf3db.js +1 -0
  116. package/assets/esri/core/workers/chunks/{2f78861afe0e9037dd8d.js → fe49321dca22dc60d105.js} +1 -1
  117. package/assets/esri/core/workers/chunks/{fe77ae6cf232a7a3298e.js → fef45bc59c71f88c60b5.js} +1 -1
  118. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  119. package/chunks/MultiPathImpl.js +1 -1
  120. package/chunks/Point2D.js +1 -1
  121. package/chunks/UnitFactory.js +1 -1
  122. package/config.js +1 -1
  123. package/core/QueueProcessor.js +1 -1
  124. package/core/SetUtils.js +1 -1
  125. package/core/has.js +1 -1
  126. package/geometry/operators/gx/operatorOffset.js +1 -1
  127. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  128. package/identity/Credential.js +1 -1
  129. package/identity/IdentityManager.js +1 -1
  130. package/identity/IdentityManagerBase.js +1 -1
  131. package/interfaces.d.ts +67 -27
  132. package/kernel.js +1 -1
  133. package/layers/FeatureLayer.js +1 -1
  134. package/layers/SceneLayer.js +1 -1
  135. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  136. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  137. package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
  138. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  139. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  140. package/layers/support/fieldConfigUtils.js +1 -1
  141. package/layers/support/rasterDatasets/pixelReader.js +1 -1
  142. package/layers/support/source/DataLayerSource.js +1 -1
  143. package/package.json +3 -3
  144. package/popup/FieldInfo.js +1 -1
  145. package/processRequest.js +5 -0
  146. package/request.js +1 -1
  147. package/requestConfig.js +5 -0
  148. package/requestQueue.js +5 -0
  149. package/rest/query/executeForCount.js +1 -1
  150. package/rest/query/executeForExtent.js +1 -1
  151. package/rest/query/executeForIds.js +1 -1
  152. package/rest/query/executeQueryJSON.js +1 -1
  153. package/rest/query/executeQueryPBF.js +1 -1
  154. package/rest/query/operations/query.js +1 -1
  155. package/rest/support/BaseImageMeasureResultValue.js +5 -0
  156. package/rest/support/ImageAreaResult.js +1 -1
  157. package/rest/support/ImageDistanceResult.js +1 -1
  158. package/rest/support/ImageHeightResult.js +1 -1
  159. package/rest/support/ImageMeasureResultAngleValue.js +5 -0
  160. package/rest/support/ImageMeasureResultAreaValue.js +5 -0
  161. package/rest/support/ImageMeasureResultLengthValue.js +5 -0
  162. package/rest/support/ImageWithType.js +5 -0
  163. package/rest/support/imageMeasureUtils.js +1 -1
  164. package/support/revision.js +1 -1
  165. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  166. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  167. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  168. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  169. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  170. package/views/2d/layers/features/sources/strategies/AFeatureLoadStrategy.js +1 -1
  171. package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
  172. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
  173. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  174. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  175. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  176. package/views/{3d/support/ImageWithType.js → 2d/layers/features/sources/strategies/constants.js} +1 -1
  177. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  178. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  179. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  180. package/views/3d/analysis/VolumeMeasurement/volumeMeasurementErrors.js +1 -1
  181. package/views/3d/glTF/DefaultLoadingContext.js +1 -1
  182. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  183. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  184. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  185. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  186. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  187. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  188. package/views/3d/layers/graphics/FeatureGraphics3DGraphicsPipeline.js +1 -1
  189. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  190. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  191. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  192. package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
  193. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  194. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  195. package/views/3d/layers/graphics/pipeline/fetching/Tile3DFetcher.js +1 -1
  196. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  197. package/views/3d/layers/i3s/I3SDataRequester.js +5 -0
  198. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  199. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  200. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  201. package/views/3d/layers/support/FeatureTile.js +1 -1
  202. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  203. package/views/3d/layers/support/MediaLayerInteractionOptions.js +1 -1
  204. package/views/3d/layers/support/MediaLayerInteractionReshapeOptions.js +5 -0
  205. package/views/3d/layers/support/SampledGeometryMaxDistanceRatio.js +5 -0
  206. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  207. package/views/3d/layers/support/fetchTile.js +1 -1
  208. package/views/3d/support/ResourceController.js +1 -1
  209. package/views/3d/support/SharedSymbolResources.js +1 -1
  210. package/views/3d/support/StreamTextureCollection.js +1 -1
  211. package/views/3d/terrain/TerrainSurface.js +1 -1
  212. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  213. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  214. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +6 -0
  215. package/views/SceneView.js +1 -1
  216. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  217. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  218. package/views/draw/MultipointDrawAction.js +1 -1
  219. package/views/draw/PointDrawAction.js +1 -1
  220. package/views/draw/PolygonDrawAction.js +1 -1
  221. package/views/draw/PolylineDrawAction.js +1 -1
  222. package/views/draw/SegmentDrawAction.js +1 -1
  223. package/views/draw/input/CursorUpdateEvents.js +5 -0
  224. package/views/draw/input/DrawCompleteEvent.js +5 -0
  225. package/views/draw/input/VertexAddEvent.js +5 -0
  226. package/views/draw/input/VertexRemoveEvent.js +5 -0
  227. package/views/draw/input/VertexUpdateEvent.js +5 -0
  228. package/views/interactive/editGeometry/CheckpointingEditGeometryOperations.js +5 -0
  229. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  230. package/views/interactive/editGeometry/operations/ReplayableAppendVertex.js +5 -0
  231. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  232. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  233. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  234. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  235. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
  236. package/webscene/spec-certification/api.js +1 -1
  237. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  238. package/widgets/CoordinateConversion.js +1 -1
  239. package/widgets/Editor.js +1 -1
  240. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  241. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  242. package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
  243. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  244. package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
  245. package/widgets/PanoramicViewer/support/PanoramicMeshManager.js +1 -1
  246. package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
  247. package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
  248. package/widgets/PanoramicViewer/support/getVisibleTiles.js +5 -0
  249. package/widgets/Sketch/CreateToolVisibilityMap.js +5 -0
  250. package/widgets/Sketch/SelectionToolVisibilityMap.js +5 -0
  251. package/widgets/Sketch/VisibleElements.js +1 -1
  252. package/widgets/Sketch.js +1 -1
  253. package/assets/esri/core/workers/chunks/02e69f0c63d97661da60.js +0 -1
  254. package/assets/esri/core/workers/chunks/05eee334d58a0b9f6316.js +0 -1
  255. package/assets/esri/core/workers/chunks/087973e7c4fea5fcfa5e.js +0 -1
  256. package/assets/esri/core/workers/chunks/326a76a4e80269d4029d.js +0 -1
  257. package/assets/esri/core/workers/chunks/377a66034e7c1bad5599.js +0 -1
  258. package/assets/esri/core/workers/chunks/4442817beb7a76c95770.js +0 -1
  259. package/assets/esri/core/workers/chunks/459a67928bde4a62b6a4.js +0 -1
  260. package/assets/esri/core/workers/chunks/53bd8996e8812f1ad7b2.js +0 -1
  261. package/assets/esri/core/workers/chunks/557960763695abee4a83.js +0 -1
  262. package/assets/esri/core/workers/chunks/6201356f7f91e5c06425.js +0 -1
  263. package/assets/esri/core/workers/chunks/6c3b99209d542efa64d4.js +0 -1
  264. package/assets/esri/core/workers/chunks/7413e582bc2b16af6a0f.js +0 -1
  265. package/assets/esri/core/workers/chunks/7461124454bfb4fb6474.js +0 -1
  266. package/assets/esri/core/workers/chunks/75bf27271a31e26e1b21.js +0 -1
  267. package/assets/esri/core/workers/chunks/7aaaebbabee27690283c.js +0 -1
  268. package/assets/esri/core/workers/chunks/7c4a63aeead2505d6f02.js +0 -1
  269. package/assets/esri/core/workers/chunks/90250e9239c173aace88.js +0 -1
  270. package/assets/esri/core/workers/chunks/9786f91455350eaae493.js +0 -1
  271. package/assets/esri/core/workers/chunks/99859dce1925b406ccd0.js +0 -1
  272. package/assets/esri/core/workers/chunks/9c5cbf8810f37b1a4718.js +0 -1
  273. package/assets/esri/core/workers/chunks/9e8dceef4c961f56940d.js +0 -1
  274. package/assets/esri/core/workers/chunks/a06bac9b8f9e18874de8.js +0 -316
  275. package/assets/esri/core/workers/chunks/a712cdff78fc826acd8c.js +0 -1
  276. package/assets/esri/core/workers/chunks/d305a21666b1ed5bf33d.js +0 -1
  277. package/assets/esri/core/workers/chunks/d40f57f9fc47f9a9f97c.js +0 -1
  278. package/assets/esri/core/workers/chunks/e82f5437bd66779c6740.js +0 -1
  279. package/assets/esri/core/workers/chunks/f4d0ae6be1b3984228d0.js +0 -1
  280. package/assets/esri/core/workers/chunks/f6c8beb60f6d29945a2e.js +0 -1
  281. package/assets/esri/core/workers/chunks/f746e3f7ebff2bbdf333.js +0 -1
  282. package/views/3d/layers/i3s/I3SStreamDataController.js +0 -5
  283. package/views/3d/support/StreamDataLoader.js +0 -5
  284. package/views/3d/support/StreamDataRequester.js +0 -5
  285. package/views/3d/support/downloadSlots.js +0 -5
  286. package/views/draw/input/DrawEvents.js +0 -5
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2869],{37838:(t,e,o)=>{o.d(e,{A:()=>Kt});var i,s=o(31635),r=o(69540),n=o(7762),l=o(25482),a=o(4718),p=o(53966),d=o(74887),c=o(10107),u=o(79901),y=o(36005),h=o(64108),m=o(43937),g=o(56507),f=o(30524),v=o(89893),w=o(84424);o(44208);let C=i=class extends w.A{constructor(t){super(t),this.creator=null,this.destroyer=null,this.outFields=null,this.type="custom"}clone(){return new i({creator:this.creator,destroyer:this.destroyer,outFields:Array.isArray(this.outFields)?(0,a.o8)(this.outFields):null})}};(0,s.Cg)([(0,c.MZ)()],C.prototype,"creator",void 0),(0,s.Cg)([(0,c.MZ)()],C.prototype,"destroyer",void 0),(0,s.Cg)([(0,c.MZ)()],C.prototype,"outFields",void 0),(0,s.Cg)([(0,c.MZ)({type:["custom"],readOnly:!0})],C.prototype,"type",void 0),C=i=(0,s.Cg)([(0,h.$)("esri.popup.content.CustomContent")],C);const M=C;var x;o(87811);let Z=x=class extends l.o{constructor(t){super(t),this.title=null,this.expression=null,this.returnType="dictionary"}clone(){return new x({title:this.title,expression:this.expression})}};(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],Z.prototype,"title",void 0),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],Z.prototype,"expression",void 0),(0,s.Cg)([(0,c.MZ)({type:["dictionary"],readOnly:!0,json:{read:!1,write:!0}})],Z.prototype,"returnType",void 0),Z=x=(0,s.Cg)([(0,h.$)("esri.popup.ElementExpressionInfo")],Z);const F=Z;var I;let j=I=class extends w.A{constructor(t){super(t),this.expressionInfo=null,this.type="expression"}clone(){return new I({expressionInfo:this.expressionInfo?.clone()})}};(0,s.Cg)([(0,c.MZ)({type:F,json:{write:!0}})],j.prototype,"expressionInfo",void 0),(0,s.Cg)([(0,c.MZ)({type:["expression"],readOnly:!0,json:{read:!1,write:!0}})],j.prototype,"type",void 0),j=I=(0,s.Cg)([(0,h.$)("esri.popup.content.ExpressionContent")],j);const A=j;var b=o(66159);let N=class extends l.o{constructor(t){super(t),this.altText=null,this.caption="",this.title="",this.type=null}};(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],N.prototype,"altText",void 0),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],N.prototype,"caption",void 0),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],N.prototype,"title",void 0),(0,s.Cg)([(0,c.MZ)({type:["image","bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],N.prototype,"type",void 0),N=(0,s.Cg)([(0,h.$)("esri.popup.content.mixins.MediaInfo")],N);const S=N;var R,O=o(68197),_=o(69622);let T=R=class extends _.A{constructor(t){super(t),this.color=null,this.fieldName=null,this.tooltip=null,this.value=null}clone(){return new R({color:this.color?.clone(),fieldName:this.fieldName,tooltip:this.tooltip,value:this.value})}};(0,s.Cg)([(0,c.MZ)()],T.prototype,"color",void 0),(0,s.Cg)([(0,c.MZ)()],T.prototype,"fieldName",void 0),(0,s.Cg)([(0,c.MZ)()],T.prototype,"tooltip",void 0),(0,s.Cg)([(0,c.MZ)()],T.prototype,"value",void 0),T=R=(0,s.Cg)([(0,h.$)("esri.popup.content.support.ChartMediaInfoValueSeries")],T);const $=T;var E;let B=E=class extends l.o{constructor(t){super(t),this.colors=null,this.fields=[],this.normalizeField=null,this.series=[],this.tooltipField=null}clone(){return new E({colors:(0,a.o8)(this.colors),fields:(0,a.o8)(this.fields),normalizeField:this.normalizeField,series:(0,a.o8)(this.series),tooltipField:this.tooltipField})}};(0,s.Cg)([(0,c.MZ)({type:[O.A],json:{type:[[g.jz]],write:!0}})],B.prototype,"colors",void 0),(0,s.Cg)([(0,c.MZ)({type:[String],json:{write:{isRequired:!0}}})],B.prototype,"fields",void 0),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],B.prototype,"normalizeField",void 0),(0,s.Cg)([(0,c.MZ)({type:[$],json:{read:!1}})],B.prototype,"series",void 0),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],B.prototype,"tooltipField",void 0),B=E=(0,s.Cg)([(0,h.$)("esri.popup.content.support.ChartMediaInfoValue")],B);const k=B;let J=class extends S{constructor(t){super(t),this.type=null,this.value=void 0}};(0,s.Cg)([(0,c.MZ)({type:["bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],J.prototype,"type",void 0),(0,s.Cg)([(0,c.MZ)({type:k,json:{write:{isRequired:!0}}})],J.prototype,"value",void 0),J=(0,s.Cg)([(0,h.$)("esri.popup.content.mixins.ChartMediaInfo")],J);const q=J,D=(0,o(66552).O)()({barchart:"bar-chart",columnchart:"column-chart",linechart:"line-chart",piechart:"pie-chart"});var U;let L=U=class extends q{constructor(t){super(t),this.type="bar-chart"}clone(){return new U({altText:this.altText,title:this.title,caption:this.caption,value:this.value?.clone()})}};(0,s.Cg)([(0,c.MZ)({type:["bar-chart"],readOnly:!0,json:{type:["barchart"],read:!1,write:{writer:D.write,isRequired:!0}}})],L.prototype,"type",void 0),L=U=(0,s.Cg)([(0,h.$)("esri.popup.content.BarChartMediaInfo")],L);const W=L;var z;let P=z=class extends q{constructor(t){super(t),this.type="column-chart"}clone(){return new z({altText:this.altText,title:this.title,caption:this.caption,value:this.value?.clone()})}};(0,s.Cg)([(0,c.MZ)({type:["column-chart"],readOnly:!0,json:{type:["columnchart"],read:!1,write:{writer:D.write,isRequired:!0}}})],P.prototype,"type",void 0),P=z=(0,s.Cg)([(0,h.$)("esri.popup.content.ColumnChartMediaInfo")],P);const K=P;var G;let V=G=class extends l.o{constructor(t){super(t),this.linkURL=null,this.sourceURL=null}clone(){return new G({linkURL:this.linkURL,sourceURL:this.sourceURL})}};(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],V.prototype,"linkURL",void 0),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:{isRequired:!0}}})],V.prototype,"sourceURL",void 0),V=G=(0,s.Cg)([(0,h.$)("esri.popup.content.support.ImageMediaInfoValue")],V);const H=V;var X;let Q=X=class extends S{constructor(t){super(t),this.refreshInterval=0,this.type="image",this.value=void 0}clone(){return new X({altText:this.altText,title:this.title,caption:this.caption,refreshInterval:this.refreshInterval,value:this.value?.clone()})}};(0,s.Cg)([(0,c.MZ)({type:Number,json:{write:!0}})],Q.prototype,"refreshInterval",void 0),(0,s.Cg)([(0,c.MZ)({type:["image"],readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],Q.prototype,"type",void 0),(0,s.Cg)([(0,c.MZ)({type:H,json:{write:{isRequired:!0}}})],Q.prototype,"value",void 0),Q=X=(0,s.Cg)([(0,h.$)("esri.popup.content.ImageMediaInfo")],Q);const Y=Q;var tt;let et=tt=class extends q{constructor(t){super(t),this.type="line-chart"}clone(){return new tt({altText:this.altText,title:this.title,caption:this.caption,value:this.value?.clone()})}};(0,s.Cg)([(0,c.MZ)({type:["line-chart"],readOnly:!0,json:{type:["linechart"],read:!1,write:{writer:D.write,isRequired:!0}}})],et.prototype,"type",void 0),et=tt=(0,s.Cg)([(0,h.$)("esri.popup.content.LineChartMediaInfo")],et);const ot=et;var it;let st=it=class extends q{constructor(t){super(t),this.type="pie-chart"}clone(){return new it({altText:this.altText,title:this.title,caption:this.caption,value:this.value?.clone()})}};(0,s.Cg)([(0,c.MZ)({type:["pie-chart"],readOnly:!0,json:{type:["piechart"],read:!1,write:{writer:D.write,isRequired:!0}}})],st.prototype,"type",void 0),st=it=(0,s.Cg)([(0,h.$)("esri.popup.content.PieChartMediaInfo")],st);const rt=st,nt={base:S,key:"type",defaultKeyValue:"image",typeMap:{"bar-chart":W,"column-chart":K,"line-chart":ot,"pie-chart":rt,image:Y}};var lt;let at=lt=class extends w.A{constructor(t){super(t),this.activeMediaInfoIndex=null,this.attributes=null,this.description=null,this.mediaInfos=null,this.title=null,this.type="media"}readMediaInfos(t){return t&&t.map(t=>"image"===t.type?Y.fromJSON(t):"barchart"===t.type?W.fromJSON(t):"columnchart"===t.type?K.fromJSON(t):"linechart"===t.type?ot.fromJSON(t):"piechart"===t.type?rt.fromJSON(t):void 0).filter(Boolean)}writeMediaInfos(t,e){e.mediaInfos=t&&t.map(t=>t.toJSON())}clone(){return new lt((0,a.o8)({activeMediaInfoIndex:this.activeMediaInfoIndex,attributes:this.attributes,description:this.description,mediaInfos:this.mediaInfos,title:this.title}))}};(0,s.Cg)([(0,c.MZ)()],at.prototype,"activeMediaInfoIndex",void 0),(0,s.Cg)([(0,c.MZ)({type:Object,json:{write:!0}})],at.prototype,"attributes",void 0),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],at.prototype,"description",void 0),(0,s.Cg)([(0,c.MZ)({types:[nt]})],at.prototype,"mediaInfos",void 0),(0,s.Cg)([(0,y.w)("mediaInfos")],at.prototype,"readMediaInfos",null),(0,s.Cg)([(0,m.K)("mediaInfos")],at.prototype,"writeMediaInfos",null),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],at.prototype,"title",void 0),(0,s.Cg)([(0,c.MZ)({type:["media"],readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],at.prototype,"type",void 0),at=lt=(0,s.Cg)([(0,h.$)("esri.popup.content.MediaContent")],at);const pt=at;var dt=o(49852);let ct=class extends((0,r.OU)(w.A)){constructor(t){super(t),this.description=null,this.displayCount=null,this.displayType="list",this.orderByFields=null,this.relationshipId=null,this.title=null,this.type="relationship"}};(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],ct.prototype,"description",void 0),(0,s.Cg)([(0,c.MZ)({type:Number,json:{type:g.jz,write:!0}})],ct.prototype,"displayCount",void 0),(0,s.Cg)([(0,c.MZ)({type:["list"],json:{write:{isRequired:!0}}})],ct.prototype,"displayType",void 0),(0,s.Cg)([(0,c.MZ)({type:[dt.A],json:{write:!0}})],ct.prototype,"orderByFields",void 0),(0,s.Cg)([(0,c.MZ)({type:Number,json:{type:g.jz,write:{isRequired:!0}}})],ct.prototype,"relationshipId",void 0),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],ct.prototype,"title",void 0),(0,s.Cg)([(0,c.MZ)({type:["relationship"],readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],ct.prototype,"type",void 0),ct=(0,s.Cg)([(0,h.$)("esri.popup.content.RelationshipContent")],ct);const ut=ct;var yt;let ht=yt=class extends w.A{constructor(t){super(t),this.text=null,this.type="text"}clone(){return new yt({text:this.text})}};(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],ht.prototype,"text",void 0),(0,s.Cg)([(0,c.MZ)({type:["text"],readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],ht.prototype,"type",void 0),ht=yt=(0,s.Cg)([(0,h.$)("esri.popup.content.TextContent")],ht);const mt=ht;var gt=o(93223),ft=o(83342);let vt=class extends((0,r.OU)(w.A)){constructor(t){super(t),this.description=null,this.displayCount=null,this.title=null,this.associationTypes=[],this.type="utility-network-associations"}};(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],vt.prototype,"description",void 0),(0,s.Cg)([(0,c.MZ)({type:Number,json:{type:g.jz,write:!0}})],vt.prototype,"displayCount",void 0),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],vt.prototype,"title",void 0),(0,s.Cg)([(0,c.MZ)({type:[ft.A],json:{write:!0}})],vt.prototype,"associationTypes",void 0),(0,s.Cg)([(0,gt.e)({utilityNetworkAssociations:"utility-network-associations"})],vt.prototype,"type",void 0),vt=(0,s.Cg)([(0,h.$)("esri.popup.content.UtilityNetworkAssociationsContent")],vt);const wt=vt,Ct={base:null,key:"type",typeMap:{attachment:v.A,media:pt,text:mt,expression:A,field:b.A,relationship:ut,utilityNetworkAssociations:wt}},Mt={base:null,key:"type",typeMap:{attachment:v.A,media:pt,text:mt,expression:A,field:b.A,relationship:ut}};var xt,Zt=o(93705),Ft=o(41227);let It=xt=class extends l.o{constructor(t){super(t),this.returnTopmostRaster=null,this.showNoDataRecords=null}clone(){return new xt({showNoDataRecords:this.showNoDataRecords,returnTopmostRaster:this.returnTopmostRaster})}};(0,s.Cg)([(0,c.MZ)({type:Boolean,json:{write:!0}})],It.prototype,"returnTopmostRaster",void 0),(0,s.Cg)([(0,c.MZ)({type:Boolean,json:{write:!0}})],It.prototype,"showNoDataRecords",void 0),It=xt=(0,s.Cg)([(0,h.$)("esri.popup.LayerOptions")],It);const jt=It;var At;let bt=At=class extends l.o{constructor(t){super(t),this.showRelatedRecords=null,this.orderByFields=null}clone(){return new At({showRelatedRecords:this.showRelatedRecords,orderByFields:this.orderByFields?(0,a.o8)(this.orderByFields):null})}};(0,s.Cg)([(0,c.MZ)({type:Boolean,json:{write:!0}})],bt.prototype,"showRelatedRecords",void 0),(0,s.Cg)([(0,c.MZ)({type:[dt.A],json:{write:!0}})],bt.prototype,"orderByFields",void 0),bt=At=(0,s.Cg)([(0,h.$)("esri.popup.RelatedRecordsInfo")],bt);const Nt=bt;var St,Rt=o(4902);let Ot=St=class extends((0,Rt.s)(_.A)){constructor(t){super(t),this.active=!1,this.className=null,this.disabled=!1,this.icon=null,this.id=null,this.indicator=!1,this.title=null,this.type=null,this.visible=!0}clone(){return new St({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible})}};(0,s.Cg)([(0,c.MZ)()],Ot.prototype,"active",void 0),(0,s.Cg)([(0,c.MZ)()],Ot.prototype,"className",void 0),(0,s.Cg)([(0,c.MZ)()],Ot.prototype,"disabled",void 0),(0,s.Cg)([(0,c.MZ)()],Ot.prototype,"icon",void 0),(0,s.Cg)([(0,c.MZ)()],Ot.prototype,"id",void 0),(0,s.Cg)([(0,c.MZ)()],Ot.prototype,"indicator",void 0),(0,s.Cg)([(0,c.MZ)()],Ot.prototype,"title",void 0),(0,s.Cg)([(0,c.MZ)()],Ot.prototype,"type",void 0),(0,s.Cg)([(0,c.MZ)()],Ot.prototype,"visible",void 0),Ot=St=(0,s.Cg)([(0,h.$)("esri.support.actions.ActionBase")],Ot);const _t=Ot;var Tt;let $t=Tt=class extends _t{constructor(t){super(t),this.image=null,this.type="button"}clone(){return new Tt({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image})}};(0,s.Cg)([(0,c.MZ)()],$t.prototype,"image",void 0),$t=Tt=(0,s.Cg)([(0,h.$)("esri.support.actions.ActionButton")],$t);const Et=$t;var Bt;let kt=Bt=class extends _t{constructor(t){super(t),this.image=null,this.type="toggle",this.value=!1}clone(){return new Bt({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image,value:this.value})}};(0,s.Cg)([(0,c.MZ)()],kt.prototype,"image",void 0),(0,s.Cg)([(0,c.MZ)()],kt.prototype,"value",void 0),kt=Bt=(0,s.Cg)([(0,h.$)("esri.support.actions.ActionToggle")],kt);const Jt=kt,qt="relationships/",Dt="expression/",Ut=n.A.ofType({key:"type",defaultKeyValue:"button",base:_t,typeMap:{button:Et,toggle:Jt}}),Lt={base:w.A,key:"type",typeMap:{media:pt,custom:M,text:mt,attachments:v.A,fields:b.A,expression:A,relationship:ut,utilityNetworkAssociations:wt}},Wt=new Set(["attachments","fields","media","text","expression","relationship"]),zt=new Set([...Wt,"utility-network-associations"]);let Pt=class extends((0,r.OU)(l.o)){constructor(t){super(t),this.actions=null,this.content="",this.expressionInfos=null,this.fieldInfos=null,this.layerOptions=null,this.lastEditInfoEnabled=!0,this.outFields=null,this.overwriteActions=!1,this.returnGeometry=!1,this.title=""}castContent(t){return Array.isArray(t)?t.map(t=>(0,g.aq)(Lt,t)):"string"==typeof t||"function"==typeof t||t instanceof HTMLElement||(0,d.$X)(t)?t:(p.A.getLogger(this).error("content error","unsupported content value",{value:t}),null)}readContent(t,e){const{popupElements:o}=e;return Array.isArray(o)&&o.length>0?this._readPopupInfoElements(e.description,e.mediaInfos,o):this._readPopupInfo(e)}writeWebSceneContent(t,e,o,i){this._writePopupTemplateContent(t,e,i)}writeWebMapContent(t,e,o,i){this._writePopupTemplateContent(t,e,i)}writeFieldInfos(t,e,o,i){const{content:s}=this,r=Array.isArray(s)?s:null,{writeFieldFormat:n,...l}=i||{};if(t){const o=r?r.filter(t=>"fields"===t.type):[],i=o.length&&o.every(t=>t.fieldInfos?.length);e.fieldInfos=t.filter(Boolean).map(t=>{const e=t.toJSON(l);return i&&(e.visible=!1),e})}if(r)for(const t of r)"fields"===t.type&&this._writeFieldsContent(t,e,l)}writeLayerOptions(t,e,o,i){e[o]=!t||null===t.showNoDataRecords&&null===t.returnTopmostRaster?null:t.toJSON(i)}writeTitle(t,e){e.title=t||""}async collectRequiredFields(t,e,o){const i=this.expressionInfos||[];await this._collectExpressionInfoFields(t,e,o,[...i,...this._getContentExpressionInfos(this.content,i)]),(0,f._w)(t,e,[...this.outFields||[],...this._getActionsFields(this.actions),...this._getTitleFields(this.title),...this._getContentFields(this.content)])}async getRequiredFields(t,e){const o=new Set;return await this.collectRequiredFields(o,t,e),[...o].sort()}_writePopupTemplateContent(t,e,o){"string"!=typeof t?Array.isArray(t)&&(e.popupElements=t.filter(t=>"web-scene"===o?.origin?Wt.has(t.type):zt.has(t.type)).map(t=>t?.toJSON(o)),e.popupElements.forEach(t=>{"attachments"===t.type?this._writeAttachmentContent(e):"media"===t.type?this._writeMediaContent(t,e):"text"===t.type?this._writeTextContent(t,e):"relationship"===t.type&&this._writeRelationshipContent(t,e)})):e.description=t}_writeFieldsContent(t,e,o){const i=t.fieldInfos;if(!Array.isArray(i)||!i.length)return;const s=e.fieldInfos;if(Array.isArray(s))for(const t of i){const e=s.find(e=>e.fieldName?.toLowerCase()===t.fieldName?.toLowerCase());e?e.visible=!0:s.push(t.toJSON(o))}else e.fieldInfos=i.map(t=>t.toJSON(o))}_writeAttachmentContent(t){t.showAttachments||(t.showAttachments=!0)}_writeRelationshipContent(t,e){const o=t.orderByFields?.map(e=>this._toFieldOrderJSON(e,t.relationshipId))||[],i=[...e.relatedRecordsInfo?.orderByFields||[],...o];e.relatedRecordsInfo={showRelatedRecords:!0,...i?.length&&{orderByFields:i}}}_writeTextContent(t,e){!e.description&&t.text&&(e.description=t.text)}_writeMediaContent(t,e){if(!Array.isArray(t.mediaInfos)||!t.mediaInfos.length)return;const o=(0,a.o8)(t.mediaInfos);Array.isArray(e.mediaInfos)?e.mediaInfos=[...e.mediaInfos,...o]:e.mediaInfos=o}_readPopupInfoElements(t,e,o){const i={description:!1,mediaInfos:!1};return o.map(o=>"media"===o.type?(o.mediaInfos||!e||i.mediaInfos||(o.mediaInfos=e,i.mediaInfos=!0),pt.fromJSON(o)):"text"===o.type?(o.text||!t||i.description||(o.text=t,i.description=!0),mt.fromJSON(o)):"attachments"===o.type?v.A.fromJSON(o):"fields"===o.type?b.A.fromJSON(o):"expression"===o.type?A.fromJSON(o):"relationship"===o.type?ut.fromJSON(o):"utilityNetworkAssociations"===o.type?wt.fromJSON(o):void 0).filter(Boolean)}_toRelationshipContent(t){const{field:e,order:o}=t;if(!e?.startsWith(qt))return null;const i=e.replace(qt,"").split("/");if(2!==i.length)return null;const s=parseInt(i[0],10),r=i[1];return!Number.isNaN(s)&&r?ut.fromJSON({relationshipId:s,orderByFields:[{field:r,order:o}]}):null}_toFieldOrderJSON(t,e){const{order:o,field:i}=t;return{field:`${qt}${e}/${i}`,order:o}}_readPopupInfo({description:t,mediaInfos:e,showAttachments:o,relatedRecordsInfo:i={showRelatedRecords:!1}}){const s=[];t?s.push(new mt({text:t})):s.push(new b.A),Array.isArray(e)&&e.length&&s.push(pt.fromJSON({mediaInfos:e})),o&&s.push(v.A.fromJSON({displayType:"auto"}));const{showRelatedRecords:r,orderByFields:n}=i;return r&&n?.length&&n.forEach(t=>{const e=this._toRelationshipContent(t);e&&s.push(e)}),s.length?s:t}_getContentElementFields(t){const e=t?.type;if("attachments"===e)return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description)];if("custom"===e)return t.outFields||[];if("fields"===e)return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description),...this._getFieldInfoFields(t.fieldInfos??this.fieldInfos)];if("media"===e){const e=t.mediaInfos||[];return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description),...e.reduce((t,e)=>[...t,...this._getMediaInfoFields(e)],[])]}return"text"===e?this._extractFieldNames(t.text):"relationship"===e||"utility-network-associations"===e?[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description)]:[]}_getMediaInfoFields(t){const{caption:e,title:o,value:i}=t,s=i||{},{fields:r,normalizeField:n,tooltipField:l,sourceURL:a,linkURL:p}=s,d=[...this._extractFieldNames(o),...this._extractFieldNames(e),...this._extractFieldNames(a),...this._extractFieldNames(p),...r??[]];return n&&d.push(n),l&&d.push(l),d}_getContentExpressionInfos(t,e){return Array.isArray(t)?t.reduce((t,e)=>[...t,..."expression"===e.type&&e.expressionInfo?[e.expressionInfo]:[]],e):[]}_getContentFields(t){return"string"==typeof t?this._extractFieldNames(t):Array.isArray(t)?t.reduce((t,e)=>[...t,...this._getContentElementFields(e)],[]):[]}async _collectExpressionInfoFields(t,e,o,i){i&&await Promise.all(i.map(i=>(0,f.Dx)(t,e,o,i.expression)))}_getFieldInfoFields(t){return t?t.filter(({fieldName:t,visible:e})=>!(void 0!==e&&!e||!t||t.startsWith(qt)||t.startsWith(Dt))).map(t=>t.fieldName):[]}_getActionsFields(t){return t?t.toArray().reduce((t,e)=>[...t,...this._getActionFields(e)],[]):[]}_getActionFields(t){const{className:e,title:o,type:i}=t,s="button"===i||"toggle"===i?t.image:"";return[...this._extractFieldNames(o),...this._extractFieldNames(e),...this._extractFieldNames(s)]}_getTitleFields(t){return"string"==typeof t?this._extractFieldNames(t):[]}_extractFieldNames(t){return(0,f.nw)(t).filter(t=>!(t.startsWith(qt)||t.startsWith(Dt)))}};(0,s.Cg)([(0,c.MZ)({type:Ut})],Pt.prototype,"actions",void 0),(0,s.Cg)([(0,c.MZ)()],Pt.prototype,"content",void 0),(0,s.Cg)([(0,u.w)("content")],Pt.prototype,"castContent",null),(0,s.Cg)([(0,y.w)("content",["description","fieldInfos","popupElements","mediaInfos","showAttachments","relatedRecordsInfo"])],Pt.prototype,"readContent",null),(0,s.Cg)([(0,m.K)("web-scene","content",{popupElements:{type:n.A.ofType(Mt)},showAttachments:{type:Boolean},mediaInfos:{type:n.A.ofType(nt)},description:{type:String},relatedRecordsInfo:{type:Nt}})],Pt.prototype,"writeWebSceneContent",null),(0,s.Cg)([(0,m.K)("content",{popupElements:{type:n.A.ofType(Ct)},showAttachments:{type:Boolean},mediaInfos:{type:n.A.ofType(nt)},description:{type:String},relatedRecordsInfo:{type:Nt}})],Pt.prototype,"writeWebMapContent",null),(0,s.Cg)([(0,c.MZ)({type:[Zt.A],json:{write:!0}})],Pt.prototype,"expressionInfos",void 0),(0,s.Cg)([(0,c.MZ)({type:[Ft.A]})],Pt.prototype,"fieldInfos",void 0),(0,s.Cg)([(0,m.K)("fieldInfos")],Pt.prototype,"writeFieldInfos",null),(0,s.Cg)([(0,c.MZ)({type:jt})],Pt.prototype,"layerOptions",void 0),(0,s.Cg)([(0,m.K)("layerOptions")],Pt.prototype,"writeLayerOptions",null),(0,s.Cg)([(0,c.MZ)({type:Boolean,json:{read:{source:"showLastEditInfo"},write:{target:"showLastEditInfo"},default:!0}})],Pt.prototype,"lastEditInfoEnabled",void 0),(0,s.Cg)([(0,c.MZ)()],Pt.prototype,"outFields",void 0),(0,s.Cg)([(0,c.MZ)()],Pt.prototype,"overwriteActions",void 0),(0,s.Cg)([(0,c.MZ)()],Pt.prototype,"returnGeometry",void 0),(0,s.Cg)([(0,c.MZ)({json:{type:String}})],Pt.prototype,"title",void 0),(0,s.Cg)([(0,m.K)("title")],Pt.prototype,"writeTitle",null),Pt=(0,s.Cg)([(0,h.$)("esri.PopupTemplate")],Pt);const Kt=Pt},39663:(t,e,o)=>{o.d(e,{$P:()=>J,HK:()=>x,PK:()=>O,fg:()=>M,qH:()=>Z});var i=o(31635),s=o(10107),r=o(64108),n=o(69540),l=o(25482);let a=class extends((0,n.OU)(l.o)){constructor(t){super(t),this.type=null}};(0,i.Cg)([(0,s.MZ)({type:["date-time","number"],nonNullable:!0,readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],a.prototype,"type",void 0),a=(0,i.Cg)([(0,r.$)("esri.layers.support.FieldFormat")],a);const p=a,d="auto";let c=class extends p{constructor(t){super(t),this.dateStyle=null,this.hour12=d,this.month=null,this.timeStyle=null,this.type="date-time",this.year=null}};(0,i.Cg)([(0,s.MZ)({type:["full","long","medium","short"],json:{write:!0}})],c.prototype,"dateStyle",void 0),(0,i.Cg)([(0,s.MZ)({type:["always","auto","never"],nonNullable:!0,json:{default:d,write:!0}})],c.prototype,"hour12",void 0),(0,i.Cg)([(0,s.MZ)({type:["long","short"],json:{write:!0}})],c.prototype,"month",void 0),(0,i.Cg)([(0,s.MZ)({type:["full","long","medium","short"],json:{write:!0}})],c.prototype,"timeStyle",void 0),(0,i.Cg)([(0,s.MZ)({type:["date-time"]})],c.prototype,"type",void 0),(0,i.Cg)([(0,s.MZ)({type:["numeric"],json:{write:!0}})],c.prototype,"year",void 0),c=(0,i.Cg)([(0,r.$)("esri.layers.support.DateTimeFieldFormat")],c);const u=c;var y=o(30524),h=o(56507);const m={min:0,max:20},g="decimal",f="auto";let v=class extends p{constructor(t){super(t),this.maximumFractionDigits=3,this.minimumFractionDigits=0,this.style=g,this.type="number",this.useGrouping=f}};(0,i.Cg)([(0,s.MZ)({type:h.jz,nonNullable:!0,range:m,json:{default:3,write:!0}})],v.prototype,"maximumFractionDigits",void 0),(0,i.Cg)([(0,s.MZ)({type:h.jz,nonNullable:!0,range:m,json:{default:0,write:!0}})],v.prototype,"minimumFractionDigits",void 0),(0,i.Cg)([(0,s.MZ)({type:["decimal"],nonNullable:!0,json:{default:g,write:!0}})],v.prototype,"style",void 0),(0,i.Cg)([(0,s.MZ)({type:["number"]})],v.prototype,"type",void 0),(0,i.Cg)([(0,s.MZ)({type:["always","auto","never"],nonNullable:!0,json:{default:f,write:!0}})],v.prototype,"useGrouping",void 0),v=(0,i.Cg)([(0,r.$)("esri.layers.support.NumberFieldFormat")],v);const w=v;var C=o(68780);const M={base:p,key:"type",errorContext:"field-configuration-field-format",typeMap:{"date-time":u,number:w}};function x(t,e){const{dateFormat:o}=t;if(!e)return o?j(t):I(t);if(!Z(e))return;const i={hour12:"always"};switch(e.type){case"integer":case"small-integer":case"big-integer":case"long":return F(t);case"single":case"double":return I(t);case"date":case"timestamp-offset":return o?j(t):J(e,i);case"date-only":return o?function(t){return new u({dateStyle:A(t),year:R(t),month:N(t)})}(t):J(e);case"time-only":return o?function(t){return new u({timeStyle:S(t),hour12:b(t)})}(t):J(e,i)}}function Z(t){return(0,y.WA)(t)||(0,y.vE)(t)||(0,y.zD)(t)||(0,y.OH)(t)||(0,y.Ah)(t)}function F(t){return new w({useGrouping:t.digitSeparator?"always":"never"})}function I(t){const e=F(t);return e.maximumFractionDigits=e.minimumFractionDigits=t.places??2,e}function j(t){return new u({dateStyle:A(t),year:R(t),month:N(t),timeStyle:S(t),hour12:b(t)})}function A(t){const{dateFormat:e}=t;return e?e.startsWith("short-date")?"short":e.startsWith("day-short-month-year")?"medium":e.startsWith("long-month-day-year")?"long":e.startsWith("long-date")?"full":null:null}function b(t){return t.dateFormat?.endsWith("-24")?"never":"always"}function N(t){switch(t.dateFormat){case"short-month-year":return"short";case"long-month-year":return"long";default:return null}}function S(t){const{dateFormat:e}=t;return e?e.includes("short-time")?"short":e.includes("long-time")?"medium":null:null}function R(t){switch(t.dateFormat){case"short-month-year":case"long-month-year":case"year":return"numeric";default:return null}}function O(t,e){const o="number"===t.type,i="date-time"===t.type;if(!e)return o?T(t):i?$(t):null;if(Z(e))switch(e.type){case"integer":case"small-integer":case"big-integer":case"long":return o?_(t):null;case"single":case"double":return o?T(t):null;case"date":case"timestamp-offset":return i?$(t):null;case"date-only":return i?function(t){let e;const o=E(t),i="numeric"===t.year?"year":null,s=k(t);return o?e=o:i&&s?e=`${s}-${i}`:i&&(e=i),e?new C.A({dateFormat:e}):null}(t):null;case"time-only":return i?function(t){let e;const o=B(t),i="never"===t.hour12?"24":null;return o&&i?e=`short-date-${o}-${i}`:o&&(e=`short-date-${o}`),e?new C.A({dateFormat:e}):null}(t):null}}function _(t){return new C.A({digitSeparator:"never"!==t.useGrouping})}function T(t){const e=_(t);return e.places=t.maximumFractionDigits,e}function $(t){let e;const o=E(t),i=B(t),s="never"===t.hour12?"24":null,r="numeric"===t.year?"year":null,n=k(t);return o&&i&&s?e=`${o}-${i}-${s}`:o&&i?e=`${o}-${i}`:o?e=o:r&&n?e=`${n}-${r}`:r&&(e=r),e?new C.A({dateFormat:e}):null}function E(t){switch(t.dateStyle){case"short":return"short-date";case"medium":return"day-short-month-year";case"long":return"long-month-day-year";case"full":return"long-date";default:return}}function B(t){return t.timeStyle&&("short"===t.timeStyle?"short-time":"long-time")}function k(t){switch(t.month){case"short":return"short-month";case"long":return"long-month";default:return}}function J(t,e){if(!Z(t))return;const o=e?.useGrouping??"auto",i=e?.hour12??"auto";switch(t.type){case"integer":case"small-integer":case"big-integer":case"long":return new w({maximumFractionDigits:0,minimumFractionDigits:0,useGrouping:o});case"single":case"double":return new w({maximumFractionDigits:2,minimumFractionDigits:0,useGrouping:o});case"date":case"timestamp-offset":return new u({dateStyle:"short",timeStyle:"short",hour12:i});case"date-only":return new u({dateStyle:"short"});case"time-only":return new u({timeStyle:"short",hour12:i})}}},41227:(t,e,o)=>{o.d(e,{A:()=>h});var i=o(31635),s=o(69540),r=o(66552),n=o(25482),l=o(10107),a=(o(44208),o(53966),o(87811),o(93223)),p=o(36005),d=o(64108),c=o(39663),u=o(68780);let y=class extends((0,s.OU)(n.o)){constructor(t){super(t),this.fieldName=null,this.isEditable=!0,this.label=null,this.statisticType=null,this.stringFieldOption="text-box",this.tooltip=null,this.visible=!0}set fieldFormat(t){this._set("fieldFormat",t),this._set("format",t?(0,c.PK)(t):null)}set format(t){this._set("format",t),this._set("fieldFormat",t?(0,c.HK)(t):null)}readFormat(t,e){if(!e.fieldFormat)return t?u.A.fromJSON(t):null}};(0,i.Cg)([(0,l.MZ)({value:null,types:c.fg,json:{write:{overridePolicy(t,e,o){const{fieldName:i}=this;return{enabled:!(!i||i.startsWith("expression/")||i.startsWith("relationships/")||!o?.writeFieldFormat)}}}}})],y.prototype,"fieldFormat",null),(0,i.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],y.prototype,"fieldName",void 0),(0,i.Cg)([(0,l.MZ)({value:null,type:u.A,json:{write:!0}})],y.prototype,"format",null),(0,i.Cg)([(0,p.w)("format")],y.prototype,"readFormat",null),(0,i.Cg)([(0,l.MZ)({type:Boolean,json:{write:{alwaysWriteDefaults:!0},default:!0}})],y.prototype,"isEditable",void 0),(0,i.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],y.prototype,"label",void 0),(0,i.Cg)([(0,l.MZ)({type:["count","sum","min","max","avg","stddev","var"],json:{write:!0}})],y.prototype,"statisticType",void 0),(0,i.Cg)([(0,a.e)(new r.J({richtext:"rich-text",textarea:"text-area",textbox:"text-box"}),{default:"text-box"})],y.prototype,"stringFieldOption",void 0),(0,i.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],y.prototype,"tooltip",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean,json:{write:!0}})],y.prototype,"visible",void 0),y=(0,i.Cg)([(0,d.$)("esri.popup.FieldInfo")],y);const h=y},49852:(t,e,o)=>{o.d(e,{A:()=>p});var i,s=o(31635),r=o(25482),n=o(10107),l=(o(44208),o(53966),o(87811),o(64108));let a=i=class extends r.o{constructor(t){super(t),this.field=null,this.order=null}clone(){return new i({field:this.field,order:this.order})}};(0,s.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],a.prototype,"field",void 0),(0,s.Cg)([(0,n.MZ)({type:["asc","desc"],json:{write:!0}})],a.prototype,"order",void 0),a=i=(0,s.Cg)([(0,l.$)("esri.popup.support.RelatedRecordsInfoFieldOrder")],a);const p=a},60950:(t,e,o)=>{o.d(e,{E_:()=>s,ym:()=>i});const i=Symbol("popupProvider");function s(t){return function(t){return!!t&&i in t}(t)?t[i]:null}},66159:(t,e,o)=>{o.d(e,{A:()=>c});var i,s=o(31635),r=o(4718),n=o(10107),l=(o(44208),o(53966),o(64108)),a=o(41227),p=o(84424);let d=i=class extends p.A{constructor(t){super(t),this.attributes=null,this.description=null,this.fieldInfos=null,this.title=null,this.type="fields"}clone(){return new i((0,r.o8)({attributes:this.attributes,description:this.description,fieldInfos:this.fieldInfos,title:this.title}))}};(0,s.Cg)([(0,n.MZ)({type:Object,json:{write:!0}})],d.prototype,"attributes",void 0),(0,s.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],d.prototype,"description",void 0),(0,s.Cg)([(0,n.MZ)({type:[a.A],json:{write:!0}})],d.prototype,"fieldInfos",void 0),(0,s.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],d.prototype,"title",void 0),(0,s.Cg)([(0,n.MZ)({type:["fields"],readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],d.prototype,"type",void 0),d=i=(0,s.Cg)([(0,l.$)("esri.popup.content.FieldsContent")],d);const c=d},68780:(t,e,o)=>{o.d(e,{A:()=>u});var i=o(31635),s=o(69540),r=o(25482),n=o(10107),l=o(56507),a=(o(44208),o(87811),o(93223)),p=o(64108),d=o(97770);let c=class extends((0,s.OU)(r.o)){constructor(t){super(t),this.dateFormat=null,this.digitSeparator=!1,this.places=null}};(0,i.Cg)([(0,a.e)(d._v)],c.prototype,"dateFormat",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,json:{write:!0}})],c.prototype,"digitSeparator",void 0),(0,i.Cg)([(0,n.MZ)({type:l.jz,json:{write:!0}})],c.prototype,"places",void 0),c=(0,i.Cg)([(0,p.$)("esri.popup.support.FieldInfoFormat")],c);const u=c},78553:(t,e,o)=>{o.d(e,{D:()=>r,p:()=>s});var i=o(56507);function s(t){const e=(0,i.Vr)(100*(1-t));return Math.max(0,Math.min(e,100))}function r(t){const e=1-t/100;return Math.max(0,Math.min(e,1))}},83342:(t,e,o)=>{o.d(e,{A:()=>d});var i=o(31635),s=o(69540),r=o(25482),n=o(10107),l=o(56507),a=(o(44208),o(87811),o(64108));let p=class extends((0,s.OU)(r.o)){constructor(t){super(t),this.title=null,this.description=null,this.type=null,this.associatedNetworkSourceId=null,this.associatedAssetGroup=null,this.associatedAssetType=null}};(0,i.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],p.prototype,"title",void 0),(0,i.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],p.prototype,"description",void 0),(0,i.Cg)([(0,n.MZ)({type:["attachment","connectivity","container","content","structure"],json:{write:!0}})],p.prototype,"type",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,json:{type:l.jz,write:!0}})],p.prototype,"associatedNetworkSourceId",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,json:{type:l.jz,write:!0}})],p.prototype,"associatedAssetGroup",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,json:{type:l.jz,write:!0}})],p.prototype,"associatedAssetType",void 0),p=(0,i.Cg)([(0,a.$)("esri.popup.support.UtilityNetworkAssociationType")],p);const d=p},84424:(t,e,o)=>{o.d(e,{A:()=>a});var i=o(31635),s=o(25482),r=o(10107),n=(o(44208),o(53966),o(87811),o(64108));let l=class extends s.o{constructor(t){super(t),this.type=null}};(0,i.Cg)([(0,r.MZ)({type:["attachments","custom","fields","media","text","expression","relationship","utility-network-associations"],readOnly:!0,json:{read:!1,write:!0}})],l.prototype,"type",void 0),l=(0,i.Cg)([(0,n.$)("esri.popup.content.Content")],l);const a=l},89893:(t,e,o)=>{o.d(e,{A:()=>h});var i=o(31635),s=o(69540),r=o(10107),n=(o(44208),o(53966),o(87811),o(64108)),l=o(84424),a=o(66552),p=o(25482);const d=new a.J({asc:"ascending",desc:"descending"});let c=class extends((0,s.OU)(p.o)){constructor(t){super(t),this.field=null,this.order="ascending"}};(0,i.Cg)([(0,r.MZ)({type:String,json:{write:!0}})],c.prototype,"field",void 0),(0,i.Cg)([(0,r.MZ)({type:d.apiValues,json:{type:d.jsonValues,read:d.read,write:d.write}})],c.prototype,"order",void 0),c=(0,i.Cg)([(0,n.$)("esri.popup.support.AttachmentsOrderByInfo")],c);const u=c;let y=class extends((0,s.OU)(l.A)){constructor(t){super(t),this.attachmentKeywords=null,this.attachmentTypes=null,this.description=null,this.displayType="auto",this.orderByFields=null,this.title=null,this.type="attachments"}};(0,i.Cg)([(0,r.MZ)({type:[String],json:{write:!0}})],y.prototype,"attachmentKeywords",void 0),(0,i.Cg)([(0,r.MZ)({type:[["application","audio","image","model","text","video"]],json:{write:!0}})],y.prototype,"attachmentTypes",void 0),(0,i.Cg)([(0,r.MZ)({type:String,json:{write:!0}})],y.prototype,"description",void 0),(0,i.Cg)([(0,r.MZ)({type:["auto","preview","list"],json:{write:!0}})],y.prototype,"displayType",void 0),(0,i.Cg)([(0,r.MZ)({type:[u],json:{write:!0}})],y.prototype,"orderByFields",void 0),(0,i.Cg)([(0,r.MZ)({type:String,json:{write:!0}})],y.prototype,"title",void 0),(0,i.Cg)([(0,r.MZ)({type:["attachments"],readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],y.prototype,"type",void 0),y=(0,i.Cg)([(0,n.$)("esri.popup.content.AttachmentsContent")],y);const h=y},93705:(t,e,o)=>{o.d(e,{A:()=>p});var i,s=o(31635),r=o(25482),n=o(10107),l=(o(44208),o(53966),o(87811),o(64108));let a=i=class extends r.o{constructor(t){super(t),this.name=null,this.title=null,this.expression=null,this.returnType=null}clone(){return new i({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};(0,s.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],a.prototype,"name",void 0),(0,s.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],a.prototype,"title",void 0),(0,s.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],a.prototype,"expression",void 0),(0,s.Cg)([(0,n.MZ)({type:["string","number"],json:{write:!0}})],a.prototype,"returnType",void 0),a=i=(0,s.Cg)([(0,l.$)("esri.popup.ExpressionInfo")],a);const p=a}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2869],{37838:(t,e,o)=>{o.d(e,{A:()=>Kt});var i,s=o(31635),r=o(69540),n=o(7762),l=o(25482),a=o(4718),p=o(53966),d=o(74887),c=o(10107),u=o(79901),y=o(36005),h=o(64108),m=o(43937),g=o(56507),f=o(30524),v=o(89893),w=o(84424);o(44208);let C=i=class extends w.A{constructor(t){super(t),this.creator=null,this.destroyer=null,this.outFields=null,this.type="custom"}clone(){return new i({creator:this.creator,destroyer:this.destroyer,outFields:Array.isArray(this.outFields)?(0,a.o8)(this.outFields):null})}};(0,s.Cg)([(0,c.MZ)()],C.prototype,"creator",void 0),(0,s.Cg)([(0,c.MZ)()],C.prototype,"destroyer",void 0),(0,s.Cg)([(0,c.MZ)()],C.prototype,"outFields",void 0),(0,s.Cg)([(0,c.MZ)({type:["custom"],readOnly:!0})],C.prototype,"type",void 0),C=i=(0,s.Cg)([(0,h.$)("esri.popup.content.CustomContent")],C);const M=C;var x;o(87811);let F=x=class extends l.o{constructor(t){super(t),this.title=null,this.expression=null,this.returnType="dictionary"}clone(){return new x({title:this.title,expression:this.expression})}};(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],F.prototype,"title",void 0),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],F.prototype,"expression",void 0),(0,s.Cg)([(0,c.MZ)({type:["dictionary"],readOnly:!0,json:{read:!1,write:!0}})],F.prototype,"returnType",void 0),F=x=(0,s.Cg)([(0,h.$)("esri.popup.ElementExpressionInfo")],F);const Z=F;var I;let j=I=class extends w.A{constructor(t){super(t),this.expressionInfo=null,this.type="expression"}clone(){return new I({expressionInfo:this.expressionInfo?.clone()})}};(0,s.Cg)([(0,c.MZ)({type:Z,json:{write:!0}})],j.prototype,"expressionInfo",void 0),(0,s.Cg)([(0,c.MZ)({type:["expression"],readOnly:!0,json:{read:!1,write:!0}})],j.prototype,"type",void 0),j=I=(0,s.Cg)([(0,h.$)("esri.popup.content.ExpressionContent")],j);const A=j;var b=o(66159);let N=class extends l.o{constructor(t){super(t),this.altText=null,this.caption="",this.title="",this.type=null}};(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],N.prototype,"altText",void 0),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],N.prototype,"caption",void 0),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],N.prototype,"title",void 0),(0,s.Cg)([(0,c.MZ)({type:["image","bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],N.prototype,"type",void 0),N=(0,s.Cg)([(0,h.$)("esri.popup.content.mixins.MediaInfo")],N);const S=N;var R,_=o(68197),O=o(69622);let T=R=class extends O.A{constructor(t){super(t),this.color=null,this.fieldName=null,this.tooltip=null,this.value=null}clone(){return new R({color:this.color?.clone(),fieldName:this.fieldName,tooltip:this.tooltip,value:this.value})}};(0,s.Cg)([(0,c.MZ)()],T.prototype,"color",void 0),(0,s.Cg)([(0,c.MZ)()],T.prototype,"fieldName",void 0),(0,s.Cg)([(0,c.MZ)()],T.prototype,"tooltip",void 0),(0,s.Cg)([(0,c.MZ)()],T.prototype,"value",void 0),T=R=(0,s.Cg)([(0,h.$)("esri.popup.content.support.ChartMediaInfoValueSeries")],T);const $=T;var E;let B=E=class extends l.o{constructor(t){super(t),this.colors=null,this.fields=[],this.normalizeField=null,this.series=[],this.tooltipField=null}clone(){return new E({colors:(0,a.o8)(this.colors),fields:(0,a.o8)(this.fields),normalizeField:this.normalizeField,series:(0,a.o8)(this.series),tooltipField:this.tooltipField})}};(0,s.Cg)([(0,c.MZ)({type:[_.A],json:{type:[[g.jz]],write:!0}})],B.prototype,"colors",void 0),(0,s.Cg)([(0,c.MZ)({type:[String],json:{write:{isRequired:!0}}})],B.prototype,"fields",void 0),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],B.prototype,"normalizeField",void 0),(0,s.Cg)([(0,c.MZ)({type:[$],json:{read:!1}})],B.prototype,"series",void 0),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],B.prototype,"tooltipField",void 0),B=E=(0,s.Cg)([(0,h.$)("esri.popup.content.support.ChartMediaInfoValue")],B);const k=B;let J=class extends S{constructor(t){super(t),this.type=null,this.value=void 0}};(0,s.Cg)([(0,c.MZ)({type:["bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],J.prototype,"type",void 0),(0,s.Cg)([(0,c.MZ)({type:k,json:{write:{isRequired:!0}}})],J.prototype,"value",void 0),J=(0,s.Cg)([(0,h.$)("esri.popup.content.mixins.ChartMediaInfo")],J);const q=J,D=(0,o(66552).O)()({barchart:"bar-chart",columnchart:"column-chart",linechart:"line-chart",piechart:"pie-chart"});var U;let L=U=class extends q{constructor(t){super(t),this.type="bar-chart"}clone(){return new U({altText:this.altText,title:this.title,caption:this.caption,value:this.value?.clone()})}};(0,s.Cg)([(0,c.MZ)({type:["bar-chart"],readOnly:!0,json:{type:["barchart"],read:!1,write:{writer:D.write,isRequired:!0}}})],L.prototype,"type",void 0),L=U=(0,s.Cg)([(0,h.$)("esri.popup.content.BarChartMediaInfo")],L);const W=L;var z;let P=z=class extends q{constructor(t){super(t),this.type="column-chart"}clone(){return new z({altText:this.altText,title:this.title,caption:this.caption,value:this.value?.clone()})}};(0,s.Cg)([(0,c.MZ)({type:["column-chart"],readOnly:!0,json:{type:["columnchart"],read:!1,write:{writer:D.write,isRequired:!0}}})],P.prototype,"type",void 0),P=z=(0,s.Cg)([(0,h.$)("esri.popup.content.ColumnChartMediaInfo")],P);const K=P;var G;let V=G=class extends l.o{constructor(t){super(t),this.linkURL=null,this.sourceURL=null}clone(){return new G({linkURL:this.linkURL,sourceURL:this.sourceURL})}};(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],V.prototype,"linkURL",void 0),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:{isRequired:!0}}})],V.prototype,"sourceURL",void 0),V=G=(0,s.Cg)([(0,h.$)("esri.popup.content.support.ImageMediaInfoValue")],V);const H=V;var X;let Q=X=class extends S{constructor(t){super(t),this.refreshInterval=0,this.type="image",this.value=void 0}clone(){return new X({altText:this.altText,title:this.title,caption:this.caption,refreshInterval:this.refreshInterval,value:this.value?.clone()})}};(0,s.Cg)([(0,c.MZ)({type:Number,json:{write:!0}})],Q.prototype,"refreshInterval",void 0),(0,s.Cg)([(0,c.MZ)({type:["image"],readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],Q.prototype,"type",void 0),(0,s.Cg)([(0,c.MZ)({type:H,json:{write:{isRequired:!0}}})],Q.prototype,"value",void 0),Q=X=(0,s.Cg)([(0,h.$)("esri.popup.content.ImageMediaInfo")],Q);const Y=Q;var tt;let et=tt=class extends q{constructor(t){super(t),this.type="line-chart"}clone(){return new tt({altText:this.altText,title:this.title,caption:this.caption,value:this.value?.clone()})}};(0,s.Cg)([(0,c.MZ)({type:["line-chart"],readOnly:!0,json:{type:["linechart"],read:!1,write:{writer:D.write,isRequired:!0}}})],et.prototype,"type",void 0),et=tt=(0,s.Cg)([(0,h.$)("esri.popup.content.LineChartMediaInfo")],et);const ot=et;var it;let st=it=class extends q{constructor(t){super(t),this.type="pie-chart"}clone(){return new it({altText:this.altText,title:this.title,caption:this.caption,value:this.value?.clone()})}};(0,s.Cg)([(0,c.MZ)({type:["pie-chart"],readOnly:!0,json:{type:["piechart"],read:!1,write:{writer:D.write,isRequired:!0}}})],st.prototype,"type",void 0),st=it=(0,s.Cg)([(0,h.$)("esri.popup.content.PieChartMediaInfo")],st);const rt=st,nt={base:S,key:"type",defaultKeyValue:"image",typeMap:{"bar-chart":W,"column-chart":K,"line-chart":ot,"pie-chart":rt,image:Y}};var lt;let at=lt=class extends w.A{constructor(t){super(t),this.activeMediaInfoIndex=null,this.attributes=null,this.description=null,this.mediaInfos=null,this.title=null,this.type="media"}readMediaInfos(t){return t&&t.map(t=>"image"===t.type?Y.fromJSON(t):"barchart"===t.type?W.fromJSON(t):"columnchart"===t.type?K.fromJSON(t):"linechart"===t.type?ot.fromJSON(t):"piechart"===t.type?rt.fromJSON(t):void 0).filter(Boolean)}writeMediaInfos(t,e){e.mediaInfos=t&&t.map(t=>t.toJSON())}clone(){return new lt((0,a.o8)({activeMediaInfoIndex:this.activeMediaInfoIndex,attributes:this.attributes,description:this.description,mediaInfos:this.mediaInfos,title:this.title}))}};(0,s.Cg)([(0,c.MZ)()],at.prototype,"activeMediaInfoIndex",void 0),(0,s.Cg)([(0,c.MZ)({type:Object,json:{write:!0}})],at.prototype,"attributes",void 0),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],at.prototype,"description",void 0),(0,s.Cg)([(0,c.MZ)({types:[nt]})],at.prototype,"mediaInfos",void 0),(0,s.Cg)([(0,y.w)("mediaInfos")],at.prototype,"readMediaInfos",null),(0,s.Cg)([(0,m.K)("mediaInfos")],at.prototype,"writeMediaInfos",null),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],at.prototype,"title",void 0),(0,s.Cg)([(0,c.MZ)({type:["media"],readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],at.prototype,"type",void 0),at=lt=(0,s.Cg)([(0,h.$)("esri.popup.content.MediaContent")],at);const pt=at;var dt=o(49852);let ct=class extends((0,r.OU)(w.A)){constructor(t){super(t),this.description=null,this.displayCount=null,this.displayType="list",this.orderByFields=null,this.relationshipId=null,this.title=null,this.type="relationship"}};(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],ct.prototype,"description",void 0),(0,s.Cg)([(0,c.MZ)({type:Number,json:{type:g.jz,write:!0}})],ct.prototype,"displayCount",void 0),(0,s.Cg)([(0,c.MZ)({type:["list"],json:{write:{isRequired:!0}}})],ct.prototype,"displayType",void 0),(0,s.Cg)([(0,c.MZ)({type:[dt.A],json:{write:!0}})],ct.prototype,"orderByFields",void 0),(0,s.Cg)([(0,c.MZ)({type:Number,json:{type:g.jz,write:{isRequired:!0}}})],ct.prototype,"relationshipId",void 0),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],ct.prototype,"title",void 0),(0,s.Cg)([(0,c.MZ)({type:["relationship"],readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],ct.prototype,"type",void 0),ct=(0,s.Cg)([(0,h.$)("esri.popup.content.RelationshipContent")],ct);const ut=ct;var yt;let ht=yt=class extends w.A{constructor(t){super(t),this.text=null,this.type="text"}clone(){return new yt({text:this.text})}};(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],ht.prototype,"text",void 0),(0,s.Cg)([(0,c.MZ)({type:["text"],readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],ht.prototype,"type",void 0),ht=yt=(0,s.Cg)([(0,h.$)("esri.popup.content.TextContent")],ht);const mt=ht;var gt=o(93223),ft=o(83342);let vt=class extends((0,r.OU)(w.A)){constructor(t){super(t),this.description=null,this.displayCount=null,this.title=null,this.associationTypes=[],this.type="utility-network-associations"}};(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],vt.prototype,"description",void 0),(0,s.Cg)([(0,c.MZ)({type:Number,json:{type:g.jz,write:!0}})],vt.prototype,"displayCount",void 0),(0,s.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],vt.prototype,"title",void 0),(0,s.Cg)([(0,c.MZ)({type:[ft.A],json:{write:!0}})],vt.prototype,"associationTypes",void 0),(0,s.Cg)([(0,gt.e)({utilityNetworkAssociations:"utility-network-associations"})],vt.prototype,"type",void 0),vt=(0,s.Cg)([(0,h.$)("esri.popup.content.UtilityNetworkAssociationsContent")],vt);const wt=vt,Ct={base:null,key:"type",typeMap:{attachment:v.A,media:pt,text:mt,expression:A,field:b.A,relationship:ut,utilityNetworkAssociations:wt}},Mt={base:null,key:"type",typeMap:{attachment:v.A,media:pt,text:mt,expression:A,field:b.A,relationship:ut}};var xt,Ft=o(93705),Zt=o(41227);let It=xt=class extends l.o{constructor(t){super(t),this.returnTopmostRaster=null,this.showNoDataRecords=null}clone(){return new xt({showNoDataRecords:this.showNoDataRecords,returnTopmostRaster:this.returnTopmostRaster})}};(0,s.Cg)([(0,c.MZ)({type:Boolean,json:{write:!0}})],It.prototype,"returnTopmostRaster",void 0),(0,s.Cg)([(0,c.MZ)({type:Boolean,json:{write:!0}})],It.prototype,"showNoDataRecords",void 0),It=xt=(0,s.Cg)([(0,h.$)("esri.popup.LayerOptions")],It);const jt=It;var At;let bt=At=class extends l.o{constructor(t){super(t),this.showRelatedRecords=null,this.orderByFields=null}clone(){return new At({showRelatedRecords:this.showRelatedRecords,orderByFields:this.orderByFields?(0,a.o8)(this.orderByFields):null})}};(0,s.Cg)([(0,c.MZ)({type:Boolean,json:{write:!0}})],bt.prototype,"showRelatedRecords",void 0),(0,s.Cg)([(0,c.MZ)({type:[dt.A],json:{write:!0}})],bt.prototype,"orderByFields",void 0),bt=At=(0,s.Cg)([(0,h.$)("esri.popup.RelatedRecordsInfo")],bt);const Nt=bt;var St,Rt=o(4902);let _t=St=class extends((0,Rt.s)(O.A)){constructor(t){super(t),this.active=!1,this.className=null,this.disabled=!1,this.icon=null,this.id=null,this.indicator=!1,this.title=null,this.type=null,this.visible=!0}clone(){return new St({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible})}};(0,s.Cg)([(0,c.MZ)()],_t.prototype,"active",void 0),(0,s.Cg)([(0,c.MZ)()],_t.prototype,"className",void 0),(0,s.Cg)([(0,c.MZ)()],_t.prototype,"disabled",void 0),(0,s.Cg)([(0,c.MZ)()],_t.prototype,"icon",void 0),(0,s.Cg)([(0,c.MZ)()],_t.prototype,"id",void 0),(0,s.Cg)([(0,c.MZ)()],_t.prototype,"indicator",void 0),(0,s.Cg)([(0,c.MZ)()],_t.prototype,"title",void 0),(0,s.Cg)([(0,c.MZ)()],_t.prototype,"type",void 0),(0,s.Cg)([(0,c.MZ)()],_t.prototype,"visible",void 0),_t=St=(0,s.Cg)([(0,h.$)("esri.support.actions.ActionBase")],_t);const Ot=_t;var Tt;let $t=Tt=class extends Ot{constructor(t){super(t),this.image=null,this.type="button"}clone(){return new Tt({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image})}};(0,s.Cg)([(0,c.MZ)()],$t.prototype,"image",void 0),$t=Tt=(0,s.Cg)([(0,h.$)("esri.support.actions.ActionButton")],$t);const Et=$t;var Bt;let kt=Bt=class extends Ot{constructor(t){super(t),this.image=null,this.type="toggle",this.value=!1}clone(){return new Bt({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image,value:this.value})}};(0,s.Cg)([(0,c.MZ)()],kt.prototype,"image",void 0),(0,s.Cg)([(0,c.MZ)()],kt.prototype,"value",void 0),kt=Bt=(0,s.Cg)([(0,h.$)("esri.support.actions.ActionToggle")],kt);const Jt=kt,qt="relationships/",Dt="expression/",Ut=n.A.ofType({key:"type",defaultKeyValue:"button",base:Ot,typeMap:{button:Et,toggle:Jt}}),Lt={base:w.A,key:"type",typeMap:{media:pt,custom:M,text:mt,attachments:v.A,fields:b.A,expression:A,relationship:ut,utilityNetworkAssociations:wt}},Wt=new Set(["attachments","fields","media","text","expression","relationship"]),zt=new Set([...Wt,"utility-network-associations"]);let Pt=class extends((0,r.OU)(l.o)){constructor(t){super(t),this.actions=null,this.content="",this.expressionInfos=null,this.fieldInfos=null,this.layerOptions=null,this.lastEditInfoEnabled=!0,this.outFields=null,this.overwriteActions=!1,this.returnGeometry=!1,this.title=""}castContent(t){return Array.isArray(t)?t.map(t=>(0,g.aq)(Lt,t)):"string"==typeof t||"function"==typeof t||t instanceof HTMLElement||(0,d.$X)(t)?t:(p.A.getLogger(this).error("content error","unsupported content value",{value:t}),null)}readContent(t,e){const{popupElements:o}=e;return Array.isArray(o)&&o.length>0?this._readPopupInfoElements(e.description,e.mediaInfos,o):this._readPopupInfo(e)}writeWebSceneContent(t,e,o,i){this._writePopupTemplateContent(t,e,i)}writeWebMapContent(t,e,o,i){this._writePopupTemplateContent(t,e,i)}writeFieldInfos(t,e,o,i){const{content:s}=this,r=Array.isArray(s)?s:null,{writeFieldFormat:n,...l}=i||{};if(t){const o=r?r.filter(t=>"fields"===t.type):[],i=o.length&&o.every(t=>t.fieldInfos?.length);e.fieldInfos=t.filter(Boolean).map(t=>{const e=t.toJSON(l);return i&&(e.visible=!1),e})}if(r)for(const t of r)"fields"===t.type&&this._writeFieldsContent(t,e,l)}writeLayerOptions(t,e,o,i){e[o]=!t||null===t.showNoDataRecords&&null===t.returnTopmostRaster?null:t.toJSON(i)}writeTitle(t,e){e.title=t||""}async collectRequiredFields(t,e,o){const i=this.expressionInfos||[];await this._collectExpressionInfoFields(t,e,o,[...i,...this._getContentExpressionInfos(this.content,i)]),(0,f._w)(t,e,[...this.outFields||[],...this._getActionsFields(this.actions),...this._getTitleFields(this.title),...this._getContentFields(this.content)])}async getRequiredFields(t,e){const o=new Set;return await this.collectRequiredFields(o,t,e),[...o].sort()}_writePopupTemplateContent(t,e,o){"string"!=typeof t?Array.isArray(t)&&(e.popupElements=t.filter(t=>"web-scene"===o?.origin?Wt.has(t.type):zt.has(t.type)).map(t=>t?.toJSON(o)),e.popupElements.forEach(t=>{"attachments"===t.type?this._writeAttachmentContent(e):"media"===t.type?this._writeMediaContent(t,e):"text"===t.type?this._writeTextContent(t,e):"relationship"===t.type&&this._writeRelationshipContent(t,e)})):e.description=t}_writeFieldsContent(t,e,o){const i=t.fieldInfos;if(!Array.isArray(i)||!i.length)return;const s=e.fieldInfos;if(Array.isArray(s))for(const t of i){const e=s.find(e=>e.fieldName?.toLowerCase()===t.fieldName?.toLowerCase());e?e.visible=!0:s.push(t.toJSON(o))}else e.fieldInfos=i.map(t=>t.toJSON(o))}_writeAttachmentContent(t){t.showAttachments||(t.showAttachments=!0)}_writeRelationshipContent(t,e){const o=t.orderByFields?.map(e=>this._toFieldOrderJSON(e,t.relationshipId))||[],i=[...e.relatedRecordsInfo?.orderByFields||[],...o];e.relatedRecordsInfo={showRelatedRecords:!0,...i?.length&&{orderByFields:i}}}_writeTextContent(t,e){!e.description&&t.text&&(e.description=t.text)}_writeMediaContent(t,e){if(!Array.isArray(t.mediaInfos)||!t.mediaInfos.length)return;const o=(0,a.o8)(t.mediaInfos);Array.isArray(e.mediaInfos)?e.mediaInfos=[...e.mediaInfos,...o]:e.mediaInfos=o}_readPopupInfoElements(t,e,o){const i={description:!1,mediaInfos:!1};return o.map(o=>"media"===o.type?(o.mediaInfos||!e||i.mediaInfos||(o.mediaInfos=e,i.mediaInfos=!0),pt.fromJSON(o)):"text"===o.type?(o.text||!t||i.description||(o.text=t,i.description=!0),mt.fromJSON(o)):"attachments"===o.type?v.A.fromJSON(o):"fields"===o.type?b.A.fromJSON(o):"expression"===o.type?A.fromJSON(o):"relationship"===o.type?ut.fromJSON(o):"utilityNetworkAssociations"===o.type?wt.fromJSON(o):void 0).filter(Boolean)}_toRelationshipContent(t){const{field:e,order:o}=t;if(!e?.startsWith(qt))return null;const i=e.replace(qt,"").split("/");if(2!==i.length)return null;const s=parseInt(i[0],10),r=i[1];return!Number.isNaN(s)&&r?ut.fromJSON({relationshipId:s,orderByFields:[{field:r,order:o}]}):null}_toFieldOrderJSON(t,e){const{order:o,field:i}=t;return{field:`${qt}${e}/${i}`,order:o}}_readPopupInfo({description:t,mediaInfos:e,showAttachments:o,relatedRecordsInfo:i={showRelatedRecords:!1}}){const s=[];t?s.push(new mt({text:t})):s.push(new b.A),Array.isArray(e)&&e.length&&s.push(pt.fromJSON({mediaInfos:e})),o&&s.push(v.A.fromJSON({displayType:"auto"}));const{showRelatedRecords:r,orderByFields:n}=i;return r&&n?.length&&n.forEach(t=>{const e=this._toRelationshipContent(t);e&&s.push(e)}),s.length?s:t}_getContentElementFields(t){const e=t?.type;if("attachments"===e)return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description)];if("custom"===e)return t.outFields||[];if("fields"===e)return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description),...this._getFieldInfoFields(t.fieldInfos??this.fieldInfos)];if("media"===e){const e=t.mediaInfos||[];return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description),...e.reduce((t,e)=>[...t,...this._getMediaInfoFields(e)],[])]}return"text"===e?this._extractFieldNames(t.text):"relationship"===e||"utility-network-associations"===e?[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description)]:[]}_getMediaInfoFields(t){const{caption:e,title:o,value:i}=t,s=i||{},{fields:r,normalizeField:n,tooltipField:l,sourceURL:a,linkURL:p}=s,d=[...this._extractFieldNames(o),...this._extractFieldNames(e),...this._extractFieldNames(a),...this._extractFieldNames(p),...r??[]];return n&&d.push(n),l&&d.push(l),d}_getContentExpressionInfos(t,e){return Array.isArray(t)?t.reduce((t,e)=>[...t,..."expression"===e.type&&e.expressionInfo?[e.expressionInfo]:[]],e):[]}_getContentFields(t){return"string"==typeof t?this._extractFieldNames(t):Array.isArray(t)?t.reduce((t,e)=>[...t,...this._getContentElementFields(e)],[]):[]}async _collectExpressionInfoFields(t,e,o,i){i&&await Promise.all(i.map(i=>(0,f.Dx)(t,e,o,i.expression)))}_getFieldInfoFields(t){return t?t.filter(({fieldName:t,visible:e})=>!(void 0!==e&&!e||!t||t.startsWith(qt)||t.startsWith(Dt))).map(t=>t.fieldName):[]}_getActionsFields(t){return t?t.toArray().reduce((t,e)=>[...t,...this._getActionFields(e)],[]):[]}_getActionFields(t){const{className:e,title:o,type:i}=t,s="button"===i||"toggle"===i?t.image:"";return[...this._extractFieldNames(o),...this._extractFieldNames(e),...this._extractFieldNames(s)]}_getTitleFields(t){return"string"==typeof t?this._extractFieldNames(t):[]}_extractFieldNames(t){return(0,f.nw)(t).filter(t=>!(t.startsWith(qt)||t.startsWith(Dt)))}};(0,s.Cg)([(0,c.MZ)({type:Ut})],Pt.prototype,"actions",void 0),(0,s.Cg)([(0,c.MZ)()],Pt.prototype,"content",void 0),(0,s.Cg)([(0,u.w)("content")],Pt.prototype,"castContent",null),(0,s.Cg)([(0,y.w)("content",["description","fieldInfos","popupElements","mediaInfos","showAttachments","relatedRecordsInfo"])],Pt.prototype,"readContent",null),(0,s.Cg)([(0,m.K)("web-scene","content",{popupElements:{type:n.A.ofType(Mt)},showAttachments:{type:Boolean},mediaInfos:{type:n.A.ofType(nt)},description:{type:String},relatedRecordsInfo:{type:Nt}})],Pt.prototype,"writeWebSceneContent",null),(0,s.Cg)([(0,m.K)("content",{popupElements:{type:n.A.ofType(Ct)},showAttachments:{type:Boolean},mediaInfos:{type:n.A.ofType(nt)},description:{type:String},relatedRecordsInfo:{type:Nt}})],Pt.prototype,"writeWebMapContent",null),(0,s.Cg)([(0,c.MZ)({type:[Ft.A],json:{write:!0}})],Pt.prototype,"expressionInfos",void 0),(0,s.Cg)([(0,c.MZ)({type:[Zt.A]})],Pt.prototype,"fieldInfos",void 0),(0,s.Cg)([(0,m.K)("fieldInfos")],Pt.prototype,"writeFieldInfos",null),(0,s.Cg)([(0,c.MZ)({type:jt})],Pt.prototype,"layerOptions",void 0),(0,s.Cg)([(0,m.K)("layerOptions")],Pt.prototype,"writeLayerOptions",null),(0,s.Cg)([(0,c.MZ)({type:Boolean,json:{read:{source:"showLastEditInfo"},write:{target:"showLastEditInfo"},default:!0}})],Pt.prototype,"lastEditInfoEnabled",void 0),(0,s.Cg)([(0,c.MZ)()],Pt.prototype,"outFields",void 0),(0,s.Cg)([(0,c.MZ)()],Pt.prototype,"overwriteActions",void 0),(0,s.Cg)([(0,c.MZ)()],Pt.prototype,"returnGeometry",void 0),(0,s.Cg)([(0,c.MZ)({json:{type:String}})],Pt.prototype,"title",void 0),(0,s.Cg)([(0,m.K)("title")],Pt.prototype,"writeTitle",null),Pt=(0,s.Cg)([(0,h.$)("esri.PopupTemplate")],Pt);const Kt=Pt},39663:(t,e,o)=>{o.d(e,{$P:()=>J,HK:()=>x,PK:()=>_,fg:()=>M,qH:()=>F});var i=o(31635),s=o(10107),r=o(64108),n=o(69540),l=o(25482);let a=class extends((0,n.OU)(l.o)){constructor(t){super(t),this.type=null}};(0,i.Cg)([(0,s.MZ)({type:["date-time","number"],nonNullable:!0,readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],a.prototype,"type",void 0),a=(0,i.Cg)([(0,r.$)("esri.layers.support.FieldFormat")],a);const p=a,d="auto";let c=class extends p{constructor(t){super(t),this.dateStyle=null,this.hour12=d,this.month=null,this.timeStyle=null,this.type="date-time",this.year=null}};(0,i.Cg)([(0,s.MZ)({type:["full","long","medium","short"],json:{write:!0}})],c.prototype,"dateStyle",void 0),(0,i.Cg)([(0,s.MZ)({type:["always","auto","never"],nonNullable:!0,json:{default:d,write:!0}})],c.prototype,"hour12",void 0),(0,i.Cg)([(0,s.MZ)({type:["long","short"],json:{write:!0}})],c.prototype,"month",void 0),(0,i.Cg)([(0,s.MZ)({type:["full","long","medium","short"],json:{write:!0}})],c.prototype,"timeStyle",void 0),(0,i.Cg)([(0,s.MZ)({type:["date-time"]})],c.prototype,"type",void 0),(0,i.Cg)([(0,s.MZ)({type:["numeric"],json:{write:!0}})],c.prototype,"year",void 0),c=(0,i.Cg)([(0,r.$)("esri.layers.support.DateTimeFieldFormat")],c);const u=c;var y=o(30524),h=o(56507);const m={min:0,max:20},g="decimal",f="auto";let v=class extends p{constructor(t){super(t),this.maximumFractionDigits=3,this.minimumFractionDigits=0,this.style=g,this.type="number",this.useGrouping=f}};(0,i.Cg)([(0,s.MZ)({type:h.jz,nonNullable:!0,range:m,json:{default:3,write:!0}})],v.prototype,"maximumFractionDigits",void 0),(0,i.Cg)([(0,s.MZ)({type:h.jz,nonNullable:!0,range:m,json:{default:0,write:!0}})],v.prototype,"minimumFractionDigits",void 0),(0,i.Cg)([(0,s.MZ)({type:["decimal"],nonNullable:!0,json:{default:g,write:!0}})],v.prototype,"style",void 0),(0,i.Cg)([(0,s.MZ)({type:["number"]})],v.prototype,"type",void 0),(0,i.Cg)([(0,s.MZ)({type:["always","auto","never"],nonNullable:!0,json:{default:f,write:!0}})],v.prototype,"useGrouping",void 0),v=(0,i.Cg)([(0,r.$)("esri.layers.support.NumberFieldFormat")],v);const w=v;var C=o(68780);const M={base:p,key:"type",errorContext:"field-configuration-field-format",typeMap:{"date-time":u,number:w}};function x(t,e){const{dateFormat:o}=t;if(!e)return o?j(t):I(t);if(!F(e))return;const i={hour12:"always"};switch(e.type){case"integer":case"small-integer":case"big-integer":case"long":return Z(t);case"single":case"double":return I(t);case"date":case"timestamp-offset":return o?j(t):J(e,i);case"date-only":return o?function(t){return new u({dateStyle:A(t),year:R(t),month:N(t)})}(t):J(e);case"time-only":return o?function(t){return new u({timeStyle:S(t),hour12:b(t)})}(t):J(e,i)}}function F(t){return(0,y.WA)(t)||(0,y.vE)(t)||(0,y.zD)(t)||(0,y.OH)(t)||(0,y.Ah)(t)}function Z(t){return new w({useGrouping:t.digitSeparator?"always":"never"})}function I(t){const e=Z(t);return e.maximumFractionDigits=e.minimumFractionDigits=t.places??2,e}function j(t){return new u({dateStyle:A(t),year:R(t),month:N(t),timeStyle:S(t),hour12:b(t)})}function A(t){const{dateFormat:e}=t;return e?e.startsWith("short-date")?"short":e.startsWith("day-short-month-year")?"medium":e.startsWith("long-month-day-year")?"long":e.startsWith("long-date")?"full":null:null}function b(t){return t.dateFormat?.endsWith("-24")?"never":"always"}function N(t){switch(t.dateFormat){case"short-month-year":return"short";case"long-month-year":return"long";default:return null}}function S(t){const{dateFormat:e}=t;return e?e.includes("short-time")?"short":e.includes("long-time")?"medium":null:null}function R(t){switch(t.dateFormat){case"short-month-year":case"long-month-year":case"year":return"numeric";default:return null}}function _(t,e){const o="number"===t.type,i="date-time"===t.type;if(!e)return o?T(t):i?$(t):null;if(F(e))switch(e.type){case"integer":case"small-integer":case"big-integer":case"long":return o?O(t):null;case"single":case"double":return o?T(t):null;case"date":case"timestamp-offset":return i?$(t):null;case"date-only":return i?function(t){let e;const o=E(t),i="numeric"===t.year?"year":null,s=k(t);return o?e=o:i&&s?e=`${s}-${i}`:i&&(e=i),e?new C.A({dateFormat:e}):null}(t):null;case"time-only":return i?function(t){let e;const o=B(t),i="never"===t.hour12?"24":null;return o&&i?e=`short-date-${o}-${i}`:o&&(e=`short-date-${o}`),e?new C.A({dateFormat:e}):null}(t):null}}function O(t){return new C.A({digitSeparator:"never"!==t.useGrouping})}function T(t){const e=O(t);return e.places=t.maximumFractionDigits,e}function $(t){let e;const o=E(t),i=B(t),s="never"===t.hour12?"24":null,r="numeric"===t.year?"year":null,n=k(t);return o&&i&&s?e=`${o}-${i}-${s}`:o&&i?e=`${o}-${i}`:o?e=o:r&&n?e=`${n}-${r}`:r&&(e=r),e?new C.A({dateFormat:e}):null}function E(t){switch(t.dateStyle){case"short":return"short-date";case"medium":return"day-short-month-year";case"long":return"long-month-day-year";case"full":return"long-date";default:return}}function B(t){return t.timeStyle&&("short"===t.timeStyle?"short-time":"long-time")}function k(t){switch(t.month){case"short":return"short-month";case"long":return"long-month";default:return}}function J(t,e){if(!F(t))return;const o=e?.useGrouping??"auto",i=e?.hour12??"auto";switch(t.type){case"integer":case"small-integer":case"big-integer":case"long":return new w({maximumFractionDigits:0,minimumFractionDigits:0,useGrouping:o});case"single":case"double":return new w({maximumFractionDigits:2,minimumFractionDigits:0,useGrouping:o});case"date":case"timestamp-offset":return new u({dateStyle:"short",timeStyle:"short",hour12:i});case"date-only":return new u({dateStyle:"short"});case"time-only":return new u({timeStyle:"short",hour12:i})}}},41227:(t,e,o)=>{o.d(e,{A:()=>h});var i=o(31635),s=o(69540),r=o(66552),n=o(25482),l=o(10107),a=(o(44208),o(53966),o(87811),o(93223)),p=o(36005),d=o(64108),c=o(39663),u=o(68780);let y=class extends((0,s.OU)(n.o)){constructor(t){super(t),this.fieldName=null,this.isEditable=!0,this.label=null,this.statisticType=null,this.stringFieldOption="text-box",this.tooltip=null,this.visible=!0}set fieldFormat(t){this._set("fieldFormat",t),this._set("format",t?(0,c.PK)(t):null)}set format(t){this._set("format",t),this._set("fieldFormat",t?(0,c.HK)(t):null)}readFormat(t,e){if(!e.fieldFormat)return t?u.A.fromJSON(t):null}clone(){const t=super.clone();return t._set("format",this.format?.clone()),t._set("fieldFormat",this.fieldFormat?.clone()),t}};(0,i.Cg)([(0,l.MZ)({value:null,clonable:!1,types:c.fg,json:{write:{overridePolicy(t,e,o){const{fieldName:i}=this;return{enabled:!(!i||i.startsWith("expression/")||i.startsWith("relationships/")||!o?.writeFieldFormat)}}}}})],y.prototype,"fieldFormat",null),(0,i.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],y.prototype,"fieldName",void 0),(0,i.Cg)([(0,l.MZ)({value:null,clonable:!1,type:u.A,json:{write:!0}})],y.prototype,"format",null),(0,i.Cg)([(0,p.w)("format")],y.prototype,"readFormat",null),(0,i.Cg)([(0,l.MZ)({type:Boolean,json:{write:{alwaysWriteDefaults:!0},default:!0}})],y.prototype,"isEditable",void 0),(0,i.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],y.prototype,"label",void 0),(0,i.Cg)([(0,l.MZ)({type:["count","sum","min","max","avg","stddev","var"],json:{write:!0}})],y.prototype,"statisticType",void 0),(0,i.Cg)([(0,a.e)(new r.J({richtext:"rich-text",textarea:"text-area",textbox:"text-box"}),{default:"text-box"})],y.prototype,"stringFieldOption",void 0),(0,i.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],y.prototype,"tooltip",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean,json:{write:!0}})],y.prototype,"visible",void 0),y=(0,i.Cg)([(0,d.$)("esri.popup.FieldInfo")],y);const h=y},49852:(t,e,o)=>{o.d(e,{A:()=>p});var i,s=o(31635),r=o(25482),n=o(10107),l=(o(44208),o(53966),o(87811),o(64108));let a=i=class extends r.o{constructor(t){super(t),this.field=null,this.order=null}clone(){return new i({field:this.field,order:this.order})}};(0,s.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],a.prototype,"field",void 0),(0,s.Cg)([(0,n.MZ)({type:["asc","desc"],json:{write:!0}})],a.prototype,"order",void 0),a=i=(0,s.Cg)([(0,l.$)("esri.popup.support.RelatedRecordsInfoFieldOrder")],a);const p=a},60950:(t,e,o)=>{o.d(e,{E_:()=>s,ym:()=>i});const i=Symbol("popupProvider");function s(t){return function(t){return!!t&&i in t}(t)?t[i]:null}},66159:(t,e,o)=>{o.d(e,{A:()=>c});var i,s=o(31635),r=o(4718),n=o(10107),l=(o(44208),o(53966),o(64108)),a=o(41227),p=o(84424);let d=i=class extends p.A{constructor(t){super(t),this.attributes=null,this.description=null,this.fieldInfos=null,this.title=null,this.type="fields"}clone(){return new i((0,r.o8)({attributes:this.attributes,description:this.description,fieldInfos:this.fieldInfos,title:this.title}))}};(0,s.Cg)([(0,n.MZ)({type:Object,json:{write:!0}})],d.prototype,"attributes",void 0),(0,s.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],d.prototype,"description",void 0),(0,s.Cg)([(0,n.MZ)({type:[a.A],json:{write:!0}})],d.prototype,"fieldInfos",void 0),(0,s.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],d.prototype,"title",void 0),(0,s.Cg)([(0,n.MZ)({type:["fields"],readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],d.prototype,"type",void 0),d=i=(0,s.Cg)([(0,l.$)("esri.popup.content.FieldsContent")],d);const c=d},68780:(t,e,o)=>{o.d(e,{A:()=>u});var i=o(31635),s=o(69540),r=o(25482),n=o(10107),l=o(56507),a=(o(44208),o(87811),o(93223)),p=o(64108),d=o(97770);let c=class extends((0,s.OU)(r.o)){constructor(t){super(t),this.dateFormat=null,this.digitSeparator=!1,this.places=null}};(0,i.Cg)([(0,a.e)(d._v)],c.prototype,"dateFormat",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,json:{write:!0}})],c.prototype,"digitSeparator",void 0),(0,i.Cg)([(0,n.MZ)({type:l.jz,json:{write:!0}})],c.prototype,"places",void 0),c=(0,i.Cg)([(0,p.$)("esri.popup.support.FieldInfoFormat")],c);const u=c},78553:(t,e,o)=>{o.d(e,{D:()=>r,p:()=>s});var i=o(56507);function s(t){const e=(0,i.Vr)(100*(1-t));return Math.max(0,Math.min(e,100))}function r(t){const e=1-t/100;return Math.max(0,Math.min(e,1))}},83342:(t,e,o)=>{o.d(e,{A:()=>d});var i=o(31635),s=o(69540),r=o(25482),n=o(10107),l=o(56507),a=(o(44208),o(87811),o(64108));let p=class extends((0,s.OU)(r.o)){constructor(t){super(t),this.title=null,this.description=null,this.type=null,this.associatedNetworkSourceId=null,this.associatedAssetGroup=null,this.associatedAssetType=null}};(0,i.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],p.prototype,"title",void 0),(0,i.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],p.prototype,"description",void 0),(0,i.Cg)([(0,n.MZ)({type:["attachment","connectivity","container","content","structure"],json:{write:!0}})],p.prototype,"type",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,json:{type:l.jz,write:!0}})],p.prototype,"associatedNetworkSourceId",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,json:{type:l.jz,write:!0}})],p.prototype,"associatedAssetGroup",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,json:{type:l.jz,write:!0}})],p.prototype,"associatedAssetType",void 0),p=(0,i.Cg)([(0,a.$)("esri.popup.support.UtilityNetworkAssociationType")],p);const d=p},84424:(t,e,o)=>{o.d(e,{A:()=>a});var i=o(31635),s=o(25482),r=o(10107),n=(o(44208),o(53966),o(87811),o(64108));let l=class extends s.o{constructor(t){super(t),this.type=null}};(0,i.Cg)([(0,r.MZ)({type:["attachments","custom","fields","media","text","expression","relationship","utility-network-associations"],readOnly:!0,json:{read:!1,write:!0}})],l.prototype,"type",void 0),l=(0,i.Cg)([(0,n.$)("esri.popup.content.Content")],l);const a=l},89893:(t,e,o)=>{o.d(e,{A:()=>h});var i=o(31635),s=o(69540),r=o(10107),n=(o(44208),o(53966),o(87811),o(64108)),l=o(84424),a=o(66552),p=o(25482);const d=new a.J({asc:"ascending",desc:"descending"});let c=class extends((0,s.OU)(p.o)){constructor(t){super(t),this.field=null,this.order="ascending"}};(0,i.Cg)([(0,r.MZ)({type:String,json:{write:!0}})],c.prototype,"field",void 0),(0,i.Cg)([(0,r.MZ)({type:d.apiValues,json:{type:d.jsonValues,read:d.read,write:d.write}})],c.prototype,"order",void 0),c=(0,i.Cg)([(0,n.$)("esri.popup.support.AttachmentsOrderByInfo")],c);const u=c;let y=class extends((0,s.OU)(l.A)){constructor(t){super(t),this.attachmentKeywords=null,this.attachmentTypes=null,this.description=null,this.displayType="auto",this.orderByFields=null,this.title=null,this.type="attachments"}};(0,i.Cg)([(0,r.MZ)({type:[String],json:{write:!0}})],y.prototype,"attachmentKeywords",void 0),(0,i.Cg)([(0,r.MZ)({type:[["application","audio","image","model","text","video"]],json:{write:!0}})],y.prototype,"attachmentTypes",void 0),(0,i.Cg)([(0,r.MZ)({type:String,json:{write:!0}})],y.prototype,"description",void 0),(0,i.Cg)([(0,r.MZ)({type:["auto","preview","list"],json:{write:!0}})],y.prototype,"displayType",void 0),(0,i.Cg)([(0,r.MZ)({type:[u],json:{write:!0}})],y.prototype,"orderByFields",void 0),(0,i.Cg)([(0,r.MZ)({type:String,json:{write:!0}})],y.prototype,"title",void 0),(0,i.Cg)([(0,r.MZ)({type:["attachments"],readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],y.prototype,"type",void 0),y=(0,i.Cg)([(0,n.$)("esri.popup.content.AttachmentsContent")],y);const h=y},93705:(t,e,o)=>{o.d(e,{A:()=>p});var i,s=o(31635),r=o(25482),n=o(10107),l=(o(44208),o(53966),o(87811),o(64108));let a=i=class extends r.o{constructor(t){super(t),this.name=null,this.title=null,this.expression=null,this.returnType=null}clone(){return new i({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};(0,s.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],a.prototype,"name",void 0),(0,s.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],a.prototype,"title",void 0),(0,s.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],a.prototype,"expression",void 0),(0,s.Cg)([(0,n.MZ)({type:["string","number"],json:{write:!0}})],a.prototype,"returnType",void 0),a=i=(0,s.Cg)([(0,l.$)("esri.popup.ExpressionInfo")],a);const p=a}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5804,9240],{13069:(e,t,r)=>{r.d(t,{AG:()=>i,lk:()=>s,vD:()=>n,yS:()=>a});const o="randomUUID"in crypto;function s(){if(o)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function a(){return`{${s().toUpperCase()}}`}function n(){return`{${s()}}`}function i(e){const t=e.toUpperCase();return e.startsWith("{")?t:`{${t}}`}},15804:(e,t,r)=>{r.d(t,{addOrUpdateResources:()=>i,bg:()=>d,cL:()=>u,fetchResources:()=>n,removeAllResources:()=>c,removeResource:()=>l});var o=r(78888),s=r(49186),a=r(84952);async function n(e,t={},r){await e.load(r);const o=(0,a.fj)(e.itemUrl,"resources"),{start:s=1,num:n=10,sortOrder:i="asc",sortField:l="resource"}=t,c={query:{start:s,num:n,sortOrder:i,sortField:l,token:e.apiKey},signal:r?.signal},p=await e.portal.request(o,c);return{total:p.total,nextStart:p.nextStart,resources:p.resources.map(({created:t,size:r,resource:o})=>({created:new Date(t),size:r,resource:e.resourceFromPath(o)}))}}async function i(e,t,r,o){const n=new Map;for(const{resource:e,content:o,compress:a,access:i}of t){if(!e.hasPath())throw new s.A(`portal-item-resource-${r}:invalid-path`,"Resource does not have a valid path");const[t,l]=p(e.path),c=`${t}/${a??""}/${i??""}`;n.has(c)||n.set(c,{prefix:t,compress:a,access:i,files:[]}),n.get(c).files.push({fileName:l,content:o})}await e.load(o);const i=(0,a.fj)(e.userItemUrl,"add"===r?"addResources":"updateResources");for(const{prefix:t,compress:r,access:s,files:a}of n.values()){const n=25;for(let l=0;l<a.length;l+=n){const c=a.slice(l,l+n),p=new FormData;t&&"."!==t&&p.append("resourcesPrefix",t),r&&p.append("compress","true"),s&&p.append("access",s);let u=0;for(const{fileName:e,content:t}of c)p.append("file"+ ++u,t,e);p.append("f","json"),await e.portal.request(i,{method:"post",body:p,signal:o?.signal})}}}async function l(e,t,r){if(!t.hasPath())throw new s.A("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(r);const o=(0,a.fj)(e.userItemUrl,"removeResources");await e.portal.request(o,{method:"post",query:{resource:t.path},signal:r?.signal}),t.portalItem=null}async function c(e,t){await e.load(t);const r=(0,a.fj)(e.userItemUrl,"removeResources");return e.portal.request(r,{method:"post",query:{deleteAll:!0},signal:t?.signal})}function p(e){const t=e.lastIndexOf("/");return-1===t?[".",e]:[e.slice(0,t),e.slice(t+1)]}async function u(e){return"blob"===e.type?e.blob:"json"===e.type?new Blob([e.jsonString],{type:"application/json"}):(await(0,o.A)(e.url,{responseType:"blob"})).data}function d(e,t){if(!e.hasPath())return null;const[r,,o]=function(e){const[t,r]=function(e){const t=(0,a.Zo)(e);return null==t?[e,""]:[e.slice(0,e.length-t.length-1),`.${t}`]}(e),[o,s]=p(t);return[o,s,r]}(e.path);return e.portalItem.resourceFromPath((0,a.fj)(r,t+o))}},26121:(e,t,r)=>{r.d(t,{ci:()=>n,dL:()=>s});var o=r(49186);async function s(e){const t=[];for(const r of e.allLayers)if("beforeSave"in r&&"function"==typeof r.beforeSave){const e=r.beforeSave();e&&t.push(e)}await Promise.allSettled(t)}r(77548);const a=new Set(["layer:unsupported","property:unsupported","symbol:unsupported","symbol-layer:unsupported","url:unsupported"]);function n(e,t,r){let s=(e.messages??[]).filter(({type:e})=>"error"===e).map(({name:e,message:t,details:r})=>new o.A(e,t,r));if(e.blockedRelativeUrls&&(s=s.concat(e.blockedRelativeUrls.map(e=>new o.A("url:unsupported",`Relative url '${e}' is not supported`)))),r){const{ignoreUnsupported:e,supplementalUnsupportedErrors:t=[],requiredPropertyChecksDisabled:o}=r;e&&(s=s.filter(({name:e})=>!(a.has(e)||t.includes(e)))),o&&(s=s.filter(e=>"web-document-write:property-required"!==e.name))}if(s.length>0)throw new o.A(t.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:s})}},46130:(e,t,r)=>{r.d(t,{v:()=>s});var o=r(76553);function s(e){e?.writtenProperties&&e.writtenProperties.forEach(({target:e,propName:t,newOrigin:r})=>{(0,o.H)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)})}},52136:(e,t,r)=>{r.d(t,{p:()=>n});var o=r(31635),s=r(10107),a=(r(44208),r(53966),r(87811),r(64108));const n=e=>{const t=e;let r=class extends t{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,o.Cg)([(0,s.MZ)({type:String})],r.prototype,"apiKey",null),r=(0,o.Cg)([(0,a.$)("esri.layers.mixins.APIKeyMixin")],r),r}},58947:(e,t,r)=>{r.d(t,{w:()=>A});var o=r(31635),s=r(78888),a=r(49186),n=r(53966),i=r(74887),l=r(10107),c=(r(44208),r(87811),r(36005)),p=r(64108),u=r(46130),d=r(5443),h=r(54239),y=r(16930),f=r(60694),m=r(10873),g=r(83898),v=r(73179);var w=r(20655),S=r(80812),x=r(88788),I=r(91682),b=r(26121);const A=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.url=null,this.indexInfo=null,this._debouncedSaveOperations=(0,i.sg)(async(e,t,r)=>{switch(e){case 0:return this._save(t);case 1:return this._saveAs(r,t)}})}readSpatialReference(e,t){return C(t)}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const o=null==e.spatialReference?{...e,spatialReference:C(t)}:e;return d.A.fromJSON(o,r)}const o=t.store,s=C(t);return null==s||null==o?.extent||!Array.isArray(o.extent)||o.extent.some(e=>e<R)?null:new d.A({xmin:o.extent[0],ymin:o.extent[1],xmax:o.extent[2],ymax:o.extent[3],spatialReference:s})}parseVersionString(e){const t={major:Number.NaN,minor:Number.NaN,versionString:e},r=e.split(".");return r.length>=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,o=null!=r.version?r.version.toString():"";return this.parseVersionString(o)}readTitlePortalItem(e){return"item-title"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){const r=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return this.url?(0,f.yG)(this.url,t.name):t.name;let o=t.name;if(!o&&this.url){const e=(0,f.qg)(this.url);null!=e&&(o=e.title)}return"item-title-and-service-name"===this.sublayerTitleMode&&r&&(o=r+" - "+o),(0,f.cr)(o)}get parsedUrl(){return(0,v.h)(this,{separator:"layers"})}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=(0,g.F)(this.parsedUrl?.path??"",this.rootNode,e,this.customParameters,this.apiKey,n.A.getLogger(this),t),null==this.fullExtent||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(e){if("page"===e?.type){const t=e.rootIndex%e.pageSize,r=e.rootPage?.nodes?.[t];if(null==r?.obb?.center||null==r.obb.halfSize)throw new a.A("sceneservice:invalid-node-page","Invalid node page.");if(r.obb.center[0]<R||null==this.fullExtent||this.fullExtent.hasZ)return;const o=r.obb.halfSize,s=r.obb.center[2],n=Math.sqrt(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]);this.fullExtent.zmin=s-n,this.fullExtent.zmax=s+n}else if("node"===e?.type){const t=e.rootNode?.mbs;if(!Array.isArray(t)||4!==t.length||t[0]<R)return;const r=t[2],o=t[3],{fullExtent:s}=this;s&&(s.zmin=r-o,s.zmax=r+o)}}async _fetchService(e){if(null==this.url)throw new a.A("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const t=await this._fetchFirstLayerId(e);null!=t&&(this.layerId=t)}return this._fetchServiceLayer(e)}async _fetchFirstLayerId(e){const t=await(0,s.A)(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(t.data&&Array.isArray(t.data.layers)&&t.data.layers.length>0)return t.data.layers[0].id}async _fetchServiceLayer(e){const t=await(0,s.A)(this.parsedUrl?.path??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});t.ssl&&this.url&&(this.url=this.url.replace(/^http:/i,"https:"));let r=!1;if(t.data.layerType&&"Voxel"===t.data.layerType&&(r=!0),r)return this._fetchVoxelServiceLayer();const o=t.data;this.read(o,this._getServiceContext()),this.validateLayer(o)}async _fetchVoxelServiceLayer(e){const t=(await(0,s.A)(this.parsedUrl?.path+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,this._getServiceContext()),this.validateLayer(t)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&"function"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}async _saveAs(e,t){const r={...O,...t};let o=S.default.from(e);if(!o)throw new a.A("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");o.id&&(o=o.clone(),o.id=null);const s=o.portal||w.A.getDefault();await this._ensureLoadBeforeSave(),o.type=U,o.portal=s;const n=(0,x.m)(o,"portal-item",!0),i={layers:[this.write({},n)]};return await Promise.all(n.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(i,n,r),this.url&&(o.url=this.url),o.title||(o.title=this.title),P(o,r,1),await s.signIn(),await s.user.addItem({item:o,folder:r?.folder,data:i}),await(0,I.r)(this.resourceReferences,n),this.portalItem=o,(0,u.v)(n),n.portalItem=o,o}async _save(e){const t={...O,...e};if(!this.portalItem)throw new a.A("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==U)throw new a.A("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${U}"`);await this._ensureLoadBeforeSave();const r=(0,x.m)(this.portalItem,"portal-item",!0),o={layers:[this.write({},r)]};return await Promise.all(r.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(o,r,t),this.url&&(this.portalItem.url=this.url),this.portalItem.title||(this.portalItem.title=this.title),P(this.portalItem,t,0),await(0,I.S)(this.portalItem,o,this.resourceReferences,r),(0,u.v)(r),this.portalItem}async _validateAgainstJSONSchema(e,t,r){const o=r?.validationOptions;(0,b.ci)(t,{errorName:"sceneservice:save"},{ignoreUnsupported:o?.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const s=o?.enabled,i=null;if(s&&i){const t=(await i()).validate(e,r.portalItemLayerType);if(!t.length)return;const s=`Layer item did not validate:\n${t.join("\n")}`;if(n.A.getLogger(this).error(`_validateAgainstJSONSchema(): ${s}`),"throw"===o.failPolicy){const e=t.map(e=>new a.A("sceneservice:schema-validation",e));throw new a.A("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:e})}}}};return(0,o.Cg)([(0,l.MZ)(m.id)],r.prototype,"id",void 0),(0,o.Cg)([(0,l.MZ)({type:y.A})],r.prototype,"spatialReference",void 0),(0,o.Cg)([(0,c.w)("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],r.prototype,"readSpatialReference",null),(0,o.Cg)([(0,l.MZ)({type:d.A})],r.prototype,"fullExtent",void 0),(0,o.Cg)([(0,c.w)("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],r.prototype,"readFullExtent",null),(0,o.Cg)([(0,l.MZ)({readOnly:!0,type:h.A})],r.prototype,"heightModelInfo",void 0),(0,o.Cg)([(0,l.MZ)({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],r.prototype,"minScale",void 0),(0,o.Cg)([(0,l.MZ)({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],r.prototype,"maxScale",void 0),(0,o.Cg)([(0,l.MZ)({readOnly:!0})],r.prototype,"version",void 0),(0,o.Cg)([(0,c.w)("version",["store.version"])],r.prototype,"readVersion",null),(0,o.Cg)([(0,l.MZ)({type:String,json:{read:{source:"copyrightText"}}})],r.prototype,"copyright",void 0),(0,o.Cg)([(0,l.MZ)({type:String,json:{read:!1}})],r.prototype,"sublayerTitleMode",void 0),(0,o.Cg)([(0,l.MZ)({type:String})],r.prototype,"title",void 0),(0,o.Cg)([(0,c.w)("portal-item","title")],r.prototype,"readTitlePortalItem",null),(0,o.Cg)([(0,c.w)("service","title",["name"])],r.prototype,"readTitleService",null),(0,o.Cg)([(0,l.MZ)({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],r.prototype,"layerId",void 0),(0,o.Cg)([(0,l.MZ)((0,v.b)({separator:"layers"}))],r.prototype,"url",void 0),(0,o.Cg)([(0,l.MZ)({readOnly:!0})],r.prototype,"parsedUrl",null),(0,o.Cg)([(0,l.MZ)({readOnly:!0})],r.prototype,"store",void 0),(0,o.Cg)([(0,l.MZ)({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],r.prototype,"rootNode",void 0),r=(0,o.Cg)([(0,p.$)("esri.layers.mixins.SceneService")],r),r},R=-1e38;function C(e){if(null!=e.spatialReference)return y.A.fromJSON(e.spatialReference);const t=e.store,r=t.indexCRS||t.geographicCRS,o=r&&parseInt(r.slice(r.lastIndexOf("/")+1),10);return null!=o?new y.A(o):null}function P(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const o=t.getTypeKeywords();for(const t of o)e.typeKeywords.push(t);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t),1===r&&(e.typeKeywords=e.typeKeywords.filter(e=>"Hosted Service"!==e)))}const U="Scene Service",O={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}}},76553:(e,t,r)=>{function o(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{H:()=>o})},83898:(e,t,r)=>{r.d(t,{F:()=>a});var o=r(78888),s=r(49186);async function a(e,t,r,a,n,i,l){let c=null;if(null!=r){const t=`${e}/nodepages/`,s=t+Math.floor(r.rootIndex/r.nodesPerPage);try{return{type:"page",rootPage:(await(0,o.A)(s,{query:{f:"json",...a,token:n},responseType:"json",signal:l})).data,rootIndex:r.rootIndex,pageSize:r.nodesPerPage,lodMetric:r.lodSelectionMetricType,urlPrefix:t}}catch(e){null!=i&&i.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",s,e),c=e}}if(!t)return null;const p=t?.split("/").pop(),u=`${e}/nodes/`,d=u+p;try{return{type:"node",rootNode:(await(0,o.A)(d,{query:{f:"json",...a,token:n},responseType:"json",signal:l})).data,urlPrefix:u}}catch(e){throw new s.A("sceneservice:root-node-missing","Root node missing.",{pageError:c,nodeError:e,url:d})}}},88788:(e,t,r)=>{r.d(t,{m:()=>n,v:()=>a});var o=r(84952),s=r(20655);function a(e,t){return{...i(e,t),readResourcePaths:[]}}function n(e,t,r){const s=(0,o.An)(e.itemUrl);return{...i(e,t),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:s?{rootPath:s.path,writtenUrls:[]}:null,resources:r?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function i(e,t){return{origin:t,url:(0,o.An)(e.itemUrl),portal:e.portal||s.A.getDefault(),portalItem:e}}},91682:(e,t,r)=>{r.d(t,{S:()=>l,r:()=>i});var o=r(49186),s=r(74887),a=r(13069),n=r(15804);async function i(e,t,r){const o=await c(e,t,r);await p(o,t,r)}async function l(e,t,r,o,s){const a=await c(r,o,s);await e.update({data:t}),await p(a,o,s)}async function c(e,t,i){if(!t?.resources)return;const l=t.portalItem===e.portalItem?new Set(e.paths):new Set;e.paths.length=0,e.portalItem=t.portalItem;const c=new Set(t.resources.toKeep.map(e=>e.resource.path)),p=new Set,u=[];c.forEach(t=>{l.delete(t),e.paths.push(t)});const d=[],h=[],y=[];for(const r of t.resources.toUpdate)if(l.delete(r.resource.path),c.has(r.resource.path)||p.has(r.resource.path)){const{resource:t,content:o,finish:s}=r,i=(0,n.bg)(t,(0,a.lk)());e.paths.push(i.path),d.push({resource:i,content:await(0,n.cL)(o),compress:r.compress}),s&&y.push(()=>s(i))}else{e.paths.push(r.resource.path),h.push({resource:r.resource,content:await(0,n.cL)(r.content),compress:r.compress});const t=r.finish;t&&y.push(()=>t(r.resource)),p.add(r.resource.path)}for(const r of t.resources.toAdd)if(e.paths.push(r.resource.path),l.has(r.resource.path))l.delete(r.resource.path);else{d.push({resource:r.resource,content:await(0,n.cL)(r.content),compress:r.compress});const e=r.finish;e&&y.push(()=>e(r.resource))}if(d.length||h.length){const{addOrUpdateResources:e}=await Promise.resolve().then(r.bind(r,15804));await e(t.portalItem,d,"add",i),await e(t.portalItem,h,"update",i)}if(y.forEach(e=>e()),0===u.length)return l;const f=await(0,s.Ol)(u);if((0,s.Te)(i),f.length>0)throw new o.A("save:resources","Failed to save one or more resources",{errors:f});return l}async function p(e,t,r){if(!e||!t.portalItem)return;const o=[];for(const s of e){const e=t.portalItem.resourceFromPath(s);o.push(e.portalItem.removeResource(e,r))}await(0,s.Lx)(o)}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5804,9240],{13069:(e,t,r)=>{r.d(t,{AG:()=>i,lk:()=>s,vD:()=>n,yS:()=>a});const o="randomUUID"in crypto;function s(){if(o)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function a(){return`{${s().toUpperCase()}}`}function n(){return`{${s()}}`}function i(e){const t=e.toUpperCase();return e.startsWith("{")?t:`{${t}}`}},15804:(e,t,r)=>{r.d(t,{addOrUpdateResources:()=>i,bg:()=>d,cL:()=>u,fetchResources:()=>n,removeAllResources:()=>c,removeResource:()=>l});var o=r(43773),s=r(49186),a=r(84952);async function n(e,t={},r){await e.load(r);const o=(0,a.fj)(e.itemUrl,"resources"),{start:s=1,num:n=10,sortOrder:i="asc",sortField:l="resource"}=t,c={query:{start:s,num:n,sortOrder:i,sortField:l,token:e.apiKey},signal:r?.signal},p=await e.portal.request(o,c);return{total:p.total,nextStart:p.nextStart,resources:p.resources.map(({created:t,size:r,resource:o})=>({created:new Date(t),size:r,resource:e.resourceFromPath(o)}))}}async function i(e,t,r,o){const n=new Map;for(const{resource:e,content:o,compress:a,access:i}of t){if(!e.hasPath())throw new s.A(`portal-item-resource-${r}:invalid-path`,"Resource does not have a valid path");const[t,l]=p(e.path),c=`${t}/${a??""}/${i??""}`;n.has(c)||n.set(c,{prefix:t,compress:a,access:i,files:[]}),n.get(c).files.push({fileName:l,content:o})}await e.load(o);const i=(0,a.fj)(e.userItemUrl,"add"===r?"addResources":"updateResources");for(const{prefix:t,compress:r,access:s,files:a}of n.values()){const n=25;for(let l=0;l<a.length;l+=n){const c=a.slice(l,l+n),p=new FormData;t&&"."!==t&&p.append("resourcesPrefix",t),r&&p.append("compress","true"),s&&p.append("access",s);let u=0;for(const{fileName:e,content:t}of c)p.append("file"+ ++u,t,e);p.append("f","json"),await e.portal.request(i,{method:"post",body:p,signal:o?.signal})}}}async function l(e,t,r){if(!t.hasPath())throw new s.A("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(r);const o=(0,a.fj)(e.userItemUrl,"removeResources");await e.portal.request(o,{method:"post",query:{resource:t.path},signal:r?.signal}),t.portalItem=null}async function c(e,t){await e.load(t);const r=(0,a.fj)(e.userItemUrl,"removeResources");return e.portal.request(r,{method:"post",query:{deleteAll:!0},signal:t?.signal})}function p(e){const t=e.lastIndexOf("/");return-1===t?[".",e]:[e.slice(0,t),e.slice(t+1)]}async function u(e){return"blob"===e.type?e.blob:"json"===e.type?new Blob([e.jsonString],{type:"application/json"}):(await(0,o.A)(e.url,{responseType:"blob"})).data}function d(e,t){if(!e.hasPath())return null;const[r,,o]=function(e){const[t,r]=function(e){const t=(0,a.Zo)(e);return null==t?[e,""]:[e.slice(0,e.length-t.length-1),`.${t}`]}(e),[o,s]=p(t);return[o,s,r]}(e.path);return e.portalItem.resourceFromPath((0,a.fj)(r,t+o))}},26121:(e,t,r)=>{r.d(t,{ci:()=>n,dL:()=>s});var o=r(49186);async function s(e){const t=[];for(const r of e.allLayers)if("beforeSave"in r&&"function"==typeof r.beforeSave){const e=r.beforeSave();e&&t.push(e)}await Promise.allSettled(t)}r(77548);const a=new Set(["layer:unsupported","property:unsupported","symbol:unsupported","symbol-layer:unsupported","url:unsupported"]);function n(e,t,r){let s=(e.messages??[]).filter(({type:e})=>"error"===e).map(({name:e,message:t,details:r})=>new o.A(e,t,r));if(e.blockedRelativeUrls&&(s=s.concat(e.blockedRelativeUrls.map(e=>new o.A("url:unsupported",`Relative url '${e}' is not supported`)))),r){const{ignoreUnsupported:e,supplementalUnsupportedErrors:t=[],requiredPropertyChecksDisabled:o}=r;e&&(s=s.filter(({name:e})=>!(a.has(e)||t.includes(e)))),o&&(s=s.filter(e=>"web-document-write:property-required"!==e.name))}if(s.length>0)throw new o.A(t.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:s})}},46130:(e,t,r)=>{r.d(t,{v:()=>s});var o=r(76553);function s(e){e?.writtenProperties&&e.writtenProperties.forEach(({target:e,propName:t,newOrigin:r})=>{(0,o.H)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)})}},52136:(e,t,r)=>{r.d(t,{p:()=>n});var o=r(31635),s=r(10107),a=(r(44208),r(53966),r(87811),r(64108));const n=e=>{const t=e;let r=class extends t{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,o.Cg)([(0,s.MZ)({type:String})],r.prototype,"apiKey",null),r=(0,o.Cg)([(0,a.$)("esri.layers.mixins.APIKeyMixin")],r),r}},58947:(e,t,r)=>{r.d(t,{w:()=>A});var o=r(31635),s=r(43773),a=r(49186),n=r(53966),i=r(74887),l=r(10107),c=(r(44208),r(87811),r(36005)),p=r(64108),u=r(46130),d=r(5443),h=r(54239),y=r(16930),f=r(60694),m=r(10873),g=r(83898),v=r(73179);var w=r(20655),S=r(80812),x=r(88788),I=r(91682),b=r(26121);const A=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.url=null,this.indexInfo=null,this._debouncedSaveOperations=(0,i.sg)(async(e,t,r)=>{switch(e){case 0:return this._save(t);case 1:return this._saveAs(r,t)}})}readSpatialReference(e,t){return C(t)}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const o=null==e.spatialReference?{...e,spatialReference:C(t)}:e;return d.A.fromJSON(o,r)}const o=t.store,s=C(t);return null==s||null==o?.extent||!Array.isArray(o.extent)||o.extent.some(e=>e<R)?null:new d.A({xmin:o.extent[0],ymin:o.extent[1],xmax:o.extent[2],ymax:o.extent[3],spatialReference:s})}parseVersionString(e){const t={major:Number.NaN,minor:Number.NaN,versionString:e},r=e.split(".");return r.length>=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,o=null!=r.version?r.version.toString():"";return this.parseVersionString(o)}readTitlePortalItem(e){return"item-title"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){const r=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return this.url?(0,f.yG)(this.url,t.name):t.name;let o=t.name;if(!o&&this.url){const e=(0,f.qg)(this.url);null!=e&&(o=e.title)}return"item-title-and-service-name"===this.sublayerTitleMode&&r&&(o=r+" - "+o),(0,f.cr)(o)}get parsedUrl(){return(0,v.h)(this,{separator:"layers"})}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=(0,g.F)(this.parsedUrl?.path??"",this.rootNode,e,this.customParameters,this.apiKey,n.A.getLogger(this),t),null==this.fullExtent||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(e){if("page"===e?.type){const t=e.rootIndex%e.pageSize,r=e.rootPage?.nodes?.[t];if(null==r?.obb?.center||null==r.obb.halfSize)throw new a.A("sceneservice:invalid-node-page","Invalid node page.");if(r.obb.center[0]<R||null==this.fullExtent||this.fullExtent.hasZ)return;const o=r.obb.halfSize,s=r.obb.center[2],n=Math.sqrt(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]);this.fullExtent.zmin=s-n,this.fullExtent.zmax=s+n}else if("node"===e?.type){const t=e.rootNode?.mbs;if(!Array.isArray(t)||4!==t.length||t[0]<R)return;const r=t[2],o=t[3],{fullExtent:s}=this;s&&(s.zmin=r-o,s.zmax=r+o)}}async _fetchService(e){if(null==this.url)throw new a.A("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const t=await this._fetchFirstLayerId(e);null!=t&&(this.layerId=t)}return this._fetchServiceLayer(e)}async _fetchFirstLayerId(e){const t=await(0,s.A)(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(t.data&&Array.isArray(t.data.layers)&&t.data.layers.length>0)return t.data.layers[0].id}async _fetchServiceLayer(e){const t=await(0,s.A)(this.parsedUrl?.path??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});t.ssl&&this.url&&(this.url=this.url.replace(/^http:/i,"https:"));let r=!1;if(t.data.layerType&&"Voxel"===t.data.layerType&&(r=!0),r)return this._fetchVoxelServiceLayer();const o=t.data;this.read(o,this._getServiceContext()),this.validateLayer(o)}async _fetchVoxelServiceLayer(e){const t=(await(0,s.A)(this.parsedUrl?.path+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,this._getServiceContext()),this.validateLayer(t)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&"function"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}async _saveAs(e,t){const r={...O,...t};let o=S.default.from(e);if(!o)throw new a.A("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");o.id&&(o=o.clone(),o.id=null);const s=o.portal||w.A.getDefault();await this._ensureLoadBeforeSave(),o.type=U,o.portal=s;const n=(0,x.m)(o,"portal-item",!0),i={layers:[this.write({},n)]};return await Promise.all(n.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(i,n,r),this.url&&(o.url=this.url),o.title||(o.title=this.title),P(o,r,1),await s.signIn(),await s.user.addItem({item:o,folder:r?.folder,data:i}),await(0,I.r)(this.resourceReferences,n),this.portalItem=o,(0,u.v)(n),n.portalItem=o,o}async _save(e){const t={...O,...e};if(!this.portalItem)throw new a.A("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==U)throw new a.A("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${U}"`);await this._ensureLoadBeforeSave();const r=(0,x.m)(this.portalItem,"portal-item",!0),o={layers:[this.write({},r)]};return await Promise.all(r.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(o,r,t),this.url&&(this.portalItem.url=this.url),this.portalItem.title||(this.portalItem.title=this.title),P(this.portalItem,t,0),await(0,I.S)(this.portalItem,o,this.resourceReferences,r),(0,u.v)(r),this.portalItem}async _validateAgainstJSONSchema(e,t,r){const o=r?.validationOptions;(0,b.ci)(t,{errorName:"sceneservice:save"},{ignoreUnsupported:o?.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const s=o?.enabled,i=null;if(s&&i){const t=(await i()).validate(e,r.portalItemLayerType);if(!t.length)return;const s=`Layer item did not validate:\n${t.join("\n")}`;if(n.A.getLogger(this).error(`_validateAgainstJSONSchema(): ${s}`),"throw"===o.failPolicy){const e=t.map(e=>new a.A("sceneservice:schema-validation",e));throw new a.A("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:e})}}}};return(0,o.Cg)([(0,l.MZ)(m.id)],r.prototype,"id",void 0),(0,o.Cg)([(0,l.MZ)({type:y.A})],r.prototype,"spatialReference",void 0),(0,o.Cg)([(0,c.w)("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],r.prototype,"readSpatialReference",null),(0,o.Cg)([(0,l.MZ)({type:d.A})],r.prototype,"fullExtent",void 0),(0,o.Cg)([(0,c.w)("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],r.prototype,"readFullExtent",null),(0,o.Cg)([(0,l.MZ)({readOnly:!0,type:h.A})],r.prototype,"heightModelInfo",void 0),(0,o.Cg)([(0,l.MZ)({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],r.prototype,"minScale",void 0),(0,o.Cg)([(0,l.MZ)({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],r.prototype,"maxScale",void 0),(0,o.Cg)([(0,l.MZ)({readOnly:!0})],r.prototype,"version",void 0),(0,o.Cg)([(0,c.w)("version",["store.version"])],r.prototype,"readVersion",null),(0,o.Cg)([(0,l.MZ)({type:String,json:{read:{source:"copyrightText"}}})],r.prototype,"copyright",void 0),(0,o.Cg)([(0,l.MZ)({type:String,json:{read:!1}})],r.prototype,"sublayerTitleMode",void 0),(0,o.Cg)([(0,l.MZ)({type:String})],r.prototype,"title",void 0),(0,o.Cg)([(0,c.w)("portal-item","title")],r.prototype,"readTitlePortalItem",null),(0,o.Cg)([(0,c.w)("service","title",["name"])],r.prototype,"readTitleService",null),(0,o.Cg)([(0,l.MZ)({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],r.prototype,"layerId",void 0),(0,o.Cg)([(0,l.MZ)((0,v.b)({separator:"layers"}))],r.prototype,"url",void 0),(0,o.Cg)([(0,l.MZ)({readOnly:!0})],r.prototype,"parsedUrl",null),(0,o.Cg)([(0,l.MZ)({readOnly:!0})],r.prototype,"store",void 0),(0,o.Cg)([(0,l.MZ)({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],r.prototype,"rootNode",void 0),r=(0,o.Cg)([(0,p.$)("esri.layers.mixins.SceneService")],r),r},R=-1e38;function C(e){if(null!=e.spatialReference)return y.A.fromJSON(e.spatialReference);const t=e.store,r=t.indexCRS||t.geographicCRS,o=r&&parseInt(r.slice(r.lastIndexOf("/")+1),10);return null!=o?new y.A(o):null}function P(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const o=t.getTypeKeywords();for(const t of o)e.typeKeywords.push(t);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t),1===r&&(e.typeKeywords=e.typeKeywords.filter(e=>"Hosted Service"!==e)))}const U="Scene Service",O={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}}},76553:(e,t,r)=>{function o(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{H:()=>o})},83898:(e,t,r)=>{r.d(t,{F:()=>a});var o=r(43773),s=r(49186);async function a(e,t,r,a,n,i,l){let c=null;if(null!=r){const t=`${e}/nodepages/`,s=t+Math.floor(r.rootIndex/r.nodesPerPage);try{return{type:"page",rootPage:(await(0,o.A)(s,{query:{f:"json",...a,token:n},responseType:"json",signal:l})).data,rootIndex:r.rootIndex,pageSize:r.nodesPerPage,lodMetric:r.lodSelectionMetricType,urlPrefix:t}}catch(e){null!=i&&i.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",s,e),c=e}}if(!t)return null;const p=t?.split("/").pop(),u=`${e}/nodes/`,d=u+p;try{return{type:"node",rootNode:(await(0,o.A)(d,{query:{f:"json",...a,token:n},responseType:"json",signal:l})).data,urlPrefix:u}}catch(e){throw new s.A("sceneservice:root-node-missing","Root node missing.",{pageError:c,nodeError:e,url:d})}}},88788:(e,t,r)=>{r.d(t,{m:()=>n,v:()=>a});var o=r(84952),s=r(20655);function a(e,t){return{...i(e,t),readResourcePaths:[]}}function n(e,t,r){const s=(0,o.An)(e.itemUrl);return{...i(e,t),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:s?{rootPath:s.path,writtenUrls:[]}:null,resources:r?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function i(e,t){return{origin:t,url:(0,o.An)(e.itemUrl),portal:e.portal||s.A.getDefault(),portalItem:e}}},91682:(e,t,r)=>{r.d(t,{S:()=>l,r:()=>i});var o=r(49186),s=r(74887),a=r(13069),n=r(15804);async function i(e,t,r){const o=await c(e,t,r);await p(o,t,r)}async function l(e,t,r,o,s){const a=await c(r,o,s);await e.update({data:t}),await p(a,o,s)}async function c(e,t,i){if(!t?.resources)return;const l=t.portalItem===e.portalItem?new Set(e.paths):new Set;e.paths.length=0,e.portalItem=t.portalItem;const c=new Set(t.resources.toKeep.map(e=>e.resource.path)),p=new Set,u=[];c.forEach(t=>{l.delete(t),e.paths.push(t)});const d=[],h=[],y=[];for(const r of t.resources.toUpdate)if(l.delete(r.resource.path),c.has(r.resource.path)||p.has(r.resource.path)){const{resource:t,content:o,finish:s}=r,i=(0,n.bg)(t,(0,a.lk)());e.paths.push(i.path),d.push({resource:i,content:await(0,n.cL)(o),compress:r.compress}),s&&y.push(()=>s(i))}else{e.paths.push(r.resource.path),h.push({resource:r.resource,content:await(0,n.cL)(r.content),compress:r.compress});const t=r.finish;t&&y.push(()=>t(r.resource)),p.add(r.resource.path)}for(const r of t.resources.toAdd)if(e.paths.push(r.resource.path),l.has(r.resource.path))l.delete(r.resource.path);else{d.push({resource:r.resource,content:await(0,n.cL)(r.content),compress:r.compress});const e=r.finish;e&&y.push(()=>e(r.resource))}if(d.length||h.length){const{addOrUpdateResources:e}=await Promise.resolve().then(r.bind(r,15804));await e(t.portalItem,d,"add",i),await e(t.portalItem,h,"update",i)}if(y.forEach(e=>e()),0===u.length)return l;const f=await(0,s.Ol)(u);if((0,s.Te)(i),f.length>0)throw new o.A("save:resources","Failed to save one or more resources",{errors:f});return l}async function p(e,t,r){if(!e||!t.portalItem)return;const o=[];for(const s of e){const e=t.portalItem.resourceFromPath(s);o.push(e.portalItem.removeResource(e,r))}await(0,s.Lx)(o)}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9203],{6518:(e,t,n)=>{n.d(t,{F:()=>a});var i=n(44208),r=n(75503),s=n(19419);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new r.wq(9,(0,i.A)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach((n,i)=>{e[t++]=i}),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(e=>this._idByBounds.has(e))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,s.Ie)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,n){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,n)}(this._index,e,e=>t(this._idByBounds.get(e)))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},8303:(e,t,n)=>{n.d(t,{A:()=>P});var i=n(31635),r=n(92602),s=n(70333),o=n(78888),a=n(60999),l=n(49186),c=n(53966),u=n(97768),h=n(74887),d=n(84952),p=n(10107),m=(n(44208),n(87811),n(36005)),f=n(64108),g=n(43937),y=n(77548),x=n(20655),_=n(80812),v=n(41318),w=n(10407);const P=e=>{const t=e;let P=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,u.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 _.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:i}=await n.e(1204).then(n.bind(n,41204));return(0,h.Te)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,h.zf)(e)||c.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,h.QP)(e),!0)))}async setUserPrivileges(e,t){if(!r.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:n,fullEdit:i},content:{updateItem:r}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",n),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",r)}catch(e){(0,h.QP)(e)}}async _fetchUserPrivileges(e,t){let n=this.portalItem;if(!e||!n||!n.loaded||n.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=!s.id?.findCredential(this.url),r=e===n.id;if(r&&n.portal.user)return this._getUserPrivileges(n,i);let o,a;if(r)o=n.portal.url;else try{o=await(0,y.wI)(this.url,t)}catch(e){(0,h.QP)(e)}if(!o||!(0,d.b8)(o,n.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;a=await(s.id?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,h.QP)(e)}const l=!0,c=!1,u=!1;if(!a)return{features:{edit:l,fullEdit:c},content:{updateItem:u}};try{if(r?await n.reload():(n=new _.default({id:e,portal:{url:o}}),await n.load(t)),n.portal.user)return this._getUserPrivileges(n,i)}catch(e){(0,h.QP)(e)}return{features:{edit:l,fullEdit:c},content:{updateItem:u}}}_getUserPrivileges(e,t){const n=(0,w.It)(e);return t&&(n.features.edit=!0),n}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,h.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=M.credential===t?M.user:await this._fetchEditingUser(e);return M.credential=t,M.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 i=`${n.owningSystemUrl}/sharing/rest`,r=x.A.getDefault();if(r&&r.loaded&&(0,d.S8)(r.restUrl)===(0,d.S8)(i))return r.user;const l=`${i}/community/self`,c=null!=e?e.signal:null,u=await(0,a.Ke)((0,o.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:c}));return u.ok?v.A.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const n=t?.portal,i=this.portalItem?.id&&(this.portalItem.portal||x.A.getDefault());return n&&i&&!(0,d.ut)(i.restUrl,n.restUrl)?(t.messages&&t.messages.push(new l.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,i.Cg)([(0,p.MZ)({type:_.default})],P.prototype,"portalItem",null),(0,i.Cg)([(0,m.w)("web-document","portalItem",["itemId"])],P.prototype,"readPortalItem",null),(0,i.Cg)([(0,g.K)("web-document","portalItem",{itemId:{type:String}})],P.prototype,"writePortalItem",null),(0,i.Cg)([(0,p.MZ)({clonable:!1})],P.prototype,"resourceReferences",void 0),(0,i.Cg)([(0,p.MZ)({type:Boolean,readOnly:!0})],P.prototype,"userHasEditingPrivileges",void 0),(0,i.Cg)([(0,p.MZ)({type:Boolean,readOnly:!0})],P.prototype,"userHasFullEditingPrivileges",void 0),(0,i.Cg)([(0,p.MZ)({type:Boolean,readOnly:!0})],P.prototype,"userHasUpdateItemPrivileges",void 0),P=(0,i.Cg)([(0,f.$)("esri.layers.mixins.PortalLayer")],P),P},M={credential:null,user:null}},10407:(e,t,n)=>{n.d(t,{It:()=>p,LG:()=>o,OM:()=>c,Sm:()=>u,Y:()=>a,bK:()=>l,mm:()=>d,sQ:()=>h});var i=n(91218),r=n(16930),s=n(28735);function o(e,t){if(!a(e,t)){const n=e.typeKeywords;n?n.push(t):e.typeKeywords=[t]}}function a(e,t){return!!e.typeKeywords?.includes(t)}function l(e){return a(e,d.HOSTED_SERVICE)}function c(e,t){const n=e.typeKeywords;if(n){const e=n.indexOf(t);e>-1&&n.splice(e,1)}}function u(e,t,n){n?o(e,t):c(e,t)}async function h(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=r.A.WGS84;return await(0,i.initializeProjection)(t,n),(0,i.project)(e,n)}(n)}const d={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 p(e){const{portal:t,isOrgItem:n,itemControl:i}=e,r=t.user?.privileges;let s=!r||r.includes("features:user:edit"),o=!!n&&!!r?.includes("features:user:fullEdit");const a="update"===i||"admin"===i;return a?o=s=!0:o&&(s=!0),{features:{edit:s,fullEdit:o},content:{updateItem:a}}}},11006:(e,t,n)=>{function i(e,t,n,i,s){r(e,t,n||0,i||e.length-1,s||o)}function r(e,t,n,i,o){for(;i>n;){if(i-n>600){var a=i-n+1,l=t-n+1,c=Math.log(a),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(a-u)/a)*(l-a/2<0?-1:1);r(e,t,Math.max(n,Math.floor(t-l*u/a+h)),Math.min(i,Math.floor(t+(a-l)*u/a+h)),o)}var d=e[t],p=n,m=i;for(s(e,n,t),o(e[i],d)>0&&s(e,n,i);p<m;){for(s(e,p,m),p++,m--;o(e[p],d)<0;)p++;for(;o(e[m],d)>0;)m--}0===o(e[n],d)?s(e,n,m):s(e,++m,i),m<=t&&(n=m+1),t<=m&&(i=m-1)}}function s(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function o(e,t){return e<t?-1:e>t?1:0}n.d(t,{q:()=>i})},13069:(e,t,n)=>{n.d(t,{AG:()=>a,lk:()=>r,vD:()=>o,yS:()=>s});const i="randomUUID"in crypto;function r(){if(i)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function s(){return`{${r().toUpperCase()}}`}function o(){return`{${r()}}`}function a(e){const t=e.toUpperCase();return e.startsWith("{")?t:`{${t}}`}},16494:(e,t,n)=>{n.d(t,{Nd:()=>a,W5:()=>o});var i=n(37330);const r=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"].reduce((e,t)=>(e[t]=[],e),{}),s=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],o=new i.I({whiteList:r,onTagAttr:(e,t,n)=>{const i=`${t}="${n}"`;if(s.includes(t))return i},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0),a=new i.I({whiteList:{br:[]},stripIgnoreTag:!0,escapeHtml:e=>e},!1)},21287:(e,t,n)=>{n.d(t,{M5:()=>h,eV:()=>u});var i=n(78888),r=n(49186),s=n(74887),o=n(84952),a=n(26306);let l=null,c=!0;function u(e,t,n,i){if(!t||!n)throw new Error("Cannot construct image data without dimensions");if(c)try{return new ImageData(e,t,n)}catch(e){c=!1}const r=function(e,t,n){return n||(l||(l=document.createElement("canvas"),l.width=1,l.height=1),n=l),n.getContext("2d").createImageData(e,t)}(t,n,i);return r.data.set(e,0),r}async function h(e,t){const{arrayBuffer:l,mediaType:c}=await async function(e,t){const n=(0,o.r$)(e);if(n?.isBase64)return{arrayBuffer:(0,a.M)(n.data),mediaType:n.mediaType};const r=await(0,i.A)(e,{responseType:"array-buffer",...t});return{arrayBuffer:r.data,mediaType:r.getHeader?.("Content-Type")??""}}(e,t),u="image/png"===c;if("image/gif"===c){const{isAnimatedGIF:e,parseGif:i}=await n.e(820).then(n.bind(n,10820));if(e(l))return i(l,t)}if(u){const{isAnimatedPNG:e,parseApng:i}=await n.e(2390).then(n.bind(n,22390));if(e(l))return i(l,t)}return async function(e,t){const n=window.URL.createObjectURL(e);try{const{data:e}=await(0,i.A)(n,{...t,responseType:"image"});return e}catch(e){if(!(0,s.zf)(e))throw new r.A("invalid-image",`Could not fetch requested image at ${n}`);throw e}finally{window.URL.revokeObjectURL(n)}}(new Blob([l],{type:c}),t)}},29203:(e,t,n)=>{n.r(t),n.d(t,{default:()=>tt});var i=n(31635),r=n(7762),s=n(49186),o=n(53966),a=n(25728),l=n(74887),c=n(10107),u=n(79901),h=(n(44208),n(87811),n(36005)),d=n(64108),p=n(43937),m=n(4146),f=n(63074),g=n(16131),y=n(8303),x=n(25036),_=n(25482),v=n(77690),w=n(29242),P=n(37585),M=n(38954);const I=(0,n(51850).vt)(),b=(0,w.vt)(),A=(0,w.vt)(),C=(0,w.vt)();function R(e,t,n){return(0,M.j)(I,t[0],t[1],1),(0,M.o)(I,I,(0,v.mg)(b,n)),0===I[2]?(0,P.hZ)(e,I[0],I[1]):(0,P.hZ)(e,I[0]/I[2],I[1]/I[2])}function S(e,t,n){return O(A,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]),O(C,n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]),(0,v.lw)(e,(0,v.KC)(A,A),C),0!==e[8]&&(e[0]/=e[8],e[1]/=e[8],e[2]/=e[8],e[3]/=e[8],e[4]/=e[8],e[5]/=e[8],e[6]/=e[8],e[7]/=e[8],e[8]/=e[8]),e}function O(e,t,n,i,r,s,o,a,l){(0,v.hZ)(e,t,i,s,n,r,o,1,1,1),(0,M.j)(I,a,l,1),(0,v.KC)(b,e);const[c,u,h]=(0,M.o)(I,I,(0,v.mg)(b,b));return(0,v.hZ)(b,c,0,0,0,u,0,0,0,h),(0,v.lw)(e,b,e)}var E=n(90629),L=n(48163),B=n(86738),T=n(39829),Z=n(91218),j=n(16930),Y=n(56560),U=n(69540);let X=class extends U.Pw{projectOrWarn(e,t){if(null==e)return e;const{geometry:n,pending:i}=(0,Z.projectOrLoad)(e,t);return i?null:i||n?n:(o.A.getLogger(this).warn("geometry could not be projected to the spatial reference",{georeference:this,geometry:e,sourceSpatialReference:e.spatialReference,targetSpatialReference:t}),null)}};X=(0,i.Cg)([(0,d.$)("esri.layers.support.GeoreferenceBase")],X);const H=(0,w.vt)(),N=(0,L.vt)();let $=class extends _.o{};(0,i.Cg)([(0,c.MZ)({type:Number,json:{write:{isRequired:!0}}})],$.prototype,"x",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{write:{isRequired:!0}}})],$.prototype,"y",void 0),$=(0,i.Cg)([(0,d.$)("esri.layers.support.ControlPointsGeoreference.ControlPointJSONType")],$);let z=class extends((0,_.T)(X)){constructor(e){super(e),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(e,t){const n=j.A.fromJSON(t.spatialReference),i=(0,w.fA)(...t.coefficients,1);return e.map(e=>((0,P.hZ)(N,e.x,e.y),R(N,N,i),{sourcePoint:e,mapPoint:new B.A({x:N[0],y:N[1],spatialReference:n})}))}writeControlPoints(e,t,n,i){if(null==this.transform){const e=new s.A("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration. Make sure the parent media element is loaded i.e. the ImageElement or VideoElement set as 'MediaLayer.source'.",{layer:i?.layer,georeference:this});return void(i?.messages?i.messages.push(e):o.A.getLogger(this).error(e.name,e.message))}null!=e&&V(e[0])&&(t.controlPoints=e.map(e=>{const t=e.sourcePoint;return{x:t.x,y:t.y}}),t.spatialReference=e[0].mapPoint.spatialReference.toJSON(),t.coefficients=this.transform.slice(0,8))}get coords(){if(null==this.controlPoints)return null;const e=this._updateTransform(H);if(null==e||!V(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return function(e,t,n,i){const r=(0,L.fA)(0,n),s=(0,L.fA)(0,0),o=(0,L.fA)(t,0),a=(0,L.fA)(t,n);return R(r,r,e),R(s,s,e),R(o,o,e),R(a,a,e),new T.A({rings:[[r,s,o,a,r]],spatialReference:i})}(e,this.width,this.height,t)}set coords(e){if(null==this.controlPoints||!V(this.controlPoints[0]))return;const t=this.controlPoints[0].mapPoint.spatialReference;if(null==(e=this.projectOrWarn(e,t)))return;const{width:n,height:i}=this,{rings:[[r,s,o,a]]}=e,l=new Y.A({sourcePoint:(0,E.tc)(0,i),mapPoint:new B.A({x:r[0],y:r[1],spatialReference:t})}),c=new Y.A({sourcePoint:(0,E.tc)(0,0),mapPoint:new B.A({x:s[0],y:s[1],spatialReference:t})}),u=new Y.A({sourcePoint:(0,E.tc)(n,0),mapPoint:new B.A({x:o[0],y:o[1],spatialReference:t})}),h=new Y.A({sourcePoint:(0,E.tc)(n,i),mapPoint:new B.A({x:a[0],y:a[1],spatialReference:t})});V(l)&&V(c)&&V(u)&&V(h)&&(te(H,l,c,u,h),this.controlPoints=this.controlPoints.map(({sourcePoint:e})=>((0,P.hZ)(N,e.x,e.y),R(N,N,H),{sourcePoint:e,mapPoint:new B.A({x:N[0],y:N[1],spatialReference:t})})))}get inverseTransform(){return null==this.transform?null:(0,v.B8)((0,w.vt)(),this.transform)}get transform(){return this._updateTransform()}toMap(e){if(null==e||null==this.transform||null==this.controlPoints||!V(this.controlPoints[0]))return null;(0,P.hZ)(N,e.x,e.y);const t=this.controlPoints[0].mapPoint.spatialReference;return R(N,N,this.transform),new B.A({x:N[0],y:N[1],spatialReference:t})}toSource(e){if(null==e||null==this.inverseTransform||null==this.controlPoints||!V(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return e=e.normalize(),null==(e=(0,Z.projectOrLoad)(e,t).geometry)?null:((0,P.hZ)(N,e.x,e.y),R(N,N,this.inverseTransform),(0,E.tc)(N[0],N[1]))}toSourceNormalized(e){const t=this.toSource(e);return null!=t&&(t.x/=this.width,t.y/=this.height),t}_updateTransform(e){const{controlPoints:t,width:n,height:i}=this;if(!(null!=t&&n>0&&i>0))return null;const[r,s,o,a]=t;if(!V(r))return null;const l=r.mapPoint.spatialReference,c=this._projectControlPoint(s,l),u=this._projectControlPoint(o,l),h=this._projectControlPoint(a,l);if(!c.valid||!u.valid||!h.valid)return null;if(!V(c.controlPoint))return null;null==e&&(e=(0,w.vt)());let d=null;return d=V(u.controlPoint)&&V(h.controlPoint)?te(e,r,c.controlPoint,u.controlPoint,h.controlPoint):V(u.controlPoint)?function(e,t,n,i){return ee(k,F,t),ee(G,q,n),ee(W,K,i),(0,P.Cc)(D,k,G,.5),(0,P.e$)(D,W,D,Math.PI),(0,P.Cc)(J,F,q,.5),(0,P.e$)(J,K,J,Math.PI),se(e,k,G,W,D,F,q,K,J)}(e,r,c.controlPoint,u.controlPoint):function(e,t,n){return ee(k,F,t),ee(G,q,n),(0,P.e$)(W,G,k,Q),(0,P.e$)(D,k,G,Q),(0,P.e$)(K,q,F,-Q),(0,P.e$)(J,F,q,-Q),se(e,k,G,W,D,F,q,K,J)}(e,r,c.controlPoint),d.every(e=>0===e)?null:d}_projectControlPoint(e,t){if(!V(e))return{valid:!0,controlPoint:e};const{sourcePoint:n,mapPoint:i}=e,{geometry:r,pending:s}=(0,Z.projectOrLoad)(i,t);return s?{valid:!1,controlPoint:null}:s||r?{valid:!0,controlPoint:new Y.A({sourcePoint:n,mapPoint:r})}:(o.A.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:e,sourceSpatialReference:i.spatialReference,targetSpatialReference:t}),{valid:!1,controlPoint:null})}};function V(e){return null!=e?.sourcePoint&&null!=e.mapPoint}(0,i.Cg)([(0,c.MZ)({type:[Y.A],json:{write:{allowNull:!1,isRequired:!0,target:{controlPoints:{type:[$],isRequired:!0},coefficients:{type:[Number],isRequired:!0},spatialReference:{type:j.A,isRequired:!0}}}}})],z.prototype,"controlPoints",void 0),(0,i.Cg)([(0,h.w)("controlPoints")],z.prototype,"readControlPoints",null),(0,i.Cg)([(0,p.K)("controlPoints")],z.prototype,"writeControlPoints",null),(0,i.Cg)([(0,c.MZ)({clonable:!1})],z.prototype,"coords",null),(0,i.Cg)([(0,c.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],z.prototype,"height",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],z.prototype,"inverseTransform",null),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],z.prototype,"transform",null),(0,i.Cg)([(0,c.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],z.prototype,"width",void 0),z=(0,i.Cg)([(0,d.$)("esri.layers.support.ControlPointsGeoreference")],z);const k=(0,L.vt)(),G=(0,L.vt)(),W=(0,L.vt)(),D=(0,L.vt)(),F=(0,L.vt)(),q=(0,L.vt)(),K=(0,L.vt)(),J=(0,L.vt)(),Q=Math.PI/2;function ee(e,t,n){(0,P.hZ)(e,n.sourcePoint.x,n.sourcePoint.y),(0,P.hZ)(t,n.mapPoint.x,n.mapPoint.y)}function te(e,t,n,i,r){return ee(k,F,t),ee(G,q,n),ee(W,K,i),ee(D,J,r),se(e,k,G,W,D,F,q,K,J)}const ne=new Array(8).fill(0),ie=new Array(8).fill(0);function re(e,t,n,i,r){return e[0]=t[0],e[1]=t[1],e[2]=n[0],e[3]=n[1],e[4]=i[0],e[5]=i[1],e[6]=r[0],e[7]=r[1],e}function se(e,t,n,i,r,s,o,a,l){return S(e,re(ne,t,n,i,r),re(ie,s,o,a,l))}var oe=n(78888),ae=n(21287),le=n(84952),ce=n(13069),ue=n(92474);let he=0;const de=e=>{const t=e;let n=class extends t{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:he++})}};return n=(0,i.Cg)([(0,d.$)("esri.core.NumericIdentifiable")],n),n};var pe=n(35666),me=n(5443),fe=n(21325);const ge=(0,L.vt)();let ye=class extends X{constructor(e){super(e),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:e,topRight:t,bottomLeft:n,bottomRight:i}=this;if(null==e||null==t||null==n||null==i)return null;const r=e.spatialReference;return t=this.projectOrWarn(t,r),n=this.projectOrWarn(n,r),i=this.projectOrWarn(i,r),null==t||null==n||null==i?null:new T.A({rings:[[[n.x,n.y],[e.x,e.y],[t.x,t.y],[i.x,i.y],[n.x,n.y]]],spatialReference:r})}set coords(e){const{topLeft:t}=this;if(null==t)return;const n=t.spatialReference;if(null==(e=this.projectOrWarn(e,n)))return;const{rings:[[i,r,s,o]]}=e;this.bottomLeft=new B.A({x:i[0],y:i[1],spatialReference:n}),this.topLeft=new B.A({x:r[0],y:r[1],spatialReference:n}),this.topRight=new B.A({x:s[0],y:s[1],spatialReference:n}),this.bottomRight=new B.A({x:o[0],y:o[1],spatialReference:n})}toSourceNormalized(e){const{topLeft:t,topRight:n,bottomRight:i,bottomLeft:r}=this;if(null==e||null==t||null==n||null==i||null==r)return null;const s=t.spatialReference;e=e.normalize();const o=(0,Z.projectOrLoad)(e,s).geometry;if(null==o)return null;(0,P.hZ)(ge,o.x,o.y);const a=S((0,w.vt)(),[t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y],[0,0,0,1,1,0,1,1]);return R(ge,ge,a),(0,E.tc)(ge[0],ge[1])}};(0,i.Cg)([(0,c.MZ)({clonable:!1})],ye.prototype,"coords",null),(0,i.Cg)([(0,c.MZ)({type:B.A})],ye.prototype,"bottomLeft",void 0),(0,i.Cg)([(0,c.MZ)({type:B.A})],ye.prototype,"bottomRight",void 0),(0,i.Cg)([(0,c.MZ)({type:B.A})],ye.prototype,"topLeft",void 0),(0,i.Cg)([(0,c.MZ)({type:B.A})],ye.prototype,"topRight",void 0),ye=(0,i.Cg)([(0,d.$)("esri.layers.support.CornersGeoreference")],ye);const xe=ye;var _e=n(34727),ve=n(34304);let we=class extends X{constructor(e){super(e),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(null==this.extent)return null;const{xmin:e,ymin:t,xmax:n,ymax:i,spatialReference:r}=this.extent;let s;if(this.rotation){const{x:r,y:o}=this.extent.center,a=Pe(r,o,this.rotation);s=[a(e,t),a(e,i),a(n,i),a(n,t)],s.push(s[0])}else s=[[e,t],[e,i],[n,i],[n,t],[e,t]];return new T.A({rings:[s],spatialReference:r})}set coords(e){if(null==e||null==this.extent)return;const t=this.extent.spatialReference;if(e=this.projectOrWarn(e,t),null==e?.extent)return;const{rings:[[n,i,r]],extent:{center:{x:s,y:o}}}=e,a=(0,_e.KJ)(Math.PI/2-Math.atan2(i[1]-n[1],i[0]-n[0])),l=Pe(s,o,-a),[c,u]=l(n[0],n[1]),[h,d]=l(r[0],r[1]);this.extent=new me.A({xmin:c,ymin:u,xmax:h,ymax:d,spatialReference:t}),this.rotation=a}toSourceNormalized(e){const{extent:t,rotation:n}=this;if(null==e||null==t)return null;const{xmin:i,ymin:r,xmax:s,ymax:o,center:a,spatialReference:l}=t;e=e.normalize();const c=(0,Z.projectOrLoad)(e,l).geometry;if(null==c)return null;let u=c.x,h=c.y;return n&&([u,h]=Pe(a.x,a.y,-n)(u,h)),(0,E.tc)((0,_e.hs)(u,i,s,0,1),(0,_e.hs)(h,o,r,0,1))}};function Pe(e,t,n){const i=(0,ve.DF)(n),r=Math.cos(i),s=Math.sin(i);return(n,i)=>[r*(n-e)+s*(i-t)+e,r*(i-t)-s*(n-e)+t]}function Me(e,t){const n=(0,pe.aB)(t);return function(e){return"media"===e?.type}(e)&&!!e.portalItem&&null!=n&&n>3}function Ie(e,t,n){return{enabled:!Me(n?.layer,n?.origin),ignoreOrigin:!0}}(0,i.Cg)([(0,c.MZ)({clonable:!1})],we.prototype,"coords",null),(0,i.Cg)([(0,c.MZ)({type:me.A})],we.prototype,"extent",void 0),(0,i.Cg)([(0,c.MZ)({type:Number})],we.prototype,"rotation",void 0),we=(0,i.Cg)([(0,d.$)("esri.layers.support.ExtentAndRotationGeoreference")],we);const be={json:{name:"url",type:String,write:{overridePolicy:Ie}}},Ae={readOnly:!0,json:{read:!1,write:{target:"mediaType",overridePolicy:Ie}}},Ce={types:{key:"type",base:X,typeMap:{"control-points":z,corners:xe,"extent-and-rotation":we}},json:{types:{key:"type",base:X,typeMap:{"control-points":z}},write:{overridePolicy:()=>({enabled:!0,ignoreOrigin:!0})}}};let Re=class extends(de((0,a.P)(ue.x_))){constructor(e){super(e),this.georeference=null,this.opacity=1}readGeoreference(e){return z.fromJSON(e)}writeGeoreference(e,t,n,i){const r=i?.resources?.pendingOperations,a=()=>{const r=function(e,t,n){if(!e||"control-points"===e.type)return e;const{coords:i}=e;if(5!==i?.rings[0]?.length)return null;const[r,s,o,a]=i.rings[0],{spatialReference:l}=i;return new z({controlPoints:[new Y.A({mapPoint:new B.A({x:r[0],y:r[1],spatialReference:l}),sourcePoint:(0,E.tc)(0,n)}),new Y.A({mapPoint:new B.A({x:s[0],y:s[1],spatialReference:l}),sourcePoint:(0,E.tc)(0,0)}),new Y.A({mapPoint:new B.A({x:o[0],y:o[1],spatialReference:l}),sourcePoint:(0,E.tc)(t,0)}),new Y.A({mapPoint:new B.A({x:a[0],y:a[1],spatialReference:l}),sourcePoint:(0,E.tc)(t,n)})],width:t,height:n})}(this.georeference,this.contentWidth,this.contentHeight);if(r){if("control-points"!==e.type&&o.A.getLogger(this).warn(`only georeference of type 'control-points' may be persisted. The georeference of type '${e.type}' has been automatically converted.`),4!==r.controlPoints?.length&&i?.messages)return void i.messages.push(new s.A("property:unsupported","only 'control-points' georeference with 4 control points may be persisted."));t[n]=r.write({},i)}};if("control-points"!==e.type&&!this.loaded&&r)return t[n]={},void r.push(this.load().then(a));a()}get contentWidth(){return 0}get contentHeight(){return 0}toSource(e){const{georeference:t,contentWidth:n,contentHeight:i}=this;if(null==e||null==t||0===n||0===i)return null;const r=t.toSourceNormalized(e);return null==r?null:(r.x*=n,r.y*=i,r)}};(0,i.Cg)([(0,c.MZ)(Ce)],Re.prototype,"georeference",void 0),(0,i.Cg)([(0,h.w)("georeference")],Re.prototype,"readGeoreference",null),(0,i.Cg)([(0,p.K)("georeference")],Re.prototype,"writeGeoreference",null),(0,i.Cg)([(0,c.MZ)({json:{read:!1,write:!1}})],Re.prototype,"opacity",void 0),Re=(0,i.Cg)([(0,d.$)("esri.layers.support.MediaElementBase")],Re);var Se=n(85648);const Oe=Symbol("ImageElementInstance"),Ee=Symbol("VideoElementInstance");function Le(e){return function(e){return null!=e&&"object"==typeof e&&Oe in e}(e)||function(e){return null!=e&&"object"==typeof e&&Ee in e}(e)}var Be,Te=n(97159);let Ze=class extends Re{static{Be=Oe}constructor(e){super(e),this.animationOptions=null,this.content=null,this.image=null,this.type="image",this[Be]=!0,this.image=null}load(){const e=this.image;if("string"==typeof e){const t=(0,ae.M5)(e).then(e=>{this._set("content",e)});this.addResolvingPromise(t)}else if(e instanceof HTMLImageElement){const t=e.decode().then(()=>{this._set("content",e)});this.addResolvingPromise(t)}else e?this._set("content",e):this.addResolvingPromise(Promise.reject(new s.A("image-element:invalid-image-type","Invalid image type",{image:e})));return Promise.resolve(this)}get contentWidth(){return null==this.content?0:this.content instanceof HTMLImageElement?this.content.naturalWidth:this.content.width}get contentHeight(){return null==this.content?0:this.content instanceof HTMLImageElement?this.content.naturalHeight:this.content.height}readImage(e,t,n){return(0,Te.f)(t.url,n)}writeImage(e,t,n,i){if(null==e)return;const r=i?.portalItem,s=i?.resources;if(!r||!s)return void("string"==typeof e&&(t[n]=(0,Te.t)(e,i)));const o=function(e){return"string"==typeof e&&!(0,le.DB)(e)&&!(0,le.w8)(e)}(e)?e:null;if(o){if(null==(0,Te.i)(o))return void(t[n]=o);const e=(0,Te.t)(o,{...i,verifyItemRelativeUrls:i?.verifyItemRelativeUrls?{writtenUrls:i.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},1);if(r&&e&&!(0,le.oP)(e))return s.toKeep.push({resource:r.resourceFromPath(e),compress:!1}),void(t[n]=e)}t[n]="<pending>",s.pendingOperations.push(async function(e){return"string"==typeof e?(0,le.DB)(e)?(0,le.N9)(e):(await(0,oe.A)(e,{responseType:"blob"})).data:new Promise(t=>function(e){if(e instanceof HTMLCanvasElement)return e;const t=e instanceof HTMLImageElement?e.naturalWidth:e.width,n=e instanceof HTMLImageElement?e.naturalHeight:e.height,i=document.createElement("canvas"),r=i.getContext("2d");return i.width=t,i.height=n,e instanceof HTMLImageElement?r.drawImage(e,0,0,e.width,e.height):e instanceof ImageData&&r.putImageData(e,0,0),i}(e).toBlob(t))}(e).then(e=>{const i=function(e,t){const n=(0,ce.lk)(),i=`${(0,le.fj)("media",n)}.${(0,Se.n)({type:"blob",blob:e})}`;return t.resourceFromPath(i)}(e,r);t[n]=i.itemRelativeUrl,s.toAdd.push({resource:i,content:{type:"blob",blob:e},compress:!1,finish:e=>{this.image=e.url}})}))}};(0,i.Cg)([(0,c.MZ)()],Ze.prototype,"animationOptions",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],Ze.prototype,"content",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],Ze.prototype,"contentWidth",null),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],Ze.prototype,"contentHeight",null),(0,i.Cg)([(0,c.MZ)(be)],Ze.prototype,"image",void 0),(0,i.Cg)([(0,h.w)("image",["url"])],Ze.prototype,"readImage",null),(0,i.Cg)([(0,p.K)("image")],Ze.prototype,"writeImage",null),(0,i.Cg)([(0,c.MZ)(Ae)],Ze.prototype,"type",void 0),Ze=(0,i.Cg)([(0,d.$)("esri.layers.support.ImageElement")],Ze);var je=n(62885),Ye=n(65529),Ue=n(61893),Xe=n(36708),He=n(19419),Ne=n(12176),$e=n(6518),ze=n(69622),Ve=n(89056);let ke=class extends ze.A{constructor(e){super(e)}get bounds(){const e=this.coords;return null==e?.extent?null:(0,He.VY)(e.extent)}get coords(){const e=this.element.georeference?.coords;return(0,Z.projectOrLoad)(e,this.spatialReference).geometry}get normalizedCoords(){return T.A.fromJSON((0,Ve.jZ)(this.coords))}get normalizedBounds(){const e=null!=this.normalizedCoords?this.normalizedCoords.extent:null;return null!=e?(0,He.VY)(e):null}};(0,i.Cg)([(0,c.MZ)()],ke.prototype,"spatialReference",void 0),(0,i.Cg)([(0,c.MZ)()],ke.prototype,"element",void 0),(0,i.Cg)([(0,c.MZ)()],ke.prototype,"bounds",null),(0,i.Cg)([(0,c.MZ)()],ke.prototype,"coords",null),(0,i.Cg)([(0,c.MZ)()],ke.prototype,"normalizedCoords",null),(0,i.Cg)([(0,c.MZ)()],ke.prototype,"normalizedBounds",null),ke=(0,i.Cg)([(0,d.$)("esri.layers.support.MediaElementView")],ke);var Ge,We=n(16494),De=n(38969);const Fe=Symbol("canplay");let qe=class extends Re{static{Ge=Ee}constructor(e){super(e),this.autoplay=!0,this.content=null,this.type="video",this[Ge]=!0}load(){const e=this.video;return"string"==typeof e?this.addResolvingPromise(this._preProcessVideoUrl(e).then(async e=>{const t=document.createElement("video");return t.src=We.W5.sanitizeUrl((0,le.s2)(e)),t.crossOrigin="anonymous",t.autoplay=this.autoplay,t.muted=!0,t.loop=!0,t.playsInline=!0,this._loadVideo(t).then(()=>{this._set("content",t)})})):e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then(()=>{this._set("content",e)})):this.addResolvingPromise(Promise.reject(new s.A("video-element:invalid-video-type","Invalid video type",{video:e}))),Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}get currentTime(){return this.content?.currentTime}set currentTime(e){if(!this.content)return;const t=(0,_e.qE)(e,0,this.content.duration);"fastSeek"in this.content?this.content.fastSeek(t):this.content.currentTime=t,this.content.play().then(()=>{this.content?.pause()}).catch(()=>{})}get duration(){return this.content?.duration}set video(e){"not-loaded"===this.loadStatus?this._set("video",e):o.A.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}writeVideo(e,t,n,i){if(!e)return void(i?.messages&&i.messages.push(new s.A("video-element:unsupported-video","video source is missing")));const r=function(e){return"string"==typeof e&&!(0,le.DB)(e)&&!(0,le.w8)(e)}(e)?e:null;if(!r)return void(i?.messages&&i.messages.push(new s.A("video-element:unsupported-video","video source must be an absolute url")));!(0,le.oP)(r)&&i?.blockedRelativeUrls&&i.blockedRelativeUrls.push(r);const o=(0,le.s2)(r);(0,Te.i)(o)?i?.messages&&i.messages.push(new s.A("video-element:unsupported-video","video source cannot be an item resource")):t[n]=o}async _preProcessVideoUrl(e){if((0,le.zs)(e))return(0,le.yM)(e);try{return await(0,oe.A)(e,{method:"head"}),e}catch{try{return(0,le.yM)(e,!0)}catch{return e}}}async _loadVideo(e){"anonymous"!==e.crossOrigin&&(e.crossOrigin="anonymous",(0,le.w8)(e.src)||(e.src=e.src));try{await(0,De.i)(e,e=>this.addHandles(e,Fe)),this.autoplay&&await e.play().catch(e=>{throw console.error(e),e})}finally{this.removeHandles(Fe)}}};(0,i.Cg)([(0,c.MZ)()],qe.prototype,"autoplay",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],qe.prototype,"content",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],qe.prototype,"contentWidth",null),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],qe.prototype,"contentHeight",null),(0,i.Cg)([(0,c.MZ)({type:Number})],qe.prototype,"currentTime",null),(0,i.Cg)([(0,c.MZ)({type:Number})],qe.prototype,"duration",null),(0,i.Cg)([(0,c.MZ)(be)],qe.prototype,"video",null),(0,i.Cg)([(0,p.K)("video")],qe.prototype,"writeVideo",null),(0,i.Cg)([(0,c.MZ)(Ae)],qe.prototype,"type",void 0),qe=(0,i.Cg)([(0,d.$)("esri.layers.support.VideoElement")],qe);const Ke={key:"type",defaultKeyValue:"image",base:Re,typeMap:{image:Ze,video:qe}},Je=r.A.ofType(Ke);let Qe=class extends((0,ue.WV)((0,Ue.g)(Ye.nJ))){constructor(e){super(e),this._index=new $e.F,this._elementViewsMap=new Map,this._elementsIndexes=new Map,this._elementsChangedHandler=e=>{for(const t of e.removed){const e=this._elementViewsMap.get(t);this._elementViewsMap.delete(t),this._index.delete(e),this.removeHandles(e),e.destroy(),this.notifyChange("fullExtent")}const{spatialReference:t}=this;for(const n of e.added){if(this._elementViewsMap.get(n))continue;const e=new ke({spatialReference:t,element:n});this._elementViewsMap.set(n,e);const i=(0,Xe.wB)(()=>e.coords,()=>this._updateIndexForElement(e,!1));this._updateIndexForElement(e,!0),this.addHandles(i,e)}this._elementsIndexes.clear(),this.elements.forEach((e,t)=>this._elementsIndexes.set(e,t)),this.emit("refresh")},this.elements=new Je}async load(e){if((0,l.Te)(e),!this.spatialReference){const e=this.elements.find(e=>null!=e.georeference?.coords);this._set("spatialReference",e?e.georeference.coords.spatialReference:j.A.WGS84)}return this._elementsChangedHandler({added:this.elements.items,removed:[]}),this.addHandles(this.elements.on("change",this._elementsChangedHandler)),this}destroy(){this._index.clear(),this._elementViewsMap.clear(),this._elementsIndexes.clear()}set elements(e){this._set("elements",(0,je.V)(e,this._get("elements"),Je))}get fullExtent(){if("not-loaded"===this.loadStatus)return null;const e=this._index.fullBounds;return null==e?null:new me.A({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:this.spatialReference})}set spatialReference(e){"not-loaded"===this.loadStatus?this._set("spatialReference",e):o.A.getLogger(this).error("#spatialReference","spatialReference cannot be changed after the source is loaded.")}async queryElements(e,t){await this.load(),await(0,Z.initializeProjection)(e.spatialReference,this.spatialReference,null,t);const n=(0,fe.aI)(e.spatialReference,this.spatialReference)?e:(0,Z.project)(e,this.spatialReference);if(!n)return[];const i=n.normalize(),r=[];for(const e of i)this._index.forEachInBounds((0,He.VY)(e),({normalizedCoords:t,element:n})=>{null!=t&&(0,Ne.fA)(e,t)&&r.push(n)});return r.sort((e,t)=>this._elementsIndexes.get(e)-this._elementsIndexes.get(t)),r}hasElement(e){return this.elements.includes(e)}_updateIndexForElement(e,t){const n=e.normalizedBounds,i=this._index.has(e),r=null!=n;this._index.delete(e),r&&this._index.set(e,n),this.notifyChange("fullExtent"),t||(i!==r?this.emit("refresh"):this.emit("change",{element:e.element}))}};(0,i.Cg)([(0,c.MZ)()],Qe.prototype,"elements",null),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],Qe.prototype,"fullExtent",null),(0,i.Cg)([(0,c.MZ)()],Qe.prototype,"spatialReference",null),Qe=(0,i.Cg)([(0,d.$)("esri.layers.support.LocalMediaElementSource")],Qe);let et=class extends((0,f.dM)((0,x.j)((0,g.q)((0,y.A)((0,a.P)(m.A)))))){constructor(e){super(e),this.effectiveSource=null,this.georeference=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this._debouncedSaveOperations=(0,l.sg)(async(e,t,i)=>{const{save:r,saveAs:s}=await n.e(3561).then(n.bind(n,63561));switch(e){case 0:return r(this,t);case 1:return s(this,i,t)}}),this.source=new Qe}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.loadFromPortal({supportedTypes:["Media Layer"]},e);let t=this.source;if(!t)throw new s.A("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer.");const n=this._getSourceOverride(t,this.georeference);n&&(this.setAtOrigin("source",n,"web-map"),this.setAtOrigin("source",n,"web-scene"),t=n);const i=Le(t)?new Qe({elements:new r.A([t])}):t;this._set("effectiveSource",i),this.spatialReference&&(i.spatialReference=this.spatialReference),await i.load(e),this.spatialReference=i.spatialReference}destroy(){this.effectiveSource?.destroy(),this.effectiveSource!==this.source&&this.source?.destroy()}readGeoreference(e,t){return e&&"itemId"in t&&t.itemId?e:void 0}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}get loaded(){return super.loaded}get source(){return this._get("source")}set source(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("source",e):o.A.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(e){return e?Array.isArray(e)?new Qe({elements:new r.A(e)}):e instanceof r.A?new Qe({elements:e}):e:null}readSource(e,t,n){if("itemId"in t&&t.itemId)return;const i=this._createSource(t);return i?.read(t,n),i}writeSource(e,t,n,i){if(e&&e instanceof Qe){const t=e.elements.length;if(1!==t)return void(i?.messages&&i.messages.push(new s.A("media-layer:unsupported-source",`local media element source can only be persisted if it contains exactly one ImageElement, but it has ${t}.`)));e=e.elements.at(0)}Le(e)?e.write(t,i):i?.messages&&(e?i.messages.push(new s.A("media-layer:unsupported-source","only media elements of type 'ImageElement' or 'VideoElement' can be persisted")):i.messages.push(new s.A("media-layer:unsupported-source","the media layer is missing a source")))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_createSource(e){if("mediaType"in e)switch(e.mediaType){case"image":return new Ze;case"video":return new qe}return null}_getSourceOverride(e,t){if(Le(e)&&3===this.originIdOf("source")&&t&&(5===this.originIdOf("georeference")||4===this.originIdOf("georeference"))){const n=e.toJSON(),i=this._createSource(n);return i.read({...n},{origin:"portal-item"}),i.read({georeference:t},{origin:"web-map"}),i.read({georeference:t},{origin:"web-scene"}),i}return null}};(0,i.Cg)([(0,c.MZ)({readOnly:!0})],et.prototype,"effectiveSource",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!0}}}})],et.prototype,"georeference",void 0),(0,i.Cg)([(0,h.w)("web-document","georeference")],et.prototype,"readGeoreference",null),(0,i.Cg)([(0,c.MZ)({type:String})],et.prototype,"copyright",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],et.prototype,"fullExtent",null),(0,i.Cg)([(0,c.MZ)({type:["MediaLayer"]})],et.prototype,"operationalLayerType",void 0),(0,i.Cg)([(0,c.MZ)({type:["show","hide"]})],et.prototype,"listMode",void 0),(0,i.Cg)([(0,c.MZ)({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1,target:{url:{type:String},mediaType:{type:["image","video"]},georeference:{type:z}},overridePolicy(e,t,n){return{enabled:!0,allowNull:!1,ignoreOrigin:Me(this,n?.origin)&&Le(e)&&!!e.georeference&&e.originIdOf("georeference")>3}}}}})],et.prototype,"source",null),(0,i.Cg)([(0,u.w)("source")],et.prototype,"castSource",null),(0,i.Cg)([(0,h.w)("source",["url"])],et.prototype,"readSource",null),(0,i.Cg)([(0,p.K)("source")],et.prototype,"writeSource",null),(0,i.Cg)([(0,c.MZ)()],et.prototype,"spatialReference",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],et.prototype,"type",void 0),et=(0,i.Cg)([(0,d.$)("esri.layers.MediaLayer")],et);const tt=et},38969:(e,t,n)=>{n.d(t,{i:()=>r});var i=n(37955);function r(e,t){return new Promise((n,r)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?n():(t((0,i.Oo)(e,"canplay",n)),t((0,i.Oo)(e,"error",r)))})}},48163:(e,t,n)=>{function i(){return[0,0]}function r(e){return[e[0],e[1]]}function s(e,t){return[e,t]}function o(){return s(1,1)}function a(){return s(1,0)}function l(){return s(0,1)}n.d(t,{Un:()=>c,fA:()=>s,o8:()=>r,vt:()=>i});const c=o(),u=a(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:c,UNIT_X:u,UNIT_Y:h,ZEROS:[0,0],clone:r,create:i,freeze:function(e,t){return[e,t]},fromArray:function(e,t=[0,0]){const n=Math.min(2,e.length);for(let i=0;i<n;++i)t[i]=e[i];return t},fromValues:s,ones:o,unitX:a,unitY:l,zeros:function(){return[0,0]}},Symbol.toStringTag,{value:"Module"}))},62885:(e,t,n)=>{n.d(t,{H:()=>s,V:()=>r});var i=n(7762);function r(e,t,n=i.A){return t||(t=new n),t===e||t.destroyed||(t.removeAll(),(r=e)&&(Array.isArray(r)||"items"in r&&Array.isArray(r.items))?t.addMany(e):e&&t.add(e)),t;var r}function s(e){return e}},69540:(e,t,n)=>{n.d(t,{OU:()=>u,Pw:()=>h});var i=n(31635),r=n(69622),s=(n(44208),n(4718)),o=(n(53966),n(97768)),a=n(88620),l=n(64108);const c=Symbol("ClonableMixin"),u=e=>{var t;const n=e;let r=class extends n{constructor(){super(...arguments),this[t]=!0}static{t=c}clone(e){const t=(0,a.oY)(this);(0,o.Lw)(t,"unable to clone instance of non-accessor class");const n=t.metadata,i=t.store,r={},l=new Map;for(const t in n){const o=n[t],a=i?.originOf(t),c=o.clonable;if(o.readOnly||!1===c||7!==a&&0!==a&&5!==a&&4!==a)continue;const u=this[t];let h=null;if("function"==typeof c)h=c(u,e);else if("reference"===c)h=u;else if(h=(0,s.TU)(u,e),null!=u&&null==h)continue;0===a?l.set(t,h):r[t]=h}const c=new(0,Object.getPrototypeOf(this).constructor)(r);if(l.size){const e=(0,a.oY)(c)?.store;if(e)for(const[t,n]of l)e.set(t,n,0)}return c}};return r=(0,i.Cg)([(0,l.$)("esri.core.Clonable")],r),r},h=u(r.A)},75503:(e,t,n)=>{n.d(t,{EC:()=>b,wq:()=>a});var i=n(4576),r=n(21818),s=(n(44208),n(15142)),o=n(11006);class a{constructor(e=9,t){this._compareMinX=d,this._compareMinY=p,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),w.prune(),P.prune(),M.prune(),I.prune()}all(e){l(this._data,e)}search(e,t){let n=this._data;const i=this._toBBox;if(_(e,n))for(w.clear();n;){for(let r=0,s=n.children.length;r<s;r++){const s=n.children[r],o=n.leaf?i(s):s;_(e,o)&&(n.leaf?t(s):x(e,o)?l(s,t):w.push(s))}n=w.pop()}}collides(e){let t=this._data;const n=this._toBBox;if(!_(e,t))return!1;for(w.clear();t;){for(let i=0,r=t.children.length;i<r;i++){const r=t.children[i],s=t.leaf?n(r):r;if(_(e,s)){if(t.leaf||x(e,s))return!0;w.push(r)}}t=w.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,n=e.length;t<n;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new C([]),this}remove(e){if(!e)return this;let t,n=this._data,s=null,o=0,a=!1;const l=this._toBBox(e);for(M.clear(),I.clear();n||M.length>0;){if(n||(n=M.pop(),s=M.data[M.length-1],o=I.pop()??0,a=!0),n.leaf&&(t=(0,i.qh)(n.children,(0,r.zI)(e),n.children.length,n.indexHint),-1!==t))return n.children.splice(t,1),M.push(n),this._condense(M),this;a||n.leaf||!x(n,l)?s?(o++,n=s.children[o],a=!1):n=null:(M.push(n),I.push(o),o=0,s=n,n=n.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,n,i){const r=n-t+1;let s=this._maxEntries;if(r<=s){const i=new C(e.slice(t,n+1));return c(i,this._toBBox),i}i||(i=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/s**(i-1)));const o=new R([]);o.height=i;const a=Math.ceil(r/s),l=a*Math.ceil(Math.sqrt(s));v(e,t,n,l,this._compareMinX);for(let r=t;r<=n;r+=l){const t=Math.min(r+l-1,n);v(e,r,t,a,this._compareMinY);for(let n=r;n<=t;n+=a){const r=Math.min(n+a-1,t);o.children.push(this._build(e,n,r,i-1))}}return c(o,this._toBBox),o}_insert(e,t,n){const i=this._toBBox,r=n?e:i(e);M.clear();const s=function(e,t,n,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==n;){let n,i=1/0,r=1/0;for(let s=0,o=t.children.length;s<o;s++){const o=t.children[s],a=m(o),l=g(e,o)-a;l<r?(r=l,i=a<i?a:i,n=o):l===r&&a<i&&(i=a,n=o)}t=n||t.children[0]}return t}(r,this._data,t,M);for(s.children.push(e),h(s,r);t>=0&&M.data[t].children.length>this._maxEntries;)this._split(M,t),t--;!function(e,t,n){for(let i=n;i>=0;i--)h(t.data[i],e)}(r,M,t)}_split(e,t){const n=e.data[t],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);const s=this._chooseSplitIndex(n,r,i);if(!s)return;const o=n.children.splice(s,n.children.length-s),a=n.leaf?new C(o):new R(o);a.height=n.height,c(n,this._toBBox),c(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(n,a)}_splitRoot(e,t){this._data=new R([e,t]),this._data.height=e.height+1,c(this._data,this._toBBox)}_chooseSplitIndex(e,t,n){let i,r,s;i=r=1/0;for(let o=t;o<=n-t;o++){const t=u(e,0,o,this._toBBox),a=u(e,o,n,this._toBBox),l=y(t,a),c=m(t)+m(a);l<i?(i=l,s=o,r=c<r?c:r):l===i&&c<r&&(r=c,s=o)}return s}_chooseSplitAxis(e,t,n){const i=e.leaf?this._compareMinX:d,r=e.leaf?this._compareMinY:p;this._allDistMargin(e,t,n,i)<this._allDistMargin(e,t,n,r)&&e.children.sort(i)}_allDistMargin(e,t,n,i){e.children.sort(i);const r=this._toBBox,s=u(e,0,t,r),o=u(e,n-t,n,r);let a=f(s)+f(o);for(let i=t;i<n-t;i++){const t=e.children[i];h(s,e.leaf?r(t):t),a+=f(s)}for(let i=n-t-1;i>=t;i--){const t=e.children[i];h(o,e.leaf?r(t):t),a+=f(o)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){const n=e.data[t];if(0===n.children.length)if(t>0){const r=e.data[t-1],s=r.children;s.splice((0,i.qh)(s,n,s.length,r.indexHint),1)}else this.clear();else c(n,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function l(e,t){let n=e;for(P.clear();n;){if(!0===n.leaf)for(const e of n.children)t((0,r.zI)(e));else P.pushArray(n.children);n=P.pop()??null}}function c(e,t){u(e,0,e.children.length,t,e)}function u(e,t,n,i,r){r||(r=new C([])),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let s,o=t;o<n;o++)s=e.children[o],h(r,e.leaf?i(s):s);return r}function h(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function d(e,t){return e.minX-t.minX}function p(e,t){return e.minY-t.minY}function m(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function f(e){return e.maxX-e.minX+(e.maxY-e.minY)}function g(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function y(e,t){const n=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),s=Math.min(e.maxY,t.maxY);return Math.max(0,r-n)*Math.max(0,s-i)}function x(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function _(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function v(e,t,n,i,r){const s=[t,n];for(;s.length;){const t=s.pop(),n=s.pop();if(t-n<=i)continue;const a=n+Math.ceil((t-n)/i/2)*i;(0,o.q)(e,a,n,t,r),s.push(n,a,a,t)}}const w=new s.A,P=new s.A,M=new s.A,I=new s.A({deallocator:void 0});class b{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class A extends b{constructor(){super(...arguments),this.height=1,this.indexHint=new i.vW}}class C extends A{constructor(e){super(),this.children=e,this.leaf=!0}}class R extends A{constructor(e){super(),this.children=e,this.leaf=!1}}},80754:(e,t,n)=>{n.d(t,{j7:()=>o,kS:()=>l,kd:()=>a,r8:()=>c});var i=n(82799),r=n(16930),s=n(65864);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:r.A.WebMercator}),minus180Line:new i.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:r.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.A({paths:[[[180,-180],[180,180]]],spatialReference:r.A.WGS84}),minus180Line:new i.A({paths:[[[-180,-180],[-180,180]]],spatialReference:r.A.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const n=c(e);for(const e of n)for(const n of e)n[0]+=t;return e}function c(e){return(0,s.Bi)(e)?e.rings:e.paths}},85648:(e,t,n)=>{n.d(t,{n:()=>r});var i=n(84952);function r(e){return s[function(e){return"json"===e.type?"application/json":"blob"===e.type?e.blob.type:function(e){const t=(0,i.Zo)(e);return l[t]||o}(e.url)}(e)]||a}const s={},o="text/plain",a=s[o],l={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const e in l)s[l[e]]=e},89056:(e,t,n)=>{n.d(t,{b3:()=>h,jZ:()=>u});var i=n(12195),r=n(19419),s=n(6606),o=n(95108),a=n(65864),l=n(80754),c=n(21325);function u(e){return d(e,!0)}function h(e){return d(e,!1)}function d(e,t){if(null==e)return null;const n=e.spatialReference,r=(0,c.Vp)(n),o=(0,i.W)(e)?e.toJSON():e;if(!r)return o;const u=(0,c.K8)(n)?102100:4326,h=l.j7[u].maxX,d=l.j7[u].minX;if((0,a.fT)(o))return m(o,h,d);if((0,a.U9)(o))return o.points=o.points.map(e=>m(e,h,d)),o;if((0,a.ZC)(o))return p(o,r);if((0,a.Bi)(o)||(0,a.Rg)(o)){const e=(0,s.Rg)(v,o),n={xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3]},i=(0,l.kd)(n.xmin,d)*(2*h),r=0===i?o:(0,l.kS)(o,i);return n.xmin+=i,n.xmax+=i,n.xmax>h?x(r,h,t):n.xmin<d?x(r,d,t):r}return o}function p(e,t){if(!t)return e;const n=function(e,t){const n=[],{ymin:i,ymax:r,xmin:s,xmax:o}=e,a=e.xmax-e.xmin,[l,c]=t.valid,{x:u,frameId:h}=f(e.xmin,t),{x:d,frameId:p}=f(e.xmax,t),m=u===d&&a>0;if(a>2*c){const e={xmin:s<o?u:d,ymin:i,xmax:c,ymax:r},t={xmin:l,ymin:i,xmax:s<o?d:u,ymax:r},a={xmin:0,ymin:i,xmax:c,ymax:r},m={xmin:l,ymin:i,xmax:0,ymax:r},f=[],y=[];g(e,a)&&f.push(h),g(e,m)&&y.push(h),g(t,a)&&f.push(p),g(t,m)&&y.push(p);for(let e=h+1;e<p;e++)f.push(e),y.push(e);n.push(new _(e,[h]),new _(t,[p]),new _(a,f),new _(m,y))}else u>d||m?n.push(new _({xmin:u,ymin:i,xmax:c,ymax:r},[h]),new _({xmin:l,ymin:i,xmax:d,ymax:r},[p])):n.push(new _({xmin:u,ymin:i,xmax:d,ymax:r},[h]));return n}(e,t).map(e=>e.extent);return n.length<2?n[0]||e:n.length>2?(e.xmin=t.valid[0],e.xmax=t.valid[1],e):{rings:n.map(e=>[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]])}}function m(e,t,n){if(Array.isArray(e)){const i=e[0];if(i>t){const n=(0,l.kd)(i,t);e[0]=i+n*(-2*t)}else if(i<n){const t=(0,l.kd)(i,n);e[0]=i+t*(-2*n)}}else{const i=e.x;if(i>t){const n=(0,l.kd)(i,t);e.x+=n*(-2*t)}else if(i<n){const t=(0,l.kd)(i,n);e.x+=t*(-2*n)}}return e}function f(e,t){const[n,i]=t.valid,r=2*i;let s,o=0;return e>i?(s=Math.ceil(Math.abs(e-i)/r),e-=s*r,o=s):e<n&&(s=Math.ceil(Math.abs(e-n)/r),e+=s*r,o=-s),{x:e,frameId:o}}function g(e,t){const{xmin:n,ymin:i,xmax:r,ymax:s}=t;return y(e,n,i)&&y(e,n,s)&&y(e,r,s)&&y(e,r,i)}function y(e,t,n){return t>=e.xmin&&t<=e.xmax&&n>=e.ymin&&n<=e.ymax}function x(e,t,n=!0){const i=!(0,a.Rg)(e);if(i&&(0,o.m3)(e),n)return(new w).cut(e,t);const r=i?e.rings:e.paths,s=i?4:2,l=r.length,c=-2*t;for(let e=0;e<l;e++){const t=r[e];if(t&&t.length>=s){const e=[];for(const[n,...i]of t)e.push([n+c,...i]);r.push(e)}}return i?e.rings=r:e.paths=r,e}class _{constructor(e,t){this.extent=e,this.frameIds=t}}const v=(0,r.vt)();class w{constructor(){this._linesIn=[],this._linesOut=[]}cut(e,t){let n;if(this._xCut=t,e.rings)this._closed=!0,n=e.rings,this._minPts=4;else{if(!e.paths)return null;this._closed=!1,n=e.paths,this._minPts=2}for(const e of n){if(!e||e.length<this._minPts)continue;let t=!0;for(const n of e)t?(this.moveTo(n),t=!1):this.lineTo(n);this._closed&&this.close()}this._pushLineIn(),this._pushLineOut(),n=[];for(const e of this._linesIn)e&&e.length>=this._minPts&&n.push(e);const i=-2*this._xCut;for(const e of this._linesOut)if(e&&e.length>=this._minPts){for(const t of e)t[0]+=i;n.push(e)}return this._closed?e.rings=n:e.paths=n,e}moveTo(e){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(e[0]),this._moveTo(e[0],e[1],this._prevSide),this._prevPt=e,this._firstPt=e}lineTo(e){const t=this._side(e[0]);if(t*this._prevSide===-1){const n=this._intersect(this._prevPt,e);this._lineTo(this._xCut,n,0),this._prevSide=0,this._lineTo(e[0],e[1],t)}else this._lineTo(e[0],e[1],t);this._prevSide=t,this._prevPt=e}close(){const e=this._firstPt,t=this._prevPt;e[0]===t[0]&&e[1]===t[1]||this.lineTo(e),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(e,t,n){this._closed?(this._lineIn.push([n<=0?e:this._xCut,t]),this._lineOut.push([n>=0?e:this._xCut,t])):(n<=0&&this._lineIn.push([e,t]),n>=0&&this._lineOut.push([e,t]))}_lineTo(e,t,n){this._closed?(P(this._lineIn,n<=0?e:this._xCut,t),P(this._lineOut,n>=0?e:this._xCut,t)):n<0?(0===this._prevSide&&this._pushLineOut(),this._lineIn.push([e,t])):n>0?(0===this._prevSide&&this._pushLineIn(),this._lineOut.push([e,t])):this._prevSide<0?(this._lineIn.push([e,t]),this._lineOut.push([e,t])):this._prevSide>0&&(this._lineOut.push([e,t]),this._lineIn.push([e,t]))}_checkClosingPt(e){const t=e.length;t>3&&e[0][0]===this._xCut&&e[t-2][0]===this._xCut&&e[1][0]===this._xCut&&(e[0][1]=e[t-2][1],e.pop())}_side(e){return e<this._xCut?-1:e>this._xCut?1:0}_intersect(e,t){const n=(this._xCut-e[0])/(t[0]-e[0]);return e[1]+n*(t[1]-e[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}function P(e,t,n){const i=e.length;i>1&&e[i-1][0]===t&&e[i-2][0]===t?e[i-1][1]=n:e.push([t,n])}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9203],{6518:(e,t,n)=>{n.d(t,{F:()=>a});var i=n(44208),r=n(75503),s=n(19419);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new r.wq(9,(0,i.A)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach((n,i)=>{e[t++]=i}),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(e=>this._idByBounds.has(e))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,s.Ie)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,n){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,n)}(this._index,e,e=>t(this._idByBounds.get(e)))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},8303:(e,t,n)=>{n.d(t,{A:()=>P});var i=n(31635),r=n(92602),s=n(70333),o=n(43773),a=n(60999),l=n(49186),c=n(53966),u=n(97768),h=n(74887),d=n(84952),p=n(10107),m=(n(44208),n(87811),n(36005)),f=n(64108),g=n(43937),y=n(77548),x=n(20655),_=n(80812),v=n(41318),w=n(10407);const P=e=>{const t=e;let P=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,u.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 _.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:i}=await n.e(1204).then(n.bind(n,41204));return(0,h.Te)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,h.zf)(e)||c.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,h.QP)(e),!0)))}async setUserPrivileges(e,t){if(!r.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:n,fullEdit:i},content:{updateItem:r}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",n),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",r)}catch(e){(0,h.QP)(e)}}async _fetchUserPrivileges(e,t){let n=this.portalItem;if(!e||!n||!n.loaded||n.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=!s.id?.findCredential(this.url),r=e===n.id;if(r&&n.portal.user)return this._getUserPrivileges(n,i);let o,a;if(r)o=n.portal.url;else try{o=await(0,y.wI)(this.url,t)}catch(e){(0,h.QP)(e)}if(!o||!(0,d.b8)(o,n.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;a=await(s.id?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,h.QP)(e)}const l=!0,c=!1,u=!1;if(!a)return{features:{edit:l,fullEdit:c},content:{updateItem:u}};try{if(r?await n.reload():(n=new _.default({id:e,portal:{url:o}}),await n.load(t)),n.portal.user)return this._getUserPrivileges(n,i)}catch(e){(0,h.QP)(e)}return{features:{edit:l,fullEdit:c},content:{updateItem:u}}}_getUserPrivileges(e,t){const n=(0,w.It)(e);return t&&(n.features.edit=!0),n}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,h.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=M.credential===t?M.user:await this._fetchEditingUser(e);return M.credential=t,M.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 i=`${n.owningSystemUrl}/sharing/rest`,r=x.A.getDefault();if(r&&r.loaded&&(0,d.S8)(r.restUrl)===(0,d.S8)(i))return r.user;const l=`${i}/community/self`,c=null!=e?e.signal:null,u=await(0,a.Ke)((0,o.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:c}));return u.ok?v.A.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const n=t?.portal,i=this.portalItem?.id&&(this.portalItem.portal||x.A.getDefault());return n&&i&&!(0,d.ut)(i.restUrl,n.restUrl)?(t.messages&&t.messages.push(new l.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,i.Cg)([(0,p.MZ)({type:_.default})],P.prototype,"portalItem",null),(0,i.Cg)([(0,m.w)("web-document","portalItem",["itemId"])],P.prototype,"readPortalItem",null),(0,i.Cg)([(0,g.K)("web-document","portalItem",{itemId:{type:String}})],P.prototype,"writePortalItem",null),(0,i.Cg)([(0,p.MZ)({clonable:!1})],P.prototype,"resourceReferences",void 0),(0,i.Cg)([(0,p.MZ)({type:Boolean,readOnly:!0})],P.prototype,"userHasEditingPrivileges",void 0),(0,i.Cg)([(0,p.MZ)({type:Boolean,readOnly:!0})],P.prototype,"userHasFullEditingPrivileges",void 0),(0,i.Cg)([(0,p.MZ)({type:Boolean,readOnly:!0})],P.prototype,"userHasUpdateItemPrivileges",void 0),P=(0,i.Cg)([(0,f.$)("esri.layers.mixins.PortalLayer")],P),P},M={credential:null,user:null}},10407:(e,t,n)=>{n.d(t,{It:()=>p,LG:()=>o,OM:()=>c,Sm:()=>u,Y:()=>a,bK:()=>l,mm:()=>d,sQ:()=>h});var i=n(91218),r=n(16930),s=n(28735);function o(e,t){if(!a(e,t)){const n=e.typeKeywords;n?n.push(t):e.typeKeywords=[t]}}function a(e,t){return!!e.typeKeywords?.includes(t)}function l(e){return a(e,d.HOSTED_SERVICE)}function c(e,t){const n=e.typeKeywords;if(n){const e=n.indexOf(t);e>-1&&n.splice(e,1)}}function u(e,t,n){n?o(e,t):c(e,t)}async function h(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=r.A.WGS84;return await(0,i.initializeProjection)(t,n),(0,i.project)(e,n)}(n)}const d={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 p(e){const{portal:t,isOrgItem:n,itemControl:i}=e,r=t.user?.privileges;let s=!r||r.includes("features:user:edit"),o=!!n&&!!r?.includes("features:user:fullEdit");const a="update"===i||"admin"===i;return a?o=s=!0:o&&(s=!0),{features:{edit:s,fullEdit:o},content:{updateItem:a}}}},11006:(e,t,n)=>{function i(e,t,n,i,s){r(e,t,n||0,i||e.length-1,s||o)}function r(e,t,n,i,o){for(;i>n;){if(i-n>600){var a=i-n+1,l=t-n+1,c=Math.log(a),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(a-u)/a)*(l-a/2<0?-1:1);r(e,t,Math.max(n,Math.floor(t-l*u/a+h)),Math.min(i,Math.floor(t+(a-l)*u/a+h)),o)}var d=e[t],p=n,m=i;for(s(e,n,t),o(e[i],d)>0&&s(e,n,i);p<m;){for(s(e,p,m),p++,m--;o(e[p],d)<0;)p++;for(;o(e[m],d)>0;)m--}0===o(e[n],d)?s(e,n,m):s(e,++m,i),m<=t&&(n=m+1),t<=m&&(i=m-1)}}function s(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function o(e,t){return e<t?-1:e>t?1:0}n.d(t,{q:()=>i})},13069:(e,t,n)=>{n.d(t,{AG:()=>a,lk:()=>r,vD:()=>o,yS:()=>s});const i="randomUUID"in crypto;function r(){if(i)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function s(){return`{${r().toUpperCase()}}`}function o(){return`{${r()}}`}function a(e){const t=e.toUpperCase();return e.startsWith("{")?t:`{${t}}`}},16494:(e,t,n)=>{n.d(t,{Nd:()=>a,W5:()=>o});var i=n(37330);const r=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"].reduce((e,t)=>(e[t]=[],e),{}),s=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],o=new i.I({whiteList:r,onTagAttr:(e,t,n)=>{const i=`${t}="${n}"`;if(s.includes(t))return i},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0),a=new i.I({whiteList:{br:[]},stripIgnoreTag:!0,escapeHtml:e=>e},!1)},21287:(e,t,n)=>{n.d(t,{M5:()=>h,eV:()=>u});var i=n(43773),r=n(49186),s=n(74887),o=n(84952),a=n(26306);let l=null,c=!0;function u(e,t,n,i){if(!t||!n)throw new Error("Cannot construct image data without dimensions");if(c)try{return new ImageData(e,t,n)}catch(e){c=!1}const r=function(e,t,n){return n||(l||(l=document.createElement("canvas"),l.width=1,l.height=1),n=l),n.getContext("2d").createImageData(e,t)}(t,n,i);return r.data.set(e,0),r}async function h(e,t){const{arrayBuffer:l,mediaType:c}=await async function(e,t){const n=(0,o.r$)(e);if(n?.isBase64)return{arrayBuffer:(0,a.M)(n.data),mediaType:n.mediaType};const r=await(0,i.A)(e,{responseType:"array-buffer",...t});return{arrayBuffer:r.data,mediaType:r.getHeader?.("Content-Type")??""}}(e,t),u="image/png"===c;if("image/gif"===c){const{isAnimatedGIF:e,parseGif:i}=await n.e(820).then(n.bind(n,10820));if(e(l))return i(l,t)}if(u){const{isAnimatedPNG:e,parseApng:i}=await n.e(2390).then(n.bind(n,22390));if(e(l))return i(l,t)}return async function(e,t){const n=window.URL.createObjectURL(e);try{const{data:e}=await(0,i.A)(n,{...t,responseType:"image"});return e}catch(e){if(!(0,s.zf)(e))throw new r.A("invalid-image",`Could not fetch requested image at ${n}`);throw e}finally{window.URL.revokeObjectURL(n)}}(new Blob([l],{type:c}),t)}},29203:(e,t,n)=>{n.r(t),n.d(t,{default:()=>tt});var i=n(31635),r=n(7762),s=n(49186),o=n(53966),a=n(25728),l=n(74887),c=n(10107),u=n(79901),h=(n(44208),n(87811),n(36005)),d=n(64108),p=n(43937),m=n(4146),f=n(63074),g=n(16131),y=n(8303),x=n(25036),_=n(25482),v=n(77690),w=n(29242),P=n(37585),M=n(38954);const I=(0,n(51850).vt)(),b=(0,w.vt)(),A=(0,w.vt)(),C=(0,w.vt)();function R(e,t,n){return(0,M.j)(I,t[0],t[1],1),(0,M.o)(I,I,(0,v.mg)(b,n)),0===I[2]?(0,P.hZ)(e,I[0],I[1]):(0,P.hZ)(e,I[0]/I[2],I[1]/I[2])}function S(e,t,n){return O(A,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]),O(C,n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]),(0,v.lw)(e,(0,v.KC)(A,A),C),0!==e[8]&&(e[0]/=e[8],e[1]/=e[8],e[2]/=e[8],e[3]/=e[8],e[4]/=e[8],e[5]/=e[8],e[6]/=e[8],e[7]/=e[8],e[8]/=e[8]),e}function O(e,t,n,i,r,s,o,a,l){(0,v.hZ)(e,t,i,s,n,r,o,1,1,1),(0,M.j)(I,a,l,1),(0,v.KC)(b,e);const[c,u,h]=(0,M.o)(I,I,(0,v.mg)(b,b));return(0,v.hZ)(b,c,0,0,0,u,0,0,0,h),(0,v.lw)(e,b,e)}var E=n(90629),L=n(48163),B=n(86738),T=n(39829),Z=n(91218),j=n(16930),Y=n(56560),U=n(69540);let X=class extends U.Pw{projectOrWarn(e,t){if(null==e)return e;const{geometry:n,pending:i}=(0,Z.projectOrLoad)(e,t);return i?null:i||n?n:(o.A.getLogger(this).warn("geometry could not be projected to the spatial reference",{georeference:this,geometry:e,sourceSpatialReference:e.spatialReference,targetSpatialReference:t}),null)}};X=(0,i.Cg)([(0,d.$)("esri.layers.support.GeoreferenceBase")],X);const H=(0,w.vt)(),N=(0,L.vt)();let $=class extends _.o{};(0,i.Cg)([(0,c.MZ)({type:Number,json:{write:{isRequired:!0}}})],$.prototype,"x",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{write:{isRequired:!0}}})],$.prototype,"y",void 0),$=(0,i.Cg)([(0,d.$)("esri.layers.support.ControlPointsGeoreference.ControlPointJSONType")],$);let z=class extends((0,_.T)(X)){constructor(e){super(e),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(e,t){const n=j.A.fromJSON(t.spatialReference),i=(0,w.fA)(...t.coefficients,1);return e.map(e=>((0,P.hZ)(N,e.x,e.y),R(N,N,i),{sourcePoint:e,mapPoint:new B.A({x:N[0],y:N[1],spatialReference:n})}))}writeControlPoints(e,t,n,i){if(null==this.transform){const e=new s.A("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration. Make sure the parent media element is loaded i.e. the ImageElement or VideoElement set as 'MediaLayer.source'.",{layer:i?.layer,georeference:this});return void(i?.messages?i.messages.push(e):o.A.getLogger(this).error(e.name,e.message))}null!=e&&V(e[0])&&(t.controlPoints=e.map(e=>{const t=e.sourcePoint;return{x:t.x,y:t.y}}),t.spatialReference=e[0].mapPoint.spatialReference.toJSON(),t.coefficients=this.transform.slice(0,8))}get coords(){if(null==this.controlPoints)return null;const e=this._updateTransform(H);if(null==e||!V(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return function(e,t,n,i){const r=(0,L.fA)(0,n),s=(0,L.fA)(0,0),o=(0,L.fA)(t,0),a=(0,L.fA)(t,n);return R(r,r,e),R(s,s,e),R(o,o,e),R(a,a,e),new T.A({rings:[[r,s,o,a,r]],spatialReference:i})}(e,this.width,this.height,t)}set coords(e){if(null==this.controlPoints||!V(this.controlPoints[0]))return;const t=this.controlPoints[0].mapPoint.spatialReference;if(null==(e=this.projectOrWarn(e,t)))return;const{width:n,height:i}=this,{rings:[[r,s,o,a]]}=e,l=new Y.A({sourcePoint:(0,E.tc)(0,i),mapPoint:new B.A({x:r[0],y:r[1],spatialReference:t})}),c=new Y.A({sourcePoint:(0,E.tc)(0,0),mapPoint:new B.A({x:s[0],y:s[1],spatialReference:t})}),u=new Y.A({sourcePoint:(0,E.tc)(n,0),mapPoint:new B.A({x:o[0],y:o[1],spatialReference:t})}),h=new Y.A({sourcePoint:(0,E.tc)(n,i),mapPoint:new B.A({x:a[0],y:a[1],spatialReference:t})});V(l)&&V(c)&&V(u)&&V(h)&&(te(H,l,c,u,h),this.controlPoints=this.controlPoints.map(({sourcePoint:e})=>((0,P.hZ)(N,e.x,e.y),R(N,N,H),{sourcePoint:e,mapPoint:new B.A({x:N[0],y:N[1],spatialReference:t})})))}get inverseTransform(){return null==this.transform?null:(0,v.B8)((0,w.vt)(),this.transform)}get transform(){return this._updateTransform()}toMap(e){if(null==e||null==this.transform||null==this.controlPoints||!V(this.controlPoints[0]))return null;(0,P.hZ)(N,e.x,e.y);const t=this.controlPoints[0].mapPoint.spatialReference;return R(N,N,this.transform),new B.A({x:N[0],y:N[1],spatialReference:t})}toSource(e){if(null==e||null==this.inverseTransform||null==this.controlPoints||!V(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return e=e.normalize(),null==(e=(0,Z.projectOrLoad)(e,t).geometry)?null:((0,P.hZ)(N,e.x,e.y),R(N,N,this.inverseTransform),(0,E.tc)(N[0],N[1]))}toSourceNormalized(e){const t=this.toSource(e);return null!=t&&(t.x/=this.width,t.y/=this.height),t}_updateTransform(e){const{controlPoints:t,width:n,height:i}=this;if(!(null!=t&&n>0&&i>0))return null;const[r,s,o,a]=t;if(!V(r))return null;const l=r.mapPoint.spatialReference,c=this._projectControlPoint(s,l),u=this._projectControlPoint(o,l),h=this._projectControlPoint(a,l);if(!c.valid||!u.valid||!h.valid)return null;if(!V(c.controlPoint))return null;null==e&&(e=(0,w.vt)());let d=null;return d=V(u.controlPoint)&&V(h.controlPoint)?te(e,r,c.controlPoint,u.controlPoint,h.controlPoint):V(u.controlPoint)?function(e,t,n,i){return ee(k,F,t),ee(G,q,n),ee(W,K,i),(0,P.Cc)(D,k,G,.5),(0,P.e$)(D,W,D,Math.PI),(0,P.Cc)(J,F,q,.5),(0,P.e$)(J,K,J,Math.PI),se(e,k,G,W,D,F,q,K,J)}(e,r,c.controlPoint,u.controlPoint):function(e,t,n){return ee(k,F,t),ee(G,q,n),(0,P.e$)(W,G,k,Q),(0,P.e$)(D,k,G,Q),(0,P.e$)(K,q,F,-Q),(0,P.e$)(J,F,q,-Q),se(e,k,G,W,D,F,q,K,J)}(e,r,c.controlPoint),d.every(e=>0===e)?null:d}_projectControlPoint(e,t){if(!V(e))return{valid:!0,controlPoint:e};const{sourcePoint:n,mapPoint:i}=e,{geometry:r,pending:s}=(0,Z.projectOrLoad)(i,t);return s?{valid:!1,controlPoint:null}:s||r?{valid:!0,controlPoint:new Y.A({sourcePoint:n,mapPoint:r})}:(o.A.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:e,sourceSpatialReference:i.spatialReference,targetSpatialReference:t}),{valid:!1,controlPoint:null})}};function V(e){return null!=e?.sourcePoint&&null!=e.mapPoint}(0,i.Cg)([(0,c.MZ)({type:[Y.A],json:{write:{allowNull:!1,isRequired:!0,target:{controlPoints:{type:[$],isRequired:!0},coefficients:{type:[Number],isRequired:!0},spatialReference:{type:j.A,isRequired:!0}}}}})],z.prototype,"controlPoints",void 0),(0,i.Cg)([(0,h.w)("controlPoints")],z.prototype,"readControlPoints",null),(0,i.Cg)([(0,p.K)("controlPoints")],z.prototype,"writeControlPoints",null),(0,i.Cg)([(0,c.MZ)({clonable:!1})],z.prototype,"coords",null),(0,i.Cg)([(0,c.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],z.prototype,"height",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],z.prototype,"inverseTransform",null),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],z.prototype,"transform",null),(0,i.Cg)([(0,c.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],z.prototype,"width",void 0),z=(0,i.Cg)([(0,d.$)("esri.layers.support.ControlPointsGeoreference")],z);const k=(0,L.vt)(),G=(0,L.vt)(),W=(0,L.vt)(),D=(0,L.vt)(),F=(0,L.vt)(),q=(0,L.vt)(),K=(0,L.vt)(),J=(0,L.vt)(),Q=Math.PI/2;function ee(e,t,n){(0,P.hZ)(e,n.sourcePoint.x,n.sourcePoint.y),(0,P.hZ)(t,n.mapPoint.x,n.mapPoint.y)}function te(e,t,n,i,r){return ee(k,F,t),ee(G,q,n),ee(W,K,i),ee(D,J,r),se(e,k,G,W,D,F,q,K,J)}const ne=new Array(8).fill(0),ie=new Array(8).fill(0);function re(e,t,n,i,r){return e[0]=t[0],e[1]=t[1],e[2]=n[0],e[3]=n[1],e[4]=i[0],e[5]=i[1],e[6]=r[0],e[7]=r[1],e}function se(e,t,n,i,r,s,o,a,l){return S(e,re(ne,t,n,i,r),re(ie,s,o,a,l))}var oe=n(43773),ae=n(21287),le=n(84952),ce=n(13069),ue=n(92474);let he=0;const de=e=>{const t=e;let n=class extends t{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:he++})}};return n=(0,i.Cg)([(0,d.$)("esri.core.NumericIdentifiable")],n),n};var pe=n(35666),me=n(5443),fe=n(21325);const ge=(0,L.vt)();let ye=class extends X{constructor(e){super(e),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:e,topRight:t,bottomLeft:n,bottomRight:i}=this;if(null==e||null==t||null==n||null==i)return null;const r=e.spatialReference;return t=this.projectOrWarn(t,r),n=this.projectOrWarn(n,r),i=this.projectOrWarn(i,r),null==t||null==n||null==i?null:new T.A({rings:[[[n.x,n.y],[e.x,e.y],[t.x,t.y],[i.x,i.y],[n.x,n.y]]],spatialReference:r})}set coords(e){const{topLeft:t}=this;if(null==t)return;const n=t.spatialReference;if(null==(e=this.projectOrWarn(e,n)))return;const{rings:[[i,r,s,o]]}=e;this.bottomLeft=new B.A({x:i[0],y:i[1],spatialReference:n}),this.topLeft=new B.A({x:r[0],y:r[1],spatialReference:n}),this.topRight=new B.A({x:s[0],y:s[1],spatialReference:n}),this.bottomRight=new B.A({x:o[0],y:o[1],spatialReference:n})}toSourceNormalized(e){const{topLeft:t,topRight:n,bottomRight:i,bottomLeft:r}=this;if(null==e||null==t||null==n||null==i||null==r)return null;const s=t.spatialReference;e=e.normalize();const o=(0,Z.projectOrLoad)(e,s).geometry;if(null==o)return null;(0,P.hZ)(ge,o.x,o.y);const a=S((0,w.vt)(),[t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y],[0,0,0,1,1,0,1,1]);return R(ge,ge,a),(0,E.tc)(ge[0],ge[1])}};(0,i.Cg)([(0,c.MZ)({clonable:!1})],ye.prototype,"coords",null),(0,i.Cg)([(0,c.MZ)({type:B.A})],ye.prototype,"bottomLeft",void 0),(0,i.Cg)([(0,c.MZ)({type:B.A})],ye.prototype,"bottomRight",void 0),(0,i.Cg)([(0,c.MZ)({type:B.A})],ye.prototype,"topLeft",void 0),(0,i.Cg)([(0,c.MZ)({type:B.A})],ye.prototype,"topRight",void 0),ye=(0,i.Cg)([(0,d.$)("esri.layers.support.CornersGeoreference")],ye);const xe=ye;var _e=n(34727),ve=n(34304);let we=class extends X{constructor(e){super(e),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(null==this.extent)return null;const{xmin:e,ymin:t,xmax:n,ymax:i,spatialReference:r}=this.extent;let s;if(this.rotation){const{x:r,y:o}=this.extent.center,a=Pe(r,o,this.rotation);s=[a(e,t),a(e,i),a(n,i),a(n,t)],s.push(s[0])}else s=[[e,t],[e,i],[n,i],[n,t],[e,t]];return new T.A({rings:[s],spatialReference:r})}set coords(e){if(null==e||null==this.extent)return;const t=this.extent.spatialReference;if(e=this.projectOrWarn(e,t),null==e?.extent)return;const{rings:[[n,i,r]],extent:{center:{x:s,y:o}}}=e,a=(0,_e.KJ)(Math.PI/2-Math.atan2(i[1]-n[1],i[0]-n[0])),l=Pe(s,o,-a),[c,u]=l(n[0],n[1]),[h,d]=l(r[0],r[1]);this.extent=new me.A({xmin:c,ymin:u,xmax:h,ymax:d,spatialReference:t}),this.rotation=a}toSourceNormalized(e){const{extent:t,rotation:n}=this;if(null==e||null==t)return null;const{xmin:i,ymin:r,xmax:s,ymax:o,center:a,spatialReference:l}=t;e=e.normalize();const c=(0,Z.projectOrLoad)(e,l).geometry;if(null==c)return null;let u=c.x,h=c.y;return n&&([u,h]=Pe(a.x,a.y,-n)(u,h)),(0,E.tc)((0,_e.hs)(u,i,s,0,1),(0,_e.hs)(h,o,r,0,1))}};function Pe(e,t,n){const i=(0,ve.DF)(n),r=Math.cos(i),s=Math.sin(i);return(n,i)=>[r*(n-e)+s*(i-t)+e,r*(i-t)-s*(n-e)+t]}function Me(e,t){const n=(0,pe.aB)(t);return function(e){return"media"===e?.type}(e)&&!!e.portalItem&&null!=n&&n>3}function Ie(e,t,n){return{enabled:!Me(n?.layer,n?.origin),ignoreOrigin:!0}}(0,i.Cg)([(0,c.MZ)({clonable:!1})],we.prototype,"coords",null),(0,i.Cg)([(0,c.MZ)({type:me.A})],we.prototype,"extent",void 0),(0,i.Cg)([(0,c.MZ)({type:Number})],we.prototype,"rotation",void 0),we=(0,i.Cg)([(0,d.$)("esri.layers.support.ExtentAndRotationGeoreference")],we);const be={json:{name:"url",type:String,write:{overridePolicy:Ie}}},Ae={readOnly:!0,json:{read:!1,write:{target:"mediaType",overridePolicy:Ie}}},Ce={types:{key:"type",base:X,typeMap:{"control-points":z,corners:xe,"extent-and-rotation":we}},json:{types:{key:"type",base:X,typeMap:{"control-points":z}},write:{overridePolicy:()=>({enabled:!0,ignoreOrigin:!0})}}};let Re=class extends(de((0,a.P)(ue.x_))){constructor(e){super(e),this.georeference=null,this.opacity=1}readGeoreference(e){return z.fromJSON(e)}writeGeoreference(e,t,n,i){const r=i?.resources?.pendingOperations,a=()=>{const r=function(e,t,n){if(!e||"control-points"===e.type)return e;const{coords:i}=e;if(5!==i?.rings[0]?.length)return null;const[r,s,o,a]=i.rings[0],{spatialReference:l}=i;return new z({controlPoints:[new Y.A({mapPoint:new B.A({x:r[0],y:r[1],spatialReference:l}),sourcePoint:(0,E.tc)(0,n)}),new Y.A({mapPoint:new B.A({x:s[0],y:s[1],spatialReference:l}),sourcePoint:(0,E.tc)(0,0)}),new Y.A({mapPoint:new B.A({x:o[0],y:o[1],spatialReference:l}),sourcePoint:(0,E.tc)(t,0)}),new Y.A({mapPoint:new B.A({x:a[0],y:a[1],spatialReference:l}),sourcePoint:(0,E.tc)(t,n)})],width:t,height:n})}(this.georeference,this.contentWidth,this.contentHeight);if(r){if("control-points"!==e.type&&o.A.getLogger(this).warn(`only georeference of type 'control-points' may be persisted. The georeference of type '${e.type}' has been automatically converted.`),4!==r.controlPoints?.length&&i?.messages)return void i.messages.push(new s.A("property:unsupported","only 'control-points' georeference with 4 control points may be persisted."));t[n]=r.write({},i)}};if("control-points"!==e.type&&!this.loaded&&r)return t[n]={},void r.push(this.load().then(a));a()}get contentWidth(){return 0}get contentHeight(){return 0}toSource(e){const{georeference:t,contentWidth:n,contentHeight:i}=this;if(null==e||null==t||0===n||0===i)return null;const r=t.toSourceNormalized(e);return null==r?null:(r.x*=n,r.y*=i,r)}};(0,i.Cg)([(0,c.MZ)(Ce)],Re.prototype,"georeference",void 0),(0,i.Cg)([(0,h.w)("georeference")],Re.prototype,"readGeoreference",null),(0,i.Cg)([(0,p.K)("georeference")],Re.prototype,"writeGeoreference",null),(0,i.Cg)([(0,c.MZ)({json:{read:!1,write:!1}})],Re.prototype,"opacity",void 0),Re=(0,i.Cg)([(0,d.$)("esri.layers.support.MediaElementBase")],Re);var Se=n(85648);const Oe=Symbol("ImageElementInstance"),Ee=Symbol("VideoElementInstance");function Le(e){return function(e){return null!=e&&"object"==typeof e&&Oe in e}(e)||function(e){return null!=e&&"object"==typeof e&&Ee in e}(e)}var Be,Te=n(97159);let Ze=class extends Re{static{Be=Oe}constructor(e){super(e),this.animationOptions=null,this.content=null,this.image=null,this.type="image",this[Be]=!0,this.image=null}load(){const e=this.image;if("string"==typeof e){const t=(0,ae.M5)(e).then(e=>{this._set("content",e)});this.addResolvingPromise(t)}else if(e instanceof HTMLImageElement){const t=e.decode().then(()=>{this._set("content",e)});this.addResolvingPromise(t)}else e?this._set("content",e):this.addResolvingPromise(Promise.reject(new s.A("image-element:invalid-image-type","Invalid image type",{image:e})));return Promise.resolve(this)}get contentWidth(){return null==this.content?0:this.content instanceof HTMLImageElement?this.content.naturalWidth:this.content.width}get contentHeight(){return null==this.content?0:this.content instanceof HTMLImageElement?this.content.naturalHeight:this.content.height}readImage(e,t,n){return(0,Te.f)(t.url,n)}writeImage(e,t,n,i){if(null==e)return;const r=i?.portalItem,s=i?.resources;if(!r||!s)return void("string"==typeof e&&(t[n]=(0,Te.t)(e,i)));const o=function(e){return"string"==typeof e&&!(0,le.DB)(e)&&!(0,le.w8)(e)}(e)?e:null;if(o){if(null==(0,Te.i)(o))return void(t[n]=o);const e=(0,Te.t)(o,{...i,verifyItemRelativeUrls:i?.verifyItemRelativeUrls?{writtenUrls:i.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},1);if(r&&e&&!(0,le.oP)(e))return s.toKeep.push({resource:r.resourceFromPath(e),compress:!1}),void(t[n]=e)}t[n]="<pending>",s.pendingOperations.push(async function(e){return"string"==typeof e?(0,le.DB)(e)?(0,le.N9)(e):(await(0,oe.A)(e,{responseType:"blob"})).data:new Promise(t=>function(e){if(e instanceof HTMLCanvasElement)return e;const t=e instanceof HTMLImageElement?e.naturalWidth:e.width,n=e instanceof HTMLImageElement?e.naturalHeight:e.height,i=document.createElement("canvas"),r=i.getContext("2d");return i.width=t,i.height=n,e instanceof HTMLImageElement?r.drawImage(e,0,0,e.width,e.height):e instanceof ImageData&&r.putImageData(e,0,0),i}(e).toBlob(t))}(e).then(e=>{const i=function(e,t){const n=(0,ce.lk)(),i=`${(0,le.fj)("media",n)}.${(0,Se.n)({type:"blob",blob:e})}`;return t.resourceFromPath(i)}(e,r);t[n]=i.itemRelativeUrl,s.toAdd.push({resource:i,content:{type:"blob",blob:e},compress:!1,finish:e=>{this.image=e.url}})}))}};(0,i.Cg)([(0,c.MZ)()],Ze.prototype,"animationOptions",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],Ze.prototype,"content",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],Ze.prototype,"contentWidth",null),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],Ze.prototype,"contentHeight",null),(0,i.Cg)([(0,c.MZ)(be)],Ze.prototype,"image",void 0),(0,i.Cg)([(0,h.w)("image",["url"])],Ze.prototype,"readImage",null),(0,i.Cg)([(0,p.K)("image")],Ze.prototype,"writeImage",null),(0,i.Cg)([(0,c.MZ)(Ae)],Ze.prototype,"type",void 0),Ze=(0,i.Cg)([(0,d.$)("esri.layers.support.ImageElement")],Ze);var je=n(62885),Ye=n(65529),Ue=n(61893),Xe=n(36708),He=n(19419),Ne=n(12176),$e=n(6518),ze=n(69622),Ve=n(89056);let ke=class extends ze.A{constructor(e){super(e)}get bounds(){const e=this.coords;return null==e?.extent?null:(0,He.VY)(e.extent)}get coords(){const e=this.element.georeference?.coords;return(0,Z.projectOrLoad)(e,this.spatialReference).geometry}get normalizedCoords(){return T.A.fromJSON((0,Ve.jZ)(this.coords))}get normalizedBounds(){const e=null!=this.normalizedCoords?this.normalizedCoords.extent:null;return null!=e?(0,He.VY)(e):null}};(0,i.Cg)([(0,c.MZ)()],ke.prototype,"spatialReference",void 0),(0,i.Cg)([(0,c.MZ)()],ke.prototype,"element",void 0),(0,i.Cg)([(0,c.MZ)()],ke.prototype,"bounds",null),(0,i.Cg)([(0,c.MZ)()],ke.prototype,"coords",null),(0,i.Cg)([(0,c.MZ)()],ke.prototype,"normalizedCoords",null),(0,i.Cg)([(0,c.MZ)()],ke.prototype,"normalizedBounds",null),ke=(0,i.Cg)([(0,d.$)("esri.layers.support.MediaElementView")],ke);var Ge,We=n(16494),De=n(38969);const Fe=Symbol("canplay");let qe=class extends Re{static{Ge=Ee}constructor(e){super(e),this.autoplay=!0,this.content=null,this.type="video",this[Ge]=!0}load(){const e=this.video;return"string"==typeof e?this.addResolvingPromise(this._preProcessVideoUrl(e).then(async e=>{const t=document.createElement("video");return t.src=We.W5.sanitizeUrl((0,le.s2)(e)),t.crossOrigin="anonymous",t.autoplay=this.autoplay,t.muted=!0,t.loop=!0,t.playsInline=!0,this._loadVideo(t).then(()=>{this._set("content",t)})})):e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then(()=>{this._set("content",e)})):this.addResolvingPromise(Promise.reject(new s.A("video-element:invalid-video-type","Invalid video type",{video:e}))),Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}get currentTime(){return this.content?.currentTime}set currentTime(e){if(!this.content)return;const t=(0,_e.qE)(e,0,this.content.duration);"fastSeek"in this.content?this.content.fastSeek(t):this.content.currentTime=t,this.content.play().then(()=>{this.content?.pause()}).catch(()=>{})}get duration(){return this.content?.duration}set video(e){"not-loaded"===this.loadStatus?this._set("video",e):o.A.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}writeVideo(e,t,n,i){if(!e)return void(i?.messages&&i.messages.push(new s.A("video-element:unsupported-video","video source is missing")));const r=function(e){return"string"==typeof e&&!(0,le.DB)(e)&&!(0,le.w8)(e)}(e)?e:null;if(!r)return void(i?.messages&&i.messages.push(new s.A("video-element:unsupported-video","video source must be an absolute url")));!(0,le.oP)(r)&&i?.blockedRelativeUrls&&i.blockedRelativeUrls.push(r);const o=(0,le.s2)(r);(0,Te.i)(o)?i?.messages&&i.messages.push(new s.A("video-element:unsupported-video","video source cannot be an item resource")):t[n]=o}async _preProcessVideoUrl(e){if((0,le.zs)(e))return(0,le.yM)(e);try{return await(0,oe.A)(e,{method:"head"}),e}catch{try{return(0,le.yM)(e,!0)}catch{return e}}}async _loadVideo(e){"anonymous"!==e.crossOrigin&&(e.crossOrigin="anonymous",(0,le.w8)(e.src)||(e.src=e.src));try{await(0,De.i)(e,e=>this.addHandles(e,Fe)),this.autoplay&&await e.play().catch(e=>{throw console.error(e),e})}finally{this.removeHandles(Fe)}}};(0,i.Cg)([(0,c.MZ)()],qe.prototype,"autoplay",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],qe.prototype,"content",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],qe.prototype,"contentWidth",null),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],qe.prototype,"contentHeight",null),(0,i.Cg)([(0,c.MZ)({type:Number})],qe.prototype,"currentTime",null),(0,i.Cg)([(0,c.MZ)({type:Number})],qe.prototype,"duration",null),(0,i.Cg)([(0,c.MZ)(be)],qe.prototype,"video",null),(0,i.Cg)([(0,p.K)("video")],qe.prototype,"writeVideo",null),(0,i.Cg)([(0,c.MZ)(Ae)],qe.prototype,"type",void 0),qe=(0,i.Cg)([(0,d.$)("esri.layers.support.VideoElement")],qe);const Ke={key:"type",defaultKeyValue:"image",base:Re,typeMap:{image:Ze,video:qe}},Je=r.A.ofType(Ke);let Qe=class extends((0,ue.WV)((0,Ue.g)(Ye.nJ))){constructor(e){super(e),this._index=new $e.F,this._elementViewsMap=new Map,this._elementsIndexes=new Map,this._elementsChangedHandler=e=>{for(const t of e.removed){const e=this._elementViewsMap.get(t);this._elementViewsMap.delete(t),this._index.delete(e),this.removeHandles(e),e.destroy(),this.notifyChange("fullExtent")}const{spatialReference:t}=this;for(const n of e.added){if(this._elementViewsMap.get(n))continue;const e=new ke({spatialReference:t,element:n});this._elementViewsMap.set(n,e);const i=(0,Xe.wB)(()=>e.coords,()=>this._updateIndexForElement(e,!1));this._updateIndexForElement(e,!0),this.addHandles(i,e)}this._elementsIndexes.clear(),this.elements.forEach((e,t)=>this._elementsIndexes.set(e,t)),this.emit("refresh")},this.elements=new Je}async load(e){if((0,l.Te)(e),!this.spatialReference){const e=this.elements.find(e=>null!=e.georeference?.coords);this._set("spatialReference",e?e.georeference.coords.spatialReference:j.A.WGS84)}return this._elementsChangedHandler({added:this.elements.items,removed:[]}),this.addHandles(this.elements.on("change",this._elementsChangedHandler)),this}destroy(){this._index.clear(),this._elementViewsMap.clear(),this._elementsIndexes.clear()}set elements(e){this._set("elements",(0,je.V)(e,this._get("elements"),Je))}get fullExtent(){if("not-loaded"===this.loadStatus)return null;const e=this._index.fullBounds;return null==e?null:new me.A({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:this.spatialReference})}set spatialReference(e){"not-loaded"===this.loadStatus?this._set("spatialReference",e):o.A.getLogger(this).error("#spatialReference","spatialReference cannot be changed after the source is loaded.")}async queryElements(e,t){await this.load(),await(0,Z.initializeProjection)(e.spatialReference,this.spatialReference,null,t);const n=(0,fe.aI)(e.spatialReference,this.spatialReference)?e:(0,Z.project)(e,this.spatialReference);if(!n)return[];const i=n.normalize(),r=[];for(const e of i)this._index.forEachInBounds((0,He.VY)(e),({normalizedCoords:t,element:n})=>{null!=t&&(0,Ne.fA)(e,t)&&r.push(n)});return r.sort((e,t)=>this._elementsIndexes.get(e)-this._elementsIndexes.get(t)),r}hasElement(e){return this.elements.includes(e)}_updateIndexForElement(e,t){const n=e.normalizedBounds,i=this._index.has(e),r=null!=n;this._index.delete(e),r&&this._index.set(e,n),this.notifyChange("fullExtent"),t||(i!==r?this.emit("refresh"):this.emit("change",{element:e.element}))}};(0,i.Cg)([(0,c.MZ)()],Qe.prototype,"elements",null),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],Qe.prototype,"fullExtent",null),(0,i.Cg)([(0,c.MZ)()],Qe.prototype,"spatialReference",null),Qe=(0,i.Cg)([(0,d.$)("esri.layers.support.LocalMediaElementSource")],Qe);let et=class extends((0,f.dM)((0,x.j)((0,g.q)((0,y.A)((0,a.P)(m.A)))))){constructor(e){super(e),this.effectiveSource=null,this.georeference=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this._debouncedSaveOperations=(0,l.sg)(async(e,t,i)=>{const{save:r,saveAs:s}=await n.e(3561).then(n.bind(n,63561));switch(e){case 0:return r(this,t);case 1:return s(this,i,t)}}),this.source=new Qe}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.loadFromPortal({supportedTypes:["Media Layer"]},e);let t=this.source;if(!t)throw new s.A("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer.");const n=this._getSourceOverride(t,this.georeference);n&&(this.setAtOrigin("source",n,"web-map"),this.setAtOrigin("source",n,"web-scene"),t=n);const i=Le(t)?new Qe({elements:new r.A([t])}):t;this._set("effectiveSource",i),this.spatialReference&&(i.spatialReference=this.spatialReference),await i.load(e),this.spatialReference=i.spatialReference}destroy(){this.effectiveSource?.destroy(),this.effectiveSource!==this.source&&this.source?.destroy()}readGeoreference(e,t){return e&&"itemId"in t&&t.itemId?e:void 0}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}get loaded(){return super.loaded}get source(){return this._get("source")}set source(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("source",e):o.A.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(e){return e?Array.isArray(e)?new Qe({elements:new r.A(e)}):e instanceof r.A?new Qe({elements:e}):e:null}readSource(e,t,n){if("itemId"in t&&t.itemId)return;const i=this._createSource(t);return i?.read(t,n),i}writeSource(e,t,n,i){if(e&&e instanceof Qe){const t=e.elements.length;if(1!==t)return void(i?.messages&&i.messages.push(new s.A("media-layer:unsupported-source",`local media element source can only be persisted if it contains exactly one ImageElement, but it has ${t}.`)));e=e.elements.at(0)}Le(e)?e.write(t,i):i?.messages&&(e?i.messages.push(new s.A("media-layer:unsupported-source","only media elements of type 'ImageElement' or 'VideoElement' can be persisted")):i.messages.push(new s.A("media-layer:unsupported-source","the media layer is missing a source")))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_createSource(e){if("mediaType"in e)switch(e.mediaType){case"image":return new Ze;case"video":return new qe}return null}_getSourceOverride(e,t){if(Le(e)&&3===this.originIdOf("source")&&t&&(5===this.originIdOf("georeference")||4===this.originIdOf("georeference"))){const n=e.toJSON(),i=this._createSource(n);return i.read({...n},{origin:"portal-item"}),i.read({georeference:t},{origin:"web-map"}),i.read({georeference:t},{origin:"web-scene"}),i}return null}};(0,i.Cg)([(0,c.MZ)({readOnly:!0})],et.prototype,"effectiveSource",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!0}}}})],et.prototype,"georeference",void 0),(0,i.Cg)([(0,h.w)("web-document","georeference")],et.prototype,"readGeoreference",null),(0,i.Cg)([(0,c.MZ)({type:String})],et.prototype,"copyright",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],et.prototype,"fullExtent",null),(0,i.Cg)([(0,c.MZ)({type:["MediaLayer"]})],et.prototype,"operationalLayerType",void 0),(0,i.Cg)([(0,c.MZ)({type:["show","hide"]})],et.prototype,"listMode",void 0),(0,i.Cg)([(0,c.MZ)({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1,target:{url:{type:String},mediaType:{type:["image","video"]},georeference:{type:z}},overridePolicy(e,t,n){return{enabled:!0,allowNull:!1,ignoreOrigin:Me(this,n?.origin)&&Le(e)&&!!e.georeference&&e.originIdOf("georeference")>3}}}}})],et.prototype,"source",null),(0,i.Cg)([(0,u.w)("source")],et.prototype,"castSource",null),(0,i.Cg)([(0,h.w)("source",["url"])],et.prototype,"readSource",null),(0,i.Cg)([(0,p.K)("source")],et.prototype,"writeSource",null),(0,i.Cg)([(0,c.MZ)()],et.prototype,"spatialReference",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],et.prototype,"type",void 0),et=(0,i.Cg)([(0,d.$)("esri.layers.MediaLayer")],et);const tt=et},38969:(e,t,n)=>{n.d(t,{i:()=>r});var i=n(37955);function r(e,t){return new Promise((n,r)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?n():(t((0,i.Oo)(e,"canplay",n)),t((0,i.Oo)(e,"error",r)))})}},48163:(e,t,n)=>{function i(){return[0,0]}function r(e){return[e[0],e[1]]}function s(e,t){return[e,t]}function o(){return s(1,1)}function a(){return s(1,0)}function l(){return s(0,1)}n.d(t,{Un:()=>c,fA:()=>s,o8:()=>r,vt:()=>i});const c=o(),u=a(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:c,UNIT_X:u,UNIT_Y:h,ZEROS:[0,0],clone:r,create:i,freeze:function(e,t){return[e,t]},fromArray:function(e,t=[0,0]){const n=Math.min(2,e.length);for(let i=0;i<n;++i)t[i]=e[i];return t},fromValues:s,ones:o,unitX:a,unitY:l,zeros:function(){return[0,0]}},Symbol.toStringTag,{value:"Module"}))},62885:(e,t,n)=>{n.d(t,{H:()=>s,V:()=>r});var i=n(7762);function r(e,t,n=i.A){return t||(t=new n),t===e||t.destroyed||(t.removeAll(),(r=e)&&(Array.isArray(r)||"items"in r&&Array.isArray(r.items))?t.addMany(e):e&&t.add(e)),t;var r}function s(e){return e}},69540:(e,t,n)=>{n.d(t,{OU:()=>u,Pw:()=>h});var i=n(31635),r=n(69622),s=(n(44208),n(4718)),o=(n(53966),n(97768)),a=n(88620),l=n(64108);const c=Symbol("ClonableMixin"),u=e=>{var t;const n=e;let r=class extends n{constructor(){super(...arguments),this[t]=!0}static{t=c}clone(e){const t=(0,a.oY)(this);(0,o.Lw)(t,"unable to clone instance of non-accessor class");const n=t.metadata,i=t.store,r={},l=new Map;for(const t in n){const o=n[t],a=i?.originOf(t),c=o.clonable;if(o.readOnly||!1===c||7!==a&&0!==a&&5!==a&&4!==a)continue;const u=this[t];let h=null;if("function"==typeof c)h=c(u,e);else if("reference"===c)h=u;else if(h=(0,s.TU)(u,e),null!=u&&null==h)continue;0===a?l.set(t,h):r[t]=h}const c=new(0,Object.getPrototypeOf(this).constructor)(r);if(l.size){const e=(0,a.oY)(c)?.store;if(e)for(const[t,n]of l)e.set(t,n,0)}return c}};return r=(0,i.Cg)([(0,l.$)("esri.core.Clonable")],r),r},h=u(r.A)},75503:(e,t,n)=>{n.d(t,{EC:()=>b,wq:()=>a});var i=n(4576),r=n(21818),s=(n(44208),n(15142)),o=n(11006);class a{constructor(e=9,t){this._compareMinX=d,this._compareMinY=p,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),w.prune(),P.prune(),M.prune(),I.prune()}all(e){l(this._data,e)}search(e,t){let n=this._data;const i=this._toBBox;if(_(e,n))for(w.clear();n;){for(let r=0,s=n.children.length;r<s;r++){const s=n.children[r],o=n.leaf?i(s):s;_(e,o)&&(n.leaf?t(s):x(e,o)?l(s,t):w.push(s))}n=w.pop()}}collides(e){let t=this._data;const n=this._toBBox;if(!_(e,t))return!1;for(w.clear();t;){for(let i=0,r=t.children.length;i<r;i++){const r=t.children[i],s=t.leaf?n(r):r;if(_(e,s)){if(t.leaf||x(e,s))return!0;w.push(r)}}t=w.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,n=e.length;t<n;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new C([]),this}remove(e){if(!e)return this;let t,n=this._data,s=null,o=0,a=!1;const l=this._toBBox(e);for(M.clear(),I.clear();n||M.length>0;){if(n||(n=M.pop(),s=M.data[M.length-1],o=I.pop()??0,a=!0),n.leaf&&(t=(0,i.qh)(n.children,(0,r.zI)(e),n.children.length,n.indexHint),-1!==t))return n.children.splice(t,1),M.push(n),this._condense(M),this;a||n.leaf||!x(n,l)?s?(o++,n=s.children[o],a=!1):n=null:(M.push(n),I.push(o),o=0,s=n,n=n.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,n,i){const r=n-t+1;let s=this._maxEntries;if(r<=s){const i=new C(e.slice(t,n+1));return c(i,this._toBBox),i}i||(i=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/s**(i-1)));const o=new R([]);o.height=i;const a=Math.ceil(r/s),l=a*Math.ceil(Math.sqrt(s));v(e,t,n,l,this._compareMinX);for(let r=t;r<=n;r+=l){const t=Math.min(r+l-1,n);v(e,r,t,a,this._compareMinY);for(let n=r;n<=t;n+=a){const r=Math.min(n+a-1,t);o.children.push(this._build(e,n,r,i-1))}}return c(o,this._toBBox),o}_insert(e,t,n){const i=this._toBBox,r=n?e:i(e);M.clear();const s=function(e,t,n,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==n;){let n,i=1/0,r=1/0;for(let s=0,o=t.children.length;s<o;s++){const o=t.children[s],a=m(o),l=g(e,o)-a;l<r?(r=l,i=a<i?a:i,n=o):l===r&&a<i&&(i=a,n=o)}t=n||t.children[0]}return t}(r,this._data,t,M);for(s.children.push(e),h(s,r);t>=0&&M.data[t].children.length>this._maxEntries;)this._split(M,t),t--;!function(e,t,n){for(let i=n;i>=0;i--)h(t.data[i],e)}(r,M,t)}_split(e,t){const n=e.data[t],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);const s=this._chooseSplitIndex(n,r,i);if(!s)return;const o=n.children.splice(s,n.children.length-s),a=n.leaf?new C(o):new R(o);a.height=n.height,c(n,this._toBBox),c(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(n,a)}_splitRoot(e,t){this._data=new R([e,t]),this._data.height=e.height+1,c(this._data,this._toBBox)}_chooseSplitIndex(e,t,n){let i,r,s;i=r=1/0;for(let o=t;o<=n-t;o++){const t=u(e,0,o,this._toBBox),a=u(e,o,n,this._toBBox),l=y(t,a),c=m(t)+m(a);l<i?(i=l,s=o,r=c<r?c:r):l===i&&c<r&&(r=c,s=o)}return s}_chooseSplitAxis(e,t,n){const i=e.leaf?this._compareMinX:d,r=e.leaf?this._compareMinY:p;this._allDistMargin(e,t,n,i)<this._allDistMargin(e,t,n,r)&&e.children.sort(i)}_allDistMargin(e,t,n,i){e.children.sort(i);const r=this._toBBox,s=u(e,0,t,r),o=u(e,n-t,n,r);let a=f(s)+f(o);for(let i=t;i<n-t;i++){const t=e.children[i];h(s,e.leaf?r(t):t),a+=f(s)}for(let i=n-t-1;i>=t;i--){const t=e.children[i];h(o,e.leaf?r(t):t),a+=f(o)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){const n=e.data[t];if(0===n.children.length)if(t>0){const r=e.data[t-1],s=r.children;s.splice((0,i.qh)(s,n,s.length,r.indexHint),1)}else this.clear();else c(n,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function l(e,t){let n=e;for(P.clear();n;){if(!0===n.leaf)for(const e of n.children)t((0,r.zI)(e));else P.pushArray(n.children);n=P.pop()??null}}function c(e,t){u(e,0,e.children.length,t,e)}function u(e,t,n,i,r){r||(r=new C([])),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let s,o=t;o<n;o++)s=e.children[o],h(r,e.leaf?i(s):s);return r}function h(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function d(e,t){return e.minX-t.minX}function p(e,t){return e.minY-t.minY}function m(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function f(e){return e.maxX-e.minX+(e.maxY-e.minY)}function g(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function y(e,t){const n=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),s=Math.min(e.maxY,t.maxY);return Math.max(0,r-n)*Math.max(0,s-i)}function x(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function _(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function v(e,t,n,i,r){const s=[t,n];for(;s.length;){const t=s.pop(),n=s.pop();if(t-n<=i)continue;const a=n+Math.ceil((t-n)/i/2)*i;(0,o.q)(e,a,n,t,r),s.push(n,a,a,t)}}const w=new s.A,P=new s.A,M=new s.A,I=new s.A({deallocator:void 0});class b{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class A extends b{constructor(){super(...arguments),this.height=1,this.indexHint=new i.vW}}class C extends A{constructor(e){super(),this.children=e,this.leaf=!0}}class R extends A{constructor(e){super(),this.children=e,this.leaf=!1}}},80754:(e,t,n)=>{n.d(t,{j7:()=>o,kS:()=>l,kd:()=>a,r8:()=>c});var i=n(82799),r=n(16930),s=n(65864);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:r.A.WebMercator}),minus180Line:new i.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:r.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.A({paths:[[[180,-180],[180,180]]],spatialReference:r.A.WGS84}),minus180Line:new i.A({paths:[[[-180,-180],[-180,180]]],spatialReference:r.A.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const n=c(e);for(const e of n)for(const n of e)n[0]+=t;return e}function c(e){return(0,s.Bi)(e)?e.rings:e.paths}},85648:(e,t,n)=>{n.d(t,{n:()=>r});var i=n(84952);function r(e){return s[function(e){return"json"===e.type?"application/json":"blob"===e.type?e.blob.type:function(e){const t=(0,i.Zo)(e);return l[t]||o}(e.url)}(e)]||a}const s={},o="text/plain",a=s[o],l={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const e in l)s[l[e]]=e},89056:(e,t,n)=>{n.d(t,{b3:()=>h,jZ:()=>u});var i=n(12195),r=n(19419),s=n(6606),o=n(95108),a=n(65864),l=n(80754),c=n(21325);function u(e){return d(e,!0)}function h(e){return d(e,!1)}function d(e,t){if(null==e)return null;const n=e.spatialReference,r=(0,c.Vp)(n),o=(0,i.W)(e)?e.toJSON():e;if(!r)return o;const u=(0,c.K8)(n)?102100:4326,h=l.j7[u].maxX,d=l.j7[u].minX;if((0,a.fT)(o))return m(o,h,d);if((0,a.U9)(o))return o.points=o.points.map(e=>m(e,h,d)),o;if((0,a.ZC)(o))return p(o,r);if((0,a.Bi)(o)||(0,a.Rg)(o)){const e=(0,s.Rg)(v,o),n={xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3]},i=(0,l.kd)(n.xmin,d)*(2*h),r=0===i?o:(0,l.kS)(o,i);return n.xmin+=i,n.xmax+=i,n.xmax>h?x(r,h,t):n.xmin<d?x(r,d,t):r}return o}function p(e,t){if(!t)return e;const n=function(e,t){const n=[],{ymin:i,ymax:r,xmin:s,xmax:o}=e,a=e.xmax-e.xmin,[l,c]=t.valid,{x:u,frameId:h}=f(e.xmin,t),{x:d,frameId:p}=f(e.xmax,t),m=u===d&&a>0;if(a>2*c){const e={xmin:s<o?u:d,ymin:i,xmax:c,ymax:r},t={xmin:l,ymin:i,xmax:s<o?d:u,ymax:r},a={xmin:0,ymin:i,xmax:c,ymax:r},m={xmin:l,ymin:i,xmax:0,ymax:r},f=[],y=[];g(e,a)&&f.push(h),g(e,m)&&y.push(h),g(t,a)&&f.push(p),g(t,m)&&y.push(p);for(let e=h+1;e<p;e++)f.push(e),y.push(e);n.push(new _(e,[h]),new _(t,[p]),new _(a,f),new _(m,y))}else u>d||m?n.push(new _({xmin:u,ymin:i,xmax:c,ymax:r},[h]),new _({xmin:l,ymin:i,xmax:d,ymax:r},[p])):n.push(new _({xmin:u,ymin:i,xmax:d,ymax:r},[h]));return n}(e,t).map(e=>e.extent);return n.length<2?n[0]||e:n.length>2?(e.xmin=t.valid[0],e.xmax=t.valid[1],e):{rings:n.map(e=>[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]])}}function m(e,t,n){if(Array.isArray(e)){const i=e[0];if(i>t){const n=(0,l.kd)(i,t);e[0]=i+n*(-2*t)}else if(i<n){const t=(0,l.kd)(i,n);e[0]=i+t*(-2*n)}}else{const i=e.x;if(i>t){const n=(0,l.kd)(i,t);e.x+=n*(-2*t)}else if(i<n){const t=(0,l.kd)(i,n);e.x+=t*(-2*n)}}return e}function f(e,t){const[n,i]=t.valid,r=2*i;let s,o=0;return e>i?(s=Math.ceil(Math.abs(e-i)/r),e-=s*r,o=s):e<n&&(s=Math.ceil(Math.abs(e-n)/r),e+=s*r,o=-s),{x:e,frameId:o}}function g(e,t){const{xmin:n,ymin:i,xmax:r,ymax:s}=t;return y(e,n,i)&&y(e,n,s)&&y(e,r,s)&&y(e,r,i)}function y(e,t,n){return t>=e.xmin&&t<=e.xmax&&n>=e.ymin&&n<=e.ymax}function x(e,t,n=!0){const i=!(0,a.Rg)(e);if(i&&(0,o.m3)(e),n)return(new w).cut(e,t);const r=i?e.rings:e.paths,s=i?4:2,l=r.length,c=-2*t;for(let e=0;e<l;e++){const t=r[e];if(t&&t.length>=s){const e=[];for(const[n,...i]of t)e.push([n+c,...i]);r.push(e)}}return i?e.rings=r:e.paths=r,e}class _{constructor(e,t){this.extent=e,this.frameIds=t}}const v=(0,r.vt)();class w{constructor(){this._linesIn=[],this._linesOut=[]}cut(e,t){let n;if(this._xCut=t,e.rings)this._closed=!0,n=e.rings,this._minPts=4;else{if(!e.paths)return null;this._closed=!1,n=e.paths,this._minPts=2}for(const e of n){if(!e||e.length<this._minPts)continue;let t=!0;for(const n of e)t?(this.moveTo(n),t=!1):this.lineTo(n);this._closed&&this.close()}this._pushLineIn(),this._pushLineOut(),n=[];for(const e of this._linesIn)e&&e.length>=this._minPts&&n.push(e);const i=-2*this._xCut;for(const e of this._linesOut)if(e&&e.length>=this._minPts){for(const t of e)t[0]+=i;n.push(e)}return this._closed?e.rings=n:e.paths=n,e}moveTo(e){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(e[0]),this._moveTo(e[0],e[1],this._prevSide),this._prevPt=e,this._firstPt=e}lineTo(e){const t=this._side(e[0]);if(t*this._prevSide===-1){const n=this._intersect(this._prevPt,e);this._lineTo(this._xCut,n,0),this._prevSide=0,this._lineTo(e[0],e[1],t)}else this._lineTo(e[0],e[1],t);this._prevSide=t,this._prevPt=e}close(){const e=this._firstPt,t=this._prevPt;e[0]===t[0]&&e[1]===t[1]||this.lineTo(e),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(e,t,n){this._closed?(this._lineIn.push([n<=0?e:this._xCut,t]),this._lineOut.push([n>=0?e:this._xCut,t])):(n<=0&&this._lineIn.push([e,t]),n>=0&&this._lineOut.push([e,t]))}_lineTo(e,t,n){this._closed?(P(this._lineIn,n<=0?e:this._xCut,t),P(this._lineOut,n>=0?e:this._xCut,t)):n<0?(0===this._prevSide&&this._pushLineOut(),this._lineIn.push([e,t])):n>0?(0===this._prevSide&&this._pushLineIn(),this._lineOut.push([e,t])):this._prevSide<0?(this._lineIn.push([e,t]),this._lineOut.push([e,t])):this._prevSide>0&&(this._lineOut.push([e,t]),this._lineIn.push([e,t]))}_checkClosingPt(e){const t=e.length;t>3&&e[0][0]===this._xCut&&e[t-2][0]===this._xCut&&e[1][0]===this._xCut&&(e[0][1]=e[t-2][1],e.pop())}_side(e){return e<this._xCut?-1:e>this._xCut?1:0}_intersect(e,t){const n=(this._xCut-e[0])/(t[0]-e[0]);return e[1]+n*(t[1]-e[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}function P(e,t,n){const i=e.length;i>1&&e[i-1][0]===t&&e[i-2][0]===t?e[i-1][1]=n:e.push([t,n])}}}]);