'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'),
    { connect: e } = require('react-redux')
  class f extends a.Component {
    constructor(a) {
      super(a), (this.state = { lazyLoaded: a.show })
    }
    componentWillReceiveProps(a) {
      a.show != this.props.show && a.show && this.setState({ lazyLoaded: !0 })
    }
    handleCancel() {
      this.props.debuggerActions.setJssdkCallback({
        callbackID: this.props.callbackID,
        runtimeID: this.props.runtimeID,
        res: { errMsg: `${this.props.api}:cancel` }
      }),
        this.hide()
    }
    handleConfirm() {
      this.props.debuggerActions.setJssdkCallback({
        callbackID: this.props.callbackID,
        runtimeID: this.props.runtimeID,
        res: { errMsg: `${this.props.api}:ok` }
      }),
        this.hide()
    }
    hide() {
      this.props.debuggerActions.setShare({
        show: !1,
        title: '',
        desc: '',
        imgUrl: '',
        sdkName: '',
        api: ''
      })
    }
    render() {
      if (!this.state.lazyLoaded) return null
      let c = this.props
      return a.createElement(
        'div',
        { className: 'share-dialog', style: c.show ? {} : b.displayNone },
        a.createElement('div', { className: 'weui-mask' }),
        a.createElement(
          'div',
          { className: 'weui-dialog' },
          a.createElement(
            'div',
            { className: 'weui-dialog__bd' },
            a.createElement(
              'h3',
              { className: 'share-dialog-title' },
              '\u53D1\u9001\u7ED9\uFF1A'
            ),
            a.createElement(
              'div',
              { className: 'share-dialog-target ui-flex' },
              a.createElement(
                'div',
                { className: 'share-dialog-nickname' },
                a.createElement(
                  'span',
                  null,
                  'timeline' == c.type ? '\u670B\u53CB\u5708' : '\u670B\u53CB'
                )
              )
            ),
            a.createElement(
              'div',
              { className: 'share-dialog-content' },
              a.createElement(
                'div',
                {
                  className: 'ui-flex',
                  style: 'timeline' == c.type ? {} : b.displayNone
                },
                a.createElement(
                  'div',
                  { className: 'share-dialog-thumb' },
                  a.createElement('img', { src: c.imgUrl })
                ),
                a.createElement(
                  'p',
                  { className: 'share-dialog-desc' },
                  '[\u94FE\u63A5] ',
                  c.title
                )
              ),
              a.createElement(
                'div',
                {
                  className: 'ui-flex',
                  style: 'appmsg' == c.type ? {} : b.displayNone
                },
                a.createElement(
                  'p',
                  { className: 'share-dialog-desc' },
                  '[\u94FE\u63A5] ',
                  c.title
                )
              )
            )
          ),
          a.createElement(
            'div',
            { className: 'weui-dialog__ft' },
            a.createElement(
              'a',
              {
                onClick: this.handleCancel.bind(this),
                className: 'weui-dialog__btn weui-dialog__btn_default'
              },
              '\u53D6\u6D88'
            ),
            a.createElement(
              'a',
              {
                className: 'weui-dialog__btn weui-dialog__btn_primary',
                onClick: this.handleConfirm.bind(this)
              },
              '\u53D1\u9001'
            )
          )
        )
      )
    }
  }
  module.exports = e(
    a => {
      let b = a.webdebugger.shareInfo
      return _extends({}, b)
    },
    a => {
      return { debuggerActions: c.bindActionCreators(d, a) }
    }
  )(f)
})(require('lazyload'), require)
