import { c as d } from "../../chunks/runtime.js";
import { css as h, html as m } from "lit";
import { LitElement as o, createEvent as c } from "@arcgis/lumina";
import { debounce as b } from "@arcgis/toolkit/function";
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
v5.0.0-next.123 */
const g = h`.container{display:flex;align-items:center;justify-content:space-between;position:relative}.slider{width:50%}.input{width:45%}`;
class $ extends o {
  constructor() {
    super(...arguments), this.debouncedApplyValueOnChange = b((e) => this.applyValueOnChange(e), 800), this.disabled = !1, this.flipLabels = !1, this.min = 0, this.max = 100, this.value = 50, this.step = 1, this.withSteppers = !1, this.arcgisSliderInputValueChange = c(), this.arcgisValueChange = c();
  }
  static {
    this.properties = { disabled: 5, label: 1, flipLabels: 5, min: 9, max: 9, value: 9, step: 9, unitsLabel: 1, withSteppers: 5 };
  }
  static {
    this.styles = g;
  }
  applyValueOnChange(e) {
    const { min: i, max: a, value: n } = this, s = Number(e.value), t = i !== void 0 && a !== void 0 ? Math.min(a, Math.max(i, s)) : s;
    s !== n && (e.value = `${t}`, this.arcgisValueChange.emit(t), this.arcgisSliderInputValueChange.emit(t), this.value = t);
  }
  render() {
    const { disabled: e, min: i, max: a, value: n, step: s, withSteppers: t, flipLabels: r, unitsLabel: p, label: u } = this;
    return m`<div class="container"><calcite-slider class="slider" .disabled=${e} .min=${i} .max=${a} .value=${n} .step=${s} @calciteSliderInput=${(l) => this.debouncedApplyValueOnChange(l.currentTarget)}></calcite-slider><calcite-input class="input" .disabled=${e} .min=${i} .max=${a} .numberButtonType=${t ? "vertical" : "none"} .prefixText=${r ? p : ""} @calciteInputInput=${(l) => this.debouncedApplyValueOnChange(l.target)} @click=${(l) => l.stopPropagation()} scale=s step=any .suffixText=${r ? "" : p} type=number .value=${`${n}`} .label=${u}></calcite-input></div>`;
  }
}
d("arcgis-slider-input", $);
export {
  $ as ArcgisSliderInput
};
