import { Alert as i } from "./accelbyte-widgets123.mjs";
import { CommonError as m } from "./accelbyte-widgets124.mjs";
import { Loading as s } from "./accelbyte-widgets136.mjs";
import { Ctx as l } from "./accelbyte-widgets33.mjs";
import { AlertType as p } from "./accelbyte-widgets128.mjs";
import e from "react";
import { Trans as c } from "react-i18next";
import { AccountMainSection as d, AccountMainSectionHeader as g, AccountMainSectionBody as u } from "./accelbyte-widgets122.mjs";
import { PrivacyRecords as f } from "./accelbyte-widgets296.mjs";
import n from "./accelbyte-widgets297.mjs";
import { mockPrivacyPolicies as y } from "./accelbyte-widgets209.mjs";
class T extends e.Component {
  constructor(t) {
    super(t), this.logic = l.getAppState().legalAppManager, this.logic.subscribe(() => this.setState({}));
  }
  componentDidMount() {
    this.props.isPreviewMode || this.logic.fetchAcceptedAgreement();
  }
  render() {
    const { isLoading: t, acceptedAgreements: a, error: o } = this.logic.state, r = this.props.isPreviewMode ? y : a;
    return /* @__PURE__ */ e.createElement(d, { className: n.accountPrivacyRecordsPage }, /* @__PURE__ */ e.createElement(g, null, /* @__PURE__ */ e.createElement(c, { i18nKey: "PrivacyRecordsPage.title" }, "Legal Agreements")), /* @__PURE__ */ e.createElement(u, { className: n.mainBody }, !t && o && /* @__PURE__ */ e.createElement(i, { type: p.danger }, /* @__PURE__ */ e.createElement(m, { error: o })), t && /* @__PURE__ */ e.createElement(s, null), !t && Array.isArray(r) && /* @__PURE__ */ e.createElement(e.Fragment, null, r.length > 0 ? /* @__PURE__ */ e.createElement(f, { agreements: r }) : /* @__PURE__ */ e.createElement("p", null, /* @__PURE__ */ e.createElement(c, { i18nKey: "PrivacyRecordsPage.noRecord" }, "There is no record to show")))));
  }
}
export {
  T as default
};
