'use strict'
!(function(require, directRequire) {
  const a = require('fs'),
    b = require('path'),
    c = require('mkdir-p'),
    d = require('./162bf2ee28b76d3b3d95b685cede4146.js'),
    e = require('./9fdd4ac31a05c27355910f0d74accd4c.js'),
    { bufToUTF8: f } = require('./efc820e1b92d6e4063535296d4a24213.js'),
    { FILE_NOT_UTF8: g } = require('./949d8235c744ced2a80121e4dba34c28.js'),
    h = { '.json': !0 },
    {
      whiteFileExtName: i,
      gameWhiteFileExtName: j
    } = require('./6242f55dbdfe53c2f07b7a51568311f2.js'),
    k = { '.js': !0 }
  module.exports = function(e, i = {}) {
    return new Promise(async (l, m) => {
      let { distPath: n, gameJSON: o } = i,
        p = await d(e),
        q = p.getAllFile(),
        r = o.appConfig.configFrom
      for (let d = 0, e = q.length; d < e; d++) {
        let e = q[d]
        if ('game.json' === r && 'app-config.json' === e) continue
        let i = b.extname(e)
        if (!k[i] && j[i]) {
          let d = p.getFile(e, null)
          if (h[i]) {
            let a = f(d)
            if (void 0 === a) {
              let a = new Error(e)
              return (a.code = g), m(a)
            }
          }
          let j = b.join(n, e),
            k = b.dirname(j)
          c.sync(k), a.writeFileSync(j, d)
        }
      }
      l()
    })
  }
})(require('lazyload'), require)
