/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as t}from"tslib";import{uniform as i,UniformGroup as s}from"../../GraphShaderModule.js";import{FixedArray as e,Float as o,cond as a,greaterThan as p,mix as r,greaterThanEqual as c,lessThanEqual as l}from"../../graph/glsl.js";import{isNan as u}from"./utils.js";class h extends s{getOpacity(t){return a([u(t),new o(1)],[l(t,this.opacityValues.first()),this.opacities.first()],[c(t,this.opacityValues.last()),this.opacities.last()],[!0,()=>{const i=this.opacityValues.findIndex(i=>p(i,t)),s=this.opacityValues.get(i),e=i.subtract(1),o=this.opacityValues.get(e),a=t.subtract(o).divide(s.subtract(o));return r(this.opacities.get(e),this.opacities.get(i),a)}])}}t([i(e.ofType(o,8))],h.prototype,"opacities",void 0),t([i(e.ofType(o,8))],h.prototype,"opacityValues",void 0);export{h as VisualVariableOpacity};
