/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
v4.34.7 */
import a from"./7OU6NVXW.js";import{J as R,K as r,L as k,P as x,a as $,b}from"./RNRMSLW5.js";import"./G6QKOIC3.js";export default $arcgis.t(([{e:_,g:y,h:L}])=>{var X=$`.arcgis-spike-ramp__container{display:flex;flex-direction:row;gap:var(--calcite-spacing-sm-plus);margin-left:var(--calcite-spacing-sm)}.arcgis-spike-ramp__preview-container{display:flex;position:relative;gap:var(--calcite-spacing-sm-plus);border-bottom:var(--calcite-border-width-sm) solid var(--calcite-color-border-2);padding:0 var(--calcite-spacing-xl)}.arcgis-spike-ramp__preview{display:flex;gap:var(--calcite-spacing-sm-plus);align-items:end}.arcgis-spike-ramp__symbol-preview{display:flex}.arcgis-spike-ramp__lines{display:flex;position:absolute;bottom:0}.arcgis-spike-ramp__labels-container{display:flex;position:relative;top:-5px;flex:1;min-width:120px}.arcgis-spike-ramp__label{position:relative;padding:0 var(--calcite-spacing-sm);line-height:1em;word-break:break-all;font-size:var(--calcite-font-size-sm)}.arcgis-spike-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:""}`,p={spikeRampContainer:"arcgis-spike-ramp__container",spikeRampPreviewContainer:"arcgis-spike-ramp__preview-container",spikeRampPreview:"arcgis-spike-ramp__preview",spikeRampSymbolPreview:"arcgis-spike-ramp__symbol-preview",spikeRampLines:"arcgis-spike-ramp__lines",spikeRampLabelsContainer:"arcgis-spike-ramp__labels-container",spikeRampLabel:"arcgis-spike-ramp__label"},Y="#ddd",e=window.devicePixelRatio;function u(v){return v.infos.filter((m,t)=>t%2===0)}function S(v){return!!(v&&typeof v=="object")}var f=class extends R{constructor(){super(...arguments),this.legendElement=null}static{this.properties={legendElement:0,messages:0}}static{this.styles=X}render(){return this.legendElement.infos.length!==5?null:b`<div class=${r(p.spikeRampContainer)}><div class=${r(p.spikeRampPreviewContainer)}>${this._renderSpikeRampLines()}${this._renderSpikeRampPreview()}</div>${this._renderSpikeRampLabels()}</div>`}_renderSpikeRampPreview(){let m=this.legendElement,[t,l,d]=u(m).map(({preview:c,label:n})=>{if(!c)return null;let s=c.cloneNode(!0);return s.classList.add(p.spikeRampSymbolPreview),L(s,y(this.messages,n)),s});return!t||!l||!d?null:b`<div class=${r(p.spikeRampPreview)}><div>${d}</div><div>${l}</div><div>${t}</div></div>`}_renderSpikeRampLines(){let m=this.legendElement,[{width:t,height:l},{width:d},{width:c,height:n}]=u(m).map(({size:w})=>S(w)?{width:_(w.width),height:_(w.height)}:{width:0,height:0}),s=10,g=8,o=t+d+c+s*3,h=l,a=document.createElement("canvas");a.width=(o+s)*e,a.height=h*e,a.style.width=`${a.width/e}px`,a.style.height=`${a.height/e}px`;let i=a.getContext("2d");i.beginPath();let P=o-(t/2+s),C=0,E=o+g;i.moveTo(P*e,C*e),i.lineTo(E*e,0*e);let T=(o-g)/2,z=(l-n)/2,M=o+g,j=(l-n)/2;i.moveTo(T*e,z*e),i.lineTo(M*e,j*e);let A=c/2,W=h-n,H=o+g,I=h-n;return i.moveTo(A*e,W*e),i.lineTo(H*e,I*e),i.strokeStyle=Y,i.lineWidth=.5*e,i.stroke(),b`<div class=${r(p.spikeRampLines)}>${a}</div>`}_renderSpikeRampLabels(){let m=this.legendElement,[{label:t,height:l},{label:d},{label:c,height:n}]=u(m).map(({label:a,size:i})=>({label:a,height:S(i)?_(i.height):0})),s=l-n,g={position:"absolute",top:"0"},o={position:"absolute",top:`${s/2}px`},h={position:"absolute",top:`${s}px`};return b`<div class=${r(p.spikeRampLabelsContainer)}><div class=${r(p.spikeRampLabel)} style=${k(g)}>${t}</div><div class=${r(p.spikeRampLabel)} style=${k(o)}>${d}</div><div class=${r(p.spikeRampLabel)} style=${k(h)}>${c}</div></div>`}};x("arcgis-legend-spike-ramp",f);return f},a)