module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = require('../../../../ssr-module-cache.js');
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		var threw = true;
/******/ 		try {
/******/ 			modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ 			threw = false;
/******/ 		} finally {
/******/ 			if(threw) delete installedModules[moduleId];
/******/ 		}
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 3);
/******/ })
/************************************************************************/
/******/ ({

/***/ "./components/App/App.scss":
/*!*********************************!*\
  !*** ./components/App/App.scss ***!
  \*********************************/
/*! no static exports found */
/***/ (function(module, exports) {



/***/ }),

/***/ "./components/App/App.tsx":
/*!********************************!*\
  !*** ./components/App/App.tsx ***!
  \********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return App; });
/* harmony import */ var _babel_runtime_corejs2_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime-corejs2/helpers/esm/defineProperty */ "./node_modules/@babel/runtime-corejs2/helpers/esm/defineProperty.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var next_head__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! next/head */ "next/head");
/* harmony import */ var next_head__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_head__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils */ "./utils/index.ts");
/* harmony import */ var _extensions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../extensions */ "./components/extensions/index.tsx");
/* harmony import */ var _Header_Header__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Header/Header */ "./components/App/Header/Header.tsx");
/* harmony import */ var _Footer_Footer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Footer/Footer */ "./components/App/Footer/Footer.tsx");
/* harmony import */ var _App_scss__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./App.scss */ "./components/App/App.scss");
/* harmony import */ var _App_scss__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_App_scss__WEBPACK_IMPORTED_MODULE_7__);

var _jsxFileName = "/Users/resure/Code/terminal/components/App/App.tsx";
var __jsx = react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement;







class App extends react__WEBPACK_IMPORTED_MODULE_1___default.a.Component {
  constructor(...args) {
    super(...args);

    Object(_babel_runtime_corejs2_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "state", {
      isLoaded: false,
      whoami: null
    });
  }

  componentDidMount() {
    Object(_extensions__WEBPACK_IMPORTED_MODULE_4__["initCollapsibles"])(document.body);
    Object(_extensions__WEBPACK_IMPORTED_MODULE_4__["initTabs"])(document.body);
    _utils__WEBPACK_IMPORTED_MODULE_3__["sdk"].whoami().then(res => this.setState({
      whoami: res,
      isLoaded: true
    })).catch(() => this.setState({
      isLoaded: true
    }));
  }

  render() {
    const {
      children,
      pageName
    } = this.props;
    const {
      whoami,
      isLoaded
    } = this.state;
    const title = pageName ? `${pageName} - SCP Foundation` : 'SCP Foundation';

    if (!isLoaded) {
      return null;
    }

    return __jsx(react__WEBPACK_IMPORTED_MODULE_1___default.a.Fragment, {
      __source: {
        fileName: _jsxFileName,
        lineNumber: 44
      },
      __self: this
    }, __jsx(next_head__WEBPACK_IMPORTED_MODULE_2___default.a, {
      __source: {
        fileName: _jsxFileName,
        lineNumber: 45
      },
      __self: this
    }, __jsx("title", {
      __source: {
        fileName: _jsxFileName,
        lineNumber: 46
      },
      __self: this
    }, title), __jsx("meta", {
      name: "viewport",
      content: "initial-scale=1.0, width=device-width",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 47
      },
      __self: this
    })), __jsx("div", {
      className: "app",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 50
      },
      __self: this
    }, __jsx("div", {
      className: "app-header",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 51
      },
      __self: this
    }, __jsx(_Header_Header__WEBPACK_IMPORTED_MODULE_5__["default"], {
      whoami: whoami,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 52
      },
      __self: this
    })), __jsx("main", {
      className: "app-content",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 54
      },
      __self: this
    }, children, __jsx("div", {
      className: "app-footer",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 56
      },
      __self: this
    }, __jsx(_Footer_Footer__WEBPACK_IMPORTED_MODULE_6__["default"], {
      __source: {
        fileName: _jsxFileName,
        lineNumber: 57
      },
      __self: this
    })))));
  }

}

