{"version":3,"file":"ChangeButtonText.DTWi09NV.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":"mKAwCA,SAAgB,EAAiB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAQ,EAAW,CAACA,EAAS,SACxF,CAAC,EAAW,EAAc,CAACA,EAAS,aAI1C,OAFA,MAAc,CAAC,QAAQ,IAAI,GAAO,IAAM,EAAc,SAAS,CAAC,GAAG,CAAC,IAAM,EAAS,MAAM,MAAM,2CAA2C,GAAG,CAAC,EAAS,GAAI,MAAU,MAAM,uBAAuB,EAAS,UAAW,IAAM,EAAK,MAAM,EAAS,OAAO,EAAW,EAAK,MAAM,SAAS,QAAQ,IAAI,EAAO,OAAM,EAAM,CAAC,QAAQ,MAAM,2BAA2B,EAAQ,CAAC,EAAC,GAAiB,EAAC,EAAE,EAC7X,MAAc,CAA2D,EAAvD,IAAU,QAA2D,YAApC,eAAmD,EAAC,CAAC,EAAQ,EAC5F,EAAK,EAAU,CAAC,GAAG,EAAM,KAAK,EAAW,CAAG,CAAE"}