{"version":3,"file":"RedirectHandler.BZIoOD07.mjs","names":[],"sources":["https:/framerusercontent.com/modules/O09Gj4tTdjOUp8aNp2Ws/56QgojzT1UIMIAh9tN7P/RedirectHandler.js"],"sourcesContent":["// Get Started: https://www.framer.com/developers\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/components/auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export function withRedirect(Component){useEffect(()=>{const{pathname,search}=window.location;const baseUrl=\"https://dashboard.babel.audio\";// Only redirect if not on the root path\nif(pathname!==\"/\"){// For /sign-in or /sign-up pages, append redirect_url param\nif(pathname===\"/sign-in\"||pathname===\"/sign-up\"){// Construct the redirect target (i.e., where the user should end up after signing in)\nconst redirectTarget=baseUrl+\"/projects\"+search;const newUrl=`${baseUrl}${pathname}?redirect_url=${encodeURIComponent(redirectTarget)}`;console.log(\"Redirecting to \"+newUrl);window.location.replace(newUrl);}else{const newUrl=baseUrl+pathname+search;console.log(\"Redirecting to \"+newUrl);window.location.replace(newUrl);}}else{console.log(\"You're on the homepage — no redirect.\");}},[]);return props=>{return /*#__PURE__*/_jsx(Component,{...props});};}// Make it draggable on the canvas\naddPropertyControls(withRedirect,{width:{type:ControlType.Number,defaultValue:1},height:{type:ControlType.Number,defaultValue:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"withRedirect\":{\"type\":\"reactComponent\",\"name\":\"withRedirect\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RedirectHandler.map"],"mappings":"0SAOG,SAAgB,EAAa,EAAU,CAGwV,OAHvV,MAAc,CAAC,GAAK,CAAC,WAAS,UAAQ,EAAO,SAAe,EAAQ,gCAC/G,GAAG,IAAW,IACd,GAAG,IAAW,YAAY,IAAW,WAAW,CAChD,IAAM,EAAe,EAAQ,YAAY,EAAa,EAAO,GAAG,IAAU,EAAS,gBAAgB,mBAAmB,EAAe,GAAG,QAAQ,IAAI,kBAAkB,EAAO,CAAC,EAAO,SAAS,QAAQ,EAAO,KAAM,CAAC,IAAM,EAAO,EAAQ,EAAS,EAAO,QAAQ,IAAI,kBAAkB,EAAO,CAAC,EAAO,SAAS,QAAQ,EAAO,MAAQ,QAAQ,IAAI,wCAAwC,EAAI,EAAE,CAAC,CAAQ,GAA4B,EAAK,EAAU,CAAC,GAAG,EAAM,CAAC,sBATpZ,IAA6B,IAAoD,CAU5H,EAAoB,EAAa,CAAC,MAAM,CAAC,KAAK,EAAY,OAAO,aAAa,EAAE,CAAC,OAAO,CAAC,KAAK,EAAY,OAAO,aAAa,EAAE,CAAC,CAAC"}