{"version":3,"file":"MagicLinkTest.BLEn250Q.mjs","names":["Feather","React.useContext","React.useMemo","React.Fragment","useRef","React.useId","useState","email"],"sources":["https:/framerusercontent.com/modules/3F4HAX18MvrlF0o5Kido/WIkSo0bSOCqkcp2nUFcL/d9P2Xwha6.js","https:/framerusercontent.com/modules/UxeqfQ4Q1E6hGv3UbDuE/7z4NNcPw4CKgG4XAqj9s/MagicLinkTest.js"],"sourcesContent":["// Generated by Framer (255de63)\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addFonts,ComponentViewportProvider,cx,getFonts,Link,SmartComponentScopedContainer,useComponentViewport,useLocaleInfo,useVariantState,withCSS}from\"framer\";import{LayoutGroup,motion,MotionConfigContext}from\"framer-motion\";import*as React from\"react\";import{useRef}from\"react\";import{Icon as Feather}from\"https://framerusercontent.com/modules/f0DboytQenYh21kfme7W/zb1zVBMZJKgPMiedOi0y/Feather.js\";const FeatherFonts=getFonts(Feather);const serializationHash=\"framer-lneds\";const variantClassNames={lG96iDF4G:\"framer-v-5uukih\"};function addPropertyOverrides(overrides,...variants){const nextOverrides={};variants?.forEach(variant=>variant&&Object.assign(nextOverrides,overrides[variant]));return nextOverrides;}const transition1={bounce:.2,delay:0,duration:.4,type:\"spring\"};const Transition=({value,children})=>{const config=React.useContext(MotionConfigContext);const transition=value??config.transition;const contextValue=React.useMemo(()=>({...config,transition}),[JSON.stringify(transition)]);return /*#__PURE__*/_jsx(MotionConfigContext.Provider,{value:contextValue,children:children});};const Variants=motion.create(React.Fragment);const getProps=({height,id,width,...props})=>{return{...props};};const createLayoutDependency=(props,variants)=>{if(props.layoutDependency)return variants.join(\"-\")+props.layoutDependency;return variants.join(\"-\");};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const fallbackRef=useRef(null);const refBinding=ref??fallbackRef;const defaultLayoutId=React.useId();const{activeLocale,setLocale}=useLocaleInfo();const componentViewport=useComponentViewport();const{style,className,layoutId,variant,...restProps}=getProps(props);const{baseVariant,classNames,clearLoadingGesture,gestureHandlers,gestureVariant,isLoading,setGestureState,setVariant,variants}=useVariantState({defaultVariant:\"lG96iDF4G\",ref:refBinding,variant,variantClassNames});const layoutDependency=createLayoutDependency(props,variants);const sharedStyleClassNames=[];const scopingClassNames=cx(serializationHash,...sharedStyleClassNames);return /*#__PURE__*/_jsx(LayoutGroup,{id:layoutId??defaultLayoutId,children:/*#__PURE__*/_jsx(Variants,{animate:variants,initial:false,children:/*#__PURE__*/_jsx(Transition,{value:transition1,children:/*#__PURE__*/_jsx(Link,{href:{webPageId:\"HFIrPuB3f\"},motionChild:true,nodeId:\"lG96iDF4G\",scopeId:\"d9P2Xwha6\",children:/*#__PURE__*/_jsxs(motion.a,{...restProps,...gestureHandlers,className:`${cx(scopingClassNames,\"framer-5uukih\",className,classNames)} framer-wiz8ho`,\"data-framer-name\":\"Variant 1\",layoutDependency:layoutDependency,layoutId:\"lG96iDF4G\",ref:refBinding,style:{backgroundColor:\"rgb(255, 255, 255)\",...style},children:[/*#__PURE__*/_jsx(ComponentViewportProvider,{children:/*#__PURE__*/_jsx(SmartComponentScopedContainer,{className:\"framer-1jbb7vz-container\",isAuthoredByUser:true,isModuleExternal:true,layoutDependency:layoutDependency,layoutId:\"U4dV_onMj-container\",nodeId:\"U4dV_onMj\",rendersWithMotion:true,scopeId:\"d9P2Xwha6\",children:/*#__PURE__*/_jsx(Feather,{color:\"var(--token-5b817ebe-a5e6-46e2-afc1-1ed2b0e33da2, rgb(0, 188, 114))\",height:\"100%\",iconSearch:\"Home\",iconSelection:\"arrow-up\",id:\"U4dV_onMj\",layoutId:\"U4dV_onMj\",mirrored:false,selectByList:true,style:{height:\"100%\",width:\"100%\"},width:\"100%\"})})}),/*#__PURE__*/_jsx(motion.div,{className:\"framer-88z5ui\",\"data-border\":true,layoutDependency:layoutDependency,layoutId:\"sw8O53Qf7\",style:{\"--border-bottom-width\":\"3px\",\"--border-color\":\"var(--token-5b817ebe-a5e6-46e2-afc1-1ed2b0e33da2, rgb(0, 188, 114))\",\"--border-left-width\":\"3px\",\"--border-right-width\":\"3px\",\"--border-style\":\"solid\",\"--border-top-width\":\"3px\",backgroundColor:\"rgba(10, 89, 88, 0)\",borderBottomLeftRadius:40,borderBottomRightRadius:40,borderTopLeftRadius:40,borderTopRightRadius:40}})]})})})})});});const css=[\"@supports (aspect-ratio: 1) { body { --framer-aspect-ratio-supported: auto; } }\",\".framer-lneds.framer-wiz8ho, .framer-lneds .framer-wiz8ho { display: block; }\",\".framer-lneds.framer-5uukih { align-content: center; align-items: center; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 20px; height: 80px; justify-content: center; overflow: hidden; padding: 40px; position: relative; text-decoration: none; width: 1200px; }\",\".framer-lneds .framer-1jbb7vz-container { flex: none; height: 40px; left: calc(50.08333333333336% - 40px / 2); position: absolute; top: calc(50.00000000000002% - 40px / 2); width: 40px; z-index: 1; }\",\".framer-lneds .framer-88z5ui { flex: none; height: 58px; overflow: hidden; position: relative; width: 55px; will-change: var(--framer-will-change-override, transform); }\",'.framer-lneds[data-border=\"true\"]::after, .framer-lneds [data-border=\"true\"]::after { content: \"\"; border-width: var(--border-top-width, 0) var(--border-right-width, 0) var(--border-bottom-width, 0) var(--border-left-width, 0); border-color: var(--border-color, none); border-style: var(--border-style, none); width: 100%; height: 100%; position: absolute; box-sizing: border-box; left: 0; top: 0; border-radius: inherit; pointer-events: none; }'];/**\n * This is a generated Framer component.\n * @framerIntrinsicHeight 80\n * @framerIntrinsicWidth 1200\n * @framerCanvasComponentVariantDetails {\"propertyName\":\"variant\",\"data\":{\"default\":{\"layout\":[\"fixed\",\"fixed\"]}}}\n * @framerImmutableVariables true\n * @framerDisplayContentsDiv false\n * @framerAutoSizeImages true\n * @framerComponentViewportWidth true\n * @framerColorSyntax true\n */const Framerd9P2Xwha6=withCSS(Component,css,\"framer-lneds\");export default Framerd9P2Xwha6;Framerd9P2Xwha6.displayName=\"Header\";Framerd9P2Xwha6.defaultProps={height:80,width:1200};addFonts(Framerd9P2Xwha6,[{explicitInter:true,fonts:[]},...FeatherFonts],{supportsExplicitInterCodegen:true});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Framerd9P2Xwha6\",\"slots\":[],\"annotations\":{\"framerDisplayContentsDiv\":\"false\",\"framerComponentViewportWidth\":\"true\",\"framerContractVersion\":\"1\",\"framerAutoSizeImages\":\"true\",\"framerIntrinsicHeight\":\"80\",\"framerColorSyntax\":\"true\",\"framerIntrinsicWidth\":\"1200\",\"framerCanvasComponentVariantDetails\":\"{\\\"propertyName\\\":\\\"variant\\\",\\\"data\\\":{\\\"default\\\":{\\\"layout\\\":[\\\"fixed\\\",\\\"fixed\\\"]}}}\",\"framerImmutableVariables\":\"true\"}},\"Props\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./d9P2Xwha6.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState}from\"react\";export default function MagicLinkForm(){const[email,setEmail]=useState(\"\");const[message,setMessage]=useState(\"\");const[isLoading,setIsLoading]=useState(false);const[errors,setErrors]=useState({});const isValidEmail=email=>/\\S+@\\S+\\.\\S+/.test(email);const handleMagicLink=async()=>{if(!isValidEmail(email)){setErrors({email:[\"Please enter a valid email address\"]});return;}setErrors({});setMessage(\"\");setIsLoading(true);try{const res=await fetch(\"https://auth.soilbeat.com/api/backend/v1/magic_link\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\",Authorization:\"Bearer fe069edf6f660ca6f3461bab77ffee0538c45eacb5048a226598e4d5633d138e7657c68379cf850407350dd32bb5a9ed\"},body:JSON.stringify({email})});if(res.ok){setMessage(\"✅ Magic link sent! Please check your inbox.\");}else{const data=await res.json().catch(()=>null);const errorText=data?.message||res.statusText;setMessage(\"❌ \"+errorText);}}catch(err){setMessage(\"❌ Error: \"+err.message);}finally{setIsLoading(false);}};const inputStyle={width:\"100%\",marginBottom:\"10px\",padding:\"12px\",borderRadius:\"40px\",border:\"1px solid #ccc\",fontSize:\"14px\",boxSizing:\"border-box\"};const errorInputStyle={...inputStyle,border:\"1px solid #ff4d4f\",backgroundColor:\"rgba(255, 77, 79, 0.05)\"};const buttonStyle={width:\"100%\",padding:\"12px\",borderRadius:\"40px\",border:\"none\",fontWeight:\"bold\",fontSize:\"14px\",cursor:\"pointer\",backgroundColor:\"#00A86B\",color:\"white\",opacity:isValidEmail(email)&&!isLoading?1:.5,pointerEvents:isValidEmail(email)&&!isLoading?\"auto\":\"none\",boxSizing:\"border-box\"};const messageStyle={textAlign:\"center\",marginTop:\"15px\",color:message.startsWith(\"✅\")?\"#00A86B\":\"#ff4d4f\",fontSize:\"13px\"};return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"auto\",fontFamily:\"Inter, sans-serif\"},children:[/*#__PURE__*/_jsx(\"input\",{type:\"email\",placeholder:\"Email Address\",value:email,onChange:e=>setEmail(e.target.value),required:true,style:errors.email?errorInputStyle:inputStyle,disabled:isLoading}),errors.email&&/*#__PURE__*/_jsx(\"div\",{style:{color:\"#ff4d4f\",fontSize:\"12px\",marginBottom:\"10px\"},children:errors.email[0]}),/*#__PURE__*/_jsx(\"button\",{style:buttonStyle,onClick:handleMagicLink,disabled:!isValidEmail(email)||isLoading,children:isLoading?\"Sending...\":\"Start my free subscription\"}),message&&/*#__PURE__*/_jsx(\"p\",{style:messageStyle,children:message})]});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MagicLinkForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MagicLinkTest.map"],"mappings":"2qBACyD,IAAiK,IAAkE,IAA4B,IAAkJ,CAAM,EAAa,EAASA,EAAQ,CAAO,EAAkB,eAAqB,EAAkB,CAAC,UAAU,kBAAkB,CAA8L,EAAY,CAAC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