'use strict'
!(function(require, directRequire) {
  const a = require('path'),
    b = require('./f171257bbcaef547a3cf27266ccb0db2.js'),
    c = require('./df6d0ff021a69fb541c733de4dbba0fe.js'),
    d = require('./0634ee2ebd3e560d9d4804ecc960160f.js'),
    e = require('./15ba1827c7f6564a45df6bd44da3a977.js'),
    f = require('./25d0beb4120ce2acafb4e03b95444fda.js'),
    g = require('./4152e7daed8b58a0b1bd0a083454e73f.js'),
    h = a => {
      return b => {
        b({
          type: d.COS_SET_CONFIRM,
          data: {
            show: !0,
            type: 'error',
            title: '\u63D0\u793A',
            content: a,
            showCancel: !1,
            showConfirm: !0,
            callback: null,
            confirmText: '\u5173\u95ED'
          }
        })
      }
    },
    i = a => {
      return { type: d.COS_SET_CONFIRM, data: a }
    }
  module.exports = {
    openCosManager: () => {
      return { type: d.COS_SET_WND, data: !0 }
    },
    closeCosManager: () => {
      return { type: d.COS_SET_WND, data: !1 }
    },
    removeResources: a => async b => {
      try {
        await g.RemoveResources([a])
      } catch (a) {
        return void h(a.toString())(b)
      }
      b({ type: d.COS_CUT_TREE, data: { path: a } })
    },
    setCurrentPath: a => {
      return { type: d.COS_SET_CURRENT, data: { path: a } }
    },
    setDir: (a, b) => async c => {
      if ((c({ type: d.COS_SET_DIR, data: { path: a, isOpen: b } }), b))
        try {
          let b = await g.getResources(a)
          c({ type: d.COS_SET_TREE, data: { children: b, path: a } })
        } catch (a) {
          1003 == a.code
            ? c(
                i({
                  show: !0,
                  type: 'error',
                  title: '\u63D0\u793A',
                  content:
                    '\u672A\u5F00\u901A\u817E\u8BAF\u4E91 CDN \u670D\u52A1\uFF0C\u8BF7\u524D\u5F80\u5F00\u901A',
                  showCancel: !0,
                  showConfirm: !0,
                  callback: a => {
                    a &&
                      f.jumpQCloudPage(
                        'https://www.qcloud.com/login/laAccessCallback'
                      )
                  },
                  confirmText: '\u524D\u5F80\u5F00\u901A'
                })
              )
            : h(a.toString())(c)
        }
    },
    setContextMenu: a => {
      return { type: d.COS_SET_CONTEXT_MENU, data: a }
    },
    showError: h,
    setConfirmInfo: i
  }
})(require('lazyload'), require)
