{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/igxg8hlns7HykQs6UCe4/oJsdbu4uKGsnaozn40Sq/AutoFetchCountry.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";export function autofillCountry(){useEffect(()=>{// Fetch the visitor's country using the provided API\nfetch(\"https://api.fetch.tools/location\").then(response=>response.json()).then(data=>{const country=data.country// For example, \"PK\"\n;// Now, get the country calling code using a service\nfetch(`https://restcountries.com/v3.1/alpha/${country}`).then(res=>res.json()).then(countryData=>{const countryCode=countryData[0].idd.root// For example, \"+\" for PK\n;const callingCode=countryData[0].idd.suffixes[0]// This will be the code, like 92\n;// Combine to form the full country calling code\nconst fullCountryCode=`${countryCode}${callingCode}`;// Select the input field by its name attribute\nconst inputField=document.querySelector('input[name=\"Country Code\"]');// If the input field exists, set its value to the detected country code\nif(inputField){inputField.value=fullCountryCode;}}).catch(error=>{console.error(\"Error fetching country code:\",error);});}).catch(error=>{console.error(\"Error fetching country:\",error);});},[]);// Return an empty object as no additional props are being overridden\nreturn{};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withautofillCountry(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...autofillCountry(props)});};}withautofillCountry.displayName=\"autofillCountry\";\nexport const __FramerMetadata__ = {\"exports\":{\"autofillCountry\":{\"type\":\"override\",\"name\":\"autofillCountry\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withautofillCountry\":{\"type\":\"reactHoc\",\"name\":\"withautofillCountry\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AutoFetchCountry.map"],
  "mappings": "gGAA+E,SAASA,GAAiB,CAAC,OAAAC,EAAU,IAAI,CACxH,MAAM,kCAAkC,EAAE,KAAKC,GAAUA,EAAS,KAAK,CAAC,EAAE,KAAKC,GAAM,CAAC,IAAMC,EAAQD,EAAK,QAEzG,MAAM,wCAAwCC,CAAO,EAAE,EAAE,KAAKC,GAAKA,EAAI,KAAK,CAAC,EAAE,KAAKC,GAAa,CAAC,IAAMC,EAAYD,EAAY,CAAC,EAAE,IAAI,KAChIE,EAAYF,EAAY,CAAC,EAAE,IAAI,SAAS,CAAC,EAE1CG,EAAgB,GAAGF,CAAW,GAAGC,CAAW,GAC5CE,EAAW,SAAS,cAAc,4BAA4B,EACjEA,IAAYA,EAAW,MAAMD,EAAiB,CAAC,EAAE,MAAME,GAAO,CAAC,QAAQ,MAAM,+BAA+BA,CAAK,CAAE,CAAC,CAAE,CAAC,EAAE,MAAMA,GAAO,CAAC,QAAQ,MAAM,0BAA0BA,CAAK,CAAE,CAAC,CAAE,EAAE,CAAC,CAAC,EAC1L,CAAC,CAAE,CAA2J,SAASC,EAAoBC,EAAE,CAAC,OAAOC,IAAQC,EAA+BC,CAAuC,EAASC,EAAKJ,EAAE,CAAC,GAAGC,EAAM,GAAGd,EAAgBc,CAAK,CAAC,CAAC,EAAI,CAACF,EAAoB,YAAY",
  "names": ["autofillCountry", "ue", "response", "data", "country", "res", "countryData", "countryCode", "callingCode", "fullCountryCode", "inputField", "error", "withautofillCountry", "C", "props", "re", "DataObserverContext", "p"]
}
