"use client";
import { j as t } from "../../../node_modules/.pnpm/react@19.1.0/node_modules/react/jsx-runtime.mjs";
import c from "../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.mjs";
import "react";
import { ReactComponent as f } from "../../assets/images/AlertBell.svg.mjs";
import h from "../Alert/index.mjs";
import i from "../Button/index.mjs";
import x from "../Loading/index.mjs";
import "../Modal/ModalAnimation/index.module.scss.mjs";
import a from "../Modal/Modal/index.mjs";
import "../Modal/ModalSuccess/index.module.scss.mjs";
import j from "../TextInput/index.mjs";
import l from "./UpdatesSubscriptionModal.module.scss.mjs";
const y = {
  title: "Get notified on our latest updates",
  body: "Get notified about our upcoming events, Quests, features and more!",
  inputLabel: "Email",
  inputPlaceholder: "Enter your email",
  submitButtonLabel: "Let’s do it!",
  cancelButtonLabel: "No, another time",
  invalidEmailError: "Invalid Email"
};
function w({
  loading: o,
  error: s,
  className: d,
  onClose: n,
  onSubmit: u,
  i18n: e = y,
  ...r
}) {
  const p = (m) => {
    m.preventDefault();
    const b = m.currentTarget.elements;
    u(b.email.value);
  };
  return /* @__PURE__ */ t.jsxs(a.Root, { ...r, className: c(d, l.root), children: [
    /* @__PURE__ */ t.jsx(a.CloseButton, { "aria-label": "close signup modal", onClick: n }),
    /* @__PURE__ */ t.jsx(a.HeadingIcon, { className: l.iconContainer, children: /* @__PURE__ */ t.jsx(f, { className: l.icon, width: 20, height: 20 }) }),
    /* @__PURE__ */ t.jsxs(a.Header, { children: [
      /* @__PURE__ */ t.jsx(a.Title, { className: "title", children: e == null ? void 0 : e.title }),
      /* @__PURE__ */ t.jsx(a.Body, { className: "body-sm", children: e == null ? void 0 : e.body })
    ] }),
    /* @__PURE__ */ t.jsxs("form", { className: l.form, onSubmit: p, children: [
      s && /* @__PURE__ */ t.jsx(h, { variant: "warning", message: s }),
      /* @__PURE__ */ t.jsx(
        j,
        {
          required: !0,
          disabled: o,
          label: e == null ? void 0 : e.inputLabel,
          placeholder: e == null ? void 0 : e.inputPlaceholder,
          name: "email",
          type: "email"
        }
      ),
      /* @__PURE__ */ t.jsxs("div", { className: l.formActions, children: [
        /* @__PURE__ */ t.jsx(
          i,
          {
            disabled: o,
            "aria-label": o ? "loading" : void 0,
            type: o ? "secondary" : "primary",
            htmlType: "submit",
            className: c(o && l.loadingButton),
            children: o ? /* @__PURE__ */ t.jsx(x, {}) : e == null ? void 0 : e.submitButtonLabel
          }
        ),
        /* @__PURE__ */ t.jsx(i, { type: "secondary", htmlType: "button", onClick: r.onCancel, children: e == null ? void 0 : e.cancelButtonLabel })
      ] })
    ] })
  ] });
}
export {
  w as default,
  y as defaultI18n
};
//# sourceMappingURL=index.mjs.map
