{"version":3,"sources":["jsdelivr-header.js","/npm/googlebot-verify@0.1.3/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aACA,MAAM,IAAM,QAAQ,OACd,IAAM,QAAQ,OASpB,OAAO,QAAU,CAAC,EAAI,KACpB,EAAW,GAAY,WAAa,EAE7B,IAAI,SAAQ,SAAU,EAAS,GAEpC,IAAI,QAAQ,GAAI,CAAC,EAAO,KACtB,GAAI,EAEF,OADA,EAAO,GACA,EAAS,GAGlB,MAAM,EAAM,EAAM,IAAM,EAAM,GAAG,MAAM,KAAK,OAAO,GAAI,GAAG,GAC1D,GAAY,WAAR,GAA4B,cAAR,EAEtB,OADA,GAAQ,GACD,EAAS,MAAM,GAGxB,IAAI,OAAO,EAAM,IAAI,CAAC,EAAO,KAC3B,MAAM,EAAQ,IAAY,EAE1B,OADA,EAAQ,GACD,EAAS,EAAO,EAAM,GAC7B,GAEN","file":"/npm/googlebot-verify@0.1.3/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/googlebot-verify@0.1.3/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\nconst dns = require('dns');\nconst url = require('url');\n\n/**\n * Check an IP address to see if it belongs to Google.\n * \n * @param  {String}   ip       The IP address to check\n * @param  {Function} callback (error, isGoogle), where `isGoogle` is a boolean\n * @return {Promise}           Promise with result of verification\n */\nmodule.exports = (ip, callback) => {\n  callback = callback || function () {}\n\n  return new Promise(function (resolve, reject) {\n\n    dns.reverse(ip, (error, hosts) => {\n      if (error) {\n        reject(error);\n        return callback(error);\n      }\n\n      const tld = hosts[0] && hosts[0].split('.').slice(-2, -1)[0];\n      if (tld !== \"google\" && tld !== \"googlebot\") {\n        resolve(false);\n        return callback(null, false);\n      }\n\n      dns.lookup(hosts[0], (error, address) => {\n        const match = address === ip;\n        resolve(match);\n        return callback(error, match);\n      });\n    });\n  });\n}"]}