import { jsx as t } from "react/jsx-runtime";
import { useCallback as s } from "react";
import { welcomeOptions as p } from "../schemas.js";
import l from "../../../hooks/useStepperState.js";
import c from "../../../hooks/useStepperHandlers.js";
import u from "../../../../form/hooks/useZodForm.js";
import d from "../../../hooks/useStepperBeforeNavigate.js";
import f from "../../../../form/Form.js";
import h from "../../../../field/Field.js";
import S from "../../../../field/components/field-control/FieldControl.js";
import g from "../../../../radio/Radio.js";
const y = ({ id: V }) => {
  const { currentStep: r } = l(), { setStepData: a } = c(), { schema: i, defaultValues: m } = r.initialData, e = u({ schema: i, defaultValues: r.storedData ?? m });
  d(async (o) => {
    if (o.type === "next" && !await e.trigger()) return !1;
    a("welcome", e.getValues());
  });
  const n = s(
    (o) => {
      e.setValue("instanceType", String(o), { shouldValidate: !0 });
    },
    [e]
  );
  return /* @__PURE__ */ t(f, { form: e, onSubmit: () => {
  }, noValidate: !0, children: /* @__PURE__ */ t(h, { name: "instanceType", children: /* @__PURE__ */ t(S, { children: /* @__PURE__ */ t(g, { options: p, value: e.watch("instanceType"), onChange: n, hasBorder: !0 }) }) }) });
};
y.displayName = "WelcomeStep";
export {
  y as default
};
//# sourceMappingURL=WelcomeStep.js.map