/***/ }),

/***/ "./components/App/Footer/Footer.scss":
/*!*******************************************!*\
  !*** ./components/App/Footer/Footer.scss ***!
  \*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {



/***/ }),

/***/ "./components/App/Footer/Footer.tsx":
/*!******************************************!*\
  !*** ./components/App/Footer/Footer.tsx ***!
  \******************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Footer_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Footer.scss */ "./components/App/Footer/Footer.scss");
/* harmony import */ var _Footer_scss__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_Footer_scss__WEBPACK_IMPORTED_MODULE_1__);
var _jsxFileName = "/Users/resure/Code/terminal/components/App/Footer/Footer.tsx";
var __jsx = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement;



const Footer = () => __jsx("footer", {
  className: "footer",
  __source: {
    fileName: _jsxFileName,
    lineNumber: 6
  },
  __self: undefined
}, "Unless otherwise stated, the content of this page is licensed under ", __jsx("a", {
  href: "https://creativecommons.org/licenses/by-sa/3.0/",
  target: "_blank",
  rel: "noopener noreferrer",
  __source: {
    fileName: _jsxFileName,
    lineNumber: 7
  },
  __self: undefined
}, "Creative Commons Attribution-ShareAlike 3.0 License"));

/* harmony default export */ __webpack_exports__["default"] = (Footer);

/***/ }),

/***/ "./components/App/Header/Header.scss":
/*!*******************************************!*\
  !*** ./components/App/Header/Header.scss ***!
  \*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {



/***/ }),

/***/ "./components/App/Header/Header.tsx":
/*!******************************************!*\
  !*** ./components/App/Header/Header.tsx ***!
  \******************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Header; });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Header_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Header.scss */ "./components/App/Header/Header.scss");
/* harmony import */ var _Header_scss__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_Header_scss__WEBPACK_IMPORTED_MODULE_1__);
var _jsxFileName = "/Users/resure/Code/terminal/components/App/Header/Header.tsx";
var __jsx = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement;


;
class Header extends react__WEBPACK_IMPORTED_MODULE_0___default.a.Component {
  render() {
    return __jsx("header", {
      className: "header",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 12
      },
      __self: this
    }, __jsx("div", {
      className: "header__container",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 13
      },
      __self: this
    }, __jsx("div", {
      className: "header__top-content",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 14
      },
      __self: this
    }, __jsx("a", {
      href: "/",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 15
      },
      __self: this
    }, "SCP Foundation")), this.renderSignIn()), __jsx("div", {
      className: "header__navigation",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 20
      },
      __self: this
    }, this.renderNavigation()));
  }

  renderSignIn() {
    const {
      user
    } = this.props;

    if (user.id !== null) {
      return __jsx("div", {
        className: "header__top-content header__top-content_right",
        __source: {
          fileName: _jsxFileName,
          lineNumber: 32
        },
        __self: this
      }, __jsx("a", {
        href: "/auth/logout",
        __source: {
          fileName: _jsxFileName,
          lineNumber: 33
        },
        __self: this
      }, "Sign out"));
    }

    return __jsx("div", {
      className: "header__top-content header__top-content_right",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 39
      },
      __self: this
    }, __jsx("a", {
      href: `/auth/google?returnPath=${encodeURIComponent(window.location.pathname)}`,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 40
      },
      __self: this
    }, "Sign in"));
  }

  renderNavigation() {
    return __jsx("div", {
      className: "header__navigation-content",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 47
      },
      __self: this
    }, __jsx("span", {
      className: "header__navigation-element",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 48
      },
      __self: this
    }, __jsx("a", {
      href: "/random",
      className: "header__random-page-link",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 49
      },
      __self: this
    }, "Random page")), __jsx("span", {
      className: "header__navigation-element",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 53
      },
      __self: this
    }, __jsx("a", {
      href: "/scp-list",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 54
      },
      __self: this
    }, "Series I")), __jsx("span", {
      className: "header__navigation-element",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 56
      },
      __self: this
    }, __jsx("a", {
      href: "/scp-list-2",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 57
      },
      __self: this
    }, "Series II")), __jsx("span", {
      className: "header__navigation-element",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 59
      },
      __self: this
    }, __jsx("a", {
      href: "/scp-list-3",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 60
      },
      __self: this
    }, "Series III")), __jsx("span", {
      className: "header__navigation-element",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 62
      },
      __self: this
    }, __jsx("a", {
      href: "/scp-list-4",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 63
      },
      __self: this
    }, "Series IV")), __jsx("span", {
      className: "header__navigation-element",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 65
      },
      __self: this
    }, __jsx("a", {
      href: "/scp-list-5",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 66
      },
      __self: this
    }, "Series V")), __jsx("span", {
      className: "header__navigation-element",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 68
      },
      __self: this
    }, __jsx("a", {
      href: "/scp-list-ru",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 69
      },
      __self: this
    }, "Series RU")), __jsx("span", {
      className: "header__navigation-element",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 71
      },
      __self: this
    }, __jsx("a", {
      href: "/stories",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 72
      },
      __self: this
    }, "Stories")), __jsx("span", {
      className: "header__navigation-element",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 74
      },
      __self: this
    }, __jsx("a", {
      href: "/canon-hub",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 75
      },
      __self: this
    }, "Canons")));
  }

}
;

