import { T as c, a as i } from "./Tabs-8498653e.mjs";
import { w as u } from "./WithPropsGuard-9dd19ecc.mjs";
import { c as o } from "./reactSlick-cb4a2d39.mjs";
import e from "react";
import { T as r } from "./index-162fd1aa.mjs";
const d = (n) => {
  const { requirements: s } = n;
  return /* @__PURE__ */ e.createElement("div", { className: "requirementItemList" }, s.map((t, l) => /* @__PURE__ */ e.createElement("div", { key: `${l} ${t.label}` }, /* @__PURE__ */ e.createElement("div", { className: "itemLabel" }, t.label), /* @__PURE__ */ e.createElement("ul", null, /* @__PURE__ */ e.createElement(
    a,
    {
      title: /* @__PURE__ */ e.createElement(r, { i18nKey: "PlatformRequirements.requirements.osVersion" }, "OS Version"),
      value: t.osVersion
    }
  ), /* @__PURE__ */ e.createElement(
    a,
    {
      title: /* @__PURE__ */ e.createElement(r, { i18nKey: "PlatformRequirements.requirements.processor" }, "Processor"),
      value: t.processor
    }
  ), /* @__PURE__ */ e.createElement(a, { title: /* @__PURE__ */ e.createElement(r, { i18nKey: "PlatformRequirements.requirements.ram" }, "RAM"), value: t.ram }), /* @__PURE__ */ e.createElement(
    a,
    {
      title: /* @__PURE__ */ e.createElement(r, { i18nKey: "PlatformRequirements.requirements.graphics" }, "Graphics Card"),
      value: t.graphics
    }
  ), /* @__PURE__ */ e.createElement(
    a,
    {
      title: /* @__PURE__ */ e.createElement(r, { i18nKey: "PlatformRequirements.requirements.directXVersion" }, "Direct X Version"),
      value: t.directXVersion
    }
  ), /* @__PURE__ */ e.createElement(
    a,
    {
      title: /* @__PURE__ */ e.createElement(r, { i18nKey: "PlatformRequirements.requirements.diskSpace" }, "Disk Space"),
      value: t.diskSpace
    }
  ), /* @__PURE__ */ e.createElement(
    a,
    {
      title: /* @__PURE__ */ e.createElement(r, { i18nKey: "PlatformRequirements.requirements.soundCard" }, "Sound Card"),
      value: t.soundCard
    }
  ), t.additionals && /* @__PURE__ */ e.createElement(
    a,
    {
      title: /* @__PURE__ */ e.createElement(r, { i18nKey: "PlatformRequirements.requirements.additionals" }, "Additional Requirements"),
      value: t.additionals
    }
  )))));
}, a = (n) => {
  const { title: s, value: t } = n;
  return /* @__PURE__ */ e.createElement("li", { className: "requirementItem" }, /* @__PURE__ */ e.createElement("span", { className: "itemTitle" }, s), /* @__PURE__ */ e.createElement("span", { className: "itemContent" }, t || "-"));
}, y = u(
  class extends e.Component {
    constructor() {
      super(...arguments), this.state = {
        selectedRequirementKey: null
      };
    }
    componentDidMount() {
      const {
        additionalAppInfo: { platformRequirements: s }
      } = this.props;
      this.setState({
        selectedRequirementKey: Object.keys(s || {})[0] || null
      });
    }
    render() {
      const {
        additionalAppInfo: { platformRequirements: s }
      } = this.props;
      if (!s)
        return null;
      const t = Object.keys(s);
      if (!this.state.selectedRequirementKey)
        return null;
      const l = s[this.state.selectedRequirementKey];
      if (l)
        return /* @__PURE__ */ e.createElement("div", { className: o("gamePlatformRequirements", this.props.className) }, /* @__PURE__ */ e.createElement("h3", { className: "requirementTitle" }, /* @__PURE__ */ e.createElement(r, { i18nKey: "PlatformRequirements.systemRequirement" }, "System Requirements")), /* @__PURE__ */ e.createElement(c, null, t.map((m) => /* @__PURE__ */ e.createElement(
          "span",
          {
            className: o(i.tab, m === this.state.selectedRequirementKey && i.active),
            onClick: () => this.setState({
              selectedPlatformKey: m
            }),
            key: m
          },
          m
        ))), /* @__PURE__ */ e.createElement(d, { requirements: l }));
    }
  },
  (n, s) => n.additionalAppInfo !== s.additionalAppInfo
);
export {
  y as P
};
