'use strict'
!(function(require, directRequire) {
  const a = require('react'),
    b = require('./logger.js'),
    { connect: c } = require('react-redux'),
    d = require('./e98c60a262d8d98e69e574a9d12a21df.js'),
    e = 'darwin' === process.platform
  class f extends a.Component {
    constructor(a) {
      super(a)
    }
    onClose() {
      if (this.props.onClose) this.props.onClose()
      else {
        let a = this.props.win || global.Win
        try {
          a.close()
        } catch (a) {
          b.error(`titlebar.js error while closing window: ${a}`)
        }
      }
    }
    onOpenSetting() {
      this.props.openIDESettings('proxy')
    }
    onMinimize() {
      if (this.props.onMinimize) this.props.onMinimize()
      else {
        let a = this.props.win || global.Win
        try {
          a.minimize()
        } catch (a) {
          b.error(`titlebar.js error while minimizing window: ${a}`)
        }
      }
    }
    getWindowsRender() {
      return a.createElement(
        'div',
        { className: 'title-bar ui-flex' },
        a.createElement('div', { className: 'ui-flex-item' }),
        a.createElement(
          'div',
          { className: 'title-bar-ext', style: { WebkitAppRegion: 'no-drag' } },
          a.createElement(
            'a',
            { onClick: this.onOpenSetting.bind(this) },
            a.createElement('i', { className: 'ui-icon-cog' })
          ),
          a.createElement(
            'a',
            { onClick: this.onClose.bind(this) },
            a.createElement('i', { className: 'ui-icon-close' })
          )
        )
      )
    }
    getMacRender() {
      return a.createElement(
        'div',
        { className: 'title-bar ui-flex' },
        a.createElement(
          'div',
          { className: 'title-bar-ext', style: { WebkitAppRegion: 'no-drag' } },
          a.createElement(
            'a',
            { className: 'title-bar-close', onClick: this.onClose.bind(this) },
            a.createElement('i', { className: 'ui-icon-circle' })
          ),
          a.createElement(
            'a',
            {
              className: 'title-bar-minimize',
              onClick: this.onMinimize.bind(this)
            },
            a.createElement('i', { className: 'ui-icon-circle' })
          )
        )
      )
    }
    render() {
      return e ? this.getMacRender() : this.getWindowsRender()
    }
  }
  module.exports = c(
    () => {
      return {}
    },
    a => {
      return {
        openIDESettings: b => {
          a(d.openIDESettings(b))
        }
      }
    }
  )(f)
})(require('lazyload'), require)