/***/ }),

/***/ "./components/Wikidot/WikidotTethering.scss":
/*!**************************************************!*\
  !*** ./components/Wikidot/WikidotTethering.scss ***!
  \**************************************************/
/*! no static exports found */
/***/ (function(module, exports) {



/***/ }),

/***/ "./components/Wikidot/WikidotTethering.tsx":
/*!*************************************************!*\
  !*** ./components/Wikidot/WikidotTethering.tsx ***!
  \*************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return WikidotTethering; });
/* harmony import */ var _babel_runtime_corejs2_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime-corejs2/helpers/esm/defineProperty */ "./node_modules/@babel/runtime-corejs2/helpers/esm/defineProperty.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _WikidotTethering_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./WikidotTethering.scss */ "./components/Wikidot/WikidotTethering.scss");
/* harmony import */ var _WikidotTethering_scss__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_WikidotTethering_scss__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils */ "./utils/index.ts");

var _jsxFileName = "/Users/resure/Code/terminal/components/Wikidot/WikidotTethering.tsx";
var __jsx = react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement;



class WikidotTethering extends react__WEBPACK_IMPORTED_MODULE_1___default.a.Component {
  constructor(...args) {
    super(...args);

    Object(_babel_runtime_corejs2_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "state", {
      loading: true,
      error: ''
    });
  }

  componentDidMount() {
    _utils__WEBPACK_IMPORTED_MODULE_3__["sdk"].whoami().then(whoami => {
      this.setState({
        whoami,
        loading: false
      });
    }).catch(error => {
      console.error(error);
      this.setState({
        loading: false,
        error: 'Failed to load status. Try to reload the page.'
      });
    });
  }

  tetherAccount() {
    this.setState({
      loading: true
    });
    _utils__WEBPACK_IMPORTED_MODULE_3__["sdk"].tetherWikidotAccount().then(code => {
      switch (code) {
        case 'PageNotFound':
          this.setState({
            error: 'Cannot find created page on the migration wiki. Reload and proceed with instructions.'
          });
          break;

        case 'WikidotUserAlreadyTethered':
          this.setState({
            error: 'This wikidot account already was connected to another user.'
          });
          break;

        case 'Ok':
          window.location.reload();
          break;

        default:
          this.setState({
            error: 'Unknown response status. Please contact developers.'
          });
      }
    }).catch(error => {
      console.error(error);
      this.setState({
        error: 'Failed to connect account. Reload the page and try again.'
      });
    });
  }

