import { defineComponent as D, ref as m, createElementBlock as c, openBlock as d, normalizeClass as N, createElementVNode as e, createCommentVNode as Y, toDisplayString as y, unref as g, Fragment as z, renderList as w } from "vue";
import A from "dayjs";
const F = {
  key: 0,
  class: "zv-date-picker"
}, W = { class: "zv-date-picker__header" }, j = { class: "zv-date-picker__header-label" }, B = { class: "zv-date-picker__header-label" }, K = { class: "zv-date-picker__body" }, P = {
  class: "zv-date-table",
  cellspacing: "0",
  cellpadding: "0",
  role: "grid"
}, V = D({ name: "zv-interaction-data-picker" }), Q = /* @__PURE__ */ D({
  ...V,
  setup(q) {
    const h = m(!0), S = () => {
      const f = m(0), s = m(0), p = () => {
        const t = A();
        return [t.year(), t.month(), t.date()];
      }, u = (t, a, r) => new Date(t, a, r).getDay(), i = (t, a) => {
        const r = t[1] === 1 ? t[0] - 1 : t[0], o = t[1] === 1 ? 12 : t[1], l = [];
        let v = new Date(r, o, 0).getDate();
        for (let n = 0; n < a; n++)
          l.push({
            y: r,
            m: o,
            d: v--
          });
        return l.sort();
      }, b = (t, a) => {
        const r = a[1] === 12 ? a[0] + 1 : a[0], o = a[1] === 12 ? 1 : a[1] + 1, l = [], v = new Date(r, o, 0).getDate();
        for (let n = 1; n < 42 - t.length + 1; n++)
          n > v ? l.push({
            y: r,
            m: o,
            d: n - v
          }) : l.push({
            y: r,
            m: o,
            d: n
          });
        return [...t, ...l];
      }, _ = p(), C = u(_[0], _[1], 1), E = b(i(_, C), _), k = [];
      for (let t = 0; t < 6; t++)
        k.push(E.splice(0, 7));
      return {
        getCurrentDate: p,
        solarWeek: u,
        beforeDays: i,
        afterDays: b,
        dateArray: k,
        selectYear: f,
        selectMonth: s
      };
    }, {
      dateArray: x,
      selectYear: M,
      selectMonth: T
    } = S();
    return (f, s) => (d(), c("div", {
      class: N(["zerov-widgets-wrap", { "is-open": h.value }])
    }, [
      s[4] || (s[4] = e("div", { class: "selected-date" }, [
        e("div", { class: "selected-date__prefix" }, [
          e("img", {
            src: "https://lganv-1304359499.cos.ap-beijing.myqcloud.com/lg_cos_static/system/users/pages/xQY9EPmv7fsKSmtuEKmh/24gl-calendar-20241025175735939.png",
            alt: ""
          })
        ]),
        e("div", { class: "selected-date__inner" }, " 2024-10-25 15:35:46 ")
      ], -1)),
      h.value ? (d(), c("div", F, [
        e("div", W, [
          s[0] || (s[0] = e("span", { class: "zv-date-picker__prev-btn" }, [
            e("i", { class: "iconfont zv-drag-drop-down" }),
            e("i", { class: "iconfont zv-return" })
          ], -1)),
          e("span", j, y(g(M)), 1),
          e("span", B, y(g(T)), 1),
          s[1] || (s[1] = e("span", { class: "zv-date-picker__next-btn" }, [
            e("i", { class: "iconfont zv-arrow-right" }),
            e("i", { class: "iconfont zv-drag-drop-down-r" })
          ], -1))
        ]),
        e("div", K, [
          e("table", P, [
            e("tbody", null, [
              s[2] || (s[2] = e("tr", null, [
                e("th", {
                  "aria-label": "Sunday",
                  scope: "col"
                }, "Sun"),
                e("th", {
                  "aria-label": "Monday",
                  scope: "col"
                }, "Mon"),
                e("th", {
                  "aria-label": "Tuesday",
                  scope: "col"
                }, "Tue"),
                e("th", {
                  "aria-label": "Wednesday",
                  scope: "col"
                }, "Wed"),
                e("th", {
                  "aria-label": "Thursday",
                  scope: "col"
                }, "Thu"),
                e("th", {
                  "aria-label": "Friday",
                  scope: "col"
                }, "Fri"),
                e("th", {
                  "aria-label": "Saturday",
                  scope: "col"
                }, "Sat")
              ], -1)),
              (d(!0), c(z, null, w(g(x), (p, u) => (d(), c("tr", {
                key: u,
                class: "zv-date-table__row"
              }, [
                (d(!0), c(z, null, w(p, (i) => (d(), c("td", { key: i }, y(i.d), 1))), 128))
              ]))), 128))
            ])
          ])
        ]),
        s[3] || (s[3] = e("span", { class: "zv-date-picker__arrow" }, null, -1))
      ])) : Y("", !0)
    ], 2));
  }
});
export {
  Q as default
};
