import { I as E, c as _, K as d, L as R, N as S, O as p, Q as x, R as b, U as y, V as K, W as U, X as L, Y as O, Z as T, _ as j, $ as C, a0 as h, a1 as v, a2 as N, a3 as Z, a4 as k, a5 as A, a6 as H, a7 as I, a8 as Y, a9 as w, aa as P, ab as B, ac as F, ad as Q, ae as $, af as z } from "./main-BINuQ9na.js";
import { j as G } from "./jsx-runtime-OVHDjVDe.js";
import { useState as V, useEffect as W, useRef as m, useCallback as f } from "react";
import { Q as i, j as l } from "./css-BYwooBtA.js";
import "./provider-CKYgKu3z.js";
const X = (e) => {
  const { listen: o } = E(), [c, n] = V([]);
  return W(
    () => o(({ next: [s] }) => n(s ?? [])),
    [o, n]
  ), /* @__PURE__ */ G.jsx(_, { ...e, children: c.join(" ") });
}, q = ({
  onDrag: e,
  triggers: o = [["MouseLeft"], ["MouseRight"]],
  bound: c,
  loose: n = !1
}) => {
  const s = m(null), u = m(i.ZERO), g = f(
    (t) => {
      const r = i.construct(t);
      if (s.current === null) return;
      const { triggers: a } = s.current;
      e({
        box: l.construct(u.current, r),
        cursor: r,
        triggers: a,
        stage: "during"
      });
    },
    [e]
  ), M = f(
    (t) => {
      const { stage: r, cursor: a } = t;
      r === "start" ? (e({ box: l.construct(a), ...t }), window.addEventListener("mousemove", g), s.current = t, u.current = a) : r === "end" && s.current != null && (e({ box: l.construct(u.current, a), ...t }), window.removeEventListener("mousemove", g), s.current = null, u.current = i.ZERO);
    },
    [e]
  );
  d({ triggers: o, callback: M, region: c, loose: n });
}, re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  ALPHANUMERIC_KEYS: R,
  ALPHANUMERIC_KEYS_SET: S,
  KEYS: p,
  MOUSE_KEYS: x,
  MOUSE_LEFT_NUMBER: b,
  MOUSE_MIDDLE_NUMBER: y,
  MOUSE_RIGHT_NUMBER: K,
  Provider: U,
  Status: X,
  Text: L,
  compareModeConfigs: O,
  determineMode: T,
  diff: j,
  eventKey: C,
  filter: h,
  flattenConfig: v,
  isAlphanumericKey: N,
  keyZ: Z,
  keyboardKey: k,
  match: A,
  matchCallback: H,
  mouseKey: I,
  mouseKeyZ: Y,
  purge: w,
  purgeMouse: P,
  toSymbols: B,
  triggerZ: F,
  use: d,
  useContext: E,
  useDrag: q,
  useFlattenedMemoConfig: Q,
  useHeld: $,
  useHeldRef: z
}, Symbol.toStringTag, { value: "Module" }));
export {
  re as e,
  q as u
};
