@arcgis/core 4.24.0-next.20220511 → 4.24.0-next.20220512
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/assets/components/assets/icon/compactness16.json +1 -0
- package/assets/components/assets/icon/compactness24.json +1 -0
- package/assets/components/assets/icon/compactness32.json +1 -0
- package/assets/components/assets/icon/configure16.json +1 -0
- package/assets/components/assets/icon/configure24.json +1 -0
- package/assets/components/assets/icon/configure32.json +1 -0
- package/assets/components/assets/icon/debugScript16.json +1 -0
- package/assets/components/assets/icon/debugScript24.json +1 -0
- package/assets/components/assets/icon/debugScript32.json +1 -0
- package/assets/components/assets/icon/dissolveFeatures16.json +1 -0
- package/assets/components/assets/icon/dissolveFeatures24.json +1 -0
- package/assets/components/assets/icon/dissolveFeatures32.json +1 -0
- package/assets/components/assets/icon/distanceType16.json +1 -0
- package/assets/components/assets/icon/distanceType24.json +1 -0
- package/assets/components/assets/icon/distanceType32.json +1 -0
- package/assets/components/assets/icon/gridDiamond16.json +1 -0
- package/assets/components/assets/icon/gridDiamond24.json +1 -0
- package/assets/components/assets/icon/gridDiamond32.json +1 -0
- package/assets/components/assets/icon/gridHexagon16.json +1 -0
- package/assets/components/assets/icon/gridHexagon24.json +1 -0
- package/assets/components/assets/icon/gridHexagon32.json +1 -0
- package/assets/components/assets/icon/gridTriangle16.json +1 -0
- package/assets/components/assets/icon/gridTriangle24.json +1 -0
- package/assets/components/assets/icon/gridTriangle32.json +1 -0
- package/assets/components/assets/icon/insets16.json +1 -0
- package/assets/components/assets/icon/insets24.json +1 -0
- package/assets/components/assets/icon/insets32.json +1 -0
- package/assets/components/assets/icon/maximumTerritoryDistance16.json +1 -0
- package/assets/components/assets/icon/maximumTerritoryDistance24.json +1 -0
- package/assets/components/assets/icon/maximumTerritoryDistance32.json +1 -0
- package/assets/components/assets/icon/minDistanceBetweenCenters16.json +1 -0
- package/assets/components/assets/icon/minDistanceBetweenCenters24.json +1 -0
- package/assets/components/assets/icon/minDistanceBetweenCenters32.json +1 -0
- package/assets/components/assets/icon/numberOfTerritories16.json +1 -0
- package/assets/components/assets/icon/numberOfTerritories24.json +1 -0
- package/assets/components/assets/icon/numberOfTerritories32.json +1 -0
- package/assets/components/assets/icon/overlapFeatures16.json +1 -0
- package/assets/components/assets/icon/overlapFeatures24.json +1 -0
- package/assets/components/assets/icon/overlapFeatures32.json +1 -0
- package/assets/components/assets/icon/profileVariables16.json +1 -0
- package/assets/components/assets/icon/profileVariables24.json +1 -0
- package/assets/components/assets/icon/profileVariables32.json +1 -0
- package/assets/components/assets/icon/rasterAnalysis16.json +1 -0
- package/assets/components/assets/icon/rasterAnalysis24.json +1 -0
- package/assets/components/assets/icon/rasterAnalysis32.json +1 -0
- package/assets/components/assets/icon/recurrence16.json +1 -0
- package/assets/components/assets/icon/recurrence24.json +1 -0
- package/assets/components/assets/icon/recurrence32.json +1 -0
- package/assets/components/assets/icon/splitFeatures16.json +1 -0
- package/assets/components/assets/icon/splitFeatures24.json +1 -0
- package/assets/components/assets/icon/splitFeatures32.json +1 -0
- package/assets/components/assets/icon/territoryBufferDistance16.json +1 -0
- package/assets/components/assets/icon/territoryBufferDistance24.json +1 -0
- package/assets/components/assets/icon/territoryBufferDistance32.json +1 -0
- package/assets/components/assets/icon/testData16.json +1 -0
- package/assets/components/assets/icon/testData24.json +1 -0
- package/assets/components/assets/icon/testData32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/07eda3e958d29f86b37e.js +1 -0
- package/assets/esri/core/workers/chunks/0ecaa28b8bff1d779d66.js +1 -0
- package/assets/esri/core/workers/chunks/{adae54f116f311d72d97.js → 1aba8c73c62a64e0658c.js} +1 -1
- package/assets/esri/core/workers/chunks/1d109cd048170e2d529a.js +1 -0
- package/assets/esri/core/workers/chunks/366e5c1abd1ab6d3e548.js +1 -0
- package/assets/esri/core/workers/chunks/3e94e35f44aadbb332ff.js +1 -0
- package/assets/esri/core/workers/chunks/46411f32b29a0e783105.js +1 -0
- package/assets/esri/core/workers/chunks/4d1c87e3e0a02efcc082.js +1 -0
- package/assets/esri/core/workers/chunks/{b089058b64db3912478f.js → 5e46e60fab93ad034d3a.js} +1 -1
- package/assets/esri/core/workers/chunks/6281b15009712a5dee3c.js +1 -0
- package/assets/esri/core/workers/chunks/66f627d68dbb0fdb725f.js +1 -0
- package/assets/esri/core/workers/chunks/672da24bbf86718bf48d.js +1 -0
- package/assets/esri/core/workers/chunks/733625d85602127d62cd.js +1 -0
- package/assets/esri/core/workers/chunks/{c51c9b5da855f84b9a48.js → 7391422fc51acb96a25d.js} +1 -1
- package/assets/esri/core/workers/chunks/{f435dc615fdc8917f6ca.js → 7cf3cff7b28ff007dbad.js} +1 -1
- package/assets/esri/core/workers/chunks/7ea06c86adfc827fda08.js +1 -0
- package/assets/esri/core/workers/chunks/{a054a52712a118c6d505.js → 82bc24bdc9c6ebaf58c0.js} +1 -1
- package/assets/esri/core/workers/chunks/8965ab74e03506e3475e.js +1 -0
- package/assets/esri/core/workers/chunks/{5405f478af3563580926.js → 8b497d9c37a8f577a467.js} +1 -1
- package/assets/esri/core/workers/chunks/919d0d8b1c2176760973.js +1 -0
- package/assets/esri/core/workers/chunks/ab2a0480dc2b608deda3.js +1 -0
- package/assets/esri/core/workers/chunks/ab97a35f7a7d5cf1da19.js +2 -0
- package/assets/esri/core/workers/chunks/{dcd0653191cd4a1ccaae.js.LICENSE.txt → ab97a35f7a7d5cf1da19.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/ae554c88e862a5761f2e.js +1 -0
- package/assets/esri/core/workers/chunks/ae5ce55cd1a32525f101.js +1 -0
- package/assets/esri/core/workers/chunks/b597c04a4abb98e29d1c.js +1 -0
- package/assets/esri/core/workers/chunks/{287c484fd40eee643f3a.js → b78c3e9d31c4a562cdf0.js} +1 -1
- package/assets/esri/core/workers/chunks/be4bf1e4cbe2a593f8b3.js +1 -0
- package/assets/esri/core/workers/chunks/{b7572b0921b23aef8b9d.js → c40d9caf5189be2c698e.js} +1 -1
- package/assets/esri/core/workers/chunks/{b28539c5a6bedb71b038.js → d63f736b3560c577a8a4.js} +1 -1
- package/assets/esri/core/workers/chunks/d869dabe937d3b60504e.js +1 -0
- package/assets/esri/core/workers/chunks/dd6c9a114ad38cf622ba.js +1 -0
- package/assets/esri/core/workers/chunks/e6b0f74226b9394bfa7a.js +1 -0
- package/assets/esri/themes/base/widgets/_Editor.scss +3 -2
- 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/assets/esri/views/interactive/tooltip/t9n/Tooltip.json +1 -0
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_en.json +1 -0
- package/chunks/EdgeShader.glsl.js +3 -4
- package/interfaces.d.ts +463 -30
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoJSONLayer.js +1 -1
- package/layers/OGCFeatureLayer.js +1 -1
- package/layers/RouteLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/WFSLayer.js +1 -1
- package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/save/featureLayerUtils.js +1 -1
- package/layers/support/AggregateField.d.ts +4 -0
- package/layers/support/AggregateField.js +1 -1
- package/layers/support/FeatureReductionBinning.d.ts +4 -0
- package/layers/support/FeatureReductionBinning.js +1 -1
- package/layers/support/OutStatistic.d.ts +4 -0
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
- package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/package.json +3 -3
- package/portal/support/portalItemUtils.js +1 -1
- package/renderers/PieChartRenderer.d.ts +4 -0
- package/renderers/PieChartRenderer.js +5 -0
- package/renderers/Renderer.js +1 -1
- package/renderers/support/AuthoringInfo.js +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/renderers/support/clickToleranceUtils.js +1 -1
- package/renderers/support/rasterRendererHelper.js +1 -1
- package/renderers/support/types.js +1 -1
- package/renderers/support/utils.js +1 -1
- package/renderers.js +1 -1
- package/request.js +1 -1
- package/rest/imageService/fetchRasterInfo.js +5 -0
- package/rest/imageService/getCatalogItemRasterInfo.js +5 -0
- package/rest/print.js +1 -1
- package/smartMapping/renderers/color.js +1 -1
- package/smartMapping/renderers/dotDensity.js +1 -1
- package/smartMapping/renderers/heatmap.js +1 -1
- package/smartMapping/renderers/location.js +1 -1
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/type.js +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/CurveHelper.js +1 -1
- package/symbols/cim/ExpandedCIM.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
- package/views/2d/engine/brushes.js +1 -1
- package/views/2d/engine/vectorTiles/GlyphSource.js +1 -1
- package/views/2d/engine/vectorTiles/style/Filter.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/Utils.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushPieChart.js +5 -0
- package/views/2d/engine/webgl/brushes/WGLGeometryBrush.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushFill.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushMarker.js +1 -1
- package/views/2d/engine/webgl/color.js +1 -1
- package/views/2d/engine/webgl/definitions.js +1 -1
- package/views/2d/engine/webgl/enums.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLBaseFillTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLBaseLineTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLMarkerTemplate.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/techniques/dotDensity/TechniqueDotDensity.js +1 -1
- package/views/2d/engine/webgl/techniques/pieChart/TechniquePieChart.js +5 -0
- package/views/2d/engine/webgl/techniques/utils.js +1 -1
- package/views/2d/engine/webgl/util/Matcher.js +1 -1
- package/views/2d/layers/features/schemaUtils.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/tileRenderers/SymbolTileRenderer.js +1 -1
- package/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/3d/analysis/Dimensioning/DimensioningTool.js +1 -1
- package/views/3d/analysis/Dimensioning/LengthDimensionVisualization.js +1 -1
- package/views/3d/environment/SnowyWeather.d.ts +4 -0
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +5 -5
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +37 -31
- package/views/draw/DrawOperation.js +1 -1
- package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
- package/views/interactive/snapping/SceneSnappingEngine.js +5 -0
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/snappingFactory.js +5 -0
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/Popup/actionUtils.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/0564f1cfa3d17ff1aad3.js +0 -1
- package/assets/esri/core/workers/chunks/0806d5d706a864542bfb.js +0 -1
- package/assets/esri/core/workers/chunks/52478ee2d2a1354b6900.js +0 -1
- package/assets/esri/core/workers/chunks/5759af97f96f24c40105.js +0 -1
- package/assets/esri/core/workers/chunks/7bc828fbdd54c0b28aac.js +0 -1
- package/assets/esri/core/workers/chunks/875f26ee040f3d75c0db.js +0 -1
- package/assets/esri/core/workers/chunks/88384e7cafbfd2348598.js +0 -1
- package/assets/esri/core/workers/chunks/89acd5f888d6b8df4aad.js +0 -1
- package/assets/esri/core/workers/chunks/9d7533aaeac3b8d145c4.js +0 -1
- package/assets/esri/core/workers/chunks/a3bb600bfcb0282622f1.js +0 -1
- package/assets/esri/core/workers/chunks/b50ae3dc7e43ff452568.js +0 -1
- package/assets/esri/core/workers/chunks/b5b7bcbc19b3430903ee.js +0 -1
- package/assets/esri/core/workers/chunks/b758f3c419edc2306784.js +0 -1
- package/assets/esri/core/workers/chunks/cf47b605c31063e88357.js +0 -1
- package/assets/esri/core/workers/chunks/cfbb332d144e65a4a55d.js +0 -1
- package/assets/esri/core/workers/chunks/db937849b2c1af87b481.js +0 -1
- package/assets/esri/core/workers/chunks/dc3ed59f450283d97a19.js +0 -1
- package/assets/esri/core/workers/chunks/dcd0653191cd4a1ccaae.js +0 -2
- package/assets/esri/core/workers/chunks/dfb6a28039e5d5ce6fd4.js +0 -1
- package/assets/esri/core/workers/chunks/e4fdd1eaf987977d0a51.js +0 -1
- package/assets/esri/core/workers/chunks/f7e0bb11ba3677069c94.js +0 -1
- package/assets/esri/core/workers/chunks/f7f3dde4c8f9c687cc1e.js +0 -1
- package/assets/esri/core/workers/chunks/fc6beaf9466ea3898549.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7175],{47175:(e,t,i)=>{i.r(t),i.d(t,{default:()=>Ft});var r,n=i(43697),s=i(51773),a=i(70586),o=i(16453),l=i(95330),u=i(5600),p=(i(67676),i(80442),i(75215)),c=i(52011),m=i(30556),d=i(87085),h=i(66577),y=i(38171),f=i(30030),g=i(3172),b=i(20102),R=i(35454),v=i(22974),w=i(92604),_=i(17445),S=i(17452),C=i(44422),I=i(71715),x=i(21506),F=i(35956),T=i(96674),N=i(36030);const D=new Set(["raster","raster2","dem","fillraster"]),P=new Set(["rasters"]),O=e=>e&&e.rasterFunction?A.fromJSON(e):e,j=e=>e&&e instanceof A?e.toJSON():e,V=e=>e?.functionName&&!e.declaredClass,M=e=>V(e)?new A(e):e;let A=r=class extends T.wq{constructor(e){super(e),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.rasterFunctionDefinition=null}set functionArguments(e){if(e){const t=Object.keys(e);if(t.some((t=>D.has(t.toLowerCase())&&V(e[t])))||t.some((t=>P.has(t.toLowerCase())&&Array.isArray(e[t])&&e[t].some((e=>V(e)))))){e=(0,v.d9)(e);for(const i of t)D.has(i.toLowerCase())?e[i]=M(e[i]):P.has(i.toLowerCase())&&Array.isArray(e[i])&&(e[i]=e[i].map((e=>M(e))))}}this._set("functionArguments",e)}readFunctionArguments(e){return(e=>{if(null==e)return null;e=(0,v.d9)(e);const t={};for(const i of Object.keys(e))D.has(i.toLowerCase())?t[i]=O(e[i]):P.has(i.toLowerCase())&&Array.isArray(e[i])?t[i]=e[i].map(O):t[i]=e[i];return t})(e)}writeFunctionArguments(e,t,i){const r={};for(const t of Object.keys(e))D.has(t.toLowerCase())?r[t]=j(e[t]):P.has(t.toLowerCase())&&Array.isArray(e[t])?r[t]=e[t].map(j):r[t]=j(e[t]);t[i]=r}readFunctionName(e,t){const i=t.rasterFunctionInfos;return t.name||(i&&i.length&&"None"!==i[0].name?i[0].name:t.rasterFunctionDefinition?t.rasterFunctionDefinition.name:t.rasterFunction)}clone(){return new r({functionName:this.functionName,functionArguments:(0,v.d9)(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:(0,v.d9)(this.rasterFunctionDefinition)})}};(0,n._)([(0,u.Cb)({json:{type:Object,name:"rasterFunctionArguments"}})],A.prototype,"functionArguments",null),(0,n._)([(0,I.r)("functionArguments")],A.prototype,"readFunctionArguments",null),(0,n._)([(0,m.c)("functionArguments")],A.prototype,"writeFunctionArguments",null),(0,n._)([(0,u.Cb)({json:{type:String,write:{target:"rasterFunction"}}})],A.prototype,"functionName",void 0),(0,n._)([(0,I.r)("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],A.prototype,"readFunctionName",null),(0,n._)([(0,N.J)({C128:"c128",C64:"c64",F32:"f32",F64:"f64",S16:"s16",S32:"s32",S8:"s8",U1:"u1",U16:"u16",U2:"u2",U32:"u32",U4:"u4",U8:"u8",UNKNOWN:"unknown"},{ignoreUnknown:!1}),(0,u.Cb)({json:{default:"unknown"}})],A.prototype,"outputPixelType",void 0),(0,n._)([(0,u.Cb)({type:String,json:{read:!0,write:!0}})],A.prototype,"variableName",void 0),(0,n._)([(0,u.Cb)({type:Object,json:{name:"rasterFunctionDefinition"}})],A.prototype,"rasterFunctionDefinition",void 0),A=r=(0,n._)([(0,c.j)("esri.layers.support.RasterFunction")],A);const J=A,E={StretchFunction:{arguments:{ComputeGamma:{isDataset:!1,isPublic:!1,name:"ComputeGamma",type:"RasterFunctionVariable",value:!1},DRA:{isDataset:!1,isPublic:!1,name:"DRA",type:"RasterFunctionVariable",value:!1},EstimateStatsHistogram:{isDataset:!1,isPublic:!1,name:"EstimateStatsHistogram",type:"RasterFunctionVariable",value:!1},Gamma:{displayName:"Gamma",isDataset:!1,isPublic:!1,name:"Gamma",type:"RasterFunctionVariable"},Histograms:{isDataset:!1,isPublic:!1,name:"Histograms",type:"RasterFunctionVariable"},Max:{isDataset:!1,isPublic:!1,name:"Max",type:"RasterFunctionVariable",value:255},MaxPercent:{isDataset:!1,isPublic:!1,name:"MaxPercent",type:"RasterFunctionVariable",value:.5},Min:{isDataset:!1,isPublic:!1,name:"Min",type:"RasterFunctionVariable",value:0},MinPercent:{isDataset:!1,isPublic:!1,name:"MinPercent",type:"RasterFunctionVariable",value:.25},NumberOfStandardDeviations:{isDataset:!1,isPublic:!1,name:"NumberOfStandardDeviation",type:"RasterFunctionVariable",value:2},Raster:{isDataset:!0,isPublic:!1,name:"Raster",type:"RasterFunctionVariable"},SigmoidStrengthLevel:{isDataset:!1,isPublic:!1,name:"SigmoidStrengthLevel",type:"RasterFunctionVariable",value:2},Statistics:{isDataset:!1,isPublic:!1,name:"Statistics",type:"RasterFunctionVariable"},StretchType:{isDataset:!1,isPublic:!1,name:"StretchType",type:"RasterFunctionVariable",value:0},type:"StretchFunctionArguments",UseGamma:{isDataset:!1,isPublic:!1,name:"UseGamma",type:"RasterFunctionVariable",value:!1}},description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",function:{description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",name:"Stretch",pixelType:"UNKNOWN",type:"StretchFunction"},functionType:0,name:"Stretch",thumbnail:""},RemapFunction:{name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table.",function:{type:"RemapFunction",pixelType:"UNKNOWN",name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},UseTable:{name:"UseTable",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},InputRanges:{name:"InputRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Input Ranges"},OutputValues:{name:"OutputValues",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Output Values"},NoDataRanges:{name:"NoDataRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"NoData Ranges"},Table:{name:"Table",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputField:{name:"InputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},OutputField:{name:"OutputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputMaxField:{name:"InputMaxField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},RemapTableType:{name:"RemapTableType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},AllowUnmatched:{name:"AllowUnmatched",isPublic:!1,isDataset:!1,value:!0,type:"RasterFunctionVariable"},type:"RemapFunctionArguments"},functionType:0,thumbnail:""},ColormapFunction:{name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.",function:{type:"ColormapFunction",pixelType:"UNKNOWN",name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},ColormapName:{name:"ColormapName",isPublic:!1,isDataset:!1,value:"Gray",type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},type:"ColormapFunctionArguments"},functionType:0,thumbnail:""},ShadedReliefFunction:{name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.",function:{type:"ShadedReliefFunction",pixelType:"UNKNOWN",name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"ShadedReliefFunctionArguments"},functionType:0,thumbnail:""},HillshadeFunction:{name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image",function:{type:"HillshadeFunction",pixelType:"UNKNOWN",name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image"},arguments:{DEM:{name:"DEM",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"HillshadeFunctionArguments"},functionType:0,thumbnail:""},ResampleFunction:{name:"Resample",description:"Changes the cell size of a raster.",function:{type:"ResampleFunction",pixelType:"UNKNOWN",name:"Resample",description:"Changes the cell size of a raster."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ResamplingType:{name:"ResamplingType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},InputCellSize:{name:"InputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},OutputCellSize:{name:"OutputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},type:"ResampleFunctionArguments"},functionType:0,thumbnail:""}};var z=i(93010),q=i(75509),L=i(27922);const Z={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767]},k={simple_scalar:"Simple Scalar",wind_barb:"Wind Barb",single_arrow:"Single Arrow",beaufort_kn:"Beaufort Wind (Knots)",beaufort_m:"Beaufort Wind (MetersPerSecond)",ocean_current_m:"Ocean Current (MetersPerSecond)",ocean_current_kn:"Ocean Current (Knots)"},U=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function H(e){return U.has(e.type)}function G(e,t){if(!e||!t)return(0,v.d9)(e||t);const i=(0,v.d9)(e);if(t.rasterFunctionDefinition){const e=t.rasterFunctionDefinition;(e.thumbnail||e.thumbnailEx)&&(e.thumbnail=e.thumbnailEx=null),Q(i.rasterFunctionDefinition.arguments,t)}else"none"!==t.functionName.toLowerCase()&&(W(i.functionArguments).Raster=t);return i}function Q(e,t){for(const i in e)"raster"===i.toLowerCase()&&("RasterFunctionVariable"===e[i].type?(e[i]=t.rasterFunctionDefinition,e[i].type="RasterFunctionTemplate"):"RasterFunctionTemplate"===e[i].type&&Q(e[i].arguments,t))}function B(e){const t=(0,v.d9)(E[e.functionName+"Function"]),i=e.functionArguments;for(const e in i)"raster"===e.toLowerCase()?(t.arguments[e]=B(i[e]),t.arguments[e].type="RasterFunctionTemplate"):"colormap"===e.toLowerCase()?(t.arguments[e].value=ee(i[e]),t.arguments.ColorSchemeType.value=0):t.arguments[e].value=i[e];return t}function W(e){const t=e.Raster;return t&&"esri.layers.support.RasterFunction"===t.declaredClass?W(t.functionArguments):e}const $={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function K(e,t){const i=Z[String(t).toLowerCase()];return i&&e.push([Math.floor(i[0]-1),0,0,0],[Math.ceil(i[1]+1),0,0,0]),e}function X(e){if(!e)return;const{fields:t}=e,i=t&&t.find((e=>e&&e.name&&"value"===e.name.toLowerCase()));return i&&i.name}function Y(e){const t=[];return e.forEach((e=>{const i=e;if(Array.isArray(i))t.push(i);else{if(null==i.min||null==i.max)return;const e=[i.min,i.max,i.avg||0,i.stddev||0];t.push(e)}})),t}function ee(e){const t=[],i=[];return e.forEach((e=>{t.push(e[0]),i.push((0,z.io)([...e.slice(1),255]))})),{type:"RasterColormap",values:t,colors:i}}var te,ie=i(90578),re=i(13473);const ne=(0,R.w)()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),se=(0,R.w)()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});let ae=te=class extends T.wq{constructor(e){super(e),this.ascending=!0,this.itemRenderingRule=null,this.lockRasterIds=null,this.method=null,this.multidimensionalDefinition=null,this.objectIds=null,this.operation=null,this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(e,t){return null!=t.ascending?t.ascending:null==t.sortAscending||t.sortAscending}readMethod(e,t){return function(e){let t;switch(e?e.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":t="esriMosaicAttribute";break;case"lockraster":t="esriMosaicLockRaster";break;case"center":t="esriMosaicCenter";break;case"northwest":t="esriMosaicNorthwest";break;case"nadir":t="esriMosaicNadir";break;case"viewpoint":t="esriMosaicViewpoint";break;case"seamline":t="esriMosaicSeamline";break;default:t="esriMosaicNone"}return se.fromJSON(t)}(t.mosaicMethod||t.defaultMosaicMethod)}readOperation(e,t){const i=t.mosaicOperation,r=t.mosaicOperator&&t.mosaicOperator.toLowerCase(),n=i||(r?ne.toJSON(r):null);return ne.fromJSON(n)||"first"}castSortValue(e){return null==e||"string"==typeof e||"number"==typeof e?e:`${e}`}clone(){return new te({ascending:this.ascending,itemRenderingRule:(0,v.d9)(this.itemRenderingRule),lockRasterIds:(0,v.d9)(this.lockRasterIds),method:this.method,multidimensionalDefinition:(0,v.d9)(this.multidimensionalDefinition),objectIds:(0,v.d9)(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:(0,v.d9)(this.viewpoint),where:this.where})}};(0,n._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],ae.prototype,"ascending",void 0),(0,n._)([(0,I.r)("ascending",["ascending","sortAscending"])],ae.prototype,"readAscending",null),(0,n._)([(0,u.Cb)({type:J,json:{write:!0}})],ae.prototype,"itemRenderingRule",void 0),(0,n._)([(0,u.Cb)({type:[p.z8],json:{write:{overridePolicy(){return{enabled:"lock-raster"===this.method}}}}})],ae.prototype,"lockRasterIds",void 0),(0,n._)([(0,u.Cb)({type:String,json:{type:se.jsonValues,write:{target:"mosaicMethod",writer:se.write}}})],ae.prototype,"method",void 0),(0,n._)([(0,I.r)("method",["mosaicMethod","defaultMosaicMethod"])],ae.prototype,"readMethod",null),(0,n._)([(0,u.Cb)({type:[F.Z],json:{write:!0}})],ae.prototype,"multidimensionalDefinition",void 0),(0,n._)([(0,u.Cb)({type:[p.z8],json:{name:"fids",write:!0}})],ae.prototype,"objectIds",void 0),(0,n._)([(0,u.Cb)({json:{type:ne.jsonValues,read:{reader:ne.read},write:{target:"mosaicOperation",writer:ne.write}}})],ae.prototype,"operation",void 0),(0,n._)([(0,I.r)("operation",["mosaicOperation","mosaicOperator"])],ae.prototype,"readOperation",null),(0,n._)([(0,u.Cb)({type:String,json:{write:{overridePolicy(){return{enabled:"attribute"===this.method}}}}})],ae.prototype,"sortField",void 0),(0,n._)([(0,u.Cb)({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:"attribute"===this.method,allowNull:!0}}}}})],ae.prototype,"sortValue",void 0),(0,n._)([(0,ie.p)("sortValue")],ae.prototype,"castSortValue",null),(0,n._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],ae.prototype,"viewpoint",void 0),(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],ae.prototype,"where",void 0),ae=te=(0,n._)([(0,c.j)("esri.layers.support.MosaicRule")],ae);const oe=ae;var le=i(69608);let ue=class extends T.wq{constructor(){super(...arguments),this.layer=null,this.adjustAspectRatio=void 0,this.bandIds=void 0,this.compression=void 0,this.compressionQuality=void 0,this.compressionTolerance=.01,this.format=null,this.interpolation=null,this.noData=null,this.noDataInterpretation=void 0,this.pixelType=void 0,this.lercVersion=2}writeAdjustAspectRatio(e,t,i){this.layer.version<10.3||(t[i]=e)}writeCompressionQuality(e,t,i){this.format&&this.format.toLowerCase().includes("jpg")&&null!=e&&(t[i]=e)}writeCompressionTolerance(e,t,i){"lerc"===this.format&&null!=e&&(t[i]=e)}writeLercVersion(e,t,i){"lerc"===this.format&&this.layer.version>=10.5&&(t[i]=e)}get version(){const e=this.layer;return e.commitProperty("bandIds"),e.commitProperty("format"),e.commitProperty("compressionQuality"),e.commitProperty("compressionTolerance"),e.commitProperty("interpolation"),e.commitProperty("noData"),e.commitProperty("noDataInterpretation"),e.commitProperty("mosaicRule"),e.commitProperty("renderingRule"),e.commitProperty("adjustAspectRatio"),e.commitProperty("pixelFilter"),e.commitProperty("renderer"),e.commitProperty("definitionExpression"),(this._get("version")||0)+1}set version(e){this._set("version",e)}get mosaicRule(){const e=this.layer;let t=e.mosaicRule;const i=e.definitionExpression;return t?i&&i!==t.where&&(t=t.clone(),t.where=i):i&&(t=new oe({where:i})),t}get renderingRule(){const e=this.layer;let t=e.renderingRule;const i=e.pixelFilter,r=!e.format||e.format.includes("jpg")||e.format.includes("png");return t=this._addResampleRasterFunction(t),r&&!i&&(t=this.combineRendererWithRenderingRule()),t}combineRendererWithRenderingRule(){const e=this.layer,{rasterInfo:t,renderingRule:i,renderer:r}=e;return r&&H(r)?G(function(e,t){switch(t=t||{},e.type){case"raster-stretch":return function(e,t){const i=t.convertToRFT,r=new J;r.functionName="Stretch";const n=$[q.v.toJSON(e.stretchType)],s="u8",a={StretchType:n,Statistics:Y(e.statistics),DRA:e.dynamicRangeAdjustment,UseGamma:e.useGamma,Gamma:e.gamma,ComputeGamma:e.computeGamma};if(null!=e.outputMin&&(a.Min=e.outputMin),null!=e.outputMax&&(a.Max=e.outputMax),n===$.standardDeviation?(a.NumberOfStandardDeviations=e.numberOfStandardDeviations,r.outputPixelType=s):n===$.percentClip?(a.MinPercent=e.minPercent,a.MaxPercent=e.maxPercent,r.outputPixelType=s):n===$.minMax?r.outputPixelType=s:n===$.sigmoid&&(a.SigmoidStrengthLevel=e.sigmoidStrengthLevel),r.functionArguments=a,r.variableName="Raster",e.colorRamp){const n=e.colorRamp,s=new J;if(i)s.functionArguments={ColorRamp:(0,z.pM)(n)};else{const i=(0,z.Uh)(n);i?s.functionArguments={colorRamp:i}:!t.convertColorRampToColormap||"algorithmic"!==n.type&&"multipart"!==n.type?s.functionArguments={colorRamp:e.colorRamp.toJSON()}:s.functionArguments={Colormap:(0,z.Jw)(n,256)}}return s.variableName="Raster",s.functionName="Colormap",s.functionArguments.Raster=r,i?new J({rasterFunctionDefinition:B(s)}):s}return i?new J({rasterFunctionDefinition:B(r)}):r}(e,t);case"class-breaks":return function(e,t){const i=[],r=[],n=[],s=[],a=1e-6,{pixelType:o,rasterAttributeTable:l}=t,u=l&&l.features,p=X(l);if(u&&Array.isArray(u)&&e.classBreakInfos){e.classBreakInfos.forEach(((t,i)=>{const r=t.symbol.color;let n;r.a&&u.forEach((a=>{n=a.attributes[e.field],(n>=t.minValue&&n<t.maxValue||i===e.classBreakInfos.length-1&&n>=t.minValue)&&s.push([a.attributes[p],r.r,r.g,r.b])}))}));const i=o?K(s,o):s,r=new J;return r.functionName="Colormap",r.functionArguments={},r.functionArguments.Colormap=i,r.variableName="Raster",t.convertToRFT?new J({rasterFunctionDefinition:B(r)}):r}e.classBreakInfos.forEach(((e,t)=>{const o=e.symbol&&e.symbol.color;o.a?(0===t?i.push(e.minValue,e.maxValue+a):i.push(e.minValue+a,e.maxValue+a),r.push(t),s.push([t,o.r,o.g,o.b])):n.push(e.minValue,e.maxValue)}));const c=o?K(s,o):s,m=new J;m.functionName="Remap",m.functionArguments={InputRanges:i,OutputValues:r,NoDataRanges:n},m.variableName="Raster";const d=new J;return d.functionName="Colormap",d.functionArguments={Colormap:c,Raster:m},t.convertToRFT?new J({rasterFunctionDefinition:B(d)}):d}(e,t);case"unique-value":return function(e,t){const i=[],{pixelType:r,rasterAttributeTable:n}=t,s=n&&n.features,a=X(n),o=e.defaultSymbol?.color?.toRgb(),l=e.uniqueValueInfos;if(l)if(s){const t=new Map;l.forEach((e=>{const i=e.value,r=e.symbol.color?.toRgb();null!=i&&r&&t.set(String(i),r)}));const r=e.field;s.forEach((({attributes:e})=>{const n=String(e[r]),s=e[a];if(t.has(n)){const e=t.get(n);i.push([s,...e])}else o&&i.push([s,...o])}))}else for(let e=0;e<l.length;e++){const t=l[e],r=t.symbol.color,n=+t.value;if(r?.a){if(isNaN(n))return null;i.push([n,r.r,r.g,r.b])}}const u=r&&i.length>0?K(i,r):i,p=new J;return p.functionName="Colormap",p.functionArguments={},p.functionArguments.Colormap=u,p.variableName="Raster",t.convertToRFT?new J({rasterFunctionDefinition:B(p)}):p}(e,t);case"raster-colormap":return function(e,t){const i=e.extractColormap();if(!i||0===i.length)return;const{pixelType:r}=t,n=r?K(i,r):i,s=new J;return s.functionName="Colormap",s.functionArguments={},s.functionArguments.Colormap=n,t.convertToRFT?new J({rasterFunctionDefinition:B(s)}):s}(e,t);case"vector-field":return function(e,t){const i=new J;i.functionName="VectorFieldRenderer";const{dataType:r,bandProperties:n}=t,s="vector-uv"===r;let a,o;n&&2===n.length&&(a=n.map((e=>e.BandName.toLowerCase())).indexOf("magnitude"),o=n.map((e=>e.BandName.toLowerCase())).indexOf("direction")),-1!==a&&null!==a||(a=0,o=1);const l="arithmetic"===e.rotationType?1:2,u="flow-from"===e.flowRepresentation?0:1,p=e.visualVariables?e.visualVariables.find((e=>"Magnitude"===e.field)):new L.Z,c={magnitudeBandID:a,directionBandID:o,isUVComponents:s,referenceSystem:l,massFlowAngleRepresentation:u,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:k[e.style.toLowerCase().replace("-","_")],minimumMagnitude:p.minDataValue,maximumMagnitude:p.maxDataValue,minimumSymbolSize:p.minSize,maximumSymbolSize:p.maxSize};return i.functionArguments=c,t.convertToRFT?new J({rasterFunctionDefinition:B(i)}):i}(e,t);case"raster-shaded-relief":return function(e,t){const i=t.convertToRFT;if("elevation"!==t.dataType)return new J;const r=new J;r.functionName="Hillshade";const n="traditional"===e.hillshadeType?0:1,s="none"===e.scalingType?1:3,a={HillshadeType:n,SlopeType:s,ZFactor:e.zFactor};return 0===n&&(a.Azimuth=e.azimuth,a.Altitude=e.altitude),3===s&&(a.PSPower=e.pixelSizePower,a.PSZFactor=e.pixelSizeFactor),r.functionArguments=a,r.variableName="Raster",e.colorRamp&&(r.functionName="ShadedRelief",i?a.ColorRamp=(0,z.pM)(e.colorRamp):a.Colormap=(0,z.Jw)(e.colorRamp,256)),i?new J({rasterFunctionDefinition:B(r)}):r}(e,t);case"flow":throw new Error("Unsupported rendering rule.")}}(r,{rasterAttributeTable:t.attributeTable,pixelType:t.pixelType,dataType:t.dataType,bandProperties:t.keyProperties?.BandProperties,convertColorRampToColormap:e.version<10.6,convertToRFT:!!i?.rasterFunctionDefinition}),i):i}_addResampleRasterFunction(e){if("vector-field"!==this.layer.renderer?.type||"Resample"===e?.functionName)return e;const t="esriImageServiceDataTypeVector-UV"===this.layer.serviceDataType?7:10;let i=new J({functionName:"Resample",functionArguments:{ResamplingType:t,InputCellSize:{x:this.layer.pixelSizeX,y:this.layer.pixelSizeY}}});return i=e?.rasterFunctionDefinition?new J({rasterFunctionDefinition:B(i)}):i,G(i,e)}};(0,n._)([(0,u.Cb)()],ue.prototype,"layer",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"adjustAspectRatio",void 0),(0,n._)([(0,m.c)("adjustAspectRatio")],ue.prototype,"writeAdjustAspectRatio",null),(0,n._)([(0,u.Cb)({json:{write:!0}}),(0,C.B)("layer.bandIds")],ue.prototype,"bandIds",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"compression",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}}),(0,C.B)("layer.compressionQuality")],ue.prototype,"compressionQuality",void 0),(0,n._)([(0,m.c)("compressionQuality")],ue.prototype,"writeCompressionQuality",null),(0,n._)([(0,u.Cb)({json:{write:!0}}),(0,C.B)("layer.compressionTolerance")],ue.prototype,"compressionTolerance",void 0),(0,n._)([(0,m.c)("compressionTolerance")],ue.prototype,"writeCompressionTolerance",null),(0,n._)([(0,u.Cb)({json:{write:!0}}),(0,C.B)("layer.format")],ue.prototype,"format",void 0),(0,n._)([(0,u.Cb)({type:String,json:{read:{reader:le.c.read},write:{writer:le.c.write}}}),(0,C.B)("layer.interpolation")],ue.prototype,"interpolation",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}}),(0,C.B)("layer.noData")],ue.prototype,"noData",void 0),(0,n._)([(0,u.Cb)({type:String,json:{read:{reader:le.k.read},write:{writer:le.k.write}}}),(0,C.B)("layer.noDataInterpretation")],ue.prototype,"noDataInterpretation",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"pixelType",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"lercVersion",void 0),(0,n._)([(0,m.c)("lercVersion")],ue.prototype,"writeLercVersion",null),(0,n._)([(0,u.Cb)({type:Number})],ue.prototype,"version",null),(0,n._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"mosaicRule",null),(0,n._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"renderingRule",null),ue=(0,n._)([(0,c.j)("esri.layers.mixins.ExportImageServiceParameters")],ue);var pe=i(1231),ce=i(99514),me=i(54163),de=i(48526),he=i(88281),ye=i(75993),fe=i(80676),ge=i(67058),be=i(91219),Re=i(82526),ve=i(11282),we=i(82971);let _e=class extends T.wq{constructor(){super(...arguments),this.north=null,this.up=null,this.spatialReference=null}};(0,n._)([(0,u.Cb)({type:Number,json:{write:!0}})],_e.prototype,"north",void 0),(0,n._)([(0,u.Cb)({type:Number,json:{write:!0}})],_e.prototype,"up",void 0),(0,n._)([(0,u.Cb)({type:we.Z,json:{write:!0}})],_e.prototype,"spatialReference",void 0),_e=(0,n._)([(0,c.j)("esri.rest.support.ImageAngleResult")],_e);const Se=_e;var Ce=i(74889);let Ie=class extends T.wq{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};(0,n._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"catalogItemVisibilities",void 0),(0,n._)([(0,u.Cb)({type:Ce.default,json:{write:!0}})],Ie.prototype,"catalogItems",void 0),(0,n._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],Ie.prototype,"location",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"name",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"objectId",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"processedValues",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"properties",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"value",void 0),Ie=(0,n._)([(0,c.j)("esri.rest.support.ImageIdentifyResult")],Ie);const xe=Ie;let Fe=class extends T.wq{constructor(){super(...arguments),this.geometries=null}};(0,n._)([(0,u.Cb)({json:{write:!0}})],Fe.prototype,"geometries",void 0),Fe=(0,n._)([(0,c.j)("esri.rest.support.ImagePixelLocationResult")],Fe);const Te=Fe;let Ne=class extends T.wq{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};(0,n._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"attributes",void 0),(0,n._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],Ne.prototype,"location",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"locationId",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"rasterId",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"resolution",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"pixelValue",void 0),Ne=(0,n._)([(0,c.j)("esri.rest.support.ImageSample")],Ne);const De=Ne;let Pe=class extends T.wq{constructor(){super(...arguments),this.samples=null}};(0,n._)([(0,u.Cb)({type:[De],json:{write:!0}})],Pe.prototype,"samples",void 0),Pe=(0,n._)([(0,c.j)("esri.rest.support.ImageSampleResult")],Pe);const Oe=Pe;function je(e){const t=e?.time;if(t&&(null!=t.start||null!=t.end)){const i=[];null!=t.start&&i.push(t.start),null==t.end||i.includes(t.end)||i.push(t.end),e.time=i.join(",")}}async function Ve(e,t,i){const r=(0,ve.en)(e),n=t.geometry?[t.geometry]:[],s=await(0,Re.aX)(n),o=t.toJSON();je(o);const l=s&&s[0];(0,a.pC)(l)&&(o.geometry=l.toJSON());const u=(0,ve.cv)({...r.query,f:"json",...o});return(0,ve.lA)(u,i)}async function Me(e,t,i){const r=(0,ve.en)(e),n=t.geometry?[t.geometry]:[];return(0,Re.aX)(n).then((e=>{const n=t.toJSON(),s=e&&e[0];(0,a.pC)(s)&&(n.geometry=JSON.stringify(s.toJSON()));const o=(0,ve.cv)({...r.query,f:"json",...n}),l=(0,ve.lA)(o,i);return(0,g.default)(r.path+"/identify",l)})).then((e=>xe.fromJSON(e.data)))}function Ae(e){const{imageCoordinateSystem:t}=e;if(t){const{id:e,referenceServiceName:i}=t;return null!=e?i?{icsid:e,icsns:i}:{icsid:e}:{ics:t}}return e.toJSON()}function Je(e,t){const i=Ae(e),{icsid:r,icsns:n,wkid:s}=i;return null!=r?null==n||t?.toLowerCase().includes("/"+n.toLowerCase()+"/")?`0:${r}`:JSON.stringify(i):s?s.toString():JSON.stringify(i)}i(10158);var Ee,ze=i(4967),qe=(i(67900),i(8744),i(98732),i(6570)),Le=(i(9361),i(65091)),Ze=i(38913),ke=(i(58901),i(45091),i(57444)),Ue=(i(40330),i(98326),i(56545),i(41818)),He=i(5396),Ge=(i(75935),i(28141),i(26059)),Qe=i(36679);let Be=Ee=class extends T.wq{constructor(){super(...arguments),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new Ee((0,v.d9)({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};(0,n._)([(0,u.Cb)({type:[String],json:{name:"angleName",write:!0}})],Be.prototype,"angleNames",void 0),(0,n._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],Be.prototype,"point",void 0),(0,n._)([(0,u.Cb)({type:we.Z,json:{write:!0}})],Be.prototype,"spatialReference",void 0),(0,n._)([(0,u.Cb)({type:p.z8,json:{write:!0}})],Be.prototype,"rasterId",void 0),Be=Ee=(0,n._)([(0,c.j)("esri.rest.support.ImageAngleParameters")],Be);const We=Be;var $e,Ke=i(92835),Xe=i(33955);let Ye=$e=class extends T.wq{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.renderingRule=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(e,t,i){null!=e&&(t.geometryType=(0,Xe.Ji)(e),t[i]=e.toJSON())}clone(){return new $e((0,v.d9)({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};(0,n._)([(0,u.Cb)({types:h.qM,json:{read:Xe.im}})],Ye.prototype,"geometry",void 0),(0,n._)([(0,m.c)("geometry")],Ye.prototype,"writeGeometry",null),(0,n._)([(0,u.Cb)({type:oe,json:{write:!0}})],Ye.prototype,"mosaicRule",void 0),(0,n._)([(0,u.Cb)({type:J,json:{write:!0}})],Ye.prototype,"renderingRule",void 0),(0,n._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],Ye.prototype,"pixelSize",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ye.prototype,"raster",void 0),(0,n._)([(0,u.Cb)({type:Ke.Z,json:{read:{source:"time"},write:{target:"time"}}})],Ye.prototype,"timeExtent",void 0),Ye=$e=(0,n._)([(0,c.j)("esri.rest.support.ImageHistogramParameters")],Ye);const et=Ye;var tt;let it=tt=class extends T.wq{constructor(){super(...arguments),this.geometry=null,this.renderingRules=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(e,t,i){null!=e&&(t.geometryType=(0,Xe.Ji)(e),t[i]=JSON.stringify(e.toJSON()))}set mosaicRule(e){let t=e;t&&t.mosaicMethod&&(t=oe.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}writeMosaicRule(e,t,i){null!=e&&(t[i]=JSON.stringify(e.toJSON()))}set renderingRule(e){let t=e;t&&t.rasterFunction&&(t=J.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("renderingRule",t)}writeRenderingRule(e,t,i){null!=e&&(t[i]=JSON.stringify(e.toJSON())),e.rasterFunctionDefinition&&(t[i]=JSON.stringify(e.rasterFunctionDefinition))}writeRenderingRules(e,t,i){null!=e&&(t[i]=JSON.stringify(e.map((e=>e.rasterFunctionDefinition||e.toJSON()))))}writePixelSize(e,t,i){null!=e&&(t[i]=JSON.stringify(e))}writeTimeExtent(e,t,i){if(null!=e){const r=(0,a.pC)(e.start)?e.start.getTime():null,n=(0,a.pC)(e.end)?e.end.getTime():null;t[i]=null!=r?null!=n?`${r},${n}`:`${r}`:null}}clone(){return new tt((0,v.d9)({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};(0,n._)([(0,u.Cb)({json:{write:!0}})],it.prototype,"geometry",void 0),(0,n._)([(0,m.c)("geometry")],it.prototype,"writeGeometry",null),(0,n._)([(0,u.Cb)({type:oe,json:{write:!0}})],it.prototype,"mosaicRule",null),(0,n._)([(0,m.c)("mosaicRule")],it.prototype,"writeMosaicRule",null),(0,n._)([(0,u.Cb)({type:J,json:{write:!0}})],it.prototype,"renderingRule",null),(0,n._)([(0,m.c)("renderingRule")],it.prototype,"writeRenderingRule",null),(0,n._)([(0,u.Cb)({type:[J],json:{write:!0}})],it.prototype,"renderingRules",void 0),(0,n._)([(0,m.c)("renderingRules")],it.prototype,"writeRenderingRules",null),(0,n._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],it.prototype,"pixelSize",void 0),(0,n._)([(0,m.c)("pixelSize")],it.prototype,"writePixelSize",null),(0,n._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],it.prototype,"returnGeometry",void 0),(0,n._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],it.prototype,"returnCatalogItems",void 0),(0,n._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],it.prototype,"returnPixelValues",void 0),(0,n._)([(0,u.Cb)({type:Number,json:{write:!0}})],it.prototype,"maxItemCount",void 0),(0,n._)([(0,u.Cb)({type:Ke.Z,json:{write:{target:"time"}}})],it.prototype,"timeExtent",void 0),(0,n._)([(0,m.c)("timeExtent")],it.prototype,"writeTimeExtent",null),(0,n._)([(0,u.Cb)({json:{write:!0}})],it.prototype,"raster",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],it.prototype,"viewId",void 0),(0,n._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],it.prototype,"processAsMultidimensional",void 0),it=tt=(0,n._)([(0,c.j)("esri.rest.support.ImageIdentifyParameters")],it);const rt=it;var nt;let st=nt=class extends T.wq{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(e,t,i){t.geometries={geometryType:"esriGeometryPoint",geometries:e.map((e=>e.toJSON()))}}clone(){return new nt({geometries:this.geometries.map((e=>e.clone())),rasterId:this.rasterId})}};(0,n._)([(0,u.Cb)({type:[re.Z],json:{write:!0}})],st.prototype,"geometries",void 0),(0,n._)([(0,m.c)("geometries")],st.prototype,"writeGeometry",null),(0,n._)([(0,u.Cb)({type:p.z8,json:{write:!0}})],st.prototype,"rasterId",void 0),st=nt=(0,n._)([(0,c.j)("esri.rest.support.ImagePixelLocationParameters")],st);const at=st;var ot;let lt=ot=class extends T.wq{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(e,t,i){null!=e&&(t.geometryType=(0,Xe.Ji)(e),t[i]=e.toJSON())}set locations(e){if(e?.length){const t=new Le.Z({spatialReference:e[0].spatialReference});t.points=e.map((e=>[e.x,e.y])),this._set("locations",e),this.geometry=t}}clone(){return new ot((0,v.d9)({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};(0,n._)([(0,u.Cb)({types:h.qM,json:{read:Xe.im}})],lt.prototype,"geometry",void 0),(0,n._)([(0,m.c)("geometry")],lt.prototype,"writeGeometry",null),(0,n._)([(0,u.Cb)()],lt.prototype,"locations",null),(0,n._)([(0,u.Cb)({type:String,json:{type:le.c.jsonValues,read:le.c.read,write:le.c.write}})],lt.prototype,"interpolation",void 0),(0,n._)([(0,u.Cb)({type:oe,json:{write:!0}})],lt.prototype,"mosaicRule",void 0),(0,n._)([(0,u.Cb)({type:[String],json:{write:!0}})],lt.prototype,"outFields",void 0),(0,n._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],lt.prototype,"pixelSize",void 0),(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],lt.prototype,"raster",void 0),(0,n._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],lt.prototype,"returnFirstValueOnly",void 0),(0,n._)([(0,u.Cb)({type:Number,json:{write:!0}})],lt.prototype,"sampleDistance",void 0),(0,n._)([(0,u.Cb)({type:Number,json:{write:!0}})],lt.prototype,"sampleCount",void 0),(0,n._)([(0,u.Cb)({type:Number,json:{write:!0}})],lt.prototype,"sliceId",void 0),(0,n._)([(0,u.Cb)({type:Ke.Z,json:{read:{source:"time"},write:{target:"time"}}})],lt.prototype,"timeExtent",void 0),lt=ot=(0,n._)([(0,c.j)("esri.rest.support.ImageSampleParameters")],lt);const ut=lt;var pt=i(23808);const ct=w.Z.getLogger("esri.layers.mixins.ArcGISImageService"),mt=(0,R.w)()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"}),dt=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),ht=(0,u.Eg)(p.q9,{min:0,max:255}),yt=e=>{let t=class extends e{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._defaultServiceMosaicRule=null,this._serviceSourceType=null,this._serviceSupportsMosaicRule=null,this.rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandCount=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelSizeX=null,this.pixelSizeY=null,this.pixelFilter=null,this.raster=void 0,this.viewId=void 0,this.symbolizer=null,this.rasterAttributeTable=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new ue({layer:this}))}readDefaultServiceMosaicRule(e,t){return this._serviceSupportsMosaicRule?oe.fromJSON(t):null}readServiceSourceType(e,t){return this._isMosaicDataset(t)?"mosaic-dataset":"raster-dataset"}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.length<1||(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.forEach((t=>{e.set(t.name.toLowerCase().replace(/ /gi,"_"),t.name)})),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every((e=>"number"==typeof e)))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,i){null!=e&&"lerc"!==this.format&&(t[i]=e)}writeCompressionTolerance(e,t,i){"lerc"===this.format&&null!=e&&(t[i]=e)}get fieldsIndex(){return this.fields?new ce.Z(this.fields):null}set format(e){e&&dt.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,t){return"esriImageServiceDataTypeVector-UV"===t.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===t.serviceDataType||null!=this.pixelFilter?"lerc":"jpgpng"}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}set mosaicRule(e){let t=e;t&&t.mosaicMethod&&(t=oe.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}readMosaicRule(e,t){const i=e||t.mosaicRule;return i?oe.fromJSON(i):this._isMosaicRuleSupported(t)?oe.fromJSON(t):null}writeMosaicRule(e,t,i){let r=this.mosaicRule;const n=this.definitionExpression;r?n&&n!==r.where&&(r=r.clone(),r.where=n):n&&(r=new oe({where:n})),this._isValidCustomizedMosaicRule(r)&&(t[i]=r.toJSON())}writeNoData(e,t,i){null!=e&&"number"==typeof e&&(t[i]=ht(e))}readObjectIdField(e,t){if(!e){const i=t.fields.filter((e=>"esriFieldTypeOID"===e.type||"oid"===e.type));e=i&&i[0]&&i[0].name}return e}get parsedUrl(){return this.url?(0,S.mN)(this.url):null}set renderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("renderer",e)}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer,n=(0,f.ij)(r,i);return null==n?null:("vector-field"===n.type&&t.symbolTileSize&&!r.symbolTileSize&&(n.symbolTileSize=t.symbolTileSize),H(n)||ct.warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),n)}writeRenderer(e,t,i){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON(),"vector-field"===e.type&&(t.symbolTileSize=e.symbolTileSize)}get rasterFields(){const e=this.rasterAttributeTableFieldPrefix||"Raster.",t=new pe.Z({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),i=new pe.Z({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),r=new pe.Z({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let n=this.fields?(0,v.d9)(this.fields):[];n.push(i),this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0&&n.push(t),this.version>=10.4&&(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.some((e=>"none"===e.name.toLowerCase()))&&n.push(r),(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.filter((e=>"none"!==e.name.toLowerCase())).forEach((e=>{n.push(new pe.Z({name:"Raster.ServicePixelValue."+e.name,alias:e.name,domain:null,editable:!1,length:50,type:"string"}))})),null==this.pixelFilter||"esriImageServiceDataTypeVector-UV"!==this.serviceDataType&&"esriImageServiceDataTypeVector-MagDir"!==this.serviceDataType||(n.push(new pe.Z({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),n.push(new pe.Z({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const s=this.rasterInfo.attributeTable&&this.rasterInfo.attributeTable.fields||null;if(s&&s.length>0){const t=s.filter((e=>"esriFieldTypeOID"!==e.type&&"value"!==e.name.toLowerCase())).map((t=>{const i=(0,v.d9)(t);return i.name=e+t.name,i}));n=n.concat(t)}return n}set renderingRule(e){let t=e;t&&t.rasterFunction&&(t=J.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("renderingRule",t)}readRenderingRule(e,t){const i=t.rasterFunctionInfos;return t.renderingRule||i&&i.length&&"None"!==i[0].name?this._isRFTJson(t.renderingRule)?J.fromJSON({rasterFunctionDefinition:t.renderingRule}):J.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}writeRenderingRule(e,t,i){const r=e.toJSON();r.rasterFunctionDefinition?t[i]=r.rasterFunctionDefinition:t[i]=r}readSpatialReference(e,t){const i=e||t.extent.spatialReference;return i?we.Z.fromJSON(i):null}readPixelType(e){return mt.fromJSON(e)||e}writePixelType(e,t,i){((0,a.Wi)(this.serviceRasterInfo)||this.pixelType!==this.serviceRasterInfo.pixelType)&&(t[i]=mt.toJSON(e))}readVersion(e,t){let i=t.currentVersion;return i||(i=t.hasOwnProperty("fields")||t.hasOwnProperty("timeInfo")?10:9.3),i}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let i=e;if(!this._isPicture()&&this.renderer&&this.symbolizer&&!this.pixelFilter){const r=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(this.renderer.toJSON()),n=this._rasterJobHandler.instance,{bandIds:s}=this;if(n){r&&(this.symbolizer.bind(),await n.updateSymbolizer(this.symbolizer,t),this._cachedRendererJson=this.renderer.toJSON());const a=await n.symbolize({bandIds:s,...e},t);i={extent:e.extent,pixelBlock:a}}else i={extent:e.extent,pixelBlock:this.symbolizer.symbolize({bandIds:s,...e})}}return i}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputeAngles)throw new b.Z("imagery-layer:compute-angles","this operation is not supported on the input image service");return e=(0,p.TJ)(We,e).clone(),async function(e,t,i){const r=t.toJSON();(0,a.pC)(r.angleName)&&(r.angleName=r.angleName.join(",")),(0,a.pC)(t.point)&&t.point.spatialReference?.imageCoordinateSystem&&(r.point.spatialReference=Ae(t.point.spatialReference)),(0,a.pC)(t.spatialReference)&&t.spatialReference.imageCoordinateSystem&&(r.spatialReference=Je(t.spatialReference));const n=(0,ve.en)(e),s=(0,ve.cv)({...n.query,f:"json",...r}),o=(0,ve.lA)(s,i),{data:l}=await(0,g.default)(`${n.path}/computeAngles`,o);return l.spatialReference=l.spatialReference?null!=l.spatialReference.geodataXform?new we.Z({wkid:0,imageCoordinateSystem:l.spatialReference}):we.Z.fromJSON(l.spatialReference):null,"NaN"===l.north&&(l.north=null),"NaN"===l.up&&(l.up=null),new Se(l)}(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputePixelLocation)throw new b.Z("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return e=(0,p.TJ)(at,e).clone(),async function(e,t,i){const r=t.toJSON(),{geometries:n}=t;for(let e=0;e<n.length;e++)n[e].spatialReference?.imageCoordinateSystem&&(r.geometries.geometries[e].spatialReference=Ae(n[e].spatialReference));const s=(0,ve.en)(e),a=(0,ve.cv)({...s.query,f:"json",...r}),o=(0,ve.lA)(a,i),{data:l}=await(0,g.default)(`${s.path}/computePixelLocation`,o);return Te.fromJSON(l)}(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputeHistograms)throw new b.Z("imagery-layer:compute-histograms","this operation is not supported on the input image service");e=(0,p.TJ)(et,e).clone();const{raster:i,mosaicRule:r,renderingRule:n}=this;return n&&null==e.renderingRule&&(e.renderingRule=n),r&&null==e.mosaicRule&&(e.mosaicRule=r),i&&null==e.raster&&(e.raster=i),async function(e,t,i){const r=await Ve(e,t,i),n=(0,ve.en)(e),{data:s}=await(0,g.default)(`${n.path}/computeHistograms`,r);return{histograms:s.histograms}}(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputeStatisticsHistograms)throw new b.Z("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");e=(0,p.TJ)(et,e).clone();const{raster:i,mosaicRule:r,renderingRule:n}=this;return n&&null==e.renderingRule&&(e.renderingRule=n),r&&null==e.mosaicRule&&(e.mosaicRule=r),i&&null==e.raster&&(e.raster=i),async function(e,t,i){const r=await Ve(e,t,i),n=(0,ve.en)(e),{data:s}=await(0,g.default)(`${n.path}/computeStatisticsHistograms`,r),{statistics:a}=s;return a?.length&&a.forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:a,histograms:s.histograms}}(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return(0,a.pC)(t)?t.get(e):void 0}getFieldDomain(e,t){const i=this.getField(e);return i?i.domain:null}fetchImage(e,t,i,r={}){if(null==e||null==t||null==i)return Promise.reject(new b.Z("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required."));const n=this.renderer||this.symbolizer?this.generateRasterInfo(this.renderingRule,{signal:r.signal}):null;return(0,l.gx)(n).then((n=>{n&&(this.rasterInfo=n);const s={imageServiceParameters:this.getExportImageServiceParameters(e,t,i,r.timeExtent),imageProps:{extent:e,width:t,height:i,format:this.format},requestAsImageElement:r.requestAsImageElement&&!this.pixelFilter||!1,signal:r.signal};return this._requestArrayBuffer(s)}))}fetchKeyProperties(e){return(0,g.default)(this.parsedUrl.path+"/keyProperties",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.renderingRule:null})}).then((e=>e.data))}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new b.Z("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):(0,g.default)(this.parsedUrl.path+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.renderingRule:null})}).then((e=>Ce.default.fromJSON(e.data)))}getCatalogItemRasterInfo(e,t){const i={...t,query:this._getQueryParams()};return async function(e,t,i){const r=(0,ve.en)(e),n=(0,ve.cv)({...r.query,f:"json"}),s=(0,ve.lA)(n,i),a=`${r.path}/${t}/info`,o=(0,g.default)(`${a}`,s),l=(0,g.default)(`${a}/keyProperties`,s),u=await Promise.allSettled([o,l]),p="fulfilled"===u[0].status?u[0].value.data:null,c="fulfilled"===u[1].status?u[1].value.data:null;let m=null;p.statistics?.length&&(m=p.statistics.map((e=>({min:e[0],max:e[1],avg:e[2],stddev:e[3]}))));const d=qe.Z.fromJSON(p.extent),h=Math.ceil(d.width/p.pixelSizeX-.1),y=Math.ceil(d.height/p.pixelSizeY-.1),f=d.spatialReference,b=new re.Z({x:p.pixelSizeX,y:p.pixelSizeY,spatialReference:f}),R=p.histograms?.length?p.histograms:null,v=new Qe.Z({origin:p.origin,blockWidth:p.blockWidth,blockHeight:p.blockHeight,firstPyramidLevel:p.firstPyramidLevel,maximumPyramidLevel:p.maxPyramidLevel});return new de.Z({width:h,height:y,bandCount:p.bandCount,extent:d,spatialReference:f,pixelSize:b,pixelType:p.pixelType.toLowerCase(),statistics:m,histograms:R,keyProperties:c,storageInfo:v})}(this.parsedUrl.path,e,i)}async getCatalogItemICSInfo(e,t){const{data:i}=await(0,g.default)(this.parsedUrl.path+"/"+e+"/info/ics",{query:this._getQueryParams(),...t}),r=i&&i.ics;if(!r)return;let n=null;try{n=(await(0,g.default)(this.parsedUrl.path+"/"+e+"/info",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!n||!n.spatialReference)return{ics:r,icsToPixelTransform:null,icsExtent:null,northDirection:null};const s=this.version>=10.7?(0,g.default)(this.parsedUrl.path+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...t}).then((e=>e.data)).catch((()=>({}))):{},a=n.spatialReference,o={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[n]}),inSR:a.wkid||JSON.stringify(a),outSR:"0:"+e},l=(0,g.default)(this.parsedUrl.path+"/project",{query:this._getQueryParams(o),...t}).then((e=>e.data)).catch((()=>({}))),u=(n.xmin+n.xmax)/2,p=(n.ymax-n.ymin)/6,c=n.ymin+p,m=[];for(let e=0;e<5;e++)m.push({x:u,y:c+p*e});const d={geometries:JSON.stringify({geometryType:"esriGeometryPoint",geometries:m}),inSR:a.wkid||JSON.stringify(a),outSR:"0:"+e},h=(0,g.default)(this.parsedUrl.path+"/project",{query:this._getQueryParams(d),...t}).then((e=>e.data)).catch((()=>({}))),y=await Promise.all([s,l,h]);let f=y[0].ipxf;if(null==f){const e=r.geodataXform?.xf_0;"topup"===e?.name?.toLowerCase()&&6===e?.coefficients?.length&&(f={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:e.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const b=qe.Z.fromJSON(y[1]&&y[1].geometries&&y[1].geometries[0]);b&&(b.spatialReference=new we.Z({wkid:0,imageCoordinateSystem:r}));const R=y[2].geometries?y[2].geometries.filter((e=>null!=e&&null!=e.x&&null!=e.y&&"NaN"!==e.x&&"NaN"!==e.y)):[],v=R.length;if(v<3)return{ics:r,icsToPixelTransform:f,icsExtent:b,northDirection:null};let w=0,_=0,S=0,C=0;for(let e=0;e<v;e++)w+=R[e].x,_+=R[e].y,S+=R[e].x*R[e].x,C+=R[e].x*R[e].y;const I=(v*C-w*_)/(v*S-w*w);let x=0;const F=R[4].x>R[0].x,T=R[4].y>R[0].y;return I===1/0?x=T?90:270:0===I?x=F?0:180:I>0?x=F?180*Math.atan(I)/Math.PI:180*Math.atan(I)/Math.PI+180:I<0&&(x=T?180+180*Math.atan(I)/Math.PI:360+180*Math.atan(I)/Math.PI),{ics:r,icsToPixelTransform:f,icsExtent:b,northDirection:x}}async generateRasterInfo(e,t){if((!e||"none"===e?.functionName?.toLowerCase()||this._isVectorFieldResampleFunction(e))&&(0,a.pC)(this.serviceRasterInfo))return this.serviceRasterInfo;const i=function(e){if(!e)return null;const t=JSON.stringify(e).match(/"rasterFunction":"(.*?")/gi)?.map((e=>e.replace('"rasterFunction":"',"").replace('"',"")));return t?t.join("/"):null}(e);if(this._functionRasterInfos[i])return this._functionRasterInfos[i];const r=this._generateRasterInfo(e,t);this._functionRasterInfos[i]=r;try{return await r}catch{return this._functionRasterInfos[i]=null,null}}getExportImageServiceParameters(e,t,i,r){const n=Je((e=e.clone().shiftCentralMeridian()).spatialReference,this.parsedUrl.path);(0,a.pC)(this.serviceRasterInfo)&&this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const s=this.exportImageServiceParameters.toJSON(),{bandIds:o,noData:l}=s;let{renderingRule:u}=s;const p=this.renderingRule?.rasterFunctionDefinition,c=!this.renderer||"raster-stretch"===this.renderer.type;if(o?.length&&this._hasRenderingRule(this.renderingRule)&&!p&&c){const e={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:o}};if("Stretch"===u.rasterFunction)e.rasterFunctionArguments.Raster=u.rasterFunctionArguments.Raster,u.rasterFunctionArguments.Raster=e;else if("Colormap"===u.rasterFunction){const t=u.rasterFunctionArguments.Raster;"Stretch"===t?.rasterFunction?(e.rasterFunctionArguments.Raster=t.rasterFunctionArguments.Raster,t.rasterFunctionArguments.Raster=e):(e.rasterFunctionArguments.Raster=t,u.rasterFunctionArguments.Raster=e)}else e.rasterFunctionArguments.Raster=u,u=e;s.bandIds=void 0}else s.bandIds=o?.join(",");l instanceof Array&&l.length>0&&(s.noData=l.join(","));const m=this._serviceSupportsMosaicRule?this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,r):null;s.mosaicRule=m&&JSON.stringify(m),s.renderingRule=this._getRenderingRuleString(J.fromJSON(u));const d={};if(r){const{start:e,end:t}=r.toJSON();e&&t&&e===t?d.time=""+e:null==e&&null==t||(d.time=`${null==e?"null":e},${null==t?"null":t}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:n,imageSR:n,size:t+","+i,...s,...d}}async getSamples(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsGetSamples)throw new b.Z("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=(0,p.TJ)(ut,e).clone();const{raster:i}=this;return i&&null==e.raster&&(e.raster=i),async function(e,t,i){const r=t.toJSON();je(r),r.outFields?.length&&(r.outFields=r.outFields.join(","));const n=(await(0,Re.aX)(t.geometry))?.[0];(0,a.pC)(n)&&(r.geometry=n.toJSON());const s=(0,ve.en)(e),o=(0,ve.cv)({...s.query,f:"json",...r}),l=(0,ve.lA)(o,i),{data:u}=await(0,g.default)(`${s.path}/getSamples`,l),p=u?.samples?.map((e=>{const t="NaN"===e.value||""===e.value?null:e.value.split(" ").map((e=>Number(e)));return{...e,pixelValue:t}}));return Oe.fromJSON({samples:p})}(this.url,e,this._getRequestOptions(t))}async identify(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsIdentify)throw new b.Z("imagery-layer:query-rasters","query operation is not supported on the input image service");e=(0,p.TJ)(rt,e).clone();const{raster:i,mosaicRule:r,renderingRule:n}=this;if(n&&null==e.renderingRule&&(e.renderingRule=n),r&&null==e.mosaicRule){const t=this._combineMosaicRuleWithTimeExtent(r,e.timeExtent);e.mosaicRule=(0,a.Wg)(t)}return i&&null==e.raster&&(e.raster=i),Me(this.url,e,this._getRequestOptions(t))}createQuery(){const e=new ke.Z;return e.outFields=["*"],e.returnGeometry=!0,e.where=this.definitionExpression||"1=1",e}async queryRasters(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),(0,ze.e)(this.url,e,t)}async queryObjectIds(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),(0,He.G)(this.url,e,t)}async queryRasterCount(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),(0,Ue.P)(this.url,e,t)}async queryVisibleRasters(e,t){if(!e)throw new b.Z("imagery-layer: query-visible-rasters","missing query parameter");const{pixelSize:i,returnDomainValues:r,returnTopmostRaster:n,showNoDataRecords:s}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let o=!1,l=null,u=null;const p="raster.servicepixelvalue",c=this.rasterFunctionNamesIndex;if((0,a.pC)(e.outFields)&&(o=e.outFields.some((e=>!e.toLowerCase().includes(p))),this.version>=10.4)){const t=e.outFields.filter((e=>e.toLowerCase().includes(p)&&e.length>p.length)).map((e=>{const t=e.slice(p.length+1);return[this._updateRenderingRulesFunctionName(t,c),t]}));l=t.map((e=>new J({functionName:e[0]}))),u=t.map((e=>e[1])),0===l.length?this.renderingRule?(l.push(this.renderingRule),u.push(this.renderingRule.functionName)):l=null:this.renderingRule&&!l.some((e=>e.functionName===this.renderingRule.functionName))&&(l.push(this.renderingRule),u.push(this.renderingRule.functionName))}const m=(0,a.Wi)(e.outSpatialReference)||e.outSpatialReference.equals(this.spatialReference),d=e.timeExtent||this.timeExtent,h=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,d),y=this._getQueryParams({geometry:e.geometry,timeExtent:d,mosaicRule:h,renderingRule:this.version<10.4?this.renderingRule:null,renderingRules:l,pixelSize:i,returnCatalogItems:o,returnGeometry:m,raster:this.raster,maxItemCount:n?1:null});delete y.f;const f=new rt(y);try{await this.generateRasterInfo(this.renderingRule);const i=await Me(this.url,f,{signal:t?.signal,query:{...this.customParameters}}),n=e.outFields,l=i.value.toLowerCase().includes("nodata");if(!o||m||!i?.catalogItems?.features.length||!s&&l)return this._processVisibleRastersResponse(i,{returnDomainValues:r,templateRRFunctionNames:u,showNoDataRecords:s,templateFields:n});const p=this.objectIdField||"ObjectId",c=i.catalogItems.features,d=c.map((e=>e.attributes?.[p])),h=new ke.Z({objectIds:d,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[p]}),y=await this.queryRasters(h);return y?.features?.length&&y.features.forEach((t=>{c.forEach((i=>{i.attributes[p]===t.attributes[p]&&(i.geometry=new Ze.Z(t.geometry),(0,a.pC)(e.outSpatialReference)&&(i.geometry.spatialReference=e.outSpatialReference))}))})),this._processVisibleRastersResponse(i,{returnDomainValues:r,templateRRFunctionNames:u,showNoDataRecords:s,templateFields:n})}catch{throw new b.Z("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,t){const i=(0,g.default)(this.parsedUrl.path+"/statistics",{query:this._getQueryParams({variable:e}),signal:t}).then((e=>e.data?.statistics)),r=(0,g.default)(this.parsedUrl.path+"/histograms",{query:this._getQueryParams({variable:e}),signal:t}).then((e=>e.data?.histograms)),n=await Promise.all([i,r]);return n[0]&&n[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:n[0]||null,histograms:n[1]||null}}async createStreamlinesMesh(e,t){const i=this._rasterJobHandler.instance;return i?i.createStreamlinesMesh(e,t):(0,pt.z_)(e.rendererSettings,e.flowData,(0,a.pC)(t.signal)?t.signal:(new AbortController).signal)}async _fetchService(e){await this._fetchServiceInfo(e),(0,a.pC)(this.serviceRasterInfo)&&!this.rasterInfo&&(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,i=(0,a.pC)(this.serviceRasterInfo)?Promise.resolve(this.serviceRasterInfo):(0,Ge.g)(this.parsedUrl.path,t,{signal:e,query:this._getQueryParams()}).then((e=>(this._set("serviceRasterInfo",e),e))),r=this._hasRenderingRule(this.renderingRule)?this.generateRasterInfo(this.renderingRule,{signal:e}):null,n=this._getRasterFunctionInfos();return Promise.all([i,r,n]).then((e=>{e[1]?this._set("rasterInfo",e[1]):this._set("rasterInfo",e[0]),e[2]&&this._set("rasterFunctionInfos",e[2]),this.renderer&&!this._isSupportedRenderer(this.renderer)&&(this._set("renderer",null),ct.warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("renderer",this._configRenderer(this.renderer)),this.own((0,_.YP)((()=>this.renderingRule),(e=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this.generateRasterInfo(e).then((e=>{e&&(this.rasterInfo=e)}))})));const t=(0,a.pC)(this.serviceRasterInfo)&&this.serviceRasterInfo.multidimensionalInfo;t&&this._updateMultidimensionalDefinition(t)}))}_combineMosaicRuleWithTimeExtent(e,t){const i=this.timeInfo;if((0,a.Wi)(e)||(0,a.Wi)(this.multidimensionalInfo)||(0,a.Wi)(t)||(0,a.Wi)(i?.startField))return e;const{startField:r}=i;if(e=e.clone(),"mosaic-dataset"===this._serviceSourceType)return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter((e=>e.dimensionName!==r)),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const n=e.multidimensionalDefinition.filter((e=>e.dimensionName===r)),s=(0,a.pC)(t.start)?t.start.getTime():null,o=(0,a.pC)(t.end)?t.end.getTime():null,l=null==s||null==o||s===o,u=l?[s||o]:[[s,o]],p=this.version>=10.8;if(n.length)n.forEach((e=>{e.dimensionName===r&&(p?(e.dimensionName=null,e.isSlice=null,e.values=null):(e.isSlice=l,e.values=u))}));else if(!p){const t=e.multidimensionalDefinition.filter((e=>null!=e.variableName&&null==e.dimensionName));t.length?t.forEach((e=>{e.dimensionName=r,e.isSlice=l,e.values=u})):e.multidimensionalDefinition.push(new F.Z({variableName:"",dimensionName:r,isSlice:l,values:u}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return(0,a.Wi)(e)?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter((e=>!(!e.variableName&&!e.dimensionName))),0===e.multidimensionalDefinition.length&&(e.multidimensionalDefinition=null)),"mosaic-dataset"!==this._serviceSourceType&&null==e.multidimensionalDefinition?null:e)}async _prepareForQuery(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsQuery)throw new b.Z("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=(0,a.pC)(e)?(0,p.TJ)(ke.Z,e):this.createQuery(),t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:e,requestOptions:t}}async _initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new he.Z;this._rasterJobHandler.connectionPromise=e.initialize().then((()=>{this._rasterJobHandler.instance=e}),(()=>null)),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0}_isSupportedRenderer(e){const{rasterInfo:t,renderingRule:i}=this;return"unique-value"===e.type&&this._hasRenderingRule(i)&&1===t.bandCount&&["u8","s8"].includes(t.pixelType)||(0,ge.U0)(this.rasterInfo).includes(this.renderer.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let t=this.sourceJSON;if(!t){const{data:i,ssl:r}=await(0,g.default)(this.parsedUrl.path,{query:this._getQueryParams(),signal:e});t=i,this.sourceJSON=t,r&&(this.url=this.url.replace(/^http:/i,"https:"))}if(t.capabilities?.toLowerCase().split(",").map((e=>e.trim())).indexOf("tilesonly")>-1)throw new b.Z("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(t,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?"esriImageServiceSourceTypeMosaicDataset"===e.serviceSourceType:e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;const t=this._isMosaicDataset(e),i=e.currentVersion>=10.71&&e.hasMultidimensions&&e.timeInfo&&!(e.objectIdField&&e.fields?.length>1);return t||i}_isVectorFieldResampleFunction(e){if((0,a.Wi)(e))return!1;const{functionName:t,functionArguments:i}=e,r="resample"===t?.toLowerCase(),n=i?.ResampleType||i?.resampleType;return r&&(7===n||10===n)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){if(!this._isPicture()&&!this.pixelFilter){if(!this.bandIds&&this.rasterInfo.bandCount>=3){const e=(0,ge.YD)(this.rasterInfo);!e||3===this.rasterInfo.bandCount&&0===e[0]&&1===e[1]&&2===e[2]||(this.bandIds=e)}e||(e=(0,ge.Ob)(this.rasterInfo,{bandIds:this.bandIds,variableName:this.renderingRule?null:this.mosaicRule?.multidimensionalDefinition?.[0].variableName}));const t=(0,ge.ol)(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=t,this.symbolizer.rasterInfo=this.rasterInfo):this.symbolizer=new be.Z({rendererJSON:t,rasterInfo:this.rasterInfo}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return null==e?e:{extent:e.extent&&e.extent.clone(),pixelBlock:(0,a.pC)(e.pixelBlock)&&e.pixelBlock.clone()}}_getQueryParams(e){(0,a.pC)(e?.renderingRule)&&"string"!=typeof e.renderingRule&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:t,viewId:i}=this;return{raster:t,viewId:i,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,t,i){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:t}):(0,ye.J)(e,t,i)}async _getRasterFunctionInfos(e){const t=this.sourceJSON.rasterFunctionInfos;return this.serviceRasterInfo?t:t&&this.version>=10.3?1===t.length&&"none"===t[0].name.toLowerCase()?t:(await(0,g.default)(this.parsedUrl.path+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e})).data?.rasterFunctionInfos:null}async _requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:i,signal:r}=e;if(i&&!this.pixelFilter&&t.format?.indexOf("png")>-1)return{imageElement:(await(0,g.default)(this.parsedUrl.path+"/exportImage",{responseType:"image",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:r})).data,params:t};const n=this._initJobHandler(),s=(0,g.default)(this.parsedUrl.path+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:r}),a=(await Promise.all([s,n]))[0].data,o=t.format||"jpgpng";let l=o;if("bsq"!==l&&"bip"!==l&&(l=(0,ye.y)(a)),!l)throw new b.Z("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(a)));const u={signal:r},p="gif"===o||"bmp"===o||o.includes("png")&&("png"===l||"jpg"===l)?(0,ye.J)(a,{useCanvas:!0,...t},u):this._decodePixelBlock(a,{width:t.width,height:t.height,planes:null,pixelType:null,noDataValue:null,format:o},u);return{pixelData:{pixelBlock:await p,extent:t.extent},params:t}}_generateRasterInfo(e,t){const i={...t,query:this._getQueryParams()};return(0,Ge.N)(this.parsedUrl.path,e,i)}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this._defaultServiceMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;const t=e.variables[0].dimensions,i=[];for(const e in t)if(t.hasOwnProperty(e)){const r=t[e],n=r.extent;let s=!0,a=[n[0]];r.hasRanges&&!0===r.hasRanges?(s=!1,a=[r.values[0]]):"stdz"===r.name.toLowerCase()&&Math.abs(n[1])<=Math.abs(n[0])&&(a=[n[1]]),i.push(new F.Z({variableName:"",dimensionName:t[e].name,isSlice:s,values:a}))}if(i.length>0){this.mosaicRule=this.mosaicRule||new oe;const e=this.mosaicRule.multidimensionalDefinition;(!e||e&&e.length<=0)&&(this.mosaicRule.multidimensionalDefinition=i)}}_processVisibleRastersResponse(e,t){t=t||{};const i=e.value,{templateRRFunctionNames:r,showNoDataRecords:n,returnDomainValues:s,templateFields:o}=t,l=e.processedValues;let u=e.catalogItems&&e.catalogItems.features,p=e.properties&&e.properties.Values&&e.properties.Values.map((e=>e.replace(/ /gi,", ")))||[];const c=this.objectIdField||"ObjectId",m="string"==typeof i&&i.toLowerCase().includes("nodata"),d=[];if(i&&!u&&!m){const e={};e[c]=0,p=[i],u=[new y.Z(this.fullExtent,null,e)]}if(!u)return[];let h,f,g;this._updateResponseFieldNames(u,o),m&&!n&&(u=[]);for(let e=0;e<u.length;e++){if(h=u[e],null!=i){if(f=p[e],g=this.renderingRule&&l&&l.length>0&&r&&r.length>0&&r.includes(this.renderingRule.functionName)?l[r.indexOf(this.renderingRule.functionName)]:i,"nodata"===f.toLowerCase()&&!n)continue;const t="Raster.ItemPixelValue",s="Raster.ServicePixelValue";h.attributes[t]=f,h.attributes[s]=g,this._updateFeatureWithMagDirValues(h,f);const o=this.fields&&this.fields.length>0;let u=this.renderingRule&&(0,a.pC)(this.serviceRasterInfo)&&this.serviceRasterInfo.attributeTable?o?f:i:g;this.renderingRule||(u=o?f:i),this._updateFeatureWithRasterAttributeTableValues(h,u)}if(h.sourceLayer=h.layer=this,s&&this._updateFeatureWithDomainValues(h),r&&l&&r.length===l.length)for(let e=0;e<r.length;e++){const t="Raster.ServicePixelValue."+r[e];h.attributes[t]=l[e]}d.push(u[e])}return d}_updateFeatureWithRasterAttributeTableValues(e,t){const i=this.rasterInfo&&this.rasterInfo.attributeTable||(0,a.pC)(this.serviceRasterInfo)&&this.serviceRasterInfo.attributeTable,r=i&&i.features;if(!r)return;const n=i.fields,s=n.map((e=>e.name)).filter((e=>"value"===e.toLowerCase())),o=s&&s[0];if(!o)return;const l=r.filter((e=>e.attributes[o]===(null!=t?parseInt(t,10):null)));l&&l[0]&&n.forEach((t=>{const i=this.rasterAttributeTableFieldPrefix+t.name;e.attributes[i]=l[0].attributes[t.name]}))}_updateFeatureWithMagDirValues(e,t){if("esriImageServiceDataTypeVector-UV"!==this.serviceDataType&&"esriImageServiceDataTypeVector-MagDir"!==this.serviceDataType)return;const i=t.split(/,\s*/).map((e=>parseFloat(e))),r=i.map((e=>[e])),n=i.map((e=>({minValue:e,maxValue:e,noDataValue:null}))),s=new me.Z({height:1,width:1,pixelType:"f32",pixels:r,statistics:n});null!=this.pixelFilter&&this.pixelFilter({pixelBlock:s,extent:new qe.Z(0,0,0,0,this.spatialReference)});const a="esriImageServiceDataTypeVector-MagDir"===this.serviceDataType?[s.pixels[0][0],s.pixels[1][0]]:(0,fe.Tg)([s.pixels[0][0],s.pixels[1][0]]);e.attributes["Raster.Magnitude"]=a[0],e.attributes["Raster.Direction"]=a[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter((e=>e.domain&&"coded-value"===e.domain.type));null!=t&&t.forEach((t=>{const i=e.attributes[t.name];if(null!=i){const r=t.domain.codedValues.find((e=>e.code===i));r&&(e.attributes[t.name]=r.name)}}))}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const i=this.fieldsIndex;(0,a.Wi)(i)||e.forEach((e=>{if(e&&e.attributes)for(const r of t)if(i.has(r)){const t=i.get(r).name;t!==r&&(e.attributes[r]=e.attributes[t],delete e.attributes[t])}}))}_getRenderingRuleString(e){if(this._hasRenderingRule(e)){let t=e.toJSON();return t=t.rasterFunctionDefinition??t,(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=null),JSON.stringify(t)}return null}_hasRenderingRule(e){return e&&e.functionName&&"none"!==e.functionName.toLowerCase()}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if("Raw"===e)return e.replace("Raw","None");const i=e.toLowerCase().replace(/ /gi,"_");return t.has(i)?t.get(i):e}_isRFTJson(e){return e&&e.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_readCapabilities(e){const t=e.capabilities?e.capabilities.toLowerCase().split(",").map((e=>e.trim())):["image","catalog"],{currentVersion:i,advancedQueryCapabilities:r,maxRecordCount:n}=e,s=t.includes("image"),a="esriImageServiceDataTypeElevation"===e.serviceDataType,o=!!(e.spatialReference||e.extent&&e.extent.spatialReference),l=t.includes("edit");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:s,supportsExportImage:s,supportsIdentify:s,supportsMeasure:t.includes("mensuration")&&o,supportsDownload:t.includes("download"),supportsQuery:t.includes("catalog")&&e.fields&&e.fields.length>0,supportsGetSamples:i>=10.2&&s,supportsProject:i>=10.3&&s,supportsComputeStatisticsHistograms:i>=10.4&&s,supportsQueryBoundary:i>=10.6&&s,supportsCalculateVolume:i>=10.7&&a,supportsComputePixelLocation:i>=10.7&&t.includes("catalog"),supportsComputeAngles:i>=10.91,supportsAdd:l,supportsDelete:l,supportsEditing:l,supportsUpdate:l,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1},query:{maxRecordCount:n,maxRecordCountFactor:void 0,supportsStatistics:!!r?.supportsStatistics,supportsOrderBy:!!r?.supportsOrderBy,supportsDistinct:!!r?.supportsDistinct,supportsPagination:!!r?.supportsPagination,supportsStandardizedQueriesOnly:!!r?.useStandardizedQueries,supportsPercentileStatistics:!!r?.supportsPercentileStatistics,supportsCentroid:!!r?.supportsReturningGeometryCentroid,supportsDistance:!!r?.supportsQueryWithDistance,supportsExtent:!!r?.supportsReturningQueryExtent,supportsGeometryProperties:!!r?.supportsReturningGeometryProperties,supportsHavingClause:!!r?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!r?.supportsDefaultSR,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}}}};return(0,n._)([(0,u.Cb)()],t.prototype,"_functionRasterInfos",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"_rasterJobHandler",void 0),(0,n._)([(0,u.Cb)({dependsOn:["_serviceSupportsMosaicRule"]})],t.prototype,"_defaultServiceMosaicRule",void 0),(0,n._)([(0,I.r)("_defaultServiceMosaicRule",["defaultMosaicMethod"])],t.prototype,"readDefaultServiceMosaicRule",null),(0,n._)([(0,u.Cb)()],t.prototype,"_cachedRendererJson",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],t.prototype,"_serviceSourceType",void 0),(0,n._)([(0,I.r)("_serviceSourceType",["serviceSourceType","fields"])],t.prototype,"readServiceSourceType",null),(0,n._)([(0,u.Cb)({readOnly:!0})],t.prototype,"_serviceSupportsMosaicRule",void 0),(0,n._)([(0,I.r)("_serviceSupportsMosaicRule",["currentVersion","fields"])],t.prototype,"readServiceSupportsMosaicRule",null),(0,n._)([(0,u.Cb)()],t.prototype,"rasterAttributeTableFieldPrefix",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],t.prototype,"rasterFunctionNamesIndex",null),(0,n._)([(0,u.Cb)()],t.prototype,"adjustAspectRatio",void 0),(0,n._)([(0,u.Cb)({readOnly:!0}),(0,C.B)("serviceRasterInfo.bandCount")],t.prototype,"bandCount",void 0),(0,n._)([(0,u.Cb)({type:[p.z8],json:{write:!0}})],t.prototype,"bandIds",void 0),(0,n._)([(0,I.r)("bandIds")],t.prototype,"readBandIds",null),(0,n._)([(0,u.Cb)({readOnly:!0,json:{read:!1}})],t.prototype,"capabilities",void 0),(0,n._)([(0,I.r)("service","capabilities",["capabilities","currentVersion","serviceDataType"])],t.prototype,"readCapabilities",null),(0,n._)([(0,u.Cb)({type:Number})],t.prototype,"compressionQuality",void 0),(0,n._)([(0,m.c)("compressionQuality")],t.prototype,"writeCompressionQuality",null),(0,n._)([(0,u.Cb)({type:Number})],t.prototype,"compressionTolerance",void 0),(0,n._)([(0,m.c)("compressionTolerance")],t.prototype,"writeCompressionTolerance",null),(0,n._)([(0,u.Cb)({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),(0,n._)([(0,u.Cb)({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],t.prototype,"definitionExpression",void 0),(0,n._)([(0,u.Cb)({readOnly:!0,constructOnly:!0})],t.prototype,"exportImageServiceParameters",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"rasterInfo",void 0),(0,n._)([(0,u.Cb)({readOnly:!0,type:[pe.Z]})],t.prototype,"fields",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],t.prototype,"fieldsIndex",null),(0,n._)([(0,u.Cb)({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"],json:{write:!0}})],t.prototype,"format",null),(0,n._)([(0,I.r)("service","format",["serviceDataType"])],t.prototype,"readFormat",null),(0,n._)([(0,u.Cb)({type:qe.Z})],t.prototype,"fullExtent",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],t.prototype,"hasMultidimensions",void 0),(0,n._)([(0,u.Cb)({json:{read:{source:"maxImageHeight"}}})],t.prototype,"imageMaxHeight",void 0),(0,n._)([(0,u.Cb)({json:{read:{source:"maxImageWidth"}}})],t.prototype,"imageMaxWidth",void 0),(0,n._)([(0,u.Cb)({type:String,json:{type:le.c.jsonValues,read:le.c.read,write:le.c.write}})],t.prototype,"interpolation",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"minScale",void 0),(0,n._)([(0,I.r)("service","minScale")],t.prototype,"readMinScale",null),(0,n._)([(0,u.Cb)()],t.prototype,"maxScale",void 0),(0,n._)([(0,I.r)("service","maxScale")],t.prototype,"readMaxScale",null),(0,n._)([(0,u.Cb)({type:oe})],t.prototype,"mosaicRule",null),(0,n._)([(0,I.r)("mosaicRule",["mosaicRule","defaultMosaicMethod"])],t.prototype,"readMosaicRule",null),(0,n._)([(0,m.c)("mosaicRule")],t.prototype,"writeMosaicRule",null),(0,n._)([(0,u.Cb)({readOnly:!0}),(0,C.B)("serviceRasterInfo.multidimensionalInfo")],t.prototype,"multidimensionalInfo",void 0),(0,n._)([(0,u.Cb)({json:{type:p.z8}})],t.prototype,"noData",void 0),(0,n._)([(0,m.c)("noData")],t.prototype,"writeNoData",null),(0,n._)([(0,u.Cb)({type:String,json:{type:le.k.jsonValues,read:le.k.read,write:le.k.write}})],t.prototype,"noDataInterpretation",void 0),(0,n._)([(0,u.Cb)({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],t.prototype,"objectIdField",void 0),(0,n._)([(0,I.r)("objectIdField")],t.prototype,"readObjectIdField",null),(0,n._)([(0,u.Cb)({})],t.prototype,"geometryType",void 0),(0,n._)([(0,u.Cb)({})],t.prototype,"typeIdField",void 0),(0,n._)([(0,u.Cb)({})],t.prototype,"types",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],t.prototype,"parsedUrl",null),(0,n._)([(0,u.Cb)({readOnly:!0}),(0,C.B)("serviceRasterInfo.pixelSize.x")],t.prototype,"pixelSizeX",void 0),(0,n._)([(0,u.Cb)({readOnly:!0}),(0,C.B)("serviceRasterInfo.pixelSize.y")],t.prototype,"pixelSizeY",void 0),(0,n._)([(0,u.Cb)({type:Function})],t.prototype,"pixelFilter",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"raster",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"viewId",void 0),(0,n._)([(0,u.Cb)({types:f.dr,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:f.FK,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],t.prototype,"renderer",null),(0,n._)([(0,I.r)("renderer")],t.prototype,"readRenderer",null),(0,n._)([(0,m.c)("renderer")],t.prototype,"writeRenderer",null),(0,n._)([(0,u.Cb)()],t.prototype,"symbolizer",void 0),(0,n._)([(0,u.Cb)(x.Oh)],t.prototype,"opacity",void 0),(0,n._)([(0,u.Cb)({readOnly:!0}),(0,C.B)("serviceRasterInfo.attributeTable")],t.prototype,"rasterAttributeTable",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],t.prototype,"rasterFields",null),(0,n._)([(0,u.Cb)({constructOnly:!0})],t.prototype,"rasterFunctionInfos",void 0),(0,n._)([(0,u.Cb)({type:J})],t.prototype,"renderingRule",null),(0,n._)([(0,I.r)("renderingRule",["renderingRule","rasterFunctionInfos"])],t.prototype,"readRenderingRule",null),(0,n._)([(0,m.c)("renderingRule")],t.prototype,"writeRenderingRule",null),(0,n._)([(0,u.Cb)()],t.prototype,"serviceDataType",void 0),(0,n._)([(0,u.Cb)({readOnly:!0,type:we.Z})],t.prototype,"spatialReference",void 0),(0,n._)([(0,I.r)("spatialReference",["spatialReference","extent"])],t.prototype,"readSpatialReference",null),(0,n._)([(0,u.Cb)({json:{type:mt.jsonValues}})],t.prototype,"pixelType",void 0),(0,n._)([(0,I.r)("pixelType")],t.prototype,"readPixelType",null),(0,n._)([(0,m.c)("pixelType")],t.prototype,"writePixelType",null),(0,n._)([(0,u.Cb)({constructOnly:!0,type:de.Z})],t.prototype,"serviceRasterInfo",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"sourceJSON",void 0),(0,n._)([(0,u.Cb)(x.HQ)],t.prototype,"url",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],t.prototype,"version",void 0),(0,n._)([(0,I.r)("version",["currentVersion","fields","timeInfo"])],t.prototype,"readVersion",null),t=(0,n._)([(0,c.j)("esri.layers.mixins.ArcGISImageService")],t),t};var ft=i(17287),gt=i(71612),bt=i(17017),Rt=i(38009),vt=i(16859),wt=i(34760),_t=i(72965),St=i(28294),Ct=i(60199),It=i(32163);let xt=class extends((0,gt.h)((0,St.n)((0,wt.Q)((0,_t.M)((0,Rt.q)((0,vt.I)(yt((0,bt.N)((0,ft.Y)((0,o.R)(d.Z))))))))))){constructor(...e){super(...e),this.legendEnabled=!0,this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery"}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=(0,a.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(l.r9).then((()=>this._fetchService(t)))),Promise.resolve(this)}writeOperationalLayerType(e,t,i){const r="vector-field"===this.renderer?.type;t[i]=r?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const t=this.rasterFields,i=this.title,r=new Set;let n=!1,s=!1;this.capabilities&&(n=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,s=n&&("esriImageServiceDataTypeVector-UV"===this.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===this.serviceDataType));const a=new Set;n&&(a.add("raster.itempixelvalue"),s&&a.add("raster.magnitude").add("raster.direction"));for(const e of t){const t=e.name.toLowerCase();a.has(t)||t.includes("raster.servicepixelvalue.")||r.add(e.name)}return(0,It.eZ)({fields:t,title:i},{...e,visibleFieldNames:r})}queryFeatures(e,t){return this.queryRasters(e,t).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryFeatureCount(e,t){return this.queryRasterCount(e,t)}redraw(){this.emit("redraw")}serviceSupportsSpatialReference(e){return(0,Ct.D)(this,e)}};(0,n._)([(0,u.Cb)(x.rn)],xt.prototype,"legendEnabled",void 0),(0,n._)([(0,u.Cb)({type:["show","hide"]})],xt.prototype,"listMode",void 0),(0,n._)([(0,u.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],xt.prototype,"isReference",void 0),(0,n._)([(0,u.Cb)({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],xt.prototype,"operationalLayerType",void 0),(0,n._)([(0,m.c)("web-map","operationalLayerType")],xt.prototype,"writeOperationalLayerType",null),(0,n._)([(0,u.Cb)(x.C_)],xt.prototype,"popupEnabled",void 0),(0,n._)([(0,u.Cb)({type:s.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],xt.prototype,"popupTemplate",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],xt.prototype,"defaultPopupTemplate",null),(0,n._)([(0,u.Cb)({readOnly:!0,json:{read:!1}})],xt.prototype,"type",void 0),xt=(0,n._)([(0,c.j)("esri.layers.ImageryLayer")],xt);const Ft=xt},17287:(e,t,i)=>{i.d(t,{Y:()=>u});var r=i(43697),n=i(92604),s=i(70586),a=i(5600),o=(i(67676),i(80442),i(75215),i(52011)),l=i(66677);const u=e=>{let t=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,l.Qc)(this.url);if((0,s.pC)(e)&&e.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,l.Nm)(e,n.Z.getLogger(this.declaredClass)))}};return(0,r._)([(0,a.Cb)()],t.prototype,"title",null),(0,r._)([(0,a.Cb)({type:String})],t.prototype,"url",null),t=(0,r._)([(0,o.j)("esri.layers.mixins.ArcGISService")],t),t}},16859:(e,t,i)=>{i.d(t,{I:()=>v});var r=i(43697),n=i(40330),s=i(3172),a=i(66643),o=i(20102),l=i(92604),u=i(70586),p=i(95330),c=i(17452),m=i(5600),d=(i(67676),i(80442),i(75215),i(71715)),h=i(52011),y=i(30556),f=i(65587),g=i(15235),b=i(86082);const R=l.Z.getLogger("esri.layers.mixins.PortalLayer"),v=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){this.portalItem?.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new g.default({id:t.itemId,portal:i&&i.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const r=await i.e(8062).then(i.bind(i,18062));return(0,p.k_)(t),await r.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,p.D_)(e)||R.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,p.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?n.id?.findCredential(this.url):null;if(!t)return!0;const i=w.credential===t?w.user:await this._fetchEditingUser(e);return w.credential=t,w.user=i,(0,u.Wi)(i)||null==i.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const i=n.id.findServerInfo(this.url);if(!i?.owningSystemUrl)return null;const r=`${i.owningSystemUrl}/sharing/rest`,o=f.Z.getDefault();if(o&&o.loaded&&(0,c.Fv)(o.restUrl)===(0,c.Fv)(r))return o.user;const l=`${r}/community/self`,p=(0,u.pC)(e)?e.signal:null,m=await(0,a.q6)((0,s.default)(l,{authMode:"no-prompt",query:{f:"json"},signal:p}));return m.ok?b.default.fromJSON(m.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t&&t.portal,r=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||f.Z.getDefault());return i&&r&&!(0,c.tm)(r.restUrl,i.restUrl)?(t.messages&&t.messages.push(new o.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,r._)([(0,m.Cb)({type:g.default})],t.prototype,"portalItem",null),(0,r._)([(0,d.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,r._)([(0,y.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,r._)([(0,m.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,r._)([(0,m.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,r._)([(0,h.j)("esri.layers.mixins.PortalLayer")],t),t},w={credential:null,user:null}},41818:(e,t,i)=>{i.d(t,{P:()=>a});var r=i(11282),n=i(34599),s=i(57444);async function a(e,t,i){const a=(0,r.en)(e);return(0,n.executeQueryForCount)(a,s.Z.from(t),{...i}).then((e=>e.data.count))}},5396:(e,t,i)=>{i.d(t,{G:()=>a});var r=i(11282),n=i(34599),s=i(57444);async function a(e,t,i){const a=(0,r.en)(e);return(0,n.executeQueryForIds)(a,s.Z.from(t),{...i}).then((e=>e.data.objectIds))}},4967:(e,t,i)=>{i.d(t,{F:()=>l,e:()=>o});var r=i(11282),n=i(34599),s=i(74889),a=i(57444);async function o(e,t,i){const r=await l(e,t,i);return s.default.fromJSON(r)}async function l(e,t,i){const s=(0,r.en)(e),o={...i},l=a.Z.from(t),{data:u}=await(0,n.executeQuery)(s,l,l.sourceSpatialReference,o);return u}},98326:(e,t,i)=>{i.d(t,{Z:()=>c});var r,n=i(43697),s=i(96674),a=i(5600),o=(i(67676),i(80442),i(75215)),l=i(52011);const u={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let p=r=class extends s.wq{constructor(e){super(e),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:e}=this,t=function(e){const{exifInfo:t,exifName:i,tagName:r}=e;if(!t||!i||!r)return null;const n=t.find((e=>e.name===i));return n?function(e){const{tagName:t,tags:i}=e;if(!i||!t)return null;const r=i.find((e=>e.name===t));return r&&r.value||null}({tagName:r,tags:n.tags}):null}({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:e});return u[t]||null}clone(){return new r({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};(0,n._)([(0,a.Cb)({type:String})],p.prototype,"contentType",void 0),(0,n._)([(0,a.Cb)()],p.prototype,"exifInfo",void 0),(0,n._)([(0,a.Cb)({readOnly:!0})],p.prototype,"orientationInfo",null),(0,n._)([(0,a.Cb)({type:o.z8})],p.prototype,"id",void 0),(0,n._)([(0,a.Cb)({type:String})],p.prototype,"globalId",void 0),(0,n._)([(0,a.Cb)({type:String})],p.prototype,"keywords",void 0),(0,n._)([(0,a.Cb)({type:String})],p.prototype,"name",void 0),(0,n._)([(0,a.Cb)({json:{read:!1}})],p.prototype,"parentGlobalId",void 0),(0,n._)([(0,a.Cb)({json:{read:!1}})],p.prototype,"parentObjectId",void 0),(0,n._)([(0,a.Cb)({type:o.z8})],p.prototype,"size",void 0),(0,n._)([(0,a.Cb)({json:{read:!1}})],p.prototype,"url",void 0),p=r=(0,n._)([(0,l.j)("esri.layers.support.AttachmentInfo")],p);const c=p}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3301,4889],{78346:(e,t,r)=>{r.d(t,{bA:()=>Z});var i=r(20102),n=r(80442),s=r(95330),a=r(80903),o=r(25045),l=r(40330),c=r(92604),u=r(70586),h=r(94362),f=r(99880),d=r(68773),m=(r(2587),r(17452));const p={};function g(e){const t={async:e.async,isDebug:e.isDebug,locale:e.locale,baseUrl:e.baseUrl,has:{...e.has},map:{...e.map},packages:e.packages&&e.packages.concat()||[],paths:{...e.paths}};return e.hasOwnProperty("async")||(t.async=!0),e.hasOwnProperty("isDebug")||(t.isDebug=!1),e.baseUrl||(t.baseUrl=p.baseUrl),p.packages?.forEach((e=>{!function(e,t){for(const r of e)if(r.name===t.name)return;e.push(t)}(t.packages,e)})),t}var y=r(41213);class x{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach((t=>{this[t]=(...r)=>e[t](...r)}))}}class w{constructor(){this._dispatcher=new x,this._workerPostMessage({type:h.Cs.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener("messageerror",e)}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e)}postMessage(e){(0,y.Y)((()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))}))}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,t,r){this._dispatcher.addEventListener(e,t,r)}removeEventListener(e,t,r){this._dispatcher.removeEventListener(e,t,r)}_workerPostMessage(e){(0,y.Y)((()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))}))}async _workerMessageHandler(e){const t=(0,h.QM)(e);if(t&&t.type===h.Cs.OPEN){const{modulePath:e,jobId:r}=t;let i=await o.default.loadWorker(e);i||(i=await import(e));const n=o.default.connect(i);this._workerPostMessage({type:h.Cs.OPENED,jobId:r,data:n})}}}var b=r(70171),I=r(17202);const v=c.Z.getLogger("esri.core.workers"),{HANDSHAKE:_}=h.Cs;let C,S;const k="Failed to create Worker. Fallback to execute module in main thread";async function R(e){return new Promise((t=>{function r(n){const s=(0,h.QM)(n);s&&s.type===_&&(e.removeEventListener("message",r),e.removeEventListener("error",i),t(e))}function i(t){t.preventDefault(),e.removeEventListener("message",r),e.removeEventListener("error",i),v.warn("Failed to create Worker. Fallback to execute module in main thread",t),(e=new w).addEventListener("message",r),e.addEventListener("error",i)}e.addEventListener("message",r),e.addEventListener("error",i)}))}let T=0;const P=c.Z.getLogger("esri.core.workers"),{ABORT:M,INVOKE:E,OPEN:D,OPENED:O,RESPONSE:F}=h.Cs;class N{constructor(e,t){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=t,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",(e=>{e.preventDefault(),P.error(e)}))}static async create(e){const t=await async function(){if(!(0,n.Z)("esri-workers")||((0,n.Z)("mozilla"),0))return R(new w);if(!C&&!S)try{const e='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,i)=>{if(t){if(t.aborted)return i(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,buildDate:r,version:t}=configuration.kernelInfo,{revision:n,buildDate:i,version:s}=e.kernelInfo;o!==n&&console.warn(`[esri.core.workers] Version mismatch detected between ArcGIS API for JavaScript and assets:\\nAPI version: ${t} [Date: ${r}, Revision: ${o.slice(0,8)}]\nAssets version: ${s} [Date: ${i}, Revision: ${n.slice(0,8)}]`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let e;function t(o){const t=e.connect(o);self.postMessage({type:2,jobId:r,data:t},[t])}"function"==typeof define&&define.amd?require([workerPath],(r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((r=>(e=r.default,checkWorkerRevision(e),e.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),e=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(e),e.loadWorker(o.modulePath).then(t));break;case 3:if(outgoing.has(r)){const e=outgoing.get(r);outgoing.delete(r),o.error?e.reject(JSON.parse(o.error)):e.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});'.replace('"{CONFIGURATION}"',`'${function(){let e;if(null!=d.Z.default){const t={...d.Z};delete t.default,e=JSON.parse(JSON.stringify(t))}else e=JSON.parse(JSON.stringify(d.Z));e.assetsPath=(0,m.hF)(e.assetsPath),e.request.interceptors=[],e.log.interceptors=[],e.locale=(0,b.Kd)(),e.has={"esri-csp-restrictions":(0,n.Z)("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":(0,n.Z)("esri-2d-update-debug"),"esri-2d-query-centroid-enabled":(0,n.Z)("esri-2d-query-centroid-enabled"),"featurelayer-pbf":(0,n.Z)("featurelayer-pbf"),"featurelayer-simplify-thresholds":(0,n.Z)("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":(0,n.Z)("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":(0,n.Z)("featurelayer-simplify-mobile-factor"),"esri-atomics":(0,n.Z)("esri-atomics"),"esri-shared-array-buffer":(0,n.Z)("esri-shared-array-buffer"),"esri-tiles-debug":(0,n.Z)("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":(0,n.Z)("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":(0,n.Z)("feature-polyline-generalization-factor"),"host-webworker":1},e.workers.loaderUrl&&(e.workers.loaderUrl=(0,m.hF)(e.workers.loaderUrl)),e.workers.workerPath?e.workers.workerPath=(0,m.hF)(e.workers.workerPath):e.workers.workerPath=(0,m.hF)((0,f.V)("esri/core/workers/RemoteClient.js")),e.workers.useDynamicImport=!1;const t=d.Z.workers.loaderConfig,r=g({baseUrl:t?.baseUrl,locale:(0,b.Kd)(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...t?.has},map:{...t?.map},paths:{...t?.paths},packages:t?.packages||[]}),i={version:l.i8,buildDate:I.r,revision:I.$};return JSON.stringify({esriConfig:e,loaderConfig:r,kernelInfo:i})}()}'`);C=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){S=e||{}}let e;if(C)try{e=new Worker(C,{name:"esri-worker-"+T++})}catch(t){v.warn(k,S),e=new w}else v.warn(k,S),e=new w;return R(e)}();return new N(t,e)}terminate(){this.worker.terminate()}async open(e,t={}){const{signal:r}=t,i=(0,h.jt)();return new Promise(((t,n)=>{const a={resolve:t,reject:n,abortHandle:(0,s.$F)(r,(()=>{this._outJobs.delete(i),this._post({type:M,jobId:i})}))};this._outJobs.set(i,a),this._post({type:D,jobId:i,modulePath:e})}))}_onMessage(e){const t=(0,h.QM)(e);if(t)switch(t.type){case O:this._onOpenedMessage(t);break;case F:this._onResponseMessage(t);break;case M:this._onAbortMessage(t);break;case E:this._onInvokeMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,i=t.get(r);i&&(i.controller&&i.controller.abort(),t.delete(r))}_onInvokeMessage(e){const{methodName:t,jobId:r,data:i,abortable:n}=e,a=n?new AbortController:null,o=this._inJobs,c=l.Nv[t];let u;try{if("function"!=typeof c)throw new TypeError(`${t} is not a function`);u=c.call(null,i,{signal:a?a.signal:null})}catch(e){return void this._post({type:F,jobId:r,error:(0,h.AB)(e)})}(0,s.y8)(u)?(o.set(r,{controller:a,promise:u}),u.then((e=>{o.has(r)&&(o.delete(r),this._post({type:F,jobId:r},e))}),(e=>{o.has(r)&&(o.delete(r),e||(e={message:"Error encountered at method"+t}),(0,s.D_)(e)||this._post({type:F,jobId:r,error:(0,h.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:F,jobId:r},u)}_onOpenedMessage(e){const{jobId:t,data:r}=e,i=this._outJobs.get(t);i&&(this._outJobs.delete(t),(0,u.hw)(i.abortHandle),i.resolve(r))}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,s=this._outJobs.get(t);s&&(this._outJobs.delete(t),(0,u.hw)(s.abortHandle),r?s.reject(i.Z.fromJSON(JSON.parse(r))):s.resolve(n))}_post(e,t,r){return(0,h.oi)(this.worker,e,t,r)}}let B=(0,n.Z)("esri-workers-debug")?1:(0,n.Z)("host-browser")?navigator.hardwareConcurrency-1:0;B||(B=(0,n.Z)("safari")&&(0,n.Z)("mac")||(0,n.Z)("trident")?7:2);let z=0;const L=[];async function A(e,t){const r=new a.Z;return await r.open(e,t),r}async function Z(e,t={}){if("string"!=typeof e)throw new i.Z("workers:undefined-module","modulePath is missing");let r=t.strategy||"distributed";if((0,n.Z)("host-webworker")&&!(0,n.Z)("esri-workers")&&(r="local"),"local"===r){let r=await o.default.loadWorker(e);r||(r=await import(e)),(0,s.k_)(t.signal);const i=t.client||r;return A([o.default.connect(r)],{...t,client:i})}if(await async function(){if(W)return W;H=new AbortController;const e=[];for(let t=0;t<B;t++){const r=N.create(t).then((e=>(L[t]=e,e)));e.push(r)}return W=Promise.all(e),W}(),(0,s.k_)(t.signal),"dedicated"===r){const r=z++%B;return A([await L[r].open(e,t)],t)}if(t.maxNumWorkers&&t.maxNumWorkers>0){const r=Math.min(t.maxNumWorkers,B);if(r<B){const i=new Array(r);for(let n=0;n<r;++n){const r=z++%B;i[n]=L[r].open(e,t)}return A(i,t)}}return A(L.map((r=>r.open(e,t))),t)}let H,W=null},2587:(e,t,r)=>{r(90344),r(18848),r(940),r(70171);var i=r(94443),n=r(3172),s=r(20102),a=r(70586);async function o(e){if((0,a.pC)(c.fetchBundleAsset))return c.fetchBundleAsset(e);const t=await(0,n.default)(e,{responseType:"text"});return JSON.parse(t.data)}class l{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let i;i="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=i,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,n){const a=t.exec(r);if(!a)throw new s.Z("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=a[1]?`${a[1]}/`:"",c=a[2],u=(0,i.Su)(n),h=`${l}${c}.json`,f=u?`${l}${c}_${u}.json`:h;let d;try{d=await o(e(f))}catch(t){if(f===h)throw new s.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{d=await o(e(h))}catch(e){throw new s.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return d}(this.getAssetUrl,this.matcher,e,t)}}const c={};var u,h=r(99880);(0,i.tz)((u={pattern:"esri/",location:h.V},new l(u)))},940:(e,t,r)=>{r.d(t,{n:()=>c});var i=r(92604),n=r(78286),s=r(19153),a=r(90344),o=r(18848);const l=i.Z.getLogger("esri.intl");function c(e,t,r={}){const{format:i={}}=r;return(0,s.gx)(e,(e=>function(e,t,r){let i,s;const a=e.indexOf(":");if(-1===a?i=e.trim():(i=e.slice(0,a).trim(),s=e.slice(a+1).trim()),!i)return"";const o=(0,n.hS)(i,t);if(null==o)return"";const l=r[s]||r[i];return l?u(o,l):s?h(o,s):f(o)}(e,t,i)))}function u(e,t){switch(t.type){case"date":return(0,a.p6)(e,t.intlOptions);case"number":return(0,o.uf)(e,t.intlOptions);default:return l.warn("missing format descriptor for key {key}"),f(e)}}function h(e,t){switch(t.toLowerCase()){case"dateformat":return(0,a.p6)(e);case"numberformat":return(0,o.uf)(e);default:return l.warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,a.p6)(e):/^numberformat/i.test(t)?(0,o.uf)(e):f(e)}}function f(e){switch(typeof e){case"string":return e;case"number":return(0,o.uf)(e);case"boolean":return""+e;default:return e instanceof Date?(0,a.p6)(e):""}}},69971:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Xe});var i=r(43697),n=r(51773),s=r(30030),a=r(20102),o=r(70586),l=r(16453),c=r(95330),u=r(17445),h=r(5600),f=(r(67676),r(80442),r(75215)),d=r(36030),m=r(71715),p=r(52011),g=r(87085),y=r(71612),x=r(17017),w=(r(66577),r(3172)),b=r(92604),I=r(44422),v=r(8744),_=r(66677),C=r(21506),S=r(35956),k=r(88281),R=r(11145);function T(e,t,r){const i=t.shift();if(0===r.length){const e=[];r.push({sliceId:-1,multidimensionalDefinition:e})}const n=r.length;for(let t=0;t<n;t++){const t=r.shift().multidimensionalDefinition;i.values.forEach((n=>{r.push({sliceId:-1,multidimensionalDefinition:[...t,{variableName:e,dimensionName:i.name,values:[n]}]})}))}t.length&&T(e,t,r)}function P(e,t){const r=[];let i=0;return(t?e.variables.filter((e=>e.name.toLowerCase()===t.toLowerCase())):[...e.variables].sort(((e,t)=>e.name>t.name?1:-1))).forEach((e=>{const t=[],n=[...e.dimensions].sort(((e,t)=>e.name>t.name?-1:1));T(e.name,n,t),t.forEach((e=>{r.push({...e,sliceId:i++})}))})),r}function M(e){return!((0,o.Wi)(e)||!e.length)&&e.some((e=>{if(null==e.values)return!0;const t=e.values.length;return 0===t||t>1||!e.isSlice&&Array.isArray(e.values[0])}))}var E=r(80676),D=r(67058),O=r(91219),F=r(23808),N=r(6570),B=r(82971);const z=b.Z.getLogger("esri.layers.mixins.ImageryTileMixin"),L=e=>{let t=class extends e{constructor(){super(...arguments),this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.fullExtent=null,this.interpolation="nearest",this.multidimensionalDefinition=null,this.raster=null,this.rasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.tileInfo=null,this.symbolizer=null}set url(e){this._set("url",(0,_.Nm)(e,z))}set renderer(e){this._set("renderer",e),this.updateRenderer()}async convertVectorFieldData(e,t){if((0,o.Wi)(e))return null;const r=this._rasterJobHandler.instance,i=this.rasterInfo.dataType;return r?r.convertVectorFieldData({pixelBlock:e,dataType:i},t):(0,E.KC)(e,i)}async createStreamlinesMesh(e,t){const r=this._rasterJobHandler.instance;return r?r.createStreamlinesMesh(e,t):(0,F.z_)(e.rendererSettings,e.flowData,(0,o.pC)(t.signal)?t.signal:(new AbortController).signal)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.rasterInfo;if((0,o.Wi)(t))return e;let r=e.multidimensionalDefinition||this.multidimensionalDefinition;!(0,o.Wi)(r)&&r.length||(r=this._getDefaultSlice());const i=e.timeExtent||this.timeExtent;if((0,o.pC)(r)&&(0,o.pC)(i)&&((0,o.pC)(i.start)||(0,o.pC)(i.end))){r=r.map((e=>e.clone()));const n=t.variables.find((({name:e})=>e===r[0].variableName))?.dimensions?.find((({name:e})=>"StdTime"===e)),s=r.find((({dimensionName:e})=>"StdTime"===e));if(!n||!s)return{...e,multidimensionalDefinition:null};const{start:a,end:l}=i,c=(0,o.Wi)(a)?null:a.getTime(),u=(0,o.Wi)(l)?null:l.getTime(),h=c??u,f=u??c;if((0,o.pC)(n.values)){const e=n.values.filter((e=>{if(Array.isArray(e)){if(h===f)return e[0]<=h&&e[1]>=h;const t=e[0]<=h&&e[1]>h||e[0]<f&&e[1]>=f,r=e[0]>=h&&e[1]<=f||e[0]<h&&e[1]>f;return t||r}return h===f?e===h:e>=h&&e<=f}));if(e.length){const t=e.sort(((e,t)=>h===f?(e[0]??e)-(t[0]??t):Math.abs((e[1]??e)-f)-Math.abs((t[1]??t)-f)))[0];s.values=[t]}else r=null}else if(n.hasRegularIntervals&&n.extent){const[e,t]=n.extent;h>t||f<e?r=null:s.values=h===f?[h]:[Math.max(e,h),Math.min(t,f)]}}return{...e,multidimensionalDefinition:r}}async updateRenderer(){if(!this.loaded)return;if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(this.renderer))return;const e=this._rasterJobHandler.instance;e&&(this.symbolizer.rendererJSON=(0,D.ol)(this.renderer.toJSON()),this.symbolizer.bind(),await e.updateSymbolizer(this.symbolizer),this._cachedRendererJson=this.renderer.toJSON())}async applyRenderer(e,t){const r=e&&e.pixelBlock;if(!((0,o.pC)(r)&&r.pixels&&r.pixels.length>0))return null;let i;await this.updateRenderer();const n=this._rasterJobHandler.instance,{bandIds:s}=this;return i=n?await n.symbolize({...e,simpleStretchParams:t,bandIds:s}):this.symbolizer.symbolize({...e,simpleStretchParams:t,bandIds:s}),i}getTileUrl(e,t,r){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${r}`:""}getCompatibleTileInfo(e,t,r=!1){if(!this.loaded||(0,o.Wi)(t))return null;if(r&&e.equals(this.spatialReference))return this.tileInfo;const i=(0,v.C5)(e);return R.Z.create({size:256,spatialReference:e,origin:i?{x:i.origin[0],y:i.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent&&this._compatibleFullExtent.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,r,i={}){if(i.requestAsImageElement){const n=this.getTileUrl(e,t,r);return(0,w.default)(n,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:i.signal}).then((e=>e.data))}if((0,o.pC)(this.rasterInfo.multidimensionalInfo)&&(i=this.normalizeRasterFetchOptions(i),(0,o.Wi)(i.multidimensionalDefinition))){const n=i.tileInfo||this.rasterInfo.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,t,r,n),pixelBlock:null}}return await this._initJobHandler(),"raster-shaded-relief"===this.renderer.type&&(i={...i,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,r,i)}async fetchPixels(e,t,r,i={}){return(0,o.pC)(this.rasterInfo.multidimensionalInfo)&&(i=this.normalizeRasterFetchOptions(i),(0,o.Wi)(i.multidimensionalDefinition))?{extent:e,pixelBlock:null}:(await this._initJobHandler(),this.raster.fetchPixels(e,t,r,i))}async identify(e,t={}){return!(0,o.pC)(this.rasterInfo.multidimensionalInfo)||this.rasterInfo.hasMultidimensionalTranspose&&(M(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent)||(t=this.normalizeRasterFetchOptions(t),!(0,o.Wi)(t.multidimensionalDefinition))?this.raster.identify(e,t):{location:e,value:null}}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const e=this.rasterInfo.multidimensionalInfo;if((0,o.Wi)(e)||"standard-time"!==this.rasterInfo.dataType)return!1;const t=this.multidimensionalDefinition[0]?.variableName;return e.variables.some((e=>e.name===t&&e.dimensions.some((e=>"StdTime"===e.name))))}getStandardTimeValue(e){return new Date(24*(e-25569)*3600*1e3).toString()}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=this._getDefaultSlice()),this._configDefaultRenderer()}_initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new k.Z;return this._rasterJobHandler.connectionPromise=e.initialize().then((()=>{this._rasterJobHandler.instance=e,this.raster.rasterJobHandler=e,this.renderer&&this.updateRenderer()})).catch((()=>null)),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this.raster.rasterJobHandler=null}_configDefaultInterpolation(){if(null==this.interpolation){const e=(0,D.In)(this.rasterInfo,this.raster.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",e)}}_getDefaultSlice(){const{multidimensionalInfo:e}=this.raster.rasterInfo;if((0,o.Wi)(e))return null;const t=e.variables[0];return t.dimensions.map((e=>new S.Z({variableName:t.name,dimensionName:e.name,values:[e.values?.[0]??e.extent[0]],isSlice:!0})))}_configDefaultRenderer(){const e=this.raster.rasterInfo;this.bandIds||(this.bandIds=(0,D.YD)(e)),this.renderer||(this.renderer=(0,D.Ob)(e,{bandIds:this.bandIds,variableName:(0,o.pC)(this.multidimensionalDefinition)?this.multidimensionalDefinition[0]?.variableName:null})),this.symbolizer?(this.symbolizer.rendererJSON=(0,D.ol)(this.renderer.toJSON()),this.symbolizer.rasterInfo=e):this.symbolizer=new O.Z({rendererJSON:this.renderer.toJSON(),rasterInfo:e});const t=this.symbolizer.bind();t.success||z.warn("imagery-tile-mixin",t.error||"The given renderer is not supported by the layer.")}};return(0,i._)([(0,h.Cb)()],t.prototype,"_cachedRendererJson",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"_compatibleFullExtent",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"_rasterJobHandler",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"bandIds",void 0),(0,i._)([(0,h.Cb)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),(0,i._)([(0,h.Cb)({type:N.Z,json:{read:!1}}),(0,I.B)("rasterInfo.extent")],t.prototype,"fullExtent",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"interpolation",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"ioConfig",void 0),(0,i._)([(0,h.Cb)({type:[S.Z]})],t.prototype,"multidimensionalDefinition",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"raster",void 0),(0,i._)([(0,h.Cb)({readOnly:!0}),(0,I.B)("raster.rasterInfo")],t.prototype,"rasterInfo",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"sourceJSON",void 0),(0,i._)([(0,h.Cb)({type:B.Z,json:{read:!1}}),(0,I.B)("rasterInfo.spatialReference")],t.prototype,"spatialReference",void 0),(0,i._)([(0,h.Cb)({type:R.Z,json:{read:!1}}),(0,I.B)("rasterInfo.storageInfo.tileInfo")],t.prototype,"tileInfo",void 0),(0,i._)([(0,h.Cb)(C.HQ)],t.prototype,"url",null),(0,i._)([(0,h.Cb)({types:s.dr})],t.prototype,"renderer",null),(0,i._)([(0,h.Cb)()],t.prototype,"symbolizer",void 0),t=(0,i._)([(0,p.j)("esri.layers.ImageryTileMixin")],t),t};var A=r(38009),Z=r(16859),H=r(34760),W=r(72965),J=r(28294),j=r(1231),U=r(69608),q=r(48526),G=r(36679),$=r(96674),V=r(609),Y=r(73506),K=r(13473);const X=new Map,Q=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const r=e+"/"+t,i=this._cachedBlocks;if(i.has(r)){const e=i.get(r);return e.refCount--,e.refCount<=0&&(i.delete(r),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const r=e+"/"+t,i=this._cachedBlocks;if(i.has(r)){const e=i.get(r);return e.ts=Date.now(),e.refCount++,i.delete(r),i.set(r,e),e.block}return null}putBlock(e,t,r,i=null){const n=this._cachedBlocks,s=e+"/"+t;if(n.has(s)){const e=n.get(s);e.ts=Date.now(),e.refCount++}else n.set(s,{block:r,ts:Date.now(),refCount:1,controller:i});this._trim(),this._updateTimer()}deleteBlock(e,t){const r=this._cachedBlocks,i=e+"/"+t;r.has(i)&&r.delete(i)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval((()=>{const t=Array.from(e),r=Date.now();for(let i=0;i<t.length&&t[i][1].ts<=r-this._duration;i++)e.delete(t[i][0]);0===e.size&&this._clearTimer()}),this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let r=0;r<t.length-this._size;r++)e.delete(t[r][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function ee(e,t){return null==t?e:`${e}?sliceId=${t}`}function te(e,t,r){if(!X.has(e))return null==t?Q.getBlock(e,r):null;const i=X.get(e);if(null==i[t]){for(let e=0;e<i.length;e++)if(i[e]&&i[e].cache.has(r)){const t=i[e].cache.get(r);return t.refCount++,t.block}return Q.getBlock(e,r)}const n=i[t].cache;if(n.has(r)){const e=n.get(r);return e.refCount++,e.block}for(let e=0;e<i.length;e++)if(e!==t&&i[e]&&i[e]&&i[e].cache.has(r)){const t=i[e].cache.get(r);return t.refCount++,n.set(r,t),t.block}return null}function re(e,t,r,i,n=null){if(!X.has(e))return void(null==t&&Q.putBlock(e,r,i,n));const s=X.get(e);if(null==s[t])return void Q.putBlock(e,r,i,n);const a={refCount:1,block:i,isResolved:!1,isRejected:!1,controller:n};i.then((()=>a.isResolved=!0)).catch((()=>a.isRejected=!0)),s[t].cache.set(r,a)}var ie=r(75993),ne=r(55914);let se=class extends((0,V.v)($.wq)){constructor(){super(...arguments),this.rasterJobHandler=null,this.datasetName=null,this.datasetFormat=null,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=(0,Y.zD)();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:R.Z.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,Y.ut)(e.spatialReference);return(0,o.pC)(t)&&e.extent.width>=t/2}set url(e){this._set("url",(0,_.Nm)(e,b.Z.getLogger(this.declaredClass)))}async open(e){throw new a.Z("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,t,r,i={}){const n=i.tileInfo||this.rasterInfo.storageInfo.tileInfo,s=this.getTileExtentFromTileInfo(e,t,r,n);return this.fetchPixels(s,n.size[0],n.size[1],i)}async identify(e,t={}){const{multidimensionalDefinition:r,timeExtent:i}=t,{hasMultidimensionalTranspose:n,multidimensionalInfo:s}=this.rasterInfo;let{transposedVariableName:a}=t;const l=(0,o.pC)(s)&&n&&(null!=i||M(r));l&&!a&&(a=(0,o.pC)(r)&&r.length>0?r[0].variableName:s.variables[0].name,t={...t,transposedVariableName:a}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=this.rasterInfo,{datumTransformation:h}=t;let f=(0,Y.nF)(e,c,h);if(!u.intersects(f))return{location:f,value:null};if((0,o.pC)(this.rasterInfo.transform)){const e=this.rasterInfo.transform.inverseTransform(f);if(!this.rasterInfo.nativeExtent.intersects(e))return{location:e,value:null};f=e}let d=0;const m=a&&(0,o.pC)(s)&&this.rasterInfo.hasMultidimensionalTranspose;if(!m)if(t.srcResolution)d=(0,Y.kr)(t.srcResolution,this.rasterInfo,this.ioConfig.sampling).pyramidLevel;else if(d=await this.computeBestPyramidLevelForLocation(e,t),null==d)return{location:f,value:null};const p=this.identifyPixelLocation(f,d,null,m);if(null===p)return{location:f,value:null};const{row:g,col:y,rowOffset:x,colOffset:w,blockWidth:b}=p,I=a??(0,o.Wg)(t.sliceId),v=ee(this.url,I),_=`${d}/${g}/${y}`;let C=te(v,null,_);(0,o.Wi)(C)&&(C=this.fetchRawTile(d,g,y,t),re(v,null,_,C));const S=await C;if((0,o.Wi)(S)||!S.pixels?.length)return{location:f,value:null};const k=x*b+w;return this._processIdentifyResult(S,{srcLocation:f,position:k,pyramidLevel:d,useTransposedTile:m,requestSomeSlices:l,identifyOptions:t})}async fetchPixels(e,t,r,i={}){if(e=(0,Y.kZ)(e),(i=this._getRequestOptionsWithSliceId(i)).requestRawData)return this._fetchPixels(e,t,r,i);const n=(0,Y.ut)(e.spatialReference),s=(0,Y.Hq)(e);if((0,o.Wi)(n)||0===s||1===s&&this._isGlobalWrappableSource)return this._fetchPixels(e,t,r,i);if(s>=3)return{extent:e,pixelBlock:null};const a=[],{xmin:l,xmax:c}=e,u=Math.round(n/(c-l)*t),h=u-Math.round((n/2-l)/(c-l)*t);let f=0;const d=[];for(let o=0;o<=s;o++){const m=new N.Z({xmin:0===o?l:-n/2,xmax:o===s?c-n*o:n/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),p=0===o?u-h:o===s?t-f:u;f+=p,d.push(p);const g=i.disableWrapAround&&o>0?null:this._fetchPixels(m,p,r,i);a.push(g)}const m=(await Promise.all(a)).map((e=>e?.pixelBlock));let p=null;const g={width:t,height:r};return p=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:g,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:d},i)).pixelBlock:(0,ne.us)(m,g,{blockWidths:d}),{extent:e,srcExtent:(0,Y.tB)(e,this.rasterInfo.spatialReference,i.datumTransformation),pixelBlock:p}}async fetchRawPixels(e,t,r,i={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const n=await this._fetchRawTiles(e,t,r,i),{nativeExtent:s,nativePixelSize:a,storageInfo:l}=this.rasterInfo,c=2**e,u=a.x*c,h=a.y*c,f=new N.Z({xmin:s.xmin+u*t.x,xmax:s.xmin+u*(t.x+r.width-1),ymin:s.ymax-h*(t.y+r.height-1),ymax:s.ymax-h*t.y,spatialReference:s.spatialReference});if(!n)return{extent:f,srcExtent:f,pixelBlock:null};const{pixelBlocks:d,mosaicSize:m}=n;if(1===d.length&&(0,o.pC)(d[0])&&d[0].width===r.width&&d[0].height===r.height)return{extent:f,srcExtent:f,pixelBlock:n.pixelBlocks[0]};const p=e>0?l.pyramidBlockWidth:l.blockWidth,g=e>0?l.pyramidBlockHeight:l.blockHeight,y={x:t.x%p,y:t.y%g};let x;return x=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:m,destDimension:r,clipOffset:y,clipSize:r,coefs:null,sampleSpacing:null,interpolation:i.interpolation,alignmentInfo:null,blockWidths:null},i)).pixelBlock:(0,ne.us)(d,m,{clipOffset:y,clipSize:r}),{extent:f,srcExtent:f,pixelBlock:x}}fetchRawTile(e,t,r,i){throw new a.Z("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,Y.tB)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,ie.J)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,r){const{customFetchParameters:i}=this.ioConfig,{range:n,query:s,headers:a}=t;r=r??t.retryCount??this.ioConfig.retryCount;const o=n?{Range:`bytes=${n.from}-${n.to}`}:null;try{return await(0,w.default)(e,{...t,query:{...s,...i},headers:{...a,...o}})}catch(i){if(r>0)return r--,this.request(e,t,r);throw i}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;if((0,o.Wi)(t))return null;if((0,o.Wi)(e)||0===e.length)return null;let r=0;const i=e[0].variableName;for(let n=0;n<t.variables.length;n++){const s=t.variables[n],a=s.dimensions;if(s.name!==i){r+=a.map((e=>this._getDimensionValuesCount(e))).reduce(((e,t)=>e+t));break}const o=a.map((e=>this._getDimensionValuesCount(e))),l=a.length;for(let t=0;t<l;t++){const i=e.find((e=>e.dimensionName===a[t].name));if(null==i)return null;const n=Array.isArray(i.values[0])?i.values[0][0]:i.values[0],s=this._getIndexFromDimensions(n,a[t]);if(-1===s)return null;o.shift(),r+=t===l-1?s:s*o.reduce(((e,t)=>e+t))}}return r}getTileExtentFromTileInfo(e,t,r,i){const n=i.lodAt(e);return this.getTileExtent({x:n.resolution,y:n.resolution},t,r,i.origin,i.spatialReference,i.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:r,pixelSize:i}=this.rasterInfo;if(!e.tileInfo){const n=[],s=e.maximumPyramidLevel||0;let a=Math.max(i.x,i.y),o=1/.0254*96*a;for(let e=0;e<=s;e++)n.push({level:s-e,resolution:a,scale:o}),a*=2,o*=2;const l=new K.Z({x:r.xmin,y:r.ymax,spatialReference:t});e.tileInfo=new R.Z({origin:l,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:n}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,r=512,i){const{width:n,height:s,nativeExtent:a,pixelSize:o,spatialReference:l}=e,c=new K.Z({x:a.xmin,y:a.ymax,spatialReference:l});null==i&&(i=Math.max(0,Math.round(Math.log(Math.max(n,s))/Math.LN2-8)));const u=this.computeBlockBoundary(a,512,512,{x:a.xmin,y:a.ymax},[o],i);e.storageInfo=new G.Z({blockWidth:t,blockHeight:r,pyramidBlockWidth:t,pyramidBlockHeight:r,origin:c,firstPyramidLevel:1,maximumPyramidLevel:i,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,r,i,n,s=0,a=2){if(1===n.length&&s>0){n=[...n];let{x:e,y:t}=n[0];for(let r=0;r<s;r++)e*=a,t*=a,n.push({x:e,y:t})}const o=[],{x:l,y:c}=i;for(let i=0;i<n.length;i++){const{x:s,y:a}=n[i];o.push({minCol:Math.floor((e.xmin-l+.1*s)/t/s),maxCol:Math.floor((e.xmax-l-.1*s)/t/s),minRow:Math.floor((c-e.ymax+.1*a)/r/a),maxRow:Math.floor((c-e.ymin-.1*a)/r/a)})}return o}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:r,pyramidScalingFactor:i}=this.rasterInfo.storageInfo;if(0===e)return t;if((0,o.pC)(r)&&r.length)return r[e-1];const n=i**e;return{x:t.x*n,y:t.y*n}}identifyPixelLocation(e,t,r,i){const{spatialReference:n,nativeExtent:s,storageInfo:a}=this.rasterInfo,{maximumPyramidLevel:l,origin:c,transposeInfo:u}=a,h=i&&(0,o.pC)(u)?u.tileSize[0]:a.blockWidth,f=i&&(0,o.pC)(u)?u.tileSize[1]:a.blockHeight,d=(0,Y.nF)(e,n,r);if(!s.intersects(d))return null;if(t<0||t>l)return null;const m=this.getPyramidPixelSize(t),{x:p,y:g}=m,y=(c.y-d.y)/g/f,x=(d.x-c.x)/p/h,w=Math.min(f-1,Math.floor((y-Math.floor(y))*f)),b=Math.min(h-1,Math.floor((x-Math.floor(x))*h));return{pyramidLevel:t,row:Math.floor(y),col:Math.floor(x),rowOffset:w,colOffset:b,blockWidth:h,srcLocation:d}}getTileExtent(e,t,r,i,n,s){const[a,o]=s,l=i.x+r*a*e.x,c=l+a*e.x,u=i.y-t*o*e.y,h=u-o*e.y;return new N.Z({xmin:l,xmax:c,ymin:h,ymax:u,spatialReference:n})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,r){const i=this.rasterInfo.storageInfo.blockBoundary[e];return!i||i.maxRow<t||i.maxCol<r||i.minRow>t||i.minCol>r}async _fetchPixels(e,t,r,i={}){let n=(0,Y.Hq)(e);if(n>=2)return{extent:e,pixelBlock:null};const s=this._getSourceDataInfo(e,t,r,i),{pyramidLevel:a,pyramidResolution:l,srcResolution:c,srcExtent:u,srcWidth:h,srcHeight:f}=s;if(0===h||0===f)return{extent:e,srcExtent:u,pixelBlock:null};const d=(0,o.Wg)(this.rasterInfo.transform),m="gcs-shift"===d?.type,p=(0,o.pC)((0,Y.ut)(e.spatialReference));!m&&p||(n=(0,Y.Hq)(s.srcExtent,m));const g=this.rasterInfo.storageInfo,y={x:Math.floor((u.xmin-g.origin.x)/l.x+.1),y:Math.floor((g.origin.y-u.ymax)/l.y+.1)},x=await this._fetchRawTiles(a,y,{width:h,height:f,wrapCount:n},i);if(!x)return{extent:e,srcExtent:u,pixelBlock:null};const w=a>0?g.pyramidBlockWidth:g.blockWidth,b=a>0?g.pyramidBlockHeight:g.blockHeight,I=w===h&&b===f&&y.x%w==0&&y.y%b==0,v=new K.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/r,spatialReference:e.spatialReference}),_=!e.spatialReference.equals(this.rasterInfo.spatialReference),{datumTransformation:C}=i;if(!_&&I&&1===x.pixelBlocks.length&&w===t&&b===r&&c.x===v.x&&c.y===v.y)return{extent:e,srcExtent:u,pixelBlock:x.pixelBlocks[0]};const S=p&&(0,o.pC)((0,Y.ut)(u.spatialReference)),k=i.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");k&&!this.rasterJobHandler&&await(0,Y.zD)();const R=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:x.extent,pixelSize:v.toJSON(),datumTransformation:C,rasterTransform:d,hasWrapAround:n>0||S,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:k},i):(0,Y.Qp)({projectedExtent:e,srcBufferExtent:x.extent,pixelSize:v,datumTransformation:C,rasterTransform:d,hasWrapAround:n>0||S,isAdaptive:!1,includeGCSGrid:k});let T;const P=!i.requestRawData,M={rows:R.spacing[0],cols:R.spacing[1]},D=(0,o.Wg)(this._getRasterTileAlignmentInfo(a,x.extent.xmin)),{pixelBlocks:O,mosaicSize:F,isPartiallyFilled:N}=x;let B=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:O,srcMosaicSize:F,destDimension:P?{width:t,height:r}:null,coefs:P?R.coefficients:null,sampleSpacing:P?M:null,projectDirections:k,gcsGrid:k?R.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:i.interpolation,alignmentInfo:D,blockWidths:null},i);({pixelBlock:T,localNorthDirections:B}=e)}else{const e=(0,ne.us)(O,F,{alignmentInfo:D});T=P?(0,ne.Uk)(e,{width:t,height:r},R.coefficients,M,i.interpolation):e,k&&R.gcsGrid&&(B=(0,ne.Qh)({width:t,height:r},R.gcsGrid),T=(0,E.xQ)(T,this.rasterInfo.dataType,B))}return i.requestRawData||k?{srcExtent:u,pixelBlock:T,transformGrid:R,localNorthDirections:B,extent:e,isPartiallyFilled:N}:{srcExtent:u,extent:e,pixelBlock:T}}async _fetchRawTiles(e,t,r,i){const{origin:n,blockBoundary:s}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:l}=this.getBlockWidthHeight(e);let{x:c,y:u}=t,{width:h,height:f,wrapCount:d}=r;const m=this._getRasterTileAlignmentInfo(e,0);i.buffer&&(c-=i.buffer.cols,u-=i.buffer.rows,h+=2*i.buffer.cols,f+=2*i.buffer.rows);let p=0,g=0,y=0;d&&(0,o.pC)(m)&&(({worldColumnCountFromOrigin:g,originColumnOffset:y,rightPadding:p}=m),g*m.blockWidth-p>=c+h&&(p=0));const x=Math.floor(c/a),w=Math.floor(u/l),b=Math.floor((c+h+p-1)/a),I=Math.floor((u+f+p-1)/l),v=s[e];if(!v)return null;const{minRow:_,minCol:C,maxCol:S,maxRow:k}=v;if(0===d&&(I<_||b<C||w>k||x>S))return null;const R=new Array;let T=!1;const P=null==this.ioConfig.allowPartialFill?i.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=w;t<=I;t++)for(let r=x;r<=b;r++){let n=r;if(!i.disableWrapAround&&d&&(0,o.pC)(m)&&g<=r&&(n=r-g-y),t>=_&&n>=C&&k>=t&&S>=n){const r=this._fetchRawTile(e,t,n,i);P?R.push(new Promise((e=>{r.then((t=>e(t))).catch((()=>{T=!0,e(null)}))}))):R.push(r)}else R.push(null)}if(0===R.length)return null;const M=await Promise.all(R),E={height:(I-w+1)*l,width:(b-x+1)*a},{spatialReference:D}=this.rasterInfo,O=this.getPyramidPixelSize(e),{x:F,y:B}=O;return{extent:new N.Z({xmin:n.x+x*a*F,xmax:n.x+(b+1)*a*F,ymin:n.y-(I+1)*l*B,ymax:n.y-w*l*B,spatialReference:D}),pixelBlocks:M,mosaicSize:E,isPartiallyFilled:T}}_fetchRawTile(e,t,r,i){const n=this.rasterInfo.storageInfo.blockBoundary[e];if(!n)return Promise.resolve(null);const{minRow:s,minCol:a,maxCol:l,maxRow:u}=n;if(t<s||r<a||t>u||r>l)return Promise.resolve(null);const h=ee(this.url,i.sliceId),f=`${e}/${t}/${r}`;let d=te(h,i.registryId,f);if((0,o.Wi)(d)){const n=new AbortController;d=this.fetchRawTile(e,t,r,{...i,signal:n.signal}),re(h,i.registryId,f,d,n),d.catch((()=>function(e,t,r){if(!X.has(e))return void(null==t&&Q.deleteBlock(e,r));const i=X.get(e);null!=i[t]?i[t].cache.delete(r):Q.deleteBlock(e,r)}(h,i.registryId,f)))}return i.signal&&(0,c.fu)(i,(()=>{!function(e,t,r){if(!X.has(e))return null==t?Q.decreaseRefCount(e,r):0;const i=X.get(e);if(null==i[t])return Q.decreaseRefCount(e,r);const n=i[t].cache;if(n.has(r)){const e=n.get(r);if(e.refCount--,0===e.refCount){n.delete(r);for(let e=0;e<i.length;e++)i[e]&&i[e].cache.has(r)&&i[e].cache.delete(r);e.controller&&e.controller.abort()}e.refCount}}(h,i.registryId,f)})),d}_computeMagDirValues(e){const{bandCount:t,dataType:r}=this.rasterInfo;if((2!==t||"vector-magdir"!==r)&&"vector-uv"!==r||2!==e?.length||!e[0]?.length)return null;const i=e[0].length;if("vector-magdir"===r){const t=e[1].map((e=>(e+360)%360));return[e[0],t]}const[n,s]=e,a=[],o=[];for(let e=0;e<i;e++){const[t,r]=(0,E.Tg)([n[e],s[e]]);a.push(t),o.push(r)}return[a,o]}_getIndexFromDimensions(e,t){const{extent:r,interval:i,unit:n,values:s}=t;if(s?.length)return Array.isArray(s[0])?s.findIndex((t=>t[0]<=e&&t[1]>=e)):s.indexOf(e);if(e>r[1])return-1;const a=r[0];let o=-1;if("ISO8601"===n){switch(t.intervalUnit?.toLowerCase()||"seconds"){case"seconds":o=Math.round((e-a)/1e3/i);break;case"minutes":o=Math.round((e-a)/6e4/i);break;case"hours":o=Math.round((e-a)/36e5/i);break;case"days":o=Math.round((e-a)/864e5/i);break;case"years":o=Math.round((new Date(e).getUTCFullYear()-new Date(a).getUTCFullYear())/i);break;case"decades":o=Math.round((new Date(e).getUTCFullYear()-new Date(a).getUTCFullYear())/10/i)}return o}return Math.round((e-a)/i)}_getDimensionValuesCount(e){const{extent:t,interval:r,unit:i,values:n}=e;let s=n?.length||0;if(s)return s;const a=t[0];if(0===s&&"ISO8601"===i){switch(e.intervalUnit?.toLowerCase()||"seconds"){case"seconds":s=Math.round((t[1]-t[0])/1e3/r);break;case"minutes":s=Math.round((t[1]-t[0])/6e4/r);break;case"hours":s=Math.round((t[1]-t[0])/36e5/r);break;case"days":s=Math.round((t[1]-t[0])/864e5/r);break;case"years":s=Math.round((new Date(t[1]).getUTCFullYear()-new Date(a).getUTCFullYear())/r);break;case"decades":s=Math.round((new Date(t[1]).getUTCFullYear()-new Date(a).getUTCFullYear())/10/r)}return s}return Math.round((t[1]-t[0])/r)}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlighmentInfo&&(this._rasterTileAlighmentInfo=(0,Y.P_)(this.rasterInfo)),(0,o.Wi)(this._rasterTileAlighmentInfo.pyramidsInfo)?null:{startX:t,halfWorldWidth:this._rasterTileAlighmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlighmentInfo.hasGCSSShiftTransform,...this._rasterTileAlighmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,r,i={}){const n={datumTransformation:i.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0};i.srcResolution&&(n.srcResolution=i.srcResolution,this._updateSourceDataInfo(e,n));const s=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:a,srcHeight:o,pyramidLevel:l}=n,c=a/t,u=o/r,h=l<s&&c*u>=16;if(h||l===s&&(c>8||u>8)||0===a||0===o){const a=new K.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/r,spatialReference:e.spatialReference});let o=(0,Y.VO)(a,this.rasterInfo.spatialReference,e,n.datumTransformation);const f=!o||i.srcResolution&&o.x+o.y<i.srcResolution.x+i.srcResolution.y;if(h&&i.srcResolution&&f){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(s-l+3>=e){const t=2**e;o={x:i.srcResolution.x*t,y:i.srcResolution.y*t}}}o&&(n.srcResolution=o,this._updateSourceDataInfo(e,n))}return(n.srcWidth/t>8||n.srcHeight/r>8)&&(n.srcWidth=0,n.srcHeight=0),n}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const r=this.rasterInfo.spatialReference,{srcResolution:i,datumTransformation:n}=t,{pyramidLevel:s,pyramidResolution:a,excessiveReading:l}=(0,Y.kr)(i,this.rasterInfo,this.ioConfig.sampling);if(l)return;let c=t.srcExtent||(0,Y.tB)(e,r,n);if(null==c)return;const u=(0,o.Wg)(this.rasterInfo.transform);u&&(c=u.inverseTransform(c)),t.srcExtent=c;const h=Math.ceil((c.xmax-c.xmin)/a.x-.1),f=Math.ceil((c.ymax-c.ymin)/a.y-.1);t.pyramidLevel=s,t.pyramidResolution=a,t.srcWidth=h,t.srcHeight=f}_getRequestOptionsWithSliceId(e){return(0,o.pC)(this.rasterInfo.multidimensionalInfo)&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:r,position:i,pyramidLevel:n,useTransposedTile:s}=t,a=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[i])return{location:r,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if((0,o.Wi)(l)||!s){const t=e.pixels.map((e=>e[i])),s={location:r,value:t,pyramidLevel:n},a=this._computeMagDirValues(t.map((e=>[e])));return a?.length&&(s.magdirValue=a.map((e=>e[0]))),s}let c=e.pixels.map((e=>Array.prototype.slice.call(e,i*a,i*a+a))),u=this._computeMagDirValues(c);const{requestSomeSlices:h,identifyOptions:f}=t;let d=P(l,f.transposedVariableName);if(h){const e=function(e,t,r){let i=e;if(t&&(t=[...t].sort(((e,t)=>e.dimensionName<t.dimensionName?-1:1))).forEach((({dimensionName:e,values:t,isSlice:r})=>{t.length&&(i=i.filter((i=>{const n=i.multidimensionalDefinition.find((t=>t.dimensionName===e));if(null==n)return!1;const s=n.values[0];return"number"==typeof s?"number"==typeof t[0]?t.includes(s):t.some((e=>e[0]<=s&&e[1]>=s)):"number"==typeof t[0]?t.some((e=>s[0]<=e&&s[1]>=e)):r?t.some((e=>e[0]===s[0]&&e[0]===s[1])):t.some((e=>e[0]>=s[0]&&e[0]<=s[1]||e[1]>=s[0]&&e[1]<=s[1]||e[0]<s[0]&&e[1]>s[1]))})))})),i.length&&r&&(0,o.pC)(r.start)&&(0,o.pC)(r.end)){const e=r.start.getTime(),t=r.end.getTime(),n=i[0].multidimensionalDefinition.findIndex((e=>"StdTime"===e.dimensionName));n>-1&&(i=i.filter((r=>{const i=r.multidimensionalDefinition[n].values[0];return e<=i&&t>=i})))}return i.map((e=>e.sliceId))}(d,(0,o.Wg)(f.multidimensionalDefinition),(0,o.Wg)(f.timeExtent));c=c.map((t=>e.map((e=>t[e])))),u=u?.map((t=>e.map((e=>t[e])))),d=e.map((e=>d[e]))}return{location:r,value:null,dataSeries:d.map(((e,t)=>{const r={value:c.map((e=>e[t])),multidimensionalDefinition:e.multidimensionalDefinition,variableName:e.multidimensionalDefinition[0].variableName,dimensionValues:{}};return u?.length&&(r.magdirValue=[u[0][t],u[1][t]]),e.multidimensionalDefinition.forEach((e=>r.dimensionValues[e.dimensionName]=e.values[0])),r})),pyramidLevel:n}}};(0,i._)([(0,h.Cb)()],se.prototype,"_rasterTileAlighmentInfo",void 0),(0,i._)([(0,h.Cb)({readOnly:!0})],se.prototype,"_isGlobalWrappableSource",null),(0,i._)([(0,h.Cb)(C.HQ)],se.prototype,"url",null),(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],se.prototype,"datasetName",void 0),(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],se.prototype,"datasetFormat",void 0),(0,i._)([(0,h.Cb)()],se.prototype,"rasterInfo",void 0),(0,i._)([(0,h.Cb)()],se.prototype,"ioConfig",void 0),(0,i._)([(0,h.Cb)()],se.prototype,"sourceJSON",void 0),se=(0,i._)([(0,p.j)("esri.layers.support.rasterDatasets.BaseRaster")],se);const ae=se;var oe=r(20095);function le(e){const t=e.fields,r=e.records,i=t.some((e=>"oid"===e.name.toLowerCase()))?"OBJECTID":"OID",n=[{name:i,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map((e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name})))),s=n.map((e=>e.name)),a=[];let o=0,l=0;return r.forEach((e=>{const t={};for(t[i]=o++,l=1;l<s.length;l++)t[s[l]]=e[l-1];a.push({attributes:t})})),{displayFieldName:"",fields:n,features:a}}var ce=r(87521),ue=r(74889);const he=new Map;he.set("int16","esriFieldTypeSmallInteger"),he.set("int32","esriFieldTypeInteger"),he.set("int64","esriFieldTypeInteger"),he.set("float32","esriFieldTypeSingle"),he.set("float64","esriFieldTypeDouble"),he.set("text","esriFieldTypeString");let fe=class extends ae{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:t}=await this.request(this.url+"/conf.json",{signal:e?.signal});if(!this._validateHeader(t))throw new a.Z("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:r,rasterInfo:i}=this._parseHeader(t);if("thematic"===i.dataType){const e=await this._fetchAuxiliaryInformation();i.attributeTable=e}this._set("storageInfo",r),this._set("rasterInfo",i),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,t,r,i={}){const{transposeInfo:n}=this.rasterInfo.storageInfo,{transposedVariableName:s}=i,a=!(!n||!s),o=a?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(o<0)return null;const l=this._buildCacheFilePath(o,t,r,i.multidimensionalDefinition,s),c=this._getIndexRecordFromBundle(t,r,a),u=await this.request(l,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:i.signal});if(!u)return null;const h=new Uint8Array(u.data),f=this._getTileEndAndContentType(h,c);if(0===f.recordSize)return null;const d=await this.request(l,{range:{from:f.position,to:f.position+f.recordSize},responseType:"array-buffer",signal:i.signal});if(!d)return null;const[m,p]=this._getTileSize(a);return this.decodePixelBlock(d.data,{width:m,height:p,planes:null,pixelType:null,returnPixelInterleavedDims:a})}_validateHeader(e){return e&&"RasterInfo"===e.type&&!["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"].some((t=>!e[t]))}_parseHeader(e){const t=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:r,histograms:i,colormap:n,blockWidth:s,blockHeight:a,firstPyramidLevel:o,maximumPyramidLevel:l}=e,c=e.statistics&&e.statistics.map((e=>({min:e.min,max:e.max,avg:e.mean,stddev:e.standardDeviation,median:e.median,mode:e.mode}))),u=e.extent.spatialReference,h=e.geodataXform?.spatialReference,f=new B.Z(u?.wkid||u?.wkt?u:h);let d=new N.Z({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:f});const m=new K.Z({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:f}),p=Math.round((d.xmax-d.xmin)/m.x),g=Math.round((d.ymax-d.ymin)/m.y),y=this._parseTransform(e.geodataXform),x=y?d:null;y&&(d=y.forwardTransform(d),m.x=(d.xmax-d.xmin)/p,m.y=(d.ymax-d.ymin)/g);const w=e.properties??{},b=e.format.toLowerCase().replace("cache/",""),I=new K.Z(e.origin.x,e.origin.y,f);let v,_,C,S;if(n&&n.colors)for(v=[],_=0;_<n.colors.length;_++)C=n.colors[_],S=n.values?n.values[_]:_,v.push([S,255&C,C<<16>>>24,C<<8>>>24,C>>>24]);const k=e.LODInfos,T=[];for(_=0;_<k.levels.length;_++)T.push({level:k.levels[_],resolution:k.resolutions[_],scale:96/.0254*k.resolutions[_]});const P=new R.Z({dpi:96,lods:T,format:b,origin:I,size:[s,a],spatialReference:f}),M={recordSize:8,packetSize:e.packetSize,headerSize:e.packetSize*e.packetSize*8+64},E=[{maxCol:Math.ceil(p/s)-1,maxRow:Math.ceil(g/a)-1,minCol:0,minRow:0}];let D=2;if(l>0)for(_=0;_<l;_++)E.push({maxCol:Math.ceil(p/D/s)-1,maxRow:Math.ceil(g/D/a)-1,minCol:0,minRow:0}),D*=2;const O=e.mdInfo;let F=null;if(O&&w._yxs){const e=w._yxs;F={packetSize:e.PacketSize,tileSize:[e.TileXSize,e.TileYSize]}}return{storageInfo:M,rasterInfo:new q.Z({width:p,height:g,pixelType:t,bandCount:r,extent:d,nativeExtent:x,transform:y,spatialReference:f,pixelSize:m,keyProperties:w,statistics:c,histograms:i,multidimensionalInfo:O,colormap:v,storageInfo:new G.Z({blockWidth:s,blockHeight:a,pyramidBlockWidth:s,pyramidBlockHeight:a,origin:I,tileInfo:P,transposeInfo:F,firstPyramidLevel:o,maximumPyramidLevel:l,blockBoundary:E})})}}_parseTransform(e){if(!(0,ce.j)(e))throw new a.Z("cloudraster:open","the data contains unsupported geodata transform types");const t=(0,ce.c)(e);if("identity"===t.type)return null;if("polynomial"!==t.type||!t.forwardCoefficients?.length||!t.inverseCoefficients?.length)throw new a.Z("cloudraster:open","the data contains unsupported geodata transforms - both forward and inverse coefficients are required currently");return t}async _fetchAuxiliaryInformation(e){const t=this.request(this.url+"/conf.vat.json",{signal:e}).then((e=>e.data)).catch((()=>null)),r=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then((e=>e.data)).catch((()=>null)),i=await Promise.all([t,r]);let n;if(i[0]){let e=i[0].fields;const t=i[0].values;if(e&&t){e=e.map((e=>({type:"OID"===e.name?"esriFieldTypeOID":he.get(e.type),name:e.name,alias:e.alias||e.name})));const r=t.map((e=>({attributes:e})));e&&t&&(n={fields:e,features:r})}}return!n&&i[1]&&(n=class{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),r=3&t.getUint8(0);if(3!==r)return{header:{version:r},recordSet:null};const i=t.getUint32(4,!0),n=t.getUint16(8,!0),s=t.getUint16(10,!0),a={version:r,recordCount:i,headerByteCount:n,recordByteCount:s};let o=32;const l=[],c=[];let u;if(3===r){for(;13!==t.getUint8(o);)u=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,oe.f)(new Uint8Array(e,o,11)),type:u,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(u)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;c.length<i&&e.byteLength-o>s;){const r=[];32===t.getUint8(o)?(o+=1,l.forEach((t=>{if("C"===t.type)r.push((0,oe.f)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)r.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)r.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const i=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();r.push(new Date(parseInt(i.substring(0,4),10),parseInt(i.substring(4,6),10)-1,parseInt(i.substring(6,8),10)))}o+=t.length})),c.push(r)):o+=s}}return{header:a,fields:l,records:c,recordSet:le({fields:l,records:c})}}}.parse(i[1]).recordSet),ue.default.fromJSON(n)}_buildCacheFilePath(e,t,r,i,n){const s=this._getPackageSize(!!n),a=Math.floor(t/s)*s,l=Math.floor(r/s)*s,c="R"+this._toHexString4(a)+"C"+this._toHexString4(l);let u="L";u+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:h}=this.rasterInfo,f=i?.[0];if((0,o.Wi)(h)||!f)return`${this.url}/_alllayers/${u}/${c}.bundle`;let d="_yxs";if(!n){d=h.variables.find((e=>e.name===f.variableName)).dimensions[0].values.indexOf(f.values[0]).toString(16);const e=4-d.length;for(let t=0;t<e;t++)d="0"+d;d="S"+d}const m=this._getVariableFolderName(n||f.variableName);return`${this.url}/_alllayers/${m}/${d}/${u}/${c}.bundle`}_getPackageSize(e=!1){const{transposeInfo:t}=this.rasterInfo.storageInfo;return e&&(0,o.pC)(t)?t.packetSize:this.storageInfo.packetSize}_getTileSize(e=!1){const{storageInfo:t}=this.rasterInfo,{transposeInfo:r}=t;return e&&(0,o.pC)(r)?r.tileSize:t.tileInfo.size}_getVariableFolderName(e){return""===(e=e.trim())?"_v":e.replace(/[\{|\}\-]/g,"_").replace("\\*","_v")}_getIndexRecordFromBundle(e,t,r=!1){const i=this._getPackageSize(r),n=i*(e%i)+t%i;if(n<0)throw"Invalid level / row / col";return 20+n*this.storageInfo.recordSize+44}_getTileEndAndContentType(e,t){const r=e.subarray(t,t+8);let i,n=0;for(i=0;i<5;i++)n|=(255&r[i])<<8*i;const s=0xffffffffff&n;for(n=0,i=5;i<8;i++)n|=(255&r[i])<<8*(i-5);return{position:s,recordSize:0xffffffffff&n}}_toHexString4(e){let t=e.toString(16);if(4!==t.length){let e=4-t.length;for(;e-- >0;)t="0"+t}return t}};(0,i._)([(0,h.Cb)({readOnly:!0})],fe.prototype,"storageInfo",void 0),(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],fe.prototype,"datasetFormat",void 0),fe=(0,i._)([(0,p.j)("esri.layers.support.rasterDatasets.CloudRaster")],fe);const de=fe;var me=r(15612);let pe=class extends ae{constructor(){super(...arguments),this.datasetFormat="MEMORY"}async open(e){await this.init();const{pixelBlock:t,statistics:r,histograms:i,name:n,keyProperties:s,nativeExtent:a,transform:o}=this.data,{width:l,height:c,pixelType:u}=t,h=this.data.extent||new N.Z({xmin:-.5,ymin:.5,xmax:l-.5,ymax:c-.5,spatialReference:new B.Z({wkid:3857})}),f=this.data.isPseudoSpatialReference??!this.data.extent,d={x:h.width/l,y:h.height/c},m=new q.Z({width:l,height:c,pixelType:u,extent:h,nativeExtent:a,transform:o,pixelSize:d,spatialReference:h.spatialReference,bandCount:3,keyProperties:s||{},statistics:r,isPseudoSpatialReference:f,histograms:i});this.createRemoteDatasetStorageInfo(m,512,512),this._set("rasterInfo",m),this.updateTileInfo(),await this._buildInMemoryRaster(t,{width:512,height:512},e),this.datasetName=n,this.url="/InMemory/"+n}fetchRawTile(e,t,r,i={}){const n=this._pixelBlockTiles.get(`${e}/${t}/${r}`);return Promise.resolve(n)}async _buildInMemoryRaster(e,t,r){const i=this.rasterInfo.storageInfo.maximumPyramidLevel,n=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:i},r):Promise.resolve((0,ne.Vl)(e,t,i)),s=(0,o.pC)(this.rasterInfo.statistics),l=(0,o.pC)(this.rasterInfo.histograms),u=s&&l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},r):Promise.resolve((0,me.Hv)(e)),h=await(0,c.as)([n,u]);if(!h[0].value&&h[1].value)throw new a.Z("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=h[0].value,s||(this.rasterInfo.statistics=h[1].value?.statistics),l&&(this.rasterInfo.histograms=h[1].value?.histograms)}};(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],pe.prototype,"datasetFormat",void 0),(0,i._)([(0,h.Cb)()],pe.prototype,"data",void 0),pe=(0,i._)([(0,p.j)("esri.layers.support.rasterDatasets.InMemoryRaster")],pe);const ge=pe;function ye(e,t){if(!e||!t)return[];let r=t;t.includes("/")?(r=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const i=[];if(t){const n=ye(e,r);for(let e=0;e<n.length;e++)ye(n[e],t).forEach((e=>i.push(e)));return i}const n=e.getElementsByTagNameNS("*",r);if(!n||0===n.length)return[];for(let e=0;e<n.length;e++)i.push(n[e]||n.item[e]);return i}function xe(e,t){if(!e||!t)return null;let r=t;t.includes("/")?(r=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const i=ye(e,r);return i.length>0?t?xe(i[0],t):i[0]:null}function we(e,t=null){const r=t?xe(e,t):e;let i;return r?(i=r.textContent||r.nodeValue,i?i.trim():null):null}function be(e,t){return function(e,t){const r=ye(e,t),i=[];let n;for(let e=0;e<r.length;e++)n=r[e].textContent||r[e].nodeValue,n&&(n=n.trim(),""!==n&&i.push(n));return i}(e,t).map((e=>Number(e)))}function Ie(e,t){const r=we(e,t);return Number(r)}function ve(e,t){const r=e?.nodeName?.toLowerCase(),i=t.toLowerCase();return r.slice(r.lastIndexOf(":")+1)===i}var _e=r(87390);function Ce(e,t){if(!e||!t)return null;const r=[];for(let i=0;i<e.length;i++)r.push(e[i]),r.push(t[i]);return r}function Se(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new B.Z({wkid:t});if((e=String(e)).startsWith("COMPD_CS")){if(!e.includes("VERTCS")||!e.includes("GEOGCS")&&!e.startsWith("PROJCS"))return null;const r=e.indexOf("VERTCS"),i=e.indexOf("PROJCS"),n=i>-1?i:e.indexOf("GEOGCS");if(-1===n)return null;const s=e.slice(n,e.lastIndexOf("]",r)+1).trim(),a=e.slice(r,e.lastIndexOf("]")).trim();t=ke(s);const o=new B.Z(t?{wkid:t}:{wkt:s}),l=ke(a);return l&&(o.vcsWkid=l),o}return e.startsWith("GEOGCS")||e.startsWith("PROJCS")?(t=ke(e),new B.Z(0!==t?{wkid:t}:{wkt:e})):null}function ke(e){const t=e.replace(/\]/g,"[").replace(/\"/g,"").split("[").map((e=>e.trim())).filter((e=>""!==e)),r=t[t.length-1].split(","),i=r[0]?.toLowerCase();if(("epsg"===i||"esri"===i)&&e.endsWith('"]]')){const e=Number(r[1]);if(!isNaN(e)&&0!==e)return e}return 0}function Re(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};const t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach((e=>{if(1===e.nodeType)if(ve(e,"SRS")){if(!t.spatialReference){const r=we(e);t.spatialReference=Se(r)}}else if(ve(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:r,transform:i}=function(e){const t=xe(e,"GeodataXform"),r=Se(Ie(t,"SpatialReference/WKID")||we(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:r,transform:null};const i=Ie(t,"PolynomialOrder")??1,n=be(t,"CoeffX/Double"),s=be(t,"CoeffY/Double"),a=be(t,"InverseCoeffX/Double"),o=be(t,"InverseCoeffY/Double"),l=Ce(n,s),c=Ce(a,o);return{spatialReference:r,transform:new _e.Z({spatialReference:r,polynomialOrder:i,forwardCoefficients:l,inverseCoefficients:c})}}(e);t.transform=i,t.spatialReference||(t.spatialReference=r)}else ye(e,"MDI").forEach((e=>t.metadata[e.getAttribute("key")]=we(e)));else if(ve(e,"PAMRasterBand")){const r=function(e){const t=Ie(e,"NoDataValue"),r=xe(e,"Histograms/HistItem"),i=Ie(r,"HistMin"),n=Ie(r,"HistMax"),s=Ie(r,"BucketCount"),a=we(r,"HistCounts")?.split("|").map((e=>Number(e)));let o,l,c,u;ye(e,"Metadata/MDI").forEach((e=>{const t=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":o=t;break;case"STATISTICS_MAXIMUM":l=t;break;case"STATISTICS_MEAN":c=t;break;case"STATISTICS_STDDEV":u=t}}));const h=Ie(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:a?.length&&null!=o&&null!=l?{min:i,max:n,size:s||a.length,counts:a}:null,sourceBandIndex:h,statistics:null!=o&&null!=l?{min:o,max:l,avg:c,stddev:u}:null}}(e);null!=r.sourceBandIndex&&null==t.rasterBands[r.sourceBandIndex]?t.rasterBands[r.sourceBandIndex]=r:t.rasterBands.push(r)}}));const r=t.rasterBands;if(r){const e=!!r[0].statistics;t.statistics=e?r.map((e=>e.statistics)):null;const i=!!r[0].histogram;t.histograms=i?r.map((e=>e.histogram)):null}return t}let Te=class extends ae{async open(e){await this.init();const t=await this._fetchData(e);let{spatialReference:r,statistics:i,histograms:n,transform:s}=await this._fetchAuxiliaryData(e);const a=!r;a&&(r=new B.Z({wkid:3857})),n?.length&&null==i&&(i=(0,me.Oh)(n));const{width:o,height:l}=t;let c=new N.Z({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:r});const u=s?s.forwardTransform(c):c;let h=!0;if(s){const e=s.forwardCoefficients;h=e&&0===e[1]&&0===e[2],h&&(s=null,c=u)}const f=new ge({data:{extent:u,nativeExtent:c,transform:s,pixelBlock:t,statistics:i,histograms:n,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:a}});await f.open(),this._set("rasterInfo",f.rasterInfo),this._inMemoryRaster=f}fetchRawTile(e,t,r,i={}){return this._inMemoryRaster.fetchRawTile(e,t,r,i)}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),r=(0,ie.y)(t).toUpperCase();if("JPG"!==r&&"PNG"!==r&&"GIF"!==r&&"BMP"!==r)throw new a.Z("image-aux-raster:open","the data is not a supported format");return this._set("datasetFormat",r),await this.decodePixelBlock(t,{format:"jpg",width:1,height:1,useCanvas:!0})}async _fetchAuxiliaryData(e){const t=(0,o.Wg)(e?.signal),r=this.ioConfig.skipExtensions??[],i=r.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),n=this.datasetFormat,s="JPG"===n?"jgw":"PNG"===n?"pgw":"BMP"===n?"bpw":null,a=r.includes(s)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+s,{responseType:"text",signal:t}),l=await(0,c.as)([i,a]);if(t?.aborted)throw(0,c.zE)();const u=Re(l[0].value?.data);if(!u.transform){const e=l[1].value?l[1].value.data.split("\n").slice(0,6).map((e=>Number(e))):null;u.transform=6===e?.length?new _e.Z({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return u}};(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],Te.prototype,"datasetFormat",void 0),Te=(0,i._)([(0,p.j)("esri.layers.support.rasterDatasets.ImageAuxRaster")],Te);const Pe=Te;var Me=r(17452),Ee=r(45322),De=r(56608),Oe=r(29680),Fe=r(26059);let Ne=class extends ae{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer"}async open(e){await this.init();const t=e&&e.signal,r=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});r.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const i=r.data;if(this.sourceJSON=i,!i)throw new a.Z("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!i.tileInfo)throw new a.Z("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=i.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(i.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===i.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=i.name.slice(i.name.indexOf("/")+1);const n=await this._fetchRasterInfo({signal:t});if(!(0,o.pC)(n))throw new a.Z("image-server-raster:open","cannot initialize image service");{const e="Map"===this.tileType?(0,Ee.d)(i.tileInfo,i):R.Z.fromJSON(i.tileInfo),{extent:t,pixelSize:r}=n,s=.5/n.width*r.x;let a,o;const l=e.lodAt(Math.max.apply(null,e.lods.map((e=>e.level))));"Map"!==this.tileType&&0!==i.maxScale&&("Raster"===this.tileType?(a=e.lods.find((e=>e.resolution===r.x)),a||(a=e.lods[e.lods.length-1])):(a=e.lods.find((e=>Math.abs(e.scale-i.maxScale)<s)),a||(a=e.lods.filter((e=>e.scale>i.maxScale)).sort(((e,t)=>e.scale>t.scale?1:-1))[0])),r.x=r.y=a.resolution,n.width=Math.ceil((t.xmax-t.xmin)/r.x-.1),n.height=Math.ceil((t.ymax-t.ymin)/r.y-.1)),a||(a=l);const c=e.lodAt(Math.min.apply(null,e.lods.map((e=>e.level))));"Map"===this.tileType?this._levelOffset=e.lods[0].level:0!==i.minScale&&"Elevation"===this.tileType&&(o=e.lods.find((e=>Math.abs(e.scale-i.minScale)<s)),this._levelOffset=o.level-c.level),o||(o=c);const u=Math.max(r.x,r.y);(Math.abs(r.x-r.y)>s||!e.lods.some((e=>Math.abs(e.resolution-u)<s)))&&(r.x=r.y=a.resolution,n.width=Math.ceil((t.xmax-t.xmin)/r.x-.1),n.height=Math.ceil((t.ymax-t.ymin)/r.y-.1));const h=a.level-o.level,[f,d]=e.size,m=[];e.lods.forEach((e=>{e.level>=o.level&&e.level<=a.level&&m.push({x:e.resolution,y:e.resolution})})),m.sort(((e,t)=>e.x-t.x));const p=this.computeBlockBoundary(t,f,d,e.origin,m,h),g=m.length>1?m.slice(1):null;let y;i.transposeInfo&&(y={tileSize:[i.transposeInfo.rows,i.transposeInfo.cols],packetSize:n.keyProperties?._yxs.PacketSize??0}),n.storageInfo=new G.Z({blockWidth:e.size[0],blockHeight:e.size[1],pyramidBlockWidth:e.size[0],pyramidBlockHeight:e.size[1],pyramidResolutions:g,compression:e.format,origin:e.origin,firstPyramidLevel:1,maximumPyramidLevel:h,tileInfo:e,transposeInfo:y,blockBoundary:p}),this._fixGCSShift(n),this._set("rasterInfo",n)}if(i.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:n.storageInfo.tileInfo,parsedUrl:(0,Me.mN)(this.url),url:this.url,tileServers:[],type:"tile"};this._tilemapCache=new De.y({layer:e})}}async fetchRawTile(e,t,r,i={}){const{storageInfo:n,extent:s}=this.rasterInfo,{transposeInfo:a}=n,l=(0,o.pC)(a)&&!!i.transposedVariableName;if(this._slices&&!l&&null==i.sliceId)return null;const c=l?0:n.maximumPyramidLevel-e+this._levelOffset,u=`${this.url}/tile/${c}/${t}/${r}`,h=this._slices?l?{variable:i.transposedVariableName}:{sliceId:i.sliceId||0}:null,{data:f}=await this.request(u,{query:h,responseType:"array-buffer",signal:i.signal});if(!f)return null;const d=l?a.tileSize:n.tileInfo.size,m=await this.decodePixelBlock(f,{width:d[0],height:d[1],planes:null,pixelType:null,isPoint:"Elevation"===this.tileType,returnPixelInterleavedDims:l}),p=n.blockBoundary[e];if("jpg"!==n.compression||r>p.minCol&&r<p.maxCol&&t>p.minRow&&t<p.maxRow)return m;const{origin:g,blockWidth:y,blockHeight:x}=n,{x:w,y:b}=this.getPyramidPixelSize(e),I=Math.round((s.xmin-g.x)/w)%y,v=Math.round((s.xmax-g.x)/w)%y||y,_=Math.round((g.y-s.ymax)/b)%x,C=Math.round((g.y-s.ymin)/b)%x||x,S=r===p.minCol?I:0,k=t===p.minRow?_:0,R=r===p.maxCol?v:y,T=t===p.maxRow?C:x;return(0,ne.pW)(m,{x:S,y:k},{width:R-S,height:T-k}),m}getSliceIndex(e){if(!this._slices||(0,o.Wi)(e)||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const r=this._slices[e].multidimensionalDefinition;if(r.length===t.length&&!r.some((e=>{const r=t.find((t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName));return!r||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(r.values[0])?`${r.values[0][0]}-${r.values[0][1]}`:r.values[0])})))return e}return null}async fetchVariableStatisticsHistograms(e,t){const r=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.statistics)),i=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.histograms)),n=await Promise.all([r,i]);return n[0]&&n[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:n[0]||null,histograms:n[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let r=this.identifyPixelLocation(e,0,(0,o.Wg)(t.datumTransformation));if(null===r)return null;let i=0;const{maximumPyramidLevel:n}=this.rasterInfo.storageInfo;let s=n-i+this._levelOffset;const a=r.srcLocation;for(;s>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(s,r.row,r.col,t))break}catch{}if(s--,i++,r=this.identifyPixelLocation(a,i,(0,o.Wg)(t.datumTransformation)),null===r)return null}return-1===s||null==r?null:i}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=Math.ceil((t.extent.xmax-t.extent.xmin)/t.pixelSizeX-.1),r=Math.ceil((t.extent.ymax-t.extent.ymin)/t.pixelSizeY-.1),i=B.Z.fromJSON(t.spatialReference||t.extent.spatialReference),n=new K.Z({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:i});return new q.Z({width:e,height:r,bandCount:3,extent:N.Z.fromJSON(t.extent),spatialReference:i,pixelSize:n,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:r}=e,i=(0,Fe.g)(this.url,this.sourceJSON,{signal:r,query:this.ioConfig.customFetchParameters}),n=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:r}).then((e=>e.data&&e.data.slices)).catch((()=>null)):null,s=await Promise.all([i,n]);return this._slices=s[1],s[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_fixGCSShift(e){const{extent:t,spatialReference:r}=e;0===t.xmin&&360===t.xmax&&r.wkid&&r.isGeographic&&(e.nativeExtent=e.extent,e.transform=new Oe.Z,e.extent=e.transform.forwardTransform(t))}};(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],Ne.prototype,"datasetFormat",void 0),(0,i._)([(0,h.Cb)()],Ne.prototype,"tileType",void 0),Ne=(0,i._)([(0,p.j)("esri.layers.support.rasterDatasets.ImageServerRaster")],Ne);const Be=Ne;var ze=r(54163),Le=r(48279);const Ae=new Map;Ae.set("Int8","s8"),Ae.set("UInt8","u8"),Ae.set("Int16","s16"),Ae.set("UInt16","u16"),Ae.set("Int32","s32"),Ae.set("UInt32","u32"),Ae.set("Float32","f32"),Ae.set("Float64","f32"),Ae.set("Double64","f32");const Ze=new Map;Ze.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Ze.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Ze.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Ze.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let He=class extends ae{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async open(e){await this.init(),this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const t=e?(0,o.Wg)(e.signal):null,r=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:i,files:n}=this._parseHeader(r.data);if(-1===this.ioConfig.skipExtensions?.indexOf("aux.xml")){const t=await this._fetchAuxiliaryData(e);null!=t&&(i.statistics=t.statistics??i.statistics,i.histograms=t.histograms,t.histograms&&(0,o.Wi)(i.statistics)&&(i.statistics=(0,me.Oh)(t.histograms)))}this._set("rasterInfo",i),this._files=n;const s=await this.request(n.index,{responseType:"array-buffer",signal:t});this._storageIndex=this._parseIndex(s.data);const{blockWidth:a,blockHeight:l}=this.rasterInfo.storageInfo,c=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:u,height:h}=this.rasterInfo,f=[],d=this._getBandSegmentCount();let m=0,p=-1;for(;m<this._storageIndex.length;){p++;const e=Math.ceil(u/a/c**p)-1,t=Math.ceil(h/l/c**p)-1;m+=(e+1)*(t+1)*d*4,f.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=f,p>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=p),this.updateTileInfo()}async fetchRawTile(e,t,r,i={}){const{blockWidth:n,blockHeight:s,blockBoundary:a}=this.rasterInfo.storageInfo,l=a[e];if(!l||l.maxRow<t||l.maxCol<r||l.minRow>t||l.minCol>r)return null;const{bandCount:c,pixelType:u}=this.rasterInfo,{ranges:h,actualTileWidth:f,actualTileHeight:d}=this._getTileLocation(e,t,r);if(!h||0===h.length)return null;if(0===h[0].from&&0===h[0].to){const e=new Uint8Array(n*s);return new ze.Z({width:n,height:s,pixels:null,mask:e,validPixelCount:0})}const{bandIds:m}=this.ioConfig,p=this._getBandSegmentCount(),g=[];let y=0;for(y=0;y<p;y++)(!m||m.indexOf[y]>-1)&&g.push(this.request(this._files.data,{range:{from:h[y].from,to:h[y].to},responseType:"array-buffer",signal:i.signal}));const x=await Promise.all(g),w=x.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),b=new Uint8Array(w);let I=0;for(y=0;y<p;y++)b.set(new Uint8Array(x[y].data),I),I+=x[y].data.byteLength;const v=Ze.get(this.rasterInfo.storageInfo.compression).decoderFormat,_=await this.decodePixelBlock(b.buffer,{width:n,height:s,format:v,planes:m?.length||c,pixelType:u});if((0,o.pC)(this.rasterInfo.noDataValue)&&"lerc"!==v&&!_.mask){const e=this.rasterInfo.noDataValue[0];if(null!=e){const t=_.width*_.height,r=new Uint8Array(t);if(Math.abs(e)>1e24)for(y=0;y<t;y++)Math.abs((_.pixels[0][y]-e)/e)>1e-6&&(r[y]=1);else for(y=0;y<t;y++)_.pixels[0][y]!==e&&(r[y]=1);_.mask=r}}let C=0,S=0;if(f!==n||d!==s){let e=_.mask;if(e)for(y=0;y<s;y++)if(S=y*n,y<d)for(C=f;C<n;C++)e[S+C]=0;else for(C=0;C<n;C++)e[S+C]=0;else for(e=new Uint8Array(n*s),_.mask=e,y=0;y<d;y++)for(S=y*n,C=0;C<f;C++)e[S+C]=1}return _}_parseIndex(e){if(e.byteLength%16>0)throw"invalid array buffer must be multiples of 16";let t,r,i,n,s,a;if(Le.f){for(r=new Uint8Array(e),n=new ArrayBuffer(e.byteLength),i=new Uint8Array(n),s=0;s<e.byteLength/4;s++)for(a=0;a<4;a++)i[4*s+a]=r[4*s+3-a];t=new Uint32Array(n)}else t=new Uint32Array(e);return t}_getBandSegmentCount(){return Ze.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,r){const{blockWidth:i,blockHeight:n,pyramidScalingFactor:s}=this.rasterInfo.storageInfo,{width:a,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let c,u,h,f=0,d=0;for(h=0;h<e;h++)d=s**h,c=Math.ceil(a/i/d),u=Math.ceil(o/n/d),f+=c*u;d=s**e,c=Math.ceil(a/i/d),u=Math.ceil(o/n/d),f+=t*c+r,f*=4*l;const m=this._storageIndex.subarray(f,f+4*l);let p=0,g=0;const y=[];for(let e=0;e<l;e++)p=m[4*e+0]*2**32+m[4*e+1],g=p+m[4*e+2]*2**32+m[4*e+3],y.push({from:p,to:g});return{ranges:y,actualTileWidth:r<c-1?i:Math.ceil(a/d)-i*(c-1),actualTileHeight:t<u-1?n:Math.ceil(o/d)-n*(u-1)}}_parseHeader(e){const t=xe(e,"MRF_META/Raster");if(!t)throw new a.Z("mrf:open","not a valid MRF format");const r=xe(t,"Size"),i=parseInt(r.getAttribute("x"),10),n=parseInt(r.getAttribute("y"),10),s=parseInt(r.getAttribute("c"),10),o=(we(t,"Compression")||"none").toLowerCase();if(!Ze.has(o))throw new a.Z("mrf:open","currently does not support compression "+o);const l=we(t,"DataType")||"UInt8",c=Ae.get(l);if(null==c)throw new a.Z("mrf:open","currently does not support pixel type "+l);const u=xe(t,"PageSize"),h=parseInt(u.getAttribute("x"),10),f=parseInt(u.getAttribute("y"),10),d=xe(t,"DataValues");let m,p;if(d&&(p=d.getAttribute("NoData"),null!=p&&(m=p.trim().split(" ").map((e=>parseFloat(e))))),xe(e,"MRF_META/CachedSource"))throw new a.Z("mrf:open","currently does not support MRF referencing other data files");const g=xe(e,"MRF_META/GeoTags"),y=xe(g,"BoundingBox");let x,w=!1;if(null!=y){const e=parseFloat(y.getAttribute("minx")),t=parseFloat(y.getAttribute("miny")),r=parseFloat(y.getAttribute("maxx")),i=parseFloat(y.getAttribute("maxy")),n=we(g,"Projection")||"";let s;if("LOCAL_CS[]"!==n)if(n.toLowerCase().startsWith("epsg:")){const e=Number(n.slice(5));isNaN(e)||0===e||(s=new B.Z({wkid:e}))}else s=Se(n);else w=!0,s=new B.Z({wkid:3857});x=new N.Z(e,t,r,i),x.spatialReference=s}else w=!0,x=new N.Z({xmin:-.5,ymin:.5-n,xmax:i-.5,ymax:.5,spatialReference:new B.Z({wkid:3857})});const b=xe(e,"MRF_META/Rsets"),I=parseInt(b&&b.getAttribute("scale")||"2",10),v=x.spatialReference,_=new G.Z({origin:new K.Z({x:x.xmin,y:x.ymax,spatialReference:v}),blockWidth:h,blockHeight:f,pyramidBlockWidth:h,pyramidBlockHeight:f,compression:o,pyramidScalingFactor:I}),C=new K.Z({x:x.width/i,y:x.height/n,spatialReference:v}),S=new q.Z({width:i,height:n,extent:x,isPseudoSpatialReference:w,spatialReference:v,bandCount:s,pixelType:c,pixelSize:C,noDataValue:m,storageInfo:_}),k=we(e,"datafile"),R=we(e,"IndexFile");return{rasterInfo:S,files:{mrf:this.url,index:R||this.url.replace(".mrf",".idx"),data:k||this.url.replace(".mrf",Ze.get(o).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Re(t)}catch{return null}}};(0,i._)([(0,h.Cb)()],He.prototype,"_files",void 0),(0,i._)([(0,h.Cb)()],He.prototype,"_storageIndex",void 0),(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],He.prototype,"datasetFormat",void 0),He=(0,i._)([(0,p.j)("esri.layers.support.rasterIO.MRFRaster")],He);const We=He;var Je=r(94793),je=r(9832);const Ue=(e,t)=>{const r=e.get(t);return r&&r.values},qe=(e,t)=>{const r=e.get(t);return r&&r.values[0]};let Ge=class extends ae{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(e){await this.init();const t=e?(0,o.Wg)(e.signal):null,{data:r}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!r)throw new a.Z("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{littleEndian:i,firstIFD:n,isBigTiff:s}=(0,Je.cK)(r),l=[];await this._readIFDs(l,r,i,n,0,s?8:4,t);const c=(0,Je.FI)(l),{width:u,height:h,tileWidth:f,tileHeight:d,planes:m,pixelType:p,compression:g,firstPyramidLevel:y,maximumPyramidLevel:x,pyramidBlockWidth:w,pyramidBlockHeight:b,tileBoundary:I,affine:v,metadata:_}=c;let C=Se(c.extent.spatialReference?.wkt||c.extent.spatialReference?.wkid),S=!1;null==C&&(S=!0,C=new B.Z({wkid:3857}));const k=new N.Z({...c.extent,spatialReference:C}),R=new K.Z(k?{x:k.xmin,y:k.ymax,spatialReference:C}:{x:0,y:0}),T=new G.Z({blockWidth:f,blockHeight:d,pyramidBlockWidth:w,pyramidBlockHeight:b,compression:g,origin:R,firstPyramidLevel:y,maximumPyramidLevel:x,blockBoundary:I}),P=new K.Z({x:(k.xmax-k.xmin)/u,y:(k.ymax-k.ymin)/h,spatialReference:C}),M=_?{BandProperties:_.bandProperties,DataType:_.dataType}:{},E=new q.Z({width:u,height:h,bandCount:m,pixelType:p,compression:g,pixelSize:P,storageInfo:T,spatialReference:C,isPseudoSpatialReference:S,keyProperties:M,extent:k,statistics:_?_.statistics:null});if(v?.length&&(E.nativeExtent=new N.Z({xmin:-.5,ymin:.5-h,xmax:u-.5,ymax:.5,spatialReference:C}),E.transform=new _e.Z({polynomialOrder:1,forwardCoefficients:[v[2]+v[0]/2,v[5]-v[3]/2,v[0],v[3],-v[1],-v[4]]}),E.extent=E.transform.forwardTransform(E.nativeExtent),E.pixelSize=new K.Z({x:(k.xmax-k.xmin)/u,y:(k.ymax-k.ymin)/h,spatialReference:C}),T.origin.x=-.5,T.origin.y=.5),!this.ioConfig.skipExtensions?.includes("aux.xml")){const t=await this._fetchAuxiliaryData(e);if(null!=t){if(E.statistics=t.statistics??E.statistics,E.histograms=t.histograms,t.histograms&&(0,o.Wi)(E.statistics)&&(E.statistics=(0,me.Oh)(t.histograms)),t.transform&&!v){E.transform=t.transform,E.nativeExtent=E.extent;const e=E.transform.forwardTransform(E.nativeExtent);E.pixelSize=new K.Z({x:(e.xmax-e.xmin)/u,y:(e.ymax-e.ymin)/h,spatialReference:C}),E.extent=e}E.spatialReference||(E.spatialReference=t.spatialReference)}}if(this._set("rasterInfo",E),this._headerInfo={littleEndian:i,isBigTiff:s,ifds:l,...c},!this._headerInfo.isSupported)throw new a.Z("tiffraster:open","this tiff is not supported: "+this._headerInfo.message);this.updateTileInfo()}async fetchRawTile(e,t,r,i={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,r))return null;const n=this._getTileLocation(e,t,r);if(!n)return null;const{ranges:s,actualTileWidth:a,actualTileHeight:o,ifd:l}=n,c=s.map((e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:i.signal}))),u=await Promise.all(c),h=u.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),f=1===u.length?u[0].data:new ArrayBuffer(h),d=[0],m=[0];if(u.length>1){const e=new Uint8Array(f);for(let t=0,r=0;t<u.length;t++){const i=u[t].data;e.set(new Uint8Array(i),r),d[t]=r,r+=i.byteLength,m[t]=i.byteLength}}const{blockWidth:p,blockHeight:g}=this.getBlockWidthHeight(e),y=await this.decodePixelBlock(f,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:l,offsets:d,sizes:m},width:p,height:g,planes:null,pixelType:null});let x,w,b;if(a!==p||o!==g){let e=y.mask;if(e)for(x=0;x<g;x++)if(b=x*p,x<o)for(w=a;w<p;w++)e[b+w]=0;else for(w=0;w<p;w++)e[b+w]=0;else for(e=new Uint8Array(p*g),y.mask=e,x=0;x<o;x++)for(b=x*p,w=0;w<a;w++)e[b+w]=1}return y}async _readIFDs(e,t,r,i,n,s=4,a){if(!i)return null;(i>=t.byteLength||i<0)&&(t=(await this.request(this.url,{range:{from:i+n,to:i+n+this._bufferSize},responseType:"array-buffer",signal:a})).data,n=i+n,i=0);const o=await this._readIFD(t,r,i,n,je.Z.TIFF_TAGS,s,a);if(e.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(e,t,r,o.nextIFD-n,n,s,a)}async _readIFD(e,t,r,i,n=je.Z.TIFF_TAGS,s=4,a){if(!e)return null;const o=(0,Je.vr)(e,t,r,i,n,s);if(o.success){const r=[];if(o.ifd.forEach((e=>{e.values||r.push(e)})),r.length>0){const n=r.map((e=>e.offlineOffsetSize)),s=Math.min.apply(null,n.map((e=>e[0])));if(Math.min.apply(null,n.map((e=>e[0]+e[1])))-s<=this._bufferSize){const{data:n}=await this.request(this.url,{range:{from:s,to:s+this._bufferSize},responseType:"array-buffer",signal:a});e=n,i=s,r.forEach((r=>(0,Je.Dq)(e,t,r,i)))}}if(o.ifd.has("GEOKEYDIRECTORY")){const r=o.ifd.get("GEOKEYDIRECTORY"),n=r.values;if(n&&n.length>4){const s=n[0]+"."+n[1]+"."+n[2],o=await this._readIFD(e,t,r.valueOffset+6-i,i,je.Z.GEO_KEYS,2,a);r.data=o.ifd,r.data&&r.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[s]})}}return o}if(o.requiredBufferSize&&o.requiredBufferSize!==e.byteLength){const r=await this.request(this.url,{range:{from:i,to:i+o.requiredBufferSize+4},responseType:"array-buffer",signal:a});return(e=r.data).byteLength<o.requiredBufferSize?null:this._readIFD(e,t,0,i,je.Z.TIFF_TAGS,4,a)}}_getTileLocation(e,t,r){const{firstPyramidLevel:i,blockBoundary:n}=this.rasterInfo.storageInfo,s=0===e?0:e-(i-1),a=this._headerInfo.ifds[s];if(!a)return null;const o=(0,Je.If)(a,this._headerInfo),l=Ue(a,"TILEOFFSETS");if(void 0===l)return null;const c=Ue(a,"TILEBYTECOUNTS"),{minRow:u,minCol:h,maxRow:f,maxCol:d}=n[s];if(t>f||r>d||t<u||r<h)return null;const m=qe(a,"IMAGEWIDTH"),p=qe(a,"IMAGELENGTH"),g=qe(a,"TILEWIDTH"),y=qe(a,"TILELENGTH"),x=o?this.rasterInfo.bandCount:1,w=x*t*(d+1)+r,b=[{from:l[w],to:l[w+x-1]+c[w+x-1]-1}];if(o){let e=!0;for(let t=0;t<x;t++)if(l[w+t]+c[w+t]!==l[w+t+1]){e=!1;break}if(!e)for(let e=0;e<x;e++)b[e]={from:l[w+e],to:l[w+e]+c[w+e]-1}}const I=l[w],v=c[w];return null==I||null==v?null:{ranges:b,ifd:a,actualTileWidth:r===d?m%g:g,actualTileHeight:t===f?p%y:y}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Re(t)}catch{return null}}};(0,i._)([(0,h.Cb)()],Ge.prototype,"_files",void 0),(0,i._)([(0,h.Cb)()],Ge.prototype,"_headerInfo",void 0),(0,i._)([(0,h.Cb)()],Ge.prototype,"_bufferSize",void 0),(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],Ge.prototype,"datasetFormat",void 0),Ge=(0,i._)([(0,p.j)("esri.layers.support.rasterDatasets.TIFFRaster")],Ge);const $e=Ge,Ve=new Map;Ve.set("CRF",{desc:"Cloud Raster Format",constructor:de}),Ve.set("MRF",{desc:"Meta Raster Format",constructor:We}),Ve.set("TIFF",{desc:"GeoTIFF",constructor:$e}),Ve.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Be}),Ve.set("JPG",{desc:"JPG Raster Format",constructor:Pe}),Ve.set("PNG",{desc:"PNG Raster Format",constructor:Pe}),Ve.set("GIF",{desc:"GIF Raster Format",constructor:Pe}),Ve.set("BMP",{desc:"BMP Raster Format",constructor:Pe});var Ye=r(32163);let Ke=class extends((0,y.h)((0,W.M)((0,A.q)((0,Z.I)((0,x.N)(L((0,J.n)((0,H.Q)((0,l.R)(g.Z)))))))))){constructor(...e){super(...e),this.bandIds=null,this.interpolation=null,this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.title=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=(0,o.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(c.r9).then((()=>this._openRaster(t)))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){let e=[new j.Z({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"})];const t=this.rasterInfo?.attributeTable?.fields;if(t){const r=t.filter((e=>"oid"!==e.type&&"value"!==e.name.toLowerCase())).map((e=>{const t=e.clone();return t.name="Raster."+e.name,t}));e=e.concat(r)}const r=this.rasterInfo.dataType;if(("vector-magdir"===r||"vector-uv"===r)&&(0,o.pC)(this.rasterInfo.multidimensionalInfo)){const t=this.rasterInfo.multidimensionalInfo.variables[0].unit?.trim(),r="Magnitude"+(t?` (${t})`:"");e.push(new j.Z({name:"Raster.Magnitude",alias:r,domain:null,editable:!1,type:"double"})),e.push(new j.Z({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return e}set renderer(e){this._set("renderer",e),this.updateRenderer()}readRenderer(e,t,r){const i=t&&t.layerDefinition&&t.layerDefinition.drawingInfo&&t.layerDefinition.drawingInfo.renderer,n=(0,s.ij)(i,r)||void 0;if(null!=n)return n}createPopupTemplate(e){return(0,Ye.eZ)({fields:this.rasterFields,title:this.title},e)}write(e,t){const{raster:r}=this;if(this.loaded?"RasterTileServer"===r.datasetFormat&&("Raster"===r.tileType||"Map"===r.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t&&t.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new a.Z("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){this.raster?(this.raster.rasterInfo||await this.raster.open(),this.url=this.raster.url):this.raster=await class{static get supportedFormats(){const e=new Set;return Ve.forEach(((t,r)=>e.add(r))),e}static async open(e){const{url:t,ioConfig:r,sourceJSON:i}=e;let n=e.datasetFormat;null==n&&t.lastIndexOf(".")&&(n=t.slice(t.lastIndexOf(".")+1).toUpperCase()),"OVR"===n||"TIF"===n?n="TIFF":"JPG"!==n&&"JPEG"!==n&&"JFIF"!==n||(n="JPG"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");const s={url:t,sourceJSON:i,datasetFormat:n,ioConfig:r||{bandIds:null,sampling:null}};let o,l;if(this.supportedFormats.has(n))return o=Ve.get(n).constructor,l=new o(s),await l.open({signal:e.signal}),l;if(n)throw new a.Z("rasterfactory:open","not a supported format "+n);const c=Array.from(Ve.keys());let u=0;const h=()=>(n=c[u++],n?(o=Ve.get(n).constructor,l=new o(s),l.open({signal:e.signal}).then((()=>l)).catch((()=>h()))):null);return h()}static register(e,t,r){Ve.has(e.toUpperCase())||Ve.set(e.toUpperCase(),{desc:t,constructor:r})}}.open({url:this.url,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});const{rasterInfo:t}=this.raster;if(!t)throw new a.Z("imagery-tile-layer:load","cannot load resources on "+this.url);if(this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}null==this.title&&(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.own((0,u.YP)((()=>this.customParameters),(e=>{this.raster.ioConfig.customFetchParameters=e})))}};(0,i._)([(0,h.Cb)({type:[f.z8],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],Ke.prototype,"bandIds",void 0),(0,i._)([(0,h.Cb)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,d.J)(U.c)],Ke.prototype,"interpolation",void 0),(0,i._)([(0,h.Cb)({json:{write:!0}})],Ke.prototype,"multidimensionalDefinition",void 0),(0,i._)([(0,h.Cb)(C.rn)],Ke.prototype,"legendEnabled",void 0),(0,i._)([(0,h.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Ke.prototype,"isReference",void 0),(0,i._)([(0,h.Cb)({type:["show","hide"]})],Ke.prototype,"listMode",void 0),(0,i._)([(0,h.Cb)()],Ke.prototype,"sourceJSON",void 0),(0,i._)([(0,h.Cb)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],Ke.prototype,"version",void 0),(0,i._)([(0,h.Cb)()],Ke.prototype,"title",void 0),(0,i._)([(0,h.Cb)({readOnly:!0,json:{read:!1}})],Ke.prototype,"type",void 0),(0,i._)([(0,h.Cb)({type:["ArcGISTiledImageServiceLayer"]})],Ke.prototype,"operationalLayerType",void 0),(0,i._)([(0,h.Cb)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,r){t[r]=!e}}}})],Ke.prototype,"popupEnabled",void 0),(0,i._)([(0,h.Cb)({type:n.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],Ke.prototype,"popupTemplate",void 0),(0,i._)([(0,h.Cb)({readOnly:!0})],Ke.prototype,"defaultPopupTemplate",null),(0,i._)([(0,h.Cb)({readOnly:!0,type:[j.Z]})],Ke.prototype,"fields",void 0),(0,i._)([(0,h.Cb)({readOnly:!0,type:[j.Z]})],Ke.prototype,"rasterFields",null),(0,i._)([(0,h.Cb)({types:s.dr,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:s.FK,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],Ke.prototype,"renderer",null),(0,i._)([(0,m.r)("renderer")],Ke.prototype,"readRenderer",null),Ke=(0,i._)([(0,p.j)("esri.layers.ImageryTileLayer")],Ke);const Xe=Ke},74889:(e,t,r)=>{r.r(t),r.d(t,{default:()=>b});var i,n=r(43697),s=r(66577),a=r(38171),o=r(35454),l=r(96674),c=r(22974),u=r(70586),h=r(5600),f=(r(75215),r(71715)),d=r(52011),m=r(30556),p=r(82971),g=r(33955),y=r(1231);const x=new o.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let w=i=class extends l.wq{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){const r=p.Z.fromJSON(t.spatialReference),i=[];for(let t=0;t<e.length;t++){const n=e[t],s=a.Z.fromJSON(n),o=n.geometry&&n.geometry.spatialReference;(0,u.pC)(s.geometry)&&!o&&(s.geometry.spatialReference=r);const l=n.aggregateGeometries,c=s.aggregateGeometries;if(l&&(0,u.pC)(c))for(const e in c){const t=c[e],i=l[e]?.spatialReference;(0,u.pC)(t)&&!i&&(t.spatialReference=r)}i.push(s)}return i}writeGeometryType(e,t,r,i){if(e)return void x.write(e,t,r,i);const{features:n}=this;if(n)for(const e of n)if(e&&(0,u.pC)(e.geometry))return void x.write(e.geometry.type,t,r,i)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,i=(0,g.im)(e);return!r&&t.spatialReference&&(i.spatialReference=p.Z.fromJSON(t.spatialReference)),i}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&(0,u.pC)(e.geometry)&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new i(this.cloneProperties())}cloneProperties(){return(0,c.d9)({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 i=t.features[r];if(i.geometry){const t=e&&e[r];i.geometry=t&&t.toJSON()||i.geometry}}return t}quantize(e){const{scale:[t,r],translate:[i,n]}=e,s=this.features,a=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-i)/t)),(e=>Math.round((n-e)/r)));for(let e=0,t=s.length;e<t;e++)a((0,u.Wg)(s[e].geometry))||(s.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:[i,n],scale:[s,a]}=r,o=this._getHydrationFunction(e,(e=>e*s+i),(e=>n-e*a));for(const{geometry:e}of t)(0,u.pC)(e)&&o(e);return this.transform=null,this}_quantizePoints(e,t,r){let i,n;const s=[];for(let a=0,o=e.length;a<o;a++){const o=e[a];if(a>0){const e=t(o[0]),a=r(o[1]);e===i&&a===n||(s.push([e-i,a-n]),i=e,n=a)}else i=t(o[0]),n=r(o[1]),s.push([i,n])}return s.length>0?s: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 i=(0,g.oU)(e)?e.rings:e.paths,n=[];for(let e=0,s=i.length;e<s;e++){const s=i[e],a=this._quantizePoints(s,t,r);a&&n.push(a)}return n.length>0?((0,g.oU)(e)?e.rings=n:e.paths=n,e):null}:"multipoint"===e?e=>{const i=this._quantizePoints(e.points,t,r);return i.length>0?(e.points=i,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y)}:"polyline"===e||"polygon"===e?e=>{const i=(0,g.oU)(e)?e.rings:e.paths;let n,s;for(let e=0,a=i.length;e<a;e++){const a=i[e];for(let e=0,i=a.length;e<i;e++){const i=a[e];e>0?(n+=i[0],s+=i[1]):(n=i[0],s=i[1]),i[0]=t(n),i[1]=r(s)}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax)}:"multipoint"===e?e=>{const i=e.points;let n,s;for(let e=0,a=i.length;e<a;e++){const a=i[e];e>0?(n+=a[0],s+=a[1]):(n=a[0],s=a[1]),a[0]=t(n),a[1]=r(s)}}:void 0}};(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],w.prototype,"displayFieldName",void 0),(0,n._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"exceededTransferLimit",void 0),(0,n._)([(0,h.Cb)({type:[a.Z],json:{write:!0}})],w.prototype,"features",void 0),(0,n._)([(0,f.r)("features")],w.prototype,"readFeatures",null),(0,n._)([(0,h.Cb)({type:[y.Z],json:{write:!0}})],w.prototype,"fields",void 0),(0,n._)([(0,h.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:x.read}}})],w.prototype,"geometryType",void 0),(0,n._)([(0,m.c)("geometryType")],w.prototype,"writeGeometryType",null),(0,n._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasM",void 0),(0,n._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasZ",void 0),(0,n._)([(0,h.Cb)({types:s.qM,json:{write:!0}})],w.prototype,"queryGeometry",void 0),(0,n._)([(0,f.r)("queryGeometry")],w.prototype,"readQueryGeometry",null),(0,n._)([(0,h.Cb)({type:p.Z,json:{write:!0}})],w.prototype,"spatialReference",void 0),(0,n._)([(0,m.c)("spatialReference")],w.prototype,"writeSpatialReference",null),(0,n._)([(0,h.Cb)({json:{write:!0}})],w.prototype,"transform",void 0),w=i=(0,n._)([(0,d.j)("esri.rest.support.FeatureSet")],w),w.prototype.toJSON.isDefaultToJSON=!0;const b=w}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3172],{3172:(e,t,r)=>{r.r(t),r.d(t,{default:()=>p});var s=r(68773),o=r(40330),n=r(20102),a=r(80442),i=r(22974),l=r(70586),c=r(95330),u=r(17452),d=r(71058),h=r(85958);async function p(e,t){const i=(0,u.HK)(e),y=(0,u.jc)(e);y||i||(e=(0,u.Fv)(e));const g={url:e,requestOptions:{...(0,l.Wg)(t)}};let b=(0,u.oh)(e);if(b){const e=await async function(e,t){if(null!=e.responseData)return e.responseData;if(e.headers&&(t.requestOptions.headers={...t.requestOptions.headers,...e.headers}),e.query&&(t.requestOptions.query={...t.requestOptions.query,...e.query}),e.before){let r,s;try{s=await e.before(t)}catch(e){r=C("request:interceptor",e,t)}if((s instanceof Error||s instanceof n.Z)&&(r=C("request:interceptor",s,t)),r)throw e.error&&e.error(r),r;return s}}(b,g);if(null!=e)return{data:e,getHeader:q,requestOptions:g.requestOptions,url:g.url};b.after||b.error||(b=null)}if(e=g.url,"image"===(t=g.requestOptions).responseType){if((0,a.Z)("host-webworker")||(0,a.Z)("host-node"))throw C("request:invalid-parameters",new Error("responseType 'image' is not supported in Web Workers or Node environment"),g)}else if(i)throw C("request:invalid-parameters",new Error("Data URLs are not supported for responseType = "+t.responseType),g);if("head"===t.method){if(t.body)throw C("request:invalid-parameters",new Error("body parameter cannot be set when method is 'head'"),g);if(i||y)throw C("request:invalid-parameters",new Error("data and blob URLs are not supported for method 'head'"),g)}if(await async function(){(0,a.Z)("host-webworker")?f||(f=await r.e(9884).then(r.bind(r,29884))):p._abortableFetch||(p._abortableFetch=globalThis.fetch.bind(globalThis))}(),f)return f.execute(e,t);const T=new AbortController;(0,c.fu)(t,(()=>T.abort()));const k={controller:T,credential:null,credentialToken:null,fetchOptions:null,hasToken:!1,interceptor:b,params:g,redoRequest:!1,useIdentity:m.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},L=await async function(e){let t,r;await async function(e){const t=e.params.url,r=e.params.requestOptions,n=e.controller.signal,a=r.body;let i=null,l=null;if(w&&"HTMLFormElement"in globalThis&&(a instanceof FormData?i=a:a instanceof HTMLFormElement&&(i=new FormData(a))),"string"==typeof a&&(l=a),e.fetchOptions={cache:r.cacheBust&&!p._abortableFetch.polyfill?"no-cache":"default",credentials:"same-origin",headers:r.headers||{},method:"head"===r.method?"HEAD":"GET",mode:"cors",priority:m.priority,redirect:"follow",signal:n},(i||l)&&(e.fetchOptions.body=i||l),"anonymous"===r.authMode&&(e.useIdentity=!1),e.hasToken=!!(/token=/i.test(t)||r.query?.token||i?.get("token")),!e.hasToken&&s.Z.apiKey&&(0,d.r)(t)&&(r.query||(r.query={}),r.query.token=s.Z.apiKey,e.hasToken=!0),e.useIdentity&&!e.hasToken&&!e.credentialToken&&!O(t)&&!(0,c.Hc)(n)){let s;"immediate"===r.authMode?(await v(),s=await o.id.getCredential(t,{signal:n}),e.credential=s):"no-prompt"===r.authMode?(await v(),s=await o.id.getCredential(t,{prompt:!1,signal:n}).catch((()=>{})),e.credential=s):o.id&&(s=o.id.findCredential(t)),s&&(e.credentialToken=s.token,e.useSSL=!!s.ssl)}}(e);try{do{[t,r]=await E(e)}while(!await S(e,t,r))}catch(r){const s=C("request:server",r,e.params,t);throw s.details.ssl=e.useSSL,e.interceptor&&e.interceptor.error&&e.interceptor.error(s),s}const n=e.params.url;if(r&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(n)){if(!e.hasToken&&!e.credentialToken&&r.user?.username&&!(0,u.kl)(n)){const e=(0,u.P$)(n,!0);e&&m.trustedServers.push(e)}Array.isArray(r.authorizedCrossOriginNoCorsDomains)&&(0,h.Hu)(r.authorizedCrossOriginNoCorsDomains)}const a=e.credential;if(a&&o.id){const e=o.id.findServerInfo(a.server);let t=e&&e.owningSystemUrl;if(t){t=t.replace(/\/?$/,"/sharing");const e=o.id.findCredential(t,a.userId);e&&-1===o.id._getIdenticalSvcIdx(t,e)&&e.resources.unshift(t)}}return{data:r,getHeader:t?e=>t.headers.get(e):q,requestOptions:e.params.requestOptions,ssl:e.useSSL,url:e.params.url}}(k);return b?.after?.(L),L}let f;const m=s.Z.request,w="FormData"in globalThis,y=[499,498,403,401],g=["COM_0056","COM_0057","SB_0008"],b=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],q=()=>null,T=Symbol();function k(e){const t=(0,u.P$)(e);return!t||t.endsWith(".arcgis.com")||p._corsServers.includes(t)||(0,u.kl)(t)}function C(e,t,r,s){let o="Error";const a={url:r.url,requestOptions:r.requestOptions,getHeader:q,ssl:!1};if(t instanceof n.Z)return t.details?(t.details=(0,i.d9)(t.details),t.details.url=r.url,t.details.requestOptions=r.requestOptions):t.details=a,t;if(t){const e=s&&(e=>s.headers.get(e)),r=s&&s.status,n=t.message;n&&(o=n),e&&(a.getHeader=e),a.httpStatus=(null!=t.httpCode?t.httpCode:t.code)||r||0,a.subCode=t.subcode,a.messageCode=t.messageCode,"string"==typeof t.details?a.messages=[t.details]:a.messages=t.details,a.raw=T in t?t[T]:t}return(0,c.D_)(t)?(0,c.zE)():new n.Z(e,o,a)}async function v(){o.id||await Promise.all([r.e(280),r.e(1400),r.e(3879)]).then(r.bind(r,28153))}function O(e){return b.some((t=>t.test(e)))}async function E(e){let t=e.params.url;const r=e.params.requestOptions,s=e.fetchOptions,n=(0,u.jc)(t)||(0,u.HK)(t),i=r.responseType||"json",l=n?0:null!=r.timeout?r.timeout:m.timeout;let d=!1;if(!n){e.useSSL&&(t=(0,u.hO)(t)),r.cacheBust&&"default"===s.cache&&(t=(0,u.ZN)(t,"request.preventCache",Date.now()));let n={...r.query};e.credentialToken&&(n.token=e.credentialToken);let i=(0,u.B7)(n);(0,a.Z)("esri-url-encodes-apostrophe")&&(i=i.replace(/'/g,"%27"));const l=t.length+1+i.length;let c;d="delete"===r.method||"post"===r.method||"put"===r.method||!!r.body||l>m.maxUrlLength;const p=r.useProxy||!!(0,u.ed)(t);if(p){const e=(0,u.b7)(t);c=e.path,!d&&c.length+1+l>m.maxUrlLength&&(d=!0),e.query&&(n={...e.query,...n})}if("HEAD"===s.method&&(d||p)){if(d){if(l>m.maxUrlLength)throw C("request:invalid-parameters",new Error("URL exceeds maximum length"),e.params);throw C("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),e.params)}if(p)throw C("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),e.params)}if(d?(s.method="delete"===r.method?"DELETE":"put"===r.method?"PUT":"POST",r.body?t=(0,u.fl)(t,n):(s.body=(0,u.B7)(n),s.headers["Content-Type"]="application/x-www-form-urlencoded")):t=(0,u.fl)(t,n),p&&(e.useProxy=!0,t=`${c}?${t}`),n.token&&w&&s.body instanceof FormData&&!/\/sharing\/(appservices|servers)\//i.test(t)&&s.body.set("token",n.token),r.hasOwnProperty("withCredentials"))e.withCredentials=r.withCredentials;else if(!(0,u.D6)(t,(0,u.TI)()))if((0,u.kl)(t))e.withCredentials=!0;else if(o.id){const r=o.id.findServerInfo(t);r&&r.webTierAuth&&(e.withCredentials=!0)}e.withCredentials&&(s.credentials="include",(0,h.jH)(t)&&await(0,h.jz)(d?(0,u.fl)(t,n):t))}let f,y,g=0,b=!1;l>0&&(g=setTimeout((()=>{b=!0,e.controller.abort()}),l));try{if("native-request-init"===r.responseType)y=s,y.url=t;else if("image"!==r.responseType||"default"!==s.cache||"GET"!==s.method||d||function(e){if(e)for(const t of Object.getOwnPropertyNames(e))if(e[t])return!0;return!1}(r.headers)||!n&&!e.useProxy&&m.proxyUrl&&!k(t)){if(f=await p._abortableFetch(t,s),e.useProxy||function(e){const t=(0,u.P$)(e);t&&!p._corsServers.includes(t)&&p._corsServers.push(t)}(t),"native"===r.responseType)y=f;else if("HEAD"!==s.method)if(f.ok){switch(i){case"array-buffer":y=await f.arrayBuffer();break;case"blob":case"image":y=await f.blob();break;default:y=await f.text()}if(g&&(clearTimeout(g),g=0),"json"===i||"xml"===i||"document"===i)if(y)switch(i){case"json":y=JSON.parse(y);break;case"xml":y=L(y,"application/xml");break;case"document":y=L(y,"text/html")}else y=null;if(y){if("array-buffer"===i||"blob"===i){const e=f.headers.get("Content-Type");if(/application\/json|text\/plain/i.test(e)&&y["blob"===i?"size":"byteLength"]<=750)try{const e=await new Response(y).json();e.error&&(y=e)}catch{}}"image"===i&&y instanceof Blob&&(y=await x(URL.createObjectURL(y),e,!0))}}else y=await f.text()}else y=await x(t,e)}catch(s){if("AbortError"===s.name){if(b)throw new Error("Timeout exceeded");throw(0,c.zE)("Request canceled")}if(!(!f&&s instanceof TypeError&&m.proxyUrl)||r.body||"delete"===r.method||"head"===r.method||"post"===r.method||"put"===r.method||e.useProxy||k(t))throw s;e.redoRequest=!0,(0,u.tD)({proxyUrl:m.proxyUrl,urlPrefix:(0,u.P$)(t)})}finally{g&&clearTimeout(g)}return[f,y]}function L(e,t){let r;try{r=(new DOMParser).parseFromString(e,t)}catch{}if(!r||r.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return r}async function S(e,t,r){if(e.redoRequest)return e.redoRequest=!1,!1;const s=e.params.requestOptions;if(!t||"native"===s.responseType||"native-request-init"===s.responseType)return!0;let n,a,i,l;if(!t.ok)throw n=new Error(`Unable to load ${t.url} status: ${t.status}`),n[T]=r,n;r?.error&&(n=r.error),n&&(a=Number(n.code),i=n.hasOwnProperty("subcode")?Number(n.subcode):null,l=n.messageCode,l=l&&l.toUpperCase());const c=s.authMode;if(403===a&&(4===i||n.message&&n.message.toLowerCase().includes("ssl")&&!n.message.toLowerCase().includes("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&("no-prompt"!==c||498===a)&&y.includes(a)&&!O(e.params.url)&&(403!==a||!g.includes(l)&&(null==i||2===i&&e.credentialToken))){await v();try{const t=await o.id.getCredential(e.params.url,{error:C("request:server",n,e.params),prompt:"no-prompt"!==c,signal:e.controller.signal,token:e.credentialToken});return e.credential=t,e.credentialToken=t.token,e.useSSL=e.useSSL||t.ssl,!1}catch(t){if("no-prompt"===c)return e.credential=null,e.credentialToken=null,!1;n=t}}if(n)throw n;return!0}function x(e,t,r=!1){const s=t.controller.signal,o=new Image;return t.withCredentials?o.crossOrigin="use-credentials":o.crossOrigin="anonymous",o.alt="",o.fetchpriority=m.priority,o.src=e,(0,h.fY)(o,e,r,s)}p._abortableFetch=null,p._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"]},71058:(e,t,r)=>{r.d(t,{r:()=>n});var s=r(17452);const o=["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"];function n(e){const t=(0,s.P$)(e,!0);return t&&t.endsWith(".arcgis.com")&&!o.includes(t)&&!e.endsWith("/sharing/rest/generateToken")}},85958:(e,t,r)=>{r.d(t,{Hu:()=>u,fY:()=>l,jH:()=>d,jz:()=>h});var s=r(68773),o=r(80442),n=r(70586),a=r(95330),i=r(17452);function l(e,t,r=!1,s){return new Promise(((i,l)=>{if((0,a.Hc)(s))return void l(c());let u=()=>{p(),l(new Error(`Unable to load ${t}`))},d=()=>{const t=e;p(),i(t)},h=()=>{if(!e)return;const t=e;p(),t.src="",l(c())};const p=()=>{(0,o.Z)("esri-image-decode")||(e.removeEventListener("error",u),e.removeEventListener("load",d)),u=null,d=null,e=null,(0,n.pC)(s)&&s.removeEventListener("abort",h),h=null,r&&URL.revokeObjectURL(t)};(0,n.pC)(s)&&s.addEventListener("abort",h),(0,o.Z)("esri-image-decode")?e.decode().then(d,u):(e.addEventListener("error",u),e.addEventListener("load",d))}))}function c(){try{return new DOMException("Aborted","AbortError")}catch{const e=new Error;return e.name="AbortError",e}}function u(e){s.Z.request.crossOriginNoCorsDomains||(s.Z.request.crossOriginNoCorsDomains={});const t=s.Z.request.crossOriginNoCorsDomains;for(let r of e)r=r.toLowerCase(),/^https?:\/\//.test(r)?t[(0,i.P$)(r)]=0:(t[(0,i.P$)("http://"+r)]=0,t[(0,i.P$)("https://"+r)]=0)}function d(e){const t=s.Z.request.crossOriginNoCorsDomains;if(t){let r=(0,i.P$)(e);if(r)return r=r.toLowerCase(),!(0,i.D6)(r,(0,i.TI)())&&t[r]<Date.now()-36e5}return!1}async function h(e){const t=s.Z.request.crossOriginNoCorsDomains;t&&(t[(0,i.P$)(e).toLowerCase()]=Date.now());const r=(0,i.mN)(e);e=r.path,"json"===r.query?.f&&(e+="?f=json");try{await fetch(e,{mode:"no-cors",credentials:"include"})}catch{}}}}]);
|