/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../chunks/_rollupPluginBabelHelpers","../../request","../../geometry/Extent","../../geometry/Point","../../layers/support/RasterInfo","../../layers/support/RasterStorageInfo","../utils"],(function(e,t,i,l,a,s,n,r){"use strict";function o(e,t,i){return u.apply(this,arguments)}function u(){return(u=t._asyncToGenerator((function*(e,t,o){var u,p;const d=r.parseUrl(e),c=r.encode({...d.query,f:"json"}),f=r.asValidOptions(c,o),g=`${d.path}/${t}/info`,h=i(`${g}`,f),m=i(`${g}/keyProperties`,f),y=yield Promise.allSettled([h,m]),x="fulfilled"===y[0].status?y[0].value.data:null,v="fulfilled"===y[1].status?y[1].value.data:null;let P=null;null!=(u=x.statistics)&&u.length&&(P=x.statistics.map((e=>({min:e[0],max:e[1],avg:e[2],stddev:e[3]}))));const S=l.fromJSON(x.extent),b=Math.ceil(S.width/x.pixelSizeX-.1),k=Math.ceil(S.height/x.pixelSizeY-.1),w=S.spatialReference,R=new a({x:x.pixelSizeX,y:x.pixelSizeY,spatialReference:w}),z=null!=(p=x.histograms)&&p.length?x.histograms:null,I=new n({origin:x.origin,blockWidth:x.blockWidth,blockHeight:x.blockHeight,firstPyramidLevel:x.firstPyramidLevel,maximumPyramidLevel:x.maxPyramidLevel});return new s({width:b,height:k,bandCount:x.bandCount,extent:S,spatialReference:w,pixelSize:R,pixelType:x.pixelType.toLowerCase(),statistics:P,histograms:z,keyProperties:v,storageInfo:I})}))).apply(this,arguments)}e.getCatalogItemRasterInfo=o,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
