 request = Promise.promisifyAll require('request')
 {relative, join} = require 'path-extra'
 path = require 'path-extra'
-fs = require 'fs-extra'
-CSON = require 'cson'
+fs = Promise.promisifyAll require 'fs-extra'
+CSON = Promise.promisifyAll require 'cson'
 {_, $, $$, React, ReactBootstrap, ROOT, resolveTime, layout, toggleModal} = window
 {Table, ProgressBar, Grid, Input, Col, Alert, Button, Divider} = ReactBootstrap
 {APPDATA_PATH, SERVER_HOSTNAME} = window

      nextSpot: NaN
      nextSpotKind: NaN
      MAPSPOT: mapspot

    handleResponse: (e) ->
      {method, path, body, postBody} = e.detail

  link: 'https://github.com/Chibaheit'
  reducer: (state={}, action) ->
    if (action.type == '@@poi-plugin-prophet/updateMapspot')
      return Object.assign(state, mapspot: action.data)
    if (action.type == '@@poi-plugin-prophet/updateMaproute')
      return Object.assign(state, maproute: action.data)
    state

  reactClass: React.createClass
    getInitialState: ->
      # Load map data
      mapspot = null
      mainFleet: new Fleet()
      escortFleet: new Fleet()
      airBaseFleet: new Fleet()
