import ee, { jsx as c, jsxs as k, Fragment as nt } from "react/jsx-runtime";
import { L as te, P as a, _ as x, Z as Vt, $ as Ut, a0 as Ht, a1 as Gt, w as z, T as He, Y as Wt, a2 as qt, l as Zt, a3 as Xt, q as be, p as ye, r as R, v as Z, j as Jt, y as X, a as Kt, a4 as Qt, z as J, E as Ye, b as N, F as Ne, J as er, a5 as tr, a6 as rr, M as q, U as or, a7 as nr, x as ve, e as Te, K as H, a8 as sr, S as ze, a9 as re, aa as oe, N as he } from "./Stack-ThmeJzqr.js";
import { r as ne, e as st, P as it, i as ir, C as ar } from "./Drawer-d8461jqd.js";
import { D as Ks, L as Qs } from "./Drawer-d8461jqd.js";
import { A as lr, l as Ge, L as cr, g as dr, S as ur, a as fr, t as We, T as hr, b as pr, c as mr, d as gr, e as br, B as Q, f as yr, G as vr, i as Tr, h as xr, F as Cr, j as Mr, k as at, M as A, m as lt, n as ct, C as se, o as P, w as Or, p as dt, q as Sr, r as Dr, s as Pr, u as Lr, v as wr, x as xe, y as kr, z as Er, D as $r, I as ut, E as _r, H as ft, J as ht, K as Yr, N as pt, O as Nr, P as zr, Q as jr, R as Ir, U as Ar, V as Rr, W as Br, X as Fr, Y as Vr, Z as Ur, _ as Hr, $ as Gr, a0 as Wr, a1 as qr, a2 as Zr, a3 as Xr } from "./theme-CWNmI1fJ.js";
import { a7 as ti, ad as ri, a4 as oi, a9 as ni, aa as si, ab as ii, ac as ai, a5 as li, a8 as ci, ae as di, ag as ui, a6 as fi, af as hi } from "./theme-CWNmI1fJ.js";
import * as L from "react";
import { useState as F, useCallback as pe, useLayoutEffect as mt, useEffect as Ce, useMemo as gt, useRef as Jr } from "react";
import { b as ce } from "./useFormControl-Cj8rSR6R.js";
import Kr, { createPortal as Qr } from "react-dom";
import { GridToolbarContainer as eo, GridToolbarColumnsButton as to, GridToolbarFilterButton as ro, GridToolbarDensitySelector as oo, DataGridPro as bt, useGridApiRef as no, getGridBooleanOperators as so, getGridNumericOperators as io, getGridStringOperators as ao } from "@mui/x-data-grid-pro";
export * from "@mui/x-data-grid-pro";
import { Link as lo } from "react-router-dom";
import { C as co, a as uo } from "./Tree-D_Zjc1fk.js";
import { T as gi } from "./Tree-D_Zjc1fk.js";
var je = {}, fo = te;
Object.defineProperty(je, "__esModule", {
  value: !0
});
var yt = je.default = void 0, ho = fo(ne()), po = ee;
yt = je.default = (0, ho.default)(/* @__PURE__ */ (0, po.jsx)("path", {
  d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
}), "ExpandMore");
const Ie = /* @__PURE__ */ L.createContext(null);
process.env.NODE_ENV !== "production" && (Ie.displayName = "ThemeContext");
function vt() {
  const e = L.useContext(Ie);
  return process.env.NODE_ENV !== "production" && L.useDebugValue(e), e;
}
const mo = typeof Symbol == "function" && Symbol.for, go = mo ? Symbol.for("mui.nested") : "__THEME_NESTED__";
function bo(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 me(e) {
  const {
    children: r,
    theme: n
  } = e, t = vt();
  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 : bo(t, n);
    return s != null && (s[go] = t !== null), s;
  }, [n, t]);
  return /* @__PURE__ */ c(Ie.Provider, {
    value: o,
    children: r
  });
}
process.env.NODE_ENV !== "production" && (me.propTypes = {
  /**
   * Your component tree.
   */
  children: a.node,
  /**
   * A theme object. You can provide a function to extend the outer theme.
   */
  theme: a.oneOfType([a.object, a.func]).isRequired
});
process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "production" && (me.propTypes = st(me.propTypes));
const qe = {};
function Ze(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 ge(e) {
  const {
    children: r,
    theme: n,
    themeId: t
  } = e, o = Vt(qe), s = vt() || qe;
  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 = Ze(t, o, n), l = Ze(t, s, n, !0), d = i.direction === "rtl";
  return /* @__PURE__ */ c(me, {
    theme: l,
    children: /* @__PURE__ */ c(Ut.Provider, {
      value: i,
      children: /* @__PURE__ */ c(Ht, {
        value: d,
        children: /* @__PURE__ */ c(Gt, {
          value: i == null ? void 0 : i.components,
          children: r
        })
      })
    })
  });
}
process.env.NODE_ENV !== "production" && (ge.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: a.node,
  /**
   * A theme object. You can provide a function to extend the outer theme.
   */
  theme: a.oneOfType([a.func, a.object]).isRequired,
  /**
   * The design system's unique id for getting the corresponded theme when there are multiple design systems.
   */
  themeId: a.string
});
process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "production" && (ge.propTypes = st(ge.propTypes));
const yo = ["theme"];
function vo(e) {
  let {
    theme: r
  } = e, n = z(e, yo);
  const t = r[He];
  return /* @__PURE__ */ c(ge, x({}, n, {
    themeId: t ? He : void 0,
    theme: t || r
  }));
}
process.env.NODE_ENV !== "production" && (vo.propTypes = {
  /**
   * Your component tree.
   */
  children: a.node,
  /**
   * A theme object. You can provide a function to extend the outer theme.
   */
  theme: a.oneOfType([a.object, a.func]).isRequired
});
const To = ["className", "elementType", "ownerState", "externalForwardedProps", "getSlotOwnerState", "internalForwardedProps"], xo = ["component", "slots", "slotProps"], Co = ["component"];
function Mo(e, r) {
  const {
    className: n,
    elementType: t,
    ownerState: o,
    externalForwardedProps: s,
    getSlotOwnerState: i,
    internalForwardedProps: l
  } = r, d = z(r, To), {
    component: u,
    slots: h = {
      [e]: void 0
    },
    slotProps: m = {
      [e]: void 0
    }
  } = s;
  z(s, xo);
  const b = h[e] || t, v = Wt(m[e], o), T = qt(x({
    className: n
  }, d, {
    externalForwardedProps: void 0,
    externalSlotProps: v
  })), {
    props: {
      component: f
    },
    internalRef: p
  } = T, g = z(T.props, Co), y = Zt(p, v == null ? void 0 : v.ref, r.ref), M = i ? i(g) : {}, S = x({}, o, M), O = f, D = Xt(b, x({}, e === "root", !h[e] && l, g, O && {
    as: O
  }, {
    ref: y
  }), S);
  return Object.keys(M).forEach((C) => {
    delete D[C];
  }), [b, D];
}
function Oo(e) {
  return ye("MuiAccordion", e);
}
const de = be("MuiAccordion", ["root", "rounded", "expanded", "disabled", "gutters", "region"]), So = ["children", "className", "defaultExpanded", "disabled", "disableGutters", "expanded", "onChange", "square", "slots", "slotProps", "TransitionComponent", "TransitionProps"], Do = (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"]
  }, Oo, r);
}, Po = R(it, {
  name: "MuiAccordion",
  slot: "Root",
  overridesResolver: (e, r) => {
    const {
      ownerState: n
    } = e;
    return [{
      [`& .${de.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"
      }
    },
    [`&.${de.expanded}`]: {
      "&::before": {
        opacity: 0
      },
      "&:first-of-type": {
        marginTop: 0
      },
      "&:last-of-type": {
        marginBottom: 0
      },
      "& + &": {
        "&::before": {
          display: "none"
        }
      }
    },
    [`&.${de.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: {
      [`&.${de.expanded}`]: {
        margin: "16px 0"
      }
    }
  }]
})), Tt = /* @__PURE__ */ L.forwardRef(function(r, n) {
  const t = Z({
    props: r,
    name: "MuiAccordion"
  }), {
    children: o,
    className: s,
    defaultExpanded: i = !1,
    disabled: l = !1,
    disableGutters: d = !1,
    expanded: u,
    onChange: h,
    square: m = !1,
    slots: b = {},
    slotProps: v = {},
    TransitionComponent: T,
    TransitionProps: f
  } = t, p = z(t, So), [g, y] = Jt({
    controlled: u,
    default: i,
    name: "Accordion",
    state: "expanded"
  }), M = L.useCallback((I) => {
    y(!g), h && h(I, !g);
  }, [g, h, y]), [S, ...O] = L.Children.toArray(o), D = L.useMemo(() => ({
    expanded: g,
    disabled: l,
    disableGutters: d,
    toggle: M
  }), [g, l, d, M]), C = x({}, t, {
    square: m,
    disabled: l,
    disableGutters: d,
    expanded: g
  }), w = Do(C), E = x({
    transition: T
  }, b), j = x({
    transition: f
  }, v), [_, $] = Mo("transition", {
    elementType: co,
    externalForwardedProps: {
      slots: E,
      slotProps: j
    },
    ownerState: C
  });
  return /* @__PURE__ */ k(Po, x({
    className: X(w.root, s),
    ref: n,
    ownerState: C,
    square: m
  }, p, {
    children: [/* @__PURE__ */ c(lr.Provider, {
      value: D,
      children: S
    }), /* @__PURE__ */ c(_, x({
      in: g,
      timeout: "auto"
    }, $, {
      children: /* @__PURE__ */ c("div", {
        "aria-labelledby": S.props.id,
        id: S.props["aria-controls"],
        role: "region",
        className: w.region,
        children: O
      })
    }))]
  }));
});
process.env.NODE_ENV !== "production" && (Tt.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: Kt(a.node.isRequired, (e) => {
    const r = L.Children.toArray(e.children)[0];
    return Qt.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: a.object,
  /**
   * @ignore
   */
  className: a.string,
  /**
   * If `true`, expands the accordion by default.
   * @default false
   */
  defaultExpanded: a.bool,
  /**
   * If `true`, the component is disabled.
   * @default false
   */
  disabled: a.bool,
  /**
   * If `true`, it removes the margin between two expanded accordion items and the increase of height.
   * @default false
   */
  disableGutters: a.bool,
  /**
   * If `true`, expands the accordion, otherwise collapse it.
   * Setting this prop enables control over the accordion.
   */
  expanded: a.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: a.func,
  /**
   * The props used for each slot inside.
   * @default {}
   */
  slotProps: a.shape({
    transition: a.oneOfType([a.func, a.object])
  }),
  /**
   * The components used for each slot inside.
   * @default {}
   */
  slots: a.shape({
    transition: a.elementType
  }),
  /**
   * If `true`, rounded corners are disabled.
   * @default false
   */
  square: a.bool,
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: a.oneOfType([a.arrayOf(a.oneOfType([a.func, a.object, a.bool])), a.func, a.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: a.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: a.object
});
const gs = Tt;
function Lo(e) {
  return ye("MuiAccordionDetails", e);
}
be("MuiAccordionDetails", ["root"]);
const wo = ["className"], ko = (e) => {
  const {
    classes: r
  } = e;
  return J({
    root: ["root"]
  }, Lo, r);
}, Eo = R("div", {
  name: "MuiAccordionDetails",
  slot: "Root",
  overridesResolver: (e, r) => r.root
})(({
  theme: e
}) => ({
  padding: e.spacing(1, 2, 2)
})), xt = /* @__PURE__ */ L.forwardRef(function(r, n) {
  const t = Z({
    props: r,
    name: "MuiAccordionDetails"
  }), {
    className: o
  } = t, s = z(t, wo), i = t, l = ko(i);
  return /* @__PURE__ */ c(Eo, x({
    className: X(l.root, o),
    ref: n,
    ownerState: i
  }, s));
});
process.env.NODE_ENV !== "production" && (xt.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: a.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: a.object,
  /**
   * @ignore
   */
  className: a.string,
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: a.oneOfType([a.arrayOf(a.oneOfType([a.func, a.object, a.bool])), a.func, a.object])
});
const bs = xt;
function $o(e) {
  return ye("MuiLinearProgress", e);
}
be("MuiLinearProgress", ["root", "colorPrimary", "colorSecondary", "determinate", "indeterminate", "buffer", "query", "dashed", "dashedColorPrimary", "dashedColorSecondary", "bar", "barColorPrimary", "barColorSecondary", "bar1Indeterminate", "bar1Determinate", "bar1Buffer", "bar2Indeterminate", "bar2Buffer"]);
const _o = ["className", "color", "value", "valueBuffer", "variant"];
let K = (e) => e, Xe, Je, Ke, Qe, et, tt;
const Ee = 4, Yo = Ye(Xe || (Xe = K`
  0% {
    left: -35%;
    right: 100%;
  }

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

  100% {
    left: 100%;
    right: -90%;
  }
`)), No = Ye(Je || (Je = K`
  0% {
    left: -200%;
    right: 100%;
  }

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

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

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

  100% {
    opacity: 1;
    background-position: -200px -23px;
  }
`)), jo = (e) => {
  const {
    classes: r,
    variant: n,
    color: t
  } = e, o = {
    root: ["root", `color${N(t)}`, n],
    dashed: ["dashed", `dashedColor${N(t)}`],
    bar1: ["bar", `barColor${N(t)}`, (n === "indeterminate" || n === "query") && "bar1Indeterminate", n === "determinate" && "bar1Determinate", n === "buffer" && "bar1Buffer"],
    bar2: ["bar", n !== "buffer" && `barColor${N(t)}`, n === "buffer" && `color${N(t)}`, (n === "indeterminate" || n === "query") && "bar2Indeterminate", n === "buffer" && "bar2Buffer"]
  };
  return J(o, $o, r);
}, Ae = (e, r) => r === "inherit" ? "currentColor" : e.vars ? e.vars.palette.LinearProgress[`${r}Bg`] : e.palette.mode === "light" ? tr(e.palette[r].main, 0.62) : rr(e.palette[r].main, 0.5), Io = R("span", {
  name: "MuiLinearProgress",
  slot: "Root",
  overridesResolver: (e, r) => {
    const {
      ownerState: n
    } = e;
    return [r.root, r[`color${N(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: Ae(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)"
})), Ao = R("span", {
  name: "MuiLinearProgress",
  slot: "Dashed",
  overridesResolver: (e, r) => {
    const {
      ownerState: n
    } = e;
    return [r.dashed, r[`dashedColor${N(n.color)}`]];
  }
})(({
  ownerState: e,
  theme: r
}) => {
  const n = Ae(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"
  });
}, Ne(Qe || (Qe = K`
    animation: ${0} 3s infinite linear;
  `), zo)), Ro = R("span", {
  name: "MuiLinearProgress",
  slot: "Bar1",
  overridesResolver: (e, r) => {
    const {
      ownerState: n
    } = e;
    return [r.bar, r[`barColor${N(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") && Ne(et || (et = K`
      width: auto;
      animation: ${0} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
    `), Yo)), Bo = R("span", {
  name: "MuiLinearProgress",
  slot: "Bar2",
  overridesResolver: (e, r) => {
    const {
      ownerState: n
    } = e;
    return [r.bar, r[`barColor${N(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: Ae(r, e.color),
  transition: `transform .${Ee}s linear`
}), ({
  ownerState: e
}) => (e.variant === "indeterminate" || e.variant === "query") && Ne(tt || (tt = K`
      width: auto;
      animation: ${0} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
    `), No)), Ct = /* @__PURE__ */ L.forwardRef(function(r, n) {
  const t = Z({
    props: r,
    name: "MuiLinearProgress"
  }), {
    className: o,
    color: s = "primary",
    value: i,
    valueBuffer: l,
    variant: d = "indeterminate"
  } = t, u = z(t, _o), h = x({}, t, {
    color: s,
    variant: d
  }), m = jo(h), b = er(), 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 f = i - 100;
      b && (f = -f), T.bar1.transform = `translateX(${f}%)`;
    } 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 (l !== void 0) {
      let f = (l || 0) - 100;
      b && (f = -f), T.bar2.transform = `translateX(${f}%)`;
    } 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(Io, x({
    className: X(m.root, o),
    ownerState: h,
    role: "progressbar"
  }, v, {
    ref: n
  }, u, {
    children: [d === "buffer" ? /* @__PURE__ */ c(Ao, {
      className: m.dashed,
      ownerState: h
    }) : null, /* @__PURE__ */ c(Ro, {
      className: m.bar1,
      ownerState: h,
      style: T.bar1
    }), d === "determinate" ? null : /* @__PURE__ */ c(Bo, {
      className: m.bar2,
      ownerState: h,
      style: T.bar2
    })]
  }));
});
process.env.NODE_ENV !== "production" && (Ct.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: a.object,
  /**
   * @ignore
   */
  className: a.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: a.oneOfType([a.oneOf(["inherit", "primary", "secondary"]), a.string]),
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: a.oneOfType([a.arrayOf(a.oneOfType([a.func, a.object, a.bool])), a.func, a.object]),
  /**
   * The value of the progress indicator for the determinate and buffer variants.
   * Value between 0 and 100.
   */
  value: a.number,
  /**
   * The value for the buffer variant.
   * Value between 0 and 100.
   */
  valueBuffer: a.number,
  /**
   * The variant to use.
   * Use indeterminate or query when there is no progress value.
   * @default 'indeterminate'
   */
  variant: a.oneOf(["buffer", "determinate", "indeterminate", "query"])
});
const Fo = ["children", "className", "disableTypography", "inset", "primary", "primaryTypographyProps", "secondary", "secondaryTypographyProps"], Vo = (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"]
  }, dr, r);
}, Uo = R("div", {
  name: "MuiListItemText",
  slot: "Root",
  overridesResolver: (e, r) => {
    const {
      ownerState: n
    } = e;
    return [{
      [`& .${Ge.primary}`]: r.primary
    }, {
      [`& .${Ge.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
})), Mt = /* @__PURE__ */ L.forwardRef(function(r, n) {
  const t = Z({
    props: r,
    name: "MuiListItemText"
  }), {
    children: o,
    className: s,
    disableTypography: i = !1,
    inset: l = !1,
    primary: d,
    primaryTypographyProps: u,
    secondary: h,
    secondaryTypographyProps: m
  } = t, b = z(t, Fo), {
    dense: v
  } = L.useContext(cr);
  let T = d ?? o, f = h;
  const p = x({}, t, {
    disableTypography: i,
    inset: l,
    primary: !!T,
    secondary: !!f,
    dense: v
  }), g = Vo(p);
  return T != null && T.type !== q && !i && (T = /* @__PURE__ */ c(q, x({
    variant: v ? "body2" : "body1",
    className: g.primary,
    component: u != null && u.variant ? void 0 : "span",
    display: "block"
  }, u, {
    children: T
  }))), f != null && f.type !== q && !i && (f = /* @__PURE__ */ c(q, x({
    variant: "body2",
    className: g.secondary,
    color: "text.secondary",
    display: "block"
  }, m, {
    children: f
  }))), /* @__PURE__ */ k(Uo, x({
    className: X(g.root, s),
    ownerState: p,
    ref: n
  }, b, {
    children: [T, f]
  }));
});
process.env.NODE_ENV !== "production" && (Mt.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: a.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: a.object,
  /**
   * @ignore
   */
  className: a.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: a.bool,
  /**
   * If `true`, the children are indented.
   * This should be used if there is no left avatar or left icon.
   * @default false
   */
  inset: a.bool,
  /**
   * The main content element.
   */
  primary: a.node,
  /**
   * These props will be forwarded to the primary typography component
   * (as long as disableTypography is not `true`).
   */
  primaryTypographyProps: a.object,
  /**
   * The secondary content element.
   */
  secondary: a.node,
  /**
   * These props will be forwarded to the secondary typography component
   * (as long as disableTypography is not `true`).
   */
  secondaryTypographyProps: a.object,
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: a.oneOfType([a.arrayOf(a.oneOfType([a.func, a.object, a.bool])), a.func, a.object])
});
function Ho(e) {
  return ye("MuiStep", e);
}
be("MuiStep", ["root", "horizontal", "vertical", "alternativeLabel", "completed"]);
const Go = ["active", "children", "className", "component", "completed", "disabled", "expanded", "index", "last"], Wo = (e) => {
  const {
    classes: r,
    orientation: n,
    alternativeLabel: t,
    completed: o
  } = e;
  return J({
    root: ["root", n, t && "alternativeLabel", o && "completed"]
  }, Ho, r);
}, qo = 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"
})), Ot = /* @__PURE__ */ L.forwardRef(function(r, n) {
  const t = Z({
    props: r,
    name: "MuiStep"
  }), {
    active: o,
    children: s,
    className: i,
    component: l = "div",
    completed: d,
    disabled: u,
    expanded: h = !1,
    index: m,
    last: b
  } = t, v = z(t, Go), {
    activeStep: T,
    connector: f,
    alternativeLabel: p,
    orientation: g,
    nonLinear: y
  } = L.useContext(ur);
  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: h,
    icon: m + 1,
    active: M,
    completed: S,
    disabled: O
  }), [m, b, h, M, S, O]), C = x({}, t, {
    active: M,
    orientation: g,
    alternativeLabel: p,
    completed: S,
    disabled: O,
    expanded: h,
    component: l
  }), w = Wo(C), E = /* @__PURE__ */ k(qo, x({
    as: l,
    className: X(w.root, i),
    ref: n,
    ownerState: C
  }, v, {
    children: [f && p && m !== 0 ? f : null, s]
  }));
  return /* @__PURE__ */ c(fr.Provider, {
    value: D,
    children: f && !p && m !== 0 ? /* @__PURE__ */ k(L.Fragment, {
      children: [f, E]
    }) : E
  });
});
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`.     │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * Sets the step as active. Is passed to child components.
   */
  active: a.bool,
  /**
   * Should be `Step` sub-components such as `StepLabel`, `StepContent`.
   */
  children: a.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: a.object,
  /**
   * @ignore
   */
  className: a.string,
  /**
   * Mark the step as completed. Is passed to child components.
   */
  completed: a.bool,
  /**
   * The component used for the root node.
   * Either a string to use a HTML element or a component.
   */
  component: a.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: a.bool,
  /**
   * Expand the step.
   * @default false
   */
  expanded: a.bool,
  /**
   * The position of the step.
   * The prop defaults to the value inherited from the parent Stepper component.
   */
  index: ir,
  /**
   * If `true`, the Step is displayed as rendered last.
   * The prop defaults to the value inherited from the parent Stepper component.
   */
  last: a.bool,
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: a.oneOfType([a.arrayOf(a.oneOfType([a.func, a.object, a.bool])), a.func, a.object])
});
function Zo(e, r) {
  return r === void 0 || e === void 0 ? !1 : Array.isArray(r) ? r.indexOf(e) >= 0 : e === r;
}
const Xo = ["value"], Jo = ["children", "className", "color", "disabled", "disableFocusRipple", "fullWidth", "onChange", "onClick", "selected", "size", "value"], Ko = (e) => {
  const {
    classes: r,
    fullWidth: n,
    selected: t,
    disabled: o,
    size: s,
    color: i
  } = e, l = {
    root: ["root", t && "selected", o && "disabled", n && "fullWidth", `size${N(s)}`, i]
  };
  return J(l, mr, r);
}, Qo = R(or, {
  name: "MuiToggleButton",
  slot: "Root",
  overridesResolver: (e, r) => {
    const {
      ownerState: n
    } = e;
    return [r.root, r[`size${N(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%"
  }, {
    [`&.${We.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})` : ce(e.palette.text.primary, e.palette.action.hoverOpacity),
      "@media (hover: none)": {
        backgroundColor: "transparent"
      }
    },
    [`&.${We.selected}`]: {
      color: n,
      backgroundColor: e.vars ? `rgba(${t} / ${e.vars.palette.action.selectedOpacity})` : ce(n, e.palette.action.selectedOpacity),
      "&:hover": {
        backgroundColor: e.vars ? `rgba(${t} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : ce(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})` : ce(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)
  });
}), St = /* @__PURE__ */ L.forwardRef(function(r, n) {
  const t = L.useContext(hr), {
    value: o
  } = t, s = z(t, Xo), i = L.useContext(pr), l = nr(x({}, s, {
    selected: Zo(r.value, o)
  }), r), d = Z({
    props: l,
    name: "MuiToggleButton"
  }), {
    children: u,
    className: h,
    color: m = "standard",
    disabled: b = !1,
    disableFocusRipple: v = !1,
    fullWidth: T = !1,
    onChange: f,
    onClick: p,
    selected: g,
    size: y = "medium",
    value: M
  } = d, S = z(d, Jo), O = x({}, d, {
    color: m,
    disabled: b,
    disableFocusRipple: v,
    fullWidth: T,
    size: y
  }), D = Ko(O), C = (E) => {
    p && (p(E, M), E.defaultPrevented) || f && f(E, M);
  }, w = i || "";
  return /* @__PURE__ */ c(Qo, x({
    className: X(s.className, D.root, h, w),
    disabled: b,
    focusRipple: !v,
    ref: n,
    onClick: C,
    onChange: f,
    value: M,
    ownerState: O,
    "aria-pressed": g
  }, S, {
    children: u
  }));
});
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: a.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: a.object,
  /**
   * @ignore
   */
  className: a.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: a.oneOfType([a.oneOf(["standard", "primary", "secondary", "error", "info", "success", "warning"]), a.string]),
  /**
   * If `true`, the component is disabled.
   * @default false
   */
  disabled: a.bool,
  /**
   * If `true`, the  keyboard focus ripple is disabled.
   * @default false
   */
  disableFocusRipple: a.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: a.bool,
  /**
   * If `true`, the button will take up the full width of its container.
   * @default false
   */
  fullWidth: a.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: a.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: a.func,
  /**
   * If `true`, the button is rendered in an active state.
   */
  selected: a.bool,
  /**
   * The size of the component.
   * The prop defaults to the value inherited from the parent ToggleButtonGroup component.
   * @default 'medium'
   */
  size: a.oneOfType([a.oneOf(["small", "medium", "large"]), a.string]),
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: a.oneOfType([a.arrayOf(a.oneOfType([a.func, a.object, a.bool])), a.func, a.object]),
  /**
   * The value to associate with the button when selected in a
   * ToggleButtonGroup.
   */
  value: a.any.isRequired
});
const ys = ({
  isSub: e,
  ...r
}) => /* @__PURE__ */ c(e ? gr : br, { ...r, expandIcon: /* @__PURE__ */ c(yt, {}) }), vs = ({ children: e, ...r }) => /* @__PURE__ */ c(Q, { variant: "contained", startIcon: /* @__PURE__ */ c(yr, {}), ...r, children: e }), en = ({
  children: e,
  Icon: r,
  variant: n,
  width: t = "auto",
  onClick: o,
  iconPosition: s,
  ...i
}) => {
  const l = ve();
  return /* @__PURE__ */ c(
    Q,
    {
      ...i,
      variant: n,
      tabIndex: -1,
      disableRipple: !0,
      onClick: o,
      sx: {
        width: t,
        height: "36px",
        backgroundColor: n === "contained" ? l.palette.primary.main : "transparent",
        color: n === "contained" ? l.palette.common.white : l.palette.primary.main
      },
      endIcon: s === "end" && r,
      startIcon: s === "start" && r,
      children: e
    }
  );
}, Ts = () => {
  const [e, r] = F(null);
  return {
    anchorEl: e,
    open: !!e,
    handleClick: (s) => {
      s.stopPropagation(), r(s.currentTarget);
    },
    onClose: () => {
      r(null);
    }
  };
}, tn = (e, r) => {
  const n = pe(() => {
    try {
      const i = localStorage.getItem(e);
      return i ? JSON.parse(i) : {};
    } catch {
      return {};
    }
  }, [e]), [t, o] = F(
    n()
  ), s = pe(() => {
    var i;
    if ((i = r == null ? void 0 : r.current) != null && i.exportState && localStorage) {
      const l = r.current.exportState();
      localStorage.setItem(e, JSON.stringify(l));
    }
  }, [r, e]);
  return mt(() => (o(n()), window.addEventListener("beforeunload", s), () => {
    window.removeEventListener("beforeunload", s), s();
  }), [s, e, n]), {
    state: t
  };
}, rn = (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;
}, on = Te(/* @__PURE__ */ c("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"), nn = Te(/* @__PURE__ */ c("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"), sn = Te(/* @__PURE__ */ c("path", {
  d: "M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"
}), "KeyboardArrowRight"), an = Te(/* @__PURE__ */ c("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"), xs = ({
  value: e,
  children: r,
  dataTestId: n
}) => /* @__PURE__ */ c(vr, { item: !0, children: /* @__PURE__ */ c(
  St,
  {
    value: e,
    sx: { fontSize: 11, py: 0, borderRadius: 10 },
    color: "primary",
    "data-testid": n,
    children: r
  }
) });
var ln = "[object Number]";
function cn(e) {
  return typeof e == "number" || Tr(e) && xr(e) == ln;
}
function dn(e) {
  return e === void 0;
}
function Cs({
  primaryLabel: e,
  primaryLoading: r,
  primaryOnClick: n,
  secondaryLabel: t,
  secondaryLoading: o,
  secondaryOnClick: s,
  tertiaryLabel: i,
  tertiaryLoading: l,
  tertiaryIcon: d,
  tertiaryOnClick: u,
  cancelOnClick: h,
  offset: m,
  disabled: b
}) {
  return Kr.createPortal(
    /* @__PURE__ */ k(Cr, { offset: m, children: [
      h && /* @__PURE__ */ c(
        Q,
        {
          disabled: b,
          onClick: h,
          "data-testid": "bottom-panel-cancel-button",
          children: "Anuluj"
        }
      ),
      n && /* @__PURE__ */ c(
        Q,
        {
          onClick: n,
          variant: "outlined",
          loading: r,
          disabled: b,
          children: e
        }
      ),
      s && t && /* @__PURE__ */ c(
        Q,
        {
          onClick: s,
          variant: "contained",
          loading: o,
          disabled: b,
          children: t ?? ""
        }
      ),
      n && u && i && /* @__PURE__ */ c(q, { fontSize: 16, children: "lub" }),
      u && i && /* @__PURE__ */ c(
        en,
        {
          iconPosition: "end",
          onClick: u,
          Icon: dn(d) ? /* @__PURE__ */ c(sn, {}) : d,
          title: i ?? "",
          variant: "contained",
          loading: l,
          disabled: b,
          children: i ?? ""
        }
      )
    ] }),
    document.body
  );
}
var un = Object.defineProperty, fn = (e, r, n) => r in e ? un(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n, ue = (e, r, n) => fn(e, typeof r != "symbol" ? r + "" : r, n), $e = /* @__PURE__ */ new Map(), fe = /* @__PURE__ */ new WeakMap(), rt = 0, hn = void 0;
function pn(e) {
  return e ? (fe.has(e) || (rt += 1, fe.set(e, rt.toString())), fe.get(e)) : "0";
}
function mn(e) {
  return Object.keys(e).sort().filter(
    (r) => e[r] !== void 0
  ).map((r) => `${r}_${r === "root" ? pn(e.root) : e[r]}`).toString();
}
function gn(e) {
  const r = mn(e);
  let n = $e.get(r);
  if (!n) {
    const t = /* @__PURE__ */ new Map();
    let o;
    const s = new IntersectionObserver((i) => {
      i.forEach((l) => {
        var d;
        const u = l.isIntersecting && o.some((h) => l.intersectionRatio >= h);
        e.trackVisibility && typeof l.isVisible > "u" && (l.isVisible = u), (d = t.get(l.target)) == null || d.forEach((h) => {
          h(u, l);
        });
      });
    }, 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 bn(e, r, n = {}, t = hn) {
  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 } = gn(n), l = i.get(e) || [];
  return i.has(e) || i.set(e, l), l.push(r), s.observe(e), function() {
    l.splice(l.indexOf(r), 1), l.length === 0 && (i.delete(e), s.unobserve(e)), i.size === 0 && (s.disconnect(), $e.delete(o));
  };
}
function yn(e) {
  return typeof e.children != "function";
}
var vn = class extends L.Component {
  constructor(e) {
    super(e), ue(this, "node", null), ue(this, "_unobserveCb", null), ue(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();
    }), ue(this, "handleChange", (r, n) => {
      r && this.props.triggerOnce && this.unobserve(), yn(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 = bn(
      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: l,
      trackVisibility: d,
      delay: u,
      initialInView: h,
      fallbackInView: m,
      ...b
    } = this.props;
    return L.createElement(
      r || "div",
      { ref: this.handleNode, ...b },
      e
    );
  }
}, Re = {}, Tn = te;
Object.defineProperty(Re, "__esModule", {
  value: !0
});
var Dt = Re.default = void 0, xn = Tn(ne()), Cn = ee;
Dt = Re.default = (0, xn.default)(/* @__PURE__ */ (0, Cn.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 Mn(e) {
  return Qr(
    /* @__PURE__ */ c(
      H,
      {
        role: "listbox",
        height: "100%",
        width: "100%",
        border: `1px solid ${sr[200]}`,
        children: e.children
      }
    ),
    document.getElementById(e.listboxPortalId)
  );
}
function On({
  listboxType: e = "default",
  ...r
}) {
  const n = (o, s) => {
    r.multiple, r.onChange(s);
  }, t = pe(r.filterOptions || ((o) => o), [
    r.filterOptions
  ]);
  return /* @__PURE__ */ k(ze, { children: [
    /* @__PURE__ */ c(
      Mr,
      {
        ...r,
        open: e === "list" ? !0 : void 0,
        onChange: (o, s) => n(o, s),
        filterOptions: t,
        size: "small",
        ListboxComponent: e === "list" ? Mn : 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__ */ c(
          at,
          {
            ...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, l, d) => l.index === d.options.length - 1 ? /* @__PURE__ */ c(vn, { onChange: (m) => {
          m && r.onLastOptionInView();
        }, children: /* @__PURE__ */ c(A, { ...s, children: r.renderOption(i) }) }, o) : /* @__PURE__ */ c(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: Sn,
        "data-testid": "contextual-search",
        noOptionsText: r.loading ? "Ładowanie..." : "Brak rezultatów"
      }
    ),
    r.errorMessage && /* @__PURE__ */ c(lt, { error: !0, children: r.errorMessage })
  ] });
}
const Sn = (e) => /* @__PURE__ */ k(it, { children: [
  e.children,
  e.loading && /* @__PURE__ */ c(Ct, {}),
  e.onAddNewEntry && /* @__PURE__ */ c(
    ct,
    {
      variant: "outlined",
      startIcon: /* @__PURE__ */ c(Dt, {}),
      fullWidth: !0,
      sx: { borderTopLeftRadius: 0, borderTopRightRadius: 0 },
      onMouseDown: e.onAddNewEntry,
      children: "Dodaj nowy wpis"
    }
  )
] });
function Ms(e) {
  return /* @__PURE__ */ c(
    se,
    {
      control: e.control,
      name: e.name,
      render: ({ field: r, fieldState: n }) => {
        var t;
        return /* @__PURE__ */ c(
          On,
          {
            ...e,
            value: r.value,
            onChange: r.onChange,
            multiple: e.multiple,
            listboxType: e.listboxType,
            errorMessage: (t = n.error) == null ? void 0 : t.message
          }
        );
      }
    }
  );
}
var Pt = { exports: {} };
(function(e, r) {
  (function(n, t) {
    e.exports = t();
  })(re, function() {
    var n = "week", t = "year";
    return function(o, s, i) {
      var l = s.prototype;
      l.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 h = i(this).startOf(t).add(1, t).date(u), m = i(this).endOf(n);
          if (h.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);
      }, l.weeks = function(d) {
        return d === void 0 && (d = null), this.week(d);
      };
    };
  });
})(Pt);
var Dn = Pt.exports;
const Pn = /* @__PURE__ */ oe(Dn);
var Lt = { exports: {} };
(function(e, r) {
  (function(n, t) {
    e.exports = t();
  })(re, 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]+/, l = {}, d = function(f) {
      return (f = +f) + (f > 68 ? 1900 : 2e3);
    }, u = function(f) {
      return function(p) {
        this[f] = +p;
      };
    }, h = [/[+-]\d\d:?(\d\d)?|Z/, function(f) {
      (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;
      }(f);
    }], m = function(f) {
      var p = l[f];
      return p && (p.indexOf ? p : p.s.concat(p.f));
    }, b = function(f, p) {
      var g, y = l.meridiem;
      if (y) {
        for (var M = 1; M <= 24; M += 1) if (f.indexOf(y(M, 0, p)) > -1) {
          g = M > 12;
          break;
        }
      } else g = f === (p ? "pm" : "PM");
      return g;
    }, v = { A: [i, function(f) {
      this.afternoon = b(f, !1);
    }], a: [i, function(f) {
      this.afternoon = b(f, !0);
    }], S: [/\d/, function(f) {
      this.milliseconds = 100 * +f;
    }], SS: [o, function(f) {
      this.milliseconds = 10 * +f;
    }], SSS: [/\d{3}/, function(f) {
      this.milliseconds = +f;
    }], 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(f) {
      var p = l.ordinal, g = f.match(/\d+/);
      if (this.day = g[0], p) for (var y = 1; y <= 31; y += 1) p(y).replace(/\[|\]/g, "") === f && (this.day = y);
    }], M: [s, u("month")], MM: [o, u("month")], MMM: [i, function(f) {
      var p = m("months"), g = (m("monthsShort") || p.map(function(y) {
        return y.slice(0, 3);
      })).indexOf(f) + 1;
      if (g < 1) throw new Error();
      this.month = g % 12 || g;
    }], MMMM: [i, function(f) {
      var p = m("months").indexOf(f) + 1;
      if (p < 1) throw new Error();
      this.month = p % 12 || p;
    }], Y: [/[+-]?\d+/, u("year")], YY: [o, function(f) {
      this.year = d(f);
    }], YYYY: [/\d{4}/, u("year")], Z: h, ZZ: h };
    function T(f) {
      var p, g;
      p = f, g = l && l.formats;
      for (var y = (f = p.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(E, j, _) {
        var $ = _ && _.toUpperCase();
        return j || g[_] || n[_] || g[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(I, 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 j = {}, _ = 0, $ = 0; _ < M; _ += 1) {
          var I = y[_];
          if (typeof I == "string") $ += I.length;
          else {
            var B = I.regex, V = I.parser, ie = E.slice($), G = B.exec(ie)[0];
            V.call(j, G), E = E.replace(G, "");
          }
        }
        return function(U) {
          var Y = U.afternoon;
          if (Y !== void 0) {
            var W = U.hours;
            Y ? W < 12 && (U.hours += 12) : W === 12 && (U.hours = 0), delete U.afternoon;
          }
        }(j), j;
      };
    }
    return function(f, p, g) {
      g.p.customParseFormat = !0, f && f.parseTwoDigitYear && (d = f.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, j = C[3] === !0, _ = E || j, $ = C[2];
          j && ($ = C[2]), l = this.$locale(), !E && $ && (l = g.Ls[$]), this.$d = function(ie, G, U) {
            try {
              if (["x", "X"].indexOf(G) > -1) return new Date((G === "X" ? 1e3 : 1) * ie);
              var Y = T(G)(ie), W = Y.year, ae = Y.month, It = Y.day, At = Y.hours, Rt = Y.minutes, Bt = Y.seconds, Ft = Y.milliseconds, Ue = Y.zone, Me = /* @__PURE__ */ new Date(), Oe = It || (W || ae ? 1 : Me.getDate()), Se = W || Me.getFullYear(), le = 0;
              W && !ae || (le = ae > 0 ? ae - 1 : Me.getMonth());
              var De = At || 0, Pe = Rt || 0, Le = Bt || 0, we = Ft || 0;
              return Ue ? new Date(Date.UTC(Se, le, Oe, De, Pe, Le, we + 60 * Ue.offset * 1e3)) : U ? new Date(Date.UTC(Se, le, Oe, De, Pe, Le, we)) : new Date(Se, le, Oe, De, Pe, Le, we);
            } 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("")), l = {};
        } else if (w instanceof Array) for (var I = w.length, B = 1; B <= I; 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 === I && (this.$d = /* @__PURE__ */ new Date(""));
        }
        else M.call(this, S);
      };
    };
  });
})(Lt);
var Ln = Lt.exports;
const wn = /* @__PURE__ */ oe(Ln);
var wt = { exports: {} };
(function(e, r) {
  (function(n, t) {
    e.exports = t();
  })(re, 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, l = i.format;
      s.en.formats = n, i.format = function(d) {
        d === void 0 && (d = "YYYY-MM-DDTHH:mm:ssZ");
        var u = this.$locale().formats, h = function(m, b) {
          return m.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(v, T, f) {
            var p = f && f.toUpperCase();
            return T || b[f] || n[f] || b[p].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(g, y, M) {
              return y || M.slice(1);
            });
          });
        }(d, u === void 0 ? {} : u);
        return l.call(this, h);
      };
    };
  });
})(wt);
var kn = wt.exports;
const En = /* @__PURE__ */ oe(kn);
var kt = { exports: {} };
(function(e, r) {
  (function(n, t) {
    e.exports = t();
  })(re, function() {
    return function(n, t, o) {
      t.prototype.isBetween = function(s, i, l, d) {
        var u = o(s), h = o(i), m = (d = d || "()")[0] === "(", b = d[1] === ")";
        return (m ? this.isAfter(u, l) : !this.isBefore(u, l)) && (b ? this.isBefore(h, l) : !this.isAfter(h, l)) || (m ? this.isBefore(u, l) : !this.isAfter(u, l)) && (b ? this.isAfter(h, l) : !this.isBefore(h, l));
      };
    };
  });
})(kt);
var $n = kt.exports;
const _n = /* @__PURE__ */ oe($n);
var Et = { exports: {} };
(function(e, r) {
  (function(n, t) {
    e.exports = t();
  })(re, function() {
    return function(n, t) {
      var o = t.prototype, s = o.format;
      o.format = function(i) {
        var l = this, d = this.$locale();
        if (!this.isValid()) return s.bind(this)(i);
        var u = this.$utils(), h = (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((l.$M + 1) / 3);
            case "Do":
              return d.ordinal(l.$D);
            case "gggg":
              return l.weekYear();
            case "GGGG":
              return l.isoWeekYear();
            case "wo":
              return d.ordinal(l.week(), "W");
            case "w":
            case "ww":
              return u.s(l.week(), m === "w" ? 1 : 2, "0");
            case "W":
            case "WW":
              return u.s(l.isoWeek(), m === "W" ? 1 : 2, "0");
            case "k":
            case "kk":
              return u.s(String(l.$H === 0 ? 24 : l.$H), m === "k" ? 1 : 2, "0");
            case "X":
              return Math.floor(l.$d.getTime() / 1e3);
            case "x":
              return l.$d.getTime();
            case "z":
              return "[" + l.offsetName() + "]";
            case "zzz":
              return "[" + l.offsetName("long") + "]";
            default:
              return m;
          }
        });
        return s.bind(this)(h);
      };
    };
  });
})(Et);
var Yn = Et.exports;
const Nn = /* @__PURE__ */ oe(Yn);
P.extend(En);
P.extend(Pn);
P.extend(_n);
P.extend(Nn);
const zn = {
  // 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"
}, jn = {
  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"
}, ke = ["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(`
`), ot = ["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(`
`), In = (e, r) => r ? (...n) => e(...n).locale(r) : e;
class $t {
  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 = zn, 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(ke);
      return P.utc(t);
    }, this.createTZDate = (t, o) => {
      if (!this.hasUTCPlugin())
        throw new Error(ke);
      if (!this.hasTimezonePlugin())
        throw new Error(ot);
      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" && Or(["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(ke);
        return t.utc();
      }
      if (o === "system")
        return t.local();
      if (!this.hasTimezonePlugin()) {
        if (o === "default")
          return t;
        throw new Error(ot);
      }
      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, (l, d, u) => d || u.slice(1));
      return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (i, l, d) => {
        const u = d && d.toUpperCase();
        return l || 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 l = 0, d = s;
      const u = [];
      for (; d < i; ) {
        const h = Math.floor(l / 7);
        u[h] = u[h] || [], u[h].push(d), d = this.addDays(d, 1), l += 1;
      }
      return u;
    }, this.getWeekNumber = (t) => t.week(), this.getYearRange = ([t, o]) => {
      const s = this.startOfYear(t), i = this.endOfYear(o), l = [];
      let d = s;
      for (; this.isBefore(d, i); )
        l.push(d), d = this.addYears(d, 1);
      return l;
    }, this.dayjs = In(P, r), this.locale = r, this.formats = x({}, jn, n), P.extend(wn);
  }
  getDayOfWeek(r) {
    return r.day() + 1;
  }
}
const Os = ({
  name: e,
  control: r,
  label: n,
  defaultValue: t,
  disabled: o,
  required: s,
  dataTestId: i
}) => /* @__PURE__ */ c(
  se,
  {
    name: e,
    control: r,
    defaultValue: t,
    render: ({ field: l, fieldState: d }) => /* @__PURE__ */ k(dt, { dateAdapter: $t, children: [
      /* @__PURE__ */ c(
        Sr,
        {
          ...l,
          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__ */ c(Dr, { error: !0, children: d.error.message })
    ] })
  }
), Ss = ({
  name: e,
  control: r,
  label: n,
  defaultValue: t,
  disabled: o,
  required: s,
  dataTestId: i
}) => /* @__PURE__ */ c(
  se,
  {
    name: e,
    control: r,
    defaultValue: t,
    render: ({ field: l, fieldState: d }) => {
      const u = () => /* @__PURE__ */ c(wr, { sx: { ml: "14px" }, required: s, children: n });
      return /* @__PURE__ */ k(dt, { dateAdapter: $t, children: [
        /* @__PURE__ */ c(
          Pr,
          {
            ...l,
            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__ */ c(Lr, { error: !0, children: d.error.message })
      ] });
    }
  }
), Ds = ({
  name: e,
  label: r,
  control: n,
  defaultValue: t,
  options: o,
  errorMessage: s,
  required: i,
  disabled: l,
  dataTestId: d
}) => {
  const u = ve();
  return /* @__PURE__ */ c(
    se,
    {
      name: e,
      control: n,
      defaultValue: t,
      render: ({ field: h, fieldState: m }) => {
        var v;
        const b = s || ((v = m.error) == null ? void 0 : v.message);
        return /* @__PURE__ */ k(xe, { ...h, component: "fieldset", "data-testid": d, children: [
          r && /* @__PURE__ */ c(kr, { required: i, children: r }),
          /* @__PURE__ */ c(H, { mt: r ? "6px" : "0", children: o.map((T, f) => {
            const p = h.value === T.value;
            return /* @__PURE__ */ c(
              Er,
              {
                label: T.label,
                disabled: T.disabled || l,
                clickable: !0,
                variant: p ? "filled" : "outlined",
                color: p ? "primary" : "default",
                onClick: () => h.onChange(T.value),
                isFirst: f === 0,
                isActive: p,
                role: "chip",
                "data-active": p
              },
              String(T.value)
            );
          }) }),
          b && /* @__PURE__ */ c(q, { fontSize: "12px", color: u.palette.error.main, children: b })
        ] });
      }
    }
  );
};
function Ps({
  isLoading: e,
  placeholder: r,
  search: n,
  setSearch: t,
  onChange: o,
  width: s = "435px"
}) {
  const i = ve(), l = gt(() => e ? /* @__PURE__ */ c(
    ar,
    {
      size: 18,
      sx: { color: i.palette.primary.main }
    }
  ) : n ? /* @__PURE__ */ c(
    he,
    {
      sx: { padding: 0 },
      size: "small",
      onClick: () => t(""),
      children: /* @__PURE__ */ c(nn, { sx: { color: i.palette.primary.main } })
    }
  ) : /* @__PURE__ */ c(an, { sx: { color: i.palette.grey[100] } }), [e, n, t, i]);
  return /* @__PURE__ */ c(xe, { sx: { width: s }, variant: "standard", children: /* @__PURE__ */ c(
    $r,
    {
      value: n,
      onChange: (d) => {
        o && o(), t(d.target.value);
      },
      placeholder: r,
      disableUnderline: !0,
      endAdornment: /* @__PURE__ */ c(ut, { position: "end", children: l })
    }
  ) });
}
var Be = {}, An = te;
Object.defineProperty(Be, "__esModule", {
  value: !0
});
var _t = Be.default = void 0, Rn = An(ne()), Bn = ee;
_t = Be.default = (0, Rn.default)(/* @__PURE__ */ (0, Bn.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 Ls = ({
  name: e,
  control: r,
  label: n,
  defaultValue: t,
  options: o,
  errorMessage: s,
  multiple: i,
  disabled: l,
  required: d,
  dataTestId: u,
  renderValue: h,
  onChange: m,
  variant: b = "standard",
  size: v = "small",
  clearable: T
}) => /* @__PURE__ */ c(
  se,
  {
    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(_r, { variant: b, size: v, fullWidth: !0, children: [
        /* @__PURE__ */ c(
          ft,
          {
            id: `select-standard-label-${n}`,
            error: !!y,
            required: d,
            children: n
          }
        ),
        /* @__PURE__ */ c(
          ht,
          {
            ...p,
            onChange: M,
            multiple: i,
            required: d,
            id: `select-standard-${n}`,
            labelId: `select-standard-label-${n}`,
            label: n,
            error: !!y,
            disabled: l,
            "data-testid": u,
            value: p.value || (i ? [] : ""),
            renderValue: h,
            endAdornment: O ? /* @__PURE__ */ c(H, { position: "relative", children: /* @__PURE__ */ c(H, { position: "absolute", top: 0, right: 10, children: /* @__PURE__ */ c(
              ut,
              {
                sx: { marginRight: "10px" },
                position: "end",
                children: /* @__PURE__ */ c(
                  he,
                  {
                    onClick: () => p.onChange(i ? [] : null),
                    size: v,
                    children: /* @__PURE__ */ c(_t, { fontSize: "inherit" })
                  }
                )
              }
            ) }) }) : null,
            children: o.map((C) => /* @__PURE__ */ c(
              A,
              {
                value: C.value,
                disabled: C.disabled,
                children: C.label
              },
              C.value
            ))
          }
        ),
        y && /* @__PURE__ */ c(lt, { error: !!y, children: y })
      ] });
    }
  }
);
function Yt(e, r) {
  const [n, t] = F(
    e !== void 0 ? e : r
  );
  return Ce(() => {
    e !== void 0 && t(e);
  }, [e]), n;
}
var Fe = {}, Fn = te;
Object.defineProperty(Fe, "__esModule", {
  value: !0
});
var Nt = Fe.default = void 0, Vn = Fn(ne()), Un = ee;
Nt = Fe.default = (0, Vn.default)(/* @__PURE__ */ (0, Un.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 Hn = (e) => {
  const [r, n] = F(null), t = !!r, o = (h) => {
    n(h.currentTarget);
  }, s = () => {
    n(null);
  }, i = () => {
    e.gridApiRef.current.exportDataAsPrint(), s();
  }, l = () => {
    var h;
    (h = e.exportDataAsExcel) == null || h.call(e, e.gridApiRef), s();
  }, d = () => {
    e.gridApiRef.current.exportDataAsCsv(), s();
  }, u = ve();
  return /* @__PURE__ */ k(H, { children: [
    /* @__PURE__ */ c(
      ct,
      {
        id: "export-button",
        startIcon: /* @__PURE__ */ c(Nt, {}),
        "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(
      Yr,
      {
        id: "export-menu",
        anchorEl: r,
        open: t,
        onClose: s,
        MenuListProps: {
          "aria-labelledby": "exportButton-button"
        },
        children: [
          /* @__PURE__ */ c(A, { onClick: d, children: "Pobierz jako plik CSV" }),
          e.exportDataAsExcel && /* @__PURE__ */ c(A, { onClick: l, children: "Pobierz jako plik EXCEL" }),
          /* @__PURE__ */ c(A, { onClick: i, children: "Drukuj" })
        ]
      }
    )
  ] });
}, zt = (e) => /* @__PURE__ */ k(eo, { children: [
  /* @__PURE__ */ c(to, {}),
  e.isFilterActive && /* @__PURE__ */ c(ro, {}),
  /* @__PURE__ */ c(oo, {}),
  /* @__PURE__ */ c(
    Hn,
    {
      gridApiRef: e.gridApiRef,
      exportDataAsExcel: e.exportDataAsExcel
    }
  )
] }), ws = ({
  rowsData: e,
  isLoading: r,
  gridApiRef: n,
  exportDataAsExcel: t,
  slotProps: o,
  ...s
}) => {
  const i = gt(
    () => ({
      ...o,
      toolbar: {
        ...o == null ? void 0 : o.toolbar,
        gridApiRef: n,
        exportDataAsExcel: t,
        isFilterActive: !!s.filterModel
      }
    }),
    [t, s.filterModel, n, o]
  ), l = Yt(e == null ? void 0 : e.total_elements, 0);
  return /* @__PURE__ */ c(
    bt,
    {
      apiRef: n,
      loading: r,
      localeText: pt,
      rows: (e == null ? void 0 : e.content) || [],
      slots: {
        // @ts-expect-error missing props passed below
        toolbar: zt
      },
      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: l,
      ...s
    }
  );
}, Gn = (e, r) => {
  const [n, t] = F(_e(e)), o = pe(() => {
    var s;
    if ((s = r == null ? void 0 : r.current) != null && s.exportState && localStorage) {
      const i = r.current.exportState();
      Wn(e, i);
    }
  }, [r, e]);
  return Ce(() => () => {
    o();
  }), mt(() => (t(_e(e)), window.addEventListener("beforeunload", o), () => {
    window.removeEventListener("beforeunload", o), o();
  }), [o, e]), n;
};
function Wn(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 ks = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  getGridInitialStateFromStorage: _e,
  useGridInitialState: Gn
}, Symbol.toStringTag, { value: "Module" })), Es = ({
  direction: e,
  children: r,
  isOpen: n,
  customCloseWidth: t = 0,
  customCloseHeight: o = 0,
  customOpenWidth: s
}) => {
  const [i, l] = F("auto"), d = Jr(null), u = s || 300;
  Ce(() => {
    d.current && l(d.current.scrollHeight);
  }, [r]);
  const h = () => e === "horizontal" ? n ? u : t : "auto", m = () => e === "vertical" ? n ? i : o : "auto";
  return /* @__PURE__ */ c(Nr, { width: h(), height: m(), children: /* @__PURE__ */ c(zr, { ref: d, children: r }) });
}, $s = ({
  options: e,
  label: r,
  placeholder: n,
  size: t = "small",
  required: o,
  testId: s,
  value: i,
  getOptionLabel: l,
  ...d
}) => /* @__PURE__ */ c(
  jr,
  {
    value: i,
    options: e,
    size: t,
    "data-testid": s,
    "data-testId": s,
    getOptionLabel: (u) => u == null ? "" : typeof u == "string" ? u : l ? l(u) : String(u),
    renderInput: (u) => /* @__PURE__ */ c(
      at,
      {
        ...u,
        label: r,
        size: t,
        placeholder: n,
        required: o
      }
    ),
    ...d
  }
), _s = ({
  sx: e,
  errorMessage: r,
  ...n
}) => /* @__PURE__ */ c(xe, { variant: "standard", children: /* @__PURE__ */ c(
  Ir,
  {
    variant: "standard",
    sx: e,
    error: !!r,
    helperText: r,
    ...n
  }
) }), Ys = ({
  id: e,
  value: r,
  label: n,
  onChange: t,
  menuItems: o,
  disabled: s
}) => /* @__PURE__ */ k(xe, { variant: "standard", children: [
  /* @__PURE__ */ c(ft, { id: e, children: n }),
  /* @__PURE__ */ c(
    ht,
    {
      id: e,
      value: r,
      onChange: (i) => t(i.target.value),
      label: n,
      labelId: e,
      disabled: s,
      children: o.map(({ value: i, label: l }) => /* @__PURE__ */ c(A, { value: i, children: l }, i))
    }
  )
] }), Ns = ({
  steps: e,
  activeStep: r,
  setActiveStep: n,
  stepsContent: t,
  noHeader: o
}) => {
  const s = (i) => () => n(i);
  return /* @__PURE__ */ k(nt, { children: [
    /* @__PURE__ */ c(Ar, { noHeader: o, activeStep: r, children: e.map(({ label: i, value: l }) => /* @__PURE__ */ c(Ot, { children: /* @__PURE__ */ c(Rr, { disableRipple: !0, onClick: s(l), children: i }) }, i)) }),
    t == null ? void 0 : t[r]
  ] });
};
function zs({
  children: e,
  top: r = "0",
  withBoxShadow: n,
  ...t
}) {
  const o = rn("main");
  return /* @__PURE__ */ c(
    Br,
    {
      ...t,
      top: r,
      isScrolled: o > 25,
      withBoxShadow: n,
      "data-testid": "sticky-container",
      children: /* @__PURE__ */ c(ze, { pr: o > 25 ? "12px" : "0", children: e })
    }
  );
}
const js = (e) => {
  const r = {
    vertical: "bottom",
    horizontal: "right"
  }, n = {
    vertical: "top",
    horizontal: "right"
  };
  return /* @__PURE__ */ c(Fr.Provider, { value: { onClose: e.onClose }, children: /* @__PURE__ */ c(
    Vr,
    {
      anchorOrigin: r,
      transformOrigin: n,
      onClick: (t) => t.stopPropagation(),
      ...e
    }
  ) });
};
function Is(e) {
  const r = Ur(), n = () => {
    var o;
    (o = r == null ? void 0 : r.onClose) == null || o.call(r);
  };
  return Zn(e) ? /* @__PURE__ */ c(
    A,
    {
      disabled: e.disabled,
      component: lo,
      to: e.to,
      onClick: n,
      children: e.children
    }
  ) : /* @__PURE__ */ c(A, { onClick: (o) => {
    var s;
    (s = e.onClick) == null || s.call(e, o), n();
  }, disabled: e.disabled, children: /* @__PURE__ */ c(Mt, { children: e.children }) });
}
function Zn(e) {
  return e instanceof Object && "to" in e;
}
var Ve = {}, Xn = te;
Object.defineProperty(Ve, "__esModule", {
  value: !0
});
var jt = Ve.default = void 0, Jn = Xn(ne()), Kn = ee;
jt = Ve.default = (0, Jn.default)(/* @__PURE__ */ (0, Kn.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 As = (e) => /* @__PURE__ */ k(ze, { direction: "row", display: "inline-flex", children: [
  e.onEdit && /* @__PURE__ */ c(H, { children: /* @__PURE__ */ c(
    he,
    {
      onClick: e.onEdit,
      title: "Edytuj",
      size: "small",
      "data-testid": "edit-button",
      children: /* @__PURE__ */ c(jt, { fontSize: "inherit" })
    }
  ) }),
  e.onDelete && /* @__PURE__ */ c(H, { children: /* @__PURE__ */ c(
    he,
    {
      onClick: e.onDelete,
      title: "Usuń",
      size: "small",
      "data-testid": "delete-button",
      children: /* @__PURE__ */ c(Hr, { fontSize: "inherit" })
    }
  ) })
] }), Rs = ({ children: e, loading: r }) => e, Bs = ({
  rowsData: e,
  paginationAndSortState: r,
  setPaginationAndSortState: n,
  isLoading: t,
  columns: o,
  offset: s,
  tableKey: i,
  filterModel: l,
  onFilterModelChange: d,
  pinnedColumns: u,
  exportDataAsExcel: h,
  showPaginationFirstAndLastButtons: m = !1
}) => {
  const b = no(), { state: v } = tn(i, b), [T, f] = F({
    page: r.page,
    pageSize: r.size
  }), p = [
    {
      field: r.sort.field || "",
      sort: r.sort.direction || "asc"
    }
  ], g = () => {
    const O = b.current.getSortModel();
    n((D) => {
      var C, w;
      return {
        ...D,
        sort: {
          field: ((C = O[0]) == null ? void 0 : C.field) || "",
          direction: ((w = O[0]) == null ? void 0 : w.sort) || ""
        }
      };
    });
  }, y = (O) => {
    n((D) => ({
      ...D,
      page: O.page,
      size: O.pageSize
    })), f(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 = Yt(e == null ? void 0 : e.total_elements, 0);
  return /* @__PURE__ */ c(Gr, { offset: s, children: /* @__PURE__ */ c(
    bt,
    {
      loading: t,
      apiRef: b,
      localeText: pt,
      rows: (e == null ? void 0 : e.content) || [],
      columns: o,
      initialState: M(),
      slots: {
        // @ts-expect-error missing props passed below
        toolbar: zt
      },
      slotProps: {
        toolbar: {
          gridApiRef: b,
          exportDataAsExcel: h,
          isFilterActive: !!l
        },
        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: l,
      filterDebounceMs: 500,
      onFilterModelChange: d
    }
  ) });
}, Fs = (e) => {
  Wr.custom((r) => /* @__PURE__ */ k(qr, { type: "success", children: [
    /* @__PURE__ */ c(on, {}),
    /* @__PURE__ */ c(Zr, { message: e, id: r.id })
  ] }));
};
function Qn() {
  return so().filter(
    (e) => e.value !== "isAnyOf"
  );
}
function Vs(e) {
  return {
    type: "boolean",
    filterOperators: Qn(),
    renderCell: ({ value: r }) => /* @__PURE__ */ c(uo, { checked: r, disabled: !0 }),
    ...e
  };
}
function Us(e) {
  return {
    type: "date",
    valueGetter: (r) => r && P(r).toDate(),
    renderCell: ({ value: r }) => r ? rs(P(r)) : "-",
    ...e
  };
}
function Hs(e) {
  return {
    type: "dateTime",
    valueGetter: (r) => r && P(r).toDate(),
    renderCell: ({ value: r }) => r ? os(P(r)) : "-",
    ...e
  };
}
function es() {
  return io().filter(
    (e) => e.value !== "isAnyOf"
  );
}
function Gs(e) {
  return {
    type: "number",
    filterOperators: es(),
    renderCell: ({ value: r }) => cn(r) ? r : "-",
    ...e
  };
}
function Ws(e) {
  return {
    ...e,
    sortable: !1,
    filterable: !1,
    resizable: !1
  };
}
function ts() {
  return ao().filter(
    (e) => e.value !== "isAnyOf"
  );
}
function qs(e) {
  return {
    type: "string",
    filterOperators: ts(),
    renderCell: ({ value: r }) => r || "-",
    ...e
  };
}
const rs = (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");
  }
}, os = (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");
  }
}, ns = () => /* @__PURE__ */ c(
  Xr,
  {
    position: "top-right",
    toastOptions: {
      duration: 8e3
    }
  }
), Zs = ({
  children: e
}) => /* @__PURE__ */ k(nt, { children: [
  /* @__PURE__ */ c(ns, {}),
  e
] });
export {
  ti as ACCEPTED_FILE_TYPES,
  gs as Accordion,
  bs as AccordionDetails,
  ys as AccordionSummary,
  ri as Autocomplete,
  Q as Button,
  vs as ButtonAdd,
  en as ButtonWithIcon,
  js as ContextMenu,
  Is as ContextMenuItem,
  On as ContextualSearch,
  Ms as ContextualSearchControlled,
  Os as DatePicker,
  Ss as DateTimePicker,
  oi as Dialog,
  Ks as Drawer,
  ni as Dropzone,
  si as DropzoneField,
  ii as ElementsPicker,
  xs as ElementsPickerElement,
  Cs as FixedActionsBottomPanel,
  Zs as GemUIComponentsProvider,
  ws as Grid,
  ks as GridInitialState,
  ai as Input,
  Qs as LoadingBackdrop,
  Ds as RadioChips,
  Es as ResizableWrapper,
  Ps as SearchInput,
  Ls as Select,
  $s as SimpleAutocomplete,
  _s as SimpleInput,
  Ys as SimpleSelect,
  Ns as Stepper,
  zs as StickyContainer,
  As as TableActions,
  Rs as TableRecord,
  Bs as TableWithPagination,
  li as TabsPanel,
  vo as ThemeProvider,
  gi as Tree,
  q as Typography,
  ci as UPLOADED_FILE_MAX_SIZE,
  di as errorToast,
  rs as formatDate,
  os as formatDateTime,
  Vs as getBooleanColumn,
  Us as getDateColumn,
  Hs as getDateTimeColumn,
  ui as getErrorMessage,
  Gs as getNumericColumn,
  Ws as getStaticColumn,
  qs as getStringColumn,
  R as styled,
  Fs as successToast,
  fi as theme,
  Ts as useContextMenu,
  tn as useDataGridState,
  hi as useGetFileUrl,
  rn as useScrollPosition,
  ve as useTheme
};
