/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import e from"../../../core/Error.js";import{createShadedReliefRenderer as r}from"../../../renderers/support/rasterRendererHelper.js";import{processRasterRendererParameters as t}from"../support/utils.js";async function o(r){const o=(r=await t(r)).layer.supportsMultidirectionalHillshade();if("multi-directional"===r.hillshadeType&&!o)throw new e("raster-shaded-relief-renderer:not-supported","multi-directional hillshade type is only supported on 10.8.1+ servers");return o&&null!=r.hillshadeType||(r.hillshadeType="traditional"),r}async function l(t){t=await o(t);const l=r(t.layer.serviceRasterInfo,t.hillshadeType);if(null==l)throw new e("raster-shaded-relief-renderer:not-supported","Only elevation raster data is supported");return s(l,t),{renderer:l}}function s(e,r){const{scalingType:t,colorRamp:o}=r;null!=t&&(e.scalingType=t),void 0!==o&&(e.colorRamp=o)}export{l as createRenderer};
