{"version":3,"file":"geolocation.mjs","names":[],"sources":["../../src/hono/geolocation.ts"],"sourcesContent":["import type { Context } from 'hono';\nimport { getRuntimeKey } from 'hono/adapter';\nimport {\n  type Geolocation,\n  getGeolocationFromCloudflare,\n  getGeolocationFromCloudfront,\n  getGeolocationFromVercel,\n} from '../utils/geolocation';\n\nexport function geolocation(c: Context): Geolocation {\n  if (getRuntimeKey() === 'workerd') return getGeolocationFromCloudflare(c.req.raw);\n  if (c.req.header('x-vercel-id')) return getGeolocationFromVercel(c.req.raw);\n  return getGeolocationFromCloudfront(c.req.raw);\n}\n"],"mappings":";;;AASA,SAAgB,YAAY,GAAyB;CACnD,IAAI,cAAc,MAAM,WAAW,OAAO,6BAA6B,EAAE,IAAI,GAAG;CAChF,IAAI,EAAE,IAAI,OAAO,aAAa,GAAG,OAAO,yBAAyB,EAAE,IAAI,GAAG;CAC1E,OAAO,6BAA6B,EAAE,IAAI,GAAG;AAC/C"}