import { c as t } from "../../chunks/runtime.js";
import { usePropertyChange as e } from "@arcgis/lumina/controllers";
import i from "@geoscene/core/widgets/Measurement.js";
import { LitElement as s, createEvent as a, noShadowRoot as o } from "@arcgis/lumina";
import { m as r } from "../../chunks/useWidget.js";
import { css as n } 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 c = n`@layer{geoscene-measurement{display:block}}`, l = r(i);
class h extends s {
  constructor() {
    super(...arguments), this.widget = l(this), this.viewModel = this.widget.viewModel, this.activeTool = this.widget.activeTool, this.activeWidget = this.widget.activeWidget, this.areaUnit = this.widget.areaUnit, this.autoDestroyDisabled = !1, this.icon = this.widget.icon, this.label = this.widget.label, this.linearUnit = this.widget.linearUnit, this.position = "bottom-left", this.state = this.viewModel.state, this.geoscenePropertyChange = e()("activeTool", "state"), this.geosceneReady = a();
  }
  static {
    this.properties = { activeTool: 1, activeWidget: 0, areaUnit: 1, autoDestroyDisabled: 5, icon: 1, label: 1, linearUnit: 1, position: 1, referenceElement: 1, state: 3 };
  }
  static {
    this.shadowRootOptions = o;
  }
  static {
    this.styles = c;
  }
  async clear() {
    this.widget?.clear();
  }
  async destroy() {
    await this.manager.destroy();
  }
  async startMeasurement() {
    this.widget?.startMeasurement();
  }
}
t("geoscene-measurement", h);
export {
  h as GeosceneMeasurement
};