'use strict'
!(function(require, directRequire) {
  const a = require('react'),
    b = require('classnames')
  class c extends a.Component {
    constructor(a) {
      super(a)
    }
    getFileIcon(a) {
      if (a) {
        let b = a.type
        if ('video' == b) return 'ui-icon-file-movie'
        if ('audio' == b) return 'ui-icon-file-audio'
      }
      return 'ui-icon-file'
    }
    render() {
      let {
          node: d,
          tree: e,
          currentPath: f,
          onItemDelete: g,
          onItemClick: h,
          offset: i
        } = this.props,
        { isOpen: j, name: k, path: l, isDir: m, children: n } = d,
        o = null
      o = m
        ? a.createElement(
            'div',
            { className: 'tree-view-icon' },
            a.createElement(
              'span',
              null,
              a.createElement('i', {
                className: b({
                  'ui-icon-tree-arrow-down': j,
                  'ui-icon-tree-arrow-right': !j
                })
              })
            ),
            a.createElement(
              'span',
              null,
              a.createElement('i', {
                className: b({ 'ui-icon-folder-o': j, 'ui-icon-folder': !j })
              })
            )
          )
        : a.createElement(
            'div',
            { className: 'tree-view-icon' },
            a.createElement(
              'span',
              null,
              a.createElement('i', { className: this.getFileIcon(d.fileInfo) })
            )
          )
      let p = []
      return (
        m &&
          j &&
          (p = n.map(b => {
            let d = e[b]
            return d
              ? a.createElement(c, {
                  key: b,
                  tree: e,
                  node: d,
                  offset: i + 20,
                  currentPath: f,
                  onItemClick: h
                })
              : null
          })),
        a.createElement(
          'div',
          { className: 'tree-view' },
          a.createElement(
            'div',
            {
              className: b('tree-view-hd', { 'tree-view-hd-active': l === f }),
              'data-path': d.path,
              onMouseDown: this.props.onItemClick
            },
            o,
            a.createElement(
              'div',
              { className: 'tree-view-content' },
              a.createElement('p', null, k)
            )
          ),
          a.createElement('div', { className: 'tree-view-bd' }, p)
        )
      )
    }
  }
  module.exports = c
})(require('lazyload'), require)
