text: 'use strict';
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  var _regenerator = require('babel-runtime/regenerator');
  
  var _regenerator2 = _interopRequireDefault(_regenerator);
  
  var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');
  
  var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
  
  var _stacktraceJs = require('stacktrace-js');
  
  var _stacktraceJs2 = _interopRequireDefault(_stacktraceJs);
  
  var _bluebird = require('bluebird');
  
  var _bluebird2 = _interopRequireDefault(_bluebird);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  var DEFAULT_INDEX = 1;
  var USE_OFFLINE_SOURCEMAPS = true;
  
  // Get stack trace info of a function call.
  //
  // * `index` {Number} The number of stack frames to look back.
  //
  
  exports.default = function () {
    var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee() {
      var index = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0];
      var err, stack, sourceCache, stackTraceOpts, line;
      return _regenerator2.default.wrap(function _callee$(_context) {
        while (1) {
          switch (_context.prev = _context.next) {
            case 0:
              err = new Error();
              stack = void 0;
              // If we don't use a source cache, a request for `main|vendor.bundle.js.map` will be made every time this is called.
              // NOTE: When looking at server logs, remember that Chrome will make a request first.
              // See https://github.com/stacktracejs/stacktrace.js/blob/eb03054362624dc2f6a22672669866ba51c5381b/spec/stacktrace-spec.js#L78
  
              sourceCache = window.__stacktracejsSourceCache__;
              stackTraceOpts = USE_OFFLINE_SOURCEMAPS ? { offline: true, sourceCache: sourceCache } : { offline: false };
              _context.prev = 4;
              _context.next = 7;
              return new _bluebird2.default(function (resolve, reject) {
                _stacktraceJs2.default.fromError(err, stackTraceOpts).then(resolve, function (e) {
                  return console.error('failed to get source maps:', e);
                }).catch(reject);
              });
  
            case 7:
              stack = _context.sent;
              _context.next = 13;
              break;
  
            case 10:
              _context.prev = 10;
              _context.t0 = _context['catch'](4);
  
              console.log('failed to get source maps:', _context.t0);
  
            case 13:
              line = stack[DEFAULT_INDEX + index];
              return _context.abrupt('return', {
                path: line.getFileName(),
                line: line.getLineNumber(),
                col: line.getColumnNumber()
              });
  
            case 15:
            case 'end':
              return _context.stop();
          }
        }
      }, _callee, this, [[4, 10]]);
    }));
  
    function getCallerFileAsync(_x) {
      return ref.apply(this, arguments);
    }
  
    return getCallerFileAsync;
  }();
  
  module.exports = exports['default'];
  //# sourceMappingURL=get-caller-file-async.js.map
  