"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _unstated = require("unstated");

class Store extends _unstated.Container {
  constructor() {
    super();
    this.state = {
      daemon: true,
      containers: {
        active: null,
        detailedView: false,
        detailedTab: 'general',
        logs: '',
        list: []
      },
      modal: {
        active: false,
        message: ''
      }
    };
  }

  setDaemon(daemon) {
    return this.setState({
      daemon
    });
  }

  setContainerActive(active) {
    return this.setState({
      containers: { ...this.state.containers,
        active
      }
    });
  }

  setDetailedView(detailedView) {
    return this.setState({
      containers: { ...this.state.containers,
        detailedView
      }
    });
  }

  setDetailedTab(detailedTab) {
    return this.setState({
      containers: { ...this.state.containers,
        detailedTab
      }
    });
  }

  setContainerLogs(logs) {
    return this.setState({
      containers: { ...this.state.containers,
        logs
      }
    });
  }

  appendContainerLogs(logs) {
    return this.setState({
      containers: { ...this.state.containers,
        logs: this.state.containers.logs + logs
      }
    });
  }

  setContainersList(list) {
    return this.setState({
      containers: { ...this.state.containers,
        list
      }
    });
  }

  lockModal(message) {
    return this.setState({
      modal: {
        active: true,
        message
      }
    });
  }

  unlockModal() {
    return this.setState({
      modal: {
        active: false,
        message: ''
      }
    });
  }

}

let store = new Store();
var _default = store;
exports.default = _default;