<commit_before>import React from 'react'
import { Button, Modal, ModalHeader, ModalBody, ModalFooter, InputGroup, InputGroupAddon, Input, Label } from 'reactstrap'
import { translate } from 'react-i18next'
import Icon from '../Common/Icon'
import Crowi from 'client/util/Crowi'
import { Page } from 'client/types/crowi'

interface Props {
  crowi: Crowi
  t: Function
}

interface State {
  show: boolean
  newPath: string
  pathMap: {}
  error: string | null
  errors: {}
  renamable: boolean
  removing: boolean
  timeoutId: number | null
}

interface PathMap { [name: string]: string }

interface Node {
  path: string
  name: string
  children: Tree
}

interface Tree {
  [name: string]: Node
}

interface Errors { [path: string]: string[] }

class RenameTree extends React.Component<Props, State> {
  constructor(props: Props) {
    super(props)

    this.renderTree = this.renderTree.bind(this)
    this.handleShow = this.handleShow.bind(this)
    this.handleClose = this.handleClose.bind(this)
    this.handleChange = this.handleChange.bind(this)
    this.handleSubmit = this.handleSubmit.bind(this)
    this.handleError = this.handleError.bind(this)
    this.convertPathMapToTree = this.convertPathMapToTree.bind(this)
    this.checkTreeRenamable = this.checkTreeRenamable.bind(this)

    this.state = {
      show: false,
      newPath: RenameTree.getPath({ removeTrailingSlash: true }),
      pathMap: {},
      error: null,
      errors: {},
      renamable: false,
      removing: false,
      timeoutId: null,
    }

    // TODO: DropdownのReact化の際に消す？
    $("a[data-target='#renameTree']").click(this.handleShow)
  }<commit_msg>npm run format<commit_after>import React from 'react'
import { Button, Modal, ModalHeader, ModalBody, ModalFooter, InputGroup, InputGroupAddon, Input, Label } from 'reactstrap'
import { translate } from 'react-i18next'
import Icon from '../Common/Icon'
import Crowi from 'client/util/Crowi'
import { Page } from 'client/types/crowi'

interface Props {
  crowi: Crowi
  t: Function
}

interface State {
  show: boolean
  newPath: string
  pathMap: {}
  error: string | null
  errors: {}
  renamable: boolean
  removing: boolean
  timeoutId: number | null
}

interface PathMap {
  [name: string]: string
}

interface Node {
  path: string
  name: string
  children: Tree
}

interface Tree {
  [name: string]: Node
}

interface Errors {
  [path: string]: string[]
}

class RenameTree extends React.Component<Props, State> {
  constructor(props: Props) {
    super(props)

    this.renderTree = this.renderTree.bind(this)
    this.handleShow = this.handleShow.bind(this)
    this.handleClose = this.handleClose.bind(this)
    this.handleChange = this.handleChange.bind(this)
    this.handleSubmit = this.handleSubmit.bind(this)
    this.handleError = this.handleError.bind(this)
    this.convertPathMapToTree = this.convertPathMapToTree.bind(this)
    this.checkTreeRenamable = this.checkTreeRenamable.bind(this)

    this.state = {
      show: false,
      newPath: RenameTree.getPath({ removeTrailingSlash: true }),
      pathMap: {},
      error: null,
      errors: {},
      renamable: false,
      removing: false,
      timeoutId: null,
    }

    // TODO: DropdownのReact化の際に消す？
    $("a[data-target='#renameTree']").click(this.handleShow)
  }
{'fraction_non_alphanumeric': 0.11743230909644052, 'fraction_numerical': 0.001216915120170368, 'mean_word_length': 3.7173601147776183, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '813664', 'n_tokens_mistral': 1082, 'n_tokens_neox': 1079, 'n_words': 248}