import i from "classnames";
import a, { Component as h } from "react";
import { Trans as m } from "react-i18next";
import { A as l, a as p } from "./ArrowIcon-7c2378f0.mjs";
import { L as f, m as P } from "./index-0462597a.mjs";
import { generatePath as k } from "react-router";
const u = "pagination _pagination_c1488", E = {
  pagination: u
}, d = ({ link: e, children: t, className: n }) => /* @__PURE__ */ a.createElement(f, { className: i(n, "paginationLink"), to: e }, t), S = ({
  callBack: e,
  children: t,
  className: n
}) => /* @__PURE__ */ a.createElement(
  "a",
  {
    href: "#",
    className: i(n, "paginationLink", "link", e ? "" : "disabled"),
    onClick: (r) => {
      r.preventDefault(), e && e();
    }
  },
  t
), g = ({
  linkOrCallback: e,
  children: t,
  className: n
}) => e === !1 ? null : /* @__PURE__ */ a.createElement(a.Fragment, null, typeof e == "string" && /* @__PURE__ */ a.createElement(d, { link: e, className: n }, t), typeof e != "string" && /* @__PURE__ */ a.createElement(S, { callBack: e, className: n }, t));
class y extends h {
  render() {
    return /* @__PURE__ */ a.createElement("div", { className: i(E.pagination, "pagination") }, /* @__PURE__ */ a.createElement(g, { linkOrCallback: this.props.prev, className: "link-prev" }, /* @__PURE__ */ a.createElement(l, { className: i(p.left, "arrowSize") }), /* @__PURE__ */ a.createElement(m, { i18nKey: "Pagination.prev" }, "Previous")), /* @__PURE__ */ a.createElement(g, { linkOrCallback: this.props.next, className: "link-next" }, /* @__PURE__ */ a.createElement(m, { i18nKey: "Pagination.next" }, "Next"), /* @__PURE__ */ a.createElement(l, { className: i(p.right, "arrowSize") })));
  }
}
class A {
  constructor(t) {
    this.link = t;
  }
  makePath(t, n) {
    const r = k(this.link, t), s = new URLSearchParams();
    for (const o in n)
      Object.prototype.hasOwnProperty.call(n, o) && s.append(o, String(n[o]));
    const c = s.toString();
    return `${r}${c ? `?${c}` : ""}`;
  }
  withSearchParams(t) {
    return this.makePath(void 0, t);
  }
  is(t, n = {}) {
    const { exact: r = !0, strict: s = !1 } = n;
    return P(t, {
      path: this.link,
      exact: r,
      strict: s
    });
  }
}
export {
  y as P,
  A as a
};
