import * as a from "react";
import _, { useState as xr } from "react";
import { h as L, u as N, P as O, c as Me, S as Ge, b as R, a as Nr, k as Lr, i as Or, g as Dr, y as Se } from "./index.D1WHzYVh.js";
import { jsx as h, jsxs as Fr, Fragment as kr } from "react/jsx-runtime";
import { u as ze, d as je, c as Pt, R as Mt, A as Ur, P as Y, a as Br, D as Vr, C as Wr, b as Kr } from "./theme.DDkAXowQ.js";
import { r as Hr, a as Tt, R as $, b as Gr, l as At, g as ut, o as zr, c as Te } from "./radius.prop.CaQGG1qO.js";
var Fe = "focusScope.autoFocusOnMount", ke = "focusScope.autoFocusOnUnmount", dt = { bubbles: !1, cancelable: !0 }, Yr = "FocusScope", _t = a.forwardRef((e, t) => {
  const {
    loop: r = !1,
    trapped: n = !1,
    onMountAutoFocus: o,
    onUnmountAutoFocus: c,
    ...s
  } = e, [l, f] = a.useState(null), v = L(o), u = L(c), i = a.useRef(null), d = N(t, (m) => f(m)), p = a.useRef({
    paused: !1,
    pause() {
      this.paused = !0;
    },
    resume() {
      this.paused = !1;
    }
  }).current;
  a.useEffect(() => {
    if (n) {
      let m = function(E) {
        if (p.paused || !l) return;
        const y = E.target;
        l.contains(y) ? i.current = y : z(i.current, { select: !0 });
      }, S = function(E) {
        if (p.paused || !l) return;
        const y = E.relatedTarget;
        y !== null && (l.contains(y) || z(i.current, { select: !0 }));
      }, b = function(E) {
        if (document.activeElement === document.body)
          for (const P of E)
            P.removedNodes.length > 0 && z(l);
      };
      document.addEventListener("focusin", m), document.addEventListener("focusout", S);
      const w = new MutationObserver(b);
      return l && w.observe(l, { childList: !0, subtree: !0 }), () => {
        document.removeEventListener("focusin", m), document.removeEventListener("focusout", S), w.disconnect();
      };
    }
  }, [n, l, p.paused]), a.useEffect(() => {
    if (l) {
      vt.add(p);
      const m = document.activeElement;
      if (!l.contains(m)) {
        const b = new CustomEvent(Fe, dt);
        l.addEventListener(Fe, v), l.dispatchEvent(b), b.defaultPrevented || (Xr(Qr(It(l)), { select: !0 }), document.activeElement === m && z(l));
      }
      return () => {
        l.removeEventListener(Fe, v), setTimeout(() => {
          const b = new CustomEvent(ke, dt);
          l.addEventListener(ke, u), l.dispatchEvent(b), b.defaultPrevented || z(m ?? document.body, { select: !0 }), l.removeEventListener(ke, u), vt.remove(p);
        }, 0);
      };
    }
  }, [l, v, u, p]);
  const g = a.useCallback(
    (m) => {
      if (!r && !n || p.paused) return;
      const S = m.key === "Tab" && !m.altKey && !m.ctrlKey && !m.metaKey, b = document.activeElement;
      if (S && b) {
        const w = m.currentTarget, [E, y] = $r(w);
        E && y ? !m.shiftKey && b === y ? (m.preventDefault(), r && z(E, { select: !0 })) : m.shiftKey && b === E && (m.preventDefault(), r && z(y, { select: !0 })) : b === w && m.preventDefault();
      }
    },
    [r, n, p.paused]
  );
  return /* @__PURE__ */ h(O.div, { tabIndex: -1, ...s, ref: d, onKeyDown: g });
});
_t.displayName = Yr;
function Xr(e, { select: t = !1 } = {}) {
  const r = document.activeElement;
  for (const n of e)
    if (z(n, { select: t }), document.activeElement !== r) return;
}
function $r(e) {
  const t = It(e), r = ft(t, e), n = ft(t.reverse(), e);
  return [r, n];
}
function It(e) {
  const t = [], r = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
    acceptNode: (n) => {
      const o = n.tagName === "INPUT" && n.type === "hidden";
      return n.disabled || n.hidden || o ? NodeFilter.FILTER_SKIP : n.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
    }
  });
  for (; r.nextNode(); ) t.push(r.currentNode);
  return t;
}
function ft(e, t) {
  for (const r of e)
    if (!jr(r, { upTo: t })) return r;
}
function jr(e, { upTo: t }) {
  if (getComputedStyle(e).visibility === "hidden") return !0;
  for (; e; ) {
    if (t !== void 0 && e === t) return !1;
    if (getComputedStyle(e).display === "none") return !0;
    e = e.parentElement;
  }
  return !1;
}
function Zr(e) {
  return e instanceof HTMLInputElement && "select" in e;
}
function z(e, { select: t = !1 } = {}) {
  if (e && e.focus) {
    const r = document.activeElement;
    e.focus({ preventScroll: !0 }), e !== r && Zr(e) && t && e.select();
  }
}
var vt = qr();
function qr() {
  let e = [];
  return {
    add(t) {
      const r = e[0];
      t !== r && (r == null || r.pause()), e = mt(e, t), e.unshift(t);
    },
    remove(t) {
      var r;
      e = mt(e, t), (r = e[0]) == null || r.resume();
    }
  };
}
function mt(e, t) {
  const r = [...e], n = r.indexOf(t);
  return n !== -1 && r.splice(n, 1), r;
}
function Qr(e) {
  return e.filter((t) => t.tagName !== "A");
}
var Ue = 0;
function Jr() {
  a.useEffect(() => {
    const e = document.querySelectorAll("[data-radix-focus-guard]");
    return document.body.insertAdjacentElement("afterbegin", e[0] ?? ht()), document.body.insertAdjacentElement("beforeend", e[1] ?? ht()), Ue++, () => {
      Ue === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), Ue--;
    };
  }, []);
}
function ht() {
  const e = document.createElement("span");
  return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none", e;
}
var V = function() {
  return V = Object.assign || function(t) {
    for (var r, n = 1, o = arguments.length; n < o; n++) {
      r = arguments[n];
      for (var c in r) Object.prototype.hasOwnProperty.call(r, c) && (t[c] = r[c]);
    }
    return t;
  }, V.apply(this, arguments);
};
function xt(e, t) {
  var r = {};
  for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
    for (var o = 0, n = Object.getOwnPropertySymbols(e); o < n.length; o++)
      t.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (r[n[o]] = e[n[o]]);
  return r;
}
function en(e, t, r) {
  if (r || arguments.length === 2) for (var n = 0, o = t.length, c; n < o; n++)
    (c || !(n in t)) && (c || (c = Array.prototype.slice.call(t, 0, n)), c[n] = t[n]);
  return e.concat(c || Array.prototype.slice.call(t));
}
var we = "right-scroll-bar-position", Ce = "width-before-scroll-bar", tn = "with-scroll-bars-hidden", rn = "--removed-body-scroll-bar-size";
function Be(e, t) {
  return typeof e == "function" ? e(t) : e && (e.current = t), e;
}
function nn(e, t) {
  var r = xr(function() {
    return {
      // value
      value: e,
      // last callback
      callback: t,
      // "memoized" public interface
      facade: {
        get current() {
          return r.value;
        },
        set current(n) {
          var o = r.value;
          o !== n && (r.value = n, r.callback(n, o));
        }
      }
    };
  })[0];
  return r.callback = t, r.facade;
}
var on = typeof window < "u" ? a.useLayoutEffect : a.useEffect, pt = /* @__PURE__ */ new WeakMap();
function an(e, t) {
  var r = nn(null, function(n) {
    return e.forEach(function(o) {
      return Be(o, n);
    });
  });
  return on(function() {
    var n = pt.get(r);
    if (n) {
      var o = new Set(n), c = new Set(e), s = r.current;
      o.forEach(function(l) {
        c.has(l) || Be(l, null);
      }), c.forEach(function(l) {
        o.has(l) || Be(l, s);
      });
    }
    pt.set(r, e);
  }, [e]), r;
}
function cn(e) {
  return e;
}
function ln(e, t) {
  t === void 0 && (t = cn);
  var r = [], n = !1, o = {
    read: function() {
      if (n)
        throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
      return r.length ? r[r.length - 1] : e;
    },
    useMedium: function(c) {
      var s = t(c, n);
      return r.push(s), function() {
        r = r.filter(function(l) {
          return l !== s;
        });
      };
    },
    assignSyncMedium: function(c) {
      for (n = !0; r.length; ) {
        var s = r;
        r = [], s.forEach(c);
      }
      r = {
        push: function(l) {
          return c(l);
        },
        filter: function() {
          return r;
        }
      };
    },
    assignMedium: function(c) {
      n = !0;
      var s = [];
      if (r.length) {
        var l = r;
        r = [], l.forEach(c), s = r;
      }
      var f = function() {
        var u = s;
        s = [], u.forEach(c);
      }, v = function() {
        return Promise.resolve().then(f);
      };
      v(), r = {
        push: function(u) {
          s.push(u), v();
        },
        filter: function(u) {
          return s = s.filter(u), r;
        }
      };
    }
  };
  return o;
}
function sn(e) {
  e === void 0 && (e = {});
  var t = ln(null);
  return t.options = V({ async: !0, ssr: !1 }, e), t;
}
var Nt = function(e) {
  var t = e.sideCar, r = xt(e, ["sideCar"]);
  if (!t)
    throw new Error("Sidecar: please provide `sideCar` property to import the right car");
  var n = t.read();
  if (!n)
    throw new Error("Sidecar medium not found");
  return a.createElement(n, V({}, r));
};
Nt.isSideCarExport = !0;
function un(e, t) {
  return e.useMedium(t), Nt;
}
var Lt = sn(), Ve = function() {
}, Ae = a.forwardRef(function(e, t) {
  var r = a.useRef(null), n = a.useState({
    onScrollCapture: Ve,
    onWheelCapture: Ve,
    onTouchMoveCapture: Ve
  }), o = n[0], c = n[1], s = e.forwardProps, l = e.children, f = e.className, v = e.removeScrollBar, u = e.enabled, i = e.shards, d = e.sideCar, p = e.noIsolation, g = e.inert, m = e.allowPinchZoom, S = e.as, b = S === void 0 ? "div" : S, w = e.gapMode, E = xt(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), y = d, P = an([r, t]), x = V(V({}, E), o);
  return a.createElement(
    a.Fragment,
    null,
    u && a.createElement(y, { sideCar: Lt, removeScrollBar: v, shards: i, noIsolation: p, inert: g, setCallbacks: c, allowPinchZoom: !!m, lockRef: r, gapMode: w }),
    s ? a.cloneElement(a.Children.only(l), V(V({}, x), { ref: P })) : a.createElement(b, V({}, x, { className: f, ref: P }), l)
  );
});
Ae.defaultProps = {
  enabled: !0,
  removeScrollBar: !0,
  inert: !1
};
Ae.classNames = {
  fullWidth: Ce,
  zeroRight: we
};
var dn = function() {
  if (typeof __webpack_nonce__ < "u")
    return __webpack_nonce__;
};
function fn() {
  if (!document)
    return null;
  var e = document.createElement("style");
  e.type = "text/css";
  var t = dn();
  return t && e.setAttribute("nonce", t), e;
}
function vn(e, t) {
  e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
}
function mn(e) {
  var t = document.head || document.getElementsByTagName("head")[0];
  t.appendChild(e);
}
var hn = function() {
  var e = 0, t = null;
  return {
    add: function(r) {
      e == 0 && (t = fn()) && (vn(t, r), mn(t)), e++;
    },
    remove: function() {
      e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
    }
  };
}, pn = function() {
  var e = hn();
  return function(t, r) {
    a.useEffect(function() {
      return e.add(t), function() {
        e.remove();
      };
    }, [t && r]);
  };
}, Ot = function() {
  var e = pn(), t = function(r) {
    var n = r.styles, o = r.dynamic;
    return e(n, o), null;
  };
  return t;
}, gn = {
  left: 0,
  top: 0,
  right: 0,
  gap: 0
}, We = function(e) {
  return parseInt(e || "", 10) || 0;
}, bn = function(e) {
  var t = window.getComputedStyle(document.body), r = t[e === "padding" ? "paddingLeft" : "marginLeft"], n = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"];
  return [We(r), We(n), We(o)];
}, Sn = function(e) {
  if (e === void 0 && (e = "margin"), typeof window > "u")
    return gn;
  var t = bn(e), r = document.documentElement.clientWidth, n = window.innerWidth;
  return {
    left: t[0],
    top: t[1],
    right: t[2],
    gap: Math.max(0, n - r + t[2] - t[0])
  };
}, wn = Ot(), ne = "data-scroll-locked", Cn = function(e, t, r, n) {
  var o = e.left, c = e.top, s = e.right, l = e.gap;
  return r === void 0 && (r = "margin"), `
  .`.concat(tn, ` {
   overflow: hidden `).concat(n, `;
   padding-right: `).concat(l, "px ").concat(n, `;
  }
  body[`).concat(ne, `] {
    overflow: hidden `).concat(n, `;
    overscroll-behavior: contain;
    `).concat([
    t && "position: relative ".concat(n, ";"),
    r === "margin" && `
    padding-left: `.concat(o, `px;
    padding-top: `).concat(c, `px;
    padding-right: `).concat(s, `px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(l, "px ").concat(n, `;
    `),
    r === "padding" && "padding-right: ".concat(l, "px ").concat(n, ";")
  ].filter(Boolean).join(""), `
  }
  
  .`).concat(we, ` {
    right: `).concat(l, "px ").concat(n, `;
  }
  
  .`).concat(Ce, ` {
    margin-right: `).concat(l, "px ").concat(n, `;
  }
  
  .`).concat(we, " .").concat(we, ` {
    right: 0 `).concat(n, `;
  }
  
  .`).concat(Ce, " .").concat(Ce, ` {
    margin-right: 0 `).concat(n, `;
  }
  
  body[`).concat(ne, `] {
    `).concat(rn, ": ").concat(l, `px;
  }
`);
}, gt = function() {
  var e = parseInt(document.body.getAttribute(ne) || "0", 10);
  return isFinite(e) ? e : 0;
}, En = function() {
  a.useEffect(function() {
    return document.body.setAttribute(ne, (gt() + 1).toString()), function() {
      var e = gt() - 1;
      e <= 0 ? document.body.removeAttribute(ne) : document.body.setAttribute(ne, e.toString());
    };
  }, []);
}, yn = function(e) {
  var t = e.noRelative, r = e.noImportant, n = e.gapMode, o = n === void 0 ? "margin" : n;
  En();
  var c = a.useMemo(function() {
    return Sn(o);
  }, [o]);
  return a.createElement(wn, { styles: Cn(c, !t, o, r ? "" : "!important") });
}, Ye = !1;
if (typeof window < "u")
  try {
    var he = Object.defineProperty({}, "passive", {
      get: function() {
        return Ye = !0, !0;
      }
    });
    window.addEventListener("test", he, he), window.removeEventListener("test", he, he);
  } catch {
    Ye = !1;
  }
var ee = Ye ? { passive: !1 } : !1, Rn = function(e) {
  return e.tagName === "TEXTAREA";
}, Dt = function(e, t) {
  var r = window.getComputedStyle(e);
  return (
    // not-not-scrollable
    r[t] !== "hidden" && // contains scroll inside self
    !(r.overflowY === r.overflowX && !Rn(e) && r[t] === "visible")
  );
}, Pn = function(e) {
  return Dt(e, "overflowY");
}, Mn = function(e) {
  return Dt(e, "overflowX");
}, bt = function(e, t) {
  var r = t.ownerDocument, n = t;
  do {
    typeof ShadowRoot < "u" && n instanceof ShadowRoot && (n = n.host);
    var o = Ft(e, n);
    if (o) {
      var c = kt(e, n), s = c[1], l = c[2];
      if (s > l)
        return !0;
    }
    n = n.parentNode;
  } while (n && n !== r.body);
  return !1;
}, Tn = function(e) {
  var t = e.scrollTop, r = e.scrollHeight, n = e.clientHeight;
  return [
    t,
    r,
    n
  ];
}, An = function(e) {
  var t = e.scrollLeft, r = e.scrollWidth, n = e.clientWidth;
  return [
    t,
    r,
    n
  ];
}, Ft = function(e, t) {
  return e === "v" ? Pn(t) : Mn(t);
}, kt = function(e, t) {
  return e === "v" ? Tn(t) : An(t);
}, _n = function(e, t) {
  return e === "h" && t === "rtl" ? -1 : 1;
}, In = function(e, t, r, n, o) {
  var c = _n(e, window.getComputedStyle(t).direction), s = c * n, l = r.target, f = t.contains(l), v = !1, u = s > 0, i = 0, d = 0;
  do {
    var p = kt(e, l), g = p[0], m = p[1], S = p[2], b = m - S - c * g;
    (g || b) && Ft(e, l) && (i += b, d += g), l instanceof ShadowRoot ? l = l.host : l = l.parentNode;
  } while (
    // portaled content
    !f && l !== document.body || // self content
    f && (t.contains(l) || t === l)
  );
  return (u && Math.abs(i) < 1 || !u && Math.abs(d) < 1) && (v = !0), v;
}, pe = function(e) {
  return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
}, St = function(e) {
  return [e.deltaX, e.deltaY];
}, wt = function(e) {
  return e && "current" in e ? e.current : e;
}, xn = function(e, t) {
  return e[0] === t[0] && e[1] === t[1];
}, Nn = function(e) {
  return `
  .block-interactivity-`.concat(e, ` {pointer-events: none;}
  .allow-interactivity-`).concat(e, ` {pointer-events: all;}
`);
}, Ln = 0, te = [];
function On(e) {
  var t = a.useRef([]), r = a.useRef([0, 0]), n = a.useRef(), o = a.useState(Ln++)[0], c = a.useState(Ot)[0], s = a.useRef(e);
  a.useEffect(function() {
    s.current = e;
  }, [e]), a.useEffect(function() {
    if (e.inert) {
      document.body.classList.add("block-interactivity-".concat(o));
      var m = en([e.lockRef.current], (e.shards || []).map(wt), !0).filter(Boolean);
      return m.forEach(function(S) {
        return S.classList.add("allow-interactivity-".concat(o));
      }), function() {
        document.body.classList.remove("block-interactivity-".concat(o)), m.forEach(function(S) {
          return S.classList.remove("allow-interactivity-".concat(o));
        });
      };
    }
  }, [e.inert, e.lockRef.current, e.shards]);
  var l = a.useCallback(function(m, S) {
    if ("touches" in m && m.touches.length === 2)
      return !s.current.allowPinchZoom;
    var b = pe(m), w = r.current, E = "deltaX" in m ? m.deltaX : w[0] - b[0], y = "deltaY" in m ? m.deltaY : w[1] - b[1], P, x = m.target, I = Math.abs(E) > Math.abs(y) ? "h" : "v";
    if ("touches" in m && I === "h" && x.type === "range")
      return !1;
    var T = bt(I, x);
    if (!T)
      return !0;
    if (T ? P = I : (P = I === "v" ? "h" : "v", T = bt(I, x)), !T)
      return !1;
    if (!n.current && "changedTouches" in m && (E || y) && (n.current = P), !P)
      return !0;
    var M = n.current || P;
    return In(M, S, m, M === "h" ? E : y);
  }, []), f = a.useCallback(function(m) {
    var S = m;
    if (!(!te.length || te[te.length - 1] !== c)) {
      var b = "deltaY" in S ? St(S) : pe(S), w = t.current.filter(function(P) {
        return P.name === S.type && (P.target === S.target || S.target === P.shadowParent) && xn(P.delta, b);
      })[0];
      if (w && w.should) {
        S.cancelable && S.preventDefault();
        return;
      }
      if (!w) {
        var E = (s.current.shards || []).map(wt).filter(Boolean).filter(function(P) {
          return P.contains(S.target);
        }), y = E.length > 0 ? l(S, E[0]) : !s.current.noIsolation;
        y && S.cancelable && S.preventDefault();
      }
    }
  }, []), v = a.useCallback(function(m, S, b, w) {
    var E = { name: m, delta: S, target: b, should: w, shadowParent: Dn(b) };
    t.current.push(E), setTimeout(function() {
      t.current = t.current.filter(function(y) {
        return y !== E;
      });
    }, 1);
  }, []), u = a.useCallback(function(m) {
    r.current = pe(m), n.current = void 0;
  }, []), i = a.useCallback(function(m) {
    v(m.type, St(m), m.target, l(m, e.lockRef.current));
  }, []), d = a.useCallback(function(m) {
    v(m.type, pe(m), m.target, l(m, e.lockRef.current));
  }, []);
  a.useEffect(function() {
    return te.push(c), e.setCallbacks({
      onScrollCapture: i,
      onWheelCapture: i,
      onTouchMoveCapture: d
    }), document.addEventListener("wheel", f, ee), document.addEventListener("touchmove", f, ee), document.addEventListener("touchstart", u, ee), function() {
      te = te.filter(function(m) {
        return m !== c;
      }), document.removeEventListener("wheel", f, ee), document.removeEventListener("touchmove", f, ee), document.removeEventListener("touchstart", u, ee);
    };
  }, []);
  var p = e.removeScrollBar, g = e.inert;
  return a.createElement(
    a.Fragment,
    null,
    g ? a.createElement(c, { styles: Nn(o) }) : null,
    p ? a.createElement(yn, { gapMode: e.gapMode }) : null
  );
}
function Dn(e) {
  for (var t = null; e !== null; )
    e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
  return t;
}
const Fn = un(Lt, On);
var Ut = a.forwardRef(function(e, t) {
  return a.createElement(Ae, V({}, e, { ref: t, sideCar: Fn }));
});
Ut.classNames = Ae.classNames;
var kn = function(e) {
  if (typeof document > "u")
    return null;
  var t = Array.isArray(e) ? e[0] : e;
  return t.ownerDocument.body;
}, re = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakMap(), be = {}, Ke = 0, Bt = function(e) {
  return e && (e.host || Bt(e.parentNode));
}, Un = function(e, t) {
  return t.map(function(r) {
    if (e.contains(r))
      return r;
    var n = Bt(r);
    return n && e.contains(n) ? n : (console.error("aria-hidden", r, "in not contained inside", e, ". Doing nothing"), null);
  }).filter(function(r) {
    return !!r;
  });
}, Bn = function(e, t, r, n) {
  var o = Un(t, Array.isArray(e) ? e : [e]);
  be[r] || (be[r] = /* @__PURE__ */ new WeakMap());
  var c = be[r], s = [], l = /* @__PURE__ */ new Set(), f = new Set(o), v = function(i) {
    !i || l.has(i) || (l.add(i), v(i.parentNode));
  };
  o.forEach(v);
  var u = function(i) {
    !i || f.has(i) || Array.prototype.forEach.call(i.children, function(d) {
      if (l.has(d))
        u(d);
      else
        try {
          var p = d.getAttribute(n), g = p !== null && p !== "false", m = (re.get(d) || 0) + 1, S = (c.get(d) || 0) + 1;
          re.set(d, m), c.set(d, S), s.push(d), m === 1 && g && ge.set(d, !0), S === 1 && d.setAttribute(r, "true"), g || d.setAttribute(n, "true");
        } catch (b) {
          console.error("aria-hidden: cannot operate on ", d, b);
        }
    });
  };
  return u(t), l.clear(), Ke++, function() {
    s.forEach(function(i) {
      var d = re.get(i) - 1, p = c.get(i) - 1;
      re.set(i, d), c.set(i, p), d || (ge.has(i) || i.removeAttribute(n), ge.delete(i)), p || i.removeAttribute(r);
    }), Ke--, Ke || (re = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakMap(), be = {});
  };
}, Vn = function(e, t, r) {
  r === void 0 && (r = "data-aria-hidden");
  var n = Array.from(Array.isArray(e) ? e : [e]), o = kn(e);
  return o ? (n.push.apply(n, Array.from(o.querySelectorAll("[aria-live], script"))), Bn(n, o, r, "aria-hidden")) : function() {
    return null;
  };
};
const na = (e) => {
  if (!a.isValidElement(e)) throw Error(`Expected a single React Element child, but got: ${a.Children.toArray(e).map((t) => typeof t == "object" && "type" in t && typeof t.type == "string" ? t.type : typeof t).join(", ")}`);
  return e;
};
function Wn(e, t) {
  const { asChild: r, children: n } = e;
  if (!r) return typeof t == "function" ? t(n) : t;
  const o = a.Children.only(n);
  return a.cloneElement(o, { children: typeof t == "function" ? t(o.props.children) : t });
}
function Vt(e) {
  const t = e + "CollectionProvider", [r, n] = Me(t), [o, c] = r(
    t,
    { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
  ), s = (p) => {
    const { scope: g, children: m } = p, S = _.useRef(null), b = _.useRef(/* @__PURE__ */ new Map()).current;
    return /* @__PURE__ */ h(o, { scope: g, itemMap: b, collectionRef: S, children: m });
  };
  s.displayName = t;
  const l = e + "CollectionSlot", f = _.forwardRef(
    (p, g) => {
      const { scope: m, children: S } = p, b = c(l, m), w = N(g, b.collectionRef);
      return /* @__PURE__ */ h(Ge, { ref: w, children: S });
    }
  );
  f.displayName = l;
  const v = e + "CollectionItemSlot", u = "data-radix-collection-item", i = _.forwardRef(
    (p, g) => {
      const { scope: m, children: S, ...b } = p, w = _.useRef(null), E = N(g, w), y = c(v, m);
      return _.useEffect(() => (y.itemMap.set(w, { ref: w, ...b }), () => void y.itemMap.delete(w))), /* @__PURE__ */ h(Ge, { [u]: "", ref: E, children: S });
    }
  );
  i.displayName = v;
  function d(p) {
    const g = c(e + "CollectionConsumer", p);
    return _.useCallback(() => {
      const S = g.collectionRef.current;
      if (!S) return [];
      const b = Array.from(S.querySelectorAll(`[${u}]`));
      return Array.from(g.itemMap.values()).sort(
        (y, P) => b.indexOf(y.ref.current) - b.indexOf(P.ref.current)
      );
    }, [g.collectionRef, g.itemMap]);
  }
  return [
    { Provider: s, Slot: f, ItemSlot: i },
    d,
    n
  ];
}
var He = "rovingFocusGroup.onEntryFocus", Kn = { bubbles: !1, cancelable: !0 }, _e = "RovingFocusGroup", [Xe, Wt, Hn] = Vt(_e), [Gn, Kt] = Me(
  _e,
  [Hn]
), [zn, Yn] = Gn(_e), Ht = a.forwardRef(
  (e, t) => /* @__PURE__ */ h(Xe.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ h(Xe.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ h(Xn, { ...e, ref: t }) }) })
);
Ht.displayName = _e;
var Xn = a.forwardRef((e, t) => {
  const {
    __scopeRovingFocusGroup: r,
    orientation: n,
    loop: o = !1,
    dir: c,
    currentTabStopId: s,
    defaultCurrentTabStopId: l,
    onCurrentTabStopIdChange: f,
    onEntryFocus: v,
    preventScrollOnEntryFocus: u = !1,
    ...i
  } = e, d = a.useRef(null), p = N(t, d), g = je(c), [m = null, S] = Nr({
    prop: s,
    defaultProp: l,
    onChange: f
  }), [b, w] = a.useState(!1), E = L(v), y = Wt(r), P = a.useRef(!1), [x, I] = a.useState(0);
  return a.useEffect(() => {
    const T = d.current;
    if (T)
      return T.addEventListener(He, E), () => T.removeEventListener(He, E);
  }, [E]), /* @__PURE__ */ h(
    zn,
    {
      scope: r,
      orientation: n,
      dir: g,
      loop: o,
      currentTabStopId: m,
      onItemFocus: a.useCallback(
        (T) => S(T),
        [S]
      ),
      onItemShiftTab: a.useCallback(() => w(!0), []),
      onFocusableItemAdd: a.useCallback(
        () => I((T) => T + 1),
        []
      ),
      onFocusableItemRemove: a.useCallback(
        () => I((T) => T - 1),
        []
      ),
      children: /* @__PURE__ */ h(
        O.div,
        {
          tabIndex: b || x === 0 ? -1 : 0,
          "data-orientation": n,
          ...i,
          ref: p,
          style: { outline: "none", ...e.style },
          onMouseDown: R(e.onMouseDown, () => {
            P.current = !0;
          }),
          onFocus: R(e.onFocus, (T) => {
            const M = !P.current;
            if (T.target === T.currentTarget && M && !b) {
              const A = new CustomEvent(He, Kn);
              if (T.currentTarget.dispatchEvent(A), !A.defaultPrevented) {
                const D = y().filter((K) => K.focusable), q = D.find((K) => K.active), ve = D.find((K) => K.id === m), Le = [q, ve, ...D].filter(
                  Boolean
                ).map((K) => K.ref.current);
                Yt(Le, u);
              }
            }
            P.current = !1;
          }),
          onBlur: R(e.onBlur, () => w(!1))
        }
      )
    }
  );
}), Gt = "RovingFocusGroupItem", zt = a.forwardRef(
  (e, t) => {
    const {
      __scopeRovingFocusGroup: r,
      focusable: n = !0,
      active: o = !1,
      tabStopId: c,
      ...s
    } = e, l = ze(), f = c || l, v = Yn(Gt, r), u = v.currentTabStopId === f, i = Wt(r), { onFocusableItemAdd: d, onFocusableItemRemove: p } = v;
    return a.useEffect(() => {
      if (n)
        return d(), () => p();
    }, [n, d, p]), /* @__PURE__ */ h(
      Xe.ItemSlot,
      {
        scope: r,
        id: f,
        focusable: n,
        active: o,
        children: /* @__PURE__ */ h(
          O.span,
          {
            tabIndex: u ? 0 : -1,
            "data-orientation": v.orientation,
            ...s,
            ref: t,
            onMouseDown: R(e.onMouseDown, (g) => {
              n ? v.onItemFocus(f) : g.preventDefault();
            }),
            onFocus: R(e.onFocus, () => v.onItemFocus(f)),
            onKeyDown: R(e.onKeyDown, (g) => {
              if (g.key === "Tab" && g.shiftKey) {
                v.onItemShiftTab();
                return;
              }
              if (g.target !== g.currentTarget) return;
              const m = Zn(g, v.orientation, v.dir);
              if (m !== void 0) {
                if (g.metaKey || g.ctrlKey || g.altKey || g.shiftKey) return;
                g.preventDefault();
                let b = i().filter((w) => w.focusable).map((w) => w.ref.current);
                if (m === "last") b.reverse();
                else if (m === "prev" || m === "next") {
                  m === "prev" && b.reverse();
                  const w = b.indexOf(g.currentTarget);
                  b = v.loop ? qn(b, w + 1) : b.slice(w + 1);
                }
                setTimeout(() => Yt(b));
              }
            })
          }
        )
      }
    );
  }
);
zt.displayName = Gt;
var $n = {
  ArrowLeft: "prev",
  ArrowUp: "prev",
  ArrowRight: "next",
  ArrowDown: "next",
  PageUp: "first",
  Home: "first",
  PageDown: "last",
  End: "last"
};
function jn(e, t) {
  return t !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
}
function Zn(e, t, r) {
  const n = jn(e.key, r);
  if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(n)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(n)))
    return $n[n];
}
function Yt(e, t = !1) {
  const r = document.activeElement;
  for (const n of e)
    if (n === r || (n.focus({ preventScroll: t }), document.activeElement !== r)) return;
}
function qn(e, t) {
  return e.map((r, n) => e[(t + n) % e.length]);
}
var Qn = Ht, Jn = zt;
const eo = _.forwardRef((e, t) => _.createElement("svg", { width: "9", height: "9", viewBox: "0 0 9 9", fill: "currentcolor", xmlns: "http://www.w3.org/2000/svg", ...e, ref: t }, _.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z" })));
eo.displayName = "ThickDividerHorizontalIcon";
const to = _.forwardRef((e, t) => _.createElement("svg", { width: "9", height: "9", viewBox: "0 0 9 9", fill: "currentcolor", xmlns: "http://www.w3.org/2000/svg", ...e, ref: t }, _.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z" })));
to.displayName = "ThickCheckIcon";
const ro = _.forwardRef((e, t) => _.createElement("svg", { width: "9", height: "9", viewBox: "0 0 9 9", fill: "currentcolor", xmlns: "http://www.w3.org/2000/svg", ...e, ref: t }, _.createElement("path", { d: "M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z" })));
ro.displayName = "ChevronDownIcon";
const no = _.forwardRef((e, t) => _.createElement("svg", { width: "9", height: "9", viewBox: "0 0 9 9", fill: "currentcolor", xmlns: "http://www.w3.org/2000/svg", ...e, ref: t }, _.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z" })));
no.displayName = "ThickChevronRightIcon";
var $e = ["Enter", " "], oo = ["ArrowDown", "PageUp", "Home"], Xt = ["ArrowUp", "PageDown", "End"], ao = [...oo, ...Xt], co = {
  ltr: [...$e, "ArrowRight"],
  rtl: [...$e, "ArrowLeft"]
}, lo = {
  ltr: ["ArrowLeft"],
  rtl: ["ArrowRight"]
}, ue = "Menu", [se, so, io] = Vt(ue), [Z, oa] = Me(ue, [
  io,
  Pt,
  Kt
]), de = Pt(), $t = Kt(), [jt, X] = Z(ue), [uo, fe] = Z(ue), Zt = (e) => {
  const { __scopeMenu: t, open: r = !1, children: n, dir: o, onOpenChange: c, modal: s = !0 } = e, l = de(t), [f, v] = a.useState(null), u = a.useRef(!1), i = L(c), d = je(o);
  return a.useEffect(() => {
    const p = () => {
      u.current = !0, document.addEventListener("pointerdown", g, { capture: !0, once: !0 }), document.addEventListener("pointermove", g, { capture: !0, once: !0 });
    }, g = () => u.current = !1;
    return document.addEventListener("keydown", p, { capture: !0 }), () => {
      document.removeEventListener("keydown", p, { capture: !0 }), document.removeEventListener("pointerdown", g, { capture: !0 }), document.removeEventListener("pointermove", g, { capture: !0 });
    };
  }, []), /* @__PURE__ */ h(Mt, { ...l, children: /* @__PURE__ */ h(
    jt,
    {
      scope: t,
      open: r,
      onOpenChange: i,
      content: f,
      onContentChange: v,
      children: /* @__PURE__ */ h(
        uo,
        {
          scope: t,
          onClose: a.useCallback(() => i(!1), [i]),
          isUsingKeyboardRef: u,
          dir: d,
          modal: s,
          children: n
        }
      )
    }
  ) });
};
Zt.displayName = ue;
var fo = "MenuAnchor", Ze = a.forwardRef(
  (e, t) => {
    const { __scopeMenu: r, ...n } = e, o = de(r);
    return /* @__PURE__ */ h(Ur, { ...o, ...n, ref: t });
  }
);
Ze.displayName = fo;
var qe = "MenuPortal", [vo, qt] = Z(qe, {
  forceMount: void 0
}), Qt = (e) => {
  const { __scopeMenu: t, forceMount: r, children: n, container: o } = e, c = X(qe, t);
  return /* @__PURE__ */ h(vo, { scope: t, forceMount: r, children: /* @__PURE__ */ h(Y, { present: r || c.open, children: /* @__PURE__ */ h(Br, { asChild: !0, container: o, children: n }) }) });
};
Qt.displayName = qe;
var k = "MenuContent", [mo, Qe] = Z(k), Jt = a.forwardRef(
  (e, t) => {
    const r = qt(k, e.__scopeMenu), { forceMount: n = r.forceMount, ...o } = e, c = X(k, e.__scopeMenu), s = fe(k, e.__scopeMenu);
    return /* @__PURE__ */ h(se.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ h(Y, { present: n || c.open, children: /* @__PURE__ */ h(se.Slot, { scope: e.__scopeMenu, children: s.modal ? /* @__PURE__ */ h(ho, { ...o, ref: t }) : /* @__PURE__ */ h(po, { ...o, ref: t }) }) }) });
  }
), ho = a.forwardRef(
  (e, t) => {
    const r = X(k, e.__scopeMenu), n = a.useRef(null), o = N(t, n);
    return a.useEffect(() => {
      const c = n.current;
      if (c) return Vn(c);
    }, []), /* @__PURE__ */ h(
      Je,
      {
        ...e,
        ref: o,
        trapFocus: r.open,
        disableOutsidePointerEvents: r.open,
        disableOutsideScroll: !0,
        onFocusOutside: R(
          e.onFocusOutside,
          (c) => c.preventDefault(),
          { checkForDefaultPrevented: !1 }
        ),
        onDismiss: () => r.onOpenChange(!1)
      }
    );
  }
), po = a.forwardRef((e, t) => {
  const r = X(k, e.__scopeMenu);
  return /* @__PURE__ */ h(
    Je,
    {
      ...e,
      ref: t,
      trapFocus: !1,
      disableOutsidePointerEvents: !1,
      disableOutsideScroll: !1,
      onDismiss: () => r.onOpenChange(!1)
    }
  );
}), Je = a.forwardRef(
  (e, t) => {
    const {
      __scopeMenu: r,
      loop: n = !1,
      trapFocus: o,
      onOpenAutoFocus: c,
      onCloseAutoFocus: s,
      disableOutsidePointerEvents: l,
      onEntryFocus: f,
      onEscapeKeyDown: v,
      onPointerDownOutside: u,
      onFocusOutside: i,
      onInteractOutside: d,
      onDismiss: p,
      disableOutsideScroll: g,
      ...m
    } = e, S = X(k, r), b = fe(k, r), w = de(r), E = $t(r), y = so(r), [P, x] = a.useState(null), I = a.useRef(null), T = N(t, I, S.onContentChange), M = a.useRef(0), A = a.useRef(""), D = a.useRef(0), q = a.useRef(null), ve = a.useRef("right"), me = a.useRef(0), Le = g ? Ut : a.Fragment, K = g ? { as: Ge, allowPinchZoom: !0 } : void 0, Ir = (C) => {
      var J, st;
      const F = A.current + C, B = y().filter((H) => !H.disabled), G = document.activeElement, Oe = (J = B.find((H) => H.ref.current === G)) == null ? void 0 : J.textValue, De = B.map((H) => H.textValue), lt = Ao(De, F, Oe), ae = (st = B.find((H) => H.textValue === lt)) == null ? void 0 : st.ref.current;
      (function H(it) {
        A.current = it, window.clearTimeout(M.current), it !== "" && (M.current = window.setTimeout(() => H(""), 1e3));
      })(F), ae && setTimeout(() => ae.focus());
    };
    a.useEffect(() => () => window.clearTimeout(M.current), []), Jr();
    const Q = a.useCallback((C) => {
      var B, G;
      return ve.current === ((B = q.current) == null ? void 0 : B.side) && Io(C, (G = q.current) == null ? void 0 : G.area);
    }, []);
    return /* @__PURE__ */ h(
      mo,
      {
        scope: r,
        searchRef: A,
        onItemEnter: a.useCallback(
          (C) => {
            Q(C) && C.preventDefault();
          },
          [Q]
        ),
        onItemLeave: a.useCallback(
          (C) => {
            var F;
            Q(C) || ((F = I.current) == null || F.focus(), x(null));
          },
          [Q]
        ),
        onTriggerLeave: a.useCallback(
          (C) => {
            Q(C) && C.preventDefault();
          },
          [Q]
        ),
        pointerGraceTimerRef: D,
        onPointerGraceIntentChange: a.useCallback((C) => {
          q.current = C;
        }, []),
        children: /* @__PURE__ */ h(Le, { ...K, children: /* @__PURE__ */ h(
          _t,
          {
            asChild: !0,
            trapped: o,
            onMountAutoFocus: R(c, (C) => {
              var F;
              C.preventDefault(), (F = I.current) == null || F.focus({ preventScroll: !0 });
            }),
            onUnmountAutoFocus: s,
            children: /* @__PURE__ */ h(
              Vr,
              {
                asChild: !0,
                disableOutsidePointerEvents: l,
                onEscapeKeyDown: v,
                onPointerDownOutside: u,
                onFocusOutside: i,
                onInteractOutside: d,
                onDismiss: p,
                children: /* @__PURE__ */ h(
                  Qn,
                  {
                    asChild: !0,
                    ...E,
                    dir: b.dir,
                    orientation: "vertical",
                    loop: n,
                    currentTabStopId: P,
                    onCurrentTabStopIdChange: x,
                    onEntryFocus: R(f, (C) => {
                      b.isUsingKeyboardRef.current || C.preventDefault();
                    }),
                    preventScrollOnEntryFocus: !0,
                    children: /* @__PURE__ */ h(
                      Wr,
                      {
                        role: "menu",
                        "aria-orientation": "vertical",
                        "data-state": pr(S.open),
                        "data-radix-menu-content": "",
                        dir: b.dir,
                        ...w,
                        ...m,
                        ref: T,
                        style: { outline: "none", ...m.style },
                        onKeyDown: R(m.onKeyDown, (C) => {
                          const B = C.target.closest("[data-radix-menu-content]") === C.currentTarget, G = C.ctrlKey || C.altKey || C.metaKey, Oe = C.key.length === 1;
                          B && (C.key === "Tab" && C.preventDefault(), !G && Oe && Ir(C.key));
                          const De = I.current;
                          if (C.target !== De || !ao.includes(C.key)) return;
                          C.preventDefault();
                          const ae = y().filter((J) => !J.disabled).map((J) => J.ref.current);
                          Xt.includes(C.key) && ae.reverse(), Mo(ae);
                        }),
                        onBlur: R(e.onBlur, (C) => {
                          C.currentTarget.contains(C.target) || (window.clearTimeout(M.current), A.current = "");
                        }),
                        onPointerMove: R(
                          e.onPointerMove,
                          ie((C) => {
                            const F = C.target, B = me.current !== C.clientX;
                            if (C.currentTarget.contains(F) && B) {
                              const G = C.clientX > me.current ? "right" : "left";
                              ve.current = G, me.current = C.clientX;
                            }
                          })
                        )
                      }
                    )
                  }
                )
              }
            )
          }
        ) })
      }
    );
  }
);
Jt.displayName = k;
var go = "MenuGroup", et = a.forwardRef(
  (e, t) => {
    const { __scopeMenu: r, ...n } = e;
    return /* @__PURE__ */ h(O.div, { role: "group", ...n, ref: t });
  }
);
et.displayName = go;
var bo = "MenuLabel", er = a.forwardRef(
  (e, t) => {
    const { __scopeMenu: r, ...n } = e;
    return /* @__PURE__ */ h(O.div, { ...n, ref: t });
  }
);
er.displayName = bo;
var Ee = "MenuItem", Ct = "menu.itemSelect", Ie = a.forwardRef(
  (e, t) => {
    const { disabled: r = !1, onSelect: n, ...o } = e, c = a.useRef(null), s = fe(Ee, e.__scopeMenu), l = Qe(Ee, e.__scopeMenu), f = N(t, c), v = a.useRef(!1), u = () => {
      const i = c.current;
      if (!r && i) {
        const d = new CustomEvent(Ct, { bubbles: !0, cancelable: !0 });
        i.addEventListener(Ct, (p) => n == null ? void 0 : n(p), { once: !0 }), Lr(i, d), d.defaultPrevented ? v.current = !1 : s.onClose();
      }
    };
    return /* @__PURE__ */ h(
      tr,
      {
        ...o,
        ref: f,
        disabled: r,
        onClick: R(e.onClick, u),
        onPointerDown: (i) => {
          var d;
          (d = e.onPointerDown) == null || d.call(e, i), v.current = !0;
        },
        onPointerUp: R(e.onPointerUp, (i) => {
          var d;
          v.current || (d = i.currentTarget) == null || d.click();
        }),
        onKeyDown: R(e.onKeyDown, (i) => {
          const d = l.searchRef.current !== "";
          r || d && i.key === " " || $e.includes(i.key) && (i.currentTarget.click(), i.preventDefault());
        })
      }
    );
  }
);
Ie.displayName = Ee;
var tr = a.forwardRef(
  (e, t) => {
    const { __scopeMenu: r, disabled: n = !1, textValue: o, ...c } = e, s = Qe(Ee, r), l = $t(r), f = a.useRef(null), v = N(t, f), [u, i] = a.useState(!1), [d, p] = a.useState("");
    return a.useEffect(() => {
      const g = f.current;
      g && p((g.textContent ?? "").trim());
    }, [c.children]), /* @__PURE__ */ h(
      se.ItemSlot,
      {
        scope: r,
        disabled: n,
        textValue: o ?? d,
        children: /* @__PURE__ */ h(Jn, { asChild: !0, ...l, focusable: !n, children: /* @__PURE__ */ h(
          O.div,
          {
            role: "menuitem",
            "data-highlighted": u ? "" : void 0,
            "aria-disabled": n || void 0,
            "data-disabled": n ? "" : void 0,
            ...c,
            ref: v,
            onPointerMove: R(
              e.onPointerMove,
              ie((g) => {
                n ? s.onItemLeave(g) : (s.onItemEnter(g), g.defaultPrevented || g.currentTarget.focus({ preventScroll: !0 }));
              })
            ),
            onPointerLeave: R(
              e.onPointerLeave,
              ie((g) => s.onItemLeave(g))
            ),
            onFocus: R(e.onFocus, () => i(!0)),
            onBlur: R(e.onBlur, () => i(!1))
          }
        ) })
      }
    );
  }
), So = "MenuCheckboxItem", rr = a.forwardRef(
  (e, t) => {
    const { checked: r = !1, onCheckedChange: n, ...o } = e;
    return /* @__PURE__ */ h(lr, { scope: e.__scopeMenu, checked: r, children: /* @__PURE__ */ h(
      Ie,
      {
        role: "menuitemcheckbox",
        "aria-checked": ye(r) ? "mixed" : r,
        ...o,
        ref: t,
        "data-state": nt(r),
        onSelect: R(
          o.onSelect,
          () => n == null ? void 0 : n(ye(r) ? !0 : !r),
          { checkForDefaultPrevented: !1 }
        )
      }
    ) });
  }
);
rr.displayName = So;
var nr = "MenuRadioGroup", [wo, Co] = Z(
  nr,
  { value: void 0, onValueChange: () => {
  } }
), or = a.forwardRef(
  (e, t) => {
    const { value: r, onValueChange: n, ...o } = e, c = L(n);
    return /* @__PURE__ */ h(wo, { scope: e.__scopeMenu, value: r, onValueChange: c, children: /* @__PURE__ */ h(et, { ...o, ref: t }) });
  }
);
or.displayName = nr;
var ar = "MenuRadioItem", cr = a.forwardRef(
  (e, t) => {
    const { value: r, ...n } = e, o = Co(ar, e.__scopeMenu), c = r === o.value;
    return /* @__PURE__ */ h(lr, { scope: e.__scopeMenu, checked: c, children: /* @__PURE__ */ h(
      Ie,
      {
        role: "menuitemradio",
        "aria-checked": c,
        ...n,
        ref: t,
        "data-state": nt(c),
        onSelect: R(
          n.onSelect,
          () => {
            var s;
            return (s = o.onValueChange) == null ? void 0 : s.call(o, r);
          },
          { checkForDefaultPrevented: !1 }
        )
      }
    ) });
  }
);
cr.displayName = ar;
var tt = "MenuItemIndicator", [lr, Eo] = Z(
  tt,
  { checked: !1 }
), sr = a.forwardRef(
  (e, t) => {
    const { __scopeMenu: r, forceMount: n, ...o } = e, c = Eo(tt, r);
    return /* @__PURE__ */ h(
      Y,
      {
        present: n || ye(c.checked) || c.checked === !0,
        children: /* @__PURE__ */ h(
          O.span,
          {
            ...o,
            ref: t,
            "data-state": nt(c.checked)
          }
        )
      }
    );
  }
);
sr.displayName = tt;
var yo = "MenuSeparator", ir = a.forwardRef(
  (e, t) => {
    const { __scopeMenu: r, ...n } = e;
    return /* @__PURE__ */ h(
      O.div,
      {
        role: "separator",
        "aria-orientation": "horizontal",
        ...n,
        ref: t
      }
    );
  }
);
ir.displayName = yo;
var Ro = "MenuArrow", ur = a.forwardRef(
  (e, t) => {
    const { __scopeMenu: r, ...n } = e, o = de(r);
    return /* @__PURE__ */ h(Kr, { ...o, ...n, ref: t });
  }
);
ur.displayName = Ro;
var rt = "MenuSub", [Po, dr] = Z(rt), fr = (e) => {
  const { __scopeMenu: t, children: r, open: n = !1, onOpenChange: o } = e, c = X(rt, t), s = de(t), [l, f] = a.useState(null), [v, u] = a.useState(null), i = L(o);
  return a.useEffect(() => (c.open === !1 && i(!1), () => i(!1)), [c.open, i]), /* @__PURE__ */ h(Mt, { ...s, children: /* @__PURE__ */ h(
    jt,
    {
      scope: t,
      open: n,
      onOpenChange: i,
      content: v,
      onContentChange: u,
      children: /* @__PURE__ */ h(
        Po,
        {
          scope: t,
          contentId: ze(),
          triggerId: ze(),
          trigger: l,
          onTriggerChange: f,
          children: r
        }
      )
    }
  ) });
};
fr.displayName = rt;
var le = "MenuSubTrigger", vr = a.forwardRef(
  (e, t) => {
    const r = X(le, e.__scopeMenu), n = fe(le, e.__scopeMenu), o = dr(le, e.__scopeMenu), c = Qe(le, e.__scopeMenu), s = a.useRef(null), { pointerGraceTimerRef: l, onPointerGraceIntentChange: f } = c, v = { __scopeMenu: e.__scopeMenu }, u = a.useCallback(() => {
      s.current && window.clearTimeout(s.current), s.current = null;
    }, []);
    return a.useEffect(() => u, [u]), a.useEffect(() => {
      const i = l.current;
      return () => {
        window.clearTimeout(i), f(null);
      };
    }, [l, f]), /* @__PURE__ */ h(Ze, { asChild: !0, ...v, children: /* @__PURE__ */ h(
      tr,
      {
        id: o.triggerId,
        "aria-haspopup": "menu",
        "aria-expanded": r.open,
        "aria-controls": o.contentId,
        "data-state": pr(r.open),
        ...e,
        ref: Or(t, o.onTriggerChange),
        onClick: (i) => {
          var d;
          (d = e.onClick) == null || d.call(e, i), !(e.disabled || i.defaultPrevented) && (i.currentTarget.focus(), r.open || r.onOpenChange(!0));
        },
        onPointerMove: R(
          e.onPointerMove,
          ie((i) => {
            c.onItemEnter(i), !i.defaultPrevented && !e.disabled && !r.open && !s.current && (c.onPointerGraceIntentChange(null), s.current = window.setTimeout(() => {
              r.onOpenChange(!0), u();
            }, 100));
          })
        ),
        onPointerLeave: R(
          e.onPointerLeave,
          ie((i) => {
            var p, g;
            u();
            const d = (p = r.content) == null ? void 0 : p.getBoundingClientRect();
            if (d) {
              const m = (g = r.content) == null ? void 0 : g.dataset.side, S = m === "right", b = S ? -5 : 5, w = d[S ? "left" : "right"], E = d[S ? "right" : "left"];
              c.onPointerGraceIntentChange({
                area: [
                  // Apply a bleed on clientX to ensure that our exit point is
                  // consistently within polygon bounds
                  { x: i.clientX + b, y: i.clientY },
                  { x: w, y: d.top },
                  { x: E, y: d.top },
                  { x: E, y: d.bottom },
                  { x: w, y: d.bottom }
                ],
                side: m
              }), window.clearTimeout(l.current), l.current = window.setTimeout(
                () => c.onPointerGraceIntentChange(null),
                300
              );
            } else {
              if (c.onTriggerLeave(i), i.defaultPrevented) return;
              c.onPointerGraceIntentChange(null);
            }
          })
        ),
        onKeyDown: R(e.onKeyDown, (i) => {
          var p;
          const d = c.searchRef.current !== "";
          e.disabled || d && i.key === " " || co[n.dir].includes(i.key) && (r.onOpenChange(!0), (p = r.content) == null || p.focus(), i.preventDefault());
        })
      }
    ) });
  }
);
vr.displayName = le;
var mr = "MenuSubContent", hr = a.forwardRef(
  (e, t) => {
    const r = qt(k, e.__scopeMenu), { forceMount: n = r.forceMount, ...o } = e, c = X(k, e.__scopeMenu), s = fe(k, e.__scopeMenu), l = dr(mr, e.__scopeMenu), f = a.useRef(null), v = N(t, f);
    return /* @__PURE__ */ h(se.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ h(Y, { present: n || c.open, children: /* @__PURE__ */ h(se.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ h(
      Je,
      {
        id: l.contentId,
        "aria-labelledby": l.triggerId,
        ...o,
        ref: v,
        align: "start",
        side: s.dir === "rtl" ? "left" : "right",
        disableOutsidePointerEvents: !1,
        disableOutsideScroll: !1,
        trapFocus: !1,
        onOpenAutoFocus: (u) => {
          var i;
          s.isUsingKeyboardRef.current && ((i = f.current) == null || i.focus()), u.preventDefault();
        },
        onCloseAutoFocus: (u) => u.preventDefault(),
        onFocusOutside: R(e.onFocusOutside, (u) => {
          u.target !== l.trigger && c.onOpenChange(!1);
        }),
        onEscapeKeyDown: R(e.onEscapeKeyDown, (u) => {
          s.onClose(), u.preventDefault();
        }),
        onKeyDown: R(e.onKeyDown, (u) => {
          var p;
          const i = u.currentTarget.contains(u.target), d = lo[s.dir].includes(u.key);
          i && d && (c.onOpenChange(!1), (p = l.trigger) == null || p.focus(), u.preventDefault());
        })
      }
    ) }) }) });
  }
);
hr.displayName = mr;
function pr(e) {
  return e ? "open" : "closed";
}
function ye(e) {
  return e === "indeterminate";
}
function nt(e) {
  return ye(e) ? "indeterminate" : e ? "checked" : "unchecked";
}
function Mo(e) {
  const t = document.activeElement;
  for (const r of e)
    if (r === t || (r.focus(), document.activeElement !== t)) return;
}
function To(e, t) {
  return e.map((r, n) => e[(t + n) % e.length]);
}
function Ao(e, t, r) {
  const o = t.length > 1 && Array.from(t).every((v) => v === t[0]) ? t[0] : t, c = r ? e.indexOf(r) : -1;
  let s = To(e, Math.max(c, 0));
  o.length === 1 && (s = s.filter((v) => v !== r));
  const f = s.find(
    (v) => v.toLowerCase().startsWith(o.toLowerCase())
  );
  return f !== r ? f : void 0;
}
function _o(e, t) {
  const { x: r, y: n } = e;
  let o = !1;
  for (let c = 0, s = t.length - 1; c < t.length; s = c++) {
    const l = t[c].x, f = t[c].y, v = t[s].x, u = t[s].y;
    f > n != u > n && r < (v - l) * (n - f) / (u - f) + l && (o = !o);
  }
  return o;
}
function Io(e, t) {
  if (!t) return !1;
  const r = { x: e.clientX, y: e.clientY };
  return _o(r, t);
}
function ie(e) {
  return (t) => t.pointerType === "mouse" ? e(t) : void 0;
}
var aa = Zt, ca = Ze, la = Qt, sa = Jt, ia = et, ua = er, da = Ie, fa = rr, va = or, ma = cr, ha = sr, pa = ir, ga = ur, ba = fr, Sa = vr, wa = hr;
function xo(e, [t, r]) {
  return Math.min(r, Math.max(t, e));
}
function No(e, t) {
  return a.useReducer((r, n) => t[r][n] ?? r, e);
}
var ot = "ScrollArea", [gr, Ca] = Me(ot), [Lo, U] = gr(ot), br = a.forwardRef(
  (e, t) => {
    const {
      __scopeScrollArea: r,
      type: n = "hover",
      dir: o,
      scrollHideDelay: c = 600,
      ...s
    } = e, [l, f] = a.useState(null), [v, u] = a.useState(null), [i, d] = a.useState(null), [p, g] = a.useState(null), [m, S] = a.useState(null), [b, w] = a.useState(0), [E, y] = a.useState(0), [P, x] = a.useState(!1), [I, T] = a.useState(!1), M = N(t, (D) => f(D)), A = je(o);
    return /* @__PURE__ */ h(
      Lo,
      {
        scope: r,
        type: n,
        dir: A,
        scrollHideDelay: c,
        scrollArea: l,
        viewport: v,
        onViewportChange: u,
        content: i,
        onContentChange: d,
        scrollbarX: p,
        onScrollbarXChange: g,
        scrollbarXEnabled: P,
        onScrollbarXEnabledChange: x,
        scrollbarY: m,
        onScrollbarYChange: S,
        scrollbarYEnabled: I,
        onScrollbarYEnabledChange: T,
        onCornerWidthChange: w,
        onCornerHeightChange: y,
        children: /* @__PURE__ */ h(
          O.div,
          {
            dir: A,
            ...s,
            ref: M,
            style: {
              position: "relative",
              // Pass corner sizes as CSS vars to reduce re-renders of context consumers
              "--radix-scroll-area-corner-width": b + "px",
              "--radix-scroll-area-corner-height": E + "px",
              ...e.style
            }
          }
        )
      }
    );
  }
);
br.displayName = ot;
var Sr = "ScrollAreaViewport", wr = a.forwardRef(
  (e, t) => {
    const { __scopeScrollArea: r, children: n, nonce: o, ...c } = e, s = U(Sr, r), l = a.useRef(null), f = N(t, l, s.onViewportChange);
    return /* @__PURE__ */ Fr(kr, { children: [
      /* @__PURE__ */ h(
        "style",
        {
          dangerouslySetInnerHTML: {
            __html: "[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"
          },
          nonce: o
        }
      ),
      /* @__PURE__ */ h(
        O.div,
        {
          "data-radix-scroll-area-viewport": "",
          ...c,
          ref: f,
          style: {
            /**
             * We don't support `visible` because the intention is to have at least one scrollbar
             * if this component is used and `visible` will behave like `auto` in that case
             * https://developer.mozilla.org/en-US/docs/Web/CSS/overflowed#description
             *
             * We don't handle `auto` because the intention is for the native implementation
             * to be hidden if using this component. We just want to ensure the node is scrollable
             * so could have used either `scroll` or `auto` here. We picked `scroll` to prevent
             * the browser from having to work out whether to render native scrollbars or not,
             * we tell it to with the intention of hiding them in CSS.
             */
            overflowX: s.scrollbarXEnabled ? "scroll" : "hidden",
            overflowY: s.scrollbarYEnabled ? "scroll" : "hidden",
            ...e.style
          },
          children: /* @__PURE__ */ h("div", { ref: s.onContentChange, style: { minWidth: "100%", display: "table" }, children: n })
        }
      )
    ] });
  }
);
wr.displayName = Sr;
var W = "ScrollAreaScrollbar", Cr = a.forwardRef(
  (e, t) => {
    const { forceMount: r, ...n } = e, o = U(W, e.__scopeScrollArea), { onScrollbarXEnabledChange: c, onScrollbarYEnabledChange: s } = o, l = e.orientation === "horizontal";
    return a.useEffect(() => (l ? c(!0) : s(!0), () => {
      l ? c(!1) : s(!1);
    }), [l, c, s]), o.type === "hover" ? /* @__PURE__ */ h(Oo, { ...n, ref: t, forceMount: r }) : o.type === "scroll" ? /* @__PURE__ */ h(Do, { ...n, ref: t, forceMount: r }) : o.type === "auto" ? /* @__PURE__ */ h(Er, { ...n, ref: t, forceMount: r }) : o.type === "always" ? /* @__PURE__ */ h(at, { ...n, ref: t }) : null;
  }
);
Cr.displayName = W;
var Oo = a.forwardRef((e, t) => {
  const { forceMount: r, ...n } = e, o = U(W, e.__scopeScrollArea), [c, s] = a.useState(!1);
  return a.useEffect(() => {
    const l = o.scrollArea;
    let f = 0;
    if (l) {
      const v = () => {
        window.clearTimeout(f), s(!0);
      }, u = () => {
        f = window.setTimeout(() => s(!1), o.scrollHideDelay);
      };
      return l.addEventListener("pointerenter", v), l.addEventListener("pointerleave", u), () => {
        window.clearTimeout(f), l.removeEventListener("pointerenter", v), l.removeEventListener("pointerleave", u);
      };
    }
  }, [o.scrollArea, o.scrollHideDelay]), /* @__PURE__ */ h(Y, { present: r || c, children: /* @__PURE__ */ h(
    Er,
    {
      "data-state": c ? "visible" : "hidden",
      ...n,
      ref: t
    }
  ) });
}), Do = a.forwardRef((e, t) => {
  const { forceMount: r, ...n } = e, o = U(W, e.__scopeScrollArea), c = e.orientation === "horizontal", s = Ne(() => f("SCROLL_END"), 100), [l, f] = No("hidden", {
    hidden: {
      SCROLL: "scrolling"
    },
    scrolling: {
      SCROLL_END: "idle",
      POINTER_ENTER: "interacting"
    },
    interacting: {
      SCROLL: "interacting",
      POINTER_LEAVE: "idle"
    },
    idle: {
      HIDE: "hidden",
      SCROLL: "scrolling",
      POINTER_ENTER: "interacting"
    }
  });
  return a.useEffect(() => {
    if (l === "idle") {
      const v = window.setTimeout(() => f("HIDE"), o.scrollHideDelay);
      return () => window.clearTimeout(v);
    }
  }, [l, o.scrollHideDelay, f]), a.useEffect(() => {
    const v = o.viewport, u = c ? "scrollLeft" : "scrollTop";
    if (v) {
      let i = v[u];
      const d = () => {
        const p = v[u];
        i !== p && (f("SCROLL"), s()), i = p;
      };
      return v.addEventListener("scroll", d), () => v.removeEventListener("scroll", d);
    }
  }, [o.viewport, c, f, s]), /* @__PURE__ */ h(Y, { present: r || l !== "hidden", children: /* @__PURE__ */ h(
    at,
    {
      "data-state": l === "hidden" ? "hidden" : "visible",
      ...n,
      ref: t,
      onPointerEnter: R(e.onPointerEnter, () => f("POINTER_ENTER")),
      onPointerLeave: R(e.onPointerLeave, () => f("POINTER_LEAVE"))
    }
  ) });
}), Er = a.forwardRef((e, t) => {
  const r = U(W, e.__scopeScrollArea), { forceMount: n, ...o } = e, [c, s] = a.useState(!1), l = e.orientation === "horizontal", f = Ne(() => {
    if (r.viewport) {
      const v = r.viewport.offsetWidth < r.viewport.scrollWidth, u = r.viewport.offsetHeight < r.viewport.scrollHeight;
      s(l ? v : u);
    }
  }, 10);
  return oe(r.viewport, f), oe(r.content, f), /* @__PURE__ */ h(Y, { present: n || c, children: /* @__PURE__ */ h(
    at,
    {
      "data-state": c ? "visible" : "hidden",
      ...o,
      ref: t
    }
  ) });
}), at = a.forwardRef((e, t) => {
  const { orientation: r = "vertical", ...n } = e, o = U(W, e.__scopeScrollArea), c = a.useRef(null), s = a.useRef(0), [l, f] = a.useState({
    content: 0,
    viewport: 0,
    scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
  }), v = Tr(l.viewport, l.content), u = {
    ...n,
    sizes: l,
    onSizesChange: f,
    hasThumb: v > 0 && v < 1,
    onThumbChange: (d) => c.current = d,
    onThumbPointerUp: () => s.current = 0,
    onThumbPointerDown: (d) => s.current = d
  };
  function i(d, p) {
    return Wo(d, s.current, l, p);
  }
  return r === "horizontal" ? /* @__PURE__ */ h(
    Fo,
    {
      ...u,
      ref: t,
      onThumbPositionChange: () => {
        if (o.viewport && c.current) {
          const d = o.viewport.scrollLeft, p = Et(d, l, o.dir);
          c.current.style.transform = `translate3d(${p}px, 0, 0)`;
        }
      },
      onWheelScroll: (d) => {
        o.viewport && (o.viewport.scrollLeft = d);
      },
      onDragScroll: (d) => {
        o.viewport && (o.viewport.scrollLeft = i(d, o.dir));
      }
    }
  ) : r === "vertical" ? /* @__PURE__ */ h(
    ko,
    {
      ...u,
      ref: t,
      onThumbPositionChange: () => {
        if (o.viewport && c.current) {
          const d = o.viewport.scrollTop, p = Et(d, l);
          c.current.style.transform = `translate3d(0, ${p}px, 0)`;
        }
      },
      onWheelScroll: (d) => {
        o.viewport && (o.viewport.scrollTop = d);
      },
      onDragScroll: (d) => {
        o.viewport && (o.viewport.scrollTop = i(d));
      }
    }
  ) : null;
}), Fo = a.forwardRef((e, t) => {
  const { sizes: r, onSizesChange: n, ...o } = e, c = U(W, e.__scopeScrollArea), [s, l] = a.useState(), f = a.useRef(null), v = N(t, f, c.onScrollbarXChange);
  return a.useEffect(() => {
    f.current && l(getComputedStyle(f.current));
  }, [f]), /* @__PURE__ */ h(
    Rr,
    {
      "data-orientation": "horizontal",
      ...o,
      ref: v,
      sizes: r,
      style: {
        bottom: 0,
        left: c.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
        right: c.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
        "--radix-scroll-area-thumb-width": xe(r) + "px",
        ...e.style
      },
      onThumbPointerDown: (u) => e.onThumbPointerDown(u.x),
      onDragScroll: (u) => e.onDragScroll(u.x),
      onWheelScroll: (u, i) => {
        if (c.viewport) {
          const d = c.viewport.scrollLeft + u.deltaX;
          e.onWheelScroll(d), _r(d, i) && u.preventDefault();
        }
      },
      onResize: () => {
        f.current && c.viewport && s && n({
          content: c.viewport.scrollWidth,
          viewport: c.viewport.offsetWidth,
          scrollbar: {
            size: f.current.clientWidth,
            paddingStart: Pe(s.paddingLeft),
            paddingEnd: Pe(s.paddingRight)
          }
        });
      }
    }
  );
}), ko = a.forwardRef((e, t) => {
  const { sizes: r, onSizesChange: n, ...o } = e, c = U(W, e.__scopeScrollArea), [s, l] = a.useState(), f = a.useRef(null), v = N(t, f, c.onScrollbarYChange);
  return a.useEffect(() => {
    f.current && l(getComputedStyle(f.current));
  }, [f]), /* @__PURE__ */ h(
    Rr,
    {
      "data-orientation": "vertical",
      ...o,
      ref: v,
      sizes: r,
      style: {
        top: 0,
        right: c.dir === "ltr" ? 0 : void 0,
        left: c.dir === "rtl" ? 0 : void 0,
        bottom: "var(--radix-scroll-area-corner-height)",
        "--radix-scroll-area-thumb-height": xe(r) + "px",
        ...e.style
      },
      onThumbPointerDown: (u) => e.onThumbPointerDown(u.y),
      onDragScroll: (u) => e.onDragScroll(u.y),
      onWheelScroll: (u, i) => {
        if (c.viewport) {
          const d = c.viewport.scrollTop + u.deltaY;
          e.onWheelScroll(d), _r(d, i) && u.preventDefault();
        }
      },
      onResize: () => {
        f.current && c.viewport && s && n({
          content: c.viewport.scrollHeight,
          viewport: c.viewport.offsetHeight,
          scrollbar: {
            size: f.current.clientHeight,
            paddingStart: Pe(s.paddingTop),
            paddingEnd: Pe(s.paddingBottom)
          }
        });
      }
    }
  );
}), [Uo, yr] = gr(W), Rr = a.forwardRef((e, t) => {
  const {
    __scopeScrollArea: r,
    sizes: n,
    hasThumb: o,
    onThumbChange: c,
    onThumbPointerUp: s,
    onThumbPointerDown: l,
    onThumbPositionChange: f,
    onDragScroll: v,
    onWheelScroll: u,
    onResize: i,
    ...d
  } = e, p = U(W, r), [g, m] = a.useState(null), S = N(t, (M) => m(M)), b = a.useRef(null), w = a.useRef(""), E = p.viewport, y = n.content - n.viewport, P = L(u), x = L(f), I = Ne(i, 10);
  function T(M) {
    if (b.current) {
      const A = M.clientX - b.current.left, D = M.clientY - b.current.top;
      v({ x: A, y: D });
    }
  }
  return a.useEffect(() => {
    const M = (A) => {
      const D = A.target;
      (g == null ? void 0 : g.contains(D)) && P(A, y);
    };
    return document.addEventListener("wheel", M, { passive: !1 }), () => document.removeEventListener("wheel", M, { passive: !1 });
  }, [E, g, y, P]), a.useEffect(x, [n, x]), oe(g, I), oe(p.content, I), /* @__PURE__ */ h(
    Uo,
    {
      scope: r,
      scrollbar: g,
      hasThumb: o,
      onThumbChange: L(c),
      onThumbPointerUp: L(s),
      onThumbPositionChange: x,
      onThumbPointerDown: L(l),
      children: /* @__PURE__ */ h(
        O.div,
        {
          ...d,
          ref: S,
          style: { position: "absolute", ...d.style },
          onPointerDown: R(e.onPointerDown, (M) => {
            M.button === 0 && (M.target.setPointerCapture(M.pointerId), b.current = g.getBoundingClientRect(), w.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", p.viewport && (p.viewport.style.scrollBehavior = "auto"), T(M));
          }),
          onPointerMove: R(e.onPointerMove, T),
          onPointerUp: R(e.onPointerUp, (M) => {
            const A = M.target;
            A.hasPointerCapture(M.pointerId) && A.releasePointerCapture(M.pointerId), document.body.style.webkitUserSelect = w.current, p.viewport && (p.viewport.style.scrollBehavior = ""), b.current = null;
          })
        }
      )
    }
  );
}), Re = "ScrollAreaThumb", Pr = a.forwardRef(
  (e, t) => {
    const { forceMount: r, ...n } = e, o = yr(Re, e.__scopeScrollArea);
    return /* @__PURE__ */ h(Y, { present: r || o.hasThumb, children: /* @__PURE__ */ h(Bo, { ref: t, ...n }) });
  }
), Bo = a.forwardRef(
  (e, t) => {
    const { __scopeScrollArea: r, style: n, ...o } = e, c = U(Re, r), s = yr(Re, r), { onThumbPositionChange: l } = s, f = N(
      t,
      (i) => s.onThumbChange(i)
    ), v = a.useRef(), u = Ne(() => {
      v.current && (v.current(), v.current = void 0);
    }, 100);
    return a.useEffect(() => {
      const i = c.viewport;
      if (i) {
        const d = () => {
          if (u(), !v.current) {
            const p = Ko(i, l);
            v.current = p, l();
          }
        };
        return l(), i.addEventListener("scroll", d), () => i.removeEventListener("scroll", d);
      }
    }, [c.viewport, u, l]), /* @__PURE__ */ h(
      O.div,
      {
        "data-state": s.hasThumb ? "visible" : "hidden",
        ...o,
        ref: f,
        style: {
          width: "var(--radix-scroll-area-thumb-width)",
          height: "var(--radix-scroll-area-thumb-height)",
          ...n
        },
        onPointerDownCapture: R(e.onPointerDownCapture, (i) => {
          const p = i.target.getBoundingClientRect(), g = i.clientX - p.left, m = i.clientY - p.top;
          s.onThumbPointerDown({ x: g, y: m });
        }),
        onPointerUp: R(e.onPointerUp, s.onThumbPointerUp)
      }
    );
  }
);
Pr.displayName = Re;
var ct = "ScrollAreaCorner", Mr = a.forwardRef(
  (e, t) => {
    const r = U(ct, e.__scopeScrollArea), n = !!(r.scrollbarX && r.scrollbarY);
    return r.type !== "scroll" && n ? /* @__PURE__ */ h(Vo, { ...e, ref: t }) : null;
  }
);
Mr.displayName = ct;
var Vo = a.forwardRef((e, t) => {
  const { __scopeScrollArea: r, ...n } = e, o = U(ct, r), [c, s] = a.useState(0), [l, f] = a.useState(0), v = !!(c && l);
  return oe(o.scrollbarX, () => {
    var i;
    const u = ((i = o.scrollbarX) == null ? void 0 : i.offsetHeight) || 0;
    o.onCornerHeightChange(u), f(u);
  }), oe(o.scrollbarY, () => {
    var i;
    const u = ((i = o.scrollbarY) == null ? void 0 : i.offsetWidth) || 0;
    o.onCornerWidthChange(u), s(u);
  }), v ? /* @__PURE__ */ h(
    O.div,
    {
      ...n,
      ref: t,
      style: {
        width: c,
        height: l,
        position: "absolute",
        right: o.dir === "ltr" ? 0 : void 0,
        left: o.dir === "rtl" ? 0 : void 0,
        bottom: 0,
        ...e.style
      }
    }
  ) : null;
});
function Pe(e) {
  return e ? parseInt(e, 10) : 0;
}
function Tr(e, t) {
  const r = e / t;
  return isNaN(r) ? 0 : r;
}
function xe(e) {
  const t = Tr(e.viewport, e.content), r = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, n = (e.scrollbar.size - r) * t;
  return Math.max(n, 18);
}
function Wo(e, t, r, n = "ltr") {
  const o = xe(r), c = o / 2, s = t || c, l = o - s, f = r.scrollbar.paddingStart + s, v = r.scrollbar.size - r.scrollbar.paddingEnd - l, u = r.content - r.viewport, i = n === "ltr" ? [0, u] : [u * -1, 0];
  return Ar([f, v], i)(e);
}
function Et(e, t, r = "ltr") {
  const n = xe(t), o = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, c = t.scrollbar.size - o, s = t.content - t.viewport, l = c - n, f = r === "ltr" ? [0, s] : [s * -1, 0], v = xo(e, f);
  return Ar([0, s], [0, l])(v);
}
function Ar(e, t) {
  return (r) => {
    if (e[0] === e[1] || t[0] === t[1]) return t[0];
    const n = (t[1] - t[0]) / (e[1] - e[0]);
    return t[0] + n * (r - e[0]);
  };
}
function _r(e, t) {
  return e > 0 && e < t;
}
var Ko = (e, t = () => {
}) => {
  let r = { left: e.scrollLeft, top: e.scrollTop }, n = 0;
  return function o() {
    const c = { left: e.scrollLeft, top: e.scrollTop }, s = r.left !== c.left, l = r.top !== c.top;
    (s || l) && t(), r = c, n = window.requestAnimationFrame(o);
  }(), () => window.cancelAnimationFrame(n);
};
function Ne(e, t) {
  const r = L(e), n = a.useRef(0);
  return a.useEffect(() => () => window.clearTimeout(n.current), []), a.useCallback(() => {
    window.clearTimeout(n.current), n.current = window.setTimeout(r, t);
  }, [r, t]);
}
function oe(e, t) {
  const r = L(t);
  Dr(() => {
    let n = 0;
    if (e) {
      const o = new ResizeObserver(() => {
        cancelAnimationFrame(n), n = window.requestAnimationFrame(r);
      });
      return o.observe(e), () => {
        window.cancelAnimationFrame(n), o.unobserve(e);
      };
    }
  }, [e, r]);
}
var Ho = br, Go = wr, yt = Cr, Rt = Pr, zo = Mr;
const Yo = ["1", "2", "3"], ce = { ...Tt, size: { values: Yo, default: "1" }, ...Hr, scrollbars: { default: "both" } };
function Xo(e) {
  const { m: t, mx: r, my: n, mt: o, mr: c, mb: s, ml: l, ...f } = e;
  return { m: t, mx: r, my: n, mt: o, mr: c, mb: s, ml: l, rest: f };
}
const j = Gr.m.values;
function $o(e) {
  const [t, r] = $({ className: "rt-r-m", customProperties: ["--margin"], propValues: j, value: e.m }), [n, o] = $({ className: "rt-r-mx", customProperties: ["--margin-left", "--margin-right"], propValues: j, value: e.mx }), [c, s] = $({ className: "rt-r-my", customProperties: ["--margin-top", "--margin-bottom"], propValues: j, value: e.my }), [l, f] = $({ className: "rt-r-mt", customProperties: ["--margin-top"], propValues: j, value: e.mt }), [v, u] = $({ className: "rt-r-mr", customProperties: ["--margin-right"], propValues: j, value: e.mr }), [i, d] = $({ className: "rt-r-mb", customProperties: ["--margin-bottom"], propValues: j, value: e.mb }), [p, g] = $({ className: "rt-r-ml", customProperties: ["--margin-left"], propValues: j, value: e.ml });
  return [Se(t, n, c, l, v, i, p), At(r, o, s, f, u, d, g)];
}
const jo = a.forwardRef((e, t) => {
  const { rest: r, ...n } = Xo(e), [o, c] = $o(n), { asChild: s, children: l, className: f, style: v, type: u, scrollHideDelay: i = u !== "scroll" ? 0 : void 0, dir: d, size: p = ce.size.default, radius: g = ce.radius.default, scrollbars: m = ce.scrollbars.default, ...S } = r;
  return a.createElement(Ho, { type: u, scrollHideDelay: i, className: Se("rt-ScrollAreaRoot", o, f), style: At(c, v), asChild: s }, Wn({ asChild: s, children: l }, (b) => a.createElement(a.Fragment, null, a.createElement(Go, { ...S, ref: t, className: "rt-ScrollAreaViewport" }, b), a.createElement("div", { className: "rt-ScrollAreaViewportFocusRing" }), m !== "vertical" ? a.createElement(yt, { "data-radius": g, orientation: "horizontal", className: Se("rt-ScrollAreaScrollbar", ut({ className: "rt-r-size", value: p, propValues: ce.size.values })) }, a.createElement(Rt, { className: "rt-ScrollAreaThumb" })) : null, m !== "horizontal" ? a.createElement(yt, { "data-radius": g, orientation: "vertical", className: Se("rt-ScrollAreaScrollbar", ut({ className: "rt-r-size", value: p, propValues: ce.size.values })) }, a.createElement(Rt, { className: "rt-ScrollAreaThumb" })) : null, m === "both" ? a.createElement(zo, { className: "rt-ScrollAreaCorner" }) : null)));
});
jo.displayName = "ScrollArea";
const Zo = ["1", "2"], qo = ["solid", "soft"], Ea = { size: { type: "enum", className: "rt-r-size", values: Zo, default: "2", responsive: !0 }, variant: { type: "enum", className: "rt-variant", values: qo, default: "solid" }, ...Te, ...zr }, ya = { ...Tt, ...Te }, Ra = { ...Te }, Pa = { ...Te };
export {
  ca as A,
  no as B,
  sa as C,
  ba as D,
  _t as F,
  ia as G,
  Jn as I,
  ua as L,
  la as P,
  Ut as R,
  yt as S,
  Rt as T,
  Go as V,
  na as a,
  xo as b,
  Vt as c,
  Ho as d,
  Kt as e,
  Qn as f,
  oa as g,
  Vn as h,
  ro as i,
  aa as j,
  fa as k,
  ha as l,
  da as m,
  pa as n,
  va as o,
  ma as p,
  ga as q,
  Sa as r,
  wa as s,
  to as t,
  Jr as u,
  Ea as v,
  jo as w,
  Ra as x,
  ya as y,
  Pa as z
};
//# sourceMappingURL=base-menu.props.D-lzb1w2.js.map
