/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
import { c as u } from "../../chunks/runtime.js";
import { css as w, html as i } from "lit";
import { LitElement as x, safeClassMap as o, safeStyleMap as e } from "@arcgis/lumina";
import { classes as R } from "@arcgis/toolkit/dom";
import { e as z, d as $, b as C, c as E, u as S, f as L, h as n } from "../../chunks/univariateUtils.js";
const U = w`.layer-body{margin-left:var(--calcite-spacing-sm)}:dir(rtl) .layer-body{margin-right:var(--calcite-spacing-sm);margin-left:0;overflow:auto}.layer-row,.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}.size-ramp~.layer-cell-info{width:80%;max-width:80%}.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-label{position:relative;margin-left:7px;line-height:1em;white-space:nowrap;font-size:var(--calcite-font-size-sm)}.univariate-label:before{display:block;position:absolute;top:.45em;left:-19px;border-width:1px 0 0;border-style:solid;width:14px;height:0;content:""}.univariate-label:first-child{top:calc(var(--calcite-font-size-sm) / 2.2 * -1)}.univariate-label:last-child{bottom:calc(var(--calcite-font-size-sm) / 2.2 * -1)}:dir(rtl) .univariate-label{margin-right:var(--calcite-spacing-sm);margin-left:auto}:dir(rtl) .univariate-label:before{right:-19px;left:auto}.univariate-above-below-symbol{display:flex;align-items:center;justify-content:center}`;
class A extends x {
  constructor() {
    super(...arguments), this.legendElement = null, this.opacity = 1;
  }
  static {
    this.properties = { cssEffectFilter: 1, legendElement: 0, opacity: 9, messages: 0 };
  }
  static {
    this.styles = U;
  }
  render() {
    const { legendElement: c, opacity: p } = this, { sizeRampElement: a, colorRampElement: l } = z(c, this.messages);
    if (!a)
      return null;
    const m = $(a), d = 12, r = C(a, "full", !1), v = E(l, {
      width: d,
      height: r,
      rampAlignment: "vertical",
      opacity: p,
      type: "full",
      cssEffectFilter: this.cssEffectFilter,
      ariaLabel: this.messages.previewColorRampAriaLabel
    }), f = a.infos.length - 1, g = a.infos.map((t, s) => s === 0 || s === f ? i`<div class=${o(t.label ? l ? "univariate-label" : "ramp-label" : void 0)}>${t.label}</div>` : null), b = { display: "table-cell", verticalAlign: "middle" }, h = { marginTop: `${m}px` }, y = { height: `${r}px` };
    return i`<div style=${e(S)}><div class="layer-body">${a.infos.map((t) => i`<div class=${o(R("layer-row", "size-ramp"))}><div class="symbol" style=${e(b)}>${t.preview}</div></div>`)}</div><div style=${e(h)}><div style=${e(L)}><div style=${e(n)}><div class="ramps">${v}</div></div><div style=${e(n)}><div class="ramp-labels" style=${e(y)}>${g}</div></div></div></div></div>`;
  }
}
u("arcgis-legend-classic-univariate-color-size-ramp", A);
export {
  A as ArcgisLegendClassicUnivariateColorSizeRamp
};
