'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('react'),
    b = require('./3b5f8e2469c474c8d433c1c6926d8999.js'),
    c = require('./d3976cc01aeebc5b09e11c4135b6bd8d.js'),
    d = require('./c4190a2430506f3602ca550e1e75d620.js'),
    e = require('./e40e098fcb2111ba9f21e79c183fec7e.js'),
    f = require('classnames'),
    { connect: g } = require('react-redux')
  class h extends a.Component {
    constructor(a) {
      super(a),
        (this.onAnimationEnd = () => {
          'hide' == this.state.animationType &&
            this.props.debuggerActions.setFooter({ show: !1 })
        }),
        (this.state = {
          lazyLoaded: a.show,
          show: a.show,
          animationType: 'none'
        })
    }
    componentWillReceiveProps(a) {
      let b = { show: a.show, animationType: a.show ? 'show' : 'hide' }
      a.show && (b.lazyLoaded = !0), this.setState(b)
    }
    onClose() {
      this.setState({ animationType: 'hide' })
    }
    handleOnClick(a) {
      let b = a.currentTarget,
        c = b.dataset,
        d = c.type
      if ('share' === d) {
        let a = c.name
        e.send({
          command: 'WEBDEBUGGER_ON_EVENT',
          data: { eventName: a, data: {} }
        }),
          this.props.debuggerActions.setShare({ show: !0, sdkName: a })
      } else
        'reload' === d
          ? this.props.debuggerActions.setActions('reload')
          : 'open' === d && nw.Shell.openExternal(this.props.url)
      this.onClose()
    }
    render() {
      if (!this.state.lazyLoaded) return null
      let c = this.state.show ? {} : b.displayNone
      return a.createElement(
        'div',
        { style: c },
        a.createElement('div', {
          className: f('weui-mask', {
            'ui-animate-fadeIn': 'show' === this.state.animationType,
            'ui-animate-fadeOut': 'hide' === this.state.animationType
          }),
          onAnimationEnd: this.onAnimationEnd,
          onClick: this.onClose.bind(this)
        }),
        a.createElement(
          'div',
          {
            className: f('ui-actionsheet', {
              'ui-animate-swipeInUp': 'show' === this.state.animationType,
              'ui-animate-swipeInDown': 'hide' === this.state.animationType
            })
          },
          a.createElement(
            'div',
            { className: 'ui-actionsheet-bd' },
            a.createElement(
              'div',
              { className: 'ui-actionsheet-items' },
              a.createElement(
                'div',
                {
                  className: 'ui-actionsheet-item',
                  onClick: this.handleOnClick.bind(this),
                  'data-type': 'share',
                  'data-name': 'menu:share:appmessage'
                },
                a.createElement(
                  'div',
                  { className: 'ui-actionsheet-icon' },
                  a.createElement('i', { className: 'ui-icon-forwarding' })
                ),
                a.createElement(
                  'p',
                  { className: 'ui-actionsheet-label' },
                  '\u53D1\u9001\u7ED9\u670B\u53CB'
                )
              ),
              a.createElement(
                'div',
                {
                  className: 'ui-actionsheet-item',
                  onClick: this.handleOnClick.bind(this),
                  'data-type': 'share',
                  'data-name': 'menu:share:timeline'
                },
                a.createElement(
                  'div',
                  { className: 'ui-actionsheet-icon' },
                  a.createElement('i', { className: 'ui-icon-timeline' })
                ),
                a.createElement(
                  'p',
                  { className: 'ui-actionsheet-label' },
                  '\u5206\u4EAB\u5230\u670B\u53CB\u5708'
                )
              ),
              a.createElement(
                'div',
                {
                  className: 'ui-actionsheet-item',
                  onClick: this.handleOnClick.bind(this),
                  'data-type': 'open'
                },
                a.createElement(
                  'div',
                  { className: 'ui-actionsheet-icon' },
                  a.createElement('i', { className: 'ui-icon-safari' })
                ),
                a.createElement(
                  'p',
                  { className: 'ui-actionsheet-label' },
                  '\u5728\u6D4F\u89C8\u5668\u4E2D\u6253\u5F00'
                )
              ),
              a.createElement(
                'div',
                {
                  className: 'ui-actionsheet-item',
                  onClick: this.handleOnClick.bind(this),
                  'data-type': 'reload'
                },
                a.createElement(
                  'div',
                  { className: 'ui-actionsheet-icon' },
                  a.createElement('i', { className: 'ui-icon-share-refresh' })
                ),
                a.createElement(
                  'p',
                  { className: 'ui-actionsheet-label' },
                  '\u5237\u65B0'
                )
              )
            )
          ),
          a.createElement(
            'div',
            {
              className: 'ui-actionsheet-ft',
              onClick: this.onClose.bind(this)
            },
            a.createElement(
              'a',
              { className: 'ui-actionsheet-opr' },
              '\u53D6\u6D88'
            )
          )
        )
      )
    }
  }
  module.exports = g(
    a => {
      let b = a.webdebugger || {}
      return _extends({}, b.footer, { url: b.url })
    },
    a => {
      return { debuggerActions: c.bindActionCreators(d, a) }
    }
  )(h)
})(require('lazyload'), require)
