{"version":3,"file":"ChangeButtonText.CVmYuKTz.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/qYgEAOGNKvkBOSlVCGGx/7JfvaivOt9RY0I9ZePAU/ChangeButtonText.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";// Framer store for shared state\n// const useStore = createStore({\n//     background: \"#0099FF\",\n// })\n// // Higher-Order Component (HOC) for rotation animation\n// export function withRotate(Component: ComponentType): ComponentType {\n//     return (props) => {\n//         return (\n//             <Component\n//                 {...props}\n//                 animate={{ rotate: 90 }}\n//                 transition={{ duration: 2 }}\n//             />\n//         )\n//     }\n// }\n// // HOC for hover animation\n// export function withHover(Component: ComponentType): ComponentType {\n//     return (props) => {\n//         return <Component {...props} whileHover={{ scale: 1.05 }} />\n//     }\n// }\n// // HOC for changing background color on click\n// export function withRandomColor(Component: ComponentType): ComponentType {\n//     return (props) => {\n//         const [store, setStore] = useStore()\n//         return (\n//             <Component\n//                 {...props}\n//                 animate={{\n//                     background: store.background,\n//                 }}\n//                 onClick={() => {\n//                     setStore({ background: randomColor() })\n//                 }}\n//             />\n//         )\n//     }\n// }\n// HOC for changing button text based on user's location\nexport function changeButtonText(Component){return props=>{const[country,setCountry]=useState(\"India\")// Default country\n;const[buttonText,setButtonText]=useState(\"Start Now\")// Default button text\n;// Fetch user's location using a geolocation API\nuseEffect(()=>{console.log(props);const fetchLocation=async()=>{try{const response=await fetch(\"https://get.geojs.io/v1/ip/country.json\");if(!response.ok){throw new Error(`HTTP error! Status: ${response.status}`);}const data=await response.json();setCountry(data.name||\"India\");console.log(data);}catch(error){console.error(\"Error fetching location:\",error);}};fetchLocation();},[]);// Update button text based on the user's country\nuseEffect(()=>{if(country!==\"India\"){setButtonText(\"Try Free Now\");}else{setButtonText(\"Start Now\");}},[country]);// Render the wrapped component with the updated buttonText\nreturn /*#__PURE__*/_jsx(Component,{...props,text:buttonText});};}\nexport const __FramerMetadata__ = {\"exports\":{\"changeButtonText\":{\"type\":\"reactHoc\",\"name\":\"changeButtonText\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ChangeButtonText.map"],"mappings":"yHAwCA,SAAgB,EAAiB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAQ,GAAYA,EAAS,QAAQ,CAChG,CAAC,EAAW,GAAeA,EAAS,YAAY,CAItD,OAFA,MAAc,CAAC,QAAQ,IAAI,EAAM,EAAqB,SAAS,CAAC,GAAG,CAAC,IAAM,EAAS,MAAM,MAAM,0CAA0C,CAAC,GAAG,CAAC,EAAS,GAAI,MAAU,MAAM,uBAAuB,EAAS,SAAS,CAAE,IAAM,EAAK,MAAM,EAAS,MAAM,CAAC,EAAW,EAAK,MAAM,QAAQ,CAAC,QAAQ,IAAI,EAAK,OAAQ,EAAM,CAAC,QAAQ,MAAM,2BAA2B,EAAM,KAAmB,EAAG,EAAE,CAAC,CAC9X,MAAc,CAA2D,EAAvD,IAAU,QAA2D,YAApC,eAAgD,EAAI,CAAC,EAAQ,CAAC,CAC7F,EAAK,EAAU,CAAC,GAAG,EAAM,KAAK,EAAW,CAAC,mBA7CnB,IAAsC"}