{"version":3,"file":"VinDecoding.BfYW4Fqk.mjs","names":[],"sources":["https:/framerusercontent.com/modules/6B1iDcJj4BdO6bmid8sx/M6iyOMZtEtqvvsBbDfnL/VinDecoding.js"],"sourcesContent":["// VinDecoding.tsx\n// Small helper for decoding a VIN into Year / Make / Model using NHTSA vPIC\n/**\n * Decode a VIN into Year, Make, Model using NHTSA vPIC.\n * Returns null if VIN is too short or nothing useful comes back.\n *\n * Example:\n *   const result = await decodeVinToYMM(\"5UXWX7C5*BA\")\n *   // result?.year, result?.make, result?.model\n */export async function decodeVinToYMM(vin,modelYearHint){const cleanedVin=(vin||\"\").trim();if(!cleanedVin||cleanedVin.length<5){return null;}const baseUrl=\"https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVinValues\";const params=new URLSearchParams({format:\"json\"});if(modelYearHint&&modelYearHint.trim()){params.append(\"modelyear\",modelYearHint.trim());}const url=`${baseUrl}/${encodeURIComponent(cleanedVin)}?${params.toString()}`;const res=await fetch(url);if(!res.ok){throw new Error(`VIN decode failed with status ${res.status}`);}const json=await res.json();const first=json?.Results?.[0];if(!first){return null;}const year=String(first.ModelYear||\"\").trim();const make=String(first.Make||\"\").trim();const model=String(first.Model||\"\").trim();if(!year&&!make&&!model){return null;}return{year,make,model,errorCode:first.ErrorCode,errorText:first.ErrorText};}\nexport const __FramerMetadata__ = {\"exports\":{\"VinDecodeResult\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"decodeVinToYMM\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VinDecoding.map"],"mappings":"oDASG,eAAsB,EAAe,EAAI,EAAc,CAAC,IAAM,GAAY,GAAK,IAAI,MAAM,CAAC,GAAG,CAAC,GAAY,EAAW,OAAO,EAAG,OAAO,KAAM,IAA8E,EAAO,IAAI,gBAAgB,CAAC,OAAO,OAAO,CAAC,CAAI,GAAe,EAAc,MAAM,EAAE,EAAO,OAAO,YAAY,EAAc,MAAM,CAAC,CAAE,IAAM,EAAI,2DAAc,mBAAmB,EAAW,CAAC,GAAG,EAAO,UAAU,GAAS,EAAI,MAAM,MAAM,EAAI,CAAC,GAAG,CAAC,EAAI,GAAI,MAAU,MAAM,iCAAiC,EAAI,SAAS,CAA8B,IAAM,GAAvB,MAAM,EAAI,MAAM,GAAmB,UAAU,GAAG,GAAG,CAAC,EAAO,OAAO,KAAM,IAAM,EAAK,OAAO,EAAM,WAAW,GAAG,CAAC,MAAM,CAAO,EAAK,OAAO,EAAM,MAAM,GAAG,CAAC,MAAM,CAAO,EAAM,OAAO,EAAM,OAAO,GAAG,CAAC,MAAM,CAAuC,MAAnC,CAAC,GAAM,CAAC,GAAM,CAAC,EAAc,KAAY,CAAC,OAAK,OAAK,QAAM,UAAU,EAAM,UAAU,UAAU,EAAM,UAAU"}