{"version":3,"file":"MovedTo.BiU1bLRg.mjs","names":[],"sources":["https:/framerusercontent.com/modules/WiD2w84vPk2hRYdvkWg0/JEQNZC89G7e9gRxACSVn/MovedTo.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * MovedTo\n *\n * Marks a page as moved. Renders a plain notice with a link to the new URL\n * (present in the server-rendered HTML), and on the live site forwards the\n * browser to the new URL with window.location.replace.\n *\n * The forward only runs when `to` is a valid https URL whose origin and\n * path differ from the current page (trailing slash ignored), and never on\n * the Framer canvas. When `to` is empty or\n * missing, the component renders nothing at all.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 1200\n */function isValidTarget(to){if(!to)return false;try{const url=new URL(to);return url.protocol===\"https:\";}catch{return false;}}function samePage(to){try{const target=new URL(to);const here=new URL(window.location.href);const norm=u=>u.origin.toLowerCase()+(u.pathname.replace(/\\/+$/,\"\")||\"/\");return norm(target)===norm(here);}catch{return true;}}export default function MovedTo(props){const{to=\"\",style}=props;React.useEffect(()=>{if(typeof window===\"undefined\")return;const target=RenderTarget.current();if(target===RenderTarget.canvas||target===RenderTarget.thumbnail||target===RenderTarget.export){return;}if(!isValidTarget(to))return;if(samePage(to))return;window.location.replace(to);},[to]);if(!to||!to.trim())return null;return /*#__PURE__*/_jsxs(\"div\",{style:{...style,width:\"100%\",boxSizing:\"border-box\",background:\"#FFFFFF\",color:\"#000000\",fontFamily:\"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif\",fontSize:16,lineHeight:1.5,padding:\"24px 20px\",textAlign:\"center\"},children:[/*#__PURE__*/_jsx(\"p\",{style:{margin:\"0 0 8px 0\",fontSize:16,color:\"#000000\"},children:\"This page has moved.\"}),/*#__PURE__*/_jsx(\"a\",{href:to,\"data-optivis-moved\":to,style:{color:\"#000000\",fontSize:16,textDecoration:\"underline\"},children:\"Continue to the new page\"})]});}addPropertyControls(MovedTo,{to:{type:ControlType.String,title:\"Moved to\",defaultValue:\"\",placeholder:\"https://optivismarketing.com/\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MovedTo\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MovedTo.map"],"mappings":"sMAeG,SAAS,EAAc,EAAG,CAAC,GAAG,CAAC,EAAG,MAAO,GAAM,GAAG,CAAuB,OAAO,IAAf,IAAI,CAAa,CAAC,CAAC,WAAW,QAAS,MAAM,CAAC,MAAO,EAAM,CAAC,CAAC,SAAS,EAAS,EAAG,CAAC,GAAG,CAAC,IAAM,EAAO,IAAI,IAAI,CAAE,EAAQ,EAAK,IAAI,IAAI,EAAO,SAAS,IAAI,EAAQ,EAAK,GAAG,EAAE,OAAO,YAAY,GAAG,EAAE,SAAS,QAAQ,OAAO,EAAE,GAAG,KAAK,OAAO,EAAK,CAAM,IAAI,EAAK,CAAI,CAAE,MAAM,CAAC,MAAO,EAAK,CAAC,CAAC,SAAwB,EAAQ,EAAM,CAAC,GAAK,CAAC,KAAG,GAAG,SAAO,EAAoU,OAA9T,MAAoB,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,EAAO,EAAa,QAAQ,EAAK,IAAS,EAAa,QAAQ,IAAS,EAAa,WAAW,IAAS,EAAa,QAAoB,EAAc,CAAE,IAAY,EAAS,CAAE,GAAS,EAAO,SAAS,QAAQ,CAAE,EAAE,EAAE,CAAC,CAAE,CAAC,EAAK,CAAC,GAAI,CAAC,EAAG,KAAK,EAAS,KAAyB,EAAM,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,MAAM,OAAO,UAAU,aAAa,WAAW,UAAU,MAAM,UAAU,WAAW,2EAA2E,SAAS,GAAG,WAAW,IAAI,QAAQ,YAAY,UAAU,QAAQ,EAA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