"use strict";const e=require("./Toggle-B8cAGDWx.cjs"),o=require("./jsx-runtime-Cek9Ww4S.cjs"),i=require("react");require("./aggregator-CoVqjgd_.cjs");const c=require("./css-Cc1vb61S.cjs");require("./Pack-BgzS2BHo.cjs");const R=require("./Keyboard-X_-hpfg9.cjs"),S=t=>{const{listen:r}=e.useContext$1(),[l,a]=i.useState([]);return i.useEffect(()=>r(({next:[s]})=>a(s??[])),[r,a]),o.jsxRuntimeExports.jsx(e.Text,{...t,children:l.join(" ")})},y={Control:()=>o.jsxRuntimeExports.jsx(e.Symbols.Meta,{},"control"),Alt:()=>o.jsxRuntimeExports.jsx(e.Symbols.Alt,{},"alt"),Shift:()=>o.jsxRuntimeExports.jsx(e.St.Keyboard.Shift,{},"shift"),MouseLeft:"Left Click",MouseRight:"Right Click",MouseMiddle:"Middle Click",Enter:()=>o.jsxRuntimeExports.jsx(e.St.Keyboard.Return,{},"enter")},x=t=>{const r=y[t];return r!=null?typeof r=="function"?r():r:t},C=t=>t.map(r=>x(r)),f=({className:t,style:r,trigger:l,children:a,...s})=>o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:l.map(n=>o.jsxRuntimeExports.jsx(R.Keyboard,{...s,children:x(n)},n))}),E=({onDrag:t,triggers:r=[["MouseLeft"],["MouseRight"]],bound:l,loose:a=!1})=>{const s=i.useRef(null),n=i.useRef(c.q.ZERO),m=i.useCallback(u=>{const d=c.q.construct(u);if(s.current===null)return;const{triggers:g}=s.current;t({box:c.To.construct(n.current,d),cursor:d,triggers:g,stage:"during"})},[t]),M=i.useCallback(u=>{const{stage:d,cursor:g}=u;d==="start"?(t({box:c.To.construct(g),...u}),window.addEventListener("mousemove",m),s.current=u,n.current=g):d==="end"&&s.current!=null&&(t({box:c.To.construct(n.current,g),...u}),window.removeEventListener("mousemove",m),s.current=null,n.current=c.q.ZERO)},[t]);e.use$2({triggers:r,callback:M,region:l,loose:a})},b=Object.freeze(Object.defineProperty({__proto__:null,ALPHANUMERIC_KEYS:e.ALPHANUMERIC_KEYS,ALPHANUMERIC_KEYS_SET:e.ALPHANUMERIC_KEYS_SET,KEYS:e.KEYS,MOUSE_KEYS:e.MOUSE_KEYS,Provider:e.Provider$1,Status:S,Text:f,compareModeConfigs:e.compareModeConfigs,determineMode:e.determineMode,diff:e.diff,eventKey:e.eventKey,filter:e.filter,flattenConfig:e.flattenConfig,keyZ:e.keyZ,keyboardKey:e.keyboardKey,match:e.match,matchCallback:e.matchCallback,mouseKey:e.mouseKey,mouseKeyZ:e.mouseKeyZ,purge:e.purge,purgeMouse:e.purgeMouse,toSymbols:C,triggerZ:e.triggerZ,use:e.use$2,useContext:e.useContext$1,useDrag:E,useFlattenedMemoConfig:e.useFlattenedMemoConfig,useHeld:e.useHeld,useHeldRef:e.useHeldRef},Symbol.toStringTag,{value:"Module"}));exports.Text=f;exports.external=b;exports.useDrag=E;
