text: /** @preserve
    * package: sweetalert2-react-content v1.1.0
    * file: dist/sweetalert2-react-content.umd.js
    * homepage: https://github.com/sweetalert2/sweetalert2-react-content#readme
    * license: MIT
    **/
  
  (function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react'), require('react-dom')) :
    typeof define === 'function' && define.amd ? define(['react', 'react-dom'], factory) :
    (global = global || self, global.sweetalert2ReactContent = factory(global.React, global.ReactDOM));
  }(this, function (React, ReactDOM) { 'use strict';
  
    React = React && React.hasOwnProperty('default') ? React['default'] : React;
    ReactDOM = ReactDOM && ReactDOM.hasOwnProperty('default') ? ReactDOM['default'] : ReactDOM;
  
    function _classCallCheck(instance, Constructor) {
      if (!(instance instanceof Constructor)) {
        throw new TypeError("Cannot call a class as a function");
      }
    }
  
    function _defineProperties(target, props) {
      for (var i = 0; i < props.length; i++) {
        var descriptor = props[i];
        descriptor.enumerable = descriptor.enumerable || false;
        descriptor.configurable = true;
        if ("value" in descriptor) descriptor.writable = true;
        Object.defineProperty(target, descriptor.key, descriptor);
      }
    }
  
    function _createClass(Constructor, protoProps, staticProps) {
      if (protoProps) _defineProperties(Constructor.prototype, protoProps);
      if (staticProps) _defineProperties(Constructor, staticProps);
      return Constructor;
    }
  
    function _inherits(subClass, superClass) {
      if (typeof superClass !== "function" && superClass !== null) {
        throw new TypeError("Super expression must either be null or a function");
      }
  
      subClass.prototype = Object.create(superClass && superClass.prototype, {
        constructor: {
          value: subClass,
          writable: true,
          configurable: true
        }
      });
      if (superClass) _setPrototypeOf(subClass, superClass);
    }
  
    function _getPrototypeOf(o) {
      _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
        return o.__proto__ || Object.getPrototypeOf(o);
      };
      return _getPrototypeOf(o);
    }
  
    function _setPrototypeOf(o, p) {
      _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
        o.__proto__ = p;
        return o;
      };
  
      return _setPrototypeOf(o, p);
    }
  
    function _assertThisInitialized(self) {
      if (self === void 0) {
        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      }
  
      return self;
    }
  
    function _possibleConstructorReturn(self, call) {
      if (call && (typeof call === "object" || typeof call === "function")) {
        return call;
      }
  
      return _assertThisInitialized(self);
    }
  
    function _superPropBase(object, property) {
      while (!Object.prototype.hasOwnProperty.call(object, property)) {
        object = _getPrototypeOf(object);
        if (object === null) break;
      }
  
      return object;
    }
  
    function _get(target, property, receiver) {
      if (typeof Reflect !== "undefined" && Reflect.get) {
        _get = Reflect.get;
      } else {
        _get = function _get(target, property, receiver) {
          var base = _superPropBase(target, property);
  
          if (!base) return;
          var desc = Object.getOwnPropertyDescriptor(base, property);
  
          if (desc.get) {
            return desc.get.call(receiver);
          }
  
          return desc.value;
        };
      }
  
      return _get(target, property, receiver || target);
    }
  
    var mounts = [{
      key: 'title',
      getter: function getter(swal) {
        return swal.getTitle();
      }
    }, {
      key: 'html',
      getter: function getter(swal) {
        return swal.getContent();
      }
    }, {
      key: 'confirmButtonText',
      getter: function getter(swal) {
        return swal.getConfirmButton();
      }
    }, {
      key: 'cancelButtonText',
      getter: function getter(swal) {
        return swal.getCancelButton();
      }
    }, {
      key: 'footer',
      getter: function getter(swal) {
        return swal.getFooter();
      }
    }];
  
    var noop = function noop() {};
  
    var error = function error(message) {
      return new Error("sweetalert2-react-content: ".concat(message));
    };
  
    function withReactContent(ParentSwal) {
      return (
        /*#__PURE__*/
        function (_ParentSwal) {
          _inherits(_class, _ParentSwal);
  
          function _class() {
            _classCallCheck(this, _class);
  
            return _possibleConstructorReturn(this, _getPrototypeOf(_class).apply(this, arguments));
          }
  
          _createClass(_class, [{
            key: "_main",
            value: function _main(params) {
              params = Object.assign({}, params);
              params.onOpen = params.onOpen || noop;
              params.onClose = params.onClose || noop;
              mounts.forEach(function (_ref) {
                var key = _ref.key,
                    getter = _ref.getter;
  
                if (React.isValidElement(params[key])) {
                  var reactElement = params[key];
                  params[key] = ' ';
                  var domElement;
                  var superOnOpen = params.onOpen;
  
                  params.onOpen = function () {
                    domElement = getter(ParentSwal);
                    ReactDOM.render(reactElement, domElement);
                    superOnOpen();
                  };
  
                  var superOnClose = params.onClose;
  
                  params.onClose = function () {
                    superOnClose();
                    ReactDOM.unmountComponentAtNode(domElement);
                  };
                }
              });
              return _get(_getPrototypeOf(_class.prototype), "_main", this).call(this, params);
            }
          }, {
            key: "update",
            value: function update() {
              throw error('Swal.update() is not yet supported. See https://github.com/sweetalert2/sweetalert2-react-content/issues/73');
            }
          }], [{
            key: "argsToParams",
            value: function argsToParams(args) {
              if (React.isValidElement(args[0]) || React.isValidElement(args[1])) {
                var params = {};
                ['title', 'html', 'type'].forEach(function (name, index) {
                  if (args[index] !== undefined) {
                    params[name] = args[index];
                  }
                });
                return params;
              } else {
                return ParentSwal.argsToParams(args);
              }
            }
          }]);
  
          return _class;
        }(ParentSwal)
      );
    }
  
    return withReactContent;
  
  }));
  //# sourceMappingURL=sweetalert2-react-content.umd.js.map
  