import "../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import { defineComponent, computed, openBlock, createElementBlock, createElementVNode as createBaseVNode } from "../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
import { toRefs, unref } from "../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
const _hoisted_1 = ["width", "height"];
const _hoisted_2 = ["x", "y", "width", "height", "fill"];
const _hoisted_3 = ["to", "dur"];
const _hoisted_4 = ["x", "y", "width", "height", "fill"];
const _hoisted_5 = ["to", "dur"];
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    chartConfig: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    const { w, h } = toRefs(props.chartConfig.attr);
    const { colors, dur, endWidth, lineHeight } = toRefs(props.chartConfig.option);
    const rectX = computed(() => 0);
    const rectY = computed(() => h.value / 2);
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("svg", {
        width: unref(w),
        height: unref(h)
      }, [
        createBaseVNode("rect", {
          x: rectX.value,
          y: rectY.value,
          width: unref(w),
          height: unref(lineHeight),
          fill: unref(colors)[0]
        }, [
          createBaseVNode("animate", {
            attributeName: "width",
            from: "0",
            to: unref(w),
            dur: `${unref(dur)}s`,
            calcMode: "spline",
            keyTimes: "0;1",
            keySplines: ".42,0,.58,1",
            repeatCount: "indefinite"
          }, null, 8, _hoisted_3)
        ], 8, _hoisted_2),
        createBaseVNode("rect", {
          x: rectX.value,
          y: rectY.value,
          width: unref(endWidth),
          height: unref(lineHeight),
          fill: unref(colors)[1]
        }, [
          createBaseVNode("animate", {
            attributeName: "x",
            from: "0",
            to: unref(w),
            dur: `${unref(dur)}s`,
            calcMode: "spline",
            keyTimes: "0;1",
            keySplines: "0.42,0,0.58,1",
            repeatCount: "indefinite"
          }, null, 8, _hoisted_5)
        ], 8, _hoisted_4)
      ], 8, _hoisted_1);
    };
  }
});
export {
  _sfc_main as default
};
