import { c as i } from "../../chunks/runtime.js";
import { usePropertyChange as e } from "@arcgis/lumina/controllers";
import { reEmitEvent as s } from "@arcgis/lumina/controllers/accessor";
import o from "@geoscene/core/widgets/TimeSlider.js";
import { LitElement as a, createEvent as h, noShadowRoot as l } from "@arcgis/lumina";
import { m as n } from "../../chunks/useWidget.js";
import { css as d } from "@lit/reactive-element/css-tag.js";
import { when as r } from "@geoscene/core/core/reactiveUtils.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 m = d`@layer{geoscene-time-slider{display:block}}`, c = n(o);
class g extends a {
  constructor() {
    super(...arguments), this.widget = c(this), this.viewModel = this.widget.viewModel, this.actions = this.widget.actions, this.autoDestroyDisabled = !1, this.disabled = this.widget.disabled, this.effectiveStops = this.widget.effectiveStops, this.fullTimeExtent = this.widget.fullTimeExtent, this.icon = this.widget.icon, this.label = this.widget.label, this.layout = this.widget.layout, this.loop = this.widget.loop, this.mode = this.widget.mode, this.playRate = this.widget.playRate, this.position = "bottom-left", this.state = this.viewModel.state, this.stops = this.widget.stops, this.tickConfigs = this.widget.tickConfigs, this.timeExtent = this.widget.timeExtent, this.timeVisible = this.widget.timeVisible, this.timeZone = this.widget.timeZone, this.geoscenePropertyChange = e()("effectiveStops", "fullTimeExtent", "timeExtent", "state"), this.geosceneReady = h(), this.geosceneTriggerAction = s(() => this.widget, "trigger-action");
  }
  static {
    this.properties = { actions: 0, autoDestroyDisabled: 5, disabled: 7, effectiveStops: 0, fullTimeExtent: 0, icon: 1, label: 1, layout: 1, loop: 5, mode: 1, playRate: 9, position: 1, referenceElement: 1, state: 3, stops: 0, tickConfigs: 0, timeExtent: 0, timeVisible: 5, timeZone: 1 };
  }
  static {
    this.shadowRootOptions = l;
  }
  static {
    this.styles = m;
  }
  async applyTimeSliderSettings(t) {
    Object.assign(this, t);
  }
  async destroy() {
    await this.manager.destroy();
  }
  async next() {
    this.widget?.next();
  }
  async play() {
    this.widget?.play();
  }
  async previous() {
    this.widget?.previous();
  }
  async stop() {
    this.widget?.stop();
  }
  async updateWebDocument(t) {
    this.widget?.updateWebDocument(t);
  }
  loaded() {
    this.manager.onLifecycle(() => r(() => this.viewModel.view?.ready, () => {
      this.timeExtent && this.viewModel.view && (this.viewModel.view.timeExtent = this.timeExtent);
    }, { initial: !0 }));
  }
}
i("geoscene-time-slider", g);
export {
  g as GeosceneTimeSlider
};