'use strict';

var slicedToArray = require('./slicedToArray-067dd3bc.js');
var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
var React = require('react');
var reactBootstrap = require('react-bootstrap');
var styleInject_es = require('./style-inject.es-dcee06b6.js');
require('./web.dom.iterable-d98303e0.js');
require('./core.get-iterator-method-5643aa10.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

var logger = _commonjsHelpers.createCommonjsModule(function (module, exports) {

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.setLogger = setLogger;
exports.proxyLogger = proxyLogger;
exports.default = void 0;
var _logger = {
  error(code) {
    for (var _len = arguments.length, message = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      message[_key - 1] = arguments[_key];
    }

    console.error("[next-auth][error][".concat(code.toLowerCase(), "]"), "\nhttps://next-auth.js.org/errors#".concat(code.toLowerCase()), ...message);
  },

  warn(code) {
    for (var _len2 = arguments.length, message = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
      message[_key2 - 1] = arguments[_key2];
    }

    console.warn("[next-auth][warn][".concat(code.toLowerCase(), "]"), "\nhttps://next-auth.js.org/warnings#".concat(code.toLowerCase()), ...message);
  },

  debug(code) {
    var _process, _process$env;

    if (!((_process = process) !== null && _process !== void 0 && (_process$env = _process.env) !== null && _process$env !== void 0 && _process$env._NEXTAUTH_DEBUG)) return;

    for (var _len3 = arguments.length, message = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
      message[_key3 - 1] = arguments[_key3];
    }

    console.log("[next-auth][debug][".concat(code.toLowerCase(), "]"), ...message);
  }

};

function setLogger() {
  var newLogger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  if (newLogger.error) _logger.error = newLogger.error;
  if (newLogger.warn) _logger.warn = newLogger.warn;
  if (newLogger.debug) _logger.debug = newLogger.debug;
}

var _default = _logger;
exports.default = _default;

function proxyLogger() {
  var logger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _logger;
  var basePath = arguments.length > 1 ? arguments[1] : undefined;

  try {
    if (typeof window === 'undefined') {
      return logger;
    }

    var clientLogger = {};

    var _loop = function _loop(level) {
      clientLogger[level] = function (code) {
        for (var _len4 = arguments.length, message = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
          message[_key4 - 1] = arguments[_key4];
        }

        _logger[level](code, ...message);

        var url = "".concat(basePath, "/_log");
        var body = new URLSearchParams({
          level,
          code,
          message: JSON.stringify(message.map(m => {
            if (m instanceof Error) {
              return {
                name: m.name,
                message: m.message,
                stack: m.stack
              };
            }

            return m;
          }))
        });

        if (navigator.sendBeacon) {
          return navigator.sendBeacon(url, body);
        }

        return fetch(url, {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json'
          },
          body
        });
      };
    };

    for (var level in logger) {
      _loop(level);
    }

    return clientLogger;
  } catch (_unused) {
    return _logger;
  }
}
});

_commonjsHelpers.unwrapExports(logger);
logger.setLogger;
logger.proxyLogger;

var parseUrl_1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {

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

function parseUrl(url) {
  var defaultHost = 'http://localhost:3000';
  var defaultPath = '/api/auth';

  if (!url) {
    url = "".concat(defaultHost).concat(defaultPath);
  }

  var protocol = url.startsWith('http:') ? 'http' : 'https';
  url = url.replace(/^https?:\/\//, '').replace(/\/$/, '');
  var [_host, ..._path] = url.split('/');
  var baseUrl = _host ? "".concat(protocol, "://").concat(_host) : defaultHost;
  var basePath = _path.length > 0 ? "/".concat(_path.join('/')) : defaultPath;
  return {
    baseUrl,
    basePath
  };
}
});

_commonjsHelpers.unwrapExports(parseUrl_1);

var client$1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useSession = useSession;
exports.getSession = getSession;
exports.getProviders = getProviders;
exports.signIn = signIn;
exports.signOut = signOut;
exports.setOptions = setOptions;
exports.Provider = Provider;
exports.default = void 0;



var _logger2 = _interopRequireWildcard(logger);

var _parseUrl = _interopRequireDefault(parseUrl_1);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }

function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }

