"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];

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

var _isPromise = _interopRequireDefault(require("is-promise"));

var manager = {
  key: 1,
  config: {
    duration: 3,
    top: 24,
    bottom: 24,
    placement: 'leftBottom',
    transitionName: 'move-up',
    icons: {
      info: 'info',
      success: 'check_circle',
      error: 'error',
      warning: 'warning',
      loading: 'loading'
    }
  },
  remove: function remove(key) {
    var instance = this.instance;

    if (instance) {
      if ((0, _isPromise["default"])(instance)) {
        instance.then(function (ins) {
          return ins.removeNotice(key);
        });
      } else {
        instance.removeNotice(key);
      }
    }
  },
  clear: function clear() {
    var instance = this.instance;

    if (instance) {
      if ((0, _isPromise["default"])(instance)) {
        instance.then(function (ins) {
          return ins.destroy();
        });
      } else {
        instance.destroy();
      }

      delete this.instance;
    }
  },
  getUuid: function getUuid() {
    return "".concat(this.key++);
  }
};
var _default = manager;
exports["default"] = _default;
//# sourceMappingURL=index.js.map
