'use strict'
!(function(require, directRequire) {
  const a = require('events').EventEmitter,
    b = { FREE: 'FREE', CAPTURING: 'CAPTURING' },
    c = { STATUS_CHANGED: 'STATUS_CHANGED' }
  module.exports = {
    STATUS: b,
    statusManager: new class extends a {
      constructor() {
        super(), (this.current = b.FREE)
      }
      getStatus() {
        return this.current
      }
      setStatus(a) {
        ;(this.current = a),
          this.emit(c.STATUS_CHANGED, a),
          this.emit(this.getChangeEventNameForStatus(a), a)
      }
      getChangeEventNameForStatus(a) {
        return `${c.STATUS_CHANGED}_${a}`
      }
      onceEnterStatus(a) {
        return new Promise(b => {
          this.once(this.getChangeEventNameForStatus(a), b)
        })
      }
    }()
  }
})(require('lazyload'), require)
