import{n as e}from"./rolldown-runtime-Czos8NxU.js";import{Gt as t,Wt as n}from"./app-initial~app-main~remote-conversation-page~new-thread-panel-page~onboarding-page~appgen-~o4yhvtva-CRxLUCiX.js";function r(e){let t=s(e);if(t==null)return null;let n=[];return e.ctrlKey&&n.push(`Ctrl`),e.metaKey&&n.push(`Command`),e.altKey&&n.push(`Alt`),e.shiftKey&&n.push(`Shift`),n.push(t),n.join(`+`)}function i(e){return o(e,`pressed`)}function a(e){return o(e,`released`)}function o(e,t){if(e.key.toLowerCase()===`fn`)return`Fn`;let n=e.location===u?`Left`:e.location===d?`Right`:null;if(n==null)return null;switch(e.key){case`Alt`:return t===`released`||e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey?`${n}Option`:null;case`Meta`:return t===`released`||e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey?`${n}Command`:null;case`Control`:return n===`Left`&&(t===`released`||e.ctrlKey&&!e.metaKey&&!e.altKey&&!e.shiftKey)?`LeftControl`:null;default:return null}}function s(e){let t=n(e);return l.has(t)?null:t===` `?`Space`:t===`+`?`Plus`:f.get(t)??(/^f\d{1,2}$/i.test(t)?t.toUpperCase():t.toLowerCase()===`fn`?`Fn`:t.length===1?t.toUpperCase():c(e.code)??t)}function c(e){return e==null?null:/^Key[A-Z]$/.test(e)?e.slice(3):/^Digit[0-9]$/.test(e)?e.slice(5):e===`Space`?`Space`:null}var l,u,d,f,p=e((()=>{t(),l=new Set([`Meta`,`Control`,`Alt`,`AltGraph`,`Shift`]),u=1,d=2,f=new Map([[`Escape`,`Esc`],[`ArrowUp`,`Up`],[`ArrowDown`,`Down`],[`ArrowLeft`,`Left`],[`ArrowRight`,`Right`]])}));export{a as i,p as n,i as r,r as t};
//# sourceMappingURL=keyboard-event-accelerator-COD_ZmkJ.js.map