import { s as m, e as D, a as y, j as a, D as l, f as d, t as s, S as v, h as o, k as h, C as b } from "./13339559.js";
import "react";
import "react-dom";
const c = async (e) => {
  const i = (await import("./c5244380.js")).default, f = o(e.minDate, h), r = o(e.maxDate, h), {
    disabledHours: C,
    disabledMinutes: w,
    disabledSeconds: x
  } = e.disabledTime();
  i.prompt({
    getContainer: () => document.querySelector(`#${b}`) || document.body,
    mouseWheel: !0,
    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) => !C().includes(t),
      minute: (t, {
        date: n
      }) => !w(n.getHours()).includes(t),
      second: (t, {
        date: n
      }) => !x(n.getHours(), n.getMinutes()).includes(t)
    },
    onConfirm: (t) => {
      const n = o(t);
      e.onChange(n);
    },
    onClose: e.onBlur
  }), e.onFocus();
}, g = m.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 && D(e.$style)}
`, u = m.div`
  overflow: hidden;
  white-space: nowrap;
  flex-grow: 1;
  display: flex;
  justify-content: center;
`, $ = (e) => /* @__PURE__ */ y(g, {
  ref: e.viewRef,
  $style: e.$style,
  onClick: () => c(e),
  children: [/* @__PURE__ */ a(u, {
    children: e.value ? e.value.format(e.format || (e.showTime ? l : d)) : s("date.placeholder")
  }), e.suffixIcon]
}), I = (e) => /* @__PURE__ */ y(g, {
  ref: e.viewRef,
  $style: e.$style,
  children: [/* @__PURE__ */ a(u, {
    onClick: () => c({
      ...e,
      value: e.start,
      onChange: (i) => e.onChange(i, e.end)
    }),
    children: e.start ? e.start.format(e.format || (e.showTime ? l : d)) : s("date.startDate")
  }), /* @__PURE__ */ a(v, {}), /* @__PURE__ */ a(u, {
    onClick: () => c({
      ...e,
      value: e.end,
      onChange: (i) => e.onChange(e.start, i)
    }),
    children: e.end ? e.end.format(e.format || (e.showTime ? l : d)) : s("date.endDate")
  }), e.suffixIcon]
});
export {
  $ as DateMobileUIView,
  I as DateRangeMobileUIView
};
