{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/kZaKbs6QcOeQs7C41b9X/8qOOWKd9ZNckXGZCstLF/Shortcuts.js"],
  "sourcesContent": ["import{jsx as e}from\"react/jsx-runtime\";import t from\"react\";export function withKeyboardShortcuts(r){let n=e=>{// Don't capture input if the user is typing in an input field/textarea or a meta key is pressed\nif(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)return;// Save pressed keys to session storage\nlet t=JSON.parse(sessionStorage.getItem(\"pressedKeys\")||\"[]\");if(t.push(e.key),t.length>1&&t.shift(),sessionStorage.setItem(\"pressedKeys\",JSON.stringify(t)),\"undefined\"!=typeof window){// Notify other components\nlet e=new CustomEvent(\"pressedKeysChanged\",{detail:t});window.dispatchEvent(e);}},o=()=>{sessionStorage.removeItem(\"pressedKeys\");};return s=>(\"undefined\"!=typeof window&&t.useEffect(()=>(// Focus window on load\n        window.focus(),window.addEventListener(\"keydown\",n),window.addEventListener(\"beforeunload\",o),()=>{window.removeEventListener(\"keydown\",n),window.removeEventListener(\"beforeunload\",o);}),[]),/*#__PURE__*/e(r,{...s}));}export function withShortcutTrigger(r){let n=(e,t,r)=>{let n=e.detail;// Check if the last pressed key matches the shortcut\nn[n.length-1].toLowerCase()===t.toLowerCase()&&(e.preventDefault(),setTimeout(()=>{if(r.current){let e=r.current.querySelector(\"button\"),n=r.current.querySelector(\"a\");e?e.click():n?n.click():console.error(`\uD83E\uDD8E Error: The shortcut trigger element ${t} isn't working properly. Check the docs for help.`);}else console.error(`\uD83E\uDD8E Error: The shortcut trigger element ${t} isn't working properly. Check the docs for help.`);sessionStorage.removeItem(\"pressedKeys\");},0));};return o=>{var s;let i=null===(s=o.name)||void 0===s?void 0:s.match(/\\[(.*?)\\]/),d=\"\",a=t.useRef(null);return i?d=i[1]:console.error(`\uD83E\uDD8E Error: Your shortcut trigger layer (${o.name}) is missing a key in its layer name.`),\"undefined\"!=typeof window&&t.useEffect(()=>{window.addEventListener(\"pressedKeysChanged\",e=>{n(e,d,a);});},[]),/*#__PURE__*/e(\"span\",{ref:a,\"data-lizard-shortcuts-trigger\":d,children:/*#__PURE__*/e(r,{...o})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withShortcutTrigger\":{\"type\":\"reactHoc\",\"name\":\"withShortcutTrigger\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withKeyboardShortcuts\":{\"type\":\"reactHoc\",\"name\":\"withKeyboardShortcuts\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Shortcuts.map"],
  "mappings": "yFAAoE,SAASA,EAAsBC,EAAE,CAAC,IAAIC,EAAE,GAAG,CAC/G,GAAG,EAAE,kBAAkB,kBAAkB,EAAE,kBAAkB,qBAAqB,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,OAC7H,IAAIC,EAAE,KAAK,MAAM,eAAe,QAAQ,aAAa,GAAG,IAAI,EAAE,GAAGA,EAAE,KAAK,EAAE,GAAG,EAAEA,EAAE,OAAO,GAAGA,EAAE,MAAM,EAAE,eAAe,QAAQ,cAAc,KAAK,UAAUA,CAAC,CAAC,EAAe,OAAOC,EAApB,IAA2B,CACxL,IAAIC,EAAE,IAAI,YAAY,qBAAqB,CAAC,OAAOF,CAAC,CAAC,EAAEC,EAAO,cAAcC,CAAC,CAAE,CAAC,EAAEC,EAAE,IAAI,CAAC,eAAe,WAAW,aAAa,CAAE,EAAE,OAAOC,IAAiB,OAAOH,EAApB,KAA4BC,EAAE,UAAU,KAC/KD,EAAO,MAAM,EAAEA,EAAO,iBAAiB,UAAUF,CAAC,EAAEE,EAAO,iBAAiB,eAAeE,CAAC,EAAE,IAAI,CAACF,EAAO,oBAAoB,UAAUF,CAAC,EAAEE,EAAO,oBAAoB,eAAeE,CAAC,CAAE,GAAG,CAAC,CAAC,EAAeE,EAAEP,EAAE,CAAC,GAAGM,CAAC,CAAC,EAAG",
  "names": ["withKeyboardShortcuts", "r", "n", "t", "window", "e", "o", "s", "p"]
}
