'use strict'
!(function(require, directRequire) {
  const a = require('react'),
    b = require('react-dom'),
    c = require('classnames'),
    d = require('./8a6bfff9d7b1c7d81421b0982e3dda9e.js'),
    e = require('redux'),
    f = require('child_process').exec,
    g = require('./a8c87029da0fa06e986298d447ab0fe2.js'),
    h = require('./1fcc6bd55b687d154a4247e57fe3011d.js'),
    i = require('./ba23d8b47b1f4ea08b9fd49939b9443f.js'),
    j = require('./6ff091369f442a4678a2ed4a1f758495.js'),
    k = require('./c4b43629b4de3d73a79d27fb0314f46a.js'),
    l = require('./274c496e897a23f75f9287cb59f86a50.js'),
    m = require('./fc137838572a83604db39acff8e909e0.js'),
    n = require('./356b2757917fbfdeb38c7afc0271eed9.js'),
    o = require('./eadce02c750c875a10680bcfedadec88.js'),
    p = require('./629ccf62fc18c4d6caab59c1e6619a09.js'),
    q = require('./3b5f8e2469c474c8d433c1c6926d8999.js'),
    r = require('./d3976cc01aeebc5b09e11c4135b6bd8d.js'),
    s = require('./3c55dff3626a3ee184d599f076158345.js'),
    t = require('./cc2c2970ff81ae4a83123e81ee123da2.js'),
    u = require('./9fdd4ac31a05c27355910f0d74accd4c.js'),
    v = require('./56c390e04c10e91a4aa2a2c19d9a885d.js'),
    w = require('./common/locales/index.js'),
    x = require('./a1dd553cc059d528bb0ef56afed53968.js'),
    y = require('./e50ed2397425c95bd75b01a4829d289f.js'),
    z = require('./3bfffbe88b3d923921f851c0697974fe.js'),
    A = require('./72410b6d4968336cd8b2fc1d41f52cdf.js'),
    B = require('./da7c31daaf542cf1796023d8e344b98a.js'),
    {
      enterBackground: C,
      enterForeground: D
    } = require('./a3959bb900db9f65ed2e9c5dfa6977b7.js'),
    E = require('./db2217eb4cff896bdcbc50abe005058f.js'),
    F = require('./1dea83a77e99a7c94f6b6f01f5c175b0.js'),
    G = require('./f0466135fc8b3a662084784e5f4ac792.js'),
    H = require('./ac78c5d79e26c1024c1fbe65d4c8047e.js'),
    { connect: I } = require('react-redux'),
    J = 53,
    K = -105,
    L = [{ name: '\u5C0F\u7A0B\u5E8F\u6A21\u5F0F', value: u.weapp }],
    M = [
      { name: '\u5C0F\u7A0B\u5E8F\u6A21\u5F0F', value: u.weapp },
      { name: '\u641C\u7D22\u52A8\u6001\u9875', value: u.search },
      { name: '\u63D2\u4EF6\u6A21\u5F0F', value: u.plugin }
    ],
    N = [{ name: '\u5C0F\u6E38\u620F\u6A21\u5F0F', value: u.game }],
    O = [
      { name: '\u5C0F\u7A0B\u5E8F\u6A21\u5F0F', value: u.weapp },
      { name: '\u63D2\u4EF6\u6A21\u5F0F', value: u.plugin }
    ],
    P = [
      { name: '\u5C0F\u7A0B\u5E8F\u6A21\u5F0F', value: u.weapp },
      { name: '\u641C\u7D22\u52A8\u6001\u9875', value: u.search }
    ]
  class Q extends a.Component {
    constructor(a) {
      super(a),
        (this.state = {
          compileTypeDropDownLeft: 0,
          compileTypeDropDownTop: 0,
          moreDropDownLeft: 0,
          moreDropDownTop: 0,
          moreDropDownList: [],
          QRCodeLeft: 0,
          QRCodeTop: 0,
          QCloudLeft: 0,
          QCloudTop: 0,
          CleanCacheLeft: 0,
          CleanCacheTop: 0,
          CleanCacheRight: 0,
          marginTop: 0,
          timeStamp: 0,
          autoUploadStatus: null,
          configListLeft: 270,
          configListTop: 20
        })
    }
    componentDidMount() {
      !global.onlySimulator && this.props.show
        ? this.setState({ marginTop: '0px' })
        : this.setState({
            marginTop: `${-b.findDOMNode(this).getBoundingClientRect()
              .height}px`
          })
    }
    componentWillReceiveProps(a) {
      if (a.previewQRShow != this.props.previewQRShow && a.previewQRShow) {
        const a = this.qrbutton.getBoundingClientRect()
        this.setState({ QRCodeLeft: a.left + K, QRCodeTop: a.top + J })
      }
      if (
        a.remoteDebugCodeShow !== this.props.remoteDebugCodeShow &&
        a.remoteDebugCodeShow
      ) {
        const a = this.remoteDebugButton.getBoundingClientRect()
        this.setState({
          remoteDebugCodeLeft: a.left + K,
          remoteDebugCodeTop: a.top + J
        })
      }
      a.show != this.props.show &&
        (!global.onlySimulator && a.show
          ? this.setState({ marginTop: '0px' })
          : this.setState({
              marginTop: `${-b.findDOMNode(this).getBoundingClientRect()
                .height}px`
            })),
        a.compilerSettings.liveReload &&
        a.compileTimestamp !== this.props.compileTimestamp
          ? (clearTimeout(this._autoUploadTimer),
            (this._autoUploadTimer = setTimeout(() => this.autoUpload(), 20)))
          : !a.compilerSettings.liveReload &&
            clearTimeout(this._autoUploadTimer)
    }
    autoUpload() {
      clearTimeout(this._autoUploadTimer)
      const a = this.props
      let b,
        c = { test: !0, liveReload: a.compilerSettings.liveReload }
      try {
        let a = this.props.project,
          d = a.compileType,
          e = a.condiction[d]
        ;(b = e.list[e.current]),
          d == u.search
            ? b &&
              ((c.searchQuery = b.customQuery || b.query),
              (c.boxQI = b.customQuery ? '' : b.boxQI))
            : (d == u.weapp || d == u.plugin) &&
              ((c.page = b ? b.pathName : this.props.appConfig.pages[0]),
              (c.query = b ? b.query : ''))
      } catch (a) {}
      this.setState({
        autoUploadFailureText: null,
        autoUploadStatus: 'uploading'
      }),
        G(c)
          .then(() => {
            this.setState({ autoUploadStatus: 'success' })
          })
          .catch(a => {
            console.error(a),
              this.setState({
                autoUploadStatus: 'fail',
                autoUploadFailureText: (a && a.toString && a.toString()) || a
              })
          })
    }
    onSetAppservice() {
      this.props.toolbarConfigShow ||
        (this.props.debugPopup
          ? (this.props.windowActions.toggleDebugWindow(), this.props.compile())
          : this.props.windowActions.toggleDebugWindow())
    }
    onSetEditor() {
      this.props.toolbarConfigShow ||
        this.props.windowActions.toggleEditorWindow()
    }
    onSetSimulator() {
      this.props.toolbarConfigShow ||
        (this.props.simulatorPopup
          ? (this.props.windowActions.toggleSimulatorWindow(),
            this.props.compile())
          : this.props.windowActions.toggleSimulatorWindow())
    }
    onLaunchSimulator() {
      this.props.toolbarConfigShow ||
        this.props.compile({ origin: v.COMPILE_ORIGIN.BUTTON })
    }
    toggleCompileCondiction(a) {
      if (!this.props.toolbarConfigShow) {
        a.stopPropagation(),
          this.props.toolbarActions.toggleClickKey(o.COMPILECONDICTION)
        let b = a.currentTarget.getBoundingClientRect()
        this.setState({
          condictionDropDownLeft: b.left,
          condictionDropDownTop: b.top + 20
        })
      }
    }
    toggleCleanCache(a) {
      if (!this.props.toolbarConfigShow) {
        a.stopPropagation()
        let b = a.currentTarget.getBoundingClientRect()
        this.setState({
          CleanCacheTop: b.top + 22,
          CleanCacheLeft: b.left,
          CleanCacheRight: void 0
        }),
          this.props.toolbarActions.toggleClickKey(o.CLEANCACHE)
      }
    }
    togglePreviewCode(a) {
      if (
        (a.stopPropagation(),
        !(this.props.actionBtnDisabled || this.props.toolbarConfigShow))
      ) {
        let b = a.currentTarget.getBoundingClientRect()
        this.props.toolbarActions.togglePreviewCode({
          left: b.left,
          top: b.top
        }),
          this.props.compilerSettings.liveReload
            ? this.setState({ timeStamp: 1 * new Date() })
            : this.setState({
                timeStamp: 1 * new Date(),
                autoUploadStatus: null,
                autoUploadFailureText: null
              }),
          B('weapp_toolbar_preview', this.props.project.appid)
      }
    }
    toggleProjectInfo(a) {
      this.props.toolbarConfigShow ||
        (a.stopPropagation(),
        this.props.toolbarActions.toggleClickKey(o.PROJECTINFO),
        B('weapp_toolbar_details', this.props.project.appid))
    }
    toggleCompileType(a) {
      if (!this.props.toolbarConfigShow) {
        a.stopPropagation(),
          this.props.toolbarActions.toggleClickKey(o.COMPILETYPE)
        let b = a.currentTarget.getBoundingClientRect()
        this.setState({
          compileTypeDropDownLeft: b.left,
          compileTypeDropDownTop: b.top + b.height
        })
      }
    }
    onUploadClick() {
      this.props.actionBtnDisabled ||
        this.props.project.isGameTourist ||
        this.props.toolbarConfigShow ||
        (this.props.infoActions.setUploadInfo({ show: !0 }),
        B('weapp_toolbar_upload', this.props.project.appid))
    }
    onTestClick() {
      this.props.actionBtnDisabled ||
        this.props.toolbarConfigShow ||
        (this.props.debugActions.openMobileTest(),
        B('weapp_test_save', this.props.project.appid))
    }
    onShareClick() {
      this.props.infoActions.setShareInfo({ show: !0 })
    }
    onSetBackground() {
      if (!this.props.toolbarConfigShow) {
        if (
          this.props.compileType == u.weapp ||
          this.props.compileType === u.game
        )
          if (this.props.backgroundShow) {
            let a = this.props.webviewInfo.pathName,
              b = this.props.webviewInfo.query,
              c = this.props.condiction
            D('toolbarAndBackMode', {
              path: a,
              query: b,
              scene: c.scene,
              shareInfo: c.shareInfo,
              referrerInfo: c.referrerInfo
            })
          } else C('toolbarAndBackMode')
        this.props.setBackground({ show: !this.props.backgroundShow })
      }
    }
    onCompileTypeSelect(a) {
      let b = this.props.compileTypeConst[a]
      b && this.props.setProjectCompileType(b.value),
        this.props.toolbarActions.toggleClickKey(o.COMPILETYPE)
    }
    onMoreClick(a) {
      if (this.props.toolbarConfigShow) return
      let b = a.currentTarget.getBoundingClientRect(),
        c = global.windowMap.get('MAIN').width,
        d = []
      1090 > c &&
        ((d = [
          {
            name: '\u4E0A\u4F20',
            type: 'upload',
            show: this.props.project && !this.props.project.isMiniCode
          },
          {
            name: '\u5206\u4EAB',
            type: 'share',
            show: this.props.project && this.props.project.isMiniCode
          },
          {
            name: '\u6D4B\u8BD5',
            type: 'test',
            show: this.props.project && !this.props.project.isMiniCode
          },
          {
            name: '\u7D20\u6750\u7BA1\u7406',
            type: 'cos',
            show: this.props.project && !this.props.project.isMiniCode
          },
          {
            name: '\u817E\u8BAF\u4E91',
            type: 'qcloud',
            show: this.props.project && !this.props.project.isMiniCode
          },
          { name: '\u8BE6\u60C5', type: 'project', show: !0 }
        ]),
        (d = d.filter(a => a.show)),
        930 > c &&
          (d = d.concat([
            {
              name: this.props.backgroundShow
                ? '\u5207\u524D\u53F0'
                : '\u5207\u540E\u53F0',
              type: 'background',
              show: !0
            },
            { name: '\u6E05\u7F13\u5B58', type: 'cleancache', show: !0 }
          ]))),
        this.setState({ moreDropDownTop: b.top + 22, moreDropDownList: d }),
        this.props.toolbarActions.toggleClickKey(o.MORETOOL)
    }
    onMoreSelect(a, b) {
      this.props.toolbarActions.toggleClickKey(o.NONE)
      let c = this.state.moreDropDownList[a]
      if (c)
        switch (c.type) {
          case 'upload': {
            this.onUploadClick()
            break
          }
          case 'share': {
            this.onShareClick()
            break
          }
          case 'test': {
            this.onTestClick()
            break
          }
          case 'qcloud': {
            const a = this
            this.toggleQCloud({
              stopPropagation: () => {},
              currentTarget: {
                getBoundingClientRect() {
                  return { right: 0, top: a.state.moreDropDownTop - 20 }
                }
              }
            })
            break
          }
          case 'project': {
            this.toggleProjectInfo(b)
            break
          }
          case 'background': {
            this.onSetBackground()
            break
          }
          case 'cleancache': {
            this.setState({
              CleanCacheTop: this.state.moreDropDownTop,
              CleanCacheLeft: void 0,
              CleanCacheRight: 0
            }),
              this.props.toolbarActions.toggleClickKey(o.CLEANCACHE)
            break
          }
          case 'cos': {
            this.toggleCos()
            break
          }
        }
    }
    showErr(a, b = '\u9519\u8BEF', c = () => {}) {
      this.props.infoActions.setConfirmInfo({
        show: !0,
        showCancel: !1,
        title: b,
        content: a,
        callback: async () => {
          c()
        }
      })
    }
    async toggleCos() {
      if (
        !(
          this.props.actionBtnDisabled ||
          this.props.project.isGameTourist ||
          this.props.toolbarConfigShow
        )
      ) {
        let a = await this.checkIsQcloudProject(
          'https://developers.weixin.qq.com/miniprogram/dev/qcloud/material.html'
        )
        a && this.props.openCosManager()
      }
    }
    async checkIsQcloudProject(a) {
      let b = this.props.project,
        c = z.isQcloudProject(b)
      if (!c) {
        try {
          await this.props.requestProjectAttr()
        } catch (a) {}
        ;(b = this.props.project), (c = z.isQcloudProject(b))
      }
      return (
        c ||
          this.props.infoActions.setConfirmInfo({
            show: !0,
            showCancel: !0,
            title: '\u672A\u6388\u6743\u817E\u8BAF\u4E91',
            content: `当前 AppID ${b.appid} 未授权给腾讯云，点击确定查看文档`,
            confirmText: '\u786E\u5B9A',
            callback: async b => {
              b &&
                nw.Shell.openExternal(
                  a || 'https://cloud.tencent.com/document/product/619/11447'
                )
            }
          }),
        c
      )
    }
    async toggleQCloud(a) {
      if (
        (a.stopPropagation(),
        this.props.actionBtnDisabled ||
          this.props.project.isGameTourist ||
          this.props.toolbarConfigShow)
      )
        return
      const b = a.currentTarget.getBoundingClientRect()
      if (this.props.actionBtnDisabled) return
      let c = this.props.project,
        d = await this.checkIsQcloudProject()
      if (!d) return
      if (this.props.qcloud && this.props.qcloud.currentOperation) {
        const a = {
            [A.CLOUD_ACTION_UPLOAD]: '\u4E0A\u4F20',
            [A.CLOUD_ACTION_DEBUG]: '\u51C6\u5907\u5355\u6B65\u8C03\u8BD5',
            [A.CLOUD_ACTION_DEPLOY_DEV]:
              '\u90E8\u7F72\u5230\u6D4B\u8BD5\u73AF\u5883',
            [A.CLOUD_ACTION_DEPLOY_PRODUCT]:
              '\u90E8\u7F72\u5230\u6B63\u5F0F\u73AF\u5883',
            [A.CLOUD_ACTION_INSTALL_DEPENDENCE]: '\u5B89\u88C5\u4F9D\u8D56',
            [A.CLOUD_ACTION_RESET_SERVICE]:
              '\u6062\u590D\u5F00\u53D1\u73AF\u5883',
            [A.CLOUD_ACTION_RESTART_SERVICE]: '\u91CD\u542F\u670D\u52A1',
            [A.CLOUD_ACTION_STOP_SERVICE]: '\u505C\u6B62\u670D\u52A1',
            [A.CLOUD_ACTION_UPLOAD_IDC]: '\u4E0A\u4F20\u6B63\u5F0F\u4EE3\u7801'
          },
          b = a[this.props.qcloud.currentOperation]
        if (b) return void this.showErr(`正在${b}中，请等待操作完成`)
      }
      const e = (a, b) => {
        let c
        try {
          c = a()
        } catch (a) {
          return void b(a)
        }
        return c
      }
      let f = !1
      try {
        const a = e(
            () => {
              return (
                1 ===
                parseInt(
                  this.props.project.attr.qcloud.qcloud_status.open_develop_env,
                  10
                )
              )
            },
            () => {}
          ),
          b = e(
            () => {
              let a = parseInt(
                this.props.project.attr.qcloud.qcloud_dev_info.current_language,
                10
              )
              return 1 === a || 2 === a
            },
            () => {}
          )
        f = a || b
      } catch (a) {}
      return f
        ? void (this.props.toolbarActions.toggleClickKey(o.QCLOUD),
          void 0 === b.left
            ? this.setState({
                QCloudLeft: void 0,
                QCloudRight: b.right,
                QCloudTop: b.top + 20
              })
            : this.setState({
                QCloudRight: void 0,
                QCloudLeft: b.left,
                QCloudTop: b.top + 20
              }))
        : void this.props.windowActions.setQCloud({ deployShow: !0 })
    }
    async remoteDebug(a) {
      if (
        (a.stopPropagation(),
        !(this.props.actionBtnDisabled || this.props.toolbarConfigShow))
      ) {
        const b = E.get(v.WINDOW_REGISTRY.REMOTE_DEBUG_WINDOW)
        if (b) return void b.focus()
        if (this.props.remoteDebugWindow.debuggingProjectId)
          return this.props.project.projectid ===
            this.props.remoteDebugWindow.debuggingProjectId
            ? void 0
            : void this.showErr(
                '\u8BF7\u5148\u7ED3\u675F\u5176\u4ED6\u8FDC\u7A0B\u8C03\u8BD5\u3002'
              )
        this.props.windowActions.setRemoteDebugWindow({
          debuggingProjectId: this.props.project.projectid
        })
        let c = a.currentTarget.getBoundingClientRect()
        this.props.toolbarActions.toggleRemoteDebugCode({
          left: c.left,
          top: c.top
        }),
          this.setState({ timeStamp: 1 * new Date() })
      }
    }
    getDevEnvType() {
      let a = 1
      try {
        a =
          2 ===
          parseInt(
            this.props.project.attr.qcloud.qcloud_dev_info.current_language,
            10
          )
            ? 2
            : 1
      } catch (a) {}
      return 1 == a ? 'nodejs' : 'php'
    }
    onToolbarMouseDown(a) {
      if (2 == a.button) {
        a.preventDefault()
        const b = 163
        this.setState({
          configListLeft:
            a.pageX + b > window.innerWidth ? window.innerWidth - b : a.pageX,
          configListTop: a.pageY
        }),
          this.props.toolbarActions.toggleClickKey(o.TOOLBARCONFIGLIST)
      }
    }
    render() {
      let b = this.props,
        e = '',
        f = this.props.compileTypeConst.map(a => {
          return a.value == this.props.compileType && (e = a.name), a.name
        }),
        g = this.state.moreDropDownList.map(a => {
          return a.name
        }),
        h = b.project.attr && b.project.attr.gameApp,
        i = b.project.isMiniCode,
        j = b.config.title
      return a.createElement(
        'div',
        {
          className: 'header',
          style: { marginTop: this.state.marginTop },
          onMouseDown: this.onToolbarMouseDown.bind(this)
        },
        a.createElement(d, null),
        a.createElement(s, {
          width: 152,
          left: this.state.compileTypeDropDownLeft,
          top: this.state.compileTypeDropDownTop,
          show: b.clickkey == o.COMPILETYPE,
          list: f,
          onSelectClick: this.onCompileTypeSelect.bind(this)
        }),
        a.createElement(y, {
          env: this.getDevEnvType(),
          left: this.state.QCloudLeft,
          top: this.state.QCloudTop,
          right: this.state.QCloudRight
        }),
        a.createElement(s, {
          right: 0,
          top: this.state.moreDropDownTop,
          show: b.clickkey == o.MORETOOL,
          list: g,
          onSelectClick: this.onMoreSelect.bind(this)
        }),
        a.createElement(n, {
          left: this.state.CleanCacheLeft,
          top: this.state.CleanCacheTop,
          right: this.state.CleanCacheRight
        }),
        b.previewQRShow
          ? a.createElement(p, {
              autoUploadFailureText: this.state.autoUploadFailureText,
              left: this.state.QRCodeLeft,
              top: this.state.QRCodeTop,
              timeStamp: this.state.timeStamp
            })
          : null,
        b.remoteDebugCodeShow
          ? a.createElement(p, {
              mode: 'remotedebug',
              left: this.state.remoteDebugCodeLeft,
              top: this.state.remoteDebugCodeTop,
              timeStamp: this.state.timeStamp
            })
          : null,
        a.createElement(l, {
          left: this.state.condictionDropDownLeft,
          top: this.state.condictionDropDownTop
        }),
        a.createElement(H, {
          left: this.state.configListLeft,
          top: this.state.configListTop
        }),
        a.createElement(
          'div',
          { className: 'toolbar' },
          a.createElement(
            'div',
            { className: 'toolbar-items' },
            a.createElement(
              'div',
              {
                className: 'toolbar-item',
                onClick: this.onSetSimulator.bind(this),
                id: 'toolbar-simulator'
              },
              a.createElement(
                'div',
                {
                  className: c('toolbar-action', {
                    'toolbar-action-active':
                      b.simulatorShow && !b.simulatorPopup
                  }),
                  disabled: b.toolbarConfigShow
                },
                a.createElement(
                  'div',
                  { className: 'toolbar-button' },
                  a.createElement('i', { className: 'ui-icon-simulator' })
                ),
                j
                  ? a.createElement(
                      'p',
                      { className: 'toolbar-label' },
                      '\u6A21\u62DF\u5668'
                    )
                  : null
              )
            ),
            a.createElement(
              'div',
              {
                className: 'toolbar-item',
                onClick: this.onSetEditor.bind(this),
                id: 'toolbar-editor'
              },
              a.createElement(
                'div',
                {
                  className: c('toolbar-action', {
                    'toolbar-action-active': b.editorShow
                  }),
                  disabled: b.toolbarConfigShow
                },
                a.createElement(
                  'div',
                  { className: 'toolbar-button' },
                  a.createElement('i', { className: 'ui-icon-editor' })
                ),
                j
                  ? a.createElement(
                      'p',
                      { className: 'toolbar-label' },
                      '\u7F16\u8F91\u5668'
                    )
                  : null
              )
            ),
            a.createElement(
              'div',
              {
                className: 'toolbar-item',
                onClick: this.onSetAppservice.bind(this),
                id: 'toolbar-devtools'
              },
              a.createElement(
                'div',
                {
                  className: c('toolbar-action', {
                    'toolbar-action-active': b.debugShow && !b.debugPopup
                  }),
                  disabled: b.toolbarConfigShow
                },
                a.createElement(
                  'div',
                  { className: 'toolbar-button' },
                  a.createElement('i', { className: 'ui-icon-debug' })
                ),
                j
                  ? a.createElement(
                      'p',
                      { className: 'toolbar-label' },
                      '\u8C03\u8BD5\u5668'
                    )
                  : null
              )
            )
          ),
          a.createElement(
            'div',
            { className: 'toolbar-items' },
            a.createElement(
              'div',
              {
                className: 'toolbar-item',
                style: { display: b.weappCompileTypeShow ? '' : 'none' }
              },
              a.createElement(
                'div',
                { className: 'toolbar-action-group' },
                a.createElement(
                  'div',
                  {
                    className: 'toolbar-action',
                    onClick: this.toggleCompileType.bind(this),
                    disabled: b.toolbarConfigShow
                  },
                  a.createElement(
                    'div',
                    { className: 'toolbar-action-selector' },
                    a.createElement('p', null, e),
                    a.createElement('i', {
                      className: c({
                        'ui-icon-arrow-down': b.clickkey != o.COMPILETYPE,
                        'ui-icon-arrow-up': b.clickkey == o.COMPILETYPE
                      })
                    })
                  )
                )
              )
            ),
            a.createElement('div', {
              className: 'toolbar-item-divider',
              style: { display: b.weappCompileTypeShow ? '' : 'none' }
            }),
            a.createElement(
              'div',
              { className: 'toolbar-item' },
              a.createElement(
                'div',
                { className: 'toolbar-action-group' },
                a.createElement(
                  'div',
                  {
                    className: 'toolbar-action',
                    onClick: this.toggleCompileCondiction.bind(this),
                    disabled: b.toolbarConfigShow
                  },
                  a.createElement(
                    'div',
                    {
                      className: 'toolbar-action-selector',
                      onClick: this.toggleCompileCondiction.bind(this)
                    },
                    a.createElement('p', null, b.condictionName),
                    a.createElement('i', {
                      className: c({
                        'ui-icon-arrow-down': b.clickkey != o.COMPILECONDICTION,
                        'ui-icon-arrow-up': b.clickkey == o.COMPILECONDICTION
                      })
                    })
                  )
                ),
                a.createElement(
                  'div',
                  {
                    className: 'toolbar-action',
                    onClick: this.onLaunchSimulator.bind(this),
                    id: 'toolbar-compile',
                    disabled: b.toolbarConfigShow
                  },
                  a.createElement(
                    'div',
                    { className: 'toolbar-button' },
                    a.createElement('i', { className: 'ui-icon-refresh' })
                  ),
                  j
                    ? a.createElement(
                        'p',
                        { className: 'toolbar-label' },
                        '\u7F16\u8BD1'
                      )
                    : null
                ),
                a.createElement(
                  'div',
                  {
                    className: 'toolbar-action',
                    ref: 'previewBtn',
                    disabled: b.actionBtnDisabled || b.toolbarConfigShow,
                    onClick: this.togglePreviewCode.bind(this),
                    id: 'toolbar-preview'
                  },
                  a.createElement(
                    'div',
                    {
                      className: 'toolbar-button',
                      ref: a => (this.qrbutton = a),
                      title: b.disabledTips
                    },
                    a.createElement('style', {
                      dangerouslySetInnerHTML: {
                        __html: '.scale07 { transform: scale(0.7, 0.7) }'
                      }
                    }),
                    a.createElement('i', {
                      className: (() => {
                        const a = this.state.autoUploadStatus,
                          b = this.props.compilerSettings.liveReload
                        return a && b
                          ? 'uploading' === a
                            ? 'ui-icon-spinner scale07'
                            : 'success' === a
                              ? 'ui-icon-success scale07'
                              : 'fail' === a
                                ? 'ui-icon-error scale07'
                                : 'ui-icon-eye'
                          : 'ui-icon-eye'
                      })()
                    })
                  ),
                  j
                    ? a.createElement(
                        'p',
                        { className: 'toolbar-label' },
                        '\u9884\u89C8'
                      )
                    : null
                )
              )
            ),
            'weapp' !== this.props.compileType || h
              ? null
              : a.createElement(
                  'div',
                  { className: 'toolbar-item' },
                  a.createElement(
                    'div',
                    {
                      className: 'toolbar-action',
                      disabled: b.actionBtnDisabled || b.toolbarConfigShow,
                      onClick: this.remoteDebug.bind(this)
                    },
                    a.createElement(
                      'div',
                      {
                        className: 'toolbar-button',
                        ref: a => (this.remoteDebugButton = a),
                        title: b.disabledTips
                      },
                      a.createElement('i', { className: 'ui-icon-bug' })
                    ),
                    j
                      ? a.createElement(
                          'p',
                          { className: 'toolbar-label' },
                          '\u8FDC\u7A0B\u8C03\u8BD5'
                        )
                      : null
                  )
                ),
            a.createElement(
              'div',
              { className: 'toolbar-item' },
              a.createElement(
                'div',
                {
                  className: 'toolbar-action',
                  onClick: this.onSetBackground.bind(this),
                  disabled: b.toolbarConfigShow,
                  id: 'toolbar-switch'
                },
                a.createElement(
                  'div',
                  { className: 'toolbar-button' },
                  a.createElement('i', { className: 'ui-icon-backstage' })
                ),
                j
                  ? a.createElement(
                      'p',
                      { className: 'toolbar-label' },
                      b.backgroundShow
                        ? '\u5207\u524D\u53F0'
                        : '\u5207\u540E\u53F0'
                    )
                  : null
              )
            ),
            a.createElement(
              'div',
              { className: 'toolbar-item' },
              a.createElement(
                'div',
                {
                  className: 'toolbar-action',
                  onClick: this.toggleCleanCache.bind(this),
                  disabled: b.toolbarConfigShow,
                  id: 'toolbar-cleancache'
                },
                a.createElement(
                  'div',
                  { className: 'toolbar-button' },
                  a.createElement('i', { className: 'ui-icon-cache' }),
                  a.createElement('i', {
                    className: c({
                      'ui-icon-arrow-down': b.clickkey != o.CLEANCACHE,
                      'ui-icon-arrow-up': b.clickkey == o.CLEANCACHE
                    })
                  })
                ),
                j
                  ? a.createElement(
                      'p',
                      { className: 'toolbar-label' },
                      '\u6E05\u7F13\u5B58'
                    )
                  : null
              )
            )
          ),
          a.createElement(
            'div',
            { className: 'toolbar-items' },
            a.createElement(
              'div',
              { className: 'toolbar-item-group' },
              null,
              i || !b.config.upload
                ? null
                : a.createElement(
                    'div',
                    { className: 'toolbar-item' },
                    a.createElement(
                      'div',
                      {
                        className: 'toolbar-action',
                        disabled:
                          b.actionBtnDisabled || b.project.isGameTourist,
                        onClick: this.onUploadClick.bind(this),
                        id: 'toolbar-upload'
                      },
                      a.createElement(
                        'div',
                        { className: 'toolbar-button', title: b.disabledTips },
                        a.createElement('i', { className: 'ui-icon-upload' })
                      ),
                      j
                        ? a.createElement(
                            'p',
                            { className: 'toolbar-label' },
                            '\u4E0A\u4F20'
                          )
                        : null
                    )
                  ),
              i || !b.config.test
                ? null
                : a.createElement(
                    'div',
                    {
                      className: 'toolbar-item',
                      style: h ? q.displayNone : {}
                    },
                    a.createElement(
                      'div',
                      {
                        className: 'toolbar-action',
                        disabled: b.actionBtnDisabled,
                        onClick: this.onTestClick.bind(this),
                        id: 'toolbar-test'
                      },
                      a.createElement(
                        'div',
                        { className: 'toolbar-button', title: b.disabledTips },
                        a.createElement('i', { className: 'ui-icon-beaker' })
                      ),
                      j
                        ? a.createElement(
                            'p',
                            { className: 'toolbar-label' },
                            '\u6D4B\u8BD5'
                          )
                        : null
                    )
                  ),
              i || !b.config.cos
                ? null
                : a.createElement(
                    'div',
                    { className: 'toolbar-item' },
                    a.createElement(
                      'div',
                      {
                        className: 'toolbar-action',
                        disabled:
                          b.actionBtnDisabled || b.project.isGameTourist,
                        onClick: this.toggleCos.bind(this),
                        id: 'toolbar-qcloud'
                      },
                      a.createElement(
                        'div',
                        { className: 'toolbar-button', title: b.disabledTips },
                        a.createElement('i', { className: 'ui-icon-material' })
                      ),
                      j
                        ? a.createElement(
                            'p',
                            { className: 'toolbar-label' },
                            '\u7D20\u6750\u7BA1\u7406'
                          )
                        : null
                    )
                  ),
              i || !b.config.qcloud
                ? null
                : a.createElement(
                    'div',
                    { className: 'toolbar-item' },
                    a.createElement(
                      'div',
                      {
                        className: 'toolbar-action',
                        disabled:
                          b.actionBtnDisabled || b.project.isGameTourist,
                        onClick: this.toggleQCloud.bind(this),
                        id: 'toolbar-qcloud'
                      },
                      a.createElement(
                        'div',
                        { className: 'toolbar-button', title: b.disabledTips },
                        a.createElement('i', { className: 'ui-icon-cloud' })
                      ),
                      j
                        ? a.createElement(
                            'p',
                            { className: 'toolbar-label' },
                            '\u817E\u8BAF\u4E91'
                          )
                        : null
                    )
                  ),
              i
                ? a.createElement(
                    'div',
                    { className: 'toolbar-item' },
                    a.createElement(
                      'div',
                      {
                        className: 'toolbar-action',
                        onClick: this.onShareClick.bind(this),
                        id: 'toolbar-qcloud'
                      },
                      a.createElement(
                        'div',
                        { className: 'toolbar-button' },
                        a.createElement('i', { className: 'ui-icon-upload' })
                      ),
                      j
                        ? a.createElement(
                            'p',
                            { className: 'toolbar-label' },
                            '\u5206\u4EAB'
                          )
                        : null
                    )
                  )
                : null
            ),
            a.createElement(
              'div',
              { className: 'toolbar-item-group' },
              a.createElement(
                'div',
                { className: 'toolbar-item' },
                a.createElement(
                  'div',
                  {
                    className: c('toolbar-action', {
                      'toolbar-action-active': b.projectInfoShow
                    }),
                    onClick: this.toggleProjectInfo.bind(this),
                    disabled: b.toolbarConfigShow,
                    id: 'toolbar-detail'
                  },
                  a.createElement(
                    'div',
                    { className: 'toolbar-button' },
                    a.createElement('i', { className: 'ui-icon-bars' })
                  ),
                  j
                    ? a.createElement(
                        'p',
                        { className: 'toolbar-label' },
                        '\u8BE6\u60C5'
                      )
                    : null
                )
              )
            )
          ),
          a.createElement(
            'a',
            { className: 'toolbar-more', onClick: this.onMoreClick.bind(this) },
            a.createElement('i', { className: 'ui-icon-double-arrow-right' })
          )
        )
      )
    }
  }
  module.exports = I(
    a => {
      let b = a.project.current || {},
        c = b.compileType,
        d = b.condiction && b.condiction[c],
        e = {},
        f = '\u666E\u901A\u7F16\u8BD1'
      d && d.list && ((e = d.list[d.current]), e ? (f = e.name) : (e = {}))
      let g = a.toolbar.clickKey,
        h = a.simulator.webviewInfos[a.simulator.currentWebviewID] || {},
        i = b.attr && b.attr.userbanded,
        j = b.isTourist || !i,
        k = ''
      j &&
        (k = b.isTourist
          ? w.config.ALERT_TOURIST_FORBIDDEN_CONTENT
          : i
            ? ''
            : w.config.CGI_ERR_NOT_BAND)
      let l = !1,
        m = L
      c == u.weapp
        ? ((l = !0), (m = M))
        : c == u.search
          ? ((l = !0), (m = P))
          : c == u.plugin && ((l = !0), (m = O)),
        b.attr && b.attr.gameApp && ((l = !1), (m = N))
      const n = ((a.simulator || {}).compileCommand || {}).ts
      let p = a.toolbar.config
      return {
        compilerSettings: a.settings.compiler || {},
        compileTimestamp: n,
        show: a.window.toolbar && a.window.toolbar.show,
        qcloud: b.qcloud,
        searchWidgetShow: !0,
        actionBtnDisabled: j,
        disabledTips: k,
        previewQRShow: o.PREVIEWCODE == g,
        remoteDebugCodeShow: o.REMOTEDEBUGCODE === g,
        debugShow: a.window.debug.show,
        debugPopup: a.window.debug.popup,
        remoteDebugWindow: a.window.remoteDebugWindow,
        editorShow: a.window.editor && a.window.editor.show,
        simulatorShow: a.window.simulator && a.window.simulator.show,
        simulatorPopup:
          a.window.simulator && 'popup' === a.window.simulator.position,
        projectInfoShow: o.PROJECTINFO == g,
        device: a.toolbar.deviceInfo,
        backgroundShow: a.simulator.backgroundShow,
        clickkey: a.toolbar.clickKey,
        project: b,
        projectAttr: b.attr || {},
        condiction: e,
        webviewInfo: h,
        compileType: c,
        condictionName: f,
        compileTypeConst: m,
        weappCompileTypeShow: l,
        appConfig: a.simulator.appConfig || {},
        toolbarConfigShow:
          a.window.toolbarConfig && a.window.toolbarConfig.show,
        config: p
      }
    },
    a => {
      return {
        openCosManager: r.bindActionCreators(k.openCosManager, a),
        toolbarActions: r.bindActionCreators(m, a),
        windowActions: r.bindActionCreators(g, a),
        infoActions: r.bindActionCreators(h, a),
        setProjectQCloud: r.bindActionCreators(t.setProjectQCloud, a),
        requestProjectAttr: r.bindActionCreators(t.requestProjectAttr, a),
        compile: r.bindActionCreators(i.compile, a),
        setBackground: r.bindActionCreators(i.setBackground, a),
        debugActions: r.bindActionCreators(j, a),
        setProjectCompileType: r.bindActionCreators(t.setProjectCompileType, a)
      }
    }
  )(Q)
})(require('lazyload'), require)