  renderActionBlock() {
    if (this.state.error) {
      return __jsx("div", {
        className: "wikidot-tethering__error",
        __source: {
          fileName: _jsxFileName,
          lineNumber: 57
        },
        __self: this
      }, this.state.error);
    }

    if (this.state.loading) {
      return __jsx("div", {
        className: "wikidot-tethering__loading",
        __source: {
          fileName: _jsxFileName,
          lineNumber: 61
        },
        __self: this
      }, "Loading");
    }

    const user = this.state.whoami;

    if (user.id === null) {
      return __jsx("div", {
        __source: {
          fileName: _jsxFileName,
          lineNumber: 67
        },
        __self: this
      }, __jsx("a", {
        href: "/auth/google?returnPath=%2Fwikidot%2Ftethering",
        className: "action",
        __source: {
          fileName: _jsxFileName,
          lineNumber: 67
        },
        __self: this
      }, "Sign in with Google"));
    }

    if (user.wikidotUid) {
      return __jsx("div", {
        className: "wikidot-tethering__success",
        __source: {
          fileName: _jsxFileName,
          lineNumber: 71
        },
        __self: this
      }, "This account was successfully connected to the Wikidot user \"", user.username, "\"");
    }

    return __jsx("div", {
      className: "wikidot-tethering__instructions",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 75
      },
      __self: this
    }, __jsx("div", {
      className: "wikidot-tethering__howto",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 76
      },
      __self: this
    }, __jsx("ol", {
      __source: {
        fileName: _jsxFileName,
        lineNumber: 77
      },
      __self: this
    }, __jsx("li", {
      __source: {
        fileName: _jsxFileName,
        lineNumber: 78
      },
      __self: this
    }, "Navigate to the ", __jsx("a", {
      href: `http://wikidot-migration.scpfoundation.net/scp-id-${user.id}`,
      target: "_blank",
      rel: "noreferrer",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 78
      },
      __self: this
    }, "migration wiki"), " and create an empty page with specified name"), __jsx("li", {
      __source: {
        fileName: _jsxFileName,
        lineNumber: 79
      },
      __self: this
    }, "Return to this page and press the button below"))), __jsx("a", {
      href: "#",
      onClick: () => {
        this.tetherAccount();
      },
      className: "action",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 82
      },
      __self: this
    }, "Connect your account"));
  }

  render() {
    return __jsx("div", {
      className: "wikidot-tethering",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 94
      },
      __self: this
    }, __jsx("div", {
      className: "wikidot-tethering__content",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 95
      },
      __self: this
    }, __jsx("div", {
      className: "wikidot-tethering__title",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 96
      },
      __self: this
    }, "Wikidot Account Tethering"), __jsx("div", {
      className: "wikidot-tethering__welcome",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 99
      },
      __self: this
    }, "This page allows you to tether your Wikidot Account to the account on this site.", __jsx("br", {
      __source: {
        fileName: _jsxFileName,
        lineNumber: 101
      },
      __self: this
    }), "In order to do that we'll ask you to create a page with special name that corresponds to your uniq account identificator.", __jsx("br", {
      __source: {
        fileName: _jsxFileName,
        lineNumber: 104
      },
      __self: this
    }), __jsx("br", {
      __source: {
        fileName: _jsxFileName,
        lineNumber: 105
      },
      __self: this
    }), __jsx("div", {
      className: "wikidot-tethering__action-block",
      __source: {
        fileName: _jsxFileName,
        lineNumber: 107
      },
      __self: this
    }, this.renderActionBlock()))));
  }

}

/***/ }),

/***/ "./components/extensions/collapsible/collapsible.scss":
/*!************************************************************!*\
  !*** ./components/extensions/collapsible/collapsible.scss ***!
  \************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {



/***/ }),

