/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../../chunks/_rollupPluginBabelHelpers","../../chunks/tslib.es6","../../core/accessorSupport/decorators/property","../../core/arrayUtils","../../core/has","../../core/accessorSupport/ensureType","../../core/accessorSupport/decorators/subclass","./VisualVariable","./support/ColorStop"],(function(e,t,o,r,s,i,n,a,l){"use strict";var p;let c=p=function(t){function o(e){var o;return(o=t.call(this,e)||this).type="color",o.normalizationField=null,o}e._inheritsLoose(o,t);var r=o.prototype;return r.clone=function(){return new p({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map((e=>e.clone())),legendOptions:this.legendOptions&&this.legendOptions.clone()})},r.getAttributeHash=function(){return`${t.prototype.getAttributeHash.call(this)}-${this.normalizationField}`},r._interpolateData=function(){return this.stops&&this.stops.map((e=>e.value||0))},e._createClass(o,[{key:"cache",get:function(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}},{key:"stops",set:function(e){e&&Array.isArray(e)&&(e=e.filter((e=>!!e))).sort(((e,t)=>e.value-t.value)),this._set("stops",e)}}]),o}(a);t.__decorate([o.property({readOnly:!0})],c.prototype,"cache",null),t.__decorate([o.property({type:["color"],json:{type:["colorInfo"]}})],c.prototype,"type",void 0),t.__decorate([o.property({type:String,json:{write:!0}})],c.prototype,"normalizationField",void 0),t.__decorate([o.property({type:[l],json:{write:!0}})],c.prototype,"stops",null),c=p=t.__decorate([n.subclass("esri.renderers.visualVariables.ColorVariable")],c);return c}));
