import{o as s}from"./index-CP7j5eJN.chunk.mjs";const l=/mac|ipad|iphone|darwin/i.test(navigator.userAgent),m=window.OCP?.Accessibility?.disableKeyboardShortcuts?.(),d=/^[a-zA-Z0-9]$/,g=/^[^\x20-\x7F]$/;function v(t){return!(t.target instanceof HTMLElement)||t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement||t.target instanceof HTMLSelectElement||t.target.isContentEditable?!0:document.getElementsByClassName("modal-mask").length!==0}function p(t,a){return e=>{if((l?e.metaKey:e.ctrlKey)===!!a.ctrl){if(e.altKey!==!!a.alt||a.shift!==void 0&&e.shiftKey!==!!a.shift||v(e))return;a.prevent&&e.preventDefault(),a.stop&&e.stopPropagation(),t(e)}}}function w(t,a=()=>{},e={}){if(m)return()=>{};const r=(n,o)=>{if(n.key===o)return!0;if(e.caseSensitive){const f=o===o.toLowerCase(),y=n.key===n.key.toLowerCase();if(f!==y)return!1}return d.test(o)&&g.test(n.key)?n.code.replace(/^(?:Key|Digit|Numpad)/,"")===o.toUpperCase():n.key.toLowerCase()===o.toLowerCase()},i=n=>typeof t=="function"?t(n):typeof t=="string"?r(n,t):Array.isArray(t)?t.some(o=>r(n,o)):!0,u=s(i,p(a,e),{eventName:"keydown",dedupe:!0,passive:!e.prevent}),c=e.push?s(i,p(a,e),{eventName:"keyup",passive:!e.prevent}):()=>{};return()=>{u(),c()}}export{w as u};
//# sourceMappingURL=useHotKey-DAjTtHos.chunk.mjs.map