/***/ "./components/extensions/collapsible/collapsible.ts":
/*!**********************************************************!*\
  !*** ./components/extensions/collapsible/collapsible.ts ***!
  \**********************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return initCollapsibles; });
/* harmony import */ var _babel_runtime_corejs2_core_js_array_from__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime-corejs2/core-js/array/from */ "./node_modules/@babel/runtime-corejs2/core-js/array/from.js");
/* harmony import */ var _babel_runtime_corejs2_core_js_array_from__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs2_core_js_array_from__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _collapsible_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./collapsible.scss */ "./components/extensions/collapsible/collapsible.scss");
/* harmony import */ var _collapsible_scss__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_collapsible_scss__WEBPACK_IMPORTED_MODULE_1__);


function initCollapsibles(element) {
  element.addEventListener('click', event => {
    const target = event.target;

    if (target && _babel_runtime_corejs2_core_js_array_from__WEBPACK_IMPORTED_MODULE_0___default()(target.classList).includes('collapsible__open')) {
      target.parentElement.classList.add('collapsible_opened');
    }

    if (target && _babel_runtime_corejs2_core_js_array_from__WEBPACK_IMPORTED_MODULE_0___default()(target.classList).includes('collapsible__close')) {
      target.parentElement.classList.remove('collapsible_opened');
    }
  });
}

/***/ }),

/***/ "./components/extensions/index.tsx":
/*!*****************************************!*\
  !*** ./components/extensions/index.tsx ***!
  \*****************************************/
/*! exports provided: initCollapsibles, initTabs */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _collapsible_collapsible__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./collapsible/collapsible */ "./components/extensions/collapsible/collapsible.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initCollapsibles", function() { return _collapsible_collapsible__WEBPACK_IMPORTED_MODULE_0__["default"]; });

/* harmony import */ var _tabs_tabs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tabs/tabs */ "./components/extensions/tabs/tabs.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initTabs", function() { return _tabs_tabs__WEBPACK_IMPORTED_MODULE_1__["default"]; });




/***/ }),

/***/ "./components/extensions/tabs/tabs.scss":
/*!**********************************************!*\
  !*** ./components/extensions/tabs/tabs.scss ***!
  \**********************************************/
/*! no static exports found */
/***/ (function(module, exports) {



/***/ }),

/***/ "./components/extensions/tabs/tabs.ts":
/*!********************************************!*\
  !*** ./components/extensions/tabs/tabs.ts ***!
  \********************************************/
/*! exports provided: prepareTabsElements, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prepareTabsElements", function() { return prepareTabsElements; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return initTabs; });
/* harmony import */ var _babel_runtime_corejs2_core_js_array_from__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime-corejs2/core-js/array/from */ "./node_modules/@babel/runtime-corejs2/core-js/array/from.js");
/* harmony import */ var _babel_runtime_corejs2_core_js_array_from__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs2_core_js_array_from__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _tabs_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tabs.scss */ "./components/extensions/tabs/tabs.scss");
/* harmony import */ var _tabs_scss__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_tabs_scss__WEBPACK_IMPORTED_MODULE_1__);



function createElementFromHTML(input) {
  var template = document.createElement('template');
  template.innerHTML = input.trim();
  return template.content.firstChild;
}

function generateId() {
  return Math.random().toString(36).substring(2);
}

