import { c as n } from "../../chunks/runtime.js";
import { repeat as m } from "lit-html/directives/repeat.js";
import { html as c } from "lit-html";
import { u as o } from "../../chunks/useT9n.js";
import { LitElement as g, createEvent as u, safeClassMap as p } from "@arcgis/lumina";
import { css as h } from "@lit/reactive-element/css-tag.js";
/*! All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
v4.33.18 */
const b = h`.geoscene-unit-select{width:100%}.geoscene-unit-select__label{--calcite-label-margin-bottom: 0;width:100%}`, $ = "geoscene-unit-select", d = {
  label: `${$}__label`
};
class f extends g {
  constructor() {
    super(...arguments), this.messages = o({}), this.options = [], this.geosceneUnitSelectChange = u();
  }
  static {
    this.properties = { options: 0, selectLabel: 1, value: 0, messageOverrides: 0, label: 1 };
  }
  static {
    this.styles = b;
  }
  async destroy() {
    await this.manager.destroy();
  }
  render() {
    const { messages: s, options: l, selectLabel: a, value: i, geosceneUnitSelectChange: r } = this;
    return c`<calcite-label class=${p(d.label)}>${a}<calcite-select .label=${a} @calciteSelectChange=${(e) => {
      r.emit(e.target.value);
    }}>${m(l, (e) => e, (e) => c`<calcite-option .selected=${e === i} .value=${e}>${y(e) ? s.systems?.[e] : s.units?.[e]?.pluralCapitalized}</calcite-option>`)}</calcite-select></calcite-label>`;
  }
}
function y(t) {
  return t === "imperial" || t === "metric";
}
n("geoscene-unit-select", f);
export {
  f as GeosceneUnitSelect
};