var __NEXTAUTH = {
  baseUrl: (0, _parseUrl.default)(process.env.NEXTAUTH_URL || process.env.VERCEL_URL).baseUrl,
  basePath: (0, _parseUrl.default)(process.env.NEXTAUTH_URL).basePath,
  baseUrlServer: (0, _parseUrl.default)(process.env.NEXTAUTH_URL_INTERNAL || process.env.NEXTAUTH_URL || process.env.VERCEL_URL).baseUrl,
  basePathServer: (0, _parseUrl.default)(process.env.NEXTAUTH_URL_INTERNAL || process.env.NEXTAUTH_URL).basePath,
  keepAlive: 0,
  clientMaxAge: 0,
  _clientLastSync: 0,
  _clientSyncTimer: null,
  _eventListenersAdded: false,
  _clientSession: undefined,
  _getSession: () => {}
};
var logger$1 = (0, _logger2.proxyLogger)(_logger2.default, __NEXTAUTH.basePath);
var broadcast = BroadcastChannel();

if (typeof window !== 'undefined' && !__NEXTAUTH._eventListenersAdded) {
  __NEXTAUTH._eventListenersAdded = true;
  broadcast.receive(() => __NEXTAUTH._getSession({
    event: 'storage'
  }));
  document.addEventListener('visibilitychange', () => {
    !document.hidden && __NEXTAUTH._getSession({
      event: 'visibilitychange'
    });
  }, false);
}

var SessionContext = (0, React__default['default'].createContext)();

function useSession(session) {
  var context = (0, React__default['default'].useContext)(SessionContext);
  if (context) return context;
  return _useSessionHook(session);
}

function _useSessionHook(session) {
  var [data, setData] = (0, React__default['default'].useState)(session);
  var [loading, setLoading] = (0, React__default['default'].useState)(!data);
  (0, React__default['default'].useEffect)(() => {
    __NEXTAUTH._getSession = _asyncToGenerator(function* () {
      var {
        event = null
      } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      try {
        var triggredByEvent = event !== null;
        var triggeredByStorageEvent = event === 'storage';
        var clientMaxAge = __NEXTAUTH.clientMaxAge;
        var clientLastSync = parseInt(__NEXTAUTH._clientLastSync);

        var currentTime = _now();

        var clientSession = __NEXTAUTH._clientSession;

        if (!triggeredByStorageEvent && clientSession !== undefined) {
          if (clientMaxAge === 0 && triggredByEvent !== true) {
            return;
          } else if (clientMaxAge > 0 && clientSession === null) {
            return;
          } else if (clientMaxAge > 0 && currentTime < clientLastSync + clientMaxAge) {
            return;
          }
        }

        if (clientSession === undefined) {
          __NEXTAUTH._clientSession = null;
        }

        __NEXTAUTH._clientLastSync = _now();
        var newClientSessionData = yield getSession({
          triggerEvent: !triggeredByStorageEvent
        });
        __NEXTAUTH._clientSession = newClientSessionData;
        setData(newClientSessionData);
        setLoading(false);
      } catch (error) {
        logger$1.error('CLIENT_USE_SESSION_ERROR', error);
        setLoading(false);
      }
    });

    __NEXTAUTH._getSession();
  });
  return [data, loading];
}

function getSession(_x) {
  return _getSession2.apply(this, arguments);
}

function _getSession2() {
  _getSession2 = _asyncToGenerator(function* (ctx) {
    var _ctx$triggerEvent;

    var session = yield _fetchData('session', ctx);

    if ((_ctx$triggerEvent = ctx === null || ctx === void 0 ? void 0 : ctx.triggerEvent) !== null && _ctx$triggerEvent !== void 0 ? _ctx$triggerEvent : true) {
      broadcast.post({
        event: 'session',
        data: {
          trigger: 'getSession'
        }
      });
    }

    return session;
  });
  return _getSession2.apply(this, arguments);
}

function getCsrfToken(_x2) {
  return _getCsrfToken.apply(this, arguments);
}

function _getCsrfToken() {
  _getCsrfToken = _asyncToGenerator(function* (ctx) {
    var _yield$_fetchData;

    return (_yield$_fetchData = yield _fetchData('csrf', ctx)) === null || _yield$_fetchData === void 0 ? void 0 : _yield$_fetchData.csrfToken;
  });
  return _getCsrfToken.apply(this, arguments);
}

function getProviders() {
  return _getProviders.apply(this, arguments);
}

