import { UIEvent as c } from "./accelbyte-widgets138.mjs";
import { Ctx as n } from "./accelbyte-widgets33.mjs";
import { GlobalPath as l } from "./accelbyte-widgets104.mjs";
import { AccountDeletionSuccessPageLock as r } from "./accelbyte-widgets152.mjs";
import m from "./accelbyte-widgets140.mjs";
import e from "react";
import { Trans as a } from "react-i18next";
import { Redirect as p } from "react-router-dom";
import { Loading as u } from "./accelbyte-widgets136.mjs";
import { Button as d } from "./accelbyte-widgets107.mjs";
import "./accelbyte-widgets153.mjs";
class M extends e.Component {
  constructor(t) {
    super(t), this.appState = n.getAppState();
  }
  async componentDidMount() {
    c.updateBackground(`url(${m})`);
    const { fetchCurrentUserGdprDeletionStatus: t } = this.appState;
    this.appState.gdprAppManager.subscribe(() => this.setState({})), t();
  }
  componentWillUnmount() {
    this.appState.gdprAppManager.unsubscribe(() => this.setState({})), c.updateBackground(null);
  }
  render() {
    if (!r.peek())
      return /* @__PURE__ */ e.createElement(p, { to: l.Home.link });
    async function t() {
      n.getGdprManager().ignoreDeletionMark(), await n.getAppState().logout(), r.unlock();
    }
    const { gdprDeletionStatus: o, isFetchingDeletion: i } = this.appState.getGdprManager().state;
    if (i)
      return /* @__PURE__ */ e.createElement(u, null);
    const s = (o == null ? void 0 : o.DeletionDate) || "";
    return /* @__PURE__ */ e.createElement("div", { className: "deletionSuccessContainer" }, /* @__PURE__ */ e.createElement("main", null, /* @__PURE__ */ e.createElement("p", { className: "title" }, /* @__PURE__ */ e.createElement(a, { i18nKey: "RequestAccountDeletionSuccessPage.title" }, "Account Deletion")), /* @__PURE__ */ e.createElement("div", { className: "content" }, /* @__PURE__ */ e.createElement(a, { i18nKey: "RequestAccountDeletionSuccessPage.content" }, /* @__PURE__ */ e.createElement("p", { className: "top" }, "Your account is set to be deleted on ", { deletionDate: s }, ". This will result in permanent deletion of all information associated with your account."), /* @__PURE__ */ e.createElement("p", { className: "bottom" }, "If you wish to keep your account, please log in before the deletion date to cancel the deletion process."))), /* @__PURE__ */ e.createElement(d, { onClick: t, className: "btn big btn-primary btnGoToHome" }, /* @__PURE__ */ e.createElement(a, { i18nKey: "RequestAccountDeletionSuccessPage.button.goToHomepage" }, "Go To Homepage"))));
  }
}
export {
  M as default
};
