import { c as x, P as M } from "./eeb063a0.js";
import { s as C, e as T, a as g, j as a, T as s, t as u, S as w, C as j, h as f, l as b, m as k, n as d } from "./13339559.js";
import "./554cd359.js";
import "react";
import "react-dom";
x && document.addEventListener("touchstart", () => {
}, !0);
const I = (e = 1) => [...d.range(0, 24, e).map((t) => {
  const n = (t < 10 ? "0" : "") + t;
  return {
    label: n,
    value: n
  };
})], S = (e = 1) => [...d.range(0, 12, e).map((t) => {
  const n = (t < 10 ? "0" : "") + t;
  return {
    label: n,
    value: n
  };
})], h = (e = 1) => d.range(0, 60, e).map((t) => {
  const n = (t < 10 ? "0" : "") + t;
  return {
    label: n,
    value: n
  };
}), $ = [{
  label: "AM",
  value: "am"
}, {
  label: "PM",
  value: "pm"
}], c = (e) => {
  const {
    disabledHours: t,
    disabledMinutes: n,
    disabledSeconds: y
  } = e.disabledTime();
  M.prompt({
    getContainer: () => document.querySelector(`#${j}`) || document.body,
    mouseWheel: !0,
    destroyOnClose: !0,
    closeOnMaskClick: !0,
    columns: (o) => {
      const l = f(o.join(":"), b);
      return [(e.use12Hours ? S : I)(e.hourStep).filter(({
        label: m,
        value: i
      }) => !t().includes(Number(i) + (o[3] === "pm" ? 12 : 0))), h(e.minuteStep).filter(({
        label: m,
        value: i
      }) => !n(l.hour()).includes(Number(i))), h(e.secondStep).filter(({
        label: m,
        value: i
      }) => !y(l.hour(), l.minute()).includes(Number(i))), ...e.use12Hours ? [$] : []];
    },
    defaultValue: e.value ? e.value.format(e.use12Hours ? k : s).split(":") : void 0,
    onConfirm: (o) => {
      const l = f(o.join(":"), b);
      e.onChange(l);
    },
    onClose: e.onBlur
  }), e.onFocus();
}, v = C.div`
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background-color: #ffffff;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid #d7d9e0;

  ${(e) => e.$style && T(e.$style)}
`, r = C.div`
  overflow: hidden;
  white-space: nowrap;
  flex-grow: 1;
  display: flex;
  justify-content: center;
`, E = (e) => /* @__PURE__ */ g(v, {
  ref: e.viewRef,
  $style: e.$style,
  onClick: () => {
    c(e);
  },
  children: [/* @__PURE__ */ a(r, {
    children: e.value ? e.value.format(e.format || s) : u("time.placeholder")
  }), e.suffixIcon]
}), V = (e) => /* @__PURE__ */ g(v, {
  ref: e.viewRef,
  $style: e.$style,
  children: [/* @__PURE__ */ a(r, {
    onClick: () => c({
      ...e,
      value: e.start,
      onChange: (t) => e.onChange(t, e.end)
    }),
    children: e.start ? e.start.format(e.format || s) : u("time.startTime")
  }), /* @__PURE__ */ a(w, {}), /* @__PURE__ */ a(r, {
    onClick: () => c({
      ...e,
      value: e.end,
      onChange: (t) => e.onChange(e.start, t)
    }),
    children: e.end ? e.end.format(e.format || s) : u("time.endTime")
  }), e.suffixIcon]
});
export {
  E as TimeMobileUIView,
  V as TimeRangeMobileUIView
};
