@arcgis/core 6.0.0-next.41 → 6.0.0-next.42

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 (203) hide show
  1. package/Camera.js +1 -1
  2. package/arcgisGlobal.d.ts +0 -2
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/075fe33152fd79fe6d72.js +1 -0
  5. package/assets/esri/core/workers/chunks/0d87cb6417672de95d53.js +1 -0
  6. package/assets/esri/core/workers/chunks/11877d4dc97f756e4711.js +1 -0
  7. package/assets/esri/core/workers/chunks/1860104c2b33f68785dd.js +1 -0
  8. package/assets/esri/core/workers/chunks/1980fd7ae1617ef4d19d.js +1 -0
  9. package/assets/esri/core/workers/chunks/{14d81280807a3d3c1b7e.js → 244ffdb91237d1cbade3.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{059cda6f11a91dbc9e28.js → 2690d5fcd9d5ca92ebf6.js} +1 -1
  11. package/assets/esri/core/workers/chunks/348f28d7ab46df878c6f.js +1 -0
  12. package/assets/esri/core/workers/chunks/{8b0efcc30184593a0812.js → 36bafcc29ac133a05558.js} +24 -24
  13. package/assets/esri/core/workers/chunks/36e5f070009b29b7ac3d.js +1 -0
  14. package/assets/esri/core/workers/chunks/39c23a52d7c3e1ee121c.js +1 -0
  15. package/assets/esri/core/workers/chunks/{5504ec9bd9ee4d10af07.js → 3f74c61359b4bd6dcf00.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{6738b3d6bce34a1e8be2.js → 446d172834f8675f1202.js} +1 -1
  17. package/assets/esri/core/workers/chunks/48c6230b8a6d3a8a7906.js +1 -0
  18. package/assets/esri/core/workers/chunks/4c73c493dabe949c2512.js +1 -0
  19. package/assets/esri/core/workers/chunks/{46504fc81f357bc7465a.js → 4d62877f521cc9663535.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{54de7dc0597fc80d7a52.js → 5dea74fe52583e77f3ce.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{1ec772eaa63eb6937231.js → 8140ed6e44c3d8536d3e.js} +1 -1
  22. package/assets/esri/core/workers/chunks/867502158997cb2d6406.js +1 -0
  23. package/assets/esri/core/workers/chunks/8ceb6697e8adbeffe019.js +1 -0
  24. package/assets/esri/core/workers/chunks/8fe22c2370219f25c15b.js +1 -0
  25. package/assets/esri/core/workers/chunks/91586bf29492735e692d.js +1 -0
  26. package/assets/esri/core/workers/chunks/{123541f79be7adff0818.js → a422a801e55fa125546e.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{fd967a9f3cf0e2890dbb.js → a91dc05a6a609d04ed04.js} +1 -1
  28. package/assets/esri/core/workers/chunks/a99c50b4e1c7568210e1.js +1 -0
  29. package/assets/esri/core/workers/chunks/ab48faea5432e2dbd45c.js +1 -0
  30. package/assets/esri/core/workers/chunks/bbddeb1c893ff8bbae5d.js +1 -0
  31. package/assets/esri/core/workers/chunks/bc2e2bdf1194e6e9eb5e.js +1 -0
  32. package/assets/esri/core/workers/chunks/c3ba1a3247e14f6b7b3a.js +1 -0
  33. package/assets/esri/core/workers/chunks/c5d0a034ff31d5954571.js +1 -0
  34. package/assets/esri/core/workers/chunks/{efc1a90742813b55602e.js → c8057b47c7c6c02a0bda.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{b386e921c273de3ac7a5.js → d4c8673ca65df874a7ce.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{947f3a1cad976bba9738.js → d5e251cddd41d643510c.js} +1 -1
  37. package/assets/esri/core/workers/chunks/fbe3a3b9d6c8c0b52f65.js +1 -0
  38. package/assets/esri/core/workers/chunks/fe7184993ef5713d13fb.js +1 -0
  39. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  40. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  41. package/assets/esri/themes/base/_core.scss +0 -2
  42. package/assets/esri/themes/dark/main.css +1 -1
  43. package/assets/esri/themes/light/main.css +1 -1
  44. package/assets/esri/themes/light/view.css +1 -1
  45. package/chunks/lyr3DMain.js +1 -1
  46. package/chunks/lyr3DWorker.js +1 -1
  47. package/config.js +1 -1
  48. package/core/Logger.js +1 -1
  49. package/core/deprecate.js +1 -1
  50. package/core/types.d.ts +0 -5
  51. package/interfaces.d.ts +0 -17
  52. package/kernel.js +1 -1
  53. package/layers/BuildingSceneLayer.js +1 -1
  54. package/layers/ElevationLayer.d.ts +1 -1
  55. package/layers/ElevationLayer.js +1 -1
  56. package/layers/FeatureLayer.js +1 -1
  57. package/layers/GeoRSSLayer.js +1 -1
  58. package/layers/ImageryLayer.js +1 -1
  59. package/layers/ImageryTileLayer.js +1 -1
  60. package/layers/IntegratedMesh3DTilesLayer.d.ts +4 -3
  61. package/layers/IntegratedMeshLayer.d.ts +4 -3
  62. package/layers/IntegratedMeshLayer.js +1 -1
  63. package/layers/KMLLayer.js +1 -1
  64. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  65. package/layers/MapImageLayer.js +1 -1
  66. package/layers/PointCloudLayer.js +1 -1
  67. package/layers/SceneLayer.js +1 -1
  68. package/layers/StreamLayer.js +1 -1
  69. package/layers/SubtypeGroupLayer.js +1 -1
  70. package/layers/TileLayer.js +1 -1
  71. package/layers/VectorTileLayer.js +1 -1
  72. package/layers/WCSLayer.js +1 -1
  73. package/layers/WMSLayer.js +1 -1
  74. package/layers/WMTSLayer.js +1 -1
  75. package/layers/WebTileLayer.js +1 -1
  76. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  77. package/layers/raster/datasets/ImageServerRaster.js +1 -1
  78. package/layers/raster/datasets/RasterFactory.js +1 -1
  79. package/layers/raster/datasets/ZarrRaster.js +2 -0
  80. package/layers/raster/datasets/datasetUtils.js +1 -1
  81. package/layers/raster/datasets/zarrParser.js +2 -0
  82. package/layers/raster/datasets/zarrUtils.js +2 -0
  83. package/layers/raster/formats/pixelRangeUtils.js +1 -1
  84. package/layers/support/SceneModifications.d.ts +1 -3
  85. package/layers/support/SceneModifications.js +1 -1
  86. package/legend/ActiveLayerInfo.js +1 -1
  87. package/package.json +3 -3
  88. package/portal/Portal.js +1 -1
  89. package/support/LayersMixin.d.ts +2 -2
  90. package/symbols/PictureFillSymbol.js +1 -1
  91. package/symbols/PictureMarkerSymbol.js +1 -1
  92. package/symbols/SimpleFillSymbol.js +1 -1
  93. package/symbols/SimpleLineSymbol.js +1 -1
  94. package/symbols/SimpleMarkerSymbol.js +1 -1
  95. package/symbols/Symbol3D.js +1 -1
  96. package/symbols/TextSymbol.js +1 -1
  97. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  98. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  99. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  100. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  101. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  102. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  103. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  104. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  105. package/views/3d/layers/support/Tiles3DLayerViewRegistration.js +2 -0
  106. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  107. package/views/3d/layers/support/createTileBVHForLayer.js +2 -0
  108. package/views/3d/layers/support/tileBoundingVolumeUtils.js +2 -0
  109. package/views/3d/support/GaussianSplatSortWorker.js +1 -1
  110. package/views/3d/support/engineContent/line.js +1 -1
  111. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  112. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  113. package/views/3d/support/gaussianSplatting/GaussianSplatSortCoordinator.js +2 -0
  114. package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
  115. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  116. package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
  117. package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
  118. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  119. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  120. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  121. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  122. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  123. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  124. package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
  125. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  126. package/views/3d/webgl-engine/shaders/ShadedMaterialConfiguration.js +2 -0
  127. package/views/SceneView.d.ts +2 -4
  128. package/views/View.d.ts +1 -3
  129. package/views/View2D.d.ts +2 -2
  130. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  131. package/views/interactive/options/ViewOptions.d.ts +0 -2
  132. package/widgets/Editor/EditorViewModel.d.ts +0 -1
  133. package/widgets/Editor.d.ts +0 -1
  134. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  135. package/widgets/Sketch/SketchViewModel.d.ts +0 -1
  136. package/widgets/Sketch.d.ts +0 -1
  137. package/assets/esri/core/workers/chunks/073f0232135f71b6c7a5.js +0 -1
  138. package/assets/esri/core/workers/chunks/0bf43d80cb40c2b43333.js +0 -1
  139. package/assets/esri/core/workers/chunks/1866f832e5f52958bc97.js +0 -1
  140. package/assets/esri/core/workers/chunks/19e51cbb354954ddafbd.js +0 -1
  141. package/assets/esri/core/workers/chunks/1deca3de77b1a9a07da4.js +0 -1
  142. package/assets/esri/core/workers/chunks/1fd82fcba2758741996a.js +0 -1
  143. package/assets/esri/core/workers/chunks/23f3692c7426173e8352.js +0 -1
  144. package/assets/esri/core/workers/chunks/2dfe6af28cd1b29d5ebc.js +0 -1
  145. package/assets/esri/core/workers/chunks/305eeaac0b4d5b79ebde.js +0 -1
  146. package/assets/esri/core/workers/chunks/353976c812ebf0c98549.js +0 -1
  147. package/assets/esri/core/workers/chunks/4caebb64a365da18453f.js +0 -1
  148. package/assets/esri/core/workers/chunks/4d8833f48348cbbcc947.js +0 -1
  149. package/assets/esri/core/workers/chunks/598ba405e93ebccf7b2d.js +0 -1
  150. package/assets/esri/core/workers/chunks/8b0be232723424dda320.js +0 -1
  151. package/assets/esri/core/workers/chunks/8b38fad017c4c0d9e1ec.js +0 -1
  152. package/assets/esri/core/workers/chunks/8c3779de09291170497f.js +0 -1
  153. package/assets/esri/core/workers/chunks/98958203a5ca45b24d72.js +0 -1
  154. package/assets/esri/core/workers/chunks/af2087b75225d7d7dbd8.js +0 -1
  155. package/assets/esri/core/workers/chunks/b3aa29589dcfb5b93106.js +0 -1
  156. package/assets/esri/core/workers/chunks/c5364ff8dd1358af3603.js +0 -1
  157. package/assets/esri/core/workers/chunks/f6f5937a1308f28bb959.js +0 -1
  158. package/assets/esri/core/workers/chunks/fe24e039385473bf77f9.js +0 -1
  159. package/assets/esri/themes/base/widgets/_UtilityNetworkValidateTopology.scss +0 -46
  160. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ar.json +0 -1
  161. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.bg.json +0 -1
  162. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.bs.json +0 -1
  163. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ca.json +0 -1
  164. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.cs.json +0 -1
  165. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.da.json +0 -1
  166. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.de.json +0 -1
  167. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.el.json +0 -1
  168. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.en.json +0 -1
  169. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.es.json +0 -1
  170. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.et.json +0 -1
  171. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.fi.json +0 -1
  172. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.fr.json +0 -1
  173. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.he.json +0 -1
  174. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.hr.json +0 -1
  175. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.hu.json +0 -1
  176. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.id.json +0 -1
  177. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.it.json +0 -1
  178. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ja.json +0 -1
  179. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ko.json +0 -1
  180. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.lt.json +0 -1
  181. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.lv.json +0 -1
  182. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.nl.json +0 -1
  183. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.no.json +0 -1
  184. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.pl.json +0 -1
  185. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.pt-BR.json +0 -1
  186. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.pt-PT.json +0 -1
  187. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ro.json +0 -1
  188. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ru.json +0 -1
  189. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sk.json +0 -1
  190. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sl.json +0 -1
  191. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sr.json +0 -1
  192. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sv.json +0 -1
  193. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.th.json +0 -1
  194. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.tr.json +0 -1
  195. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.uk.json +0 -1
  196. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.vi.json +0 -1
  197. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.zh-CN.json +0 -1
  198. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.zh-HK.json +0 -1
  199. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.zh-TW.json +0 -1
  200. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.d.ts +0 -72
  201. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +0 -2
  202. package/widgets/UtilityNetworkValidateTopology.d.ts +0 -130
  203. package/widgets/UtilityNetworkValidateTopology.js +0 -2
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2223],{52106(e,t,i){i.d(t,{A:()=>C});var r,l,s=i(32198),n=i(40124),o=i(69540),a=i(51447),h=i(25482),u=i(53966),p=i(36708),c=i(24326),f=i(91429),g=i(12195),d=i(65864),y=i(50498),m=i(55156),v=i(60950),w=i(54339),b=i(94128),M=i(33910);const _=Symbol("meshGeometryHandles");function A(e){if(null==e)return null;let t={};for(let i in e){let r=e[i];r&&(t[i]=r.toJSON())}return 0===Object.keys(t).length?null:t}let C=class extends((0,o.OU)(h.o)){static{r=b.Z}static{l=this}constructor(e){super(e),this[r]=!0,this.distance=null,this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this.statisticsAggregatedIds=void 0,this._version=0,Object.defineProperty(this,"uid",{value:(0,c.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,a.eF)(u.A.getLogger(this),"Graphic",{version:"4.30"})}set aggregateGeometries(e){let t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){let t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){let t=this._get("geometry");t!==e&&(this._set("geometry",e),this._watchMeshGeometryChanges(),this._notifyLayer("geometry",t,e))}set popupTemplate(e){let t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){let t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){let t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new l({aggregateGeometries:this.aggregateGeometries,statisticsAggregatedIds:this.statisticsAggregatedIds,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;let t=(0,v.E_)(this.origin);if(t)return t.popupTemplate??(e?t.defaultPopupTemplate:null)??null;let i=this.origin&&"layer"in this.origin?this.origin.layer:null;for(let t of[i,this.sourceLayer,this.layer])if(t&&"object"==typeof t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(e&&"defaultPopupTemplate"in t&&null!=t.defaultPopupTemplate)return t.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){let i=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",i,t,e)}else this.attributes={[e]:t}}getObjectId(){let e=(0,m.I)(this.origin);if(e)return(0,w.r)(this,e);let t=this.sourceLayer??this.layer;return t?(0,w.r)(this,t):null}getGlobalId(){let e=(0,m.I)(this.origin);if(e?.globalIdField)return this.getAttribute(e.globalIdField);let t=this.sourceLayer??this.layer;return t&&"globalIdField"in t&&t.globalIdField?this.getAttribute(t.globalIdField):null}toJSON(){let e={aggregateGeometries:A(this.aggregateGeometries),geometry:this.geometry?.toJSON()??null,symbol:this.symbol?.toJSON()??null,attributes:(0,g.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null};return this.statisticsAggregatedIds?.length&&(e.aggregateIds=[...this.statisticsAggregatedIds]),null!=this.distance&&(e.distance=this.distance),e}notifyMeshTransformChanged(e={}){let{geometry:t}=this;if("mesh"===t?.type){let i={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",i,i,e.action)}}_notifyLayer(e,t,i,r){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;let l={graphic:this,property:e,oldValue:t,newValue:i};"origin-transform"===e&&(l.action=r),"attributes"===e&&(l.attributeName=r),this.layer.graphicChanged(l)}_watchMeshGeometryChanges(){this.removeHandles(_);let e=this.geometry;"mesh"===e?.type&&this.addHandles([(0,p.z7)(()=>e.vertexSpace.origin?{localMatrix:e.transform?.localMatrix,origin:e.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{(this._lastMeshTransform.localMatrix!==e||this._lastMeshTransform.origin!==t)&&(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,p.z7)(()=>({vertexAttributes:e.vertexAttributes}),()=>{e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",e,e)},{equals:(e,t)=>e===t,sync:!0})],_)}};(0,s.Cg)([(0,f.MZ)({value:null,json:{read:function(e){if(!e)return null;let t={};for(let i in e){let r=(0,d.rS)(e[i]);r&&(t[i]=r)}return 0===Object.keys(t).length?null:t}}})],C.prototype,"aggregateGeometries",null),(0,s.Cg)([(0,f.MZ)({value:null})],C.prototype,"attributes",null),(0,s.Cg)([(0,f.MZ)({value:null,types:y.yR,json:{read:d.rS}})],C.prototype,"geometry",null),(0,s.Cg)([(0,f.MZ)()],C.prototype,"distance",void 0),(0,s.Cg)([(0,f.MZ)({type:Boolean})],C.prototype,"isAggregate",void 0),(0,s.Cg)([(0,f.MZ)({clonable:!1})],C.prototype,"layer",void 0),(0,s.Cg)([(0,f.MZ)({clonable:"reference"})],C.prototype,"origin",void 0),(0,s.Cg)([(0,f.MZ)({type:n.A,value:null})],C.prototype,"popupTemplate",null),(0,s.Cg)([(0,f.MZ)({clonable:"reference"})],C.prototype,"sourceLayer",void 0),(0,s.Cg)([(0,f.MZ)({json:{name:"aggregateIds",read:e=>e?.map(e=>Array.isArray(e)?JSON.stringify(e):e)}})],C.prototype,"statisticsAggregatedIds",void 0),(0,s.Cg)([(0,f.MZ)({value:null,types:M.Es})],C.prototype,"symbol",null),(0,s.Cg)([(0,f.MZ)({clonable:!1,json:{read:!1,write:!1}})],C.prototype,"_version",void 0),(0,s.Cg)([(0,f.MZ)({type:Boolean,value:!0})],C.prototype,"visible",null),C=l=(0,s.Cg)([(0,f.$K)("esri.Graphic")],C)},69052(e,t,i){i.d(t,{hr:()=>l});var r=i(34727);class l{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,i=!1){return s(this.range,this.min,this.max,e,t,i)}clamp(e,t=0){return(0,r.qE)(e-t,this.min,this.max)+t}monotonic(e,t,i){return e<t?t:t+n(this.range,e-t,i)}minimalMonotonic(e,t,i){return s(this.range,e,e+this.range,t,i)}center(e,t,i){return t=this.monotonic(e,t,i),this.normalize((e+t)/2,i)}diff(e,t,i){return this.monotonic(e,t,i)-e}shortestSignedDiff(e,t){e=this.normalize(e);let i=(t=this.normalize(t))-e,r=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(i)<Math.abs(r)?i:r}contains(e,t,i){return t=this.minimalMonotonic(e,t),(i=this.minimalMonotonic(e,i))>e&&i<t}}function s(e,t,i,r,l=0,s=!1){return(r-=l)<t?r+=n(e,t-r):r>i&&(r-=n(e,r-i)),s&&r===i&&(r=t),r+l}function n(e,t,i=0){return Math.ceil((t-i)/e)*e+i}const o=new l(0,2*Math.PI),a=(new l(-Math.PI,Math.PI),new l(0,360));i.d(t,["ie",0,a,"uC",0,o])},18370(e,t,i){i.d(t,{z:()=>l});class r{constructor(e){this._import=e,this.module=null,this._promise=null}getImportPromise(){return this._promise??=this._import().then(async e=>(this.module=e,e)),this._promise}}function l(e){return new r(e)}},52039(e,t,i){i.d(t,{O7:()=>c,el:()=>h});var r=i(69052),l=(i(49186),i(18370)),s=i(17676),n=(i(5443),i(39829)),o=(i(82799),i(16930)),a=(i(80754),i(21325));async function h(e,t,i){Array.isArray(e)||(e=[e]),"object"==typeof t&&t&&"authMode"in t&&(i=t);let r=null;for(let t of e)r??=t?.spatialReference;if(!r)return e;let l=(0,a.Vp)(r);if(!l)return e;if(1===e.length&&"extent"===e[0]?.type){let t=e[0].clone().normalizeAsSingleGeometry(l);return["xmin"in t?t:new n.A(t)]}let[o,h]=l.valid,c=!1;for(let t of e){if(!t)continue;if("point"===t.type){c||=t.x>=h,c||=t.x<=o;continue}let{extent:e}=t;if(null==e){c=!0;break}c||=e.xmin>=h,c||=e.xmin<=o,c||=e.xmax>=h,c||=e.xmax<=o}if(!c)return e;let[{foldInto360Range:f},g]=await(0,s.qr)(Promise.all([u.getImportPromise(),p.getImportPromise()]),i),d=g.fromSpatialReference(r);return e.map(e=>{if(null==e||"mesh"===e.type)return e;let t=g.fromGeometry(e),i=g.toGeometry(f(t,d),r);return"extent"===e.type&&1===i?.rings.length?i.extent:i})}const u=(0,l.z)(()=>i.e(4144).then(()=>i(4144)).then(e=>e.load().then(()=>e))),p=(0,l.z)(()=>Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(3299),i.e(1550)]).then(()=>i(78125)));function c(e,t,i){let r=(0,a.Vp)(i);if(null==r)return e;let[l,s]=r.valid,n=2*s,o=0,h=0;t>s?o=Math.ceil(Math.abs(t-s)/n):t<l&&(o=-Math.ceil(Math.abs(t-l)/n)),e>s?h=Math.ceil(Math.abs(e-s)/n):e<l&&(h=-Math.ceil(Math.abs(e-l)/n));let u=e+(o-h)*n,p=u-t;return p>s?u-=n:p<l&&(u+=n),u}function f(e){let t=(0,a.Vp)(e);if(null==t)return null;let[i,l]=t.valid;return new r.hr(i,l)}const g=f(o.A.WGS84);f(o.A.WebMercator),i.d(t,["Y_",0,g])},80754(e,t,i){i.d(t,{kS:()=>h,kd:()=>a});var r=i(82799),l=i(16930),s=i(60408),n=i(52006);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new r.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:l.A.WebMercator}),minus180Line:new r.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:l.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new r.A({paths:[[[180,-180],[180,180]]],spatialReference:l.A.WGS84}),minus180Line:new r.A({paths:[[[-180,-180],[-180,180]]],spatialReference:l.A.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function h(e,t){if((0,n.Ed)(e))for(let i of function(e){return(0,s.Bi)(e)?e.curveRings:e.curvePaths}(e))for(let e of i)if((0,n.aO)(e)){let[i,r]=e.c;i[0]+=t,r[0]+=t}else if((0,n.FG)(e)){let[i,r]=e.a;i[0]+=t,r[0]+=t}else if((0,n.n1)(e)){let[i,r,l]=e.b;i[0]+=t,r[0]+=t,l[0]+=t}else e[0]+=t;for(let i of function(e){return(0,s.Bi)(e)?e.rings:e.paths}(e))for(let e of i)e[0]+=t;return e}i.d(t,["j7",0,o])},55156(e,t,i){i.d(t,{I:()=>l});const r=Symbol("idFieldsProviderSymbol");function l(e){return(t=e)&&r in t?e[r]:void 0;var t}i.d(t,["e",0,r])},71756(e,t,i){i.r(t);var r,l=i(32198),s=i(56507),n=i(49186),o=i(81583),a=i(25728),h=i(17676),u=i(84952),p=i(91429),c=i(16930),f=i(4146),g=i(52136),d=i(89186),y=i(98534),m=i(18768),v=i(63074),w=i(69208),b=i(34287),M=i(8303),_=i(54310),A=i(25036),C=i(91921),S=i(60694),x=i(10873),T=i(33446),O=i(15775),L=i(88625),I=i(36005),Z=i(43937);const z=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let R=r=class extends((0,v.dM)((0,A.j)((0,C.I)((0,d.f)((0,y.V)((0,b.q)((0,M.A)((0,m.b)((0,a.M)((0,_.J)((0,g.p)((0,w.d)(f.A))))))))))))){constructor(e){super(e),this.listMode="show",this.elevationInfo=new L.A({mode:"on-the-ground"}),this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}load(e){let t=null==e?null:e.signal;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(h.QP).then(()=>this._fetchService(t))),Promise.resolve(this)}get attributionDataUrl(){let e=this.parsedUrl?.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}get hasAttributionData(){return super.hasAttributionData}readSpatialReference(e,t){return e||=t.tileInfo?.spatialReference,e&&c.A.fromJSON(e)}writeSublayers(e,t,i,r){if(!this.loaded||!e)return;let l=e.slice().reverse().flatten(({sublayers:e})=>e&&e.toArray().reverse()).toArray(),s=[],n={writeSublayerStructure:!1,...r};l.forEach(e=>{let t=e.write({},n);s.push(t)}),s.some(e=>Object.keys(e).length>1)&&(t.layers=s)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl?.path)}castTileServers(e){return Array.isArray(e)?e.map(e=>(0,u.An)(e).path):null}fetchTile(e,t,i,r={}){let{signal:l}=r,n=this.getTileUrl(e,t,i),o={responseType:"image",signal:l,query:{...this.refreshParameters}};return(0,s.A)(n,o).then(e=>e.data)}async fetchImageBitmapTile(e,t,i,l={}){let{signal:n}=l;if(this.fetchTile!==r.prototype.fetchTile){let r=await this.fetchTile(e,t,i,l);return(0,T.Cp)(r,e,t,i,l)}let o=this.getTileUrl(e,t,i),a={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:h}=await(0,s.A)(o,a);return(0,T.Cp)(h,e,t,i,l)}getTileUrl(e,t,i){let r=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,l=(0,u.x0)({...this.parsedUrl?.query,blankTile:!r&&null,...this.customParameters,token:this.apiKey}),s=this.tileServers;return`${s&&s.length?s[t%s.length]:this.parsedUrl?.path}/tile/${e}/${t}/${i}${l?"?"+l:""}`}loadAll(){return(0,o.g)(this,e=>{e(this.allSublayers)})}_fetchService(e){return new Promise((t,i)=>{if(this.sourceJSON){if(null!=this.sourceJSON.bandCount&&null!=this.sourceJSON.pixelSizeX)throw new n.A("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void t({data:this.sourceJSON})}if(!this.parsedUrl)throw new n.A("tile-layer:undefined-url","layer's url is not defined");let r=(0,S.qg)(this.parsedUrl.path);if(null!=r&&"ImageServer"===r.serverType)throw new n.A("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");(0,s.A)(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t,i)}).then(t=>{let i=this.url;if(t.ssl&&(i=this.url=i.replace(/^http:/i,"https:")),this.sourceJSON=t.data,this.read(t.data,{origin:"service",url:this.parsedUrl}),10.1===this.version&&!(0,S.Wo)(i))return this._fetchServerVersion(i,e).then(e=>{this.read({currentVersion:e})}).catch(()=>{})})}_fetchServerVersion(e,t){if(!(0,S.Fi)(e))return Promise.reject();let i=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return(0,s.A)(i,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t}).then(e=>{if(e.data?.currentVersion)return e.data.currentVersion;throw new n.A("tile-layer:version-not-available","Server did not provide a version")})}_getMapName(e){let t=e.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^/]+(\/[^/]+)*)\/mapserver/i);return t?t[2]:void 0}_getDefaultAttribution(e){if(null==e)return null;let t;e=e.toLowerCase();for(let i=0,r=z.length;i<r;i++)if(t=z[i],t.toLowerCase().includes(e))return(0,u.s2)("//static.arcgis.com/attribution/"+t);return null}_getDefaultTileServers(e){if(null==e)return[];let t=-1!==e.search(/^(?:https?:)?\/\/server\.arcgisonline\.com/i),i=-1!==e.search(/^(?:https?:)?\/\/services\.arcgisonline\.com/i);return t||i?[e,e.replace(t?/server\.arcgisonline/i:/services\.arcgisonline/i,t?"services.arcgisonline":"server.arcgisonline")]:[]}get hasOverriddenFetchTile(){return!this.fetchTile[j]}};(0,l.Cg)([(0,p.MZ)({readOnly:!0})],R.prototype,"attributionDataUrl",null),(0,l.Cg)([(0,p.MZ)({type:["show","hide","hide-children"]})],R.prototype,"listMode",void 0),(0,l.Cg)([(0,p.MZ)({json:{read:!0,write:!0}})],R.prototype,"blendMode",void 0),(0,l.Cg)([(0,p.MZ)()],R.prototype,"elevationInfo",void 0),(0,l.Cg)([(0,p.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],R.prototype,"isReference",void 0),(0,l.Cg)([(0,p.MZ)({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],R.prototype,"operationalLayerType",void 0),(0,l.Cg)([(0,p.MZ)({type:Boolean})],R.prototype,"resampling",void 0),(0,l.Cg)([(0,p.MZ)()],R.prototype,"sourceJSON",void 0),(0,l.Cg)([(0,p.MZ)({type:c.A})],R.prototype,"spatialReference",void 0),(0,l.Cg)([(0,I.w)("spatialReference",["spatialReference","tileInfo"])],R.prototype,"readSpatialReference",null),(0,l.Cg)([(0,p.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],R.prototype,"path",void 0),(0,l.Cg)([(0,p.MZ)({readOnly:!0})],R.prototype,"sublayers",void 0),(0,l.Cg)([(0,Z.K)("sublayers",{layers:{type:[O.A]}})],R.prototype,"writeSublayers",null),(0,l.Cg)([(0,p.MZ)({json:{read:!1,write:!1}})],R.prototype,"popupEnabled",void 0),(0,l.Cg)([(0,p.MZ)()],R.prototype,"tileServers",null),(0,l.Cg)([(0,p.wg)("tileServers")],R.prototype,"castTileServers",null),(0,l.Cg)([(0,p.MZ)({readOnly:!0,json:{read:!1}})],R.prototype,"type",void 0),(0,l.Cg)([(0,p.MZ)(x.OZ)],R.prototype,"url",void 0),R=r=(0,l.Cg)([(0,p.$K)("esri.layers.TileLayer")],R);const j=Symbol("default-fetch-tile");R.prototype.fetchTile[j]=!0;const P=R;i.d(t,["default",0,P])},54339(e,t,i){function r(e,t){switch(t.type){case"object-id":case"unique-id-simple":return e.attributes[t.fieldName];case"unique-id-composite":{let i=[];for(let r of t.fieldNames)i.push(e.attributes[r]??null);return JSON.stringify(i)}}}function l(e,t){if("uniqueIdFields"in t&&t.uniqueIdFields?.length){if(1===t.uniqueIdFields.length)return e.attributes?.[t.uniqueIdFields[0]];let i=t.uniqueIdFields.map(t=>e.attributes?.[t]);return JSON.stringify(i)}return"objectIdField"in t&&t.objectIdField?e.attributes?.[t.objectIdField]:null}i.d(t,{W:()=>r,r:()=>l})},89186(e,t,i){var r=i(32198),l=i(91429),s=i(16930),n=i(87045),o=i(65509),a=i(25943),h=i(36005);i.d(t,["f",0,e=>{let t=e,i=class extends t{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}destroy(){this.tilemapCache?.destroy?.()}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(e,t,i){let r=t.capabilities?.toLowerCase().includes("tilemap"),{minLOD:l,maxLOD:s,minScale:h,maxScale:u}=t;if(null==l&&null==s&&(0!==h||0!==u)){let e=e=>Math.round(1e4*e)/1e4;h=e(h||t.tileInfo.lods[0].scale),u=e(u||t.tileInfo.lods[t.tileInfo.lods.length-1].scale);for(let i of t.tileInfo.lods){let t=e(i.scale);l=t>=h?i.level:l,s=t>=u?i.level:s}}if(r)return new a.d({layer:this,minLOD:l,maxLOD:s});if(t.tileInfo){let e=new n.A;return e.read(t.tileInfo,i),new o.A(e,l,s)}return null}};return(0,r.Cg)([(0,l.MZ)({json:{read:{source:"copyrightText"}}})],i.prototype,"copyright",void 0),(0,r.Cg)([(0,l.MZ)()],i.prototype,"minScale",void 0),(0,r.Cg)([(0,h.w)("service","minScale")],i.prototype,"readMinScale",null),(0,r.Cg)([(0,l.MZ)()],i.prototype,"maxScale",void 0),(0,r.Cg)([(0,h.w)("service","maxScale")],i.prototype,"readMaxScale",null),(0,r.Cg)([(0,l.MZ)({type:s.A})],i.prototype,"spatialReference",void 0),(0,r.Cg)([(0,l.MZ)({readOnly:!0})],i.prototype,"supportsBlankTile",null),(0,r.Cg)([(0,l.MZ)({type:n.A})],i.prototype,"tileInfo",void 0),(0,r.Cg)([(0,l.MZ)()],i.prototype,"tilemapCache",void 0),(0,r.Cg)([(0,h.w)("service","tilemapCache",["capabilities","tileInfo"])],i.prototype,"readTilemapCache",null),(0,r.Cg)([(0,l.MZ)()],i.prototype,"version",void 0),i=(0,r.Cg)([(0,l.$K)("esri.layers.mixins.ArcGISCachedService")],i),i}])},91806(e,t,i){i.d(t,{A:()=>a});var r,l=i(32198),s=i(25482),n=i(91429),o=i(78888);let a=class extends s.o{static{r=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new r({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,l.Cg)([(0,n.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],a.prototype,"cols",void 0),(0,l.Cg)([(0,n.MZ)({type:o.jz,json:{write:!0}})],a.prototype,"level",void 0),(0,l.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],a.prototype,"levelValue",void 0),(0,l.Cg)([(0,n.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],a.prototype,"origin",void 0),(0,l.Cg)([(0,n.MZ)({type:Number,json:{write:!0}})],a.prototype,"resolution",void 0),(0,l.Cg)([(0,n.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],a.prototype,"rows",void 0),(0,l.Cg)([(0,n.MZ)({type:Number,json:{write:!0}})],a.prototype,"scale",void 0),a=r=(0,l.Cg)([(0,n.$K)("esri.layers.support.LOD")],a)},87045(e,t,i){i.d(t,{A:()=>w});var r,l=i(32198),s=i(66552),n=i(25482),o=i(86211),a=i(91429),h=i(78888),u=i(86738),p=i(16930),c=i(21325),f=i(28735),g=i(91806),d=i(72802),y=i(36005),m=i(43937);const v=new s.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",JPEGPlus:"jpgplus",pbf:"pbf"});let w=class extends n.o{static{r=this}static create(e={}){let{resolutionFactor:t=1,scales:i,size:l=256,spatialReference:s=p.A.WebMercator,numLODs:n=24}=e;if(!(0,c.fn)(s)){let e=[];if(i)for(let t=0;t<i.length;t++){let r=i[t];e.push(new g.A({level:t,scale:r,resolution:r}))}else{let t=5e-4;for(let i=n-1;i>=0;i--)e.unshift(new g.A({level:i,scale:t,resolution:t})),t*=2}return new r({dpi:96,lods:e,origin:new u.A({x:0,y:0,spatialReference:s}),size:[l,l],spatialReference:s})}let a=(0,c.Vp)(s),h=e.origin?new u.A({x:e.origin.x,y:e.origin.y,spatialReference:s}):a?new u.A({x:a.origin[0],y:a.origin[1],spatialReference:s}):new u.A({x:0,y:0,spatialReference:s}),f=1/(39.37*(0,o.GA)(s)*96),d=[];if(i)for(let e=0;e<i.length;e++){let t=i[e],r=t*f;d.push(new g.A({level:e,scale:t,resolution:r}))}else{let e=(0,c.EA)(s)?512/l*591657527.5917094:256/l*591657527.591555,i=Math.ceil(n/t);d.push(new g.A({level:0,scale:e,resolution:e*f}));for(let r=1;r<i;r++){let i=e/2**t,l=i*f;d.push(new g.A({level:r,scale:i,resolution:l})),e=i}}return new r({dpi:96,lods:d,origin:h,size:[l,l],spatialReference:s})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){let{spatialReference:e,origin:t}=this;if(e&&t){let i=(0,c.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return u.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0,r=[],l=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach(e=>{r.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,l[e.level]=e})),this._set("scales",r),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){let t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];let i=Math.floor(e),r=i+1;return t[i]/(t[i]/t[r])**(e-i)}scaleToZoom(e){let t=this.scales,i=t.length-1,r=0;for(;r<i;r++){let i=t[r],l=t[r+1];if(i<=e)return r;if(l===e)return r+1;if(i>e&&l<e)return r+Math.log(i/e)/Math.log(i/l)}return r}tileAt(e,t,i,r){let l,s,n=this.lodAt(e);if(!n)return null;if("number"==typeof t)l=t,s=i;else if((0,c.aI)(t.spatialReference,this.spatialReference))l=t.x,s=t.y,r=i;else{let e=(0,f.Cv)(t,this.spatialReference);if(null==e)return null;l=e.x,s=e.y,r=i}let o=n.resolution*this.size[0],a=n.resolution*this.size[1];return r??=new d.U(0,0,0),r.level=e,r.row=Math.floor((this.origin.y-s)/a+.001),r.col=Math.floor((l-this.origin.x)/o+.001),this.updateTileInfo(r),r}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let i=this.lodAt(e.level);if(!i&&1===t){let t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return!1;let r=e.level-i.level,l=i.resolution*this.size[0]/2**r,s=i.resolution*this.size[1]/2**r;return e.extent[0]=this.origin.x+e.col*l,e.extent[1]=this.origin.y-(e.row+1)*s,e.extent[2]=e.extent[0]+l,e.extent[3]=e.extent[1]+s,!0}upsampleTile(e){let t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){let i=this.lodAt(t.level);if(null==i)return null;let{resolution:r}=i,l=r*this.size[0],s=r*this.size[1];return e[0]=this.origin.x+t.col*l,e[1]=this.origin.y-(t.row+1)*s,e[2]=e[0]+l,e[3]=e[1]+s,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return r.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;let t=(512===this.size[0]&&256===e?-1:0)+ +!!this.spatialReference.isGeographic;if(this.size[0]===e&&0===t)return this;let i=[],l=this.lods.length-t;for(let e=0;e<l;e++){let r=e+t,{scale:l,resolution:s}=r>=0?this.lods[r]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new g.A({level:e,scale:l,resolution:s}))}return new r({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){let e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){let r=e[i];this._upsampleLevels[r.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/r.resolution:0},t=r}}};(0,l.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],w.prototype,"compressionQuality",void 0),(0,l.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],w.prototype,"dpi",void 0),(0,l.Cg)([(0,a.MZ)({type:String,json:{read:v.read,write:v.write,origins:{"web-scene":{read:!1,write:!1}}}})],w.prototype,"format",void 0),(0,l.Cg)([(0,a.MZ)({readOnly:!0})],w.prototype,"isWrappable",null),(0,l.Cg)([(0,a.MZ)({type:u.A,json:{write:!0}})],w.prototype,"origin",void 0),(0,l.Cg)([(0,y.w)("origin")],w.prototype,"readOrigin",null),(0,l.Cg)([(0,a.MZ)({type:[g.A],value:null,json:{write:!0}})],w.prototype,"lods",null),(0,l.Cg)([(0,a.MZ)({readOnly:!0})],w.prototype,"scales",void 0),(0,l.Cg)([(0,a.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],w.prototype,"size",void 0),(0,l.Cg)([(0,y.w)("size",["rows","cols"])],w.prototype,"readSize",null),(0,l.Cg)([(0,m.K)("size",{cols:{type:h.jz},rows:{type:h.jz}})],w.prototype,"writeSize",null),(0,l.Cg)([(0,a.MZ)({type:p.A,json:{write:!0}})],w.prototype,"spatialReference",void 0),w=r=(0,l.Cg)([(0,a.$K)("esri.layers.support.TileInfo")],w)},65509(e,t,i){i.d(t,{A:()=>s});var r=i(49186),l=i(17676);class s{constructor(e,t=0,i=e.lods[e.lods.length-1].level){this.tileInfo=e,this.minLOD=t,this.maxLOD=i,e.lodAt(t)||(this.minLOD=e.lods[0].level),e.lodAt(i)||(this.maxLOD=e.lods[e.lods.length-1].level)}get effectiveMinLOD(){return this.minLOD??this.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}getAvailability(e,t,i){let r=this.tileInfo?.lodAt(e);return!r||e<this.minLOD||e>this.maxLOD?"unavailable":r.cols&&r.rows?i>=r.cols[0]&&i<=r.cols[1]&&t>=r.rows[0]&&t<=r.rows[1]?"unknown":"unavailable":"unknown"}async fetchAvailability(e,t,i,s){await(0,l.NO)(s);let n=this.getAvailability(e,t,i);if("unavailable"===n)throw new r.A("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i});return n}async fetchAvailabilityUpsample(e,t,i,r,s){await(0,l.NO)(s),r.level=e,r.row=t,r.col=i;let n=this.tileInfo;return n.updateTileInfo(r),this.fetchAvailability(e,t,i,s).catch(e=>{if((0,l.zf)(e))throw e;if(n.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,s);throw e})}}},72802(e,t,i){i.d(t,{U:()=>l});var r=i(19419);class l{constructor(e,t,i,l=(0,r.vt)()){this._level=e,this._row=t,this._col=i,this.extent=l}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(e){this._level=e,this._id=null}get row(){return this._row}set row(e){this._row=e,this._id=null}get col(){return this._col}set col(e){this._col=e,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(e){return new l(e.level,e.row,e.col,e.extent)}}},25943(e,t,i){i.d(t,{d:()=>_});var r,l=i(32198),s=i(56507),n=i(69622),o=i(49186),a=i(36563),h=(i(44208),i(66344)),u=i(15142),p=i(17676),c=i(36708),f=i(76030),g=i(84952),d=i(91429),y=i(72802),m=i(4718),v=i(69397);class w{constructor(e){!function(e){if(!e?.location)throw new o.A("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new o.A("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new o.A("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new o.A("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new o.A("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}(e);let{location:t,data:i}=e;this.location=Object.freeze((0,m.o8)(t));let r=this.location.width,l=this.location.height,s=!0,n=!0,a=function(e,t=!1){return e<=1024?t?Array(e).fill(0):Array(e):new Uint32Array(e)}(Math.ceil(r*l/32)),h=0;for(let e=0;e<i.length;e++){let t=e%32;i[e]?(n=!1,a[h]|=1<<t):s=!1,31===t&&++h}n?(this._availability="unavailable",this.byteSize=40):s?(this._availability="available",this.byteSize=40):(this._availability=a,this.byteSize=40+(0,v.Qf)(a))}getAvailability(e,t){if("unavailable"===this._availability||"available"===this._availability)return this._availability;let i=(e-this.location.top)*this.location.width+(t-this.location.left),r=i%32,l=i>>5,s=this._availability;return l<0||l>s.length?"unknown":s[l]&1<<r?"available":"unavailable"}static fromDefinition(e,t){let i=e.service.request||s.A,{row:r,col:l,width:n,height:a}=e,h={query:{f:"json"}};return t=t?{...h,...t}:h,i(function(e){let t;if(e.service.tileServers?.length){let i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;let i=e.service.query;return i&&(t=`${t}?${i}`),t}(e),t).then(e=>e.data).catch(e=>{if(422===e?.details?.httpStatus)return{location:{top:r,left:l,width:n,height:a},valid:!0,data:Array(n*a).fill(0)};throw e}).then(e=>{if(e.location&&(e.location.top!==r||e.location.left!==l||e.location.width!==n||e.location.height!==a))throw new o.A("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:r,left:l,width:n,height:a}});return w.fromJSON(e)})}static fromJSON(e){return Object.freeze(new w(e))}}function b(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function M(e,t,i){return new o.A("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})}let _=class extends n.A{static{r=this}constructor(e){super(e),this._pendingTilemapRequests={},this.request=s.A,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new h.q(2097152),this.addHandles((0,c.wB)(()=>{let{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),c.Vh))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,i){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return"unavailable";let r=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return r?r.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,r){return!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD?Promise.reject(M(e,t,i)):this._fetchTilemap(e,t,i,r).catch(e=>e).then(r=>{if(r instanceof w){let l=r.getAvailability(t,i);if("unavailable"===l)throw M(e,t,i);return l}if((0,p.zf)(r))throw r;return"unknown"})}fetchAvailabilityUpsample(e,t,i,r,l){r.level=e,r.row=t,r.col=i;let s=this.layer.tileInfo;s.updateTileInfo(r);let n=this.fetchAvailability(e,t,i,l).catch(e=>{if((0,p.zf)(e))throw e;if(s.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,l);throw e});return this._fetchAvailabilityUpsamplePrefetch(e,t,i,l,n),n}async _fetchAvailabilityUpsamplePrefetch(e,t,i,l,s){if(!this._prefetchingEnabled)return;let n=`prefetch-${e}-${t}-${i}`;if(this.hasHandles(n))return;let o=new AbortController;s.then(()=>o.abort(),()=>o.abort());let h=!1,u=(0,a.hA)(()=>{h||(h=!0,o.abort())});if(this.addHandles(u,n),await(0,f.md)(10,o.signal).catch(()=>{}),h||(h=!0,this.removeHandles(n)),(0,p.G4)(o))return;let c=new y.U(e,t,i),g={...l,signal:o.signal},d=this.layer.tileInfo;for(let e=0;r._prefetches.length<r._maxPrefetch&&d.upsampleTile(c);++e){let e=this.fetchAvailability(c.level,c.row,c.col,g);r._prefetches.push(e);let t=()=>{r._prefetches.removeUnordered(e)};e.then(t,t)}}static{this._maxPrefetch=4}static{this._prefetches=new u.A({initialSize:r._maxPrefetch})}static cleanupTilemapCache(){this._prefetches.prune()}_fetchTilemap(e,t,i,r){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return Promise.reject(new o.A("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));let l=this._tmpTilemapDefinition,s=this._tilemapFromCache(e,t,i,l);if(s)return Promise.resolve(s);let n=r?.signal;return r={...r,signal:null},new Promise((e,t)=>{(0,p.u7)(n,()=>t((0,p.NK)()));let i=b(l),s=this._pendingTilemapRequests[i];if(!s){s=w.fromDefinition(l,r).then(e=>(this._tilemapCache.put(i,e,e.byteSize),e));let e=()=>{delete this._pendingTilemapRequests[i]};this._pendingTilemapRequests[i]=s,s.then(e,e)}s.then(e,t)})}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;let{parsedUrl:e,apiKey:t,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:(0,g.x0)({...e.query,...i,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,r){r.level=e,r.row=t-t%this.size,r.col=i-i%this.size;let l=b(r);return this._tilemapCache.get(l)}get test(){}};(0,l.Cg)([(0,d.MZ)({constructOnly:!0})],_.prototype,"layer",void 0),(0,l.Cg)([(0,d.MZ)({constructOnly:!0})],_.prototype,"minLOD",void 0),(0,l.Cg)([(0,d.MZ)({constructOnly:!0})],_.prototype,"maxLOD",void 0),(0,l.Cg)([(0,d.MZ)({constructOnly:!0})],_.prototype,"request",void 0),(0,l.Cg)([(0,d.MZ)({constructOnly:!0})],_.prototype,"size",void 0),_=r=(0,l.Cg)([(0,d.$K)("esri.layers.support.TilemapCache")],_)},22671(e,t,i){i.d(t,{A:()=>v});var r,l=i(32198),s=i(52106),n=i(66552),o=i(25482),a=i(4718),h=i(91429),u=i(16930),p=i(60408),c=i(65864),f=i(50498),g=i(20437),d=i(36005),y=i(43937);const m=new n.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let v=r=class extends o.o{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,s.A)}writeGeometryType(e,t,i,r){if(e)return void m.write(e,t,i,r);let{features:l}=this;if(l)for(let e of l)if(null!=e?.geometry)return void m.write(e.geometry.type,t,i,r)}readQueryGeometry(e,t){if(!e)return null;let i=!!e.spatialReference,r=(0,c.rS)(e);return r&&!i&&t.spatialReference&&(r.spatialReference=u.A.fromJSON(t.spatialReference)),r}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());let{features:i}=this;if(i)for(let e of i)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new r(this.cloneProperties())}cloneProperties(){return(0,a.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){let t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let i=0;i<t.features.length;i++){let r=t.features[i];r.geometry&&=(e?.[i])?.toJSON()||r.geometry}return t}quantize(e){let{scale:[t,i],translate:[r,l]}=e,s=this.features,n=this._getQuantizationFunction(this.geometryType,e=>Math.round((e-r)/t),e=>Math.round((l-e)/i));for(let e=0,t=s.length;e<t;e++)n?.(s[e].geometry)||(s.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){let{geometryType:e,features:t,transform:i}=this;if(!i)return this;let{translate:[r,l],scale:[s,n]}=i,o=null,a=null;if(this.hasZ&&null!=i?.scale?.[2]){let{translate:[,,e],scale:[,,t]}=i;o=i=>i*t+e}if(this.hasM&&null!=i?.scale?.[3]){let{translate:[,,,e],scale:[,,,t]}=i;a=i=>null==i?i:i*t+e}let h=this._getHydrationFunction(e,e=>e*s+r,e=>l-e*n,o,a);for(let{geometry:e}of t)null!=e&&h&&h(e);return this.transform=null,this}readFeaturesWithClass(e,t,i){let r=u.A.fromJSON(t.spatialReference),l=[];for(let t=0;t<e.length;t++){let s=e[t],n=i.fromJSON(s),o=s.geometry?.spatialReference;null!=n.geometry&&!o&&(n.geometry.spatialReference=r);let a=s.aggregateGeometries,h=n.aggregateGeometries;if(a&&null!=h)for(let e in h){let t=h[e],i=a[e]?.spatialReference;null!=t&&!i&&(t.spatialReference=r)}l.push(n)}return l}_quantizePoints(e,t,i){let r,l,s=[];for(let n=0,o=e.length;n<o;n++){let o=e[n];if(n>0){let e=t(o[0]),n=i(o[1]);(e!==r||n!==l)&&(s.push([e-r,n-l]),r=e,l=n)}else r=t(o[0]),l=i(o[1]),s.push([r,l])}return s.length>0?s:null}_getQuantizationFunction(e,t,i){return"point"===e?e=>(e.x=t(e.x),e.y=i(e.y),e):"polyline"===e||"polygon"===e?e=>{let r=(0,p.Bi)(e)?e.rings:e.paths,l=[];for(let e=0,s=r.length;e<s;e++){let s=r[e],n=this._quantizePoints(s,t,i);n&&l.push(n)}return l.length>0?((0,p.Bi)(e)?e.rings=l:e.paths=l,e):null}:"multipoint"===e?e=>{let r=this._quantizePoints(e.points,t,i);return r&&r.length>0?(e.points=r,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,i,r,l){return"point"===e?e=>{e.x=t(e.x),e.y=i(e.y),r&&(e.z=r(e.z))}:"polyline"===e||"polygon"===e?e=>{let s,n,o=(0,p.Bi)(e)?e.rings:e.paths;for(let e=0,r=o.length;e<r;e++){let r=o[e];for(let e=0,l=r.length;e<l;e++){let l=r[e];e>0?(s+=l[0],n+=l[1]):(s=l[0],n=l[1]),l[0]=t(s),l[1]=i(n)}}if(r&&l)for(let e=0,t=o.length;e<t;e++){let t=o[e];for(let e=0,i=t.length;e<i;e++){let i=t[e];i[2]=r(i[2]),i[3]=l(i[3])}}else if(r)for(let e=0,t=o.length;e<t;e++){let t=o[e];for(let e=0,i=t.length;e<i;e++){let i=t[e];i[2]=r(i[2])}}else if(l)for(let e=0,t=o.length;e<t;e++){let t=o[e];for(let e=0,i=t.length;e<i;e++){let i=t[e];i[2]=l(i[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=i(e.ymin),e.xmax=t(e.xmax),e.ymax=i(e.ymax),r&&null!=e.zmax&&null!=e.zmin&&(e.zmax=r(e.zmax),e.zmin=r(e.zmin)),l&&null!=e.mmax&&null!=e.mmin&&(e.mmax=l(e.mmax),e.mmin=l(e.mmin))}:"multipoint"===e?e=>{let s,n,o=e.points;for(let e=0,r=o.length;e<r;e++){let r=o[e];e>0?(s+=r[0],n+=r[1]):(s=r[0],n=r[1]),r[0]=t(s),r[1]=i(n)}if(r&&l)for(let e=0,t=o.length;e<t;e++){let t=o[e];t[2]=r(t[2]),t[3]=l(t[3])}else if(r)for(let e=0,t=o.length;e<t;e++){let t=o[e];t[2]=r(t[2])}else if(l)for(let e=0,t=o.length;e<t;e++){let t=o[e];t[2]=l(t[2])}}:null}};(0,l.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],v.prototype,"displayFieldName",void 0),(0,l.Cg)([(0,h.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"exceededTransferLimit",void 0),(0,l.Cg)([(0,h.MZ)({type:[s.A],json:{write:!0}})],v.prototype,"features",void 0),(0,l.Cg)([(0,d.w)("features")],v.prototype,"readFeatures",null),(0,l.Cg)([(0,h.MZ)({type:[g.A],json:{write:!0}})],v.prototype,"fields",void 0),(0,l.Cg)([(0,h.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:m.read}}})],v.prototype,"geometryType",void 0),(0,l.Cg)([(0,y.K)("geometryType")],v.prototype,"writeGeometryType",null),(0,l.Cg)([(0,h.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasM",void 0),(0,l.Cg)([(0,h.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasZ",void 0),(0,l.Cg)([(0,h.MZ)({types:f.yR,json:{write:!0}})],v.prototype,"queryGeometry",void 0),(0,l.Cg)([(0,d.w)("queryGeometry")],v.prototype,"readQueryGeometry",null),(0,l.Cg)([(0,h.MZ)({type:u.A,json:{write:!0}})],v.prototype,"spatialReference",void 0),(0,l.Cg)([(0,y.K)("spatialReference")],v.prototype,"writeSpatialReference",null),(0,l.Cg)([(0,h.MZ)({json:{write:!0}})],v.prototype,"transform",void 0),v=r=(0,l.Cg)([(0,h.$K)("esri.rest.support.FeatureSet")],v),v.prototype.toJSON.isDefaultToJSON=!0},2272(e,t,i){i.d(t,{Dl:()=>h,gf:()=>p,jV:()=>a,lF:()=>u});var r=i(92602),l=i(70333),s=i(4718),n=i(84952),o=i(926);function a(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function h(e){return"string"==typeof e?(0,n.An)(e):(0,s.o8)(e)}function u(e,t,i){let r={};for(let l in e){if("declaredClass"===l)continue;let s=e[l];if(null!=s&&"function"!=typeof s)if(Array.isArray(s))r[l]=s.map(e=>u(e));else if("object"==typeof s)if(s.toJSON){let e=s.toJSON(i?.[l]);r[l]=t?e:JSON.stringify(e)}else r[l]=t?s:JSON.stringify(s);else r[l]=s}return r}async function p(e,t,s){return function(e,t){return e?t&&(0,o.Qc)(e)?t:(0,o.getApiKey)(e)??l.id?.findCredential(e)?.token:null}(e,t)||(!l.id&&r.A.request.useIdentity&&await Promise.all([i.e(8673),i.e(7956),i.e(4189)]).then(()=>i(98232)),(await l.id.getCredential(e,s))?.token)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6051],{56512(e,t,i){function r(e){let t,i,r=[],a=!1;return function(...n){return a&&t===this&&function(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}(n,r)||(i=e.apply(this,n),t=this,r=n,a=!0),i}}i.d(t,{B:()=>r})},69397(e,t,i){i.d(t,{Qf:()=>o,Qh:()=>s,lM:()=>n,ro:()=>u,rq:()=>f});var r=i(44208),a=i(34275);function n(e){if(!e)return 0;let t=h;for(let i in e)e.hasOwnProperty(i)&&(t+=l(e[i],!1));return t}function s(e){if(!e)return 0;if("number"==typeof e[0])return o(e);if(Array.isArray(e))return function(e){let t=e.length;if(0===t||"number"==typeof e[0])return f(e,8);let i=c;for(let r=0;r<t;r++)i+=l(e[r]);return i}(e);let t=h;for(let i in e)e.hasOwnProperty(i)&&(t+=l(e[i]));return t}function l(e,t=!0){switch(typeof e){case"object":return t?s(e):h;case"string":return function(e){return 32+e.length}(e);case"number":return 16;case"boolean":return 4;default:return 8}}function o(...e){return e.reduce((e,t)=>e+u(t),0)}function u(e,t=16){return e?(0,a.iu)(e)?e.byteLength+p:Array.isArray(e)?f(e,t):0:0}function f(e,t){return c+e.length*t}const h=32,c=16,d=(0,r.A)("ios")||!(0,r.A)("chrome")&&!(0,r.A)("opr")?8:4,p=145;i.d(t,["JY",0,d])},5359(e,t,i){i.d(t,{Z:()=>a});const r=Symbol("isImageryTileGraphicOrigin");function a(e){return!!e&&r in e}i.d(t,["H",0,r])},16051(e,t,i){i.r(t),i.d(t,{default:()=>bt});var r,a=i(32198),n=i(40124),s=i(69540),l=i(49186),o=i(53966),u=i(97768),f=i(25728),h=i(17676),c=i(36708),d=i(91429),p=i(78888),m=i(41910),g=i(60950),y=i(89808),w=i(99959),v=i(5359);class x extends w.A{get[(r=v.H,g.ym)](){return this.layer}get[y.Q](){return this.layer}get[m.e7](){return this.layer}constructor(e){super(),this[r]=!0,this.type="imagery-tile",this.layer=e}get id(){return this.layer.id}}var b=i(4146),I=i(18768),A=i(63074),S=i(69208),C=i(34287),_=i(8303),R=i(72545),M=i(56551),T=i(54310),O=i(25036),k=i(82935),F=i(82806),D=i(7548),N=i(23636),P=i(49859),z=i(68197),L=i(5443),E=i(16930),B=i(73444),$=i(94778),J=i(14140);function U(e){return["x","e","east","long","longitude"].includes(e.toLowerCase())}function H(e){return["y","n","west","lat","latitude"].includes(e.toLowerCase())}function j(e){let t=(0,B.lR)();return t?e[t]??Object.values(e)[0]:Object.values(e)[0]}function Z(){return Math.round(255*Math.random())}function V(e){let t={},{parameters:i}=e;if(!i)return t;for(let[e,r]of Object.entries(i)){let{type:i,description:a,unit:n,categoryEncoding:s,observedProperty:l}=r;if("Parameter"===i&&(t[e]={},a&&(t[e].description=j(a)),n&&(t[e].unit=n.label?j(n.label):null,t[e].symbol=n.symbol?.value),s)){let i=Object.entries(s).map((e,t)=>({OID:t,Value:Number(e[1]),ClassName:e[0].slice(e[0].lastIndexOf("/")+1),Count:1})),r=!1;l?.categories?.length&&(l.categories.forEach(e=>{if(!e.id)return;let t=e.id.slice(e.id.lastIndexOf("/")+1),a=i.find(e=>e.ClassName===t);if(a&&(a.Label=e.label?j(e.label):null,e.preferredColor)){let t=z.A.fromHex(e.preferredColor);t&&(r=!0,a.Red=t.r,a.Green=t.g,a.Blue=t.b)}}),r&&i.forEach(e=>{e.Red??(e.Red=Z(),e.Green=Z(),e.Blue=Z())}));let a={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:i.map(e=>({attributes:e}))};r&&a.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),t[e].attributeTable=a}}return t}function q(e){let t=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(let r=0;r<e.length;r++){let a=e[r];null!=a&&(a<t&&(t=a),a>i&&(i=a))}return(0,$.X1)(t,i)}function W(e,t,i){let r=e.map((e,i)=>({name:e,count:t[i]})).sort((e,t)=>e.name>t.name?-1:1),a=(e=>t=>e*=t.count)(1),n=[...r.slice(1),{name:"",count:1}].reverse().map(a).reverse(),s=0;for(let a=e.length-1;a>=0;a--){let l=r.findIndex(({name:t})=>t===e[a]);s+=n[l]*(i%t[a]),i=Math.floor(i/t[a])}return s}var G=i(4366),X=i(47520),Y=i(51927),K=i(45617),Q=i(87186);let ee=class extends P.A{constructor(){super(...arguments),this._pixelBlockTiles=new Map,this.datasetFormat="MEMORY",this.preGenerateTiles=!0,this.source=null}get url(){return""}async fetchRawTile(e,t,i,r={}){let a=`${e}/${t}/${i}`,n=this._pixelBlockTiles.get(a);if(n)return n;if(!this.source)return null;let{rasterInfo:s}=this,[l,o]=s.storageInfo.tileInfo.size,{sliceId:u}=r,{encodedData:f}=this.source;if(f){let n=await this.decodePixelBlock(f,{tileSize:[l,o],tileIndex:[e,t,i],canvasUsage:"canvas-only",cloneSource:!0,skipStatistics:!0},{signal:r.signal});return n&&this._pixelBlockTiles.set(a,n),n}let{pixelBlocks:h}=this.source,c=null==u?h[0]:h[u];if(null==c)return null;let d={pixelBlock:c,useBilinear:"thematic"!==s.dataType,tileSize:{width:l,height:o},level:e,row:t,col:i};return this.rasterJobHandler?this.rasterJobHandler.clipTile(d,r):(0,X.J$)(d)}async _open(e){if(!this.source)throw new l.A("in-memory-raster:open","source is required to open an in memory raster");let t=this.source;this.datasetName=t.name;let{pixelBlocks:i,attributeTable:r,statistics:a,histograms:n,nativeExtent:s,transform:o,colormap:u}=t,f=i[0],{width:h,height:c,pixelType:d}=f??t.imageInfo,p=t.extent??new L.A({xmin:-.5,ymin:.5,xmax:h-.5,ymax:c-.5,spatialReference:new E.A({wkid:3857})}),m=t.isPseudoSpatialReference??!t.extent,g={x:p.width/h,y:p.height/c},y={...t.keyProperties};t.dataType&&(y.DataType=t.dataType),t.bandInfos&&(y.BandProperties=t.bandInfos.map(e=>e.toJSON())),r&&(y.DataType="Thematic");let w=new Q.A({width:h,height:c,pixelType:d,extent:p,nativeExtent:s,attributeTable:r,colormap:u,transform:o,pixelSize:g,spatialReference:p.spatialReference,bandCount:f?.pixels.length??t.imageInfo.bandCount,keyProperties:y,multidimensionalInfo:t.multidimensionalInfo,statistics:a,isPseudoSpatialReference:m,histograms:n});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(w),this.createRemoteDatasetStorageInfo(w,512,512),this._set("rasterInfo",w),this.updateTileInfo(),w.multidimensionalInfo?await this._buildMDimStats(i,w.multidimensionalInfo):this.preGenerateTiles&&f&&(await this._buildInMemoryRaster(f,{width:512,height:512},e),this.source=null)}async _buildInMemoryRaster(e,t,i){let{rasterInfo:r}=this,a=r.storageInfo.maximumPyramidLevel??0,n="thematic"!==r.dataType,s=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:a,useBilinear:n},i):Promise.resolve((0,X.lD)(e,t,a,n)),o=null!=r.statistics,u=null!=r.histograms,f=this.ioConfig.skipStatistics||o?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},i):Promise.resolve((0,Y.f4)(e)),c=await(0,h.Lx)([s,f]);if(!c[0].value)throw new l.A("in-memory-raster:open","failed to build in memory raster");this._pixelBlockTiles=c[0].value,o||(r.statistics=c[1].value?.statistics),u||(r.histograms=c[1].value?.histograms)}async _buildMDimStats(e,t,i){for(let r=0;r<t.variables.length;r++){let a=t.variables[r];if(a.statistics)continue;let n=a.dimensions.map(e=>new K.A({variableName:a.name,dimensionName:e.name,values:[e.values?.[0]??e.extent?.[0]],isSlice:!0})),s=(0,G.NG)(n,t),l=null==s?null:e[s];if(null==l)continue;let o=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:l},i):(0,Y.eH)(l);a.statistics=o.statistics,a.histograms||=o.histograms}}};(0,a.Cg)([(0,d.MZ)({type:String,json:{write:!0}})],ee.prototype,"datasetFormat",void 0),(0,a.Cg)([(0,d.MZ)({constructOnly:!0})],ee.prototype,"preGenerateTiles",void 0),(0,a.Cg)([(0,d.MZ)()],ee.prototype,"source",void 0),(0,a.Cg)([(0,d.MZ)()],ee.prototype,"url",null),ee=(0,a.Cg)([(0,d.$K)("esri.layers.raster.datasets.InMemoryRaster")],ee);const te=ee;var ie=i(22671);let re=class extends P.A{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(e,t,i,r={}){return this._inMemoryRaster.fetchRawTile(e,t,i,r)}async _open(e){let{extent:t,pixelBlocks:i,multidimensionalInfo:r,attributeTable:a,bandNames:n}=await this._fetchData(e),{statistics:s,histograms:l}=(0,Y.eH)(i[0]),o=n?.map(e=>({BandName:e})),u={DataType:a?"Thematic":r?"Scientific":"Generic",BandProperties:o},f=new te({source:{extent:t,pixelBlocks:i,attributeTable:a?ie.A.fromJSON(a):null,multidimensionalInfo:r,statistics:s,histograms:l,keyProperties:u,isPseudoSpatialReference:!1}});await f.open(),this._inMemoryRaster=f;let h=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",h.slice(0,h.indexOf("."))),this._set("rasterInfo",f.rasterInfo)}async _fetchData(e){let t=this.source??(await this.request(this.url,{signal:e?.signal})).data,i="imagery-tile-layer:open-coverage-json";if("coverage"!==t.type?.toLowerCase()||"grid"!==t.domain?.domainType?.toLowerCase())throw new l.A(i,"Only coverage with Grid domain type is supported");if(!t.ranges)throw new l.A(i,"Missing ranges in the grid coverage data");if(!t.domain.referencing?.length)throw new l.A(i,"Missing domain referencing in the grid coverage data");let r=Object.values(t.ranges);for(let e=0;e<r.length;e++){let{axisNames:t,shape:a,type:n,values:s}=r[e];if(!("ndarray"===n.toLowerCase()&&s?.length&&t?.length&&a?.length))throw new l.A(i,"Only ranges with valid NdArray, axisNames, shape, and inline values are supported");if(!U(t[t.length-1])||!H(t[t.length-2]))throw new l.A(i,"Only row-major ordered pixel values are supported. X axis must be the last axis.")}return function(e){let{width:t,height:i,extent:r,dimensions:a}=function(e){let{axes:t}=e.domain,i=Object.keys(t),r=[],a=[],n=-1,s=-1,l=[];for(let e=0;e<i.length;e++){let o=i[e];U(o)?n=e:H(o)&&(s=e);let u=t[o],f=[];if("values"in u){u.values.forEach(e=>f.push("string"==typeof e?new Date(e).getTime():e));let e=f[1]-f[0];r.push([f[0]-.5*e,f[f.length-1]+.5*e]),a.push(e)}else{let{start:e,stop:t,num:i}=u,n=(t-e)/(i-1);r.push([e-.5*n,t+.5*n]),a.push(n);for(let t=0;t<i;t++)f.push(e+n*t)}l.push({name:o,values:f,extent:[f[0],f[f.length-1]]})}n>-1&&-1===s?s=+(0===n):s>-1&&-1===n?n=+(0===s):-1===s&&-1===n&&(n=0,s=1),l=l.filter((e,t)=>t!==n&&t!==s);let{referencing:o}=e.domain,u=o.find(e=>e.coordinates.includes(i[n])).system.id,f=u?.slice(u.lastIndexOf("/")+1),h=null==f||"CRS84"===f?4326:Number(f),c=new E.A({wkid:h}),[d,p]=r[n],[m,g]=r[s],y=new L.A({xmin:d,xmax:p,ymin:m,ymax:g,spatialReference:c});return{width:Math.round(y.width/a[n]),height:Math.round(y.height/a[s]),extent:y,dimensions:l}}(e),{ranges:n}=e,s=Object.keys(n).sort((e,t)=>e<t?-1:1),l=[];for(let e=0;e<s.length;e++){let t=s[e];a?.length&&l.push({name:t,dimensions:a})}let o=V(e);l.forEach(e=>o[e.name]&&Object.assign(e,o[e.name]));let u=l.length?{variables:l}:void 0,f=[];for(let e=0;e<s.length;e++){let{values:r,dataType:l,axisNames:o,shape:u}=n[s[e]],h=u.length>2?e*u.slice(0,-2).reduce((e,t)=>e*t):0,c=o.slice(0,-2),d=u.slice(0,-2),p="float"===l?"f32":q(r),m=t*i,g=r.length/m;for(let n=0;n<g;n++){let s=J.A.createEmptyBand(p,m),l=new Uint8Array(m).fill(255),o=!1,u=n*m;for(let e=0;e<m;e++){let t=r[u+e];null==t?(l[e]=0,o=!0):s[e]=t}if(0===e||a?.length){let e=new J.A({width:t,height:i,mask:o?l:null,pixels:[s],pixelType:p});e.updateStatistics(),a?.length?f[W(c,d,n)+h]=e:f.push(e)}else{let e=f[n];e.pixels.push(s),o?e.mask&&=J.A.combineBandMasks([e.mask,l]):e.mask=o?l:null}}}return{extent:r,pixelBlocks:f,multidimensionalInfo:u,attributeTable:Object.values(o).find(e=>e.attributeTable)?.attributeTable,bandNames:u?void 0:s}}(t)}};(0,a.Cg)([(0,d.MZ)({type:String,json:{write:!0}})],re.prototype,"datasetFormat",void 0),(0,a.Cg)([(0,d.MZ)({constructOnly:!0})],re.prototype,"source",void 0),re=(0,a.Cg)([(0,d.$K)("esri.layers.raster.datasets.CovJSONRaster")],re);const ae=re;var ne=i(4576),se=i(21325),le=i(330),oe=i(43163);function ue(e,t){if(!e||!t)return null;let i=[];for(let r=0;r<e.length;r++)i.push(e[r]),i.push(t[r]);return i}function fe(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new E.A({wkid:t});if(e=String(e).trim(),(0,se.jp)(e))return new E.A({wkt2:e});let i=e.toUpperCase();if(i.startsWith("COMPD_CS")){if(!i.includes("VERTCS")||!i.includes("GEOGCS")&&!i.startsWith("PROJCS"))return null;let r=i.indexOf("VERTCS"),a=i.indexOf("PROJCS"),n=a>-1?a:i.indexOf("GEOGCS");if(-1===n)return null;let s=e.slice(n,e.lastIndexOf("]",r)+1).trim(),l=e.slice(r,e.lastIndexOf("]")).trim();t=he(s);let o=t?new E.A({wkid:t}):new E.A({wkt:s}),u=he(l);return u&&(o.vcsWkid=u),o}return i.startsWith("GEOGCS")||i.startsWith("PROJCS")?(t=he(e),0===t?new E.A({wkt:e}):new E.A({wkid:t})):null}function he(e){let t=e.replaceAll("]","[").replaceAll('"',"").split("[").map(e=>e.trim()).filter(e=>""!==e),i=t[t.length-1].split(","),r=i[0]?.toLowerCase();if(("epsg"===r||"esri"===r)&&e.endsWith('"]]')){let e=Number(i[1]);if(!isNaN(e)&&0!==e)return e}return 0}function ce(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};let t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach(e=>{if(1===e.nodeType)if((0,le.g7)(e,"SRS")){if(!t.spatialReference){let i=(0,le.mX)(e);t.spatialReference=fe(i)}}else if((0,le.g7)(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){let{spatialReference:i,transform:r}=function(e){let t=(0,le.V6)(e,"GeodataXform"),i=fe((0,le.v7)(t,"SpatialReference/WKID")||(0,le.mX)(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:i,transform:null};let r=(0,le.v7)(t,"PolynomialOrder")??1,a=(0,le.Ui)(t,"CoeffX/Double"),n=(0,le.Ui)(t,"CoeffY/Double"),s=(0,le.Ui)(t,"InverseCoeffX/Double"),l=(0,le.Ui)(t,"InverseCoeffY/Double"),o=ue(a,n),u=ue(s,l);return{spatialReference:i,transform:o&&u&&o.length&&u.length?new oe.A({spatialReference:i,polynomialOrder:r,forwardCoefficients:o,inverseCoefficients:u}):null}}(e);t.transform=r,t.spatialReference||=i}else(0,le.IC)(e,"MDI").forEach(e=>t.metadata[e.getAttribute("key")]=(0,le.mX)(e));else if((0,le.g7)(e,"PAMRasterBand")){let i=function(e){let t,i,r,a,n=(0,le.v7)(e,"NoDataValue"),s=(0,le.V6)(e,"Histograms/HistItem"),l=(0,le.v7)(s,"HistMin"),o=(0,le.v7)(s,"HistMax"),u=(0,le.v7)(s,"BucketCount"),f=(0,le.mX)(s,"HistCounts")?.split("|").map(e=>Number(e));(0,le.IC)(e,"Metadata/MDI").forEach(e=>{let n=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":t=n;break;case"STATISTICS_MAXIMUM":i=n;break;case"STATISTICS_MEAN":r=n;break;case"STATISTICS_STDDEV":a=n}});let h=(0,le.v7)(e,"Metadata/SourceBandIndex");return{noDataValue:n,histogram:f?.length&&null!=l&&null!=o?{min:l,max:o,size:u||f.length,counts:f}:null,sourceBandIndex:h,statistics:null!=t&&null!=i?{min:t,max:i,avg:r,stddev:a}:null}}(e);null!=i.sourceBandIndex&&null==t.rasterBands[i.sourceBandIndex]?t.rasterBands[i.sourceBandIndex]=i:t.rasterBands.push(i)}});let i=t.rasterBands;return i.length&&(t.statistics=i[0].statistics?i.map(e=>e.statistics).filter(ne.Ru):null,t.histograms=i[0].histogram?i.map(e=>e.histogram).filter(ne.Ru):null),t}var de=i(85951),pe=i(40951);const me="image-aux-raster:open",ge="The data is not a supported format.";let ye=class extends P.A{set rasterJobHandler(e){this._set("rasterJobHandler",e),this._inMemoryRaster&&(this._inMemoryRaster.rasterJobHandler=e)}async fetchRawTile(e,t,i,r={}){return this._inMemoryRaster?.fetchRawTile(e,t,i,r)}async _open(e){let t,{data:i,format:r}=await this._fetchData(e),{tileGeneration:a}=this.ioConfig,n="immediate"===a||"jpg"!==r;if(n){let a=await this._decodeFullImage(i,r,e);if(!a)throw new l.A(me,"The data cannot be decoded.");t=await this._createRasterSource(a,e)}else{let r=(0,de.R)(i);if(!r)throw new l.A(me,ge);t=await this._createRasterSource(r,e),t.encodedData=i}let{rasterJobHandler:s,ioConfig:o}=this,u=new te({preGenerateTiles:n,rasterJobHandler:s,source:t,ioConfig:{...o,sampling:"closest",skipStatistics:!0}});await u.open(e),this._set("rasterInfo",u.rasterInfo),this._inMemoryRaster=u}async _createRasterSource(e,t){let{spatialReference:i,statistics:r,histograms:a,transform:n}=await this._fetchAuxiliaryData(t),s=!i;s&&(i=new E.A({wkid:3857})),a?.length&&null==r&&(r=(0,Y.Pg)(a));let{width:l,height:o}=e,u=new L.A({xmin:-.5,ymin:.5-o,xmax:l-.5,ymax:.5,spatialReference:i}),f=n?n.forwardTransform(u):u,h=!0;if(n){let e=n.forwardCoefficients;h=e&&0===e[1]&&0===e[2],h&&(n=null,u=f)}let c=[];return"pixels"in e&&c.push(e),{name:this.datasetName,pixelBlocks:c,imageInfo:{width:l,height:o,pixelType:"u8",bandCount:3},extent:f,nativeExtent:u,transform:n,statistics:r,histograms:a,isPseudoSpatialReference:s,keyProperties:{DataType:"Processed"}}}async _fetchData(e){let{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),i=(0,pe.g)(t);if("jpg"!==i&&"png"!==i&&"gif"!==i&&"bmp"!==i)throw new l.A(me,ge);return this._set("datasetFormat",i.toUpperCase()),{data:t,format:i}}async _decodeFullImage(e,t,i){try{return await this.decodePixelBlock(e,{format:t,canvasUsage:"canvas-only",cloneSource:!0,skipStatistics:!0},i)}catch{return(0,h.Te)(i?.signal),this.decodePixelBlock(e,{format:t,canvasUsage:"no-canvas",skipStatistics:!0},i)}}async _fetchAuxiliaryData(e){let t=e?.signal,{skipExtensions:i=[],skipMapInfo:r}=this.ioConfig,a=r||i.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),n=this.datasetFormat,s="JPG"===n?"jgw":"PNG"===n?"pgw":"BMP"===n?"bpw":null,l=r||null==s||i.includes(s)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+s,{responseType:"text",signal:t}),o=await(0,h.Lx)([a,l]);if(t?.aborted)throw(0,h.NK)();let u=ce(o[0].value?.data);if(!u.transform){let e=o[1].value?o[1].value.data.split("\n").slice(0,6).map(e=>Number(e)):null;u.transform=6===e?.length?new oe.A({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return u}};(0,a.Cg)([(0,d.MZ)({type:String,json:{write:!0}})],ye.prototype,"datasetFormat",void 0),(0,a.Cg)([(0,d.MZ)()],ye.prototype,"rasterJobHandler",null),ye=(0,a.Cg)([(0,d.$K)("esri.layers.raster.datasets.ImageAuxRaster")],ye);const we=ye;var ve=i(84952),xe=i(86738),be=i(20223),Ie=i(87045),Ae=i(25943),Se=i(82371);let Ce=class extends P.A{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(e,t,i,r={}){let{storageInfo:a,extent:n}=this.rasterInfo,{transposeInfo:s}=a,l=null!=s&&!!r.transposedVariableName;if(this._slices&&!l&&null==r.sliceId)return null;let o,u,f=l?0:a.maximumPyramidLevel-e+this._levelOffset,h=`${this.url}/tile/${f}/${t}/${i}`,c={...this._slices?l?{variable:r.transposedVariableName}:{sliceId:r.sliceId||0}:null,...r.refreshParameters};if(a.isBsqTile){let e=(r.bandIds?.length?r.bandIds:[0,1,2]).map(e=>this.request(h,{query:{...c,bandId:e},responseType:"array-buffer",signal:r.signal})),t=await Promise.all(e),i=t.map(e=>e.data.byteLength).reduce((e,t)=>e+t),a=new Uint8Array(i);u=[];let n=0;for(let{data:e}of t)u.push(n),a.set(new Uint8Array(e),n),n+=e.byteLength;o=a.buffer}else o=(await this.request(h,{query:c,responseType:"array-buffer",signal:r.signal})).data;if(!o)return null;let{tileInfo:d}=a,p=l?s.tileSize:d.size,m=/^(mixed|jp)/i.test(d.format),g="raw"===d.format,y=await this.decodePixelBlock(o,{format:g?"bsq":void 0,width:p[0],height:p[1],planes:u?.length,offsets:u,pixelType:g?this.rasterInfo.pixelType:void 0,isPoint:"Elevation"===this.tileType,returnInterleaved:l,noDataValue:this.rasterInfo.noDataValue,applyJpegMask:m},{signal:r.signal});if(null==y)return null;let w=a.blockBoundary[e];if("jpg"!==a.compression||i>w.minCol&&i<w.maxCol&&t>w.minRow&&t<w.maxRow)return y;let{origin:v,blockWidth:x,blockHeight:b}=a,{x:I,y:A}=this.getPyramidPixelSize(e),S=Math.round((n.xmin-v.x)/I)%x,C=Math.round((n.xmax-v.x)/I)%x||x,_=Math.round((v.y-n.ymax)/A)%b,R=Math.round((v.y-n.ymin)/A)%b||b,M=i===w.minCol?S:0,T=t===w.minRow?_:0,O=i===w.maxCol?C:x,k=t===w.maxRow?R:b;return(0,X.z$)(y,{x:M,y:T},{width:O-M,height:k-T}),y}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;let t=e;for(let e=0;e<this._slices.length;e++){let i=this._slices[e].multidimensionalDefinition;if(i.length===t.length&&!i.some(e=>{let i=t.find(t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName);return!i||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])}))return e}return null}async fetchVariableStatisticsHistograms(e,t){let i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.statistics),r=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.histograms),a=await Promise.all([i,r]);return a[0]&&a[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),a[1]?.[0]?.counts?.length||(a[1]=null),{statistics:a[0]||null,histograms:a[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===i)return null;let r=0,{maximumPyramidLevel:a}=this.rasterInfo.storageInfo,n=a-r+this._levelOffset,s=i.srcLocation;for(;n>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(n,i.row,i.col,t))break}catch{}if(n--,r++,i=this.identifyPixelLocation(s,r,t.datumTransformation),null===i)return null}return-1===n||null==i?null:r}async _open(e){let t=e?.signal,i=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});i.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let r=i.data;if(this.sourceJSON=r,!r)throw new l.A("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!r.tileInfo)throw new l.A("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();this.tileType=r.cacheType,this.tileType??=["jpg","jpeg","png","png8","png24","png32","mixed"].includes(r.tileInfo.format.toLowerCase())?"Map":"lerc"===r.tileInfo.format.toLowerCase()?"Elevation":"Raster",this.datasetName=r.name?.slice(r.name.indexOf("/")+1)??"";let a=this.rasterInfo??await this._fetchRasterInfo({signal:t});if(null==a)throw new l.A("image-server-raster:open","cannot initialize image service");(0,Se.E9)(a,r);let n="Map"===this.tileType?function(e,t){if(!e)return null;let{minScale:i,maxScale:r,minLOD:a,maxLOD:n}=t;if(null!=a&&null!=n)return Ie.A.fromJSON({...e,lods:e.lods.filter(({level:e})=>null!=e&&e>=a&&e<=n)});if(0!==i&&0!==r){let t=e=>Math.round(1e4*e)/1e4,a=i?t(i):1/0,n=r?t(r):-1/0;return Ie.A.fromJSON({...e,lods:e.lods.filter(e=>{let i=t(e.scale);return i<=a&&i>=n})})}return Ie.A.fromJSON(e)}(r.tileInfo,r):Ie.A.fromJSON(r.tileInfo);(0,u.Lw)(n);let[s,o]=this._computeMinMaxLOD(a,n),{extent:f,pixelSize:h}=a,c=.001*Math.min(h.x,h.y);(h.x!==h.y||Math.abs(s.resolution-h.x)>c)&&(h.x=h.y=s.resolution,a.width=Math.ceil((f.xmax-f.xmin)/h.x-.1),a.height=Math.ceil((f.ymax-f.ymin)/h.y-.1));let d=s.level-o.level,[p,m]=n.size,g=[],y=[],{lods:w}=n;w.forEach((e,t)=>{e.level>=o.level&&e.level<=s.level&&g.push({x:e.resolution,y:e.resolution}),t<w.length-1&&y.push(Math.round(10*e.resolution/w[t+1].resolution)/10)}),g.sort((e,t)=>e.x-t.x);let v,x=this.computeBlockBoundary(f,p,m,n.origin,g,d),b=g.length>1?g.slice(1):null;r.transposeInfo&&(v={tileSize:[r.transposeInfo.rows,r.transposeInfo.cols],packetSize:a.keyProperties?._yxs.PacketSize??0});let I=y.length<=1||y.length>=3&&y.slice(0,-1).every(e=>e===y[0])?y[0]??2:Math.round(10/(o.resolution/s.resolution)**(-1/d))/10,A=!!r.bsq&&"Raster"===this.tileType;if(a.storageInfo=new be.A({blockWidth:n.size[0],blockHeight:n.size[1],pyramidBlockWidth:n.size[0],pyramidBlockHeight:n.size[1],pyramidResolutions:b,pyramidScalingFactor:I,compression:n.format,origin:n.origin,firstPyramidLevel:1,maximumPyramidLevel:d,tileInfo:n,isBsqTile:A,transposeInfo:v,blockBoundary:x}),(0,D.vj)(a),this._set("rasterInfo",a),r.capabilities.toLowerCase().includes("tilemap")){let e={tileInfo:a.storageInfo.tileInfo,parsedUrl:(0,ve.An)(this.url),url:this.url,tileServers:[]};this._tilemapCache=new Ae.d({layer:e})}}async _fetchRasterInfo(e){let t=this.sourceJSON;if("Map"===this.tileType){let e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),r=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),a=E.A.fromJSON(t.spatialReference||e.spatialReference),n=new xe.A({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:a});return new Q.A({width:i,height:r,bandCount:3,extent:L.A.fromJSON(e),spatialReference:a,pixelSize:n,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}let i={...e,query:{...this.ioConfig.customFetchParameters,f:"json"}},r=(0,Se.Tw)(this.url,this.sourceJSON,i),a=t.hasMultidimensions?this.request(`${this.url}/slices`,i).then(e=>e.data?.slices).catch(()=>null):null,n=await Promise.all([r,a]);return this._slices=n[1],n[0]}_fixScaleInServiceInfo(){let{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_computeMinMaxLOD(e,t){let{pixelSize:i}=e,r=.5/e.width*i.x,{lods:a}=t,n=t.lodAt(Math.max.apply(null,a.map(e=>e.level))),s=t.lodAt(Math.min.apply(null,a.map(e=>e.level))),{tileType:l}=this;if("Map"===l)return this._levelOffset=a[0].level,[n,s];if("Raster"===l)return[a.find(e=>e.resolution===i.x)??n,s];let{minScale:o,maxScale:u}=this.sourceJSON,f=n;u>0&&(f=a.find(e=>Math.abs(e.scale-u)<r),f||=a.filter(e=>e.scale>u).sort((e,t)=>e.scale>t.scale?1:-1)[0]??n);let h=s;return o>0&&(h=a.find(e=>Math.abs(e.scale-o)<r)??s,this._levelOffset=h.level-s.level),[f,h]}};(0,a.Cg)([(0,d.MZ)({type:String,json:{write:!0}})],Ce.prototype,"datasetFormat",void 0),(0,a.Cg)([(0,d.MZ)()],Ce.prototype,"tileType",void 0),Ce=(0,a.Cg)([(0,d.$K)("esri.layers.raster.datasets.ImageServerRaster")],Ce);const _e=Ce;var Re=i(10713);const Me=new Map([["byte","u8"],["signedbyte","s8"],["int8","s8"],["uint8","u8"],["int16","s16"],["uint16","u16"],["int32","s32"],["uint32","u32"],["float32","f32"],["float64","f64"],["double64","f64"]]),Te=new Map;Te.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Te.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Te.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Te.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"}),Te.set("qb3",{blobExtension:".pq3",isOneSegment:!0,decoderFormat:"qb3"});let Oe=class extends P.A{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this._isBsq=!1,this.datasetFormat="MRF"}async fetchRawTile(e,t,i,r={}){let{blockWidth:a,blockHeight:n,blockBoundary:s}=this.rasterInfo.storageInfo,l=s[e];if(!l||l.maxRow<t||l.maxCol<i||l.minRow>t||l.minCol>i)return null;let{bandCount:o,pixelType:u}=this.rasterInfo,{ranges:f,actualTileWidth:h,actualTileHeight:c}=this._getTileLocation(e,t,i);if(!f||0===f.length)return null;if(f.some(e=>e.from>e.to)){let e=new Uint8Array(a*n);return new J.A({width:a,height:n,pixels:void 0,mask:e,validPixelCount:0})}let{bandIds:d}=this.ioConfig,p=this._getBandSegmentCount(),m=[],g=0;for(g=0;g<p;g++)(!d||d.includes(g))&&m.push(this.request(this._files.data,{range:{from:f[g].from,to:f[g].to},responseType:"array-buffer",signal:r.signal}));let y=await Promise.all(m),w=y.map(e=>e.data.byteLength).reduce((e,t)=>e+t),v=new Uint8Array(w),x=[],b=0;for(g=0;g<p;g++)x.push(b),v.set(new Uint8Array(y[g].data),b),b+=y[g].data.byteLength;let I=Te.get(this.rasterInfo.storageInfo.compression).decoderFormat,A="jpg"===I&&4===o&&1===x.length,S=await this.decodePixelBlock(v.buffer,{width:a,height:n,format:I,planes:d?.length||o,offsets:x,pixelType:u,canvasUsage:A?"no-canvas":void 0,decodeJpegAsRgb:!1},{signal:r.signal});if(null==S)return null;let{noDataValue:C}=this.rasterInfo;if(null!=C&&"lerc"!==I&&!S.mask&&(C=C[0],null!=C)){let e=S.width*S.height,t=new Uint8Array(e);if(Math.abs(C)>1e24)for(g=0;g<e;g++)Math.abs((S.pixels[0][g]-C)/C)>1e-6&&(t[g]=1);else for(g=0;g<e;g++)S.pixels[0][g]!==C&&(t[g]=1);S.mask=t}let _=0,R=0;if(h!==a||c!==n){let e=S.mask;if(e)for(g=0;g<n;g++)if(R=g*a,g<c)for(_=h;_<a;_++)e[R+_]=0;else for(_=0;_<a;_++)e[R+_]=0;else for(e=new Uint8Array(a*n),S.mask=e,g=0;g<c;g++)for(R=g*a,_=0;_<h;_++)e[R+_]=1}return S}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);let t=e?e.signal:null,i=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:r,files:a}=this._parseHeader(i.data),{skipMapInfo:n,skipExtensions:s=[]}=this.ioConfig;if(!s.includes("aux.xml")&&!n){let t=await this._fetchAuxiliaryData(e);null!=t&&(r.statistics=t.statistics??r.statistics,r.histograms=t.histograms,t.histograms&&null==r.statistics&&(r.statistics=(0,Y.Pg)(t.histograms)))}n&&this.updateImageSpaceRasterInfo(r),this._set("rasterInfo",r),this._files=a;let l=await this.request(a.index,{responseType:"array-buffer",signal:t});this._storageIndex=function(e){if(e.byteLength%16>0)throw Error("invalid array buffer must be multiples of 16");let t;if(Re.Z){let i=new Uint8Array(e),r=new ArrayBuffer(e.byteLength),a=new Uint8Array(r);for(let t=0;t<e.byteLength/4;t++)for(let e=0;e<4;e++)a[4*t+e]=i[4*t+3-e];t=new Uint32Array(r)}else t=new Uint32Array(e);return t}(l.data);let{blockWidth:o,blockHeight:u}=this.rasterInfo.storageInfo,f=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:h,height:c}=this.rasterInfo,d=[],p=this._getBandSegmentCount(),m=0,g=-1;for(;m<this._storageIndex.length;){g++;let e=Math.ceil(h/o/f**g)-1,t=Math.ceil(c/u/f**g)-1;m+=(e+1)*(t+1)*p*4,d.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=d,g>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=g),this.updateTileInfo()}_getBandSegmentCount(){return this._isBsq?this.rasterInfo.bandCount:1}_getTileLocation(e,t,i){let r,a,n,{blockWidth:s,blockHeight:l,pyramidScalingFactor:o}=this.rasterInfo.storageInfo,{width:u,height:f}=this.rasterInfo,h=this._getBandSegmentCount(),c=0,d=0;for(n=0;n<e;n++)d=o**n,r=Math.ceil(u/s/d),a=Math.ceil(f/l/d),c+=r*a;d=o**e,r=Math.ceil(u/s/d),a=Math.ceil(f/l/d),c+=t*r+i,c*=4*h;let p=this._storageIndex.subarray(c,c+4*h),m=0,g=0,y=[];for(let e=0;e<h;e++)m=p[4*e]*2**32+p[4*e+1],g=m+p[4*e+2]*2**32+p[4*e+3]-1,y.push({from:m,to:g});return{ranges:y,actualTileWidth:i<r-1?s:Math.ceil(u/d)-s*(r-1),actualTileHeight:t<a-1?l:Math.ceil(f/d)-l*(a-1)}}_parseHeader(e){let t=(0,le.V6)(e,"MRF_META/Raster");if(!t)throw new l.A("mrf:open","not a valid MRF format");let i=(0,le.V6)(t,"Size"),r=parseInt(i.getAttribute("x"),10),a=parseInt(i.getAttribute("y"),10),n=parseInt(i.getAttribute("c"),10),s=((0,le.mX)(t,"Compression")||"none").toLowerCase();if(!Te.has(s))throw new l.A("mrf:open","currently does not support compression "+s);let o=(0,le.mX)(t,"DataType")||"UInt8",u=Me.get(o.toLowerCase());if(null==u)throw new l.A("mrf:open","currently does not support pixel type "+o);let f=(0,le.V6)(t,"PageSize"),h=parseInt(f.getAttribute("x"),10),c=parseInt(f.getAttribute("y"),10),d=f.getAttribute("c"),p=d?d===String(n):Te.get(s).isOneSegment;this._isBsq=!p;let m,g=(0,le.V6)(t,"DataValues");if(g){let e=g.getAttribute("NoData");null!=e&&(m=e.trim().split(" ").map(e=>parseFloat(e)))}if((0,le.V6)(e,"MRF_META/CachedSource"))throw new l.A("mrf:open","currently does not support MRF referencing other data files");let y,w=(0,le.V6)(e,"MRF_META/GeoTags"),v=(0,le.V6)(w,"BoundingBox"),x=!1;if(null!=v){let e=parseFloat(v.getAttribute("minx")),t=parseFloat(v.getAttribute("miny")),i=parseFloat(v.getAttribute("maxx")),r=parseFloat(v.getAttribute("maxy")),a=(0,le.mX)(w,"Projection")||"",n=E.A.WGS84;if("LOCAL_CS[]"!==a)if(a.toLowerCase().startsWith("epsg:")){let e=Number(a.slice(5));!isNaN(e)&&0!==e&&(n=new E.A({wkid:e}))}else n=fe(a)??E.A.WGS84;else x=!0,n=new E.A({wkid:3857});y=new L.A({xmin:e,ymin:t,xmax:i,ymax:r}),y.spatialReference=n}else x=!0,y=new L.A({xmin:-.5,ymin:.5-a,xmax:r-.5,ymax:.5,spatialReference:new E.A({wkid:3857})});let b=(0,le.V6)(e,"MRF_META/Rsets"),I=parseInt(b?.getAttribute("scale")||"2",10),A=y.spatialReference,S=new be.A({origin:new xe.A({x:y.xmin,y:y.ymax,spatialReference:A}),blockWidth:h,blockHeight:c,pyramidBlockWidth:h,pyramidBlockHeight:c,compression:s,pyramidScalingFactor:I}),C=new xe.A({x:y.width/r,y:y.height/a,spatialReference:A}),_=new Q.A({width:r,height:a,extent:y,isPseudoSpatialReference:x,spatialReference:A,bandCount:n,pixelType:u,pixelSize:C,noDataValue:m,storageInfo:S}),R=this._getAuxFullPath((0,le.mX)(t,"DataFile")),M=this._getAuxFullPath((0,le.mX)(t,"IndexFile"));return{rasterInfo:_,files:{mrf:this.url,index:M||this.url.replace(".mrf",".idx"),data:R||this.url.replace(".mrf",Te.get(s).blobExtension)}}}_getAuxFullPath(e){return!e||e.includes("\\")?null:e.includes("/")?e.startsWith(new URL(this.url).origin)?e:null:`${this.url.slice(0,this.url.lastIndexOf("/"))}/${e}`}async _fetchAuxiliaryData(e){try{let{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return ce(t)}catch{return null}}};(0,a.Cg)([(0,d.MZ)()],Oe.prototype,"_files",void 0),(0,a.Cg)([(0,d.MZ)()],Oe.prototype,"_storageIndex",void 0),(0,a.Cg)([(0,d.MZ)()],Oe.prototype,"_isBsq",void 0),(0,a.Cg)([(0,d.MZ)({type:String,json:{write:!0}})],Oe.prototype,"datasetFormat",void 0),Oe=(0,a.Cg)([(0,d.$K)("esri.layers.raster.datasets.MRFRaster")],Oe);const ke=Oe;i(44208);var Fe=i(9334);function De(e){let t=e.fields,i=e.records,r=t.some(e=>"oid"===e.name.toLowerCase())?"OBJECTID":"OID",a=[{name:r,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map(e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name}))),n=a.map(e=>e.name),s=[],l=0,o=0;return i.forEach(e=>{let t={};for(t[r]=l++,o=1;o<n.length;o++)t[n[o]]=e[o-1];s.push({attributes:t})}),{displayFieldName:"",fields:a,features:s}}function Ne(e){let t=new DataView(e),i=3&t.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};let r=t.getUint32(4,!0),a=t.getUint16(8,!0),n=t.getUint16(10,!0),s={version:i,recordCount:r,headerByteCount:a,recordByteCount:n},l=32,o=[],u=[];for(;13!==t.getUint8(l);){let i=String.fromCharCode(t.getUint8(l+11)).trim();o.push({name:(0,Fe.w)(new Uint8Array(e,l,11)),type:i,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(i)],length:t.getUint8(l+16)}),l+=32}if(l+=1,o.length>0)for(;u.length<r&&e.byteLength-l>n;){let i=[];32===t.getUint8(l)?(l+=1,o.forEach(t=>{if("C"===t.type)i.push((0,Fe.w)(new Uint8Array(e,l,t.length)).trim());else if("N"===t.type)i.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,l,t.length)).trim(),10));else if("F"===t.type)i.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,l,t.length)).trim()));else if("D"===t.type){let r=String.fromCharCode.apply(null,new Uint8Array(e,l,t.length)).trim();i.push(new Date(parseInt(r.slice(0,4),10),parseInt(r.slice(4,6),10)-1,parseInt(r.slice(6,8),10)))}l+=t.length}),u.push(i)):l+=n}return{header:s,fields:o,records:u,recordSet:De({fields:o,records:u})}}var Pe=i(44094),ze=i(94213);const Le="none-tiled tiff is not optimized for access, convert to COG and retry.";let Ee=class extends P.A{constructor(){super(...arguments),this._bufferSize=1048576,this._chunkSize=10485760,this._fileSize=-1,this._headerChunks=[],this.datasetFormat="TIFF",this.headerInfo=null}async fetchRawTile(e,t,i,r={}){if(!this.headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;let a=await this._fetchRawTiffTile(e,t,i,!1,r);if(null!=a&&this.headerInfo.hasMaskBand){let n=await this._fetchRawTiffTile(e,t,i,!0,r);null!=n&&n.pixels[0]instanceof Uint8Array&&(a.mask=n.pixels[0])}return a}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf(".")),await this._readHeader(e?.signal),await this._fetchAllAuxData(),this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(this.rasterInfo),this.updateTileInfo()}async _readHeader(e){try{let t=await this._fetchHeaderData(0,this._bufferSize,e);if(!t)throw new l.A("tiffraster:open","failed to open url "+this.url);let{littleEndian:i,firstIFDPos:r,isBigTiff:a}=(0,Pe.uT)(t),n=[],s={fileChunk:t,posIFD:r,fileOffset:0};await this._readIFDs(n,s,i,a?8:4,e);let{imageInfo:o,rasterInfo:u}=function(e){let t=(0,Pe.uc)(e),{width:i,height:r,tileWidth:a,tileHeight:n,planes:s,pixelType:l,compression:o,firstPyramidLevel:u,maximumPyramidLevel:f,pyramidBlockWidth:h,pyramidBlockHeight:c,pyramidResolutions:d,tileBoundary:p,affine:m,metadata:g,colormap:y}=t,w=fe(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),v=!!t.isPseudoGeographic;w??=(v=!0,new E.A({wkid:3857}));let x=new L.A({...t.extent,spatialReference:w}),b=x?new xe.A({x:x.xmin,y:x.ymax,spatialReference:w}):new xe.A({x:0,y:0}),I=new be.A({blockWidth:a,blockHeight:n,pyramidBlockWidth:h,pyramidBlockHeight:c,compression:o,origin:b,firstPyramidLevel:u,maximumPyramidLevel:f,pyramidResolutions:d,blockBoundary:p}),A=new xe.A({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/r,spatialReference:w}),S=g?{BandProperties:g.bandProperties,DataType:g.dataType}:{},C=new Q.A({width:i,height:r,bandCount:s,pixelType:l,pixelSize:A,storageInfo:I,spatialReference:w,isPseudoSpatialReference:v,keyProperties:S,extent:x,colormap:y,statistics:g?g.statistics:null});if(m?.length&&(C.nativeExtent=new L.A({xmin:-.5,ymin:.5-r,xmax:i-.5,ymax:.5,spatialReference:w}),C.transform=new oe.A({polynomialOrder:1,forwardCoefficients:[m[2]+m[0]/2,m[5]-m[3]/2,m[0],m[3],-m[1],-m[4]]}),C.extent=C.transform.forwardTransform(C.nativeExtent),C.pixelSize=new xe.A({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/r,spatialReference:w}),I.origin.x=-.5,I.origin.y=.5),d){let{x:e,y:t}=C.pixelSize;d.forEach(i=>{i.x*=e,i.y*=t})}return{imageInfo:t,rasterInfo:C}}(n),f=(0,Pe.zS)(n),h=(0,Pe.r9)(n);this.headerInfo={littleEndian:i,isBigTiff:a,ifds:n,pyramidIFDs:f,maskIFDs:h,...o},this._set("rasterInfo",u),this._validateHeader()}finally{this._headerChunks.length=0}}_validateHeader(){let e=this.headerInfo;if(!e.isSupported)throw new l.A("tiffraster:open","this tiff is not supported: "+e.message);if(!e.tileWidth||!e.tileHeight)throw new l.A("tiffraster:open",Le);this.rasterInfo.isPseudoSpatialReference&&o.A.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");let t=e.ifds[0],i=t.get("PREDICTOR")?.values?.[0];if(3===t.get("SAMPLEFORMAT")?.values?.[0]&&2===i)throw new l.A("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data")}async _fetchHeaderData(e,t,i){let r=this._getCachedHeaderData(e,t);if(r)return r;let a=Math.floor(e/this._bufferSize)*this._bufferSize,n=a+Math.max(1,Math.ceil((t-a)/this._bufferSize))*this._bufferSize,s=this._getMissingHeaderRanges(a,n).map(async e=>{let{from:t,to:r}=e,a=await this._fetchOffsets(t,r,i),n=this._fileSize;return{chunk:a,fileOffset:t,isEOF:n>0?t+a.byteLength>=n:a.byteLength<r-t+1}}),o=await Promise.all(s);this._headerChunks.push(...o),this._headerChunks.sort((e,t)=>e.fileOffset-t.fileOffset);let u=this._getCachedHeaderData(e,t);if(!u)throw new l.A("tiffraster:open",`failed to fetch byte range ${e}-${t} from ${this.url}`);return u}_getCachedHeaderData(e,t){let i=[],r=e;for(let{chunk:a,fileOffset:n,isEOF:s}of this._headerChunks){if(n+a.byteLength-1<r)continue;if(n>r)return null;let l=r-n,o=Math.min(t-n+1,a.byteLength);if(i.push({chunk:a,start:l,end:o}),r=n+o,r>t||s&&o===a.byteLength){let t=new Uint8Array(r-e),a=0;for(let e of i){let i=new Uint8Array(e.chunk,e.start,e.end-e.start);t.set(i,a),a+=i.byteLength}return t.buffer}}return null}_getMissingHeaderRanges(e,t){let i=[],r=(e,t)=>{let r=Math.floor(e/this._bufferSize)*this._bufferSize,a=Math.ceil(t/this._bufferSize)*this._bufferSize;i.push({from:r,to:a})},a=e;for(let{chunk:e,fileOffset:n,isEOF:s}of this._headerChunks){let l=n+e.byteLength-1;if(!(l<a)&&(n>a&&r(a,Math.min(n-1,t)),a=Math.max(a,l+1),a>t||s))return i}return a<=t&&r(a,t),i}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:i,fileOffset:r,posIFD:a}=e;if(a+8>=i.byteLength||a<0){if(r=a+r,r<0)throw new l.A("tiffraster:open",`invalid IFD position ${r}. failed to open url ${this.url}`);i=await this._fetchHeaderData(r,r+this._bufferSize/2,t),a=0}return{fileChunk:i,fileOffset:r,posIFD:a}}async _readIFDs(e,t,i,r=4,a){if(!t.posIFD)return null;t=await this._validateOrFetchHeaderBuffer(t,a);let n=await this._readIFD(t,i,ze.NB,r,a);if(!n?.ifd)throw new l.A("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(e.push(n.ifd),!n.nextIFD)return null;t.posIFD=n.nextIFD-t.fileOffset,await this._readIFDs(e,t,i,r,a)}async _readIFD(e,t,i=ze.NB,r=4,a){let{fileChunk:n,posIFD:s,fileOffset:o}=e;if(!e.fileChunk)return null;let u=(0,Pe.JM)(n,t,s,o,i,r);if(u.success){let{ifd:e}=u;if(!e)throw new l.A("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(!(this.ioConfig.loadFullMetadata||i!==ze.NB||e.has("TILEWIDTH")&&e.has("TILELENGTH")))throw new l.A("tiffraster:open",Le);let r=[];e.forEach(e=>{e.values||r.push(e)}),r.length>0&&await this._fillOffsets(r,t,u.nextIFD,a),(0,Pe.fM)(e),(0,Pe.h_)(e);for(let[i,r]of ze.RR){let l=e.get(i),u=null!=l?.data&&Array.from(l.data.values()).some(e=>null==e.values&&null!=e.offlineOffsetSize);if(l&&(!l.data||u)){s=l.valueOffset-o;let e=await this._validateOrFetchHeaderBuffer({fileChunk:n,posIFD:s,fileOffset:o},a);l.data=(await this._readIFD(e,t,r,4,a))?.ifd}}return u}return u.requiredBufferSize?(n=await this._fetchHeaderData(o,o+s+u.requiredBufferSize+8,a),n.byteLength<s+u.requiredBufferSize?null:(e.fileChunk=n,e.fileOffset=o,this._readIFD(e,t,i,r,a))):null}async _fillOffsets(e,t,i,r){let a=e.filter(e=>null!=e.offlineOffsetSize);if(0===a.length)return;let n=a.map(e=>e.offlineOffsetSize),s=Math.min.apply(null,n.map(e=>e[0])),l=Math.max.apply(null,n.map(e=>e[0]+e[1])),o=1===n.length||l-s<=this._bufferSize;if(!o&&n.length>1&&(n.sort((e,t)=>e[0]-t[0]),o=n.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,n[0][0])===l),o){let e=Math.max(l,s+this._bufferSize/4),i=await this._fetchHeaderData(s,e,r);return void a.forEach(e=>(0,Pe.Cr)(i,t,e,s))}let u=a.map(async e=>{let i=e.offlineOffsetSize,a=await this._fetchHeaderData(i[0],i[1]+i[0],r);(0,Pe.Cr)(a,t,e,i[0])});await Promise.all(u)}async _fetchOffsets(e,t,i){let r=[],a=this._chunkSize;this._fileSize>0&&(t=Math.min(t,this._fileSize-1));let n=Math.ceil((t-e+1)/a),s=e;for(let e=0;e<n;e++)r.push(this.request(this.url,{range:{from:s,to:e===n-1?t:s+a-1},responseType:"array-buffer",signal:i})),s+=a;let l=await Promise.all(r);if(-1===this._fileSize&&206===l[0].httpStatus){let e=l[0].getHeader?.("Content-Range"),t=Number(e?.split("/")[1]);Number.isFinite(t)&&(this._fileSize=t)}if(1===l.length)return l[0].data;let o=l.reduce((e,t)=>e+t.data.byteLength,0),u=new Uint8Array(o),f=0;for(let e of l)u.set(new Uint8Array(e.data),f),f+=e.data.byteLength;return u.buffer}async _fetchRawTiffTile(e,t,i,r,a={}){let n=this._getTileLocation(e,t,i,r);if(!n)return null;let{ranges:s,actualTileWidth:l,actualTileHeight:o,ifd:u}=n,f=s.map(e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:a.signal})),h=await Promise.all(f),c=h.map(e=>e.data.byteLength).reduce((e,t)=>e+t),d=1===h.length?h[0].data:new ArrayBuffer(c),p=[0],m=[0];if(h.length>1){let e=new Uint8Array(d);for(let t=0,i=0;t<h.length;t++){let r=h[t].data;e.set(new Uint8Array(r),i),p[t]=i,i+=r.byteLength,m[t]=r.byteLength}}let{blockWidth:g,blockHeight:y}=this.getBlockWidthHeight(e),w=await this.decodePixelBlock(d,{format:"tiff",customOptions:{headerInfo:this.headerInfo,ifd:u,offsets:p,sizes:m},width:g,height:y,planes:null,pixelType:null},{signal:a.signal});if(null==w)return null;if(l!==g||o!==y){let e=w.mask;if(e)for(let t=0;t<y;t++){let i=t*g;if(t<o)for(let t=l;t<g;t++)e[i+t]=0;else for(let t=0;t<g;t++)e[i+t]=0}else{e=new Uint8Array(g*y),w.mask=e;for(let t=0;t<o;t++){let i=t*g;for(let t=0;t<l;t++)e[i+t]=1}}}return w}_getTileLocation(e,t,i,r=!1){let{firstPyramidLevel:a,blockBoundary:n}=this.rasterInfo.storageInfo,s=0===e?0:e-(a-1),{headerInfo:l}=this;if(!l)return null;let o=r?l.maskIFDs[s]:0===s?l.ifds[0]:l.pyramidIFDs[s-1];if(!o)return null;let u=(0,Pe.XO)(o,l),f=(0,Pe.wc)(o,"TILEOFFSETS"),h=(0,Pe.wc)(o,"TILEBYTECOUNTS");if(!f?.length||!h?.length)return null;let{minRow:c,minCol:d,maxRow:p,maxCol:m}=n[s];if(t>p||i>m||t<c||i<d)return null;let g=(0,Pe.LZ)(o,"IMAGEWIDTH"),y=(0,Pe.LZ)(o,"IMAGELENGTH"),w=(0,Pe.LZ)(o,"TILEWIDTH"),v=(0,Pe.LZ)(o,"TILELENGTH"),x=[];if(u){let{bandCount:e}=this.rasterInfo;for(let r=0;r<e;r++){let e=r*(p+1)*(m+1)+t*(m+1)+i;x[r]={from:f[e],to:f[e]+h[e]-1}}}else{let e=t*(m+1)+i;x.push({from:f[e],to:f[e]+h[e]-1})}for(let e=0;e<x.length;e++)if(null==x[e].from||!x[e].to||x[e].to<0)return null;return{ranges:x,ifd:o,actualTileWidth:i===m&&g%w||w,actualTileHeight:t===p&&y%v||v}}async _fetchAllAuxData(e){if(this.ioConfig.skipMapInfo)return;let{rasterInfo:t}=this,{skipExtensions:i=[]}=this.ioConfig,r=i.includes("aux.xml")?Promise.resolve(null):this._fetchAuxiliaryMetaData(e),a=i.includes("vat.dbf")||1!==t.bandCount||"u8"!==t.pixelType?Promise.resolve(null):this._fetchAuxiliaryTable(e),[n,s]=await Promise.all([r,a]);null!=n&&function(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,Y.Pg)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;let i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new xe.A({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}(n,t),null!=s&&(t.attributeTable=s,t.keyProperties.DataType="thematic")}async _fetchAuxiliaryMetaData(e){try{let{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return ce(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{let{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=Ne(t);return i?.recordSet?ie.A.fromJSON(i.recordSet):null}catch{return null}}};(0,a.Cg)([(0,d.MZ)()],Ee.prototype,"_bufferSize",void 0),(0,a.Cg)([(0,d.MZ)()],Ee.prototype,"_chunkSize",void 0),(0,a.Cg)([(0,d.MZ)()],Ee.prototype,"_fileSize",void 0),(0,a.Cg)([(0,d.MZ)()],Ee.prototype,"_headerChunks",void 0),(0,a.Cg)([(0,d.MZ)({type:String,json:{write:!0}})],Ee.prototype,"datasetFormat",void 0),(0,a.Cg)([(0,d.MZ)()],Ee.prototype,"headerInfo",void 0),Ee=(0,a.Cg)([(0,d.$K)("esri.layers.raster.datasets.TIFFRaster")],Ee);const Be=Ee;var $e=i(91806);const Je=new Set(["x","lon","long","longitude","e","east","easting"]),Ue=new Set(["y","lat","latitude","n","north","northing"]),He=new Map([["b1","u8"],["u1","u8"],["u2","u16"],["u4","u32"],["i1","s8"],["i2","s16"],["i4","s32"],["f2","f32"],["f4","f32"],["f8","f64"],["c8","c64"],["c16","c128"],["m","unknown"],["M","unknown"],["S","unknown"],["U","unknown"],["V","unknown"]]),je="zarr-raster:parse";function Ze(e,t){return e.slice(0,-t.length)}function Ve(e,t){!function(e){if(2!==e?.zarr_format)throw new l.A(je,"only zarr_format 2 is supported");let{shape:t,compressor:i,order:r,chunks:a,dimension_separator:n}=e;if(!Array.isArray(t)||!Array.isArray(a)||t.length!==a.length||t.some(e=>!Number.isSafeInteger(e)||e<0)||a.some(e=>!Number.isSafeInteger(e)||e<=0))throw new l.A(je,"invalid Zarr shape or chunks");if(null!=r&&"C"!==r&&"F"!==r)throw new l.A(je,"invalid Zarr array order");if(null!=n&&"."!==n&&"/"!==n)throw new l.A(je,"invalid Zarr dimension separator");if(null!==i&&("string"!=typeof i?.id||!i.id))throw new l.A(je,"Zarr compressor must be null or have a codec id")}(e);let{isBigEndian:i,pixelType:r,originalPixelType:a}=function(e){if("string"!=typeof e)throw new l.A(je,`Unsupported Zarr dtype: ${JSON.stringify(e)}`);let t=e.startsWith(">"),i=e.replace(/^[<>|=]/,""),r=He.get(i);if(!r||"unknown"===r||r.startsWith("c"))throw new l.A(je,`Unsupported Zarr dtype: ${JSON.stringify(e)}`);return{isBigEndian:t,pixelType:r,originalPixelType:i}}(e.dtype),{shape:n,compressor:s,order:o,chunks:u}=e,f=s?.id||"none",h="C"===o||null==o,c=function(e){if(null!==e){if("number"==typeof e)return e;switch(e){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw new l.A(je,`Unsupported numeric Zarr fill value: ${e}`)}}}(e.fill_value);if(null!=c)if(Number.isFinite(c)){"f32"===r&&(c="f2"===a?new Float16Array([c])[0]:Math.fround(c));let[e,t]=(0,$.hP)("f2"===a?"f16":r);(c>t||c<e)&&(c=void 0)}else c=r.startsWith("f")?c:void 0;let d=e.dimension_separator??".";return{isBigEndian:i,pixelType:r,originalPixelType:a,compression:f,isRowMajor:h,shape:n,chunkSize:u,fillValue:c,scaleFactor:t?.scale_factor??1,addOffset:t?.add_offset??0,separator:d}}function qe(e){return e.Description??e.description??e.long_name??e.standard_name??null}function We(e,t,i){let r=i?.[e];return!r?.length||t<=0?null:r.length<=t?r.toSorted((e,t)=>e-t):r.slice(0,t).toSorted((e,t)=>e-t)}function Ge(e){if(1===e.length)return[e[0]-.5,e[0]+.5];let t=e[0],i=e.at(-1),r=Math.abs(i-t)/(e.length-1)*.5;return[Math.min(t,i)-r,Math.max(t,i)+r]}function Xe(e){let t;for(let i=0;i<e.length;i++){let r=e[i],a=Ye(r);if(a)return new E.A({wkid:a});t||=r?._CRS?.wkt?.trim()}return t?new E.A({wkt:t}):void 0}function Ye(e){let t=e?._CRS?.projjson?.id?.code,i="CRS84"===t?4326:"CRS83"===t?4269:"CRS27"===t?4267:Number(t);if(Number.isSafeInteger(i)&&i>0)return i;let r=e?._CRS?.url;return"string"==typeof r&&Number(r.slice(r.lastIndexOf("/")+1))||void 0}function Ke(e){let t=e.attributes._ARRAY_DIMENSIONS,i=e.array.shape??[];return!t?.length||t.length!==i.length}function Qe(e,t){let i="x"===t?Je:Ue;return(e.find(e=>i.has(e.attributes.standard_name?.toLowerCase()??""))??e.find(e=>i.has(e.name.toLowerCase()??"")))?.name}function et(e,t){return`${e}/${t=t.split("/").map(encodeURIComponent).join("/")}`}const tt="zarr-raster:open",it=new Set(["none"]);let rt=class extends P.A{constructor(){super(...arguments),this.datasetFormat="ZARR"}get _baseUrl(){let{url:e}=this;return e.endsWith("/.zmetadata")||e.endsWith("/.zgroup")?e.slice(0,e.lastIndexOf("/")):e}async fetchRawTile(e,t,i,r={}){let{multidimensionalDefinition:a}=r;if(!a?.length)return null;let n=a[0].variableName,s=this._metadata.dataVariables.find(e=>e.name===n);if(!s)return null;let{storageInfo:o}=s,u=Object.fromEntries(a.map(e=>[e.dimensionName,e.values[0]])),f=this._getDimensionIndices(s,t,i,u);if(!f)return null;let h=s.attributes._ARRAY_DIMENSIONS,{xDimension:c,yDimension:d}=this._metadata,p=function(e,t,i,r){let{chunkSize:a,shape:n,pixelType:s,separator:l,isRowMajor:o,fillValue:u,scaleFactor:f,addOffset:h}=e,c=Array(n.length),d=Array(n.length),p=Array(n.length),m=1;for(let e=0;e<n.length;e++){let i=t[e];if(i<0||i>=n[e])return null;let r=a[e],s=Math.floor(i/r);c[e]=s,d[e]=i-s*r,p[e]=Math.min(r,n[e]-s*r),m*=r}return{chunkPath:c.join(l),chunkSize:a,actualSize:p,offsets:d,xIndex:i,yIndex:r,pixelType:s,isRowMajor:o,elementCount:m,fillValue:u,scaleFactor:f,addOffset:h}}(o,f,h.indexOf(c),h.indexOf(d));if(!p)return null;let m=et(this._baseUrl,`${n}/${p.chunkPath}`),{data:g}=await this.request(m,{responseType:"array-buffer",signal:r.signal}),{actualSize:y,elementCount:w}=p,v=this._decodeChunk(g,o),x=y.reduce((e,t)=>e*t,1),b=v.length;if(b!==w&&b!==x)throw new l.A("zarr-raster:decode",`Invalid chunk length ${b} for "${m}"; expected ${w} or ${x} values`);return function(e,t){let i,{chunkSize:r,actualSize:a,xIndex:n,yIndex:s}=t,l=r[n],o=r[s],u=a[n],f=a[s],h=function(e,t){let{chunkSize:i,actualSize:r,xIndex:a,yIndex:n,pixelType:s,elementCount:l,isRowMajor:o}=t,u=i[a],f=i[n],h=e.length===l?i:r;return e.length===u*f&&h[a]===u&&h[n]===f?(o?n<a:a<n)?e:function(e,t,i,r){let a=new(J.A.getPixelArrayConstructor(r))(e.length);for(let r=0;r<i;r++)for(let n=0;n<t;n++)a[r*t+n]=e[n*i+r];return a}(e,u,f,s):function(e,t,i){let{chunkSize:r,actualSize:a,offsets:n,xIndex:s,yIndex:l,pixelType:o,isRowMajor:u}=t,f=r[s],h=r[l],c=a[s],d=a[l],p=Array(i.length),m=1;for(let e=0;e<i.length;e++){let t=u?i.length-1-e:e;p[t]=m,m*=i[t]}let g=new(J.A.getPixelArrayConstructor(o))(f*h);for(let t=0;t<d;t++)for(let r=0;r<c;r++){let a=0;for(let e=0;e<i.length;e++){let i=n[e];e===s?i=r:e===l&&(i=t),a+=i*p[e]}g[t*f+r]=e[a]}return g}(e,t,h)}(e,t);if(u<l||f<o){i=new Uint8Array(l*o);for(let e=0;e<f;e++)i.fill(1,e*l,e*l+u)}let{fillValue:c}=t;if(null!=c){let e=Number.isNaN(c);for(let t=0;t<f;t++)for(let r=0;r<u;r++){let a=t*l+r,n=h[a];(n===c||e&&Number.isNaN(n))&&(i??=new Uint8Array(l*o).fill(1),i[a]=0)}}let{pixelType:d,scaleFactor:p,addOffset:m}=t,g=d,y=h;if(1!==p||0!==m){g="f64"===d?"f64":"f32",y=new(J.A.getPixelArrayConstructor(g))(h.length);for(let e=0;e<h.length;e++)y[e]=0===i?.[e]?h[e]:h[e]*p+m}return new J.A({width:l,height:o,pixelType:g,pixels:[y],mask:i})}(v,p)}async _open(e){let t=this.url.slice(this.url.lastIndexOf("/")+1);if(t.endsWith(".zattrs")||t.endsWith(".zarray"))throw new l.A(tt,`Unsupported Zarr URL: "${this.url}". Expect a v2 root url or consolidated metadata url`);let i=this._baseUrl;this.datasetName=i.slice(i.lastIndexOf("/")+1).replace(".zarr","");let r=e?.signal??void 0,{data:a}=await this.request(`${i}/.zmetadata`,{signal:r}),n=function(e){let t=e?.metadata;if("object"!=typeof t||!t||Array.isArray(t))throw new l.A(je,"missing consolidated metadata root");let i=new Map;for(let[e,r]of Object.entries(t))if(e.endsWith("/.zarray")){let a=r,n=Ze(e,"/.zarray"),s=t[`${n}/.zattrs`],o=Ve(a,s);if(s){let e=s._ARRAY_DIMENSIONS;if(!e?.length)throw new l.A(je,`missing required _ARRAY_DIMENSIONS attribute for array "${n}"`);if(null!=s.scale_factor&&!Number.isFinite(s.scale_factor)||null!=s.add_offset&&!Number.isFinite(s.add_offset))throw new l.A(je,`Invalid scale_factor or add_offset for array "${n}"`);let t=1===e.length&&e[0]===n,r=Xe([s]),{shape:u,chunkSize:f}=o;if(e.length!==u.length||e.length!==f.length)throw new l.A(je,`variable dimensions do not match shape for array "${n}"`);i.set(n,{name:n,isDimension:t,storageInfo:o,spatialReference:r,array:a,attributes:s})}}if(0===i.size)throw new l.A(je,"no arrays found");let r=Array.from(i.values()),{xDimension:a,yDimension:n}=function(e){let t=e.filter(e=>e.isDimension),i=t.map(e=>e.name),r=Qe(t,"x"),a=Qe(t,"y");if(!r||!a){let t=(e.find(e=>!e.isDimension&&(e.attributes._ARRAY_DIMENSIONS?.length??0)>=2)?.attributes._ARRAY_DIMENSIONS)?.filter(e=>i.includes(e))??i;r??=t.findLast(e=>e!==a),a??=t.findLast(e=>e!==r)}if(!r||!a||r===a)throw new l.A(je,`Unable to determine x and y dimensions from variable dimensions "${i.join(", ")}"`);return{xDimension:r,yDimension:a}}(r),s=function(e,t,i){let r=e.filter(e=>{let r=!e.isDimension,a=e.attributes._ARRAY_DIMENSIONS,n=a?.includes(t)&&a.includes(i);return r&&n});if(0===r.length)throw new l.A(je,"no valid data variables found");if(r.some(Ke))throw new l.A(je,"some variable dimensions do not match shape");let a=e.filter(e=>e.isDimension),n=r[0],s=n.attributes._ARRAY_DIMENSIONS,o=n.storageInfo.chunkSize[s.indexOf(t)],u=n.storageInfo.chunkSize[s.indexOf(i)];for(let e of r){let r=e.attributes._ARRAY_DIMENSIONS;if(r.some((t,i)=>{let r=a.find(e=>e.name===t);return r&&r.storageInfo.shape[0]!==e.storageInfo.shape[i]}))throw new l.A(je,`Coordinate dimensions do not match shape for "${e.name}"`);let{chunkSize:s}=e.storageInfo;if(s[r.indexOf(t)]!==o||s[r.indexOf(i)]!==u)throw new l.A(je,`X/Y chunk sizes must match across variables: compare ${e.name} ${n.name}`)}return r}(r,a,n),o=r.filter(e=>e.isDimension);return{dataDimensions:o,dataVariables:s,spatialReference:s.find(e=>e.spatialReference)?.spatialReference??o.find(e=>e.spatialReference)?.spatialReference,xDimension:a,yDimension:n,version:2}}(a);this._metadata=n;let s=[...n.dataDimensions,...n.dataVariables].find(({storageInfo:{compression:e}})=>!it.has(e));if(s)throw new l.A(tt,`Unsupported Zarr compression "${s.storageInfo.compression}" for array "${s.name}"`);let o={};await Promise.all(n.dataDimensions.map(e=>this._readDimensionValues(e,o,r)));let u=function(e,t){let{dataDimensions:i,dataVariables:r,spatialReference:a}=e,n=r[0],s=n.attributes._ARRAY_DIMENSIONS??[],{xDimension:o,yDimension:u}=e,f=i.find(e=>e.name===o)?.storageInfo.shape[0],h=i.find(e=>e.name===u)?.storageInfo.shape[0];if(!f||!h)throw new l.A(je,`Unable to determine width and height from dimensions "${o}" and "${u}"`);let c=t[o],d=t[u];if(c.some((e,t)=>t>0&&e<c[t-1])||d.some((e,t)=>t>0&&e>d[t-1]))throw new l.A(je,"Unsupported spatial coordinates order, must be ascending X and descending Y");let[p,m]=Ge(c),[g,y]=Ge(d),w=new L.A({xmin:p,ymin:g,xmax:m,ymax:y,spatialReference:a}),v=Math.abs((m-p)/f),x=Math.abs((y-g)/h),b={x:v,y:x},I=new Map;for(let e of i){let i=e.name;if(i===o||i===u)continue;let r=e.storageInfo.shape[0],a=We(i,r,t),{attributes:n}=e;I.set(i,{name:i,description:qe(n),unit:n.units,values:a,extent:a?[a[0],a.at(-1)]:r>0?[0,r-1]:void 0})}let A=[];for(let e of r){let t=e.attributes._ARRAY_DIMENSIONS.map(e=>I.get(e)).filter(e=>!!e),{attributes:i}=e;A.push({name:e.name,description:qe(i),unit:i.units??null,dimensions:t})}let S=A.length?{variables:A}:null,{pixelType:C}=n.storageInfo;for(let{storageInfo:e}of r){if("f64"===e.pixelType){C="f64";break}("f32"===e.pixelType||1!==e.scaleFactor||0!==e.addOffset)&&(C="f32")}let _={DataType:S?"Scientific":"Generic"},{chunkSize:R}=n.storageInfo,M=R[s.indexOf(o)],T=R[s.indexOf(u)],O=[{minCol:0,maxCol:Math.ceil(f/M)-1,minRow:0,maxRow:Math.ceil(h/T)-1}],k=new xe.A({x:p,y,spatialReference:a}),F=(v+x)/2,N=new Ie.A({origin:k,size:[M,T],spatialReference:a,lods:[new $e.A({level:0,resolution:F,scale:1/.0254*96*F})]}),P=new be.A({blockWidth:M,blockHeight:T,pyramidBlockWidth:M,pyramidBlockHeight:T,compression:n.storageInfo.compression,origin:k,firstPyramidLevel:0,maximumPyramidLevel:0,blockBoundary:O,tileInfo:N,isVirtualTileInfo:!1}),z=n.storageInfo.fillValue,E=new Q.A({width:f,height:h,pixelSize:b,pixelType:C,bandCount:1,noDataValue:z,extent:w,spatialReference:a,keyProperties:_,multidimensionalInfo:S,isPseudoSpatialReference:!1,format:"zarr",storageInfo:P});return(0,D.vj)(E),E}(n,o);this._dimensionValues=o,this._set("rasterInfo",u)}_getDimensionIndices(e,t,i,r){let a=e.attributes._ARRAY_DIMENSIONS,{xDimension:n,yDimension:s}=this._metadata,{chunkSize:l}=e.storageInfo;if(!this.rasterInfo.multidimensionalInfo?.variables.find(t=>t.name===e.name)?.dimensions?.length)return null;let o=[];for(let e=0;e<a.length;e++){let u=a[e];if(u===n)o[e]=i*l[e];else if(u===s)o[e]=t*l[e];else{let t=this._dimensionValues[u],i=r[u],a=t?.indexOf(i)??-1;if(a<0)return null;o[e]=a}}return o}async _readDimensionValues(e,t,i){let{name:r,storageInfo:a}=e,n=a.chunkSize[0],s=a.shape[0];if(n<=0||s<=0)throw new l.A(tt,`Invalid dimension array "${r}" with chunkSize ${n} and totalElements ${s}`);let o=Math.ceil(s/n),u=this._baseUrl,f=[];for(let e=0;e<o;e++){let t=et(u,`${r}/${e}`),c=e===o-1?s-e*n:n;f.push(this.request(t,{responseType:"array-buffer",signal:i}).then(e=>{let t=this._decodeChunk(e.data,a);if(t.length!==n&&t.length!==c)throw new l.A(tt,`Invalid dimension chunk length for "${r}"`);return t.slice(0,c)}).catch(e=>{throw(0,h.zf)(e)?e:new l.A(tt,`Unable to fetch dimension data for "${r}"`)}))}let c=(await Promise.all(f)).flatMap(e=>Array.from(e)),{scaleFactor:d,addOffset:p}=a;if(1!==d||0!==p)for(let e=0;e<c.length;e++)c[e]=c[e]*d+p;t[r]="days since 1899-12-30 00:00:00 UTC"===e.attributes.units?c.map(G.$E):c}_decodeChunk(e,t){let{compression:i}=t;if(!it.has(i))throw new l.A("zarr-raster:decode",`Unsupported Zarr compression "${i}"`);return function(e,t){let{pixelType:i,originalPixelType:r}=t,a=!t.isBigEndian,n=J.A.getPixelArrayConstructor(i);if(a&&"f2"!==r)return new n(e);let s="f2"===r?2:(0,$.Qd)(i),o=e.byteLength/s,u=new DataView(e),f=new n(o);for(let e=0,t=0;e<o;t+=s,e++)switch(i){case"s8":f[e]=u.getInt8(t);break;case"u8":f[e]=u.getUint8(t);break;case"s16":f[e]=u.getInt16(t,a);break;case"u16":f[e]=u.getUint16(t,a);break;case"s32":f[e]=u.getInt32(t,a);break;case"u32":f[e]=u.getUint32(t,a);break;case"f32":f[e]="f2"===r?u.getFloat16(t,a):u.getFloat32(t,a);break;case"f64":f[e]=u.getFloat64(t,a);break;default:throw new l.A("zarr-raster:decode",`Unsupported coordinate pixel type: ${i}`)}return f}(e,t)}};(0,a.Cg)([(0,d.MZ)()],rt.prototype,"_baseUrl",null),(0,a.Cg)([(0,d.MZ)({json:{write:!0}})],rt.prototype,"_dimensionValues",void 0),(0,a.Cg)([(0,d.MZ)({json:{write:!0}})],rt.prototype,"_metadata",void 0),(0,a.Cg)([(0,d.MZ)({type:String,json:{write:!0}})],rt.prototype,"datasetFormat",void 0),rt=(0,a.Cg)([(0,d.$K)("esri.layers.raster.datasets.ZarrRaster")],rt);const at=rt,nt=new Map;nt.set("RasterTileServer",{desc:"Raster Tile Server",constructor:_e}),nt.set("TIFF",{desc:"Cloud Optimized GeoTIFF",constructor:Be}),nt.set("MRF",{desc:"Meta Raster Format",constructor:ke}),nt.set("ZARR",{desc:"Zarr Raster Format",constructor:at}),nt.set("JPG",{desc:"JPG Raster Format",constructor:we}),nt.set("PNG",{desc:"PNG Raster Format",constructor:we}),nt.set("GIF",{desc:"GIF Raster Format",constructor:we}),nt.set("BMP",{desc:"BMP Raster Format",constructor:we}),nt.set("CovJSON",{desc:"COVJSON Raster Format",constructor:ae}),nt.set("MEMORY",{desc:"In Memory Raster Format",constructor:te});class st{static get supportedFormats(){let e=new Set;return nt.forEach((t,i)=>e.add(i)),e}static async open(e){let{url:t,ioConfig:i,source:r,sourceJSON:a}=e,n=e.datasetFormat??i?.datasetFormat;n??(/(?:\.zarr|\/\.(?:zmetadata|zarray|zgroup))$/.test(t)?n="ZARR":t.includes(".")?n=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===r?.type?.toLowerCase()?n="CovJSON":r?.extent&&r.pixelblocks&&(n="MEMORY")),"OVR"===n||"TIF"===n||"DM"===n?n="TIFF":"JPG"===n||"JPEG"===n||"JFIF"===n?n="JPG":"COVJSON"===n&&(n="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");let s={url:t,source:r,sourceJSON:a,datasetFormat:n,ioConfig:i??{bandIds:null,sampling:null}};if(Object.keys(s).forEach(e=>{s[e]??delete s[e]}),n){if(!this.supportedFormats.has(n))throw new l.A("rasterfactory:open","not a supported format "+n);if("CRF"===n)throw new l.A("rasterfactory:open",`cannot open raster: ${t}`);let i=new(0,nt.get(n).constructor)(s);return i.rasterJobHandler=e.rasterJobHandler,i.rasterInfo=e.rasterInfo,await i.open({signal:e.signal}),i}let o=Array.from(nt.keys()).filter(e=>"CovJSON"!==e&&"Memory"!==e),u=0,f=()=>{if(n=o[u++],!n||"CRF"===n)return null;let t=new(0,nt.get(n).constructor)(s);return t.rasterJobHandler=e.rasterJobHandler,t.open({signal:e.signal}).then(()=>t).catch(()=>f())};return f()}static register(e,t,i){nt.has(e.toUpperCase())||nt.set(e.toUpperCase(),{desc:t,constructor:i})}}var lt=i(99235),ot=i(10873),ut=i(20437),ft=i(74797),ht=i(22796),ct=i(69409);const dt={instance:null,refCount:0,connectionPromise:null};async function pt(){if(dt.refCount++,dt.instance)return dt.instance;if(!dt.connectionPromise){let e=new ct.A;dt.connectionPromise=e.initialize().then(()=>{dt.instance=e})}return await dt.connectionPromise,dt.instance}function mt(){dt.refCount--,dt.refCount>0||(dt.instance?.destroy(),dt.instance=null,dt.connectionPromise=null,dt.refCount=0)}var gt=i(24212),yt=i(30291),wt=i(88625),vt=i(59923);let xt=class extends((0,A.dM)((0,O.j)((0,C.q)((0,_.A)((0,M.H)((0,S.d)((0,F.b)((0,R.G)((0,k.e)((0,I.b)((0,T.J)((0,f.M)((0,s.OU)(b.A)))))))))))))){constructor(e){super(e),this._primaryRasters=[],this.charts=null,this.graphicOrigin=new x(this),this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.fields=null,this.source=void 0,this._debouncedSaveOperations=(0,h.sg)(async(e,t,r)=>{let{save:a,saveAs:n}=await i.e(9838).then(()=>i(59838));switch(e){case 0:return a(this,t);case 1:return n(this,r,t)}})}load(e){let t=null==e?null:e.signal;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(h.QP).then(()=>this._openRaster(t))),Promise.resolve(this)}destroy(){super.destroy(),this._releaseWorkerHandle=(0,u.xt)(this._releaseWorkerHandle)}set elevationInfo(e){"relative-to-scene"!==e?.mode&&this._set("elevationInfo",e),this._validateElevationInfo(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){let e=[(0,ft.rZ)("Pixel Value"),(0,ft.dy)("Raw Pixel Value")],t=this.raster?.rasterInfo??this.serviceRasterInfo,i=t?.attributeTable;if(i){let t=(0,ft.jC)(i);e.push(...t)}let r=t?.dataType,a=t?.multidimensionalInfo;if(("vector-magdir"===r||"vector-uv"===r)&&null!=a){let t=a.variables[0].unit?.trim(),i=(0,ft.DV)(t),r=(0,ft.y6)();e.push(i,r)}if(a){let t=(0,ft.AL)(a);e.push(...t)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){let{rasterFields:t}=this,i=e?.visibleFieldNames??new Set(t.map(({name:e})=>e).filter(e=>e!==ft.F_.rawServicePixelValue)),r=(0,yt.tn)({fields:t,title:this.title},{...e,visibleFieldNames:i}),{rasterInfo:a}=this.raster;return r?.fieldInfos&&a&&(0,ft.h4)(r.fieldInfos,a),r}async generateRasterInfo(e,t){let i=(0,p.PZ)(ht.A,e);if(await this.load(),!i||"none"===i.functionName?.toLowerCase())return this.serviceRasterInfo;try{let{rasterInfo:e}=await this._openFunctionRaster(i,t);return e}catch(e){throw e instanceof l.A?e:new l.A("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}supportsExportMapTiles(){let e=this._primaryRasters[0]??this.raster,t="RasterTileServer"===e?.datasetFormat,i=!!this.sourceJSON?.exportTilesAllowed,r=this.sourceJSON?.datasetFormat?.toLowerCase(),a=!/\/tiledimageservices[^.]*\.arcgis\.com/i.test(this.url)&&"Raster"===e?.tileType&&("cache/jpegplus"===r||"cache/jpegpng"===r);return t&&i&&("Map"===e?.tileType||a)}supportsWrite(){let e=this._primaryRasters[0]??this.raster;return!!(this.loaded?"RasterTileServer"===e.datasetFormat&&("Raster"===e.tileType||"Map"===e.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))}write(e,t){return this.supportsWrite()?super.write(e,t):((0,vt.U4)(t,this),null)}async hasDataChanged(){try{let e=this._primaryRasters[0]??this.raster,{dataChanged:t,updates:i}=await e.refresh();return t&&(this.serviceRasterInfo!==e.rasterInfo&&this._set("serviceRasterInfo",e.rasterInfo),e.sourceJSON&&this.sourceJSON!==e.sourceJSON&&(this.sourceJSON=e.sourceJSON),i&&this.read(i,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0})),t}catch{return!1}}async _openRaster(e){let t=!1;if(this.raster)await this._openFromRaster(this.raster,e),t=(0,D.qg)(this.raster),!t&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{let{url:t,rasterFunction:i,source:r}=this;if(!t&&!r)throw new l.A("imagery-tile-layer:open","missing url or source parameter");r?await this._openFromSource(r,e):i?await this._openFromUrlWithRasterFunction(t,i,e):await this._openFromUrl(t,e)}let i=this.raster.rasterInfo;if(!i)throw new l.A("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",t?i:this._primaryRasters[0].rasterInfo),this._set("spatialReference",i.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){let e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||=this.raster.datasetName,"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles((0,c.wB)(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,t){e.rasterInfo||await e.open({signal:t}),this._primaryRasters=(0,D.pb)(e),this.url||=this._primaryRasters[0].url}async _openFromUrlWithRasterFunction(e,t,i){let r,a=[e];t&&(0,lt.UD)(t.toJSON(),a),a.some(e=>It(e,this.ioConfig))&&(r=await pt(),this._releaseWorkerHandle={remove:()=>mt()});let n=await Promise.all(a.map(e=>st.open({url:e,rasterInfo:1===a.length?this.serviceRasterInfo:void 0,sourceJSON:1===a.length?this.sourceJSON:void 0,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},rasterJobHandler:r,signal:i}))),s=n.findIndex(e=>null==e);if(s>-1)throw new l.A("imagery-tile-layer:open",`cannot open raster: ${a[s]}`);return this._primaryRasters=n,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){let i;It(e,this.ioConfig)&&(i=await pt(),this._releaseWorkerHandle={remove:()=>mt()});let r=await st.open({url:e,rasterInfo:this.serviceRasterInfo,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},rasterJobHandler:i,signal:t});if(null==r)throw new l.A("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[r],this.raster=r}async _openFromSource(e,t){let i="the tiled imagery data source is not supported",r="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!r)throw new l.A("imagery-tile-layer:open",i);"MEMORY"===r&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});let a=await st.open({url:"",source:e,datasetFormat:r,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==a)throw new l.A("imagery-tile-layer:open",i);this._primaryRasters=[a],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=a}async _openFunctionRaster(e,t){let i={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>i[e.url]=e);let r=(0,lt.vt)(e.functionDefinition?.toJSON()??e.toJSON(),i),a=new N.A({rasterFunction:r});return await a.open(t),a}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(e){e instanceof l.A&&o.A.getLogger(this).error("imagery-tile-layer:open",e.message),o.A.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(e){(0,gt.XF)(o.A.getLogger(this),(0,gt.$7)("ImageryTile layers","relative-to-scene",e)),(0,gt.XF)(o.A.getLogger(this),(0,gt.tW)("ImageryTile layers",e))}};(0,a.Cg)([(0,d.MZ)({clonable:!1})],xt.prototype,"_primaryRasters",void 0),(0,a.Cg)([(0,d.MZ)({clonable:!1})],xt.prototype,"_releaseWorkerHandle",void 0),(0,a.Cg)([(0,d.MZ)({json:{origins:{"web-scene":{write:!1}},write:!0}})],xt.prototype,"charts",void 0),(0,a.Cg)([(0,d.MZ)({type:wt.A,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],xt.prototype,"elevationInfo",null),(0,a.Cg)([(0,d.MZ)({type:Ie.A})],xt.prototype,"tileInfo",void 0),(0,a.Cg)([(0,d.MZ)({readOnly:!0,clonable:!1})],xt.prototype,"graphicOrigin",void 0),(0,a.Cg)([(0,d.MZ)(ot.fV)],xt.prototype,"legendEnabled",void 0),(0,a.Cg)([(0,d.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],xt.prototype,"isReference",void 0),(0,a.Cg)([(0,d.MZ)({type:["show","hide"]})],xt.prototype,"listMode",void 0),(0,a.Cg)([(0,d.MZ)({json:{read:!0,write:!0}})],xt.prototype,"blendMode",void 0),(0,a.Cg)([(0,d.MZ)({type:ht.A,json:{name:"renderingRule",write:!0}})],xt.prototype,"rasterFunction",void 0),(0,a.Cg)([(0,d.MZ)()],xt.prototype,"sourceJSON",void 0),(0,a.Cg)([(0,d.MZ)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],xt.prototype,"version",void 0),(0,a.Cg)([(0,d.MZ)({readOnly:!0,json:{read:!1}})],xt.prototype,"type",void 0),(0,a.Cg)([(0,d.MZ)({type:["ArcGISTiledImageServiceLayer"]})],xt.prototype,"operationalLayerType",void 0),(0,a.Cg)([(0,d.MZ)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,i){t[i]=!e}}}})],xt.prototype,"popupEnabled",void 0),(0,a.Cg)([(0,d.MZ)({type:n.A,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],xt.prototype,"popupTemplate",void 0),(0,a.Cg)([(0,d.MZ)({readOnly:!0})],xt.prototype,"defaultPopupTemplate",null),(0,a.Cg)([(0,d.MZ)(ot.PY)],xt.prototype,"screenSizePerspectiveEnabled",void 0),(0,a.Cg)([(0,d.MZ)({readOnly:!0,type:[ut.A]})],xt.prototype,"fields",void 0),(0,a.Cg)([(0,d.MZ)({readOnly:!0,type:[ut.A]})],xt.prototype,"rasterFields",null),(0,a.Cg)([(0,d.MZ)({constructOnly:!0})],xt.prototype,"source",void 0),xt=(0,a.Cg)([(0,d.$K)("esri.layers.ImageryTileLayer")],xt);const bt=xt;function It(e,t){let{tileGeneration:i}=t??{};return"immediate"===i||/\.(png|gif|bmp)$/i.test(e)}},18768(e,t,i){var r=i(32198),a=i(53966),n=i(91429),s=i(60694);i.d(t,["b",0,e=>{let t=e,i=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){let e=(0,s.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,s.Jf)(e,a.A.getLogger(this)))}};return(0,r.Cg)([(0,n.MZ)()],i.prototype,"title",null),(0,r.Cg)([(0,n.MZ)({type:String})],i.prototype,"url",null),i=(0,r.Cg)([(0,n.$K)("esri.layers.mixins.ArcGISService")],i),i}])},56551(e,t,i){i.d(t,{H:()=>c});var r=i(32198),a=i(91429),n=i(69540),s=i(25482),l=i(78888),o=i(94359),u=i(93223);let f=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.name=void 0,this.method="none",this.value=void 0,this.bandIds=void 0,this.renderer=void 0}};(0,r.Cg)([(0,a.MZ)({type:String,json:{write:{isRequired:!0}}})],f.prototype,"name",void 0),(0,r.Cg)([(0,a.MZ)({type:["raster-function-template","variable","none"],json:{write:{isRequired:!0}}}),(0,u.e)({rasterFunctionTemplate:"raster-function-template",variable:"variable",none:"none"})],f.prototype,"method",void 0),(0,r.Cg)([(0,a.MZ)({type:String,json:{write:{isRequired:!0}}})],f.prototype,"value",void 0),(0,r.Cg)([(0,a.MZ)({type:[l.jz],json:{write:{isRequired:!0}}})],f.prototype,"bandIds",void 0),(0,r.Cg)([(0,a.MZ)({types:o.uy,json:{write:!0,origins:{"web-scene":{types:o.Gj,write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],f.prototype,"renderer",void 0),f=(0,r.Cg)([(0,a.$K)("esri.renderers.support.RasterPresetRenderer")],f);const h=f,c=e=>{let t=e,i=class extends t{constructor(){super(...arguments),this.activePresetRendererName=null,this.presetRenderers=null}};return(0,r.Cg)([(0,a.MZ)({type:String,json:{name:"layerDefinition.activePresetRendererName",write:{allowNull:!0}}})],i.prototype,"activePresetRendererName",void 0),(0,r.Cg)([(0,a.MZ)({type:[h],json:{name:"layerDefinition.presetRenderers",write:!0}})],i.prototype,"presetRenderers",void 0),i=(0,r.Cg)([(0,a.$K)("esri.layers.mixins.RasterPresetRendererMixin")],i),i}},43163(e,t,i){i.d(t,{A:()=>p});var r,a=i(32198),n=i(91429),s=i(5443),l=i(86738),o=i(10333),u=i(36005),f=i(43937),h=i(93223);function c(e,t,i){let{x:r,y:a}=t;if(i<2)return{x:e[0]+r*e[2]+a*e[4],y:e[1]+r*e[3]+a*e[5]};if(2===i){let t=r*r,i=a*a,n=r*a;return{x:e[0]+r*e[2]+a*e[4]+t*e[6]+n*e[8]+i*e[10],y:e[1]+r*e[3]+a*e[5]+t*e[7]+n*e[9]+i*e[11]}}let n=r*r,s=a*a,l=r*a,o=n*r,u=n*a,f=r*s,h=a*s;return{x:e[0]+r*e[2]+a*e[4]+n*e[6]+l*e[8]+s*e[10]+o*e[12]+u*e[14]+f*e[16]+h*e[18],y:e[1]+r*e[3]+a*e[5]+n*e[7]+l*e[9]+s*e[11]+o*e[13]+u*e[15]+f*e[17]+h*e[19]}}function d(e,t,i){let{xmin:r,ymin:a,xmax:n,ymax:l,spatialReference:o}=t,u=[];if(i<2)u.push({x:r,y:l}),u.push({x:n,y:l}),u.push({x:r,y:a}),u.push({x:n,y:a});else{let e=10;for(let t=0;t<e;t++)u.push({x:r,y:a+(l-a)*t/(e-1)}),u.push({x:n,y:a+(l-a)*t/(e-1)});e=8;for(let t=1;t<=e;t++)u.push({x:r+(n-r)*t/e,y:a}),u.push({x:r+(n-r)*t/e,y:l})}u=u.map(t=>c(e,t,i));let f=u.map(e=>e.x),h=u.map(e=>e.y);return new s.A({xmin:Math.min.apply(null,f),xmax:Math.max.apply(null,f),ymin:Math.min.apply(null,h),ymax:Math.max.apply(null,h),spatialReference:o})}let p=r=class extends o.A{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(e,t){let{coeffX:i,coeffY:r}=t;if(!i?.length||!r?.length||i.length!==r.length)return null;let a=[];for(let e=0;e<i.length;e++)a.push(i[e]),a.push(r[e]);return a}writeForwardCoefficients(e,t,i){let r=[],a=[];for(let t=0;t<e?.length;t++)t%2==0?r.push(e[t]):a.push(e[t]);t.coeffX=r,t.coeffY=a}get inverseCoefficients(){let e=this._get("inverseCoefficients"),t=this._get("forwardCoefficients");return!e&&t&&this.polynomialOrder<2&&(e=function(e){let[t,i,r,a,n,s]=e,l=r*s-n*a,o=n*a-r*s;return[(n*i-t*s)/l,(r*i-t*a)/o,s/l,a/o,-n/l,-r/o]}(t)),e}set inverseCoefficients(e){this._set("inverseCoefficients",e)}readInverseCoefficients(e,t){let{inverseCoeffX:i,inverseCoeffY:r}=t;if(!i?.length||!r?.length||i.length!==r.length)return null;let a=[];for(let e=0;e<i.length;e++)a.push(i[e]),a.push(r[e]);return a}writeInverseCoefficients(e,t,i){let r=[],a=[];for(let t=0;t<e?.length;t++)t%2==0?r.push(e[t]):a.push(e[t]);t.inverseCoeffX=r,t.inverseCoeffY=a}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(e){if("point"===e.type){let t=c(this.forwardCoefficients,e,this.polynomialOrder);return new l.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return d(this.forwardCoefficients,e,this.polynomialOrder)}inverseTransform(e){if("point"===e.type){let t=c(this.inverseCoefficients,e,this.polynomialOrder);return new l.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return d(this.inverseCoefficients,e,this.polynomialOrder)}clone(){return new r({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};(0,a.Cg)([(0,n.MZ)({json:{write:!0}})],p.prototype,"polynomialOrder",void 0),(0,a.Cg)([(0,n.MZ)()],p.prototype,"forwardCoefficients",void 0),(0,a.Cg)([(0,u.w)("forwardCoefficients",["coeffX","coeffY"])],p.prototype,"readForwardCoefficients",null),(0,a.Cg)([(0,f.K)("forwardCoefficients")],p.prototype,"writeForwardCoefficients",null),(0,a.Cg)([(0,n.MZ)({json:{write:!0}})],p.prototype,"inverseCoefficients",null),(0,a.Cg)([(0,u.w)("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],p.prototype,"readInverseCoefficients",null),(0,a.Cg)([(0,f.K)("inverseCoefficients")],p.prototype,"writeInverseCoefficients",null),(0,a.Cg)([(0,n.MZ)()],p.prototype,"affectsPixelSize",null),(0,a.Cg)([(0,h.e)({PolynomialXform:"polynomial"})],p.prototype,"type",void 0),p=r=(0,a.Cg)([(0,n.$K)("esri.layers.raster.transforms.PolynomialTransform")],p)},25943(e,t,i){i.d(t,{d:()=>I});var r,a=i(32198),n=i(56507),s=i(69622),l=i(49186),o=i(36563),u=(i(44208),i(66344)),f=i(15142),h=i(17676),c=i(36708),d=i(76030),p=i(84952),m=i(91429),g=i(72802),y=i(4718),w=i(69397);class v{constructor(e){!function(e){if(!e?.location)throw new l.A("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new l.A("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new l.A("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new l.A("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new l.A("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}(e);let{location:t,data:i}=e;this.location=Object.freeze((0,y.o8)(t));let r=this.location.width,a=this.location.height,n=!0,s=!0,o=function(e,t=!1){return e<=1024?t?Array(e).fill(0):Array(e):new Uint32Array(e)}(Math.ceil(r*a/32)),u=0;for(let e=0;e<i.length;e++){let t=e%32;i[e]?(s=!1,o[u]|=1<<t):n=!1,31===t&&++u}s?(this._availability="unavailable",this.byteSize=40):n?(this._availability="available",this.byteSize=40):(this._availability=o,this.byteSize=40+(0,w.Qf)(o))}getAvailability(e,t){if("unavailable"===this._availability||"available"===this._availability)return this._availability;let i=(e-this.location.top)*this.location.width+(t-this.location.left),r=i%32,a=i>>5,n=this._availability;return a<0||a>n.length?"unknown":n[a]&1<<r?"available":"unavailable"}static fromDefinition(e,t){let i=e.service.request||n.A,{row:r,col:a,width:s,height:o}=e,u={query:{f:"json"}};return t=t?{...u,...t}:u,i(function(e){let t;if(e.service.tileServers?.length){let i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;let i=e.service.query;return i&&(t=`${t}?${i}`),t}(e),t).then(e=>e.data).catch(e=>{if(422===e?.details?.httpStatus)return{location:{top:r,left:a,width:s,height:o},valid:!0,data:Array(s*o).fill(0)};throw e}).then(e=>{if(e.location&&(e.location.top!==r||e.location.left!==a||e.location.width!==s||e.location.height!==o))throw new l.A("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:r,left:a,width:s,height:o}});return v.fromJSON(e)})}static fromJSON(e){return Object.freeze(new v(e))}}function x(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function b(e,t,i){return new l.A("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})}let I=class extends s.A{static{r=this}constructor(e){super(e),this._pendingTilemapRequests={},this.request=n.A,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new u.q(2097152),this.addHandles((0,c.wB)(()=>{let{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),c.Vh))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,i){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return"unavailable";let r=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return r?r.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,r){return!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD?Promise.reject(b(e,t,i)):this._fetchTilemap(e,t,i,r).catch(e=>e).then(r=>{if(r instanceof v){let a=r.getAvailability(t,i);if("unavailable"===a)throw b(e,t,i);return a}if((0,h.zf)(r))throw r;return"unknown"})}fetchAvailabilityUpsample(e,t,i,r,a){r.level=e,r.row=t,r.col=i;let n=this.layer.tileInfo;n.updateTileInfo(r);let s=this.fetchAvailability(e,t,i,a).catch(e=>{if((0,h.zf)(e))throw e;if(n.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,a);throw e});return this._fetchAvailabilityUpsamplePrefetch(e,t,i,a,s),s}async _fetchAvailabilityUpsamplePrefetch(e,t,i,a,n){if(!this._prefetchingEnabled)return;let s=`prefetch-${e}-${t}-${i}`;if(this.hasHandles(s))return;let l=new AbortController;n.then(()=>l.abort(),()=>l.abort());let u=!1,f=(0,o.hA)(()=>{u||(u=!0,l.abort())});if(this.addHandles(f,s),await(0,d.md)(10,l.signal).catch(()=>{}),u||(u=!0,this.removeHandles(s)),(0,h.G4)(l))return;let c=new g.U(e,t,i),p={...a,signal:l.signal},m=this.layer.tileInfo;for(let e=0;r._prefetches.length<r._maxPrefetch&&m.upsampleTile(c);++e){let e=this.fetchAvailability(c.level,c.row,c.col,p);r._prefetches.push(e);let t=()=>{r._prefetches.removeUnordered(e)};e.then(t,t)}}static{this._maxPrefetch=4}static{this._prefetches=new f.A({initialSize:r._maxPrefetch})}static cleanupTilemapCache(){this._prefetches.prune()}_fetchTilemap(e,t,i,r){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return Promise.reject(new l.A("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));let a=this._tmpTilemapDefinition,n=this._tilemapFromCache(e,t,i,a);if(n)return Promise.resolve(n);let s=r?.signal;return r={...r,signal:null},new Promise((e,t)=>{(0,h.u7)(s,()=>t((0,h.NK)()));let i=x(a),n=this._pendingTilemapRequests[i];if(!n){n=v.fromDefinition(a,r).then(e=>(this._tilemapCache.put(i,e,e.byteSize),e));let e=()=>{delete this._pendingTilemapRequests[i]};this._pendingTilemapRequests[i]=n,n.then(e,e)}n.then(e,t)})}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;let{parsedUrl:e,apiKey:t,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:(0,p.x0)({...e.query,...i,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,r){r.level=e,r.row=t-t%this.size,r.col=i-i%this.size;let a=x(r);return this._tilemapCache.get(a)}get test(){}};(0,a.Cg)([(0,m.MZ)({constructOnly:!0})],I.prototype,"layer",void 0),(0,a.Cg)([(0,m.MZ)({constructOnly:!0})],I.prototype,"minLOD",void 0),(0,a.Cg)([(0,m.MZ)({constructOnly:!0})],I.prototype,"maxLOD",void 0),(0,a.Cg)([(0,m.MZ)({constructOnly:!0})],I.prototype,"request",void 0),(0,a.Cg)([(0,m.MZ)({constructOnly:!0})],I.prototype,"size",void 0),I=r=(0,a.Cg)([(0,m.$K)("esri.layers.support.TilemapCache")],I)},82371(e,t,i){i.d(t,{E9:()=>p,Tw:()=>c,X6:()=>d});var r=i(56507),a=i(5443),n=i(86738),s=i(16930),l=i(87186),o=i(20223),u=i(2272),f=i(22671);async function h(e,t,i){let h=(0,u.Dl)(e),{rasterFunction:c,sourceJSON:d}=t||{},p=c?JSON.stringify(c.rasterFunctionDefinition||c):null,m=(0,u.lF)({...h.query,renderingRule:p,f:"json"}),g=(0,u.jV)(m,i);e=h.path;let y=d||await(0,r.A)(e,g).then(e=>e.data),{currentVersion:w}=y,v=y.hasRasterAttributeTable?(0,r.A)(`${e}/rasterAttributeTable`,g):null,x=y.hasColormap?(0,r.A)(`${e}/colormap`,g):null,b=y.hasHistograms?(0,r.A)(`${e}/histograms`,g):null,I=w>=10.3?(0,r.A)(`${e}/keyProperties`,g):null,A=y.hasMultidimensions?(0,r.A)(`${e}/multidimensionalInfo`,g):null,S=(c?w>=10.91:w>=10.81)?(0,r.A)(`${e}/statistics`,g):null,C=await Promise.allSettled([v,x,b,I,A,S]),_=a.A.fromJSON(y.extent),R=Math.ceil(_.width/y.pixelSizeX-.1),M=Math.ceil(_.height/y.pixelSizeY-.1),T=s.A.fromJSON(y.spatialReference||y.extent.spatialReference),O="fulfilled"===C[0].status?C[0].value?.data:null,k=O?.features?.length?f.A.fromJSON(O):null,F="fulfilled"===C[1].status?C[1].value?.data.colormap:null,D=F?.length?F:null,N="fulfilled"===C[2].status?C[2].value?.data.histograms:null,P=N?.[0]?.counts?.length?N:null,z="fulfilled"===C[3].status?C[3].value?.data??{}:{},L="fulfilled"===C[4].status?C[4].value?.data.multidimensionalInfo:null,E=L?.variables?.length?L:null;var B;(B=E)&&B.variables.forEach(e=>{e.statistics?.length&&e.statistics.forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),e.dimensions?.forEach(e=>{"StdTime"===e.name&&!e.recurring&&!e.unit&&(e.unit="ISO8601")})});let $=function(e,t){let i=null;t&&t.length===e.bandCount&&(i=t.map(e=>{let t=e.covariances?.trim(),i=t?t.split(",").map(Number):void 0;return{avg:e.mean,count:e.count,max:e.max,median:e.median,min:e.min,mode:e.mode,stddev:e.standardDeviation,sum:e.sum,covariances:i}}));let r=e.minValues?.length===e.bandCount?e.minValues.map((t,i)=>({min:t,max:e.maxValues[i],avg:e.meanValues[i],stddev:e.stdvValues[i]})):null;return null==r||null==i||i.some((e,t)=>e.min!==r[t]?.min||e.max!==r[t]?.max||e.avg!==r[t]?.avg||e.stddev!==r[t]?.stddev)?r:i}(y,"fulfilled"===C[5].status?C[5].value?.data.statistics:null),{defaultVariable:J,serviceDataType:U}=y;J&&J!==z.DefaultVariable&&(z.DefaultVariable=J),U?.includes("esriImageServiceDataTypeVector")&&!U.includes(z.DataType)&&(z.DataType=U.replace("esriImageServiceDataType",""));let H=y.noDataValue;y.noDataValues?.length&&y.noDataValues.some(e=>e!==H)&&(H=y.noDataValues);let j=y.transposeInfo?new o.A({blockWidth:256,blockHeight:256,pyramidBlockWidth:256,pyramidBlockHeight:256,pyramidScalingFactor:2,compression:"lerc",origin:new n.A({x:y.extent.xmin,y:y.extent.ymax,spatialReference:T}),firstPyramidLevel:1,maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(R,M))/Math.LN2-8)),transposeInfo:y.transposeInfo}):void 0;return new l.A({width:R,height:M,bandCount:y.bandCount,extent:a.A.fromJSON(y.extent),spatialReference:T,pixelSize:new n.A({x:y.pixelSizeX,y:y.pixelSizeY,spatialReference:T}),pixelType:y.pixelType.toLowerCase(),statistics:$,attributeTable:k,colormap:D,histograms:P,keyProperties:z,noDataValue:H,multidimensionalInfo:E,storageInfo:j})}function c(e,t,i){return h(e,{sourceJSON:t},i)}function d(e,t,i){return h(e,{rasterFunction:t},i)}function p(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}},2272(e,t,i){i.d(t,{Dl:()=>u,gf:()=>h,jV:()=>o,lF:()=>f});var r=i(92602),a=i(70333),n=i(4718),s=i(84952),l=i(926);function o(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function u(e){return"string"==typeof e?(0,s.An)(e):(0,n.o8)(e)}function f(e,t,i){let r={};for(let a in e){if("declaredClass"===a)continue;let n=e[a];if(null!=n&&"function"!=typeof n)if(Array.isArray(n))r[a]=n.map(e=>f(e));else if("object"==typeof n)if(n.toJSON){let e=n.toJSON(i?.[a]);r[a]=t?e:JSON.stringify(e)}else r[a]=t?n:JSON.stringify(n);else r[a]=n}return r}async function h(e,t,n){return function(e,t){return e?t&&(0,l.Qc)(e)?t:(0,l.getApiKey)(e)??a.id?.findCredential(e)?.token:null}(e,t)||(!a.id&&r.A.request.useIdentity&&await Promise.all([i.e(8673),i.e(7956),i.e(4189)]).then(()=>i(98232)),(await a.id.getCredential(e,n))?.token)}},24212(e,t,i){i.d(t,{$7:()=>o,B:()=>l,M7:()=>h,XF:()=>f,tW:()=>u,w7:()=>s});var r=i(56512),a=i(86211),n=i(16271);function s(e,t){return function(e,t){return t?.mode?t.mode:function(e){return e?c:d}(e).mode}(null==e||(e.hasZ??!1),t)}function l(e,t,i){return i&&i.mode!==t?`${e} only support ${t} elevation mode`:null}function o(e,t,i){return i?.mode===t?`${e} do not support ${t} elevation mode`:null}function u(e,t){return null!=t?.featureExpressionInfo&&"0"!==t.featureExpressionInfo.expression?`${e} do not support featureExpressionInfo`:null}function f(e,t){t&&e.warn(".elevationInfo=",t)}function h(e){return(e?.offset??0)*(0,n.Ao)(e?.unit)}(0,r.B)((e,t,i)=>{if(!e||"decimal-degrees"===t)return 0;let r="unknown"!==t&&t?t:"meters",n=(0,a.mq)(i);return n?(0,a.oU)(e,r,n):0});const c={mode:"absolute-height",offset:0},d={mode:"on-the-ground",offset:null}}}]);
@@ -94,7 +94,6 @@ $include_UnitSelect: $include_widgets !default;
94
94
  $include_UtilityNetworkAssociationList: $include_widgets !default;
95
95
  $include_UtilityNetworkAssociations: $include_widgets !default;
96
96
  $include_UtilityNetworkTrace: $include_widgets !default;
97
- $include_UtilityNetworkValidateTopology: $include_widgets !default;
98
97
  $include_ValuePicker: $include_widgets !default;
99
98
  $include_Weather: $include_widgets !default;
100
99
  $include_Zoom: $include_widgets !default;
@@ -204,7 +203,6 @@ $calcite-fonts-path: "../base/fonts/fonts/" !default;
204
203
  @import "widgets/UtilityNetworkAssociationList";
205
204
  @import "widgets/UtilityNetworkAssociations";
206
205
  @import "widgets/UtilityNetworkTrace";
207
- @import "widgets/UtilityNetworkValidateTopology";
208
206
  @import "widgets/ValuePicker";
209
207
  @import "widgets/Weather";
210
208
  @import "widgets/Zoom";