"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const event = require("../../../constants/event.js");
const index = require("../../../hooks/use-namespace/index.js");
const index$1 = require("../../../hooks/use-ordered-children/index.js");
const steps = require("./steps.js");
const tokens = require("./tokens.js");
const Vue = require("vue");
var steps_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ Vue.defineComponent({
  name: "ElSteps",
  __name: "steps",
  props: steps.stepsProps,
  emits: steps.stepsEmits,
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const ns = index.useNamespace("steps");
    const { children: steps2, addChild: addStep, removeChild: removeStep, ChildrenSorter: StepsSorter } = index$1.useOrderedChildren(Vue.getCurrentInstance(), "ElStep");
    Vue.watch(steps2, () => {
      steps2.value.forEach((instance, index2) => {
        instance.setIndex(index2);
      });
    });
    Vue.provide(tokens.STEPS_INJECTION_KEY, {
      props,
      steps: steps2,
      addStep,
      removeStep
    });
    Vue.watch(() => props.active, (newVal, oldVal) => {
      emit(event.CHANGE_EVENT, newVal, oldVal);
    });
    return (_ctx, _cache) => {
      return Vue.openBlock(), Vue.createElementBlock("div", { class: Vue.normalizeClass([Vue.unref(ns).b(), Vue.unref(ns).m(__props.simple ? "simple" : __props.direction)]) }, [Vue.renderSlot(_ctx.$slots, "default"), Vue.createVNode(Vue.unref(StepsSorter))], 2);
    };
  }
});
exports.default = steps_vue_vue_type_script_setup_true_lang_default;
