{"version":3,"file":"RefreshTrigger.COdltUEc.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/oYPQ8GMU9BpOhyDb0uTA/v3JpWecPINZFMs3iCmB8/RefreshTrigger.js"],"sourcesContent":["// Component without graphics that has an F5 action to refresh the page\n// Crucial: no graphics inside so user can embed an image\n// Added: Image input section\n// Added: Hover image functionality\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useState}from\"react\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function RefreshTrigger(props){const{children,enableKeyboard,enableClick,image={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Refresh image\"},hoverImage={src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Hover image\"}}=props;const[isHovered,setIsHovered]=useState(false);useEffect(()=>{if(!enableKeyboard)return;const handleKeyPress=e=>{if(e.key===\"F5\"||e.key===\"r\"&&(e.ctrlKey||e.metaKey)){e.preventDefault();if(typeof window!==\"undefined\"){window.location.reload();}}};if(typeof window!==\"undefined\"){window.addEventListener(\"keydown\",handleKeyPress);return()=>window.removeEventListener(\"keydown\",handleKeyPress);}},[enableKeyboard]);const handleClick=()=>{if(enableClick&&typeof window!==\"undefined\"){window.location.reload();}};return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",position:\"relative\",cursor:enableClick?\"pointer\":\"default\"},onClick:handleClick,onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>setIsHovered(false),children:[image&&/*#__PURE__*/_jsx(\"img\",{src:isHovered&&hoverImage?hoverImage.src:image.src,srcSet:isHovered&&hoverImage?hoverImage.srcSet:image.srcSet,alt:isHovered&&hoverImage?hoverImage.alt||\"Hover\":image.alt||\"Refresh\",style:{width:\"100%\",height:\"100%\",objectFit:\"contain\"}}),children]});}addPropertyControls(RefreshTrigger,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},hoverImage:{type:ControlType.ResponsiveImage,title:\"Hover Image\"},children:{type:ControlType.ComponentInstance,title:\"Content\"},enableKeyboard:{type:ControlType.Boolean,title:\"F5 Key\",defaultValue:true,enabledTitle:\"Enabled\",disabledTitle:\"Disabled\"},enableClick:{type:ControlType.Boolean,title:\"Click to Refresh\",defaultValue:false,enabledTitle:\"Enabled\",disabledTitle:\"Disabled\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RefreshTrigger\",\"slots\":[\"children\"],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RefreshTrigger.map"],"mappings":"sMAOG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,WAAS,iBAAe,cAAY,QAAM,CAAC,IAAI,sEAAsE,IAAI,gBAAgB,CAAC,aAAW,CAAC,IAAI,oEAAoE,IAAI,cAAc,EAAE,EAAW,CAAC,EAAU,GAAcA,EAAS,GAAM,CAA+c,OAA9c,MAAc,CAAC,GAAG,CAAC,EAAe,OAAO,IAAM,EAAe,GAAG,EAAI,EAAE,MAAM,MAAM,EAAE,MAAM,MAAM,EAAE,SAAS,EAAE,YAAU,EAAE,gBAAgB,CAAW,IAAS,QAAa,EAAO,SAAS,QAAQ,GAAK,GAAU,IAAS,OAA+D,OAAlD,EAAO,iBAAiB,UAAU,EAAe,KAAW,EAAO,oBAAoB,UAAU,EAAe,EAAI,CAAC,EAAe,CAAC,CAAqH,EAAM,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,SAAS,WAAW,OAAO,EAAY,UAAU,UAAU,CAAC,YAAzM,CAAI,GAAoB,IAAS,QAAa,EAAO,SAAS,QAAQ,EAAuJ,iBAAiB,EAAa,G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