import { defineComponent as m, ref as n, toRefs as f, watch as b, onMounted as k, onUnmounted as z, openBlock as E, createElementBlock as I, normalizeStyle as u, unref as t, createElementVNode as B, toDisplayString as H } from "vue";
const j = m({ name: "EClock" }), T = /* @__PURE__ */ m({
  ...j,
  props: {
    chartConfig: {
      type: Object,
      required: !0
    }
  },
  setup(w) {
    const o = w;
    let i = n("2021-2-3"), h = n("08:00:00"), l = n("2021-2-3 08:00:00"), r = n("none");
    const { w: v, h: S } = f(o.chartConfig.attr);
    let {
      timeColor: $,
      timeSize: x,
      timeLineHeight: C,
      timeTextIndent: y,
      fontWeight: D,
      showShadow: q,
      hShadow: F,
      vShadow: L,
      blurShadow: N,
      colorShadow: O
    } = f(o.chartConfig.option);
    b(
      o.chartConfig.option,
      () => {
        try {
          o.chartConfig.option.showShadow ? r.value = `${o.chartConfig.option.hShadow}px ${o.chartConfig.option.vShadow}px ${o.chartConfig.option.blurShadow}px ${o.chartConfig.option.colorShadow}` : r.value = "none";
        } catch (e) {
          console.log(e);
        }
      },
      {
        immediate: !0
      }
    );
    let c;
    return k(() => {
      c = setInterval(() => {
        var e = new Date(), s = e.getFullYear(), _ = e.getMonth() + 1 < 10 ? "0" + (e.getMonth() + 1) : e.getMonth() + 1, M = e.getDate() < 10 ? "0" + e.getDate() : e.getDate(), d = e.getHours(), g = e.getMinutes(), p = e.getSeconds();
        let a = "";
        d < 10 && (a += "0"), a += d + ":", g < 10 && (a += "0"), a += g + ":", p < 10 && (a += "0"), a += p, i.value = `${s}-${_}-${M}`, h.value = a, l.value = i.value + " " + h.value;
      }, 500);
    }), z(() => {
      clearInterval(c);
    }), (e, s) => (E(), I("div", {
      class: "go-decorates-number",
      style: u(`width:${t(v)}px;height:${t(S)}px;`)
    }, [
      B("div", {
        style: u(`color:${t($)};font-size:${t(x)}px;line-height:${t(C)}px;
      letter-spacing:${t(y)}px;font-weight:${t(D)};
      text-shadow: ${t(r)}`)
      }, H(t(l)), 5)
    ], 4));
  }
});
export {
  T as default
};