function _getProviders() {
  _getProviders = _asyncToGenerator(function* () {
    return _fetchData('providers');
  });
  return _getProviders.apply(this, arguments);
}

function signIn(_x3) {
  return _signIn.apply(this, arguments);
}

function _signIn() {
  _signIn = _asyncToGenerator(function* (provider) {
    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    var authorizationParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
    var {
      callbackUrl = window.location,
      redirect = true
    } = options;

    var baseUrl = _apiBaseUrl();

    var providers = yield getProviders();

    if (!(provider in providers)) {
      window.location = "".concat(baseUrl, "/signin?callbackUrl=").concat(encodeURIComponent(callbackUrl));
      return;
    }

    var isCredentials = providers[provider].type === 'credentials';
    var isEmail = providers[provider].type === 'email';
    var canRedirectBeDisabled = isCredentials || isEmail;
    var signInUrl = isCredentials ? "".concat(baseUrl, "/callback/").concat(provider) : "".concat(baseUrl, "/signin/").concat(provider);
    var fetchOptions = {
      method: 'post',
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      body: new URLSearchParams(_objectSpread(_objectSpread({}, options), {}, {
        csrfToken: yield getCsrfToken(),
        callbackUrl,
        json: true
      }))
    };

    var _signInUrl = "".concat(signInUrl, "?").concat(new URLSearchParams(authorizationParams));

    var res = yield fetch(_signInUrl, fetchOptions);
    var data = yield res.json();

    if (redirect || !canRedirectBeDisabled) {
      var _data$url;

      var url = (_data$url = data.url) !== null && _data$url !== void 0 ? _data$url : callbackUrl;
      window.location = url;
      if (url.includes('#')) window.location.reload();
      return;
    }

    var error = new URL(data.url).searchParams.get('error');

    if (res.ok) {
      yield __NEXTAUTH._getSession({
        event: 'storage'
      });
    }

    return {
      error,
      status: res.status,
      ok: res.ok,
      url: error ? null : data.url
    };
  });
  return _signIn.apply(this, arguments);
}

function signOut() {
  return _signOut.apply(this, arguments);
}

function _signOut() {
  _signOut = _asyncToGenerator(function* () {
    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    var {
      callbackUrl = window.location,
      redirect = true
    } = options;

    var baseUrl = _apiBaseUrl();

    var fetchOptions = {
      method: 'post',
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      body: new URLSearchParams({
        csrfToken: yield getCsrfToken(),
        callbackUrl,
        json: true
      })
    };
    var res = yield fetch("".concat(baseUrl, "/signout"), fetchOptions);
    var data = yield res.json();
    broadcast.post({
      event: 'session',
      data: {
        trigger: 'signout'
      }
    });

    if (redirect) {
      var _data$url2;

      var url = (_data$url2 = data.url) !== null && _data$url2 !== void 0 ? _data$url2 : callbackUrl;
      window.location = url;
      if (url.includes('#')) window.location.reload();
      return;
    }

    yield __NEXTAUTH._getSession({
      event: 'storage'
    });
    return data;
  });
  return _signOut.apply(this, arguments);
}

