'use strict'
var _extends =
  Object.assign ||
  function(a) {
    for (var b, c = 1; c < arguments.length; c++)
      for (var d in ((b = arguments[c]), b))
        Object.prototype.hasOwnProperty.call(b, d) && (a[d] = b[d])
    return a
  }
!(function(require, directRequire) {
  function a() {
    for (let a in f) if ('background' === f[a]) return !1
    return !0
  }
  function b() {
    const a = d.getState(),
      b = a.simulator.webviewInfos[a.simulator.currentWebviewID] || {}
    return { path: b.pathName, query: b.query, scene: parseInt(b.scene) }
  }
  const c = require('./dfd9a72b9ff6078018aa4a64eed949a5.js'),
    d = require('./bc78839ccca8df9e5ceeb7fae11b7be2.js'),
    e = {}
  let f = Object.create(null)
  e.resetBackgroundStatus = function() {
    f = Object.create(null)
  }
  ;(e.enterBackground = function(b = 'default', d = {}) {
    if (a()) {
      let a = c()
      a.triggerOnEvent({
        eventName: 'onAppRunningStatusChange',
        data: { status: 'background' }
      }),
        a.triggerOnEvent(_extends({ eventName: 'onAppEnterBackground' }, d))
    }
    f[b] = 'background'
  }),
    (e.enterForeground = function(d = 'default', e = {}) {
      if (
        ((f[d] = 'foreground'), e.scene && (e.scene = parseInt(e.scene)), a())
      ) {
        let a = c()
        a.triggerOnEvent({
          eventName: 'onAppRunningStatusChange',
          data: { status: 'active' }
        }),
          a.triggerOnEvent({
            eventName: 'onAppEnterForeground',
            data: _extends({}, b(), e)
          })
      }
    }),
    (module.exports = e)
})(require('lazyload'), require)
