import { jsx as a, jsxs as E } from "react/jsx-runtime";
import { a as F } from "./index.CfQlFjZU.js";
import { O as N } from "./Onboarding.BDRBUM0D.js";
import { u as b } from "./useInputValidation.BmDVJuIZ.js";
import { P as x } from "./PageHeader.BwFpx_pz.js";
import { B as I, a as B } from "./Button.CpTwUWVr.js";
import { F as j } from "./form.BJJLcx4p.js";
import { a as g } from "./TextInput.63vMRxAK.js";
import { p as D } from "./onboarding.ByhrQ6ig.js";
const T = "creator_contentContainerStretch_O0Ns1", z = "creator_mainContentContainer_gQ-xX", H = "creator_formContainer_1M8QW", M = "creator_sectionFormContainer_-NuYR", Q = "creator_body_EjRor", R = { contentContainerStretch: T, mainContentContainer: z, formContainer: H, sectionFormContainer: M, body: Q }, C = () => {
};
function V({
  onSubmit: m,
  loading: o,
  disabled: n,
  title: u = "Sign up with email",
  shouldRemoveForm: c,
  autoCompleteAutoCorrectOff: e,
  email: r = "",
  fullname: p = "",
  password: d = "",
  previousPageUrl: f,
  emailProcessor: v = C,
  fullnameProcessor: P = C,
  passwordProcessor: h = C,
  ...w
}) {
  const t = !!n || !!o, s = b(P, {
    value: p,
    helper: "Your real name",
    withIcon: !0
  }), i = b(v, {
    value: r,
    withIcon: !0,
    readOnly: !!r
  }), l = b(h, {
    value: d,
    helper: D,
    withIcon: !0
  }), S = n || !!(!s.value || s.isError) || !i.value || !!i.isError || !l.value || !!l.isError;
  function _(y) {
    y.preventDefault(), m?.({
      fullname: s.value,
      email: i.value,
      password: l.value
    });
  }
  return {
    ...w,
    disabled: S,
    disabledInputs: t,
    fullnameProps: s,
    emailProps: i,
    passwordProps: l,
    loading: o,
    previousPageUrl: f,
    title: u,
    isNativeForm: !c,
    autoCompleteAutoCorrectOff: !!e,
    autoComplete: e ? "off" : void 0,
    autoCorrect: e ? "off" : void 0,
    spellCheck: e ? !1 : void 0,
    autoCapitalize: e ? "none" : void 0,
    onSubmit: _,
    formContainerClassName: R.sectionFormContainer
  };
}
function Y({
  disabled: m,
  disabledInputs: o,
  fullnameProps: n,
  emailProps: u,
  passwordProps: c,
  loading: e,
  title: r,
  isNativeForm: p,
  previousPageUrl: d,
  autoComplete: f,
  autoCorrect: v,
  spellCheck: P,
  autoCapitalize: h,
  onSubmit: w,
  formContainerClassName: t
}) {
  return /* @__PURE__ */ a(N, { children: /* @__PURE__ */ E(
    j,
    {
      isNative: p,
      formProps: { className: t, onSubmit: w },
      divProps: { className: t },
      children: [
        /* @__PURE__ */ a(
          x,
          {
            title: r,
            previousPageUrl: d,
            height: "auto"
          }
        ),
        /* @__PURE__ */ a(
          g,
          {
            label: "Full name",
            name: "fullname",
            isDisabled: o,
            autoComplete: f,
            autoCorrect: v,
            spellCheck: P,
            autoCapitalize: h,
            ...n
          }
        ),
        /* @__PURE__ */ a(
          g,
          {
            label: "Email",
            name: "email",
            type: "email",
            isDisabled: o,
            ...u
          }
        ),
        /* @__PURE__ */ a(
          g,
          {
            label: "Password",
            name: "password",
            type: "password",
            isDisabled: o,
            ...c
          }
        ),
        /* @__PURE__ */ a(
          I,
          {
            label: "Create Account",
            size: "full",
            name: "intent",
            value: "signup",
            type: B.SUBMIT,
            loading: e,
            disabled: m
          }
        )
      ]
    }
  ) });
}
const L = F(Y, V);
export {
  Y as S,
  L as a,
  V as u
};
