'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) {
  const a = require('path'),
    b = require('./8a145c66a3f53e0aff94a871ac692d06.js'),
    c = require('./6242f55dbdfe53c2f07b7a51568311f2.js'),
    d = require('./37be435102276ea9cf47609ff6535cd4.js')
  var e = { USER_DATA_PATH: d.USER_DATA_PATH }
  module.exports = async function(d) {
    const f = await b(d)
    let g = JSON.parse(f['/app-config.json'].toString()),
      h = (d.attr && d.attr.setting) || {}
    h = _extends({}, c.setting, h)
    let i = _extends({}, g, {
      wxAppInfo: {
        maxRequestConcurrent: h.MaxRequestConcurrent,
        maxUploadConcurrent: h.MaxUploadConcurrent,
        maxDownloadConcurrent: h.MaxDownloadConcurrent,
        maxWorkerConcurrent: h.MaxWorkerConcurrent
      }
    })
    if (i.subPackages) {
      let b = []
      i.subPackages.forEach(c => {
        b = b.concat(
          c.pages.map(b => {
            return a.posix.join(c.root, b)
          })
        )
      }),
        (i.pages = i.pages.concat(b))
    }
    let j,
      k = { path: i.pages[0], scene: c.SCENE_DEFAULT, query: {} }
    try {
      let a = d.compileType,
        b = d.condiction[a]
      if (((j = b.list[b.current]), j)) {
        let a = (j.query && j.query.split('&')) || []
        a.forEach(a => {
          if (a) {
            let b = a.split('=')
            k.query[b[0]] = b[1]
          }
        }),
          j.pathName && (k.path = j.pathName)
        let b = j.scene
        b &&
          ((k.scene = parseInt(b)),
          b == c.SCENE_SHARE_TICKET && (k.shareInfo = j.shareInfo),
          (b == c.SCENE_MINI_PROGRAM ||
            b == c.SCENE_MINI_PROGRAM_BACK ||
            b == c.SCENE_PROFILE ||
            b == c.SCENE_CUSTOM_MENU ||
            b == c.SCENE_APP_SHARE_MESSAGE ||
            b == c.SCENE_TEMPLETE_MESSAGE) &&
            (k.referrerInfo = j.referrerInfo))
      }
    } catch (a) {}
    return (
      (i = _extends({}, i, { platform: 'devtools', appLaunchInfo: k, env: e })),
      i
    )
  }
})(require('lazyload'), require)
