// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("exports ../../request ../../geometry/Extent ../../geometry/Point ../../geometry/SpatialReference ../../layers/support/RasterInfo ../../layers/support/RasterStorageInfo ../utils ../support/FeatureSet".split(" "),function(m,f,x,y,A,B,C,r,D){async function z(c,b,a){c=r.parseUrl(c);const {rasterFunction:t,sourceJSON:E}=b||{};b=t?JSON.stringify(t.rasterFunctionDefinition||t):null;b=r.encode({...c.query,renderingRule:b,f:"json"});b=r.asValidOptions(b,a);c=c.path;a=E||await f(c,b).then(g=>g.data); var e=a.hasRasterAttributeTable?f(`${c}/rasterAttributeTable`,b):null,k=a.hasColormap?f(`${c}/colormap`,b):null,d=a.hasHistograms?f(`${c}/histograms`,b):null,h=10.3<=a.currentVersion?f(`${c}/keyProperties`,b):null;c=a.hasMultidimensions?f(`${c}/multidimensionalInfo`,b):null;d=await Promise.allSettled([e,k,d,h,c]);c=null;if(a.minValues&&a.minValues.length===a.bandCount)for(c=[],b=0;b{g.statistics?.length&&g.statistics.forEach(q=>{q.avg=q.mean;q.stddev=q.standardDeviation})});const {defaultVariable:u,serviceDataType:v}=a;u&&u!==l.DefaultVariable&&(l.DefaultVariable=u);v?.includes("esriImageServiceDataTypeVector")&&!v.includes(l.DataType)&&(l.DataType=v.replace("esriImageServiceDataType",""));let w=a.noDataValue;a.noDataValues?.length&&a.noDataValues.some(g=>g!==w)&&(w=a.noDataValues); const F=a.transposeInfo?new C({blockWidth:256,blockHeight:256,pyramidBlockWidth:256,pyramidBlockHeight:256,pyramidScalingFactor:2,compression:"lerc",origin:new y({x:a.extent.xmin,y:a.extent.ymax,spatialReference:k}),firstPyramidLevel:1,maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(b,e))/Math.LN2-8)),transposeInfo:a.transposeInfo}):void 0;return new B({width:b,height:e,bandCount:a.bandCount,extent:x.fromJSON(a.extent),spatialReference:k,pixelSize:new y({x:a.pixelSizeX,y:a.pixelSizeY, spatialReference:k}),pixelType:a.pixelType.toLowerCase(),statistics:c,attributeTable:h,colormap:n,histograms:p,keyProperties:l,noDataValue:w,multidimensionalInfo:d,storageInfo:F})}m.fetchServiceRasterInfo=function(c,b,a){return z(c,{sourceJSON:b},a)};m.generateRasterInfo=function(c,b,a){return z(c,{rasterFunction:b},a)};m.patchServiceInfo=function(c,b){c.attributeTable||(b.hasRasterAttributeTable=!1);c.histograms||(b.hasHistograms=!1);c.colormap||(b.hasColormap=!1);c.multidimensionalInfo||(b.hasMultidimensions= !1)};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});