/*
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","../../../core/Error","../../../renderers/support/rasterRendererHelper","./adapters/ImageryLayerAdapter","./adapters/ImageryTileLayerAdapter"],(function(e,r,a,t,n,s){"use strict";const l={imagery:{adapter:n,label:"ImageryLayer"},"imagery-tile":{adapter:s,label:"ImageryTileLayer"},wcs:{adapter:s,label:"WCSLayer"}},o={"raster-stretch":"raster-stretch","unique-value":"raster-unique-value","raster-rgb":"raster-rgb","class-breaks":"raster-class-breaks","raster-colormap":"raster-colormap","raster-shaded-relief":"raster-shaded-relief","vector-field":"raster-vector-field",flow:"raster-flow"},i=Object.keys(l).map((e=>l[e].label));function u(e){var r;if("raster-layer-adapter"===e.type)return e;const a=null==(r=l[e.type])?void 0:r.adapter;return null==a?null:new a({layer:e})}function d(e){return p.apply(this,arguments)}function p(){return(p=r._asyncToGenerator((function*(e){var r;const a=u((e=yield f(e)).layer),n=yield a.generateRasterInfo(e),s=t.getSupportedRendererTypes(n).map((e=>o[e])),l=t.createDefaultRenderer(n),{bandCount:i}=n;return i>1&&s.push("raster-rgb"),!s.includes("raster-class-breaks")&&1===i&&(null==(r=a.layer)?void 0:r.version)>=10.3&&s.push("raster-class-breaks"),{supportedTypes:s,defaultRenderer:l}}))).apply(this,arguments)}function y(e){return c.apply(this,arguments)}function c(){return(c=r._asyncToGenerator((function*(e){const r=u((e=yield f(e)).layer),a=yield r.generateRasterInfo(e);return t.getDefaultBandCombination(a)}))).apply(this,arguments)}function f(e){return g.apply(this,arguments)}function g(){return(g=r._asyncToGenerator((function*(e){const{layer:r}=e;if(!r)throw new a("raster-renderer-creator:missing-parameters","'layer' parameter is required");const t=u(r);if(null==t)throw new a("raster-renderer-creator:invalid-parameters","'layer' must be one of these types: "+i.join(", "));return yield t.load(),yield t.updateRasterInfo({renderingRule:e.renderingRule,signal:e.signal}),{...e,layer:t}}))).apply(this,arguments)}e.createRasterLayerAdapter=u,e.getDefaultBandCombination=y,e.getSupportedRendererInfo=d,e.processRasterRendererParameters=f,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
