import '@das-fed/upf-ui/packages/components/date-picker/style.css';
import { withInstall as ve } from "@das-fed/upf-utils/with-install/index";
import { defineComponent as pe, useCssVars as fe, ref as n, watch as H, computed as i, openBlock as f, createElementBlock as I, normalizeClass as ke, unref as o, normalizeStyle as X, createVNode as S, withCtx as p, withDirectives as me, createBlock as K, mergeProps as se, isRef as $e, createSlots as Ve, renderSlot as $, normalizeProps as ge, guardReactiveProps as we, createElementVNode as E, toDisplayString as O, Fragment as ue, createCommentVNode as w, nextTick as te, useAttrs as Be, createTextVNode as Me, renderList as Le, withModifiers as Re } from "vue";
import { ConfigProvider as Te, DatePicker as Ne, RangePicker as We, Dropdown as Ze, Menu as Ae, MenuItem as Fe, TimePicker as Oe, TimeRangePicker as qe } from "ant-design-vue";
import { DasAutoRegisterIcon as Ce, DasIcon as re } from "@das-fed/upf-ui/packages/components/icon/index";
import { DasTooltip as xe } from "@das-fed/upf-ui/packages/components/tooltip/index";
import { DasErrorOverlayModel as he } from "@das-fed/upf-ui/packages/components/error-overlay-model/index";
import { useModelValue as G } from "@das-fed/upf-utils/vue";
import { vHoverInside as ye } from "@das-fed/upf-utils/directive/hoverInside/index";
import { useZIndex as Ie } from "@das-fed/upf-utils/hooks/popup-manager/use-zindex";
import { currentLang as D, loadLocale as ze, t as ie, setI18nRule as Ue } from "@das-fed/upf-web/packages/i18n/index";
import { calcTextWidth as Se } from "@das-fed/upf-utils/common-tools";
import "ant-design-vue/es/date-picker/style/css";
import "ant-design-vue/es/config-provider/style/css";
import { DasDatePicker as De } from "@das-fed/upf-ui/packages/components/date-picker/index";
import Pe from "dayjs";
import "ant-design-vue/es/dropdown/style/css";
import "ant-design-vue/es/menu/style/css";
import "element-plus";
import { DasIconDengdai as He } from "@das-fed/upf-ui/packages/icons/dengdai/index";
import "ant-design-vue/es/time-picker/style/css";
const je = { class: "ant-picker-cell-inner" }, Ke = {
  key: 0,
  class: "das-date-picker-error-label-content"
}, Ye = {
  name: "DasDatePicker"
}, Xe = /* @__PURE__ */ pe({
  ...Ye,
  props: {
    modelValue: {},
    borderType: { default: "bordered" },
    size: { default: "middle" },
    width: { default: "230px" },
    height: {},
    showToday: { type: Boolean, default: !1 },
    disabled: { type: Boolean, default: !1 },
    isView: { type: Boolean, default: !1 },
    error: { type: Boolean, default: !1 },
    errorLabel: {},
    errorMode: { default: "default" },
    dropdownClassName: { default: "" },
    placeholder: { default: "" },
    teleported: { type: Boolean, default: !0 },
    errorModelZIndex: { default: 2e3 },
    noSetDefaultVal: { type: Boolean, default: !1 },
    isTooltip: { type: Boolean, default: !0 },
    formSize: {}
  },
  emits: ["change", "openChange", "update:model-value", "update:error"],
  setup(l, { expose: j, emit: d }) {
    fe((r) => ({
      v1a969202: J.value,
      v1e6cb46b: q.value
    }));
    const t = l, m = d;
    Ce({
      right: import("@das-fed/upf-ui/packages/icons/right"),
      left: import("@das-fed/upf-ui/packages/icons/left"),
      "double-arrow-left": import("@das-fed/upf-ui/packages/icons/double-arrow-left"),
      "double-arrow-right": import("@das-fed/upf-ui/packages/icons/double-arrow-right"),
      riqixuanze: import("@das-fed/upf-ui/packages/icons/riqixuanze")
    });
    const V = n(void 0);
    H(D, async () => {
      V.value = await ze(D.value);
    }, { immediate: !0 });
    const y = i(() => `date-picker-${D.value}`), c = n(null), R = n(null), T = i(() => t.size === "table" || t.size === "middle" || t.size === "default" ? "middle" : t.size), k = G(t, "modelValue"), N = G(t, "error"), P = i(() => t.isView ? t.noSetDefaultVal ? "" : "-" : t.placeholder || ie("请选择日期")), W = i(() => ({
      width: t.width
    })), J = i(() => t.width ? t.width : "230px"), Z = i(() => t.formSize), q = i(() => t.height ? t.height : Z.value ? {
      small: "24px",
      default: "32px",
      large: "40px"
    }[Z.value] : "auto"), B = n(3e3), A = i(() => ({
      "z-index": B.value
    })), C = n(!1), Y = n({
      display: "block",
      color: "var(--upf-color-error)",
      "white-space": "break-spaces"
    }), b = n(!1), L = n(""), U = i(() => k.value ? L.value : P.value), Q = () => {
      const r = t.size === "table" ? 12 : 14;
      return Se(P.value, r);
    }, u = () => {
      var a;
      const r = (a = c.value) == null ? void 0 : a.$el.querySelector(".ant-picker-input>input");
      return k.value ? r == null ? void 0 : r.scrollWidth : Q();
    }, s = () => {
      var e;
      const r = (e = c.value) == null ? void 0 : e.$el.querySelector(".ant-picker-input>input");
      return r ? (L.value = r.getAttribute("value"), r.removeAttribute("title"), (r == null ? void 0 : r.offsetWidth) ?? 0) : 0;
    }, g = n(0), z = n(0);
    H(() => [P.value, k.value], () => {
      te(() => {
        g.value = s(), z.value = u(), (g.value === z.value || z.value - g.value < 1) && (b.value = !1);
      });
    });
    const _ = n();
    H(
      () => {
        var r;
        return (r = R.value) == null ? void 0 : r.$tooltipRef.popperRef.contentRef;
      },
      (r) => {
        r && (r.addEventListener("mouseenter", function() {
          b.value = !0, _.value && clearTimeout(_.value);
        }), r.addEventListener("mouseleave", function() {
          _.value = setTimeout(() => {
            b.value = !1;
          }, 200);
        }));
      }
    );
    const x = (r) => {
      r && (B.value = Ie().nextZIndex()), m("openChange", r), D.value === "en-US" && te(() => {
        const a = document == null ? void 0 : document.querySelectorAll(".ant-picker-ok > .ant-btn > span");
        for (let e of a)
          e && (e.innerText = "OK");
      });
    }, le = () => {
      g.value = s(), z.value = u(), g.value === z.value || z.value - g.value < 1 ? b.value = !1 : (b.value = !0, _.value && clearTimeout(_.value)), C.value = !0;
    }, ae = () => {
      _.value = setTimeout(() => {
        b.value = !1;
      }, 200), C.value = !1;
    }, oe = (r, a) => {
      r ? le() : ae();
    }, ne = (r, a) => {
      N.value = !1, m("update:error", N.value), m("update:model-value", r), m("change", r, a);
    };
    return j({
      $datePicker: c,
      blur: () => {
        c.value.blur();
      },
      focus: () => {
        c.value.focus();
      }
    }), (r, a) => (f(), I(
      "div",
      {
        class: ke(["das-ui-date-picker", [l.borderType, t.isView ? "readonly" : "", o(N) ? "is-error" : ""]]),
        style: X(W.value)
      },
      [
        S(o(Te), { locale: V.value }, {
          default: p(() => [
            S(o(xe), {
              ref_key: "inputTooltipRef",
              ref: R,
              placement: "top",
              trigger: "hover",
              visible: b.value,
              disabled: !l.isTooltip,
              content: U.value
            }, {
              default: p(() => [
                me((f(), K(o(Ne), se({
                  key: y.value,
                  ref_key: "$datePicker",
                  ref: c
                }, r.$attrs, {
                  value: o(k),
                  "onUpdate:value": a[0] || (a[0] = (e) => $e(k) ? k.value = e : null),
                  size: T.value,
                  dropdownClassName: "das-ui-date-picker-dropdown " + l.dropdownClassName,
                  placeholder: P.value,
                  showToday: l.showToday,
                  bordered: l.borderType === "bordered",
                  disabled: t.disabled || t.isView,
                  style: W.value,
                  popupStyle: A.value,
                  onChange: ne,
                  onOpenChange: x
                }), Ve({
                  dateRender: p((e) => [
                    $(r.$slots, "dateRender", ge(we(e)), () => [
                      E(
                        "div",
                        je,
                        O(e.current.date()),
                        1
                        /* TEXT */
                      )
                    ], !0)
                  ]),
                  nextIcon: p(() => [
                    $(r.$slots, "nextIcon", {}, () => [
                      S(o(re), {
                        icon: "right",
                        size: "medium"
                      })
                    ], !0)
                  ]),
                  prevIcon: p(() => [
                    $(r.$slots, "prevIcon", {}, () => [
                      S(o(re), {
                        icon: "left",
                        size: "medium"
                      })
                    ], !0)
                  ]),
                  superNextIcon: p(() => [
                    $(r.$slots, "superNextIcon", {}, () => [
                      S(o(re), {
                        icon: "double-arrow-right",
                        size: "medium"
                      })
                    ], !0)
                  ]),
                  superPrevIcon: p(() => [
                    $(r.$slots, "superPrevIcon", {}, () => [
                      S(o(re), {
                        icon: "double-arrow-left",
                        size: "medium"
                      })
                    ], !0)
                  ]),
                  suffixIcon: p(() => [
                    $(r.$slots, "suffixIcon", {}, () => [
                      S(o(re), {
                        class: "das-suffix-icon",
                        icon: "riqixuanze",
                        size: "medium"
                      })
                    ], !0)
                  ]),
                  _: 2
                  /* DYNAMIC */
                }, [
                  r.$slots.renderExtraFooter ? {
                    name: "renderExtraFooter",
                    fn: p(() => [
                      $(r.$slots, "renderExtraFooter", {}, void 0, !0)
                    ]),
                    key: "0"
                  } : void 0
                ]), 1040, ["value", "size", "dropdownClassName", "placeholder", "showToday", "bordered", "disabled", "style", "popupStyle"])), [
                  [o(ye), oe]
                ])
              ]),
              _: 3
              /* FORWARDED */
            }, 8, ["visible", "disabled", "content"])
          ]),
          _: 3
          /* FORWARDED */
        }, 8, ["locale"]),
        l.error && l.errorLabel ? (f(), I(
          ue,
          { key: 0 },
          [
            l.errorMode === "default" ? (f(), I("div", Ke, [
              E(
                "span",
                {
                  style: X(Y.value)
                },
                O(l.errorLabel),
                5
                /* TEXT, STYLE */
              )
            ])) : w("v-if", !0),
            l.errorMode === "overlay" && C.value ? (f(), K(o(he), {
              key: 1,
              errorLabel: l.errorLabel,
              getEl: () => {
                var e;
                return (e = c.value) == null ? void 0 : e.$el;
              },
              errorModelZIndex: l.errorModelZIndex
            }, null, 8, ["errorLabel", "getEl", "errorModelZIndex"])) : w("v-if", !0)
          ],
          64
          /* STABLE_FRAGMENT */
        )) : w("v-if", !0)
      ],
      6
      /* CLASS, STYLE */
    ));
  }
}), be = (l, j) => {
  const d = l.__vccOpts || l;
  for (const [t, m] of j)
    d[t] = m;
  return d;
}, Ge = /* @__PURE__ */ be(Xe, [["__scopeId", "data-v-9335fe1d"]]), Je = { class: "date-range-separator" }, Qe = {
  key: 0,
  class: "das-date-picker-error-label-content"
}, _e = {
  name: "DasDateRangePicker"
}, et = /* @__PURE__ */ pe({
  ..._e,
  props: {
    modelValue: {},
    borderType: { default: "bordered" },
    size: {},
    width: { default: "428px" },
    height: {},
    itemWidth: { default: "200px" },
    format: { default: "YYYY/MM/DD HH:mm:ss" },
    valueFormat: {},
    showToday: { type: Boolean, default: !1 },
    separator: { default: "~" },
    disabledDate: {},
    placeholder: { default: void 0 },
    error: { type: Boolean },
    errorLabel: {},
    errorMode: { default: "default" },
    teleported: { type: Boolean, default: !0 },
    errorModelZIndex: { default: 2e3 },
    noSetDefaultVal: { type: Boolean },
    prevAttrs: {},
    nextAttrs: {},
    disabledUnit: {},
    formSize: {}
  },
  emits: ["change", "openChange", "update:model-value", "update:error"],
  setup(l, { emit: j }) {
    fe((u) => ({
      v11f9697a: T.value,
      v0db101da: R.value
    }));
    const d = l, t = j, m = Be(), V = i(() => d.placeholder ?? [ie("开始日期"), ie("结束日期")]), y = G(d, "modelValue"), c = G(d, "error"), R = i(() => d.width ? d.width : "230px"), T = i(() => d.height ? d.height : "auto"), k = i(() => ({ ...m, ...d.prevAttrs })), N = i(() => ({ ...m, ...d.nextAttrs })), P = n(), W = n(!1), J = n({
      display: "block",
      color: "var(--upf-color-error)",
      "white-space": "break-spaces"
    }), Z = () => {
      W.value = !0;
    }, q = () => {
      W.value = !1;
    }, B = (u, s) => {
      u ? Z() : q();
    }, A = (u, s) => {
      t("openChange", u, s), D.value === "en-US" && te(() => {
        const g = document == null ? void 0 : document.querySelectorAll(".ant-picker-ok > .ant-btn > span");
        for (let z of g)
          z && (z.innerText = "OK");
      });
    }, C = i(() => {
      let u = d.valueFormat ? d.valueFormat : d.format;
      return [
        y.value[0] ? Pe.isDayjs(y.value[0]) ? y.value[0].format(u) : y.value[0] : "",
        y.value[1] ? Pe.isDayjs(y.value[1]) ? y.value[1].format(u) : y.value[1] : ""
      ];
    }), Y = (u) => d.disabledDate && d.disabledDate(u) === !0 ? !0 : !!(y.value[1] && u.isAfter(y.value[1], d.disabledUnit || void 0)), b = (u) => d.disabledDate && d.disabledDate(u) === !0 ? !0 : !!(y.value[0] && u.isBefore(y.value[0], d.disabledUnit || void 0)), L = i(() => ({
      width: d.width
    })), U = (u, s) => {
      c.value = !1, t("update:model-value", y.value), t("change", y.value, C.value);
    }, Q = (u, s) => {
      c.value = !1, t("update:model-value", y.value), t("change", y.value, C.value);
    };
    return (u, s) => me((f(), I(
      "div",
      {
        class: "das-ui-date-range-picker",
        style: X(L.value),
        ref_key: "$dateRange",
        ref: P
      },
      [
        S(o(De), se(k.value, {
          modelValue: o(y)[0],
          "onUpdate:modelValue": s[0] || (s[0] = (g) => o(y)[0] = g),
          size: d.size,
          valueFormat: d.valueFormat,
          borderType: d.borderType,
          error: o(c),
          width: d.itemWidth,
          "disabled-date": Y,
          placeholder: V.value[0],
          onChange: U,
          onOpenChange: s[1] || (s[1] = (g) => A(g, "before"))
        }), null, 16, ["modelValue", "size", "valueFormat", "borderType", "error", "width", "placeholder"]),
        $(u.$slots, "separator", {}, () => [
          E(
            "span",
            Je,
            O(d.separator),
            1
            /* TEXT */
          )
        ], !0),
        S(o(De), se(N.value, {
          modelValue: o(y)[1],
          "onUpdate:modelValue": s[2] || (s[2] = (g) => o(y)[1] = g),
          size: d.size,
          valueFormat: d.valueFormat,
          borderType: d.borderType,
          error: o(c),
          width: d.itemWidth,
          "disabled-date": b,
          placeholder: V.value[1],
          onChange: Q,
          onOpenChange: s[3] || (s[3] = (g) => A(g, "after"))
        }), null, 16, ["modelValue", "size", "valueFormat", "borderType", "error", "width", "placeholder"]),
        l.error && l.errorLabel ? (f(), I(
          ue,
          { key: 0 },
          [
            l.errorMode === "default" ? (f(), I("div", Qe, [
              E(
                "span",
                {
                  style: X(J.value)
                },
                O(l.errorLabel),
                5
                /* TEXT, STYLE */
              )
            ])) : w("v-if", !0),
            l.errorMode === "overlay" && W.value ? (f(), K(o(he), {
              key: 1,
              errorLabel: l.errorLabel,
              getEl: () => P.value,
              errorModelZIndex: l.errorModelZIndex
            }, null, 8, ["errorLabel", "getEl", "errorModelZIndex"])) : w("v-if", !0)
          ],
          64
          /* STABLE_FRAGMENT */
        )) : w("v-if", !0)
      ],
      4
      /* STYLE */
    )), [
      [o(ye), B]
    ]);
  }
}), tt = /* @__PURE__ */ be(et, [["__scopeId", "data-v-9599ec25"]]), rt = { class: "ant-picker-cell-inner" }, lt = { class: "das-picker-footer-extra" }, at = {
  key: 0,
  class: "das-picker-ranges"
}, ot = { class: "das-picker-preset-span" }, nt = ["onClick"], ut = {
  key: 0,
  class: "das-date-picker-error-label-content"
}, st = {
  name: "DasRangePicker"
}, it = /* @__PURE__ */ pe({
  ...st,
  props: {
    modelValue: {},
    borderType: { default: "bordered" },
    size: { default: "middle" },
    width: { default: "230px" },
    height: {},
    format: {},
    showToday: { type: Boolean, default: !1 },
    ranges: { default: [] },
    disabled: { type: Boolean, default: !1 },
    isView: { type: Boolean, default: !1 },
    error: { type: Boolean, default: !1 },
    errorLabel: {},
    errorMode: { default: "default" },
    showTime: {},
    dropdownClassName: { default: "" },
    placeholder: { default: ["开始日期", "结束日期"] },
    teleported: { type: Boolean, default: !0 },
    errorModelZIndex: { default: 2e3 },
    noSetDefaultVal: { type: Boolean },
    isTooltip: { type: Boolean, default: !0 },
    formSize: {}
  },
  emits: ["change", "openChange", "update:model-value", "update:error"],
  setup(l, { expose: j, emit: d }) {
    fe((e) => ({
      v0cab478c: P.value,
      v6eeeb021: J.value
    }));
    const t = l, m = d;
    Ce({
      fold: import("@das-fed/upf-ui/packages/icons/fold"),
      riqixuanze: import("@das-fed/upf-ui/packages/icons/riqixuanze")
    });
    const V = n(void 0);
    H(D, async () => {
      V.value = await ze(D.value);
    }, { immediate: !0 });
    const y = i(() => `range-picker-${D.value}`), c = n(null), R = n(null), T = i(() => t.size === "table" || t.size === "middle" || t.size === "default" ? "middle" : t.size), k = G(t, "modelValue"), N = G(t, "error"), P = i(() => t.width ? t.width : "230px"), W = i(() => t.formSize), J = i(() => t.height ? t.height : W.value ? {
      small: "24px",
      default: "32px",
      large: "40px"
    }[W.value] : "auto"), Z = n(3e3), q = i(() => ({
      "z-index": Z.value
    })), B = n(!1), A = n({
      display: "block",
      color: "var(--upf-color-error)",
      "white-space": "break-spaces"
    }), C = i(() => {
      var e;
      return t.isView ? t.noSetDefaultVal ? ["", ""] : ["-", "-"] : (e = t.placeholder) == null ? void 0 : e.map((v) => ie(v));
    }), Y = i(() => ({
      width: t.width
    })), b = n(!1), L = n(["", ""]), U = n("~"), Q = i(() => {
      var e;
      return (e = k.value) != null && e.length && k.value[0] && k.value[1] ? L.value.join(" " + U.value + " ") : C.value.join(" " + U.value + " ");
    }), u = n([0, 0]), s = n([0, 0]), g = () => {
      var M;
      let e = [];
      const v = (M = c.value) == null ? void 0 : M.$el.querySelectorAll(".ant-picker-input>input");
      if (!v)
        return e = [0, 0], e;
      let h = [];
      for (let ee of v) {
        h.push(ee.getAttribute("value") || "");
        let Ee = (ee == null ? void 0 : ee.offsetWidth) ?? 0;
        e.push(Ee);
      }
      return L.value = h, e;
    }, z = (e) => {
      const v = t.size === "table" ? 12 : 14;
      return Se(e, v);
    }, F = () => {
      var h;
      let e = [];
      return ((h = c.value) == null ? void 0 : h.$el.querySelectorAll(".ant-picker-input>input")).forEach((M, ee) => {
        k.value.length && k.value[0] && k.value[0] ? e.push(M == null ? void 0 : M.scrollWidth) : e.push(z(C.value[ee]));
      }), e;
    };
    H(() => [C.value, k.value], () => {
      te(() => {
        u.value = g(), s.value = F(), (u.value[0] === s.value[0] || s.value[0] - u.value[0] < 1) && (u.value[1] === s.value[1] || s.value[1] - u.value[1] < 1) && (b.value = !1);
      });
    });
    const x = n();
    H(
      () => {
        var e;
        return (e = R.value) == null ? void 0 : e.$tooltipRef.popperRef.contentRef;
      },
      (e) => {
        e && (e.addEventListener("mouseenter", function() {
          b.value = !0, x.value && clearTimeout(x.value);
        }), e.addEventListener("mouseleave", function() {
          x.value = setTimeout(() => {
            b.value = !1;
          }, 200);
        }));
      }
    );
    const le = (e) => {
      e && (Z.value = Ie().nextZIndex()), m("openChange", e), D.value === "en-US" && te(() => {
        const v = document == null ? void 0 : document.querySelectorAll(".ant-picker-ok > .ant-btn > span");
        for (let h of v)
          h && (h.innerText = "OK");
      });
    }, ae = () => {
      u.value = g(), s.value = F(), (u.value[0] === s.value[0] || s.value[0] - u.value[0] < 1) && (u.value[1] === s.value[1] || s.value[1] - u.value[1] < 1) ? b.value = !1 : (b.value = !0, x.value && clearTimeout(x.value)), B.value = !0;
    }, oe = () => {
      x.value = setTimeout(() => {
        b.value = !1;
      }, 200), B.value = !1;
    }, ne = (e, v) => {
      e ? ae() : oe();
    }, de = (e, v) => {
      if (N.value = !1, e === null) {
        m("update:model-value", [null, null]), m("change", [null, null], v);
        return;
      }
      m("update:error", N.value), m("update:model-value", e), m("change", e, v);
    }, ce = (e) => {
      m("update:model-value", e.value), m("change", e.value, [e.value[0].format(t.format), e.value[1].format(t.format)]), c.value.blur();
    };
    return j({
      $rangePicker: c,
      blur: () => {
        c.value.blur();
      },
      focus: () => {
        c.value.focus();
      }
    }), (e, v) => (f(), I(
      "div",
      {
        class: ke(["das-ui-range-picker", [l.borderType, t.isView ? "readonly" : "", o(N) ? "is-error" : ""]]),
        style: X(Y.value)
      },
      [
        S(o(Te), { locale: V.value }, {
          default: p(() => [
            S(o(xe), {
              ref_key: "inputTooltipRef",
              ref: R,
              placement: "top",
              trigger: "hover",
              visible: b.value,
              disabled: !l.isTooltip,
              content: Q.value
            }, {
              default: p(() => [
                me((f(), K(o(We), se({
                  key: y.value,
                  ref_key: "$rangePicker",
                  ref: c
                }, e.$attrs, {
                  value: o(k),
                  size: T.value,
                  dropdownClassName: "das-ui-range-picker-dropdown " + l.dropdownClassName,
                  placeholder: C.value,
                  showToday: l.showToday,
                  showTime: l.showTime,
                  bordered: l.borderType === "bordered",
                  disabled: t.disabled || t.isView,
                  style: Y.value,
                  popupStyle: q.value,
                  onChange: de,
                  onOpenChange: le
                }), {
                  dateRender: p((h) => [
                    $(e.$slots, "dateRender", ge(we(h)), () => [
                      E(
                        "div",
                        rt,
                        O(h.current.date()),
                        1
                        /* TEXT */
                      )
                    ], !0)
                  ]),
                  nextIcon: p(() => [
                    w(' <slot name="nextIcon"> '),
                    v[1] || (v[1] = Me(
                      " XX ",
                      -1
                      /* CACHED */
                    )),
                    w(" </slot> ")
                  ]),
                  prevIcon: p(() => [
                    $(e.$slots, "prevIcon", {}, () => [
                      w(' <das-icon icon="left"></das-icon> ')
                    ], !0)
                  ]),
                  superNextIcon: p(() => [
                    $(e.$slots, "superNextIcon", {}, () => [
                      w(' <das-icon icon="double-arrow-right"></das-icon> ')
                    ], !0)
                  ]),
                  superPrevIcon: p(() => [
                    $(e.$slots, "superPrevIcon", {}, () => [
                      w(' <das-icon icon="double-arrow-left"></das-icon> ')
                    ], !0)
                  ]),
                  suffixIcon: p(() => [
                    $(e.$slots, "suffixIcon", {}, () => [
                      S(o(re), {
                        class: "das-suffix-icon",
                        icon: "riqixuanze",
                        size: "medium"
                      })
                    ], !0)
                  ]),
                  separator: p(() => [
                    $(e.$slots, "separator", {}, () => [
                      v[2] || (v[2] = E(
                        "div",
                        { style: { padding: "0 8px" } },
                        "~",
                        -1
                        /* CACHED */
                      ))
                    ], !0)
                  ]),
                  renderExtraFooter: p(() => [
                    E("div", lt, [
                      $(e.$slots, "renderExtraFooter", {}, void 0, !0)
                    ]),
                    l.showTime || l.ranges && l.ranges.length ? (f(), I("div", at, [
                      (f(!0), I(
                        ue,
                        null,
                        Le(l.ranges, (h) => (f(), I("div", {
                          class: "das-picker-preset",
                          key: h.key
                        }, [
                          w(` <el-dropdown v-if="item.type==='dropdown' && item.children.length" trigger="click" :teleported="false" placement='bottom-end'>\r
                 \r
                    <span class="das-picker-preset-span" >\r
                        {{ item.key }}<das-icon icon="fold" size='mini'></das-icon>\r
                    </span>\r
                \r
                  <template #dropdown>\r
\r
                    <el-dropdown-menu>\r
                      <el-dropdown-item v-for="child in item.children" :key="child.key" :command="child" >\r
                        <div class="das-picker-preset-item">\r
                          {{ child.key }}\r
                        </div>\r
                      </el-dropdown-item>\r
                    </el-dropdown-menu>\r
                  </template>\r
                </el-dropdown> `),
                          h.type === "dropdown" && h.children.length ? (f(), K(
                            o(Ze),
                            {
                              key: 0,
                              trigger: ["click"]
                            },
                            {
                              overlay: p(() => [
                                S(
                                  o(Ae),
                                  null,
                                  {
                                    default: p(() => [
                                      (f(!0), I(
                                        ue,
                                        null,
                                        Le(h.children, (M) => (f(), K(o(Fe), {
                                          key: M.key,
                                          onClick: (ee) => ce(M)
                                        }, {
                                          default: p(() => [
                                            (f(), I(
                                              "span",
                                              { key: M },
                                              O(M.key),
                                              1
                                              /* TEXT */
                                            ))
                                          ]),
                                          _: 2
                                          /* DYNAMIC */
                                        }, 1032, ["onClick"]))),
                                        128
                                        /* KEYED_FRAGMENT */
                                      ))
                                    ]),
                                    _: 2
                                    /* DYNAMIC */
                                  },
                                  1024
                                  /* DYNAMIC_SLOTS */
                                )
                              ]),
                              default: p(() => [
                                E("a", {
                                  class: "ant-dropdown-link",
                                  onClick: v[0] || (v[0] = Re(() => {
                                  }, ["prevent"]))
                                }, [
                                  E("span", ot, [
                                    Me(
                                      O(h.key) + " ",
                                      1
                                      /* TEXT */
                                    ),
                                    S(o(re), {
                                      icon: "fold",
                                      size: "mini",
                                      style: { display: "inline-block" }
                                    })
                                  ])
                                ])
                              ]),
                              _: 2
                              /* DYNAMIC */
                            },
                            1024
                            /* DYNAMIC_SLOTS */
                          )) : (f(), I("span", {
                            key: 1,
                            class: "das-picker-preset-span",
                            onClick: (M) => ce(h)
                          }, O(h.key), 9, nt))
                        ]))),
                        128
                        /* KEYED_FRAGMENT */
                      )),
                      w(` <div class="das-picker-ok">\r
                <das-button btnType="primary" size="middle">Ok</das-button>\r
              </div> `)
                    ])) : w("v-if", !0)
                  ]),
                  _: 3
                  /* FORWARDED */
                }, 16, ["value", "size", "dropdownClassName", "placeholder", "showToday", "showTime", "bordered", "disabled", "style", "popupStyle"])), [
                  [o(ye), ne]
                ])
              ]),
              _: 3
              /* FORWARDED */
            }, 8, ["visible", "disabled", "content"])
          ]),
          _: 3
          /* FORWARDED */
        }, 8, ["locale"]),
        w(` <div\r
      :class="[errorMode === 'default' ? 'das-date-picker-error-label-content' : 'das-date-picker-overlay-error-label-content', 'das-picker-label-content']"\r
      v-if="(errorMode === 'default' || (errorMode === 'overlay' && isHoverInInput)) && currError && !!errorLabel"\r
    >\r
      <span v-if="currError" class="das-picker-error-label label" :title="errorLabel">{{ errorLabel }}</span>\r
    </div> `),
        l.error && l.errorLabel ? (f(), I(
          ue,
          { key: 0 },
          [
            l.errorMode === "default" ? (f(), I("div", ut, [
              E(
                "span",
                {
                  style: X(A.value)
                },
                O(l.errorLabel),
                5
                /* TEXT, STYLE */
              )
            ])) : w("v-if", !0),
            l.errorMode === "overlay" && B.value ? (f(), K(o(he), {
              key: 1,
              errorLabel: l.errorLabel,
              getEl: () => {
                var h;
                return (h = c.value) == null ? void 0 : h.$el;
              },
              errorModelZIndex: l.errorModelZIndex
            }, null, 8, ["errorLabel", "getEl", "errorModelZIndex"])) : w("v-if", !0)
          ],
          64
          /* STABLE_FRAGMENT */
        )) : w("v-if", !0)
      ],
      6
      /* CLASS, STYLE */
    ));
  }
}), dt = /* @__PURE__ */ be(it, [["__scopeId", "data-v-9085501f"]]), ct = { class: "ant-picker-cell-inner" }, vt = {
  key: 0,
  class: "das-date-picker-error-label-content"
}, pt = {
  name: "DasDatePicker"
}, ft = /* @__PURE__ */ pe({
  ...pt,
  props: {
    modelValue: {},
    borderType: { default: "bordered" },
    size: { default: "middle" },
    width: { default: "230px" },
    height: {},
    showNow: { type: Boolean, default: !1 },
    disabled: { type: Boolean, default: !1 },
    isView: { type: Boolean, default: !1 },
    error: { type: Boolean, default: !1 },
    errorLabel: {},
    errorMode: { default: "default" },
    dropdownClassName: { default: "" },
    placeholder: { default: "请选择时间" },
    teleported: { type: Boolean, default: !0 },
    errorModelZIndex: { default: 2e3 },
    noSetDefaultVal: { type: Boolean },
    isTooltip: { type: Boolean, default: !0 },
    formSize: {}
  },
  emits: ["change", "openChange", "update:model-value", "update:error"],
  setup(l, { expose: j, emit: d }) {
    fe((r) => ({
      v680e6b6e: N.value,
      v7ff0087f: J.value
    }));
    const t = l, m = d, V = n(void 0);
    H(D, async () => {
      V.value = await ze(D.value);
    }, { immediate: !0 });
    const y = i(() => `time-picker-${D.value}`), c = n(null), R = n(null), T = G(t, "modelValue"), k = G(t, "error"), N = i(() => t.width ? t.width : "230px"), P = i(() => t.formSize), W = i(() => t.size === "large" ? "large" : t.size === "small" || t.size === "table" ? "small" : "middle"), J = i(() => t.height ? t.height : P.value ? {
      small: "24px",
      default: "32px",
      large: "40px"
    }[P.value] : "auto"), Z = i(() => ({
      width: t.width
    })), q = i(() => t.isView ? t.noSetDefaultVal ? "" : "-" : ie(t.placeholder)), B = n(3e3), A = i(() => ({
      "z-index": B.value
    })), C = n(!1), Y = n({
      display: "block",
      color: "var(--upf-color-error)",
      "white-space": "break-spaces"
    }), b = (r) => {
      r && (B.value = Ie().nextZIndex()), m("openChange", r), String(D.value).startsWith("en") && te(() => {
        const a = document == null ? void 0 : document.querySelectorAll(".ant-picker-ok > .ant-btn > span");
        for (let e of a)
          e && (e.innerText = "OK");
      });
    }, L = n(!1), U = n(""), Q = i(() => T.value ? U.value : q.value), u = () => {
      const r = t.size === "table" ? 12 : 14;
      return Se(q.value, r);
    }, s = () => {
      var a;
      const r = (a = c.value) == null ? void 0 : a.$el.querySelector(".ant-picker-input>input");
      return T.value ? r == null ? void 0 : r.scrollWidth : u();
    }, g = () => {
      var e;
      const r = (e = c.value) == null ? void 0 : e.$el.querySelector(".ant-picker-input>input");
      return r ? (U.value = r.getAttribute("value"), r.removeAttribute("title"), (r == null ? void 0 : r.offsetWidth) ?? 0) : 0;
    }, z = n(0), F = n(0);
    H(() => [q.value, T.value], () => {
      te(() => {
        z.value = g(), F.value = s(), (z.value === F.value || F.value - z.value < 1) && (L.value = !1);
      });
    });
    const x = n();
    H(
      () => {
        var r;
        return (r = R.value) == null ? void 0 : r.$tooltipRef.popperRef.contentRef;
      },
      (r) => {
        r && (r.addEventListener("mouseenter", function() {
          L.value = !0, x.value && clearTimeout(x.value);
        }), r.addEventListener("mouseleave", function() {
          x.value = setTimeout(() => {
            L.value = !1;
          }, 200);
        }));
      }
    );
    const le = () => {
      z.value = g(), F.value = s(), z.value === F.value || F.value - z.value < 1 ? L.value = !1 : (L.value = !0, x.value && clearTimeout(x.value)), C.value = !0;
    }, ae = () => {
      x.value = setTimeout(() => {
        L.value = !1;
      }, 200), C.value = !1;
    }, oe = (r) => {
      r ? le() : ae();
    }, ne = (r, a) => {
      k.value = !1, m("update:error", k.value), m("update:model-value", r), m("change", r, a);
    };
    return j({
      $timePicker: c,
      blur: () => {
        c.value.blur();
      },
      focus: () => {
        c.value.focus();
      }
    }), (r, a) => (f(), I(
      "div",
      {
        class: ke(["das-ui-time-picker", [l.borderType, t.isView ? "readonly" : "", o(k) ? "is-error" : ""]]),
        style: X(Z.value)
      },
      [
        S(o(Te), { locale: V.value }, {
          default: p(() => [
            S(o(xe), {
              ref_key: "inputTooltipRef",
              ref: R,
              placement: "top",
              trigger: "hover",
              visible: L.value,
              disabled: !l.isTooltip,
              content: Q.value
            }, {
              default: p(() => [
                me((f(), K(o(Oe), se({
                  key: y.value,
                  ref_key: "$timePicker",
                  ref: c
                }, r.$attrs, {
                  value: o(T),
                  "onUpdate:value": a[0] || (a[0] = (e) => $e(T) ? T.value = e : null),
                  size: W.value,
                  popupClassName: "das-ui-time-picker-dropdown " + l.dropdownClassName,
                  showNow: l.showNow,
                  bordered: l.borderType === "bordered",
                  placeholder: q.value,
                  disabled: t.disabled || t.isView,
                  style: Z.value,
                  popupStyle: A.value,
                  onChange: ne,
                  onOpenChange: b
                }), {
                  dateRender: p((e) => [
                    $(r.$slots, "dateRender", ge(we(e)), () => [
                      E(
                        "div",
                        ct,
                        O(e.current.date()),
                        1
                        /* TEXT */
                      )
                    ], !0)
                  ]),
                  suffixIcon: p(() => [
                    $(r.$slots, "suffixIcon", {}, () => [
                      S(o(He), {
                        class: "das-suffix-icon",
                        size: "medium"
                      })
                    ], !0)
                  ]),
                  _: 3
                  /* FORWARDED */
                }, 16, ["value", "size", "popupClassName", "showNow", "bordered", "placeholder", "disabled", "style", "popupStyle"])), [
                  [o(ye), oe]
                ])
              ]),
              _: 3
              /* FORWARDED */
            }, 8, ["visible", "disabled", "content"])
          ]),
          _: 3
          /* FORWARDED */
        }, 8, ["locale"]),
        l.error && l.errorLabel ? (f(), I(
          ue,
          { key: 0 },
          [
            l.errorMode === "default" ? (f(), I("div", vt, [
              E(
                "span",
                {
                  style: X(Y.value)
                },
                O(l.errorLabel),
                5
                /* TEXT, STYLE */
              )
            ])) : w("v-if", !0),
            l.errorMode === "overlay" && C.value ? (f(), K(o(he), {
              key: 1,
              errorLabel: l.errorLabel,
              getEl: () => {
                var e;
                return (e = c.value) == null ? void 0 : e.$el;
              },
              errorModelZIndex: l.errorModelZIndex
            }, null, 8, ["errorLabel", "getEl", "errorModelZIndex"])) : w("v-if", !0),
            w(` <template v-else-if="errorMode === 'overlay' && isHoverInInput">\r
        <teleport to="body" v-if="teleported">\r
          <div ref="$errorModel" :style="errorModelStyle">\r
            <span :style="errorLabelStyle">{{ errorLabel }}</span>\r
          </div>\r
        </teleport>\r
\r
        <div :style="errorModalBaseSyle" class="das-picker-error-label label" v-else>\r
          <span :style="errorLabelStyle">{{ errorLabel }}</span>\r
        </div>\r
      </template> `)
          ],
          64
          /* STABLE_FRAGMENT */
        )) : w("v-if", !0)
      ],
      6
      /* CLASS, STYLE */
    ));
  }
}), mt = /* @__PURE__ */ be(ft, [["__scopeId", "data-v-dfa7b5b9"]]), ht = { class: "ant-picker-cell-inner" }, yt = {
  key: 0,
  class: "das-date-picker-error-label-content"
}, bt = {
  name: "DasDatePicker"
}, kt = /* @__PURE__ */ pe({
  ...bt,
  props: {
    modelValue: {},
    borderType: { default: "bordered" },
    size: { default: "middle" },
    width: { default: "230px" },
    height: {},
    showNow: { type: Boolean, default: !1 },
    disabled: { type: Boolean, default: !1 },
    isView: { type: Boolean, default: !1 },
    error: { type: Boolean, default: !1 },
    errorLabel: {},
    errorMode: { default: "default" },
    dropdownClassName: { default: "" },
    placeholder: { default: ["开始时间", "结束时间"] },
    teleported: { type: Boolean, default: !0 },
    errorModelZIndex: { default: 2e3 },
    noSetDefaultVal: { type: Boolean },
    isTooltip: { type: Boolean, default: !0 },
    formSize: {}
  },
  emits: ["change", "openChange", "update:model-value", "update:error"],
  setup(l, { expose: j, emit: d }) {
    fe((a) => ({
      v43899416: N.value,
      v13d9f4d7: J.value
    })), Ce({
      dengdai: import("@das-fed/upf-ui/packages/icons/dengdai")
    });
    const t = l, m = d, V = n(void 0);
    H(D, async () => {
      V.value = await ze(D.value);
    }, { immediate: !0 });
    const y = i(() => `time-range-picker-${D.value}`), c = n(null), R = n(null), T = G(t, "modelValue"), k = G(t, "error"), N = i(() => t.width ? t.width : "230px"), P = i(() => t.formSize), W = i(() => t.size === "large" ? "large" : t.size === "small" || t.size === "table" ? "small" : "middle"), J = i(() => t.height ? t.height : P.value ? {
      small: "24px",
      default: "32px",
      large: "40px"
    }[P.value] : "auto"), Z = n(3e3), q = i(() => ({
      "z-index": Z.value
    })), B = i(() => ({
      width: t.width
    })), A = i(() => {
      var a;
      return t.isView ? t.noSetDefaultVal ? ["", ""] : ["-", "-"] : (a = t.placeholder) == null ? void 0 : a.map((e) => ie(e));
    }), C = n(!1), Y = n({
      display: "block",
      color: "var(--upf-color-error)",
      "white-space": "break-spaces"
    }), b = n(!1), L = n(["", ""]), U = n("~"), Q = i(() => {
      var a;
      return (a = T.value) != null && a.length && T.value[0] && T.value[1] ? L.value.join(" " + U.value + " ") : A.value.join(" " + U.value + " ");
    }), u = n([0, 0]), s = n([0, 0]), g = () => {
      var h;
      let a = [];
      const e = (h = c.value) == null ? void 0 : h.$el.querySelectorAll(".ant-picker-input>input");
      if (!e)
        return a = [0, 0], a;
      let v = [];
      for (let M of e) {
        v.push(M.getAttribute("value") || "");
        let ee = (M == null ? void 0 : M.offsetWidth) ?? 0;
        a.push(ee);
      }
      return L.value = v, a;
    }, z = (a) => {
      const e = t.size === "table" ? 12 : 14;
      return Se(a, e);
    }, F = () => {
      var v;
      let a = [];
      return ((v = c.value) == null ? void 0 : v.$el.querySelectorAll(".ant-picker-input>input")).forEach((h, M) => {
        T.value.length && T.value[0] && T.value[0] ? a.push(h == null ? void 0 : h.scrollWidth) : a.push(z(A.value[M]));
      }), a;
    };
    H(() => [A.value, T.value], () => {
      te(() => {
        u.value = g(), s.value = F(), (u.value[0] === s.value[0] || s.value[0] - u.value[0] < 1) && (u.value[1] === s.value[1] || s.value[1] - u.value[1] < 1) && (b.value = !1);
      });
    });
    const x = n();
    H(
      () => {
        var a;
        return (a = R.value) == null ? void 0 : a.$tooltipRef.popperRef.contentRef;
      },
      (a) => {
        a && (a.addEventListener("mouseenter", function() {
          b.value = !0, x.value && clearTimeout(x.value);
        }), a.addEventListener("mouseleave", function() {
          x.value = setTimeout(() => {
            b.value = !1;
          }, 200);
        }));
      }
    );
    const le = (a) => {
      a && (Z.value = Ie().nextZIndex()), m("openChange", a), String(D.value).startsWith("en") && te(() => {
        const e = document == null ? void 0 : document.querySelectorAll(".ant-picker-ok > .ant-btn > span");
        for (let v of e)
          v && (v.innerText = "OK");
      });
    }, ae = () => {
      u.value = g(), s.value = F(), (u.value[0] === s.value[0] || s.value[0] - u.value[0] < 1) && (u.value[1] === s.value[1] || s.value[1] - u.value[1] < 1) ? b.value = !1 : (b.value = !0, x.value && clearTimeout(x.value)), C.value = !0;
    }, oe = () => {
      x.value = setTimeout(() => {
        b.value = !1;
      }, 200), C.value = !1;
    }, ne = (a) => {
      a ? ae() : oe();
    }, de = (a, e) => {
      if (k.value = !1, a === null) {
        m("update:model-value", [null, null]), m("change", [null, null], Array.isArray(e) ? e.join(" ~ ") : e);
        return;
      }
      m("update:error", k.value), m("update:model-value", a), m("change", a, Array.isArray(e) ? e.join(" ~ ") : e);
    };
    return j({
      $timeRangePicker: c,
      blur: () => {
        c.value.blur();
      },
      focus: () => {
        c.value.focus();
      }
    }), (a, e) => (f(), I(
      "div",
      {
        class: ke(["das-ui-time-range-picker", [l.borderType, t.isView ? "readonly" : "", o(k) ? "is-error" : ""]]),
        style: X(B.value)
      },
      [
        S(o(Te), { locale: V.value }, {
          default: p(() => [
            S(o(xe), {
              ref_key: "inputTooltipRef",
              ref: R,
              placement: "top",
              trigger: "hover",
              visible: b.value,
              disabled: !l.isTooltip,
              content: Q.value
            }, {
              default: p(() => [
                me((f(), K(o(qe), se({
                  key: y.value,
                  ref_key: "$timeRangePicker",
                  ref: c
                }, a.$attrs, {
                  value: o(T),
                  "onUpdate:value": e[0] || (e[0] = (v) => $e(T) ? T.value = v : null),
                  size: W.value,
                  popupClassName: "das-ui-time-range-picker-dropdown " + l.dropdownClassName,
                  showNow: l.showNow,
                  bordered: l.borderType === "bordered",
                  placeholder: A.value,
                  disabled: t.disabled || t.isView,
                  style: B.value,
                  popupStyle: q.value,
                  onChange: de,
                  onOpenChange: le
                }), {
                  dateRender: p((v) => [
                    $(a.$slots, "dateRender", ge(we(v)), () => [
                      E(
                        "div",
                        ht,
                        O(v.current.date()),
                        1
                        /* TEXT */
                      )
                    ], !0)
                  ]),
                  suffixIcon: p(() => [
                    $(a.$slots, "suffixIcon", {}, () => [
                      S(o(re), {
                        class: "das-suffix-icon",
                        icon: "dengdai",
                        size: "medium"
                      })
                    ], !0)
                  ]),
                  separator: p(() => [
                    $(a.$slots, "separator", {}, () => [
                      e[1] || (e[1] = E(
                        "div",
                        { style: { padding: "0 8px" } },
                        "~",
                        -1
                        /* CACHED */
                      ))
                    ], !0)
                  ]),
                  _: 3
                  /* FORWARDED */
                }, 16, ["value", "size", "popupClassName", "showNow", "bordered", "placeholder", "disabled", "style", "popupStyle"])), [
                  [o(ye), ne]
                ])
              ]),
              _: 3
              /* FORWARDED */
            }, 8, ["visible", "disabled", "content"])
          ]),
          _: 3
          /* FORWARDED */
        }, 8, ["locale"]),
        l.error && l.errorLabel ? (f(), I(
          ue,
          { key: 0 },
          [
            l.errorMode === "default" ? (f(), I("div", yt, [
              E(
                "span",
                {
                  style: X(Y.value)
                },
                O(l.errorLabel),
                5
                /* TEXT, STYLE */
              )
            ])) : w("v-if", !0),
            l.errorMode === "overlay" && C.value ? (f(), K(o(he), {
              key: 1,
              errorLabel: l.errorLabel,
              getEl: () => {
                var v;
                return (v = c.value) == null ? void 0 : v.$el;
              },
              errorModelZIndex: l.errorModelZIndex
            }, null, 8, ["errorLabel", "getEl", "errorModelZIndex"])) : w("v-if", !0)
          ],
          64
          /* STABLE_FRAGMENT */
        )) : w("v-if", !0)
      ],
      6
      /* CLASS, STYLE */
    ));
  }
}), gt = /* @__PURE__ */ be(kt, [["__scopeId", "data-v-897bf2ce"]]), wt = {
  开始日期: { "zh-CN": "开始日期", en: "Start Date", "zh-MO": "開始日期", _appCode: "framework" },
  结束日期: { "zh-CN": "结束日期", en: "End Date", "zh-MO": "結束日期", _appCode: "framework" },
  开始时间: { "zh-CN": "开始时间", en: "Start Time", "zh-MO": "開始時間", _appCode: "framework" },
  结束时间: { "zh-CN": "结束时间", en: "End Time", "zh-MO": "結束時間", _appCode: "framework" },
  请选择日期: { "zh-CN": "请选择日期", en: "Please select a date", "zh-MO": "請選擇日期", _appCode: "framework" },
  请选择时间: { "zh-CN": "请选择时间", en: "Please select the time", "zh-MO": "請選擇時間", _appCode: "framework" }
};
Ue(wt);
const Ot = ve(Ge), qt = ve(tt), Ut = ve(dt), Ht = ve(mt), jt = ve(gt), Kt = { name: "datePicker 日期时间选择器" };
export {
  Ot as DasDatePicker,
  qt as DasDateRangePicker,
  Ut as DasRangePicker,
  Ht as DasTimePicker,
  jt as DasTimeRangePicker,
  Kt as default
};
