{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/xy0zijMFZOnMvFMOoNdb/bR5IyIlAUQsR7YOAA8fg/Shortcut.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function Shortcut(props){useEffect(()=>{const handleKeyDown=event=>{props.shortcuts.forEach(shortcut=>{const comboKey=shortcut.shortcutKey.toLowerCase();const eventKey=event.key.toLowerCase();let isModifierMatch=false;if(shortcut.modifier===\"\u2318\"&&event.metaKey){isModifierMatch=true;}else if(shortcut.modifier===\"none\"){isModifierMatch=true;}if(isModifierMatch&&comboKey===eventKey){event.preventDefault()// Prevent default behavior\n;let url=shortcut.shortcutLink;// Check if the link is likely an external URL\nif(!url.startsWith(\"http://\")&&!url.startsWith(\"https://\")&&url.includes(\".\")){url=\"http://\"+url// Prepend protocol for external URLs\n;}else if(!url.startsWith(\"http://\")&&!url.startsWith(\"https://\")){// Construct the URL for internal navigation\nurl=`${window.location.origin}/${url}`;}if(shortcut.newTab){window.open(url,\"_blank\");}else{window.location.href=url;}}});};window.addEventListener(\"keydown\",handleKeyDown);return()=>window.removeEventListener(\"keydown\",handleKeyDown);},[props.shortcuts]);return /*#__PURE__*/_jsx(\"div\",{style:{...props.style}});}Shortcut.displayName=\"Shortcut\";addPropertyControls(Shortcut,{shortcuts:{type:ControlType.Array,title:\"Shortcuts\",defaultValue:[],propertyControl:{type:ControlType.Object,controls:{modifier:{type:ControlType.Enum,title:\"Modifier\",defaultValue:\"none\",options:[\"none\",\"\u2318\"],optionTitles:[\"None\",\"\u2318\"],displaySegmentedControl:true},shortcutKey:{type:ControlType.String,title:\"Key\",defaultValue:\"\",placeholder:\"s\"},shortcutLink:{type:ControlType.Link,title:\"Link\",defaultValue:{url:\"/page\"}},newTab:{type:ControlType.Boolean,title:\"New Tab\",defaultValue:false}}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Shortcut\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Shortcut.map"],
  "mappings": "uGAGkB,SAARA,EAA0BC,EAAM,CAAC,OAAAC,EAAU,IAAI,CAAC,IAAMC,EAAcC,GAAO,CAACH,EAAM,UAAU,QAAQI,GAAU,CAAC,IAAMC,EAASD,EAAS,YAAY,YAAY,EAAQE,EAASH,EAAM,IAAI,YAAY,EAAMI,EAAgB,GAAiI,IAAxHH,EAAS,WAAW,UAAKD,EAAM,SAAuCC,EAAS,WAAW,UAAQG,EAAgB,IAASA,GAAiBF,IAAWC,EAAS,CAACH,EAAM,eAAe,EACpa,IAAIK,EAAIJ,EAAS,aACf,CAACI,EAAI,WAAW,SAAS,GAAG,CAACA,EAAI,WAAW,UAAU,GAAGA,EAAI,SAAS,GAAG,EAAGA,EAAI,UAAUA,EACnF,CAACA,EAAI,WAAW,SAAS,GAAG,CAACA,EAAI,WAAW,UAAU,IAChEA,EAAI,GAAGC,EAAO,SAAS,MAAM,IAAID,CAAG,IAAOJ,EAAS,OAAQK,EAAO,KAAKD,EAAI,QAAQ,EAAQC,EAAO,SAAS,KAAKD,CAAK,CAAC,CAAC,CAAE,EAAE,OAAAC,EAAO,iBAAiB,UAAUP,CAAa,EAAQ,IAAIO,EAAO,oBAAoB,UAAUP,CAAa,CAAE,EAAE,CAACF,EAAM,SAAS,CAAC,EAAsBU,EAAK,MAAM,CAAC,MAAM,CAAC,GAAGV,EAAM,KAAK,CAAC,CAAC,CAAE,CAACD,EAAS,YAAY,WAAWY,EAAoBZ,EAAS,CAAC,UAAU,CAAC,KAAKa,EAAY,MAAM,MAAM,YAAY,aAAa,CAAC,EAAE,gBAAgB,CAAC,KAAKA,EAAY,OAAO,SAAS,CAAC,SAAS,CAAC,KAAKA,EAAY,KAAK,MAAM,WAAW,aAAa,OAAO,QAAQ,CAAC,OAAO,QAAG,EAAE,aAAa,CAAC,OAAO,QAAG,EAAE,wBAAwB,EAAI,EAAE,YAAY,CAAC,KAAKA,EAAY,OAAO,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,EAAE,aAAa,CAAC,KAAKA,EAAY,KAAK,MAAM,OAAO,aAAa,CAAC,IAAI,OAAO,CAAC,EAAE,OAAO,CAAC,KAAKA,EAAY,QAAQ,MAAM,UAAU,aAAa,EAAK,CAAC,CAAC,CAAC,CAAC,CAAC",
  "names": ["Shortcut", "props", "ue", "handleKeyDown", "event", "shortcut", "comboKey", "eventKey", "isModifierMatch", "url", "window", "p", "addPropertyControls", "ControlType"]
}
