import { c as u } from "../../chunks/runtime.js";
import { css as w, html as t } from "lit";
import { LitElement as x, safeClassMap as l, safeStyleMap as a } from "@arcgis/lumina";
import { classes as R } from "@arcgis/toolkit/dom";
import { g as $, a as z, b as C, c as E, u as L, d as S, e as c } from "../../chunks/univariateUtils.js";
/*! 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 */
const U = w`.arcgis-legend__layer-body{margin-left:var(--calcite-spacing-sm)}:dir(rtl) .arcgis-legend__layer-body{margin-right:var(--calcite-spacing-sm);margin-left:0;overflow:auto}.arcgis-legend__layer-row,.arcgis-legend__symbol{display:flex;justify-content:center}.arcgis-legend__ramps{margin-left:var(--calcite-spacing-md)}:dir(rtl) .arcgis-legend__ramps{margin-right:var(--calcite-spacing-md);margin-left:auto}.arcgis-legend__size-ramp~.arcgis-legend__layer-cell--info{width:80%;max-width:80%}.arcgis-legend__ramp-labels{display:flex;flex-flow:column nowrap;justify-content:space-between}.arcgis-legend__ramp-label{position:relative;padding:0 var(--calcite-spacing-sm);line-height:1em;white-space:nowrap;font-size:var(--calcite-font-size-sm)}.arcgis-legend__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:""}.arcgis-legend__ramp-label:first-child{margin-top:calc(var(--calcite-font-size-sm) / 3 * -1)}.arcgis-legend__ramp-label:last-child{bottom:calc(var(--calcite-font-size-sm) * .25 * -1)}:dir(rtl) .arcgis-legend__ramp-label:before{right:auto;left:100%;border-width:3px 0 3px 4px;border-color:transparent transparent transparent var(--calcite-color-text-1)}.arcgis-legend__univariate-label{position:relative;margin-left:7px;line-height:1em;white-space:nowrap;font-size:var(--calcite-font-size-sm)}.arcgis-legend__univariate-label:before{display:block;position:absolute;top:.45em;left:-19px;border-width:1px 0 0;border-style:solid;width:14px;height:0;content:""}.arcgis-legend__univariate-label:first-child{top:calc(var(--calcite-font-size-sm) / 2.2 * -1)}.arcgis-legend__univariate-label:last-child{bottom:calc(var(--calcite-font-size-sm) / 2.2 * -1)}:dir(rtl) .arcgis-legend__univariate-label{margin-right:var(--calcite-spacing-sm);margin-left:auto}:dir(rtl) .arcgis-legend__univariate-label:before{right:-19px;left:auto}.arcgis-univariate-above-and-below-ramp__symbol{display:flex;align-items:center;justify-content:center}`, e = {
  layerBody: "arcgis-legend__layer-body",
  layerRow: "arcgis-legend__layer-row",
  symbol: "arcgis-legend__symbol",
  rampContainer: "arcgis-legend__ramps",
  sizeRamp: "arcgis-legend__size-ramp",
  rampLabelsContainer: "arcgis-legend__ramp-labels",
  rampLabel: "arcgis-legend__ramp-label",
  univariateLabel: "arcgis-legend__univariate-label"
};
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: g, opacity: p } = this, { sizeRampElement: i, colorRampElement: s } = $(g, this.messages);
    if (!i)
      return null;
    const m = z(i), d = 12, n = C(i, "full", !1), v = E(s, {
      width: d,
      height: n,
      rampAlignment: "vertical",
      opacity: p,
      type: "full",
      cssEffectFilter: this.cssEffectFilter,
      ariaLabel: this.messages.previewColorRampAriaLabel
    }), _ = i.infos.length - 1, b = i.infos.map((r, o) => o === 0 || o === _ ? t`<div class=${l(r.label ? s ? e.univariateLabel : e.rampLabel : void 0)}>${r.label}</div>` : null), f = { display: "table-cell", verticalAlign: "middle" }, y = { marginTop: `${m}px` }, h = { height: `${n}px` };
    return t`<div style=${a(L)}><div class=${l(e.layerBody)}>${i.infos.map((r) => t`<div class=${l(R(e.layerRow, e.sizeRamp))}><div class=${l(e.symbol)} style=${a(f)}>${r.preview}</div></div>`)}</div><div style=${a(y)}><div style=${a(S)}><div style=${a(c)}><div class=${l(e.rampContainer)}>${v}</div></div><div style=${a(c)}><div class=${l(e.rampLabelsContainer)} style=${a(h)}>${b}</div></div></div></div></div>`;
  }
}
u("arcgis-legend-classic-univariate-color-size-ramp", A);
export {
  A as ArcgisLegendClassicUnivariateColorSizeRamp
};
