import{o as s}from"./video-B2Zidy_E.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:Array.from(document.getElementsByClassName("modal-mask")).filter(n=>n.checkVisibility()).length>0}function c(t,n){return e=>{if((l?e.metaKey:e.ctrlKey)===!!n.ctrl){if(e.altKey!==!!n.alt||n.shift!==void 0&&e.shiftKey!==!!n.shift||v(e))return;n.prevent&&e.preventDefault(),n.stop&&e.stopPropagation(),t(e)}}}function k(t,n=()=>{},e={}){if(m)return()=>{};const o=(r,i)=>{if(r.key===i)return!0;if(e.caseSensitive){const u=i===i.toLowerCase(),y=r.key===r.key.toLowerCase();if(u!==y)return!1}return d.test(i)&&g.test(r.key)?r.code.replace(/^(?:Key|Digit|Numpad)/,"")===i.toUpperCase():r.key.toLowerCase()===i.toLowerCase()},a=r=>typeof t=="function"?t(r):typeof t=="string"?o(r,t):Array.isArray(t)?t.some(i=>o(r,i)):!0,f=s(a,c(n,e),{eventName:"keydown",dedupe:!0,passive:!e.prevent}),p=e.push?s(a,c(n,e),{eventName:"keyup",passive:!e.prevent}):()=>{};return()=>{f(),p()}}export{k as u};
//# sourceMappingURL=useHotKey-DcDjrX3a.chunk.mjs.map