function prepareTabsElements(rootElement) {
  _babel_runtime_corejs2_core_js_array_from__WEBPACK_IMPORTED_MODULE_0___default()(rootElement.querySelectorAll('.tabs')).forEach(element => {
    const idSequence = [];

    const getNextId = () => {
      const id = generateId();
      idSequence.push(id);
      return id;
    };

    const titleElements = _babel_runtime_corejs2_core_js_array_from__WEBPACK_IMPORTED_MODULE_0___default()(element.querySelectorAll('.tab__title'));

    const titles = titleElements.map(e => e.innerHTML);
    let titlesHtml = '<div class="tabs__titles">';

    for (let i = 0; i < titles.length; i++) {
      titlesHtml += `<div class="tabs__title${i === 0 ? ' tabs__title_active' : ''}" data-tab-id="${getNextId()}">${titles[i]}</div>`;
    }

    titlesHtml += '</div>';
    const titlesBlock = createElementFromHTML(titlesHtml);
    element.prepend(titlesBlock);
    titleElements.map(e => e.remove());

    _babel_runtime_corejs2_core_js_array_from__WEBPACK_IMPORTED_MODULE_0___default()(element.querySelectorAll('.tab')).forEach((tabElement, i) => {
      tabElement.dataset.tabContentId = idSequence[i];

      if (i === 0) {
        tabElement.classList.add('tab_active');
      }
    });
  });
}
function initTabs(element) {
  element.addEventListener('click', event => {
    const target = event.target;

    if (target && _babel_runtime_corejs2_core_js_array_from__WEBPACK_IMPORTED_MODULE_0___default()(target.classList).includes('tabs__title')) {
      const tabsRoot = target.parentElement.parentElement;
      const tabId = target.dataset.tabId;
      const oldActiveTab = tabsRoot.querySelector('.tabs__title_active');

      if (oldActiveTab) {
        const oldTabId = oldActiveTab.dataset.tabId;
        tabsRoot.querySelector(`.tabs__title[data-tab-id="${oldTabId}"]`).classList.remove('tabs__title_active');
        tabsRoot.querySelector(`.tab[data-tab-content-id="${oldTabId}"]`).classList.remove('tab_active');
      }

      target.classList.add('tabs__title_active');
      tabsRoot.querySelector(`.tab[data-tab-content-id="${tabId}"]`).classList.add('tab_active');
    }
  });
  prepareTabsElements(element);
}

/***/ }),

/***/ "./node_modules/@babel/runtime-corejs2/core-js/array/from.js":
/*!*******************************************************************!*\
  !*** ./node_modules/@babel/runtime-corejs2/core-js/array/from.js ***!
  \*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__(/*! core-js/library/fn/array/from */ "core-js/library/fn/array/from");

/***/ }),

/***/ "./node_modules/@babel/runtime-corejs2/core-js/object/define-property.js":
/*!*******************************************************************************!*\
  !*** ./node_modules/@babel/runtime-corejs2/core-js/object/define-property.js ***!
  \*******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__(/*! core-js/library/fn/object/define-property */ "core-js/library/fn/object/define-property");

/***/ }),

/***/ "./node_modules/@babel/runtime-corejs2/helpers/esm/defineProperty.js":
/*!***************************************************************************!*\
  !*** ./node_modules/@babel/runtime-corejs2/helpers/esm/defineProperty.js ***!
  \***************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _defineProperty; });
/* harmony import */ var _core_js_object_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core-js/object/define-property */ "./node_modules/@babel/runtime-corejs2/core-js/object/define-property.js");
/* harmony import */ var _core_js_object_define_property__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_core_js_object_define_property__WEBPACK_IMPORTED_MODULE_0__);

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

  return obj;
}

/***/ }),

/***/ "./pages/wikidot/tethering.tsx":
/*!*************************************!*\
  !*** ./pages/wikidot/tethering.tsx ***!
  \*************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _components_App_App__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../components/App/App */ "./components/App/App.tsx");
/* harmony import */ var _components_Wikidot_WikidotTethering__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../components/Wikidot/WikidotTethering */ "./components/Wikidot/WikidotTethering.tsx");
var _jsxFileName = "/Users/resure/Code/terminal/pages/wikidot/tethering.tsx";
var __jsx = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement;




const WikidotTetheringPage = () => __jsx(_components_App_App__WEBPACK_IMPORTED_MODULE_1__["default"], {
  __source: {
    fileName: _jsxFileName,
    lineNumber: 6
  },
  __self: undefined
}, __jsx(_components_Wikidot_WikidotTethering__WEBPACK_IMPORTED_MODULE_2__["default"], {
  __source: {
    fileName: _jsxFileName,
    lineNumber: 7
  },
  __self: undefined
}));

/* harmony default export */ __webpack_exports__["default"] = (WikidotTetheringPage);

