{"version":3,"file":"NoRightClick.DDXMdcPg.mjs","names":[],"sources":["https:/framerusercontent.com/modules/AhCiRZ2igRkca4SAQVvY/GHBspZVVLtJvMFz7QSRr/NoRightClick.js"],"sourcesContent":["// Prevent right-click on page when published. Shows indicator in canvas only.\nimport{jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{RenderTarget,addPropertyControls,ControlType}from\"framer\";/**\n * NoRightClick\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function NoRightClick(props){const{enabled=true,message=\"Right-click is disabled on this page.\"}=props;useEffect(()=>{if(!enabled)return;if(typeof window===\"undefined\")return;if(RenderTarget.current()!==RenderTarget.preview&&RenderTarget.current()!==RenderTarget.export)return;function handleContextMenu(e){e.preventDefault();if(message){// Show a temporary message near the cursor\nconst msgDiv=document.createElement(\"div\");msgDiv.textContent=message;msgDiv.style.position=\"fixed\";msgDiv.style.left=`${e.clientX+8}px`;msgDiv.style.top=`${e.clientY+8}px`;msgDiv.style.background=\"rgba(34,34,34,0.95)\";msgDiv.style.color=\"#fff\";msgDiv.style.padding=\"8px 14px\";msgDiv.style.borderRadius=\"6px\";msgDiv.style.fontSize=\"14px\";msgDiv.style.fontFamily=\"sans-serif\";msgDiv.style.zIndex=\"99999\";msgDiv.style.pointerEvents=\"none\";msgDiv.style.transition=\"opacity 0.3s\";msgDiv.style.opacity=\"1\";document.body.appendChild(msgDiv);setTimeout(()=>{msgDiv.style.opacity=\"0\";},900);setTimeout(()=>{if(msgDiv.parentNode)msgDiv.parentNode.removeChild(msgDiv);},1200);}}function handleKeyDown(e){// Prevent F12, Ctrl+Shift+I, Ctrl+Shift+J, Ctrl+Shift+C, Ctrl+U, Cmd+Opt+I (Mac), Cmd+Opt+J, Cmd+Opt+C, Cmd+Opt+U\nconst isMac=navigator.platform.toUpperCase().indexOf(\"MAC\")>=0;if(e.key===\"F12\"||e.ctrlKey&&e.shiftKey&&[\"I\",\"J\",\"C\"].includes(e.key.toUpperCase())||e.ctrlKey&&e.key.toUpperCase()===\"U\"||isMac&&e.metaKey&&e.altKey&&[\"I\",\"J\",\"C\",\"U\"].includes(e.key.toUpperCase())){e.preventDefault();e.stopPropagation();if(message){const msgDiv=document.createElement(\"div\");msgDiv.textContent=message;msgDiv.style.position=\"fixed\";msgDiv.style.left=`50%`;msgDiv.style.top=`20px`;msgDiv.style.transform=\"translateX(-50%)\";msgDiv.style.background=\"rgba(34,34,34,0.95)\";msgDiv.style.color=\"#fff\";msgDiv.style.padding=\"8px 14px\";msgDiv.style.borderRadius=\"6px\";msgDiv.style.fontSize=\"14px\";msgDiv.style.fontFamily=\"sans-serif\";msgDiv.style.zIndex=\"99999\";msgDiv.style.pointerEvents=\"none\";msgDiv.style.transition=\"opacity 0.3s\";msgDiv.style.opacity=\"1\";document.body.appendChild(msgDiv);setTimeout(()=>{msgDiv.style.opacity=\"0\";},900);setTimeout(()=>{if(msgDiv.parentNode)msgDiv.parentNode.removeChild(msgDiv);},1200);}}}window.addEventListener(\"contextmenu\",handleContextMenu);window.addEventListener(\"keydown\",handleKeyDown,true);return()=>{window.removeEventListener(\"contextmenu\",handleContextMenu);window.removeEventListener(\"keydown\",handleKeyDown,true);};},[enabled,message]);if(RenderTarget.current()===RenderTarget.canvas||RenderTarget.current()===RenderTarget.thumbnail){return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:40,background:\"#F5F5F5\",color:\"#222\",border:\"1px dashed #CCC\",borderRadius:8,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",fontSize:14,fontWeight:500,fontFamily:\"sans-serif\",opacity:.8},children:[\"Prevent Right-Click (\",enabled?\"active\":\"off\",\")\"]});}return null;}addPropertyControls(NoRightClick,{enabled:{type:ControlType.Boolean,title:\"Prevent Right-Click\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},message:{type:ControlType.String,title:\"Message\",defaultValue:\"Right-click is disabled on this page.\",placeholder:\"Custom message…\",displayTextArea:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"NoRightClick\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./NoRightClick.map"],"mappings":"sMAMG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,UAAQ,GAAK,UAAQ,yCAAyC,EAEkiD,OAF5hD,MAAc,CAA0D,GAAtD,CAAC,GAAyB,IAAS,QAAsB,EAAa,QAAQ,IAAI,EAAa,SAAS,EAAa,QAAQ,IAAI,EAAa,OAAO,OAAO,SAAS,EAAkB,EAAE,CAAoB,GAAnB,EAAE,eAAe,EAAK,EAAQ,CACnW,IAAM,EAAO,SAAS,cAAc,KAAK,EAAE,EAAO,YAAY,EAAQ,EAAO,MAAM,SAAS,QAAQ,EAAO,MAAM,KAAK,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAO,MAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAO,MAAM,WAAW,sBAAsB,EAAO,MAAM,MAAM,OAAO,EAAO,MAAM,QAAQ,WAAW,EAAO,MAAM,aAAa,MAAM,EAAO,MAAM,SAAS,OAAO,EAAO,MAAM,WAAW,aAAa,EAAO,MAAM,OAAO,QAAQ,EAAO,MAAM,cAAc,OAAO,EAAO,MAAM,WAAW,eAAe,EAAO,MAAM,QAAQ,IAAI,SAAS,KAAK,YAAY,CAAM,EAAE,eAAe,CAAC,EAAO,MAAM,QAAQ,GAAI,EAAE,GAAG,EAAE,eAAe,CAAI,EAAO,YAAW,EAAO,WAAW,YAAY,CAAM,CAAE,EAAE,IAAI,CAAE,CAAC,CAAC,SAAS,EAAc,EAAE,CACrrB,IAAM,EAAM,EAAU,SAAS,YAAY,CAAC,CAAC,QAAQ,KAAK,GAAG,EAAE,IAAG,EAAE,MAAM,OAAO,EAAE,SAAS,EAAE,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