import { K as E, T as _, L as d, N as R, O as S, Q as p, R as x, U as b, V as K, W as y, X as T, Y as U, Z as L, _ as O, $ as C, a0 as H, a1 as h, a2 as j, a3 as v, a4 as N, a5 as Z, a6 as k, a7 as A, a8 as Y, a9 as w, aa as I, ab as P, ac as B, ad as F, ae as $, af as z, ag as G } from "./main-jKCzbrWn.js";
import { j as Q } from "./jsx-runtime-C5mzlN2N.js";
import { useState as V, useEffect as W, useRef as m, useCallback as f } from "react";
import { K as i, H as l } from "./css-BUXMI9PB.js";
import "./eraser-DXDDmPgV.js";
const X = (e) => {
  const { listen: o } = E(), [c, n] = V([]);
  return W(
    () => o(({ next: [s] }) => n(s ?? [])),
    [o, n]
  ), /* @__PURE__ */ Q.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: K,
  MOUSE_RIGHT_NUMBER: y,
  Provider: T,
  Status: X,
  Text: U,
  compareModeConfigs: L,
  determineMode: O,
  diff: C,
  eventKey: H,
  filter: h,
  flattenConfig: j,
  isAlphanumericKey: v,
  keyZ: N,
  keyboardKey: Z,
  match: k,
  matchCallback: A,
  mouseKey: Y,
  mouseKeyZ: w,
  purge: I,
  purgeMouse: P,
  toSymbols: B,
  triggerZ: F,
  use: d,
  useContext: E,
  useDrag: q,
  useFlattenedMemoConfig: $,
  useHeld: z,
  useHeldRef: G
}, Symbol.toStringTag, { value: "Module" }));
export {
  re as e,
  q as u
};