/***/ }),

/***/ "./utils/index.ts":
/*!************************!*\
  !*** ./utils/index.ts ***!
  \************************/
/*! exports provided: sdk */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sdk */ "./utils/sdk.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sdk", function() { return _sdk__WEBPACK_IMPORTED_MODULE_0__["default"]; });



/***/ }),

/***/ "./utils/sdk.ts":
/*!**********************!*\
  !*** ./utils/sdk.ts ***!
  \**********************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "axios");
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var next_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! next/config */ "next/config");
/* harmony import */ var next_config__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_config__WEBPACK_IMPORTED_MODULE_1__);


const {
  publicRuntimeConfig
} = next_config__WEBPACK_IMPORTED_MODULE_1___default()();
const {
  BROWSER_API_ENDPOINT,
  SERVER_API_ENDPOINT
} = publicRuntimeConfig;
const WIKI_NAME = 'scp-ru';

function getApiEndpoint() {
  if (false) {} else {
    return SERVER_API_ENDPOINT;
  }
}

/* harmony default export */ __webpack_exports__["default"] = ({
  whoami: async () => {
    const response = await axios__WEBPACK_IMPORTED_MODULE_0___default.a.get(`${getApiEndpoint()}/auth/whoami`);
    return response.data;
  },
  getWikidotPage: async pageName => {
    const url = `${getApiEndpoint()}/api/wikidot/pages/${WIKI_NAME}/${pageName.toLowerCase()}`;
    const response = await axios__WEBPACK_IMPORTED_MODULE_0___default.a.get(url);
    return response.data.page;
  },
  getRandomWikidotPageName: async () => {
    try {
      const response = await axios__WEBPACK_IMPORTED_MODULE_0___default.a.get(`${getApiEndpoint()}/api/wikidot_random_page`);
      return response.data.name;
    } catch (error) {
      console.error('Failed to get random page', error);
      throw error;
    }
  },
  tetherWikidotAccount: async () => {
    try {
      const response = await axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(`${getApiEndpoint()}/wikidot/api/tether-account`);
      return response.data && response.data.code;
    } catch (error) {
      const response = error.response;

      if (response && response.data && response.data.code) {
        return response.data.code;
      } else {
        throw error;
      }
    }
  }
});

/***/ }),

/***/ 3:
/*!*******************************************!*\
  !*** multi ./pages/wikidot/tethering.tsx ***!
  \*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__(/*! /Users/resure/Code/terminal/pages/wikidot/tethering.tsx */"./pages/wikidot/tethering.tsx");


/***/ }),

/***/ "axios":
/*!************************!*\
  !*** external "axios" ***!
  \************************/
/*! no static exports found */
/***/ (function(module, exports) {

module.exports = require("axios");

/***/ }),

/***/ "core-js/library/fn/array/from":
/*!************************************************!*\
  !*** external "core-js/library/fn/array/from" ***!
  \************************************************/
/*! no static exports found */
/***/ (function(module, exports) {

module.exports = require("core-js/library/fn/array/from");

/***/ }),

/***/ "core-js/library/fn/object/define-property":
/*!************************************************************!*\
  !*** external "core-js/library/fn/object/define-property" ***!
  \************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {

module.exports = require("core-js/library/fn/object/define-property");

/***/ }),

/***/ "next/config":
/*!******************************!*\
  !*** external "next/config" ***!
  \******************************/
/*! no static exports found */
/***/ (function(module, exports) {

module.exports = require("next/config");

/***/ }),

/***/ "next/head":
/*!****************************!*\
  !*** external "next/head" ***!
  \****************************/
/*! no static exports found */
/***/ (function(module, exports) {

module.exports = require("next/head");

/***/ }),

/***/ "react":
/*!************************!*\
  !*** external "react" ***!
  \************************/
/*! no static exports found */
/***/ (function(module, exports) {

module.exports = require("react");

/***/ })

/******/ });
//# sourceMappingURL=tethering.js.map