import te, { jsx as a, jsxs as k, Fragment as at } from "react/jsx-runtime";
import { L as re, P as l, _ as x, Z as Wt, $ as Gt, a0 as qt, a1 as Zt, w as N, T as qe, Y as Xt, a2 as Jt, l as Kt, a3 as Qt, q as ye, p as ve, r as R, v as Z, j as er, y as X, a as tr, a4 as rr, z as J, E as Ye, b as z, F as ze, J as or, a5 as nr, a6 as sr, M as q, U as ir, a7 as ar, x as Te, e as oe, K as H, a8 as lr, S as Ne, a9 as ne, aa as se, N as pe } from "./Stack-ThmeJzqr.js";
import { r as ie, e as lt, P as ct, i as cr, C as dr } from "./Drawer-d8461jqd.js";
import { D as ii, L as ai } from "./Drawer-d8461jqd.js";
import { A as ur, l as Ze, L as hr, g as fr, S as pr, a as mr, t as Xe, T as gr, b as br, c as yr, d as vr, e as Tr, B as ee, f as xr, G as Cr, i as Mr, h as Or, F as Sr, j as Dr, k as dt, M as A, m as Ie, n as ut, C as K, o as P, w as Pr, p as je, q as Lr, r as kr, s as wr, u as Er, v as $r, x as xe, y as _r, z as Yr, D as zr, I as ht, E as Nr, H as ft, J as pt, K as Ir, N as jr, O as Ar, P as mt, Q as Rr, R as Br, U as Fr, V as Vr, W as Ur, X as Hr, Y as Wr, Z as Gr, _ as qr, $ as Zr, a0 as Xr, a1 as Jr, a2 as Kr, a3 as Qr, a4 as gt, a5 as bt, a6 as yt, a7 as eo } from "./theme-DQCPHf7F.js";
import { ab as ci, ah as di, a8 as ui, ad as hi, ae as fi, af as pi, ag as mi, a9 as gi, ac as bi, ai as yi, ak as vi, aa as Ti, aj as xi } from "./theme-DQCPHf7F.js";
import * as L from "react";
import { useState as F, useCallback as me, useLayoutEffect as vt, useEffect as Ce, useMemo as Tt, useRef as to } from "react";
import { b as de } from "./useFormControl-Cj8rSR6R.js";
import ro, { createPortal as oo } from "react-dom";
import { GridToolbarContainer as no, GridToolbarColumnsButton as so, GridToolbarFilterButton as io, GridToolbarDensitySelector as ao, DataGridPro as xt, useGridApiRef as lo, getGridBooleanOperators as co, getGridNumericOperators as uo, getGridStringOperators as ho } from "@mui/x-data-grid-pro";
export * from "@mui/x-data-grid-pro";
import { Link as fo } from "react-router-dom";
import { C as po, a as mo } from "./Tree-D_Zjc1fk.js";
import { T as Oi } from "./Tree-D_Zjc1fk.js";
var Ae = {}, go = re;
Object.defineProperty(Ae, "__esModule", {
  value: !0
});
var Ct = Ae.default = void 0, bo = go(ie()), yo = te;
Ct = Ae.default = (0, bo.default)(/* @__PURE__ */ (0, yo.jsx)("path", {
  d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
}), "ExpandMore");
const Re = /* @__PURE__ */ L.createContext(null);
process.env.NODE_ENV !== "production" && (Re.displayName = "ThemeContext");
function Mt() {
  const e = L.useContext(Re);
  return process.env.NODE_ENV !== "production" && L.useDebugValue(e), e;
}
const vo = typeof Symbol == "function" && Symbol.for, To = vo ? Symbol.for("mui.nested") : "__THEME_NESTED__";
function xo(e, r) {
  if (typeof r == "function") {
    const n = r(e);
    return process.env.NODE_ENV !== "production" && (n || console.error(["MUI: You should return an object from your theme function, i.e.", "<ThemeProvider theme={() => ({})} />"].join(`
`))), n;
  }
  return x({}, e, r);
}
function ge(e) {
  const {
    children: r,
    theme: n
  } = e, t = Mt();
  process.env.NODE_ENV !== "production" && t === null && typeof n == "function" && console.error(["MUI: You are providing a theme function prop to the ThemeProvider component:", "<ThemeProvider theme={outerTheme => outerTheme} />", "", "However, no outer theme is present.", "Make sure a theme is already injected higher in the React tree or provide a theme object."].join(`
`));
  const o = L.useMemo(() => {
    const s = t === null ? n : xo(t, n);
    return s != null && (s[To] = t !== null), s;
  }, [n, t]);
  return /* @__PURE__ */ a(Re.Provider, {
    value: o,
    children: r
  });
}
process.env.NODE_ENV !== "production" && (ge.propTypes = {
  /**
   * Your component tree.
   */
  children: l.node,
  /**
   * A theme object. You can provide a function to extend the outer theme.
   */
  theme: l.oneOfType([l.object, l.func]).isRequired
});
process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "production" && (ge.propTypes = lt(ge.propTypes));
const Je = {};
function Ke(e, r, n, t = !1) {
  return L.useMemo(() => {
    const o = e && r[e] || r;
    if (typeof n == "function") {
      const s = n(o), i = e ? x({}, r, {
        [e]: s
      }) : s;
      return t ? () => i : i;
    }
    return e ? x({}, r, {
      [e]: n
    }) : x({}, r, n);
  }, [e, r, n, t]);
}
function be(e) {
  const {
    children: r,
    theme: n,
    themeId: t
  } = e, o = Wt(Je), s = Mt() || Je;
  process.env.NODE_ENV !== "production" && (o === null && typeof n == "function" || t && o && !o[t] && typeof n == "function") && console.error(["MUI: You are providing a theme function prop to the ThemeProvider component:", "<ThemeProvider theme={outerTheme => outerTheme} />", "", "However, no outer theme is present.", "Make sure a theme is already injected higher in the React tree or provide a theme object."].join(`
`));
  const i = Ke(t, o, n), c = Ke(t, s, n, !0), d = i.direction === "rtl";
  return /* @__PURE__ */ a(ge, {
    theme: c,
    children: /* @__PURE__ */ a(Gt.Provider, {
      value: i,
      children: /* @__PURE__ */ a(qt, {
        value: d,
        children: /* @__PURE__ */ a(Zt, {
          value: i == null ? void 0 : i.components,
          children: r
        })
      })
    })
  });
}
process.env.NODE_ENV !== "production" && (be.propTypes = {
  // ┌────────────────────────────── Warning ──────────────────────────────┐
  // │ These PropTypes are generated from the TypeScript type definitions. │
  // │    To update them, edit the d.ts file and run `pnpm proptypes`.     │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * Your component tree.
   */
  children: l.node,
  /**
   * A theme object. You can provide a function to extend the outer theme.
   */
  theme: l.oneOfType([l.func, l.object]).isRequired,
  /**
   * The design system's unique id for getting the corresponded theme when there are multiple design systems.
   */
  themeId: l.string
});
process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "production" && (be.propTypes = lt(be.propTypes));
const Co = ["theme"];
function Mo(e) {
  let {
    theme: r
  } = e, n = N(e, Co);
  const t = r[qe];
  return /* @__PURE__ */ a(be, x({}, n, {
    themeId: t ? qe : void 0,
    theme: t || r
  }));
}
process.env.NODE_ENV !== "production" && (Mo.propTypes = {
  /**
   * Your component tree.
   */
  children: l.node,
  /**
   * A theme object. You can provide a function to extend the outer theme.
   */
  theme: l.oneOfType([l.object, l.func]).isRequired
});
const Oo = ["className", "elementType", "ownerState", "externalForwardedProps", "getSlotOwnerState", "internalForwardedProps"], So = ["component", "slots", "slotProps"], Do = ["component"];
function Po(e, r) {
  const {
    className: n,
    elementType: t,
    ownerState: o,
    externalForwardedProps: s,
    getSlotOwnerState: i,
    internalForwardedProps: c
  } = r, d = N(r, Oo), {
    component: u,
    slots: f = {
      [e]: void 0
    },
    slotProps: m = {
      [e]: void 0
    }
  } = s;
  N(s, So);
  const b = f[e] || t, v = Xt(m[e], o), T = Jt(x({
    className: n
  }, d, {
    externalForwardedProps: void 0,
    externalSlotProps: v
  })), {
    props: {
      component: h
    },
    internalRef: p
  } = T, g = N(T.props, Do), y = Kt(p, v == null ? void 0 : v.ref, r.ref), M = i ? i(g) : {}, S = x({}, o, M), O = h, D = Qt(b, x({}, e === "root", !f[e] && c, g, O && {
    as: O
  }, {
    ref: y
  }), S);
  return Object.keys(M).forEach((C) => {
    delete D[C];
  }), [b, D];
}
function Lo(e) {
  return ve("MuiAccordion", e);
}
const ue = ye("MuiAccordion", ["root", "rounded", "expanded", "disabled", "gutters", "region"]), ko = ["children", "className", "defaultExpanded", "disabled", "disableGutters", "expanded", "onChange", "square", "slots", "slotProps", "TransitionComponent", "TransitionProps"], wo = (e) => {
  const {
    classes: r,
    square: n,
    expanded: t,
    disabled: o,
    disableGutters: s
  } = e;
  return J({
    root: ["root", !n && "rounded", t && "expanded", o && "disabled", !s && "gutters"],
    region: ["region"]
  }, Lo, r);
}, Eo = R(ct, {
  name: "MuiAccordion",
  slot: "Root",
  overridesResolver: (e, r) => {
    const {
      ownerState: n
    } = e;
    return [{
      [`& .${ue.region}`]: r.region
    }, r.root, !n.square && r.rounded, !n.disableGutters && r.gutters];
  }
})(({
  theme: e
}) => {
  const r = {
    duration: e.transitions.duration.shortest
  };
  return {
    position: "relative",
    transition: e.transitions.create(["margin"], r),
    overflowAnchor: "none",
    // Keep the same scrolling position
    "&::before": {
      position: "absolute",
      left: 0,
      top: -1,
      right: 0,
      height: 1,
      content: '""',
      opacity: 1,
      backgroundColor: (e.vars || e).palette.divider,
      transition: e.transitions.create(["opacity", "background-color"], r)
    },
    "&:first-of-type": {
      "&::before": {
        display: "none"
      }
    },
    [`&.${ue.expanded}`]: {
      "&::before": {
        opacity: 0
      },
      "&:first-of-type": {
        marginTop: 0
      },
      "&:last-of-type": {
        marginBottom: 0
      },
      "& + &": {
        "&::before": {
          display: "none"
        }
      }
    },
    [`&.${ue.disabled}`]: {
      backgroundColor: (e.vars || e).palette.action.disabledBackground
    }
  };
}, ({
  theme: e
}) => ({
  variants: [{
    props: (r) => !r.square,
    style: {
      borderRadius: 0,
      "&:first-of-type": {
        borderTopLeftRadius: (e.vars || e).shape.borderRadius,
        borderTopRightRadius: (e.vars || e).shape.borderRadius
      },
      "&:last-of-type": {
        borderBottomLeftRadius: (e.vars || e).shape.borderRadius,
        borderBottomRightRadius: (e.vars || e).shape.borderRadius,
        // Fix a rendering issue on Edge
        "@supports (-ms-ime-align: auto)": {
          borderBottomLeftRadius: 0,
          borderBottomRightRadius: 0
        }
      }
    }
  }, {
    props: (r) => !r.disableGutters,
    style: {
      [`&.${ue.expanded}`]: {
        margin: "16px 0"
      }
    }
  }]
})), Ot = /* @__PURE__ */ L.forwardRef(function(r, n) {
  const t = Z({
    props: r,
    name: "MuiAccordion"
  }), {
    children: o,
    className: s,
    defaultExpanded: i = !1,
    disabled: c = !1,
    disableGutters: d = !1,
    expanded: u,
    onChange: f,
    square: m = !1,
    slots: b = {},
    slotProps: v = {},
    TransitionComponent: T,
    TransitionProps: h
  } = t, p = N(t, ko), [g, y] = er({
    controlled: u,
    default: i,
    name: "Accordion",
    state: "expanded"
  }), M = L.useCallback((j) => {
    y(!g), f && f(j, !g);
  }, [g, f, y]), [S, ...O] = L.Children.toArray(o), D = L.useMemo(() => ({
    expanded: g,
    disabled: c,
    disableGutters: d,
    toggle: M
  }), [g, c, d, M]), C = x({}, t, {
    square: m,
    disabled: c,
    disableGutters: d,
    expanded: g
  }), w = wo(C), E = x({
    transition: T
  }, b), I = x({
    transition: h
  }, v), [_, $] = Po("transition", {
    elementType: po,
    externalForwardedProps: {
      slots: E,
      slotProps: I
    },
    ownerState: C
  });
  return /* @__PURE__ */ k(Eo, x({
    className: X(w.root, s),
    ref: n,
    ownerState: C,
    square: m
  }, p, {
    children: [/* @__PURE__ */ a(ur.Provider, {
      value: D,
      children: S
    }), /* @__PURE__ */ a(_, x({
      in: g,
      timeout: "auto"
    }, $, {
      children: /* @__PURE__ */ a("div", {
        "aria-labelledby": S.props.id,
        id: S.props["aria-controls"],
        role: "region",
        className: w.region,
        children: O
      })
    }))]
  }));
});
process.env.NODE_ENV !== "production" && (Ot.propTypes = {
  // ┌────────────────────────────── Warning ──────────────────────────────┐
  // │ These PropTypes are generated from the TypeScript type definitions. │
  // │    To update them, edit the d.ts file and run `pnpm proptypes`.     │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * The content of the component.
   */
  children: tr(l.node.isRequired, (e) => {
    const r = L.Children.toArray(e.children)[0];
    return rr.isFragment(r) ? new Error("MUI: The Accordion doesn't accept a Fragment as a child. Consider providing an array instead.") : /* @__PURE__ */ L.isValidElement(r) ? null : new Error("MUI: Expected the first child of Accordion to be a valid element.");
  }),
  /**
   * Override or extend the styles applied to the component.
   */
  classes: l.object,
  /**
   * @ignore
   */
  className: l.string,
  /**
   * If `true`, expands the accordion by default.
   * @default false
   */
  defaultExpanded: l.bool,
  /**
   * If `true`, the component is disabled.
   * @default false
   */
  disabled: l.bool,
  /**
   * If `true`, it removes the margin between two expanded accordion items and the increase of height.
   * @default false
   */
  disableGutters: l.bool,
  /**
   * If `true`, expands the accordion, otherwise collapse it.
   * Setting this prop enables control over the accordion.
   */
  expanded: l.bool,
  /**
   * Callback fired when the expand/collapse state is changed.
   *
   * @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.
   * @param {boolean} expanded The `expanded` state of the accordion.
   */
  onChange: l.func,
  /**
   * The props used for each slot inside.
   * @default {}
   */
  slotProps: l.shape({
    transition: l.oneOfType([l.func, l.object])
  }),
  /**
   * The components used for each slot inside.
   * @default {}
   */
  slots: l.shape({
    transition: l.elementType
  }),
  /**
   * If `true`, rounded corners are disabled.
   * @default false
   */
  square: l.bool,
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: l.oneOfType([l.arrayOf(l.oneOfType([l.func, l.object, l.bool])), l.func, l.object]),
  /**
   * The component used for the transition.
   * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
   * @deprecated Use `slots.transition` instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
   */
  TransitionComponent: l.elementType,
  /**
   * Props applied to the transition element.
   * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
   * @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
   */
  TransitionProps: l.object
});
const xs = Ot;
function $o(e) {
  return ve("MuiAccordionDetails", e);
}
ye("MuiAccordionDetails", ["root"]);
const _o = ["className"], Yo = (e) => {
  const {
    classes: r
  } = e;
  return J({
    root: ["root"]
  }, $o, r);
}, zo = R("div", {
  name: "MuiAccordionDetails",
  slot: "Root",
  overridesResolver: (e, r) => r.root
})(({
  theme: e
}) => ({
  padding: e.spacing(1, 2, 2)
})), St = /* @__PURE__ */ L.forwardRef(function(r, n) {
  const t = Z({
    props: r,
    name: "MuiAccordionDetails"
  }), {
    className: o
  } = t, s = N(t, _o), i = t, c = Yo(i);
  return /* @__PURE__ */ a(zo, x({
    className: X(c.root, o),
    ref: n,
    ownerState: i
  }, s));
});
process.env.NODE_ENV !== "production" && (St.propTypes = {
  // ┌────────────────────────────── Warning ──────────────────────────────┐
  // │ These PropTypes are generated from the TypeScript type definitions. │
  // │    To update them, edit the d.ts file and run `pnpm proptypes`.     │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * The content of the component.
   */
  children: l.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: l.object,
  /**
   * @ignore
   */
  className: l.string,
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: l.oneOfType([l.arrayOf(l.oneOfType([l.func, l.object, l.bool])), l.func, l.object])
});
const Cs = St;
function No(e) {
  return ve("MuiLinearProgress", e);
}
ye("MuiLinearProgress", ["root", "colorPrimary", "colorSecondary", "determinate", "indeterminate", "buffer", "query", "dashed", "dashedColorPrimary", "dashedColorSecondary", "bar", "barColorPrimary", "barColorSecondary", "bar1Indeterminate", "bar1Determinate", "bar1Buffer", "bar2Indeterminate", "bar2Buffer"]);
const Io = ["className", "color", "value", "valueBuffer", "variant"];
let Q = (e) => e, Qe, et, tt, rt, ot, nt;
const Ee = 4, jo = Ye(Qe || (Qe = Q`
  0% {
    left: -35%;
    right: 100%;
  }

  60% {
    left: 100%;
    right: -90%;
  }

  100% {
    left: 100%;
    right: -90%;
  }
`)), Ao = Ye(et || (et = Q`
  0% {
    left: -200%;
    right: 100%;
  }

  60% {
    left: 107%;
    right: -8%;
  }

  100% {
    left: 107%;
    right: -8%;
  }
`)), Ro = Ye(tt || (tt = Q`
  0% {
    opacity: 1;
    background-position: 0 -23px;
  }

  60% {
    opacity: 0;
    background-position: 0 -23px;
  }

  100% {
    opacity: 1;
    background-position: -200px -23px;
  }
`)), Bo = (e) => {
  const {
    classes: r,
    variant: n,
    color: t
  } = e, o = {
    root: ["root", `color${z(t)}`, n],
    dashed: ["dashed", `dashedColor${z(t)}`],
    bar1: ["bar", `barColor${z(t)}`, (n === "indeterminate" || n === "query") && "bar1Indeterminate", n === "determinate" && "bar1Determinate", n === "buffer" && "bar1Buffer"],
    bar2: ["bar", n !== "buffer" && `barColor${z(t)}`, n === "buffer" && `color${z(t)}`, (n === "indeterminate" || n === "query") && "bar2Indeterminate", n === "buffer" && "bar2Buffer"]
  };
  return J(o, No, r);
}, Be = (e, r) => r === "inherit" ? "currentColor" : e.vars ? e.vars.palette.LinearProgress[`${r}Bg`] : e.palette.mode === "light" ? nr(e.palette[r].main, 0.62) : sr(e.palette[r].main, 0.5), Fo = R("span", {
  name: "MuiLinearProgress",
  slot: "Root",
  overridesResolver: (e, r) => {
    const {
      ownerState: n
    } = e;
    return [r.root, r[`color${z(n.color)}`], r[n.variant]];
  }
})(({
  ownerState: e,
  theme: r
}) => x({
  position: "relative",
  overflow: "hidden",
  display: "block",
  height: 4,
  zIndex: 0,
  // Fix Safari's bug during composition of different paint.
  "@media print": {
    colorAdjust: "exact"
  },
  backgroundColor: Be(r, e.color)
}, e.color === "inherit" && e.variant !== "buffer" && {
  backgroundColor: "none",
  "&::before": {
    content: '""',
    position: "absolute",
    left: 0,
    top: 0,
    right: 0,
    bottom: 0,
    backgroundColor: "currentColor",
    opacity: 0.3
  }
}, e.variant === "buffer" && {
  backgroundColor: "transparent"
}, e.variant === "query" && {
  transform: "rotate(180deg)"
})), Vo = R("span", {
  name: "MuiLinearProgress",
  slot: "Dashed",
  overridesResolver: (e, r) => {
    const {
      ownerState: n
    } = e;
    return [r.dashed, r[`dashedColor${z(n.color)}`]];
  }
})(({
  ownerState: e,
  theme: r
}) => {
  const n = Be(r, e.color);
  return x({
    position: "absolute",
    marginTop: 0,
    height: "100%",
    width: "100%"
  }, e.color === "inherit" && {
    opacity: 0.3
  }, {
    backgroundImage: `radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`,
    backgroundSize: "10px 10px",
    backgroundPosition: "0 -23px"
  });
}, ze(rt || (rt = Q`
    animation: ${0} 3s infinite linear;
  `), Ro)), Uo = R("span", {
  name: "MuiLinearProgress",
  slot: "Bar1",
  overridesResolver: (e, r) => {
    const {
      ownerState: n
    } = e;
    return [r.bar, r[`barColor${z(n.color)}`], (n.variant === "indeterminate" || n.variant === "query") && r.bar1Indeterminate, n.variant === "determinate" && r.bar1Determinate, n.variant === "buffer" && r.bar1Buffer];
  }
})(({
  ownerState: e,
  theme: r
}) => x({
  width: "100%",
  position: "absolute",
  left: 0,
  bottom: 0,
  top: 0,
  transition: "transform 0.2s linear",
  transformOrigin: "left",
  backgroundColor: e.color === "inherit" ? "currentColor" : (r.vars || r).palette[e.color].main
}, e.variant === "determinate" && {
  transition: `transform .${Ee}s linear`
}, e.variant === "buffer" && {
  zIndex: 1,
  transition: `transform .${Ee}s linear`
}), ({
  ownerState: e
}) => (e.variant === "indeterminate" || e.variant === "query") && ze(ot || (ot = Q`
      width: auto;
      animation: ${0} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
    `), jo)), Ho = R("span", {
  name: "MuiLinearProgress",
  slot: "Bar2",
  overridesResolver: (e, r) => {
    const {
      ownerState: n
    } = e;
    return [r.bar, r[`barColor${z(n.color)}`], (n.variant === "indeterminate" || n.variant === "query") && r.bar2Indeterminate, n.variant === "buffer" && r.bar2Buffer];
  }
})(({
  ownerState: e,
  theme: r
}) => x({
  width: "100%",
  position: "absolute",
  left: 0,
  bottom: 0,
  top: 0,
  transition: "transform 0.2s linear",
  transformOrigin: "left"
}, e.variant !== "buffer" && {
  backgroundColor: e.color === "inherit" ? "currentColor" : (r.vars || r).palette[e.color].main
}, e.color === "inherit" && {
  opacity: 0.3
}, e.variant === "buffer" && {
  backgroundColor: Be(r, e.color),
  transition: `transform .${Ee}s linear`
}), ({
  ownerState: e
}) => (e.variant === "indeterminate" || e.variant === "query") && ze(nt || (nt = Q`
      width: auto;
      animation: ${0} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
    `), Ao)), Dt = /* @__PURE__ */ L.forwardRef(function(r, n) {
  const t = Z({
    props: r,
    name: "MuiLinearProgress"
  }), {
    className: o,
    color: s = "primary",
    value: i,
    valueBuffer: c,
    variant: d = "indeterminate"
  } = t, u = N(t, Io), f = x({}, t, {
    color: s,
    variant: d
  }), m = Bo(f), b = or(), v = {}, T = {
    bar1: {},
    bar2: {}
  };
  if (d === "determinate" || d === "buffer")
    if (i !== void 0) {
      v["aria-valuenow"] = Math.round(i), v["aria-valuemin"] = 0, v["aria-valuemax"] = 100;
      let h = i - 100;
      b && (h = -h), T.bar1.transform = `translateX(${h}%)`;
    } else process.env.NODE_ENV !== "production" && console.error("MUI: You need to provide a value prop when using the determinate or buffer variant of LinearProgress .");
  if (d === "buffer")
    if (c !== void 0) {
      let h = (c || 0) - 100;
      b && (h = -h), T.bar2.transform = `translateX(${h}%)`;
    } else process.env.NODE_ENV !== "production" && console.error("MUI: You need to provide a valueBuffer prop when using the buffer variant of LinearProgress.");
  return /* @__PURE__ */ k(Fo, x({
    className: X(m.root, o),
    ownerState: f,
    role: "progressbar"
  }, v, {
    ref: n
  }, u, {
    children: [d === "buffer" ? /* @__PURE__ */ a(Vo, {
      className: m.dashed,
      ownerState: f
    }) : null, /* @__PURE__ */ a(Uo, {
      className: m.bar1,
      ownerState: f,
      style: T.bar1
    }), d === "determinate" ? null : /* @__PURE__ */ a(Ho, {
      className: m.bar2,
      ownerState: f,
      style: T.bar2
    })]
  }));
});
process.env.NODE_ENV !== "production" && (Dt.propTypes = {
  // ┌────────────────────────────── Warning ──────────────────────────────┐
  // │ These PropTypes are generated from the TypeScript type definitions. │
  // │    To update them, edit the d.ts file and run `pnpm proptypes`.     │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * Override or extend the styles applied to the component.
   */
  classes: l.object,
  /**
   * @ignore
   */
  className: l.string,
  /**
   * The color of the component.
   * It supports both default and custom theme colors, which can be added as shown in the
   * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
   * @default 'primary'
   */
  color: l.oneOfType([l.oneOf(["inherit", "primary", "secondary"]), l.string]),
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: l.oneOfType([l.arrayOf(l.oneOfType([l.func, l.object, l.bool])), l.func, l.object]),
  /**
   * The value of the progress indicator for the determinate and buffer variants.
   * Value between 0 and 100.
   */
  value: l.number,
  /**
   * The value for the buffer variant.
   * Value between 0 and 100.
   */
  valueBuffer: l.number,
  /**
   * The variant to use.
   * Use indeterminate or query when there is no progress value.
   * @default 'indeterminate'
   */
  variant: l.oneOf(["buffer", "determinate", "indeterminate", "query"])
});
const Wo = ["children", "className", "disableTypography", "inset", "primary", "primaryTypographyProps", "secondary", "secondaryTypographyProps"], Go = (e) => {
  const {
    classes: r,
    inset: n,
    primary: t,
    secondary: o,
    dense: s
  } = e;
  return J({
    root: ["root", n && "inset", s && "dense", t && o && "multiline"],
    primary: ["primary"],
    secondary: ["secondary"]
  }, fr, r);
}, qo = R("div", {
  name: "MuiListItemText",
  slot: "Root",
  overridesResolver: (e, r) => {
    const {
      ownerState: n
    } = e;
    return [{
      [`& .${Ze.primary}`]: r.primary
    }, {
      [`& .${Ze.secondary}`]: r.secondary
    }, r.root, n.inset && r.inset, n.primary && n.secondary && r.multiline, n.dense && r.dense];
  }
})(({
  ownerState: e
}) => x({
  flex: "1 1 auto",
  minWidth: 0,
  marginTop: 4,
  marginBottom: 4
}, e.primary && e.secondary && {
  marginTop: 6,
  marginBottom: 6
}, e.inset && {
  paddingLeft: 56
})), Pt = /* @__PURE__ */ L.forwardRef(function(r, n) {
  const t = Z({
    props: r,
    name: "MuiListItemText"
  }), {
    children: o,
    className: s,
    disableTypography: i = !1,
    inset: c = !1,
    primary: d,
    primaryTypographyProps: u,
    secondary: f,
    secondaryTypographyProps: m
  } = t, b = N(t, Wo), {
    dense: v
  } = L.useContext(hr);
  let T = d ?? o, h = f;
  const p = x({}, t, {
    disableTypography: i,
    inset: c,
    primary: !!T,
    secondary: !!h,
    dense: v
  }), g = Go(p);
  return T != null && T.type !== q && !i && (T = /* @__PURE__ */ a(q, x({
    variant: v ? "body2" : "body1",
    className: g.primary,
    component: u != null && u.variant ? void 0 : "span",
    display: "block"
  }, u, {
    children: T
  }))), h != null && h.type !== q && !i && (h = /* @__PURE__ */ a(q, x({
    variant: "body2",
    className: g.secondary,
    color: "text.secondary",
    display: "block"
  }, m, {
    children: h
  }))), /* @__PURE__ */ k(qo, x({
    className: X(g.root, s),
    ownerState: p,
    ref: n
  }, b, {
    children: [T, h]
  }));
});
process.env.NODE_ENV !== "production" && (Pt.propTypes = {
  // ┌────────────────────────────── Warning ──────────────────────────────┐
  // │ These PropTypes are generated from the TypeScript type definitions. │
  // │    To update them, edit the d.ts file and run `pnpm proptypes`.     │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * Alias for the `primary` prop.
   */
  children: l.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: l.object,
  /**
   * @ignore
   */
  className: l.string,
  /**
   * If `true`, the children won't be wrapped by a Typography component.
   * This can be useful to render an alternative Typography variant by wrapping
   * the `children` (or `primary`) text, and optional `secondary` text
   * with the Typography component.
   * @default false
   */
  disableTypography: l.bool,
  /**
   * If `true`, the children are indented.
   * This should be used if there is no left avatar or left icon.
   * @default false
   */
  inset: l.bool,
  /**
   * The main content element.
   */
  primary: l.node,
  /**
   * These props will be forwarded to the primary typography component
   * (as long as disableTypography is not `true`).
   */
  primaryTypographyProps: l.object,
  /**
   * The secondary content element.
   */
  secondary: l.node,
  /**
   * These props will be forwarded to the secondary typography component
   * (as long as disableTypography is not `true`).
   */
  secondaryTypographyProps: l.object,
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: l.oneOfType([l.arrayOf(l.oneOfType([l.func, l.object, l.bool])), l.func, l.object])
});
function Zo(e) {
  return ve("MuiStep", e);
}
ye("MuiStep", ["root", "horizontal", "vertical", "alternativeLabel", "completed"]);
const Xo = ["active", "children", "className", "component", "completed", "disabled", "expanded", "index", "last"], Jo = (e) => {
  const {
    classes: r,
    orientation: n,
    alternativeLabel: t,
    completed: o
  } = e;
  return J({
    root: ["root", n, t && "alternativeLabel", o && "completed"]
  }, Zo, r);
}, Ko = R("div", {
  name: "MuiStep",
  slot: "Root",
  overridesResolver: (e, r) => {
    const {
      ownerState: n
    } = e;
    return [r.root, r[n.orientation], n.alternativeLabel && r.alternativeLabel, n.completed && r.completed];
  }
})(({
  ownerState: e
}) => x({}, e.orientation === "horizontal" && {
  paddingLeft: 8,
  paddingRight: 8
}, e.alternativeLabel && {
  flex: 1,
  position: "relative"
})), Lt = /* @__PURE__ */ L.forwardRef(function(r, n) {
  const t = Z({
    props: r,
    name: "MuiStep"
  }), {
    active: o,
    children: s,
    className: i,
    component: c = "div",
    completed: d,
    disabled: u,
    expanded: f = !1,
    index: m,
    last: b
  } = t, v = N(t, Xo), {
    activeStep: T,
    connector: h,
    alternativeLabel: p,
    orientation: g,
    nonLinear: y
  } = L.useContext(pr);
  let [M = !1, S = !1, O = !1] = [o, d, u];
  T === m ? M = o !== void 0 ? o : !0 : !y && T > m ? S = d !== void 0 ? d : !0 : !y && T < m && (O = u !== void 0 ? u : !0);
  const D = L.useMemo(() => ({
    index: m,
    last: b,
    expanded: f,
    icon: m + 1,
    active: M,
    completed: S,
    disabled: O
  }), [m, b, f, M, S, O]), C = x({}, t, {
    active: M,
    orientation: g,
    alternativeLabel: p,
    completed: S,
    disabled: O,
    expanded: f,
    component: c
  }), w = Jo(C), E = /* @__PURE__ */ k(Ko, x({
    as: c,
    className: X(w.root, i),
    ref: n,
    ownerState: C
  }, v, {
    children: [h && p && m !== 0 ? h : null, s]
  }));
  return /* @__PURE__ */ a(mr.Provider, {
    value: D,
    children: h && !p && m !== 0 ? /* @__PURE__ */ k(L.Fragment, {
      children: [h, E]
    }) : E
  });
});
process.env.NODE_ENV !== "production" && (Lt.propTypes = {
  // ┌────────────────────────────── Warning ──────────────────────────────┐
  // │ These PropTypes are generated from the TypeScript type definitions. │
  // │    To update them, edit the d.ts file and run `pnpm proptypes`.     │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * Sets the step as active. Is passed to child components.
   */
  active: l.bool,
  /**
   * Should be `Step` sub-components such as `StepLabel`, `StepContent`.
   */
  children: l.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: l.object,
  /**
   * @ignore
   */
  className: l.string,
  /**
   * Mark the step as completed. Is passed to child components.
   */
  completed: l.bool,
  /**
   * The component used for the root node.
   * Either a string to use a HTML element or a component.
   */
  component: l.elementType,
  /**
   * If `true`, the step is disabled, will also disable the button if
   * `StepButton` is a child of `Step`. Is passed to child components.
   */
  disabled: l.bool,
  /**
   * Expand the step.
   * @default false
   */
  expanded: l.bool,
  /**
   * The position of the step.
   * The prop defaults to the value inherited from the parent Stepper component.
   */
  index: cr,
  /**
   * If `true`, the Step is displayed as rendered last.
   * The prop defaults to the value inherited from the parent Stepper component.
   */
  last: l.bool,
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: l.oneOfType([l.arrayOf(l.oneOfType([l.func, l.object, l.bool])), l.func, l.object])
});
function Qo(e, r) {
  return r === void 0 || e === void 0 ? !1 : Array.isArray(r) ? r.indexOf(e) >= 0 : e === r;
}
const en = ["value"], tn = ["children", "className", "color", "disabled", "disableFocusRipple", "fullWidth", "onChange", "onClick", "selected", "size", "value"], rn = (e) => {
  const {
    classes: r,
    fullWidth: n,
    selected: t,
    disabled: o,
    size: s,
    color: i
  } = e, c = {
    root: ["root", t && "selected", o && "disabled", n && "fullWidth", `size${z(s)}`, i]
  };
  return J(c, yr, r);
}, on = R(ir, {
  name: "MuiToggleButton",
  slot: "Root",
  overridesResolver: (e, r) => {
    const {
      ownerState: n
    } = e;
    return [r.root, r[`size${z(n.size)}`]];
  }
})(({
  theme: e,
  ownerState: r
}) => {
  let n = r.color === "standard" ? e.palette.text.primary : e.palette[r.color].main, t;
  return e.vars && (n = r.color === "standard" ? e.vars.palette.text.primary : e.vars.palette[r.color].main, t = r.color === "standard" ? e.vars.palette.text.primaryChannel : e.vars.palette[r.color].mainChannel), x({}, e.typography.button, {
    borderRadius: (e.vars || e).shape.borderRadius,
    padding: 11,
    border: `1px solid ${(e.vars || e).palette.divider}`,
    color: (e.vars || e).palette.action.active
  }, r.fullWidth && {
    width: "100%"
  }, {
    [`&.${Xe.disabled}`]: {
      color: (e.vars || e).palette.action.disabled,
      border: `1px solid ${(e.vars || e).palette.action.disabledBackground}`
    },
    "&:hover": {
      textDecoration: "none",
      // Reset on mouse devices
      backgroundColor: e.vars ? `rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})` : de(e.palette.text.primary, e.palette.action.hoverOpacity),
      "@media (hover: none)": {
        backgroundColor: "transparent"
      }
    },
    [`&.${Xe.selected}`]: {
      color: n,
      backgroundColor: e.vars ? `rgba(${t} / ${e.vars.palette.action.selectedOpacity})` : de(n, e.palette.action.selectedOpacity),
      "&:hover": {
        backgroundColor: e.vars ? `rgba(${t} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : de(n, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
        // Reset on touch devices, it doesn't add specificity
        "@media (hover: none)": {
          backgroundColor: e.vars ? `rgba(${t} / ${e.vars.palette.action.selectedOpacity})` : de(n, e.palette.action.selectedOpacity)
        }
      }
    }
  }, r.size === "small" && {
    padding: 7,
    fontSize: e.typography.pxToRem(13)
  }, r.size === "large" && {
    padding: 15,
    fontSize: e.typography.pxToRem(15)
  });
}), kt = /* @__PURE__ */ L.forwardRef(function(r, n) {
  const t = L.useContext(gr), {
    value: o
  } = t, s = N(t, en), i = L.useContext(br), c = ar(x({}, s, {
    selected: Qo(r.value, o)
  }), r), d = Z({
    props: c,
    name: "MuiToggleButton"
  }), {
    children: u,
    className: f,
    color: m = "standard",
    disabled: b = !1,
    disableFocusRipple: v = !1,
    fullWidth: T = !1,
    onChange: h,
    onClick: p,
    selected: g,
    size: y = "medium",
    value: M
  } = d, S = N(d, tn), O = x({}, d, {
    color: m,
    disabled: b,
    disableFocusRipple: v,
    fullWidth: T,
    size: y
  }), D = rn(O), C = (E) => {
    p && (p(E, M), E.defaultPrevented) || h && h(E, M);
  }, w = i || "";
  return /* @__PURE__ */ a(on, x({
    className: X(s.className, D.root, f, w),
    disabled: b,
    focusRipple: !v,
    ref: n,
    onClick: C,
    onChange: h,
    value: M,
    ownerState: O,
    "aria-pressed": g
  }, S, {
    children: u
  }));
});
process.env.NODE_ENV !== "production" && (kt.propTypes = {
  // ┌────────────────────────────── Warning ──────────────────────────────┐
  // │ These PropTypes are generated from the TypeScript type definitions. │
  // │    To update them, edit the d.ts file and run `pnpm proptypes`.     │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * The content of the component.
   */
  children: l.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: l.object,
  /**
   * @ignore
   */
  className: l.string,
  /**
   * The color of the button when it is in an active state.
   * It supports both default and custom theme colors, which can be added as shown in the
   * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
   * @default 'standard'
   */
  color: l.oneOfType([l.oneOf(["standard", "primary", "secondary", "error", "info", "success", "warning"]), l.string]),
  /**
   * If `true`, the component is disabled.
   * @default false
   */
  disabled: l.bool,
  /**
   * If `true`, the  keyboard focus ripple is disabled.
   * @default false
   */
  disableFocusRipple: l.bool,
  /**
   * If `true`, the ripple effect is disabled.
   *
   * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
   * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
   * @default false
   */
  disableRipple: l.bool,
  /**
   * If `true`, the button will take up the full width of its container.
   * @default false
   */
  fullWidth: l.bool,
  /**
   * Callback fired when the state changes.
   *
   * @param {React.MouseEvent<HTMLElement>} event The event source of the callback.
   * @param {any} value of the selected button.
   */
  onChange: l.func,
  /**
   * Callback fired when the button is clicked.
   *
   * @param {React.MouseEvent<HTMLElement>} event The event source of the callback.
   * @param {any} value of the selected button.
   */
  onClick: l.func,
  /**
   * If `true`, the button is rendered in an active state.
   */
  selected: l.bool,
  /**
   * The size of the component.
   * The prop defaults to the value inherited from the parent ToggleButtonGroup component.
   * @default 'medium'
   */
  size: l.oneOfType([l.oneOf(["small", "medium", "large"]), l.string]),
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: l.oneOfType([l.arrayOf(l.oneOfType([l.func, l.object, l.bool])), l.func, l.object]),
  /**
   * The value to associate with the button when selected in a
   * ToggleButtonGroup.
   */
  value: l.any.isRequired
});
const Ms = ({
  isSub: e,
  ...r
}) => /* @__PURE__ */ a(e ? vr : Tr, { ...r, expandIcon: /* @__PURE__ */ a(Ct, {}) }), Os = ({ children: e, ...r }) => /* @__PURE__ */ a(ee, { variant: "contained", startIcon: /* @__PURE__ */ a(xr, {}), ...r, children: e }), nn = ({
  children: e,
  Icon: r,
  variant: n,
  width: t = "auto",
  onClick: o,
  iconPosition: s,
  ...i
}) => {
  const c = Te();
  return /* @__PURE__ */ a(
    ee,
    {
      ...i,
      variant: n,
      tabIndex: -1,
      disableRipple: !0,
      onClick: o,
      sx: {
        width: t,
        height: "36px",
        backgroundColor: n === "contained" ? c.palette.primary.main : "transparent",
        color: n === "contained" ? c.palette.common.white : c.palette.primary.main
      },
      endIcon: s === "end" && r,
      startIcon: s === "start" && r,
      children: e
    }
  );
}, Ss = () => {
  const [e, r] = F(null);
  return {
    anchorEl: e,
    open: !!e,
    handleClick: (s) => {
      s.stopPropagation(), r(s.currentTarget);
    },
    onClose: () => {
      r(null);
    }
  };
}, sn = (e, r) => {
  const n = me(() => {
    try {
      const i = localStorage.getItem(e);
      return i ? JSON.parse(i) : {};
    } catch {
      return {};
    }
  }, [e]), [t, o] = F(
    n()
  ), s = me(() => {
    var i;
    if ((i = r == null ? void 0 : r.current) != null && i.exportState && localStorage) {
      const c = r.current.exportState();
      localStorage.setItem(e, JSON.stringify(c));
    }
  }, [r, e]);
  return vt(() => (o(n()), window.addEventListener("beforeunload", s), () => {
    window.removeEventListener("beforeunload", s), s();
  }), [s, e, n]), {
    state: t
  };
}, an = (e) => {
  const [r, n] = F(0);
  return Ce(() => {
    const t = document.querySelector(e);
    if (!t) {
      console.warn(`Element with selector "${e}" not found`);
      return;
    }
    const o = () => {
      n(t.scrollTop);
    };
    return t.addEventListener("scroll", o), () => {
      t.removeEventListener("scroll", o);
    };
  }, [e]), r;
}, ln = oe(/* @__PURE__ */ a("path", {
  d: "M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"
}), "CheckCircleOutline"), cn = oe(/* @__PURE__ */ a("path", {
  d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
}), "Clear"), dn = oe(/* @__PURE__ */ a("path", {
  d: "M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"
}), "InfoOutlined"), un = oe(/* @__PURE__ */ a("path", {
  d: "M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"
}), "KeyboardArrowRight"), hn = oe(/* @__PURE__ */ a("path", {
  d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"
}), "Search"), Ds = ({
  value: e,
  children: r,
  dataTestId: n
}) => /* @__PURE__ */ a(Cr, { item: !0, children: /* @__PURE__ */ a(
  kt,
  {
    value: e,
    sx: { fontSize: 11, py: 0, borderRadius: 10 },
    color: "primary",
    "data-testid": n,
    children: r
  }
) });
var fn = "[object Number]";
function pn(e) {
  return typeof e == "number" || Mr(e) && Or(e) == fn;
}
function mn(e) {
  return e === void 0;
}
function Ps({
  primaryLabel: e,
  primaryLoading: r,
  primaryOnClick: n,
  secondaryLabel: t,
  secondaryLoading: o,
  secondaryOnClick: s,
  tertiaryLabel: i,
  tertiaryLoading: c,
  tertiaryIcon: d,
  tertiaryOnClick: u,
  cancelOnClick: f,
  offset: m,
  disabled: b
}) {
  return ro.createPortal(
    /* @__PURE__ */ k(Sr, { offset: m, children: [
      f && /* @__PURE__ */ a(
        ee,
        {
          disabled: b,
          onClick: f,
          "data-testid": "bottom-panel-cancel-button",
          children: "Anuluj"
        }
      ),
      n && /* @__PURE__ */ a(
        ee,
        {
          onClick: n,
          variant: "outlined",
          loading: r,
          disabled: b,
          children: e
        }
      ),
      s && t && /* @__PURE__ */ a(
        ee,
        {
          onClick: s,
          variant: "contained",
          loading: o,
          disabled: b,
          children: t ?? ""
        }
      ),
      n && u && i && /* @__PURE__ */ a(q, { fontSize: 16, children: "lub" }),
      u && i && /* @__PURE__ */ a(
        nn,
        {
          iconPosition: "end",
          onClick: u,
          Icon: mn(d) ? /* @__PURE__ */ a(un, {}) : d,
          title: i ?? "",
          variant: "contained",
          loading: c,
          disabled: b,
          children: i ?? ""
        }
      )
    ] }),
    document.body
  );
}
var gn = Object.defineProperty, bn = (e, r, n) => r in e ? gn(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n, he = (e, r, n) => bn(e, typeof r != "symbol" ? r + "" : r, n), $e = /* @__PURE__ */ new Map(), fe = /* @__PURE__ */ new WeakMap(), st = 0, yn = void 0;
function vn(e) {
  return e ? (fe.has(e) || (st += 1, fe.set(e, st.toString())), fe.get(e)) : "0";
}
function Tn(e) {
  return Object.keys(e).sort().filter(
    (r) => e[r] !== void 0
  ).map((r) => `${r}_${r === "root" ? vn(e.root) : e[r]}`).toString();
}
function xn(e) {
  const r = Tn(e);
  let n = $e.get(r);
  if (!n) {
    const t = /* @__PURE__ */ new Map();
    let o;
    const s = new IntersectionObserver((i) => {
      i.forEach((c) => {
        var d;
        const u = c.isIntersecting && o.some((f) => c.intersectionRatio >= f);
        e.trackVisibility && typeof c.isVisible > "u" && (c.isVisible = u), (d = t.get(c.target)) == null || d.forEach((f) => {
          f(u, c);
        });
      });
    }, e);
    o = s.thresholds || (Array.isArray(e.threshold) ? e.threshold : [e.threshold || 0]), n = {
      id: r,
      observer: s,
      elements: t
    }, $e.set(r, n);
  }
  return n;
}
function Cn(e, r, n = {}, t = yn) {
  if (typeof window.IntersectionObserver > "u" && t !== void 0) {
    const d = e.getBoundingClientRect();
    return r(t, {
      isIntersecting: t,
      target: e,
      intersectionRatio: typeof n.threshold == "number" ? n.threshold : 0,
      time: 0,
      boundingClientRect: d,
      intersectionRect: d,
      rootBounds: d
    }), () => {
    };
  }
  const { id: o, observer: s, elements: i } = xn(n), c = i.get(e) || [];
  return i.has(e) || i.set(e, c), c.push(r), s.observe(e), function() {
    c.splice(c.indexOf(r), 1), c.length === 0 && (i.delete(e), s.unobserve(e)), i.size === 0 && (s.disconnect(), $e.delete(o));
  };
}
function Mn(e) {
  return typeof e.children != "function";
}
var On = class extends L.Component {
  constructor(e) {
    super(e), he(this, "node", null), he(this, "_unobserveCb", null), he(this, "handleNode", (r) => {
      this.node && (this.unobserve(), !r && !this.props.triggerOnce && !this.props.skip && this.setState({ inView: !!this.props.initialInView, entry: void 0 })), this.node = r || null, this.observeNode();
    }), he(this, "handleChange", (r, n) => {
      r && this.props.triggerOnce && this.unobserve(), Mn(this.props) || this.setState({ inView: r, entry: n }), this.props.onChange && this.props.onChange(r, n);
    }), this.state = {
      inView: !!e.initialInView,
      entry: void 0
    };
  }
  componentDidMount() {
    this.unobserve(), this.observeNode();
  }
  componentDidUpdate(e) {
    (e.rootMargin !== this.props.rootMargin || e.root !== this.props.root || e.threshold !== this.props.threshold || e.skip !== this.props.skip || e.trackVisibility !== this.props.trackVisibility || e.delay !== this.props.delay) && (this.unobserve(), this.observeNode());
  }
  componentWillUnmount() {
    this.unobserve();
  }
  observeNode() {
    if (!this.node || this.props.skip) return;
    const {
      threshold: e,
      root: r,
      rootMargin: n,
      trackVisibility: t,
      delay: o,
      fallbackInView: s
    } = this.props;
    this._unobserveCb = Cn(
      this.node,
      this.handleChange,
      {
        threshold: e,
        root: r,
        rootMargin: n,
        // @ts-ignore
        trackVisibility: t,
        // @ts-ignore
        delay: o
      },
      s
    );
  }
  unobserve() {
    this._unobserveCb && (this._unobserveCb(), this._unobserveCb = null);
  }
  render() {
    const { children: e } = this.props;
    if (typeof e == "function") {
      const { inView: v, entry: T } = this.state;
      return e({ inView: v, entry: T, ref: this.handleNode });
    }
    const {
      as: r,
      triggerOnce: n,
      threshold: t,
      root: o,
      rootMargin: s,
      onChange: i,
      skip: c,
      trackVisibility: d,
      delay: u,
      initialInView: f,
      fallbackInView: m,
      ...b
    } = this.props;
    return L.createElement(
      r || "div",
      { ref: this.handleNode, ...b },
      e
    );
  }
}, Fe = {}, Sn = re;
Object.defineProperty(Fe, "__esModule", {
  value: !0
});
var wt = Fe.default = void 0, Dn = Sn(ie()), Pn = te;
wt = Fe.default = (0, Dn.default)(/* @__PURE__ */ (0, Pn.jsx)("path", {
  d: "M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"
}), "AddCircleOutline");
function Ln(e) {
  return oo(
    /* @__PURE__ */ a(
      H,
      {
        role: "listbox",
        height: "100%",
        width: "100%",
        border: `1px solid ${lr[200]}`,
        children: e.children
      }
    ),
    document.getElementById(e.listboxPortalId)
  );
}
function kn({
  listboxType: e = "default",
  ...r
}) {
  const n = (o, s) => {
    r.multiple, r.onChange(s);
  }, t = me(r.filterOptions || ((o) => o), [
    r.filterOptions
  ]);
  return /* @__PURE__ */ k(Ne, { children: [
    /* @__PURE__ */ a(
      Dr,
      {
        ...r,
        open: e === "list" ? !0 : void 0,
        onChange: (o, s) => n(o, s),
        filterOptions: t,
        size: "small",
        ListboxComponent: e === "list" ? Ln : void 0,
        ListboxProps: {
          onScroll: (o) => {
            var i;
            const s = o.currentTarget;
            s.scrollTop + s.clientHeight === s.scrollHeight && ((i = r.onLastOptionInView) == null || i.call(r));
          },
          // @ts-expect-error "listboxPortalId" (needed for ListboxComponent)
          listboxPortalId: r.listboxPortalId
        },
        renderInput: (o) => /* @__PURE__ */ a(
          dt,
          {
            ...o,
            label: r.label,
            required: r.required,
            disabled: r.disabled,
            error: !!r.errorMessage,
            inputProps: {
              ...o.inputProps,
              "data-testid": "contextual-search-text-input"
            }
          }
        ),
        renderOption: ({ key: o, ...s }, i, c, d) => c.index === d.options.length - 1 ? /* @__PURE__ */ a(On, { onChange: (m) => {
          m && r.onLastOptionInView();
        }, children: /* @__PURE__ */ a(A, { ...s, children: r.renderOption(i) }) }, o) : /* @__PURE__ */ a(A, { ...s, children: r.renderOption(i) }, o),
        slotProps: {
          paper: {
            // @ts-expect-error https://github.com/mui/material-ui/issues/43609
            loading: r.loading,
            onAddNewEntry: r.onAddNewEntry
          }
        },
        PaperComponent: wn,
        "data-testid": "contextual-search",
        noOptionsText: r.loading ? "Ładowanie..." : "Brak rezultatów"
      }
    ),
    r.errorMessage && /* @__PURE__ */ a(Ie, { error: !0, children: r.errorMessage })
  ] });
}
const wn = (e) => /* @__PURE__ */ k(ct, { children: [
  e.children,
  e.loading && /* @__PURE__ */ a(Dt, {}),
  e.onAddNewEntry && /* @__PURE__ */ a(
    ut,
    {
      variant: "outlined",
      startIcon: /* @__PURE__ */ a(wt, {}),
      fullWidth: !0,
      sx: { borderTopLeftRadius: 0, borderTopRightRadius: 0 },
      onMouseDown: e.onAddNewEntry,
      children: "Dodaj nowy wpis"
    }
  )
] });
function Ls(e) {
  return /* @__PURE__ */ a(
    K,
    {
      control: e.control,
      name: e.name,
      render: ({ field: r, fieldState: n }) => {
        var t;
        return /* @__PURE__ */ a(
          kn,
          {
            ...e,
            value: r.value,
            onChange: r.onChange,
            multiple: e.multiple,
            listboxType: e.listboxType,
            errorMessage: (t = n.error) == null ? void 0 : t.message
          }
        );
      }
    }
  );
}
var Et = { exports: {} };
(function(e, r) {
  (function(n, t) {
    e.exports = t();
  })(ne, function() {
    var n = "week", t = "year";
    return function(o, s, i) {
      var c = s.prototype;
      c.week = function(d) {
        if (d === void 0 && (d = null), d !== null) return this.add(7 * (d - this.week()), "day");
        var u = this.$locale().yearStart || 1;
        if (this.month() === 11 && this.date() > 25) {
          var f = i(this).startOf(t).add(1, t).date(u), m = i(this).endOf(n);
          if (f.isBefore(m)) return 1;
        }
        var b = i(this).startOf(t).date(u).startOf(n).subtract(1, "millisecond"), v = this.diff(b, n, !0);
        return v < 0 ? i(this).startOf("week").week() : Math.ceil(v);
      }, c.weeks = function(d) {
        return d === void 0 && (d = null), this.week(d);
      };
    };
  });
})(Et);
var En = Et.exports;
const $n = /* @__PURE__ */ se(En);
var $t = { exports: {} };
(function(e, r) {
  (function(n, t) {
    e.exports = t();
  })(ne, function() {
    var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, o = /\d\d/, s = /\d\d?/, i = /\d*[^-_:/,()\s\d]+/, c = {}, d = function(h) {
      return (h = +h) + (h > 68 ? 1900 : 2e3);
    }, u = function(h) {
      return function(p) {
        this[h] = +p;
      };
    }, f = [/[+-]\d\d:?(\d\d)?|Z/, function(h) {
      (this.zone || (this.zone = {})).offset = function(p) {
        if (!p || p === "Z") return 0;
        var g = p.match(/([+-]|\d\d)/g), y = 60 * g[1] + (+g[2] || 0);
        return y === 0 ? 0 : g[0] === "+" ? -y : y;
      }(h);
    }], m = function(h) {
      var p = c[h];
      return p && (p.indexOf ? p : p.s.concat(p.f));
    }, b = function(h, p) {
      var g, y = c.meridiem;
      if (y) {
        for (var M = 1; M <= 24; M += 1) if (h.indexOf(y(M, 0, p)) > -1) {
          g = M > 12;
          break;
        }
      } else g = h === (p ? "pm" : "PM");
      return g;
    }, v = { A: [i, function(h) {
      this.afternoon = b(h, !1);
    }], a: [i, function(h) {
      this.afternoon = b(h, !0);
    }], S: [/\d/, function(h) {
      this.milliseconds = 100 * +h;
    }], SS: [o, function(h) {
      this.milliseconds = 10 * +h;
    }], SSS: [/\d{3}/, function(h) {
      this.milliseconds = +h;
    }], s: [s, u("seconds")], ss: [s, u("seconds")], m: [s, u("minutes")], mm: [s, u("minutes")], H: [s, u("hours")], h: [s, u("hours")], HH: [s, u("hours")], hh: [s, u("hours")], D: [s, u("day")], DD: [o, u("day")], Do: [i, function(h) {
      var p = c.ordinal, g = h.match(/\d+/);
      if (this.day = g[0], p) for (var y = 1; y <= 31; y += 1) p(y).replace(/\[|\]/g, "") === h && (this.day = y);
    }], M: [s, u("month")], MM: [o, u("month")], MMM: [i, function(h) {
      var p = m("months"), g = (m("monthsShort") || p.map(function(y) {
        return y.slice(0, 3);
      })).indexOf(h) + 1;
      if (g < 1) throw new Error();
      this.month = g % 12 || g;
    }], MMMM: [i, function(h) {
      var p = m("months").indexOf(h) + 1;
      if (p < 1) throw new Error();
      this.month = p % 12 || p;
    }], Y: [/[+-]?\d+/, u("year")], YY: [o, function(h) {
      this.year = d(h);
    }], YYYY: [/\d{4}/, u("year")], Z: f, ZZ: f };
    function T(h) {
      var p, g;
      p = h, g = c && c.formats;
      for (var y = (h = p.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(E, I, _) {
        var $ = _ && _.toUpperCase();
        return I || g[_] || n[_] || g[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(j, B, V) {
          return B || V.slice(1);
        });
      })).match(t), M = y.length, S = 0; S < M; S += 1) {
        var O = y[S], D = v[O], C = D && D[0], w = D && D[1];
        y[S] = w ? { regex: C, parser: w } : O.replace(/^\[|\]$/g, "");
      }
      return function(E) {
        for (var I = {}, _ = 0, $ = 0; _ < M; _ += 1) {
          var j = y[_];
          if (typeof j == "string") $ += j.length;
          else {
            var B = j.regex, V = j.parser, ae = E.slice($), W = B.exec(ae)[0];
            V.call(I, W), E = E.replace(W, "");
          }
        }
        return function(U) {
          var Y = U.afternoon;
          if (Y !== void 0) {
            var G = U.hours;
            Y ? G < 12 && (U.hours += 12) : G === 12 && (U.hours = 0), delete U.afternoon;
          }
        }(I), I;
      };
    }
    return function(h, p, g) {
      g.p.customParseFormat = !0, h && h.parseTwoDigitYear && (d = h.parseTwoDigitYear);
      var y = p.prototype, M = y.parse;
      y.parse = function(S) {
        var O = S.date, D = S.utc, C = S.args;
        this.$u = D;
        var w = C[1];
        if (typeof w == "string") {
          var E = C[2] === !0, I = C[3] === !0, _ = E || I, $ = C[2];
          I && ($ = C[2]), c = this.$locale(), !E && $ && (c = g.Ls[$]), this.$d = function(ae, W, U) {
            try {
              if (["x", "X"].indexOf(W) > -1) return new Date((W === "X" ? 1e3 : 1) * ae);
              var Y = T(W)(ae), G = Y.year, le = Y.month, Bt = Y.day, Ft = Y.hours, Vt = Y.minutes, Ut = Y.seconds, Ht = Y.milliseconds, Ge = Y.zone, Me = /* @__PURE__ */ new Date(), Oe = Bt || (G || le ? 1 : Me.getDate()), Se = G || Me.getFullYear(), ce = 0;
              G && !le || (ce = le > 0 ? le - 1 : Me.getMonth());
              var De = Ft || 0, Pe = Vt || 0, Le = Ut || 0, ke = Ht || 0;
              return Ge ? new Date(Date.UTC(Se, ce, Oe, De, Pe, Le, ke + 60 * Ge.offset * 1e3)) : U ? new Date(Date.UTC(Se, ce, Oe, De, Pe, Le, ke)) : new Date(Se, ce, Oe, De, Pe, Le, ke);
            } catch {
              return /* @__PURE__ */ new Date("");
            }
          }(O, w, D), this.init(), $ && $ !== !0 && (this.$L = this.locale($).$L), _ && O != this.format(w) && (this.$d = /* @__PURE__ */ new Date("")), c = {};
        } else if (w instanceof Array) for (var j = w.length, B = 1; B <= j; B += 1) {
          C[1] = w[B - 1];
          var V = g.apply(this, C);
          if (V.isValid()) {
            this.$d = V.$d, this.$L = V.$L, this.init();
            break;
          }
          B === j && (this.$d = /* @__PURE__ */ new Date(""));
        }
        else M.call(this, S);
      };
    };
  });
})($t);
var _n = $t.exports;
const Yn = /* @__PURE__ */ se(_n);
var _t = { exports: {} };
(function(e, r) {
  (function(n, t) {
    e.exports = t();
  })(ne, function() {
    var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" };
    return function(t, o, s) {
      var i = o.prototype, c = i.format;
      s.en.formats = n, i.format = function(d) {
        d === void 0 && (d = "YYYY-MM-DDTHH:mm:ssZ");
        var u = this.$locale().formats, f = function(m, b) {
          return m.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(v, T, h) {
            var p = h && h.toUpperCase();
            return T || b[h] || n[h] || b[p].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(g, y, M) {
              return y || M.slice(1);
            });
          });
        }(d, u === void 0 ? {} : u);
        return c.call(this, f);
      };
    };
  });
})(_t);
var zn = _t.exports;
const Nn = /* @__PURE__ */ se(zn);
var Yt = { exports: {} };
(function(e, r) {
  (function(n, t) {
    e.exports = t();
  })(ne, function() {
    return function(n, t, o) {
      t.prototype.isBetween = function(s, i, c, d) {
        var u = o(s), f = o(i), m = (d = d || "()")[0] === "(", b = d[1] === ")";
        return (m ? this.isAfter(u, c) : !this.isBefore(u, c)) && (b ? this.isBefore(f, c) : !this.isAfter(f, c)) || (m ? this.isBefore(u, c) : !this.isAfter(u, c)) && (b ? this.isAfter(f, c) : !this.isBefore(f, c));
      };
    };
  });
})(Yt);
var In = Yt.exports;
const jn = /* @__PURE__ */ se(In);
var zt = { exports: {} };
(function(e, r) {
  (function(n, t) {
    e.exports = t();
  })(ne, function() {
    return function(n, t) {
      var o = t.prototype, s = o.format;
      o.format = function(i) {
        var c = this, d = this.$locale();
        if (!this.isValid()) return s.bind(this)(i);
        var u = this.$utils(), f = (i || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, function(m) {
          switch (m) {
            case "Q":
              return Math.ceil((c.$M + 1) / 3);
            case "Do":
              return d.ordinal(c.$D);
            case "gggg":
              return c.weekYear();
            case "GGGG":
              return c.isoWeekYear();
            case "wo":
              return d.ordinal(c.week(), "W");
            case "w":
            case "ww":
              return u.s(c.week(), m === "w" ? 1 : 2, "0");
            case "W":
            case "WW":
              return u.s(c.isoWeek(), m === "W" ? 1 : 2, "0");
            case "k":
            case "kk":
              return u.s(String(c.$H === 0 ? 24 : c.$H), m === "k" ? 1 : 2, "0");
            case "X":
              return Math.floor(c.$d.getTime() / 1e3);
            case "x":
              return c.$d.getTime();
            case "z":
              return "[" + c.offsetName() + "]";
            case "zzz":
              return "[" + c.offsetName("long") + "]";
            default:
              return m;
          }
        });
        return s.bind(this)(f);
      };
    };
  });
})(zt);
var An = zt.exports;
const Rn = /* @__PURE__ */ se(An);
P.extend(Nn);
P.extend($n);
P.extend(jn);
P.extend(Rn);
const Bn = {
  // Year
  YY: "year",
  YYYY: {
    sectionType: "year",
    contentType: "digit",
    maxLength: 4
  },
  // Month
  M: {
    sectionType: "month",
    contentType: "digit",
    maxLength: 2
  },
  MM: "month",
  MMM: {
    sectionType: "month",
    contentType: "letter"
  },
  MMMM: {
    sectionType: "month",
    contentType: "letter"
  },
  // Day of the month
  D: {
    sectionType: "day",
    contentType: "digit",
    maxLength: 2
  },
  DD: "day",
  Do: {
    sectionType: "day",
    contentType: "digit-with-letter"
  },
  // Day of the week
  d: {
    sectionType: "weekDay",
    contentType: "digit",
    maxLength: 2
  },
  dd: {
    sectionType: "weekDay",
    contentType: "letter"
  },
  ddd: {
    sectionType: "weekDay",
    contentType: "letter"
  },
  dddd: {
    sectionType: "weekDay",
    contentType: "letter"
  },
  // Meridiem
  A: "meridiem",
  a: "meridiem",
  // Hours
  H: {
    sectionType: "hours",
    contentType: "digit",
    maxLength: 2
  },
  HH: "hours",
  h: {
    sectionType: "hours",
    contentType: "digit",
    maxLength: 2
  },
  hh: "hours",
  // Minutes
  m: {
    sectionType: "minutes",
    contentType: "digit",
    maxLength: 2
  },
  mm: "minutes",
  // Seconds
  s: {
    sectionType: "seconds",
    contentType: "digit",
    maxLength: 2
  },
  ss: "seconds"
}, Fn = {
  year: "YYYY",
  month: "MMMM",
  monthShort: "MMM",
  dayOfMonth: "D",
  dayOfMonthFull: "Do",
  weekday: "dddd",
  weekdayShort: "dd",
  hours24h: "HH",
  hours12h: "hh",
  meridiem: "A",
  minutes: "mm",
  seconds: "ss",
  fullDate: "ll",
  keyboardDate: "L",
  shortDate: "MMM D",
  normalDate: "D MMMM",
  normalDateWithWeekday: "ddd, MMM D",
  fullTime: "LT",
  fullTime12h: "hh:mm A",
  fullTime24h: "HH:mm",
  keyboardDateTime: "L LT",
  keyboardDateTime12h: "L hh:mm A",
  keyboardDateTime24h: "L HH:mm"
}, we = ["Missing UTC plugin", "To be able to use UTC or timezones, you have to enable the `utc` plugin", "Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join(`
`), it = ["Missing timezone plugin", "To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin", "Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join(`
`), Vn = (e, r) => r ? (...n) => e(...n).locale(r) : e;
class Ve {
  constructor({
    locale: r,
    formats: n
  } = {}) {
    this.isMUIAdapter = !0, this.isTimezoneCompatible = !0, this.lib = "dayjs", this.dayjs = void 0, this.locale = void 0, this.formats = void 0, this.escapedCharacters = {
      start: "[",
      end: "]"
    }, this.formatTokenMap = Bn, this.setLocaleToValue = (t) => {
      const o = this.getCurrentLocaleCode();
      return o === t.locale() ? t : t.locale(o);
    }, this.hasUTCPlugin = () => typeof P.utc < "u", this.hasTimezonePlugin = () => typeof P.tz < "u", this.isSame = (t, o, s) => {
      const i = this.setTimezone(o, this.getTimezone(t));
      return t.format(s) === i.format(s);
    }, this.cleanTimezone = (t) => {
      switch (t) {
        case "default":
          return;
        case "system":
          return P.tz.guess();
        default:
          return t;
      }
    }, this.createSystemDate = (t) => {
      if (this.hasUTCPlugin() && this.hasTimezonePlugin()) {
        const o = P.tz.guess();
        return o !== "UTC" ? P.tz(t, o) : P(t);
      }
      return P(t);
    }, this.createUTCDate = (t) => {
      if (!this.hasUTCPlugin())
        throw new Error(we);
      return P.utc(t);
    }, this.createTZDate = (t, o) => {
      if (!this.hasUTCPlugin())
        throw new Error(we);
      if (!this.hasTimezonePlugin())
        throw new Error(it);
      const s = t !== void 0 && !t.endsWith("Z");
      return P(t).tz(this.cleanTimezone(o), s);
    }, this.getLocaleFormats = () => {
      const t = P.Ls, o = this.locale || "en";
      let s = t[o];
      return s === void 0 && (process.env.NODE_ENV !== "production" && Pr(["MUI X: Your locale has not been found.", "Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale.", "Or you forget to import the locale from 'dayjs/locale/{localeUsed}'", "fallback on English locale."]), s = t.en), s.formats;
    }, this.adjustOffset = (t) => {
      if (!this.hasTimezonePlugin())
        return t;
      const o = this.getTimezone(t);
      if (o !== "UTC") {
        const s = t.tz(this.cleanTimezone(o), !0);
        if (s.$offset === (t.$offset ?? 0))
          return t;
        t.$offset = s.$offset;
      }
      return t;
    }, this.date = (t, o = "default") => {
      if (t === null)
        return null;
      let s;
      return o === "UTC" ? s = this.createUTCDate(t) : o === "system" || o === "default" && !this.hasTimezonePlugin() ? s = this.createSystemDate(t) : s = this.createTZDate(t, o), this.locale === void 0 ? s : s.locale(this.locale);
    }, this.getInvalidDate = () => P(/* @__PURE__ */ new Date("Invalid date")), this.getTimezone = (t) => {
      var o;
      if (this.hasTimezonePlugin()) {
        const s = (o = t.$x) == null ? void 0 : o.$timezone;
        if (s)
          return s;
      }
      return this.hasUTCPlugin() && t.isUTC() ? "UTC" : "system";
    }, this.setTimezone = (t, o) => {
      if (this.getTimezone(t) === o)
        return t;
      if (o === "UTC") {
        if (!this.hasUTCPlugin())
          throw new Error(we);
        return t.utc();
      }
      if (o === "system")
        return t.local();
      if (!this.hasTimezonePlugin()) {
        if (o === "default")
          return t;
        throw new Error(it);
      }
      return P.tz(t, this.cleanTimezone(o));
    }, this.toJsDate = (t) => t.toDate(), this.parse = (t, o) => t === "" ? null : this.dayjs(t, o, this.locale, !0), this.getCurrentLocaleCode = () => this.locale || "en", this.is12HourCycleInCurrentLocale = () => /A|a/.test(this.getLocaleFormats().LT || ""), this.expandFormat = (t) => {
      const o = this.getLocaleFormats(), s = (i) => i.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (c, d, u) => d || u.slice(1));
      return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (i, c, d) => {
        const u = d && d.toUpperCase();
        return c || o[d] || s(o[u]);
      });
    }, this.isValid = (t) => t == null ? !1 : t.isValid(), this.format = (t, o) => this.formatByString(t, this.formats[o]), this.formatByString = (t, o) => this.dayjs(t).format(o), this.formatNumber = (t) => t, this.isEqual = (t, o) => t === null && o === null ? !0 : t === null || o === null ? !1 : t.toDate().getTime() === o.toDate().getTime(), this.isSameYear = (t, o) => this.isSame(t, o, "YYYY"), this.isSameMonth = (t, o) => this.isSame(t, o, "YYYY-MM"), this.isSameDay = (t, o) => this.isSame(t, o, "YYYY-MM-DD"), this.isSameHour = (t, o) => t.isSame(o, "hour"), this.isAfter = (t, o) => t > o, this.isAfterYear = (t, o) => this.hasUTCPlugin() ? !this.isSameYear(t, o) && t.utc() > o.utc() : t.isAfter(o, "year"), this.isAfterDay = (t, o) => this.hasUTCPlugin() ? !this.isSameDay(t, o) && t.utc() > o.utc() : t.isAfter(o, "day"), this.isBefore = (t, o) => t < o, this.isBeforeYear = (t, o) => this.hasUTCPlugin() ? !this.isSameYear(t, o) && t.utc() < o.utc() : t.isBefore(o, "year"), this.isBeforeDay = (t, o) => this.hasUTCPlugin() ? !this.isSameDay(t, o) && t.utc() < o.utc() : t.isBefore(o, "day"), this.isWithinRange = (t, [o, s]) => t >= o && t <= s, this.startOfYear = (t) => this.adjustOffset(t.startOf("year")), this.startOfMonth = (t) => this.adjustOffset(t.startOf("month")), this.startOfWeek = (t) => this.adjustOffset(t.startOf("week")), this.startOfDay = (t) => this.adjustOffset(t.startOf("day")), this.endOfYear = (t) => this.adjustOffset(t.endOf("year")), this.endOfMonth = (t) => this.adjustOffset(t.endOf("month")), this.endOfWeek = (t) => this.adjustOffset(t.endOf("week")), this.endOfDay = (t) => this.adjustOffset(t.endOf("day")), this.addYears = (t, o) => this.adjustOffset(o < 0 ? t.subtract(Math.abs(o), "year") : t.add(o, "year")), this.addMonths = (t, o) => this.adjustOffset(o < 0 ? t.subtract(Math.abs(o), "month") : t.add(o, "month")), this.addWeeks = (t, o) => this.adjustOffset(o < 0 ? t.subtract(Math.abs(o), "week") : t.add(o, "week")), this.addDays = (t, o) => this.adjustOffset(o < 0 ? t.subtract(Math.abs(o), "day") : t.add(o, "day")), this.addHours = (t, o) => this.adjustOffset(o < 0 ? t.subtract(Math.abs(o), "hour") : t.add(o, "hour")), this.addMinutes = (t, o) => this.adjustOffset(o < 0 ? t.subtract(Math.abs(o), "minute") : t.add(o, "minute")), this.addSeconds = (t, o) => this.adjustOffset(o < 0 ? t.subtract(Math.abs(o), "second") : t.add(o, "second")), this.getYear = (t) => t.year(), this.getMonth = (t) => t.month(), this.getDate = (t) => t.date(), this.getHours = (t) => t.hour(), this.getMinutes = (t) => t.minute(), this.getSeconds = (t) => t.second(), this.getMilliseconds = (t) => t.millisecond(), this.setYear = (t, o) => this.adjustOffset(t.set("year", o)), this.setMonth = (t, o) => this.adjustOffset(t.set("month", o)), this.setDate = (t, o) => this.adjustOffset(t.set("date", o)), this.setHours = (t, o) => this.adjustOffset(t.set("hour", o)), this.setMinutes = (t, o) => this.adjustOffset(t.set("minute", o)), this.setSeconds = (t, o) => this.adjustOffset(t.set("second", o)), this.setMilliseconds = (t, o) => this.adjustOffset(t.set("millisecond", o)), this.getDaysInMonth = (t) => t.daysInMonth(), this.getWeekArray = (t) => {
      const o = this.setLocaleToValue(t), s = this.startOfWeek(this.startOfMonth(o)), i = this.endOfWeek(this.endOfMonth(o));
      let c = 0, d = s;
      const u = [];
      for (; d < i; ) {
        const f = Math.floor(c / 7);
        u[f] = u[f] || [], u[f].push(d), d = this.addDays(d, 1), c += 1;
      }
      return u;
    }, this.getWeekNumber = (t) => t.week(), this.getYearRange = ([t, o]) => {
      const s = this.startOfYear(t), i = this.endOfYear(o), c = [];
      let d = s;
      for (; this.isBefore(d, i); )
        c.push(d), d = this.addYears(d, 1);
      return c;
    }, this.dayjs = Vn(P, r), this.locale = r, this.formats = x({}, Fn, n), P.extend(Yn);
  }
  getDayOfWeek(r) {
    return r.day() + 1;
  }
}
const ks = ({
  name: e,
  control: r,
  label: n,
  defaultValue: t,
  disabled: o,
  required: s,
  dataTestId: i
}) => /* @__PURE__ */ a(
  K,
  {
    name: e,
    control: r,
    defaultValue: t,
    render: ({ field: c, fieldState: d }) => /* @__PURE__ */ k(je, { dateAdapter: Ve, children: [
      /* @__PURE__ */ a(
        Lr,
        {
          ...c,
          format: "YYYY-MM-DD",
          disabled: o,
          isError: !!d.error,
          label: n,
          slotProps: {
            field: {
              sx: {
                mt: 1
              }
            },
            textField: {
              required: s,
              InputLabelProps: {
                size: "small",
                sx: {
                  mb: 1
                }
              },
              InputProps: {
                size: "small"
              },
              inputProps: {
                "data-testid": i
              }
            }
          }
        }
      ),
      d.error && /* @__PURE__ */ a(kr, { error: !0, children: d.error.message })
    ] })
  }
), ws = ({
  name: e,
  control: r,
  label: n,
  defaultValue: t,
  disabled: o,
  required: s,
  dataTestId: i
}) => /* @__PURE__ */ a(
  K,
  {
    name: e,
    control: r,
    defaultValue: t,
    render: ({ field: c, fieldState: d }) => {
      const u = () => /* @__PURE__ */ a($r, { sx: { ml: "14px" }, required: s, children: n });
      return /* @__PURE__ */ k(je, { dateAdapter: Ve, children: [
        /* @__PURE__ */ a(
          wr,
          {
            ...c,
            format: "YYYY-MM-DD HH:mm",
            isError: !!d.error,
            label: u(),
            ampm: !1,
            disabled: o,
            slotProps: {
              textField: {
                InputLabelProps: {
                  size: "small"
                },
                InputProps: {
                  size: "small"
                },
                inputProps: {
                  "data-testid": i
                }
              }
            }
          }
        ),
        d.error && /* @__PURE__ */ a(Er, { error: !0, children: d.error.message })
      ] });
    }
  }
), Es = ({
  name: e,
  label: r,
  control: n,
  defaultValue: t,
  options: o,
  errorMessage: s,
  required: i,
  disabled: c,
  dataTestId: d
}) => {
  const u = Te();
  return /* @__PURE__ */ a(
    K,
    {
      name: e,
      control: n,
      defaultValue: t,
      render: ({ field: f, fieldState: m }) => {
        var v;
        const b = s || ((v = m.error) == null ? void 0 : v.message);
        return /* @__PURE__ */ k(xe, { ...f, component: "fieldset", "data-testid": d, children: [
          r && /* @__PURE__ */ a(_r, { required: i, children: r }),
          /* @__PURE__ */ a(H, { mt: r ? "6px" : "0", children: o.map((T, h) => {
            const p = f.value === T.value;
            return /* @__PURE__ */ a(
              Yr,
              {
                label: T.label,
                disabled: T.disabled || c,
                clickable: !0,
                variant: p ? "filled" : "outlined",
                color: p ? "primary" : "default",
                onClick: () => f.onChange(T.value),
                isFirst: h === 0,
                isActive: p,
                role: "chip",
                "data-active": p
              },
              String(T.value)
            );
          }) }),
          b && /* @__PURE__ */ a(q, { fontSize: "12px", color: u.palette.error.main, children: b })
        ] });
      }
    }
  );
};
function $s({
  isLoading: e,
  placeholder: r,
  search: n,
  setSearch: t,
  onChange: o,
  width: s = "435px"
}) {
  const i = Te(), c = Tt(() => e ? /* @__PURE__ */ a(
    dr,
    {
      size: 18,
      sx: { color: i.palette.primary.main }
    }
  ) : n ? /* @__PURE__ */ a(
    pe,
    {
      sx: { padding: 0 },
      size: "small",
      onClick: () => t(""),
      children: /* @__PURE__ */ a(cn, { sx: { color: i.palette.primary.main } })
    }
  ) : /* @__PURE__ */ a(hn, { sx: { color: i.palette.grey[100] } }), [e, n, t, i]);
  return /* @__PURE__ */ a(xe, { sx: { width: s }, variant: "standard", children: /* @__PURE__ */ a(
    zr,
    {
      value: n,
      onChange: (d) => {
        o && o(), t(d.target.value);
      },
      placeholder: r,
      disableUnderline: !0,
      endAdornment: /* @__PURE__ */ a(ht, { position: "end", children: c })
    }
  ) });
}
var Ue = {}, Un = re;
Object.defineProperty(Ue, "__esModule", {
  value: !0
});
var Nt = Ue.default = void 0, Hn = Un(ie()), Wn = te;
Nt = Ue.default = (0, Hn.default)(/* @__PURE__ */ (0, Wn.jsx)("path", {
  d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
}), "Clear");
const _s = ({
  name: e,
  control: r,
  label: n,
  defaultValue: t,
  options: o,
  errorMessage: s,
  multiple: i,
  disabled: c,
  required: d,
  dataTestId: u,
  renderValue: f,
  onChange: m,
  variant: b = "standard",
  size: v = "small",
  clearable: T
}) => /* @__PURE__ */ a(
  K,
  {
    name: e,
    control: r,
    defaultValue: t ?? (i ? [] : void 0),
    render: ({ field: p, fieldState: g }) => {
      var D;
      const y = s || ((D = g.error) == null ? void 0 : D.message), M = (C, w) => {
        p.onChange(C, w), m == null || m(C, w);
      }, S = i ? !!p.value.length : !!p.value, O = T && S;
      return /* @__PURE__ */ k(Nr, { variant: b, size: v, fullWidth: !0, children: [
        /* @__PURE__ */ a(
          ft,
          {
            id: `select-standard-label-${n}`,
            error: !!y,
            required: d,
            children: n
          }
        ),
        /* @__PURE__ */ a(
          pt,
          {
            ...p,
            onChange: M,
            multiple: i,
            required: d,
            id: `select-standard-${n}`,
            labelId: `select-standard-label-${n}`,
            label: n,
            error: !!y,
            disabled: c,
            "data-testid": u,
            value: p.value || (i ? [] : ""),
            renderValue: f,
            endAdornment: O ? /* @__PURE__ */ a(H, { position: "relative", children: /* @__PURE__ */ a(H, { position: "absolute", top: 0, right: 10, children: /* @__PURE__ */ a(
              ht,
              {
                sx: { marginRight: "10px" },
                position: "end",
                children: /* @__PURE__ */ a(
                  pe,
                  {
                    onClick: () => p.onChange(i ? [] : null),
                    size: v,
                    children: /* @__PURE__ */ a(Nt, { fontSize: "inherit" })
                  }
                )
              }
            ) }) }) : null,
            children: o.map((C) => /* @__PURE__ */ a(
              A,
              {
                value: C.value,
                disabled: C.disabled,
                children: C.label
              },
              C.value
            ))
          }
        ),
        y && /* @__PURE__ */ a(Ie, { error: !!y, children: y })
      ] });
    }
  }
), Ys = ({
  name: e,
  control: r,
  label: n,
  defaultValue: t,
  disabled: o,
  required: s,
  dataTestId: i
}) => /* @__PURE__ */ a(
  K,
  {
    name: e,
    control: r,
    defaultValue: t,
    render: ({ field: c, fieldState: d }) => /* @__PURE__ */ k(je, { dateAdapter: Ve, children: [
      /* @__PURE__ */ a(
        Ir,
        {
          ...c,
          disabled: o,
          format: "HH:mm",
          isError: !!d.error,
          label: n,
          slotProps: {
            field: {
              sx: {
                mt: 1
              }
            },
            textField: {
              required: s,
              InputLabelProps: {
                size: "small",
                sx: {
                  mb: 1
                }
              },
              InputProps: {
                size: "small"
              },
              inputProps: {
                "data-testid": i
              }
            }
          }
        }
      ),
      d.error && /* @__PURE__ */ a(jr, { error: !0, children: d.error.message })
    ] })
  }
);
function It(e, r) {
  const [n, t] = F(
    e !== void 0 ? e : r
  );
  return Ce(() => {
    e !== void 0 && t(e);
  }, [e]), n;
}
var He = {}, Gn = re;
Object.defineProperty(He, "__esModule", {
  value: !0
});
var jt = He.default = void 0, qn = Gn(ie()), Zn = te;
jt = He.default = (0, qn.default)(/* @__PURE__ */ (0, Zn.jsx)("path", {
  d: "M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zm-1-4-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5z"
}), "FileDownloadOutlined");
const Xn = (e) => {
  const [r, n] = F(null), t = !!r, o = (f) => {
    n(f.currentTarget);
  }, s = () => {
    n(null);
  }, i = () => {
    e.gridApiRef.current.exportDataAsPrint(), s();
  }, c = () => {
    var f;
    (f = e.exportDataAsExcel) == null || f.call(e, e.gridApiRef), s();
  }, d = () => {
    e.gridApiRef.current.exportDataAsCsv(), s();
  }, u = Te();
  return /* @__PURE__ */ k(H, { children: [
    /* @__PURE__ */ a(
      ut,
      {
        id: "export-button",
        startIcon: /* @__PURE__ */ a(jt, {}),
        "aria-controls": t ? "export-menu" : void 0,
        "aria-haspopup": "true",
        "aria-expanded": t ? "true" : void 0,
        onClick: o,
        size: "small",
        sx: {
          // match other buttons color
          color: u.palette.dataGrid.primary
        },
        children: "Eksportuj"
      }
    ),
    /* @__PURE__ */ k(
      Ar,
      {
        id: "export-menu",
        anchorEl: r,
        open: t,
        onClose: s,
        MenuListProps: {
          "aria-labelledby": "exportButton-button"
        },
        children: [
          /* @__PURE__ */ a(A, { onClick: d, children: "Pobierz jako plik CSV" }),
          e.exportDataAsExcel && /* @__PURE__ */ a(A, { onClick: c, children: "Pobierz jako plik EXCEL" }),
          /* @__PURE__ */ a(A, { onClick: i, children: "Drukuj" })
        ]
      }
    )
  ] });
}, At = (e) => /* @__PURE__ */ k(no, { children: [
  /* @__PURE__ */ a(so, {}),
  e.isFilterActive && /* @__PURE__ */ a(io, {}),
  /* @__PURE__ */ a(ao, {}),
  /* @__PURE__ */ a(
    Xn,
    {
      gridApiRef: e.gridApiRef,
      exportDataAsExcel: e.exportDataAsExcel
    }
  )
] }), zs = ({
  rowsData: e,
  isLoading: r,
  gridApiRef: n,
  exportDataAsExcel: t,
  slotProps: o,
  ...s
}) => {
  const i = Tt(
    () => ({
      ...o,
      toolbar: {
        ...o == null ? void 0 : o.toolbar,
        gridApiRef: n,
        exportDataAsExcel: t,
        isFilterActive: !!s.filterModel
      }
    }),
    [t, s.filterModel, n, o]
  ), c = It(e == null ? void 0 : e.total_elements, 0);
  return /* @__PURE__ */ a(
    xt,
    {
      apiRef: n,
      loading: r,
      localeText: mt,
      rows: (e == null ? void 0 : e.content) || [],
      slots: {
        // @ts-expect-error missing props passed below
        toolbar: At
      },
      slotProps: i,
      sortingMode: "server",
      pagination: !0,
      paginationMode: "server",
      showFirstButton: !0,
      showLastButton: !0,
      pageSizeOptions: [10, 20, 30, 40, 50],
      filterMode: "server",
      filterDebounceMs: 500,
      filter: !0,
      rowCount: c,
      ...s
    }
  );
}, Jn = (e, r) => {
  const [n, t] = F(_e(e)), o = me(() => {
    var s;
    if ((s = r == null ? void 0 : r.current) != null && s.exportState && localStorage) {
      const i = r.current.exportState();
      Kn(e, i);
    }
  }, [r, e]);
  return Ce(() => () => {
    o();
  }), vt(() => (t(_e(e)), window.addEventListener("beforeunload", o), () => {
    window.removeEventListener("beforeunload", o), o();
  }), [o, e]), n;
};
function Kn(e, r) {
  try {
    e && localStorage.setItem(e, JSON.stringify(r));
  } catch {
  }
}
function _e(e) {
  try {
    return Qn(e);
  } catch {
    return {};
  }
}
function Qn(e) {
  try {
    if (e) {
      const r = localStorage.getItem(e);
      if (r)
        return JSON.parse(r);
    }
    return {};
  } catch {
    return {};
  }
}
const Ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  getGridInitialStateFromStorage: _e,
  useGridInitialState: Jn
}, Symbol.toStringTag, { value: "Module" })), Is = ({ label: e, children: r, required: n, errorMessage: t }) => /* @__PURE__ */ k(Rr, { error: !!t, children: [
  /* @__PURE__ */ a(Br, { error: !!t, required: n, children: e }),
  r,
  t && /* @__PURE__ */ a(Ie, { error: !0, children: t })
] }), js = ({
  direction: e,
  children: r,
  isOpen: n,
  customCloseWidth: t = 0,
  customCloseHeight: o = 0,
  customOpenWidth: s
}) => {
  const [i, c] = F("auto"), d = to(null), u = s || 300;
  Ce(() => {
    d.current && c(d.current.scrollHeight);
  }, [r]);
  const f = () => e === "horizontal" ? n ? u : t : "auto", m = () => e === "vertical" ? n ? i : o : "auto";
  return /* @__PURE__ */ a(Fr, { width: f(), height: m(), children: /* @__PURE__ */ a(Vr, { ref: d, children: r }) });
}, As = ({
  options: e,
  label: r,
  placeholder: n,
  size: t = "small",
  required: o,
  testId: s,
  value: i,
  getOptionLabel: c,
  ...d
}) => /* @__PURE__ */ a(
  Ur,
  {
    value: i,
    options: e,
    size: t,
    "data-testid": s,
    "data-testId": s,
    getOptionLabel: (u) => u == null ? "" : typeof u == "string" ? u : c ? c(u) : String(u),
    renderInput: (u) => /* @__PURE__ */ a(
      dt,
      {
        ...u,
        label: r,
        size: t,
        placeholder: n,
        required: o
      }
    ),
    ...d
  }
), Rs = ({
  sx: e,
  errorMessage: r,
  ...n
}) => /* @__PURE__ */ a(xe, { variant: "standard", children: /* @__PURE__ */ a(
  Hr,
  {
    variant: "standard",
    sx: e,
    error: !!r,
    helperText: r,
    ...n
  }
) }), Bs = ({
  id: e,
  value: r,
  label: n,
  onChange: t,
  menuItems: o,
  disabled: s
}) => /* @__PURE__ */ k(xe, { variant: "standard", children: [
  /* @__PURE__ */ a(ft, { id: e, children: n }),
  /* @__PURE__ */ a(
    pt,
    {
      id: e,
      value: r,
      onChange: (i) => t(i.target.value),
      label: n,
      labelId: e,
      disabled: s,
      children: o.map(({ value: i, label: c }) => /* @__PURE__ */ a(A, { value: i, children: c }, i))
    }
  )
] }), Fs = ({
  steps: e,
  activeStep: r,
  setActiveStep: n,
  stepsContent: t,
  noHeader: o
}) => {
  const s = (i) => () => n(i);
  return /* @__PURE__ */ k(at, { children: [
    /* @__PURE__ */ a(Wr, { noHeader: o, activeStep: r, children: e.map(({ label: i, value: c }) => /* @__PURE__ */ a(Lt, { children: /* @__PURE__ */ a(Gr, { disableRipple: !0, onClick: s(c), children: i }) }, i)) }),
    t == null ? void 0 : t[r]
  ] });
};
function Vs({
  children: e,
  top: r = "0",
  withBoxShadow: n,
  ...t
}) {
  const o = an("main");
  return /* @__PURE__ */ a(
    qr,
    {
      ...t,
      top: r,
      isScrolled: o > 25,
      withBoxShadow: n,
      "data-testid": "sticky-container",
      children: /* @__PURE__ */ a(Ne, { pr: o > 25 ? "12px" : "0", children: e })
    }
  );
}
const Us = (e) => {
  const r = {
    vertical: "bottom",
    horizontal: "right"
  }, n = {
    vertical: "top",
    horizontal: "right"
  };
  return /* @__PURE__ */ a(Zr.Provider, { value: { onClose: e.onClose }, children: /* @__PURE__ */ a(
    Xr,
    {
      anchorOrigin: r,
      transformOrigin: n,
      onClick: (t) => t.stopPropagation(),
      ...e
    }
  ) });
};
function Hs(e) {
  const r = Jr(), n = () => {
    var o;
    (o = r == null ? void 0 : r.onClose) == null || o.call(r);
  };
  return es(e) ? /* @__PURE__ */ a(
    A,
    {
      disabled: e.disabled,
      component: fo,
      to: e.to,
      onClick: n,
      children: e.children
    }
  ) : /* @__PURE__ */ a(A, { onClick: (o) => {
    var s;
    (s = e.onClick) == null || s.call(e, o), n();
  }, disabled: e.disabled, children: /* @__PURE__ */ a(Pt, { children: e.children }) });
}
function es(e) {
  return e instanceof Object && "to" in e;
}
var We = {}, ts = re;
Object.defineProperty(We, "__esModule", {
  value: !0
});
var Rt = We.default = void 0, rs = ts(ie()), os = te;
Rt = We.default = (0, rs.default)(/* @__PURE__ */ (0, os.jsx)("path", {
  d: "M3 21h3.75L17.81 9.94l-3.75-3.75L3 17.25zm2-2.92 9.06-9.06.92.92L5.92 19H5zM18.37 3.29a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41z"
}), "ModeEditOutlineOutlined");
const Ws = (e) => /* @__PURE__ */ k(Ne, { direction: "row", display: "inline-flex", children: [
  e.onEdit && /* @__PURE__ */ a(H, { children: /* @__PURE__ */ a(
    pe,
    {
      onClick: e.onEdit,
      title: "Edytuj",
      size: "small",
      "data-testid": "edit-button",
      children: /* @__PURE__ */ a(Rt, { fontSize: "inherit" })
    }
  ) }),
  e.onDelete && /* @__PURE__ */ a(H, { children: /* @__PURE__ */ a(
    pe,
    {
      onClick: e.onDelete,
      title: "Usuń",
      size: "small",
      "data-testid": "delete-button",
      children: /* @__PURE__ */ a(Kr, { fontSize: "inherit" })
    }
  ) })
] }), Gs = ({ children: e, loading: r }) => e, qs = ({
  rowsData: e,
  paginationAndSortState: r,
  setPaginationAndSortState: n,
  isLoading: t,
  columns: o,
  offset: s,
  tableKey: i,
  filterModel: c,
  onFilterModelChange: d,
  pinnedColumns: u,
  exportDataAsExcel: f,
  showPaginationFirstAndLastButtons: m = !1
}) => {
  const b = lo(), { state: v } = sn(i, b), [T, h] = F({
    page: r.page,
    pageSize: r.size
  }), p = [
    {
      field: r.sort.field || "",
      sort: r.sort.direction || "asc"
    }
  ], g = () => {
    var D, C;
    const O = b.current.getSortModel();
    n({
      ...r,
      sort: {
        field: ((D = O[0]) == null ? void 0 : D.field) || "",
        direction: ((C = O[0]) == null ? void 0 : C.sort) || ""
      }
    });
  }, y = (O) => {
    n({
      ...r,
      page: O.page,
      size: O.pageSize
    }), h(O);
  }, M = () => {
    var O, D;
    return {
      ...v,
      sorting: {
        sortModel: p
      },
      pagination: {
        paginationModel: {
          pageSize: r.size,
          page: r.page
        }
      },
      pinnedColumns: {
        left: [
          ...((O = v == null ? void 0 : v.pinnedColumns) == null ? void 0 : O.left) || [],
          ...(u == null ? void 0 : u.left) || []
        ],
        right: [
          ...((D = v == null ? void 0 : v.pinnedColumns) == null ? void 0 : D.right) || [],
          ...(u == null ? void 0 : u.right) || []
        ]
      }
    };
  }, S = It(e == null ? void 0 : e.total_elements, 0);
  return /* @__PURE__ */ a(Qr, { offset: s, children: /* @__PURE__ */ a(
    xt,
    {
      loading: t,
      apiRef: b,
      localeText: mt,
      rows: (e == null ? void 0 : e.content) || [],
      columns: o,
      initialState: M(),
      slots: {
        // @ts-expect-error missing props passed below
        toolbar: At
      },
      slotProps: {
        toolbar: {
          gridApiRef: b,
          exportDataAsExcel: f,
          isFilterActive: !!c
        },
        pagination: {
          showFirstButton: m,
          showLastButton: m
        }
      },
      sortingMode: "server",
      onSortModelChange: g,
      pagination: !0,
      paginationMode: "server",
      rowCount: S,
      paginationModel: T,
      showFirstButton: !0,
      showLastButton: !0,
      onPaginationModelChange: y,
      pageSizeOptions: [10, 20, 30, 40, 50],
      filterMode: "server",
      filterModel: c,
      filterDebounceMs: 500,
      onFilterModelChange: d
    }
  ) });
}, Zs = (e, r) => {
  gt.custom(
    (n) => /* @__PURE__ */ k(bt, { type: "info", children: [
      /* @__PURE__ */ a(dn, {}),
      /* @__PURE__ */ a(yt, { message: e, id: n.id })
    ] }),
    r
  );
}, Xs = (e, r) => {
  gt.custom(
    (n) => /* @__PURE__ */ k(bt, { type: "success", children: [
      /* @__PURE__ */ a(ln, {}),
      /* @__PURE__ */ a(yt, { message: e, id: n.id })
    ] }),
    r
  );
};
function ns() {
  return co().filter(
    (e) => e.value !== "isAnyOf"
  );
}
function Js(e) {
  return {
    type: "boolean",
    filterOperators: ns(),
    renderCell: ({ value: r }) => /* @__PURE__ */ a(mo, { checked: r, disabled: !0 }),
    ...e
  };
}
function Ks(e) {
  return {
    type: "date",
    valueGetter: (r) => r && P(r).toDate(),
    renderCell: ({ value: r }) => r ? as(P(r)) : "-",
    ...e
  };
}
function Qs(e) {
  return {
    type: "dateTime",
    valueGetter: (r) => r && P(r).toDate(),
    renderCell: ({ value: r }) => r ? ls(P(r)) : "-",
    ...e
  };
}
function ss() {
  return uo().filter(
    (e) => e.value !== "isAnyOf"
  );
}
function ei(e) {
  return {
    type: "number",
    filterOperators: ss(),
    renderCell: ({ value: r }) => pn(r) ? r : "-",
    ...e
  };
}
function ti(e) {
  return {
    ...e,
    sortable: !1,
    filterable: !1,
    resizable: !1
  };
}
function is() {
  return ho().filter(
    (e) => e.value !== "isAnyOf"
  );
}
function ri(e) {
  return {
    type: "string",
    filterOperators: is(),
    renderCell: ({ value: r }) => r || "-",
    ...e
  };
}
const as = (e) => {
  if (e) {
    if (P.isDayjs(e))
      return e.format("YYYY-MM-DD");
    console.error("Unable to format date, as it is not dayjs instance");
  }
}, ls = (e) => {
  if (e) {
    if (P.isDayjs(e))
      return e.format("YYYY-MM-DD HH:mm:ss");
    console.error("Unable to format dateTime, as it is not dayjs instance");
  }
}, cs = () => /* @__PURE__ */ a(
  eo,
  {
    position: "top-right",
    toastOptions: {
      duration: 8e3
    }
  }
), oi = ({
  children: e
}) => /* @__PURE__ */ k(at, { children: [
  /* @__PURE__ */ a(cs, {}),
  e
] });
export {
  ci as ACCEPTED_FILE_TYPES,
  xs as Accordion,
  Cs as AccordionDetails,
  Ms as AccordionSummary,
  di as Autocomplete,
  ee as Button,
  Os as ButtonAdd,
  nn as ButtonWithIcon,
  Us as ContextMenu,
  Hs as ContextMenuItem,
  kn as ContextualSearch,
  Ls as ContextualSearchControlled,
  ks as DatePicker,
  ws as DateTimePicker,
  ui as Dialog,
  ii as Drawer,
  hi as Dropzone,
  fi as DropzoneField,
  pi as ElementsPicker,
  Ds as ElementsPickerElement,
  Ps as FixedActionsBottomPanel,
  oi as GemUIComponentsProvider,
  zs as Grid,
  Ns as GridInitialState,
  mi as Input,
  ai as LoadingBackdrop,
  Is as MuiLikeWrapper,
  Es as RadioChips,
  js as ResizableWrapper,
  $s as SearchInput,
  _s as Select,
  As as SimpleAutocomplete,
  Rs as SimpleInput,
  Bs as SimpleSelect,
  Fs as Stepper,
  Vs as StickyContainer,
  Ws as TableActions,
  Gs as TableRecord,
  qs as TableWithPagination,
  gi as TabsPanel,
  Mo as ThemeProvider,
  Ys as TimePicker,
  Oi as Tree,
  q as Typography,
  bi as UPLOADED_FILE_MAX_SIZE,
  yi as errorToast,
  as as formatDate,
  ls as formatDateTime,
  Js as getBooleanColumn,
  Ks as getDateColumn,
  Qs as getDateTimeColumn,
  vi as getErrorMessage,
  ei as getNumericColumn,
  ti as getStaticColumn,
  ri as getStringColumn,
  Zs as infoToast,
  R as styled,
  Xs as successToast,
  Ti as theme,
  Ss as useContextMenu,
  sn as useDataGridState,
  xi as useGetFileUrl,
  an as useScrollPosition,
  Te as useTheme
};
