import { UIEvent as i } from "./accelbyte-widgets138.mjs";
import { Ctx as n } from "./accelbyte-widgets33.mjs";
import l from "./accelbyte-widgets140.mjs";
import r from "./accelbyte-widgets157.mjs";
import { IamHelper as s } from "@accelbyte/sdk-iam";
import t from "react";
import { Trans as m } from "react-i18next";
import a from "./accelbyte-widgets158.mjs";
import { LogoutConfirmationModal as g } from "./accelbyte-widgets159.mjs";
import { NewAccountVerificationForm as c } from "./accelbyte-widgets160.mjs";
import { UpdatingEmailVerification as p } from "./accelbyte-widgets161.mjs";
const u = () => /* @__PURE__ */ t.createElement("div", { className: "logoContainer" }, /* @__PURE__ */ t.createElement("div", { className: "logo" }, /* @__PURE__ */ t.createElement("img", { src: r, alt: "logo", loading: "lazy" })));
class S extends t.Component {
  constructor(o) {
    super(o), this.setIsLogoutAvailable = (e) => {
      this.setState({ isLogoutAvailable: e });
    }, this.toggleLogoutConfirmationModal = () => {
      this.setState((e) => ({ isLogoutConfirmationModalOpen: !e.isLogoutConfirmationModalOpen }));
    }, this.logout = () => {
      this.appState.logout();
    }, this.appState = n.getAppState(), this.state = {
      isLogoutAvailable: !0,
      isLogoutConfirmationModalOpen: !1,
      isUpdatingEmail: s.currentUserIsUpdatingEmail(this.appState.getUser())
    };
  }
  componentDidMount() {
    i.updateBackground(`url(${l})`);
  }
  componentWillUnmount() {
    i.updateBackground(null);
  }
  render() {
    const { isLogoutAvailable: o, isLogoutConfirmationModalOpen: e } = this.state;
    return /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", { className: a.emailVerificationPage }, /* @__PURE__ */ t.createElement("div", { className: a.emailVerificationPageContainer }, /* @__PURE__ */ t.createElement(u, null), /* @__PURE__ */ t.createElement("div", { className: a.emailVerificationPageForm }, this.state.isUpdatingEmail && /* @__PURE__ */ t.createElement(p, { setIsLogoutAvailable: this.setIsLogoutAvailable }), !this.state.isUpdatingEmail && /* @__PURE__ */ t.createElement(c, null)), this.state.isUpdatingEmail && o && /* @__PURE__ */ t.createElement("span", { onClick: this.toggleLogoutConfirmationModal }, /* @__PURE__ */ t.createElement(m, { i18nKey: "UserSessionItem.logout" }, "Logout")))), /* @__PURE__ */ t.createElement(
      g,
      {
        isOpen: e,
        onLogout: this.logout,
        onClose: this.toggleLogoutConfirmationModal
      }
    ));
  }
}
export {
  u as HeaderLogoContainer,
  S as default
};
