{"version":3,"sources":["jsdelivr-header.js","/npm/superagent-progress@0.0.3/lib/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,IAAI,YAAc,QAAQ,YACtB,WAAa,QAAQ,cASzB,SAAS,yBAAyB,EAAS,GAErC,IACF,EAAU,CAAC,GAGb,EAAI,GAAG,WAAW,SAAS,GACzB,yBAAyB,EAAS,EAAI,IACxC,IAEA,EAAI,GAAG,YAAY,SAAS,GAC1B,IAAI,IAAU,EAAI,QAAQ,mBAAqB,EAAI,QAAQ,mBACvD,EAAK,IAAI,YAAY,EAAQ,KAAO,yBAA0B,CAChE,MAAO,EACP,QAAS,IAGX,EAAI,GAAG,QAAQ,SAAS,GACtB,EAAG,KAAK,EAAE,OACZ,GACF,GACF,CA5BA,QAAU,OAAO,QAAU,SAAS,GAElC,OADI,IAAS,EAAU,CAAC,GACrB,aAAmB,WAAW,QACxB,yBAAyB,CAAC,EAAG,GAC/B,yBAAyB,KAAK,KAAM,EAC7C","file":"/npm/superagent-progress@0.0.3/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/superagent-progress@0.0.3/lib/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 ProgressBar = require('progress');\nvar superagent = require('superagent');\n\nexports = module.exports = function(options) {\n  if(!options) options = {}\n  if(options instanceof superagent.Request)\n    return attachSuperagentProgress({}, options);\n  return attachSuperagentProgress.bind(null, options);\n};\n\nfunction attachSuperagentProgress(options, req) {\n  var pg;\n  if(!options) {\n    options = {};\n  }\n\n  req.on('request', function(req) {\n    attachSuperagentProgress(options, req.req);\n  });\n\n  req.on('response', function(res) {\n    var total = +(res.headers['content-length'] || res.headers['Content-Length']);\n    var pg = new ProgressBar(options.bar || '[:bar] :current/:total', {\n      total: total,\n      current: 0,\n    });\n\n    res.on('data', function(e) {\n      pg.tick(e.length);\n    });\n  });\n}\n"]}