@arcgis/core 4.33.0-next.20250206 → 4.33.0-next.20250208
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.
- package/applications/Components/styleUtils.js +1 -1
- package/applications/Components/webStyleSymbolUtils.js +1 -1
- package/arcade/treeAnalysis.js +1 -1
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{5b20ee64248f2d5c937f.js → 08980b1ad3d5d67c6390.js} +1 -1
- package/assets/esri/core/workers/chunks/0a8e388e96af44deeabb.js +1 -0
- package/assets/esri/core/workers/chunks/{38cd7745b8ef1b8b6196.js → 12d6baeffd55a98a7c75.js} +1 -1
- package/assets/esri/core/workers/chunks/{b1f5344e57ee679a7e81.js → 140d0c4285c6978103ea.js} +7 -7
- package/assets/esri/core/workers/chunks/143a193fa3a6e645c8ac.js +1 -0
- package/assets/esri/core/workers/chunks/{2a7f5d09cdc0333fa4bd.js → 2611adb4f328f95ee508.js} +1 -1
- package/assets/esri/core/workers/chunks/2def7db73a776e759dae.js +1 -0
- package/assets/esri/core/workers/chunks/308ec51ff4a66f7fcb0d.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{72cf9192292e5c85c6df.js → 32d3657dcae89b740f8b.js} +2 -2
- package/assets/esri/core/workers/chunks/{72cf9192292e5c85c6df.js.LICENSE.txt → 32d3657dcae89b740f8b.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/354531dc2f0dea2ad96f.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/35e4af82a08b4eadbfab.js +1 -0
- package/assets/esri/core/workers/chunks/369a2b8484a8807bde38.js +1 -0
- package/assets/esri/core/workers/chunks/4040158835f9036967cd.js +2 -0
- package/assets/esri/core/workers/chunks/{1a2e1a414e651e988435.js.LICENSE.txt → 4040158835f9036967cd.js.LICENSE.txt} +1 -6
- package/assets/esri/core/workers/chunks/53810519ff5922b42cd2.js +1 -0
- package/assets/esri/core/workers/chunks/{15f850c9a1154fc57e5a.js → 5721557a1d8eab23a55b.js} +1 -1
- package/assets/esri/core/workers/chunks/594d923400fd74881833.js +1 -0
- package/assets/esri/core/workers/chunks/{32f5f00aab55ef16dcf1.js → 5b85f9da022742f602e2.js} +1 -1
- package/assets/esri/core/workers/chunks/62a1d60ad4bf6469c4dd.js +1 -0
- package/assets/esri/core/workers/chunks/{bab541feca7ab4d3f993.js → 6ea02ff25f051c08e6c3.js} +1 -1
- package/assets/esri/core/workers/chunks/{81aa8cc289fd02ca4da6.js → 7058001bf66f9f3d5d45.js} +1 -1
- package/assets/esri/core/workers/chunks/{e8ae8a11d8439e2a66ad.js → 706f867a9034d62a8ef7.js} +1 -1
- package/assets/esri/core/workers/chunks/77764ca90bdd13ee2167.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{1ab83753d9eec0463461.js → 7b367bb0ed9c218ca595.js} +1 -1
- package/assets/esri/core/workers/chunks/{8e334fa440ae542e2e34.js → 7e49ddb5a2182f2c9ca6.js} +1 -1
- package/assets/esri/core/workers/chunks/8191dd3d7451b2e7b95e.js +1 -0
- package/assets/esri/core/workers/chunks/8c32cee395da0a7b9a8e.js +1 -0
- package/assets/esri/core/workers/chunks/{48ecc5a74fecbb2b9c6f.js → 8d8f5f08d730270e1165.js} +1 -1
- package/assets/esri/core/workers/chunks/94225d92afbdb10dfedb.js +1 -0
- package/assets/esri/core/workers/chunks/94490937dca566fe2640.js +1 -0
- package/assets/esri/core/workers/chunks/{b9ce0049e27a3e1ed9f9.js → 9b2fab133786e5d47631.js} +1 -1
- package/assets/esri/core/workers/chunks/{28374a64790342e1b5ae.js → 9d61590c4d21c7421925.js} +1 -1
- package/assets/esri/core/workers/chunks/b21b152fa15896577242.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{5a25cef6355fd20e44e7.js → b765670b47d209d7655a.js} +2 -2
- package/assets/esri/core/workers/chunks/{5a25cef6355fd20e44e7.js.LICENSE.txt → b765670b47d209d7655a.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/b97673755cd2cc5164e8.js +1 -0
- package/assets/esri/core/workers/chunks/bb9ab85a135d211637f6.js +1 -0
- package/assets/esri/core/workers/chunks/c26ffbff1115e76bcb0f.js +1 -0
- package/assets/esri/core/workers/chunks/c38c154062cd838dd144.js +1 -0
- package/assets/esri/core/workers/chunks/d29c3bf29fcd7fa31f1a.js +1 -0
- package/assets/esri/core/workers/chunks/d339dee99c4820b63f39.js +1 -0
- package/assets/esri/core/workers/chunks/de1f3c4b8000c2d73013.js +1 -0
- package/assets/esri/core/workers/chunks/{4decfae8bc5e80878bdd.js → de4384b5833a60e88e31.js} +1 -1
- package/assets/esri/core/workers/chunks/e37e5d2e233d7f6ccd52.js +314 -0
- package/assets/esri/core/workers/chunks/e4b3f2d5c43518b0cde7.js +1 -0
- package/assets/esri/core/workers/chunks/e5e3b6d00d27b5bb354f.js +1 -0
- package/assets/esri/core/workers/chunks/e93dea6b112ce8e2779b.js +1 -0
- package/assets/esri/core/workers/chunks/edb580ce96da6fd66503.js +1 -0
- package/assets/esri/core/workers/chunks/f14b318bab5efcf43419.js +1 -0
- package/assets/esri/core/workers/chunks/{24e47f748f0e4f815c6e.js → f32ca4381e804cc3481e.js} +1 -1
- package/assets/esri/core/workers/chunks/f9070edd8e0b2a57af79.js +1 -0
- package/assets/esri/themes/base/widgets/_ItemList.scss +6 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/ImageMaterial.glsl.js +4 -4
- package/geometry/Mesh.js +1 -1
- package/geometry/support/Indices.js +1 -1
- package/geometry/support/meshUtils/deduplicate.js +1 -1
- package/geometry/support/meshVertexSpaceUtils.js +1 -1
- package/geometry/support/triangulationUtils.js +1 -1
- package/interfaces.d.ts +61 -84
- package/layers/FeatureLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
- package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
- package/layers/graphics/sources/support/sourceUtils.js +1 -1
- package/layers/mixins/BlendLayer.js +1 -1
- package/layers/mixins/FeatureLayerBase.js +1 -1
- package/layers/mixins/OperationalLayer.js +1 -1
- package/layers/mixins/operationalLayerModuleMap.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/arcadeUtils.js +1 -1
- package/layers/support/commonProperties.js +1 -1
- package/layers/support/layersCreator.js +1 -1
- package/package.json +2 -2
- package/portal/support/layersLoader.js +1 -1
- package/portal/support/loadUtils.js +1 -1
- package/rest/imageService.js +1 -1
- package/rest/support/ImageSampleParameters.js +1 -1
- package/rest/support/ImageSampleResult.js +1 -1
- package/rest/support/ImageVolumeResult.js +1 -1
- package/support/TablesMixin.js +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/WebStyleSymbol.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/fitVectorMarker.js +5 -0
- package/symbols/support/previewCIMSymbol.js +1 -1
- package/symbols/support/previewSymbol3D.js +1 -1
- package/symbols/support/previewWebStyleSymbol.js +1 -1
- package/symbols/support/styleUtils.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/symbols/support/utils.js +1 -1
- package/symbols/support/webStyleAcceptedFormats.js +5 -0
- package/symbols/support/webStyleSymbolUtils.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/layers/features/schema/SourceSchema.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/DrillDownTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/PagedTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/SnapshotLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/StreamLoadStrategy.js +1 -1
- package/views/3d/glTF/internal/resourceUtils.js +1 -1
- package/views/3d/layers/MediaLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
- package/views/3d/layers/graphics/pipeline/PipelineCommand.js +1 -1
- package/views/3d/layers/graphics/pipeline/featureData/FeatureData.js +1 -1
- package/views/3d/layers/graphics/pipeline/featureData/processingUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/RenderCommandEncoder.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/RenderGeometryBufferWriter.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/UniqueValueFeatureRenderer.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/primitiveObjectUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/utils.js +5 -0
- package/views/3d/layers/graphics/webStyleUtils.js +1 -1
- package/views/3d/layers/graphics/wosrLoader.js +1 -1
- package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultBufferWriter.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/VisibleElements.js +1 -1
- package/widgets/Editor/components/FeatureList.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/07bff9e742f3e5877f3f.js +0 -1
- package/assets/esri/core/workers/chunks/1100d9d114287b6443e2.js +0 -1
- package/assets/esri/core/workers/chunks/1a2e1a414e651e988435.js +0 -2
- package/assets/esri/core/workers/chunks/287362f9af132fafe4de.js +0 -1
- package/assets/esri/core/workers/chunks/2adc533dadcb018a9755.js +0 -1
- package/assets/esri/core/workers/chunks/2ea5e5e6c4660a06b516.js +0 -1
- package/assets/esri/core/workers/chunks/3984bf01f055fc42bfbf.js +0 -1
- package/assets/esri/core/workers/chunks/41cd1a5c99ab3bbd1fb4.js +0 -1
- package/assets/esri/core/workers/chunks/5e7f16b312077ca8c18d.js +0 -1
- package/assets/esri/core/workers/chunks/6ec108bd955e064256b5.js +0 -1
- package/assets/esri/core/workers/chunks/6ef2514a6b7bbfb8e37d.js +0 -1
- package/assets/esri/core/workers/chunks/7b11bf5799ecb3640b48.js +0 -314
- package/assets/esri/core/workers/chunks/81efe1f47fd41b7a5cc1.js +0 -1
- package/assets/esri/core/workers/chunks/82d26884127ed772cc4b.js +0 -1
- package/assets/esri/core/workers/chunks/918bdba41fa470cf77fd.js +0 -1
- package/assets/esri/core/workers/chunks/91d2bdfa6e34c10b7f50.js +0 -1
- package/assets/esri/core/workers/chunks/92871ebb339a7b6ff29c.js +0 -1
- package/assets/esri/core/workers/chunks/991e0f619f1f81f94d56.js +0 -1
- package/assets/esri/core/workers/chunks/9a27824d94df702e6e28.js +0 -1
- package/assets/esri/core/workers/chunks/b3f9d7a676076a7557f5.js +0 -1
- package/assets/esri/core/workers/chunks/c1fd87af3129873369fd.js +0 -1
- package/assets/esri/core/workers/chunks/c4c2b94e5cee7b824093.js +0 -1
- package/assets/esri/core/workers/chunks/c85374360ac5e169af16.js +0 -1
- package/assets/esri/core/workers/chunks/c94ec324ecad77c53a87.js +0 -1
- package/assets/esri/core/workers/chunks/d175953337fa655dc6b0.js +0 -1
- package/assets/esri/core/workers/chunks/e26dc0c1654316bb1558.js +0 -1
- package/assets/esri/core/workers/chunks/fe817283bbcbca8fb296.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4296],{67482:(e,t,r)=>{function n(e){return null!=a(e)||null!=s(e)}function i(e){return l.test(e)}function o(e){return a(e)??s(e)}function s(e){const t=new Date(e);return function(e,t){if(Number.isNaN(e.getTime()))return!1;let r=!0;if(p&&/\d+\W*$/.test(t)){const e=t.match(/[a-zA-Z]{2,}/);if(e){let t=!1,n=0;for(;!t&&n<=e.length;)t=!u.test(e[n]),n++;r=!t}}return r}(t,e)?Number.isNaN(t.getTime())?null:t.getTime()-6e4*t.getTimezoneOffset():null}function a(e){const t=l.exec(e);if(!t?.groups)return null;const r=t.groups,n=+r.year,i=+r.month-1,o=+r.day,s=+(r.hours??"0"),a=+(r.minutes??"0"),u=+(r.seconds??"0");if(s>23)return null;if(a>59)return null;if(u>59)return null;const p=r.ms??"0",c=p?+p.padEnd(3,"0").slice(0,3):0;let d;if(r.isUTC||!r.offsetSign)d=Date.UTC(n,i,o,s,a,u,c);else{const e=+r.offsetHours,t=+r.offsetMinutes;d=6e4*("+"===r.offsetSign?-1:1)*(60*e+t)+Date.UTC(n,i,o,s,a,u,c)}return Number.isNaN(d)?null:d}r.d(t,{Br:()=>i,Cq:()=>n,_U:()=>o});const l=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/,u=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,p=!Number.isNaN(new Date("technology 10").getTime())},39516:(e,t,r)=>{let n;async function i(){return null==n&&(n=r.e(4123).then(r.bind(r,44123)).then((e=>new e.WhereClauseCache(500,500)))),n}async function o(e,t){const r=await i(),n=r.get(e,t);if(null==n)throw r.getError(e,t);return n}function s(e,t){return e||=null,t||=null,"1=1"===e?t??e:"1=1"===t?e??t:e&&t?`(${e}) AND (${t})`:e??t}function a(e,t){return e||=null,t||=null,"1=1"===e||"1=1"===t||e===t?"1=1"===e?e:t:e&&t?`(${e}) OR (${t})`:e??t}r.d(t,{GP:()=>o,IW:()=>a,mA:()=>s})},13069:(e,t,r)=>{r.d(t,{AG:()=>a,lk:()=>i,vD:()=>s,yS:()=>o});const n="randomUUID"in crypto;function i(){if(n)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function o(){return`{${i().toUpperCase()}}`}function s(){return`{${i()}}`}function a(e){const t=e.toUpperCase();return"{"!==e[0]?`{${t}}`:t}},83960:(e,t,r)=>{r.d(t,{X_:()=>s,oW:()=>l,zx:()=>a});var n=r(34727),i=r(83047);const o=96;function s(e,t){const r=t||e.extent,n=e.width,s=(0,i.GA)(r?.spatialReference);return r&&n?r.width/n*s*i.dy*o:0}function a(e,t,r){return function(e,t){return 0===t||(0,n.Sp)(e,t)||e<t}(e,t)&&function(e,t){return 0===t||(0,n.Sp)(e,t)||e>t}(e,r)}function l(e,t){return(0,n.Sp)(e,t)?0:(e||Number.POSITIVE_INFINITY)>(t||Number.POSITIVE_INFINITY)?1:-1}},16350:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Y});var n=r(90237),i=r(13874),o=r(92071),s=r(93637),a=r(84952),l=r(10107),u=r(56507),p=r(44208),c=(r(87811),r(40608)),d=r(43937),y=r(5443),f=r(16930),m=r(50498),h=r(4146),g=r(49186),w=r(92474),v=r(53966),x=r(74887),b=r(29953),F=r(64714),S=r(34322),T=r(37745),_=r(22671),A=r(56400);let I=class extends w.A{constructor(){super(...arguments),this._connection=null,this._workerHandler=null,this.capabilities=(0,F.f)(!1,!1),this.type="wfs",this.refresh=(0,x.sg)((async()=>{await this.load();const e={customParameters:this.layer.customParameters,maxRecordCount:this.layer.maxRecordCount,maxTotalRecordCount:this.layer.maxTotalRecordCount,maxPageCount:this.layer.maxPageCount},{extent:t}=await this._workerHandler.refresh(e);return t&&(this.sourceJSON.extent=t),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}}))}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._startWorker({signal:t})),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){const r=await this.queryFeaturesJSON(e,t);return _.A.fromJSON(r)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._workerHandler.queryFeatures(e?e.toJSON():void 0,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._workerHandler.queryFeatureCount(e?e.toJSON():void 0,t)}async queryObjectIds(e,t={}){return await this.load(t),this._workerHandler.queryObjectIds(e?e.toJSON():void 0,t)}async queryExtent(e,t={}){await this.load(t);const r=await this._workerHandler.queryExtent(e?e.toJSON():void 0,t);return{count:r.count,extent:y.A.fromJSON(r.extent)}}async querySnapping(e,t={}){return await this.load(t),this._workerHandler.querySnapping(e,t)}async queryAttributeBins(e,t={}){await this.load(t);const r=await this._workerHandler.queryAttributeBins(e?.toJSON(),t);return T.A.fromJSON(r)}async _createLoadOptions(e){const{url:t,customParameters:r,name:n,namespaceUri:i,fields:o,geometryType:s,maxRecordCount:a,maxPageCount:l,maxTotalRecordCount:u,swapXY:p}=this.layer,c="defaults"===this.layer.originOf("spatialReference")?void 0:this.layer.spatialReference;if(!t)throw new g.A("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await(0,S.Fu)(t,{customParameters:r,...e}));const d=["fields","geometryType","name","namespaceUri","swapXY"].some((e=>null==this.layer[e])),y=d?await(0,S.O8)(this.wfsCapabilities,n,i,{spatialReference:c,customParameters:r,signal:e?.signal}):{...(0,S.YW)(o??[]),geometryType:s,name:n,namespaceUri:i,spatialReference:c,swapXY:p},f=(0,S.mG)(this.wfsCapabilities.readFeatureTypes(),y.name,y.namespaceUri),h=m.gy.toJSON(y.geometryType),{operations:w}=this.wfsCapabilities,v=w.GetFeature.url,x=w.GetFeature.outputFormat;return{customParameters:r,featureType:f,fields:y.fields?.map((e=>e.toJSON()))??[],geometryField:y.geometryField,geometryType:h,getFeatureUrl:v,getFeatureOutputFormat:x,maxRecordCount:a,maxPageCount:l,maxTotalRecordCount:u,objectIdField:y.objectIdField,spatialReference:y.spatialReference?.toJSON(),swapXY:!!y.swapXY}}async _startWorker(e){const[t,r]=await(0,x.Lx)([this._createLoadOptions(e),(0,b.ho)("WFSSourceWorker",{...e,strategy:(0,p.A)("feature-layers-workers")?"dedicated":"local",registryTarget:this})]),n=t.error||r.error||null,i=r.value||null;if(n)throw i&&i.close(),n;const o=t.value;this._connection=r.value,this._workerHandler=this._connection.createInvokeProxy();const s=await this._workerHandler.load(o,e);for(const e of s.warnings)v.A.getLogger(this.layer).warn("#load()",`${e.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:e});this.sourceJSON={dateFieldsTimeReference:{timeZoneIANA:A.n$},extent:s.extent,fields:o.fields,geometryType:o.geometryType,objectIdField:o.objectIdField,geometryField:o.geometryField,drawingInfo:(0,F.F0)(o.geometryType),name:o.featureType.title,wfsInfo:{name:o.featureType.name,featureUrl:o.getFeatureUrl,maxFeatures:o.maxRecordCount,swapXY:o.swapXY,supportedSpatialReferences:o.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:o.featureType.namespaceUri}}}};(0,n._)([(0,l.MZ)()],I.prototype,"capabilities",void 0),(0,n._)([(0,l.MZ)({constructOnly:!0})],I.prototype,"layer",void 0),(0,n._)([(0,l.MZ)()],I.prototype,"sourceJSON",void 0),(0,n._)([(0,l.MZ)()],I.prototype,"type",void 0),(0,n._)([(0,l.MZ)()],I.prototype,"wfsCapabilities",void 0),I=(0,n._)([(0,c.$)("esri.layers.graphics.sources.WFSSource")],I);var M,P=r(63074),R=r(69208),E=r(6455),C=r(87718),O=r(76294),N=r(16131),j=r(32756),Z=r(8303),U=r(54310),k=r(25036),$=r(82935),D=r(10873),G=r(20437),z=r(17036),q=r(30524),L=r(46499),J=r(39383),H=r(13112),B=r(61956),V=r(30291);const W=(0,z.p)();let Q=M=class extends((0,j.fY)((0,E.FJ)((0,R.d)((0,O.J)((0,C.F)((0,P.dM)((0,$.e)((0,U.J)((0,k.j)((0,N.q)((0,Z.A)((0,o.P)(h.A))))))))))))){static fromWFSLayerInfo(e){const{customParameters:t,fields:r,geometryField:n,geometryType:i,name:o,namespaceUri:s,objectIdField:a,spatialReference:l,swapXY:u,url:p,wfsCapabilities:c}=e;return new M({customParameters:t,fields:r,geometryField:n,geometryType:i,name:o,namespaceUri:s,objectIdField:a,spatialReference:l,swapXY:u,url:p,wfsCapabilities:c})}constructor(e){super(e),this.copyright=null,this.customParameters=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxRecordCount=3e3,this.maxPageCount=10,this.maxTotalRecordCount=2e5,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new I({layer:this}),this.spatialReference=f.A.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then((()=>this.source.load(e))).then((()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),(0,q.yp)(this.renderer,this.fieldsIndex),(0,q.sv)(this.timeInfo,this.fieldsIndex)}))),Promise.resolve(this)}get capabilities(){return this.source?.capabilities}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,t,r){const n=e.filter((e=>e.name!==S.i5));this.geometryField&&n.unshift(new G.A({name:this.geometryField,alias:this.geometryField,type:"geometry"})),(0,s.sM)(r,n.map((e=>e.toJSON())),t)}get parsedUrl(){return(0,a.An)(this.url)}set renderer(e){(0,q.yp)(e,this.fieldsIndex),this._set("renderer",e)}get wfsCapabilities(){return this.source?.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return(0,V.tn)(this,e)}createQuery(){const e=new B.A({returnGeometry:!0,outFields:["*"],where:this.definitionExpression||"1=1"}),{timeOffset:t,timeExtent:r}=this;return e.timeExtent=null!=t&&null!=r?r.offset(-t.value,t.unit):r||null,e}getFieldDomain(e,t){return this.getField(e)?.domain}getField(e){return this.fieldsIndex?.get(e)}queryFeatures(e,t){return this.load().then((()=>this.source.queryFeatures(B.A.from(e)||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this.load().then((()=>this.source.queryObjectIds(B.A.from(e)||this.createQuery(),t)))}queryFeatureCount(e,t){return this.load().then((()=>this.source.queryFeatureCount(B.A.from(e)||this.createQuery(),t)))}queryExtent(e,t){return this.load().then((()=>this.source.queryExtent(B.A.from(e)||this.createQuery(),t)))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh();return null!=t&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};(0,n._)([(0,l.MZ)({readOnly:!0})],Q.prototype,"capabilities",null),(0,n._)([(0,l.MZ)({type:String})],Q.prototype,"copyright",void 0),(0,n._)([(0,l.MZ)({readOnly:!0})],Q.prototype,"createQueryVersion",null),(0,n._)([(0,l.MZ)({json:{name:"wfsInfo.customParameters",write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0),ignoreOrigin:!0})}}})],Q.prototype,"customParameters",void 0),(0,n._)([(0,l.MZ)((0,A.P6)("dateFieldsTimeReference"))],Q.prototype,"dateFieldsTimeZone",void 0),(0,n._)([(0,l.MZ)({readOnly:!0})],Q.prototype,"defaultPopupTemplate",null),(0,n._)([(0,l.MZ)({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Q.prototype,"definitionExpression",void 0),(0,n._)([(0,l.MZ)({type:String})],Q.prototype,"displayField",void 0),(0,n._)([(0,l.MZ)(D.Yj)],Q.prototype,"elevationInfo",void 0),(0,n._)([(0,l.MZ)({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"featureUrl",void 0),(0,n._)([(0,l.MZ)({type:[G.A],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],Q.prototype,"fields",void 0),(0,n._)([(0,d.K)("fields")],Q.prototype,"writeFields",null),(0,n._)([(0,l.MZ)(W.fieldsIndex)],Q.prototype,"fieldsIndex",void 0),(0,n._)([(0,l.MZ)({type:y.A,json:{name:"extent"}})],Q.prototype,"fullExtent",void 0),(0,n._)([(0,l.MZ)()],Q.prototype,"geometryField",void 0),(0,n._)([(0,l.MZ)({type:String,json:{read:{source:"layerDefinition.geometryType",reader:m.gy.read},write:{target:"layerDefinition.geometryType",writer:m.gy.write,ignoreOrigin:!0},origins:{service:{read:m.gy.read}}}})],Q.prototype,"geometryType",void 0),(0,n._)([(0,l.MZ)({type:String})],Q.prototype,"id",void 0),(0,n._)([(0,l.MZ)(D.kF)],Q.prototype,"labelsVisible",void 0),(0,n._)([(0,l.MZ)({type:[L.A],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:J.w},write:!0}})],Q.prototype,"labelingInfo",void 0),(0,n._)([(0,l.MZ)(D.fV)],Q.prototype,"legendEnabled",void 0),(0,n._)([(0,l.MZ)({type:["show","hide"]})],Q.prototype,"listMode",void 0),(0,n._)([(0,l.MZ)({type:String})],Q.prototype,"objectIdField",void 0),(0,n._)([(0,l.MZ)({type:["WFS"]})],Q.prototype,"operationalLayerType",void 0),(0,n._)([(0,l.MZ)({type:u.jz,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"maxRecordCount",void 0),(0,n._)([(0,l.MZ)({type:u.jz})],Q.prototype,"maxPageCount",void 0),(0,n._)([(0,l.MZ)({type:u.jz})],Q.prototype,"maxTotalRecordCount",void 0),(0,n._)([(0,l.MZ)({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],Q.prototype,"mode",void 0),(0,n._)([(0,l.MZ)({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"name",void 0),(0,n._)([(0,l.MZ)({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"namespaceUri",void 0),(0,n._)([(0,l.MZ)(D.Ih)],Q.prototype,"opacity",void 0),(0,n._)([(0,l.MZ)(W.outFields)],Q.prototype,"outFields",void 0),(0,n._)([(0,l.MZ)({readOnly:!0})],Q.prototype,"parsedUrl",null),(0,n._)([(0,l.MZ)(D.M6)],Q.prototype,"popupEnabled",void 0),(0,n._)([(0,l.MZ)({type:i.A,json:{name:"popupInfo",write:!0}})],Q.prototype,"popupTemplate",void 0),(0,n._)([(0,l.MZ)({types:H.Hg,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:H.XJ,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],Q.prototype,"renderer",null),(0,n._)([(0,l.MZ)(D.PY)],Q.prototype,"screenSizePerspectiveEnabled",void 0),(0,n._)([(0,l.MZ)({readOnly:!0})],Q.prototype,"source",void 0),(0,n._)([(0,l.MZ)({type:f.A,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],Q.prototype,"spatialReference",void 0),(0,n._)([(0,l.MZ)({readOnly:!0,type:[u.jz],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"spatialReferences",void 0),(0,n._)([(0,l.MZ)({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"swapXY",void 0),(0,n._)([(0,l.MZ)({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],Q.prototype,"title",void 0),(0,n._)([(0,l.MZ)({json:{read:!1},readOnly:!0})],Q.prototype,"type",void 0),(0,n._)([(0,l.MZ)(D.OZ)],Q.prototype,"url",void 0),(0,n._)([(0,l.MZ)({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"version",void 0),(0,n._)([(0,l.MZ)()],Q.prototype,"wfsCapabilities",null),Q=M=(0,n._)([(0,c.$)("esri.layers.WFSLayer")],Q);const Y=Q},99352:(e,t,r)=>{r.d(t,{F:()=>n,P:()=>i});const n={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!0,supportsCurrentUser:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!0,supportsReturnMesh:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1},i={supportsDate:!0,supportsFixedInterval:!0,supportsAutoInterval:!0,supportsFixedBoundaries:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!0,supportedStatistics:{count:!0,sum:!0,avg:!0,var:!0,stddev:!0,min:!0,max:!0,percentileContinuous:!0,percentileDiscrete:!0,envelope:!0,centroid:!0,convexHull:!0},supportedNormalizationTypes:{field:!0,log:!0,naturalLog:!0,percentOfTotal:!0,squareRoot:!0}}},85113:(e,t,r)=>{r.d(t,{BM:()=>T,bd:()=>_,sO:()=>S,xD:()=>p});var n=r(67482),i=r(49186),o=r(21325),s=r(43334),a=r(92722),l=r(30524);const u={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function p(e){return u[e]}function*c(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*d(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function y(e){for(const t of e)if(t.length>2)return!0;return!1}function f(e){let t=0;for(let r=0;r<e.length;r++){const n=e[r],i=e[(r+1)%e.length];t+=n[0]*i[1]-i[0]*n[1]}return t<=0}function m(e){const t=e[0],r=e[e.length-1];return t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]||e.push(t),e}function h(e,t,r){switch(t.type){case"LineString":case"MultiPoint":return function(e,t,r){return v(e,t.coordinates,r),e}(e,t,r);case"MultiLineString":return function(e,t,r){for(const n of t.coordinates)v(e,n,r);return e}(e,t,r);case"MultiPolygon":return function(e,t,r){for(const n of t.coordinates){g(e,n[0],r);for(let t=1;t<n.length;t++)w(e,n[t],r)}return e}(e,t,r);case"Point":return function(e,t,r){return b(e,t.coordinates,r),e}(e,t,r);case"Polygon":return function(e,t,r){const n=t.coordinates;g(e,n[0],r);for(let t=1;t<n.length;t++)w(e,n[t],r);return e}(e,t,r)}}function g(e,t,r){const n=m(t);!function(e){return!f(e)}(n)?v(e,n,r):x(e,n,r)}function w(e,t,r){const n=m(t);!function(e){return f(e)}(n)?v(e,n,r):x(e,n,r)}function v(e,t,r){for(const n of t)b(e,n,r);e.lengths.push(t.length)}function x(e,t,r){for(let n=t.length-1;n>=0;n--)b(e,t[n],r);e.lengths.push(t.length)}function b(e,t,r){const[n,i,o]=t;e.coords.push(n,i),r.hasZ&&e.coords.push(o||0)}function F(e){switch(typeof e){case"string":return(0,n.Br)(e)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function S(e,t=4326){if(!e)throw new i.A("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new i.A("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:r}=e;if(!r)return;const n="string"==typeof r?r:"name"===r.type?r.properties.name:"EPSG"===r.type?r.properties.code:null,s=(0,o.oT)({wkid:t})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${t})$`,"i");if(!n||!s.test(n))throw new i.A("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:r})}function T(e,t={}){const r=[],n=new Set,i=new Set;let o,s=!1,a=null,u=!1,{geometryType:f=null}=t;for(const t of c(e)){const{geometry:e,properties:c,id:m}=t;if((!e||(f||(f=p(e.type)),p(e.type)===f))&&(s||(s=y(d(e))),u||(u=null!=m,u&&(o=typeof m,c&&(a=Object.keys(c).filter((e=>c[e]===m))))),c&&a&&u&&null!=m&&(a.length>1?a=a.filter((e=>c[e]===m)):1===a.length&&(a=c[a[0]]===m?a:[])),c))for(const e in c){if(n.has(e))continue;const t=F(c[e]);if("unknown"===t){i.add(e);continue}i.delete(e),n.add(e);const o=(0,l.rS)(e);o&&r.push({name:o,alias:e,type:t})}}const m=(0,l.rS)(1===a?.length&&a[0]||null)??void 0;if(m)for(const e of r)if(e.name===m&&(0,l.WA)(e)){e.type="esriFieldTypeOID";break}return{fields:r,geometryType:f,hasZ:s,objectIdFieldName:m,objectIdFieldType:o,unknownFields:Array.from(i)}}function _(e,t){return Array.from(function*(e,t={}){const{geometryType:r,objectIdField:n}=t;for(const i of e){const{geometry:e,properties:o,id:l}=i;if(e&&p(e.type)!==r)continue;const u=o||{};let c;n&&(c=u[n],null==l||c||(u[n]=c=l));const d=new s.Om(e?h(new a.A,e,t):null,u,null,c);yield d}}(c(e),t))}},64714:(e,t,r)=>{r.d(t,{F0:()=>a,Vx:()=>p,e2:()=>d,f:()=>y});var n=r(44208),i=r(4718),o=r(99352),s=r(93470);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?s.Cb:"esriGeometryPolyline"===e?s.yM:s.WR}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let u=1;function p(e,t){if((0,n.A)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let r=`this${c(t)} = null;`;for(const t in e)r+=`this${c(t)} = ${JSON.stringify(e[t])};`;const n=new Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new n}catch(r){return()=>({[t]:null,...e})}}function c(e){return l.test(e)?`.${e}`:`["${e}"]`}function d(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,i.o8)(e)}}]}function y(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:o.F,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:o.P,editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},69208:(e,t,r)=>{r.d(t,{d:()=>s});var n=r(90237),i=r(10107),o=(r(44208),r(53966),r(87811),r(40608));const s=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,n._)([(0,i.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],t.prototype,"customParameters",void 0),t=(0,n._)([(0,o.$)("esri.layers.mixins.CustomParametersMixin")],t),t}},6455:(e,t,r)=>{r.d(t,{FJ:()=>x,Dp:()=>b,KV:()=>F});var n=r(90237),i=r(93637),o=r(10107),s=(r(44208),r(53966),r(87811),r(40608)),a=r(89317),l=r(69540),u=r(5503),p=r(25482),c=r(43937),d=r(83960),y=r(13069);const f={write:{overridePolicy:(e,t,r)=>({enabled:!r||"scale"===r.filterMode})}};let m=class extends(l.A.ClonableMixin(p.A)){constructor(e){super(e),this.id=(0,y.lk)(),this.maxScale=0,this.minScale=0,this.title="",this.where=null}};(0,n._)([(0,o.MZ)({type:String,json:{write:!0}})],m.prototype,"id",void 0),(0,n._)([(0,o.MZ)({type:Number,json:f})],m.prototype,"maxScale",void 0),(0,n._)([(0,o.MZ)({type:Number,json:f})],m.prototype,"minScale",void 0),(0,n._)([(0,o.MZ)({type:String,json:{write:!0}})],m.prototype,"title",void 0),(0,n._)([(0,o.MZ)({type:String,json:{write:!0}})],m.prototype,"where",void 0),m=(0,n._)([(0,s.$)("esri.layers.support.DisplayFilter")],m);const h=m;var g=r(41560);let w=class extends(l.A.ClonableMixin(p.A)){constructor(e){super(e),this.activeFilterId=null,this.filters=new(u.A.ofType(h)),this.mode="manual"}writeFilters(e,t,r,n){const i=e.toArray();"scale"===this.mode&&i.sort(((e,t)=>{const r=(0,d.oW)(t.minScale,e.minScale),n=e.maxScale-t.maxScale;return 0===r?n:r})),t[r]=i.map((e=>e.toJSON(n)))}write(e,t){return super.write(e,(0,g.mW)(this,t))}};(0,n._)([(0,o.MZ)({type:String,json:{write:{overridePolicy:(e,t,r)=>({enabled:"manual"===r.filterMode,isRequired:!0})}}})],w.prototype,"activeFilterId",void 0),(0,n._)([(0,o.MZ)({type:u.A.ofType(h),nonNullable:!0,json:{write:!0}})],w.prototype,"filters",void 0),(0,n._)([(0,c.K)("filters")],w.prototype,"writeFilters",null),(0,n._)([(0,o.MZ)({type:["manual","scale"],nonNullable:!0,json:{name:"filterMode",write:!0}})],w.prototype,"mode",void 0),w=(0,n._)([(0,s.$)("esri.layers.support.DisplayFilterInfo")],w);const v=w,x=e=>{let t=class extends e{constructor(){super(...arguments),this.displayFilterEnabled=!0,this.displayFilterInfo=null}};return(0,n._)([(0,o.MZ)(b)],t.prototype,"displayFilterEnabled",void 0),(0,n._)([(0,o.MZ)(F)],t.prototype,"displayFilterInfo",void 0),t=(0,n._)([(0,s.$)("esri.layers.mixins.DisplayFilteredLayer")],t),t},b={type:Boolean,json:{name:"layerDefinition.disableDisplayFilter",read:{reader:e=>!e},write:{layerContainerTypes:a.K,writer(e,t,r){(0,i.sM)(r,!e,t)}},origins:{"web-scene":{write:!1,read:!1}}}},F={type:v,json:{name:"layerDefinition.displayFilterInfo",write:{enabled:!0,allowNull:!0,layerContainerTypes:a.K},origins:{"web-scene":{write:!1,read:!1}}}}},32756:(e,t,r)=>{r.d(t,{Rr:()=>l,fY:()=>p,ne:()=>u});var n=r(90237),i=r(93637),o=r(10107),s=(r(44208),r(53966),r(87811),r(40608)),a=r(91880);function l(e,t,r){if(!e)return null;const n=e.find((e=>!!e.field));if(!n)return null;const i=new a.A;return i.read(n,r),[i]}const u={type:[a.A],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:l},write:{writer:function(e,t,r,n){const o=e.find((e=>!!e.field));o&&(0,i.sM)(r,[o.toJSON()],t)}}}},p=e=>{let t=class extends e{constructor(){super(...arguments),this.orderBy=null}};return(0,n._)([(0,o.MZ)(u)],t.prototype,"orderBy",void 0),t=(0,n._)([(0,s.$)("esri.layers.mixins.OrderedLayer")],t),t}},8303:(e,t,r)=>{r.d(t,{A:()=>F});var n=r(90237),i=r(92602),o=r(70333),s=r(78888),a=r(60999),l=r(49186),u=r(53966),p=r(97768),c=r(74887),d=r(84952),y=r(10107),f=(r(44208),r(87811),r(36005)),m=r(40608),h=r(43937),g=r(83531),w=r(20655),v=r(80812),x=r(41318),b=r(10407);const F=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,p.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new v.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:n}=await r.e(1204).then(r.bind(r,41204));return(0,c.Te)(t),await n({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,c.zf)(e)||u.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,c.QP)(e),!0))))}async setUserPrivileges(e,t){if(!i.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:n},content:{updateItem:i}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",n),this._set("userHasUpdateItemPrivileges",i)}catch(e){(0,c.QP)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const n=!o.id?.findCredential(this.url),i=e===r.id;if(i&&r.portal.user)return this._getUserPrivileges(r,n);let s,a;if(i)s=r.portal.url;else try{s=await(0,g.wI)(this.url,t)}catch(e){(0,c.QP)(e)}if(!s||!(0,d.b8)(s,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;a=await(o.id?.getCredential(`${s}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,c.QP)(e)}const l=!0,u=!1,p=!1;if(!a)return{features:{edit:l,fullEdit:u},content:{updateItem:p}};try{if(i?await r.reload():(r=new v.default({id:e,portal:{url:s}}),await r.load(t)),r.portal.user)return this._getUserPrivileges(r,n)}catch(e){(0,c.QP)(e)}return{features:{edit:l,fullEdit:u},content:{updateItem:p}}}_getUserPrivileges(e,t){const r=(0,b.It)(e);return t&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,c.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?o.id?.findCredential(this.url):null;if(!t)return!0;const r=S.credential===t?S.user:await this._fetchEditingUser(e);return S.credential=t,S.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=o.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const n=`${r.owningSystemUrl}/sharing/rest`,i=w.A.getDefault();if(i&&i.loaded&&(0,d.S8)(i.restUrl)===(0,d.S8)(n))return i.user;const l=`${n}/community/self`,u=null!=e?e.signal:null,p=await(0,a.Ke)((0,s.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:u}));return p.ok?x.A.fromJSON(p.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t?.portal,n=this.portalItem?.id&&(this.portalItem.portal||w.A.getDefault());return r&&n&&!(0,d.ut)(n.restUrl,r.restUrl)?(t.messages&&t.messages.push(new l.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,n._)([(0,y.MZ)({type:v.default})],t.prototype,"portalItem",null),(0,n._)([(0,f.w)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,n._)([(0,h.K)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,n._)([(0,y.MZ)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,n._)([(0,y.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,n._)([(0,y.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,n._)([(0,y.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,n._)([(0,m.$)("esri.layers.mixins.PortalLayer")],t),t},S={credential:null,user:null}},82935:(e,t,r)=>{r.d(t,{B:()=>y,e:()=>f});var n=r(90237),i=r(10107),o=(r(44208),r(53966),r(87811),r(36005)),s=r(40608),a=r(89317),l=r(30524),u=r(96184),p=r(73133),c=r(79677),d=r(10184);const y={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation",layerContainerTypes:a.K}}},f=e=>{let t=class extends e{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(e,t){const r=t.timeInfo.exportOptions;if(!r)return null;const n=r.timeOffset,i=p.j.fromJSON(r.timeOffsetUnits);return n&&i?new d.A({value:n,unit:i}):null}set timeInfo(e){(0,l.sv)(e,this.fieldsIndex),this._set("timeInfo",e)}};return(0,n._)([(0,i.MZ)({type:c.A,json:{write:!1}})],t.prototype,"timeExtent",void 0),(0,n._)([(0,i.MZ)({type:d.A})],t.prototype,"timeOffset",void 0),(0,n._)([(0,o.w)("service","timeOffset",["timeInfo.exportOptions"])],t.prototype,"readOffset",null),(0,n._)([(0,i.MZ)({value:null,type:u.A,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],t.prototype,"timeInfo",null),(0,n._)([(0,i.MZ)(y)],t.prototype,"useViewTime",void 0),t=(0,n._)([(0,s.$)("esri.layers.mixins.TemporalLayer")],t),t}},34322:(e,t,r)=>{r.d(t,{E:()=>q,Fu:()=>R,O8:()=>Z,UH:()=>B,YW:()=>U,i5:()=>v,mG:()=>j,x$:()=>G});var n=r(78888),i=r(49186),o=r(5479),s=r(84952),a=r(5443),l=r(57251),u=r(16930),p=r(21325),c=r(50498),d=r(85113),y=r(13043),f=r(60694),m=r(20437),h=r(30524);const g="xlink:href",w="2.0.0",v="__esri_wfs_id__",x="wfs-layer:getWFSLayerTypeInfo-error",b="wfs-layer:empty-service",F="wfs-layer:feature-type-not-found",S="wfs-layer:geojson-not-supported",T="wfs-layer:kvp-encoding-not-supported",_="wfs-layer:malformed-json",A="wfs-layer:unknown-geometry-type",I="wfs-layer:unknown-field-type",M="wfs-layer:unsupported-spatial-reference",P="wfs-layer:unsupported-wfs-version";async function R(e,t){const r=function(e){const t=L(e);(function(e){const t=e.firstElementChild?.getAttribute("version");if(t&&t!==w)throw new i.A(P,`Unsupported WFS version ${t}. Supported version: ${w}`)})(t),H(t);const r=t.firstElementChild,n=(0,o.PP)(function(e){return(0,y.i)(e,{FeatureTypeList:{FeatureType:e=>{const t={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",defaultSpatialReference:4326,supportedSpatialReferences:[]},r=new Set;return(0,y.p)(e,{Name:e=>{const{name:r,prefix:n}=J(e.textContent);t.typeName=`${n}:${r}`,t.name=r,t.namespacePrefix=n,t.namespaceUri=e.lookupNamespaceURI(n)},Abstract:e=>{t.description=e.textContent},Title:e=>{t.title=e.textContent},WGS84BoundingBox:e=>{t.extent=a.A.fromJSON(function(e){let t,r,n,i;for(const o of e.children)switch(o.localName){case"LowerCorner":[t,r]=o.textContent.split(" ").map((e=>Number.parseFloat(e)));break;case"UpperCorner":[n,i]=o.textContent.split(" ").map((e=>Number.parseFloat(e)))}return{xmin:t,ymin:r,xmax:n,ymax:i,spatialReference:p.KK}}(e))},DefaultCRS:e=>{const n=N(e);n&&(t.defaultSpatialReference=n,r.add(n))},OtherCRS:e=>{const t=N(e);t&&r.add(t)}}),t.title||(t.title=t.name),r.add(4326),t.supportedSpatialReferences.push(...r),t}}})}(r));return{operations:O(r),get featureTypes(){return Array.from(n())},readFeatureTypes:n}}((await(0,n.A)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:w,...t?.customParameters},signal:t?.signal})).data);return function(e,t){(0,s.m3)(e)&&((0,s.FX)(e,t.operations.DescribeFeatureType.url,!0)&&(t.operations.DescribeFeatureType.url=(0,s.lM)(t.operations.DescribeFeatureType.url)),(0,s.FX)(e,t.operations.GetFeature.url,!0)&&(t.operations.GetFeature.url=(0,s.lM)(t.operations.GetFeature.url)))}(e,r),r}const E=["json","application/json","geojson","application/json; subtype=geojson","application/geo+json"];function C(e){for(const t of E){const r=e.findIndex((e=>e.toLowerCase()===t));if(r>=0)return e[r]}return null}function O(e){let t=!1;const r={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}},n=[],o=[];if((0,y.p)(e,{OperationsMetadata:{Parameter:e=>{if("outputFormat"===e.getAttribute("name"))return{AllowedValues:{Value:({textContent:e})=>{e&&n.push(e)}}}},Operation:e=>{switch(e.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:e=>{r.GetCapabilities.url=e.getAttribute(g)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:e=>{r.DescribeFeatureType.url=e.getAttribute(g)}}}};case"GetFeature":return{DCP:{HTTP:{Get:e=>{r.GetFeature.url=e.getAttribute(g)}}},Parameter:e=>{if("outputFormat"===e.getAttribute("name"))return{AllowedValues:{Value:({textContent:e})=>{e&&o.push(e)}}}}}}},Constraint:e=>{switch(e.getAttribute("name")){case"KVPEncoding":return{DefaultValue:e=>{t="true"===e.textContent.toLowerCase()}};case"ImplementsResultPaging":return{DefaultValue:e=>{r.GetFeature.supportsPagination="true"===e.textContent.toLowerCase()}}}}}}),r.GetFeature.outputFormat=C(o)??C(n),!t)throw new i.A(T,"WFS service doesn't support key/value pair (KVP) encoding");if(null==r.GetFeature.outputFormat)throw new i.A(S,"WFS service doesn't support GeoJSON output format");return r}function N(e){const t=parseInt(e.textContent?.match(/(?<wkid>\d+$)/i)?.groups?.wkid??"",10);if(!Number.isNaN(t))return t}function j(e,t,r){return(0,o.I6)(e,(e=>r?e.name===t&&e.namespaceUri===r:e.typeName===t||e.name===t))}async function Z(e,t,r,n={}){const{featureType:o,extent:s}=await async function(e,t,r,n={}){const o=e.readFeatureTypes(),s=t?j(o,t,r):o.next().value,{spatialReference:a=new u.A({wkid:s?.defaultSpatialReference})}=n;if(null==s)throw t?new i.A(F,`The type '${t}' could not be found in the service`):new i.A(b,"The service is empty");let c=s.extent;if(c&&!(0,p.aI)(c.spatialReference,a))try{await(0,l.initializeProjection)(c.spatialReference,a,void 0,n),c=(0,l.project)(c,a)}catch{throw new i.A(M,"Projection not supported")}return{extent:c,spatialReference:a,featureType:s}}(e,t,r,n),{spatialReference:a}=B(e.operations.GetFeature.url,o,n.spatialReference),{fields:c,geometryType:d,swapXY:y,objectIdField:f,geometryField:m}=await async function(e,t,r,n={}){const{typeName:o}=t,[s,a]=await Promise.allSettled([$(e.operations.DescribeFeatureType.url,o,n),k(e,o,r,n)]),l=e=>new i.A(x,`An error occurred while getting info about the feature type '${o}'`,{error:e});if("rejected"===s.status)throw l(s.reason);if("rejected"===a.status)throw l(a.reason);const{fields:u,errors:p}=s.value??{},c=s.value?.geometryType||a.value?.geometryType,d=a.value?.swapXY??!1;if(null==c)throw new i.A(A,`The geometry type could not be determined for type '${o}`,{typeName:o,geometryType:c,fields:u,errors:p});return{...U(u??[]),geometryType:c,swapXY:d}}(e,o,a,n);return{url:e.operations.GetCapabilities.url,name:o.name,namespaceUri:o.namespaceUri,fields:c,geometryField:m,geometryType:d,objectIdField:f,spatialReference:n.spatialReference??new u.A({wkid:o.defaultSpatialReference}),extent:s,swapXY:y,wfsCapabilities:e,customParameters:n.customParameters}}function U(e){const t=e.find((e=>"geometry"===e.type));let r=e.find((e=>"oid"===e.type));return e=e.filter((e=>"geometry"!==e.type)),r||(r=new m.A({name:v,type:"oid",alias:v}),e.unshift(r)),{geometryField:t?.name??null,objectIdField:r.name,fields:e}}async function k(e,t,r,i={}){let o,s=!1;const[a,l]=await Promise.all([G(e.operations.GetFeature.url,t,r,e.operations.GetFeature.outputFormat,{...i,count:1}),(0,n.A)(e.operations.GetFeature.url,{responseType:"text",query:z(t,r,void 0,{...i,count:1}),signal:i?.signal})]),u="FeatureCollection"===a.type&&a.features[0]?.geometry;if(u){let e;switch(o=c.gy.fromJSON((0,d.xD)(u.type)),u.type){case"Point":e=u.coordinates;break;case"LineString":case"MultiPoint":e=u.coordinates[0];break;case"MultiLineString":case"Polygon":e=u.coordinates[0][0];break;case"MultiPolygon":e=u.coordinates[0][0][0]}const t=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(l.data);if(t){const r=e[0].toFixed(3),n=e[1].toFixed(3),i=parseFloat(t[1]).toFixed(3);r===parseFloat(t[2]).toFixed(3)&&n===i&&(s=!0)}}return{geometryType:o,swapXY:s}}async function $(e,t,r){return function(e,t){const{name:r}=J(e),n=L(t);H(n);const s=(0,o.I6)((0,y.i)(n.firstElementChild,{element:e=>e}),(e=>e.getAttribute("name")===r));if(null!=s){const e=s.getAttribute("type"),t=e?(0,o.I6)((0,y.i)(n.firstElementChild,{complexType:e=>e}),(t=>t.getAttribute("name")===J(e).name)):(0,o.I6)((0,y.i)(s,{complexType:e=>e}),(()=>!0));if(t)return function(e){const t=[],r=[];let n;const o=(0,y.i)(e,{complexContent:{extension:{sequence:{element:e=>e}}}});for(const s of o){const o=s.getAttribute("name");if(!o)continue;let a,l;if(s.hasAttribute("type")?a=J(s.getAttribute("type")).name:(0,y.p)(s,{simpleType:{restriction:e=>(a=J(e.getAttribute("base")).name,{maxLength:e=>{l=+e.getAttribute("value")}})}}),!a)continue;const u="true"===s.getAttribute("nillable");let p=!1;switch(a.toLowerCase()){case"integer":case"nonpositiveinteger":case"negativeinteger":case"long":case"int":case"short":case"byte":case"nonnegativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"positiveinteger":r.push(new m.A({name:o,alias:o,type:"integer",nullable:u,length:(0,h._b)("integer")}));break;case"float":case"double":case"decimal":r.push(new m.A({name:o,alias:o,type:"double",nullable:u,length:(0,h._b)("double")}));break;case"boolean":case"string":case"gyearmonth":case"gyear":case"gmonthday":case"gday":case"gmonth":case"anyuri":case"qname":case"notation":case"normalizedstring":case"token":case"language":case"idrefs":case"entities":case"nmtoken":case"nmtokens":case"name":case"ncname":case"id":case"idref":case"entity":case"duration":case"time":r.push(new m.A({name:o,alias:o,type:"string",nullable:u,length:l??(0,h._b)("string")}));break;case"datetime":case"date":r.push(new m.A({name:o,alias:o,type:"date",nullable:u,length:l??(0,h._b)("date")}));break;case"pointpropertytype":n="point",p=!0;break;case"multipointpropertytype":n="multipoint",p=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":n="polyline",p=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":n="polygon",p=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":p=!0,t.push(new i.A(A,`geometry type '${a}' is not supported`,{type:(new XMLSerializer).serializeToString(e)}));break;default:t.push(new i.A(I,`Unknown field type '${a}'`,{type:(new XMLSerializer).serializeToString(e)}))}p&&r.push(new m.A({name:o,alias:o,type:"geometry",nullable:u}))}for(const e of r)if("integer"===e.type&&!e.nullable&&D.has(e.name.toLowerCase())){e.type="oid";break}return{geometryType:n,fields:r,errors:t}}(t)}throw new i.A(F,`Type '${e}' not found in document`,{document:(new XMLSerializer).serializeToString(n)})}(t,(await(0,n.A)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:w,TYPENAME:t,TYPENAMES:t,...r?.customParameters},signal:r?.signal})).data)}const D=new Set(["objectid","fid"]);async function G(e,t,r,o,s){let{data:a}=await(0,n.A)(e,{responseType:"text",query:z(t,r,o,s),signal:s?.signal});a=a.replaceAll(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{return JSON.parse(a)}catch(e){throw new i.A(_,"Error while parsing the response",{response:a,error:e})}}function z(e,t,r,n){const i="number"==typeof t?t:t.wkid;return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:w,TYPENAMES:e,OUTPUTFORMAT:r,SRSNAME:"EPSG:"+i,STARTINDEX:n?.startIndex,COUNT:n?.count,...n?.customParameters}}async function q(e,t,r){const i=await(0,n.A)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:w,TYPENAMES:t,RESULTTYPE:"hits",...r?.customParameters},signal:r?.signal}),o=/numberMatched=["'](?<numberMatched>\d+)["']/gi.exec(i.data);if(o?.groups)return+o.groups.numberMatched}function L(e){return(new DOMParser).parseFromString(e.trim(),"text/xml")}function J(e){const[t,r]=e.split(":");return{prefix:r?t:"",name:r??t}}function H(e){let t="",r="";if((0,y.p)(e.firstElementChild,{Exception:e=>(t=e.getAttribute("exceptionCode"),{ExceptionText:e=>{r=e.textContent}})}),t)throw new i.A(`wfs-layer:${t}`,r)}function B(e,t,r){const n={wkid:t.defaultSpatialReference},i=null!=r?.wkid?{wkid:r.wkid}:n;return{spatialReference:i,getFeatureSpatialReference:(0,f.Fi)(e)||i.wkid&&t.supportedSpatialReferences.includes(i.wkid)?{wkid:i.wkid}:{wkid:t.defaultSpatialReference}}}},13043:(e,t,r)=>{function n(e,t){if(e&&t)for(const r of e.children)if(r.localName in t){const e=t[r.localName];if("function"==typeof e){const t=e(r);t&&n(r,t)}else n(r,e)}}function*i(e,t){for(const r of e.children)if(r.localName in t){const e=t[r.localName];"function"==typeof e?yield e(r):yield*i(r,e)}}r.d(t,{i:()=>i,p:()=>n})},91880:(e,t,r)=>{r.d(t,{A:()=>c});var n,i=r(90237),o=r(66552),s=r(25482),a=r(10107),l=(r(44208),r(53966),r(87811),r(40608));const u=new o.J({asc:"ascending",desc:"descending"});let p=n=class extends s.A{constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new n({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,i._)([(0,a.MZ)({type:String,json:{write:!0}})],p.prototype,"field",void 0),(0,i._)([(0,a.MZ)({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],p.prototype,"valueExpression",void 0),(0,i._)([(0,a.MZ)({type:u.apiValues,json:{type:u.jsonValues,read:u.read,write:u.write}})],p.prototype,"order",void 0),p=n=(0,i._)([(0,l.$)("esri.layers.support.OrderByInfo")],p);const c=p},96184:(e,t,r)=>{r.d(t,{A:()=>m});var n=r(90237),i=r(69540),o=r(25482),s=r(10107),a=(r(44208),r(53966),r(87811),r(36005)),l=r(40608),u=r(43937),p=r(79677),c=r(10184),d=r(56400);function y(e,t){return c.A.fromJSON({value:e,unit:t})}let f=class extends(i.A.ClonableMixin(o.A)){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(e,t){return t.timeExtent&&Array.isArray(t.timeExtent)&&2===t.timeExtent.length?p.A.fromArray(t.timeExtent):null}writeFullTimeExtent(e,t){null!=e?.start&&null!=e.end?t.timeExtent=e.toArray():t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?y(t.timeInterval,t.timeIntervalUnits):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?y(t.defaultTimeInterval,t.defaultTimeIntervalUnits):null}writeInterval(e,t){t.timeInterval=e?.toJSON().value??null,t.timeIntervalUnits=e?.toJSON().unit??null}};(0,n._)([(0,s.MZ)({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],f.prototype,"cumulative",void 0),(0,n._)([(0,s.MZ)({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],f.prototype,"endField",void 0),(0,n._)([(0,s.MZ)({type:p.A,json:{write:{enabled:!0,allowNull:!0}}})],f.prototype,"fullTimeExtent",void 0),(0,n._)([(0,a.w)("fullTimeExtent",["timeExtent"])],f.prototype,"readFullTimeExtent",null),(0,n._)([(0,u.K)("fullTimeExtent")],f.prototype,"writeFullTimeExtent",null),(0,n._)([(0,s.MZ)({type:Boolean,json:{write:!0}})],f.prototype,"hasLiveData",void 0),(0,n._)([(0,s.MZ)({type:c.A,json:{write:{enabled:!0,allowNull:!0}}})],f.prototype,"interval",void 0),(0,n._)([(0,a.w)("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],f.prototype,"readInterval",null),(0,n._)([(0,u.K)("interval")],f.prototype,"writeInterval",null),(0,n._)([(0,s.MZ)({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],f.prototype,"startField",void 0),(0,n._)([(0,s.MZ)((0,d.P6)("timeReference",!0))],f.prototype,"timeZone",void 0),(0,n._)([(0,s.MZ)({type:String,json:{write:{enabled:!0,allowNull:!0}}})],f.prototype,"trackIdField",void 0),(0,n._)([(0,s.MZ)({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],f.prototype,"useTime",void 0),(0,n._)([(0,s.MZ)({type:[Date],json:{read:!1}})],f.prototype,"stops",void 0),f=(0,n._)([(0,l.$)("esri.layers.support.TimeInfo")],f);const m=f},41560:(e,t,r)=>{r.d(t,{Ch:()=>s,mW:()=>o});var n=r(34727),i=r(39516);function o(e,t){return{...t,filterMode:e.mode}}function s(e,t,r){const o=function(e){if("manual"===u(e))return null;const t=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const{minScale:r,maxScale:n}of e.filters)t[0]=Math.max(t[0],p(r)),t[1]=Math.min(t[1],c(n));return t}(e);if(o&&((0,n.gg)(t,o[0])||(0,n.ZH)(r,o[1])))return"";const s=Array.from(a(e,t,r)),l=function(e,t,r){if(0===e.length)return!0;const i=p(e.at(0)?.minScale),o=c(e.at(-1)?.maxScale);if((0,n.ZH)(i,t)||(0,n.gg)(o,r))return!0;for(let t=0;t<e.length-1;t++){const r=e[t],i=e[t+1];if((0,n.ZH)(p(i.minScale),c(r.maxScale)))return!0}return!1}(s,t,r)?"1=1":s.map((e=>e.where||"1=1")).reduce(((e,t)=>(0,i.IW)(e,t)),"");return l&&"1=1"!==l?l:""}function*a(e,t,r){if("manual"===u(e)){const t=e.filters.find((t=>t.id===e.activeFilterId));t&&(yield t)}else{"object"==typeof t&&(t=t.scale);for(const n of e.filters)l(n.minScale,n.maxScale,t,r)&&(yield n)}}function l(e,t,r,i){return e=p(e),r=p(r),t=c(t),!(!(0,n.Sp)(r,e)&&(i??r)>e||(0,n.Hx)(t,r)||void 0!==i&&(0,n.Sp)(i,e))}function u(e){return"mode"in e?e.mode:e.filterMode}function p(e){return e||Number.POSITIVE_INFINITY}function c(e){return e||0}},17036:(e,t,r)=>{r.d(t,{p:()=>l});var n=r(44208),i=r(53966),o=r(20437),s=r(95466),a=r(30524);function l(){return{fields:{type:[o.A],value:null,set:function(e){if(e&&(0,n.A)("big-integer-warning-enabled")){const t=e.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(t.length){const e=t.map((e=>`'${e.name}'`)).join(", ");i.A.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${e}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return s.A.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const t of e){const r=this.fieldsIndex?.has(t);r||i.A.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e})}return(0,a.DB)(this.fieldsIndex,e)}}}}},32730:(e,t,r)=>{r.d(t,{BI:()=>h,D3:()=>f,XJ:()=>m,lc:()=>y,mX:()=>w,rU:()=>g,tH:()=>S});var n=r(799);const i="__begin__",o="__end__",s=new RegExp(i,"ig"),a=new RegExp(o,"ig"),l=new RegExp("^"+i,"i"),u=new RegExp(o+"$","i"),p='"',c=p+" + ",d=" + "+p;function y(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function f(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function m(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=y(e.labelExpression),t.type="conventional"),t}function h(e){const t=m(e);switch(t.type){case"conventional":return w(t.expression);case"arcade":return t.expression}return null}function g(e){const t=m(e);switch(t.type){case"conventional":return function(e){const t=e?.match(v);return t?.[1].trim()||null}(t.expression);case"arcade":return S(t.expression)}return null}function w(e){let t;return e?(t=(0,n.HC)(e,(e=>i+'$feature["'+e+'"]'+o)),t=l.test(t)?t.replace(l,""):p+t,t=u.test(t)?t.replace(u,""):t+p,t=t.replaceAll(s,c).replaceAll(a,d)):t='""',t}const v=/^\s*\{([^}]+)\}\s*$/i,x=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,b=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,F=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function S(e){if(!e)return null;let t=x.exec(e)||b.exec(e);return t?t[1]||t[3]:(t=F.exec(e),t?t[2]:null)}},73133:(e,t,r)=>{r.d(t,{j:()=>n});const n=(0,r(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0})},37745:(e,t,r)=>{r.d(t,{A:()=>m});var n,i=r(90237),o=r(52106),s=r(69540),a=r(4718),l=r(10107),u=(r(44208),r(53966),r(40608));let p=n=class extends(s.A.ClonableMixin(o.A)){constructor(e){super(e),this.stackedAttributes=null}cloneShallow(){return new n({...super.cloneShallow(),stackedAttributes:this.stackedAttributes})}toJSON(){return{...super.toJSON(),stackedAttributes:(0,a.o8)(this.stackedAttributes)}}};(0,i._)([(0,l.MZ)()],p.prototype,"stackedAttributes",void 0),p=n=(0,i._)([(0,u.$)("esri.AttributeBinsGraphic")],p);const c=p;r(87811);var d=r(36005),y=r(22671);let f=class extends(s.A.ClonableMixin(y.A)){constructor(){super(...arguments),this.features=[]}readFeatures(e,t){return this.readFeaturesWithClass(e,t,c)}};(0,i._)([(0,l.MZ)({type:[c],json:{write:!0}})],f.prototype,"features",void 0),(0,i._)([(0,d.w)("features")],f.prototype,"readFeatures",null),f=(0,i._)([(0,u.$)("esri.rest.support.AttributeBinsFeatureSet")],f);const m=f},22671:(e,t,r)=>{r.d(t,{A:()=>v});var n,i=r(90237),o=r(52106),s=r(66552),a=r(25482),l=r(4718),u=r(10107),p=(r(44208),r(53966),r(36005)),c=r(40608),d=r(43937),y=r(16930),f=r(65864),m=r(50498),h=r(20437);const g=new s.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let w=n=class extends a.A{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,o.A)}writeGeometryType(e,t,r,n){if(e)return void g.write(e,t,r,n);const{features:i}=this;if(i)for(const e of i)if(null!=e?.geometry)return void g.write(e.geometry.type,t,r,n)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,n=(0,f.rS)(e);return n&&!r&&t.spatialReference&&(n.spatialReference=y.A.fromJSON(t.spatialReference)),n}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new n(this.cloneProperties())}cloneProperties(){return(0,l.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const n=t.features[r];if(n.geometry){const t=e?.[r];n.geometry=t?.toJSON()||n.geometry}}return t}quantize(e){const{scale:[t,r],translate:[n,i]}=e,o=this.features,s=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-n)/t)),(e=>Math.round((i-e)/r)));for(let e=0,t=o.length;e<t;e++)s?.(o[e].geometry)||(o.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[n,i],scale:[o,s]}=r;let a=null,l=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;a=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;l=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,(e=>e*o+n),(e=>i-e*s),a,l);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}readFeaturesWithClass(e,t,r){const n=y.A.fromJSON(t.spatialReference),i=[];for(let t=0;t<e.length;t++){const o=e[t],s=r.fromJSON(o),a=o.geometry?.spatialReference;null==s.geometry||a||(s.geometry.spatialReference=n);const l=o.aggregateGeometries,u=s.aggregateGeometries;if(l&&null!=u)for(const e in u){const t=u[e],r=l[e],i=r?.spatialReference;null==t||i||(t.spatialReference=n)}i.push(s)}return i}_quantizePoints(e,t,r){let n,i;const o=[];for(let s=0,a=e.length;s<a;s++){const a=e[s];if(s>0){const e=t(a[0]),s=r(a[1]);e===n&&s===i||(o.push([e-n,s-i]),n=e,i=s)}else n=t(a[0]),i=r(a[1]),o.push([n,i])}return o.length>0?o:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const n=(0,f.Bi)(e)?e.rings:e.paths,i=[];for(let e=0,o=n.length;e<o;e++){const o=n[e],s=this._quantizePoints(o,t,r);s&&i.push(s)}return i.length>0?((0,f.Bi)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{const n=this._quantizePoints(e.points,t,r);return n&&n.length>0?(e.points=n,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,n,i){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),n&&(e.z=n(e.z))}:"polyline"===e||"polygon"===e?e=>{const o=(0,f.Bi)(e)?e.rings:e.paths;let s,a;for(let e=0,n=o.length;e<n;e++){const n=o[e];for(let e=0,i=n.length;e<i;e++){const i=n[e];e>0?(s+=i[0],a+=i[1]):(s=i[0],a=i[1]),i[0]=t(s),i[1]=r(a)}}if(n&&i)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=n(r[2]),r[3]=i(r[3])}}else if(n)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=n(r[2])}}else if(i)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),n&&null!=e.zmax&&null!=e.zmin&&(e.zmax=n(e.zmax),e.zmin=n(e.zmin)),i&&null!=e.mmax&&null!=e.mmin&&(e.mmax=i(e.mmax),e.mmin=i(e.mmin))}:"multipoint"===e?e=>{const o=e.points;let s,a;for(let e=0,n=o.length;e<n;e++){const n=o[e];e>0?(s+=n[0],a+=n[1]):(s=n[0],a=n[1]),n[0]=t(s),n[1]=r(a)}if(n&&i)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=n(t[2]),t[3]=i(t[3])}else if(n)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=n(t[2])}else if(i)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=i(t[2])}}:null}};(0,i._)([(0,u.MZ)({type:String,json:{write:!0}})],w.prototype,"displayFieldName",void 0),(0,i._)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"exceededTransferLimit",void 0),(0,i._)([(0,u.MZ)({type:[o.A],json:{write:!0}})],w.prototype,"features",void 0),(0,i._)([(0,p.w)("features")],w.prototype,"readFeatures",null),(0,i._)([(0,u.MZ)({type:[h.A],json:{write:!0}})],w.prototype,"fields",void 0),(0,i._)([(0,u.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],w.prototype,"geometryType",void 0),(0,i._)([(0,d.K)("geometryType")],w.prototype,"writeGeometryType",null),(0,i._)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasM",void 0),(0,i._)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasZ",void 0),(0,i._)([(0,u.MZ)({types:m.yR,json:{write:!0}})],w.prototype,"queryGeometry",void 0),(0,i._)([(0,p.w)("queryGeometry")],w.prototype,"readQueryGeometry",null),(0,i._)([(0,u.MZ)({type:y.A,json:{write:!0}})],w.prototype,"spatialReference",void 0),(0,i._)([(0,d.K)("spatialReference")],w.prototype,"writeSpatialReference",null),(0,i._)([(0,u.MZ)({json:{write:!0}})],w.prototype,"transform",void 0),w=n=(0,i._)([(0,c.$)("esri.rest.support.FeatureSet")],w),w.prototype.toJSON.isDefaultToJSON=!0;const v=w},41366:(e,t,r)=>{r.d(t,{K:()=>d,Q:()=>u});var n=r(90237),i=r(66552),o=r(53966),s=r(10107),a=(r(44208),r(87811),r(93223)),l=r(40608);const u=(0,i.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),p="percent-of-total",c="field",d=e=>{let t=class extends e{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,r=null!=this.normalizationTotal;return t||r?(e=t&&c||r&&p||null,t&&r&&o.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==c&&e!==p||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,n._)([(0,s.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],t.prototype,"normalizationField",void 0),(0,n._)([(0,s.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],t.prototype,"normalizationMaxValue",void 0),(0,n._)([(0,s.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],t.prototype,"normalizationMinValue",void 0),(0,n._)([(0,s.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],t.prototype,"normalizationTotal",void 0),(0,n._)([(0,a.e)(u,{name:"parameters.normalizationType"})],t.prototype,"normalizationType",null),t=(0,n._)([(0,l.$)("esri.rest.support.NormalizationBinParametersMixin")],t),t}},10184:(e,t,r)=>{r.d(t,{A:()=>d});var n=r(90237),i=r(69540),o=r(25482),s=r(88930),a=r(10107),l=(r(44208),r(53966),r(87811),r(93223)),u=r(40608),p=r(73133);let c=class extends(i.A.ClonableMixin(o.A)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,s.t)(this.value,this.unit,"milliseconds")}};(0,n._)([(0,l.e)(p.j,{nonNullable:!0})],c.prototype,"unit",void 0),(0,n._)([(0,a.MZ)({type:Number,json:{write:!0},nonNullable:!0})],c.prototype,"value",void 0),c=(0,n._)([(0,u.$)("esri.time.TimeInterval")],c);const d=c}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9547],{19547:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ae});var i=n(90237),s=n(13874),o=n(69540),a=n(49186),r=n(92071),l=n(74887),c=n(36708),u=n(10107),p=(n(44208),n(53966)),d=(n(87811),n(40608)),m=n(4146),f=n(63074),g=n(69208),h=n(89015),v=n(16131),y=n(8303),b=n(54310),w=n(25036),x=n(82935),C=n(10873),I=n(20437),S=n(74797),D=n(5443),A=n(38458),T=n(78888),L=n(50103);function V(e){return e.endsWith("?")?e.slice(0,-1):e}function M(e){return e.filter((({coverageSubType:e})=>null==e||""===e||/^rectified(grid|dataset)/i.test(e)))}function N(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,L.vv)(i).toLowerCase();switch(s){case"title":case"abstract":t[s]=(0,L.mX)(i);break;case"identifier":t.id=(0,L.mX)(i);break;case"wgs84boundingbox":{const e=(0,L.pN)(i,"LowerCorner"),n=(0,L.pN)(i,"UpperCorner");t.lonLatEnvelope=new D.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(N(i))}}return t}function R(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,R(e.coverageSummaries[n],t);null!=e.id&&t.push(e)}function P(e){const t=(0,L.V6)(e.querySelector("Operation[name=GetCapabilities]"),"Get")?.getAttribute("xlink:href")||"",n=(0,L.V6)(e.querySelector("Operation[name=DescribeCoverage]"),"Get")?.getAttribute("xlink:href")||"",i=(0,L.V6)(e.querySelector("Operation[name=GetCoverage]"),"Get")?.getAttribute("xlink:href")||"";return{getCapabilities:V(t),describeCoverage:V(n),getCoverage:V(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",o=s.slice(0,3);let r;if("2.0"===o)r=function(e){const t=(0,L.V6)(e,"ServiceIdentification"),n=(0,L.mX)(t,"Title"),i=(0,L.Dy)(t,"ServiceTypeVersion"),s=(0,L.Dy)(t,"Profile"),o=P((0,L.V6)(e,"OperationsMetadata")),a=(0,L.IC)(e,"Contents/CoverageSummary"),r=[];for(let e=0;e<a.length;e++){const t=a[e],n=(0,L.mX)(t,"CoverageId"),i=(0,L.V6)(t,"WGS84BoundingBox");let s;if(i){const e=(0,L.pN)(i,"LowerCorner"),t=(0,L.pN)(i,"UpperCorner");s=new D.A({xmin:e[0],ymin:e[1],xmax:t[0],ymax:t[1],spatialReference:{wkid:4326}})}const o=(0,L.mX)(t,"CoverageSubtype")||"RectifiedGridCoverage";r.push({id:n,lonLatEnvelope:s,coverageSubType:o})}const l=(0,L.V6)(e,"ServiceMetadata");return{name:n,supportedVersions:i,supportedFormats:(0,L.Dy)(l,"formatSupported"),supportedInterpolations:(0,L.Dy)(l,"interpolationSupported").concat((0,L.Dy)(l,"InterpolationSupported")),onlineResources:o,profiles:s,coverages:r,gridCoverages:M(r),version:"2.0.1"}}(n);else if("1.1"===o)r=function(e){const t=(0,L.mX)(e,"ServiceIdentification/Title"),n=(0,L.Dy)(e,"ServiceIdentification/ServiceTypeVersion"),i=P((0,L.V6)(e,"OperationsMetadata")),s=[],o=(0,L.V6)(e,"Contents");for(let e=0;e<o.childNodes.length;e++){const t=o.childNodes[e];1===t.nodeType&&(0,L.g7)(t,"CoverageSummary")&&R(N(t),s)}const a=(0,L.Dy)(o,"SupportedFormat");return{name:t,onlineResources:i,coverages:s,gridCoverages:M(s),supportedVersions:n,supportedFormats:a,version:"1.1.0"}}(n);else{if("1.0"!==o)throw new a.A("wcsraster:parsecapabilities","the capabilities version is not supported");r=function(e){const t=(0,L.mX)(e,"Service/name"),n=(0,L.V6)(e,"Capability"),i=(0,L.V6)(n,"GetCapabilities/Get/OnlineResource")?.getAttribute("xlink:href")??"",s=(0,L.V6)(n,"DescribeCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",o=(0,L.V6)(n,"GetCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",a={getCapabilities:V(i),describeCoverage:V(s),getCoverage:V(o)},r=(0,L.IC)(e,"CoverageOfferingBrief"),l=[];for(let e=0;e<r.length;e++){const t=r[e],n=(0,L.mX)(t,"name"),i=(0,L.IC)(t,"pos"),s=(0,L.pN)(i[0]),o=(0,L.pN)(i[1]),a=new D.A({xmin:s[0],ymin:s[1],xmax:o[0],ymax:o[1],spatialReference:{wkid:4326}});l.push({id:n,lonLatEnvelope:a})}return{name:t,onlineResources:a,coverages:l,gridCoverages:M(l),supportedVersions:["1.0.0"],version:"1.0.0"}}(n)}return r.version=s,r}var X=n(39829),$=n(87186),O=n(77301);function _(e){e.variables.forEach((e=>e.dimensions.forEach((e=>e.values??=(0,O.Xg)(e)))))}function k(e){return{requestResponseCRSs:(0,L.Dy)(e,"requestResponseCRSs").map((e=>e.split(":")[1])),nativeCRSs:(0,L.Dy)(e,"nativeCRSs").map((e=>e.split(":")[1]))}}function F(e,t){const n=(0,L.Dy)(e,"1.0.0"===t?"interpolationMethod":"InterpolationMethod"),i="1.0.0"===t?e.getAttribute("default"):(0,L.mX)(e,"InterpolationMethods/Default");return null!=i?[i].concat(n.filter((e=>e.toLowerCase()!==i.toLowerCase()))):n}function G(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 B(e){const t=(0,L.IC)(e,"pos"),n=(0,L.pN)(t[0]),i=(0,L.pN)(t[1]);return new D.A({xmin:n[0],ymin:n[1],xmax:i[0],ymax:i[1],spatialReference:{wkid:4326}})}function j(e,t){const n=(0,L.Dy)(e,t);return n?.length&&""!==n[0]&&!isNaN(Number(n[0]))?n.map((e=>Number(e))):null}function W(e){const t=(0,L.pN)(e,"MinimumValue"),n=(0,L.pN)(e,"MaximumValue");return t.length&&n.length?t.map(((e,t)=>({min:e,max:n[t],avg:-1,stddev:-1}))):null}function q(e){return null==e?null:e.every((t=>t===e[0]))?e[0]:e}function Z(e){const t=[],n=(0,L.IC)(e,"RangeSet");let i=[];for(let e=0;e<n.length;e++){const s=(0,L.mX)(n[e],"name"),o=(0,L.mX)(n[e],"label"),a=[],r=j(n[e],"nullValues/singleValue"),l=(0,L.IC)(n[e],"AxisDescription");for(let e=0;e<l.length;e++){const t=(0,L.mX)(l[e],"name"),n=(0,L.mX)(l[e],"label"),s=(0,L.Dy)(l[e],"singleValue");if(0===s.length){const t=(0,L.mX)(l[e],"min"),n=(0,L.mX)(l[e],"max"),i=Number((0,L.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),a.push({name:t,label:n,values:s})}t.push({name:s,label:o,nullValues:r,axis:a})}return{rangeSet:t,bandNames:i}}function U(e=null){if(!e)return{resolution:null,units:null};let t=e.toUpperCase();const n=["Years","Months","Days","Hours","Minutes","Seconds"];let i,s,o;return t.includes("PT")?(t=t.slice(2),o=["H","M","S"].findIndex((e=>t.includes(e))),i=n[3+o],s=parseFloat(t.slice(0,-1))):(t=t.slice(1),o=["Y","M","D"].findIndex((e=>t.includes(e))),o>-1&&(i=n[o]),s=parseFloat(t.slice(0,-1))),{resolution:s,units:i}}function z(e){const t=(0,L.IC)(e,"timeposition");if(t.length>0){const e=[];for(let n=0;n<t.length;n++)e.push(new Date((0,L.mX)(t[n])));return{begin:e[0],end:e[e.length-1],values:e}}const n=(0,L.V6)(e,"timePeriod")||(0,L.V6)(e,"TimePeriod");return n?{begin:new Date((0,L.mX)(n,"beginPosition")||(0,L.mX)(n,"BeginPosition")),end:new Date((0,L.mX)(n,"endPosition")||(0,L.mX)(n,"EndPosition")),...U((0,L.mX)(n,"timeResolution")||(0,L.mX)(n,"TimeResolution"))}:null}function H(e){const t=(0,L.V6)(e,"spatialDomain"),n=(0,L.V6)(t,"Envelope")||(0,L.V6)(t,"EnvelopeWithTimePeriod"),i=n.getAttribute("srsName").split(":"),s=i[i.length-1],o=(0,L.IC)(n,"pos"),a=(0,L.pN)(o[0]),r=(0,L.pN)(o[1]),l=parseInt(s,10),c=isNaN(l)?null:{wkid:l},u=new D.A({xmin:a[0],ymin:a[1],xmax:r[0],ymax:r[1],spatialReference:c}),p=(0,L.V6)(t,"RectifiedGrid"),d=(0,L.mX)(p,"low").split(" "),m=(0,L.mX)(p,"high").split(" "),f=parseInt(m[0],10)-parseInt(d[0],10)+1,g=parseInt(m[1],10)-parseInt(d[1],10)+1,h=(0,L.pN)(t,"origin/pos"),v=(0,L.IC)(t,"offsetVector"),y={envelope:u,columns:f,rows:g,offset:{x:parseFloat((0,L.mX)(v[0]).split(" ")[0]),y:parseFloat((0,L.mX)(v[1]).split(" ")[1])},origin:{x:h[0],y:h[1]}},b=(0,L.V6)(e,"temporalDomain")||(0,L.V6)(e,"TemporalDomain");return{spatialDomain:y,temporalDomain:b?z(b):null}}function Y(e){if(!e.temporalDomain)return null;const{begin:t,end:n,values:i,units:s,resolution:o}=e.temporalDomain,a={variables:[{name:"default",description:"",dimensions:[{name:"StdTime",description:"",unit:"ISO8601",values:i?.map((e=>e.getTime())),hasRegularIntervals:!i,interval:o,intervalUnit:s,extent:[t.getTime(),n.getTime()]}]}]};return _(a),a}function Q(e,t){const n=[],i=(0,L.IC)(e,"Field");let s,o=[];for(let e=0;e<i.length;e++){const a=(0,L.mX)(i[e],"Identifier"),r=(0,L.mX)(i[e],"Description"),l=(0,L.mX)(i[e],"Definition"),c=(0,L.mX)(i[e],"Abstract"),u=(0,L.mX)(i[e],"Title"),p=j(i[e],"NullValue"),d=(0,L.V6)(i[e],"AllowedValues"),m=d?W(d):null,f=F(i[e],"1.1.0"),g=[],h=(0,L.IC)(i[e],"Axis");for(let e=0;e<h.length;e++){const n=h[e].getAttribute("identifier"),i=(0,L.mX)(h[e],"UOM"),a=(0,L.mX)(h[e],"DataType"),r=(0,L.Dy)(h[e],"Key");t&&!n.toLowerCase().includes("band")||(o=r,s=p),g.push({identifier:n,uom:i,dataType:a,values:r,bandNoDataValues:s})}n.push({identifier:a,description:r,definition:l,abstract:c,title:u,supportedInterpolations:f,axis:g,nullValues:p,statistics:m})}return{rangeSet:n,bandNames:o,bandNoDataValues:s,statistics:n[0].statistics}}function J(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:o,resolution:a}=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:a,intervalUnit:o,extent:[e.getTime(),n.getTime()]})}))}if(i.length){const e={variables:i};return _(e),e}return null}function K(e){const t=(0,L.V6)(e,"SpatialDomain"),n=(0,L.V6)(t,"GridCRS"),i=(0,L.mX)(n,"GridBaseCRS"),s=(0,L.mX)(n,"GridOrigin"),o=s?.split(" ").map((e=>parseFloat(e)))??[0,0],a=(0,L.pN)(n,"GridOffsets"),r=(0,L.IC)(t,"BoundingBox");let l,c,u,p;for(let e=0;e<r.length;e++){const t=r[e].getAttribute("crs")?.toLowerCase();if(null!=t)if(t.includes("imagecrs")){const t=(0,L.pN)(r[e],"LowerCorner"),n=(0,L.pN)(r[e],"UpperCorner");l=n[0]-t[0]+1,c=n[1]-t[1]+1}else if(t.indexOf("epsg")>0){const n=t.split(":");u=parseInt(n[n.length-1],10);const i=(0,L.pN)(r[e],"LowerCorner"),s=(0,L.pN)(r[e],"UpperCorner");p=new D.A({xmin:i[0],ymin:i[1],xmax:s[0],ymax:s[1],spatialReference:{wkid:u}})}}const d=l>c,m=p.xmax-p.xmin>p.ymax-p.ymin;let f=!1;(0,A.m)(u)&&(d===m?f=!1:(f=!0,p=new D.A({xmin:p.ymin,ymin:p.xmin,xmax:p.ymax,ymax:p.xmax,spatialReference:{wkid:u}})));const g={columns:l,rows:c,origin:{x:o[0],y:o[1]},offset:{x:a[0],y:a[a.length-1]},gridBaseCRS:i,envelope:p,useEPSGAxis:f},h=(0,L.V6)(e,"temporalDomain")||(0,L.V6)(e,"TemporalDomain");return{spatialDomain:g,temporalDomain:h?z(h):null}}function ee(e){const t=(0,L.V6)(e,"Envelope")||(0,L.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())),o=(0,L.pN)(t,"lowerCorner"),a=(0,L.pN)(t,"upperCorner"),r=!["y","lat","latitude","north","nor","n","b"].includes(s[0].toLowerCase());let l;const c=parseInt(i,10),u=isNaN(c)?null:{wkid:c};l=new D.A(r?{xmin:o[0],ymin:o[1],xmax:a[0],ymax:a[1],spatialReference:u}:{xmin:o[1],ymin:o[0],xmax:a[1],ymax:a[0],spatialReference:u});const p={mins:o,maxs:a},d=t.getAttribute("uomLabels").trim().split(" ");let m,f;if((0,L.g7)(t,"EnvelopeWithTimePeriod")){m=new Date((0,L.mX)(e,"beginPosition")||(0,L.mX)(e,"BeginPosition")),f=new Date((0,L.mX)(e,"endPosition")||(0,L.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:m,endPosition:f,isEastFirst:r}}function te(e,t){const n=[],i=(0,L.IC)(e,"DataRecord"),s=[];let o,a=[];for(let e=0;e<i.length;e++){const r=(0,L.IC)(i[e],"field"),l=[];for(let e=0;e<r.length;e++){const n=r[e].getAttribute("name"),i=(0,L.mX)(r[e],"description")||"",c=(0,L.V6)(r[e],"uom")?.getAttribute("code")||"",u=(0,L.pN)(r[e],"interval"),p=j(r[e],"nilValue")?.[0];t&&!n.toLowerCase().includes("band")||(s.push(n),u?.length&&(o=o||[],o.push({min:u[0],max:u[1],avg:-1,stddev:-1})),a.push(p)),l.push({name:n,description:i,uom:c,allowedValues:u,nilValue:p})}n.push(l)}return a.some((e=>null!=e))||(a=null),{rangeType:n,bandNames:s,bandStats:o,bandNoDataValues:a}}function ne(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 ie(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()??"",o=n.axisLabels[i].toLowerCase().includes("time")||"iso8601"===s.toLowerCase()||"oledatetime"===s.toLowerCase();let a,r;if(o){const e=ne(n.offset[i]);a=e.interval,r=e.intervalUnit}else a=n.offset[i],r=s;const l=[];o?(l.push(ae(t.envelopeAllDims.mins[i])),l.push(ae(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:o?"ISO8601":s,hasRegularIntervals:!0,extent:l,interval:a,intervalUnit:r})}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 _(e),e}}return null}function se(e,t){const n=(0,L.V6)(e,"RectifiedGrid"),i=(0,L.pN)(n,"low"),s=(0,L.pN)(n,"high"),o=[];for(let e=0;e<i.length;e++)o.push(s[e]-i[e]+1);const a=(0,L.mX)(n,"axisLabels").split(" "),r=(0,L.pN)(n,"origin/pos"),l=(0,L.IC)(n,"offsetVector"),c=[];for(let e=0;e<l.length;e++){const t=(0,L.pN)(l[e]),n=t.findIndex((e=>0!==e));c[n]=t[n]}let u,p,d,m=!1;return t?.length&&a?.length&&(m=[...t].sort(((e,t)=>e<t?-1:1)).join(",")===[...a].sort(((e,t)=>e<t?-1:1)).join(",")),["y","lat","latitude","north","nor","n","b"].includes((m?a:t)[0].toLowerCase())?(u=o[1],p=o[0],d={y:Math.abs(c[0]),x:Math.abs(c[1])}):(u=o[0],p=o[1],d={x:Math.abs(c[0]),y:Math.abs(c[1])}),{columns:u,rows:p,origin:r,offset:c,resolution:d,gridSamples:o,axisLabels:a,hasSameAxisLabelsAsBoundedBy:m}}function oe(e){const t=(0,L.V6)(e,"EarthObservation");if(!t)return null;const n=(0,L.V6)(t,"phenomenonTime"),i=n?z(n):null,s=(0,L.V6)(t,"phenomenonTime"),o=s?z(s):null,a=(0,L.mX)(t,"featureOfInterest/Footprint/multiExtentOf/MultiSurface/surfaceMembers/Polygon/exterior/LinearRing/posList");let r=null;if(a){const e=a.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]);r=new X.A({rings:[[t]]})}}return{observation:{phenomenonTime:i,resultTime:o,footprint:r,identifier:(0,L.mX)(e,"metaDataProperty/EarthObservationMetaData/identifier"),acquisitionType:(0,L.mX)(e,"metaDataProperty/EarthObservationMetaData/acquisitionType"),status:(0,L.mX)(e,"metaDataProperty/EarthObservationMetaData/status")}}}function ae(e){return Math.round(24*(e-25569)*3600*1e3)}async function re(e,t){const{coverageIds:n,version:i,customParameters:s,signal:o}=t,r=i.slice(0,3),c="1.0"===r?"coverage":"1.1"===r?"identifiers":"coverageId",u={service:"WCS",request:"DescribeCoverage",version:i,[c]:n.join(","),...s};try{const{data:t}=await(0,T.A)(e,{query:u,responseType:"xml",signal:o});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,L.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 o=e.childNodes[s];if(1===o.nodeType)if((0,L.g7)(o,"description"))t.description=(0,L.mX)(o);else if((0,L.g7)(o,"name"))t.name=(0,L.mX)(o);else if((0,L.g7)(o,"label"))t.label=(0,L.mX)(o);else if((0,L.g7)(o,"supportedFormats"))t.supportedFormats=(0,L.Dy)(o,"formats");else if((0,L.g7)(o,"supportedCRSs"))t.supportedCRSs=k(o);else if((0,L.g7)(o,"supportedInterpolations"))t.supportedInterpolations=F(o,"1.0.0");else if((0,L.g7)(o,"lonLatEnvelope"))t.lonLatEnvelope=B(o);else if((0,L.g7)(o,"rangeSet")){const e=Z(o);t.rangeSet=e.rangeSet,i=e.bandNames;const s=e.rangeSet[0].nullValues;s?.length&&(n=q(s))}else(0,L.g7)(o,"domainSet")&&(t.domainSet=H(o))}const s=G(t.supportedInterpolations),{name:o,description:a,label:r,lonLatEnvelope:l,supportedFormats:c}=t,{spatialDomain:u}=t.domainSet,p={x:Math.abs(u.offset.x),y:Math.abs(u.offset.y)},d=Y(t.domainSet),m=new $.A({width:u.columns,height:u.rows,pixelSize:p,pixelType:"unknown",extent:u.envelope,spatialReference:u.envelope.spatialReference,bandCount:i.length||1,noDataValue:n,multidimensionalInfo:d});return{id:o,title:t.name,description:a||r,lonLatEnvelope:l,rasterInfo:m,bandNames:i,supportedFormats:c,supportedInterpolations:s,coverageDescription:t,version:"1.0.0",useEPSGAxis:!1}}(e)));const i=(0,L.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 o,a,r=[];for(let t=0;t<e.childNodes.length;t++){const l=e.childNodes[t];if(1!==l.nodeType)continue;const c=(0,L.vv)(l).toLowerCase();switch(c){case"title":case"abstract":case"identifier":s[c]=(0,L.mX)(l);break;case"supportedformat":{const e=(0,L.mX)(l);n.includes(e)||n.push(e)}break;case"supportedcrs":{const e=(0,L.mX)(l);i.includes(e)||i.push(e)}break;case"range":{const e=Q(l,!!s.domain?.temporalDomain);s.range=e.rangeSet,r=e.bandNames;const{bandNoDataValues:t}=e;t?.length&&(o=q(t)),a=e.statistics}break;case"domain":s.domain=K(l)}}const l=G(s.range[0].supportedInterpolations),{identifier:c,abstract:u,title:p,domain:d,range:m}=s,f={x:Math.abs(d.spatialDomain.offset.x),y:Math.abs(d.spatialDomain.offset.y)},g=J(m,d);g&&(o=m[0].nullValues,1===o?.length&&(o=o[0]));const h=new $.A({width:d.spatialDomain.columns,height:d.spatialDomain.rows,pixelSize:f,pixelType:"unknown",extent:d.spatialDomain.envelope,spatialReference:d.spatialDomain.envelope.spatialReference,bandCount:r.length||1,noDataValue:o,statistics:a,multidimensionalInfo:g});return{id:c,title:s.title,description:u||p,bandNames:r,rasterInfo:h,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 o=0;o<e.childNodes.length;o++){const a=e.childNodes[o];if(1===a.nodeType)if((0,L.g7)(a,"coverageId"))t.coverageId=(0,L.mX)(a);else if((0,L.g7)(a,"ServiceParameters"))t.serviceParameters={supportedFormats:(0,L.Dy)(a,"nativeFormat")};else if((0,L.g7)(a,"boundedBy"))t.boundedBy=ee(a);else if((0,L.g7)(a,"rangeType")){const e=te(a,t.boundedBy?.axisLabels.length>2||t.domainSet?.axisLabels.length>2);t.rangeType=e.rangeType,s=e.bandNames,n=e.bandStats;const{bandNoDataValues:o}=e;o?.length&&(i=q(o))}else if((0,L.g7)(a,"domainSet"))t.domainSet=se(a,t.boundedBy?.axisLabels);else if((0,L.g7)(a,"metadata")){const e=(0,L.V6)(a,"EOMetadata");t.eoMetadata=e?oe(e):null}}const{coverageId:o,boundedBy:a,domainSet:r,rangeType:l,serviceParameters:c}=t,u=ie(l,a,r);return!n&&u&&(n=u?.variables[0].statistics),null!=u&&(i=l[0][0].nilValue),{id:o,title:o,description:o,bandNames:s,rasterInfo:new $.A({width:r.columns,height:r.rows,pixelSize:r.resolution,pixelType:"unknown",extent:a.envelope,spatialReference:a.envelope.spatialReference,bandCount:s.length||1,statistics:n,noDataValue:i,multidimensionalInfo:u}),supportedFormats:c.supportedFormats,coverageDescription:t,version:"2.0.1",useEPSGAxis:!1}}(e)))}(t,i)}catch(e){if(!(0,l.zf)(e))throw new a.A("wcslayer:open","wcs coverage description is not valid or supported");throw e}}var le=n(45617),ce=n(4916);function ue(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(),o=t[e].slice(i+1).trim();n[s]=o.startsWith('"')?o.slice(1,-1):o}}return n}(e);return t?{isMultipart:!0,data:t.boundary?pe(e.data,t,0):null}:{isMultipart:!1,data:null}}function pe(e,t,n=0){const i="--"+t.boundary,s=[];for(let e=0;e<i.length;e++)s.push(i.charCodeAt(e));const o=[],a="\n--"+t.boundary+"--";for(let e=0;e<a.length;e++)o.push(a.charCodeAt(e));const r=[10],l=[13,10],c=[],u=s.length,p=new Uint8Array(e,n),d=p.length-u;let m=0,f=0;for(let e=0;e<d;e++){for(f=0;f<u&&p[e+f]===s[f];f++);if(f!==u)continue;let n=!1;if(m){const i=de(p.subarray(m,e),t);c.push(i),n=!!i.isValidImage}if(e+=u-1,p[e+1]===r[0]?e+=1:p[e+1]===l[0]&&p[e+2]===l[1]&&(e+=2),m=e+1,n)break}const g=o.length;for(let e=p.length-g-10;e<p.length-g;e++){for(f=0;f<g&&p[e+f]===o[f];f++);if(f===g){c.push(de(p.subarray(m,e),t));break}}return c}function de(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 o=0;for(let a=0;a<i;a++)if(n[a].length<4)o=o+n[a].length+1;else if("content"===n[a].slice(0,7).toLowerCase()){o=o+n[a].length+1;const e=n[a].indexOf(":");if(-1===e)continue;const t=n[a].slice(0,e).trim(),i=n[a].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[a].length>=4&&s.contentType?.toLowerCase().indexOf("image")>-1){let t=!0,n=e.subarray(o,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-o),n=new Uint8Array(t),n.set(e.subarray(o,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(o,e.length));break}s.contentData=e.subarray(o,e.length)}}return s}var me=n(51244),fe=n(28435);const ge=["nearest neighbor","bilinear","bicubic"],he=["nearest","linear","cubic"],ve="response is not a supported multipart/related mediaType with inline tiff, switching to compatibility mode",ye=new Set(["1.0.0","1.1.0","1.1.1","1.1.2","2.0.1"]);let be=class extends ce.A{constructor(){super(...arguments),this.datasetFormat="WCSServer",this.tileType="Raster"}async fetchRawTile(e,t,n,i={}){if(this.isBlockOutside(e,t,n))return null;const{nativePixelSize:s,spatialReference:o}=this.rasterInfo,r=2**e,l=s.x*r,c=s.y*r,{blockWidth:u,blockHeight:p}=this.getBlockWidthHeight(e),{origin:d}=this.rasterInfo.storageInfo.tileInfo,m=this.getTileExtent({x:l,y:c},t,n,d,o,[u,p]),f=this.rasterInfo.extent,g=m.xmax>f.xmax,h=m.ymin<f.ymin,v=g||h;let y=m,b=u,w=p;if(v&&(y=m.clone().intersection(f),null!=y&&(g&&(b=Math.floor((y.xmax-y.xmin)/l),y.xmax=y.xmin+l*b),h&&(w=Math.floor((y.ymax-y.ymin)/c),y.ymin=y.ymax-c*w))),null==y||b<=1||w<=1)return null;const x=await this._getCoverage(y,b,w,r,i);if(!x)return null;const{coverageDescription:C}=this.coverageInfo,{noDataValue:I,multidimensionalInfo:S}=this.rasterInfo,{multidimensionalDefinition:D}=i;let A;if(null!=S&&null!=D&&D.length){const e=D[0].variableName;if("2.0"===C.version){const t=C.rangeType[0].find((t=>t.name===e));A=t?.nilValue}else if("1.1"===C.version){const t=C.range.find((t=>t.identifier===e));A=t?.nullValues}}const T=A??I,L=await this.decodePixelBlock(x,{width:b,height:w,planes:null,pixelType:null,tiffNoDataValue:Array.isArray(T)?T[0]:T});if(null==L)return null;if(L&&(L.width!==b||L.height!==w))throw new a.A("wcsraster-fetch",`the response has unexpected dimension width: ${L.width}, height: {pixelBlock.height}`);return v?(0,fe.$Q)(L,{x:0,y:0},{width:p,height:p}):L}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??{},o=n?.startsWith("1.0")?"version":"acceptVersions",r={service:"WCS",request:"GetCapabilities",[o]:n,...i};try{let{data:n}=await(0,T.A)(e,{query:r,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)||(r[o]="2.0.1",({data:n}=await(0,T.A)(e,{query:r,responseType:"xml",signal:s}))),E(n)}catch(e){if(!(0,l.zf)(e))throw new a.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=>"2.0"===e.slice(0,3)))||i.supportedVersions.find((e=>"1.1"===e.slice(0,3)))||i.supportedVersions.find((e=>"1.0"===e.slice(0,3)))||"1.0.0",this.version=e)}const{version:s}=this;if(!ye.has(s))throw new a.A("wcsraster-open",`unsupported WCS version ${s}`);const{gridCoverages:o}=i;if(!o.length)throw new a.A("wcsraster-open","cannot find rectified grid coverages");this.coverageId??=o[0].id;const{coverageId:r}=this,c=o.find((e=>e.id===r));if(null==c)throw new a.A("wcsraster-open",`the coverageId ${r} does not exist in capabilities`);const u=await re(this.url,{coverageIds:[r],version:s,customParameters:t,signal:n});if(this.coverageInfo=u[0],"2.0"===s.slice(0,3)){const{coverageInfo:e}=this;e.lonLatEnvelope=c.lonLatEnvelope,e.supportedInterpolations=G(i.supportedInterpolations),this._patchDimensionValues201(r,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 a.A("wcsraster-open",`coverage without spatial reference is not supported: ${r}`);const{pixelType:d,bandCount:m}=await this._getPixelTypeAndBandCount(n);p.pixelType=d,1===p.bandCount&&m>1&&(p.bandCount=m),this.updateTileInfo()}async _patchDimensionValues201(e,t){const{coverageInfo:n}=this,i=n.rasterInfo.multidimensionalInfo?.variables,s=ye.has("1.1.2")?"1.1.2":ye.has("1.1.1")?"1.1.1":ye.has("1.1.0")?"1.1.0":null,{customFetchParameters:o}=this.ioConfig;if(i&&s)try{const n=this.url.includes("/ImageServer/"),a=e.length>8&&e.startsWith("Coverage")&&n?e.slice(8):e,r=await re(this.url,{coverageIds:[a??e],version:s,customParameters:o,signal:t}).catch((()=>{if(a)return re(this.url,{coverageIds:[e],version:s,customParameters:o,signal:t})})),l=r?.[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],o=t.dimensions.find((({name:e})=>e===s.name));o?o.values&&o.extent?.join(",")===s.extent?.join(",")&&(e.dimensions[i]={...s,values:o.values}):n&&e.dimensions.splice(i,1)}}}catch{}}async _getPixelTypeAndBandCount(e){const{pixelSize:t,extent:n,multidimensionalInfo:i}=this.rasterInfo,s=n.center,o=new D.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 r=[];if(null!=i){const e=i.variables[0];r=[],e.dimensions.forEach((t=>{r.push(new le.A({variableName:e.name,dimensionName:t.name,values:t.hasRegularIntervals?t.extent?.[0]:t.values?.[0],isSlice:!0}))}))}const{coverageDescription:l}=this.coverageInfo,c={interpolation:"nearest",multidimensionalDefinition:r,signal:e},{version:u}=l,{ioConfig:d}=this,m="2.0"===u&&null==d.allowAnyMediaType||"1.1"===u&&null==d.use2GridOffsets;let f;try{f=await this._getCoverage(o,2,2,1,c,!0)}catch(e){if(!m)throw e;if("1.1"===u){if(!e.details?.isResolutionMismatch)throw e;d.use2GridOffsets=!0}}if(!f&&m&&("2.0"===u&&(d.allowAnyMediaType=!0),f=await this._getCoverage(o,2,2,1,c),f&&p.A.getLogger(this).warn("wcsraster:getcoverage",ve)),!f)throw new a.A("wcsraster-open","unable to determine pixel type");const g=await this.decodePixelBlock(f,{width:2,height:2,planes:null,pixelType:null});if(null==g)throw new a.A("wcsraster-open","unable to determine pixel type");return{pixelType:g.pixelType,bandCount:g.getPlaneCount()??0}}async _getCoverage(e,t,n,i,s,o=!1){const{coverageDescription:r}=this.coverageInfo,{version:l}=r,c="2.0"===l?this._getCoverage201Parameters(e,t,n,i,s,r):"1.1"===l?this._getCoverage110Parameters(e,t,n,s,r):this._getCoverage100Parameters(e,t,n,s),u="2.0"===l?await this.request(this._constructWCS201Url(c),{signal:s.signal,responseType:"array-buffer"}):await this.request(this.url,{query:c,signal:s.signal,responseType:"array-buffer"});if("1.0"===l)return u.data;if("2.0"===l&&!1!==this.ioConfig.allowAnyMediaType&&"tiff"===(0,me.g)(u.data))return o&&(this.ioConfig.allowAnyMediaType=!0,p.A.getLogger(this).warn("wcsraster:getcoverage",ve)),u.data;const d=ue(u);if(d.isMultipart&&d.data){const e=d.data.find((e=>e.isValidImage));return o&&"base64"===e?.contentTransferEncoding&&p.A.getLogger(this).warn("wcsraster:getcoverage","response is base64 encoded which may impact layer display performance"),e?.contentData}const m=new Uint8Array(u.data,0,Math.min(u.data.byteLength,2e3)),f=String.fromCharCode.apply(null,m).toLowerCase().includes("exception"),g=f&&String.fromCharCode.apply(null,m).includes("A non-zero RESX/RESY or WIDTH/HEIGHT is required but neither was provided");if(f)throw new a.A("wcsraster:getcoverage","server returns an exception",{isResolutionMismatch:g});throw new a.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}`,o=e.spatialReference.wkid,a=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"GEOTIFF",{bandIds:r,interpolation:l}=i,c=this._getInterpolationIndex(l),u=r?r.map((e=>this.coverageInfo.bandNames[e])):null,p=ge[c],{multidimensionalDefinition:d}=i;let m;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]),m=t.map((e=>we(e))).join(","))}return{service:"WCS",request:"GetCoverage",version:this.version,coverage:this.coverageId,format:a,crs:`EPSG:${o}`,bbox:s,width:t,height:n,time:m,interpolation:p,band:u?.join(",")}}_getCoverage110Parameters(e,t,n,i,s){const{multidimensionalDefinition:o,bandIds:a,interpolation:r}=i,l=e.spatialReference.wkid,c=`urn:ogc:def:crs:EPSG::${l}`,u=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",p=this._getInterpolationIndex(r),d=he[p],m=null==r||0===this.coverageInfo.supportedInterpolations?.indexOf(r),f=s.domain.spatialDomain,g=f.origin.x<=f.envelope.xmin&&f.origin.y<=f.envelope.ymin,h=e.width/t,v=e.height/n*(g?1:-1),y=g?[e.xmin,e.ymin]:[e.xmin,e.ymax],b=f.useEPSGAxis&&(0,A.m)(l),w=b?`${y[1]},${y[0]}`:`${y[0]},${y[1]}`,x=this.ioConfig.use2GridOffsets,C=b?x?`${v},${h}`:`${v},0,0,${h}`:x?`${h},${v}`:`${h},0,0,${v}`,I=h/2,S=e.xmin+I,D=e.xmax-I,T=Math.abs(v)/2,L=e.ymin+T,V=e.ymax-T,M=b?`${L},${S},${V},${D},${c}`:`${S},${L},${D},${V},${c}`,N=s.range.find((e=>e.axis.some((e=>e.identifier.toLowerCase().includes("band")))));let R,P=N&&d&&a?m?`${N.identifier}[${N.axis[0].identifier}[${a.join(",")}]]`:`${N.identifier}:${d}[${N.axis[0].identifier}[${a.join(",")}]]`:null;if(null!=o&&o.length)for(let e=0;e<o.length;e++){let t=o[e].values;const n=o[e].dimensionName?.toLowerCase(),i=o[e].variableName?.toLowerCase(),a=s.range.find((e=>e.identifier.toLowerCase()===i));if(t.length>0)if(Array.isArray(t[0])&&(t=t[0]),"stdtime"===n)R=t.map((e=>we(e))).join(",");else if(a){const e=a.axis.find((e=>e.identifier.toLowerCase()===n));e&&(P=m?a.identifier+"["+e.identifier+"["+t.join(",")+"]]":a.identifier+":"+d+"["+e.identifier+"["+t.join(",")+"]]")}e===o.length-1&&a&&!P&&(P=m?a.identifier:a.identifier+":"+d)}return{service:"WCS",request:"GetCoverage",version:this.version,identifier:this.coverageId,format:u,crs:`EPSG:${l}`,boundingbox:M,gridCS:"urn:ogc:def:cs:OGC:0.0:Grid2dSquareCS",gridType:"urn:ogc:def:method:WCS:1.1:2dGridIn2dCrs",gridOrigin:w,gridOffsets:C,gridBaseCRS:c,timeSequence:R,rangeSubset:P}}_getCoverage201Parameters(e,t,n,i,s,o){const{multidimensionalDefinition:a,interpolation:r}=s,l=this._getInterpolationIndex(r);let c=null;const{supportedInterpolations:u}=this.capabilities;if(u?.length)switch(l){case 0:c=u.find((e=>e.toLowerCase().includes("nearest")));break;case 1:c=u.find((e=>e.toLowerCase().includes("linear")));break;case 2:c=u.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:m,domainSet:f,rangeType:g}=o,h=m.isEastFirst?0:1,v=1-h,{axisLabels:y}=m,b=y[h],w=y[v],x=`http://www.opengis.net/def/crs/EPSG/0/${e.spatialReference.wkid}`,C=x,I=[];I.push(`${b}(${e.xmin},${e.xmax})`),I.push(`${w}(${e.ymin},${e.ymax})`);const S=[];if(y.length>2)for(let e=2;e<y.length;e++){const t=f.origin[e];if(y[e].toLowerCase().includes("time")){let n=t.toString();m.uomLabels?.[e].toLowerCase().includes("ole")&&(S.push(y[e]),n=we(t,!0)),I.push(y[e]+",http://www.opengis.net("+n+")")}else I.push(y[e]+",http://www.opengis.net("+t+")")}let D=null;if(null!=a&&a.length){const e=[];g.forEach((t=>t.forEach((t=>e.push(t.name)))));const t=[];for(let n=0;n<a.length;n++){const i=y.find((e=>e===a[n].dimensionName)),s=e.find((e=>e===a[n].variableName));if(t.includes(s)||t.push(s),i){let e=a[n].values;if(e.length>0){Array.isArray(e[0])&&(e=e[0]);let t="";t=i.toLowerCase().includes("time")?e.map((e=>we(e))).join(","):e.join(",");const n=I.findIndex((e=>0===e.indexOf(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&&(D=t.join(","))}else d?.length>=2&&(D=(s.bandIds?s.bandIds.map((e=>d[e])):d).join(","));const A=I.join("&subset="),T=!o.domainSet.hasSameAxisLabelsAsBoundedBy&&!1!==this.ioConfig.allowScaleFactor,L=T?null:`${b}(${t}),${w}(${n})`,V=T?1/i:null;return{service:"WCS",request:"GetCoverage",version:this.version,coverageId:this.coverageId,rangesubset:D,interpolation:c,scaleSize:L,scaleFactor:V,subset:A,format:p,mediaType:this.ioConfig.allowAnyMediaType?null:"multipart/related",outputcrs:x,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 we(e,t=!1){return(t?new Date(ae(e)):new Date(e)).toISOString()}(0,i._)([(0,u.MZ)({type:String,json:{write:!0}})],be.prototype,"datasetFormat",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],be.prototype,"tileType",void 0),(0,i._)([(0,u.MZ)({type:String,json:{write:!0}})],be.prototype,"version",void 0),(0,i._)([(0,u.MZ)({type:String,json:{write:!0}})],be.prototype,"coverageId",void 0),be=(0,i._)([(0,d.$)("esri.layers.support.rasterDatasets.WCSRaster")],be);const xe=be;var Ce=n(30291),Ie=n(92935);const Se=new Set(["milliseconds","seconds","minutes","hours","days","weeks","months","years","decades","centuries"]);let De=class extends((0,f.dM)((0,w.j)((0,v.q)((0,y.A)((0,g.d)((0,h.o)((0,x.e)((0,b.J)((0,r.P)(o.A.ClonableMixin(m.A))))))))))){constructor(...e){super(...e),this.coverageId=null,this.version=null,this.isReference=null,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:o}=await n.e(9838).then(n.bind(n,59838));switch(e){case Ie.X.SAVE:return s(this,t);case Ie.X.SAVE_AS:return o(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 coverageInfo(){return this.raster.coverageInfo}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){return[(0,S.rZ)("Pixel Value")]}createPopupTemplate(e){return(0,Ce.tn)({fields:this.rasterFields,title:this.title},e)}async save(e){return this._debouncedSaveOperations(Ie.X.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(Ie.X.SAVE_AS,t,e)}async _openRaster(e){const t=new xe({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 a.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=Se.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,c.wB)((()=>this.customParameters),(e=>this.raster.ioConfig.customFetchParameters=e)))}};(0,i._)([(0,u.MZ)({type:String,nonNullable:!0,json:{name:"wcsInfo.coverageId",write:{isRequired:!0}}})],De.prototype,"coverageId",void 0),(0,i._)([(0,u.MZ)()],De.prototype,"coverageInfo",null),(0,i._)([(0,u.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}}})],De.prototype,"version",void 0),(0,i._)([(0,u.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],De.prototype,"isReference",void 0),(0,i._)([(0,u.MZ)({json:{read:!0,write:!0}})],De.prototype,"blendMode",void 0),(0,i._)([(0,u.MZ)(C.fV)],De.prototype,"legendEnabled",void 0),(0,i._)([(0,u.MZ)({type:["show","hide"]})],De.prototype,"listMode",void 0),(0,i._)([(0,u.MZ)()],De.prototype,"noData",void 0),(0,i._)([(0,u.MZ)({type:["WCS"]})],De.prototype,"operationalLayerType",void 0),(0,i._)([(0,u.MZ)()],De.prototype,"raster",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],De.prototype,"type",void 0),(0,i._)([(0,u.MZ)(C.M6)],De.prototype,"popupEnabled",void 0),(0,i._)([(0,u.MZ)({type:s.A,json:{name:"popupInfo",write:!0}})],De.prototype,"popupTemplate",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],De.prototype,"defaultPopupTemplate",null),(0,i._)([(0,u.MZ)({readOnly:!0,type:[I.A]})],De.prototype,"fields",void 0),(0,i._)([(0,u.MZ)({readOnly:!0,type:[I.A]})],De.prototype,"rasterFields",null),De=(0,i._)([(0,d.$)("esri.layers.WCSLayer")],De);const Ae=De},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))}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9547],{19547:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ae});var i=n(90237),s=n(13874),o=n(69540),a=n(49186),r=n(92071),l=n(74887),c=n(36708),u=n(10107),p=(n(44208),n(53966)),d=(n(87811),n(40608)),m=n(4146),f=n(63074),g=n(69208),h=n(89015),v=n(16131),y=n(8303),b=n(54310),w=n(25036),x=n(82935),C=n(10873),I=n(20437),S=n(74797),D=n(5443),A=n(38458),T=n(78888),L=n(50103);function V(e){return e.endsWith("?")?e.slice(0,-1):e}function M(e){return e.filter((({coverageSubType:e})=>null==e||""===e||/^rectified(grid|dataset)/i.test(e)))}function N(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,L.vv)(i).toLowerCase();switch(s){case"title":case"abstract":t[s]=(0,L.mX)(i);break;case"identifier":t.id=(0,L.mX)(i);break;case"wgs84boundingbox":{const e=(0,L.pN)(i,"LowerCorner"),n=(0,L.pN)(i,"UpperCorner");t.lonLatEnvelope=new D.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(N(i))}}return t}function R(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,R(e.coverageSummaries[n],t);null!=e.id&&t.push(e)}function P(e){const t=(0,L.V6)(e.querySelector("Operation[name=GetCapabilities]"),"Get")?.getAttribute("xlink:href")||"",n=(0,L.V6)(e.querySelector("Operation[name=DescribeCoverage]"),"Get")?.getAttribute("xlink:href")||"",i=(0,L.V6)(e.querySelector("Operation[name=GetCoverage]"),"Get")?.getAttribute("xlink:href")||"";return{getCapabilities:V(t),describeCoverage:V(n),getCoverage:V(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",o=s.slice(0,3);let r;if("2.0"===o)r=function(e){const t=(0,L.V6)(e,"ServiceIdentification"),n=(0,L.mX)(t,"Title"),i=(0,L.Dy)(t,"ServiceTypeVersion"),s=(0,L.Dy)(t,"Profile"),o=P((0,L.V6)(e,"OperationsMetadata")),a=(0,L.IC)(e,"Contents/CoverageSummary"),r=[];for(let e=0;e<a.length;e++){const t=a[e],n=(0,L.mX)(t,"CoverageId"),i=(0,L.V6)(t,"WGS84BoundingBox");let s;if(i){const e=(0,L.pN)(i,"LowerCorner"),t=(0,L.pN)(i,"UpperCorner");s=new D.A({xmin:e[0],ymin:e[1],xmax:t[0],ymax:t[1],spatialReference:{wkid:4326}})}const o=(0,L.mX)(t,"CoverageSubtype")||"RectifiedGridCoverage";r.push({id:n,lonLatEnvelope:s,coverageSubType:o})}const l=(0,L.V6)(e,"ServiceMetadata");return{name:n,supportedVersions:i,supportedFormats:(0,L.Dy)(l,"formatSupported"),supportedInterpolations:(0,L.Dy)(l,"interpolationSupported").concat((0,L.Dy)(l,"InterpolationSupported")),onlineResources:o,profiles:s,coverages:r,gridCoverages:M(r),version:"2.0.1"}}(n);else if("1.1"===o)r=function(e){const t=(0,L.mX)(e,"ServiceIdentification/Title"),n=(0,L.Dy)(e,"ServiceIdentification/ServiceTypeVersion"),i=P((0,L.V6)(e,"OperationsMetadata")),s=[],o=(0,L.V6)(e,"Contents");for(let e=0;e<o.childNodes.length;e++){const t=o.childNodes[e];1===t.nodeType&&(0,L.g7)(t,"CoverageSummary")&&R(N(t),s)}const a=(0,L.Dy)(o,"SupportedFormat");return{name:t,onlineResources:i,coverages:s,gridCoverages:M(s),supportedVersions:n,supportedFormats:a,version:"1.1.0"}}(n);else{if("1.0"!==o)throw new a.A("wcsraster:parsecapabilities","the capabilities version is not supported");r=function(e){const t=(0,L.mX)(e,"Service/name"),n=(0,L.V6)(e,"Capability"),i=(0,L.V6)(n,"GetCapabilities/Get/OnlineResource")?.getAttribute("xlink:href")??"",s=(0,L.V6)(n,"DescribeCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",o=(0,L.V6)(n,"GetCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",a={getCapabilities:V(i),describeCoverage:V(s),getCoverage:V(o)},r=(0,L.IC)(e,"CoverageOfferingBrief"),l=[];for(let e=0;e<r.length;e++){const t=r[e],n=(0,L.mX)(t,"name"),i=(0,L.IC)(t,"pos"),s=(0,L.pN)(i[0]),o=(0,L.pN)(i[1]),a=new D.A({xmin:s[0],ymin:s[1],xmax:o[0],ymax:o[1],spatialReference:{wkid:4326}});l.push({id:n,lonLatEnvelope:a})}return{name:t,onlineResources:a,coverages:l,gridCoverages:M(l),supportedVersions:["1.0.0"],version:"1.0.0"}}(n)}return r.version=s,r}var O=n(39829),X=n(87186),$=n(77301);function _(e){e.variables.forEach((e=>e.dimensions.forEach((e=>e.values??=(0,$.Xg)(e)))))}function k(e){return{requestResponseCRSs:(0,L.Dy)(e,"requestResponseCRSs").map((e=>e.split(":")[1])),nativeCRSs:(0,L.Dy)(e,"nativeCRSs").map((e=>e.split(":")[1]))}}function F(e,t){const n=(0,L.Dy)(e,"1.0.0"===t?"interpolationMethod":"InterpolationMethod"),i="1.0.0"===t?e.getAttribute("default"):(0,L.mX)(e,"InterpolationMethods/Default");return null!=i?[i].concat(n.filter((e=>e.toLowerCase()!==i.toLowerCase()))):n}function G(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 B(e){const t=(0,L.IC)(e,"pos"),n=(0,L.pN)(t[0]),i=(0,L.pN)(t[1]);return new D.A({xmin:n[0],ymin:n[1],xmax:i[0],ymax:i[1],spatialReference:{wkid:4326}})}function j(e,t){const n=(0,L.Dy)(e,t);return n?.length&&""!==n[0]&&!isNaN(Number(n[0]))?n.map((e=>Number(e))):null}function W(e){const t=(0,L.pN)(e,"MinimumValue"),n=(0,L.pN)(e,"MaximumValue");return t.length&&n.length?t.map(((e,t)=>({min:e,max:n[t],avg:-1,stddev:-1}))):null}function q(e){return null==e?null:e.every((t=>t===e[0]))?e[0]:e}function Z(e){const t=[],n=(0,L.IC)(e,"RangeSet");let i=[];for(let e=0;e<n.length;e++){const s=(0,L.mX)(n[e],"name"),o=(0,L.mX)(n[e],"label"),a=[],r=j(n[e],"nullValues/singleValue"),l=(0,L.IC)(n[e],"AxisDescription");for(let e=0;e<l.length;e++){const t=(0,L.mX)(l[e],"name"),n=(0,L.mX)(l[e],"label"),s=(0,L.Dy)(l[e],"singleValue");if(0===s.length){const t=(0,L.mX)(l[e],"min"),n=(0,L.mX)(l[e],"max"),i=Number((0,L.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),a.push({name:t,label:n,values:s})}t.push({name:s,label:o,nullValues:r,axis:a})}return{rangeSet:t,bandNames:i}}function U(e=null){if(!e)return{resolution:null,units:null};let t=e.toUpperCase();const n=["Years","Months","Days","Hours","Minutes","Seconds"];let i,s,o;return t.includes("PT")?(t=t.slice(2),o=["H","M","S"].findIndex((e=>t.includes(e))),i=n[3+o],s=parseFloat(t.slice(0,-1))):(t=t.slice(1),o=["Y","M","D"].findIndex((e=>t.includes(e))),o>-1&&(i=n[o]),s=parseFloat(t.slice(0,-1))),{resolution:s,units:i}}function z(e){const t=(0,L.IC)(e,"timeposition");if(t.length>0){const e=[];for(let n=0;n<t.length;n++)e.push(new Date((0,L.mX)(t[n])));return{begin:e[0],end:e[e.length-1],values:e}}const n=(0,L.V6)(e,"timePeriod")||(0,L.V6)(e,"TimePeriod");return n?{begin:new Date((0,L.mX)(n,"beginPosition")||(0,L.mX)(n,"BeginPosition")),end:new Date((0,L.mX)(n,"endPosition")||(0,L.mX)(n,"EndPosition")),...U((0,L.mX)(n,"timeResolution")||(0,L.mX)(n,"TimeResolution"))}:null}function H(e){const t=(0,L.V6)(e,"spatialDomain"),n=(0,L.V6)(t,"Envelope")||(0,L.V6)(t,"EnvelopeWithTimePeriod"),i=n.getAttribute("srsName").split(":"),s=i[i.length-1],o=(0,L.IC)(n,"pos"),a=(0,L.pN)(o[0]),r=(0,L.pN)(o[1]),l=parseInt(s,10),c=isNaN(l)?null:{wkid:l},u=new D.A({xmin:a[0],ymin:a[1],xmax:r[0],ymax:r[1],spatialReference:c}),p=(0,L.V6)(t,"RectifiedGrid"),d=(0,L.mX)(p,"low").split(" "),m=(0,L.mX)(p,"high").split(" "),f=parseInt(m[0],10)-parseInt(d[0],10)+1,g=parseInt(m[1],10)-parseInt(d[1],10)+1,h=(0,L.pN)(t,"origin/pos"),v=(0,L.IC)(t,"offsetVector"),y={envelope:u,columns:f,rows:g,offset:{x:parseFloat((0,L.mX)(v[0]).split(" ")[0]),y:parseFloat((0,L.mX)(v[1]).split(" ")[1])},origin:{x:h[0],y:h[1]}},b=(0,L.V6)(e,"temporalDomain")||(0,L.V6)(e,"TemporalDomain");return{spatialDomain:y,temporalDomain:b?z(b):null}}function Y(e){if(!e.temporalDomain)return null;const{begin:t,end:n,values:i,units:s,resolution:o}=e.temporalDomain,a={variables:[{name:"default",description:"",dimensions:[{name:"StdTime",description:"",unit:"ISO8601",values:i?.map((e=>e.getTime())),hasRegularIntervals:!i,interval:o,intervalUnit:s,extent:[t.getTime(),n.getTime()]}]}]};return _(a),a}function Q(e,t){const n=[],i=(0,L.IC)(e,"Field");let s,o=[];for(let e=0;e<i.length;e++){const a=(0,L.mX)(i[e],"Identifier"),r=(0,L.mX)(i[e],"Description"),l=(0,L.mX)(i[e],"Definition"),c=(0,L.mX)(i[e],"Abstract"),u=(0,L.mX)(i[e],"Title"),p=j(i[e],"NullValue"),d=(0,L.V6)(i[e],"AllowedValues"),m=d?W(d):null,f=F(i[e],"1.1.0"),g=[],h=(0,L.IC)(i[e],"Axis");for(let e=0;e<h.length;e++){const n=h[e].getAttribute("identifier"),i=(0,L.mX)(h[e],"UOM"),a=(0,L.mX)(h[e],"DataType"),r=(0,L.Dy)(h[e],"Key");t&&!n.toLowerCase().includes("band")||(o=r,s=p),g.push({identifier:n,uom:i,dataType:a,values:r,bandNoDataValues:s})}n.push({identifier:a,description:r,definition:l,abstract:c,title:u,supportedInterpolations:f,axis:g,nullValues:p,statistics:m})}return{rangeSet:n,bandNames:o,bandNoDataValues:s,statistics:n[0].statistics}}function J(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:o,resolution:a}=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:a,intervalUnit:o,extent:[e.getTime(),n.getTime()]})}))}if(i.length){const e={variables:i};return _(e),e}return null}function K(e){const t=(0,L.V6)(e,"SpatialDomain"),n=(0,L.V6)(t,"GridCRS"),i=(0,L.mX)(n,"GridBaseCRS"),s=(0,L.mX)(n,"GridOrigin"),o=s?.split(" ").map((e=>parseFloat(e)))??[0,0],a=(0,L.pN)(n,"GridOffsets"),r=(0,L.IC)(t,"BoundingBox");let l,c,u,p;for(let e=0;e<r.length;e++){const t=r[e].getAttribute("crs")?.toLowerCase();if(null!=t)if(t.includes("imagecrs")){const t=(0,L.pN)(r[e],"LowerCorner"),n=(0,L.pN)(r[e],"UpperCorner");l=n[0]-t[0]+1,c=n[1]-t[1]+1}else if(t.indexOf("epsg")>0){const n=t.split(":");u=parseInt(n[n.length-1],10);const i=(0,L.pN)(r[e],"LowerCorner"),s=(0,L.pN)(r[e],"UpperCorner");p=new D.A({xmin:i[0],ymin:i[1],xmax:s[0],ymax:s[1],spatialReference:{wkid:u}})}}const d=l>c,m=p.xmax-p.xmin>p.ymax-p.ymin;let f=!1;(0,A.m)(u)&&(d===m?f=!1:(f=!0,p=new D.A({xmin:p.ymin,ymin:p.xmin,xmax:p.ymax,ymax:p.xmax,spatialReference:{wkid:u}})));const g={columns:l,rows:c,origin:{x:o[0],y:o[1]},offset:{x:a[0],y:a[a.length-1]},gridBaseCRS:i,envelope:p,useEPSGAxis:f},h=(0,L.V6)(e,"temporalDomain")||(0,L.V6)(e,"TemporalDomain");return{spatialDomain:g,temporalDomain:h?z(h):null}}function ee(e){const t=(0,L.V6)(e,"Envelope")||(0,L.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())),o=(0,L.pN)(t,"lowerCorner"),a=(0,L.pN)(t,"upperCorner"),r=!["y","lat","latitude","north","nor","n","b"].includes(s[0].toLowerCase());let l;const c=parseInt(i,10),u=isNaN(c)?null:{wkid:c};l=new D.A(r?{xmin:o[0],ymin:o[1],xmax:a[0],ymax:a[1],spatialReference:u}:{xmin:o[1],ymin:o[0],xmax:a[1],ymax:a[0],spatialReference:u});const p={mins:o,maxs:a},d=t.getAttribute("uomLabels").trim().split(" ");let m,f;if((0,L.g7)(t,"EnvelopeWithTimePeriod")){m=new Date((0,L.mX)(e,"beginPosition")||(0,L.mX)(e,"BeginPosition")),f=new Date((0,L.mX)(e,"endPosition")||(0,L.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:m,endPosition:f,isEastFirst:r}}function te(e,t){const n=[],i=(0,L.IC)(e,"DataRecord"),s=[];let o,a=[];for(let e=0;e<i.length;e++){const r=(0,L.IC)(i[e],"field"),l=[];for(let e=0;e<r.length;e++){const n=r[e].getAttribute("name"),i=(0,L.mX)(r[e],"description")||"",c=(0,L.V6)(r[e],"uom")?.getAttribute("code")||"",u=(0,L.pN)(r[e],"interval"),p=j(r[e],"nilValue")?.[0];t&&!n.toLowerCase().includes("band")||(s.push(n),u?.length&&(o=o||[],o.push({min:u[0],max:u[1],avg:-1,stddev:-1})),a.push(p)),l.push({name:n,description:i,uom:c,allowedValues:u,nilValue:p})}n.push(l)}return a.some((e=>null!=e))||(a=null),{rangeType:n,bandNames:s,bandStats:o,bandNoDataValues:a}}function ne(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 ie(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()??"",o=n.axisLabels[i].toLowerCase().includes("time")||"iso8601"===s.toLowerCase()||"oledatetime"===s.toLowerCase();let a,r;if(o){const e=ne(n.offset[i]);a=e.interval,r=e.intervalUnit}else a=n.offset[i],r=s;const l=[];o?(l.push(ae(t.envelopeAllDims.mins[i])),l.push(ae(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:o?"ISO8601":s,hasRegularIntervals:!0,extent:l,interval:a,intervalUnit:r})}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 _(e),e}}return null}function se(e,t){const n=(0,L.V6)(e,"RectifiedGrid"),i=(0,L.pN)(n,"low"),s=(0,L.pN)(n,"high"),o=[];for(let e=0;e<i.length;e++)o.push(s[e]-i[e]+1);const a=(0,L.mX)(n,"axisLabels").split(" "),r=(0,L.pN)(n,"origin/pos"),l=(0,L.IC)(n,"offsetVector"),c=[];for(let e=0;e<l.length;e++){const t=(0,L.pN)(l[e]),n=t.findIndex((e=>0!==e));c[n]=t[n]}let u,p,d,m=!1;return t?.length&&a?.length&&(m=[...t].sort(((e,t)=>e<t?-1:1)).join(",")===[...a].sort(((e,t)=>e<t?-1:1)).join(",")),["y","lat","latitude","north","nor","n","b"].includes((m?a:t)[0].toLowerCase())?(u=o[1],p=o[0],d={y:Math.abs(c[0]),x:Math.abs(c[1])}):(u=o[0],p=o[1],d={x:Math.abs(c[0]),y:Math.abs(c[1])}),{columns:u,rows:p,origin:r,offset:c,resolution:d,gridSamples:o,axisLabels:a,hasSameAxisLabelsAsBoundedBy:m}}function oe(e){const t=(0,L.V6)(e,"EarthObservation");if(!t)return null;const n=(0,L.V6)(t,"phenomenonTime"),i=n?z(n):null,s=(0,L.V6)(t,"phenomenonTime"),o=s?z(s):null,a=(0,L.mX)(t,"featureOfInterest/Footprint/multiExtentOf/MultiSurface/surfaceMembers/Polygon/exterior/LinearRing/posList");let r=null;if(a){const e=a.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]);r=new O.A({rings:[[t]]})}}return{observation:{phenomenonTime:i,resultTime:o,footprint:r,identifier:(0,L.mX)(e,"metaDataProperty/EarthObservationMetaData/identifier"),acquisitionType:(0,L.mX)(e,"metaDataProperty/EarthObservationMetaData/acquisitionType"),status:(0,L.mX)(e,"metaDataProperty/EarthObservationMetaData/status")}}}function ae(e){return Math.round(24*(e-25569)*3600*1e3)}async function re(e,t){const{coverageIds:n,version:i,customParameters:s,signal:o}=t,r=i.slice(0,3),c="1.0"===r?"coverage":"1.1"===r?"identifiers":"coverageId",u={service:"WCS",request:"DescribeCoverage",version:i,[c]:n.join(","),...s};try{const{data:t}=await(0,T.A)(e,{query:u,responseType:"xml",signal:o});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,L.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 o=e.childNodes[s];if(1===o.nodeType)if((0,L.g7)(o,"description"))t.description=(0,L.mX)(o);else if((0,L.g7)(o,"name"))t.name=(0,L.mX)(o);else if((0,L.g7)(o,"label"))t.label=(0,L.mX)(o);else if((0,L.g7)(o,"supportedFormats"))t.supportedFormats=(0,L.Dy)(o,"formats");else if((0,L.g7)(o,"supportedCRSs"))t.supportedCRSs=k(o);else if((0,L.g7)(o,"supportedInterpolations"))t.supportedInterpolations=F(o,"1.0.0");else if((0,L.g7)(o,"lonLatEnvelope"))t.lonLatEnvelope=B(o);else if((0,L.g7)(o,"rangeSet")){const e=Z(o);t.rangeSet=e.rangeSet,i=e.bandNames;const s=e.rangeSet[0].nullValues;s?.length&&(n=q(s))}else(0,L.g7)(o,"domainSet")&&(t.domainSet=H(o))}const s=G(t.supportedInterpolations),{name:o,description:a,label:r,lonLatEnvelope:l,supportedFormats:c}=t,{spatialDomain:u}=t.domainSet,p={x:Math.abs(u.offset.x),y:Math.abs(u.offset.y)},d=Y(t.domainSet),m=new X.A({width:u.columns,height:u.rows,pixelSize:p,pixelType:"unknown",extent:u.envelope,spatialReference:u.envelope.spatialReference,bandCount:i.length||1,noDataValue:n,multidimensionalInfo:d});return{id:o,title:t.name,description:a||r,lonLatEnvelope:l,rasterInfo:m,bandNames:i,supportedFormats:c,supportedInterpolations:s,coverageDescription:t,version:"1.0.0",useEPSGAxis:!1}}(e)));const i=(0,L.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 o,a,r=[];for(let t=0;t<e.childNodes.length;t++){const l=e.childNodes[t];if(1!==l.nodeType)continue;const c=(0,L.vv)(l).toLowerCase();switch(c){case"title":case"abstract":case"identifier":s[c]=(0,L.mX)(l);break;case"supportedformat":{const e=(0,L.mX)(l);n.includes(e)||n.push(e)}break;case"supportedcrs":{const e=(0,L.mX)(l);i.includes(e)||i.push(e)}break;case"range":{const e=Q(l,!!s.domain?.temporalDomain);s.range=e.rangeSet,r=e.bandNames;const{bandNoDataValues:t}=e;t?.length&&(o=q(t)),a=e.statistics}break;case"domain":s.domain=K(l)}}const l=G(s.range[0].supportedInterpolations),{identifier:c,abstract:u,title:p,domain:d,range:m}=s,f={x:Math.abs(d.spatialDomain.offset.x),y:Math.abs(d.spatialDomain.offset.y)},g=J(m,d);g&&(o=m[0].nullValues,1===o?.length&&(o=o[0]));const h=new X.A({width:d.spatialDomain.columns,height:d.spatialDomain.rows,pixelSize:f,pixelType:"unknown",extent:d.spatialDomain.envelope,spatialReference:d.spatialDomain.envelope.spatialReference,bandCount:r.length||1,noDataValue:o,statistics:a,multidimensionalInfo:g});return{id:c,title:s.title,description:u||p,bandNames:r,rasterInfo:h,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 o=0;o<e.childNodes.length;o++){const a=e.childNodes[o];if(1===a.nodeType)if((0,L.g7)(a,"coverageId"))t.coverageId=(0,L.mX)(a);else if((0,L.g7)(a,"ServiceParameters"))t.serviceParameters={supportedFormats:(0,L.Dy)(a,"nativeFormat")};else if((0,L.g7)(a,"boundedBy"))t.boundedBy=ee(a);else if((0,L.g7)(a,"rangeType")){const e=te(a,t.boundedBy?.axisLabels.length>2||t.domainSet?.axisLabels.length>2);t.rangeType=e.rangeType,s=e.bandNames,n=e.bandStats;const{bandNoDataValues:o}=e;o?.length&&(i=q(o))}else if((0,L.g7)(a,"domainSet"))t.domainSet=se(a,t.boundedBy?.axisLabels);else if((0,L.g7)(a,"metadata")){const e=(0,L.V6)(a,"EOMetadata");t.eoMetadata=e?oe(e):null}}const{coverageId:o,boundedBy:a,domainSet:r,rangeType:l,serviceParameters:c}=t,u=ie(l,a,r);return!n&&u&&(n=u?.variables[0].statistics),null!=u&&(i=l[0][0].nilValue),{id:o,title:o,description:o,bandNames:s,rasterInfo:new X.A({width:r.columns,height:r.rows,pixelSize:r.resolution,pixelType:"unknown",extent:a.envelope,spatialReference:a.envelope.spatialReference,bandCount:s.length||1,statistics:n,noDataValue:i,multidimensionalInfo:u}),supportedFormats:c.supportedFormats,coverageDescription:t,version:"2.0.1",useEPSGAxis:!1}}(e)))}(t,i)}catch(e){if(!(0,l.zf)(e))throw new a.A("wcslayer:open","wcs coverage description is not valid or supported");throw e}}var le=n(45617),ce=n(4916);function ue(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(),o=t[e].slice(i+1).trim();n[s]=o.startsWith('"')?o.slice(1,-1):o}}return n}(e);return t?{isMultipart:!0,data:t.boundary?pe(e.data,t,0):null}:{isMultipart:!1,data:null}}function pe(e,t,n=0){const i="--"+t.boundary,s=[];for(let e=0;e<i.length;e++)s.push(i.charCodeAt(e));const o=[],a="\n--"+t.boundary+"--";for(let e=0;e<a.length;e++)o.push(a.charCodeAt(e));const r=[10],l=[13,10],c=[],u=s.length,p=new Uint8Array(e,n),d=p.length-u;let m=0,f=0;for(let e=0;e<d;e++){for(f=0;f<u&&p[e+f]===s[f];f++);if(f!==u)continue;let n=!1;if(m){const i=de(p.subarray(m,e),t);c.push(i),n=!!i.isValidImage}if(e+=u-1,p[e+1]===r[0]?e+=1:p[e+1]===l[0]&&p[e+2]===l[1]&&(e+=2),m=e+1,n)break}const g=o.length;for(let e=p.length-g-10;e<p.length-g;e++){for(f=0;f<g&&p[e+f]===o[f];f++);if(f===g){c.push(de(p.subarray(m,e),t));break}}return c}function de(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 o=0;for(let a=0;a<i;a++)if(n[a].length<4)o=o+n[a].length+1;else if("content"===n[a].slice(0,7).toLowerCase()){o=o+n[a].length+1;const e=n[a].indexOf(":");if(-1===e)continue;const t=n[a].slice(0,e).trim(),i=n[a].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[a].length>=4&&s.contentType?.toLowerCase().indexOf("image")>-1){let t=!0,n=e.subarray(o,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-o),n=new Uint8Array(t),n.set(e.subarray(o,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(o,e.length));break}s.contentData=e.subarray(o,e.length)}}return s}var me=n(51244),fe=n(28435);const ge=["nearest neighbor","bilinear","bicubic"],he=["nearest","linear","cubic"],ve="response is not a supported multipart/related mediaType with inline tiff, switching to compatibility mode",ye=new Set(["1.0.0","1.1.0","1.1.1","1.1.2","2.0.1"]);let be=class extends ce.A{constructor(){super(...arguments),this.datasetFormat="WCSServer",this.tileType="Raster"}async fetchRawTile(e,t,n,i={}){if(this.isBlockOutside(e,t,n))return null;const{nativePixelSize:s,spatialReference:o}=this.rasterInfo,r=2**e,l=s.x*r,c=s.y*r,{blockWidth:u,blockHeight:p}=this.getBlockWidthHeight(e),{origin:d}=this.rasterInfo.storageInfo.tileInfo,m=this.getTileExtent({x:l,y:c},t,n,d,o,[u,p]),f=this.rasterInfo.extent,g=m.xmax>f.xmax,h=m.ymin<f.ymin,v=g||h;let y=m,b=u,w=p;if(v&&(y=m.clone().intersection(f),null!=y&&(g&&(b=Math.floor((y.xmax-y.xmin)/l),y.xmax=y.xmin+l*b),h&&(w=Math.floor((y.ymax-y.ymin)/c),y.ymin=y.ymax-c*w))),null==y||b<=1||w<=1)return null;const x=await this._getCoverage(y,b,w,r,i);if(!x)return null;const{coverageDescription:C}=this.coverageInfo,{noDataValue:I,multidimensionalInfo:S}=this.rasterInfo,{multidimensionalDefinition:D}=i;let A;if(null!=S&&null!=D&&D.length){const e=D[0].variableName;if("2.0"===C.version){const t=C.rangeType[0].find((t=>t.name===e));A=t?.nilValue}else if("1.1"===C.version){const t=C.range.find((t=>t.identifier===e));A=t?.nullValues}}const T=A??I,L=await this.decodePixelBlock(x,{width:b,height:w,planes:null,pixelType:null,tiffNoDataValue:Array.isArray(T)?T[0]:T});if(null==L)return null;if(L&&(L.width!==b||L.height!==w))throw new a.A("wcsraster-fetch",`the response has unexpected dimension width: ${L.width}, height: {pixelBlock.height}`);return v?(0,fe.$Q)(L,{x:0,y:0},{width:p,height:p}):L}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??{},o=n?.startsWith("1.0")?"version":"acceptVersions",r={service:"WCS",request:"GetCapabilities",[o]:n,...i};try{let{data:n}=await(0,T.A)(e,{query:r,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)||(r[o]="2.0.1",({data:n}=await(0,T.A)(e,{query:r,responseType:"xml",signal:s}))),E(n)}catch(e){if(!(0,l.zf)(e))throw new a.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=>"2.0"===e.slice(0,3)))||i.supportedVersions.find((e=>"1.1"===e.slice(0,3)))||i.supportedVersions.find((e=>"1.0"===e.slice(0,3)))||"1.0.0",this.version=e)}const{version:s}=this;if(!ye.has(s))throw new a.A("wcsraster-open",`unsupported WCS version ${s}`);const{gridCoverages:o}=i;if(!o.length)throw new a.A("wcsraster-open","cannot find rectified grid coverages");this.coverageId??=o[0].id;const{coverageId:r}=this,c=o.find((e=>e.id===r));if(null==c)throw new a.A("wcsraster-open",`the coverageId ${r} does not exist in capabilities`);const u=await re(this.url,{coverageIds:[r],version:s,customParameters:t,signal:n});if(this.coverageInfo=u[0],"2.0"===s.slice(0,3)){const{coverageInfo:e}=this;e.lonLatEnvelope=c.lonLatEnvelope,e.supportedInterpolations=G(i.supportedInterpolations),this._patchDimensionValues201(r,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 a.A("wcsraster-open",`coverage without spatial reference is not supported: ${r}`);const{pixelType:d,bandCount:m}=await this._getPixelTypeAndBandCount(n);p.pixelType=d,1===p.bandCount&&m>1&&(p.bandCount=m),this.updateTileInfo()}async _patchDimensionValues201(e,t){const{coverageInfo:n}=this,i=n.rasterInfo.multidimensionalInfo?.variables,s=ye.has("1.1.2")?"1.1.2":ye.has("1.1.1")?"1.1.1":ye.has("1.1.0")?"1.1.0":null,{customFetchParameters:o}=this.ioConfig;if(i&&s)try{const n=this.url.includes("/ImageServer/"),a=e.length>8&&e.startsWith("Coverage")&&n?e.slice(8):e,r=await re(this.url,{coverageIds:[a??e],version:s,customParameters:o,signal:t}).catch((()=>{if(a)return re(this.url,{coverageIds:[e],version:s,customParameters:o,signal:t})})),l=r?.[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],o=t.dimensions.find((({name:e})=>e===s.name));o?o.values&&o.extent?.join(",")===s.extent?.join(",")&&(e.dimensions[i]={...s,values:o.values}):n&&e.dimensions.splice(i,1)}}}catch{}}async _getPixelTypeAndBandCount(e){const{pixelSize:t,extent:n,multidimensionalInfo:i}=this.rasterInfo,s=n.center,o=new D.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 r=[];if(null!=i){const e=i.variables[0];r=[],e.dimensions.forEach((t=>{r.push(new le.A({variableName:e.name,dimensionName:t.name,values:t.hasRegularIntervals?t.extent?.[0]:t.values?.[0],isSlice:!0}))}))}const{coverageDescription:l}=this.coverageInfo,c={interpolation:"nearest",multidimensionalDefinition:r,signal:e},{version:u}=l,{ioConfig:d}=this,m="2.0"===u&&null==d.allowAnyMediaType||"1.1"===u&&null==d.use2GridOffsets;let f;try{f=await this._getCoverage(o,2,2,1,c,!0)}catch(e){if(!m)throw e;if("1.1"===u){if(!e.details?.isResolutionMismatch)throw e;d.use2GridOffsets=!0}}if(!f&&m&&("2.0"===u&&(d.allowAnyMediaType=!0),f=await this._getCoverage(o,2,2,1,c),f&&p.A.getLogger(this).warn("wcsraster:getcoverage",ve)),!f)throw new a.A("wcsraster-open","unable to determine pixel type");const g=await this.decodePixelBlock(f,{width:2,height:2,planes:null,pixelType:null});if(null==g)throw new a.A("wcsraster-open","unable to determine pixel type");return{pixelType:g.pixelType,bandCount:g.getPlaneCount()??0}}async _getCoverage(e,t,n,i,s,o=!1){const{coverageDescription:r}=this.coverageInfo,{version:l}=r,c="2.0"===l?this._getCoverage201Parameters(e,t,n,i,s,r):"1.1"===l?this._getCoverage110Parameters(e,t,n,s,r):this._getCoverage100Parameters(e,t,n,s),u="2.0"===l?await this.request(this._constructWCS201Url(c),{signal:s.signal,responseType:"array-buffer"}):await this.request(this.url,{query:c,signal:s.signal,responseType:"array-buffer"});if("1.0"===l)return u.data;if("2.0"===l&&!1!==this.ioConfig.allowAnyMediaType&&"tiff"===(0,me.g)(u.data))return o&&(this.ioConfig.allowAnyMediaType=!0,p.A.getLogger(this).warn("wcsraster:getcoverage",ve)),u.data;const d=ue(u);if(d.isMultipart&&d.data){const e=d.data.find((e=>e.isValidImage));return o&&"base64"===e?.contentTransferEncoding&&p.A.getLogger(this).warn("wcsraster:getcoverage","response is base64 encoded which may impact layer display performance"),e?.contentData}const m=new Uint8Array(u.data,0,Math.min(u.data.byteLength,2e3)),f=String.fromCharCode.apply(null,m).toLowerCase().includes("exception"),g=f&&String.fromCharCode.apply(null,m).includes("A non-zero RESX/RESY or WIDTH/HEIGHT is required but neither was provided");if(f)throw new a.A("wcsraster:getcoverage","server returns an exception",{isResolutionMismatch:g});throw new a.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}`,o=e.spatialReference.wkid,a=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"GEOTIFF",{bandIds:r,interpolation:l}=i,c=this._getInterpolationIndex(l),u=r?r.map((e=>this.coverageInfo.bandNames[e])):null,p=ge[c],{multidimensionalDefinition:d}=i;let m;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]),m=t.map((e=>we(e))).join(","))}return{service:"WCS",request:"GetCoverage",version:this.version,coverage:this.coverageId,format:a,crs:`EPSG:${o}`,bbox:s,width:t,height:n,time:m,interpolation:p,band:u?.join(",")}}_getCoverage110Parameters(e,t,n,i,s){const{multidimensionalDefinition:o,bandIds:a,interpolation:r}=i,l=e.spatialReference.wkid,c=`urn:ogc:def:crs:EPSG::${l}`,u=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",p=this._getInterpolationIndex(r),d=he[p],m=null==r||0===this.coverageInfo.supportedInterpolations?.indexOf(r),f=s.domain.spatialDomain,g=f.origin.x<=f.envelope.xmin&&f.origin.y<=f.envelope.ymin,h=e.width/t,v=e.height/n*(g?1:-1),y=g?[e.xmin,e.ymin]:[e.xmin,e.ymax],b=f.useEPSGAxis&&(0,A.m)(l),w=b?`${y[1]},${y[0]}`:`${y[0]},${y[1]}`,x=this.ioConfig.use2GridOffsets,C=b?x?`${v},${h}`:`${v},0,0,${h}`:x?`${h},${v}`:`${h},0,0,${v}`,I=h/2,S=e.xmin+I,D=e.xmax-I,T=Math.abs(v)/2,L=e.ymin+T,V=e.ymax-T,M=b?`${L},${S},${V},${D},${c}`:`${S},${L},${D},${V},${c}`,N=s.range.find((e=>e.axis.some((e=>e.identifier.toLowerCase().includes("band")))));let R,P=N&&d&&a?m?`${N.identifier}[${N.axis[0].identifier}[${a.join(",")}]]`:`${N.identifier}:${d}[${N.axis[0].identifier}[${a.join(",")}]]`:null;if(null!=o&&o.length)for(let e=0;e<o.length;e++){let t=o[e].values;const n=o[e].dimensionName?.toLowerCase(),i=o[e].variableName?.toLowerCase(),a=s.range.find((e=>e.identifier.toLowerCase()===i));if(t.length>0)if(Array.isArray(t[0])&&(t=t[0]),"stdtime"===n)R=t.map((e=>we(e))).join(",");else if(a){const e=a.axis.find((e=>e.identifier.toLowerCase()===n));e&&(P=m?a.identifier+"["+e.identifier+"["+t.join(",")+"]]":a.identifier+":"+d+"["+e.identifier+"["+t.join(",")+"]]")}e===o.length-1&&a&&!P&&(P=m?a.identifier:a.identifier+":"+d)}return{service:"WCS",request:"GetCoverage",version:this.version,identifier:this.coverageId,format:u,crs:`EPSG:${l}`,boundingbox:M,gridCS:"urn:ogc:def:cs:OGC:0.0:Grid2dSquareCS",gridType:"urn:ogc:def:method:WCS:1.1:2dGridIn2dCrs",gridOrigin:w,gridOffsets:C,gridBaseCRS:c,timeSequence:R,rangeSubset:P}}_getCoverage201Parameters(e,t,n,i,s,o){const{multidimensionalDefinition:a,interpolation:r}=s,l=this._getInterpolationIndex(r);let c=null;const{supportedInterpolations:u}=this.capabilities;if(u?.length)switch(l){case 0:c=u.find((e=>e.toLowerCase().includes("nearest")));break;case 1:c=u.find((e=>e.toLowerCase().includes("linear")));break;case 2:c=u.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:m,domainSet:f,rangeType:g}=o,h=m.isEastFirst?0:1,v=1-h,{axisLabels:y}=m,b=y[h],w=y[v],x=`http://www.opengis.net/def/crs/EPSG/0/${e.spatialReference.wkid}`,C=x,I=[];I.push(`${b}(${e.xmin},${e.xmax})`),I.push(`${w}(${e.ymin},${e.ymax})`);const S=[];if(y.length>2)for(let e=2;e<y.length;e++){const t=f.origin[e];if(y[e].toLowerCase().includes("time")){let n=t.toString();m.uomLabels?.[e].toLowerCase().includes("ole")&&(S.push(y[e]),n=we(t,!0)),I.push(y[e]+",http://www.opengis.net("+n+")")}else I.push(y[e]+",http://www.opengis.net("+t+")")}let D=null;if(null!=a&&a.length){const e=[];g.forEach((t=>t.forEach((t=>e.push(t.name)))));const t=[];for(let n=0;n<a.length;n++){const i=y.find((e=>e===a[n].dimensionName)),s=e.find((e=>e===a[n].variableName));if(t.includes(s)||t.push(s),i){let e=a[n].values;if(e.length>0){Array.isArray(e[0])&&(e=e[0]);let t="";t=i.toLowerCase().includes("time")?e.map((e=>we(e))).join(","):e.join(",");const n=I.findIndex((e=>0===e.indexOf(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&&(D=t.join(","))}else d?.length>=2&&(D=(s.bandIds?s.bandIds.map((e=>d[e])):d).join(","));const A=I.join("&subset="),T=!o.domainSet.hasSameAxisLabelsAsBoundedBy&&!1!==this.ioConfig.allowScaleFactor,L=T?null:`${b}(${t}),${w}(${n})`,V=T?1/i:null;return{service:"WCS",request:"GetCoverage",version:this.version,coverageId:this.coverageId,rangesubset:D,interpolation:c,scaleSize:L,scaleFactor:V,subset:A,format:p,mediaType:this.ioConfig.allowAnyMediaType?null:"multipart/related",outputcrs:x,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 we(e,t=!1){return(t?new Date(ae(e)):new Date(e)).toISOString()}(0,i._)([(0,u.MZ)({type:String,json:{write:!0}})],be.prototype,"datasetFormat",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],be.prototype,"tileType",void 0),(0,i._)([(0,u.MZ)({type:String,json:{write:!0}})],be.prototype,"version",void 0),(0,i._)([(0,u.MZ)({type:String,json:{write:!0}})],be.prototype,"coverageId",void 0),be=(0,i._)([(0,d.$)("esri.layers.support.rasterDatasets.WCSRaster")],be);const xe=be;var Ce=n(30291),Ie=n(92935);const Se=new Set(["milliseconds","seconds","minutes","hours","days","weeks","months","years","decades","centuries"]);let De=class extends((0,f.dM)((0,w.j)((0,v.q)((0,y.A)((0,g.d)((0,h.o)((0,x.e)((0,b.J)((0,r.P)(o.A.ClonableMixin(m.A))))))))))){constructor(...e){super(...e),this.coverageId=null,this.version=null,this.isReference=null,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:o}=await n.e(9838).then(n.bind(n,59838));switch(e){case Ie.X.SAVE:return s(this,t);case Ie.X.SAVE_AS:return o(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 coverageInfo(){return this.raster.coverageInfo}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){return[(0,S.rZ)("Pixel Value")]}createPopupTemplate(e){return(0,Ce.tn)({fields:this.rasterFields,title:this.title},e)}async save(e){return this._debouncedSaveOperations(Ie.X.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(Ie.X.SAVE_AS,t,e)}async _openRaster(e){const t=new xe({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 a.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=Se.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,c.wB)((()=>this.customParameters),(e=>this.raster.ioConfig.customFetchParameters=e)))}};(0,i._)([(0,u.MZ)({type:String,nonNullable:!0,json:{name:"wcsInfo.coverageId",write:{isRequired:!0,ignoreOrigin:!0}}})],De.prototype,"coverageId",void 0),(0,i._)([(0,u.MZ)()],De.prototype,"coverageInfo",null),(0,i._)([(0,u.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}}})],De.prototype,"version",void 0),(0,i._)([(0,u.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],De.prototype,"isReference",void 0),(0,i._)([(0,u.MZ)({json:{read:!0,write:!0}})],De.prototype,"blendMode",void 0),(0,i._)([(0,u.MZ)(C.fV)],De.prototype,"legendEnabled",void 0),(0,i._)([(0,u.MZ)({type:["show","hide"]})],De.prototype,"listMode",void 0),(0,i._)([(0,u.MZ)()],De.prototype,"noData",void 0),(0,i._)([(0,u.MZ)({type:["WCS"]})],De.prototype,"operationalLayerType",void 0),(0,i._)([(0,u.MZ)()],De.prototype,"raster",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],De.prototype,"type",void 0),(0,i._)([(0,u.MZ)(C.M6)],De.prototype,"popupEnabled",void 0),(0,i._)([(0,u.MZ)({type:s.A,json:{name:"popupInfo",write:!0}})],De.prototype,"popupTemplate",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],De.prototype,"defaultPopupTemplate",null),(0,i._)([(0,u.MZ)({readOnly:!0,type:[I.A]})],De.prototype,"fields",void 0),(0,i._)([(0,u.MZ)({readOnly:!0,type:[I.A]})],De.prototype,"rasterFields",null),De=(0,i._)([(0,d.$)("esri.layers.WCSLayer")],De);const Ae=De},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))}}}]);
|