/*
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","../../../core/maybe","../../../renderers/support/rasterRendererHelper","../support/utils"],(function(e,r,t,a,n,s){"use strict";function o(e){return i.apply(this,arguments)}function i(){return(i=r._asyncToGenerator((function*(e){var r;e=yield s.processRasterRendererParameters(e);const{rasterInfo:a}=e.layer;if(a.bandCount>1)throw new t("raster-class-breaks-renderer:not-supported","Multiband raster is not supported");if(null===a.attributeTable&&!n.isSingleBand8BitRasterWithStats(a))throw new t("raster-unique-value-renderer:not-supported","The source raster does not have an attribute table");const o=null==(r=e.classFieldName)?void 0:r.toLowerCase();if(o&&!a.attributeTable.fields.some((e=>e.name.toLowerCase()===o)))throw new t("raster-unique-value-renderer:invalid-parameters","A valid 'classfieldName' is required");return o||(e.classFieldName=n.getClassField(a.attributeTable).name),e}))).apply(this,arguments)}function l(e){return u.apply(this,arguments)}function u(){return(u=r._asyncToGenerator((function*(e){e=yield o(e);const{classFieldName:r,colors:s,colorRamp:i}=e,l=n.createUVRenderer(e.layer.rasterInfo,r,s,i);if(a.isNone(l))throw new t("raster-unique-value-renderer:not-supported","UniqueValueRenderer is not supported on the provided data source");return{renderer:l,classFieldName:r}}))).apply(this,arguments)}e.createRenderer=l,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