function setOptions() {
  var {
    baseUrl,
    basePath,
    clientMaxAge,
    keepAlive
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  if (baseUrl) __NEXTAUTH.baseUrl = baseUrl;
  if (basePath) __NEXTAUTH.basePath = basePath;
  if (clientMaxAge) __NEXTAUTH.clientMaxAge = clientMaxAge;

  if (keepAlive) {
    __NEXTAUTH.keepAlive = keepAlive;
    if (typeof window === 'undefined') return;

    if (__NEXTAUTH._clientSyncTimer !== null) {
      clearTimeout(__NEXTAUTH._clientSyncTimer);
    }

    __NEXTAUTH._clientSyncTimer = setTimeout(_asyncToGenerator(function* () {
      if (!__NEXTAUTH._clientSession) return;
      yield __NEXTAUTH._getSession({
        event: 'timer'
      });
    }), keepAlive * 1000);
  }
}

function Provider(_ref3) {
  var {
    children,
    session,
    options
  } = _ref3;
  setOptions(options);
  return (0, React__default['default'].createElement)(SessionContext.Provider, {
    value: useSession(session)
  }, children);
}

function _fetchData(_x4) {
  return _fetchData2.apply(this, arguments);
}

function _fetchData2() {
  _fetchData2 = _asyncToGenerator(function* (path) {
    var {
      ctx,
      req = ctx === null || ctx === void 0 ? void 0 : ctx.req
    } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

    try {
      var baseUrl = yield _apiBaseUrl();
      var options = req ? {
        headers: {
          cookie: req.headers.cookie
        }
      } : {};
      var res = yield fetch("".concat(baseUrl, "/").concat(path), options);
      var data = yield res.json();
      return Object.keys(data).length > 0 ? data : null;
    } catch (error) {
      logger$1.error('CLIENT_FETCH_ERROR', path, error);
      return null;
    }
  });
  return _fetchData2.apply(this, arguments);
}

function _apiBaseUrl() {
  if (typeof window === 'undefined') {
    if (!process.env.NEXTAUTH_URL) {
      logger$1.warn('NEXTAUTH_URL', 'NEXTAUTH_URL environment variable not set');
    }

    return "".concat(__NEXTAUTH.baseUrlServer).concat(__NEXTAUTH.basePathServer);
  }

  return __NEXTAUTH.basePath;
}

function _now() {
  return Math.floor(Date.now() / 1000);
}

function BroadcastChannel() {
  var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'nextauth.message';
  return {
    receive(onReceive) {
      if (typeof window === 'undefined') return;
      window.addEventListener('storage', function () {
        var _ref4 = _asyncToGenerator(function* (event) {
          if (event.key !== name) return;
          var message = JSON.parse(event.newValue);
          if ((message === null || message === void 0 ? void 0 : message.event) !== 'session' || !(message !== null && message !== void 0 && message.data)) return;
          onReceive(message);
        });

        return function (_x5) {
          return _ref4.apply(this, arguments);
        };
      }());
    },

    post(message) {
      if (typeof localStorage === 'undefined') return;
      localStorage.setItem(name, JSON.stringify(_objectSpread(_objectSpread({}, message), {}, {
        timestamp: _now()
      })));
    }

  };
}

var _default = {
  getSession,
  getCsrfToken,
  getProviders,
  useSession,
  signIn,
  signOut,
  Provider,
  setOptions,
  options: setOptions,
  session: getSession,
  providers: getProviders,
  csrfToken: getCsrfToken,
  signin: signIn,
  signout: signOut
};
exports.default = _default;
});

_commonjsHelpers.unwrapExports(client$1);
client$1.useSession;
client$1.getSession;
client$1.getProviders;
client$1.signIn;
client$1.signOut;
client$1.setOptions;
client$1.Provider;

var client = client$1.default;

var css = ".AuthWrapper-module_loginBox__3l-BE {\n  margin-bottom: 2rem;\n  width: 350px;\n  max-width: 90vw;\n  margin-left: auto;\n  margin-right: auto;\n  /* box-shadow: 2px 5px 12px rgba(0, 0, 0, 0.15); */\n  background: #fff;\n  z-index: 1;\n}\n.AuthWrapper-module_loginBox_title__12rGD {\n  margin-bottom: 2rem;\n  text-align: center;\n}\n.AuthWrapper-module_bar__1dafn {\n  background: #eee;\n  margin-left: unset;\n  margin-right: unset;\n}\n.AuthWrapper-module_bar__1dafn:nth-child(1) {\n  float: left;\n  border-right: 1rem solid #fff;\n  background: rgb(245, 245, 245);\n  height: 10rem;\n  width: 25%;\n  margin-left: auto;\n  margin-right: auto;\n  margin-bottom: 2rem;\n}\n.AuthWrapper-module_bar__1dafn:nth-child(2n) {\n  width: 97%;\n  height: 1.5rem;\n  margin-bottom: 0.25rem;\n}\n.AuthWrapper-module_bar__1dafn.AuthWrapper-module_bar__1dafn:nth-child(3n) {\n  width: 96%;\n  height: 1.5rem;\n  margin-bottom: 1.5rem;\n}\n.AuthWrapper-module_bar__1dafn.AuthWrapper-module_bar__1dafn:nth-child(4n) {\n  width: 72%;\n  height: 1.5rem;\n  margin-bottom: 0.25rem;\n}\n.AuthWrapper-module_bar__1dafn.AuthWrapper-module_bar__1dafn:nth-child(5n) {\n  width: 88%;\n  height: 1.5rem;\n  margin-bottom: 0.25rem;\n}\n\n.AuthWrapper-module_iframe__2wDJW {\n  margin-top: -3rem;\n  border: none;\n  width: 100%;\n  height: 1900px;\n}";
var styles = { "loginBox": "AuthWrapper-module_loginBox__3l-BE", "loginBox_title": "AuthWrapper-module_loginBox_title__12rGD", "bar": "AuthWrapper-module_bar__1dafn", "iframe": "AuthWrapper-module_iframe__2wDJW" };
styleInject_es.styleInject(css);

