@arcgis/core 5.1.0-next.77 → 5.1.0-next.78

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 (210) hide show
  1. package/analysis/ElevationProfile/ElevationProfileGroup.d.ts +74 -0
  2. package/analysis/ElevationProfile/ElevationProfileGroup.js +2 -0
  3. package/analysis/ElevationProfileAnalysis.d.ts +29 -14
  4. package/analysis/ElevationProfileAnalysis.js +1 -1
  5. package/applications/Components/OrientedImageryViewer/ImageViewer/utils.d.ts +34 -0
  6. package/applications/Components/OrientedImageryViewer/ImageViewer/utils.js +2 -0
  7. package/assets/esri/core/workers/RemoteClient.js +1 -1
  8. package/assets/esri/core/workers/chunks/{537fe2522dff1e6ce03b.js → 11ea4be441a26134ce1f.js} +1 -1
  9. package/assets/esri/core/workers/chunks/17acbf40e7c1cb42d9bd.js +1 -0
  10. package/assets/esri/core/workers/chunks/1c7fd0a229a8112b0539.js +596 -0
  11. package/assets/esri/core/workers/chunks/{baeb96aef03d4c566af7.js → 1f53620f82cc7c3daabe.js} +1 -1
  12. package/assets/esri/core/workers/chunks/2387613b855771a3e537.js +1 -0
  13. package/assets/esri/core/workers/chunks/283d39dfb1625b5a74db.js +1 -0
  14. package/assets/esri/core/workers/chunks/{5e1b847b116d21908a54.js → 322c54081b25f1c53661.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{330b47ac0759c3c35cc5.js → 34fe97bcacc0dfc5bce6.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{14eb2cc8e2ad6d8d03fd.js → 3d9fcbe95dd22dbe730e.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{e262c4864dc06c43b380.js → 3df8493b91aa3bce824d.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{bf8f603848bad4a7deb4.js → 4ccb56333de0247dcb6f.js} +1 -1
  19. package/assets/esri/core/workers/chunks/5b6f2bfdcdd207d8ae42.js +1 -0
  20. package/assets/esri/core/workers/chunks/{88b480a1d1fb01778798.js → 5ee4b630ad39c21d11db.js} +21 -26
  21. package/assets/esri/core/workers/chunks/{6b66fc32451433129a88.js → 8508f238d99021e87f71.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{bc75ab48f4c7609ef09d.js → 85d3475667c503ec4fc6.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{9d6491f996eeb0c646ed.js → 85d8c7cc7f8decbe975d.js} +1 -1
  24. package/assets/esri/core/workers/chunks/9b9916864b6575c42c8a.js +1 -0
  25. package/assets/esri/core/workers/chunks/{75d5ea0da181f9e7425f.js → a8ca5d8740cc7e39197b.js} +6 -6
  26. package/assets/esri/core/workers/chunks/{8d75f6f27c1c17c33992.js → b7bb7072dbee978f3ca3.js} +1 -1
  27. package/assets/esri/core/workers/chunks/bf7e019437a3b6036300.js +2 -0
  28. package/assets/esri/core/workers/chunks/{99c161fecae710b53b40.js → d304343a781acfa3ff96.js} +1 -1
  29. package/assets/esri/core/workers/chunks/dbb9bb28696ff9536678.js +2 -0
  30. package/assets/esri/core/workers/chunks/{34ea3ed78041437a8fc8.js → f81c6f6ccc201f584970.js} +1 -1
  31. package/assets/esri/themes/base/_core.scss +2 -0
  32. package/assets/esri/themes/base/widgets/_PluginSettingsControls.scss +29 -0
  33. package/assets/esri/themes/dark/main.css +1 -1
  34. package/assets/esri/themes/light/main.css +1 -1
  35. package/assets/esri/themes/light/view.css +1 -1
  36. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
  37. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
  38. package/assets/esri/widgets/Sketch/t9n/Sketch.json +1 -1
  39. package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
  40. package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
  41. package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
  42. package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
  43. package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
  44. package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
  45. package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
  46. package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
  47. package/assets/esri/widgets/Sketch/t9n/Sketch_en.json +1 -1
  48. package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
  49. package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
  50. package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
  51. package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
  52. package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
  53. package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
  54. package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
  55. package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
  56. package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
  57. package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
  58. package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
  59. package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
  60. package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
  61. package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
  62. package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
  63. package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
  64. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
  65. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
  66. package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
  67. package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
  68. package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
  69. package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
  70. package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
  71. package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
  72. package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
  73. package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
  74. package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
  75. package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
  76. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
  77. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
  78. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
  79. package/config.js +1 -1
  80. package/core/types.d.ts +28 -0
  81. package/form/elements/inputs/MultipleChoiceInput.d.ts +2 -2
  82. package/form/elements/inputs/MultipleChoiceInput.js +1 -1
  83. package/geometry/operators/types.d.ts +2 -2
  84. package/interfaces.d.ts +4 -7
  85. package/kernel.js +1 -1
  86. package/layers/ImageryLayer.d.ts +7 -1
  87. package/layers/ImageryLayer.js +1 -1
  88. package/layers/ImageryTileLayer.d.ts +7 -1
  89. package/layers/ImageryTileLayer.js +1 -1
  90. package/layers/WCSLayer.d.ts +7 -1
  91. package/layers/WCSLayer.js +1 -1
  92. package/layers/save/imageryUtils.js +1 -1
  93. package/layers/video/VideoController.js +1 -1
  94. package/networks/UnitIdentifierManager.d.ts +15 -15
  95. package/networks/UnitIdentifierManager.js +1 -1
  96. package/networks/support/jsonTypes.d.ts +125 -13
  97. package/package.json +3 -3
  98. package/popup/Features.d.ts +0 -1
  99. package/popup/Features.js +1 -1
  100. package/rest/networks/unitIdentifiers/reserve.js +2 -0
  101. package/rest/networks/unitIdentifiers/support/ReserveParameters.js +2 -0
  102. package/rest/networks/unitIdentifiers/support/ResizeParameters.js +1 -1
  103. package/rest/networks/unitIdentifiers/support/UnitQueryResult.js +1 -1
  104. package/support/revision.js +1 -1
  105. package/views/2d/analysis/ElevationProfile/ElevationProfileVisualization2D.js +1 -1
  106. package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +5 -1
  107. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  108. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  109. package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
  110. package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
  111. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  112. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
  113. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  114. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ShaderHittest.js +1 -1
  115. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
  116. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  117. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  118. package/views/2d/layers/BaseLayerView2D.d.ts +3 -3
  119. package/views/2d/layers/BaseLayerViewGL2D.d.ts +3 -3
  120. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  121. package/views/2d/layers/TileLayerView2D.js +1 -1
  122. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  123. package/views/2d/layers/features/FeatureContainer.js +1 -1
  124. package/views/2d/support/clippingUtils.js +1 -1
  125. package/views/2d/support/hitTestUtils.js +1 -1
  126. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
  127. package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +5 -1
  128. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  129. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  130. package/views/3d/layers/IntegratedMeshNormals.js +1 -1
  131. package/views/3d/terrain/ElevationData.js +1 -1
  132. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  133. package/views/3d/webgl-engine/collections/Component/Renderable.js +1 -1
  134. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +1 -5
  135. package/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js +1 -5
  136. package/views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js +16 -21
  137. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  138. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  139. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  140. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  141. package/views/3d/webgl-engine/shaders/BlackLevelLightSoftCompression.glsl.js +5 -1
  142. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +2 -2
  143. package/views/VideoView.js +1 -1
  144. package/views/View2D.js +1 -1
  145. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  146. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  147. package/views/analysis/ElevationProfile/ElevationProfileIndicatorPointVisualization.js +1 -1
  148. package/views/analysis/ElevationProfile/ElevationProfileResult.d.ts +6 -4
  149. package/views/draw/DrawTool.js +1 -1
  150. package/views/draw/plugins/BezierSegmentPlugin.js +1 -1
  151. package/views/draw/plugins/FreehandSegmentPlugin.js +1 -1
  152. package/views/draw/support/PluginContext.js +1 -1
  153. package/views/draw/support/types.d.ts +21 -0
  154. package/views/draw/support/types.js +1 -1
  155. package/views/types.d.ts +2 -2
  156. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  157. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  158. package/widgets/Daylight/DaylightViewModel.js +1 -1
  159. package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
  160. package/widgets/Editor/components/Settings.js +1 -1
  161. package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
  162. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  163. package/widgets/ElevationProfile/support/ElevationProfileView.js +1 -1
  164. package/widgets/ElevationProfile/support/ElevationProfileView2D.js +1 -1
  165. package/widgets/ElevationProfile/support/ElevationProfileView3D.js +1 -1
  166. package/widgets/ElevationProfile/support/InputRepresentation2D.js +1 -1
  167. package/widgets/ElevationProfile/support/InputRepresentation3D.js +1 -1
  168. package/widgets/ElevationProfile/support/ProfileLine2D.js +1 -1
  169. package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
  170. package/widgets/FeatureForm/FieldInput.js +1 -1
  171. package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.js +1 -1
  172. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  173. package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.d.ts +5 -5
  174. package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
  175. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  176. package/widgets/OrientedImageryViewer/constants.js +1 -1
  177. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  178. package/widgets/OrientedImageryViewer/services/SuperimposeService.js +2 -0
  179. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +2 -0
  180. package/widgets/OrientedImageryViewer/types.d.ts +10 -0
  181. package/widgets/OrientedImageryViewer.d.ts +17 -2
  182. package/widgets/OrientedImageryViewer.js +1 -1
  183. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  184. package/widgets/Sketch/SketchViewModel.js +1 -1
  185. package/widgets/Sketch/support/PluginManager.js +1 -1
  186. package/widgets/Sketch/support/SettingsManager.js +2 -0
  187. package/widgets/Sketch.js +1 -1
  188. package/widgets/Slider/SliderViewModel.d.ts +2 -1
  189. package/widgets/Slider/SliderViewModel.js +1 -1
  190. package/widgets/Slider.js +1 -1
  191. package/widgets/smartMapping/ColorSlider/ColorSliderViewModel.js +1 -1
  192. package/widgets/smartMapping/OpacitySlider/OpacitySliderViewModel.js +1 -1
  193. package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.js +1 -1
  194. package/widgets/smartMapping/SmartMappingSliderViewModel.js +1 -1
  195. package/widgets/support/PluginSettingsControls.js +2 -0
  196. package/widgets/support/SnappingControls.js +1 -1
  197. package/widgets/support/forms/formUtils.js +1 -1
  198. package/analysis/ElevationProfile/elevationProfileLineTypes.js +0 -2
  199. package/assets/esri/core/workers/chunks/003476e950bd27a2f884.js +0 -596
  200. package/assets/esri/core/workers/chunks/07aca5ecad659d55e795.js +0 -2
  201. package/assets/esri/core/workers/chunks/7540f7df86620f067b5a.js +0 -1
  202. package/assets/esri/core/workers/chunks/76e34f81bb4a7b0e694c.js +0 -1
  203. package/assets/esri/core/workers/chunks/bfe575da727ce7c8d331.js +0 -2
  204. package/assets/esri/core/workers/chunks/cb45e5d4a4ef82cda583.js +0 -1
  205. package/assets/esri/core/workers/chunks/ea59b81299acaf0d85ee.js +0 -1
  206. package/assets/esri/core/workers/chunks/ef0eae13408cbf83a64f.js +0 -1
  207. package/rest/networks/unitIdentifiers/insertGap.js +0 -2
  208. package/rest/networks/unitIdentifiers/support/InsertGapParameters.js +0 -2
  209. /package/assets/esri/core/workers/chunks/{07aca5ecad659d55e795.js.LICENSE.txt → bf7e019437a3b6036300.js.LICENSE.txt} +0 -0
  210. /package/assets/esri/core/workers/chunks/{bfe575da727ce7c8d331.js.LICENSE.txt → dbb9bb28696ff9536678.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3661],{56512(e,t,n){function i(e){let t,n,i=[],s=!1;return function(...r){return s&&t===this&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(e[n]!==t[n])return!1;return!0}(r,i)||(n=e.apply(this,r),t=this,i=r,s=!0),n}}n.d(t,{B:()=>i})},159(e,t,n){n.d(t,{A:()=>u});var i,s=n(5482),r=n(69540),o=n(25482),a=n(91429),l=n(99157);let u=i=class extends((0,r.OU)(o.o)){constructor(e){super(e),this.steps=[]}getInverse(){const e=new i;for(let t=this.steps.length-1;t>=0;t--){const n=this.steps[t];e.steps.push(n.getInverse())}return e}};(0,s.Cg)([(0,a.MZ)({type:[l.A],nonNullable:!0,json:{name:"geoTransforms"}})],u.prototype,"steps",void 0),u=i=(0,s.Cg)([(0,a.$K)("esri.geometry.operators.support.GeographicTransformation")],u)},99157(e,t,n){n.d(t,{A:()=>l});var i,s=n(5482),r=n(69540),o=n(25482),a=n(91429);let l=i=class extends((0,r.OU)(o.o)){constructor(e){super(e),this.isInverse=!1,this.wkt=null,this.wkid=null}getInverse(){return new i({isInverse:!this.isInverse,wkid:this.wkid,wkt:this.wkt})}};(0,s.Cg)([(0,a.MZ)({json:{name:"transformForward",read:e=>!e,write:(e,t,n)=>{t[n]=!e}}})],l.prototype,"isInverse",void 0),(0,s.Cg)([(0,a.MZ)({json:{write:!0}})],l.prototype,"wkt",void 0),(0,s.Cg)([(0,a.MZ)({json:{write:!0}})],l.prototype,"wkid",void 0),l=i=(0,s.Cg)([(0,a.$K)("esri.geometry.operators.support.GeographicTransformationStep")],l)},9762(e,t,n){n.r(t),n.d(t,{projectBuffer:()=>s});var i=n(49208);function s(e,t,n,s,r,o,a=Math.floor(e.length/3)){const l=(0,i.jd)(t,r);if(null==l)return!1;if(l===i.pO){if(e===s&&n===o)return!0;const t=n+3*a;for(let i=n,r=o;i<t;i++,r++)s[r]=e[i]??0;return!0}const u=n+3*a;for(let t=n,i=o;t<u;t+=3,i+=3)l(e,t,s,i);return!0}},49208(e,t,n){n.d(t,{Tp:()=>p,jd:()=>c,pO:()=>f,w5:()=>u});var i=n(34727),s=n(86211),r=n(73941),o=n(79258),a=n(34403),l=n(21325);const u={2:{5:f,7:null,9:null,10:f,1:b,6:null,8:null,0:null,3:m,11:g,2:f,4:M},5:{5:f,7:null,9:null,10:f,1:b,6:null,8:null,0:null,3:m,11:g,2:f,4:M},7:{5:null,7:f,9:null,10:f,1:null,6:x,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:f,10:f,1:null,6:null,8:w,0:null,3:null,11:null,2:null,4:null},3:{5:h,7:null,9:null,10:h,1:function(e,t,n,i){const s=e[t]/O,r=P-2*Math.atan(Math.exp(-e[t+1]/O)),o=O+(e[t+2]??0),a=Math.cos(r)*o;n[i]=Math.cos(s)*a,n[i+1]=Math.sin(s)*a,n[i+2]=Math.sin(r)*o},6:null,8:null,0:null,3:f,11:function(e,t,n,i){h(e,t,n,i),g(n,i,n,i)},2:h,4:function(e,t,n,i){h(e,t,n,i),M(n,i,n,i)}},4:{5:R,7:null,9:null,10:R,1:function(e,t,n,i){R(e,t,n,i),b(n,i,n,i)},6:null,8:null,0:null,3:function(e,t,n,i){R(e,t,n,i),m(n,i,n,i)},11:function(e,t,n,i){R(e,t,n,i),g(n,i,n,i)},2:R,4:f},1:{5:A,7:null,9:null,10:A,1:f,6:null,8:null,0:null,3:function(e,t,n,i){A(e,t,n,i),m(n,i,n,i)},11:function(e,t,n,i){A(e,t,n,i),g(n,i,n,i)},2:A,4:function(e,t,n,i){A(e,t,n,i),M(n,i,n,i)}},6:{5:null,7:S,9:null,10:S,1:null,6:f,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:I,10:I,1:null,6:null,8:f,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:f,3:null,11:null,2:null,4:null},10:{5:f,7:f,9:f,10:f,1:b,6:x,8:w,0:null,3:m,11:g,2:f,4:M},11:{5:v,7:null,9:null,10:v,1:function(e,t,n,i){v(e,t,n,i),b(n,i,n,i)},6:null,8:null,0:null,3:function(e,t,n,i){v(e,t,n,i),m(n,i,n,i)},11:f,2:v,4:function(e,t,n,i){v(e,t,n,i),M(n,i,n,i)}}};function c(e,t){return p(e,t)?.projector}function p(e,t){if(null==e||null==t)return null;if(T.source.spatialReference===e&&T.dest.spatialReference===t)return T;const n=d(e,T.source),i=d(t,T.dest);return 0===n&&0===i?(0,l.aI)(e,t)?T.projector=f:T.projector=null:T.projector=u[n][i],T}function d(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,s.GA)(e,1)),(0,r.jA)(e)?t.spatialReferenceId=1:(0,l.oT)(e)?t.spatialReferenceId=2:(0,l.K8)(e)?t.spatialReferenceId=3:(0,l.r1)(e)?t.spatialReferenceId=11:e.wkt===r.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===r.FY.wkt?t.spatialReferenceId=6:e.wkt===r.LJ.wkt?t.spatialReferenceId=8:(0,r.q8)(e)?t.spatialReferenceId=7:(0,r.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function f(e,t,n,i){e!==n&&(n[i++]=e[t++],n[i++]=e[t++],n[i]=e[t]??0)}function h(e,t,n,i){n[i]=L*(e[t]/O),n[i+1]=L*(P-2*Math.atan(Math.exp(-e[t+1]/O))),n[i+2]=e[t+2]??0}function m(e,t,n,s){!function(e,t,n,s,r){const o=.4999999*Math.PI,a=(0,i.qE)(D*e[t+1],-o,o),l=Math.sin(a);n[s++]=D*e[t]*r.radius,n[s++]=r.halfSemiMajorAxis*Math.log((1+l)/(1-l)),n[s]=e[t+2]??0}(e,t,n,s,o.$O)}function g(e,t,n,i){n[i]=e[t]*N,n[i+1]=e[t+1]*N,n[i+2]=e[t+2]??0}function v(e,t,n,i){n[i]=e[t]*V,n[i+1]=e[t+1]*V,n[i+2]=e[t+2]??0}function y(e,t,n,i,s){const r=s+(e[t+2]??0),o=D*e[t],a=D*e[t+1],l=Math.cos(a)*r;n[i]=Math.cos(o)*l,n[i+1]=Math.sin(o)*l,n[i+2]=Math.sin(a)*r}function w(e,t,n,i){y(e,t,n,i,o.Sw.radius)}function x(e,t,n,i){y(e,t,n,i,o.sH.radius)}function b(e,t,n,i){y(e,t,n,i,o.$O.radius)}function C(e,t,n,s,r){const o=e[t],a=e[t+1],l=e[t+2]??0,u=Math.sqrt(o*o+a*a+l*l),c=(0,i.YN)(l/(0===u?1:u)),p=Math.atan2(a,o);n[s++]=L*p,n[s++]=L*c,n[s]=u-r}function I(e,t,n,i){C(e,t,n,i,o.Sw.radius)}function S(e,t,n,i){C(e,t,n,i,o.sH.radius)}function A(e,t,n,i){C(e,t,n,i,o.$O.radius)}function M(e,t,n,i){!function(e,t,n,i,s){const r=D*e[t],o=D*e[t+1],a=e[t+2]??0,l=Math.sin(o),u=Math.cos(o),c=s.radius/Math.sqrt(1-s.eccentricitySquared*l*l);n[i++]=(c+a)*u*Math.cos(r),n[i++]=(c+a)*u*Math.sin(r),n[i++]=(c*(1-s.eccentricitySquared)+a)*l}(e,t,n,i,o.$O)}function R(e,t,n,i){const s=a.TP,r=e[t],l=e[t+1],u=e[t+2]??0;let c,p,d,f,h,m,g,v,y,w,x,b,C,I,S,A,M,R,T,D,P;c=Math.abs(u),p=r*r+l*l,d=Math.sqrt(p),f=p+u*u,h=Math.sqrt(f),D=Math.atan2(l,r),m=u*u/f,g=p/f,I=s.a2/h,S=s.a3-s.a4/h,g>.3?(v=c/h*(1+g*(s.a1+I+m*S)/h),T=Math.asin(v),w=v*v,y=Math.sqrt(1-w)):(y=d/h*(1-m*(s.a5-I-g*S)/h),T=Math.acos(y),w=1-y*y,v=Math.sqrt(w)),x=1-o.$O.eccentricitySquared*w,b=o.$O.radius/Math.sqrt(x),C=s.a6*b,I=d-b*y,S=c-C*v,M=y*I+v*S,A=y*S-v*I,R=A/(C/x+M),T+=R,P=M+A*R/2,u<0&&(T=-T),n[i++]=L*D,n[i++]=L*T,n[i]=P}const T={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:f},D=(0,i.kU)(1),L=(0,i.KJ)(1),P=.5*Math.PI,O=o.$O.radius,N=O*Math.PI/180,V=180/(O*Math.PI)},91218(e,t,n){n.r(t),n.d(t,{canProjectWithoutEngine:()=>B,initializeProjection:()=>U,isEqualBaseGCS:()=>q,isLoaded:()=>O,isLoadedOrLoad:()=>N,isLoadedOrLoadFor:()=>V,load:()=>$,project:()=>E,projectAsync:()=>W,projectExtent:()=>se,projectMany:()=>k,projectMultipoint:()=>Y,projectOrLoad:()=>Z,projectOrLoadMany:()=>F,projectPoint:()=>K,projectPolygon:()=>ne,projectPolyline:()=>ee,projectWithoutEngine:()=>H,requiresLoad:()=>j,test:()=>z,tryProject:()=>G,unload:()=>X});var i=n(49186),s=n(17676),r=n(62788),o=n(95488),a=n(51850),l=n(21276),u=n(73941),c=n(5443),p=n(91075),d=n(48526),f=n(86738),h=n(39829),m=n(82799),g=n(16930),v=n(98764),y=n(159),w=n(9762),x=n(49208);function b(e,t,n,i,s,r){return C[0]=e,C[1]=t,C[2]=n,(0,w.projectBuffer)(C,i,0,s,r,0)}const C=(0,a.vt)();var I=n(60408),S=n(21325),A=n(52006);let M=null,R=null,T=null,D=null,L={};const P=new o.I;function O(){return!!(R?.isLoaded()&&T?.isLoaded()&&D?.isLoaded())}function N(){return!!O()||((0,r.gc)(P),$(),!1)}function V(e,t){return!e||!t||B(e,t)||N()}function j(e,t){return!B(e,t)&&!O()}async function $(e){null==M&&(M=Promise.all([n.e(3276).then(n.bind(n,83276)).then(e=>(R=e,R.load())),n.e(8377).then(n.bind(n,8377)).then(e=>(T=e,T.load())),n.e(2158).then(n.bind(n,12158)).then(e=>(D=e,D.load()))])),await M,(0,s.Te)(e),P.notify()}function E(e,t,n){return Array.isArray(e)?0===e.length?[]:((0,l.H)(e),k(e,e[0].spatialReference,t,n)):((0,l.f)(e),k([e],e.spatialReference,t,n)[0])}function k(e,t,n,i){if(null==t||null==n)return e;if(B(t,n,i))return e.map(e=>H(e,t,n));if(null==i?.geographicTransformation&&(0,u.jA)(t))return k(e.map(e=>H(e,t,g.A.WGS84)),g.A.WGS84,n,{zConversionDisabled:i?.zConversionDisabled});if(null==i?.geographicTransformation&&(0,u.jA)(n))return k(e,t,g.A.WGS84).map(e=>H(e,g.A.WGS84,n));if(!O())throw new _;if(!i?.geographicTransformation)if(i?.extendedParams)i={...i,geographicTransformation:D.getTransformation(t,n,i.areaOfInterestExtent)||new y.A};else if(!i?.areaOfInterestExtent){const e=function(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}(t,n);let s=L[e];s||(s=D.getTransformation(t,n)||new y.A,L[e]=s),i={geographicTransformation:s,zConversionDisabled:i?.zConversionDisabled}}return e[0].spatialReference||(e[0].spatialReference=t),e[0]instanceof p.A?R.executeMany(e,n,i):T.executeMany(e,n,i)}function G(e,t,n){try{return E(e,t,n)}catch(e){return null}}function Z(e,t){const n=F([e],t);return null!=n.pending?{pending:n.pending,geometry:null}:null!=n.geometries?{pending:null,geometry:n.geometries[0]}:{pending:null,geometry:null}}function F(e,t,n){if(!O())for(const n of e)if(null!=n&&!(0,S.aI)(n.spatialReference,t)&&(0,S.fn)(n.spatialReference)&&(0,S.fn)(t)&&!B(n.spatialReference,t))return(0,r.gc)(P),{pending:$(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,S.aI)(e.spatialReference,t)?e:(0,S.fn)(e.spatialReference)&&(0,S.fn)(t)?E(e,t,n):null)}}class _ extends i.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function X(){M=null,R=null,T=null,D=null,L={}}const z={get loadPromise(){return M}};async function W(e,t,n){if((0,s.Te)(n),!e)return e;const i=F(Array.isArray(e)?e:[e],t,n);if(i.pending)return await i.pending,(0,s.Te)(n),W(e,t,n);const r=i.geometries??[];return Array.isArray(e)?r:r[0]}function B(e,t,n){return!(n?.areaOfInterestExtent||n?.extendedParams||n?.geographicTransformation)&&(!!(0,S.aI)(e,t)||(0,S.fn)(e)&&(0,S.fn)(t)&&!!(0,x.jd)(e,t))}function q(e,t){if((0,S.aI)(e,t))return!0;if(!(0,S.fn)(e)||!(0,S.fn)(t))return!1;const n=(0,S.oT)(e)||(0,S.K8)(e)||(0,S.x1)(e),i=(0,S.oT)(t)||(0,S.K8)(t)||(0,S.x1)(t);return n&&i}async function U(e,t,n,i){if(O())return(0,s.NO)(i);if(Array.isArray(e)){for(const{source:t,dest:n,options:s}of e)if(t&&n&&!B(t,n,s))return $(i)}else if(e&&t&&!B(e,t,n))return $(i);return(0,s.NO)(i)}function H(e,t,n){return e?(0,I.fT)(e)?J(e,t,new f.A,n,0):(0,I.ZC)(e)?re(e,t,new c.A,n,0):(0,I.Bi)(e)?ie(e,t,new h.A,n,0):(0,I.Rg)(e)?te(e,t,new m.A,n,0):(0,I.U9)(e)?Q(e,t,new d.A,n,0):null:null}function K(e,t,n=t.spatialReference,i=0){return null!=n&&null!=e.spatialReference&&null!=J(e,e.spatialReference,t,n,i)}function J(e,t,n,i,s){ue[0]=e.x,ue[1]=e.y;const r=e.z;return ue[2]=void 0!==r?r:s,(0,w.projectBuffer)(ue,t,0,ue,i,0)?(n.x=ue[0],n.y=ue[1],n.spatialReference=i,void 0!==r||(0,u.xP)(i)?(n.z=ue[2],n.hasZ=!0):(n.z=void 0,n.hasZ=!1),void 0===e.m?(n.m=void 0,n.hasM=!1):(n.m=e.m,n.hasM=!0),n):null}function Y(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=Q(e,e.spatialReference,t,n,i)}function Q(e,t,n,i,s){const{points:r,hasZ:o,hasM:a}=e,l=[],u=r.length,c=[];for(const e of r)c.push(e[0],e[1],o?e[2]:s);if(!(0,w.projectBuffer)(c,t,0,c,i,0,u))return null;const p=le(o,i);for(let e=0;e<u;++e){const t=3*e,n=c[t],i=c[t+1];p&&a?l.push([n,i,c[t+2],r[e][3]]):p?l.push([n,i,c[t+2]]):a?l.push([n,i,r[e][2]]):l.push([n,i])}return n.points=l,n.spatialReference=i,n.hasZ=o,n.hasM=a,n}function ee(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=te(e,e.spatialReference,t,n,i)}function te(e,t,n,i,s){const{curvePaths:r,paths:o,hasZ:a,hasM:l}=e;if(!(r?ae(r,a??!1,l??!1,t,n.curvePaths=[],i,s):oe(o,a??!1,l??!1,t,n.paths,i,s)))return null;const u=le(a,i);return n.spatialReference=i,n.hasZ=u,n.hasM=l,n}function ne(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=ie(e,e.spatialReference,t,n,i)}function ie(e,t,n,i,s){const{curveRings:r,rings:o,hasZ:a,hasM:l}=e;return(r?ae(r,a??!1,l??!1,t,n.curveRings=[],i,s):oe(o,a??!1,l??!1,t,n.rings,i,s))?(n.spatialReference=i,n.hasZ=le(a,i),n.hasM=l,n):null}function se(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=re(e,e.spatialReference,t,n,i)}function re(e,t,n,i,s){const{xmin:r,ymin:o,xmax:a,ymax:l,hasZ:u,hasM:c}=e;if(!b(r,o,u?e.zmin:s,t,ue,i))return null;const p=le(u,i);return n.xmin=ue[0],n.ymin=ue[1],p&&(n.zmin=ue[2]),b(a,l,u?e.zmax:s,t,ue,i)?(n.xmax=ue[0],n.ymax=ue[1],p&&(n.zmax=ue[2]),c&&(n.mmin=e.mmin,n.mmax=e.mmax),n.spatialReference=i,n):null}function oe(e,t,n,i,s,r,o=0){const a=new Array;for(const n of e)for(const e of n)a.push(e[0],e[1],t?e[2]:o);if(!(0,w.projectBuffer)(a,i,0,a,r,0))return!1;let l=0;s.length=0;const u=t?3:2,c=le(t,r);for(const t of e){const e=new Array;for(const i of t){const t=a.slice(l,l+=3);c||t.pop(),n&&t.push(i[u]),e.push(t)}s.push(e)}return!0}function ae(e,t,n,i,s,r,o=0){const a=new Array;for(const n of e)for(const e of n){if((0,A.FG)(e))return!1;if((0,A.aO)(e)){const[n,i]=e.c;a.push(n[0],n[1],t?n[2]:o,i[0],i[1],o);continue}if((0,A.n1)(e)){const[n,i,s]=e.b;a.push(n[0],n[1],t?n[2]:o,i[0],i[1],o,s[0],s[1],o);continue}const n=e;a.push(n[0],n[1],t?n[2]:o)}if(!(0,w.projectBuffer)(a,i,0,a,r,0))return!1;let l=0;s.length=0;const u=t?3:2,c=le(t,r);for(const t of e){const e=new Array;for(const i of t){const t=a.slice(l,l+=3);if(c||t.pop(),n&&t.push((0,A.yP)(i)[u]),(0,A.FG)(i))return!1;if((0,A.aO)(i)){const n=a[l++],i=a[l++];++l,e.push({c:[t,[n,i]]});continue}if((0,A.n1)(i)){const n=a[l++],i=a[l++];++l;const s=a[l++],r=a[l++];++l,e.push({b:[t,[n,i],[s,r]]});continue}e.push(t)}s.push(e)}return!0}function le(e,t){return e||(0,u.xP)(t)||(0,S.aI)(t,v.Y0)}const ue=(0,a.vt)()},98764(e,t,n){n.d(t,{GD:()=>o,Y0:()=>u,lO:()=>c});var i=n(73941),s=n(16930),r=n(21325);const o=new s.A(i.fv),a=new s.A(i.FY),l=new s.A(i.LJ),u=new s.A(i.Ro);function c(e){const t=p.get(e);if(t)return t;let n=o;if(e)if(e===a)n=a;else if(e===l)n=l;else{const t=e.wkid,i=e.latestWkid;if(null!=t||null!=i)(0,r.tl)(t)||(0,r.tl)(i)?n=a:((0,r.ZL)(t)||(0,r.ZL)(i))&&(n=l);else{const t=e.wkt2??e.wkt;if(t){const e=t.toUpperCase();e===d?n=a:e===f&&(n=l)}}}return p.set(e,n),n}const p=new Map,d=a.wkt.toUpperCase(),f=l.wkt.toUpperCase()},34403(e,t,n){n.d(t,{TP:()=>o});var i=n(79258);Math.PI;const s=i.$O.radius,r=i.$O.eccentricitySquared,o={a1:s*r,a2:s*r*s*r,a3:s*r*r/2,a4:s*r*s*r*2.5,a5:s*r+s*r*r/2,a6:1-r};i.$O.radius,i.$O.flattening,i.Sw.radius,i.Sw.flattening,i.sH.radius,i.sH.flattening,i.sH.radius},20521(e,t,n){n.r(t),n.d(t,{default:()=>Ae});var i=n(5482),s=n(37838),r=n(69540),o=n(49186),a=n(25728),l=n(17676),u=n(36708),c=n(91429),p=n(60950),d=n(89808),f=n(99959);const h=Symbol("isWCSGraphicOrigin");var m;class g extends f.A{get[(m=h,p.ym)](){return this.layer}get[d.Q](){return this.layer}constructor(e){super(),this[m]=!0,this.type="wcs",this.layer=e}get id(){return this.layer.id}}var v=n(4146),y=n(63074),w=n(69208),x=n(34287),b=n(8303),C=n(72545),I=n(54310),S=n(25036),A=n(82935),M=n(82806),R=n(53966),T=n(5443),D=n(38458),L=n(11254),P=n(330);function O(e){return e.endsWith("?")?e.slice(0,-1):e}function N(e){return e.filter(({coverageSubType:e})=>null==e||""===e||/^rectified(grid|dataset)/i.test(e))}function V(e){const t={};for(let n=0;n<e.childNodes.length;n++){const i=e.childNodes[n];if(1!==i.nodeType)continue;const s=(0,P.vv)(i).toLowerCase();switch(s){case"title":case"abstract":t[s]=(0,P.mX)(i);break;case"identifier":t.id=(0,P.mX)(i);break;case"wgs84boundingbox":{const e=(0,P.pN)(i,"LowerCorner"),n=(0,P.pN)(i,"UpperCorner");t.lonLatEnvelope=new T.A({xmin:e[0],ymin:e[1],xmax:n[0],ymax:n[1],spatialReference:{wkid:4326}})}break;case"coveragesummary":t.coverageSummaries=t.coverageSummaries||[],t.coverageSummaries.push(V(i))}}return t}function j(e,t){if(e.coverageSummaries)for(let n=0;n<e.coverageSummaries.length;n++)e.coverageSummaries[n].abstract=e.coverageSummaries[n].abstract||e.abstract,e.coverageSummaries[n].lonLatEnvelope=e.coverageSummaries[n].lonLatEnvelope||e.lonLatEnvelope,e.coverageSummaries[n].title=e.coverageSummaries[n].title||e.title,j(e.coverageSummaries[n],t);null!=e.id&&t.push(e)}function $(e){const t=(0,P.V6)(e.querySelector("Operation[name=GetCapabilities]"),"Get")?.getAttribute("xlink:href")||"",n=(0,P.V6)(e.querySelector("Operation[name=DescribeCoverage]"),"Get")?.getAttribute("xlink:href")||"",i=(0,P.V6)(e.querySelector("Operation[name=GetCoverage]"),"Get")?.getAttribute("xlink:href")||"";return{getCapabilities:O(t),describeCoverage:O(n),getCoverage:O(i)}}function E(e,t=null){let n=null;n="string"==typeof e?(new DOMParser).parseFromString(e,"text/xml"):e;let i=n.documentElement.getAttribute("version");"1.0"===i?i="1.0.0":"1.1"===i&&(i="1.1.0");const s=i||t||"1.0.0",r=s.slice(0,3);let a;if("2.0"===r)a=function(e){const t=(0,P.V6)(e,"ServiceIdentification"),n=(0,P.mX)(t,"Title"),i=(0,P.Dy)(t,"ServiceTypeVersion"),s=(0,P.Dy)(t,"Profile"),r=$((0,P.V6)(e,"OperationsMetadata")),o=(0,P.IC)(e,"Contents/CoverageSummary"),a=[];for(let e=0;e<o.length;e++){const t=o[e],n=(0,P.mX)(t,"CoverageId"),i=(0,P.V6)(t,"WGS84BoundingBox");let s;if(i){const e=(0,P.pN)(i,"LowerCorner"),t=(0,P.pN)(i,"UpperCorner");s=new T.A({xmin:e[0],ymin:e[1],xmax:t[0],ymax:t[1],spatialReference:{wkid:4326}})}const r=(0,P.mX)(t,"CoverageSubtype")||"RectifiedGridCoverage";a.push({id:n,lonLatEnvelope:s,coverageSubType:r})}const l=(0,P.V6)(e,"ServiceMetadata");return{name:n,supportedVersions:i,supportedFormats:(0,P.Dy)(l,"formatSupported"),supportedInterpolations:(0,P.Dy)(l,"interpolationSupported").concat((0,P.Dy)(l,"InterpolationSupported")),onlineResources:r,profiles:s,coverages:a,gridCoverages:N(a),version:"2.0.1"}}(n);else if("1.1"===r)a=function(e){const t=(0,P.mX)(e,"ServiceIdentification/Title"),n=(0,P.Dy)(e,"ServiceIdentification/ServiceTypeVersion"),i=$((0,P.V6)(e,"OperationsMetadata")),s=[],r=(0,P.V6)(e,"Contents");for(let e=0;e<r.childNodes.length;e++){const t=r.childNodes[e];1===t.nodeType&&(0,P.g7)(t,"CoverageSummary")&&j(V(t),s)}const o=(0,P.Dy)(r,"SupportedFormat");return{name:t,onlineResources:i,coverages:s,gridCoverages:N(s),supportedVersions:n,supportedFormats:o,version:"1.1.0"}}(n);else{if("1.0"!==r)throw new o.A("wcsraster:parsecapabilities","the capabilities version is not supported");a=function(e){const t=(0,P.mX)(e,"Service/name"),n=(0,P.V6)(e,"Capability"),i=(0,P.V6)(n,"GetCapabilities/Get/OnlineResource")?.getAttribute("xlink:href")??"",s=(0,P.V6)(n,"DescribeCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",r=(0,P.V6)(n,"GetCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",o={getCapabilities:O(i),describeCoverage:O(s),getCoverage:O(r)},a=(0,P.IC)(e,"CoverageOfferingBrief"),l=[];for(let e=0;e<a.length;e++){const t=a[e],n=(0,P.mX)(t,"name"),i=(0,P.IC)(t,"pos"),s=(0,P.pN)(i[0]),r=(0,P.pN)(i[1]),o=new T.A({xmin:s[0],ymin:s[1],xmax:r[0],ymax:r[1],spatialReference:{wkid:4326}});l.push({id:n,lonLatEnvelope:o})}return{name:t,onlineResources:o,coverages:l,gridCoverages:N(l),supportedVersions:["1.0.0"],version:"1.0.0"}}(n)}return a.version=s,a}var k=n(39829),G=n(4366),Z=n(87186);function F(e){e.variables.forEach(e=>e.dimensions.forEach(e=>e.values??=(0,G.Xg)(e)))}function _(e){return{requestResponseCRSs:(0,P.Dy)(e,"requestResponseCRSs").map(e=>e.split(":")[1]),nativeCRSs:(0,P.Dy)(e,"nativeCRSs").map(e=>e.split(":")[1])}}function X(e,t){const n=(0,P.Dy)(e,"1.0.0"===t?"interpolationMethod":"InterpolationMethod"),i="1.0.0"===t?e.getAttribute("default"):(0,P.mX)(e,"InterpolationMethods/Default");return null!=i?[i].concat(n.filter(e=>e.toLowerCase()!==i.toLowerCase())):n}function z(e){return null==e?["nearest"]:e.map(e=>{const t=e.toLowerCase();return t.includes("nearest")?"nearest":t.includes("linear")?"bilinear":t.includes("cubic")?"cubic":null}).filter(e=>!!e)}function W(e){const t=(0,P.IC)(e,"pos"),n=(0,P.pN)(t[0]),i=(0,P.pN)(t[1]);return new T.A({xmin:n[0],ymin:n[1],xmax:i[0],ymax:i[1],spatialReference:{wkid:4326}})}function B(e,t){const n=(0,P.Dy)(e,t);return n?.length&&""!==n[0]&&!isNaN(Number(n[0]))?n.map(e=>Number(e)):null}function q(e){const t=(0,P.pN)(e,"MinimumValue"),n=(0,P.pN)(e,"MaximumValue");return t.length&&n.length?t.map((e,t)=>({min:e,max:n[t],avg:-1,stddev:-1})):null}function U(e){return null==e?null:e.every(t=>t===e[0])?e[0]:e}function H(e){const t=[],n=(0,P.IC)(e,"RangeSet");let i=[];for(let e=0;e<n.length;e++){const s=(0,P.mX)(n[e],"name"),r=(0,P.mX)(n[e],"label"),o=[],a=B(n[e],"nullValues/singleValue"),l=(0,P.IC)(n[e],"AxisDescription");for(let e=0;e<l.length;e++){const t=(0,P.mX)(l[e],"name"),n=(0,P.mX)(l[e],"label"),s=(0,P.Dy)(l[e],"singleValue");if(0===s.length){const t=(0,P.mX)(l[e],"min"),n=(0,P.mX)(l[e],"max"),i=Number((0,P.mX)(l[e],"res"))||1;if(null!==t&&null!==n)for(let e=parseInt(t,10);e<=parseInt(n,10);e+=i)s.push(e.toString())}"band"===t.toLowerCase()&&(i=s),o.push({name:t,label:n,values:s})}t.push({name:s,label:r,nullValues:a,axis:o})}return{rangeSet:t,bandNames:i}}function K(e=null){if(!e)return{resolution:null,units:null};let t=e.toUpperCase();const n=["Years","Months","Days","Hours","Minutes","Seconds"];let i,s,r;return t.includes("PT")?(t=t.slice(2),r=["H","M","S"].findIndex(e=>t.includes(e)),i=n[3+r],s=parseFloat(t.slice(0,-1))):(t=t.slice(1),r=["Y","M","D"].findIndex(e=>t.includes(e)),r>-1&&(i=n[r]),s=parseFloat(t.slice(0,-1))),{resolution:s,units:i}}function J(e){const t=(0,P.IC)(e,"timeposition");if(t.length>0){const e=[];for(let n=0;n<t.length;n++)e.push(new Date((0,P.mX)(t[n])));return{begin:e[0],end:e[e.length-1],values:e}}const n=(0,P.V6)(e,"timePeriod")||(0,P.V6)(e,"TimePeriod");return n?{begin:new Date((0,P.mX)(n,"beginPosition")||(0,P.mX)(n,"BeginPosition")),end:new Date((0,P.mX)(n,"endPosition")||(0,P.mX)(n,"EndPosition")),...K((0,P.mX)(n,"timeResolution")||(0,P.mX)(n,"TimeResolution"))}:null}function Y(e){const t=(0,P.V6)(e,"spatialDomain"),n=(0,P.V6)(t,"Envelope")||(0,P.V6)(t,"EnvelopeWithTimePeriod"),i=n.getAttribute("srsName").split(":"),s=i[i.length-1],r=(0,P.IC)(n,"pos"),o=(0,P.pN)(r[0]),a=(0,P.pN)(r[1]),l=parseInt(s,10),u=isNaN(l)?null:{wkid:l},c=new T.A({xmin:o[0],ymin:o[1],xmax:a[0],ymax:a[1],spatialReference:u}),p=(0,P.V6)(t,"RectifiedGrid"),d=(0,P.mX)(p,"low").split(" "),f=(0,P.mX)(p,"high").split(" "),h=parseInt(f[0],10)-parseInt(d[0],10)+1,m=parseInt(f[1],10)-parseInt(d[1],10)+1,g=(0,P.pN)(t,"origin/pos"),v=(0,P.IC)(t,"offsetVector"),y={envelope:c,columns:h,rows:m,offset:{x:parseFloat((0,P.mX)(v[0]).split(" ")[0]),y:parseFloat((0,P.mX)(v[1]).split(" ")[1])},origin:{x:g[0],y:g[1]}},w=(0,P.V6)(e,"temporalDomain")||(0,P.V6)(e,"TemporalDomain");return{spatialDomain:y,temporalDomain:w?J(w):null}}function Q(e,t){const n=[],i=(0,P.IC)(e,"Field");let s,r=[];for(let e=0;e<i.length;e++){const o=(0,P.mX)(i[e],"Identifier"),a=(0,P.mX)(i[e],"Description"),l=(0,P.mX)(i[e],"Definition"),u=(0,P.mX)(i[e],"Abstract"),c=(0,P.mX)(i[e],"Title"),p=B(i[e],"NullValue"),d=(0,P.V6)(i[e],"AllowedValues"),f=d?q(d):null,h=X(i[e],"1.1.0"),m=[],g=(0,P.IC)(i[e],"Axis");for(let e=0;e<g.length;e++){const n=g[e].getAttribute("identifier"),i=(0,P.mX)(g[e],"UOM"),o=(0,P.mX)(g[e],"DataType"),a=(0,P.Dy)(g[e],"Key");t&&!n.toLowerCase().includes("band")||(r=a,s=p),m.push({identifier:n,uom:i,dataType:o,values:a,bandNoDataValues:s})}n.push({identifier:o,description:a,definition:l,abstract:u,title:c,supportedInterpolations:h,axis:m,nullValues:p,statistics:f})}return{rangeSet:n,bandNames:r,bandNoDataValues:s,statistics:n[0].statistics}}function ee(e){const t=(0,P.V6)(e,"SpatialDomain"),n=(0,P.V6)(t,"GridCRS"),i=(0,P.mX)(n,"GridBaseCRS"),s=(0,P.mX)(n,"GridOrigin"),r=s?.split(" ").map(e=>parseFloat(e))??[0,0],o=(0,P.pN)(n,"GridOffsets"),a=(0,P.IC)(t,"BoundingBox");let l,u,c,p;for(let e=0;e<a.length;e++){const t=a[e].getAttribute("crs")?.toLowerCase();if(null!=t)if(t.includes("imagecrs")){const t=(0,P.pN)(a[e],"LowerCorner"),n=(0,P.pN)(a[e],"UpperCorner");l=n[0]-t[0]+1,u=n[1]-t[1]+1}else if(t.indexOf("epsg")>0){const n=t.split(":");c=parseInt(n[n.length-1],10);const i=(0,P.pN)(a[e],"LowerCorner"),s=(0,P.pN)(a[e],"UpperCorner");p=new T.A({xmin:i[0],ymin:i[1],xmax:s[0],ymax:s[1],spatialReference:{wkid:c}})}}const d=l>u,f=p.xmax-p.xmin>p.ymax-p.ymin;let h=!1;(0,D.m)(c)&&(d===f?h=!1:(h=!0,p=new T.A({xmin:p.ymin,ymin:p.xmin,xmax:p.ymax,ymax:p.xmax,spatialReference:{wkid:c}})));const m={columns:l,rows:u,origin:{x:r[0],y:r[1]},offset:{x:o[0],y:o[o.length-1]},gridBaseCRS:i,envelope:p,useEPSGAxis:h},g=(0,P.V6)(e,"temporalDomain")||(0,P.V6)(e,"TemporalDomain");return{spatialDomain:m,temporalDomain:g?J(g):null}}function te(e){const t=(0,P.V6)(e,"Envelope")||(0,P.V6)(e,"EnvelopeWithTimePeriod"),n=t.getAttribute("srsName"),i=n.slice(n.lastIndexOf("/")+1),s=t.getAttribute("axisLabels").split(" ").map(e=>e.trim()).filter(e=>""!==e.trim()),r=(0,P.pN)(t,"lowerCorner"),o=(0,P.pN)(t,"upperCorner"),a=!["y","lat","latitude","north","nor","n","b"].includes(s[0].toLowerCase());let l;const u=parseInt(i,10),c=isNaN(u)?null:{wkid:u};l=new T.A(a?{xmin:r[0],ymin:r[1],xmax:o[0],ymax:o[1],spatialReference:c}:{xmin:r[1],ymin:r[0],xmax:o[1],ymax:o[0],spatialReference:c});const p={mins:r,maxs:o},d=t.getAttribute("uomLabels").trim().split(" ");let f,h;if((0,P.g7)(t,"EnvelopeWithTimePeriod")){f=new Date((0,P.mX)(e,"beginPosition")||(0,P.mX)(e,"BeginPosition")),h=new Date((0,P.mX)(e,"endPosition")||(0,P.mX)(e,"EndPosition"));const t=d?.findIndex(e=>"oledatetime"===e?.toLowerCase());t>-1&&(d[t]="ISO8601")}return{envelope:l,axisLabels:s,uomLabels:d.length?d:null,envelopeAllDims:p,beginPosition:f,endPosition:h,isEastFirst:a}}function ne(e,t){const n=[],i=(0,P.IC)(e,"DataRecord"),s=[];let r,o=[];for(let e=0;e<i.length;e++){const a=(0,P.IC)(i[e],"field"),l=[];for(let e=0;e<a.length;e++){const n=a[e].getAttribute("name"),i=(0,P.mX)(a[e],"description")||"",u=(0,P.V6)(a[e],"uom")?.getAttribute("code")||"",c=(0,P.pN)(a[e],"interval"),p=B(a[e],"nilValue")?.[0];t&&!n.toLowerCase().includes("band")||(s.push(n),c?.length&&(r=r||[],r.push({min:c[0],max:c[1],avg:-1,stddev:-1})),o.push(p)),l.push({name:n,description:i,uom:u,allowedValues:c,nilValue:p})}n.push(l)}return o.some(e=>null!=e)||(o=null),{rangeType:n,bandNames:s,bandStats:r,bandNoDataValues:o}}function ie(e){let t=1,n="";const i=.01;return Math.abs(e-1/24)<1/24*i?n="Hours":Math.abs(e-1)<1*i?n="Days":e<1?(t=Math.round(24*e),n="Hours"):e>28-i&&e<31+i||Math.round(e/30)<12?n="Months":e>365-i&&e<366+i&&(n="Years"),{interval:t,intervalUnit:n}}function se(e,t){const n=(0,P.V6)(e,"RectifiedGrid"),i=(0,P.pN)(n,"low"),s=(0,P.pN)(n,"high"),r=[];for(let e=0;e<i.length;e++)r.push(s[e]-i[e]+1);const o=(0,P.mX)(n,"axisLabels").split(" "),a=(0,P.pN)(n,"origin/pos"),l=(0,P.IC)(n,"offsetVector"),u=[];for(let e=0;e<l.length;e++){const t=(0,P.pN)(l[e]),n=t.findIndex(e=>0!==e);u[n]=t[n]}let c,p,d,f=!1;return t?.length&&o?.length&&(f=[...t].sort((e,t)=>e<t?-1:1).join(",")===[...o].sort((e,t)=>e<t?-1:1).join(",")),["y","lat","latitude","north","nor","n","b"].includes((f?o:t)[0].toLowerCase())?(c=r[1],p=r[0],d={y:Math.abs(u[0]),x:Math.abs(u[1])}):(c=r[0],p=r[1],d={x:Math.abs(u[0]),y:Math.abs(u[1])}),{columns:c,rows:p,origin:a,offset:u,resolution:d,gridSamples:r,axisLabels:o,hasSameAxisLabelsAsBoundedBy:f}}function re(e){const t=(0,P.V6)(e,"EarthObservation");if(!t)return null;const n=(0,P.V6)(t,"phenomenonTime"),i=n?J(n):null,s=(0,P.V6)(t,"phenomenonTime"),r=s?J(s):null,o=(0,P.mX)(t,"featureOfInterest/Footprint/multiExtentOf/MultiSurface/surfaceMembers/Polygon/exterior/LinearRing/posList");let a=null;if(o){const e=o.split(" ").map(e=>e.trim()).filter(e=>null!=e&&""!==e).map(Number);if(e.length){const t=[];for(let n=0;n<e.length/2;n+=2)t.push(e[n],e[n+1]);a=new k.A({rings:[[t]]})}}return{observation:{phenomenonTime:i,resultTime:r,footprint:a,identifier:(0,P.mX)(e,"metaDataProperty/EarthObservationMetaData/identifier"),acquisitionType:(0,P.mX)(e,"metaDataProperty/EarthObservationMetaData/acquisitionType"),status:(0,P.mX)(e,"metaDataProperty/EarthObservationMetaData/status")}}}async function oe(e,t){const{coverageIds:n,version:i,customParameters:s,signal:r}=t,a=i.slice(0,3),u="1.0"===a?"coverage":"1.1"===a?"identifiers":"coverageId",c={service:"WCS",request:"DescribeCoverage",version:i,[u]:n.join(","),...s};try{const{data:t}=await(0,L.A)(e,{query:c,responseType:"xml",signal:r});return function(e,t){let n=null;if(n="string"==typeof e?(new DOMParser).parseFromString(e,"text/xml"):e,"1.0.0"===t)return(0,P.IC)(n,"CoverageOffering").map(e=>function(e){const t={version:"1.0"};let n,i=[];for(let s=0;s<e.childNodes.length;s++){const r=e.childNodes[s];if(1===r.nodeType)if((0,P.g7)(r,"description"))t.description=(0,P.mX)(r);else if((0,P.g7)(r,"name"))t.name=(0,P.mX)(r);else if((0,P.g7)(r,"label"))t.label=(0,P.mX)(r);else if((0,P.g7)(r,"supportedFormats"))t.supportedFormats=(0,P.Dy)(r,"formats");else if((0,P.g7)(r,"supportedCRSs"))t.supportedCRSs=_(r);else if((0,P.g7)(r,"supportedInterpolations"))t.supportedInterpolations=X(r,"1.0.0");else if((0,P.g7)(r,"lonLatEnvelope"))t.lonLatEnvelope=W(r);else if((0,P.g7)(r,"rangeSet")){const e=H(r);t.rangeSet=e.rangeSet,i=e.bandNames;const s=e.rangeSet[0].nullValues;s?.length&&(n=U(s))}else(0,P.g7)(r,"domainSet")&&(t.domainSet=Y(r))}const s=z(t.supportedInterpolations),{name:r,description:o,label:a,lonLatEnvelope:l,supportedFormats:u}=t,{spatialDomain:c}=t.domainSet,p={x:Math.abs(c.offset.x),y:Math.abs(c.offset.y)},d=function(e){if(!e.temporalDomain)return null;const{begin:t,end:n,values:i,units:s,resolution:r}=e.temporalDomain,o={variables:[{name:"default",description:"",dimensions:[{name:"StdTime",description:"",unit:"ISO8601",values:i?.map(e=>e.getTime()),hasRegularIntervals:!i,interval:r,intervalUnit:s,extent:[t.getTime(),n.getTime()]}]}]};return F(o),o}(t.domainSet),f=new Z.A({width:c.columns,height:c.rows,pixelSize:p,pixelType:"unknown",extent:c.envelope,spatialReference:c.envelope.spatialReference,bandCount:i.length||1,noDataValue:n,multidimensionalInfo:d});return{id:r,title:t.name,description:o||a,lonLatEnvelope:l,rasterInfo:f,bandNames:i,supportedFormats:u,supportedInterpolations:s,coverageDescription:t,version:"1.0.0",useEPSGAxis:!1}}(e));const i=(0,P.IC)(n,"CoverageDescription");return"1.1.0"===t||"1.1.1"===t||"1.1.2"===t?i.map(e=>function(e,t){const n=[],i=[],s={supportedFormats:n,supportedCRSs:i,version:"1.1"};let r,o,a=[];for(let t=0;t<e.childNodes.length;t++){const l=e.childNodes[t];if(1!==l.nodeType)continue;const u=(0,P.vv)(l).toLowerCase();switch(u){case"title":case"abstract":case"identifier":s[u]=(0,P.mX)(l);break;case"supportedformat":{const e=(0,P.mX)(l);n.includes(e)||n.push(e)}break;case"supportedcrs":{const e=(0,P.mX)(l);i.includes(e)||i.push(e)}break;case"range":{const e=Q(l,!!s.domain?.temporalDomain);s.range=e.rangeSet,a=e.bandNames;const{bandNoDataValues:t}=e;t?.length&&(r=U(t)),o=e.statistics}break;case"domain":s.domain=ee(l)}}const l=z(s.range[0].supportedInterpolations),{identifier:u,abstract:c,title:p,domain:d,range:f}=s,h={x:Math.abs(d.spatialDomain.offset.x),y:Math.abs(d.spatialDomain.offset.y)},m=function(e,t){if(!t.temporalDomain)return null;const n=e.filter(e=>!e.identifier.toLowerCase().includes("field_1")&&!e.axis.some(e=>e.identifier.includes("band"))),i=[];if(n.length&&n.forEach(e=>{const t=e.axis.map(e=>{const t=e.values.map(t=>"ISO8601"===e.uom?(t=t.trim()).toLowerCase().includes("z")?new Date(t).getTime():new Date(t+"Z").getTime():parseFloat(t.trim())),n=[Math.min.apply(null,t),Math.max.apply(null,t)];return{name:e.identifier.trim(),description:"",field:e.identifier.trim(),unit:e.uom?e.uom.trim():"",hasRegularIntervals:!1,values:t,extent:n}});i.push({name:e.identifier.trim(),description:e.description?.trim()??"",unit:"",dimensions:t,statistics:e.statistics})}),t.temporalDomain){const{begin:e,end:n,values:s,units:r,resolution:o}=t.temporalDomain;i.some(e=>e.dimensions.some(e=>"stdtime"===e.name.toLowerCase()))||i.forEach(t=>{t.dimensions.push({name:"StdTime",description:"",unit:"ISO8601",values:s?.map(e=>e.getTime()),hasRegularIntervals:!s,interval:o,intervalUnit:r,extent:[e.getTime(),n.getTime()]})})}if(i.length){const e={variables:i};return F(e),e}return null}(f,d);m&&(r=f[0].nullValues,1===r?.length&&(r=r[0]));const g=new Z.A({width:d.spatialDomain.columns,height:d.spatialDomain.rows,pixelSize:h,pixelType:"unknown",extent:d.spatialDomain.envelope,spatialReference:d.spatialDomain.envelope.spatialReference,bandCount:a.length||1,noDataValue:r,statistics:o,multidimensionalInfo:m});return{id:u,title:s.title,description:c||p,bandNames:a,rasterInfo:g,supportedFormats:n,supportedInterpolations:l,coverageDescription:s,version:t,useEPSGAxis:d.spatialDomain.useEPSGAxis}}(e,t)):i.map(e=>function(e){const t={version:"2.0"};let n,i,s=[];for(let r=0;r<e.childNodes.length;r++){const o=e.childNodes[r];if(1===o.nodeType)if((0,P.g7)(o,"coverageId"))t.coverageId=(0,P.mX)(o);else if((0,P.g7)(o,"ServiceParameters"))t.serviceParameters={supportedFormats:(0,P.Dy)(o,"nativeFormat")};else if((0,P.g7)(o,"boundedBy"))t.boundedBy=te(o);else if((0,P.g7)(o,"rangeType")){const e=ne(o,t.boundedBy?.axisLabels.length>2||t.domainSet?.axisLabels.length>2);t.rangeType=e.rangeType,s=e.bandNames,n=e.bandStats;const{bandNoDataValues:r}=e;r?.length&&(i=U(r))}else if((0,P.g7)(o,"domainSet"))t.domainSet=se(o,t.boundedBy?.axisLabels);else if((0,P.g7)(o,"metadata")){const e=(0,P.V6)(o,"EOMetadata");t.eoMetadata=e?re(e):null}}const{coverageId:r,boundedBy:o,domainSet:a,rangeType:l,serviceParameters:u}=t,c=function(e,t,n){if(n.axisLabels.length<=2)return null;const i=[];for(let t=0;t<e.length;t++){const n=e[t];for(let e=0;e<n.length;e++)n[e].name.toLowerCase().includes("band")||i.push(n[e])}const s=[];if(i.length){const e=[];for(let i=2;i<n.axisLabels.length;i++){const s=t.uomLabels?.[i]?.trim()??"",r=n.axisLabels[i].toLowerCase().includes("time")||"iso8601"===s.toLowerCase()||"oledatetime"===s.toLowerCase();let o,a;if(r){const e=ie(n.offset[i]);o=e.interval,a=e.intervalUnit}else o=n.offset[i],a=s;const l=[];r?(l.push((0,G.$E)(t.envelopeAllDims.mins[i])),l.push((0,G.$E)(t.envelopeAllDims.maxs[i]))):(l.push(t.envelopeAllDims.mins[i]),l.push(t.envelopeAllDims.maxs[i])),e.push({name:n.axisLabels[i].trim(),description:n.axisLabels[i].trim(),unit:r?"ISO8601":s,hasRegularIntervals:!0,extent:l,interval:o,intervalUnit:a})}if(i.forEach(t=>{const{allowedValues:n}=t,i=2===n?.length?[{min:n[0],max:n[1],avg:-1,stddev:-1}]:null;s.push({name:t.name.trim(),description:t.description?.trim()??"",unit:t.uom.trim(),statistics:i,dimensions:[...e]})}),s.length){const e={variables:s};return F(e),e}}return null}(l,o,a);return!n&&c&&(n=c?.variables[0].statistics),null!=c&&(i=l[0][0].nilValue),{id:r,title:r,description:r,bandNames:s,rasterInfo:new Z.A({width:a.columns,height:a.rows,pixelSize:a.resolution,pixelType:"unknown",extent:o.envelope,spatialReference:o.envelope.spatialReference,bandCount:s.length||1,statistics:n,noDataValue:i,multidimensionalInfo:c}),supportedFormats:u.supportedFormats,coverageDescription:t,version:"2.0.1",useEPSGAxis:!1}}(e))}(t,i)}catch(e){if(!(0,l.zf)(e))throw new o.A("wcslayer:open","wcs coverage description is not valid or supported");throw e}}var ae=n(49859);function le(e,t,n=0){const i="--"+t.boundary,s=[];for(let e=0;e<i.length;e++)s.push(i.charCodeAt(e));const r=[],o="\n--"+t.boundary+"--";for(let e=0;e<o.length;e++)r.push(o.charCodeAt(e));const a=[10],l=[13,10],u=[],c=s.length,p=new Uint8Array(e,n),d=p.length-c;let f=0,h=0;for(let e=0;e<d;e++){for(h=0;h<c&&p[e+h]===s[h];h++);if(h!==c)continue;let n=!1;if(f){const i=ue(p.subarray(f,e),t);u.push(i),n=!!i.isValidImage}if(e+=c-1,p[e+1]===a[0]?e+=1:p[e+1]===l[0]&&p[e+2]===l[1]&&(e+=2),f=e+1,n)break}const m=r.length;for(let e=p.length-m-10;e<p.length-m;e++){for(h=0;h<m&&p[e+h]===r[h];h++);if(h===m){u.push(ue(p.subarray(f,e),t));break}}return u}function ue(e,t){const n=String.fromCharCode.apply(null,e.subarray(0,Math.min(300,e.length))).split("\n"),i=Math.min(n.length,7),s={contentDisposition:"inline"};let r=0;for(let o=0;o<i;o++)if(n[o].length<4)r=r+n[o].length+1;else if("content"===n[o].slice(0,7).toLowerCase()){r=r+n[o].length+1;const e=n[o].indexOf(":");if(-1===e)continue;const t=n[o].slice(0,e).trim(),i=n[o].slice(e+1).trim();switch(t.toLowerCase()){case"content-type":s.contentType=i;break;case"content-description":s.contentDescription=i;break;case"content-transfer-encoding":s.contentTransferEncoding=i;break;case"content-id":s.contentID=i;break;case"content-disposition":s.contentDisposition=i;break;case"content-location":s.contentLocation=i}}else{if(s.contentDisposition.toLowerCase().includes("inline")&&n[o].length>=4&&s.contentType?.toLowerCase().includes("image")){let t=!0,n=e.subarray(r,e.length);if(s.contentType.toLowerCase().indexOf("tif")>0){if("base64"===s.contentTransferEncoding){let e="";const t=n;for(let n=0;n<t.length;n+=65535){const i=t.subarray(n,n+65535>t.length-1?t.length-1:n+65535);e+=String.fromCharCode.apply(null,i)}const i=atob(e);n=new Uint8Array(i.length);for(let e=0;e<n.length;e++)n[e]=i.charCodeAt(e)}t=73===n[0]&&73===n[1]||77===n[0]&&77===n[1]}if(t){let t=n.buffer;"base64"!==s.contentTransferEncoding&&(t=new ArrayBuffer(e.length-r),n=new Uint8Array(t),n.set(e.subarray(r,e.length))),s.contentData=t,s.isValidImage=!0}break}if((""===t.start||s.contentID===t.start)&&s.contentType){if(s.contentType.includes("text")||s.contentType.includes("xml")){s.contentData=String.fromCharCode.apply(null,e.subarray(r,e.length));break}s.contentData=e.subarray(r,e.length)}}return s}var ce=n(20758),pe=n(47520),de=n(45617);const fe=["nearest neighbor","bilinear","bicubic"],he=["nearest","linear","cubic"],me="response is not a supported multipart/related mediaType with inline tiff, switching to compatibility mode",ge=new Set(["1.0.0","1.1.0","1.1.1","1.1.2","2.0.1"]);let ve=class extends ae.A{constructor(){super(...arguments),this.datasetFormat="WCSServer",this.tileType="Raster"}get rasterId(){return`${this.url}-${this.coverageId}-${this.version}`}async fetchRawTile(e,t,n,i={}){if(this.isBlockOutside(e,t,n))return null;const{nativePixelSize:s,spatialReference:r}=this.rasterInfo,a=2**e,l=s.x*a,u=s.y*a,{blockWidth:c,blockHeight:p}=this.getBlockWidthHeight(e),{origin:d}=this.rasterInfo.storageInfo.tileInfo,f=this.getTileExtent({x:l,y:u},t,n,d,r,[c,p]),h=this.rasterInfo.extent,m=f.xmax>h.xmax,g=f.ymin<h.ymin,v=m||g;let y=f,w=c,x=p;if(v&&(y=f.clone().intersection(h),null!=y&&(m&&(w=Math.floor((y.xmax-y.xmin)/l),y.xmax=y.xmin+l*w),g&&(x=Math.floor((y.ymax-y.ymin)/u),y.ymin=y.ymax-u*x))),null==y||w<=1||x<=1)return null;const b=await this._getCoverage(y,w,x,a,i);if(!b)return null;const{coverageDescription:C}=this.coverageInfo,{noDataValue:I,multidimensionalInfo:S}=this.rasterInfo,{multidimensionalDefinition:A}=i;let M;if(null!=S&&null!=A&&A.length){const e=A[0].variableName;if("2.0"===C.version){const t=C.rangeType[0].find(t=>t.name===e);M=t?.nilValue}else if("1.1"===C.version){const t=C.range.find(t=>t.identifier===e);M=t?.nullValues}}const R=M??I,T=await this.decodePixelBlock(b,{width:w,height:x,planes:null,pixelType:null,tiffNoDataValue:Array.isArray(R)?R[0]:R,matchAllNoData:!0});if(null==T)return null;if(T&&(T.width!==w||T.height!==x))throw new o.A("wcsraster-fetch",`the response has unexpected dimension width: ${T.width}, height: {pixelBlock.height}`);return v?(0,pe.$Q)(T,{x:0,y:0},{width:p,height:p}):T}async _open(e){const{customFetchParameters:t}=this.ioConfig,n=e?.signal,i=await async function(e,t){const{version:n,customParameters:i,signal:s}=t??{},r=n?.startsWith("1.0")?"version":"acceptVersions",a={service:"WCS",request:"GetCapabilities",[r]:n,...i};try{let{data:n}=await(0,L.A)(e,{query:a,responseType:"xml",signal:s});return t?.version||function(e){let t=null;t="string"==typeof e?(new DOMParser).parseFromString(e,"text/xml"):e;const n=t.documentElement.getAttribute("version"),i=n?.slice(0,3);return null!=i&&i<"2.1"}(n)||(a[r]="2.0.1",({data:n}=await(0,L.A)(e,{query:a,responseType:"xml",signal:s}))),E(n)}catch(e){if(!(0,l.zf)(e))throw new o.A("wcslayer:open","wcs capabilities is not valid or supported");throw e}}(this.url,{version:t?.version??this.version,customParameters:t,signal:n});if(this.capabilities=i,!this.version){let e=i.version.slice(0,3);"2.0"===e||"1.1"===e||"1.0"===e?this.version=i.version:(e=i.supportedVersions.find(e=>"2.0.1"===e)||i.supportedVersions.find(e=>e.startsWith("2.0"))||i.supportedVersions.find(e=>e.startsWith("1.1"))||i.supportedVersions.find(e=>e.startsWith("1.0"))||"1.0.0",this.version=e)}const{version:s}=this;if(!ge.has(s))throw new o.A("wcsraster-open",`unsupported WCS version ${s}`);const{gridCoverages:r}=i;if(!r.length)throw new o.A("wcsraster-open","cannot find rectified grid coverages");this.coverageId??=r[0].id;const{coverageId:a}=this,u=r.find(e=>e.id===a);if(null==u)throw new o.A("wcsraster-open",`the coverageId ${a} does not exist in capabilities`);const c=await oe(this.url,{coverageIds:[a],version:s,customParameters:t,signal:n});if(this.coverageInfo=c[0],s.startsWith("2.0")){const{coverageInfo:e}=this;e.lonLatEnvelope=u.lonLatEnvelope,e.supportedInterpolations=z(i.supportedInterpolations),this._patchDimensionValues201(a,n)}this.datasetName=this.coverageInfo.title;const{rasterInfo:p}=this.coverageInfo;if(this.createRemoteDatasetStorageInfo(p,512,512),this._set("rasterInfo",p),null==p.spatialReference)throw new o.A("wcsraster-open",`coverage without spatial reference is not supported: ${a}`);const{pixelType:d,bandCount:f}=await this._getPixelTypeAndBandCount(n);p.pixelType=d,1===p.bandCount&&f>1&&(p.bandCount=f),this.updateTileInfo()}async _patchDimensionValues201(e,t){const{coverageInfo:n}=this,i=n.rasterInfo.multidimensionalInfo?.variables,s=ge.has("1.1.2")?"1.1.2":ge.has("1.1.1")?"1.1.1":ge.has("1.1.0")?"1.1.0":null,{customFetchParameters:r}=this.ioConfig;if(i&&s)try{const n=this.url.includes("/ImageServer/"),o=e.length>8&&e.startsWith("Coverage")&&n?e.slice(8):e,a=await oe(this.url,{coverageIds:[o??e],version:s,customParameters:r,signal:t}).catch(()=>{if(o)return oe(this.url,{coverageIds:[e],version:s,customParameters:r,signal:t})}),l=a?.[0].rasterInfo.multidimensionalInfo?.variables;if(l)for(const e of i){const t=l.find(({name:t})=>t===e.name);if(t?.dimensions?.length)for(let i=e.dimensions.length-1;i>=0;i--){const s=e.dimensions[i],r=t.dimensions.find(({name:e})=>e===s.name);r?r.values&&r.extent?.join(",")===s.extent?.join(",")&&(e.dimensions[i]={...s,values:r.values}):n&&e.dimensions.splice(i,1)}}}catch{}}async _getPixelTypeAndBandCount(e){const{pixelSize:t,extent:n,multidimensionalInfo:i}=this.rasterInfo,s=n.center,r=new T.A({xmin:s.x-t.x,xmax:s.x+t.x,ymin:s.y-t.y,ymax:s.y+t.y,spatialReference:n.spatialReference});let a=[];if(null!=i){const e=i.variables[0];a=[],e.dimensions.forEach(t=>{a.push(new de.A({variableName:e.name,dimensionName:t.name,values:t.hasRegularIntervals?t.extent?.[0]:t.values?.[0],isSlice:!0}))})}const{coverageDescription:l}=this.coverageInfo,u={interpolation:"nearest",multidimensionalDefinition:a,signal:e},{version:c}=l,{ioConfig:p}=this,d="2.0"===c&&null==p.allowAnyMediaType||"1.1"===c&&null==p.use2GridOffsets;let f;try{f=await this._getCoverage(r,2,2,1,u,!0)}catch(e){if(!d)throw e;if("1.1"===c){if(!e.details?.isResolutionMismatch)throw e;p.use2GridOffsets=!0}}if(!f&&d&&("2.0"===c&&(p.allowAnyMediaType=!0),f=await this._getCoverage(r,2,2,1,u),f&&R.A.getLogger(this).warn("wcsraster:getcoverage",me)),!f)throw new o.A("wcsraster-open","unable to determine pixel type");const h=await this.decodePixelBlock(f,{width:2,height:2,planes:null,pixelType:null});if(null==h)throw new o.A("wcsraster-open","unable to determine pixel type");return{pixelType:h.pixelType,bandCount:h.getPlaneCount()??0}}async _getCoverage(e,t,n,i,s,r=!1){const{coverageDescription:a}=this.coverageInfo,{version:l}=a,u="2.0"===l?this._getCoverage201Parameters(e,t,n,i,s,a):"1.1"===l?this._getCoverage110Parameters(e,t,n,s,a):this._getCoverage100Parameters(e,t,n,s),c="2.0"===l?await this.request(this._constructWCS201Url(u),{signal:s.signal,responseType:"array-buffer"}):await this.request(this.url,{query:u,signal:s.signal,responseType:"array-buffer"});if("1.0"===l)return c.data;if("2.0"===l&&!1!==this.ioConfig.allowAnyMediaType&&"tiff"===(0,ce.g)(c.data))return r&&(this.ioConfig.allowAnyMediaType=!0,R.A.getLogger(this).warn("wcsraster:getcoverage",me)),c.data;const p=function(e){const t=function(e){const t=e.getHeader?.("Content-Type")?.split(";");if(!t)return null;if(!(t[0].trim()??"").startsWith("multipart/"))return null;const n={boundary:"",start:"",type:""};for(let e=1;e<t.length;e++){const i=t[e].indexOf("=");if(i>0){const s=t[e].slice(0,i).trim(),r=t[e].slice(i+1).trim();n[s]=r.startsWith('"')?r.slice(1,-1):r}}return n}(e);return t?{isMultipart:!0,data:t.boundary?le(e.data,t,0):null}:{isMultipart:!1,data:null}}(c);if(p.isMultipart&&p.data){const e=p.data.find(e=>e.isValidImage);return r&&"base64"===e?.contentTransferEncoding&&R.A.getLogger(this).warn("wcsraster:getcoverage","response is base64 encoded which may impact layer display performance"),e?.contentData}const d=new Uint8Array(c.data,0,Math.min(c.data.byteLength,2e3)),f=String.fromCharCode.apply(null,d).toLowerCase().includes("exception"),h=f&&String.fromCharCode.apply(null,d).includes("A non-zero RESX/RESY or WIDTH/HEIGHT is required but neither was provided");if(f)throw new o.A("wcsraster:getcoverage","server returns an exception",{isResolutionMismatch:h});throw new o.A("wcsraster:getcoverage","response is not a supported multipart mediaType with inline tiff")}_getInterpolationIndex(e){return e&&this.coverageInfo.supportedInterpolations?.includes(e)?"nearest"===e?0:"bilinear"===e?1:"cubic"===e?2:0:0}_getCoverage100Parameters(e,t,n,i){const s=`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`,r=e.spatialReference.wkid,o=(this.coverageInfo.supportedFormats||[]).find(e=>e.toLowerCase().includes("tiff"))||"GEOTIFF",{bandIds:a,interpolation:l}=i,u=this._getInterpolationIndex(l),c=a?a.map(e=>this.coverageInfo.bandNames[e]):null,p=fe[u],{multidimensionalDefinition:d}=i;let f;if(null!=d&&null!=this.rasterInfo.multidimensionalInfo){const e=d.find(e=>"StdTime"===e.dimensionName);let t=e?.values;t&&t.length>0&&(Array.isArray(t[0])&&(t=t[0]),f=t.map(e=>ye(e)).join(","))}return{service:"WCS",request:"GetCoverage",version:this.version,coverage:this.coverageId,format:o,crs:`EPSG:${r}`,bbox:s,width:t,height:n,time:f,interpolation:p,band:c?.join(",")}}_getCoverage110Parameters(e,t,n,i,s){const{multidimensionalDefinition:r,bandIds:o,interpolation:a}=i,l=e.spatialReference.wkid,u=`urn:ogc:def:crs:EPSG::${l}`,c=(this.coverageInfo.supportedFormats||[]).find(e=>e.toLowerCase().includes("tiff"))||"image/tiff",p=this._getInterpolationIndex(a),d=he[p],f=null==a||0===this.coverageInfo.supportedInterpolations?.indexOf(a),h=s.domain.spatialDomain,m=h.origin.x<=h.envelope.xmin&&h.origin.y<=h.envelope.ymin,g=e.width/t,v=e.height/n*(m?1:-1),y=m?[e.xmin,e.ymin]:[e.xmin,e.ymax],w=h.useEPSGAxis&&(0,D.m)(l),x=w?`${y[1]},${y[0]}`:`${y[0]},${y[1]}`,b=this.ioConfig.use2GridOffsets,C=w?b?`${v},${g}`:`${v},0,0,${g}`:b?`${g},${v}`:`${g},0,0,${v}`,I=g/2,S=e.xmin+I,A=e.xmax-I,M=Math.abs(v)/2,R=e.ymin+M,T=e.ymax-M,L=w?`${R},${S},${T},${A},${u}`:`${S},${R},${A},${T},${u}`,P=s.range.find(e=>e.axis.some(e=>e.identifier.toLowerCase().includes("band")));let O,N=P&&d&&o?f?`${P.identifier}[${P.axis[0].identifier}[${o.join(",")}]]`:`${P.identifier}:${d}[${P.axis[0].identifier}[${o.join(",")}]]`:null;if(null!=r&&r.length)for(let e=0;e<r.length;e++){let t=r[e].values;const n=r[e].dimensionName?.toLowerCase(),i=r[e].variableName?.toLowerCase(),o=s.range.find(e=>e.identifier.toLowerCase()===i);if(t.length>0)if(Array.isArray(t[0])&&(t=t[0]),"stdtime"===n)O=t.map(e=>ye(e)).join(",");else if(o){const e=o.axis.find(e=>e.identifier.toLowerCase()===n);e&&(N=f?o.identifier+"["+e.identifier+"["+t.join(",")+"]]":o.identifier+":"+d+"["+e.identifier+"["+t.join(",")+"]]")}e===r.length-1&&o&&!N&&(N=f?o.identifier:o.identifier+":"+d)}return{service:"WCS",request:"GetCoverage",version:this.version,identifier:this.coverageId,format:c,crs:`EPSG:${l}`,boundingbox:L,gridCS:"urn:ogc:def:cs:OGC:0.0:Grid2dSquareCS",gridType:"urn:ogc:def:method:WCS:1.1:2dGridIn2dCrs",gridOrigin:x,gridOffsets:C,gridBaseCRS:u,timeSequence:O,rangeSubset:N}}_getCoverage201Parameters(e,t,n,i,s,r){const{multidimensionalDefinition:o,interpolation:a}=s,l=this._getInterpolationIndex(a);let u=null;const{supportedInterpolations:c}=this.capabilities;if(c?.length)switch(l){case 0:u=c.find(e=>e.toLowerCase().includes("nearest"));break;case 1:u=c.find(e=>e.toLowerCase().includes("linear"));break;case 2:u=c.find(e=>e.toLowerCase().includes("cubic")||e.toLowerCase().includes("quadratic"))}const p=(this.coverageInfo.supportedFormats||[]).find(e=>e.toLowerCase().includes("tiff"))||"image/tiff",{bandNames:d}=this.coverageInfo,{boundedBy:f,domainSet:h,rangeType:m}=r,g=f.isEastFirst?0:1,v=1-g,{axisLabels:y}=f,w=y[g],x=y[v],b=`http://www.opengis.net/def/crs/EPSG/0/${e.spatialReference.wkid}`,C=b,I=[];I.push(`${w}(${e.xmin},${e.xmax})`),I.push(`${x}(${e.ymin},${e.ymax})`);const S=[];if(y.length>2)for(let e=2;e<y.length;e++){const t=h.origin[e];if(y[e].toLowerCase().includes("time")){let n=t.toString();f.uomLabels?.[e].toLowerCase().includes("ole")&&(S.push(y[e]),n=ye(t,!0)),I.push(y[e]+",http://www.opengis.net("+n+")")}else I.push(y[e]+",http://www.opengis.net("+t+")")}let A=null;if(null!=o&&o.length){const e=[];m.forEach(t=>t.forEach(t=>e.push(t.name)));const t=[];for(let n=0;n<o.length;n++){const i=y.find(e=>e===o[n].dimensionName),s=e.find(e=>e===o[n].variableName);if(t.includes(s)||t.push(s),i){let e=o[n].values;if(e.length>0){Array.isArray(e[0])&&(e=e[0]);let t="";t=i.toLowerCase().includes("time")?e.map(e=>ye(e)).join(","):e.join(",");const n=I.findIndex(e=>e.startsWith(i+",http://www.opengis.net"));-1===n&&I.push(i+",http://www.opengis.net("+t+")"),-1===n||I[n].includes("("+t+")")||I.splice(n,1,i+",http://www.opengis.net("+t+")")}}}t.length&&(A=t.join(","))}else d?.length>=2&&(A=(s.bandIds?s.bandIds.map(e=>d[e]):d).join(","));const M=I.join("&subset="),R=!r.domainSet.hasSameAxisLabelsAsBoundedBy&&!1!==this.ioConfig.allowScaleFactor,T=R?null:`${w}(${t}),${x}(${n})`,D=R?1/i:null;return{service:"WCS",request:"GetCoverage",version:this.version,coverageId:this.coverageId,rangesubset:A,interpolation:u,scaleSize:T,scaleFactor:D,subset:M,format:p,mediaType:this.ioConfig.allowAnyMediaType?null:"multipart/related",outputcrs:b,subsettingcrs:C}}_constructWCS201Url(e){const t={...this.ioConfig.customFetchParameters,...e},n=[];return Object.keys(t).forEach(e=>{const i=t[e];null!=i&&("subset"===e?"string"==typeof i&&i.split("&subset=").forEach(e=>{e&&n.push(`subset=${encodeURIComponent(e)}`)}):n.push(`${e}=${encodeURIComponent(i)}`))}),`${encodeURI(this.url)}?${n.join("&")}`}};function ye(e,t=!1){return(t?new Date((0,G.$E)(e)):new Date(e)).toISOString()}(0,i.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],ve.prototype,"datasetFormat",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],ve.prototype,"tileType",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],ve.prototype,"version",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],ve.prototype,"coverageId",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],ve.prototype,"rasterId",null),ve=(0,i.Cg)([(0,c.$K)("esri.layers.raster.datasets.WCSRaster")],ve);var we=n(10873),xe=n(20437),be=n(74797),Ce=n(30291);const Ie=new Set(["milliseconds","seconds","minutes","hours","days","weeks","months","years","decades","centuries"]);let Se=class extends((0,y.dM)((0,S.j)((0,x.q)((0,b.A)((0,w.d)((0,M.b)((0,C.G)((0,A.e)((0,I.J)((0,a.M)((0,r.OU)(v.A)))))))))))){constructor(...e){super(...e),this.coverageId=null,this.version=null,this.isReference=null,this.graphicOrigin=new g(this),this.legendEnabled=!0,this.noData=0,this.operationalLayerType="WCS",this.type="wcs",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this._debouncedSaveOperations=(0,l.sg)(async(e,t,i)=>{const{save:s,saveAs:r}=await n.e(9838).then(n.bind(n,59838));switch(e){case 0:return s(this,t);case 1:return r(this,i,t)}})}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WCS"]},e).catch(l.QP).then(()=>this._openRaster(t))),Promise.resolve(this)}get renderer(){return super.renderer}set renderer(e){super.renderer=e}get coverageInfo(){return this.raster.coverageInfo}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[(0,be.rZ)("Pixel Value")],t=this.raster?.rasterInfo??this.serviceRasterInfo,n=t?.multidimensionalInfo;if(n){const t=(0,be.AL)(n);e.push(...t)}return e}createPopupTemplate(e){return(0,Ce.tn)({fields:this.rasterFields,title:this.title},e)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}async _openRaster(e){const t=new ve({url:this.url,version:this.version,coverageId:this.coverageId,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters}});if(await t.open({signal:e}),!t.rasterInfo)throw t.destroy(),new o.A("wcs-layer:load","cannot load resources on "+this.url);const{rasterInfo:n}=t;null==n.noDataValue&&(n.noDataValue=this.noData),this._set("serviceRasterInfo",n),this._set("spatialReference",n.spatialReference),null==this.title&&this.setAtOrigin("title",t.datasetName,"service"),null==this.coverageId&&this.setAtOrigin("coverageId",t.coverageInfo.id,"service"),null==this.version&&t.version&&this.setAtOrigin("version",t.version,"service"),this.setAtOrigin("tileInfo",t.rasterInfo.storageInfo.tileInfo,"service");const{multidimensionalInfo:i}=n;if(null!=i){const e=i.variables[0].dimensions.find(({name:e})=>"StdTime"===e);if(e){let t=e.extent?.[0]??e.values[0];Array.isArray(t)&&(t=t[0]);let n=e.extent?.[1]??e.values[e.values.length-1];Array.isArray(n)&&(n=n[1]);const i=Ie.has(e.intervalUnit?.toLowerCase())?e.intervalUnit?.toLowerCase():null;this.set("timeInfo",{startField:"StdTime",fullTimeExtent:{start:t,end:n},timeZone:null,interval:i?{value:e.interval,unit:i}:null})}}this.raster=t,this._configDefaultSettings(),this.addHandles((0,u.wB)(()=>this.customParameters,e=>this.raster.ioConfig.customFetchParameters=e))}};(0,i.Cg)([(0,c.MZ)({type:String,nonNullable:!0,json:{name:"wcsInfo.coverageId",write:{isRequired:!0,ignoreOrigin:!0}}})],Se.prototype,"coverageId",void 0),(0,i.Cg)([(0,c.MZ)()],Se.prototype,"coverageInfo",null),(0,i.Cg)([(0,c.MZ)({type:["1.0.0","1.1.0","1.1.1","1.1.2","2.0.1"],nonNullable:!0,json:{name:"wcsInfo.version",write:{isRequired:!0,ignoreOrigin:!0}}})],Se.prototype,"version",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Se.prototype,"isReference",void 0),(0,i.Cg)([(0,c.MZ)({json:{read:!0,write:!0}})],Se.prototype,"blendMode",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0,clonable:!1})],Se.prototype,"graphicOrigin",void 0),(0,i.Cg)([(0,c.MZ)(we.fV)],Se.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,c.MZ)({type:["show","hide"]})],Se.prototype,"listMode",void 0),(0,i.Cg)([(0,c.MZ)()],Se.prototype,"noData",void 0),(0,i.Cg)([(0,c.MZ)({type:["WCS"]})],Se.prototype,"operationalLayerType",void 0),(0,i.Cg)([(0,c.MZ)()],Se.prototype,"raster",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],Se.prototype,"type",void 0),(0,i.Cg)([(0,c.MZ)(we.M6)],Se.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,c.MZ)({type:s.A,json:{name:"popupInfo",write:!0}})],Se.prototype,"popupTemplate",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],Se.prototype,"defaultPopupTemplate",null),(0,i.Cg)([(0,c.MZ)({readOnly:!0,type:[xe.A]})],Se.prototype,"fields",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0,type:[xe.A]})],Se.prototype,"rasterFields",null),Se=(0,i.Cg)([(0,c.$K)("esri.layers.WCSLayer")],Se);const Ae=Se},38458(e,t,n){n.d(t,{m:()=>s});const i=[[3819,3819],[3821,3824],[3889,3889],[3906,3906],[4001,4025],[4027,4036],[4039,4047],[4052,4055],[4074,4075],[4080,4081],[4120,4176],[4178,4185],[4188,4216],[4218,4289],[4291,4304],[4306,4319],[4322,4326],[4463,4463],[4470,4470],[4475,4475],[4483,4483],[4490,4490],[4555,4558],[4600,4646],[4657,4765],[4801,4811],[4813,4821],[4823,4824],[4901,4904],[5013,5013],[5132,5132],[5228,5229],[5233,5233],[5246,5246],[5252,5252],[5264,5264],[5324,5340],[5354,5354],[5360,5360],[5365,5365],[5370,5373],[5381,5381],[5393,5393],[5451,5451],[5464,5464],[5467,5467],[5489,5489],[5524,5524],[5527,5527],[5546,5546],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3038,3051],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3150,3151],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3389,3390],[3416,3417],[3833,3841],[3844,3850],[3854,3854],[3873,3885],[3907,3910],[4026,4026],[4037,4038],[4417,4417],[4434,4434],[4491,4554],[4839,4839],[5048,5048],[5105,5130],[5253,5259],[5269,5275],[5343,5349],[5479,5482],[5518,5519],[5520,5520],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]];function s(e){return null!=e&&i.some(([t,n])=>e>=t&&e<=n)}},91806(e,t,n){n.d(t,{A:()=>l});var i,s=n(5482),r=n(25482),o=n(91429),a=n(56507);let l=class extends r.o{static{i=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 i({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,s.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"cols",void 0),(0,s.Cg)([(0,o.MZ)({type:a.jz,json:{write:!0}})],l.prototype,"level",void 0),(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],l.prototype,"levelValue",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"origin",void 0),(0,s.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],l.prototype,"resolution",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"rows",void 0),(0,s.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],l.prototype,"scale",void 0),l=i=(0,s.Cg)([(0,o.$K)("esri.layers.support.LOD")],l)},87045(e,t,n){n.d(t,{A:()=>w});var i,s=n(5482),r=n(66552),o=n(25482),a=n(86211),l=n(91429),u=n(56507),c=n(86738),p=n(16930),d=n(21325),f=n(28735),h=n(91806),m=n(72802),g=n(36005),v=n(43937);const y=new r.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",pbf:"pbf"});let w=class extends o.o{static{i=this}static create(e={}){const{resolutionFactor:t=1,scales:n,size:s=256,spatialReference:r=p.A.WebMercator,numLODs:o=24}=e;if(!(0,d.fn)(r)){const e=[];if(n)for(let t=0;t<n.length;t++){const i=n[t];e.push(new h.A({level:t,scale:i,resolution:i}))}else{let t=5e-4;for(let n=o-1;n>=0;n--)e.unshift(new h.A({level:n,scale:t,resolution:t})),t*=2}return new i({dpi:96,lods:e,origin:new c.A(0,0,r),size:[s,s],spatialReference:r})}const l=(0,d.Vp)(r),u=e.origin?new c.A({x:e.origin.x,y:e.origin.y,spatialReference:r}):new c.A(l?{x:l.origin[0],y:l.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),f=1/(39.37*(0,a.GA)(r)*96),m=[];if(n)for(let e=0;e<n.length;e++){const t=n[e],i=t*f;m.push(new h.A({level:e,scale:t,resolution:i}))}else{let e=(0,d.EA)(r)?512/s*591657527.5917094:256/s*591657527.591555;const n=Math.ceil(o/t);m.push(new h.A({level:0,scale:e,resolution:e*f}));for(let i=1;i<n;i++){const n=e/2**t,s=n*f;m.push(new h.A({level:i,scale:n,resolution:s})),e=n}}return new i({dpi:96,lods:m,origin:u,size:[s,s],spatialReference:r})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const n=(0,d.Vp)(e);return e.isWrappable&&!!n&&Math.abs(n.origin[0]-t.x)<=n.dx}return!1}readOrigin(e,t){return c.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,n=0;const i=[],s=this._levelToLOD={};e&&(t=-1/0,n=1/0,e.forEach(e=>{i.push(e.scale),t=e.scale>t?e.scale:t,n=e.scale<n?e.scale:n,s[e.level]=e})),this._set("scales",i),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){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const n=Math.floor(e),i=n+1;return t[n]/(t[n]/t[i])**(e-n)}scaleToZoom(e){const t=this.scales,n=t.length-1;let i=0;for(;i<n;i++){const n=t[i],s=t[i+1];if(n<=e)return i;if(s===e)return i+1;if(n>e&&s<e)return i+Math.log(n/e)/Math.log(n/s)}return i}tileAt(e,t,n,i){const s=this.lodAt(e);if(!s)return null;let r,o;if("number"==typeof t)r=t,o=n;else if((0,d.aI)(t.spatialReference,this.spatialReference))r=t.x,o=t.y,i=n;else{const e=(0,f.Cv)(t,this.spatialReference);if(null==e)return null;r=e.x,o=e.y,i=n}const a=s.resolution*this.size[0],l=s.resolution*this.size[1];return i??=new m.U(0,0,0),i.level=e,i.row=Math.floor((this.origin.y-o)/l+.001),i.col=Math.floor((r-this.origin.x)/a+.001),this.updateTileInfo(i),i}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let n=this.lodAt(e.level);if(!n&&1===t){const t=this.lods[this.lods.length-1];t.level<e.level&&(n=t)}if(!n)return!1;const i=e.level-n.level,s=n.resolution*this.size[0]/2**i,r=n.resolution*this.size[1]/2**i;return e.extent[0]=this.origin.x+e.col*s,e.extent[1]=this.origin.y-(e.row+1)*r,e.extent[2]=e.extent[0]+s,e.extent[3]=e.extent[1]+r,!0}upsampleTile(e){const 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){const n=this.lodAt(t.level);if(null==n)return null;const{resolution:i}=n,s=i*this.size[0],r=i*this.size[1];return e[0]=this.origin.x+t.col*s,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+s,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return i.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const n=[],s=this.lods.length-t;for(let e=0;e<s;e++){const i=e+t,{scale:s,resolution:r}=i>=0?this.lods[i]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};n.push(new h.A({level:e,scale:s,resolution:r}))}return new i({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:n})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let n=0;n<e.length;n++){const i=e[n];this._upsampleLevels[i.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/i.resolution:0},t=i}}};(0,s.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],w.prototype,"compressionQuality",void 0),(0,s.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],w.prototype,"dpi",void 0),(0,s.Cg)([(0,l.MZ)({type:String,json:{read:y.read,write:y.write,origins:{"web-scene":{read:!1,write:!1}}}})],w.prototype,"format",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],w.prototype,"isWrappable",null),(0,s.Cg)([(0,l.MZ)({type:c.A,json:{write:!0}})],w.prototype,"origin",void 0),(0,s.Cg)([(0,g.w)("origin")],w.prototype,"readOrigin",null),(0,s.Cg)([(0,l.MZ)({type:[h.A],value:null,json:{write:!0}})],w.prototype,"lods",null),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],w.prototype,"scales",void 0),(0,s.Cg)([(0,l.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],w.prototype,"size",void 0),(0,s.Cg)([(0,g.w)("size",["rows","cols"])],w.prototype,"readSize",null),(0,s.Cg)([(0,v.K)("size",{cols:{type:u.jz},rows:{type:u.jz}})],w.prototype,"writeSize",null),(0,s.Cg)([(0,l.MZ)({type:p.A,json:{write:!0}})],w.prototype,"spatialReference",void 0),w=i=(0,s.Cg)([(0,l.$K)("esri.layers.support.TileInfo")],w)},72802(e,t,n){n.d(t,{U:()=>s});var i=n(19419);class s{constructor(e,t,n,s=(0,i.vt)()){this._level=e,this._row=t,this._col=n,this.extent=s}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 s(e.level,e.row,e.col,e.extent)}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3661],{56512(e,t,n){function i(e){let t,n,i=[],s=!1;return function(...r){return s&&t===this&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(e[n]!==t[n])return!1;return!0}(r,i)||(n=e.apply(this,r),t=this,i=r,s=!0),n}}n.d(t,{B:()=>i})},159(e,t,n){n.d(t,{A:()=>u});var i,s=n(5482),r=n(69540),o=n(25482),a=n(91429),l=n(99157);let u=i=class extends((0,r.OU)(o.o)){constructor(e){super(e),this.steps=[]}getInverse(){const e=new i;for(let t=this.steps.length-1;t>=0;t--){const n=this.steps[t];e.steps.push(n.getInverse())}return e}};(0,s.Cg)([(0,a.MZ)({type:[l.A],nonNullable:!0,json:{name:"geoTransforms"}})],u.prototype,"steps",void 0),u=i=(0,s.Cg)([(0,a.$K)("esri.geometry.operators.support.GeographicTransformation")],u)},99157(e,t,n){n.d(t,{A:()=>l});var i,s=n(5482),r=n(69540),o=n(25482),a=n(91429);let l=i=class extends((0,r.OU)(o.o)){constructor(e){super(e),this.isInverse=!1,this.wkt=null,this.wkid=null}getInverse(){return new i({isInverse:!this.isInverse,wkid:this.wkid,wkt:this.wkt})}};(0,s.Cg)([(0,a.MZ)({json:{name:"transformForward",read:e=>!e,write:(e,t,n)=>{t[n]=!e}}})],l.prototype,"isInverse",void 0),(0,s.Cg)([(0,a.MZ)({json:{write:!0}})],l.prototype,"wkt",void 0),(0,s.Cg)([(0,a.MZ)({json:{write:!0}})],l.prototype,"wkid",void 0),l=i=(0,s.Cg)([(0,a.$K)("esri.geometry.operators.support.GeographicTransformationStep")],l)},9762(e,t,n){n.r(t),n.d(t,{projectBuffer:()=>s});var i=n(49208);function s(e,t,n,s,r,o,a=Math.floor(e.length/3)){const l=(0,i.jd)(t,r);if(null==l)return!1;if(l===i.pO){if(e===s&&n===o)return!0;const t=n+3*a;for(let i=n,r=o;i<t;i++,r++)s[r]=e[i]??0;return!0}const u=n+3*a;for(let t=n,i=o;t<u;t+=3,i+=3)l(e,t,s,i);return!0}},49208(e,t,n){n.d(t,{Tp:()=>p,jd:()=>c,pO:()=>f,w5:()=>u});var i=n(34727),s=n(86211),r=n(73941),o=n(79258),a=n(34403),l=n(21325);const u={2:{5:f,7:null,9:null,10:f,1:b,6:null,8:null,0:null,3:m,11:g,2:f,4:M},5:{5:f,7:null,9:null,10:f,1:b,6:null,8:null,0:null,3:m,11:g,2:f,4:M},7:{5:null,7:f,9:null,10:f,1:null,6:x,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:f,10:f,1:null,6:null,8:w,0:null,3:null,11:null,2:null,4:null},3:{5:h,7:null,9:null,10:h,1:function(e,t,n,i){const s=e[t]/O,r=P-2*Math.atan(Math.exp(-e[t+1]/O)),o=O+(e[t+2]??0),a=Math.cos(r)*o;n[i]=Math.cos(s)*a,n[i+1]=Math.sin(s)*a,n[i+2]=Math.sin(r)*o},6:null,8:null,0:null,3:f,11:function(e,t,n,i){h(e,t,n,i),g(n,i,n,i)},2:h,4:function(e,t,n,i){h(e,t,n,i),M(n,i,n,i)}},4:{5:R,7:null,9:null,10:R,1:function(e,t,n,i){R(e,t,n,i),b(n,i,n,i)},6:null,8:null,0:null,3:function(e,t,n,i){R(e,t,n,i),m(n,i,n,i)},11:function(e,t,n,i){R(e,t,n,i),g(n,i,n,i)},2:R,4:f},1:{5:A,7:null,9:null,10:A,1:f,6:null,8:null,0:null,3:function(e,t,n,i){A(e,t,n,i),m(n,i,n,i)},11:function(e,t,n,i){A(e,t,n,i),g(n,i,n,i)},2:A,4:function(e,t,n,i){A(e,t,n,i),M(n,i,n,i)}},6:{5:null,7:S,9:null,10:S,1:null,6:f,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:I,10:I,1:null,6:null,8:f,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:f,3:null,11:null,2:null,4:null},10:{5:f,7:f,9:f,10:f,1:b,6:x,8:w,0:null,3:m,11:g,2:f,4:M},11:{5:v,7:null,9:null,10:v,1:function(e,t,n,i){v(e,t,n,i),b(n,i,n,i)},6:null,8:null,0:null,3:function(e,t,n,i){v(e,t,n,i),m(n,i,n,i)},11:f,2:v,4:function(e,t,n,i){v(e,t,n,i),M(n,i,n,i)}}};function c(e,t){return p(e,t)?.projector}function p(e,t){if(null==e||null==t)return null;if(T.source.spatialReference===e&&T.dest.spatialReference===t)return T;const n=d(e,T.source),i=d(t,T.dest);return 0===n&&0===i?(0,l.aI)(e,t)?T.projector=f:T.projector=null:T.projector=u[n][i],T}function d(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,s.GA)(e,1)),(0,r.jA)(e)?t.spatialReferenceId=1:(0,l.oT)(e)?t.spatialReferenceId=2:(0,l.K8)(e)?t.spatialReferenceId=3:(0,l.r1)(e)?t.spatialReferenceId=11:e.wkt===r.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===r.FY.wkt?t.spatialReferenceId=6:e.wkt===r.LJ.wkt?t.spatialReferenceId=8:(0,r.q8)(e)?t.spatialReferenceId=7:(0,r.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function f(e,t,n,i){e!==n&&(n[i++]=e[t++],n[i++]=e[t++],n[i]=e[t]??0)}function h(e,t,n,i){n[i]=L*(e[t]/O),n[i+1]=L*(P-2*Math.atan(Math.exp(-e[t+1]/O))),n[i+2]=e[t+2]??0}function m(e,t,n,s){!function(e,t,n,s,r){const o=.4999999*Math.PI,a=(0,i.qE)(D*e[t+1],-o,o),l=Math.sin(a);n[s++]=D*e[t]*r.radius,n[s++]=r.halfSemiMajorAxis*Math.log((1+l)/(1-l)),n[s]=e[t+2]??0}(e,t,n,s,o.$O)}function g(e,t,n,i){n[i]=e[t]*N,n[i+1]=e[t+1]*N,n[i+2]=e[t+2]??0}function v(e,t,n,i){n[i]=e[t]*V,n[i+1]=e[t+1]*V,n[i+2]=e[t+2]??0}function y(e,t,n,i,s){const r=s+(e[t+2]??0),o=D*e[t],a=D*e[t+1],l=Math.cos(a)*r;n[i]=Math.cos(o)*l,n[i+1]=Math.sin(o)*l,n[i+2]=Math.sin(a)*r}function w(e,t,n,i){y(e,t,n,i,o.Sw.radius)}function x(e,t,n,i){y(e,t,n,i,o.sH.radius)}function b(e,t,n,i){y(e,t,n,i,o.$O.radius)}function C(e,t,n,s,r){const o=e[t],a=e[t+1],l=e[t+2]??0,u=Math.sqrt(o*o+a*a+l*l),c=(0,i.YN)(l/(0===u?1:u)),p=Math.atan2(a,o);n[s++]=L*p,n[s++]=L*c,n[s]=u-r}function I(e,t,n,i){C(e,t,n,i,o.Sw.radius)}function S(e,t,n,i){C(e,t,n,i,o.sH.radius)}function A(e,t,n,i){C(e,t,n,i,o.$O.radius)}function M(e,t,n,i){!function(e,t,n,i,s){const r=D*e[t],o=D*e[t+1],a=e[t+2]??0,l=Math.sin(o),u=Math.cos(o),c=s.radius/Math.sqrt(1-s.eccentricitySquared*l*l);n[i++]=(c+a)*u*Math.cos(r),n[i++]=(c+a)*u*Math.sin(r),n[i++]=(c*(1-s.eccentricitySquared)+a)*l}(e,t,n,i,o.$O)}function R(e,t,n,i){const s=a.TP,r=e[t],l=e[t+1],u=e[t+2]??0;let c,p,d,f,h,m,g,v,y,w,x,b,C,I,S,A,M,R,T,D,P;c=Math.abs(u),p=r*r+l*l,d=Math.sqrt(p),f=p+u*u,h=Math.sqrt(f),D=Math.atan2(l,r),m=u*u/f,g=p/f,I=s.a2/h,S=s.a3-s.a4/h,g>.3?(v=c/h*(1+g*(s.a1+I+m*S)/h),T=Math.asin(v),w=v*v,y=Math.sqrt(1-w)):(y=d/h*(1-m*(s.a5-I-g*S)/h),T=Math.acos(y),w=1-y*y,v=Math.sqrt(w)),x=1-o.$O.eccentricitySquared*w,b=o.$O.radius/Math.sqrt(x),C=s.a6*b,I=d-b*y,S=c-C*v,M=y*I+v*S,A=y*S-v*I,R=A/(C/x+M),T+=R,P=M+A*R/2,u<0&&(T=-T),n[i++]=L*D,n[i++]=L*T,n[i]=P}const T={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:f},D=(0,i.kU)(1),L=(0,i.KJ)(1),P=.5*Math.PI,O=o.$O.radius,N=O*Math.PI/180,V=180/(O*Math.PI)},91218(e,t,n){n.r(t),n.d(t,{canProjectWithoutEngine:()=>B,initializeProjection:()=>U,isEqualBaseGCS:()=>q,isLoaded:()=>O,isLoadedOrLoad:()=>N,isLoadedOrLoadFor:()=>V,load:()=>$,project:()=>E,projectAsync:()=>W,projectExtent:()=>se,projectMany:()=>k,projectMultipoint:()=>Y,projectOrLoad:()=>Z,projectOrLoadMany:()=>F,projectPoint:()=>K,projectPolygon:()=>ne,projectPolyline:()=>ee,projectWithoutEngine:()=>H,requiresLoad:()=>j,test:()=>z,tryProject:()=>G,unload:()=>X});var i=n(49186),s=n(17676),r=n(62788),o=n(95488),a=n(51850),l=n(21276),u=n(73941),c=n(5443),p=n(91075),d=n(48526),f=n(86738),h=n(39829),m=n(82799),g=n(16930),v=n(98764),y=n(159),w=n(9762),x=n(49208);function b(e,t,n,i,s,r){return C[0]=e,C[1]=t,C[2]=n,(0,w.projectBuffer)(C,i,0,s,r,0)}const C=(0,a.vt)();var I=n(60408),S=n(21325),A=n(52006);let M=null,R=null,T=null,D=null,L={};const P=new o.I;function O(){return!!(R?.isLoaded()&&T?.isLoaded()&&D?.isLoaded())}function N(){return!!O()||((0,r.gc)(P),$(),!1)}function V(e,t){return!e||!t||B(e,t)||N()}function j(e,t){return!B(e,t)&&!O()}async function $(e){null==M&&(M=Promise.all([n.e(3276).then(n.bind(n,83276)).then(e=>(R=e,R.load())),n.e(8377).then(n.bind(n,8377)).then(e=>(T=e,T.load())),n.e(2158).then(n.bind(n,12158)).then(e=>(D=e,D.load()))])),await M,(0,s.Te)(e),P.notify()}function E(e,t,n){return Array.isArray(e)?0===e.length?[]:((0,l.H)(e),k(e,e[0].spatialReference,t,n)):((0,l.f)(e),k([e],e.spatialReference,t,n)[0])}function k(e,t,n,i){if(null==t||null==n)return e;if(B(t,n,i))return e.map(e=>H(e,t,n));if(null==i?.geographicTransformation&&(0,u.jA)(t))return k(e.map(e=>H(e,t,g.A.WGS84)),g.A.WGS84,n,{zConversionDisabled:i?.zConversionDisabled});if(null==i?.geographicTransformation&&(0,u.jA)(n))return k(e,t,g.A.WGS84).map(e=>H(e,g.A.WGS84,n));if(!O())throw new _;if(!i?.geographicTransformation)if(i?.extendedParams)i={...i,geographicTransformation:D.getTransformation(t,n,i.areaOfInterestExtent)||new y.A};else if(!i?.areaOfInterestExtent){const e=function(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}(t,n);let s=L[e];s||(s=D.getTransformation(t,n)||new y.A,L[e]=s),i={geographicTransformation:s,zConversionDisabled:i?.zConversionDisabled}}return e[0].spatialReference||(e[0].spatialReference=t),e[0]instanceof p.A?R.executeMany(e,n,i):T.executeMany(e,n,i)}function G(e,t,n){try{return E(e,t,n)}catch(e){return null}}function Z(e,t){const n=F([e],t);return null!=n.pending?{pending:n.pending,geometry:null}:null!=n.geometries?{pending:null,geometry:n.geometries[0]}:{pending:null,geometry:null}}function F(e,t,n){if(!O())for(const n of e)if(null!=n&&!(0,S.aI)(n.spatialReference,t)&&(0,S.fn)(n.spatialReference)&&(0,S.fn)(t)&&!B(n.spatialReference,t))return(0,r.gc)(P),{pending:$(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,S.aI)(e.spatialReference,t)?e:(0,S.fn)(e.spatialReference)&&(0,S.fn)(t)?E(e,t,n):null)}}class _ extends i.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function X(){M=null,R=null,T=null,D=null,L={}}const z={get loadPromise(){return M}};async function W(e,t,n){if((0,s.Te)(n),!e)return e;const i=F(Array.isArray(e)?e:[e],t,n);if(i.pending)return await i.pending,(0,s.Te)(n),W(e,t,n);const r=i.geometries??[];return Array.isArray(e)?r:r[0]}function B(e,t,n){return!(n?.areaOfInterestExtent||n?.extendedParams||n?.geographicTransformation)&&(!!(0,S.aI)(e,t)||(0,S.fn)(e)&&(0,S.fn)(t)&&!!(0,x.jd)(e,t))}function q(e,t){if((0,S.aI)(e,t))return!0;if(!(0,S.fn)(e)||!(0,S.fn)(t))return!1;const n=(0,S.oT)(e)||(0,S.K8)(e)||(0,S.x1)(e),i=(0,S.oT)(t)||(0,S.K8)(t)||(0,S.x1)(t);return n&&i}async function U(e,t,n,i){if(O())return(0,s.NO)(i);if(Array.isArray(e)){for(const{source:t,dest:n,options:s}of e)if(t&&n&&!B(t,n,s))return $(i)}else if(e&&t&&!B(e,t,n))return $(i);return(0,s.NO)(i)}function H(e,t,n){return e?(0,I.fT)(e)?J(e,t,new f.A,n,0):(0,I.ZC)(e)?re(e,t,new c.A,n,0):(0,I.Bi)(e)?ie(e,t,new h.A,n,0):(0,I.Rg)(e)?te(e,t,new m.A,n,0):(0,I.U9)(e)?Q(e,t,new d.A,n,0):null:null}function K(e,t,n=t.spatialReference,i=0){return null!=n&&null!=e.spatialReference&&null!=J(e,e.spatialReference,t,n,i)}function J(e,t,n,i,s){ue[0]=e.x,ue[1]=e.y;const r=e.z;return ue[2]=void 0!==r?r:s,(0,w.projectBuffer)(ue,t,0,ue,i,0)?(n.x=ue[0],n.y=ue[1],n.spatialReference=i,void 0!==r||(0,u.xP)(i)?(n.z=ue[2],n.hasZ=!0):(n.z=void 0,n.hasZ=!1),void 0===e.m?(n.m=void 0,n.hasM=!1):(n.m=e.m,n.hasM=!0),n):null}function Y(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=Q(e,e.spatialReference,t,n,i)}function Q(e,t,n,i,s){const{points:r,hasZ:o,hasM:a}=e,l=[],u=r.length,c=[];for(const e of r)c.push(e[0],e[1],o?e[2]:s);if(!(0,w.projectBuffer)(c,t,0,c,i,0,u))return null;const p=le(o,i);for(let e=0;e<u;++e){const t=3*e,n=c[t],i=c[t+1];p&&a?l.push([n,i,c[t+2],r[e][3]]):p?l.push([n,i,c[t+2]]):a?l.push([n,i,r[e][2]]):l.push([n,i])}return n.points=l,n.spatialReference=i,n.hasZ=o,n.hasM=a,n}function ee(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=te(e,e.spatialReference,t,n,i)}function te(e,t,n,i,s){const{curvePaths:r,paths:o,hasZ:a,hasM:l}=e;if(!(r?ae(r,a??!1,l??!1,t,n.curvePaths=[],i,s):oe(o,a??!1,l??!1,t,n.paths,i,s)))return null;const u=le(a,i);return n.spatialReference=i,n.hasZ=u,n.hasM=l,n}function ne(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=ie(e,e.spatialReference,t,n,i)}function ie(e,t,n,i,s){const{curveRings:r,rings:o,hasZ:a,hasM:l}=e;return(r?ae(r,a??!1,l??!1,t,n.curveRings=[],i,s):oe(o,a??!1,l??!1,t,n.rings,i,s))?(n.spatialReference=i,n.hasZ=le(a,i),n.hasM=l,n):null}function se(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=re(e,e.spatialReference,t,n,i)}function re(e,t,n,i,s){const{xmin:r,ymin:o,xmax:a,ymax:l,hasZ:u,hasM:c}=e;if(!b(r,o,u?e.zmin:s,t,ue,i))return null;const p=le(u,i);return n.xmin=ue[0],n.ymin=ue[1],p&&(n.zmin=ue[2]),b(a,l,u?e.zmax:s,t,ue,i)?(n.xmax=ue[0],n.ymax=ue[1],p&&(n.zmax=ue[2]),c&&(n.mmin=e.mmin,n.mmax=e.mmax),n.spatialReference=i,n):null}function oe(e,t,n,i,s,r,o=0){const a=new Array;for(const n of e)for(const e of n)a.push(e[0],e[1],t?e[2]:o);if(!(0,w.projectBuffer)(a,i,0,a,r,0))return!1;let l=0;s.length=0;const u=t?3:2,c=le(t,r);for(const t of e){const e=new Array;for(const i of t){const t=a.slice(l,l+=3);c||t.pop(),n&&t.push(i[u]),e.push(t)}s.push(e)}return!0}function ae(e,t,n,i,s,r,o=0){const a=new Array;for(const n of e)for(const e of n){if((0,A.FG)(e))return!1;if((0,A.aO)(e)){const[n,i]=e.c;a.push(n[0],n[1],t?n[2]:o,i[0],i[1],o);continue}if((0,A.n1)(e)){const[n,i,s]=e.b;a.push(n[0],n[1],t?n[2]:o,i[0],i[1],o,s[0],s[1],o);continue}const n=e;a.push(n[0],n[1],t?n[2]:o)}if(!(0,w.projectBuffer)(a,i,0,a,r,0))return!1;let l=0;s.length=0;const u=t?3:2,c=le(t,r);for(const t of e){const e=new Array;for(const i of t){const t=a.slice(l,l+=3);if(c||t.pop(),n&&t.push((0,A.yP)(i)[u]),(0,A.FG)(i))return!1;if((0,A.aO)(i)){const n=a[l++],i=a[l++];++l,e.push({c:[t,[n,i]]});continue}if((0,A.n1)(i)){const n=a[l++],i=a[l++];++l;const s=a[l++],r=a[l++];++l,e.push({b:[t,[n,i],[s,r]]});continue}e.push(t)}s.push(e)}return!0}function le(e,t){return e||(0,u.xP)(t)||(0,S.aI)(t,v.Y0)}const ue=(0,a.vt)()},98764(e,t,n){n.d(t,{GD:()=>o,Y0:()=>u,lO:()=>c});var i=n(73941),s=n(16930),r=n(21325);const o=new s.A(i.fv),a=new s.A(i.FY),l=new s.A(i.LJ),u=new s.A(i.Ro);function c(e){const t=p.get(e);if(t)return t;let n=o;if(e)if(e===a)n=a;else if(e===l)n=l;else{const t=e.wkid,i=e.latestWkid;if(null!=t||null!=i)(0,r.tl)(t)||(0,r.tl)(i)?n=a:((0,r.ZL)(t)||(0,r.ZL)(i))&&(n=l);else{const t=e.wkt2??e.wkt;if(t){const e=t.toUpperCase();e===d?n=a:e===f&&(n=l)}}}return p.set(e,n),n}const p=new Map,d=a.wkt.toUpperCase(),f=l.wkt.toUpperCase()},34403(e,t,n){n.d(t,{TP:()=>o});var i=n(79258);Math.PI;const s=i.$O.radius,r=i.$O.eccentricitySquared,o={a1:s*r,a2:s*r*s*r,a3:s*r*r/2,a4:s*r*s*r*2.5,a5:s*r+s*r*r/2,a6:1-r};i.$O.radius,i.$O.flattening,i.Sw.radius,i.Sw.flattening,i.sH.radius,i.sH.flattening,i.sH.radius},20521(e,t,n){n.r(t),n.d(t,{default:()=>Ae});var i=n(5482),s=n(37838),r=n(69540),o=n(49186),a=n(25728),l=n(17676),u=n(36708),c=n(91429),p=n(60950),d=n(89808),f=n(99959);const h=Symbol("isWCSGraphicOrigin");var m;class g extends f.A{get[(m=h,p.ym)](){return this.layer}get[d.Q](){return this.layer}constructor(e){super(),this[m]=!0,this.type="wcs",this.layer=e}get id(){return this.layer.id}}var v=n(4146),y=n(63074),w=n(69208),x=n(34287),b=n(8303),C=n(72545),I=n(54310),S=n(25036),A=n(82935),M=n(82806),R=n(53966),T=n(5443),D=n(38458),L=n(11254),P=n(330);function O(e){return e.endsWith("?")?e.slice(0,-1):e}function N(e){return e.filter(({coverageSubType:e})=>null==e||""===e||/^rectified(grid|dataset)/i.test(e))}function V(e){const t={};for(let n=0;n<e.childNodes.length;n++){const i=e.childNodes[n];if(1!==i.nodeType)continue;const s=(0,P.vv)(i).toLowerCase();switch(s){case"title":case"abstract":t[s]=(0,P.mX)(i);break;case"identifier":t.id=(0,P.mX)(i);break;case"wgs84boundingbox":{const e=(0,P.pN)(i,"LowerCorner"),n=(0,P.pN)(i,"UpperCorner");t.lonLatEnvelope=new T.A({xmin:e[0],ymin:e[1],xmax:n[0],ymax:n[1],spatialReference:{wkid:4326}})}break;case"coveragesummary":t.coverageSummaries=t.coverageSummaries||[],t.coverageSummaries.push(V(i))}}return t}function j(e,t){if(e.coverageSummaries)for(let n=0;n<e.coverageSummaries.length;n++)e.coverageSummaries[n].abstract=e.coverageSummaries[n].abstract||e.abstract,e.coverageSummaries[n].lonLatEnvelope=e.coverageSummaries[n].lonLatEnvelope||e.lonLatEnvelope,e.coverageSummaries[n].title=e.coverageSummaries[n].title||e.title,j(e.coverageSummaries[n],t);null!=e.id&&t.push(e)}function $(e){const t=(0,P.V6)(e.querySelector("Operation[name=GetCapabilities]"),"Get")?.getAttribute("xlink:href")||"",n=(0,P.V6)(e.querySelector("Operation[name=DescribeCoverage]"),"Get")?.getAttribute("xlink:href")||"",i=(0,P.V6)(e.querySelector("Operation[name=GetCoverage]"),"Get")?.getAttribute("xlink:href")||"";return{getCapabilities:O(t),describeCoverage:O(n),getCoverage:O(i)}}function E(e,t=null){let n=null;n="string"==typeof e?(new DOMParser).parseFromString(e,"text/xml"):e;let i=n.documentElement.getAttribute("version");"1.0"===i?i="1.0.0":"1.1"===i&&(i="1.1.0");const s=i||t||"1.0.0",r=s.slice(0,3);let a;if("2.0"===r)a=function(e){const t=(0,P.V6)(e,"ServiceIdentification"),n=(0,P.mX)(t,"Title"),i=(0,P.Dy)(t,"ServiceTypeVersion"),s=(0,P.Dy)(t,"Profile"),r=$((0,P.V6)(e,"OperationsMetadata")),o=(0,P.IC)(e,"Contents/CoverageSummary"),a=[];for(let e=0;e<o.length;e++){const t=o[e],n=(0,P.mX)(t,"CoverageId"),i=(0,P.V6)(t,"WGS84BoundingBox");let s;if(i){const e=(0,P.pN)(i,"LowerCorner"),t=(0,P.pN)(i,"UpperCorner");s=new T.A({xmin:e[0],ymin:e[1],xmax:t[0],ymax:t[1],spatialReference:{wkid:4326}})}const r=(0,P.mX)(t,"CoverageSubtype")||"RectifiedGridCoverage";a.push({id:n,lonLatEnvelope:s,coverageSubType:r})}const l=(0,P.V6)(e,"ServiceMetadata");return{name:n,supportedVersions:i,supportedFormats:(0,P.Dy)(l,"formatSupported"),supportedInterpolations:(0,P.Dy)(l,"interpolationSupported").concat((0,P.Dy)(l,"InterpolationSupported")),onlineResources:r,profiles:s,coverages:a,gridCoverages:N(a),version:"2.0.1"}}(n);else if("1.1"===r)a=function(e){const t=(0,P.mX)(e,"ServiceIdentification/Title"),n=(0,P.Dy)(e,"ServiceIdentification/ServiceTypeVersion"),i=$((0,P.V6)(e,"OperationsMetadata")),s=[],r=(0,P.V6)(e,"Contents");for(let e=0;e<r.childNodes.length;e++){const t=r.childNodes[e];1===t.nodeType&&(0,P.g7)(t,"CoverageSummary")&&j(V(t),s)}const o=(0,P.Dy)(r,"SupportedFormat");return{name:t,onlineResources:i,coverages:s,gridCoverages:N(s),supportedVersions:n,supportedFormats:o,version:"1.1.0"}}(n);else{if("1.0"!==r)throw new o.A("wcsraster:parsecapabilities","the capabilities version is not supported");a=function(e){const t=(0,P.mX)(e,"Service/name"),n=(0,P.V6)(e,"Capability"),i=(0,P.V6)(n,"GetCapabilities/Get/OnlineResource")?.getAttribute("xlink:href")??"",s=(0,P.V6)(n,"DescribeCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",r=(0,P.V6)(n,"GetCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",o={getCapabilities:O(i),describeCoverage:O(s),getCoverage:O(r)},a=(0,P.IC)(e,"CoverageOfferingBrief"),l=[];for(let e=0;e<a.length;e++){const t=a[e],n=(0,P.mX)(t,"name"),i=(0,P.IC)(t,"pos"),s=(0,P.pN)(i[0]),r=(0,P.pN)(i[1]),o=new T.A({xmin:s[0],ymin:s[1],xmax:r[0],ymax:r[1],spatialReference:{wkid:4326}});l.push({id:n,lonLatEnvelope:o})}return{name:t,onlineResources:o,coverages:l,gridCoverages:N(l),supportedVersions:["1.0.0"],version:"1.0.0"}}(n)}return a.version=s,a}var k=n(39829),G=n(4366),Z=n(87186);function F(e){e.variables.forEach(e=>e.dimensions.forEach(e=>e.values??=(0,G.Xg)(e)))}function _(e){return{requestResponseCRSs:(0,P.Dy)(e,"requestResponseCRSs").map(e=>e.split(":")[1]),nativeCRSs:(0,P.Dy)(e,"nativeCRSs").map(e=>e.split(":")[1])}}function X(e,t){const n=(0,P.Dy)(e,"1.0.0"===t?"interpolationMethod":"InterpolationMethod"),i="1.0.0"===t?e.getAttribute("default"):(0,P.mX)(e,"InterpolationMethods/Default");return null!=i?[i].concat(n.filter(e=>e.toLowerCase()!==i.toLowerCase())):n}function z(e){return null==e?["nearest"]:e.map(e=>{const t=e.toLowerCase();return t.includes("nearest")?"nearest":t.includes("linear")?"bilinear":t.includes("cubic")?"cubic":null}).filter(e=>!!e)}function W(e){const t=(0,P.IC)(e,"pos"),n=(0,P.pN)(t[0]),i=(0,P.pN)(t[1]);return new T.A({xmin:n[0],ymin:n[1],xmax:i[0],ymax:i[1],spatialReference:{wkid:4326}})}function B(e,t){const n=(0,P.Dy)(e,t);return n?.length&&""!==n[0]&&!isNaN(Number(n[0]))?n.map(e=>Number(e)):null}function q(e){const t=(0,P.pN)(e,"MinimumValue"),n=(0,P.pN)(e,"MaximumValue");return t.length&&n.length?t.map((e,t)=>({min:e,max:n[t],avg:-1,stddev:-1})):null}function U(e){return null==e?null:e.every(t=>t===e[0])?e[0]:e}function H(e){const t=[],n=(0,P.IC)(e,"RangeSet");let i=[];for(let e=0;e<n.length;e++){const s=(0,P.mX)(n[e],"name"),r=(0,P.mX)(n[e],"label"),o=[],a=B(n[e],"nullValues/singleValue"),l=(0,P.IC)(n[e],"AxisDescription");for(let e=0;e<l.length;e++){const t=(0,P.mX)(l[e],"name"),n=(0,P.mX)(l[e],"label"),s=(0,P.Dy)(l[e],"singleValue");if(0===s.length){const t=(0,P.mX)(l[e],"min"),n=(0,P.mX)(l[e],"max"),i=Number((0,P.mX)(l[e],"res"))||1;if(null!==t&&null!==n)for(let e=parseInt(t,10);e<=parseInt(n,10);e+=i)s.push(e.toString())}"band"===t.toLowerCase()&&(i=s),o.push({name:t,label:n,values:s})}t.push({name:s,label:r,nullValues:a,axis:o})}return{rangeSet:t,bandNames:i}}function K(e=null){if(!e)return{resolution:null,units:null};let t=e.toUpperCase();const n=["Years","Months","Days","Hours","Minutes","Seconds"];let i,s,r;return t.includes("PT")?(t=t.slice(2),r=["H","M","S"].findIndex(e=>t.includes(e)),i=n[3+r],s=parseFloat(t.slice(0,-1))):(t=t.slice(1),r=["Y","M","D"].findIndex(e=>t.includes(e)),r>-1&&(i=n[r]),s=parseFloat(t.slice(0,-1))),{resolution:s,units:i}}function J(e){const t=(0,P.IC)(e,"timeposition");if(t.length>0){const e=[];for(let n=0;n<t.length;n++)e.push(new Date((0,P.mX)(t[n])));return{begin:e[0],end:e[e.length-1],values:e}}const n=(0,P.V6)(e,"timePeriod")||(0,P.V6)(e,"TimePeriod");return n?{begin:new Date((0,P.mX)(n,"beginPosition")||(0,P.mX)(n,"BeginPosition")),end:new Date((0,P.mX)(n,"endPosition")||(0,P.mX)(n,"EndPosition")),...K((0,P.mX)(n,"timeResolution")||(0,P.mX)(n,"TimeResolution"))}:null}function Y(e){const t=(0,P.V6)(e,"spatialDomain"),n=(0,P.V6)(t,"Envelope")||(0,P.V6)(t,"EnvelopeWithTimePeriod"),i=n.getAttribute("srsName").split(":"),s=i[i.length-1],r=(0,P.IC)(n,"pos"),o=(0,P.pN)(r[0]),a=(0,P.pN)(r[1]),l=parseInt(s,10),u=isNaN(l)?null:{wkid:l},c=new T.A({xmin:o[0],ymin:o[1],xmax:a[0],ymax:a[1],spatialReference:u}),p=(0,P.V6)(t,"RectifiedGrid"),d=(0,P.mX)(p,"low").split(" "),f=(0,P.mX)(p,"high").split(" "),h=parseInt(f[0],10)-parseInt(d[0],10)+1,m=parseInt(f[1],10)-parseInt(d[1],10)+1,g=(0,P.pN)(t,"origin/pos"),v=(0,P.IC)(t,"offsetVector"),y={envelope:c,columns:h,rows:m,offset:{x:parseFloat((0,P.mX)(v[0]).split(" ")[0]),y:parseFloat((0,P.mX)(v[1]).split(" ")[1])},origin:{x:g[0],y:g[1]}},w=(0,P.V6)(e,"temporalDomain")||(0,P.V6)(e,"TemporalDomain");return{spatialDomain:y,temporalDomain:w?J(w):null}}function Q(e,t){const n=[],i=(0,P.IC)(e,"Field");let s,r=[];for(let e=0;e<i.length;e++){const o=(0,P.mX)(i[e],"Identifier"),a=(0,P.mX)(i[e],"Description"),l=(0,P.mX)(i[e],"Definition"),u=(0,P.mX)(i[e],"Abstract"),c=(0,P.mX)(i[e],"Title"),p=B(i[e],"NullValue"),d=(0,P.V6)(i[e],"AllowedValues"),f=d?q(d):null,h=X(i[e],"1.1.0"),m=[],g=(0,P.IC)(i[e],"Axis");for(let e=0;e<g.length;e++){const n=g[e].getAttribute("identifier"),i=(0,P.mX)(g[e],"UOM"),o=(0,P.mX)(g[e],"DataType"),a=(0,P.Dy)(g[e],"Key");t&&!n.toLowerCase().includes("band")||(r=a,s=p),m.push({identifier:n,uom:i,dataType:o,values:a,bandNoDataValues:s})}n.push({identifier:o,description:a,definition:l,abstract:u,title:c,supportedInterpolations:h,axis:m,nullValues:p,statistics:f})}return{rangeSet:n,bandNames:r,bandNoDataValues:s,statistics:n[0].statistics}}function ee(e){const t=(0,P.V6)(e,"SpatialDomain"),n=(0,P.V6)(t,"GridCRS"),i=(0,P.mX)(n,"GridBaseCRS"),s=(0,P.mX)(n,"GridOrigin"),r=s?.split(" ").map(e=>parseFloat(e))??[0,0],o=(0,P.pN)(n,"GridOffsets"),a=(0,P.IC)(t,"BoundingBox");let l,u,c,p;for(let e=0;e<a.length;e++){const t=a[e].getAttribute("crs")?.toLowerCase();if(null!=t)if(t.includes("imagecrs")){const t=(0,P.pN)(a[e],"LowerCorner"),n=(0,P.pN)(a[e],"UpperCorner");l=n[0]-t[0]+1,u=n[1]-t[1]+1}else if(t.indexOf("epsg")>0){const n=t.split(":");c=parseInt(n[n.length-1],10);const i=(0,P.pN)(a[e],"LowerCorner"),s=(0,P.pN)(a[e],"UpperCorner");p=new T.A({xmin:i[0],ymin:i[1],xmax:s[0],ymax:s[1],spatialReference:{wkid:c}})}}const d=l>u,f=p.xmax-p.xmin>p.ymax-p.ymin;let h=!1;(0,D.m)(c)&&(d===f?h=!1:(h=!0,p=new T.A({xmin:p.ymin,ymin:p.xmin,xmax:p.ymax,ymax:p.xmax,spatialReference:{wkid:c}})));const m={columns:l,rows:u,origin:{x:r[0],y:r[1]},offset:{x:o[0],y:o[o.length-1]},gridBaseCRS:i,envelope:p,useEPSGAxis:h},g=(0,P.V6)(e,"temporalDomain")||(0,P.V6)(e,"TemporalDomain");return{spatialDomain:m,temporalDomain:g?J(g):null}}function te(e){const t=(0,P.V6)(e,"Envelope")||(0,P.V6)(e,"EnvelopeWithTimePeriod"),n=t.getAttribute("srsName"),i=n.slice(n.lastIndexOf("/")+1),s=t.getAttribute("axisLabels").split(" ").map(e=>e.trim()).filter(e=>""!==e.trim()),r=(0,P.pN)(t,"lowerCorner"),o=(0,P.pN)(t,"upperCorner"),a=!["y","lat","latitude","north","nor","n","b"].includes(s[0].toLowerCase());let l;const u=parseInt(i,10),c=isNaN(u)?null:{wkid:u};l=new T.A(a?{xmin:r[0],ymin:r[1],xmax:o[0],ymax:o[1],spatialReference:c}:{xmin:r[1],ymin:r[0],xmax:o[1],ymax:o[0],spatialReference:c});const p={mins:r,maxs:o},d=t.getAttribute("uomLabels").trim().split(" ");let f,h;if((0,P.g7)(t,"EnvelopeWithTimePeriod")){f=new Date((0,P.mX)(e,"beginPosition")||(0,P.mX)(e,"BeginPosition")),h=new Date((0,P.mX)(e,"endPosition")||(0,P.mX)(e,"EndPosition"));const t=d?.findIndex(e=>"oledatetime"===e?.toLowerCase());t>-1&&(d[t]="ISO8601")}return{envelope:l,axisLabels:s,uomLabels:d.length?d:null,envelopeAllDims:p,beginPosition:f,endPosition:h,isEastFirst:a}}function ne(e,t){const n=[],i=(0,P.IC)(e,"DataRecord"),s=[];let r,o=[];for(let e=0;e<i.length;e++){const a=(0,P.IC)(i[e],"field"),l=[];for(let e=0;e<a.length;e++){const n=a[e].getAttribute("name"),i=(0,P.mX)(a[e],"description")||"",u=(0,P.V6)(a[e],"uom")?.getAttribute("code")||"",c=(0,P.pN)(a[e],"interval"),p=B(a[e],"nilValue")?.[0];t&&!n.toLowerCase().includes("band")||(s.push(n),c?.length&&(r=r||[],r.push({min:c[0],max:c[1],avg:-1,stddev:-1})),o.push(p)),l.push({name:n,description:i,uom:u,allowedValues:c,nilValue:p})}n.push(l)}return o.some(e=>null!=e)||(o=null),{rangeType:n,bandNames:s,bandStats:r,bandNoDataValues:o}}function ie(e){let t=1,n="";const i=.01;return Math.abs(e-1/24)<1/24*i?n="Hours":Math.abs(e-1)<1*i?n="Days":e<1?(t=Math.round(24*e),n="Hours"):e>28-i&&e<31+i||Math.round(e/30)<12?n="Months":e>365-i&&e<366+i&&(n="Years"),{interval:t,intervalUnit:n}}function se(e,t){const n=(0,P.V6)(e,"RectifiedGrid"),i=(0,P.pN)(n,"low"),s=(0,P.pN)(n,"high"),r=[];for(let e=0;e<i.length;e++)r.push(s[e]-i[e]+1);const o=(0,P.mX)(n,"axisLabels").split(" "),a=(0,P.pN)(n,"origin/pos"),l=(0,P.IC)(n,"offsetVector"),u=[];for(let e=0;e<l.length;e++){const t=(0,P.pN)(l[e]),n=t.findIndex(e=>0!==e);u[n]=t[n]}let c,p,d,f=!1;return t?.length&&o?.length&&(f=[...t].sort((e,t)=>e<t?-1:1).join(",")===[...o].sort((e,t)=>e<t?-1:1).join(",")),["y","lat","latitude","north","nor","n","b"].includes((f?o:t)[0].toLowerCase())?(c=r[1],p=r[0],d={y:Math.abs(u[0]),x:Math.abs(u[1])}):(c=r[0],p=r[1],d={x:Math.abs(u[0]),y:Math.abs(u[1])}),{columns:c,rows:p,origin:a,offset:u,resolution:d,gridSamples:r,axisLabels:o,hasSameAxisLabelsAsBoundedBy:f}}function re(e){const t=(0,P.V6)(e,"EarthObservation");if(!t)return null;const n=(0,P.V6)(t,"phenomenonTime"),i=n?J(n):null,s=(0,P.V6)(t,"phenomenonTime"),r=s?J(s):null,o=(0,P.mX)(t,"featureOfInterest/Footprint/multiExtentOf/MultiSurface/surfaceMembers/Polygon/exterior/LinearRing/posList");let a=null;if(o){const e=o.split(" ").map(e=>e.trim()).filter(e=>null!=e&&""!==e).map(Number);if(e.length){const t=[];for(let n=0;n<e.length/2;n+=2)t.push(e[n],e[n+1]);a=new k.A({rings:[[t]]})}}return{observation:{phenomenonTime:i,resultTime:r,footprint:a,identifier:(0,P.mX)(e,"metaDataProperty/EarthObservationMetaData/identifier"),acquisitionType:(0,P.mX)(e,"metaDataProperty/EarthObservationMetaData/acquisitionType"),status:(0,P.mX)(e,"metaDataProperty/EarthObservationMetaData/status")}}}async function oe(e,t){const{coverageIds:n,version:i,customParameters:s,signal:r}=t,a=i.slice(0,3),u="1.0"===a?"coverage":"1.1"===a?"identifiers":"coverageId",c={service:"WCS",request:"DescribeCoverage",version:i,[u]:n.join(","),...s};try{const{data:t}=await(0,L.A)(e,{query:c,responseType:"xml",signal:r});return function(e,t){let n=null;if(n="string"==typeof e?(new DOMParser).parseFromString(e,"text/xml"):e,"1.0.0"===t)return(0,P.IC)(n,"CoverageOffering").map(e=>function(e){const t={version:"1.0"};let n,i=[];for(let s=0;s<e.childNodes.length;s++){const r=e.childNodes[s];if(1===r.nodeType)if((0,P.g7)(r,"description"))t.description=(0,P.mX)(r);else if((0,P.g7)(r,"name"))t.name=(0,P.mX)(r);else if((0,P.g7)(r,"label"))t.label=(0,P.mX)(r);else if((0,P.g7)(r,"supportedFormats"))t.supportedFormats=(0,P.Dy)(r,"formats");else if((0,P.g7)(r,"supportedCRSs"))t.supportedCRSs=_(r);else if((0,P.g7)(r,"supportedInterpolations"))t.supportedInterpolations=X(r,"1.0.0");else if((0,P.g7)(r,"lonLatEnvelope"))t.lonLatEnvelope=W(r);else if((0,P.g7)(r,"rangeSet")){const e=H(r);t.rangeSet=e.rangeSet,i=e.bandNames;const s=e.rangeSet[0].nullValues;s?.length&&(n=U(s))}else(0,P.g7)(r,"domainSet")&&(t.domainSet=Y(r))}const s=z(t.supportedInterpolations),{name:r,description:o,label:a,lonLatEnvelope:l,supportedFormats:u}=t,{spatialDomain:c}=t.domainSet,p={x:Math.abs(c.offset.x),y:Math.abs(c.offset.y)},d=function(e){if(!e.temporalDomain)return null;const{begin:t,end:n,values:i,units:s,resolution:r}=e.temporalDomain,o={variables:[{name:"default",description:"",dimensions:[{name:"StdTime",description:"",unit:"ISO8601",values:i?.map(e=>e.getTime()),hasRegularIntervals:!i,interval:r,intervalUnit:s,extent:[t.getTime(),n.getTime()]}]}]};return F(o),o}(t.domainSet),f=new Z.A({width:c.columns,height:c.rows,pixelSize:p,pixelType:"unknown",extent:c.envelope,spatialReference:c.envelope.spatialReference,bandCount:i.length||1,noDataValue:n,multidimensionalInfo:d});return{id:r,title:t.name,description:o||a,lonLatEnvelope:l,rasterInfo:f,bandNames:i,supportedFormats:u,supportedInterpolations:s,coverageDescription:t,version:"1.0.0",useEPSGAxis:!1}}(e));const i=(0,P.IC)(n,"CoverageDescription");return"1.1.0"===t||"1.1.1"===t||"1.1.2"===t?i.map(e=>function(e,t){const n=[],i=[],s={supportedFormats:n,supportedCRSs:i,version:"1.1"};let r,o,a=[];for(let t=0;t<e.childNodes.length;t++){const l=e.childNodes[t];if(1!==l.nodeType)continue;const u=(0,P.vv)(l).toLowerCase();switch(u){case"title":case"abstract":case"identifier":s[u]=(0,P.mX)(l);break;case"supportedformat":{const e=(0,P.mX)(l);n.includes(e)||n.push(e)}break;case"supportedcrs":{const e=(0,P.mX)(l);i.includes(e)||i.push(e)}break;case"range":{const e=Q(l,!!s.domain?.temporalDomain);s.range=e.rangeSet,a=e.bandNames;const{bandNoDataValues:t}=e;t?.length&&(r=U(t)),o=e.statistics}break;case"domain":s.domain=ee(l)}}const l=z(s.range[0].supportedInterpolations),{identifier:u,abstract:c,title:p,domain:d,range:f}=s,h={x:Math.abs(d.spatialDomain.offset.x),y:Math.abs(d.spatialDomain.offset.y)},m=function(e,t){if(!t.temporalDomain)return null;const n=e.filter(e=>!e.identifier.toLowerCase().includes("field_1")&&!e.axis.some(e=>e.identifier.includes("band"))),i=[];if(n.length&&n.forEach(e=>{const t=e.axis.map(e=>{const t=e.values.map(t=>"ISO8601"===e.uom?(t=t.trim()).toLowerCase().includes("z")?new Date(t).getTime():new Date(t+"Z").getTime():parseFloat(t.trim())),n=[Math.min.apply(null,t),Math.max.apply(null,t)];return{name:e.identifier.trim(),description:"",field:e.identifier.trim(),unit:e.uom?e.uom.trim():"",hasRegularIntervals:!1,values:t,extent:n}});i.push({name:e.identifier.trim(),description:e.description?.trim()??"",unit:"",dimensions:t,statistics:e.statistics})}),t.temporalDomain){const{begin:e,end:n,values:s,units:r,resolution:o}=t.temporalDomain;i.some(e=>e.dimensions.some(e=>"stdtime"===e.name.toLowerCase()))||i.forEach(t=>{t.dimensions.push({name:"StdTime",description:"",unit:"ISO8601",values:s?.map(e=>e.getTime()),hasRegularIntervals:!s,interval:o,intervalUnit:r,extent:[e.getTime(),n.getTime()]})})}if(i.length){const e={variables:i};return F(e),e}return null}(f,d);m&&(r=f[0].nullValues,1===r?.length&&(r=r[0]));const g=new Z.A({width:d.spatialDomain.columns,height:d.spatialDomain.rows,pixelSize:h,pixelType:"unknown",extent:d.spatialDomain.envelope,spatialReference:d.spatialDomain.envelope.spatialReference,bandCount:a.length||1,noDataValue:r,statistics:o,multidimensionalInfo:m});return{id:u,title:s.title,description:c||p,bandNames:a,rasterInfo:g,supportedFormats:n,supportedInterpolations:l,coverageDescription:s,version:t,useEPSGAxis:d.spatialDomain.useEPSGAxis}}(e,t)):i.map(e=>function(e){const t={version:"2.0"};let n,i,s=[];for(let r=0;r<e.childNodes.length;r++){const o=e.childNodes[r];if(1===o.nodeType)if((0,P.g7)(o,"coverageId"))t.coverageId=(0,P.mX)(o);else if((0,P.g7)(o,"ServiceParameters"))t.serviceParameters={supportedFormats:(0,P.Dy)(o,"nativeFormat")};else if((0,P.g7)(o,"boundedBy"))t.boundedBy=te(o);else if((0,P.g7)(o,"rangeType")){const e=ne(o,t.boundedBy?.axisLabels.length>2||t.domainSet?.axisLabels.length>2);t.rangeType=e.rangeType,s=e.bandNames,n=e.bandStats;const{bandNoDataValues:r}=e;r?.length&&(i=U(r))}else if((0,P.g7)(o,"domainSet"))t.domainSet=se(o,t.boundedBy?.axisLabels);else if((0,P.g7)(o,"metadata")){const e=(0,P.V6)(o,"EOMetadata");t.eoMetadata=e?re(e):null}}const{coverageId:r,boundedBy:o,domainSet:a,rangeType:l,serviceParameters:u}=t,c=function(e,t,n){if(n.axisLabels.length<=2)return null;const i=[];for(let t=0;t<e.length;t++){const n=e[t];for(let e=0;e<n.length;e++)n[e].name.toLowerCase().includes("band")||i.push(n[e])}const s=[];if(i.length){const e=[];for(let i=2;i<n.axisLabels.length;i++){const s=t.uomLabels?.[i]?.trim()??"",r=n.axisLabels[i].toLowerCase().includes("time")||"iso8601"===s.toLowerCase()||"oledatetime"===s.toLowerCase();let o,a;if(r){const e=ie(n.offset[i]);o=e.interval,a=e.intervalUnit}else o=n.offset[i],a=s;const l=[];r?(l.push((0,G.$E)(t.envelopeAllDims.mins[i])),l.push((0,G.$E)(t.envelopeAllDims.maxs[i]))):(l.push(t.envelopeAllDims.mins[i]),l.push(t.envelopeAllDims.maxs[i])),e.push({name:n.axisLabels[i].trim(),description:n.axisLabels[i].trim(),unit:r?"ISO8601":s,hasRegularIntervals:!0,extent:l,interval:o,intervalUnit:a})}if(i.forEach(t=>{const{allowedValues:n}=t,i=2===n?.length?[{min:n[0],max:n[1],avg:-1,stddev:-1}]:null;s.push({name:t.name.trim(),description:t.description?.trim()??"",unit:t.uom.trim(),statistics:i,dimensions:[...e]})}),s.length){const e={variables:s};return F(e),e}}return null}(l,o,a);return!n&&c&&(n=c?.variables[0].statistics),null!=c&&(i=l[0][0].nilValue),{id:r,title:r,description:r,bandNames:s,rasterInfo:new Z.A({width:a.columns,height:a.rows,pixelSize:a.resolution,pixelType:"unknown",extent:o.envelope,spatialReference:o.envelope.spatialReference,bandCount:s.length||1,statistics:n,noDataValue:i,multidimensionalInfo:c}),supportedFormats:u.supportedFormats,coverageDescription:t,version:"2.0.1",useEPSGAxis:!1}}(e))}(t,i)}catch(e){if(!(0,l.zf)(e))throw new o.A("wcslayer:open","wcs coverage description is not valid or supported");throw e}}var ae=n(49859);function le(e,t,n=0){const i="--"+t.boundary,s=[];for(let e=0;e<i.length;e++)s.push(i.charCodeAt(e));const r=[],o="\n--"+t.boundary+"--";for(let e=0;e<o.length;e++)r.push(o.charCodeAt(e));const a=[10],l=[13,10],u=[],c=s.length,p=new Uint8Array(e,n),d=p.length-c;let f=0,h=0;for(let e=0;e<d;e++){for(h=0;h<c&&p[e+h]===s[h];h++);if(h!==c)continue;let n=!1;if(f){const i=ue(p.subarray(f,e),t);u.push(i),n=!!i.isValidImage}if(e+=c-1,p[e+1]===a[0]?e+=1:p[e+1]===l[0]&&p[e+2]===l[1]&&(e+=2),f=e+1,n)break}const m=r.length;for(let e=p.length-m-10;e<p.length-m;e++){for(h=0;h<m&&p[e+h]===r[h];h++);if(h===m){u.push(ue(p.subarray(f,e),t));break}}return u}function ue(e,t){const n=String.fromCharCode.apply(null,e.subarray(0,Math.min(300,e.length))).split("\n"),i=Math.min(n.length,7),s={contentDisposition:"inline"};let r=0;for(let o=0;o<i;o++)if(n[o].length<4)r=r+n[o].length+1;else if("content"===n[o].slice(0,7).toLowerCase()){r=r+n[o].length+1;const e=n[o].indexOf(":");if(-1===e)continue;const t=n[o].slice(0,e).trim(),i=n[o].slice(e+1).trim();switch(t.toLowerCase()){case"content-type":s.contentType=i;break;case"content-description":s.contentDescription=i;break;case"content-transfer-encoding":s.contentTransferEncoding=i;break;case"content-id":s.contentID=i;break;case"content-disposition":s.contentDisposition=i;break;case"content-location":s.contentLocation=i}}else{if(s.contentDisposition.toLowerCase().includes("inline")&&n[o].length>=4&&s.contentType?.toLowerCase().includes("image")){let t=!0,n=e.subarray(r,e.length);if(s.contentType.toLowerCase().indexOf("tif")>0){if("base64"===s.contentTransferEncoding){let e="";const t=n;for(let n=0;n<t.length;n+=65535){const i=t.subarray(n,n+65535>t.length-1?t.length-1:n+65535);e+=String.fromCharCode.apply(null,i)}const i=atob(e);n=new Uint8Array(i.length);for(let e=0;e<n.length;e++)n[e]=i.charCodeAt(e)}t=73===n[0]&&73===n[1]||77===n[0]&&77===n[1]}if(t){let t=n.buffer;"base64"!==s.contentTransferEncoding&&(t=new ArrayBuffer(e.length-r),n=new Uint8Array(t),n.set(e.subarray(r,e.length))),s.contentData=t,s.isValidImage=!0}break}if((""===t.start||s.contentID===t.start)&&s.contentType){if(s.contentType.includes("text")||s.contentType.includes("xml")){s.contentData=String.fromCharCode.apply(null,e.subarray(r,e.length));break}s.contentData=e.subarray(r,e.length)}}return s}var ce=n(20758),pe=n(47520),de=n(45617);const fe=["nearest neighbor","bilinear","bicubic"],he=["nearest","linear","cubic"],me="response is not a supported multipart/related mediaType with inline tiff, switching to compatibility mode",ge=new Set(["1.0.0","1.1.0","1.1.1","1.1.2","2.0.1"]);let ve=class extends ae.A{constructor(){super(...arguments),this.datasetFormat="WCSServer",this.tileType="Raster"}get rasterId(){return`${this.url}-${this.coverageId}-${this.version}`}async fetchRawTile(e,t,n,i={}){if(this.isBlockOutside(e,t,n))return null;const{nativePixelSize:s,spatialReference:r}=this.rasterInfo,a=2**e,l=s.x*a,u=s.y*a,{blockWidth:c,blockHeight:p}=this.getBlockWidthHeight(e),{origin:d}=this.rasterInfo.storageInfo.tileInfo,f=this.getTileExtent({x:l,y:u},t,n,d,r,[c,p]),h=this.rasterInfo.extent,m=f.xmax>h.xmax,g=f.ymin<h.ymin,v=m||g;let y=f,w=c,x=p;if(v&&(y=f.clone().intersection(h),null!=y&&(m&&(w=Math.floor((y.xmax-y.xmin)/l),y.xmax=y.xmin+l*w),g&&(x=Math.floor((y.ymax-y.ymin)/u),y.ymin=y.ymax-u*x))),null==y||w<=1||x<=1)return null;const b=await this._getCoverage(y,w,x,a,i);if(!b)return null;const{coverageDescription:C}=this.coverageInfo,{noDataValue:I,multidimensionalInfo:S}=this.rasterInfo,{multidimensionalDefinition:A}=i;let M;if(null!=S&&null!=A&&A.length){const e=A[0].variableName;if("2.0"===C.version){const t=C.rangeType[0].find(t=>t.name===e);M=t?.nilValue}else if("1.1"===C.version){const t=C.range.find(t=>t.identifier===e);M=t?.nullValues}}const R=M??I,T=await this.decodePixelBlock(b,{width:w,height:x,planes:null,pixelType:null,tiffNoDataValue:Array.isArray(R)?R[0]:R,matchAllNoData:!0});if(null==T)return null;if(T&&(T.width!==w||T.height!==x))throw new o.A("wcsraster-fetch",`the response has unexpected dimension width: ${T.width}, height: {pixelBlock.height}`);return v?(0,pe.$Q)(T,{x:0,y:0},{width:p,height:p}):T}async _open(e){const{customFetchParameters:t}=this.ioConfig,n=e?.signal,i=await async function(e,t){const{version:n,customParameters:i,signal:s}=t??{},r=n?.startsWith("1.0")?"version":"acceptVersions",a={service:"WCS",request:"GetCapabilities",[r]:n,...i};try{let{data:n}=await(0,L.A)(e,{query:a,responseType:"xml",signal:s});return t?.version||function(e){let t=null;t="string"==typeof e?(new DOMParser).parseFromString(e,"text/xml"):e;const n=t.documentElement.getAttribute("version"),i=n?.slice(0,3);return null!=i&&i<"2.1"}(n)||(a[r]="2.0.1",({data:n}=await(0,L.A)(e,{query:a,responseType:"xml",signal:s}))),E(n)}catch(e){if(!(0,l.zf)(e))throw new o.A("wcslayer:open","wcs capabilities is not valid or supported");throw e}}(this.url,{version:t?.version??this.version,customParameters:t,signal:n});if(this.capabilities=i,!this.version){let e=i.version.slice(0,3);"2.0"===e||"1.1"===e||"1.0"===e?this.version=i.version:(e=i.supportedVersions.find(e=>"2.0.1"===e)||i.supportedVersions.find(e=>e.startsWith("2.0"))||i.supportedVersions.find(e=>e.startsWith("1.1"))||i.supportedVersions.find(e=>e.startsWith("1.0"))||"1.0.0",this.version=e)}const{version:s}=this;if(!ge.has(s))throw new o.A("wcsraster-open",`unsupported WCS version ${s}`);const{gridCoverages:r}=i;if(!r.length)throw new o.A("wcsraster-open","cannot find rectified grid coverages");this.coverageId??=r[0].id;const{coverageId:a}=this,u=r.find(e=>e.id===a);if(null==u)throw new o.A("wcsraster-open",`the coverageId ${a} does not exist in capabilities`);const c=await oe(this.url,{coverageIds:[a],version:s,customParameters:t,signal:n});if(this.coverageInfo=c[0],s.startsWith("2.0")){const{coverageInfo:e}=this;e.lonLatEnvelope=u.lonLatEnvelope,e.supportedInterpolations=z(i.supportedInterpolations),this._patchDimensionValues201(a,n)}this.datasetName=this.coverageInfo.title;const{rasterInfo:p}=this.coverageInfo;if(this.createRemoteDatasetStorageInfo(p,512,512),this._set("rasterInfo",p),null==p.spatialReference)throw new o.A("wcsraster-open",`coverage without spatial reference is not supported: ${a}`);const{pixelType:d,bandCount:f}=await this._getPixelTypeAndBandCount(n);p.pixelType=d,1===p.bandCount&&f>1&&(p.bandCount=f),this.updateTileInfo()}async _patchDimensionValues201(e,t){const{coverageInfo:n}=this,i=n.rasterInfo.multidimensionalInfo?.variables,s=ge.has("1.1.2")?"1.1.2":ge.has("1.1.1")?"1.1.1":ge.has("1.1.0")?"1.1.0":null,{customFetchParameters:r}=this.ioConfig;if(i&&s)try{const n=this.url.includes("/ImageServer/"),o=e.length>8&&e.startsWith("Coverage")&&n?e.slice(8):e,a=await oe(this.url,{coverageIds:[o??e],version:s,customParameters:r,signal:t}).catch(()=>{if(o)return oe(this.url,{coverageIds:[e],version:s,customParameters:r,signal:t})}),l=a?.[0].rasterInfo.multidimensionalInfo?.variables;if(l)for(const e of i){const t=l.find(({name:t})=>t===e.name);if(t?.dimensions?.length)for(let i=e.dimensions.length-1;i>=0;i--){const s=e.dimensions[i],r=t.dimensions.find(({name:e})=>e===s.name);r?r.values&&r.extent?.join(",")===s.extent?.join(",")&&(e.dimensions[i]={...s,values:r.values}):n&&e.dimensions.splice(i,1)}}}catch{}}async _getPixelTypeAndBandCount(e){const{pixelSize:t,extent:n,multidimensionalInfo:i}=this.rasterInfo,s=n.center,r=new T.A({xmin:s.x-t.x,xmax:s.x+t.x,ymin:s.y-t.y,ymax:s.y+t.y,spatialReference:n.spatialReference});let a=[];if(null!=i){const e=i.variables[0];a=[],e.dimensions.forEach(t=>{a.push(new de.A({variableName:e.name,dimensionName:t.name,values:t.hasRegularIntervals?t.extent?.[0]:t.values?.[0],isSlice:!0}))})}const{coverageDescription:l}=this.coverageInfo,u={interpolation:"nearest",multidimensionalDefinition:a,signal:e},{version:c}=l,{ioConfig:p}=this,d="2.0"===c&&null==p.allowAnyMediaType||"1.1"===c&&null==p.use2GridOffsets;let f;try{f=await this._getCoverage(r,2,2,1,u,!0)}catch(e){if(!d)throw e;if("1.1"===c){if(!e.details?.isResolutionMismatch)throw e;p.use2GridOffsets=!0}}if(!f&&d&&("2.0"===c&&(p.allowAnyMediaType=!0),f=await this._getCoverage(r,2,2,1,u),f&&R.A.getLogger(this).warn("wcsraster:getcoverage",me)),!f)throw new o.A("wcsraster-open","unable to determine pixel type");const h=await this.decodePixelBlock(f,{width:2,height:2,planes:null,pixelType:null});if(null==h)throw new o.A("wcsraster-open","unable to determine pixel type");return{pixelType:h.pixelType,bandCount:h.getPlaneCount()??0}}async _getCoverage(e,t,n,i,s,r=!1){const{coverageDescription:a}=this.coverageInfo,{version:l}=a,u="2.0"===l?this._getCoverage201Parameters(e,t,n,i,s,a):"1.1"===l?this._getCoverage110Parameters(e,t,n,s,a):this._getCoverage100Parameters(e,t,n,s),c="2.0"===l?await this.request(this._constructWCS201Url(u),{signal:s.signal,responseType:"array-buffer"}):await this.request(this.url,{query:u,signal:s.signal,responseType:"array-buffer"});if("1.0"===l)return c.data;if("2.0"===l&&!1!==this.ioConfig.allowAnyMediaType&&"tiff"===(0,ce.g)(c.data))return r&&(this.ioConfig.allowAnyMediaType=!0,R.A.getLogger(this).warn("wcsraster:getcoverage",me)),c.data;const p=function(e){const t=function(e){const t=e.getHeader?.("Content-Type")?.split(";");if(!t)return null;if(!(t[0].trim()??"").startsWith("multipart/"))return null;const n={boundary:"",start:"",type:""};for(let e=1;e<t.length;e++){const i=t[e].indexOf("=");if(i>0){const s=t[e].slice(0,i).trim(),r=t[e].slice(i+1).trim();n[s]=r.startsWith('"')?r.slice(1,-1):r}}return n}(e);return t?{isMultipart:!0,data:t.boundary?le(e.data,t,0):null}:{isMultipart:!1,data:null}}(c);if(p.isMultipart&&p.data){const e=p.data.find(e=>e.isValidImage);return r&&"base64"===e?.contentTransferEncoding&&R.A.getLogger(this).warn("wcsraster:getcoverage","response is base64 encoded which may impact layer display performance"),e?.contentData}const d=new Uint8Array(c.data,0,Math.min(c.data.byteLength,2e3)),f=String.fromCharCode.apply(null,d).toLowerCase().includes("exception"),h=f&&String.fromCharCode.apply(null,d).includes("A non-zero RESX/RESY or WIDTH/HEIGHT is required but neither was provided");if(f)throw new o.A("wcsraster:getcoverage","server returns an exception",{isResolutionMismatch:h});throw new o.A("wcsraster:getcoverage","response is not a supported multipart mediaType with inline tiff")}_getInterpolationIndex(e){return e&&this.coverageInfo.supportedInterpolations?.includes(e)?"nearest"===e?0:"bilinear"===e?1:"cubic"===e?2:0:0}_getCoverage100Parameters(e,t,n,i){const s=`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`,r=e.spatialReference.wkid,o=(this.coverageInfo.supportedFormats||[]).find(e=>e.toLowerCase().includes("tiff"))||"GEOTIFF",{bandIds:a,interpolation:l}=i,u=this._getInterpolationIndex(l),c=a?a.map(e=>this.coverageInfo.bandNames[e]):null,p=fe[u],{multidimensionalDefinition:d}=i;let f;if(null!=d&&null!=this.rasterInfo.multidimensionalInfo){const e=d.find(e=>"StdTime"===e.dimensionName);let t=e?.values;t&&t.length>0&&(Array.isArray(t[0])&&(t=t[0]),f=t.map(e=>ye(e)).join(","))}return{service:"WCS",request:"GetCoverage",version:this.version,coverage:this.coverageId,format:o,crs:`EPSG:${r}`,bbox:s,width:t,height:n,time:f,interpolation:p,band:c?.join(",")}}_getCoverage110Parameters(e,t,n,i,s){const{multidimensionalDefinition:r,bandIds:o,interpolation:a}=i,l=e.spatialReference.wkid,u=`urn:ogc:def:crs:EPSG::${l}`,c=(this.coverageInfo.supportedFormats||[]).find(e=>e.toLowerCase().includes("tiff"))||"image/tiff",p=this._getInterpolationIndex(a),d=he[p],f=null==a||0===this.coverageInfo.supportedInterpolations?.indexOf(a),h=s.domain.spatialDomain,m=h.origin.x<=h.envelope.xmin&&h.origin.y<=h.envelope.ymin,g=e.width/t,v=e.height/n*(m?1:-1),y=m?[e.xmin,e.ymin]:[e.xmin,e.ymax],w=h.useEPSGAxis&&(0,D.m)(l),x=w?`${y[1]},${y[0]}`:`${y[0]},${y[1]}`,b=this.ioConfig.use2GridOffsets,C=w?b?`${v},${g}`:`${v},0,0,${g}`:b?`${g},${v}`:`${g},0,0,${v}`,I=g/2,S=e.xmin+I,A=e.xmax-I,M=Math.abs(v)/2,R=e.ymin+M,T=e.ymax-M,L=w?`${R},${S},${T},${A},${u}`:`${S},${R},${A},${T},${u}`,P=s.range.find(e=>e.axis.some(e=>e.identifier.toLowerCase().includes("band")));let O,N=P&&d&&o?f?`${P.identifier}[${P.axis[0].identifier}[${o.join(",")}]]`:`${P.identifier}:${d}[${P.axis[0].identifier}[${o.join(",")}]]`:null;if(null!=r&&r.length)for(let e=0;e<r.length;e++){let t=r[e].values;const n=r[e].dimensionName?.toLowerCase(),i=r[e].variableName?.toLowerCase(),o=s.range.find(e=>e.identifier.toLowerCase()===i);if(t.length>0)if(Array.isArray(t[0])&&(t=t[0]),"stdtime"===n)O=t.map(e=>ye(e)).join(",");else if(o){const e=o.axis.find(e=>e.identifier.toLowerCase()===n);e&&(N=f?o.identifier+"["+e.identifier+"["+t.join(",")+"]]":o.identifier+":"+d+"["+e.identifier+"["+t.join(",")+"]]")}e===r.length-1&&o&&!N&&(N=f?o.identifier:o.identifier+":"+d)}return{service:"WCS",request:"GetCoverage",version:this.version,identifier:this.coverageId,format:c,crs:`EPSG:${l}`,boundingbox:L,gridCS:"urn:ogc:def:cs:OGC:0.0:Grid2dSquareCS",gridType:"urn:ogc:def:method:WCS:1.1:2dGridIn2dCrs",gridOrigin:x,gridOffsets:C,gridBaseCRS:u,timeSequence:O,rangeSubset:N}}_getCoverage201Parameters(e,t,n,i,s,r){const{multidimensionalDefinition:o,interpolation:a}=s,l=this._getInterpolationIndex(a);let u=null;const{supportedInterpolations:c}=this.capabilities;if(c?.length)switch(l){case 0:u=c.find(e=>e.toLowerCase().includes("nearest"));break;case 1:u=c.find(e=>e.toLowerCase().includes("linear"));break;case 2:u=c.find(e=>e.toLowerCase().includes("cubic")||e.toLowerCase().includes("quadratic"))}const p=(this.coverageInfo.supportedFormats||[]).find(e=>e.toLowerCase().includes("tiff"))||"image/tiff",{bandNames:d}=this.coverageInfo,{boundedBy:f,domainSet:h,rangeType:m}=r,g=f.isEastFirst?0:1,v=1-g,{axisLabels:y}=f,w=y[g],x=y[v],b=`http://www.opengis.net/def/crs/EPSG/0/${e.spatialReference.wkid}`,C=b,I=[];I.push(`${w}(${e.xmin},${e.xmax})`),I.push(`${x}(${e.ymin},${e.ymax})`);const S=[];if(y.length>2)for(let e=2;e<y.length;e++){const t=h.origin[e];if(y[e].toLowerCase().includes("time")){let n=t.toString();f.uomLabels?.[e].toLowerCase().includes("ole")&&(S.push(y[e]),n=ye(t,!0)),I.push(y[e]+",http://www.opengis.net("+n+")")}else I.push(y[e]+",http://www.opengis.net("+t+")")}let A=null;if(null!=o&&o.length){const e=[];m.forEach(t=>t.forEach(t=>e.push(t.name)));const t=[];for(let n=0;n<o.length;n++){const i=y.find(e=>e===o[n].dimensionName),s=e.find(e=>e===o[n].variableName);if(t.includes(s)||t.push(s),i){let e=o[n].values;if(e.length>0){Array.isArray(e[0])&&(e=e[0]);let t="";t=i.toLowerCase().includes("time")?e.map(e=>ye(e)).join(","):e.join(",");const n=I.findIndex(e=>e.startsWith(i+",http://www.opengis.net"));-1===n&&I.push(i+",http://www.opengis.net("+t+")"),-1===n||I[n].includes("("+t+")")||I.splice(n,1,i+",http://www.opengis.net("+t+")")}}}t.length&&(A=t.join(","))}else d?.length>=2&&(A=(s.bandIds?s.bandIds.map(e=>d[e]):d).join(","));const M=I.join("&subset="),R=!r.domainSet.hasSameAxisLabelsAsBoundedBy&&!1!==this.ioConfig.allowScaleFactor,T=R?null:`${w}(${t}),${x}(${n})`,D=R?1/i:null;return{service:"WCS",request:"GetCoverage",version:this.version,coverageId:this.coverageId,rangesubset:A,interpolation:u,scaleSize:T,scaleFactor:D,subset:M,format:p,mediaType:this.ioConfig.allowAnyMediaType?null:"multipart/related",outputcrs:b,subsettingcrs:C}}_constructWCS201Url(e){const t={...this.ioConfig.customFetchParameters,...e},n=[];return Object.keys(t).forEach(e=>{const i=t[e];null!=i&&("subset"===e?"string"==typeof i&&i.split("&subset=").forEach(e=>{e&&n.push(`subset=${encodeURIComponent(e)}`)}):n.push(`${e}=${encodeURIComponent(i)}`))}),`${encodeURI(this.url)}?${n.join("&")}`}};function ye(e,t=!1){return(t?new Date((0,G.$E)(e)):new Date(e)).toISOString()}(0,i.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],ve.prototype,"datasetFormat",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],ve.prototype,"tileType",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],ve.prototype,"version",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],ve.prototype,"coverageId",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],ve.prototype,"rasterId",null),ve=(0,i.Cg)([(0,c.$K)("esri.layers.raster.datasets.WCSRaster")],ve);var we=n(10873),xe=n(20437),be=n(74797),Ce=n(30291);const Ie=new Set(["milliseconds","seconds","minutes","hours","days","weeks","months","years","decades","centuries"]);let Se=class extends((0,y.dM)((0,S.j)((0,x.q)((0,b.A)((0,w.d)((0,M.b)((0,C.G)((0,A.e)((0,I.J)((0,a.M)((0,r.OU)(v.A)))))))))))){constructor(...e){super(...e),this.charts=null,this.coverageId=null,this.version=null,this.isReference=null,this.graphicOrigin=new g(this),this.legendEnabled=!0,this.noData=0,this.operationalLayerType="WCS",this.type="wcs",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this._debouncedSaveOperations=(0,l.sg)(async(e,t,i)=>{const{save:s,saveAs:r}=await n.e(9838).then(n.bind(n,59838));switch(e){case 0:return s(this,t);case 1:return r(this,i,t)}})}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WCS"]},e).catch(l.QP).then(()=>this._openRaster(t))),Promise.resolve(this)}get renderer(){return super.renderer}set renderer(e){super.renderer=e}get coverageInfo(){return this.raster.coverageInfo}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[(0,be.rZ)("Pixel Value")],t=this.raster?.rasterInfo??this.serviceRasterInfo,n=t?.multidimensionalInfo;if(n){const t=(0,be.AL)(n);e.push(...t)}return e}createPopupTemplate(e){return(0,Ce.tn)({fields:this.rasterFields,title:this.title},e)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}async _openRaster(e){const t=new ve({url:this.url,version:this.version,coverageId:this.coverageId,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters}});if(await t.open({signal:e}),!t.rasterInfo)throw t.destroy(),new o.A("wcs-layer:load","cannot load resources on "+this.url);const{rasterInfo:n}=t;null==n.noDataValue&&(n.noDataValue=this.noData),this._set("serviceRasterInfo",n),this._set("spatialReference",n.spatialReference),null==this.title&&this.setAtOrigin("title",t.datasetName,"service"),null==this.coverageId&&this.setAtOrigin("coverageId",t.coverageInfo.id,"service"),null==this.version&&t.version&&this.setAtOrigin("version",t.version,"service"),this.setAtOrigin("tileInfo",t.rasterInfo.storageInfo.tileInfo,"service");const{multidimensionalInfo:i}=n;if(null!=i){const e=i.variables[0].dimensions.find(({name:e})=>"StdTime"===e);if(e){let t=e.extent?.[0]??e.values[0];Array.isArray(t)&&(t=t[0]);let n=e.extent?.[1]??e.values[e.values.length-1];Array.isArray(n)&&(n=n[1]);const i=Ie.has(e.intervalUnit?.toLowerCase())?e.intervalUnit?.toLowerCase():null;this.set("timeInfo",{startField:"StdTime",fullTimeExtent:{start:t,end:n},timeZone:null,interval:i?{value:e.interval,unit:i}:null})}}this.raster=t,this._configDefaultSettings(),this.addHandles((0,u.wB)(()=>this.customParameters,e=>this.raster.ioConfig.customFetchParameters=e))}};(0,i.Cg)([(0,c.MZ)({json:{origins:{"web-scene":{write:!1}},write:!0}})],Se.prototype,"charts",void 0),(0,i.Cg)([(0,c.MZ)({type:String,nonNullable:!0,json:{name:"wcsInfo.coverageId",write:{isRequired:!0,ignoreOrigin:!0}}})],Se.prototype,"coverageId",void 0),(0,i.Cg)([(0,c.MZ)()],Se.prototype,"coverageInfo",null),(0,i.Cg)([(0,c.MZ)({type:["1.0.0","1.1.0","1.1.1","1.1.2","2.0.1"],nonNullable:!0,json:{name:"wcsInfo.version",write:{isRequired:!0,ignoreOrigin:!0}}})],Se.prototype,"version",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Se.prototype,"isReference",void 0),(0,i.Cg)([(0,c.MZ)({json:{read:!0,write:!0}})],Se.prototype,"blendMode",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0,clonable:!1})],Se.prototype,"graphicOrigin",void 0),(0,i.Cg)([(0,c.MZ)(we.fV)],Se.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,c.MZ)({type:["show","hide"]})],Se.prototype,"listMode",void 0),(0,i.Cg)([(0,c.MZ)()],Se.prototype,"noData",void 0),(0,i.Cg)([(0,c.MZ)({type:["WCS"]})],Se.prototype,"operationalLayerType",void 0),(0,i.Cg)([(0,c.MZ)()],Se.prototype,"raster",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],Se.prototype,"type",void 0),(0,i.Cg)([(0,c.MZ)(we.M6)],Se.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,c.MZ)({type:s.A,json:{name:"popupInfo",write:!0}})],Se.prototype,"popupTemplate",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],Se.prototype,"defaultPopupTemplate",null),(0,i.Cg)([(0,c.MZ)({readOnly:!0,type:[xe.A]})],Se.prototype,"fields",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0,type:[xe.A]})],Se.prototype,"rasterFields",null),Se=(0,i.Cg)([(0,c.$K)("esri.layers.WCSLayer")],Se);const Ae=Se},38458(e,t,n){n.d(t,{m:()=>s});const i=[[3819,3819],[3821,3824],[3889,3889],[3906,3906],[4001,4025],[4027,4036],[4039,4047],[4052,4055],[4074,4075],[4080,4081],[4120,4176],[4178,4185],[4188,4216],[4218,4289],[4291,4304],[4306,4319],[4322,4326],[4463,4463],[4470,4470],[4475,4475],[4483,4483],[4490,4490],[4555,4558],[4600,4646],[4657,4765],[4801,4811],[4813,4821],[4823,4824],[4901,4904],[5013,5013],[5132,5132],[5228,5229],[5233,5233],[5246,5246],[5252,5252],[5264,5264],[5324,5340],[5354,5354],[5360,5360],[5365,5365],[5370,5373],[5381,5381],[5393,5393],[5451,5451],[5464,5464],[5467,5467],[5489,5489],[5524,5524],[5527,5527],[5546,5546],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3038,3051],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3150,3151],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3389,3390],[3416,3417],[3833,3841],[3844,3850],[3854,3854],[3873,3885],[3907,3910],[4026,4026],[4037,4038],[4417,4417],[4434,4434],[4491,4554],[4839,4839],[5048,5048],[5105,5130],[5253,5259],[5269,5275],[5343,5349],[5479,5482],[5518,5519],[5520,5520],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]];function s(e){return null!=e&&i.some(([t,n])=>e>=t&&e<=n)}},91806(e,t,n){n.d(t,{A:()=>l});var i,s=n(5482),r=n(25482),o=n(91429),a=n(56507);let l=class extends r.o{static{i=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 i({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,s.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"cols",void 0),(0,s.Cg)([(0,o.MZ)({type:a.jz,json:{write:!0}})],l.prototype,"level",void 0),(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],l.prototype,"levelValue",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"origin",void 0),(0,s.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],l.prototype,"resolution",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"rows",void 0),(0,s.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],l.prototype,"scale",void 0),l=i=(0,s.Cg)([(0,o.$K)("esri.layers.support.LOD")],l)},87045(e,t,n){n.d(t,{A:()=>w});var i,s=n(5482),r=n(66552),o=n(25482),a=n(86211),l=n(91429),u=n(56507),c=n(86738),p=n(16930),d=n(21325),f=n(28735),h=n(91806),m=n(72802),g=n(36005),v=n(43937);const y=new r.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",pbf:"pbf"});let w=class extends o.o{static{i=this}static create(e={}){const{resolutionFactor:t=1,scales:n,size:s=256,spatialReference:r=p.A.WebMercator,numLODs:o=24}=e;if(!(0,d.fn)(r)){const e=[];if(n)for(let t=0;t<n.length;t++){const i=n[t];e.push(new h.A({level:t,scale:i,resolution:i}))}else{let t=5e-4;for(let n=o-1;n>=0;n--)e.unshift(new h.A({level:n,scale:t,resolution:t})),t*=2}return new i({dpi:96,lods:e,origin:new c.A(0,0,r),size:[s,s],spatialReference:r})}const l=(0,d.Vp)(r),u=e.origin?new c.A({x:e.origin.x,y:e.origin.y,spatialReference:r}):new c.A(l?{x:l.origin[0],y:l.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),f=1/(39.37*(0,a.GA)(r)*96),m=[];if(n)for(let e=0;e<n.length;e++){const t=n[e],i=t*f;m.push(new h.A({level:e,scale:t,resolution:i}))}else{let e=(0,d.EA)(r)?512/s*591657527.5917094:256/s*591657527.591555;const n=Math.ceil(o/t);m.push(new h.A({level:0,scale:e,resolution:e*f}));for(let i=1;i<n;i++){const n=e/2**t,s=n*f;m.push(new h.A({level:i,scale:n,resolution:s})),e=n}}return new i({dpi:96,lods:m,origin:u,size:[s,s],spatialReference:r})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const n=(0,d.Vp)(e);return e.isWrappable&&!!n&&Math.abs(n.origin[0]-t.x)<=n.dx}return!1}readOrigin(e,t){return c.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,n=0;const i=[],s=this._levelToLOD={};e&&(t=-1/0,n=1/0,e.forEach(e=>{i.push(e.scale),t=e.scale>t?e.scale:t,n=e.scale<n?e.scale:n,s[e.level]=e})),this._set("scales",i),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){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const n=Math.floor(e),i=n+1;return t[n]/(t[n]/t[i])**(e-n)}scaleToZoom(e){const t=this.scales,n=t.length-1;let i=0;for(;i<n;i++){const n=t[i],s=t[i+1];if(n<=e)return i;if(s===e)return i+1;if(n>e&&s<e)return i+Math.log(n/e)/Math.log(n/s)}return i}tileAt(e,t,n,i){const s=this.lodAt(e);if(!s)return null;let r,o;if("number"==typeof t)r=t,o=n;else if((0,d.aI)(t.spatialReference,this.spatialReference))r=t.x,o=t.y,i=n;else{const e=(0,f.Cv)(t,this.spatialReference);if(null==e)return null;r=e.x,o=e.y,i=n}const a=s.resolution*this.size[0],l=s.resolution*this.size[1];return i??=new m.U(0,0,0),i.level=e,i.row=Math.floor((this.origin.y-o)/l+.001),i.col=Math.floor((r-this.origin.x)/a+.001),this.updateTileInfo(i),i}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let n=this.lodAt(e.level);if(!n&&1===t){const t=this.lods[this.lods.length-1];t.level<e.level&&(n=t)}if(!n)return!1;const i=e.level-n.level,s=n.resolution*this.size[0]/2**i,r=n.resolution*this.size[1]/2**i;return e.extent[0]=this.origin.x+e.col*s,e.extent[1]=this.origin.y-(e.row+1)*r,e.extent[2]=e.extent[0]+s,e.extent[3]=e.extent[1]+r,!0}upsampleTile(e){const 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){const n=this.lodAt(t.level);if(null==n)return null;const{resolution:i}=n,s=i*this.size[0],r=i*this.size[1];return e[0]=this.origin.x+t.col*s,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+s,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return i.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const n=[],s=this.lods.length-t;for(let e=0;e<s;e++){const i=e+t,{scale:s,resolution:r}=i>=0?this.lods[i]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};n.push(new h.A({level:e,scale:s,resolution:r}))}return new i({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:n})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let n=0;n<e.length;n++){const i=e[n];this._upsampleLevels[i.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/i.resolution:0},t=i}}};(0,s.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],w.prototype,"compressionQuality",void 0),(0,s.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],w.prototype,"dpi",void 0),(0,s.Cg)([(0,l.MZ)({type:String,json:{read:y.read,write:y.write,origins:{"web-scene":{read:!1,write:!1}}}})],w.prototype,"format",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],w.prototype,"isWrappable",null),(0,s.Cg)([(0,l.MZ)({type:c.A,json:{write:!0}})],w.prototype,"origin",void 0),(0,s.Cg)([(0,g.w)("origin")],w.prototype,"readOrigin",null),(0,s.Cg)([(0,l.MZ)({type:[h.A],value:null,json:{write:!0}})],w.prototype,"lods",null),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],w.prototype,"scales",void 0),(0,s.Cg)([(0,l.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],w.prototype,"size",void 0),(0,s.Cg)([(0,g.w)("size",["rows","cols"])],w.prototype,"readSize",null),(0,s.Cg)([(0,v.K)("size",{cols:{type:u.jz},rows:{type:u.jz}})],w.prototype,"writeSize",null),(0,s.Cg)([(0,l.MZ)({type:p.A,json:{write:!0}})],w.prototype,"spatialReference",void 0),w=i=(0,s.Cg)([(0,l.$K)("esri.layers.support.TileInfo")],w)},72802(e,t,n){n.d(t,{U:()=>s});var i=n(19419);class s{constructor(e,t,n,s=(0,i.vt)()){this._level=e,this._row=t,this._col=n,this.extent=s}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 s(e.level,e.row,e.col,e.extent)}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[561,7705],{69397(e,t,i){i.d(t,{Qf:()=>l,Qh:()=>o,RS:()=>s,Ul:()=>d,i5:()=>p,lM:()=>n,qK:()=>h});var r=i(34275);const s=16;function n(e){if(!e)return 0;let t=h;for(const i in e)e.hasOwnProperty(i)&&(t+=a(e[i],!1));return t}function o(e){if(!e)return 0;if("number"==typeof e[0])return l(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return c(e,8);let i=u;for(let r=0;r<t;r++)i+=a(e[r]);return i}(e);let t=h;for(const i in e)e.hasOwnProperty(i)&&(t+=a(e[i]));return t}function a(e,t=!0){switch(typeof e){case"object":return t?o(e):h;case"string":return function(e){return 32+e.length}(e);case"number":return s;case"boolean":return 4;default:return 8}}function l(...e){return e.reduce((e,t)=>e+(t?(0,r.iu)(t)?t.byteLength+p:Array.isArray(t)?c(t,s):0:0),0)}function c(e,t){return u+e.length*t}const h=32,u=16,p=145,d=64},5359(e,t,i){i.d(t,{H:()=>r,Z:()=>s});const r=Symbol("isImageryTileGraphicOrigin");function s(e){return!!e&&r in e}},90561(e,t,i){i.r(t),i.d(t,{default:()=>k});var r,s=i(5482),n=i(37838),o=i(69540),a=i(49186),l=i(53966),c=i(25728),h=i(17676),u=i(36708),p=i(91429),d=i(56507),f=i(60950),m=i(89808),g=i(99959),y=i(5359);class v extends g.A{get[(r=y.H,f.ym)](){return this.layer}get[m.Q](){return this.layer}constructor(e){super(),this[r]=!0,this.type="imagery-tile",this.layer=e}get id(){return this.layer.id}}var w=i(4146),b=i(18768),A=i(63074),_=i(69208),C=i(34287),R=i(8303),M=i(72545),S=i(56551),O=i(54310),x=i(25036),I=i(82935),T=i(82806),P=i(7548),z=i(23636),D=i(1003),F=i(99235),N=i(10873),Z=i(20437),L=i(74797),j=i(22796),$=i(87045),J=i(24212),V=i(30291),q=i(88625),E=i(59923);let U=class extends((0,A.dM)((0,x.j)((0,C.q)((0,R.A)((0,S.H)((0,_.d)((0,T.b)((0,M.G)((0,I.e)((0,b.b)((0,O.J)((0,c.M)((0,o.OU)(w.A)))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.charts=null,this.graphicOrigin=new v(this),this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.fields=null,this.source=void 0,this._debouncedSaveOperations=(0,h.sg)(async(e,t,r)=>{const{save:s,saveAs:n}=await i.e(9838).then(i.bind(i,59838));switch(e){case 0:return s(this,t);case 1:return n(this,r,t)}})}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(h.QP).then(()=>this._openRaster(t))),Promise.resolve(this)}set elevationInfo(e){"relative-to-scene"!==e?.mode&&this._set("elevationInfo",e),this._validateElevationInfo(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[(0,L.rZ)("Pixel Value"),(0,L.dy)("Raw Pixel Value")],t=this.raster?.rasterInfo??this.serviceRasterInfo,i=t?.attributeTable;if(i){const t=(0,L.jC)(i);e.push(...t)}const r=t?.dataType,s=t?.multidimensionalInfo;if(("vector-magdir"===r||"vector-uv"===r)&&null!=s){const t=s.variables[0].unit?.trim(),i=(0,L.DV)(t),r=(0,L.y6)();e.push(i,r)}if(s){const t=(0,L.AL)(s);e.push(...t)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){const{rasterFields:t}=this,i=e?.visibleFieldNames??new Set(t.map(({name:e})=>e).filter(e=>e!==L.F_.rawServicePixelValue)),r=(0,V.tn)({fields:t,title:this.title},{...e,visibleFieldNames:i}),{rasterInfo:s}=this.raster;return r?.fieldInfos&&s&&(0,L.h4)(r.fieldInfos,s),r}async generateRasterInfo(e,t){const i=(0,d.PZ)(j.A,e);if(await this.load(),!i||"none"===i.functionName?.toLowerCase())return this.serviceRasterInfo;try{const{rasterInfo:e}=await this._openFunctionRaster(i,t);return e}catch(e){if(e instanceof a.A)throw e;throw new a.A("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}supportsWrite(){const e=this._primaryRasters[0]??this.raster;return!!(this.loaded?"RasterTileServer"===e.datasetFormat&&("Raster"===e.tileType||"Map"===e.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))}write(e,t){return this.supportsWrite()?super.write(e,t):((0,E.U4)(t,this),null)}async hasDataChanged(){try{const 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,P.qg)(this.raster),!t&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:t,rasterFunction:i,source:r}=this;if(!t&&!r)throw new a.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)}const i=this.raster.rasterInfo;if(!i)throw new a.A("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",t?i:this._primaryRasters[0].rasterInfo),this._set("spatialReference",i.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles((0,u.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,P.pb)(e),this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(e,t,i){const r=[e];t&&(0,F.UD)(t.toJSON(),r);const s=await Promise.all(r.map(e=>D.default.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:i}))),n=s.findIndex(e=>null==e);if(n>-1)throw new a.A("imagery-tile-layer:open",`cannot open raster: ${r[n]}`);return this._primaryRasters=s,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){const i=await D.default.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==i)throw new a.A("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[i],this.raster=i}async _openFromSource(e,t){const i="the tiled imagery data source is not supported",r="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!r)throw new a.A("imagery-tile-layer:open",i);"MEMORY"===r&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});const s=await D.default.open({url:"",source:e,datasetFormat:r,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==s)throw new a.A("imagery-tile-layer:open",i);this._primaryRasters=[s],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=s}async _openFunctionRaster(e,t){const i={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>i[e.url]=e);const r=(0,F.vt)(e.functionDefinition?.toJSON()??e.toJSON(),i),s=new z.A({rasterFunction:r});return await s.open(t),s}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(e){e instanceof a.A&&l.A.getLogger(this).error("imagery-tile-layer:open",e.message),l.A.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(e){(0,J.XF)(l.A.getLogger(this),(0,J.$7)("ImageryTile layers","relative-to-scene",e)),(0,J.XF)(l.A.getLogger(this),(0,J.tW)("ImageryTile layers",e))}};(0,s.Cg)([(0,p.MZ)({clonable:!1})],U.prototype,"_primaryRasters",void 0),(0,s.Cg)([(0,p.MZ)({json:{origins:{"web-scene":{write:!1}},write:!0}})],U.prototype,"charts",void 0),(0,s.Cg)([(0,p.MZ)({type:q.A,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],U.prototype,"elevationInfo",null),(0,s.Cg)([(0,p.MZ)({type:$.A})],U.prototype,"tileInfo",void 0),(0,s.Cg)([(0,p.MZ)({readOnly:!0,clonable:!1})],U.prototype,"graphicOrigin",void 0),(0,s.Cg)([(0,p.MZ)(N.fV)],U.prototype,"legendEnabled",void 0),(0,s.Cg)([(0,p.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],U.prototype,"isReference",void 0),(0,s.Cg)([(0,p.MZ)({type:["show","hide"]})],U.prototype,"listMode",void 0),(0,s.Cg)([(0,p.MZ)({json:{read:!0,write:!0}})],U.prototype,"blendMode",void 0),(0,s.Cg)([(0,p.MZ)({type:j.A,json:{name:"renderingRule",write:!0}})],U.prototype,"rasterFunction",void 0),(0,s.Cg)([(0,p.MZ)()],U.prototype,"sourceJSON",void 0),(0,s.Cg)([(0,p.MZ)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],U.prototype,"version",void 0),(0,s.Cg)([(0,p.MZ)({readOnly:!0,json:{read:!1}})],U.prototype,"type",void 0),(0,s.Cg)([(0,p.MZ)({type:["ArcGISTiledImageServiceLayer"]})],U.prototype,"operationalLayerType",void 0),(0,s.Cg)([(0,p.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}}}})],U.prototype,"popupEnabled",void 0),(0,s.Cg)([(0,p.MZ)({type:n.A,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],U.prototype,"popupTemplate",void 0),(0,s.Cg)([(0,p.MZ)({readOnly:!0})],U.prototype,"defaultPopupTemplate",null),(0,s.Cg)([(0,p.MZ)(N.PY)],U.prototype,"screenSizePerspectiveEnabled",void 0),(0,s.Cg)([(0,p.MZ)({readOnly:!0,type:[Z.A]})],U.prototype,"fields",void 0),(0,s.Cg)([(0,p.MZ)({readOnly:!0,type:[Z.A]})],U.prototype,"rasterFields",null),(0,s.Cg)([(0,p.MZ)({constructOnly:!0})],U.prototype,"source",void 0),U=(0,s.Cg)([(0,p.$K)("esri.layers.ImageryTileLayer")],U);const k=U},18768(e,t,i){i.d(t,{b:()=>a});var r=i(5482),s=i(53966),n=i(91429),o=i(60694);const a=e=>{const t=e;let i=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,o.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,o.Jf)(e,s.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:()=>u});var r=i(5482),s=i(91429),n=i(69540),o=i(25482),a=i(56507),l=i(94359),c=i(93223);let h=class extends((0,n.OU)(o.o)){constructor(e){super(e),this.name=void 0,this.method="none",this.value=void 0,this.bandIds=void 0,this.renderer=void 0}};(0,r.Cg)([(0,s.MZ)({type:String,json:{write:{isRequired:!0}}})],h.prototype,"name",void 0),(0,r.Cg)([(0,s.MZ)({type:["raster-function-template","variable","none"],json:{write:{isRequired:!0}}}),(0,c.e)({rasterFunctionTemplate:"raster-function-template",variable:"variable",none:"none"})],h.prototype,"method",void 0),(0,r.Cg)([(0,s.MZ)({type:String,json:{write:{isRequired:!0}}})],h.prototype,"value",void 0),(0,r.Cg)([(0,s.MZ)({type:[a.jz],json:{write:{isRequired:!0}}})],h.prototype,"bandIds",void 0),(0,r.Cg)([(0,s.MZ)({types:l.uy,json:{write:!0,origins:{"web-scene":{types:l.Gj,write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],h.prototype,"renderer",void 0),h=(0,r.Cg)([(0,s.$K)("esri.renderers.support.RasterPresetRenderer")],h);const u=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.activePresetRendererName=null,this.presetRenderers=null}};return(0,r.Cg)([(0,s.MZ)({type:String,json:{name:"layerDefinition.activePresetRendererName",write:{allowNull:!0}}})],i.prototype,"activePresetRendererName",void 0),(0,r.Cg)([(0,s.MZ)({type:[h],json:{name:"layerDefinition.presetRenderers",write:!0}})],i.prototype,"presetRenderers",void 0),i=(0,r.Cg)([(0,s.$K)("esri.layers.mixins.RasterPresetRendererMixin")],i),i}},91806(e,t,i){i.d(t,{A:()=>l});var r,s=i(5482),n=i(25482),o=i(91429),a=i(56507);let l=class extends n.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,s.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"cols",void 0),(0,s.Cg)([(0,o.MZ)({type:a.jz,json:{write:!0}})],l.prototype,"level",void 0),(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],l.prototype,"levelValue",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"origin",void 0),(0,s.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],l.prototype,"resolution",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"rows",void 0),(0,s.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],l.prototype,"scale",void 0),l=r=(0,s.Cg)([(0,o.$K)("esri.layers.support.LOD")],l)},87045(e,t,i){i.d(t,{A:()=>w});var r,s=i(5482),n=i(66552),o=i(25482),a=i(86211),l=i(91429),c=i(56507),h=i(86738),u=i(16930),p=i(21325),d=i(28735),f=i(91806),m=i(72802),g=i(36005),y=i(43937);const v=new n.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",pbf:"pbf"});let w=class extends o.o{static{r=this}static create(e={}){const{resolutionFactor:t=1,scales:i,size:s=256,spatialReference:n=u.A.WebMercator,numLODs:o=24}=e;if(!(0,p.fn)(n)){const e=[];if(i)for(let t=0;t<i.length;t++){const r=i[t];e.push(new f.A({level:t,scale:r,resolution:r}))}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift(new f.A({level:i,scale:t,resolution:t})),t*=2}return new r({dpi:96,lods:e,origin:new h.A(0,0,n),size:[s,s],spatialReference:n})}const l=(0,p.Vp)(n),c=e.origin?new h.A({x:e.origin.x,y:e.origin.y,spatialReference:n}):new h.A(l?{x:l.origin[0],y:l.origin[1],spatialReference:n}:{x:0,y:0,spatialReference:n}),d=1/(39.37*(0,a.GA)(n)*96),m=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],r=t*d;m.push(new f.A({level:e,scale:t,resolution:r}))}else{let e=(0,p.EA)(n)?512/s*591657527.5917094:256/s*591657527.591555;const i=Math.ceil(o/t);m.push(new f.A({level:0,scale:e,resolution:e*d}));for(let r=1;r<i;r++){const i=e/2**t,s=i*d;m.push(new f.A({level:r,scale:i,resolution:s})),e=i}}return new r({dpi:96,lods:m,origin:c,size:[s,s],spatialReference:n})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,p.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return h.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const r=[],s=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,s[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){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),r=i+1;return t[i]/(t[i]/t[r])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let r=0;for(;r<i;r++){const i=t[r],s=t[r+1];if(i<=e)return r;if(s===e)return r+1;if(i>e&&s<e)return r+Math.log(i/e)/Math.log(i/s)}return r}tileAt(e,t,i,r){const s=this.lodAt(e);if(!s)return null;let n,o;if("number"==typeof t)n=t,o=i;else if((0,p.aI)(t.spatialReference,this.spatialReference))n=t.x,o=t.y,r=i;else{const e=(0,d.Cv)(t,this.spatialReference);if(null==e)return null;n=e.x,o=e.y,r=i}const a=s.resolution*this.size[0],l=s.resolution*this.size[1];return r??=new m.U(0,0,0),r.level=e,r.row=Math.floor((this.origin.y-o)/l+.001),r.col=Math.floor((n-this.origin.x)/a+.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){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return!1;const r=e.level-i.level,s=i.resolution*this.size[0]/2**r,n=i.resolution*this.size[1]/2**r;return e.extent[0]=this.origin.x+e.col*s,e.extent[1]=this.origin.y-(e.row+1)*n,e.extent[2]=e.extent[0]+s,e.extent[3]=e.extent[1]+n,!0}upsampleTile(e){const 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){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:r}=i,s=r*this.size[0],n=r*this.size[1];return e[0]=this.origin.x+t.col*s,e[1]=this.origin.y-(t.row+1)*n,e[2]=e[0]+s,e[3]=e[1]+n,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;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const i=[],s=this.lods.length-t;for(let e=0;e<s;e++){const r=e+t,{scale:s,resolution:n}=r>=0?this.lods[r]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new f.A({level:e,scale:s,resolution:n}))}return new r({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const r=e[i];this._upsampleLevels[r.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/r.resolution:0},t=r}}};(0,s.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],w.prototype,"compressionQuality",void 0),(0,s.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],w.prototype,"dpi",void 0),(0,s.Cg)([(0,l.MZ)({type:String,json:{read:v.read,write:v.write,origins:{"web-scene":{read:!1,write:!1}}}})],w.prototype,"format",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],w.prototype,"isWrappable",null),(0,s.Cg)([(0,l.MZ)({type:h.A,json:{write:!0}})],w.prototype,"origin",void 0),(0,s.Cg)([(0,g.w)("origin")],w.prototype,"readOrigin",null),(0,s.Cg)([(0,l.MZ)({type:[f.A],value:null,json:{write:!0}})],w.prototype,"lods",null),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],w.prototype,"scales",void 0),(0,s.Cg)([(0,l.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],w.prototype,"size",void 0),(0,s.Cg)([(0,g.w)("size",["rows","cols"])],w.prototype,"readSize",null),(0,s.Cg)([(0,y.K)("size",{cols:{type:c.jz},rows:{type:c.jz}})],w.prototype,"writeSize",null),(0,s.Cg)([(0,l.MZ)({type:u.A,json:{write:!0}})],w.prototype,"spatialReference",void 0),w=r=(0,s.Cg)([(0,l.$K)("esri.layers.support.TileInfo")],w)},72802(e,t,i){i.d(t,{U:()=>s});var r=i(19419);class s{constructor(e,t,i,s=(0,r.vt)()){this._level=e,this._row=t,this._col=i,this.extent=s}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 s(e.level,e.row,e.col,e.extent)}}},25943(e,t,i){i.d(t,{d:()=>C});var r,s=i(5482),n=i(11254),o=i(69622),a=i(49186),l=i(36563),c=(i(44208),i(66344)),h=i(15142),u=i(17676),p=i(36708),d=i(76030),f=i(84952),m=i(91429),g=i(72802),y=i(4718),v=i(69397),w=i(34275);class b{constructor(e){!function(e){if(!e?.location)throw new a.A("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new a.A("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new a.A("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new a.A("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new a.A("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}(e);const{location:t,data:i}=e;this.location=Object.freeze((0,y.o8)(t));const r=this.location.width,s=this.location.height;let n=!0,o=!0;const l=function(e,t=!1){return e<=w.y9?t?new Array(e).fill(0):new Array(e):new Uint32Array(e)}(Math.ceil(r*s/32));let c=0;for(let e=0;e<i.length;e++){const t=e%32;i[e]?(o=!1,l[c]|=1<<t):n=!1,31===t&&++c}o?(this._availability="unavailable",this.byteSize=40):n?(this._availability="available",this.byteSize=40):(this._availability=l,this.byteSize=40+(0,v.Qf)(l))}getAvailability(e,t){if("unavailable"===this._availability||"available"===this._availability)return this._availability;const i=(e-this.location.top)*this.location.width+(t-this.location.left),r=i%32,s=i>>5,n=this._availability;return s<0||s>n.length?"unknown":n[s]&1<<r?"available":"unavailable"}static fromDefinition(e,t){const i=e.service.request||n.A,{row:r,col:s,width:o,height:l}=e,c={query:{f:"json"}};return t=t?{...c,...t}:c,i(function(e){let t;if(e.service.tileServers?.length){const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;const i=e.service.query;return i&&(t=`${t}?${i}`),t}(e),t).then(e=>e.data).catch(e=>{if(422===e?.details?.httpStatus)return{location:{top:r,left:s,width:o,height:l},valid:!0,data:new Array(o*l).fill(0)};throw e}).then(e=>{if(e.location&&(e.location.top!==r||e.location.left!==s||e.location.width!==o||e.location.height!==l))throw new a.A("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:r,left:s,width:o,height:l}});return b.fromJSON(e)})}static fromJSON(e){return Object.freeze(new b(e))}}function A(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function _(e,t,i){return new a.A("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})}let C=class extends o.A{static{r=this}constructor(e){super(e),this._pendingTilemapRequests={},this.request=n.A,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new c.q(2097152),this.addHandles((0,p.wB)(()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),p.Vh))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,i){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return"unavailable";const 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(_(e,t,i)):this._fetchTilemap(e,t,i,r).catch(e=>e).then(r=>{if(r instanceof b){const s=r.getAvailability(t,i);if("unavailable"===s)throw _(e,t,i);return s}if((0,u.zf)(r))throw r;return"unknown"})}fetchAvailabilityUpsample(e,t,i,r,s){r.level=e,r.row=t,r.col=i;const n=this.layer.tileInfo;n.updateTileInfo(r);const o=this.fetchAvailability(e,t,i,s).catch(e=>{if((0,u.zf)(e))throw e;if(n.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,s);throw e});return this._fetchAvailabilityUpsamplePrefetch(e,t,i,s,o),o}async _fetchAvailabilityUpsamplePrefetch(e,t,i,s,n){if(!this._prefetchingEnabled)return;const o=`prefetch-${e}-${t}-${i}`;if(this.hasHandles(o))return;const a=new AbortController;n.then(()=>a.abort(),()=>a.abort());let c=!1;const h=(0,l.hA)(()=>{c||(c=!0,a.abort())});if(this.addHandles(h,o),await(0,d.md)(10,a.signal).catch(()=>{}),c||(c=!0,this.removeHandles(o)),(0,u.G4)(a))return;const p=new g.U(e,t,i),f={...s,signal:a.signal},m=this.layer.tileInfo;for(let e=0;r._prefetches.length<r._maxPrefetch&&m.upsampleTile(p);++e){const e=this.fetchAvailability(p.level,p.row,p.col,f);r._prefetches.push(e);const t=()=>{r._prefetches.removeUnordered(e)};e.then(t,t)}}static{this._maxPrefetch=4}static{this._prefetches=new h.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 a.A("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const s=this._tmpTilemapDefinition,n=this._tilemapFromCache(e,t,i,s);if(n)return Promise.resolve(n);const o=r?.signal;return r={...r,signal:null},new Promise((e,t)=>{(0,u.u7)(o,()=>t((0,u.NK)()));const i=A(s);let n=this._pendingTilemapRequests[i];if(!n){n=b.fromDefinition(s,r).then(e=>(this._tilemapCache.put(i,e,e.byteSize),e));const e=()=>{delete this._pendingTilemapRequests[i]};this._pendingTilemapRequests[i]=n,n.then(e,e)}n.then(e,t)})}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:t,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:(0,f.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;const s=A(r);return this._tilemapCache.get(s)}get test(){}};(0,s.Cg)([(0,m.MZ)({constructOnly:!0})],C.prototype,"layer",void 0),(0,s.Cg)([(0,m.MZ)({constructOnly:!0})],C.prototype,"minLOD",void 0),(0,s.Cg)([(0,m.MZ)({constructOnly:!0})],C.prototype,"maxLOD",void 0),(0,s.Cg)([(0,m.MZ)({constructOnly:!0})],C.prototype,"request",void 0),(0,s.Cg)([(0,m.MZ)({constructOnly:!0})],C.prototype,"size",void 0),C=r=(0,s.Cg)([(0,m.$K)("esri.layers.support.TilemapCache")],C)},82371(e,t,i){i.d(t,{E9:()=>f,Tw:()=>p,X6:()=>d});var r=i(11254),s=i(5443),n=i(86738),o=i(16930),a=i(87186),l=i(20223),c=i(2272),h=i(22671);async function u(e,t,i){const u=(0,c.Dl)(e),{rasterFunction:p,sourceJSON:d}=t||{},f=p?JSON.stringify(p.rasterFunctionDefinition||p):null,m=(0,c.lF)({...u.query,renderingRule:f,f:"json"}),g=(0,c.jV)(m,i);e=u.path;const y=d||await(0,r.A)(e,g).then(e=>e.data),v=y.hasRasterAttributeTable?(0,r.A)(`${e}/rasterAttributeTable`,g):null,w=y.hasColormap?(0,r.A)(`${e}/colormap`,g):null,b=y.hasHistograms?(0,r.A)(`${e}/histograms`,g):null,A=y.currentVersion>=10.3?(0,r.A)(`${e}/keyProperties`,g):null,_=y.hasMultidimensions?(0,r.A)(`${e}/multidimensionalInfo`,g):null,C=y.currentVersion>=10.81?(0,r.A)(`${e}/statistics`,g):null,R=await Promise.allSettled([v,w,b,A,_,C]),M=s.A.fromJSON(y.extent),S=Math.ceil(M.width/y.pixelSizeX-.1),O=Math.ceil(M.height/y.pixelSizeY-.1),x=o.A.fromJSON(y.spatialReference||y.extent.spatialReference),I="fulfilled"===R[0].status?R[0].value?.data:null,T=I?.features?.length?h.A.fromJSON(I):null,P="fulfilled"===R[1].status?R[1].value?.data.colormap:null,z=P?.length?P:null,D="fulfilled"===R[2].status?R[2].value?.data.histograms:null,F=D?.[0]?.counts?.length?D:null,N="fulfilled"===R[3].status?R[3].value?.data??{}:{},Z="fulfilled"===R[4].status?R[4].value?.data.multidimensionalInfo:null,L=Z?.variables?.length?Z:null;L&&L.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 j=null;const $="fulfilled"===R[5].status?R[5].value?.data.statistics:null;if($&&$.length===y.bandCount)j=$.map(e=>({avg:e.mean,count:e.count,max:e.max,median:e.median,min:e.min,mode:e.mode,stddev:e.standardDeviation,sum:e.sum}));else if(y.minValues&&y.minValues.length===y.bandCount){j=[];for(let e=0;e<y.minValues.length;e++)j.push({min:y.minValues[e],max:y.maxValues[e],avg:y.meanValues[e],stddev:y.stdvValues[e]})}const{defaultVariable:J,serviceDataType:V}=y;J&&J!==N.DefaultVariable&&(N.DefaultVariable=J),V?.includes("esriImageServiceDataTypeVector")&&!V.includes(N.DataType)&&(N.DataType=V.replace("esriImageServiceDataType",""));let q=y.noDataValue;y.noDataValues?.length&&y.noDataValues.some(e=>e!==q)&&(q=y.noDataValues);const E=y.transposeInfo?new l.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:x}),firstPyramidLevel:1,maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(S,O))/Math.LN2-8)),transposeInfo:y.transposeInfo}):void 0;return new a.A({width:S,height:O,bandCount:y.bandCount,extent:s.A.fromJSON(y.extent),spatialReference:x,pixelSize:new n.A({x:y.pixelSizeX,y:y.pixelSizeY,spatialReference:x}),pixelType:y.pixelType.toLowerCase(),statistics:j,attributeTable:T,colormap:z,histograms:F,keyProperties:N,noDataValue:q,multidimensionalInfo:L,storageInfo:E})}function p(e,t,i){return u(e,{sourceJSON:t},i)}function d(e,t,i){return u(e,{rasterFunction:t},i)}function f(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}}}]);