import { a3 as g, ad as x, H as a, cl as l, cm as d, a4 as o, cj as c, ck as h, h4 as b } from "./56c67d3b.js";
import { getMobileStyle as T } from "./85fb0bcf.js";
import { a as M } from "./84393c9d.js";
import "react";
import "react-dom";
const s = async (e) => {
  const i = (await import("./d14fdd0b.js")).default, f = c(e.minDate, h), r = c(e.maxDate, h), {
    disabledHours: y,
    disabledMinutes: C,
    disabledSeconds: v
  } = e.disabledTime();
  i.prompt({
    getContainer: () => document.querySelector(`#${b}`) || document.body,
    mouseWheel: !0,
    cancelText: o("cancel"),
    confirmText: o("ok"),
    destroyOnClose: !0,
    closeOnMaskClick: !0,
    min: f.isValid() ? f.toDate() : void 0,
    max: r.isValid() ? r.toDate() : void 0,
    precision: e.showTime ? "second" : "day",
    defaultValue: e.value ? e.value.toDate() : void 0,
    filter: {
      hour: (t) => !y().includes(t),
      minute: (t, {
        date: n
      }) => !C(n.getHours()).includes(t),
      second: (t, {
        date: n
      }) => !v(n.getHours(), n.getMinutes()).includes(t)
    },
    onConfirm: (t) => {
      var m;
      const n = c(t), D = n.format(e.showTime ? l : d);
      (m = e.onChange) == null || m.call(e, n, D);
    },
    onClose: e.onBlur
  }), e.onFocus();
}, w = g.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)}
`, u = g.div`
  overflow: hidden;
  white-space: nowrap;
  flex-grow: 1;
  display: flex;
  justify-content: center;
`, V = (e) => /* @__PURE__ */ x(w, {
  ref: e.viewRef,
  $style: e.$style,
  onClick: () => s(e),
  children: [/* @__PURE__ */ a(u, {
    children: e.value ? e.value.format(e.format || (e.showTime ? l : d)) : o("date.placeholder")
  }), e.suffixIcon]
}), O = (e) => /* @__PURE__ */ x(w, {
  ref: e.viewRef,
  $style: e.$style,
  children: [/* @__PURE__ */ a(u, {
    onClick: () => s({
      ...e,
      value: e.start,
      onChange: (i) => e.onChange(i, e.end)
    }),
    children: e.start ? e.start.format(e.format || (e.showTime ? l : d)) : o("date.startDate")
  }), /* @__PURE__ */ a(M, {}), /* @__PURE__ */ a(u, {
    onClick: () => s({
      ...e,
      value: e.end,
      onChange: (i) => e.onChange(e.start, i)
    }),
    children: e.end ? e.end.format(e.format || (e.showTime ? l : d)) : o("date.endDate")
  }), e.suffixIcon]
});
export {
  V as DateMobileUIView,
  O as DateRangeMobileUIView
};
