/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as e}from"tslib";import{property as s,subclass as t}from"../../../../core/accessorSupport/decorators.js";import l from"../../../Widget.js";import{css as i}from"./css.js";import{getUnivariateColorSizeRampElements as r,getUnivariateColorRampMargin as o,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,univariateColorRampContainerStyles as n,univariateColorRampStyles as c,univariateRampContainerStyles as m}from"../support/univariateUtils.js";import{attachToNode as d}from"../../support/styleUtils.js";import{tsx as y}from"../../../support/widget.js";let f=class extends l{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:s,cssEffectFilter:t,key:l}=this,{sizeRampElement:f,colorRampElement:v}=r(e);if(!f)return null;const u=o(f),b=12,g=a(f,"full",!1),h=p(v,{width:b,height:g,rampAlignment:"vertical",opacity:s,type:"full",cssEffectFilter:t,ariaLabel:this.messages?.previewColorRampAriaLabel}),E=f.infos.length-1,w=f.infos.map((e,s)=>0===s||s===E?y("div",{class:e.label?v?i.univariateAboveAndBelowLabel:i.rampLabel:void 0,key:`${l}-color-ramp-label-${e.label??s}`},e.label):null),$={display:"table-cell",verticalAlign:"middle"},j={marginTop:`${u}px`},C={height:`${g}px`};return y("div",{key:`${l}-container`,styles:m},y("div",{class:i.layerBody},f.infos.map((e,s)=>y("div",{class:this.classes(i.layerRow,i.sizeRamp),key:`${l}-row-${s}`},y("div",{afterCreate:d,bind:e.preview,class:i.symbol,styles:$})))),y("div",{styles:j},y("div",{styles:n},y("div",{styles:c},y("div",{afterCreate:d,bind:h,class:i.rampContainer})),y("div",{styles:c},y("div",{class:i.rampLabelsContainer,styles:C},w)))))}};e([s()],f.prototype,"cssEffectFilter",void 0),e([s()],f.prototype,"legendElement",void 0),e([s()],f.prototype,"messages",void 0),e([s()],f.prototype,"opacity",void 0),f=e([t("esri.widgets.Legend.styles.classic.UnivariateColorSizeRamp")],f);export{f as default};