var AuthWrapper = function AuthWrapper(_ref) {
  var children = _ref.children,
      needAuth = _ref.needAuth,
      _ref$formUrl = _ref.formUrl,
      formUrl = _ref$formUrl === undefined ? '' : _ref$formUrl;

  var _nextAuth$useSession = client.useSession(),
      _nextAuth$useSession2 = slicedToArray._slicedToArray(_nextAuth$useSession, 2),
      session = _nextAuth$useSession2[0],
      loading = _nextAuth$useSession2[1];

  var _useState = React.useState(null),
      _useState2 = slicedToArray._slicedToArray(_useState, 2),
      callbackUrl = _useState2[0],
      setCallbackUrl = _useState2[1];

  var _useState3 = React.useState(),
      _useState4 = slicedToArray._slicedToArray(_useState3, 2),
      email = _useState4[0],
      setEmail = _useState4[1];

  var _useState5 = React.useState(false),
      _useState6 = slicedToArray._slicedToArray(_useState5, 2),
      showForm = _useState6[0],
      setShowForm = _useState6[1];

  var _useState7 = React.useState(),
      _useState8 = slicedToArray._slicedToArray(_useState7, 2),
      password = _useState8[0],
      setPassword = _useState8[1];

  React.useEffect(function () {
    setCallbackUrl(window.location.href);
  }, []);

  if (session || !needAuth) {
    return React__default['default'].createElement(
      'div',
      null,
      children
    );
  }

  if (!loading) {
    return React__default['default'].createElement(
      'div',
      { style: { position: 'relative', minHeight: '300px', paddingTop: '2rem' } },
      callbackUrl && React__default['default'].createElement(
        'div',
        null,
        !showForm && React__default['default'].createElement(
          'div',
          { className: styles.loginBox },
          React__default['default'].createElement(
            'div',
            { className: styles.loginBox_title },
            React__default['default'].createElement(
              'b',
              null,
              'Please log in to view this content.'
            )
          ),
          React__default['default'].createElement(
            reactBootstrap.Form,
            { onSubmit: function onSubmit(e) {
                return e.preventDefault();
              } },
            React__default['default'].createElement(
              reactBootstrap.Form.Group,
              { controlId: 'email' },
              React__default['default'].createElement(reactBootstrap.Form.Control, { type: 'email', onChange: function onChange(e) {
                  return setEmail(e.target.value);
                }, placeholder: 'Email' })
            ),
            React__default['default'].createElement(
              reactBootstrap.Form.Group,
              { controlId: 'password' },
              React__default['default'].createElement(reactBootstrap.Form.Control, { type: 'password', onChange: function onChange(e) {
                  return setPassword(e.target.value);
                }, placeholder: 'Password' })
            ),
            React__default['default'].createElement(
              'button',
              { className: 'btn btn-primary btn-block', onClick: function onClick() {
                  return client.signIn('credentials', { email: email, password: password, callbackUrl: callbackUrl });
                } },
              'Sign in'
            )
          ),
          React__default['default'].createElement(
            'button',
            { className: 'btn btn-primary btn-block mt-3' },
            React__default['default'].createElement(
              'a',
              { style: { textDecoration: 'underline' }, onClick: function onClick() {
                  return setShowForm(!showForm);
                } },
              'Register Now'
            )
          ),
          React__default['default'].createElement(
            'p',
            { className: 'mt-1', style: { fontSize: '.8em', textAlign: 'center' } },
            React__default['default'].createElement(
              'em',
              null,
              React__default['default'].createElement(
                'a',
                { href: '/forgotpassword', style: { color: 'blue', textDecoration: 'underline' } },
                'Forgot your password? '
              )
            )
          )
        ),
        showForm && React__default['default'].createElement('iframe', { className: styles.iframe, src: formUrl })
      )
    );
  } else {
    return null;
  }
};

module.exports = AuthWrapper;
