import u from "./accelbyte-widgets334.mjs";
import { ArrowIcon as p, ArrowIconStyles as f } from "./accelbyte-widgets125.mjs";
import { t as i } from "./accelbyte-widgets58.mjs";
import c from "classnames";
import e from "react";
import { NavLink as N } from "react-router-dom";
class y extends e.Component {
  constructor(n) {
    super(n), this.getCurrentLocationLabel = () => {
      const a = this.props.accountPageNav.find((r) => r.type === "link" && this.props.location.pathname.startsWith(r.to));
      return a ? i(a.label) : null;
    }, this.state = {
      menuOpen: !1
    };
  }
  render() {
    const { isLoading: n, listHiddenMenu: a, accountPageNav: r } = this.props;
    return /* @__PURE__ */ e.createElement("div", { className: "accountNavMobile" }, !n && /* @__PURE__ */ e.createElement("div", { className: "menuToggleContainer" }, /* @__PURE__ */ e.createElement("button", { className: "menuToggle btn", onClick: () => this.setState((t) => ({ menuOpen: !t.menuOpen })) }, /* @__PURE__ */ e.createElement("span", null, this.getCurrentLocationLabel()), /* @__PURE__ */ e.createElement(p, { className: c("activeArrow", f.down) }))), this.state.menuOpen && !n && /* @__PURE__ */ e.createElement("div", { className: "menuContainer" }, /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("nav", { className: "navigationMobile" }, r.map((t, o) => {
      if (t.type === "separator")
        return t.component ? /* @__PURE__ */ e.createElement(t.component, { key: o }) : /* @__PURE__ */ e.createElement("div", { key: `separator-${o}`, className: c(u.separator) });
      const { to: s, label: m, isVisible: l } = t;
      return a.has(s) || l && !l() ? null : /* @__PURE__ */ e.createElement(N, { key: `${o}-${s}`, to: s, onClick: () => this.setState({ menuOpen: !1 }) }, /* @__PURE__ */ e.createElement("span", null, i(m)));
    })))));
  }
}
export {
  y as AccountPageMobileNavigation
};
