/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
import { c as t } from "../../chunks/runtime.js";
import { css as n, html as i } from "lit";
import { LitElement as m, safeClassMap as r } from "@arcgis/lumina";
import { classes as l } from "@arcgis/toolkit/dom";
import { c, s as o, g as p } from "../../chunks/utils2.js";
const d = n`.size-ramp-container{margin-left:var(--calcite-spacing-sm);display:table}:dir(rtl) .size-ramp-container{margin-right:var(--calcite-spacing-sm);margin-left:0;overflow:auto}.size-ramp-row{display:table-row}.size-ramp-cell{padding:var(--calcite-spacing-xxs) 0;min-width:100px;vertical-align:middle;word-break:break-word;display:table-cell}.size-ramp-label{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)}.size-ramp-symbol-container{min-width:10px;text-align:center}.size-ramp-symbol{display:flex;justify-content:center}`;
class g extends m {
  constructor() {
    super(...arguments), this.legendElement = null;
  }
  static {
    this.properties = { legendElement: 0, messages: 0 };
  }
  static {
    this.styles = d;
  }
  render() {
    const e = this.legendElement.infos.map((s) => this._renderRow(s)).filter(Boolean);
    return e.length ? this.legendElement.theme === "spike" ? i`<arcgis-legend-spike-ramp .legendElement=${this.legendElement} .messages=${this.messages}></arcgis-legend-spike-ramp>` : i`<div class="size-ramp-container">${e}</div>` : null;
  }
  _renderRow(e) {
    const { preview: s } = e;
    if (!s)
      return null;
    const a = c(this.messages, e.label, !1);
    return o(s, p(this.messages, a)), i`<div class="size-ramp-row"><div class=${r(l("size-ramp-cell", "size-ramp-symbol-container"))}><div class="size-ramp-symbol">${s}</div></div><div class=${r(l("size-ramp-cell", "size-ramp-label"))}>${a}</div></div>`;
  }
}
t("arcgis-legend-classic-size-ramp", g);
export {
  g as ArcgisLegendClassicSizeRamp
};
