import { M as o, a as p, N as g, U as n, Q as h, L as d, R as L, T as u, i as U } from "./index-162fd1aa.mjs";
import e from "react";
import { s as S } from "./URLGenerator.module-fa874451.mjs";
import "./dateFns-2367ee5b.mjs";
import "./validator-61879ab7.mjs";
import "./reactPlayer-2f69f369.mjs";
import "react-router-dom";
import "./reactSlick-cb4a2d39.mjs";
class M extends e.Component {
  constructor(t) {
    super(t), this.randString = o(), this.state = { error: null }, this.randString = o(), this.appState = p.getAppState();
  }
  componentDidMount() {
    this.tryLogin();
  }
  tryLogin() {
    const t = this.appState, { appHistory: a } = t.state, s = !!t.getUser(), i = t.getSdk();
    if (s)
      return a.replace(g.Home.link);
    const r = n.silentSearchParamsBuilder(a.location.search), c = r.get(h.LoginURLGeneratorParamKeys.RETURN_PATH_PARAMS_KEY);
    a.replace(`${n.makeAbsolutePath(a.location.pathname)}?${r.toString()}`);
    const { createLoginURL: l } = i.IAM.UserAuthorization(), m = l(c);
    window.location.replace(m);
  }
  render() {
    const { error: t } = this.state;
    return /* @__PURE__ */ e.createElement("div", { className: S.loginURLGenerator }, !t && /* @__PURE__ */ e.createElement(d, { className: L.tall }, /* @__PURE__ */ e.createElement(u, { i18nKey: "InitialUserFetchPage.notice" })), t && /* @__PURE__ */ e.createElement(U, { error: t }));
  }
}
export {
  M as default
};
