{"version":3,"sources":["jsdelivr-header.js","/npm/oxford-dictionary-api@1.0.1/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,IAAI,MAAQ,QAAQ,SAEhB,iBAAmB,SAAS,EAAO,GAE/B,KAAK,OAAS,CACV,OAAS,EACT,QAAU,EAEtB,EAGI,iBAAiB,UAAU,KAAO,SAAS,EAAK,GAC5C,IAAI,EAAU,CACV,KAAQ,gCACR,KAAO,IACP,KAAO,sBAAsB,EAC7B,OAAS,MACT,QAAU,CACF,OAAU,mBACV,OAAU,KAAK,OAAO,OACtB,QAAW,KAAK,OAAO,UAKnC,MAAM,IAAI,GAAS,SAAS,GAE5B,GAAqB,KAAlB,EAAI,WACH,EAAG,2BACF,CACL,IAAI,EAAO,GACX,EAAI,GAAG,QAAQ,SAAS,GACnB,GAAS,CACd,IACC,GAAG,OAAM,WACN,IACA,OAAS,KAAK,MAAM,EACtB,CAAE,MAAO,GACP,OAAS,CAAC,YAAe,IAAK,YAAe,oBAC/C,CACE,EAAG,KAAK,OACZ,IACC,GAAG,SAAQ,SAAS,GAChB,EAAG,EACR,GAAG,CACH,GACJ,EACJ,OAAO,QAAU","file":"/npm/oxford-dictionary-api@1.0.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/oxford-dictionary-api@1.0.1/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","var https = require('https');\r\n\r\nvar OxfordDictionary = function(app_id,app_key) {\r\n    \r\n        this.config = {\r\n            app_id : app_id,\r\n            app_key : app_key\r\n        };\r\n};    \r\n \r\n  \r\n    OxfordDictionary.prototype.find = function(word,cb){\r\n        var options = {\r\n            host :  'od-api.oxforddictionaries.com',\r\n            port : 443,\r\n            path : '/api/v1/entries/en/'+word,\r\n            method : 'GET',\r\n            headers : {\r\n                    \"Accept\": \"application/json\",\r\n                    \"app_id\": this.config.app_id,\r\n                    \"app_key\": this.config.app_key\r\n                   }\r\n            };\r\n        \r\n        \r\n        https.get(options, function(res) {\r\n        //console.log(\"\\nstatus code: \", res.statusCode);\r\n        if(res.statusCode == 404){\r\n            cb(\"No such entry found\");\r\n        }else{\r\n        var data = \"\";\r\n        res.on('data', function(chunk) {\r\n             data +=  chunk;\r\n        })\r\n        .on('end',function(){\r\n            try {\r\n            result = JSON.parse(data);\r\n          } catch (exp) {\r\n            result = {'status_code': 500, 'status_text': 'JSON Parse Failed'};\r\n          }\r\n            cb(null,result);\r\n        })\r\n        .on('error',function(err){\r\n             cb(err);    \r\n        });}\r\n        });\r\n    }; \r\nmodule.exports = OxfordDictionary;"]}