/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import b from"./TRAOBRME.js";import a from"./ZKOJATCN.js";import{O as u,P as n,Q as e,U as x,a as w,b as l}from"./IWZQMWZ5.js";import"./ALDX5YZO.js";export default $arcgis.t(([,{a:$,b:d,d:p,e:z,g:v,h:o,i:E}])=>{var H=w`.layer-body{margin-left:var(--calcite-spacing-sm);display:table}:dir(rtl) .layer-body{margin-right:var(--calcite-spacing-sm);margin-left:0;overflow:auto}.layer-row{display:table-row}.layer-cell{display:table-cell;padding:var(--calcite-spacing-xxs) 0;min-width:100px;vertical-align:middle;word-break:break-word}.layer-cell-info{padding-right:var(--calcite-spacing-sm);padding-left:var(--calcite-spacing-sm);max-width:250px;word-break:normal;word-wrap:normal;font-size:var(--calcite-font-size-sm)}.symbol{display:flex;justify-content:center}.ramps{margin-left:var(--calcite-spacing-md)}:dir(rtl) .ramps{margin-right:var(--calcite-spacing-md);margin-left:auto}.ramp-labels{display:flex;flex-flow:column nowrap;justify-content:space-between}.ramp-label{position:relative;padding:0 var(--calcite-spacing-sm);line-height:1em;white-space:nowrap;font-size:var(--calcite-font-size-sm)}.ramp-label:before{display:block;position:absolute;top:.25em;right:100%;border-width:3px 4px 3px 0;border-style:solid;border-color:transparent var(--calcite-color-text-1) transparent transparent;width:0;height:0;content:""}.ramp-label:first-child{margin-top:calc(var(--calcite-font-size-sm) / 3 * -1)}.ramp-label:last-child{bottom:calc(var(--calcite-font-size-sm) * .25 * -1)}:dir(rtl) .ramp-label:before{right:auto;left:100%;border-width:3px 0 3px 4px;border-color:transparent transparent transparent var(--calcite-color-text-1)}.univariate-above-below-label{position:relative;margin-left:7px;line-height:1em;white-space:nowrap;font-size:var(--calcite-font-size-sm)}.univariate-above-below-label:before{display:block;position:absolute;top:.45em;left:-19px;border-width:1px 0 0;border-style:solid;width:14px;height:0;content:""}.univariate-above-below-label:first-child{top:calc(var(--calcite-font-size-sm) / 2.2 * -1)}.univariate-above-below-label:last-child{bottom:calc(var(--calcite-font-size-sm) / 2.2 * -1)}:dir(rtl) .univariate-above-below-label{margin-right:var(--calcite-spacing-sm);margin-left:auto}:dir(rtl) .univariate-above-below-label:before{right:-19px;left:auto}.univariate-above-below-symbol{display:flex;align-items:center;justify-content:center}`,m=class extends u{constructor(){super(...arguments),this.legendElement=null,this.opacity=1}static{this.properties={cssEffectFilter:1,legendElement:0,opacity:9,messages:0}}static{this.styles=H}render(){let{legendElement:A,opacity:c}=this,{sizeRampElement:t,colorRampElement:b}=z(A,this.messages,c);if(!t)return null;let f=this.messages.previewColorRampAriaLabel,g=p(t,"above",!0),h=p(t,"below",!0),y=12,r=d(b,{width:y,height:g,rampAlignment:"vertical",opacity:c,type:"above",cssEffectFilter:this.cssEffectFilter,ariaLabel:f}),k=d(b,{width:y,height:h,rampAlignment:"vertical",opacity:c,type:"below",cssEffectFilter:this.cssEffectFilter,ariaLabel:f}),F=$(t),s=t.infos.map(a=>a.label),L=s.map((a,i)=>i===0?l`<div class=${n(a?r?"univariate-above-below-label":"ramp-label":void 0)}>${a}</div>`:i===2?l`<div></div>`:null),R=s.length-1,j=Math.floor(s.length/2),C=s.map((a,i)=>i===j||i===R?l`<div class=${n(a?r?"univariate-above-below-label":"ramp-label":void 0)}>${a}</div>`:null),M={display:"table-cell",verticalAlign:"middle"},B={marginTop:`${F}px`},S={height:`${g}px`},U={height:`${h}px`};return l`<div style=${e(E)}><div class="layer-body">${t.infos.map((a,i)=>l`<div class="layer-row"><div class="symbol" style=${e(M)}>${a.preview}</div>${!r&&i%2===0?l`<div class="layer-cell layer-cell-info">${s[i]}</div>`:null}</div>`)}</div>${r?l`<div style=${e(B)}><div style=${e(v)}><div style=${e(o)}><div class="ramps">${r}</div></div><div style=${e(o)}><div class="ramp-labels" style=${e(S)}>${L}</div></div></div><div style=${e(v)}><div style=${e(o)}><div class="ramps">${k}</div></div><div style=${e(o)}><div class="ramp-labels" style=${e(U)}>${C}</div></div></div></div>`:null}</div>`}};x("arcgis-legend-classic-univariate-above-and-below-ramp",m);return m},a,b)